vskill 0.5.21 → 0.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/eval/sweep.d.ts +1 -0
- package/dist/commands/eval/sweep.js +78 -18
- package/dist/commands/eval/sweep.js.map +1 -1
- package/dist/commands/eval.d.ts +1 -0
- package/dist/commands/eval.js +1 -0
- package/dist/commands/eval.js.map +1 -1
- package/dist/eval/activation-history.d.ts +21 -0
- package/dist/eval/activation-history.js +41 -0
- package/dist/eval/activation-history.js.map +1 -0
- package/dist/eval-server/api-routes.js +104 -1
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/skill-create-routes.d.ts +11 -0
- package/dist/eval-server/skill-create-routes.js +131 -4
- package/dist/eval-server/skill-create-routes.js.map +1 -1
- package/dist/eval-server/sweep-routes.js +1 -0
- package/dist/eval-server/sweep-routes.js.map +1 -1
- package/dist/eval-server/sweep-runner.d.ts +33 -0
- package/dist/eval-server/sweep-runner.js +233 -84
- package/dist/eval-server/sweep-runner.js.map +1 -1
- package/dist/eval-ui/assets/index-BM579QSw.js +73 -0
- package/dist/eval-ui/assets/index-DcbzllbY.css +1 -0
- package/dist/eval-ui/index.html +2 -2
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-C9_Pey9T.css +0 -1
- package/dist/eval-ui/assets/index-KfkLPyh3.js +0 -74
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const x of document.querySelectorAll('link[rel="modulepreload"]'))u(x);new MutationObserver(x=>{for(const v of x)if(v.type==="childList")for(const p of v.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function o(x){const v={};return x.integrity&&(v.integrity=x.integrity),x.referrerPolicy&&(v.referrerPolicy=x.referrerPolicy),x.crossOrigin==="use-credentials"?v.credentials="include":x.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function u(x){if(x.ep)return;x.ep=!0;const v=o(x);fetch(x.href,v)}})();var Uo={exports:{}},as={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and 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 sx;function dh(){if(sx)return as;sx=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function o(u,x,v){var p=null;if(v!==void 0&&(p=""+v),x.key!==void 0&&(p=""+x.key),"key"in x){v={};for(var b in x)b!=="key"&&(v[b]=x[b])}else v=x;return x=v.ref,{$$typeof:r,type:u,key:p,ref:x!==void 0?x:null,props:v}}return as.Fragment=c,as.jsx=o,as.jsxs=o,as}var rx;function fh(){return rx||(rx=1,Uo.exports=dh()),Uo.exports}var a=fh(),Go={exports:{}},he={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and 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 ix;function xh(){if(ix)return he;ix=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),p=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),T=Symbol.iterator;function A(N){return N===null||typeof N!="object"?null:(N=T&&N[T]||N["@@iterator"],typeof N=="function"?N:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,G={};function q(N,z,V){this.props=N,this.context=z,this.refs=G,this.updater=V||L}q.prototype.isReactComponent={},q.prototype.setState=function(N,z){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,z,"setState")},q.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function J(){}J.prototype=q.prototype;function ie(N,z,V){this.props=N,this.context=z,this.refs=G,this.updater=V||L}var Z=ie.prototype=new J;Z.constructor=ie,O(Z,q.prototype),Z.isPureReactComponent=!0;var ae=Array.isArray;function ne(){}var $={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function xe(N,z,V){var P=V.ref;return{$$typeof:r,type:N,key:z,ref:P!==void 0?P:null,props:V}}function Ne(N,z){return xe(N.type,z,N.props)}function ge(N){return typeof N=="object"&&N!==null&&N.$$typeof===r}function je(N){var z={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(V){return z[V]})}var Q=/\/+/g;function ee(N,z){return typeof N=="object"&&N!==null&&N.key!=null?je(""+N.key):z.toString(36)}function me(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(ne,ne):(N.status="pending",N.then(function(z){N.status==="pending"&&(N.status="fulfilled",N.value=z)},function(z){N.status==="pending"&&(N.status="rejected",N.reason=z)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function C(N,z,V,P,I){var te=typeof N;(te==="undefined"||te==="boolean")&&(N=null);var ve=!1;if(N===null)ve=!0;else switch(te){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(N.$$typeof){case r:case c:ve=!0;break;case j:return ve=N._init,C(ve(N._payload),z,V,P,I)}}if(ve)return I=I(N),ve=P===""?"."+ee(N,0):P,ae(I)?(V="",ve!=null&&(V=ve.replace(Q,"$&/")+"/"),C(I,z,V,"",function(ut){return ut})):I!=null&&(ge(I)&&(I=Ne(I,V+(I.key==null||N&&N.key===I.key?"":(""+I.key).replace(Q,"$&/")+"/")+ve)),z.push(I)),1;ve=0;var Be=P===""?".":P+":";if(ae(N))for(var Ae=0;Ae<N.length;Ae++)P=N[Ae],te=Be+ee(P,Ae),ve+=C(P,z,V,te,I);else if(Ae=A(N),typeof Ae=="function")for(N=Ae.call(N),Ae=0;!(P=N.next()).done;)P=P.value,te=Be+ee(P,Ae++),ve+=C(P,z,V,te,I);else if(te==="object"){if(typeof N.then=="function")return C(me(N),z,V,P,I);throw z=String(N),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ve}function E(N,z,V){if(N==null)return N;var P=[],I=0;return C(N,P,"","",function(te){return z.call(V,te,I++)}),P}function K(N){if(N._status===-1){var z=N._result;z=z(),z.then(function(V){(N._status===0||N._status===-1)&&(N._status=1,N._result=V)},function(V){(N._status===0||N._status===-1)&&(N._status=2,N._result=V)}),N._status===-1&&(N._status=0,N._result=z)}if(N._status===1)return N._result.default;throw N._result}var W=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},oe={map:E,forEach:function(N,z,V){E(N,function(){z.apply(this,arguments)},V)},count:function(N){var z=0;return E(N,function(){z++}),z},toArray:function(N){return E(N,function(z){return z})||[]},only:function(N){if(!ge(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return he.Activity=y,he.Children=oe,he.Component=q,he.Fragment=o,he.Profiler=x,he.PureComponent=ie,he.StrictMode=u,he.Suspense=g,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,he.__COMPILER_RUNTIME={__proto__:null,c:function(N){return $.H.useMemoCache(N)}},he.cache=function(N){return function(){return N.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(N,z,V){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var P=O({},N.props),I=N.key;if(z!=null)for(te in z.key!==void 0&&(I=""+z.key),z)!F.call(z,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&z.ref===void 0||(P[te]=z[te]);var te=arguments.length-2;if(te===1)P.children=V;else if(1<te){for(var ve=Array(te),Be=0;Be<te;Be++)ve[Be]=arguments[Be+2];P.children=ve}return xe(N.type,I,P)},he.createContext=function(N){return N={$$typeof:p,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:v,_context:N},N},he.createElement=function(N,z,V){var P,I={},te=null;if(z!=null)for(P in z.key!==void 0&&(te=""+z.key),z)F.call(z,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(I[P]=z[P]);var ve=arguments.length-2;if(ve===1)I.children=V;else if(1<ve){for(var Be=Array(ve),Ae=0;Ae<ve;Ae++)Be[Ae]=arguments[Ae+2];I.children=Be}if(N&&N.defaultProps)for(P in ve=N.defaultProps,ve)I[P]===void 0&&(I[P]=ve[P]);return xe(N,te,I)},he.createRef=function(){return{current:null}},he.forwardRef=function(N){return{$$typeof:b,render:N}},he.isValidElement=ge,he.lazy=function(N){return{$$typeof:j,_payload:{_status:-1,_result:N},_init:K}},he.memo=function(N,z){return{$$typeof:f,type:N,compare:z===void 0?null:z}},he.startTransition=function(N){var z=$.T,V={};$.T=V;try{var P=N(),I=$.S;I!==null&&I(V,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(ne,W)}catch(te){W(te)}finally{z!==null&&V.types!==null&&(z.types=V.types),$.T=z}},he.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},he.use=function(N){return $.H.use(N)},he.useActionState=function(N,z,V){return $.H.useActionState(N,z,V)},he.useCallback=function(N,z){return $.H.useCallback(N,z)},he.useContext=function(N){return $.H.useContext(N)},he.useDebugValue=function(){},he.useDeferredValue=function(N,z){return $.H.useDeferredValue(N,z)},he.useEffect=function(N,z){return $.H.useEffect(N,z)},he.useEffectEvent=function(N){return $.H.useEffectEvent(N)},he.useId=function(){return $.H.useId()},he.useImperativeHandle=function(N,z,V){return $.H.useImperativeHandle(N,z,V)},he.useInsertionEffect=function(N,z){return $.H.useInsertionEffect(N,z)},he.useLayoutEffect=function(N,z){return $.H.useLayoutEffect(N,z)},he.useMemo=function(N,z){return $.H.useMemo(N,z)},he.useOptimistic=function(N,z){return $.H.useOptimistic(N,z)},he.useReducer=function(N,z,V){return $.H.useReducer(N,z,V)},he.useRef=function(N){return $.H.useRef(N)},he.useState=function(N){return $.H.useState(N)},he.useSyncExternalStore=function(N,z,V){return $.H.useSyncExternalStore(N,z,V)},he.useTransition=function(){return $.H.useTransition()},he.version="19.2.4",he}var ox;function ic(){return ox||(ox=1,Go.exports=xh()),Go.exports}var h=ic(),qo={exports:{}},ns={},Yo={exports:{}},Vo={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and 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
|
+
*/var cx;function ph(){return cx||(cx=1,(function(r){function c(C,E){var K=C.length;C.push(E);e:for(;0<K;){var W=K-1>>>1,oe=C[W];if(0<x(oe,E))C[W]=E,C[K]=oe,K=W;else break e}}function o(C){return C.length===0?null:C[0]}function u(C){if(C.length===0)return null;var E=C[0],K=C.pop();if(K!==E){C[0]=K;e:for(var W=0,oe=C.length,N=oe>>>1;W<N;){var z=2*(W+1)-1,V=C[z],P=z+1,I=C[P];if(0>x(V,K))P<oe&&0>x(I,V)?(C[W]=I,C[P]=K,W=P):(C[W]=V,C[z]=K,W=z);else if(P<oe&&0>x(I,K))C[W]=I,C[P]=K,W=P;else break e}}return E}function x(C,E){var K=C.sortIndex-E.sortIndex;return K!==0?K:C.id-E.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;r.unstable_now=function(){return v.now()}}else{var p=Date,b=p.now();r.unstable_now=function(){return p.now()-b}}var g=[],f=[],j=1,y=null,T=3,A=!1,L=!1,O=!1,G=!1,q=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,ie=typeof setImmediate<"u"?setImmediate:null;function Z(C){for(var E=o(f);E!==null;){if(E.callback===null)u(f);else if(E.startTime<=C)u(f),E.sortIndex=E.expirationTime,c(g,E);else break;E=o(f)}}function ae(C){if(O=!1,Z(C),!L)if(o(g)!==null)L=!0,ne||(ne=!0,je());else{var E=o(f);E!==null&&me(ae,E.startTime-C)}}var ne=!1,$=-1,F=5,xe=-1;function Ne(){return G?!0:!(r.unstable_now()-xe<F)}function ge(){if(G=!1,ne){var C=r.unstable_now();xe=C;var E=!0;try{e:{L=!1,O&&(O=!1,J($),$=-1),A=!0;var K=T;try{t:{for(Z(C),y=o(g);y!==null&&!(y.expirationTime>C&&Ne());){var W=y.callback;if(typeof W=="function"){y.callback=null,T=y.priorityLevel;var oe=W(y.expirationTime<=C);if(C=r.unstable_now(),typeof oe=="function"){y.callback=oe,Z(C),E=!0;break t}y===o(g)&&u(g),Z(C)}else u(g);y=o(g)}if(y!==null)E=!0;else{var N=o(f);N!==null&&me(ae,N.startTime-C),E=!1}}break e}finally{y=null,T=K,A=!1}E=void 0}}finally{E?je():ne=!1}}}var je;if(typeof ie=="function")je=function(){ie(ge)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ee=Q.port2;Q.port1.onmessage=ge,je=function(){ee.postMessage(null)}}else je=function(){q(ge,0)};function me(C,E){$=q(function(){C(r.unstable_now())},E)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(C){C.callback=null},r.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<C?Math.floor(1e3/C):5},r.unstable_getCurrentPriorityLevel=function(){return T},r.unstable_next=function(C){switch(T){case 1:case 2:case 3:var E=3;break;default:E=T}var K=T;T=E;try{return C()}finally{T=K}},r.unstable_requestPaint=function(){G=!0},r.unstable_runWithPriority=function(C,E){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var K=T;T=C;try{return E()}finally{T=K}},r.unstable_scheduleCallback=function(C,E,K){var W=r.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?W+K:W):K=W,C){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=K+oe,C={id:j++,callback:E,priorityLevel:C,startTime:K,expirationTime:oe,sortIndex:-1},K>W?(C.sortIndex=K,c(f,C),o(g)===null&&C===o(f)&&(O?(J($),$=-1):O=!0,me(ae,K-W))):(C.sortIndex=oe,c(g,C),L||A||(L=!0,ne||(ne=!0,je()))),C},r.unstable_shouldYield=Ne,r.unstable_wrapCallback=function(C){var E=T;return function(){var K=T;T=E;try{return C.apply(this,arguments)}finally{T=K}}}})(Vo)),Vo}var ux;function mh(){return ux||(ux=1,Yo.exports=ph()),Yo.exports}var Qo={exports:{}},jt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and 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 dx;function hh(){if(dx)return jt;dx=1;var r=ic();function c(g){var f="https://react.dev/errors/"+g;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)f+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+g+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(c(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},x=Symbol.for("react.portal");function v(g,f,j){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x,key:y==null?null:""+y,children:g,containerInfo:f,implementation:j}}var p=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(g,f){if(g==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,jt.createPortal=function(g,f){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(c(299));return v(g,f,null,j)},jt.flushSync=function(g){var f=p.T,j=u.p;try{if(p.T=null,u.p=2,g)return g()}finally{p.T=f,u.p=j,u.d.f()}},jt.preconnect=function(g,f){typeof g=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,u.d.C(g,f))},jt.prefetchDNS=function(g){typeof g=="string"&&u.d.D(g)},jt.preinit=function(g,f){if(typeof g=="string"&&f&&typeof f.as=="string"){var j=f.as,y=b(j,f.crossOrigin),T=typeof f.integrity=="string"?f.integrity:void 0,A=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;j==="style"?u.d.S(g,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:y,integrity:T,fetchPriority:A}):j==="script"&&u.d.X(g,{crossOrigin:y,integrity:T,fetchPriority:A,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},jt.preinitModule=function(g,f){if(typeof g=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var j=b(f.as,f.crossOrigin);u.d.M(g,{crossOrigin:j,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&u.d.M(g)},jt.preload=function(g,f){if(typeof g=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var j=f.as,y=b(j,f.crossOrigin);u.d.L(g,j,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},jt.preloadModule=function(g,f){if(typeof g=="string")if(f){var j=b(f.as,f.crossOrigin);u.d.m(g,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:j,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else u.d.m(g)},jt.requestFormReset=function(g){u.d.r(g)},jt.unstable_batchedUpdates=function(g,f){return g(f)},jt.useFormState=function(g,f,j){return p.H.useFormState(g,f,j)},jt.useFormStatus=function(){return p.H.useHostTransitionStatus()},jt.version="19.2.4",jt}var fx;function vh(){if(fx)return Qo.exports;fx=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),Qo.exports=hh(),Qo.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var xx;function yh(){if(xx)return ns;xx=1;var r=mh(),c=ic(),o=vh();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}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."}function x(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function p(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 b(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(v(e)!==e)throw Error(u(188))}function f(e){var t=e.alternate;if(!t){if(t=v(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,n=t;;){var s=l.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){l=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===l)return g(s),e;if(i===n)return g(s),t;i=i.sibling}throw Error(u(188))}if(l.return!==n.return)l=s,n=i;else{for(var d=!1,m=s.child;m;){if(m===l){d=!0,l=s,n=i;break}if(m===n){d=!0,n=s,l=i;break}m=m.sibling}if(!d){for(m=i.child;m;){if(m===l){d=!0,l=i,n=s;break}if(m===n){d=!0,n=i,l=s;break}m=m.sibling}if(!d)throw Error(u(189))}}if(l.alternate!==n)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,T=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),ie=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),Ne=Symbol.for("react.memo_cache_sentinel"),ge=Symbol.iterator;function je(e){return e===null||typeof e!="object"?null:(e=ge&&e[ge]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case q:return"Profiler";case G:return"StrictMode";case ae:return"Suspense";case ne:return"SuspenseList";case xe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case L:return"Portal";case ie:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var me=Array.isArray,C=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},W=[],oe=-1;function N(e){return{current:e}}function z(e){0>oe||(e.current=W[oe],W[oe]=null,oe--)}function V(e,t){oe++,W[oe]=e.current,e.current=t}var P=N(null),I=N(null),te=N(null),ve=N(null);function Be(e,t){switch(V(te,t),V(I,e),V(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wf(t),e=Af(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}z(P),V(P,e)}function Ae(){z(P),z(I),z(te)}function ut(e){e.memoizedState!==null&&V(ve,e);var t=P.current,l=Af(t,e.type);t!==l&&(V(I,e),V(P,l))}function zt(e){I.current===e&&(z(P),z(I)),ve.current===e&&(z(ve),Pn._currentValue=K)}var X,se;function le(e){if(X===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);X=t&&t[1]||"",se=-1<l.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+X+e+se}var de=!1;function pe(e,t){if(!e||de)return"";de=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(D){var M=D}Reflect.construct(e,[],U)}else{try{U.call()}catch(D){M=D}e.call(U.prototype)}}else{try{throw Error()}catch(D){M=D}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(D){if(D&&M&&typeof D.stack=="string")return[D.stack,M.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),d=i[0],m=i[1];if(d&&m){var S=d.split(`
|
|
44
|
+
`),_=m.split(`
|
|
45
|
+
`);for(s=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(n===S.length||s===_.length)for(n=S.length-1,s=_.length-1;1<=n&&0<=s&&S[n]!==_[s];)s--;for(;1<=n&&0<=s;n--,s--)if(S[n]!==_[s]){if(n!==1||s!==1)do if(n--,s--,0>s||S[n]!==_[s]){var B=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=n&&0<=s);break}}}finally{de=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?le(l):""}function Ve(e,t){switch(e.tag){case 26:case 27:case 5:return le(e.type);case 16:return le("Lazy");case 13:return e.child!==t&&t!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("SuspenseList");case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return le("Activity");default:return""}}function dt(e){try{var t="",l=null;do t+=Ve(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var Xe=Object.prototype.hasOwnProperty,Lt=r.unstable_scheduleCallback,mt=r.unstable_cancelCallback,tl=r.unstable_shouldYield,Qt=r.unstable_requestPaint,We=r.unstable_now,Dt=r.unstable_getCurrentPriorityLevel,Y=r.unstable_ImmediatePriority,Me=r.unstable_UserBlockingPriority,at=r.unstable_NormalPriority,Je=r.unstable_LowPriority,Rl=r.unstable_IdlePriority,Ot=r.log,sa=r.unstable_setDisableYieldValue,Et=null,Fe=null;function nt(e){if(typeof Ot=="function"&&sa(e),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(Et,e)}catch{}}var et=Math.clz32?Math.clz32:al,ll=Math.log,Qe=Math.LN2;function al(e){return e>>>=0,e===0?32:31-(ll(e)/Qe|0)|0}var st=256,qe=262144,_l=4194304;function kt(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ea(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var m=n&134217727;return m!==0?(n=m&~i,n!==0?s=kt(n):(d&=m,d!==0?s=kt(d):l||(l=m&~e,l!==0&&(s=kt(l))))):(m=n&~i,m!==0?s=kt(m):d!==0?s=kt(d):l||(l=n&~e,l!==0&&(s=kt(l)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:s}function fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ix(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oc(){var e=_l;return _l<<=1,(_l&62914560)===0&&(_l=4194304),e}function Tr(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Px(e,t,l,n,s,i){var d=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var m=e.entanglements,S=e.expirationTimes,_=e.hiddenUpdates;for(l=d&~l;0<l;){var B=31-et(l),U=1<<B;m[B]=0,S[B]=-1;var M=_[B];if(M!==null)for(_[B]=null,B=0;B<M.length;B++){var D=M[B];D!==null&&(D.lane&=-536870913)}l&=~U}n!==0&&cc(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function cc(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-et(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function uc(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-et(l),s=1<<n;s&t|e[n]&t&&(e[n]|=t),l&=~s}}function dc(e,t){var l=t&-t;return l=(l&42)!==0?1:Cr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Cr(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function wr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function fc(){var e=E.p;return e!==0?e:(e=window.event,e===void 0?32:If(e.type))}function xc(e,t){var l=E.p;try{return E.p=e,t()}finally{E.p=l}}var Ml=Math.random().toString(36).slice(2),ht="__reactFiber$"+Ml,Tt="__reactProps$"+Ml,ka="__reactContainer$"+Ml,Ar="__reactEvents$"+Ml,ep="__reactListeners$"+Ml,tp="__reactHandles$"+Ml,pc="__reactResources$"+Ml,pn="__reactMarker$"+Ml;function Rr(e){delete e[ht],delete e[Tt],delete e[Ar],delete e[ep],delete e[tp]}function Ta(e){var t=e[ht];if(t)return t;for(var l=e.parentNode;l;){if(t=l[ka]||l[ht]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Of(e);e!==null;){if(l=e[ht])return l;e=Of(e)}return t}e=l,l=e.parentNode}return null}function Ca(e){if(e=e[ht]||e[ka]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function wa(e){var t=e[pc];return t||(t=e[pc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[pn]=!0}var mc=new Set,hc={};function ra(e,t){Aa(e,t),Aa(e+"Capture",t)}function Aa(e,t){for(hc[e]=t,e=0;e<t.length;e++)mc.add(t[e])}var lp=RegExp("^[: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]*$"),vc={},yc={};function ap(e){return Xe.call(yc,e)?!0:Xe.call(vc,e)?!1:lp.test(e)?yc[e]=!0:(vc[e]=!0,!1)}function rs(e,t,l){if(ap(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function is(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function fl(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function np(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){l=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=gc(e)?"checked":"value";e._valueTracker=np(e,t,""+e[t])}}function bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=gc(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function os(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}}var sp=/[\n"\\]/g;function Zt(e){return e.replace(sp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mr(e,t,l,n,s,i,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?zr(e,d,Xt(t)):l!=null?zr(e,d,Xt(l)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Xt(m):e.removeAttribute("name")}function jc(e,t,l,n,s,i,d,m){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){_r(e);return}l=l!=null?""+Xt(l):"",t=t!=null?""+Xt(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=m?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),_r(e)}function zr(e,t,l){t==="number"&&os(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ra(e,t,l,n){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Xt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Sc(e,t,l){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Xt(l):""}function Nc(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(me(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Xt(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),_r(e)}function _a(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var rp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ec(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||rp.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function kc(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&l[s]!==n&&Ec(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&Ec(e,i,t[i])}function Lr(e){if(e.indexOf("-")===-1)return!1;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 ip=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),op=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cs(e){return op.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xl(){}var Dr=null;function Or(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,za=null;function Tc(e){var t=Ca(e);if(t&&(e=t.stateNode)){var l=e[Tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Mr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var s=n[Tt]||null;if(!s)throw Error(u(90));Mr(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&bc(n)}break e;case"textarea":Sc(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ra(e,!!l.multiple,t,!1)}}}var Br=!1;function Cc(e,t,l){if(Br)return e(t,l);Br=!0;try{var n=e(t);return n}finally{if(Br=!1,(Ma!==null||za!==null)&&(Ws(),Ma&&(t=Ma,e=za,za=Ma=null,Tc(t),e)))for(t=0;t<e.length;t++)Tc(e[t])}}function hn(e,t){var l=e.stateNode;if(l===null)return null;var n=l[Tt]||null;if(n===null)return null;l=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var pl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hr=!1;if(pl)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Hr=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Hr=!1}var zl=null,Ur=null,us=null;function wc(){if(us)return us;var e,t=Ur,l=t.length,n,s="value"in zl?zl.value:zl.textContent,i=s.length;for(e=0;e<l&&t[e]===s[e];e++);var d=l-e;for(n=1;n<=d&&t[l-n]===s[i-n];n++);return us=s.slice(e,1<n?1-n:void 0)}function ds(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 fs(){return!0}function Ac(){return!1}function Ct(e){function t(l,n,s,i,d){this._reactName=l,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(i):i[m]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?fs:Ac,this.isPropagationStopped=Ac,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xs=Ct(ia),yn=y({},ia,{view:0,detail:0}),cp=Ct(yn),Gr,qr,gn,ps=y({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vr,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!==gn&&(gn&&e.type==="mousemove"?(Gr=e.screenX-gn.screenX,qr=e.screenY-gn.screenY):qr=Gr=0,gn=e),Gr)},movementY:function(e){return"movementY"in e?e.movementY:qr}}),Rc=Ct(ps),up=y({},ps,{dataTransfer:0}),dp=Ct(up),fp=y({},yn,{relatedTarget:0}),Yr=Ct(fp),xp=y({},ia,{animationName:0,elapsedTime:0,pseudoElement:0}),pp=Ct(xp),mp=y({},ia,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hp=Ct(mp),vp=y({},ia,{data:0}),_c=Ct(vp),yp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gp={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"},bp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bp[e])?!!t[e]:!1}function Vr(){return jp}var Sp=y({},yn,{key:function(e){if(e.key){var t=yp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vr,charCode:function(e){return e.type==="keypress"?ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Np=Ct(Sp),Ep=y({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mc=Ct(Ep),kp=y({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vr}),Tp=Ct(kp),Cp=y({},ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),wp=Ct(Cp),Ap=y({},ps,{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}),Rp=Ct(Ap),_p=y({},ia,{newState:0,oldState:0}),Mp=Ct(_p),zp=[9,13,27,32],Qr=pl&&"CompositionEvent"in window,bn=null;pl&&"documentMode"in document&&(bn=document.documentMode);var Lp=pl&&"TextEvent"in window&&!bn,zc=pl&&(!Qr||bn&&8<bn&&11>=bn),Lc=" ",Dc=!1;function Oc(e,t){switch(e){case"keyup":return zp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var La=!1;function Dp(e,t){switch(e){case"compositionend":return Bc(t);case"keypress":return t.which!==32?null:(Dc=!0,Lc);case"textInput":return e=t.data,e===Lc&&Dc?null:e;default:return null}}function Op(e,t){if(La)return e==="compositionend"||!Qr&&Oc(e,t)?(e=wc(),us=Ur=zl=null,La=!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 zc&&t.locale!=="ko"?null:t.data;default:return null}}var Bp={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 Hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Bp[e.type]:t==="textarea"}function Uc(e,t,l,n){Ma?za?za.push(n):za=[n]:Ma=n,t=ar(t,"onChange"),0<t.length&&(l=new xs("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var jn=null,Sn=null;function Hp(e){Sf(e,0)}function ms(e){var t=mn(e);if(bc(t))return e}function Gc(e,t){if(e==="change")return t}var qc=!1;if(pl){var Xr;if(pl){var Zr="oninput"in document;if(!Zr){var Yc=document.createElement("div");Yc.setAttribute("oninput","return;"),Zr=typeof Yc.oninput=="function"}Xr=Zr}else Xr=!1;qc=Xr&&(!document.documentMode||9<document.documentMode)}function Vc(){jn&&(jn.detachEvent("onpropertychange",Qc),Sn=jn=null)}function Qc(e){if(e.propertyName==="value"&&ms(Sn)){var t=[];Uc(t,Sn,e,Or(e)),Cc(Hp,t)}}function Up(e,t,l){e==="focusin"?(Vc(),jn=t,Sn=l,jn.attachEvent("onpropertychange",Qc)):e==="focusout"&&Vc()}function Gp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ms(Sn)}function qp(e,t){if(e==="click")return ms(t)}function Yp(e,t){if(e==="input"||e==="change")return ms(t)}function Vp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bt=typeof Object.is=="function"?Object.is:Vp;function Nn(e,t){if(Bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var s=l[n];if(!Xe.call(t,s)||!Bt(e[s],t[s]))return!1}return!0}function Xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zc(e,t){var l=Xc(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xc(l)}}function Kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $c(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=os(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=os(e.document)}return t}function Kr(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")}var Qp=pl&&"documentMode"in document&&11>=document.documentMode,Da=null,$r=null,En=null,Jr=!1;function Jc(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||Da==null||Da!==os(n)||(n=Da,"selectionStart"in n&&Kr(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),En&&Nn(En,n)||(En=n,n=ar($r,"onSelect"),0<n.length&&(t=new xs("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Da)))}function oa(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Oa={animationend:oa("Animation","AnimationEnd"),animationiteration:oa("Animation","AnimationIteration"),animationstart:oa("Animation","AnimationStart"),transitionrun:oa("Transition","TransitionRun"),transitionstart:oa("Transition","TransitionStart"),transitioncancel:oa("Transition","TransitionCancel"),transitionend:oa("Transition","TransitionEnd")},Wr={},Wc={};pl&&(Wc=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function ca(e){if(Wr[e])return Wr[e];if(!Oa[e])return e;var t=Oa[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in Wc)return Wr[e]=t[l];return e}var Fc=ca("animationend"),Ic=ca("animationiteration"),Pc=ca("animationstart"),Xp=ca("transitionrun"),Zp=ca("transitionstart"),Kp=ca("transitioncancel"),eu=ca("transitionend"),tu=new Map,Fr="abort auxClick beforeToggle 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(" ");Fr.push("scrollEnd");function nl(e,t){tu.set(e,t),ra(t,[e])}var hs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Kt=[],Ba=0,Ir=0;function vs(){for(var e=Ba,t=Ir=Ba=0;t<e;){var l=Kt[t];Kt[t++]=null;var n=Kt[t];Kt[t++]=null;var s=Kt[t];Kt[t++]=null;var i=Kt[t];if(Kt[t++]=null,n!==null&&s!==null){var d=n.pending;d===null?s.next=s:(s.next=d.next,d.next=s),n.pending=s}i!==0&&lu(l,s,i)}}function ys(e,t,l,n){Kt[Ba++]=e,Kt[Ba++]=t,Kt[Ba++]=l,Kt[Ba++]=n,Ir|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Pr(e,t,l,n){return ys(e,t,l,n),gs(e)}function ua(e,t){return ys(e,null,null,t),gs(e)}function lu(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var s=!1,i=e.return;i!==null;)i.childLanes|=l,n=i.alternate,n!==null&&(n.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-et(l),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=l|536870912),i):null}function gs(e){if(50<Zn)throw Zn=0,oo=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ha={};function $p(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,l,n){return new $p(e,t,l,n)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ml(e,t){var l=e.alternate;return l===null?(l=Ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function au(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function bs(e,t,l,n,s,i){var d=0;if(n=e,typeof e=="function")ei(e)&&(d=1);else if(typeof e=="string")d=Pm(e,l,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case xe:return e=Ht(31,l,t,s),e.elementType=xe,e.lanes=i,e;case O:return da(l.children,s,i,t);case G:d=8,s|=24;break;case q:return e=Ht(12,l,t,s|2),e.elementType=q,e.lanes=i,e;case ae:return e=Ht(13,l,t,s),e.elementType=ae,e.lanes=i,e;case ne:return e=Ht(19,l,t,s),e.elementType=ne,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ie:d=10;break e;case J:d=9;break e;case Z:d=11;break e;case $:d=14;break e;case F:d=16,n=null;break e}d=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Ht(d,l,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function da(e,t,l,n){return e=Ht(7,e,n,t),e.lanes=l,e}function ti(e,t,l){return e=Ht(6,e,null,t),e.lanes=l,e}function nu(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function li(e,t,l){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var su=new WeakMap;function $t(e,t){if(typeof e=="object"&&e!==null){var l=su.get(e);return l!==void 0?l:(t={value:e,source:t,stack:dt(t)},su.set(e,t),t)}return{value:e,source:t,stack:dt(t)}}var Ua=[],Ga=0,js=null,kn=0,Jt=[],Wt=0,Ll=null,ol=1,cl="";function hl(e,t){Ua[Ga++]=kn,Ua[Ga++]=js,js=e,kn=t}function ru(e,t,l){Jt[Wt++]=ol,Jt[Wt++]=cl,Jt[Wt++]=Ll,Ll=e;var n=ol;e=cl;var s=32-et(n)-1;n&=~(1<<s),l+=1;var i=32-et(t)+s;if(30<i){var d=s-s%5;i=(n&(1<<d)-1).toString(32),n>>=d,s-=d,ol=1<<32-et(t)+s|l<<s|n,cl=i+e}else ol=1<<i|l<<s|n,cl=e}function ai(e){e.return!==null&&(hl(e,1),ru(e,1,0))}function ni(e){for(;e===js;)js=Ua[--Ga],Ua[Ga]=null,kn=Ua[--Ga],Ua[Ga]=null;for(;e===Ll;)Ll=Jt[--Wt],Jt[Wt]=null,cl=Jt[--Wt],Jt[Wt]=null,ol=Jt[--Wt],Jt[Wt]=null}function iu(e,t){Jt[Wt++]=ol,Jt[Wt++]=cl,Jt[Wt++]=Ll,ol=t.id,cl=t.overflow,Ll=e}var vt=null,Ze=null,we=!1,Dl=null,Ft=!1,si=Error(u(519));function Ol(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tn($t(t,e)),si}function ou(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[ht]=e,t[Tt]=n,l){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(l=0;l<$n.length;l++)ke($n[l],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),jc(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Nc(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||Tf(t.textContent,l)?(n.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),n.onScroll!=null&&ke("scroll",t),n.onScrollEnd!=null&&ke("scrollend",t),n.onClick!=null&&(t.onclick=xl),t=!0):t=!1,t||Ol(e,!0)}function cu(e){for(vt=e.return;vt;)switch(vt.tag){case 5:case 31:case 13:Ft=!1;return;case 27:case 3:Ft=!0;return;default:vt=vt.return}}function qa(e){if(e!==vt)return!1;if(!we)return cu(e),we=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Eo(e.type,e.memoizedProps)),l=!l),l&&Ze&&Ol(e),cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ze=Df(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Ze=Df(e)}else t===27?(t=Ze,Wl(e.type)?(e=Ao,Ao=null,Ze=e):Ze=t):Ze=vt?Pt(e.stateNode.nextSibling):null;return!0}function fa(){Ze=vt=null,we=!1}function ri(){var e=Dl;return e!==null&&(_t===null?_t=e:_t.push.apply(_t,e),Dl=null),e}function Tn(e){Dl===null?Dl=[e]:Dl.push(e)}var ii=N(null),xa=null,vl=null;function Bl(e,t,l){V(ii,t._currentValue),t._currentValue=l}function yl(e){e._currentValue=ii.current,z(ii)}function oi(e,t,l){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var d=s.child;i=i.firstContext;e:for(;i!==null;){var m=i;i=s;for(var S=0;S<t.length;S++)if(m.context===t[S]){i.lanes|=l,m=i.alternate,m!==null&&(m.lanes|=l),oi(i.return,l,e),n||(d=null);break e}i=m.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(u(341));d.lanes|=l,i=d.alternate,i!==null&&(i.lanes|=l),oi(d,l,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Ya(e,t,l,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var m=s.type;Bt(s.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(s===ve.current){if(d=s.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}s=s.return}e!==null&&ci(t,e,l,n),t.flags|=262144}function Ss(e){for(e=e.firstContext;e!==null;){if(!Bt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pa(e){xa=e,vl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return uu(xa,e)}function Ns(e,t){return xa===null&&pa(e),uu(e,t)}function uu(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},vl===null){if(e===null)throw Error(u(308));vl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vl=vl.next=t;return l}var Jp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Wp=r.unstable_scheduleCallback,Fp=r.unstable_NormalPriority,rt={$$typeof:ie,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ui(){return{controller:new Jp,data:new Map,refCount:0}}function Cn(e){e.refCount--,e.refCount===0&&Wp(Fp,function(){e.controller.abort()})}var wn=null,di=0,Va=0,Qa=null;function Ip(e,t){if(wn===null){var l=wn=[];di=0,Va=mo(),Qa={status:"pending",value:void 0,then:function(n){l.push(n)}}}return di++,t.then(du,du),t}function du(){if(--di===0&&wn!==null){Qa!==null&&(Qa.status="fulfilled");var e=wn;wn=null,Va=0,Qa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pp(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),n}var fu=C.S;C.S=function(e,t){Jd=We(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ip(e,t),fu!==null&&fu(e,t)};var ma=N(null);function fi(){var e=ma.current;return e!==null?e:Ye.pooledCache}function Es(e,t){t===null?V(ma,ma.current):V(ma,t.pool)}function xu(){var e=fi();return e===null?null:{parent:rt._currentValue,pool:e}}var Xa=Error(u(460)),xi=Error(u(474)),ks=Error(u(542)),Ts={then:function(){}};function pu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mu(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(xl,xl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vu(e),e;default:if(typeof t.status=="string")t.then(xl,xl);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vu(e),e}throw va=t,Xa}}function ha(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(va=l,Xa):l}}var va=null;function hu(){if(va===null)throw Error(u(459));var e=va;return va=null,e}function vu(e){if(e===Xa||e===ks)throw Error(u(483))}var Za=null,An=0;function Cs(e){var t=An;return An+=1,Za===null&&(Za=[]),mu(Za,e,t)}function Rn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===T?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function yu(e){function t(w,k){if(e){var R=w.deletions;R===null?(w.deletions=[k],w.flags|=16):R.push(k)}}function l(w,k){if(!e)return null;for(;k!==null;)t(w,k),k=k.sibling;return null}function n(w){for(var k=new Map;w!==null;)w.key!==null?k.set(w.key,w):k.set(w.index,w),w=w.sibling;return k}function s(w,k){return w=ml(w,k),w.index=0,w.sibling=null,w}function i(w,k,R){return w.index=R,e?(R=w.alternate,R!==null?(R=R.index,R<k?(w.flags|=67108866,k):R):(w.flags|=67108866,k)):(w.flags|=1048576,k)}function d(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function m(w,k,R,H){return k===null||k.tag!==6?(k=ti(R,w.mode,H),k.return=w,k):(k=s(k,R),k.return=w,k)}function S(w,k,R,H){var ue=R.type;return ue===O?B(w,k,R.props.children,H,R.key):k!==null&&(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===F&&ha(ue)===k.type)?(k=s(k,R.props),Rn(k,R),k.return=w,k):(k=bs(R.type,R.key,R.props,null,w.mode,H),Rn(k,R),k.return=w,k)}function _(w,k,R,H){return k===null||k.tag!==4||k.stateNode.containerInfo!==R.containerInfo||k.stateNode.implementation!==R.implementation?(k=li(R,w.mode,H),k.return=w,k):(k=s(k,R.children||[]),k.return=w,k)}function B(w,k,R,H,ue){return k===null||k.tag!==7?(k=da(R,w.mode,H,ue),k.return=w,k):(k=s(k,R),k.return=w,k)}function U(w,k,R){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ti(""+k,w.mode,R),k.return=w,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case A:return R=bs(k.type,k.key,k.props,null,w.mode,R),Rn(R,k),R.return=w,R;case L:return k=li(k,w.mode,R),k.return=w,k;case F:return k=ha(k),U(w,k,R)}if(me(k)||je(k))return k=da(k,w.mode,R,null),k.return=w,k;if(typeof k.then=="function")return U(w,Cs(k),R);if(k.$$typeof===ie)return U(w,Ns(w,k),R);ws(w,k)}return null}function M(w,k,R,H){var ue=k!==null?k.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ue!==null?null:m(w,k,""+R,H);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case A:return R.key===ue?S(w,k,R,H):null;case L:return R.key===ue?_(w,k,R,H):null;case F:return R=ha(R),M(w,k,R,H)}if(me(R)||je(R))return ue!==null?null:B(w,k,R,H,null);if(typeof R.then=="function")return M(w,k,Cs(R),H);if(R.$$typeof===ie)return M(w,k,Ns(w,R),H);ws(w,R)}return null}function D(w,k,R,H,ue){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return w=w.get(R)||null,m(k,w,""+H,ue);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return w=w.get(H.key===null?R:H.key)||null,S(k,w,H,ue);case L:return w=w.get(H.key===null?R:H.key)||null,_(k,w,H,ue);case F:return H=ha(H),D(w,k,R,H,ue)}if(me(H)||je(H))return w=w.get(R)||null,B(k,w,H,ue,null);if(typeof H.then=="function")return D(w,k,R,Cs(H),ue);if(H.$$typeof===ie)return D(w,k,R,Ns(k,H),ue);ws(k,H)}return null}function re(w,k,R,H){for(var ue=null,Re=null,ce=k,be=k=0,Ce=null;ce!==null&&be<R.length;be++){ce.index>be?(Ce=ce,ce=null):Ce=ce.sibling;var _e=M(w,ce,R[be],H);if(_e===null){ce===null&&(ce=Ce);break}e&&ce&&_e.alternate===null&&t(w,ce),k=i(_e,k,be),Re===null?ue=_e:Re.sibling=_e,Re=_e,ce=Ce}if(be===R.length)return l(w,ce),we&&hl(w,be),ue;if(ce===null){for(;be<R.length;be++)ce=U(w,R[be],H),ce!==null&&(k=i(ce,k,be),Re===null?ue=ce:Re.sibling=ce,Re=ce);return we&&hl(w,be),ue}for(ce=n(ce);be<R.length;be++)Ce=D(ce,w,be,R[be],H),Ce!==null&&(e&&Ce.alternate!==null&&ce.delete(Ce.key===null?be:Ce.key),k=i(Ce,k,be),Re===null?ue=Ce:Re.sibling=Ce,Re=Ce);return e&&ce.forEach(function(ta){return t(w,ta)}),we&&hl(w,be),ue}function fe(w,k,R,H){if(R==null)throw Error(u(151));for(var ue=null,Re=null,ce=k,be=k=0,Ce=null,_e=R.next();ce!==null&&!_e.done;be++,_e=R.next()){ce.index>be?(Ce=ce,ce=null):Ce=ce.sibling;var ta=M(w,ce,_e.value,H);if(ta===null){ce===null&&(ce=Ce);break}e&&ce&&ta.alternate===null&&t(w,ce),k=i(ta,k,be),Re===null?ue=ta:Re.sibling=ta,Re=ta,ce=Ce}if(_e.done)return l(w,ce),we&&hl(w,be),ue;if(ce===null){for(;!_e.done;be++,_e=R.next())_e=U(w,_e.value,H),_e!==null&&(k=i(_e,k,be),Re===null?ue=_e:Re.sibling=_e,Re=_e);return we&&hl(w,be),ue}for(ce=n(ce);!_e.done;be++,_e=R.next())_e=D(ce,w,be,_e.value,H),_e!==null&&(e&&_e.alternate!==null&&ce.delete(_e.key===null?be:_e.key),k=i(_e,k,be),Re===null?ue=_e:Re.sibling=_e,Re=_e);return e&&ce.forEach(function(uh){return t(w,uh)}),we&&hl(w,be),ue}function Ge(w,k,R,H){if(typeof R=="object"&&R!==null&&R.type===O&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case A:e:{for(var ue=R.key;k!==null;){if(k.key===ue){if(ue=R.type,ue===O){if(k.tag===7){l(w,k.sibling),H=s(k,R.props.children),H.return=w,w=H;break e}}else if(k.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===F&&ha(ue)===k.type){l(w,k.sibling),H=s(k,R.props),Rn(H,R),H.return=w,w=H;break e}l(w,k);break}else t(w,k);k=k.sibling}R.type===O?(H=da(R.props.children,w.mode,H,R.key),H.return=w,w=H):(H=bs(R.type,R.key,R.props,null,w.mode,H),Rn(H,R),H.return=w,w=H)}return d(w);case L:e:{for(ue=R.key;k!==null;){if(k.key===ue)if(k.tag===4&&k.stateNode.containerInfo===R.containerInfo&&k.stateNode.implementation===R.implementation){l(w,k.sibling),H=s(k,R.children||[]),H.return=w,w=H;break e}else{l(w,k);break}else t(w,k);k=k.sibling}H=li(R,w.mode,H),H.return=w,w=H}return d(w);case F:return R=ha(R),Ge(w,k,R,H)}if(me(R))return re(w,k,R,H);if(je(R)){if(ue=je(R),typeof ue!="function")throw Error(u(150));return R=ue.call(R),fe(w,k,R,H)}if(typeof R.then=="function")return Ge(w,k,Cs(R),H);if(R.$$typeof===ie)return Ge(w,k,Ns(w,R),H);ws(w,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,k!==null&&k.tag===6?(l(w,k.sibling),H=s(k,R),H.return=w,w=H):(l(w,k),H=ti(R,w.mode,H),H.return=w,w=H),d(w)):l(w,k)}return function(w,k,R,H){try{An=0;var ue=Ge(w,k,R,H);return Za=null,ue}catch(ce){if(ce===Xa||ce===ks)throw ce;var Re=Ht(29,ce,null,w.mode);return Re.lanes=H,Re.return=w,Re}finally{}}}var ya=yu(!0),gu=yu(!1),Hl=!1;function pi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gl(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ze&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=gs(e),lu(e,null,l),t}return ys(e,n,t,l),gs(e)}function _n(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,uc(e,l)}}function hi(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var s=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var d={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?s=i=d:i=i.next=d,l=l.next}while(l!==null);i===null?s=i=t:i=i.next=t}else s=i=t;l={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var vi=!1;function Mn(){if(vi){var e=Qa;if(e!==null)throw e}}function zn(e,t,l,n){vi=!1;var s=e.updateQueue;Hl=!1;var i=s.firstBaseUpdate,d=s.lastBaseUpdate,m=s.shared.pending;if(m!==null){s.shared.pending=null;var S=m,_=S.next;S.next=null,d===null?i=_:d.next=_,d=S;var B=e.alternate;B!==null&&(B=B.updateQueue,m=B.lastBaseUpdate,m!==d&&(m===null?B.firstBaseUpdate=_:m.next=_,B.lastBaseUpdate=S))}if(i!==null){var U=s.baseState;d=0,B=_=S=null,m=i;do{var M=m.lane&-536870913,D=M!==m.lane;if(D?(Te&M)===M:(n&M)===M){M!==0&&M===Va&&(vi=!0),B!==null&&(B=B.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var re=e,fe=m;M=t;var Ge=l;switch(fe.tag){case 1:if(re=fe.payload,typeof re=="function"){U=re.call(Ge,U,M);break e}U=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=fe.payload,M=typeof re=="function"?re.call(Ge,U,M):re,M==null)break e;U=y({},U,M);break e;case 2:Hl=!0}}M=m.callback,M!==null&&(e.flags|=64,D&&(e.flags|=8192),D=s.callbacks,D===null?s.callbacks=[M]:D.push(M))}else D={lane:M,tag:m.tag,payload:m.payload,callback:m.callback,next:null},B===null?(_=B=D,S=U):B=B.next=D,d|=M;if(m=m.next,m===null){if(m=s.shared.pending,m===null)break;D=m,m=D.next,D.next=null,s.lastBaseUpdate=D,s.shared.pending=null}}while(!0);B===null&&(S=U),s.baseState=S,s.firstBaseUpdate=_,s.lastBaseUpdate=B,i===null&&(s.shared.lanes=0),Xl|=d,e.lanes=d,e.memoizedState=U}}function bu(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function ju(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)bu(l[e],t)}var Ka=N(null),As=N(0);function Su(e,t){e=Cl,V(As,e),V(Ka,t),Cl=e|t.baseLanes}function yi(){V(As,Cl),V(Ka,Ka.current)}function gi(){Cl=As.current,z(Ka),z(As)}var Ut=N(null),It=null;function ql(e){var t=e.alternate;V(tt,tt.current&1),V(Ut,e),It===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(It=e)}function bi(e){V(tt,tt.current),V(Ut,e),It===null&&(It=e)}function Nu(e){e.tag===22?(V(tt,tt.current),V(Ut,e),It===null&&(It=e)):Yl()}function Yl(){V(tt,tt.current),V(Ut,Ut.current)}function Gt(e){z(Ut),It===e&&(It=null),z(tt)}var tt=N(0);function Rs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Co(l)||wo(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 gl=0,ye=null,He=null,it=null,_s=!1,$a=!1,ga=!1,Ms=0,Ln=0,Ja=null,em=0;function Ie(){throw Error(u(321))}function ji(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Bt(e[l],t[l]))return!1;return!0}function Si(e,t,l,n,s,i){return gl=i,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?rd:Bi,ga=!1,i=l(n,s),ga=!1,$a&&(i=ku(t,l,n,s)),Eu(e),i}function Eu(e){C.H=Bn;var t=He!==null&&He.next!==null;if(gl=0,it=He=ye=null,_s=!1,Ln=0,Ja=null,t)throw Error(u(300));e===null||ot||(e=e.dependencies,e!==null&&Ss(e)&&(ot=!0))}function ku(e,t,l,n){ye=e;var s=0;do{if($a&&(Ja=null),Ln=0,$a=!1,25<=s)throw Error(u(301));if(s+=1,it=He=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}C.H=id,i=t(l,n)}while($a);return i}function tm(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Dn(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(ye.flags|=1024),t}function Ni(){var e=Ms!==0;return Ms=0,e}function Ei(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ki(e){if(_s){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_s=!1}gl=0,it=He=ye=null,$a=!1,Ln=Ms=0,Ja=null}function St(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?ye.memoizedState=it=e:it=it.next=e,it}function lt(){if(He===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=it===null?ye.memoizedState:it.next;if(t!==null)it=t,He=e;else{if(e===null)throw ye.alternate===null?Error(u(467)):Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},it===null?ye.memoizedState=it=e:it=it.next=e}return it}function zs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dn(e){var t=Ln;return Ln+=1,Ja===null&&(Ja=[]),e=mu(Ja,e,t),t=ye,(it===null?t.memoizedState:it.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?rd:Bi),e}function Ls(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dn(e);if(e.$$typeof===ie)return yt(e)}throw Error(u(438,String(e)))}function Ti(e){var t=null,l=ye.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=ye.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=zs(),ye.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=Ne;return t.index++,l}function bl(e,t){return typeof t=="function"?t(e):t}function Ds(e){var t=lt();return Ci(t,He,e)}function Ci(e,t,l){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=l;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var d=s.next;s.next=i.next,i.next=d}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var m=d=null,S=null,_=t,B=!1;do{var U=_.lane&-536870913;if(U!==_.lane?(Te&U)===U:(gl&U)===U){var M=_.revertLane;if(M===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),U===Va&&(B=!0);else if((gl&M)===M){_=_.next,M===Va&&(B=!0);continue}else U={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(m=S=U,d=i):S=S.next=U,ye.lanes|=M,Xl|=M;U=_.action,ga&&l(i,U),i=_.hasEagerState?_.eagerState:l(i,U)}else M={lane:U,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},S===null?(m=S=M,d=i):S=S.next=M,ye.lanes|=U,Xl|=U;_=_.next}while(_!==null&&_!==t);if(S===null?d=i:S.next=m,!Bt(i,e.memoizedState)&&(ot=!0,B&&(l=Qa,l!==null)))throw l;e.memoizedState=i,e.baseState=d,e.baseQueue=S,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function wi(e){var t=lt(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var n=l.dispatch,s=l.pending,i=t.memoizedState;if(s!==null){l.pending=null;var d=s=s.next;do i=e(i,d.action),d=d.next;while(d!==s);Bt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,n]}function Tu(e,t,l){var n=ye,s=lt(),i=we;if(i){if(l===void 0)throw Error(u(407));l=l()}else l=t();var d=!Bt((He||s).memoizedState,l);if(d&&(s.memoizedState=l,ot=!0),s=s.queue,_i(Au.bind(null,n,s,e),[e]),s.getSnapshot!==t||d||it!==null&&it.memoizedState.tag&1){if(n.flags|=2048,Wa(9,{destroy:void 0},wu.bind(null,n,s,l,t),null),Ye===null)throw Error(u(349));i||(gl&127)!==0||Cu(n,t,l)}return l}function Cu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ye.updateQueue,t===null?(t=zs(),ye.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function wu(e,t,l,n){t.value=l,t.getSnapshot=n,Ru(t)&&_u(e)}function Au(e,t,l){return l(function(){Ru(t)&&_u(e)})}function Ru(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Bt(e,l)}catch{return!0}}function _u(e){var t=ua(e,2);t!==null&&Mt(t,e,2)}function Ai(e){var t=St();if(typeof e=="function"){var l=e;if(e=l(),ga){nt(!0);try{l()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:e},t}function Mu(e,t,l,n){return e.baseState=l,Ci(e,He,typeof n=="function"?n:bl)}function lm(e,t,l,n,s){if(Hs(e))throw Error(u(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};C.T!==null?l(!0):i.isTransition=!1,n(i),l=t.pending,l===null?(i.next=t.pending=i,zu(t,i)):(i.next=l.next,t.pending=l.next=i)}}function zu(e,t){var l=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=C.T,d={};C.T=d;try{var m=l(s,n),S=C.S;S!==null&&S(d,m),Lu(e,t,m)}catch(_){Ri(e,t,_)}finally{i!==null&&d.types!==null&&(i.types=d.types),C.T=i}}else try{i=l(s,n),Lu(e,t,i)}catch(_){Ri(e,t,_)}}function Lu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Du(e,t,n)},function(n){return Ri(e,t,n)}):Du(e,t,l)}function Du(e,t,l){t.status="fulfilled",t.value=l,Ou(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,zu(e,l)))}function Ri(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Ou(t),t=t.next;while(t!==n)}e.action=null}function Ou(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bu(e,t){return t}function Hu(e,t){if(we){var l=Ye.formState;if(l!==null){e:{var n=ye;if(we){if(Ze){t:{for(var s=Ze,i=Ft;s.nodeType!==8;){if(!i){s=null;break t}if(s=Pt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){Ze=Pt(s.nextSibling),n=s.data==="F!";break e}}Ol(n)}n=!1}n&&(t=l[0])}}return l=St(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bu,lastRenderedState:t},l.queue=n,l=ad.bind(null,ye,n),n.dispatch=l,n=Ai(!1),i=Oi.bind(null,ye,!1,n.queue),n=St(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,l=lm.bind(null,ye,s,i,l),s.dispatch=l,n.memoizedState=e,[t,l,!1]}function Uu(e){var t=lt();return Gu(t,He,e)}function Gu(e,t,l){if(t=Ci(e,t,Bu)[0],e=Ds(bl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Dn(t)}catch(d){throw d===Xa?ks:d}else n=t;t=lt();var s=t.queue,i=s.dispatch;return l!==t.memoizedState&&(ye.flags|=2048,Wa(9,{destroy:void 0},am.bind(null,s,l),null)),[n,i,e]}function am(e,t){e.action=t}function qu(e){var t=lt(),l=He;if(l!==null)return Gu(t,l,e);lt(),t=t.memoizedState,l=lt();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function Wa(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=ye.updateQueue,t===null&&(t=zs(),ye.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Yu(){return lt().memoizedState}function Os(e,t,l,n){var s=St();ye.flags|=e,s.memoizedState=Wa(1|t,{destroy:void 0},l,n===void 0?null:n)}function Bs(e,t,l,n){var s=lt();n=n===void 0?null:n;var i=s.memoizedState.inst;He!==null&&n!==null&&ji(n,He.memoizedState.deps)?s.memoizedState=Wa(t,i,l,n):(ye.flags|=e,s.memoizedState=Wa(1|t,i,l,n))}function Vu(e,t){Os(8390656,8,e,t)}function _i(e,t){Bs(2048,8,e,t)}function nm(e){ye.flags|=4;var t=ye.updateQueue;if(t===null)t=zs(),ye.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Qu(e){var t=lt().memoizedState;return nm({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Xu(e,t){return Bs(4,2,e,t)}function Zu(e,t){return Bs(4,4,e,t)}function Ku(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $u(e,t,l){l=l!=null?l.concat([e]):null,Bs(4,4,Ku.bind(null,t,e),l)}function Mi(){}function Ju(e,t){var l=lt();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&ji(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function Wu(e,t){var l=lt();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&ji(t,n[1]))return n[0];if(n=e(),ga){nt(!0);try{e()}finally{nt(!1)}}return l.memoizedState=[n,t],n}function zi(e,t,l){return l===void 0||(gl&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Fd(),ye.lanes|=e,Xl|=e,l)}function Fu(e,t,l,n){return Bt(l,t)?l:Ka.current!==null?(e=zi(e,l,n),Bt(e,t)||(ot=!0),e):(gl&42)===0||(gl&1073741824)!==0&&(Te&261930)===0?(ot=!0,e.memoizedState=l):(e=Fd(),ye.lanes|=e,Xl|=e,t)}function Iu(e,t,l,n,s){var i=E.p;E.p=i!==0&&8>i?i:8;var d=C.T,m={};C.T=m,Oi(e,!1,t,l);try{var S=s(),_=C.S;if(_!==null&&_(m,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var B=Pp(S,n);On(e,t,B,Vt(e))}else On(e,t,n,Vt(e))}catch(U){On(e,t,{then:function(){},status:"rejected",reason:U},Vt())}finally{E.p=i,d!==null&&m.types!==null&&(d.types=m.types),C.T=d}}function sm(){}function Li(e,t,l,n){if(e.tag!==5)throw Error(u(476));var s=Pu(e).queue;Iu(e,s,t,K,l===null?sm:function(){return ed(e),l(n)})}function Pu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:K},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ed(e){var t=Pu(e);t.next===null&&(t=e.alternate.memoizedState),On(e,t.next.queue,{},Vt())}function Di(){return yt(Pn)}function td(){return lt().memoizedState}function ld(){return lt().memoizedState}function rm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=Ul(l);var n=Gl(t,e,l);n!==null&&(Mt(n,t,l),_n(n,t,l)),t={cache:ui()},e.payload=t;return}t=t.return}}function im(e,t,l){var n=Vt();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)?nd(t,l):(l=Pr(e,t,l,n),l!==null&&(Mt(l,e,n),sd(l,t,n)))}function ad(e,t,l){var n=Vt();On(e,t,l,n)}function On(e,t,l,n){var s={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))nd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,m=i(d,l);if(s.hasEagerState=!0,s.eagerState=m,Bt(m,d))return ys(e,t,s,0),Ye===null&&vs(),!1}catch{}finally{}if(l=Pr(e,t,s,n),l!==null)return Mt(l,e,n),sd(l,t,n),!0}return!1}function Oi(e,t,l,n){if(n={lane:2,revertLane:mo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(u(479))}else t=Pr(e,l,n,2),t!==null&&Mt(t,e,2)}function Hs(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function nd(e,t){$a=_s=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function sd(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,uc(e,l)}}var Bn={readContext:yt,use:Ls,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Bn.useEffectEvent=Ie;var rd={readContext:yt,use:Ls,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Vu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Os(4194308,4,Ku.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){Os(4,2,e,t)},useMemo:function(e,t){var l=St();t=t===void 0?null:t;var n=e();if(ga){nt(!0);try{e()}finally{nt(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=St();if(l!==void 0){var s=l(t);if(ga){nt(!0);try{l(t)}finally{nt(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=im.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ad.bind(null,ye,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Mi,useDeferredValue:function(e,t){var l=St();return zi(l,e,t)},useTransition:function(){var e=Ai(!1);return e=Iu.bind(null,ye,e.queue,!0,!1),St().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=ye,s=St();if(we){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ye===null)throw Error(u(349));(Te&127)!==0||Cu(n,t,l)}s.memoizedState=l;var i={value:l,getSnapshot:t};return s.queue=i,Vu(Au.bind(null,n,i,e),[e]),n.flags|=2048,Wa(9,{destroy:void 0},wu.bind(null,n,i,l,t),null),l},useId:function(){var e=St(),t=Ye.identifierPrefix;if(we){var l=cl,n=ol;l=(n&~(1<<32-et(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ms++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=em++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Di,useFormState:Hu,useActionState:Hu,useOptimistic:function(e){var t=St();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Oi.bind(null,ye,!0,l),l.dispatch=t,[e,t]},useMemoCache:Ti,useCacheRefresh:function(){return St().memoizedState=rm.bind(null,ye)},useEffectEvent:function(e){var t=St(),l={impl:e};return t.memoizedState=l,function(){if((ze&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},Bi={readContext:yt,use:Ls,useCallback:Ju,useContext:yt,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Zu,useMemo:Wu,useReducer:Ds,useRef:Yu,useState:function(){return Ds(bl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=lt();return Fu(l,He.memoizedState,e,t)},useTransition:function(){var e=Ds(bl)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Di,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=lt();return Mu(l,He,e,t)},useMemoCache:Ti,useCacheRefresh:ld};Bi.useEffectEvent=Qu;var id={readContext:yt,use:Ls,useCallback:Ju,useContext:yt,useEffect:_i,useImperativeHandle:$u,useInsertionEffect:Xu,useLayoutEffect:Zu,useMemo:Wu,useReducer:wi,useRef:Yu,useState:function(){return wi(bl)},useDebugValue:Mi,useDeferredValue:function(e,t){var l=lt();return He===null?zi(l,e,t):Fu(l,He.memoizedState,e,t)},useTransition:function(){var e=wi(bl)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:Tu,useId:td,useHostTransitionStatus:Di,useFormState:qu,useActionState:qu,useOptimistic:function(e,t){var l=lt();return He!==null?Mu(l,He,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Ti,useCacheRefresh:ld};id.useEffectEvent=Qu;function Hi(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:y({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ui={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=Vt(),s=Ul(n);s.payload=t,l!=null&&(s.callback=l),t=Gl(e,s,n),t!==null&&(Mt(t,e,n),_n(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=Vt(),s=Ul(n);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Gl(e,s,n),t!==null&&(Mt(t,e,n),_n(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),n=Ul(l);n.tag=2,t!=null&&(n.callback=t),t=Gl(e,n,l),t!==null&&(Mt(t,e,l),_n(t,e,l))}};function od(e,t,l,n,s,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,d):t.prototype&&t.prototype.isPureReactComponent?!Nn(l,n)||!Nn(s,i):!0}function cd(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function ba(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=y({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function ud(e){hs(e)}function dd(e){console.error(e)}function fd(e){hs(e)}function Us(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function xd(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Gi(e,t,l){return l=Ul(l),l.tag=3,l.payload={element:null},l.callback=function(){Us(e,t)},l}function pd(e){return e=Ul(e),e.tag=3,e}function md(e,t,l,n){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){xd(t,l,n)}}var d=l.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){xd(t,l,n),typeof s!="function"&&(Zl===null?Zl=new Set([this]):Zl.add(this));var m=n.stack;this.componentDidCatch(n.value,{componentStack:m!==null?m:""})})}function om(e,t,l,n,s){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Ya(t,l,s,!0),l=Ut.current,l!==null){switch(l.tag){case 31:case 13:return It===null?Fs():l.alternate===null&&Pe===0&&(Pe=3),l.flags&=-257,l.flags|=65536,l.lanes=s,n===Ts?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),fo(e,n,s)),!1;case 22:return l.flags|=65536,n===Ts?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),fo(e,n,s)),!1}throw Error(u(435,l.tag))}return fo(e,n,s),Fs(),!1}if(we)return t=Ut.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==si&&(e=Error(u(422),{cause:n}),Tn($t(e,l)))):(n!==si&&(t=Error(u(423),{cause:n}),Tn($t(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=$t(n,l),s=Gi(e.stateNode,n,s),hi(e,s),Pe!==4&&(Pe=2)),!1;var i=Error(u(520),{cause:n});if(i=$t(i,l),Xn===null?Xn=[i]:Xn.push(i),Pe!==4&&(Pe=2),t===null)return!0;n=$t(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Gi(l.stateNode,n,e),hi(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Zl===null||!Zl.has(i))))return l.flags|=65536,s&=-s,l.lanes|=s,s=pd(s),md(s,e,l,n),hi(l,s),!1}l=l.return}while(l!==null);return!1}var qi=Error(u(461)),ot=!1;function gt(e,t,l,n){t.child=e===null?gu(t,null,l,n):ya(t,e.child,l,n)}function hd(e,t,l,n,s){l=l.render;var i=t.ref;if("ref"in n){var d={};for(var m in n)m!=="ref"&&(d[m]=n[m])}else d=n;return pa(t),n=Si(e,t,l,d,i,s),m=Ni(),e!==null&&!ot?(Ei(e,t,s),jl(e,t,s)):(we&&m&&ai(t),t.flags|=1,gt(e,t,n,s),t.child)}function vd(e,t,l,n,s){if(e===null){var i=l.type;return typeof i=="function"&&!ei(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,yd(e,t,i,n,s)):(e=bs(l.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Ji(e,s)){var d=i.memoizedProps;if(l=l.compare,l=l!==null?l:Nn,l(d,n)&&e.ref===t.ref)return jl(e,t,s)}return t.flags|=1,e=ml(i,n),e.ref=t.ref,e.return=t,t.child=e}function yd(e,t,l,n,s){if(e!==null){var i=e.memoizedProps;if(Nn(i,n)&&e.ref===t.ref)if(ot=!1,t.pendingProps=n=i,Ji(e,s))(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,jl(e,t,s)}return Yi(e,t,l,n,s)}function gd(e,t,l,n){var s=n.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~i}else n=0,t.child=null;return bd(e,t,i,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Es(t,i!==null?i.cachePool:null),i!==null?Su(t,i):yi(),Nu(t);else return n=t.lanes=536870912,bd(e,t,i!==null?i.baseLanes|l:l,l,n)}else i!==null?(Es(t,i.cachePool),Su(t,i),Yl(),t.memoizedState=null):(e!==null&&Es(t,null),yi(),Yl());return gt(e,t,s,l),t.child}function Hn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bd(e,t,l,n,s){var i=fi();return i=i===null?null:{parent:rt._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&Es(t,null),yi(),Nu(t),e!==null&&Ya(e,t,n,!0),t.childLanes=s,null}function Gs(e,t){return t=Ys({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jd(e,t,l){return ya(t,e.child,null,l),e=Gs(t,t.pendingProps),e.flags|=2,Gt(t),t.memoizedState=null,e}function cm(e,t,l){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(we){if(n.mode==="hidden")return e=Gs(t,n),t.lanes=536870912,Hn(null,e);if(bi(t),(e=Ze)?(e=Lf(e,Ft),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ll!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,vt=t,Ze=null)):e=null,e===null)throw Ol(t);return t.lanes=536870912,null}return Gs(t,n)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(bi(t),s)if(t.flags&256)t.flags&=-257,t=jd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(ot||Ya(e,t,l,!1),s=(l&e.childLanes)!==0,ot||s){if(n=Ye,n!==null&&(d=dc(n,l),d!==0&&d!==i.retryLane))throw i.retryLane=d,ua(e,d),Mt(n,e,d),qi;Fs(),t=jd(e,t,l)}else e=i.treeContext,Ze=Pt(d.nextSibling),vt=t,we=!0,Dl=null,Ft=!1,e!==null&&iu(t,e),t=Gs(t,n),t.flags|=4096;return t}return e=ml(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Yi(e,t,l,n,s){return pa(t),l=Si(e,t,l,n,void 0,s),n=Ni(),e!==null&&!ot?(Ei(e,t,s),jl(e,t,s)):(we&&n&&ai(t),t.flags|=1,gt(e,t,l,s),t.child)}function Sd(e,t,l,n,s,i){return pa(t),t.updateQueue=null,l=ku(t,n,l,s),Eu(e),n=Ni(),e!==null&&!ot?(Ei(e,t,i),jl(e,t,i)):(we&&n&&ai(t),t.flags|=1,gt(e,t,l,i),t.child)}function Nd(e,t,l,n,s){if(pa(t),t.stateNode===null){var i=Ha,d=l.contextType;typeof d=="object"&&d!==null&&(i=yt(d)),i=new l(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Ui,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},pi(t),d=l.contextType,i.context=typeof d=="object"&&d!==null?yt(d):Ha,i.state=t.memoizedState,d=l.getDerivedStateFromProps,typeof d=="function"&&(Hi(t,l,d,n),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Ui.enqueueReplaceState(i,i.state,null),zn(t,n,i,s),Mn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var m=t.memoizedProps,S=ba(l,m);i.props=S;var _=i.context,B=l.contextType;d=Ha,typeof B=="object"&&B!==null&&(d=yt(B));var U=l.getDerivedStateFromProps;B=typeof U=="function"||typeof i.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,B||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(m||_!==d)&&cd(t,i,n,d),Hl=!1;var M=t.memoizedState;i.state=M,zn(t,n,i,s),Mn(),_=t.memoizedState,m||M!==_||Hl?(typeof U=="function"&&(Hi(t,l,U,n),_=t.memoizedState),(S=Hl||od(t,l,S,n,M,_,d))?(B||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=n,t.memoizedState=_),i.props=n,i.state=_,i.context=d,n=S):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,mi(e,t),d=t.memoizedProps,B=ba(l,d),i.props=B,U=t.pendingProps,M=i.context,_=l.contextType,S=Ha,typeof _=="object"&&_!==null&&(S=yt(_)),m=l.getDerivedStateFromProps,(_=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==U||M!==S)&&cd(t,i,n,S),Hl=!1,M=t.memoizedState,i.state=M,zn(t,n,i,s),Mn();var D=t.memoizedState;d!==U||M!==D||Hl||e!==null&&e.dependencies!==null&&Ss(e.dependencies)?(typeof m=="function"&&(Hi(t,l,m,n),D=t.memoizedState),(B=Hl||od(t,l,B,n,M,D,S)||e!==null&&e.dependencies!==null&&Ss(e.dependencies))?(_||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,D,S),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,D,S)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=D),i.props=n,i.state=D,i.context=S,n=B):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,qs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=ya(t,e.child,null,s),t.child=ya(t,null,l,s)):gt(e,t,l,s),t.memoizedState=i.state,e=t.child):e=jl(e,t,s),e}function Ed(e,t,l,n){return fa(),t.flags|=256,gt(e,t,l,n),t.child}var Vi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qi(e){return{baseLanes:e,cachePool:xu()}}function Xi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Yt),e}function kd(e,t,l){var n=t.pendingProps,s=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(we){if(s?ql(t):Yl(),(e=Ze)?(e=Lf(e,Ft),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ll!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=nu(e),l.return=t,t.child=l,vt=t,Ze=null)):e=null,e===null)throw Ol(t);return wo(e)?t.lanes=32:t.lanes=536870912,null}var m=n.children;return n=n.fallback,s?(Yl(),s=t.mode,m=Ys({mode:"hidden",children:m},s),n=da(n,s,l,null),m.return=t,n.return=t,m.sibling=n,t.child=m,n=t.child,n.memoizedState=Qi(l),n.childLanes=Xi(e,d,l),t.memoizedState=Vi,Hn(null,n)):(ql(t),Zi(t,m))}var S=e.memoizedState;if(S!==null&&(m=S.dehydrated,m!==null)){if(i)t.flags&256?(ql(t),t.flags&=-257,t=Ki(e,t,l)):t.memoizedState!==null?(Yl(),t.child=e.child,t.flags|=128,t=null):(Yl(),m=n.fallback,s=t.mode,n=Ys({mode:"visible",children:n.children},s),m=da(m,s,l,null),m.flags|=2,n.return=t,m.return=t,n.sibling=m,t.child=n,ya(t,e.child,null,l),n=t.child,n.memoizedState=Qi(l),n.childLanes=Xi(e,d,l),t.memoizedState=Vi,t=Hn(null,n));else if(ql(t),wo(m)){if(d=m.nextSibling&&m.nextSibling.dataset,d)var _=d.dgst;d=_,n=Error(u(419)),n.stack="",n.digest=d,Tn({value:n,source:null,stack:null}),t=Ki(e,t,l)}else if(ot||Ya(e,t,l,!1),d=(l&e.childLanes)!==0,ot||d){if(d=Ye,d!==null&&(n=dc(d,l),n!==0&&n!==S.retryLane))throw S.retryLane=n,ua(e,n),Mt(d,e,n),qi;Co(m)||Fs(),t=Ki(e,t,l)}else Co(m)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Ze=Pt(m.nextSibling),vt=t,we=!0,Dl=null,Ft=!1,e!==null&&iu(t,e),t=Zi(t,n.children),t.flags|=4096);return t}return s?(Yl(),m=n.fallback,s=t.mode,S=e.child,_=S.sibling,n=ml(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,_!==null?m=ml(_,m):(m=da(m,s,l,null),m.flags|=2),m.return=t,n.return=t,n.sibling=m,t.child=n,Hn(null,n),n=t.child,m=e.child.memoizedState,m===null?m=Qi(l):(s=m.cachePool,s!==null?(S=rt._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=xu(),m={baseLanes:m.baseLanes|l,cachePool:s}),n.memoizedState=m,n.childLanes=Xi(e,d,l),t.memoizedState=Vi,Hn(e.child,n)):(ql(t),l=e.child,e=l.sibling,l=ml(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=l,t.memoizedState=null,l)}function Zi(e,t){return t=Ys({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ys(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function Ki(e,t,l){return ya(t,e.child,null,l),e=Zi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Td(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),oi(e.return,t,l)}function $i(e,t,l,n,s,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:s,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=l,d.tailMode=s,d.treeForkCount=i)}function Cd(e,t,l){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var d=tt.current,m=(d&2)!==0;if(m?(d=d&1|2,t.flags|=128):d&=1,V(tt,d),gt(e,t,n,l),n=we?kn:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Td(e,l,t);else if(e.tag===19)Td(e,l,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}switch(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&Rs(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),$i(t,!1,s,l,i,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Rs(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}$i(t,!0,l,null,i,n);break;case"together":$i(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function jl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Ya(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=ml(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=ml(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ji(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ss(e)))}function um(e,t,l){switch(t.tag){case 3:Be(t,t.stateNode.containerInfo),Bl(t,rt,e.memoizedState.cache),fa();break;case 27:case 5:ut(t);break;case 4:Be(t,t.stateNode.containerInfo);break;case 10:Bl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bi(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ql(t),t.flags|=128,null):(l&t.child.childLanes)!==0?kd(e,t,l):(ql(t),e=jl(e,t,l),e!==null?e.sibling:null);ql(t);break;case 19:var s=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Ya(e,t,l,!1),n=(l&t.childLanes)!==0),s){if(n)return Cd(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),V(tt,tt.current),n)break;return null;case 22:return t.lanes=0,gd(e,t,l,t.pendingProps);case 24:Bl(t,rt,e.memoizedState.cache)}return jl(e,t,l)}function wd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)ot=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return ot=!1,um(e,t,l);ot=(e.flags&131072)!==0}else ot=!1,we&&(t.flags&1048576)!==0&&ru(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ha(t.elementType),t.type=e,typeof e=="function")ei(e)?(n=ba(e,n),t.tag=1,t=Nd(null,t,e,n,l)):(t.tag=0,t=Yi(null,t,e,n,l));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=hd(null,t,e,n,l);break e}else if(s===$){t.tag=14,t=vd(null,t,e,n,l);break e}}throw t=ee(e)||e,Error(u(306,t,""))}}return t;case 0:return Yi(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,s=ba(n,t.pendingProps),Nd(e,t,n,s,l);case 3:e:{if(Be(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,mi(e,t),zn(t,n,null,l);var d=t.memoizedState;if(n=d.cache,Bl(t,rt,n),n!==i.cache&&ci(t,[rt],l,!0),Mn(),n=d.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Ed(e,t,n,l);break e}else if(n!==s){s=$t(Error(u(424)),t),Tn(s),t=Ed(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=Pt(e.firstChild),vt=t,we=!0,Dl=null,Ft=!0,l=gu(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(fa(),n===s){t=jl(e,t,l);break e}gt(e,t,n,l)}t=t.child}return t;case 26:return qs(e,t),e===null?(l=Gf(t.type,null,t.pendingProps,null))?t.memoizedState=l:we||(l=t.type,e=t.pendingProps,n=nr(te.current).createElement(l),n[ht]=t,n[Tt]=e,bt(n,l,e),xt(n),t.stateNode=n):t.memoizedState=Gf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ut(t),e===null&&we&&(n=t.stateNode=Bf(t.type,t.pendingProps,te.current),vt=t,Ft=!0,s=Ze,Wl(t.type)?(Ao=s,Ze=Pt(n.firstChild)):Ze=s),gt(e,t,t.pendingProps.children,l),qs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&we&&((s=n=Ze)&&(n=Gm(n,t.type,t.pendingProps,Ft),n!==null?(t.stateNode=n,vt=t,Ze=Pt(n.firstChild),Ft=!1,s=!0):s=!1),s||Ol(t)),ut(t),s=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,n=i.children,Eo(s,i)?n=null:d!==null&&Eo(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=Si(e,t,tm,null,null,l),Pn._currentValue=s),qs(e,t),gt(e,t,n,l),t.child;case 6:return e===null&&we&&((e=l=Ze)&&(l=qm(l,t.pendingProps,Ft),l!==null?(t.stateNode=l,vt=t,Ze=null,e=!0):e=!1),e||Ol(t)),null;case 13:return kd(e,t,l);case 4:return Be(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ya(t,null,n,l):gt(e,t,n,l),t.child;case 11:return hd(e,t,t.type,t.pendingProps,l);case 7:return gt(e,t,t.pendingProps,l),t.child;case 8:return gt(e,t,t.pendingProps.children,l),t.child;case 12:return gt(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,Bl(t,t.type,n.value),gt(e,t,n.children,l),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,pa(t),s=yt(s),n=n(s),t.flags|=1,gt(e,t,n,l),t.child;case 14:return vd(e,t,t.type,t.pendingProps,l);case 15:return yd(e,t,t.type,t.pendingProps,l);case 19:return Cd(e,t,l);case 31:return cm(e,t,l);case 22:return gd(e,t,l,t.pendingProps);case 24:return pa(t),n=yt(rt),e===null?(s=fi(),s===null&&(s=Ye,i=ui(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=l),s=i),t.memoizedState={parent:n,cache:s},pi(t),Bl(t,rt,s)):((e.lanes&l)!==0&&(mi(e,t),zn(t,null,null,l),Mn()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Bl(t,rt,n)):(n=i.cache,Bl(t,rt,n),n!==s.cache&&ci(t,[rt],l,!0))),gt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Sl(e){e.flags|=4}function Wi(e,t,l,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(tf())e.flags|=8192;else throw va=Ts,xi}else e.flags&=-16777217}function Ad(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(tf())e.flags|=8192;else throw va=Ts,xi}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oc():536870912,e.lanes|=t,en|=t)}function Un(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ke(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function dm(e,t,l){var n=t.pendingProps;switch(ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return Ke(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),yl(rt),Ae(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(qa(t)?Sl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ri())),Ke(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(Sl(t),i!==null?(Ke(t),Ad(t,i)):(Ke(t),Wi(t,s,null,n,l))):i?i!==e.memoizedState?(Sl(t),Ke(t),Ad(t,i)):(Ke(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Sl(t),Ke(t),Wi(t,s,e,n,l)),null;case 27:if(zt(t),l=te.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ke(t),null}e=P.current,qa(t)?ou(t):(e=Bf(s,n,l),t.stateNode=e,Sl(t))}return Ke(t),null;case 5:if(zt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ke(t),null}if(i=P.current,qa(t))ou(t);else{var d=nr(te.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?d.createElement(s,{is:n.is}):d.createElement(s)}}i[ht]=t,i[Tt]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(bt(i,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Sl(t)}}return Ke(t),Wi(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Sl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=te.current,qa(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,s=vt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[ht]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||Tf(e.nodeValue,l)),e||Ol(t,!0)}else e=nr(e).createTextNode(n),e[ht]=t,t.stateNode=e}return Ke(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=qa(t),l!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[ht]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ke(t),e=!1}else l=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Gt(t),t):(Gt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ke(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=qa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[ht]=t}else fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ke(t),s=!1}else s=ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Gt(t),t):(Gt(t),null)}return Gt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Vs(t,t.updateQueue),Ke(t),null);case 4:return Ae(),e===null&&go(t.stateNode.containerInfo),Ke(t),null;case 10:return yl(t.type),Ke(t),null;case 19:if(z(tt),n=t.memoizedState,n===null)return Ke(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Un(n,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Rs(e),i!==null){for(t.flags|=128,Un(n,!1),e=i.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)au(l,e),l=l.sibling;return V(tt,tt.current&1|2),we&&hl(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&We()>$s&&(t.flags|=128,s=!0,Un(n,!1),t.lanes=4194304)}else{if(!s)if(e=Rs(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),Un(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!we)return Ke(t),null}else 2*We()-n.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Un(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=We(),e.sibling=null,l=tt.current,V(tt,s?l&1|2:l&1),we&&hl(t,n.treeForkCount),e):(Ke(t),null);case 22:case 23:return Gt(t),gi(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),l=t.updateQueue,l!==null&&Vs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&z(ma),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),yl(rt),Ke(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function fm(e,t){switch(ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yl(rt),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zt(t),null;case 31:if(t.memoizedState!==null){if(Gt(t),t.alternate===null)throw Error(u(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Gt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(tt),null;case 4:return Ae(),null;case 10:return yl(t.type),null;case 22:case 23:return Gt(t),gi(),e!==null&&z(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return yl(rt),null;case 25:return null;default:return null}}function Rd(e,t){switch(ni(t),t.tag){case 3:yl(rt),Ae();break;case 26:case 27:case 5:zt(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Gt(t);break;case 13:Gt(t);break;case 19:z(tt);break;case 10:yl(t.type);break;case 22:case 23:Gt(t),gi(),e!==null&&z(ma);break;case 24:yl(rt)}}function Gn(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var s=n.next;l=s;do{if((l.tag&e)===e){n=void 0;var i=l.create,d=l.inst;n=i(),d.destroy=n}l=l.next}while(l!==s)}}catch(m){Oe(t,t.return,m)}}function Vl(e,t,l){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var d=n.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,s=t;var S=l,_=m;try{_()}catch(B){Oe(s,S,B)}}}n=n.next}while(n!==i)}}catch(B){Oe(t,t.return,B)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ju(t,l)}catch(n){Oe(e,e.return,n)}}}function Md(e,t,l){l.props=ba(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Oe(e,t,n)}}function qn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(s){Oe(e,t,s)}}function ul(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(s){Oe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Oe(e,t,s)}else l.current=null}function zd(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(s){Oe(e,e.return,s)}}function Fi(e,t,l){try{var n=e.stateNode;Lm(n,e.type,l,t),n[Tt]=t}catch(s){Oe(e,e.return,s)}}function Ld(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wl(e.type)||e.tag===4}function Ii(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ld(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.tag===27&&Wl(e.type)||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 Pi(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=xl));else if(n!==4&&(n===27&&Wl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Pi(e,t,l),e=e.sibling;e!==null;)Pi(e,t,l),e=e.sibling}function Qs(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Wl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Qs(e,t,l),e=e.sibling;e!==null;)Qs(e,t,l),e=e.sibling}function Dd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);bt(t,n,l),t[ht]=e,t[Tt]=l}catch(i){Oe(e,e.return,i)}}var Nl=!1,ct=!1,eo=!1,Od=typeof WeakSet=="function"?WeakSet:Set,pt=null;function xm(e,t){if(e=e.containerInfo,So=dr,e=$c(e),Kr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var d=0,m=-1,S=-1,_=0,B=0,U=e,M=null;t:for(;;){for(var D;U!==l||s!==0&&U.nodeType!==3||(m=d+s),U!==i||n!==0&&U.nodeType!==3||(S=d+n),U.nodeType===3&&(d+=U.nodeValue.length),(D=U.firstChild)!==null;)M=U,U=D;for(;;){if(U===e)break t;if(M===l&&++_===s&&(m=d),M===i&&++B===n&&(S=d),(D=U.nextSibling)!==null)break;U=M,M=U.parentNode}U=D}l=m===-1||S===-1?null:{start:m,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(No={focusedElem:e,selectionRange:l},dr=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,s=i.memoizedProps,i=i.memoizedState,n=l.stateNode;try{var re=ba(l.type,s);e=n.getSnapshotBeforeUpdate(re,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(fe){Oe(l,l.return,fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)To(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":To(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function Bd(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:kl(e,l),n&4&&Gn(5,l);break;case 1:if(kl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(d){Oe(l,l.return,d)}else{var s=ba(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Oe(l,l.return,d)}}n&64&&_d(l),n&512&&qn(l,l.return);break;case 3:if(kl(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{ju(e,t)}catch(d){Oe(l,l.return,d)}}break;case 27:t===null&&n&4&&Dd(l);case 26:case 5:kl(e,l),t===null&&n&4&&zd(l),n&512&&qn(l,l.return);break;case 12:kl(e,l);break;case 31:kl(e,l),n&4&&Gd(e,l);break;case 13:kl(e,l),n&4&&qd(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Sm.bind(null,l),Ym(e,l))));break;case 22:if(n=l.memoizedState!==null||Nl,!n){t=t!==null&&t.memoizedState!==null||ct,s=Nl;var i=ct;Nl=n,(ct=t)&&!i?Tl(e,l,(l.subtreeFlags&8772)!==0):kl(e,l),Nl=s,ct=i}break;case 30:break;default:kl(e,l)}}function Hd(e){var t=e.alternate;t!==null&&(e.alternate=null,Hd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $e=null,wt=!1;function El(e,t,l){for(l=l.child;l!==null;)Ud(e,t,l),l=l.sibling}function Ud(e,t,l){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(Et,l)}catch{}switch(l.tag){case 26:ct||ul(l,t),El(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ct||ul(l,t);var n=$e,s=wt;Wl(l.type)&&($e=l.stateNode,wt=!1),El(e,t,l),Wn(l.stateNode),$e=n,wt=s;break;case 5:ct||ul(l,t);case 6:if(n=$e,s=wt,$e=null,El(e,t,l),$e=n,wt=s,$e!==null)if(wt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(i){Oe(l,t,i)}else try{$e.removeChild(l.stateNode)}catch(i){Oe(l,t,i)}break;case 18:$e!==null&&(wt?(e=$e,Mf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),cn(e)):Mf($e,l.stateNode));break;case 4:n=$e,s=wt,$e=l.stateNode.containerInfo,wt=!0,El(e,t,l),$e=n,wt=s;break;case 0:case 11:case 14:case 15:Vl(2,l,t),ct||Vl(4,l,t),El(e,t,l);break;case 1:ct||(ul(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Md(l,t,n)),El(e,t,l);break;case 21:El(e,t,l);break;case 22:ct=(n=ct)||l.memoizedState!==null,El(e,t,l),ct=n;break;default:El(e,t,l)}}function Gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{cn(e)}catch(l){Oe(t,t.return,l)}}}function qd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{cn(e)}catch(l){Oe(t,t.return,l)}}function pm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Od),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Od),t;default:throw Error(u(435,e.tag))}}function Xs(e,t){var l=pm(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var s=Nm.bind(null,e,n);n.then(s,s)}})}function At(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var s=l[n],i=e,d=t,m=d;e:for(;m!==null;){switch(m.tag){case 27:if(Wl(m.type)){$e=m.stateNode,wt=!1;break e}break;case 5:$e=m.stateNode,wt=!1;break e;case 3:case 4:$e=m.stateNode.containerInfo,wt=!0;break e}m=m.return}if($e===null)throw Error(u(160));Ud(i,d,s),$e=null,wt=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var sl=null;function Yd(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:At(t,e),Rt(e),n&4&&(Vl(3,e,e.return),Gn(3,e),Vl(5,e,e.return));break;case 1:At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),n&64&&Nl&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var s=sl;if(At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),n&4){var i=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":i=s.getElementsByTagName("title")[0],(!i||i[pn]||i[ht]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),bt(i,n,l),i[ht]=e,xt(i),n=i;break e;case"link":var d=Vf("link","href",s).get(n+(l.href||""));if(d){for(var m=0;m<d.length;m++)if(i=d[m],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){d.splice(m,1);break t}}i=s.createElement(n),bt(i,n,l),s.head.appendChild(i);break;case"meta":if(d=Vf("meta","content",s).get(n+(l.content||""))){for(m=0;m<d.length;m++)if(i=d[m],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){d.splice(m,1);break t}}i=s.createElement(n),bt(i,n,l),s.head.appendChild(i);break;default:throw Error(u(468,n))}i[ht]=e,xt(i),n=i}e.stateNode=n}else Qf(s,e.type,e.stateNode);else e.stateNode=Yf(s,n,e.memoizedProps);else i!==n?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,n===null?Qf(s,e.type,e.stateNode):Yf(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Fi(e,e.memoizedProps,l.memoizedProps)}break;case 27:At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),l!==null&&n&4&&Fi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(At(t,e),Rt(e),n&512&&(ct||l===null||ul(l,l.return)),e.flags&32){s=e.stateNode;try{_a(s,"")}catch(re){Oe(e,e.return,re)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,Fi(e,s,l!==null?l.memoizedProps:s)),n&1024&&(eo=!0);break;case 6:if(At(t,e),Rt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(re){Oe(e,e.return,re)}}break;case 3:if(ir=null,s=sl,sl=sr(t.containerInfo),At(t,e),sl=s,Rt(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{cn(t.containerInfo)}catch(re){Oe(e,e.return,re)}eo&&(eo=!1,Vd(e));break;case 4:n=sl,sl=sr(e.stateNode.containerInfo),At(t,e),Rt(e),sl=n;break;case 12:At(t,e),Rt(e);break;case 31:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 13:At(t,e),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ks=We()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 22:s=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,_=Nl,B=ct;if(Nl=_||s,ct=B||S,At(t,e),ct=B,Nl=_,Rt(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||S||Nl||ct||ja(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){S=l=t;try{if(i=S.stateNode,s)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{m=S.stateNode;var U=S.memoizedProps.style,M=U!=null&&U.hasOwnProperty("display")?U.display:null;m.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(re){Oe(S,S.return,re)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(re){Oe(S,S.return,re)}}}else if(t.tag===18){if(l===null){S=t;try{var D=S.stateNode;s?zf(D,!0):zf(S.stateNode,!1)}catch(re){Oe(S,S.return,re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,Xs(e,l))));break;case 19:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Xs(e,n)));break;case 30:break;case 21:break;default:At(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(Ld(n)){l=n;break}n=n.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,i=Ii(e);Qs(e,i,s);break;case 5:var d=l.stateNode;l.flags&32&&(_a(d,""),l.flags&=-33);var m=Ii(e);Qs(e,m,d);break;case 3:case 4:var S=l.stateNode.containerInfo,_=Ii(e);Pi(e,_,S);break;default:throw Error(u(161))}}catch(B){Oe(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function kl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bd(e,t.alternate,t),t=t.sibling}function ja(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vl(4,t,t.return),ja(t);break;case 1:ul(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Md(t,t.return,l),ja(t);break;case 27:Wn(t.stateNode);case 26:case 5:ul(t,t.return),ja(t);break;case 22:t.memoizedState===null&&ja(t);break;case 30:ja(t);break;default:ja(t)}e=e.sibling}}function Tl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:Tl(s,i,l),Gn(4,i);break;case 1:if(Tl(s,i,l),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){Oe(n,n.return,_)}if(n=i,s=n.updateQueue,s!==null){var m=n.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)bu(S[s],m)}catch(_){Oe(n,n.return,_)}}l&&d&64&&_d(i),qn(i,i.return);break;case 27:Dd(i);case 26:case 5:Tl(s,i,l),l&&n===null&&d&4&&zd(i),qn(i,i.return);break;case 12:Tl(s,i,l);break;case 31:Tl(s,i,l),l&&d&4&&Gd(s,i);break;case 13:Tl(s,i,l),l&&d&4&&qd(s,i);break;case 22:i.memoizedState===null&&Tl(s,i,l),qn(i,i.return);break;case 30:break;default:Tl(s,i,l)}t=t.sibling}}function to(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Cn(l))}function lo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e))}function rl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Qd(e,t,l,n),t=t.sibling}function Qd(e,t,l,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:rl(e,t,l,n),s&2048&&Gn(9,t);break;case 1:rl(e,t,l,n);break;case 3:rl(e,t,l,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Cn(e)));break;case 12:if(s&2048){rl(e,t,l,n),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,m=i.onPostCommit;typeof m=="function"&&m(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Oe(t,t.return,S)}}else rl(e,t,l,n);break;case 31:rl(e,t,l,n);break;case 13:rl(e,t,l,n);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?rl(e,t,l,n):Yn(e,t):i._visibility&2?rl(e,t,l,n):(i._visibility|=2,Fa(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&to(d,t);break;case 24:rl(e,t,l,n),s&2048&&lo(t.alternate,t);break;default:rl(e,t,l,n)}}function Fa(e,t,l,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,m=l,S=n,_=d.flags;switch(d.tag){case 0:case 11:case 15:Fa(i,d,m,S,s),Gn(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?Fa(i,d,m,S,s):Yn(i,d):(B._visibility|=2,Fa(i,d,m,S,s)),s&&_&2048&&to(d.alternate,d);break;case 24:Fa(i,d,m,S,s),s&&_&2048&&lo(d.alternate,d);break;default:Fa(i,d,m,S,s)}t=t.sibling}}function Yn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,s=n.flags;switch(n.tag){case 22:Yn(l,n),s&2048&&to(n.alternate,n);break;case 24:Yn(l,n),s&2048&&lo(n.alternate,n);break;default:Yn(l,n)}t=t.sibling}}var Vn=8192;function Ia(e,t,l){if(e.subtreeFlags&Vn)for(e=e.child;e!==null;)Xd(e,t,l),e=e.sibling}function Xd(e,t,l){switch(e.tag){case 26:Ia(e,t,l),e.flags&Vn&&e.memoizedState!==null&&eh(l,sl,e.memoizedState,e.memoizedProps);break;case 5:Ia(e,t,l);break;case 3:case 4:var n=sl;sl=sr(e.stateNode.containerInfo),Ia(e,t,l),sl=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Vn,Vn=16777216,Ia(e,t,l),Vn=n):Ia(e,t,l));break;default:Ia(e,t,l)}}function Zd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];pt=n,$d(n,e)}Zd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kd(e),e=e.sibling}function Kd(e){switch(e.tag){case 0:case 11:case 15:Qn(e),e.flags&2048&&Vl(9,e,e.return);break;case 3:Qn(e);break;case 12:Qn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zs(e)):Qn(e);break;default:Qn(e)}}function Zs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];pt=n,$d(n,e)}Zd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vl(8,t,t.return),Zs(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Zs(t));break;default:Zs(t)}e=e.sibling}}function $d(e,t){for(;pt!==null;){var l=pt;switch(l.tag){case 0:case 11:case 15:Vl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Cn(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,pt=n;else e:for(l=e;pt!==null;){n=pt;var s=n.sibling,i=n.return;if(Hd(n),n===l){pt=null;break e}if(s!==null){s.return=i,pt=s;break e}pt=i}}}var mm={getCacheForType:function(e){var t=yt(rt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return yt(rt).controller.signal}},hm=typeof WeakMap=="function"?WeakMap:Map,ze=0,Ye=null,Ee=null,Te=0,De=0,qt=null,Ql=!1,Pa=!1,ao=!1,Cl=0,Pe=0,Xl=0,Sa=0,no=0,Yt=0,en=0,Xn=null,_t=null,so=!1,Ks=0,Jd=0,$s=1/0,Js=null,Zl=null,ft=0,Kl=null,tn=null,wl=0,ro=0,io=null,Wd=null,Zn=0,oo=null;function Vt(){return(ze&2)!==0&&Te!==0?Te&-Te:C.T!==null?mo():fc()}function Fd(){if(Yt===0)if((Te&536870912)===0||we){var e=qe;qe<<=1,(qe&3932160)===0&&(qe=262144),Yt=e}else Yt=536870912;return e=Ut.current,e!==null&&(e.flags|=32),Yt}function Mt(e,t,l){(e===Ye&&(De===2||De===9)||e.cancelPendingCommit!==null)&&(ln(e,0),$l(e,Te,Yt,!1)),xn(e,l),((ze&2)===0||e!==Ye)&&(e===Ye&&((ze&2)===0&&(Sa|=l),Pe===4&&$l(e,Te,Yt,!1)),dl(e))}function Id(e,t,l){if((ze&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||fn(e,t),s=n?gm(e,t):uo(e,t,!0),i=n;do{if(s===0){Pa&&!n&&$l(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!vm(l)){s=uo(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var m=e;s=Xn;var S=m.current.memoizedState.isDehydrated;if(S&&(ln(m,d).flags|=256),d=uo(m,d,!1),d!==2){if(ao&&!S){m.errorRecoveryDisabledLanes|=i,Sa|=i,s=4;break e}i=_t,_t=s,i!==null&&(_t===null?_t=i:_t.push.apply(_t,i))}s=d}if(i=!1,s!==2)continue}}if(s===1){ln(e,0),$l(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:$l(n,t,Yt,!Ql);break e;case 2:_t=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Ks+300-We(),10<s)){if($l(n,t,Yt,!Ql),Ea(n,0,!0)!==0)break e;wl=t,n.timeoutHandle=Rf(Pd.bind(null,n,l,_t,Js,so,t,Yt,Sa,en,Ql,i,"Throttled",-0,0),s);break e}Pd(n,l,_t,Js,so,t,Yt,Sa,en,Ql,i,null,-0,0)}}break}while(!0);dl(e)}function Pd(e,t,l,n,s,i,d,m,S,_,B,U,M,D){if(e.timeoutHandle=-1,U=t.subtreeFlags,U&8192||(U&16785408)===16785408){U={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xl},Xd(t,i,U);var re=(i&62914560)===i?Ks-We():(i&4194048)===i?Jd-We():0;if(re=th(U,re),re!==null){wl=i,e.cancelPendingCommit=re(of.bind(null,e,t,i,l,n,s,d,m,S,B,U,null,M,D)),$l(e,i,d,!_);return}}of(e,t,i,l,n,s,d,m,S)}function vm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var s=l[n],i=s.getSnapshot;s=s.value;try{if(!Bt(i(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 $l(e,t,l,n){t&=~no,t&=~Sa,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-et(s),d=1<<i;n[i]=-1,s&=~d}l!==0&&cc(e,l,t)}function Ws(){return(ze&6)===0?(Kn(0),!1):!0}function co(){if(Ee!==null){if(De===0)var e=Ee.return;else e=Ee,vl=xa=null,ki(e),Za=null,An=0,e=Ee;for(;e!==null;)Rd(e.alternate,e),e=e.return;Ee=null}}function ln(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Bm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),wl=0,co(),Ye=e,Ee=l=ml(e.current,null),Te=t,De=0,qt=null,Ql=!1,Pa=fn(e,t),ao=!1,en=Yt=no=Sa=Xl=Pe=0,_t=Xn=null,so=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-et(n),i=1<<s;t|=e[s],n&=~i}return Cl=t,vs(),l}function ef(e,t){ye=null,C.H=Bn,t===Xa||t===ks?(t=hu(),De=3):t===xi?(t=hu(),De=4):De=t===qi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qt=t,Ee===null&&(Pe=1,Us(e,$t(t,e.current)))}function tf(){var e=Ut.current;return e===null?!0:(Te&4194048)===Te?It===null:(Te&62914560)===Te||(Te&536870912)!==0?e===It:!1}function lf(){var e=C.H;return C.H=Bn,e===null?Bn:e}function af(){var e=C.A;return C.A=mm,e}function Fs(){Pe=4,Ql||(Te&4194048)!==Te&&Ut.current!==null||(Pa=!0),(Xl&134217727)===0&&(Sa&134217727)===0||Ye===null||$l(Ye,Te,Yt,!1)}function uo(e,t,l){var n=ze;ze|=2;var s=lf(),i=af();(Ye!==e||Te!==t)&&(Js=null,ln(e,t)),t=!1;var d=Pe;e:do try{if(De!==0&&Ee!==null){var m=Ee,S=qt;switch(De){case 8:co(),d=6;break e;case 3:case 2:case 9:case 6:Ut.current===null&&(t=!0);var _=De;if(De=0,qt=null,an(e,m,S,_),l&&Pa){d=0;break e}break;default:_=De,De=0,qt=null,an(e,m,S,_)}}ym(),d=Pe;break}catch(B){ef(e,B)}while(!0);return t&&e.shellSuspendCounter++,vl=xa=null,ze=n,C.H=s,C.A=i,Ee===null&&(Ye=null,Te=0,vs()),d}function ym(){for(;Ee!==null;)nf(Ee)}function gm(e,t){var l=ze;ze|=2;var n=lf(),s=af();Ye!==e||Te!==t?(Js=null,$s=We()+500,ln(e,t)):Pa=fn(e,t);e:do try{if(De!==0&&Ee!==null){t=Ee;var i=qt;t:switch(De){case 1:De=0,qt=null,an(e,t,i,1);break;case 2:case 9:if(pu(i)){De=0,qt=null,sf(t);break}t=function(){De!==2&&De!==9||Ye!==e||(De=7),dl(e)},i.then(t,t);break e;case 3:De=7;break e;case 4:De=5;break e;case 7:pu(i)?(De=0,qt=null,sf(t)):(De=0,qt=null,an(e,t,i,7));break;case 5:var d=null;switch(Ee.tag){case 26:d=Ee.memoizedState;case 5:case 27:var m=Ee;if(d?Xf(d):m.stateNode.complete){De=0,qt=null;var S=m.sibling;if(S!==null)Ee=S;else{var _=m.return;_!==null?(Ee=_,Is(_)):Ee=null}break t}}De=0,qt=null,an(e,t,i,5);break;case 6:De=0,qt=null,an(e,t,i,6);break;case 8:co(),Pe=6;break e;default:throw Error(u(462))}}bm();break}catch(B){ef(e,B)}while(!0);return vl=xa=null,C.H=n,C.A=s,ze=l,Ee!==null?0:(Ye=null,Te=0,vs(),Pe)}function bm(){for(;Ee!==null&&!tl();)nf(Ee)}function nf(e){var t=wd(e.alternate,e,Cl);e.memoizedProps=e.pendingProps,t===null?Is(e):Ee=t}function sf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Sd(l,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Sd(l,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:ki(t);default:Rd(l,t),t=Ee=au(t,Cl),t=wd(l,t,Cl)}e.memoizedProps=e.pendingProps,t===null?Is(e):Ee=t}function an(e,t,l,n){vl=xa=null,ki(t),Za=null,An=0;var s=t.return;try{if(om(e,s,t,l,Te)){Pe=1,Us(e,$t(l,e.current)),Ee=null;return}}catch(i){if(s!==null)throw Ee=s,i;Pe=1,Us(e,$t(l,e.current)),Ee=null;return}t.flags&32768?(we||n===1?e=!0:Pa||(Te&536870912)!==0?e=!1:(Ql=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ut.current,n!==null&&n.tag===13&&(n.flags|=16384))),rf(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){rf(t,Ql);return}e=t.return;var l=dm(t.alternate,t,Cl);if(l!==null){Ee=l;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Pe===0&&(Pe=5)}function rf(e,t){do{var l=fm(e.alternate,e);if(l!==null){l.flags&=32767,Ee=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=l}while(e!==null);Pe=6,Ee=null}function of(e,t,l,n,s,i,d,m,S){e.cancelPendingCommit=null;do Ps();while(ft!==0);if((ze&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(i=t.lanes|t.childLanes,i|=Ir,Px(e,l,i,d,m,S),e===Ye&&(Ee=Ye=null,Te=0),tn=t,Kl=e,wl=l,ro=i,io=s,Wd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Em(at,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=C.T,C.T=null,s=E.p,E.p=2,d=ze,ze|=4;try{xm(e,t,l)}finally{ze=d,E.p=s,C.T=n}}ft=1,cf(),uf(),df()}}function cf(){if(ft===1){ft=0;var e=Kl,t=tn,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var n=E.p;E.p=2;var s=ze;ze|=4;try{Yd(t,e);var i=No,d=$c(e.containerInfo),m=i.focusedElem,S=i.selectionRange;if(d!==m&&m&&m.ownerDocument&&Kc(m.ownerDocument.documentElement,m)){if(S!==null&&Kr(m)){var _=S.start,B=S.end;if(B===void 0&&(B=_),"selectionStart"in m)m.selectionStart=_,m.selectionEnd=Math.min(B,m.value.length);else{var U=m.ownerDocument||document,M=U&&U.defaultView||window;if(M.getSelection){var D=M.getSelection(),re=m.textContent.length,fe=Math.min(S.start,re),Ge=S.end===void 0?fe:Math.min(S.end,re);!D.extend&&fe>Ge&&(d=Ge,Ge=fe,fe=d);var w=Zc(m,fe),k=Zc(m,Ge);if(w&&k&&(D.rangeCount!==1||D.anchorNode!==w.node||D.anchorOffset!==w.offset||D.focusNode!==k.node||D.focusOffset!==k.offset)){var R=U.createRange();R.setStart(w.node,w.offset),D.removeAllRanges(),fe>Ge?(D.addRange(R),D.extend(k.node,k.offset)):(R.setEnd(k.node,k.offset),D.addRange(R))}}}}for(U=[],D=m;D=D.parentNode;)D.nodeType===1&&U.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<U.length;m++){var H=U[m];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}dr=!!So,No=So=null}finally{ze=s,E.p=n,C.T=l}}e.current=t,ft=2}}function uf(){if(ft===2){ft=0;var e=Kl,t=tn,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var n=E.p;E.p=2;var s=ze;ze|=4;try{Bd(e,t.alternate,t)}finally{ze=s,E.p=n,C.T=l}}ft=3}}function df(){if(ft===4||ft===3){ft=0,Qt();var e=Kl,t=tn,l=wl,n=Wd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ft=5:(ft=0,tn=Kl=null,ff(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Zl=null),wr(l),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(Et,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=C.T,s=E.p,E.p=2,C.T=null;try{for(var i=e.onRecoverableError,d=0;d<n.length;d++){var m=n[d];i(m.value,{componentStack:m.stack})}}finally{C.T=t,E.p=s}}(wl&3)!==0&&Ps(),dl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===oo?Zn++:(Zn=0,oo=e):Zn=0,Kn(0)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cn(t)))}function Ps(){return cf(),uf(),df(),xf()}function xf(){if(ft!==5)return!1;var e=Kl,t=ro;ro=0;var l=wr(wl),n=C.T,s=E.p;try{E.p=32>l?32:l,C.T=null,l=io,io=null;var i=Kl,d=wl;if(ft=0,tn=Kl=null,wl=0,(ze&6)!==0)throw Error(u(331));var m=ze;if(ze|=4,Kd(i.current),Qd(i,i.current,d,l),ze=m,Kn(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(Et,i)}catch{}return!0}finally{E.p=s,C.T=n,ff(e,t)}}function pf(e,t,l){t=$t(l,t),t=Gi(e.stateNode,t,2),e=Gl(e,t,2),e!==null&&(xn(e,2),dl(e))}function Oe(e,t,l){if(e.tag===3)pf(e,e,l);else for(;t!==null;){if(t.tag===3){pf(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Zl===null||!Zl.has(n))){e=$t(l,e),l=pd(2),n=Gl(t,l,2),n!==null&&(md(l,n,t,e),xn(n,2),dl(n));break}}t=t.return}}function fo(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new hm;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(l)||(ao=!0,s.add(l),e=jm.bind(null,e,t,l),t.then(e,e))}function jm(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ye===e&&(Te&l)===l&&(Pe===4||Pe===3&&(Te&62914560)===Te&&300>We()-Ks?(ze&2)===0&&ln(e,0):no|=l,en===Te&&(en=0)),dl(e)}function mf(e,t){t===0&&(t=oc()),e=ua(e,t),e!==null&&(xn(e,t),dl(e))}function Sm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),mf(e,l)}function Nm(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),mf(e,l)}function Em(e,t){return Lt(e,t)}var er=null,nn=null,xo=!1,tr=!1,po=!1,Jl=0;function dl(e){e!==nn&&e.next===null&&(nn===null?er=nn=e:nn=nn.next=e),tr=!0,xo||(xo=!0,Tm())}function Kn(e,t){if(!po&&tr){po=!0;do for(var l=!1,n=er;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var d=n.suspendedLanes,m=n.pingedLanes;i=(1<<31-et(42|e)+1)-1,i&=s&~(d&~m),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,gf(n,i))}else i=Te,i=Ea(n,n===Ye?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||fn(n,i)||(l=!0,gf(n,i));n=n.next}while(l);po=!1}}function km(){hf()}function hf(){tr=xo=!1;var e=0;Jl!==0&&Om()&&(e=Jl);for(var t=We(),l=null,n=er;n!==null;){var s=n.next,i=vf(n,t);i===0?(n.next=null,l===null?er=s:l.next=s,s===null&&(nn=l)):(l=n,(e!==0||(i&3)!==0)&&(tr=!0)),n=s}ft!==0&&ft!==5||Kn(e),Jl!==0&&(Jl=0)}function vf(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-et(i),m=1<<d,S=s[d];S===-1?((m&l)===0||(m&n)!==0)&&(s[d]=Ix(m,t)):S<=t&&(e.expiredLanes|=m),i&=~m}if(t=Ye,l=Te,l=Ea(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(De===2||De===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&mt(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||fn(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&mt(n),wr(l)){case 2:case 8:l=Me;break;case 32:l=at;break;case 268435456:l=Rl;break;default:l=at}return n=yf.bind(null,e),l=Lt(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&mt(n),e.callbackPriority=2,e.callbackNode=null,2}function yf(e,t){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Ps()&&e.callbackNode!==l)return null;var n=Te;return n=Ea(e,e===Ye?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Id(e,n,t),vf(e,We()),e.callbackNode!=null&&e.callbackNode===l?yf.bind(null,e):null)}function gf(e,t){if(Ps())return null;Id(e,t,!0)}function Tm(){Hm(function(){(ze&6)!==0?Lt(Y,km):hf()})}function mo(){if(Jl===0){var e=Va;e===0&&(e=st,st<<=1,(st&261888)===0&&(st=256)),Jl=e}return Jl}function bf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:cs(""+e)}function jf(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function Cm(e,t,l,n,s){if(t==="submit"&&l&&l.stateNode===s){var i=bf((s[Tt]||null).action),d=n.submitter;d&&(t=(t=d[Tt]||null)?bf(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var m=new xs("action","action",null,n,s);e.push({event:m,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Jl!==0){var S=d?jf(s,d):new FormData(s);Li(l,{pending:!0,data:S,method:s.method,action:i},null,S)}}else typeof i=="function"&&(m.preventDefault(),S=d?jf(s,d):new FormData(s),Li(l,{pending:!0,data:S,method:s.method,action:i},i,S))},currentTarget:s}]})}}for(var ho=0;ho<Fr.length;ho++){var vo=Fr[ho],wm=vo.toLowerCase(),Am=vo[0].toUpperCase()+vo.slice(1);nl(wm,"on"+Am)}nl(Fc,"onAnimationEnd"),nl(Ic,"onAnimationIteration"),nl(Pc,"onAnimationStart"),nl("dblclick","onDoubleClick"),nl("focusin","onFocus"),nl("focusout","onBlur"),nl(Xp,"onTransitionRun"),nl(Zp,"onTransitionStart"),nl(Kp,"onTransitionCancel"),nl(eu,"onTransitionEnd"),Aa("onMouseEnter",["mouseout","mouseover"]),Aa("onMouseLeave",["mouseout","mouseover"]),Aa("onPointerEnter",["pointerout","pointerover"]),Aa("onPointerLeave",["pointerout","pointerover"]),ra("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ra("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ra("onBeforeInput",["compositionend","keypress","textInput","paste"]),ra("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ra("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ra("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $n="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(" "),Rm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($n));function Sf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var d=n.length-1;0<=d;d--){var m=n[d],S=m.instance,_=m.currentTarget;if(m=m.listener,S!==i&&s.isPropagationStopped())break e;i=m,s.currentTarget=_;try{i(s)}catch(B){hs(B)}s.currentTarget=null,i=S}else for(d=0;d<n.length;d++){if(m=n[d],S=m.instance,_=m.currentTarget,m=m.listener,S!==i&&s.isPropagationStopped())break e;i=m,s.currentTarget=_;try{i(s)}catch(B){hs(B)}s.currentTarget=null,i=S}}}}function ke(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var n=e+"__bubble";l.has(n)||(Nf(t,e,2,!1),l.add(n))}function yo(e,t,l){var n=0;t&&(n|=4),Nf(l,e,n,t)}var lr="_reactListening"+Math.random().toString(36).slice(2);function go(e){if(!e[lr]){e[lr]=!0,mc.forEach(function(l){l!=="selectionchange"&&(Rm.has(l)||yo(l,!1,e),yo(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lr]||(t[lr]=!0,yo("selectionchange",!1,t))}}function Nf(e,t,l,n){switch(If(t)){case 2:var s=nh;break;case 8:s=sh;break;default:s=Lo}l=s.bind(null,t,l,e),s=void 0,!Hr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function bo(e,t,l,n,s){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var m=n.stateNode.containerInfo;if(m===s)break;if(d===4)for(d=n.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;m!==null;){if(d=Ta(m),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){n=i=d;continue e}m=m.parentNode}}n=n.return}Cc(function(){var _=i,B=Or(l),U=[];e:{var M=tu.get(e);if(M!==void 0){var D=xs,re=e;switch(e){case"keypress":if(ds(l)===0)break e;case"keydown":case"keyup":D=Np;break;case"focusin":re="focus",D=Yr;break;case"focusout":re="blur",D=Yr;break;case"beforeblur":case"afterblur":D=Yr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=Rc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=dp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=Tp;break;case Fc:case Ic:case Pc:D=pp;break;case eu:D=wp;break;case"scroll":case"scrollend":D=cp;break;case"wheel":D=Rp;break;case"copy":case"cut":case"paste":D=hp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Mc;break;case"toggle":case"beforetoggle":D=Mp}var fe=(t&4)!==0,Ge=!fe&&(e==="scroll"||e==="scrollend"),w=fe?M!==null?M+"Capture":null:M;fe=[];for(var k=_,R;k!==null;){var H=k;if(R=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||R===null||w===null||(H=hn(k,w),H!=null&&fe.push(Jn(k,H,R))),Ge)break;k=k.return}0<fe.length&&(M=new D(M,re,null,l,B),U.push({event:M,listeners:fe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",M&&l!==Dr&&(re=l.relatedTarget||l.fromElement)&&(Ta(re)||re[ka]))break e;if((D||M)&&(M=B.window===B?B:(M=B.ownerDocument)?M.defaultView||M.parentWindow:window,D?(re=l.relatedTarget||l.toElement,D=_,re=re?Ta(re):null,re!==null&&(Ge=v(re),fe=re.tag,re!==Ge||fe!==5&&fe!==27&&fe!==6)&&(re=null)):(D=null,re=_),D!==re)){if(fe=Rc,H="onMouseLeave",w="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Mc,H="onPointerLeave",w="onPointerEnter",k="pointer"),Ge=D==null?M:mn(D),R=re==null?M:mn(re),M=new fe(H,k+"leave",D,l,B),M.target=Ge,M.relatedTarget=R,H=null,Ta(B)===_&&(fe=new fe(w,k+"enter",re,l,B),fe.target=R,fe.relatedTarget=Ge,H=fe),Ge=H,D&&re)t:{for(fe=_m,w=D,k=re,R=0,H=w;H;H=fe(H))R++;H=0;for(var ue=k;ue;ue=fe(ue))H++;for(;0<R-H;)w=fe(w),R--;for(;0<H-R;)k=fe(k),H--;for(;R--;){if(w===k||k!==null&&w===k.alternate){fe=w;break t}w=fe(w),k=fe(k)}fe=null}else fe=null;D!==null&&Ef(U,M,D,fe,!1),re!==null&&Ge!==null&&Ef(U,Ge,re,fe,!0)}}e:{if(M=_?mn(_):window,D=M.nodeName&&M.nodeName.toLowerCase(),D==="select"||D==="input"&&M.type==="file")var Re=Gc;else if(Hc(M))if(qc)Re=Yp;else{Re=Gp;var ce=Up}else D=M.nodeName,!D||D.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?_&&Lr(_.elementType)&&(Re=Gc):Re=qp;if(Re&&(Re=Re(e,_))){Uc(U,Re,l,B);break e}ce&&ce(e,M,_),e==="focusout"&&_&&M.type==="number"&&_.memoizedProps.value!=null&&zr(M,"number",M.value)}switch(ce=_?mn(_):window,e){case"focusin":(Hc(ce)||ce.contentEditable==="true")&&(Da=ce,$r=_,En=null);break;case"focusout":En=$r=Da=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Jc(U,l,B);break;case"selectionchange":if(Qp)break;case"keydown":case"keyup":Jc(U,l,B)}var be;if(Qr)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else La?Oc(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(zc&&l.locale!=="ko"&&(La||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&La&&(be=wc()):(zl=B,Ur="value"in zl?zl.value:zl.textContent,La=!0)),ce=ar(_,Ce),0<ce.length&&(Ce=new _c(Ce,e,null,l,B),U.push({event:Ce,listeners:ce}),be?Ce.data=be:(be=Bc(l),be!==null&&(Ce.data=be)))),(be=Lp?Dp(e,l):Op(e,l))&&(Ce=ar(_,"onBeforeInput"),0<Ce.length&&(ce=new _c("onBeforeInput","beforeinput",null,l,B),U.push({event:ce,listeners:Ce}),ce.data=be)),Cm(U,e,_,l,B)}Sf(U,t)})}function Jn(e,t,l){return{instance:e,listener:t,currentTarget:l}}function ar(e,t){for(var l=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=hn(e,l),s!=null&&n.unshift(Jn(e,s,i)),s=hn(e,t),s!=null&&n.push(Jn(e,s,i))),e.tag===3)return n;e=e.return}return[]}function _m(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ef(e,t,l,n,s){for(var i=t._reactName,d=[];l!==null&&l!==n;){var m=l,S=m.alternate,_=m.stateNode;if(m=m.tag,S!==null&&S===n)break;m!==5&&m!==26&&m!==27||_===null||(S=_,s?(_=hn(l,i),_!=null&&d.unshift(Jn(l,_,S))):s||(_=hn(l,i),_!=null&&d.push(Jn(l,_,S)))),l=l.return}d.length!==0&&e.push({event:t,listeners:d})}var Mm=/\r\n?/g,zm=/\u0000|\uFFFD/g;function kf(e){return(typeof e=="string"?e:""+e).replace(Mm,`
|
|
49
|
+
`).replace(zm,"")}function Tf(e,t){return t=kf(t),kf(e)===t}function Ue(e,t,l,n,s,i){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||_a(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&_a(e,""+n);break;case"className":is(e,"class",n);break;case"tabIndex":is(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":is(e,l,n);break;case"style":kc(e,n,i);break;case"data":if(t!=="object"){is(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=cs(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(l==="formAction"?(t!=="input"&&Ue(e,t,"name",s.name,s,null),Ue(e,t,"formEncType",s.formEncType,s,null),Ue(e,t,"formMethod",s.formMethod,s,null),Ue(e,t,"formTarget",s.formTarget,s,null)):(Ue(e,t,"encType",s.encType,s,null),Ue(e,t,"method",s.method,s,null),Ue(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=cs(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=xl);break;case"onScroll":n!=null&&ke("scroll",e);break;case"onScrollEnd":n!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=cs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":ke("beforetoggle",e),ke("toggle",e),rs(e,"popover",n);break;case"xlinkActuate":fl(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":fl(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":fl(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":fl(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":fl(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":fl(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":fl(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":fl(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":fl(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":rs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ip.get(l)||l,rs(e,l,n))}}function jo(e,t,l,n,s,i){switch(l){case"style":kc(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof n=="string"?_a(e,n):(typeof n=="number"||typeof n=="bigint")&&_a(e,""+n);break;case"onScroll":n!=null&&ke("scroll",e);break;case"onScrollEnd":n!=null&&ke("scrollend",e);break;case"onClick":n!=null&&(e.onclick=xl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hc.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),i=e[Tt]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,s);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):rs(e,l,n)}}}function bt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var n=!1,s=!1,i;for(i in l)if(l.hasOwnProperty(i)){var d=l[i];if(d!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ue(e,t,i,d,l,null)}}s&&Ue(e,t,"srcSet",l.srcSet,l,null),n&&Ue(e,t,"src",l.src,l,null);return;case"input":ke("invalid",e);var m=i=d=s=null,S=null,_=null;for(n in l)if(l.hasOwnProperty(n)){var B=l[n];if(B!=null)switch(n){case"name":s=B;break;case"type":d=B;break;case"checked":S=B;break;case"defaultChecked":_=B;break;case"value":i=B;break;case"defaultValue":m=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(u(137,t));break;default:Ue(e,t,n,B,l,null)}}jc(e,i,m,S,_,d,s,!1);return;case"select":ke("invalid",e),n=d=i=null;for(s in l)if(l.hasOwnProperty(s)&&(m=l[s],m!=null))switch(s){case"value":i=m;break;case"defaultValue":d=m;break;case"multiple":n=m;default:Ue(e,t,s,m,l,null)}t=i,l=d,e.multiple=!!n,t!=null?Ra(e,!!n,t,!1):l!=null&&Ra(e,!!n,l,!0);return;case"textarea":ke("invalid",e),i=s=n=null;for(d in l)if(l.hasOwnProperty(d)&&(m=l[d],m!=null))switch(d){case"value":n=m;break;case"defaultValue":s=m;break;case"children":i=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Ue(e,t,d,m,l,null)}Nc(e,n,s,i);return;case"option":for(S in l)if(l.hasOwnProperty(S)&&(n=l[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ue(e,t,S,n,l,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(n=0;n<$n.length;n++)ke($n[n],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in l)if(l.hasOwnProperty(_)&&(n=l[_],n!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ue(e,t,_,n,l,null)}return;default:if(Lr(t)){for(B in l)l.hasOwnProperty(B)&&(n=l[B],n!==void 0&&jo(e,t,B,n,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(n=l[m],n!=null&&Ue(e,t,m,n,l,null))}function Lm(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,i=null,d=null,m=null,S=null,_=null,B=null;for(D in l){var U=l[D];if(l.hasOwnProperty(D)&&U!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":S=U;default:n.hasOwnProperty(D)||Ue(e,t,D,null,n,U)}}for(var M in n){var D=n[M];if(U=l[M],n.hasOwnProperty(M)&&(D!=null||U!=null))switch(M){case"type":i=D;break;case"name":s=D;break;case"checked":_=D;break;case"defaultChecked":B=D;break;case"value":d=D;break;case"defaultValue":m=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:D!==U&&Ue(e,t,M,D,n,U)}}Mr(e,d,m,S,_,B,i,s);return;case"select":D=d=m=M=null;for(i in l)if(S=l[i],l.hasOwnProperty(i)&&S!=null)switch(i){case"value":break;case"multiple":D=S;default:n.hasOwnProperty(i)||Ue(e,t,i,null,n,S)}for(s in n)if(i=n[s],S=l[s],n.hasOwnProperty(s)&&(i!=null||S!=null))switch(s){case"value":M=i;break;case"defaultValue":m=i;break;case"multiple":d=i;default:i!==S&&Ue(e,t,s,i,n,S)}t=m,l=d,n=D,M!=null?Ra(e,!!l,M,!1):!!n!=!!l&&(t!=null?Ra(e,!!l,t,!0):Ra(e,!!l,l?[]:"",!1));return;case"textarea":D=M=null;for(m in l)if(s=l[m],l.hasOwnProperty(m)&&s!=null&&!n.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Ue(e,t,m,null,n,s)}for(d in n)if(s=n[d],i=l[d],n.hasOwnProperty(d)&&(s!=null||i!=null))switch(d){case"value":M=s;break;case"defaultValue":D=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==i&&Ue(e,t,d,s,n,i)}Sc(e,M,D);return;case"option":for(var re in l)if(M=l[re],l.hasOwnProperty(re)&&M!=null&&!n.hasOwnProperty(re))switch(re){case"selected":e.selected=!1;break;default:Ue(e,t,re,null,n,M)}for(S in n)if(M=n[S],D=l[S],n.hasOwnProperty(S)&&M!==D&&(M!=null||D!=null))switch(S){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ue(e,t,S,M,n,D)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var fe in l)M=l[fe],l.hasOwnProperty(fe)&&M!=null&&!n.hasOwnProperty(fe)&&Ue(e,t,fe,null,n,M);for(_ in n)if(M=n[_],D=l[_],n.hasOwnProperty(_)&&M!==D&&(M!=null||D!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(u(137,t));break;default:Ue(e,t,_,M,n,D)}return;default:if(Lr(t)){for(var Ge in l)M=l[Ge],l.hasOwnProperty(Ge)&&M!==void 0&&!n.hasOwnProperty(Ge)&&jo(e,t,Ge,void 0,n,M);for(B in n)M=n[B],D=l[B],!n.hasOwnProperty(B)||M===D||M===void 0&&D===void 0||jo(e,t,B,M,n,D);return}}for(var w in l)M=l[w],l.hasOwnProperty(w)&&M!=null&&!n.hasOwnProperty(w)&&Ue(e,t,w,null,n,M);for(U in n)M=n[U],D=l[U],!n.hasOwnProperty(U)||M===D||M==null&&D==null||Ue(e,t,U,M,n,D)}function Cf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Dm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var s=l[n],i=s.transferSize,d=s.initiatorType,m=s.duration;if(i&&m&&Cf(d)){for(d=0,m=s.responseEnd,n+=1;n<l.length;n++){var S=l[n],_=S.startTime;if(_>m)break;var B=S.transferSize,U=S.initiatorType;B&&Cf(U)&&(S=S.responseEnd,d+=B*(S<m?1:(m-_)/(S-_)))}if(--n,t+=8*(i+d)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var So=null,No=null;function nr(e){return e.nodeType===9?e:e.ownerDocument}function wf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Af(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Eo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ko=null;function Om(){var e=window.event;return e&&e.type==="popstate"?e===ko?!1:(ko=e,!0):(ko=null,!1)}var Rf=typeof setTimeout=="function"?setTimeout:void 0,Bm=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,Hm=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(Um)}:Rf;function Um(e){setTimeout(function(){throw e})}function Wl(e){return e==="head"}function Mf(e,t){var l=t,n=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(s),cn(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Wn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wn(l);for(var i=l.firstChild;i;){var d=i.nextSibling,m=i.nodeName;i[pn]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=d}}else l==="body"&&Wn(e.ownerDocument.body);l=s}while(l);cn(t)}function zf(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function To(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":To(l),Rr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Gm(e,t,l,n){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[pn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Pt(e.nextSibling),e===null)break}return null}function qm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Pt(e.nextSibling),e===null))return null;return e}function Lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pt(e.nextSibling),e===null))return null;return e}function Co(e){return e.data==="$?"||e.data==="$~"}function wo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ym(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Pt(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ao=null;function Df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Pt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Of(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Bf(e,t,l){switch(t=nr(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Wn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rr(e)}var el=new Map,Hf=new Set;function sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Al=E.d;E.d={f:Vm,r:Qm,D:Xm,C:Zm,L:Km,m:$m,X:Wm,S:Jm,M:Fm};function Vm(){var e=Al.f(),t=Ws();return e||t}function Qm(e){var t=Ca(e);t!==null&&t.tag===5&&t.type==="form"?ed(t):Al.r(e)}var sn=typeof document>"u"?null:document;function Uf(e,t,l){var n=sn;if(n&&typeof t=="string"&&t){var s=Zt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Hf.has(s)||(Hf.add(s),e={rel:e,crossOrigin:l,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),bt(t,"link",e),xt(t),n.head.appendChild(t)))}}function Xm(e){Al.D(e),Uf("dns-prefetch",e,null)}function Zm(e,t){Al.C(e,t),Uf("preconnect",e,t)}function Km(e,t,l){Al.L(e,t,l);var n=sn;if(n&&e&&t){var s='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Zt(l.imageSizes)+'"]')):s+='[href="'+Zt(e)+'"]';var i=s;switch(t){case"style":i=rn(e);break;case"script":i=on(e)}el.has(i)||(e=y({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),el.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Fn(i))||t==="script"&&n.querySelector(In(i))||(t=n.createElement("link"),bt(t,"link",e),xt(t),n.head.appendChild(t)))}}function $m(e,t){Al.m(e,t);var l=sn;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Zt(n)+'"][href="'+Zt(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=on(e)}if(!el.has(i)&&(e=y({rel:"modulepreload",href:e},t),el.set(i,e),l.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(In(i)))return}n=l.createElement("link"),bt(n,"link",e),xt(n),l.head.appendChild(n)}}}function Jm(e,t,l){Al.S(e,t,l);var n=sn;if(n&&e){var s=wa(n).hoistableStyles,i=rn(e);t=t||"default";var d=s.get(i);if(!d){var m={loading:0,preload:null};if(d=n.querySelector(Fn(i)))m.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},l),(l=el.get(i))&&Ro(e,l);var S=d=n.createElement("link");xt(S),bt(S,"link",e),S._p=new Promise(function(_,B){S.onload=_,S.onerror=B}),S.addEventListener("load",function(){m.loading|=1}),S.addEventListener("error",function(){m.loading|=2}),m.loading|=4,rr(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:m},s.set(i,d)}}}function Wm(e,t){Al.X(e,t);var l=sn;if(l&&e){var n=wa(l).hoistableScripts,s=on(e),i=n.get(s);i||(i=l.querySelector(In(s)),i||(e=y({src:e,async:!0},t),(t=el.get(s))&&_o(e,t),i=l.createElement("script"),xt(i),bt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Fm(e,t){Al.M(e,t);var l=sn;if(l&&e){var n=wa(l).hoistableScripts,s=on(e),i=n.get(s);i||(i=l.querySelector(In(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=el.get(s))&&_o(e,t),i=l.createElement("script"),xt(i),bt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Gf(e,t,l,n){var s=(s=te.current)?sr(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=rn(l.href),l=wa(s).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=rn(l.href);var i=wa(s).hoistableStyles,d=i.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=s.querySelector(Fn(e)))&&!i._p&&(d.instance=i,d.state.loading=5),el.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},el.set(e,l),i||Im(s,e,l,d.state))),t&&n===null)throw Error(u(528,""));return d}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=on(l),l=wa(s).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function rn(e){return'href="'+Zt(e)+'"'}function Fn(e){return'link[rel="stylesheet"]['+e+"]"}function qf(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Im(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),bt(t,"link",l),xt(t),e.head.appendChild(t))}function on(e){return'[src="'+Zt(e)+'"]'}function In(e){return"script[async]"+e}function Yf(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(n)return t.instance=n,xt(n),n;var s=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),xt(n),bt(n,"style",s),rr(n,l.precedence,e),t.instance=n;case"stylesheet":s=rn(l.href);var i=e.querySelector(Fn(s));if(i)return t.state.loading|=4,t.instance=i,xt(i),i;n=qf(l),(s=el.get(s))&&Ro(n,s),i=(e.ownerDocument||e).createElement("link"),xt(i);var d=i;return d._p=new Promise(function(m,S){d.onload=m,d.onerror=S}),bt(i,"link",n),t.state.loading|=4,rr(i,l.precedence,e),t.instance=i;case"script":return i=on(l.src),(s=e.querySelector(In(i)))?(t.instance=s,xt(s),s):(n=l,(s=el.get(i))&&(n=y({},l),_o(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),xt(s),bt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,rr(n,l.precedence,e));return t.instance}function rr(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,d=0;d<n.length;d++){var m=n[d];if(m.dataset.precedence===t)i=m;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Ro(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _o(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ir=null;function Vf(e,t,l){if(ir===null){var n=new Map,s=ir=new Map;s.set(l,n)}else s=ir,n=s.get(l),n||(n=new Map,s.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var i=l[s];if(!(i[pn]||i[ht]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var m=n.get(d);m?m.push(i):n.set(d,[i])}}return n}function Qf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Pm(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Xf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function eh(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=rn(n.href),i=t.querySelector(Fn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=or.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,xt(i);return}i=t.ownerDocument||t,n=qf(n),(s=el.get(s))&&Ro(n,s),i=i.createElement("link"),xt(i);var d=i;d._p=new Promise(function(m,S){d.onload=m,d.onerror=S}),bt(i,"link",n),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=or.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Mo=0;function th(e,t){return e.stylesheets&&e.count===0&&ur(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&ur(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Mo===0&&(Mo=62500*Dm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ur(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Mo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ur(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cr=null;function ur(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cr=new Map,t.forEach(lh,e),cr=null,or.call(e))}function lh(e,t){if(!(t.state.loading&4)){var l=cr.get(e);if(l)var n=l.get(null);else{l=new Map,cr.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var d=s[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(l.set(d.dataset.precedence,d),n=d)}n&&l.set(null,n)}s=t.instance,d=s.getAttribute("data-precedence"),i=l.get(d)||n,i===n&&l.set(null,s),l.set(d,s),this.count++,n=or.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:ie,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function ah(e,t,l,n,s,i,d,m,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tr(0),this.hiddenUpdates=Tr(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function Zf(e,t,l,n,s,i,d,m,S,_,B,U){return e=new ah(e,t,l,d,S,_,B,U,m),t=1,i===!0&&(t|=24),i=Ht(3,null,null,t),e.current=i,i.stateNode=e,t=ui(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:l,cache:t},pi(i),e}function Kf(e){return e?(e=Ha,e):Ha}function $f(e,t,l,n,s,i){s=Kf(s),n.context===null?n.context=s:n.pendingContext=s,n=Ul(t),n.payload={element:l},i=i===void 0?null:i,i!==null&&(n.callback=i),l=Gl(e,n,t),l!==null&&(Mt(l,e,t),_n(l,e,t))}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function zo(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Wf(e){if(e.tag===13||e.tag===31){var t=ua(e,67108864);t!==null&&Mt(t,e,67108864),zo(e,67108864)}}function Ff(e){if(e.tag===13||e.tag===31){var t=Vt();t=Cr(t);var l=ua(e,t);l!==null&&Mt(l,e,t),zo(e,t)}}var dr=!0;function nh(e,t,l,n){var s=C.T;C.T=null;var i=E.p;try{E.p=2,Lo(e,t,l,n)}finally{E.p=i,C.T=s}}function sh(e,t,l,n){var s=C.T;C.T=null;var i=E.p;try{E.p=8,Lo(e,t,l,n)}finally{E.p=i,C.T=s}}function Lo(e,t,l,n){if(dr){var s=Do(n);if(s===null)bo(e,t,n,fr,l),Pf(e,n);else if(ih(s,e,t,l,n))n.stopPropagation();else if(Pf(e,n),t&4&&-1<rh.indexOf(e)){for(;s!==null;){var i=Ca(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=kt(i.pendingLanes);if(d!==0){var m=i;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var S=1<<31-et(d);m.entanglements[1]|=S,d&=~S}dl(i),(ze&6)===0&&($s=We()+500,Kn(0))}}break;case 31:case 13:m=ua(i,2),m!==null&&Mt(m,i,2),Ws(),zo(i,2)}if(i=Do(n),i===null&&bo(e,t,n,fr,l),i===s)break;s=i}s!==null&&n.stopPropagation()}else bo(e,t,n,null,l)}}function Do(e){return e=Or(e),Oo(e)}var fr=null;function Oo(e){if(fr=null,e=Ta(e),e!==null){var t=v(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=p(t),e!==null)return e;e=null}else if(l===31){if(e=b(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fr=e,null}function If(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Dt()){case Y:return 2;case Me:return 8;case at:case Je:return 32;case Rl:return 268435456;default:return 32}default:return 32}}var Bo=!1,Fl=null,Il=null,Pl=null,es=new Map,ts=new Map,ea=[],rh="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".split(" ");function Pf(e,t){switch(e){case"focusin":case"focusout":Fl=null;break;case"dragenter":case"dragleave":Il=null;break;case"mouseover":case"mouseout":Pl=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function ls(e,t,l,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ca(t),t!==null&&Wf(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ih(e,t,l,n,s){switch(t){case"focusin":return Fl=ls(Fl,e,t,l,n,s),!0;case"dragenter":return Il=ls(Il,e,t,l,n,s),!0;case"mouseover":return Pl=ls(Pl,e,t,l,n,s),!0;case"pointerover":var i=s.pointerId;return es.set(i,ls(es.get(i)||null,e,t,l,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ts.set(i,ls(ts.get(i)||null,e,t,l,n,s)),!0}return!1}function ex(e){var t=Ta(e.target);if(t!==null){var l=v(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,xc(e.priority,function(){Ff(l)});return}}else if(t===31){if(t=b(l),t!==null){e.blockedOn=t,xc(e.priority,function(){Ff(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Do(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);Dr=n,l.target.dispatchEvent(n),Dr=null}else return t=Ca(l),t!==null&&Wf(t),e.blockedOn=l,!1;t.shift()}return!0}function tx(e,t,l){xr(e)&&l.delete(t)}function oh(){Bo=!1,Fl!==null&&xr(Fl)&&(Fl=null),Il!==null&&xr(Il)&&(Il=null),Pl!==null&&xr(Pl)&&(Pl=null),es.forEach(tx),ts.forEach(tx)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Bo||(Bo=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,oh)))}var mr=null;function lx(e){mr!==e&&(mr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){mr===e&&(mr=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Oo(n||l)===null)continue;break}var i=Ca(l);i!==null&&(e.splice(t,3),t-=3,Li(i,{pending:!0,data:s,method:l.method,action:n},n,s))}}))}function cn(e){function t(S){return pr(S,e)}Fl!==null&&pr(Fl,e),Il!==null&&pr(Il,e),Pl!==null&&pr(Pl,e),es.forEach(t),ts.forEach(t);for(var l=0;l<ea.length;l++){var n=ea[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ea.length&&(l=ea[0],l.blockedOn===null);)ex(l),l.blockedOn===null&&ea.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var s=l[n],i=l[n+1],d=s[Tt]||null;if(typeof i=="function")d||lx(l);else if(d){var m=null;if(i&&i.hasAttribute("formAction")){if(s=i,d=i[Tt]||null)m=d.formAction;else if(Oo(s)!==null)continue}else m=d.action;typeof m=="function"?l[n+1]=m:(l.splice(n,3),n-=3),lx(l)}}}function ax(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Ho(e){this._internalRoot=e}hr.prototype.render=Ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=Vt();$f(l,n,e,t,null,null)},hr.prototype.unmount=Ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$f(e.current,2,null,e,null,null),Ws(),t[ka]=null}};function hr(e){this._internalRoot=e}hr.prototype.unstable_scheduleHydration=function(e){if(e){var t=fc();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ea.length&&t!==0&&t<ea[l].priority;l++);ea.splice(l,0,e),l===0&&ex(e)}};var nx=c.version;if(nx!=="19.2.4")throw Error(u(527,nx,"19.2.4"));E.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=f(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var ch={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vr.isDisabled&&vr.supportsFiber)try{Et=vr.inject(ch),Fe=vr}catch{}}return ns.createRoot=function(e,t){if(!x(e))throw Error(u(299));var l=!1,n="",s=ud,i=dd,d=fd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Zf(e,1,!1,null,null,l,n,null,s,i,d,ax),e[ka]=t.current,go(e),new Ho(t)},ns.hydrateRoot=function(e,t,l){if(!x(e))throw Error(u(299));var n=!1,s="",i=ud,d=dd,m=fd,S=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(d=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=Zf(e,1,!0,t,l??null,n,s,S,i,d,m,ax),t.context=Kf(null),l=t.current,n=Vt(),n=Cr(n),s=Ul(n),s.callback=null,Gl(l,s,n),l=n,t.current.lanes=l,xn(t,l),dl(t),e[ka]=t.current,go(e),new hr(t)},ns.version="19.2.4",ns}var px;function gh(){if(px)return qo.exports;px=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(c){console.error(c)}}return r(),qo.exports=yh(),qo.exports}var bh=gh();const tc="";class Dx extends Error{constructor(c,o){super(c),this.name="ApiError",this.status=o}}async function Le(r,c){const o=await fetch(`${tc}${r}`,c);if(!o.ok){const u=await o.json().catch(()=>({error:o.statusText}));throw new Dx(u.error||`HTTP ${o.status}`,o.status)}return o.json()}const Se={getConfig(){return Le("/api/config")},setConfig(r,c){return Le("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,model:c})})},getSkills(){return Le("/api/skills")},getSkillDetail(r,c){return Le(`/api/skills/${r}/${c}`)},getEvals(r,c){return Le(`/api/skills/${r}/${c}/evals`)},saveEvals(r,c,o){return Le(`/api/skills/${r}/${c}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},generateEvals(r,c){return Le(`/api/skills/${r}/${c}/generate-evals`,{method:"POST"})},async getLatestBenchmark(r,c){const o=await fetch(`${tc}/api/skills/${r}/${c}/benchmark/latest`);if(o.status===404)return null;if(!o.ok){const u=await o.json().catch(()=>({error:o.statusText}));throw new Dx(u.error||`HTTP ${o.status}`,o.status)}return o.json()},getHistory(r,c,o){const u=new URLSearchParams;o!=null&&o.model&&u.set("model",o.model),o!=null&&o.type&&u.set("type",o.type),o!=null&&o.from&&u.set("from",o.from),o!=null&&o.to&&u.set("to",o.to);const x=u.toString();return Le(`/api/skills/${r}/${c}/history${x?"?"+x:""}`)},getHistoryEntry(r,c,o){return Le(`/api/skills/${r}/${c}/history/${encodeURIComponent(o)}`)},compareRuns(r,c,o,u){return Le(`/api/skills/${r}/${c}/history-compare?a=${encodeURIComponent(o)}&b=${encodeURIComponent(u)}`)},getCaseHistory(r,c,o,u){const x=new URLSearchParams;u&&x.set("model",u);const v=x.toString();return Le(`/api/skills/${r}/${c}/history/case/${o}${v?"?"+v:""}`)},deleteHistoryEntry(r,c,o){return Le(`/api/skills/${r}/${c}/history/${encodeURIComponent(o)}`,{method:"DELETE"})},deleteSkill(r,c){return Le(`/api/skills/${r}/${c}`,{method:"DELETE"})},improveSkill(r,c,o){return Le(`/api/skills/${r}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})},instructEdit(r,c,o){return Le(`/api/skills/${r}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...o})})},applyImprovement(r,c,o){return Le(`/api/skills/${r}/${c}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:o})})},getStats(r,c){return Le(`/api/skills/${r}/${c}/stats`)},getDependencies(r,c){return Le(`/api/skills/${r}/${c}/dependencies`)},getProjectLayout(){return Le("/api/project-layout")},createSkill(r){return Le("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},saveDraft(r){return Le("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},getSkillCreatorStatus(){return Le("/api/skill-creator-status")},generateSkill(r){return Le("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})},getSkillFiles(r,c){return Le(`/api/skills/${r}/${c}/files`)},getSkillFile(r,c,o){return Le(`/api/skills/${r}/${c}/file?path=${encodeURIComponent(o)}`)},saveSkillFile(r,c,o,u){return Le(`/api/skills/${r}/${c}/file`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:o,content:u})})},getLeaderboard(r,c){return Le(`/api/skills/${r}/${c}/leaderboard`)},getLeaderboardEntry(r,c,o){return Le(`/api/skills/${r}/${c}/leaderboard/${encodeURIComponent(o)}`)},startSweep(r,c,o){const u=`${tc}/api/skills/${r}/${c}/sweep`,x=new EventSource(u);return fetch(u,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify(o)}),x},getCredentials(r,c){return Le(`/api/credentials/${r}/${c}`)},searchModels(){return Le("/api/openrouter/models")}};function jh(r){const[c,o]=h.useState(()=>typeof window>"u"?!1:window.matchMedia(r).matches);return h.useEffect(()=>{const u=window.matchMedia(r);o(u.matches);const x=v=>o(v.matches);return u.addEventListener("change",x),()=>u.removeEventListener("change",x)},[r]),c}const Sh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function Nh(r,c){switch(c.type){case"SELECT_SKILL":return{...r,selectedSkill:c.skill,mode:"browse",mobileView:r.isMobile?"detail":r.mobileView};case"CLEAR_SELECTION":return{...r,selectedSkill:null};case"SET_MODE":return{...r,mode:c.mode,selectedSkill:c.mode==="create"?null:r.selectedSkill};case"SET_SEARCH":return{...r,searchQuery:c.query};case"SET_SKILLS":return{...r,skills:c.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...r,skillsError:c.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...r,skillsLoading:c.loading};case"SET_MOBILE":return{...r,isMobile:c.isMobile};case"SET_MOBILE_VIEW":return{...r,mobileView:c.view};default:return r}}const Ox=h.createContext(null);function na(){const r=h.useContext(Ox);if(!r)throw new Error("useStudio must be used within StudioProvider");return r}function Eh({children:r}){const[c,o]=h.useReducer(Nh,Sh),u=jh("(max-width: 767px)");h.useEffect(()=>{o({type:"SET_MOBILE",isMobile:u})},[u]);const x=h.useCallback(()=>{o({type:"SET_SKILLS_LOADING",loading:!0}),Se.getSkills().then(y=>{o({type:"SET_SKILLS",skills:y});const A=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(A){const[,L,O]=A,G=y.find(q=>q.plugin===L&&q.skill===O);G&&o({type:"SELECT_SKILL",skill:{plugin:L,skill:O,origin:G.origin}})}}).catch(y=>o({type:"SET_SKILLS_ERROR",error:y.message}))},[]);h.useEffect(()=>{x()},[x]);const v=h.useCallback(y=>{o({type:"SELECT_SKILL",skill:y}),window.location.hash=`/skills/${y.plugin}/${y.skill}`},[]),p=h.useCallback(()=>{o({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),b=h.useCallback(y=>{o({type:"SET_MODE",mode:y})},[]),g=h.useCallback(y=>{o({type:"SET_SEARCH",query:y})},[]),f=h.useCallback(y=>{o({type:"SET_MOBILE_VIEW",view:y})},[]),j=h.useMemo(()=>({state:c,selectSkill:v,clearSelection:p,setMode:b,setSearch:g,setMobileView:f,refreshSkills:x}),[c,v,p,b,g,f,x]);return a.jsx(Ox.Provider,{value:j,children:r})}const kh={config:null,loading:!0};function Th(r,c){switch(c.type){case"SET_CONFIG":return{config:c.config,loading:!1};case"SET_LOADING":return{...r,loading:!0};default:return r}}const Bx=h.createContext(null);function Na(){const r=h.useContext(Bx);if(!r)throw new Error("useConfig must be used within ConfigProvider");return r}function Ch({children:r}){const[c,o]=h.useReducer(Th,kh),u=h.useCallback(()=>{Se.getConfig().then(p=>o({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);h.useEffect(()=>{u()},[u]);const x=h.useCallback(async(p,b)=>{const g=await Se.setConfig(p,b);return o({type:"SET_CONFIG",config:g}),g},[]),v=h.useMemo(()=>({config:c.config,loading:c.loading,updateConfig:x,refreshConfig:u}),[c,x,u]);return a.jsx(Bx.Provider,{value:v,children:r})}function wh({left:r,right:c}){const{state:o}=na();return o.isMobile?a.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:o.mobileView==="list"?a.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:r}):a.jsx("div",{style:{height:"100%",overflowY:"auto"},children:c})}):a.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[a.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:r}),a.jsx("div",{style:{background:"var(--border-subtle)"}}),a.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:c})]})}function Ah(){const{state:r,setSearch:c}=na(),[o,u]=h.useState(r.searchQuery),x=h.useRef(null);h.useEffect(()=>(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{c(o)},200),()=>{x.current&&clearTimeout(x.current)}),[o,c]),h.useEffect(()=>{r.searchQuery===""&&o!==""&&u("")},[r.searchQuery]);const v=new Set(r.skills.map(p=>p.plugin)).size;return a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"relative",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)"},children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),a.jsx("input",{type:"text",value:o,onChange:p=>u(p.target.value),placeholder:"Search skills...",className:"w-full py-2 pl-8 pr-3 rounded-lg text-[13px] transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none"},onFocus:p=>{p.currentTarget.style.borderColor="var(--accent)"},onBlur:p=>{p.currentTarget.style.borderColor="var(--border-subtle)"}}),o&&a.jsx("button",{onClick:()=>{u(""),c("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!r.skillsLoading&&a.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[r.skills.length," skill",r.skills.length!==1?"s":""," across ",v," plugin",v!==1?"s":""]})]})}const mx={pass:{bg:"var(--green-muted)",text:"var(--green)",dot:"var(--green)",label:"Passing"},fail:{bg:"var(--red-muted)",text:"var(--red)",dot:"var(--red)",label:"Failing"},pending:{bg:"var(--yellow-muted)",text:"var(--yellow)",dot:"var(--yellow)",label:"Pending"},stale:{bg:"var(--orange-muted)",text:"var(--orange)",dot:"var(--orange)",label:"Stale"},missing:{bg:"var(--surface-3)",text:"var(--text-tertiary)",dot:"var(--text-tertiary)",label:"No evals"}};function hx({skill:r,isSelected:c,onSelect:o}){const u=mx[r.benchmarkStatus]||mx.missing,x=r.origin==="installed";return a.jsxs("button",{onClick:o,className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:c?"var(--surface-2)":"transparent",cursor:"pointer",borderTop:"none",borderRight:"none",borderBottom:"1px solid var(--border-subtle)",borderLeft:c?"2px solid var(--accent)":"2px solid transparent",display:"block",opacity:x?.7:1},onMouseEnter:v=>{c||(v.currentTarget.style.background="var(--surface-2)")},onMouseLeave:v=>{c||(v.currentTarget.style.background="transparent")},children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[x&&a.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"flex-shrink-0",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),r.skill]}),a.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full flex-shrink-0 ml-2",style:{background:u.bg,color:u.text},children:[a.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:u.dot}}),u.label]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsxs("span",{children:[r.evalCount," eval",r.evalCount!==1?"s":""]}),a.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),a.jsxs("span",{children:[r.assertionCount," assert",r.assertionCount!==1?"s":""]}),r.lastBenchmark&&a.jsxs(a.Fragment,{children:[a.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),a.jsx("span",{children:new Date(r.lastBenchmark).toLocaleDateString()})]})]})]})}function vx(r){var o;const c={};for(const u of r)(c[o=u.plugin]||(c[o]=[])).push(u);return c}function Rh(){const{state:r,selectSkill:c}=na(),{skills:o,searchQuery:u,selectedSkill:x}=r,[v,p]=h.useState(!1),[b,g]=h.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:j}=h.useMemo(()=>{const y=u.toLowerCase(),T=y?o.filter(O=>O.skill.toLowerCase().includes(y)||O.plugin.toLowerCase().includes(y)):o,A=T.filter(O=>O.origin==="source"),L=T.filter(O=>O.origin==="installed");return{sourceGroups:Object.entries(vx(A)),installedGroups:Object.entries(vx(L))}},[o,u]);return r.skillsLoading?a.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(y=>a.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},y))}):f.length===0&&j.length===0?a.jsx("div",{className:"px-4 py-8 text-center",children:a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):a.jsxs("div",{className:"flex-1",children:[f.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(_h,{title:"Your Skills",count:f.reduce((y,[,T])=>y+T.length,0)}),f.map(([y,T])=>a.jsxs("div",{children:[a.jsx(yx,{plugin:y,count:T.length}),T.map(A=>{const L=(x==null?void 0:x.plugin)===A.plugin&&(x==null?void 0:x.skill)===A.skill;return a.jsx(hx,{skill:A,isSelected:L,onSelect:()=>c({plugin:A.plugin,skill:A.skill,origin:A.origin})},`${A.plugin}/${A.skill}`)})]},y))]}),j.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>p(y=>!y),className:"w-full flex items-center gap-2 px-3 py-2.5 text-left",style:{background:"var(--surface-1)",border:"none",borderTop:"1px solid var(--border-subtle)",borderBottom:v?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:v?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",j.reduce((y,[,T])=>y+T.length,0),")"]}),a.jsx("div",{className:"flex-1"}),a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),v&&a.jsxs(a.Fragment,{children:[!b&&a.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("p",{className:"flex-1 text-[10px] leading-relaxed",style:{color:"var(--text-tertiary)",margin:0},children:"Skills inside agent folders (.claude/, .cursor/, etc.) are installed copies for consuming. Edit skills in your project root instead."}),a.jsx("button",{onClick:()=>{g(!0);try{sessionStorage.setItem("vskill-origin-banner-dismissed","1")}catch{}},className:"flex-shrink-0 mt-0.5",style:{background:"none",border:"none",cursor:"pointer",padding:0,color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),j.map(([y,T])=>a.jsxs("div",{children:[a.jsx(yx,{plugin:y,count:T.length}),T.map(A=>{const L=(x==null?void 0:x.plugin)===A.plugin&&(x==null?void 0:x.skill)===A.skill;return a.jsx(hx,{skill:A,isSelected:L,onSelect:()=>c({plugin:A.plugin,skill:A.skill,origin:A.origin})},`${A.plugin}/${A.skill}`)})]},y))]})]})]})}function _h({title:r,count:c}){return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:r}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]})]})}function yx({plugin:r,count:c}){const[o,u]=h.useState(!1),x=`/images/icons/${r}.webp`;return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[o?a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}):a.jsx("img",{src:x,width:16,height:16,alt:"",onError:()=>u(!0),style:{objectFit:"contain"}}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:r}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]}),a.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Mh({value:r,onChange:c}){const[o,u]=h.useState([]),[x,v]=h.useState(!1),[p,b]=h.useState(null),[g,f]=h.useState(r),[j,y]=h.useState(!1),T=h.useRef(null),A=h.useRef(void 0);h.useEffect(()=>{v(!0),Se.searchModels().then(q=>u(q.models)).catch(q=>b(q instanceof Error?q.message:String(q))).finally(()=>v(!1))},[]);const L=h.useCallback(q=>{f(q),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>y(!0),300)},[]),O=h.useMemo(()=>{if(!g.trim())return o.slice(0,50);const q=g.toLowerCase();return o.filter(J=>J.id.toLowerCase().includes(q)||J.name.toLowerCase().includes(q)).slice(0,50)},[o,g]);h.useEffect(()=>{function q(J){T.current&&!T.current.contains(J.target)&&y(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);function G(q){var Z;const J=(Z=q.pricing)==null?void 0:Z.prompt;return J==null||J===0?"Free":`$${(J*1e6).toFixed(2)}/1M`}return a.jsxs("div",{ref:T,style:{position:"relative"},children:[a.jsx("input",{type:"text",value:g,onChange:q=>L(q.target.value),onFocus:()=>y(!0),placeholder:x?"Loading models...":"Search OpenRouter models...",className:"input-field w-full",style:{fontSize:12}}),j&&!x&&a.jsxs("div",{style:{position:"absolute",top:"100%",left:0,right:0,maxHeight:280,overflowY:"auto",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:8,marginTop:4,zIndex:20,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[p&&a.jsxs("div",{className:"px-3 py-2 text-[11px]",style:{color:"var(--red)"},children:["Failed to load models: ",p]}),O.length===0&&!p&&a.jsx("div",{className:"px-3 py-3 text-[11px]",style:{color:"var(--text-tertiary)"},children:"No models found"}),O.map(q=>a.jsxs("button",{onClick:()=>{c(q.id),f(q.id),y(!1)},className:"w-full text-left px-3 py-2 flex items-center justify-between transition-colors duration-100",style:{background:q.id===r?"var(--accent-muted)":"transparent",border:"none",cursor:"pointer",borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--surface-3)"},onMouseLeave:J=>{J.currentTarget.style.background=q.id===r?"var(--accent-muted)":"transparent"},children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:q.name}),a.jsx("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:q.id})]}),a.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:G(q)})]},q.id))]})]})}function zh(){const{config:r,updateConfig:c,refreshConfig:o}=Na(),[u,x]=h.useState(!1),[v,p]=h.useState(!1),b=h.useRef(null);h.useEffect(()=>{function y(T){b.current&&!b.current.contains(T.target)&&x(!1)}return u&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[u]);async function g(y,T){p(!0);try{await c(y.id,T.id),x(!1)}catch{o()}finally{p(!1)}}if(!r)return null;const f=Dh(r),j=Lh(r);return a.jsxs("div",{ref:b,className:"relative",children:[a.jsxs("button",{onClick:()=>x(!u),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:u?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${u?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:y=>{u||(y.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:y=>{u||(y.currentTarget.style.borderColor="var(--border-subtle)")},children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:j!=null&&j.available?"var(--green)":"var(--text-tertiary)"}}),a.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:u?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),u&&a.jsxs("div",{className:"absolute top-full mt-1 left-0 right-0 rounded-xl shadow-xl z-50 overflow-hidden animate-fade-in",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",minWidth:"240px"},children:[a.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),a.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:r.providers.map(y=>a.jsxs("div",{children:[a.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:y.available?"var(--green)":"var(--text-tertiary)",opacity:y.available?1:.3}}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:y.available?1:.5},children:y.label})]}),y.id==="openrouter"&&y.available?a.jsx("div",{className:"px-3 py-1.5",children:a.jsx(Mh,{value:r.provider==="openrouter"?r.model:"",onChange:T=>{v||g(y,{id:T,label:T})}})}):y.models.map(T=>{const A=Hx(r,y.id,T.id),L=!y.available||v;return a.jsxs("button",{onClick:()=>!L&&g(y,T),disabled:L,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:A?"var(--accent-muted)":"transparent",color:L?"var(--text-tertiary)":"var(--text-primary)",opacity:L?.4:1,cursor:L?"not-allowed":"pointer"},onMouseEnter:O=>{!L&&!A&&(O.currentTarget.style.background="var(--surface-3)")},onMouseLeave:O=>{A||(O.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${A?"var(--accent)":"var(--border-subtle)"}`},children:A&&a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),a.jsx("span",{className:"text-[12px]",style:{fontWeight:A?600:400},title:T.id,children:T.label})]},`${y.id}-${T.id}`)})]},y.id))})]})]})}function Hx(r,c,o){return r.provider!==c?!1:c==="claude-cli"?r.model===`claude-${o}`:r.model===o}function Lh(r){return r.providers.find(c=>c.id===r.provider)}function Dh(r){for(const c of r.providers)for(const o of c.models)if(Hx(r,c.id,o.id))return o.label;return r.model}function Oh(){const{state:r,setMode:c}=na(),{config:o}=Na(),[u,x]=h.useState(null),[v,p]=h.useState(!1);return h.useEffect(()=>{Se.getSkillCreatorStatus().then(x).catch(()=>{})},[]),a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),a.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(o==null?void 0:o.projectName)||"vskill"})]})]}),a.jsx("div",{className:"mt-3",children:a.jsx(zh,{})})]}),a.jsx(Ah,{}),a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("button",{onClick:()=>c("create"),className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:r.mode==="create"?"var(--accent)":"var(--surface-3)",color:r.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:b=>{r.mode!=="create"&&(b.currentTarget.style.background="var(--surface-4)",b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{r.mode!=="create"&&(b.currentTarget.style.background="var(--surface-3)",b.currentTarget.style.color="var(--text-secondary)")},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),u&&(()=>{const b=(o==null?void 0:o.provider)==="claude-cli";return u.installed&&b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):u.installed&&!b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!u.installed&&b?a.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:a.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[a.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),a.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),a.jsx("button",{onClick:()=>{navigator.clipboard.writeText(u.installCommand).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)}).catch(()=>{})},className:"w-full text-left px-2 py-1 rounded text-[10px] font-mono cursor-pointer transition-colors duration-150",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},title:"Click to copy",onMouseEnter:g=>{g.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:g=>{g.currentTarget.style.borderColor="var(--border-subtle)"},children:v?"Copied!":u.installCommand})]})}):null})(),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:a.jsx(Rh,{})})]})}const Bh="modulepreload",Hh=function(r){return"/"+r},gx={},Uh=function(c,o,u){let x=Promise.resolve();if(o&&o.length>0){let p=function(f){return Promise.all(f.map(j=>Promise.resolve(j).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const b=document.querySelector("meta[property=csp-nonce]"),g=(b==null?void 0:b.nonce)||(b==null?void 0:b.getAttribute("nonce"));x=p(o.map(f=>{if(f=Hh(f),f in gx)return;gx[f]=!0;const j=f.endsWith(".css"),y=j?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":Bh,j||(T.as="script"),T.crossOrigin="",T.href=f,g&&T.setAttribute("nonce",g),document.head.appendChild(T),j)return new Promise((A,L)=>{T.addEventListener("load",A),T.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${f}`)))})}))}function v(p){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=p,window.dispatchEvent(b),!b.defaultPrevented)throw p}return x.then(p=>{for(const b of p||[])b.status==="rejected"&&v(b.reason);return c().catch(v)})};function Xo(){const[r,c]=h.useState([]),[o,u]=h.useState(!1),[x,v]=h.useState(!1),[p,b]=h.useState(null),g=h.useRef(null),f=h.useCallback(async(y,T)=>{c([]),u(!0),v(!1),b(null);const A=new AbortController;g.current=A;try{const L=await fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:T?JSON.stringify(T):void 0,signal:A.signal});if(!L.ok||!L.body){let ie=`HTTP ${L.status}`;try{const Z=await L.json();Z.error&&(ie=Z.error)}catch{}throw new Error(ie)}const O=L.body.getReader(),G=new TextDecoder;let q="",J="";for(;;){const{done:ie,value:Z}=await O.read();if(ie)break;q+=G.decode(Z,{stream:!0});const ae=q.split(`
|
|
50
|
+
`);q=ae.pop()||"";for(const ne of ae)if(ne.startsWith("event: "))J=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const $=JSON.parse(ne.slice(6)),F={event:J,data:$};J==="done"?(v(!0),c(xe=>[...xe,F])):c(xe=>[...xe,F])}catch{}J=""}}}catch(L){L.name!=="AbortError"&&b(L.message)}finally{u(!1),g.current=null}},[]),j=h.useCallback(()=>{var y;(y=g.current)==null||y.abort()},[]);return{events:r,running:o,done:x,error:p,start:f,stop:j}}function Gh(r){const c=h.useRef(r);c.current=r;const[o,u]=h.useState(new Set),x=h.useRef(new Map),v=h.useCallback(async(f,j,y)=>{var A;(A=x.current.get(f))==null||A.abort();const T=new AbortController;x.current.set(f,T),u(L=>{const O=new Set(L);return O.add(f),O});try{const L=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json"},body:y?JSON.stringify(y):void 0,signal:T.signal});if(!L.ok||!L.body){let ie=`HTTP ${L.status}`;try{const Z=await L.json();Z.error&&(ie=Z.error)}catch{}throw new Error(ie)}const O=L.body.getReader(),G=new TextDecoder;let q="",J="";for(;;){const{done:ie,value:Z}=await O.read();if(ie)break;q+=G.decode(Z,{stream:!0});const ae=q.split(`
|
|
51
|
+
`);q=ae.pop()||"";for(const ne of ae)if(ne.startsWith("event: "))J=ne.slice(7).trim();else if(ne.startsWith("data: ")){try{const $=JSON.parse(ne.slice(6)),F={event:J,data:$};c.current.onEvent(f,F)}catch{}J=""}}c.current.onDone(f)}catch(L){L.name!=="AbortError"&&c.current.onError(f,L.message)}finally{u(L=>{const O=new Set(L);return O.delete(f),O}),x.current.delete(f)}},[]),p=h.useCallback(f=>{var j;(j=x.current.get(f))==null||j.abort()},[]),b=h.useCallback(()=>{for(const f of x.current.values())f.abort()},[]),g=o.size>0;return{runningSet:o,startCase:v,stopCase:p,stopAll:b,isAnyCaseRunning:g}}const qh={plugin:"",skill:"",skillContent:"",savedContent:"",isDirty:!1,evals:null,evalsError:null,activePanel:"tests",selectedCaseId:null,caseRunStates:new Map,bulkRunActive:!1,runMode:null,latestBenchmark:null,inlineResults:new Map,improveTarget:null,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null,generateEvalsLoading:!1,generateEvalsProgress:[],generateEvalsError:null,regressions:[],iterationCount:0,activationPrompts:"",activationResults:[],activationSummary:null,activationRunning:!1,activationError:null,activationTotalPrompts:0,activationStartedAt:null,generatingPrompts:!1,generatingPromptsError:null,activationHistory:null,activationHistoryLoading:!1,loading:!0,error:null};function Yh(r,c){var o,u;switch(c.type){case"SET_LOADING":return{...r,loading:c.loading};case"SET_ERROR":return{...r,error:c.error};case"INIT_DATA":{const x=new Map;if(c.benchmark)for(const p of c.benchmark.cases)x.set(p.eval_id,{status:p.status,passRate:p.pass_rate,errorMessage:p.error_message||void 0,durationMs:p.durationMs,tokens:p.tokens,output:p.output,assertions:p.assertions.map(b=>({assertion_id:b.id,text:b.text,pass:b.pass,reasoning:b.reasoning}))});const v=((u=(o=c.evals)==null?void 0:o.evals[0])==null?void 0:u.id)??null;return{...r,skillContent:c.skillContent,savedContent:c.skillContent,isDirty:!1,evals:c.evals,evalsError:c.evalsError??null,latestBenchmark:c.benchmark,inlineResults:x,selectedCaseId:v,loading:!1,error:null}}case"SET_PANEL":return{...r,activePanel:c.panel};case"SET_CONTENT":return{...r,skillContent:c.content,isDirty:c.content!==r.savedContent};case"CONTENT_SAVED":return{...r,savedContent:r.skillContent,isDirty:!1};case"SET_EVALS":return{...r,evals:c.evals};case"SELECT_CASE":return{...r,selectedCaseId:c.caseId};case"CASE_RUN_START":{const x=new Map(r.caseRunStates);return x.set(c.caseId,{status:"running",startedAt:Date.now(),mode:c.mode}),{...r,caseRunStates:x,runMode:c.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);x.set(c.caseId,{status:"complete",mode:v==null?void 0:v.mode});const p=new Map(r.inlineResults);return p.set(c.caseId,c.result),{...r,caseRunStates:x,inlineResults:p}}case"CASE_RUN_ERROR":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);x.set(c.caseId,{status:"error",mode:v==null?void 0:v.mode});const p=new Map(r.inlineResults);return p.set(c.caseId,{status:"error",errorMessage:c.error,assertions:[]}),{...r,caseRunStates:x,inlineResults:p}}case"CASE_RUN_CANCEL":{const x=new Map(r.caseRunStates),v=x.get(c.caseId);return x.set(c.caseId,{status:"cancelled",mode:v==null?void 0:v.mode}),{...r,caseRunStates:x}}case"BULK_RUN_START":{const x=new Map(r.caseRunStates);for(const v of c.caseIds)x.set(v,{status:"queued",mode:c.mode});return{...r,caseRunStates:x,bulkRunActive:!0,runMode:c.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...r,bulkRunActive:!1,latestBenchmark:c.benchmark??r.latestBenchmark,iterationCount:r.iterationCount+1};case"CANCEL_ALL":{const x=new Map(r.caseRunStates);for(const[v,p]of x)(p.status==="running"||p.status==="queued")&&x.set(v,{status:"cancelled"});return{...r,caseRunStates:x,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const x=new Map(r.inlineResults);return x.set(c.evalId,c.result),{...r,inlineResults:x}}case"OPEN_IMPROVE":return{...r,improveTarget:c.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...r,improveTarget:null};case"OPEN_AI_EDIT":return{...r,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...r,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...r,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...r,aiEditProgress:[...r.aiEditProgress,c.entry]};case"AI_EDIT_RESULT":{const x=c.evalChanges??[],v=new Map;for(let p=0;p<x.length;p++)v.set(p,!0);return{...r,aiEditLoading:!1,aiEditResult:{improved:c.improved,reasoning:c.reasoning,evalChanges:x},aiEditEvalChanges:x,aiEditEvalSelections:v}}case"AI_EDIT_ERROR":return{...r,aiEditLoading:!1,aiEditError:c.message,aiEditClassifiedError:c.classified??null};case"GENERATE_EVALS_START":return{...r,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...r,generateEvalsProgress:[...r.generateEvalsProgress,c.entry]};case"GENERATE_EVALS_DONE":return{...r,generateEvalsLoading:!1,evals:c.evals};case"GENERATE_EVALS_ERROR":return{...r,generateEvalsLoading:!1,generateEvalsError:c.classified};case"TOGGLE_EVAL_CHANGE":{const x=new Map(r.aiEditEvalSelections);return x.set(c.index,!x.get(c.index)),{...r,aiEditEvalSelections:x}}case"SELECT_ALL_EVAL_CHANGES":{const x=new Map(r.aiEditEvalSelections);for(const v of x.keys())x.set(v,!0);return{...r,aiEditEvalSelections:x}}case"DESELECT_ALL_EVAL_CHANGES":{const x=new Map(r.aiEditEvalSelections);for(const v of x.keys())x.set(v,!1);return{...r,aiEditEvalSelections:x}}case"SET_EVALS_RETRY":return{...r,aiEditEvalsRetry:c.evalsFile};case"SET_REGRESSIONS":return{...r,regressions:c.regressions};case"INCREMENT_ITERATION":return{...r,iterationCount:r.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...r,activationPrompts:c.prompts};case"ACTIVATION_START":return{...r,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null,activationStartedAt:Date.now()};case"ACTIVATION_RESULT":return{...r,activationResults:[...r.activationResults,c.result]};case"ACTIVATION_DONE":return{...r,activationRunning:!1,activationSummary:c.summary};case"ACTIVATION_ERROR":return{...r,activationRunning:!1,activationError:c.error};case"ACTIVATION_RESET":return{...r,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_TIMEOUT":return{...r,activationRunning:!1,activationError:"Activation test timed out after 120 seconds"};case"ACTIVATION_CANCEL":return{...r,activationRunning:!1};case"GENERATE_PROMPTS_START":return{...r,generatingPrompts:!0,generatingPromptsError:null};case"GENERATE_PROMPTS_DONE":return{...r,generatingPrompts:!1};case"GENERATE_PROMPTS_ERROR":return{...r,generatingPrompts:!1,generatingPromptsError:c.error};case"ACTIVATION_HISTORY_LOADED":return{...r,activationHistory:c.runs,activationHistoryLoading:!1};default:return r}}function Vh(r,c){const o=c.data;if(c.event==="output_ready"&&(r.output=o.output,o.durationMs!=null&&(r.durationMs=o.durationMs),o.tokens!=null&&(r.tokens=o.tokens)),c.event==="outputs_ready"&&(r.output=o.skillOutput,o.skillDurationMs!=null&&(r.durationMs=o.skillDurationMs),o.skillTokens!=null&&(r.tokens=o.skillTokens)),c.event==="assertion_result"){const u={assertion_id:o.assertion_id,text:o.text,pass:o.pass,reasoning:o.reasoning};r.assertions.find(x=>x.assertion_id===u.assertion_id)||r.assertions.push(u)}c.event==="case_complete"&&(r.status=o.status,r.passRate=o.pass_rate,r.errorMessage=o.error_message||void 0,r.classifiedError=o.classified_error||void 0)}const Ux=h.createContext(null);function il(){const r=h.useContext(Ux);if(!r)throw new Error("useWorkspace must be used within WorkspaceProvider");return r}function Qh({plugin:r,skill:c,origin:o,children:u}){const x=o==="installed",[v,p]=h.useReducer(Yh,{...qh,plugin:r,skill:c}),b=h.useRef(new Set),g=h.useRef(new Set),f=h.useRef(new Map),j=h.useCallback((X,se)=>{let le=f.current.get(X);le||(le={assertions:[]},f.current.set(X,le)),Vh(le,se),p({type:"UPDATE_INLINE_RESULT",evalId:X,result:{...le,assertions:[...le.assertions]}})},[]),y=h.useCallback(X=>{if(g.current.has(X))return;g.current.add(X);const se=f.current.get(X)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:X,result:{...se,assertions:[...se.assertions]}}),b.current.has(X)&&(b.current.delete(X),b.current.size===0&&Se.getLatestBenchmark(r,c).then(le=>p({type:"BULK_RUN_COMPLETE",benchmark:le})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[r,c]),T=h.useCallback((X,se)=>{g.current.has(X)||(g.current.add(X),p({type:"CASE_RUN_ERROR",caseId:X,error:se}),b.current.has(X)&&(b.current.delete(X),b.current.size===0&&Se.getLatestBenchmark(r,c).then(le=>p({type:"BULK_RUN_COMPLETE",benchmark:le})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[r,c]),{startCase:A,stopCase:L,stopAll:O}=Gh({onEvent:j,onDone:y,onError:T});h.useEffect(()=>()=>{O()},[O]),h.useEffect(()=>{let X=!1;async function se(){try{const[le,de,pe]=await Promise.allSettled([Se.getSkillDetail(r,c),Se.getEvals(r,c),Se.getLatestBenchmark(r,c)]);if(X)return;let Ve=null,dt=null;if(de.status==="fulfilled")Ve=de.value;else{const Xe=de.reason;(Xe==null?void 0:Xe.status)!==404&&(dt=(Xe==null?void 0:Xe.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:le.status==="fulfilled"?le.value.skillContent:"",evals:Ve,evalsError:dt,benchmark:pe.status==="fulfilled"?pe.value:null})}catch(le){X||p({type:"SET_ERROR",error:le.message})}}return se(),ut(),()=>{X=!0}},[r,c,ut]);const G=h.useCallback(async()=>{if(!x)try{await Se.applyImprovement(r,c,v.skillContent),p({type:"CONTENT_SAVED"})}catch(X){p({type:"SET_ERROR",error:X.message})}},[x,r,c,v.skillContent]),q=h.useCallback(async X=>{if(!x)try{const se=await Se.saveEvals(r,c,X);p({type:"SET_EVALS",evals:se})}catch(se){p({type:"SET_ERROR",error:se.message})}},[x,r,c]),J=h.useCallback((X,se="benchmark")=>{if(x)return;const le=v.caseRunStates.get(X);if((le==null?void 0:le.status)!=="running")if(f.current.delete(X),g.current.delete(X),p({type:"CASE_RUN_START",caseId:X,mode:se}),se==="comparison"){const de=`/api/skills/${r}/${c}/compare`;A(X,de,{eval_ids:[X]})}else{const de=`/api/skills/${r}/${c}/benchmark/case/${X}`;A(X,de,se==="baseline"?{baseline_only:!0}:void 0)}},[x,r,c,v.caseRunStates,A]),ie=h.useCallback((X="benchmark")=>{var de;if(x)return;const se=((de=v.evals)==null?void 0:de.evals)??[];if(se.length===0)return;const le=se.map(pe=>pe.id);for(const pe of le)f.current.delete(pe),g.current.delete(pe);p({type:"BULK_RUN_START",caseIds:le,mode:X}),b.current=new Set(le);for(const pe of le)if(X==="comparison")A(pe,`/api/skills/${r}/${c}/compare`,{eval_ids:[pe]});else{const Ve=`/api/skills/${r}/${c}/benchmark/case/${pe}`;A(pe,Ve,X==="baseline"?{baseline_only:!0}:void 0)}},[x,r,c,v.evals,A]),Z=h.useCallback(X=>{L(X),p({type:"CASE_RUN_CANCEL",caseId:X}),b.current.delete(X),g.current.add(X)},[L]),ae=h.useCallback(()=>{O(),p({type:"CANCEL_ALL"}),b.current.clear()},[O]),ne=h.useCallback(async(X,se)=>{p({type:"OPEN_IMPROVE",evalId:X})},[]),$=h.useCallback(async(X,se)=>{try{await Se.applyImprovement(r,c,se),p({type:"SET_CONTENT",content:se}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),J(X,"benchmark")}catch(le){p({type:"SET_ERROR",error:le.message})}},[r,c,J]),F=Xo(),xe=h.useRef(null),Ne=h.useRef(0);h.useEffect(()=>{const X=F.events;for(let se=Ne.current;se<X.length;se++){const le=X[se],de=le.data;if(le.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:de.phase,message:de.message}}),le.event==="done"){const pe=de.improved,Ve=de.reasoning,dt=de.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:pe,reasoning:Ve,evalChanges:dt})}if(le.event==="error"){const pe=de;p({type:"AI_EDIT_ERROR",message:pe.description||"Unknown error",classified:pe})}}Ne.current=X.length},[F.events]),h.useEffect(()=>{F.error&&p({type:"AI_EDIT_ERROR",message:F.error})},[F.error]),h.useEffect(()=>()=>{F.stop()},[F.stop]);const ge=h.useCallback(async(X,se,le)=>{x||(Ne.current=0,p({type:"AI_EDIT_LOADING"}),xe.current=F.stop,F.start(`/api/skills/${r}/${c}/improve?sse`,{mode:"instruct",instruction:X,content:v.skillContent,evals:v.evals??{skill_name:c,evals:[]},provider:se,model:le}))},[x,r,c,v.skillContent,v.evals,F]),je=h.useCallback(()=>{F.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[F]),Q=h.useCallback(async()=>{const X=v.aiEditResult;if(X!=null&&X.improved)try{if(await Se.applyImprovement(r,c,X.improved),p({type:"SET_CONTENT",content:X.improved}),p({type:"CONTENT_SAVED"}),v.aiEditEvalChanges.length>0&&Array.from(v.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:le}=await Uh(async()=>{const{mergeEvalChanges:Ve}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:Ve}},[]),de=v.evals??{skill_name:c,evals:[]},pe=le(de,v.aiEditEvalChanges,v.aiEditEvalSelections);try{const Ve=await Se.saveEvals(r,c,pe);p({type:"SET_EVALS",evals:Ve})}catch(Ve){p({type:"SET_EVALS_RETRY",evalsFile:pe}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${Ve.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(se){p({type:"SET_ERROR",error:se.message})}},[r,c,v.aiEditResult,v.evals,v.aiEditEvalChanges,v.aiEditEvalSelections]),ee=h.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),me=h.useCallback(X=>{p({type:"TOGGLE_EVAL_CHANGE",index:X})},[]),C=h.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),E=h.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),K=h.useCallback(async()=>{const X=v.aiEditEvalsRetry;if(X)try{const se=await Se.saveEvals(r,c,X);p({type:"SET_EVALS",evals:se}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(se){p({type:"SET_ERROR",error:`Retry failed: ${se.message}`})}},[r,c,v.aiEditEvalsRetry]),W=h.useCallback(async()=>{try{const X=await Se.getSkillDetail(r,c);p({type:"SET_CONTENT",content:X.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[r,c]),oe=Xo(),N=h.useRef(0);h.useEffect(()=>{const X=oe.events;for(let se=N.current;se<X.length;se++){const le=X[se],de=le.data;if(le.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:de.phase,message:de.message}}),le.event==="done"){const pe=de;Se.saveEvals(r,c,pe).then(Ve=>p({type:"GENERATE_EVALS_DONE",evals:Ve})).catch(Ve=>p({type:"SET_ERROR",error:Ve.message}))}le.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:de})}N.current=X.length},[oe.events,r,c]),h.useEffect(()=>{oe.error&&p({type:"SET_ERROR",error:oe.error})},[oe.error]),h.useEffect(()=>()=>{oe.stop()},[oe.stop]);const z=h.useCallback(async()=>{x||(N.current=0,p({type:"GENERATE_EVALS_START"}),oe.start(`/api/skills/${r}/${c}/generate-evals?sse`))},[x,r,c,oe]),V=Xo(),P=h.useRef(0),{config:I}=Na();h.useEffect(()=>()=>{V.stop()},[V.stop]),h.useEffect(()=>{const X=V.events;for(let se=P.current;se<X.length;se++){const le=X[se];if(le.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:le.data}),le.event==="done"){te.current&&(clearTimeout(te.current),te.current=null);const de=le.data;p({type:"ACTIVATION_DONE",summary:de});const pe={id:`run-${Date.now()}`,timestamp:new Date().toISOString(),model:(I==null?void 0:I.model)||"unknown",provider:(I==null?void 0:I.provider)||"unknown",promptCount:de.total,summary:{precision:de.precision,recall:de.recall,reliability:de.reliability,tp:de.tp,tn:de.tn,fp:de.fp,fn:de.fn}};p({type:"ACTIVATION_HISTORY_LOADED",runs:[pe,...v.activationHistory??[]]})}}P.current=X.length},[V.events,I,v.activationHistory]),h.useEffect(()=>{V.error&&(te.current&&(clearTimeout(te.current),te.current=null),p({type:"ACTIVATION_ERROR",error:V.error}))},[V.error]);const te=h.useRef(null),ve=h.useCallback(()=>{te.current&&(clearTimeout(te.current),te.current=null),V.stop(),p({type:"ACTIVATION_CANCEL",totalPrompts:0})},[V]),Be=h.useCallback(X=>{const le=X.trim().split(`
|
|
52
|
+
`).filter(Boolean).map(pe=>pe.startsWith("!")?{prompt:pe.slice(1).trim(),expected:"should_not_activate"}:pe.startsWith("+")?{prompt:pe.slice(1).trim(),expected:"should_activate"}:{prompt:pe.trim(),expected:"auto"});P.current=0,p({type:"ACTIVATION_START"}),p({type:"SET_ACTIVATION_PROMPTS",prompts:X});const de={prompts:le};I!=null&&I.provider&&(de.provider=I.provider),I!=null&&I.model&&(de.model=I.model),V.start(`/api/skills/${r}/${c}/activation-test`,de),te.current&&clearTimeout(te.current),te.current=setTimeout(()=>{V.stop(),p({type:"ACTIVATION_TIMEOUT"}),te.current=null},12e4)},[r,c,V,I]),Ae=h.useCallback(async(X=8)=>{p({type:"GENERATE_PROMPTS_START"});try{const se={count:X};I!=null&&I.provider&&(se.provider=I.provider),I!=null&&I.model&&(se.model=I.model);const le=await fetch(`/api/skills/${r}/${c}/activation-prompts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(se)});if(!le.ok){let mt=`HTTP ${le.status}`;try{const tl=await le.json();tl.error&&(mt=tl.error)}catch{}throw new Error(mt)}const de=le.body.getReader(),pe=new TextDecoder;let Ve="",dt="",Xe=[];for(;;){const{done:mt,value:tl}=await de.read();if(mt)break;Ve+=pe.decode(tl,{stream:!0});const Qt=Ve.split(`
|
|
53
|
+
`);Ve=Qt.pop()||"";for(const We of Qt)if(We.startsWith("event: "))dt=We.slice(7).trim();else if(We.startsWith("data: ")){try{const Dt=JSON.parse(We.slice(6));if(dt==="done"&&(Xe=Dt.prompts||[]),dt==="error")throw new Error(Dt.message||Dt.description||"Generation failed")}catch(Dt){if(!(Dt instanceof Error&&Dt.message!=="Generation failed"))throw Dt}dt=""}}const Lt=Xe.map(mt=>`${mt.expected==="should_activate"?"+":"!"}${mt.prompt}`).join(`
|
|
54
|
+
`);p({type:"SET_ACTIVATION_PROMPTS",prompts:Lt}),p({type:"GENERATE_PROMPTS_DONE"})}catch(se){p({type:"GENERATE_PROMPTS_ERROR",error:se.message})}},[r,c,I]),ut=h.useCallback(async()=>{try{const X=await fetch(`/api/skills/${r}/${c}/activation-history`);if(!X.ok){if(X.status===404){p({type:"ACTIVATION_HISTORY_LOADED",runs:[]});return}return}const se=await X.json();p({type:"ACTIVATION_HISTORY_LOADED",runs:se.runs||[]})}catch{}},[r,c]),zt=h.useMemo(()=>({state:v,dispatch:p,isReadOnly:x,saveContent:G,saveEvals:q,runCase:J,runAll:ie,cancelCase:Z,cancelAll:ae,improveForCase:ne,applyImproveAndRerun:$,refreshSkillContent:W,generateEvals:z,runActivationTest:Be,cancelActivation:ve,generateActivationPrompts:Ae,fetchActivationHistory:ut,submitAiEdit:ge,cancelAiEdit:je,applyAiEdit:Q,discardAiEdit:ee,toggleEvalChange:me,selectAllEvalChanges:C,deselectAllEvalChanges:E,retryEvalsSave:K}),[v,x,G,q,J,ie,Z,ae,ne,$,W,z,Be,ve,Ae,ut,ge,je,Q,ee,me,C,E,K]);return a.jsx(Ux.Provider,{value:zt,children:u})}function Xh(r){return r==null?"var(--text-tertiary)":r>=.7?"var(--green)":r>=.4?"var(--yellow)":"var(--red)"}function Zh(r){return r==null?"var(--surface-3)":r>=.7?"var(--green-muted)":r>=.4?"var(--yellow-muted)":"var(--red-muted)"}function Kh({state:r,isReadOnly:c,onDelete:o}){const{plugin:u,skill:x,evals:v,latestBenchmark:p,isDirty:b,caseRunStates:g,regressions:f,iterationCount:j}=r,y=Array.from(g.values()).some(q=>q.status==="running"||q.status==="queued"),T=p==null?void 0:p.overall_pass_rate,A=(v==null?void 0:v.evals.reduce((q,J)=>q+J.assertions.length,0))??0,L=(v==null?void 0:v.evals.length)??0,O=Xh(T),G=Zh(T);return a.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:[a.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[a.jsx("span",{style:{color:"var(--text-tertiary)"},children:u}),a.jsx($h,{}),a.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:x}),c&&a.jsxs("span",{className:"ml-2 flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:[a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),b&&a.jsx("span",{className:"ml-2 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded",style:{background:"var(--yellow-muted)",color:"var(--yellow)"},children:"unsaved"}),y&&a.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[a.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!c&&o&&a.jsx("button",{disabled:y,onClick:()=>{window.confirm(`Delete skill "${x}"? This cannot be undone.`)&&o()},title:"Delete skill",className:"flex items-center justify-center transition-colors duration-150",style:{background:"none",border:"none",cursor:y?"not-allowed":"pointer",color:"var(--text-tertiary)",padding:4,opacity:y?.4:1,borderRadius:4},onMouseEnter:q=>{y||(q.currentTarget.style.color="var(--red)")},onMouseLeave:q=>{q.currentTarget.style.color="var(--text-tertiary)"},children:a.jsx(Jh,{})}),f.length>0&&a.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),a.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),a.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),f.length," regression",f.length>1?"s":""]}),j>0&&a.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",j]}),a.jsx("span",{className:"pill",style:{background:G,color:O},children:T!=null?`${Math.round(T*100)}%`:"--"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[L," case",L!==1?"s":""," / ",A," assert",A!==1?"s":""]})]})]})}function $h(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Jh(){return a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Wh=[{label:"Build",tabs:[{id:"editor",label:"Editor",shortcut:"1"},{id:"tests",label:"Tests",shortcut:"2"}]},{label:"Evaluate",tabs:[{id:"run",label:"Run",shortcut:"3"},{id:"activation",label:"Activation",shortcut:"4"}]},{label:"Insights",tabs:[{id:"history",label:"History",shortcut:"5"},{id:"leaderboard",label:"Leaderboard",shortcut:"6"},{id:"deps",label:"Deps",shortcut:"7"}]}];function Fh({id:r}){const c={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(r){case"editor":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]});case"tests":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M9 11l3 3L22 4"}),a.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]});case"run":return a.jsx("svg",{...c,children:a.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return a.jsxs("svg",{...c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("circle",{cx:"12",cy:"12",r:"6"}),a.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return a.jsxs("svg",{...c,children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"leaderboard":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]});case"deps":return a.jsxs("svg",{...c,children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}}function Ih({activePanel:r,onPanelChange:c,isDirty:o,isRunning:u,hasRegressions:x,isActivationRunning:v}){return a.jsx("div",{className:"flex items-center gap-0.5 px-3 overflow-x-auto",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",flexShrink:0},children:Wh.map((p,b)=>a.jsxs("div",{className:"flex items-center",children:[b>0&&a.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),p.tabs.map(g=>{const f=r===g.id,j=g.id==="editor"&&o||g.id==="run"&&u||g.id==="activation"&&v||g.id==="history"&&x,y=g.id==="run"||g.id==="activation"?"var(--accent)":g.id==="history"?"var(--red)":"var(--yellow)";return a.jsxs("button",{onClick:()=>c(g.id),title:`${g.label} (Ctrl+${g.shortcut})`,className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[12px] font-medium transition-colors duration-150",style:{background:"transparent",color:f?"var(--text-primary)":"var(--text-tertiary)",borderBottom:f?"2px solid var(--accent)":"2px solid transparent",cursor:"pointer",border:"none",borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:f?"var(--accent)":"transparent",whiteSpace:"nowrap"},onMouseEnter:T=>{f||(T.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:T=>{f||(T.currentTarget.style.color="var(--text-tertiary)")},children:[a.jsx(Fh,{id:g.id}),g.label,j&&a.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:y}})]},g.id)})]},p.label))})}function Ph(r){const c=r.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!c)return{metadata:{},body:r};const o=c[1],u=c[2].trim(),x={},v=o.split(`
|
|
55
|
+
`);let p="",b=!1;for(const g of v){const f=g.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&b){const T=f[1],A=f[2].trim();let L=x[p];if((typeof L!="object"||Array.isArray(L))&&(L={},x[p]=L),!A)L[T]=[];else{const O=A.match(/^\[(.+)\]$/);O?L[T]=O[1].split(",").map(G=>G.trim().replace(/^["']|["']$/g,"")).filter(Boolean):L[T]=A.replace(/^["']|["']$/g,"")}continue}const j=g.match(/^\s+-\s+(.+)$/);if(j&&p){b=!1;const T=x[p];Array.isArray(T)?T.push(j[1].trim().replace(/^["']|["']$/g,"")):x[p]=[j[1].trim().replace(/^["']|["']$/g,"")];continue}const y=g.match(/^([\w-]+):\s*(.*)$/);if(y){p=y[1];const T=y[2].trim();if(b=!1,!T){x[p]={},b=!0;continue}const A=T.match(/^\[(.+)\]$/);if(A){x[p]=A[1].split(",").map(L=>L.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}x[p]=T.replace(/^["']|["']$/g,"")}}return{metadata:x,body:u}}function Nr(r){if(!r)return"";try{let c=r.replace(/^---\n[\s\S]*?\n---\n?/,""),o=ev(c);return o=o.replace(/```(\w*)\n([\s\S]*?)```/g,'<pre style="background:var(--surface-2);padding:0.75rem;border-radius:6px;overflow-x:auto;font-size:12px;line-height:1.5;margin:0.5rem 0;border:1px solid var(--border-subtle)"><code>$2</code></pre>'),o=o.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),o=o.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),o=o.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),o=o.replace(/\*([^*]+)\*/g,"<em>$1</em>"),o=o.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),o=o.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),o=o.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),o=o.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),o=o.replace(/\n/g,"<br/>"),o}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</pre>`}}function ev(r){const c=r.split(`
|
|
56
|
+
`),o=[];let u=0;for(;u<c.length;)if(c[u].trim().startsWith("|")&&u+1<c.length&&c[u+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(c[u+1])){const x=bx(c[u]);u+=2;const v=[];for(;u<c.length&&c[u].trim().startsWith("|");)v.push(bx(c[u])),u++;const p='style="text-align:left;padding:0.4rem 0.6rem;font-weight:600;font-size:12px;color:var(--text-primary);border-bottom:1px solid var(--border-default)"',b='style="padding:0.4rem 0.6rem;font-size:12px;color:var(--text-secondary);border-bottom:1px solid var(--border-subtle)"';let g='<table style="width:100%;border-collapse:collapse;margin:0.5rem 0;border:1px solid var(--border-subtle);border-radius:6px;overflow:hidden">';g+="<thead><tr>";for(const f of x)g+=`<th ${p}>${f}</th>`;g+="</tr></thead><tbody>";for(const f of v){g+="<tr>";for(const j of f)g+=`<td ${b}>${j}</td>`;g+="</tr>"}g+="</tbody></table>",o.push(g)}else o.push(c[u]),u++;return o.join(`
|
|
57
|
+
`)}function bx(r){return r.split("|").map(c=>c.trim()).filter(c=>c.length>0)}function Er(r,c){const o=r.split(`
|
|
58
|
+
`),u=c.split(`
|
|
59
|
+
`);if(o.length>1e3||u.length>1e3)return[...o.map(j=>({type:"unchanged",content:j}))];const x=o.length,v=u.length,p=Array.from({length:x+1},()=>new Array(v+1).fill(0));for(let j=1;j<=x;j++)for(let y=1;y<=v;y++)o[j-1]===u[y-1]?p[j][y]=p[j-1][y-1]+1:p[j][y]=Math.max(p[j-1][y],p[j][y-1]);const b=[];let g=x,f=v;for(;g>0||f>0;)g>0&&f>0&&o[g-1]===u[f-1]?(b.push({type:"unchanged",content:o[g-1]}),g--,f--):f>0&&(g===0||p[g][f-1]>=p[g-1][f])?(b.push({type:"added",content:u[f-1]}),f--):(b.push({type:"removed",content:o[g-1]}),g--);return b.reverse()}function tv(r,c){if(c&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(r))return a.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const u=new Set(["generating","comparing","preparing","generating_skill","generating_baseline","scoring","action_items"]);return a.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:u.has(r)?"var(--accent)":"var(--green)"}})}function ss({entries:r,isRunning:c}){const[o,u]=h.useState(!1),x=h.useRef(null);return h.useEffect(()=>{x.current&&!o&&(x.current.scrollTop=x.current.scrollHeight)},[r,o]),r.length===0&&!c?null:a.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("button",{onClick:()=>u(!o),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:v=>{v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--text-tertiary)"},children:[a.jsxs("span",{className:"flex items-center gap-2",children:[c&&a.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",r.length,")"]}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:o?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!o&&a.jsx("div",{ref:x,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:r.map((v,p)=>{const b=p===r.length-1&&c,g=p===0?"0s":`+${((v.timestamp-r[0].timestamp)/1e3).toFixed(1)}s`;return a.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:b?1:.7},children:[tv(v.phase,b),a.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:g}),a.jsx("span",{style:{color:b?"var(--text-primary)":"var(--text-secondary)"},children:v.message}),v.current!=null&&v.total!=null&&a.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",v.current,"/",v.total,"]"]})]},p)})})]})}const jx={rate_limit:{icon:"⏱",color:"var(--amber, #f59e0b)"},context_window:{icon:"⚠",color:"var(--amber, #f59e0b)"},auth:{icon:"🔒",color:"var(--red, #ef4444)"},timeout:{icon:"⌛",color:"var(--amber, #f59e0b)"},provider_unavailable:{icon:"⚡",color:"var(--red, #ef4444)"},parse_error:{icon:"❓",color:"var(--amber, #f59e0b)"},unknown:{icon:"❌",color:"var(--red, #ef4444)"}};function kr({error:r,onRetry:c,onDismiss:o}){const[u,x]=h.useState(null),v=h.useRef(null);h.useEffect(()=>(r.category==="rate_limit"&&r.retryAfterMs?x(Math.ceil(r.retryAfterMs/1e3)):x(null),()=>{v.current&&clearInterval(v.current)}),[r]),h.useEffect(()=>{if(!(u==null||u<=0))return v.current=setInterval(()=>{x(g=>g==null||g<=1?(v.current&&clearInterval(v.current),0):g-1)},1e3),()=>{v.current&&clearInterval(v.current)}},[u!=null&&u>0]);const p=jx[r.category]||jx.unknown,b=u!=null&&u>0;return a.jsxs("div",{className:"rounded-lg overflow-hidden animate-fade-in",style:{border:`1px solid color-mix(in srgb, ${p.color} 30%, transparent)`,background:`color-mix(in srgb, ${p.color} 6%, var(--surface-1))`},children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{style:{fontSize:14},children:p.icon}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:p.color},children:r.title})]}),o&&a.jsx("button",{onClick:o,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-3.5 pb-3",children:[a.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:r.description}),a.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.hint}),(c||u!=null)&&a.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:c&&a.jsx("button",{onClick:c,disabled:b,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:b?.5:1},children:b?`Retry in ${u}s`:"Retry"})})]})]})}function lv({plugin:r,skill:c,skillContent:o,onApplied:u}){const[x,v]=h.useState("closed"),{config:p}=Na(),[b,g]=h.useState("claude-cli"),[f,j]=h.useState("opus"),[y,T]=h.useState([]),[A,L]=h.useState(""),[O,G]=h.useState(""),[q,J]=h.useState(null),[ie,Z]=h.useState(null),[ae,ne]=h.useState([]),[$,F]=h.useState(!1),xe=h.useRef(null);h.useEffect(()=>{if(!p)return;p.providers.find(E=>E.id==="claude-cli"&&E.available)&&(g("claude-cli"),j("opus"))},[p]),h.useEffect(()=>()=>{var C;(C=xe.current)==null||C.abort()},[]);function Ne(){return p==null?void 0:p.providers.find(C=>C.id===b&&C.available)}const ge=h.useCallback(()=>{var C;(C=xe.current)==null||C.abort(),v("open")},[]);async function je(){v("loading"),J(null),Z(null),ne([]);const C=new AbortController;xe.current=C;try{const E=await fetch(`/api/skills/${encodeURIComponent(r)}/${encodeURIComponent(c)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,model:f}),signal:C.signal});if(!E.ok||!E.body){let z=`HTTP ${E.status}`;try{const V=await E.json();V.error&&(z=V.error)}catch{}throw new Error(z)}const K=E.body.getReader(),W=new TextDecoder;let oe="",N="";for(;;){const{done:z,value:V}=await K.read();if(z)break;oe+=W.decode(V,{stream:!0});const P=oe.split(`
|
|
60
|
+
`);oe=P.pop()||"";for(const I of P)if(I.startsWith("event: "))N=I.slice(7).trim();else if(I.startsWith("data: ")){try{const te=JSON.parse(I.slice(6));N==="progress"?ne(ve=>[...ve,{phase:te.phase,message:te.message,timestamp:Date.now()}]):N==="done"||N==="complete"?(L(te.improved),G(te.reasoning||""),T(Er(te.original||o,te.improved)),v("diff_shown")):N==="error"&&(J(te.message||te.description||"Unknown error"),te.category&&Z(te),v("open"))}catch{}N=""}}}catch(E){E.name!=="AbortError"&&(J(E.message),v("open"))}finally{xe.current=null}}async function Q(){F(!0);try{await Se.applyImprovement(r,c,A),u(A),v("closed")}catch(C){J(C.message)}finally{F(!1)}}function ee(){v("closed"),T([]),L(""),G(""),J(null)}if(x==="closed")return a.jsxs("button",{onClick:()=>v("open"),className:"btn btn-secondary mb-5",disabled:!o,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const me=Ne();return a.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]})}),a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),a.jsx("button",{onClick:ee,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:C=>{C.currentTarget.style.background="var(--surface-3)"},onMouseLeave:C=>{C.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-5 py-4",children:[(x==="open"||x==="loading")&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),a.jsx("select",{className:"input-field text-[12px] py-1.5",value:b,onChange:C=>{g(C.target.value);const E=p==null?void 0:p.providers.find(K=>K.id===C.target.value);E!=null&&E.models[0]&&j(E.models[0].id)},disabled:x==="loading",children:p==null?void 0:p.providers.filter(C=>C.available).map(C=>a.jsx("option",{value:C.id,children:C.label},C.id))})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:C=>j(C.target.value),disabled:x==="loading",children:me==null?void 0:me.models.map(C=>a.jsx("option",{value:C.id,children:C.label},C.id))})]}),x==="loading"?a.jsx("button",{onClick:ge,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):a.jsx("button",{onClick:je,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),x==="loading"&&ae.length>0&&a.jsx("div",{className:"mt-3",children:a.jsx(ss,{entries:ae,isRunning:!0})})]}),q&&a.jsx("div",{className:"mb-4",children:ie?a.jsx(kr,{error:ie,onRetry:je,onDismiss:()=>{J(null),Z(null)}}):a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:q})}),x==="diff_shown"&&a.jsxs(a.Fragment,{children:[O&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),O]}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:y.map((C,E)=>a.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:C.type==="added"?"rgba(34,197,94,0.1)":C.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:C.type==="added"?"var(--green)":C.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:C.type==="added"?"3px solid var(--green)":C.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:C.type==="added"?"+":C.type==="removed"?"-":" "}),C.content]},E))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:Q,disabled:$,className:"btn btn-primary",children:$?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),a.jsx("button",{onClick:ee,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const Sx={remove:{bg:"var(--red-muted)",color:"var(--red)",label:"REMOVE"},modify:{bg:"rgba(251,191,36,0.15)",color:"#fbbf24",label:"MODIFY"},add:{bg:"var(--green-muted)",color:"var(--green)",label:"ADD"}},av={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function nv({change:r,index:c,selected:o,onToggle:u,originalEval:x}){var y;const[v,p]=h.useState(!1),b=Sx[r.action]??Sx.add,g=av[r.action]??"var(--border-subtle)",f=r.action==="remove"?(x==null?void 0:x.name)??`Eval #${r.evalId}`:((y=r.eval)==null?void 0:y.name)??"Unnamed",j=h.useCallback(()=>u(c),[u,c]);return a.jsxs("div",{className:"rounded-lg transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderLeft:`3px solid ${g}`,opacity:o?1:.5},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[a.jsx("input",{type:"checkbox",checked:o,onChange:j,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),a.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:b.bg,color:b.color,padding:"1px 6px"},children:b.label}),a.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),a.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:r.reason}),a.jsx("button",{onClick:()=>p(!v),className:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:T=>{T.currentTarget.style.background="var(--surface-3)"},onMouseLeave:T=>{T.currentTarget.style.background="transparent"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:v?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),v&&a.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[r.action==="add"&&r.eval&&a.jsx(sv,{evalCase:r.eval}),r.action==="modify"&&r.eval&&x&&a.jsx(rv,{original:x,proposed:r.eval}),r.action==="remove"&&x&&a.jsx(iv,{evalCase:x})]})]})}function sv({evalCase:r}){var c;return a.jsxs("div",{className:"pt-2.5 space-y-2",children:[a.jsx(lc,{label:"Prompt",value:r.prompt}),a.jsx(lc,{label:"Expected",value:r.expected_output}),a.jsxs("div",{children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=r.assertions)==null?void 0:c.length)??0,")"]}),a.jsx("div",{className:"mt-1 space-y-1",children:(r.assertions??[]).map(o=>a.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[a.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",o.text]},o.id))})]})]})}function rv({original:r,proposed:c}){const o=[];r.name!==c.name&&o.push({label:"Name",old:r.name,new:c.name}),r.prompt!==c.prompt&&o.push({label:"Prompt",old:r.prompt,new:c.prompt}),r.expected_output!==c.expected_output&&o.push({label:"Expected",old:r.expected_output,new:c.expected_output});const u=r.assertions??[],x=c.assertions??[],v=new Set(u.map(f=>f.text)),p=new Set(x.map(f=>f.text)),b=x.filter(f=>!v.has(f.text)),g=u.filter(f=>!p.has(f.text));return a.jsxs("div",{className:"pt-2.5 space-y-2",children:[o.map(f=>a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),a.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[a.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",ac(f.old,120)]}),a.jsxs("div",{style:{color:"var(--green)"},children:["+ ",ac(f.new,120)]})]})]},f.label)),(b.length>0||g.length>0)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),a.jsxs("div",{className:"mt-1 space-y-0.5",children:[g.map(f=>a.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),b.map(f=>a.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),o.length===0&&b.length===0&&g.length===0&&a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function iv({evalCase:r}){var c;return a.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[a.jsx(lc,{label:"Prompt",value:r.prompt}),a.jsxs("div",{children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=r.assertions)==null?void 0:c.length)??0,")"]}),a.jsx("div",{className:"mt-1 space-y-0.5",children:(r.assertions??[]).map(o=>a.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:o.text},o.id))})]})]})}function lc({label:r,value:c}){return a.jsxs("div",{children:[a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),a.jsx("div",{className:"mt-0.5 text-[11px] p-2 rounded font-mono",style:{background:"var(--surface-1)",color:"var(--text-secondary)",whiteSpace:"pre-wrap"},children:ac(c,300)})]})}function ac(r,c){return r.length>c?r.slice(0,c)+"...":r}const Nx={remove:0,modify:1,add:2};function ov({changes:r,selections:c,currentEvals:o,onToggle:u,onSelectAll:x,onDeselectAll:v}){if(r.length===0)return null;const p=r.map((g,f)=>({change:g,originalIndex:f}));p.sort((g,f)=>(Nx[g.change.action]??2)-(Nx[f.change.action]??2));const b=Array.from(c.values()).filter(Boolean).length;return a.jsxs("div",{className:"mt-3 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",b,"/",r.length," selected)"]})]}),a.jsxs("div",{className:"flex gap-1.5",children:[a.jsx("button",{onClick:x,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--accent)",background:"transparent"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-muted)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Select All"}),a.jsx("button",{onClick:v,className:"text-[10px] px-2 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:g=>{g.currentTarget.style.background="var(--surface-3)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Deselect All"})]})]}),a.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:p.map(({change:g,originalIndex:f})=>a.jsx(nv,{change:g,index:f,selected:c.get(f)??!1,onToggle:u,originalEval:g.evalId!=null?o.find(j=>j.id===g.evalId):void 0},f))})]})}function cv(){var C;const{state:r,dispatch:c,submitAiEdit:o,applyAiEdit:u,discardAiEdit:x,cancelAiEdit:v,toggleEvalChange:p,selectAllEvalChanges:b,deselectAllEvalChanges:g,retryEvalsSave:f}=il(),{aiEditLoading:j,aiEditResult:y,aiEditError:T,aiEditClassifiedError:A,aiEditProgress:L,aiEditEvalChanges:O,aiEditEvalSelections:G,aiEditEvalsRetry:q}=r,[J,ie]=h.useState(""),{config:Z}=Na(),[ae,ne]=h.useState("claude-cli"),[$,F]=h.useState("opus"),xe=h.useRef(null);h.useEffect(()=>{var E;(E=xe.current)==null||E.focus()},[]),h.useEffect(()=>{if(!Z)return;Z.providers.find(K=>K.id==="claude-cli"&&K.available)&&(ne("claude-cli"),F("opus"))},[Z]);const Ne=Z==null?void 0:Z.providers.find(E=>E.id===ae&&E.available),ge=h.useCallback(()=>{const E=J.trim();!E||j||o(E,ae,$)},[J,j,o,ae,$]),je=h.useCallback(E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),ge()),E.key==="Escape"&&(E.preventDefault(),j?v():x())},[ge,j,v,x]),Q=h.useCallback(()=>{c({type:"CLOSE_AI_EDIT"}),c({type:"OPEN_AI_EDIT"})},[c]),ee=y?Er(r.skillContent,y.improved):[],me=((C=r.evals)==null?void 0:C.evals)??[];return a.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-2)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 4V2"}),a.jsx("path",{d:"M15 16v-2"}),a.jsx("path",{d:"M8 9h2"}),a.jsx("path",{d:"M20 9h2"}),a.jsx("path",{d:"M17.8 11.8L19 13"}),a.jsx("path",{d:"M15 9h.01"}),a.jsx("path",{d:"M17.8 6.2L19 5"}),a.jsx("path",{d:"M11 6.2L9.7 5"}),a.jsx("path",{d:"M3 21l9-9"})]})}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),a.jsx("button",{onClick:x,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:E=>{E.currentTarget.style.background="var(--surface-3)"},onMouseLeave:E=>{E.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"px-4 py-3",children:[!y&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-end gap-2.5",children:[a.jsx("div",{className:"flex-1",children:a.jsx("textarea",{ref:xe,value:J,onChange:E=>ie(E.target.value),onKeyDown:je,placeholder:"e.g., Add an error handling section...",disabled:j,rows:1,className:"w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:6,padding:"8px 12px",fontSize:12.5,lineHeight:1.5,fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",minHeight:36,maxHeight:96},onInput:E=>{const K=E.currentTarget;K.style.height="auto",K.style.height=Math.min(K.scrollHeight,96)+"px"}})}),a.jsxs("div",{style:{minWidth:100},children:[a.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),a.jsx("select",{className:"input-field text-[11px] py-1",value:ae,onChange:E=>{ne(E.target.value);const K=Z==null?void 0:Z.providers.find(W=>W.id===E.target.value);K!=null&&K.models[0]&&F(K.models[0].id)},disabled:j,style:{width:"100%"},children:Z==null?void 0:Z.providers.filter(E=>E.available).map(E=>a.jsx("option",{value:E.id,children:E.label},E.id))})]}),a.jsxs("div",{style:{minWidth:80},children:[a.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsx("select",{className:"input-field text-[11px] py-1",value:$,onChange:E=>F(E.target.value),disabled:j,style:{width:"100%"},children:Ne==null?void 0:Ne.models.map(E=>a.jsx("option",{value:E.id,children:E.label},E.id))})]}),j?a.jsx("button",{onClick:v,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):a.jsx("button",{onClick:ge,disabled:!J.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),j&&L.length>0&&a.jsx("div",{className:"mt-2.5",children:a.jsx(ss,{entries:L,isRunning:!0})})]}),T&&a.jsx("div",{className:"mt-3",children:A?a.jsx(kr,{error:A,onRetry:Q,onDismiss:x}):a.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),y&&a.jsxs("div",{className:"animate-fade-in",children:[y.reasoning&&a.jsxs("div",{className:"mb-3 px-3 py-2.5 rounded-lg text-[11.5px]",style:{background:"rgba(168,85,247,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(168,85,247,0.2)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),y.reasoning]}),a.jsx("div",{className:"mb-1",children:a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:ee.map((E,K)=>a.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:E.type==="added"?"rgba(34,197,94,0.1)":E.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:E.type==="added"?"var(--green)":E.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:E.type==="added"?"3px solid var(--green)":E.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:E.type==="added"?"+":E.type==="removed"?"-":" "}),E.content]},K))}),a.jsx(ov,{changes:O,selections:G,currentEvals:me,onToggle:p,onSelectAll:b,onDeselectAll:g}),q&&a.jsxs("div",{className:"mt-3 px-3 py-2.5 rounded-lg text-[12px] flex items-center justify-between",style:{background:"rgba(251,191,36,0.12)",border:"1px solid rgba(251,191,36,0.3)",color:"#fbbf24"},children:[a.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),a.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),a.jsxs("div",{className:"flex gap-2 mt-3",children:[a.jsxs("button",{onClick:u,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),a.jsx("button",{onClick:x,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),a.jsx("button",{onClick:Q,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function uv(r,c){const[o,u]=h.useState([]),[x,v]=h.useState("SKILL.md"),[p,b]=h.useState(null),[g,f]=h.useState(!1),[j,y]=h.useState(null),T=h.useCallback(async()=>{try{const O=await Se.getSkillFiles(r,c);u(O.files)}catch{u([])}},[r,c]);h.useEffect(()=>{v("SKILL.md"),b(null),y(null),T()},[r,c,T]);const A=h.useCallback(async O=>{if(v(O),O==="SKILL.md"){b(null),y(null);return}f(!0),y(null);try{const G=await Se.getSkillFile(r,c,O);b(G)}catch(G){y(`Unable to open file: ${G.message}`),b(null)}finally{f(!1)}},[r,c]),L=h.useCallback(()=>{T()},[T]);return{files:o,activeFile:x,secondaryContent:p,loading:g,error:j,selectFile:A,refresh:L,isSkillMd:x==="SKILL.md"}}function dv(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function fv(r){const c=[],o=new Map;for(const u of r){const x=u.path.split("/"),p={name:x[x.length-1],path:u.path,type:u.type,size:u.size,children:[]};o.set(u.path,p)}for(const u of r){const x=u.path.split("/");if(x.length===1){const v=o.get(u.path);v&&c.push(v)}else{const v=x.slice(0,-1).join("/"),p=o.get(v),b=o.get(u.path);p&&b&&p.children.push(b)}}return c}function Gx({expanded:r}){return a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:r?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})})}function qx(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function xv(){return a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function pv(){return a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"23 4 23 10 17 10"}),a.jsx("polyline",{points:"1 20 1 14 7 14"}),a.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}function Yx({node:r,depth:c,activeFile:o,onSelect:u}){const[x,v]=h.useState(!0),p=r.path===o;return r.type==="dir"?a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>v(!x),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left"},children:[a.jsx(Gx,{expanded:x}),a.jsx(qx,{}),a.jsxs("span",{children:[r.name,"/"]})]}),x&&r.children.map(b=>a.jsx(Yx,{node:b,depth:c+1,activeFile:o,onSelect:u},b.path))]}):a.jsxs("button",{onClick:()=>u(r.path),style:{display:"flex",alignItems:"center",gap:4,width:"100%",paddingLeft:`${4+c*14}px`,paddingTop:2,paddingBottom:2,background:p?"var(--accent-muted)":"none",border:"none",cursor:"pointer",color:p?"var(--accent)":"var(--text-tertiary)",fontSize:11,fontFamily:"var(--font-mono, monospace)",textAlign:"left",borderRadius:3},children:[a.jsx("span",{style:{width:10}}),a.jsx(xv,{}),a.jsx("span",{style:{flex:1},children:r.name}),a.jsx("span",{style:{fontSize:9,color:"var(--text-tertiary)",marginRight:4,whiteSpace:"nowrap"},children:dv(r.size)})]})}function mv({files:r,activeFile:c,onSelect:o,onRefresh:u}){const[x,v]=h.useState(!1),p=h.useMemo(()=>fv(r),[r]);return a.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>v(!x),children:[a.jsx(Gx,{expanded:x}),a.jsx(qx,{}),a.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),a.jsx("button",{onClick:b=>{b.stopPropagation(),u()},style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:"2px 4px",display:"flex",alignItems:"center",borderRadius:3},title:"Refresh file list",children:a.jsx(pv,{})})]}),x&&a.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?a.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(b=>a.jsx(Yx,{node:b,depth:0,activeFile:c,onSelect:o},b.path))})]})}function yr(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function hv(r){try{return JSON.stringify(JSON.parse(r),null,2)}catch{return r}}function vv(r){const c=r.toLowerCase();return c.endsWith(".json")?"json":c.endsWith(".md")?"md":"other"}function Ex({content:r}){return a.jsx("textarea",{readOnly:!0,value:r,style:{flex:1,width:"100%",resize:"none",background:"var(--surface-1)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}})}function kx({content:r,fileType:c}){if(c==="json"){const o=hv(r);return a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:o})}return c==="md"?a.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px 20px",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:13,lineHeight:1.6},dangerouslySetInnerHTML:{__html:Nr(r)}}):a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r})}function Tx(r){try{return JSON.stringify(JSON.parse(r),null,2).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"([^"\\]|\\.)*"\s*:/g,o=>`<span style="color:#6383ff">${o}</span>`).replace(/:\s*"([^"\\]|\\.)*"/g,o=>`<span style="color:#22c55e">${o.slice(0,2)}<span style="color:#22c55e">${o.slice(2)}</span></span>`).replace(/:\s*(-?\d+\.?\d*)/g,(o,u)=>`: <span style="color:#fb923c">${u}</span>`).replace(/:\s*(true|false|null)/g,(o,u)=>`: <span style="color:#a855f7">${u}</span>`)}catch{return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}function yv({file:r,loading:c,error:o,viewMode:u,plugin:x,skill:v,onSaved:p,onDirtyChange:b}){const[g,f]=h.useState(u),[j,y]=h.useState(!1),[T,A]=h.useState(""),[L,O]=h.useState(!1),[G,q]=h.useState(null),J=u!==g?u:g;h.useEffect(()=>{b==null||b(j)},[j,b]);const ie=h.useCallback(()=>{(r==null?void 0:r.content)!=null&&(A(r.content),y(!0))},[r]),Z=h.useCallback(()=>{y(!1)},[]),ae=h.useCallback(async()=>{if(!(!x||!v||!r)){O(!0);try{await Se.saveSkillFile(x,v,r.path,T),q("Saved"),y(!1),p==null||p(),setTimeout(()=>q(null),2e3)}catch(F){q(`Save failed: ${F.message}`),setTimeout(()=>q(null),3e3)}finally{O(!1)}}},[x,v,r,T,p]);if(h.useEffect(()=>{if(!j)return;const F=xe=>{(xe.ctrlKey||xe.metaKey)&&xe.key==="s"&&(xe.preventDefault(),ae())};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[j,ae]),c)return a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(o)return a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:a.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[a.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),a.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:o})]})});if(!r)return null;if(r.binary)return a.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",yr(r.size),") — cannot be displayed"]});const ne=r.content??"",$=vv(r.path);return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[r.truncated&&a.jsxs("div",{style:{padding:"4px 12px",background:"var(--warning-muted, #fef3c7)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:"var(--warning-text, #92400e)"},children:["File truncated at ",yr(512*1024)," — ",yr(r.size)," total"]}),a.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[($==="md"||$==="json")&&["raw","split","preview"].map(F=>a.jsx("button",{onClick:()=>f(F),style:{padding:"2px 8px",fontSize:11,background:J===F?"var(--accent-muted)":"none",color:J===F?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:F},F)),a.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center",gap:6},children:[yr(r.size),x&&v&&!r.binary&&!j&&a.jsx("button",{onClick:ie,style:{padding:"1px 6px",fontSize:10,background:"var(--accent-muted)",color:"var(--accent)",border:"none",borderRadius:3,cursor:"pointer"},children:"Edit"}),j&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:ae,disabled:L,style:{padding:"1px 6px",fontSize:10,background:"var(--accent)",color:"#fff",border:"none",borderRadius:3,cursor:"pointer",opacity:L?.6:1},children:L?"Saving...":"Save"}),a.jsx("button",{onClick:Z,style:{padding:"1px 6px",fontSize:10,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer"},children:"Cancel"})]})]})]}),G&&a.jsx("div",{style:{padding:"4px 12px",background:G.startsWith("Save failed")?"var(--red-muted)":"var(--green-muted)",borderBottom:"1px solid var(--border-subtle)",fontSize:11,color:G.startsWith("Save failed")?"var(--red)":"var(--green)"},children:G}),a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:j?a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:[a.jsx("textarea",{value:T,onChange:F=>A(F.target.value),style:{flex:1,width:"100%",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",border:"none",outline:"none",padding:"12px 16px",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6}}),a.jsxs("div",{style:{position:"sticky",bottom:0,display:"flex",alignItems:"center",gap:8,padding:"6px 12px",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[a.jsx("span",{style:{flex:1,fontSize:11,color:"var(--text-tertiary)"},children:"Unsaved changes"}),a.jsx("button",{onClick:ae,disabled:L,style:{padding:"3px 12px",fontSize:11,background:"var(--accent)",color:"#fff",border:"none",borderRadius:4,cursor:"pointer",opacity:L?.6:1},children:L?"Saving...":"Save"}),a.jsx("button",{onClick:Z,style:{padding:"3px 12px",fontSize:11,background:"var(--surface-3)",color:"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer"},children:"Cancel"})]})]}):J==="split"&&$!=="other"?a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:a.jsx(Ex,{content:ne})}),a.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:$==="json"?a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(ne)}}):a.jsx(kx,{content:ne,fileType:$})})]}):J==="preview"&&$!=="other"?$==="json"?a.jsx("pre",{style:{flex:1,margin:0,padding:"12px 16px",overflow:"auto",background:"var(--surface-0)",fontSize:12,fontFamily:"var(--font-mono, monospace)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Tx(ne)}}):a.jsx(kx,{content:ne,fileType:$}):a.jsx(Ex,{content:ne})})]})}function gv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"16 18 22 12 16 6"}),a.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function bv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),a.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function jv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function Sv({size:r=15}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M15 4V2"}),a.jsx("path",{d:"M15 16v-2"}),a.jsx("path",{d:"M8 9h2"}),a.jsx("path",{d:"M20 9h2"}),a.jsx("path",{d:"M17.8 11.8L19 13"}),a.jsx("path",{d:"M15 9h.01"}),a.jsx("path",{d:"M17.8 6.2L19 5"}),a.jsx("path",{d:"M11 6.2L9.7 5"}),a.jsx("path",{d:"M3 21l9-9"})]})}function Zo({size:r=15}){return a.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function Nv(){const{state:r,dispatch:c,saveContent:o,isReadOnly:u}=il(),{plugin:x,skill:v,skillContent:p,isDirty:b,improveTarget:g,aiEditOpen:f}=r,[j,y]=h.useState("split"),[T,A]=h.useState(!1),L=h.useRef(null),[O,G]=h.useState(!1),[q,J]=h.useState(""),[ie,Z]=h.useState(!1),[ae,ne]=h.useState(null),[$,F]=h.useState([]),[xe,Ne]=h.useState([]),[ge,je]=h.useState(null),Q=h.useRef(null),{config:ee}=Na(),{files:me,activeFile:C,secondaryContent:E,loading:K,error:W,selectFile:oe,refresh:N,isSkillMd:z}=uv(x??"",v??""),[V,P]=h.useState(!1),I=h.useCallback(Y=>{V&&!window.confirm("You have unsaved changes. Discard?")||oe(Y)},[V,oe]);h.useEffect(()=>()=>{var Y;(Y=Q.current)==null||Y.abort()},[]);const{metadata:te,body:ve}=Ph(p),Be=te["allowed-tools"],Ae=Array.isArray(Be)?Be:typeof Be=="string"?[Be]:[],ut=te.name,zt=te.description,X=te.metadata,se=typeof X=="object"&&!Array.isArray(X)?X:null,le=te.version||(se==null?void 0:se.version),de=te.tags||(se==null?void 0:se.tags),pe=Array.isArray(de)?de:typeof de=="string"?de.split(",").map(Y=>Y.trim()).filter(Boolean):[],Ve=new Set(["name","description","metadata","allowed-tools","version","tags"]),dt=Object.entries(te).filter(([Y])=>!Ve.has(Y)),Xe=h.useCallback(async()=>{A(!0),await o(),A(!1)},[o]),Lt=h.useCallback(Y=>{(Y.ctrlKey||Y.metaKey)&&Y.key==="s"&&(Y.preventDefault(),Y.stopPropagation(),b&&Xe()),(Y.ctrlKey||Y.metaKey)&&Y.key==="k"&&(Y.preventDefault(),Y.stopPropagation(),c({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[b,Xe,f,c]),mt=h.useCallback(async()=>{var Me,at;if(!q.trim())return;(Me=Q.current)==null||Me.abort();const Y=new AbortController;Q.current=Y,Z(!0),je(null),Ne([]),ne(null),F([]);try{const Je=(ee==null?void 0:ee.provider)||"claude-cli",Rl=(ee==null?void 0:ee.model)||"sonnet",Ot=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:q,provider:Je,model:Rl}),signal:Y.signal});if(!Ot.ok||!Ot.body){let et=`HTTP ${Ot.status}`;try{const ll=await Ot.json();ll.error&&(et=ll.error)}catch{}throw new Error(et)}const sa=Ot.body.getReader(),Et=new TextDecoder;let Fe="",nt="";for(;;){const{done:et,value:ll}=await sa.read();if(et)break;Fe+=Et.decode(ll,{stream:!0});const Qe=Fe.split(`
|
|
61
|
+
`);Fe=Qe.pop()||"";for(const al of Qe)if(al.startsWith("event: "))nt=al.slice(7).trim();else if(al.startsWith("data: ")){try{const st=JSON.parse(al.slice(6));if(nt==="progress")Ne(qe=>[...qe,{phase:st.phase,message:st.message,timestamp:Date.now()}]);else if(nt==="done"||nt==="complete"){const qe=["---"];st.name&&qe.push(`name: ${st.name}`),st.description&&qe.push(`description: "${st.description.replace(/"/g,'\\"')}"`),st.model&&qe.push(`model: ${st.model}`),(at=st.allowedTools)!=null&&at.trim()&&qe.push(`allowed-tools: ${st.allowedTools.trim()}`),qe.push("---","",st.body||"");const _l=qe.join(`
|
|
62
|
+
`);ne(_l),F(Er(p,_l)),Z(!1)}else nt==="error"&&(je(st.message||st.description||"Generation failed"),Z(!1))}catch{}nt=""}}}catch(Je){Je.name!=="AbortError"&&je(Je.message)}finally{Z(!1),Q.current=null}},[q,ee,p]),tl=h.useCallback(()=>{ae&&c({type:"SET_CONTENT",content:ae}),G(!1),ne(null),F([]),J(""),Ne([])},[ae,c]),Qt=h.useCallback(()=>{G(!1),ne(null),F([]),J(""),Ne([]),je(null)},[]),We=h.useCallback(()=>{var Y;O?((Y=Q.current)==null||Y.abort(),Qt()):(f&&c({type:"CLOSE_AI_EDIT"}),G(!0))},[O,f,c,Qt]),Dt=[{mode:"raw",icon:a.jsx(gv,{}),label:"Editor"},{mode:"split",icon:a.jsx(bv,{}),label:"Split"},{mode:"preview",icon:a.jsx(jv,{}),label:"Preview"}];return a.jsxs("div",{className:"flex flex-col h-full",onKeyDown:Lt,tabIndex:-1,children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:Dt.map(({mode:Y,icon:Me,label:at})=>a.jsxs("button",{onClick:()=>y(Y),title:at,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:j===Y?"var(--surface-4)":"transparent",color:j===Y?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:j===Y?600:400,border:"none",cursor:"pointer"},children:[Me,a.jsx("span",{style:{letterSpacing:"0.01em"},children:at})]},Y))}),z?u?a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:()=>{f?c({type:"CLOSE_AI_EDIT"}):(O&&Qt(),c({type:"OPEN_AI_EDIT"}))},title:"Edit with AI (Ctrl+K)",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:f?600:400,border:"none",cursor:"pointer",color:f?"#a855f7":"var(--text-tertiary)",background:f?"rgba(168,85,247,0.12)":"transparent"},children:[a.jsx(Sv,{size:13}),a.jsx("span",{children:"AI Edit"})]}),a.jsxs("button",{onClick:We,title:"Regenerate skill from prompt",className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"4px 10px",fontSize:11,fontWeight:O?600:400,border:"none",cursor:"pointer",color:O?"#a855f7":"var(--text-tertiary)",background:O?"rgba(168,85,247,0.12)":"transparent"},children:[a.jsx(Zo,{size:13}),a.jsx("span",{children:"Regenerate"})]}),a.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),b&&a.jsx("button",{onClick:()=>c({type:"SET_CONTENT",content:r.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),a.jsx("button",{onClick:Xe,disabled:!b||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),x&&v&&a.jsx(mv,{files:me,activeFile:C,onSelect:I,onRefresh:N}),!z&&a.jsx(yv,{file:E,loading:K,error:W,viewMode:j,plugin:x??void 0,skill:v??void 0,onSaved:()=>{oe(C),N()},onDirtyChange:P}),z&&a.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:j==="raw"||j==="preview"?"1fr":"1fr 1fr"},children:[j!=="preview"&&a.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:j==="split"?"1px solid var(--border-subtle)":"none"},children:a.jsx("textarea",{ref:L,value:p,onChange:Y=>{u||c({type:"SET_CONTENT",content:Y.target.value})},onKeyDown:Lt,spellCheck:!1,readOnly:u,className:"flex-1 w-full resize-none outline-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono, 'JetBrains Mono', ui-monospace, monospace)",fontSize:12.5,lineHeight:1.7,tabSize:2,border:"none",padding:"16px 20px",opacity:u?.7:1}})}),j!=="raw"&&a.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(ut||le||zt)&&a.jsxs("div",{style:{marginBottom:20},children:[a.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[ut&&a.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:ut}),le&&a.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4,letterSpacing:"0.03em",fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:["v",le]})]}),zt&&a.jsx("p",{style:{fontSize:12.5,lineHeight:1.65,color:"var(--text-secondary)",margin:0,paddingLeft:12,borderLeft:"2px solid var(--accent)",maxWidth:600},children:zt})]}),pe.length>0&&a.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:pe.map(Y=>a.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:Y},Y))}),Ae.length>0&&a.jsx("div",{style:{marginBottom:16},children:a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),Ae.map(Y=>a.jsx("span",{style:{fontSize:10.5,fontFamily:"var(--font-mono, ui-monospace, monospace)",color:"var(--accent)",background:"var(--accent-muted)",padding:"2px 7px",borderRadius:4},children:Y},Y))]})}),dt.length>0&&a.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:dt.map(([Y,Me],at)=>{const Je=Array.isArray(Me)?Me.join(", "):typeof Me=="object"?Object.entries(Me).map(([Rl,Ot])=>`${Rl}: ${Array.isArray(Ot)?Ot.join(", "):Ot}`).join(" | "):Me;return a.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:at>0?"1px solid var(--border-subtle)":"none"},children:[a.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:Y}),a.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Je})]},Y)})}),(ut||zt||pe.length>0||Ae.length>0||dt.length>0)&&ve&&a.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),ve&&a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(ve)}})]})})]}),z&&f&&a.jsx(cv,{}),z&&O&&a.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:a.jsxs("div",{className:"px-4 py-3",children:[!ae&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Zo,{size:14}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),a.jsx("div",{className:"flex gap-2 mb-2",children:a.jsx("textarea",{value:q,onChange:Y=>J(Y.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:ie,className:"flex-1 px-3 py-2 rounded-lg text-[12px] resize-none",style:{background:"var(--surface-0)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",outline:"none",opacity:ie?.5:1},onKeyDown:Y=>{Y.key==="Enter"&&(Y.ctrlKey||Y.metaKey)&&q.trim()&&!ie&&(Y.preventDefault(),mt())}})}),a.jsxs("div",{className:"flex items-center gap-2",children:[ie?a.jsx("button",{onClick:()=>{var Y;(Y=Q.current)==null||Y.abort(),Z(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):a.jsx("button",{onClick:mt,disabled:!q.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),a.jsx("button",{onClick:Qt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),ie&&xe.length>0&&a.jsx("div",{className:"mt-2",children:a.jsx(ss,{entries:xe,isRunning:!0})}),ge&&a.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ge,a.jsx("button",{onClick:mt,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),ae&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(Zo,{size:14}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),a.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:$.map((Y,Me)=>a.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:Y.type==="added"?"rgba(34,197,94,0.1)":Y.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:Y.type==="added"?"var(--green)":Y.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:Y.type==="added"?"3px solid var(--green)":Y.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[a.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:Y.type==="added"?"+":Y.type==="removed"?"-":" "}),Y.content]},Me))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:tl,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),a.jsx("button",{onClick:Qt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),z&&g!==null&&x&&v&&a.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:a.jsx(lv,{plugin:x,skill:v,skillContent:p,onApplied:Y=>{c({type:"SET_CONTENT",content:Y}),c({type:"CONTENT_SAVED"}),c({type:"CLOSE_IMPROVE"})}})})]})}function un(r){return r.testType==="integration"?"integration":"unit"}function dn(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function Vx(r){const c=new Date(r);return c.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Qx(r){return r==null?"--":r>=1e3?`${(r/1e3).toFixed(1)}s`:`${r}ms`}const Ev=new Set(["benchmark","comparison","baseline"]);function Cx(r,c,o,u){return r.map(({rate:x,idx:v,total:p})=>{const b=u+v/(p-1)*(c-u*2),g=u+(o-u*2)-x*(o-u*2);return`${b},${g}`})}function Xx({entries:r}){const c=r.filter(y=>Ev.has(y.type)).slice().reverse(),o=c.map((y,T,A)=>({rate:y.pass_rate,idx:T,total:A.length})).filter((y,T)=>{const A=c[T].type;return A==="benchmark"||A==="comparison"}),u=c.flatMap((y,T)=>y.type==="baseline"?[{rate:y.pass_rate,idx:T,total:c.length}]:y.type==="comparison"&&y.baselinePassRate!=null?[{rate:y.baselinePassRate,idx:T,total:c.length}]:[]);if(o.length<2&&u.length<2)return null;const x=80,v=24,p=2,b=o.length>=2?Cx(o,x,v,p):[],g=u.length>=2?Cx(u,x,v,p):[],f=b[b.length-1],j=g[g.length-1];return a.jsxs("svg",{width:x,height:v,style:{display:"block",flexShrink:0},children:[g.length>0&&a.jsx("polyline",{points:g.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),b.length>0&&a.jsx("polyline",{points:b.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),j&&a.jsx("circle",{cx:parseFloat(j.split(",")[0]),cy:parseFloat(j.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&a.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function Zx(r,c,o){const u=[],x=[],v=[];if((r==="PASS"||r==="EFFECTIVE")&&c>=.7){const g=u.length>0?` Met criteria: ${u.map(f=>f.criterion).join(", ")}.`:"";return{explanation:`${r} (score ${c.toFixed(2)}): evaluation met expectations.${g}`}}if((r==="FAIL"||r==="DEGRADING")&&c<.4){const g=x.length>0?` Failed criteria: ${x.map(j=>j.criterion).join(", ")}.`:"",f=[...x.map(j=>`Improve "${j.criterion}" (score: ${j.score.toFixed(2)})`),...v.map(j=>`Strengthen "${j.criterion}" (score: ${j.score.toFixed(2)})`)];return f.length===0&&f.push("Review prompt instructions and add more specific guidance"),{explanation:`${r} (score ${c.toFixed(2)}): evaluation did not meet expectations.${g}`,recommendations:f}}if(r==="INEFFECTIVE"&&c<.2){const g=[...x.map(f=>`Rework "${f.criterion}" — currently at ${f.score.toFixed(2)}`),"Consider adding examples to your system prompt","Review the rubric criteria for achievability"];return{explanation:`${r} (score ${c.toFixed(2)}): evaluation is significantly below expectations.`,recommendations:g}}const p=u.length>0?` Passing: ${u.map(g=>g.criterion).join(", ")}.`:"",b=v.length>0?` Needs improvement: ${v.map(g=>g.criterion).join(", ")}.`:"";return{explanation:`${r} (score ${c.toFixed(2)}): mixed results.${p}${b}`}}function kv(r,c,o){const[u,x]=h.useState(null),[v,p]=h.useState(!1),b=h.useRef("");h.useEffect(()=>{const f=`${r}/${c}/${o}`;b.current!==f&&(b.current=f,p(!0),Se.getCaseHistory(r,c,o).then(j=>x(j)).catch(()=>x([])).finally(()=>p(!1)))},[r,c,o]);const g=h.useCallback(()=>{p(!0),b.current="",Se.getCaseHistory(r,c,o).then(f=>x(f)).catch(()=>x([])).finally(()=>p(!1))},[r,c,o]);return{entries:u,loading:v,refetch:g}}function Tv(r,c,o){const u={flaky:!1,nonDiscriminating:!1,regression:!1};if(!o||o.length===0)return u;const v=o.slice(0,10).map(g=>g.assertions.find(f=>f.id===r)).filter(Boolean);if(v.length>=2){const f=v.filter(j=>j.pass).length/v.length;f>=.3&&f<=.7&&(u.flaky=!0)}const p=o.find(g=>g.type==="benchmark"),b=o.find(g=>g.type==="baseline");if(p&&b){const g=p.assertions.find(j=>j.id===r),f=b.assertions.find(j=>j.id===r);g!=null&&g.pass&&(f!=null&&f.pass)&&(u.nonDiscriminating=!0)}if(c&&!c.pass&&o.length>=1){const f=o[0].assertions.find(j=>j.id===r);f!=null&&f.pass&&(u.regression=!0)}return u}function Cv(){var C;const{state:r,dispatch:c,saveEvals:o,runCase:u,runAll:x,cancelCase:v,cancelAll:p,generateEvals:b,isReadOnly:g}=il(),{evals:f,evalsError:j,selectedCaseId:y,inlineResults:T,caseRunStates:A,generateEvalsLoading:L,generateEvalsProgress:O,generateEvalsError:G}=r,q=h.useMemo(()=>{for(const E of A.values())if(E.status==="running"||E.status==="queued")return!0;return!1},[A]),[J,ie]=h.useState(!1),[Z,ae]=h.useState("all"),ne={skill_name:r.skill,evals:[]},$=f??ne,F=$.evals,xe=Z==="all"?F:F.filter(E=>un(E)===Z),Ne=xe.find(E=>E.id===y)??null,[ge,je]=h.useState([]),Q=h.useMemo(()=>F.some(E=>un(E)==="integration"),[F]);h.useEffect(()=>{Q&&Se.getCredentials(r.plugin,r.skill).then(E=>je(E.credentials)).catch(()=>je([]))},[r.plugin,r.skill,Q]);const ee=h.useMemo(()=>new Set(ge.filter(E=>E.status==="missing").map(E=>E.name)),[ge]),me=h.useCallback(()=>{b()},[b]);return!f||xe.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:j?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:j?a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--error, #f87171)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 11l3 3L22 4"}),a.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),a.jsx("div",{className:"text-center",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),a.jsx("div",{className:"text-[11px] font-mono px-3 py-2 rounded mt-1 max-w-sm text-left break-words",style:{color:"var(--text-secondary)",background:"var(--surface-2)"},children:j}),a.jsx("div",{className:"text-[12px] mt-2",style:{color:"var(--text-tertiary)"},children:"Fix the evals.json file and reload, or regenerate test cases with AI"})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>ie(!0),disabled:g,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),a.jsx("button",{onClick:me,disabled:L||g,className:"btn btn-secondary text-[12px]",children:L?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),L&&O.length>0&&a.jsx("div",{className:"w-full max-w-md mt-3",children:a.jsx(ss,{entries:O,isRunning:!0})}),G&&a.jsx("div",{className:"w-full max-w-md mt-3",children:a.jsx(kr,{error:G,onRetry:me})}),J&&a.jsx(wx,{evals:$,onSave:E=>{o(E),ie(!1)},onCancel:()=>ie(!1)})]}):a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[a.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",xe.length,")"]}),a.jsx("div",{className:"flex items-center gap-1.5",children:q?a.jsx("button",{onClick:p,className:"btn text-[10px] px-2 py-0.5",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel All"}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>x("benchmark"),disabled:xe.length===0||g,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),a.jsx("button",{onClick:()=>x("comparison"),disabled:xe.length===0||g,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),a.jsx("div",{className:"flex px-3 py-1.5 gap-1",style:{borderBottom:"1px solid var(--border-subtle)"},children:["all","unit","integration"].map(E=>a.jsx("button",{onClick:()=>ae(E),style:{padding:"2px 8px",fontSize:10,fontWeight:Z===E?600:400,background:Z===E?"var(--accent-muted)":"transparent",color:Z===E?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:4,cursor:"pointer",textTransform:"capitalize"},children:E==="all"?`All (${F.length})`:E==="unit"?`Unit (${F.filter(K=>un(K)==="unit").length})`:`Integration (${F.filter(K=>un(K)==="integration").length})`},E))}),a.jsx("div",{className:"py-1",children:xe.map(E=>{var N;const K=T.get(E.id),W=y===E.id,oe=un(E);return a.jsxs("button",{onClick:()=>c({type:"SELECT_CASE",caseId:E.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:W?"var(--accent-muted)":"transparent",borderLeft:W?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:z=>{W||(z.currentTarget.style.background="var(--surface-2)")},onMouseLeave:z=>{W||(z.currentTarget.style.background="transparent")},children:[a.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[a.jsxs("span",{className:"text-[12px] font-medium truncate flex items-center gap-1.5",style:{color:W?"var(--text-primary)":"var(--text-secondary)"},children:["#",E.id," ",E.name,a.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:9999,background:oe==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:oe==="unit"?"#6383ff":"#fb923c",whiteSpace:"nowrap"},children:oe==="unit"?"U":"I"}),oe==="integration"&&((N=E.requiredCredentials)==null?void 0:N.some(z=>ee.has(z)))&&a.jsx("span",{title:"Configure credentials to run",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})})]}),a.jsx(Kx,{result:K})]}),a.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[E.assertions.length," assertion",E.assertions.length!==1?"s":"",(K==null?void 0:K.passRate)!=null&&a.jsx(Rv,{passRate:K.passRate})]})]},E.id)})}),a.jsx("div",{className:"px-3 py-2",children:!g&&a.jsx("button",{onClick:()=>ie(!0),className:"w-full py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{border:"1px dashed var(--border-default)",color:"var(--text-tertiary)",background:"transparent"},onMouseEnter:E=>{E.currentTarget.style.borderColor="var(--accent)",E.currentTarget.style.color="var(--accent)"},onMouseLeave:E=>{E.currentTarget.style.borderColor="var(--border-default)",E.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),a.jsx("div",{className:"overflow-auto",children:Ne?a.jsx(wv,{evalCase:Ne,result:T.get(Ne.id),evals:f,caseStatus:((C=A.get(Ne.id))==null?void 0:C.status)??"idle",onSaveEvals:o,onRun:E=>u(E,"benchmark"),onCompare:E=>u(E,"comparison"),onCancel:E=>v(E),onImprove:E=>c({type:"OPEN_IMPROVE",evalId:E})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),J&&a.jsx(wx,{evals:$,onSave:E=>{o(E),ie(!1)},onCancel:()=>ie(!1)})]})}function wv({evalCase:r,result:c,evals:o,caseStatus:u,onSaveEvals:x,onRun:v,onCompare:p,onCancel:b,onImprove:g}){const{state:f,isReadOnly:j}=il(),{plugin:y,skill:T}=f,{entries:A,loading:L}=kv(y,T,r.id),[O,G]=h.useState(!1),[q,J]=h.useState(r.prompt),[ie,Z]=h.useState(!1),[ae,ne]=h.useState(r.expected_output);h.useState(()=>{J(r.prompt),ne(r.expected_output)});const $=h.useCallback(W=>{x({...o,evals:o.evals.map(oe=>oe.id===W.id?W:oe)})},[o,x]),F=h.useCallback(()=>{$({...r,prompt:q}),G(!1)},[r,q,$]),xe=h.useCallback(()=>{$({...r,expected_output:ae}),Z(!1)},[r,ae,$]),Ne=h.useCallback(()=>{$({...r,assertions:[...r.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[r,$]),ge=h.useCallback((W,oe)=>{$({...r,assertions:r.assertions.map(N=>N.id===W?{...N,text:oe}:N)})},[r,$]),je=h.useCallback(W=>{$({...r,assertions:r.assertions.filter(oe=>oe.id!==W)})},[r,$]),Q=h.useCallback(()=>{confirm("Delete this test case?")&&x({...o,evals:o.evals.filter(W=>W.id!==r.id)})},[o,r.id,x]),ee=c&&c.assertions.length>0&&c.assertions.every(W=>W.pass),me=c&&c.assertions.some(W=>!W.pass),C=un(r),E=r.requiredCredentials??[],K=C==="integration"&&E.length>0;return a.jsxs("div",{className:"p-5 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",r.id," ",r.name]}),a.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:9999,background:C==="unit"?"rgba(99,131,255,0.15)":"rgba(251,146,60,0.15)",color:C==="unit"?"#6383ff":"#fb923c"},children:C==="unit"?"Unit":"Integration"}),a.jsx(Kx,{result:c})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"||u==="queued"?a.jsxs("button",{onClick:()=>b(r.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>v(r.id),disabled:j,className:"btn btn-primary text-[12px]",children:"Run"}),a.jsx("button",{onClick:()=>p(r.id),disabled:j,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),me&&!j&&u!=="running"&&u!=="queued"&&a.jsx("button",{onClick:()=>g(r.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!j&&u!=="running"&&u!=="queued"&&a.jsx("button",{onClick:Q,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("polyline",{points:"3 6 5 6 21 6"}),a.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),j&&C==="integration"&&a.jsxs("div",{"data-testid":"platform-integration-note",className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--accent-muted)",border:"1px solid rgba(99,131,255,0.2)"},children:[a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),a.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),a.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--accent)"},children:"Run locally in vSkill Studio"})]}),ee&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl flex items-center gap-3",style:{background:"var(--green-muted)",border:"1px solid rgba(52, 211, 153, 0.2)"},children:[a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[a.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),K&&a.jsxs("div",{className:"mb-4 px-4 py-3 rounded-xl",style:{background:"rgba(251,146,60,0.1)",border:"1px solid rgba(251,146,60,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"Required Credentials"})]}),a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:"This integration test requires the following environment variables:"}),a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:E.map(W=>a.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono, monospace)",padding:"2px 6px",borderRadius:4,background:"rgba(251,146,60,0.15)",color:"#fb923c"},children:W},W))})]}),a.jsx(gr,{title:"Prompt",children:O?a.jsxs("div",{children:[a.jsx("textarea",{value:q,onChange:W=>J(W.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx("button",{onClick:F,className:"btn btn-primary text-[12px]",children:"Save"}),a.jsx("button",{onClick:()=>{J(r.prompt),G(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):a.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:j?"default":"pointer"},onClick:()=>{j||G(!0)},onMouseEnter:W=>{j||(W.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-subtle)"},children:r.prompt||a.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:j?"No prompt":"Click to edit prompt..."})})}),a.jsx(gr,{title:"Expected Output",children:ie?a.jsxs("div",{children:[a.jsx("textarea",{value:ae,onChange:W=>ne(W.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx("button",{onClick:xe,className:"btn btn-primary text-[12px]",children:"Save"}),a.jsx("button",{onClick:()=>{ne(r.expected_output),Z(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):a.jsx("div",{className:"p-3 rounded-lg text-[12px] transition-all duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",border:"1px solid var(--border-subtle)",maxHeight:200,overflowY:"auto",cursor:j?"default":"pointer"},onClick:()=>{j||Z(!0)},onMouseEnter:W=>{j||(W.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:W=>{W.currentTarget.style.borderColor="var(--border-subtle)"},children:r.expected_output||a.jsx("span",{style:{fontStyle:"italic"},children:j?"No expected output":"Click to edit expected output..."})})}),a.jsx(gr,{title:`Assertions (${r.assertions.length})`,action:j?void 0:a.jsx("button",{onClick:Ne,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:r.assertions.length===0?a.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):a.jsx("div",{className:"space-y-2",children:r.assertions.map(W=>{const oe=c==null?void 0:c.assertions.find(z=>z.assertion_id===W.id),N=Tv(W.id,oe,A);return a.jsx(Av,{assertion:W,result:oe,badges:N,isReadOnly:j,onUpdate:z=>ge(W.id,z),onDelete:()=>je(W.id)},W.id)})})}),(c==null?void 0:c.output)&&a.jsx(_v,{output:c.output,durationMs:c.durationMs,tokens:c.tokens}),c&&c.passRate!=null&&c.passRate<.2&&(()=>{const W=Zx("INEFFECTIVE",c.passRate);return W.recommendations&&W.recommendations.length>0?a.jsx(gr,{title:"Recommendations",children:a.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(251,146,60,0.08)",border:"1px solid rgba(251,146,60,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fb923c",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),a.jsx("span",{className:"text-[12px] font-semibold",style:{color:"#fb923c"},children:"This eval is significantly below expectations"})]}),a.jsx("ul",{className:"space-y-1.5 ml-1",children:W.recommendations.map((oe,N)=>a.jsxs("li",{className:"flex items-start gap-2 text-[12px]",style:{color:"var(--text-secondary)"},children:[a.jsx("span",{style:{color:"#fb923c",fontWeight:600,flexShrink:0},children:"•"}),oe]},N))})]})}):null})(),a.jsx(Mv,{evalId:r.id,sharedEntries:A,sharedLoading:L})]},r.id)}function Av({assertion:r,result:c,badges:o,isReadOnly:u,onUpdate:x,onDelete:v}){const[p,b]=h.useState(!1),[g,f]=h.useState(r.text),[j,y]=h.useState(!1),T=()=>{x(g),b(!1)};return a.jsx("div",{className:"rounded-lg px-3 py-2.5 transition-all duration-150",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:a.jsxs("div",{className:"flex items-start gap-2",children:[c?a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:c.pass?"var(--green-muted)":"var(--red-muted)"},children:c.pass?a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:18,height:18,border:"1.5px dashed var(--text-tertiary)",background:"transparent"},title:"Not run yet"}),(o==null?void 0:o.regression)&&a.jsx("span",{className:"mt-0.5 flex-shrink-0",title:"Regression: was passing, now failing",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:18,color:"var(--red)",fontSize:14,fontWeight:700,lineHeight:1},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:r.id}),(o==null?void 0:o.flaky)&&a.jsx("span",{title:"Flaky: 30-70% pass rate across recent runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"rgba(234, 179, 8, 0.15)",color:"#ca8a04",whiteSpace:"nowrap"},children:"Flaky"}),(o==null?void 0:o.nonDiscriminating)&&a.jsx("span",{title:"Non-discriminating: passes on both skill and baseline runs",style:{display:"inline-block",fontSize:9,fontWeight:600,lineHeight:1,padding:"2px 6px",borderRadius:9999,background:"var(--surface-3)",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"Non-Discrim."})]}),p?a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{value:g,onChange:A=>f(A.target.value),onKeyDown:A=>{A.key==="Enter"&&T(),A.key==="Escape"&&b(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),a.jsx("button",{onClick:T,className:"btn btn-primary text-[11px]",children:"Save"})]}):a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:u?"default":"pointer"},onClick:()=>{u||(f(r.text),b(!0))},children:r.text}),(c==null?void 0:c.reasoning)&&a.jsx("button",{onClick:()=>y(!j),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:j?"Hide reasoning":"Show reasoning"}),j&&(c==null?void 0:c.reasoning)&&a.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:c.reasoning})]}),!u&&a.jsx("button",{onClick:v,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:A=>{A.currentTarget.style.color="var(--red)",A.currentTarget.style.opacity="1"},onMouseLeave:A=>{A.currentTarget.style.color="var(--text-tertiary)",A.currentTarget.style.opacity=""},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function gr({title:r,action:c,children:o}){return a.jsxs("div",{className:"mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:r}),c]}),o]})}function Kx({result:r}){const[c,o]=h.useState(!1);if(!r||r.status==null)return a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const u=r.status==="pass",x=r.passRate??0,p=Zx(u?"PASS":"FAIL",x);return a.jsxs("span",{className:"pill text-[10px]",style:{background:u?"var(--green-muted)":"var(--red-muted)",color:u?"var(--green)":"var(--red)",position:"relative",cursor:"default"},onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),"aria-describedby":c?"verdict-tooltip":void 0,children:[r.passRate!=null?`${Math.round(r.passRate*100)}%`:r.status,c&&a.jsx("div",{id:"verdict-tooltip",role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",right:0,padding:"6px 10px",background:"var(--surface-4)",border:"1px solid var(--border-subtle)",borderRadius:6,fontSize:11,color:"var(--text-secondary)",whiteSpace:"nowrap",zIndex:50,maxWidth:300,width:"max-content",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"},children:p.explanation})]})}function Rv({passRate:r}){const c=Math.round(r*100);return a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${c}%`,background:c>=80?"var(--green)":c>=50?"var(--yellow)":"var(--red)"}})})})}function _v({output:r,durationMs:c,tokens:o}){const[u,x]=h.useState(!1);return a.jsxs("div",{className:"mb-5",children:[a.jsxs("button",{onClick:()=>x(!u),className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:u?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",c!=null&&a.jsxs("span",{style:{fontWeight:400},children:["(",(c/1e3).toFixed(1),"s)"]}),o!=null&&a.jsxs("span",{style:{fontWeight:400},children:["(",o," tokens)"]})]}),u&&a.jsx("pre",{className:"text-[12px] p-4 rounded-lg overflow-auto animate-fade-in",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:400,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r})]})}function Ko(r){return r==="baseline"?"right":r==="comparison"?"full":"left"}function $o({entry:r}){return a.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Vx(r.timestamp)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:r.model}),a.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:r.type==="benchmark"?"rgba(99,131,255,0.15)":r.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:r.type==="benchmark"?"#6383ff":r.type==="comparison"?"var(--purple)":"#fb923c"},children:r.type}),a.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:dn(r.pass_rate)},children:[Math.round(r.pass_rate*100),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[r.durationMs!=null&&a.jsx("span",{children:Qx(r.durationMs)}),r.tokens!=null&&a.jsxs("span",{children:[r.tokens>=1e3?`${(r.tokens/1e3).toFixed(1)}k`:r.tokens," tok"]})]}),r.type==="comparison"&&r.baselinePassRate!=null&&(()=>{const c=r.pass_rate-r.baselinePassRate,o=c>.001?"skill":c<-.001?"baseline":"tie",u=c>0?"+":"",x=o==="skill"?"var(--green)":o==="baseline"?"var(--red)":"var(--text-tertiary)";return a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:c>=0?"var(--green)":"var(--red)"},children:[u,(c*100).toFixed(1),"%"]}),a.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:x},children:o})]})})(),a.jsx("div",{className:"space-y-0.5",children:r.assertions.map(c=>a.jsxs("div",{className:"flex items-start gap-1.5",children:[a.jsx("span",{className:"mt-0.5 rounded-full flex-shrink-0",style:{width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center",background:c.pass?"var(--green-muted)":"var(--red-muted)"},children:c.pass?a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:c.text})]},c.id))})]})}function Mv({evalId:r,sharedEntries:c,sharedLoading:o}){const{state:u,dispatch:x}=il(),{plugin:v,skill:p}=u,[b,g]=h.useState(!0),f=c??null,j=o??!1,y=h.useCallback(()=>{g(O=>!O)},[]),T=f?f.slice(0,10):[],A=T.some(O=>{const G=Ko(O.type);return G==="left"||G==="full"}),L=T.some(O=>{const G=Ko(O.type);return G==="right"||G==="full"});return a.jsxs("div",{className:"mb-5",children:[a.jsxs("button",{onClick:y,className:"flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wider mb-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:b?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&a.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),b&&a.jsx("div",{className:"animate-fade-in",children:j?a.jsxs("div",{className:"flex items-center gap-2 py-3",children:[a.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),a.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?a.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):a.jsxs("div",{children:[T.length>=2&&a.jsx("div",{className:"mb-2",children:a.jsx(Xx,{entries:T})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!A&&a.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!L&&a.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((O,G)=>{const q=Ko(O.type);return q==="full"?a.jsx("div",{style:{gridColumn:"1 / -1"},children:a.jsx($o,{entry:O})},G):q==="left"?a.jsxs(h.Fragment,{children:[a.jsx("div",{style:{gridColumn:"1"},children:a.jsx($o,{entry:O})}),a.jsx("div",{style:{gridColumn:"2"}})]},G):a.jsxs(h.Fragment,{children:[a.jsx("div",{style:{gridColumn:"1"}}),a.jsx("div",{style:{gridColumn:"2"},children:a.jsx($o,{entry:O})})]},G)})]}),a.jsx("button",{onClick:()=>x({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:O=>{O.currentTarget.style.textDecoration="underline"},onMouseLeave:O=>{O.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function wx({evals:r,onSave:c,onCancel:o}){const[u,x]=h.useState(""),[v,p]=h.useState(""),[b,g]=h.useState(""),[f,j]=h.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),y=Math.max(0,...r.evals.map(A=>A.id))+1,T=()=>{if(!u.trim()||!v.trim())return;const A={id:y,name:u.trim(),prompt:v.trim(),expected_output:b.trim(),files:[],assertions:f.filter(L=>L.text.trim())};c({...r,evals:[...r.evals,A]})};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center animate-overlay-in",style:{background:"rgba(0,0,0,0.6)"},children:a.jsxs("div",{className:"w-full max-w-lg rounded-xl p-6 animate-modal-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),a.jsx("input",{value:u,onChange:A=>x(A.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),a.jsx("textarea",{value:v,onChange:A=>p(A.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),a.jsxs("label",{className:"block mb-3",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),a.jsx("textarea",{value:b,onChange:A=>g(A.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((A,L)=>a.jsxs("div",{className:"flex gap-2 mb-2",children:[a.jsx("input",{value:A.text,onChange:O=>j(f.map((G,q)=>q===L?{...G,text:O.target.value}:G)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&a.jsx("button",{onClick:()=>j(f.filter((O,G)=>G!==L)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},A.id)),a.jsx("button",{onClick:()=>j([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx("button",{onClick:o,className:"btn btn-secondary text-[12px]",children:"Cancel"}),a.jsx("button",{onClick:T,disabled:!u.trim()||!v.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function zv(r,c){const o=r+c,u=o*10,x=o*25,v=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${v(u)}–${v(x)}`}function Lv(){const{state:r,runCase:c,runAll:o,cancelCase:u,cancelAll:x,isReadOnly:v}=il(),{evals:p,caseRunStates:b,bulkRunActive:g,latestBenchmark:f,inlineResults:j}=r,y=(p==null?void 0:p.evals)??[],T=h.useMemo(()=>{for(const Z of b.values())if(Z.status==="running"||Z.status==="queued")return!0;return!1},[b]),A=y.filter(Z=>{const ae=b.get(Z.id);return ae&&(ae.status==="complete"||ae.status==="error"||ae.status==="cancelled")}).length,L=y.filter(Z=>{const ae=b.get(Z.id);return ae&&(ae.status==="running"||ae.status==="queued")}).length,O=h.useRef(null),[G,q]=h.useState(0);h.useEffect(()=>{if(T&&!O.current&&(O.current=Date.now()),!T){O.current=null,q(0);return}const Z=setInterval(()=>{O.current&&q(Math.round((Date.now()-O.current)/1e3))},1e3);return()=>clearInterval(Z)},[T]);const J=y.reduce((Z,ae)=>Z+ae.assertions.length,0),ie=h.useMemo(()=>zv(y.length,J),[y.length,J]);return a.jsxs("div",{className:"p-5",children:[v&&a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-4 text-[11px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),a.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),T&&a.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[L," running"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[T&&a.jsxs("button",{onClick:x,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),a.jsx("button",{onClick:()=>o("comparison"),disabled:y.length===0||T||v,className:"btn btn-primary text-[12px]",children:"Compare All"}),a.jsx("button",{onClick:()=>o("benchmark"),disabled:y.length===0||T||v,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),a.jsx("button",{onClick:()=>o("baseline"),disabled:y.length===0||T||v,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&y.length>0&&a.jsxs("div",{className:"mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",A,"/",y.length," cases"]}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(A/y.length*100),"%"]})]}),a.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${A/y.length*100}%`,background:"var(--accent)"}})}),a.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",G>=60?`${Math.floor(G/60)}m ${G%60}s`:`${G}s`]}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",ie]})]})]}),a.jsx("div",{className:"space-y-3 stagger-children",children:y.map(Z=>{const ae=j.get(Z.id),ne=b.get(Z.id),$=(ne==null?void 0:ne.status)??"idle";return a.jsx(Ov,{name:Z.name,evalId:Z.id,result:ae,caseStatus:$,runMode:(ne==null?void 0:ne.mode)??null,isReadOnly:v,onRun:F=>c(F,"benchmark"),onBaseline:F=>c(F,"baseline"),onCompare:F=>c(F,"comparison"),onCancel:F=>u(F)},Z.id)})}),!T&&f&&f.cases.length>0&&a.jsxs("div",{className:"mt-5",children:[a.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),a.jsx("span",{className:"text-[20px] font-bold",style:{color:(f.overall_pass_rate??0)>=.8?"var(--green)":(f.overall_pass_rate??0)>=.5?"var(--yellow)":"var(--red)"},children:f.overall_pass_rate!=null?`${Math.round(f.overall_pass_rate*100)}%`:"--"})]}),f.totalDurationMs!=null&&a.jsxs("div",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:["Total: ",(f.totalDurationMs/1e3).toFixed(1),"s",f.model&&` | Model: ${f.model}`]}),f.overall_pass_rate===1&&!f.comparison&&a.jsx("button",{onClick:()=>o("comparison"),disabled:y.length===0||v,className:"text-[13px] font-semibold mt-3 w-full rounded-lg transition-opacity duration-150",style:{padding:"10px 0",background:"var(--green, #22c55e)",color:"#fff",border:"none",cursor:"pointer",opacity:y.length===0?.5:1},children:"Run Final A/B Comparison"})]}),f.comparison&&a.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Ax,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),a.jsx(Ax,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),a.jsxs("div",{className:"mt-3 text-[12px] font-medium",style:{color:f.comparison.delta>0?"var(--green)":f.comparison.delta<0?"var(--red)":"var(--text-tertiary)"},children:["Delta: ",f.comparison.delta>0?"+":"",(f.comparison.delta*100).toFixed(1),"%",f.verdict&&` | ${f.verdict}`]})]})]})]})}const Dv={benchmark:{label:"Skill",bg:"var(--accent-muted)",color:"var(--accent)"},baseline:{label:"Baseline",bg:"var(--surface-3)",color:"var(--text-tertiary)"},comparison:{label:"Compare",bg:"rgba(168,85,247,0.12)",color:"rgb(168,85,247)"}};function Ov({name:r,evalId:c,result:o,caseStatus:u,runMode:x,isReadOnly:v,onRun:p,onBaseline:b,onCompare:g,onCancel:f}){const[j,y]=h.useState(!1),T=u==="running"||u==="queued",A=u==="complete"||u==="error";return a.jsxs("div",{className:"rounded-xl overflow-hidden transition-all duration-200",style:{background:"var(--surface-1)",border:T?"1px solid var(--accent)":"1px solid var(--border-subtle)",boxShadow:T?"0 0 12px rgba(99, 131, 255, 0.15)":"none"},children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[u==="running"&&a.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),u==="queued"&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),a.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",c," ",r]}),x&&(T||A)&&(()=>{const L=Dv[x];return L?a.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:L.bg,color:L.color,padding:"1px 6px"},children:L.label}):null})()]}),a.jsxs("div",{className:"flex items-center gap-2",children:[T?a.jsx("button",{onClick:()=>f(c),className:"btn text-[10px] px-2 py-1",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:"Cancel"}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>g(c),disabled:v,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),a.jsx("button",{onClick:()=>p(c),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),a.jsx("button",{onClick:()=>b(c),disabled:v,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),o&&o.status!=null&&a.jsx("span",{className:"pill text-[10px]",style:{background:o.status==="pass"?"var(--green-muted)":(o.status==="error","var(--red-muted)"),color:o.status==="pass"?"var(--green)":"var(--red)"},children:o.passRate!=null?`${Math.round(o.passRate*100)}%`:o.status}),u==="cancelled"&&a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),o&&o.assertions.length>0&&a.jsxs("div",{className:"px-4 pb-3",children:[a.jsx("div",{className:"space-y-1",children:o.assertions.map(L=>a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsx("span",{style:{color:L.pass?"var(--green)":"var(--red)"},children:L.pass?"PASS":"FAIL"}),a.jsx("span",{style:{color:"var(--text-secondary)"},children:L.text})]},L.assertion_id))}),o.output&&a.jsx("button",{onClick:()=>y(!j),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:j?"Hide output":"Show output"}),j&&o.output&&a.jsx("pre",{className:"text-[11px] mt-2 p-3 rounded-lg overflow-auto",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",maxHeight:200,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap"},children:o.output})]}),o&&o.errorMessage&&a.jsx(Bv,{errorMessage:o.errorMessage,classifiedError:o.classifiedError})]})}const Jo={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Bv({errorMessage:r,classifiedError:c}){const[o,u]=h.useState(!1),x=(c==null?void 0:c.title)??"Error",v=c==null?void 0:c.hint,p=c?Jo[c.category]??Jo.unknown:Jo.unknown;return a.jsx("div",{className:"px-4 pb-3",children:a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[a.jsx("span",{style:{fontSize:12},children:p}),a.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:x}),a.jsx("button",{onClick:()=>u(!o),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:o?"Hide details":"Details"})]}),v&&a.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:v}),o&&a.jsx("pre",{className:"text-[10px] px-3 pb-2.5 overflow-auto",style:{color:"var(--text-tertiary)",maxHeight:120,fontFamily:"var(--font-mono, ui-monospace, monospace)",whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:r})]})})}function Ax({label:r,value:c,color:o}){return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:r}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:o},children:[Math.round(c*100),"%"]})]}),a.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c*100}%`,background:o}})})]})}const Rx={TP:{bg:"var(--green-muted)",text:"var(--green)"},TN:{bg:"rgba(52,211,153,0.06)",text:"rgba(52,211,153,0.6)"},FP:{bg:"var(--red-muted)",text:"var(--red)"},FN:{bg:"rgba(248,113,113,0.06)",text:"rgba(248,113,113,0.6)"}};function Hv(){const{state:r,dispatch:c,runActivationTest:o,cancelActivation:u,generateActivationPrompts:x}=il(),{plugin:v,skill:p,activationPrompts:b,activationResults:g,activationSummary:f,activationRunning:j,activationError:y,activationStartedAt:T,generatingPrompts:A,generatingPromptsError:L,activationHistory:O}=r,[G,q]=h.useState(b),[J,ie]=h.useState(null),[Z,ae]=h.useState(!1);h.useEffect(()=>{b&&b!==G&&q(b)},[b]),h.useEffect(()=>{c({type:"SET_ACTIVATION_PROMPTS",prompts:G})},[G,c]),h.useEffect(()=>{fetch(`/api/skills/${v}/${p}/description`).then(ee=>ee.json()).then(ee=>ie(ee.rawContent||ee.description||null)).catch(()=>ie(null))},[v,p]);function ne(){o(G)}function $(){x(8)}const F=G.trim().split(`
|
|
63
|
+
`).filter(Boolean).length,xe=g.filter(ee=>ee.classification==="TP"||ee.classification==="TN"),Ne=g.filter(ee=>ee.classification==="FP"||ee.classification==="FN"),ge=(J==null?void 0:J.replace(/^---[\s\S]*?---\s*/,"").trim())??null,je=G.trim().length>0,Q=ge?Nr(ge):"";return a.jsxs("div",{className:"p-5 space-y-5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),a.jsx("div",{className:"text-[12px] mt-0.5",style:{color:"var(--text-tertiary)"},children:"Test whether this skill's description activates for relevant prompts and stays silent for irrelevant ones."})]}),a.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[a.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),a.jsx("div",{className:"flex gap-1.5",children:a.jsx("button",{onClick:$,disabled:A||!ge||j,className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150 flex items-center gap-1.5",style:{background:A?"var(--surface-3)":"var(--surface-2)",color:ge?"var(--accent)":"var(--text-tertiary)",border:"1px solid var(--border-subtle)",opacity:ge?1:.5,cursor:ge?"pointer":"not-allowed"},title:ge?void 0:"No skill description available",onMouseEnter:ee=>{ge&&!A&&(ee.currentTarget.style.background="var(--surface-3)")},onMouseLeave:ee=>{A||(ee.currentTarget.style.background="var(--surface-2)")},children:A?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{borderTopColor:"var(--accent)",borderColor:"var(--border-subtle)",width:10,height:10}}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3v3m6.36.64l-2.12 2.12M21 12h-3m-.64 6.36l-2.12-2.12M12 21v-3m-4.24.64l2.12-2.12M3 12h3m.64-6.36l2.12 2.12"})}),je?"Regenerate":"Generate"," Test Prompts"]})})})]}),L&&a.jsx("div",{className:"text-[11px] px-2 py-1 rounded",style:{color:"var(--red)",background:"var(--red-muted)"},children:L}),a.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:G,onChange:ee=>q(ee.target.value),placeholder:`How do I write a unit test?
|
|
64
|
+
What edge cases should I test?
|
|
65
|
+
+Deploy this to production
|
|
66
|
+
!What's the weather like today?
|
|
67
|
+
!Write me a poem about flowers`}),a.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{children:"One prompt per line"}),a.jsx(br,{}),a.jsx("span",{children:"No prefix = auto-classify"}),a.jsx(br,{}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),a.jsx(br,{}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),a.jsx(br,{}),a.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[F," prompt",F!==1?"s":""]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:ne,disabled:j||!G.trim(),className:"btn btn-primary",children:j?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("circle",{cx:"12",cy:"12",r:"6"}),a.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})}),j&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[g.length," / ",F," prompts tested",T&&a.jsx(Yv,{startedAt:T})]})]})]})]}),a.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[a.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:a.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),a.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:ge?a.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Q}}):a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),y&&a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:y}),j&&g.length===0&&a.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[a.jsx("div",{className:"spinner-lg mx-auto mb-4"}),a.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),g.length>0&&a.jsxs("div",{className:"space-y-5",children:[Ne.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),a.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",Ne.length,")"]}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),a.jsx("div",{className:"space-y-1.5 stagger-children",children:Ne.map((ee,me)=>a.jsx(_x,{result:ee},`incorrect-${me}`))})]}),xe.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"16 10 11 15 8 12"})]}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",xe.length,")"]})]}),a.jsx("div",{className:"space-y-1.5 stagger-children",children:xe.map((ee,me)=>a.jsx(_x,{result:ee},`correct-${me}`))})]})]}),f&&a.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),f.autoClassifiedCount!=null&&f.autoClassifiedCount>0&&a.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[f.autoClassifiedCount," of ",f.total," prompts auto-classified from skill name and tags"]}),a.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[a.jsx(Wo,{label:"Precision",value:f.precision,description:"Of all activations, how many were correct?",detail:`${f.tp} true / ${f.tp+f.fp} total activations`}),a.jsx(Wo,{label:"Recall",value:f.recall,description:"Of expected activations, how many fired?",detail:`${f.tp} activated / ${f.tp+f.fn} expected`}),a.jsx(Wo,{label:"Reliability",value:f.reliability,description:"Overall correct classification rate",detail:`${f.tp+f.tn} correct / ${f.total} total`})]}),a.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[a.jsx(jr,{label:"True Positive",abbr:"TP",count:f.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),a.jsx(jr,{label:"False Positive",abbr:"FP",count:f.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),a.jsx(jr,{label:"False Negative",abbr:"FN",count:f.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),a.jsx(jr,{label:"True Negative",abbr:"TN",count:f.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]}),a.jsx(Uv,{history:O,expanded:Z,onToggle:()=>ae(!Z)})]})}function Uv({history:r,expanded:c,onToggle:o}){return r===null?null:a.jsxs("div",{className:"glass-card overflow-hidden",children:[a.jsxs("button",{className:"w-full px-4 py-3 flex items-center justify-between text-left",style:{borderBottom:c?"1px solid var(--border-subtle)":"none"},onClick:o,children:[a.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:["Test History",r.length>0&&a.jsxs("span",{className:"ml-2 font-normal",style:{color:"var(--text-tertiary)"},children:["(",r.length," run",r.length!==1?"s":"",")"]})]}),a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:c?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"},children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),c&&a.jsx("div",{className:"px-4 py-3",children:r.length===0?a.jsx("div",{className:"text-[12px] py-4 text-center",style:{color:"var(--text-tertiary)"},children:"No test runs yet"}):a.jsx("div",{className:"space-y-2",children:r.map(u=>a.jsx(Gv,{run:u},u.id))})})]})}function Gv({run:r}){const c=Math.round(r.summary.reliability*100),o=c>=80?"var(--green)":c>=60?"var(--yellow)":"var(--red)",u=c>=80?"Good":c>=60?"Needs Work":"Poor",x=o;return a.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg",style:{background:"var(--surface-1)"},children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:qv(r.timestamp)}),a.jsx("span",{className:"pill text-[9px] px-1.5",style:{background:"var(--surface-2)",color:"var(--text-tertiary)"},children:r.model||r.provider}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[r.promptCount," prompts"]})]})}),a.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:o,fontVariantNumeric:"tabular-nums"},children:[c,"%"]}),a.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded",style:{color:x,background:`color-mix(in srgb, ${x} 10%, transparent)`},children:u})]})]})}function qv(r){const c=Date.now(),o=new Date(r).getTime(),u=Math.floor((c-o)/1e3);if(u<60)return"just now";const x=Math.floor(u/60);if(x<60)return`${x}m ago`;const v=Math.floor(x/60);if(v<24)return`${v}h ago`;const p=Math.floor(v/24);return p<7?`${p}d ago`:new Date(r).toLocaleDateString()}function br(){return a.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function _x({result:r}){const c=Rx[r.classification]||Rx.FN,o=r.classification==="TP"||r.classification==="TN";return a.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl transition-all duration-200",style:{background:c.bg,border:"1px solid transparent"},children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:`color-mix(in srgb, ${c.text} 20%, transparent)`},children:o?a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}):a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:r.prompt})}),a.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[a.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:c.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:r.classification}),a.jsx("span",{style:{color:r.activate?"var(--green)":"var(--text-tertiary)"},children:r.activate?"Activated":"Silent"}),a.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",r.expected==="should_activate"?"activate":"stay silent"]}),a.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[r.confidence," confidence"]}),r.autoClassified&&a.jsx("span",{className:"pill",style:{background:"rgba(139,92,246,0.1)",color:"rgba(139,92,246,0.8)",fontSize:"9px",padding:"1px 5px"},children:"auto"})]}),r.reasoning&&a.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:r.reasoning})]})]})}function Wo({label:r,value:c,description:o,detail:u}){const x=Math.round(c*100),v=x>=80?"var(--green)":x>=60?"var(--yellow)":"var(--red)";return a.jsxs("div",{className:"text-center",children:[a.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:v},children:[x,"%"]}),a.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:r}),a.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:o}),a.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:u})]})}function jr({abbr:r,count:c,bg:o,color:u,description:x}){return a.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:o},children:[a.jsx("div",{className:"text-[20px] font-bold",style:{color:u},children:c}),a.jsx("div",{className:"text-[11px] font-semibold",style:{color:u},children:r}),a.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:x})]})}function Yv({startedAt:r}){const[c,o]=h.useState(0);return h.useEffect(()=>{const u=setInterval(()=>o(Math.floor((Date.now()-r)/1e3)),1e3);return()=>clearInterval(u)},[r]),a.jsxs("span",{className:"ml-2",children:["(",c,"s)"]})}const Fo={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},Mx={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},nc=600,sc=180,Nt=40,Io=nc-Nt*2,la=sc-Nt*2,Vv=[25,50,75,100];function zx(r){return new Date(r).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Qv(r){return r==null?"--":`${(r/1e3).toFixed(1)}s`}function Xv({entries:r,onPointClick:c}){const[o,u]=h.useState(null),x=h.useMemo(()=>[...r].reverse(),[r]);if(x.length<2)return null;const v=x.length,p=x.map((f,j)=>{const y=Nt+j/(v-1)*Io,T=f.passRate*100,A=Nt+la-T/100*la;return{x:y,y:A,pct:T,entry:f}}),b=p.map(f=>`${f.x},${f.y}`).join(" "),g=Array.from(new Set(x.map(f=>f.type)));return a.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative",overflowX:v>=20?"auto":void 0},children:[a.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),a.jsx("div",{className:"flex items-center gap-5 mb-3",children:g.map(f=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Fo[f]??"var(--text-tertiary)"}}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:Mx[f]??f})]},f))}),a.jsxs("svg",{width:nc,height:sc,viewBox:`0 0 ${nc} ${sc}`,style:{display:"block",overflow:"visible"},children:[Vv.map(f=>{const j=Nt+la-f/100*la;return a.jsxs("g",{children:[a.jsx("line",{x1:Nt,y1:j,x2:Nt+Io,y2:j,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),a.jsxs("text",{x:Nt-8,y:j+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[f,"%"]})]},f)}),a.jsx("line",{x1:Nt,y1:Nt+la,x2:Nt+Io,y2:Nt+la,stroke:"var(--border-subtle)",strokeWidth:1}),a.jsx("text",{x:Nt-8,y:Nt+la+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),a.jsx("polyline",{points:b,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),p.map((f,j)=>a.jsx("circle",{cx:f.x,cy:f.y,r:5,fill:Fo[f.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:y=>{y.currentTarget.setAttribute("r","7"),u({x:f.x,y:f.y,entry:f.entry})},onMouseLeave:y=>{y.currentTarget.setAttribute("r","5"),u(null)},onClick:()=>c==null?void 0:c(f.entry)},j)),Zv(v).map(f=>a.jsx("text",{x:p[f].x,y:Nt+la+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:zx(x[f].timestamp)},f))]}),o&&a.jsxs("div",{style:{position:"absolute",left:o.x,top:o.y-12,transform:"translate(-50%, -100%)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"8px 12px",pointerEvents:"none",zIndex:10,whiteSpace:"nowrap"},children:[a.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:zx(o.entry.timestamp)}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:o.entry.model}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Fo[o.entry.type]??"var(--text-tertiary)",color:"#fff"},children:Mx[o.entry.type]??o.entry.type}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(o.entry.passRate*100),"%"]})]}),a.jsxs("div",{className:"text-[10px] mt-1.5 flex items-center gap-3",style:{color:"var(--text-tertiary)"},children:[a.jsx("span",{children:Qv(o.entry.totalDurationMs)}),a.jsx("span",{children:o.entry.totalTokens!=null?`${o.entry.totalTokens} tokens`:"--"})]})]})]})}function Zv(r){if(r<=3)return Array.from({length:r},(u,x)=>x);if(r<=6)return[0,Math.floor(r/2),r-1];if(r<20)return[0,Math.floor(r/3),Math.floor(2*r/3),r-1];const c=Math.ceil(r/10),o=[0];for(let u=c;u<r-1;u+=c)o.push(u);return o.push(r-1),o}function Sr(r){return r>=.8?"var(--green)":r>=.5?"var(--yellow)":"var(--red)"}function Kv(r){return r>=1e3?`${(r/1e3).toFixed(1)}s`:`${Math.round(r)}ms`}function $v({rate:r,label:c}){const o=Math.round(r*100);return a.jsx("div",{className:"flex items-center gap-3",children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:c}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(r)},children:[o,"%"]})]}),a.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${o}%`,background:Sr(r)}})})]})})}function Jv({points:r}){if(r.length<2)return null;const c=200,o=48,u=4,x=r.length,v=r.map((g,f)=>{const j=u+f/(x-1)*(c-u*2),y=u+(o-u*2)-g.passRate*(o-u*2);return{x:j,y}}),p=`M ${v[0].x},${o-u} `+v.map(g=>`L ${g.x},${g.y}`).join(" ")+` L ${v[v.length-1].x},${o-u} Z`,b=v.map((g,f)=>`${f===0?"M":"L"} ${g.x},${g.y}`).join(" ");return a.jsxs("svg",{width:c,height:o,style:{display:"block"},children:[a.jsx("path",{d:p,fill:"var(--accent-muted)"}),a.jsx("path",{d:b,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),a.jsx("circle",{cx:v[v.length-1].x,cy:v[v.length-1].y,r:3,fill:"var(--accent)"})]})}function Wv({plugin:r,skill:c}){const[o,u]=h.useState(null),[x,v]=h.useState(!0);if(h.useEffect(()=>{v(!0),Se.getStats(r,c).then(u).catch(()=>u(null)).finally(()=>v(!1))},[r,c]),x)return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"skeleton h-24 rounded-xl"}),a.jsx("div",{className:"skeleton h-48 rounded-xl"}),a.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!o||o.totalRuns===0)return a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]})}),a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),a.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const p=o.trendPoints.length>0?o.trendPoints[o.trendPoints.length-1].passRate:0,b=o.trendPoints.length>0?o.trendPoints[0].passRate:0,g=p-b,f=o.assertionStats.slice(0,10);return a.jsxs("div",{className:"space-y-4 stagger-children",children:[a.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),a.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:o.totalRuns})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),a.jsxs("div",{className:"text-[24px] font-bold",style:{color:Sr(p)},children:[Math.round(p*100),"%"]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),a.jsxs("div",{className:"text-[24px] font-bold",style:{color:g>=0?"var(--green)":"var(--red)"},children:[g>=0?"+":"",Math.round(g*100),"%"]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),a.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:o.modelStats.length})]})]}),o.trendPoints.length>=2&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),a.jsx(Jv,{points:o.trendPoints})]}),o.modelStats.length>0&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),a.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),a.jsx("tbody",{children:o.modelStats.map(j=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:j.model}),a.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:j.runs}),a.jsx("td",{style:{padding:"8px",textAlign:"center"},children:a.jsxs("span",{className:"font-semibold",style:{color:Sr(j.avgPassRate)},children:[Math.round(j.avgPassRate*100),"%"]})}),a.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Kv(j.avgDurationMs)})]},j.model))})]})]}),f.length>0&&a.jsxs("div",{className:"glass-card p-5",children:[a.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),a.jsx("div",{className:"space-y-3",children:f.map(j=>a.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:y=>{y.currentTarget.style.background="var(--surface-2)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},onClick:()=>{},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsxs("span",{className:"text-[10px] font-mono px-1 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",j.evalId]}),a.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:j.evalName}),a.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[j.totalRuns," runs"]})]}),a.jsx($v,{rate:j.passRate,label:j.text})]},`${j.evalId}:${j.id}`))})]})]})}function Fv({plugin:r,skill:c}){const[o,u]=h.useState(null),[x,v]=h.useState(null),[p,b]=h.useState({}),[g,f]=h.useState({});h.useEffect(()=>{Se.getEvals(r,c).then(u).catch(()=>u(null))},[r,c]);async function j(y){if(x===y){v(null);return}if(v(y),!p[y]){f(T=>({...T,[y]:!0}));try{const T=await Se.getCaseHistory(r,c,y);b(A=>({...A,[y]:T}))}catch{b(T=>({...T,[y]:[]}))}finally{f(T=>({...T,[y]:!1}))}}}return o?a.jsx("div",{className:"space-y-2 stagger-children",children:o.evals.map(y=>{const T=p[y.id]||[],A=x===y.id,L=g[y.id],O=T.length>0?T[0].pass_rate:null;return a.jsxs("div",{className:"glass-card overflow-hidden",children:[a.jsxs("button",{onClick:()=>j(y.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:A?"var(--surface-2)":"transparent"},onMouseEnter:G=>{A||(G.currentTarget.style.background="var(--surface-2)")},onMouseLeave:G=>{A||(G.currentTarget.style.background="transparent")},children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:A?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),a.jsxs("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:["#",y.id]}),a.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:y.name}),T.length>=2&&a.jsx(Xx,{entries:T}),O!=null&&a.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:dn(O)},children:[Math.round(O*100),"%"]}),T.length>0&&a.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.length," runs"]})]}),A&&a.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:L?a.jsxs("div",{className:"p-4 flex items-center gap-2",children:[a.jsx("div",{className:"spinner",style:{width:14,height:14}}),a.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):T.length===0?a.jsx("div",{className:"p-4",children:a.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):a.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:T.map((G,q)=>a.jsxs("div",{className:"p-4",style:{background:q===0?"var(--surface-2)":"transparent"},children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Vx(G.timestamp)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:G.model}),a.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:G.type==="benchmark"?"rgba(99,131,255,0.15)":G.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:G.type==="benchmark"?"#6383ff":G.type==="comparison"?"var(--purple)":"#fb923c"},children:G.type}),a.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:dn(G.pass_rate)},children:[Math.round(G.pass_rate*100),"%"]})]}),a.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[G.durationMs!=null&&a.jsx("span",{children:Qx(G.durationMs)}),G.tokens!=null&&a.jsxs("span",{children:[G.tokens>=1e3?`${(G.tokens/1e3).toFixed(1)}k`:G.tokens," tok"]})]}),a.jsx("div",{className:"space-y-1",children:G.assertions.map(J=>a.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[a.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:J.pass?"var(--green)":"var(--red)"},children:a.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:J.pass?a.jsx("polyline",{points:"20 6 9 17 4 12"}):a.jsxs(a.Fragment,{children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:J.text}),J.reasoning&&a.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:J.reasoning})]})]},J.id))})]},q))})})]},y.id)})}):a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function Iv(){const{state:r,dispatch:c}=il(),{plugin:o,skill:u}=r,[x,v]=h.useState("timeline"),[p,b]=h.useState([]),[g,f]=h.useState(!0),[j,y]=h.useState(""),[T,A]=h.useState(""),[L,O]=h.useState(!1),[G,q]=h.useState([]),[J,ie]=h.useState(null),[Z,ae]=h.useState(!1),[ne,$]=h.useState(null),[F,xe]=h.useState(!1);h.useEffect(()=>{f(!0),Se.getHistory(o,u,{model:j||void 0,type:T||void 0}).then(Q=>{b(Q),Q.length>=2&&Se.compareRuns(o,u,Q[0].timestamp,Q[1].timestamp).then(ee=>{const me=ee.regressions.filter(C=>C.change==="regression");c({type:"SET_REGRESSIONS",regressions:me})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[o,u,j,T]);const Ne=h.useCallback(async Q=>{if(L){q(ee=>ee.includes(Q)?ee.filter(me=>me!==Q):ee.length>=2?[ee[1],Q]:[...ee,Q]);return}xe(!0);try{const ee=await Se.getHistoryEntry(o,u,Q);$(ee)}catch{}finally{xe(!1)}},[o,u,L]),ge=h.useCallback(async()=>{if(G.length===2){ae(!0);try{const Q=await Se.compareRuns(o,u,G[0],G[1]);ie(Q)}catch{}finally{ae(!1)}}},[o,u,G]),je=[...new Set(p.map(Q=>Q.model))];return g?a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),a.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"skeleton h-12 rounded-lg"}),a.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(Q=>a.jsx("button",{onClick:()=>v(Q),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:x===Q?"var(--accent-muted)":"transparent",color:x===Q?"var(--accent)":"var(--text-tertiary)"},children:Q==="timeline"?"Timeline":Q==="per-eval"?"Per Eval":"Statistics"},Q))}),x==="timeline"&&a.jsxs("div",{children:[p.length>0&&a.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:a.jsx(Xv,{entries:p,onPointClick:Q=>Ne(Q.timestamp)})}),a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsxs("select",{value:j,onChange:Q=>y(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[a.jsx("option",{value:"",children:"All Models"}),je.map(Q=>a.jsx("option",{value:Q,children:Q},Q))]}),a.jsxs("select",{value:T,onChange:Q=>A(Q.target.value),className:"input-field text-[12px]",style:{width:150},children:[a.jsx("option",{value:"",children:"All Types"}),a.jsx("option",{value:"benchmark",children:"Benchmark"}),a.jsx("option",{value:"comparison",children:"Comparison"}),a.jsx("option",{value:"baseline",children:"Baseline"}),a.jsx("option",{value:"model-compare",children:"Model Compare"}),a.jsx("option",{value:"improve",children:"AI Improve"}),a.jsx("option",{value:"instruct",children:"AI Edit"}),a.jsx("option",{value:"ai-generate",children:"AI Generate"}),a.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>{O(!L),q([]),ie(null)},className:`btn text-[12px] ${L?"btn-primary":"btn-secondary"}`,children:L?"Exit Compare":"Compare Runs"}),L&&G.length===2&&a.jsx("button",{onClick:ge,disabled:Z,className:"btn btn-primary text-[12px]",children:Z?"Comparing...":"Compare"})]}),a.jsx("div",{className:"space-y-2",children:p.length===0?a.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(Q=>{const ee=G.includes(Q.timestamp);return a.jsx("button",{onClick:()=>Ne(Q.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ee?"var(--accent-muted)":"var(--surface-1)",border:ee?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:me=>{ee||(me.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:me=>{ee||(me.currentTarget.style.borderColor="var(--border-subtle)")},children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[L&&a.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:ee?"var(--accent)":"var(--border-default)",background:ee?"var(--accent)":"transparent"},children:ee&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(Q.timestamp).toLocaleString()}),a.jsx("span",{className:"pill text-[9px]",style:{background:Q.type==="comparison"?"var(--purple-muted)":Q.type==="baseline"?"var(--surface-3)":Q.type==="model-compare"?"rgba(56,189,248,0.15)":Q.type==="improve"||Q.type==="instruct"?"rgba(168,85,247,0.15)":Q.type==="ai-generate"?"rgba(34,197,94,0.15)":Q.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:Q.type==="comparison"?"var(--purple)":Q.type==="baseline"?"var(--text-tertiary)":Q.type==="model-compare"?"#38bdf8":Q.type==="improve"||Q.type==="instruct"?"#a855f7":Q.type==="ai-generate"?"#22c55e":Q.type==="eval-generate"?"#fb923c":"var(--accent)"},children:Q.type==="model-compare"?"model compare":Q.type==="improve"?"ai improve":Q.type==="instruct"?"ai edit":Q.type==="ai-generate"?"ai generate":Q.type==="eval-generate"?"eval generate":Q.type})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Q.model}),a.jsxs("span",{className:"text-[12px] font-semibold",style:{color:Q.passRate>=.8?"var(--green)":Q.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(Q.passRate*100),"%"]})]})]})},Q.timestamp)})}),J&&a.jsx(Pv,{result:J}),ne&&!L&&a.jsx(ey,{run:ne,onClose:()=>$(null)})]}),x==="per-eval"&&a.jsx(Fv,{plugin:o,skill:u}),x==="statistics"&&a.jsx(Wv,{plugin:o,skill:u})]})}function Pv({result:r}){const c=r.regressions.filter(u=>u.change==="regression"),o=r.regressions.filter(u=>u.change==="improvement");return a.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(r.runA.timestamp).toLocaleDateString()," vs ",new Date(r.runB.timestamp).toLocaleDateString()]}),c.length>0&&a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",c.length,")"]}),c.map(u=>a.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",a.jsx("span",{style:{color:"var(--red)"},children:u.assertionId})," (was passing, now failing)"]},`${u.evalId}-${u.assertionId}`))]}),o.length>0&&a.jsxs("div",{className:"mb-3",children:[a.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",o.length,")"]}),o.map(u=>a.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",u.evalId," ",u.evalName,": ",a.jsx("span",{style:{color:"var(--green)"},children:u.assertionId})," (was failing, now passing)"]},`${u.evalId}-${u.assertionId}`))]}),a.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),a.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:a.jsxs("table",{className:"w-full text-[12px]",children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"var(--surface-2)"},children:[a.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),a.jsx("tbody",{children:r.caseDiffs.map(u=>a.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[a.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),a.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateA!=null?u.passRateA>=.8?"var(--green)":u.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateA!=null?`${Math.round(u.passRateA*100)}%`:u.statusA}),a.jsx("td",{className:"text-right px-3 py-2",style:{color:u.passRateB!=null?u.passRateB>=.8?"var(--green)":u.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:u.passRateB!=null?`${Math.round(u.passRateB*100)}%`:u.statusB})]},u.eval_id))})]})})]})}function ey({run:r,onClose:c}){return(r.type==="improve"||r.type==="instruct")&&r.improve?a.jsx(ty,{run:r,onClose:c}):a.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(r.timestamp).toLocaleString()]}),a.jsx("button",{onClick:c,className:"btn btn-ghost text-[11px]",children:"Close"})]}),a.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",r.model," | Cases: ",r.cases.length," | Pass Rate: ",r.overall_pass_rate!=null?`${Math.round(r.overall_pass_rate*100)}%`:"--"]}),a.jsx("div",{className:"space-y-2",children:r.cases.map(o=>a.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",o.eval_id," ",o.eval_name]}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:o.status==="pass"?"var(--green)":"var(--red)"},children:o.pass_rate!=null?`${Math.round(o.pass_rate*100)}%`:o.status})]})},o.eval_id))})]})}function ty({run:r,onClose:c}){var v;const o=h.useMemo(()=>r.improve?Er(r.improve.original,r.improve.improved):[],[r.improve]),u=h.useMemo(()=>{const p=o.filter(g=>g.type==="added").length,b=o.filter(g=>g.type==="removed").length;return{added:p,removed:b}},[o]),x=h.useMemo(()=>{let p=0,b=0;return o.map(g=>g.type==="removed"?(p++,{...g,origNum:p,newNum:null}):g.type==="added"?(b++,{...g,origNum:null,newNum:b}):(p++,b++,{...g,origNum:p,newNum:b}))},[o]);return a.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),a.jsx("path",{d:"M2 17l10 5 10-5"}),a.jsx("path",{d:"M2 12l10 5 10-5"})]})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),a.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(r.timestamp).toLocaleString()," · ",r.model]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[a.jsxs("span",{style:{color:"var(--green)"},children:["+",u.added]}),a.jsxs("span",{style:{color:"var(--red)"},children:["-",u.removed]})]}),a.jsx("button",{onClick:c,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--surface-3)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((v=r.improve)==null?void 0:v.reasoning)&&a.jsxs("div",{className:"mx-4 mt-4 px-4 py-3 rounded-lg text-[12px]",style:{background:"rgba(168,85,247,0.06)",border:"1px solid rgba(168,85,247,0.15)",color:"var(--text-secondary)"},children:[a.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),r.improve.reasoning]}),a.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:a.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:a.jsx("tbody",{children:x.map((p,b)=>a.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[a.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="removed"?"rgba(239,68,68,0.5)":"var(--text-tertiary)",opacity:p.origNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.origNum??""}),a.jsx("td",{className:"text-right select-none px-2",style:{width:40,fontSize:10,color:p.type==="added"?"rgba(34,197,94,0.5)":"var(--text-tertiary)",opacity:p.newNum?.6:.2,borderRight:"1px solid var(--border-subtle)"},children:p.newNum??""}),a.jsx("td",{className:"select-none text-center",style:{width:20,fontSize:11,fontWeight:700,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"transparent",borderRight:p.type==="added"?"2px solid var(--green)":p.type==="removed"?"2px solid var(--red)":"2px solid transparent"},children:p.type==="added"?"+":p.type==="removed"?"-":" "}),a.jsx("td",{className:"px-3 py-px whitespace-pre-wrap",style:{fontSize:11,lineHeight:1.6,color:p.type==="added"?"var(--green)":p.type==="removed"?"var(--red)":"var(--text-secondary)"},children:p.content||""})]},b))})})})]})}function ly({plugin:r,skill:c}){const[o,u]=h.useState([]),[x,v]=h.useState([]),[p,b]=h.useState(!0),[g,f]=h.useState(null);h.useEffect(()=>{Se.getDependencies(r,c).then(y=>{u(y.mcpDependencies),v(y.skillDependencies)}).catch(()=>{}).finally(()=>b(!1))},[r,c]);async function j(y,T){try{await navigator.clipboard.writeText(T),f(y),setTimeout(()=>f(null),2e3)}catch{}}return p?null:o.length===0&&x.length===0?a.jsx("div",{className:"mb-5 px-4 py-3 rounded-lg text-[12px]",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"No dependencies detected"}):a.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[a.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3.5",style:{background:"var(--surface-2)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}),a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),a.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:o.length+x.length})]}),a.jsxs("div",{className:"px-5 py-4",children:[o.length>0&&a.jsxs("div",{className:"space-y-3 mb-4",children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),o.map(y=>a.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:y.server}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:y.transport})]}),a.jsx("button",{onClick:()=>j(y.server,y.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:g===y.server?"var(--green)":"var(--accent)"},children:g===y.server?a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})," Copy Config"]})})]}),a.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:y.url}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.matchedTools.map(T=>a.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:T},T))})]},y.server))]}),x.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),a.jsx("div",{className:"space-y-1.5",children:x.map(y=>a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})}),a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:y.name}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:y.source==="frontmatter"?"frontmatter":"referenced"})]},y.name))})]})]})]})}function ay(){const{state:r}=il(),{plugin:c,skill:o}=r,[u,x]=h.useState(null),[v,p]=h.useState(!0);return h.useEffect(()=>{Se.getDependencies(c,o).then(x).catch(()=>{}).finally(()=>p(!1))},[c,o]),v?a.jsxs("div",{className:"p-5",children:[a.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),a.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):u?a.jsx("div",{className:"p-5 max-w-3xl",children:a.jsx(ly,{plugin:c,skill:o})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}function $x({data:r}){if(r.length<2)return a.jsx("span",{style:{color:"var(--text-tertiary)",fontSize:10},children:"--"});const c=r.slice(-10),o=80,u=24,x=2,v=o-x*2,p=u-x*2,b=c.length,g=Math.min(...c),j=Math.max(...c)-g||1,y=c.map((L,O)=>{const G=x+O/(b-1)*v,q=x+p-(L-g)/j*p;return`${G.toFixed(1)},${q.toFixed(1)}`}),T=c[c.length-1],A=dn(T);return a.jsxs("svg",{width:o,height:u,viewBox:`0 0 ${o} ${u}`,style:{display:"block"},children:[a.jsx("polyline",{points:y.join(" "),fill:"none",stroke:A,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),(()=>{const[L,O]=y[y.length-1].split(",");return a.jsx("circle",{cx:L,cy:O,r:2.5,fill:A})})()]})}function ny(){return a.jsxs("span",{className:"pill",style:{background:"rgba(251,191,36,0.15)",color:"#fbbf24",fontSize:9,fontWeight:700,gap:3},children:[a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"#fbbf24",stroke:"none",children:a.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),"Best Model"]})}function sy({pct:r}){const c=r>=10?"var(--green)":r>=0?"var(--yellow)":"var(--red)",o=r>=10?"var(--green-muted)":r>=0?"var(--yellow-muted)":"var(--red-muted)",u=r>=0?"+":"";return a.jsxs("span",{className:"pill",style:{background:o,color:c,fontSize:10,fontWeight:600},children:[u,r.toFixed(1),"%"]})}function ry({score:r,rating:c}){const o={excellent:{bg:"var(--green-muted)",fg:"var(--green)"},good:{bg:"var(--green-muted)",fg:"var(--green)"},marginal:{bg:"var(--yellow-muted)",fg:"var(--yellow)"},minimal:{bg:"var(--yellow-muted)",fg:"var(--yellow)"},harmful:{bg:"var(--red-muted)",fg:"var(--red)"}},u=o[c]??o.minimal,x=r>=0?"+":"";return a.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"Skill Quality:"}),a.jsxs("span",{className:"pill",style:{background:u.bg,color:u.fg,fontSize:11,fontWeight:600},children:[x,r.toFixed(1),"% (",c.toUpperCase(),")"]})]})}function iy({warning:r}){return a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg mb-3",style:{background:"var(--yellow-muted)",border:"1px solid rgba(251,191,36,0.3)"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--yellow)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),a.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),a.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--yellow)"},children:r})]})}function oy({active:r,onChange:c,hasBaseline:o}){return a.jsxs("div",{className:"flex gap-1 p-0.5 rounded-lg",style:{background:"var(--surface-2)"},children:[a.jsx("button",{onClick:()=>c("rankings"),className:"px-3 py-1 rounded-md text-[11px] font-medium transition-all",style:{background:r==="rankings"?"var(--surface-3)":"transparent",color:r==="rankings"?"var(--text-primary)":"var(--text-tertiary)"},children:"Rankings"}),a.jsx("button",{onClick:()=>c("amplification"),disabled:!o,className:"px-3 py-1 rounded-md text-[11px] font-medium transition-all",style:{background:r==="amplification"?"var(--surface-3)":"transparent",color:o&&r==="amplification"?"var(--text-primary)":"var(--text-tertiary)",opacity:o?1:.5,cursor:o?"pointer":"not-allowed"},title:o?"View skill amplification data":"Run sweep with --baseline to see amplification data",children:"Skill Amplification"})]})}function cy(r){var u,x,v;if(r.length===0)return[];const c=new Map;for(const p of r)for(const b of p.models){if(b.status==="error")continue;const g=`${b.provider}/${b.model}`;c.has(g)||c.set(g,{provider:b.provider,passRates:[],lastRubric:null,lastDuration:0,lastCost:null,lastBaselinePassRate:void 0,lastSkillDelta:void 0,lastAmplificationPct:void 0,lastCompositeScore:void 0,hasBaseline:!1});const f=c.get(g);f.passRates.push(b.passRate.mean),f.lastRubric=((u=b.rubricScore)==null?void 0:u.mean)??null,f.lastDuration=b.duration.mean,f.lastCost=((x=b.cost)==null?void 0:x.total)??null,f.lastCompositeScore=b.compositeScore,b.baselinePassRate!=null&&(f.lastBaselinePassRate=b.baselinePassRate.mean,f.lastSkillDelta=(v=b.skillDelta)==null?void 0:v.mean,f.lastAmplificationPct=b.amplificationPct,f.hasBaseline=!0)}const o=[];for(const[p,b]of c){const[g,...f]=p.split("/");o.push({rank:0,model:f.join("/"),provider:g,passRate:b.passRates[b.passRates.length-1],rubricScore:b.lastRubric,duration:b.lastDuration,cost:b.lastCost,sparklineData:b.passRates,isBest:!1,baselinePassRate:b.lastBaselinePassRate,skillDelta:b.lastSkillDelta,amplificationPct:b.lastAmplificationPct,compositeScore:b.lastCompositeScore,hasBaseline:b.hasBaseline})}return o.sort((p,b)=>p.compositeScore!=null&&b.compositeScore!=null?b.compositeScore-p.compositeScore:b.passRate-p.passRate),o.forEach((p,b)=>{p.rank=b+1}),o.length>0&&(o[0].isBest=!0),o}const Jx=(r="left")=>({padding:"10px 12px",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary)",textAlign:r,whiteSpace:"nowrap"});function uy({entries:r}){return a.jsx("div",{className:"glass-card",style:{overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["#","Model","Pass Rate","Rubric","Duration","Cost","Trend"].map(c=>a.jsx("th",{style:Jx(c==="#"?"center":"left"),children:c},c))})}),a.jsx("tbody",{children:r.map(c=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:o=>{o.currentTarget.style.background="var(--surface-2)"},onMouseLeave:o=>{o.currentTarget.style.background="transparent"},children:[a.jsx("td",{style:{padding:"10px 12px",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--text-tertiary)",width:40},children:c.rank}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:c.model}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:c.provider}),c.isBest&&a.jsx(ny,{})]})}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("span",{className:"pill",style:{background:c.passRate>=.7?"var(--green-muted)":c.passRate>=.4?"var(--yellow-muted)":"var(--red-muted)",color:dn(c.passRate),fontSize:11,fontWeight:600},children:[Math.round(c.passRate*100),"%"]})}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.rubricScore!=null?c.rubricScore.toFixed(1):"--"}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.duration<1e3?`${Math.round(c.duration)}ms`:`${(c.duration/1e3).toFixed(1)}s`}),a.jsx("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-secondary)"},children:c.cost!=null?`$${c.cost.toFixed(4)}`:"N/A"}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsx($x,{data:c.sparklineData})})]},`${c.provider}/${c.model}`))})]})})}function dy({entries:r}){const c=[...r].filter(o=>o.hasBaseline).sort((o,u)=>(u.amplificationPct??0)-(o.amplificationPct??0));return c.length===0?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx("div",{className:"text-center",children:a.jsxs("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:["No baseline data available. Run sweep with ",a.jsx("code",{children:"--baseline"})," flag."]})})}):a.jsx("div",{className:"glass-card",style:{overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["#","Model","With Skill","Without Skill","Delta","Amplification","Trend"].map(o=>a.jsx("th",{style:Jx(o==="#"?"center":"left"),children:o},o))})}),a.jsx("tbody",{children:c.map((o,u)=>a.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--surface-2)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[a.jsx("td",{style:{padding:"10px 12px",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--text-tertiary)",width:40},children:u+1}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:o.model}),a.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:o.provider})]})}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsxs("span",{className:"pill",style:{background:o.passRate>=.7?"var(--green-muted)":o.passRate>=.4?"var(--yellow-muted)":"var(--red-muted)",color:dn(o.passRate),fontSize:11,fontWeight:600},children:[Math.round(o.passRate*100),"%"]})}),a.jsx("td",{style:{padding:"10px 12px"},children:o.baselinePassRate!=null?a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:[Math.round(o.baselinePassRate*100),"%"]}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:o.skillDelta!=null?a.jsxs("span",{className:"text-[11px] font-medium",style:{color:o.skillDelta>=0?"var(--green)":"var(--red)"},children:[o.skillDelta>=0?"+":"",(o.skillDelta*100).toFixed(1),"pp"]}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:o.amplificationPct!=null&&isFinite(o.amplificationPct)?a.jsx(sy,{pct:o.amplificationPct}):"--"}),a.jsx("td",{style:{padding:"10px 12px"},children:a.jsx($x,{data:o.sparklineData})})]},`${o.provider}/${o.model}`))})]})})}function fy(){const{state:r}=il(),{plugin:c,skill:o}=r,[u,x]=h.useState([]),[v,p]=h.useState(!0),[b,g]=h.useState(null),[f,j]=h.useState("rankings");h.useEffect(()=>{p(!0),g(null),Se.getLeaderboard(c,o).then(O=>x(O.entries)).catch(O=>g(O instanceof Error?O.message:String(O))).finally(()=>p(!1))},[c,o]);const y=h.useMemo(()=>cy(u),[u]),T=u.some(O=>O.baselineEnabled),A=u[0],L=A==null?void 0:A.judgeBiasWarning;return v?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("div",{className:"spinner spinner-lg"})}):b?a.jsx("div",{className:"flex items-center justify-center h-full px-8",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--red)"},children:"Failed to load leaderboard"}),a.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:b})]})}):y.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 20V10"}),a.jsx("path",{d:"M12 20V4"}),a.jsx("path",{d:"M6 20v-6"})]})}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No sweep results yet"}),a.jsx("div",{className:"text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:"Run your first model sweep to compare performance across models:"}),a.jsx("div",{className:"text-[11px] font-mono px-4 py-3 rounded-lg text-left",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:'vskill eval sweep --models "anthropic/claude-sonnet-4,openrouter/meta-llama/llama-3.1-70b" --judge "anthropic/claude-sonnet-4"'}),a.jsxs("div",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Add ",a.jsx("code",{children:"--baseline"})," to measure skill amplification per model."]})]})]}):a.jsxs("div",{className:"p-5 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"text-[15px] font-semibold",style:{color:"var(--text-primary)"},children:"Model Leaderboard"}),a.jsx(oy,{active:f,onChange:j,hasBaseline:T})]}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[u.length," sweep",u.length!==1?"s":""," · ",y.length," model",y.length!==1?"s":""]})]}),L&&a.jsx(iy,{warning:L}),f==="rankings"?a.jsx(uy,{entries:y}):a.jsx(dy,{entries:y}),f==="amplification"&&(A==null?void 0:A.skillQualityScore)!=null&&(A==null?void 0:A.skillQualityRating)&&a.jsx(ry,{score:A.skillQualityScore,rating:A.skillQualityRating})]})}const xy=["editor","tests","run","activation","history","leaderboard","deps"];function py(r){return r!=null&&xy.includes(r)}function my(){const{state:r,dispatch:c,saveContent:o,isReadOnly:u}=il(),{refreshSkills:x,clearSelection:v}=na(),p=h.useCallback(async()=>{try{await Se.deleteSkill(r.plugin,r.skill),x(),v()}catch(f){const j=f instanceof Error?f.message:String(f);c({type:"SET_ERROR",error:`Failed to delete skill: ${j}`})}},[r.plugin,r.skill,x,v,c]);h.useEffect(()=>{const j=new URLSearchParams(window.location.search).get("panel");py(j)&&j!==r.activePanel&&c({type:"SET_PANEL",panel:j})},[]),h.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",r.activePanel);const j=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",j)},[r.activePanel]);const b=h.useCallback(f=>{const j=f.ctrlKey||f.metaKey;if(j&&f.key>="1"&&f.key<="7"){f.preventDefault(),c({type:"SET_PANEL",panel:["editor","tests","run","activation","history","leaderboard","deps"][parseInt(f.key)-1]});return}if(j&&f.key==="s"&&!f.shiftKey){f.preventDefault(),r.isDirty&&o();return}},[r.isDirty,o,c]);if(h.useEffect(()=>(window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)),[b]),r.loading)return a.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"spinner spinner-lg"}),a.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const g=Array.from(r.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[a.jsx(Kh,{state:r,isReadOnly:u,onDelete:u?void 0:p}),r.error&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",borderBottom:"1px solid var(--border-subtle)"},children:[a.jsx("span",{className:"flex-1",children:r.error}),a.jsx("button",{onClick:()=>c({type:"SET_ERROR",error:null}),style:{background:"none",border:"none",cursor:"pointer",color:"var(--red)",padding:2},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx(Ih,{activePanel:r.activePanel,onPanelChange:f=>c({type:"SET_PANEL",panel:f}),isDirty:r.isDirty,isRunning:g,hasRegressions:r.regressions.length>0,isActivationRunning:r.activationRunning}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:a.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[r.activePanel==="editor"&&a.jsx(Nv,{}),r.activePanel==="tests"&&a.jsx(Cv,{}),r.activePanel==="run"&&a.jsx(Lv,{}),r.activePanel==="activation"&&a.jsx(Hv,{}),r.activePanel==="history"&&a.jsx(Iv,{}),r.activePanel==="leaderboard"&&a.jsx(fy,{}),r.activePanel==="deps"&&a.jsx(ay,{})]},r.activePanel)})]})}function rc(r,c=!0){let o=r.toLowerCase().replace(/[^a-z0-9]+/g,"-");return c&&(o=o.replace(/^-+|-+$/g,"")),o}function hy(r,c,o,u){const v=`.../${r.split("/").slice(-2).join("/")}`;switch(c){case 1:return`${v}/${o}/skills/${u}/SKILL.md`;case 2:return`${v}/plugins/${o}/skills/${u}/SKILL.md`;case 3:return`${v}/skills/${u}/SKILL.md`}}function vy({onCreated:r,resolveAiConfigOverride:c}){const[o,u]=h.useState("ai"),[x,v]=h.useState(null),[p,b]=h.useState(!0),{config:g}=Na(),[f,j]=h.useState(""),[y,T]=h.useState(3),[A,L]=h.useState(""),[O,G]=h.useState(""),[q,J]=h.useState(""),[ie,Z]=h.useState(""),[ae,ne]=h.useState(""),[$,F]=h.useState(""),[xe,Ne]=h.useState("write"),[ge,je]=h.useState(!1),[Q,ee]=h.useState(null),[me,C]=h.useState(""),[E,K]=h.useState(!1),[W,oe]=h.useState(!1),[N,z]=h.useState(null),[V,P]=h.useState(null),[I,te]=h.useState([]),ve=h.useRef(null),Be=h.useRef(null),Ae=h.useRef(null),ut=h.useRef(null),[zt,X]=h.useState(!1),[se,le]=h.useState(!1);h.useEffect(()=>{Se.getProjectLayout().then(Y=>{v(Y),T(Y.suggestedLayout);const Me=Y.detectedLayouts.find(at=>at.layout===Y.suggestedLayout);Me!=null&&Me.existingPlugins.length&&L(Me.existingPlugins[0])}).catch(()=>{}).finally(()=>b(!1))},[]),h.useEffect(()=>{var Y;o==="ai"&&((Y=ve.current)==null||Y.focus())},[o]),h.useEffect(()=>()=>{var Y;(Y=Be.current)==null||Y.abort()},[]);const de=h.useMemo(()=>{var Y;return x?((Y=x.detectedLayouts.find(Me=>Me.layout===y))==null?void 0:Y.existingPlugins)||[]:[]},[x,y]),pe=A==="__new__"?O:A,Ve=x?hy(x.root,y,pe||"{plugin}",f||"{skill}"):"",dt=h.useMemo(()=>x?x.detectedLayouts.filter(Y=>Y.layout!==4):[],[x]),Xe=h.useMemo(()=>{if(!x)return null;const Y=x.detectedLayouts.find(Je=>Je.layout===2&&Je.existingPlugins.length>0),Me=x.detectedLayouts.find(Je=>Je.layout===1&&Je.existingPlugins.length>0),at=Y||Me;return at?{layout:at.layout,plugins:at.existingPlugins}:null},[x]),Lt=h.useCallback(()=>{if(c)return c();if(!g)return{provider:"claude-cli",model:"sonnet"};const Y=g.provider||"claude-cli";let Me=g.model||"sonnet";return Y==="claude-cli"&&Me.startsWith("claude-")&&(Me=Me.replace("claude-","")),{provider:Y,model:Me}},[g,c]),mt=h.useCallback(()=>{var Y;(Y=Be.current)==null||Y.abort(),K(!1)},[]),tl=h.useCallback(()=>{z(null),P(null)},[]),Qt=h.useCallback(async()=>{if(z(null),P(null),te([]),Ae.current=null,!me.trim()){z("Describe what your skill should do");return}K(!0);const Y=new AbortController;Be.current=Y;const{provider:Me,model:at}=Lt();try{const Je=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:me.trim(),provider:Me,model:at}),signal:Y.signal});if(!Je.ok||!Je.body){let Fe=`HTTP ${Je.status}`;try{const nt=await Je.json();nt.error&&(Fe=nt.error)}catch{}throw new Error(Fe)}const Rl=Je.body.getReader(),Ot=new TextDecoder;let sa="",Et="";for(;;){const{done:Fe,value:nt}=await Rl.read();if(Fe)break;sa+=Ot.decode(nt,{stream:!0});const et=sa.split(`
|
|
68
|
+
`);sa=et.pop()||"";for(const ll of et)if(ll.startsWith("event: "))Et=ll.slice(7).trim();else if(ll.startsWith("data: ")){try{const Qe=JSON.parse(ll.slice(6));if(Et==="progress")te(al=>[...al,{phase:Qe.phase,message:Qe.message,timestamp:Date.now()}]);else if(Et==="done"||Et==="complete"){const al={prompt:me.trim(),provider:Lt().provider,model:Lt().model,reasoning:Qe.reasoning||""};if(j(Qe.name),J(Qe.description),Z(Qe.model||""),ne(Qe.allowedTools||""),F(Qe.body),oe(!0),Ae.current=al,u("manual"),Qe.suggestedPlugin&&typeof Qe.suggestedPlugin=="object"&&Qe.suggestedPlugin.plugin){const qe=Qe.suggestedPlugin;if(((x==null?void 0:x.detectedLayouts.flatMap(kt=>kt.existingPlugins))??[]).includes(qe.plugin))if(L(qe.plugin),qe.layout&&(qe.layout===1||qe.layout===2))T(qe.layout);else{const kt=x==null?void 0:x.detectedLayouts.find(Ea=>Ea.existingPlugins.includes(qe.plugin));kt&&(kt.layout===1||kt.layout===2)&&T(kt.layout)}else L("__new__"),G(qe.plugin)}else y===3&&Xe&&le(!0);const st={name:Qe.name,plugin:pe||"",layout:y,description:Qe.description,model:Qe.model||void 0,allowedTools:Qe.allowedTools||void 0,body:Qe.body,aiMeta:al};Se.saveDraft(st).then(qe=>{X(!0),qe!=null&&qe.dir&&(ut.current=qe.dir)}).catch(()=>{})}else Et==="error"&&(z(Qe.message||Qe.description||"Unknown error"),Qe.category&&P(Qe))}catch{}Et=""}}}catch(Je){Je.name!=="AbortError"&&z(Je.message)}finally{K(!1),Be.current=null}},[me,Lt,y,Xe,pe,x]),We=h.useCallback(async()=>{if(ee(null),!f.trim()){ee("Skill name is required");return}if(!q.trim()){ee("Description is required");return}if(y!==3&&!pe.trim()){ee("Plugin name is required");return}je(!0);try{const Y=await Se.createSkill({name:rc(f),plugin:pe||"",layout:y,description:q,model:ie||void 0,allowedTools:ae||void 0,body:$,aiMeta:Ae.current||void 0,draftDir:ut.current||void 0});ut.current=null,r(Y.plugin,Y.skill)}catch(Y){ee(Y.message)}finally{je(!1)}},[f,q,y,pe,ie,ae,$,r]),Dt=h.useCallback(()=>{Xe&&(T(Xe.layout),L(Xe.plugins[0]),le(!1))},[Xe]);return{mode:o,setMode:u,layout:x,layoutLoading:p,selectedLayout:y,setSelectedLayout:T,creatableLayouts:dt,availablePlugins:de,pathPreview:Ve,plugin:A,setPlugin:L,newPlugin:O,setNewPlugin:G,effectivePlugin:pe,name:f,setName:j,description:q,setDescription:J,model:ie,setModel:Z,allowedTools:ae,setAllowedTools:ne,body:$,setBody:F,bodyViewMode:xe,setBodyViewMode:Ne,aiPrompt:me,setAiPrompt:C,generating:E,aiGenerated:W,aiError:N,aiClassifiedError:V,aiProgress:I,promptRef:ve,handleGenerate:Qt,handleCancelGenerate:mt,clearAiError:tl,draftSaved:zt,showPluginRecommendation:se,setShowPluginRecommendation:le,pluginLayoutInfo:Xe,applyPluginRecommendation:Dt,creating:ge,error:Q,handleCreate:We}}function Wx(){return a.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function yy(){return a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Fx({node:r,depth:c=0}){var o;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${c*16}px`,color:r.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[r.type==="dir"?a.jsx(Wx,{}):a.jsx(yy,{}),a.jsxs("span",{children:[r.name,r.type==="dir"?"/":""]})]}),(o=r.children)==null?void 0:o.map(u=>a.jsx(Fx,{node:u,depth:c+1},u.name))]})}function gy(r,c,o){const u=[];c&&u.push({name:"evals.json",type:"file"}),u.push({name:"history",type:"dir"});const x=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:u}];return o&&x.push({name:"draft.json",type:"file"}),{name:r||"{skill}",type:"dir",children:x}}function by({skillName:r,hasEvals:c,isDraft:o}){const u=gy(r,c,o);return a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[a.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsx(Wx,{})}),"Skill Structure"]}),a.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:a.jsx(Fx,{node:u})})]})}const aa={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Po({size:r=14,color:c="currentColor"}){return a.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function jy({onCreated:r,onCancel:c}){const o=vy({onCreated:r});return a.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[a.jsxs("div",{className:"mb-5",children:[a.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),a.jsx("div",{className:"flex items-center justify-between mt-2",children:a.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[a.jsx("button",{onClick:()=>o.setMode("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:o.mode==="ai"?"rgba(168,85,247,0.15)":"transparent",color:o.mode==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:o.mode==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx(Po,{size:12}),"AI-Assisted"]})}),a.jsx("button",{onClick:()=>o.setMode("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:o.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:o.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:o.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"})]})})]}),o.layoutLoading&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),a.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!o.layoutLoading&&o.layout&&o.mode==="ai"&&a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[a.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:a.jsx(Po,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),a.jsx("textarea",{ref:o.promptRef,value:o.aiPrompt,onChange:u=>o.setAiPrompt(u.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
69
|
+
|
|
70
|
+
Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:o.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...aa,minHeight:"120px"},onKeyDown:u=>{u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),o.handleGenerate())}}),a.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),o.generating&&o.aiProgress.length>0&&a.jsx(ss,{entries:o.aiProgress,isRunning:!0}),o.aiError&&a.jsx("div",{children:o.aiClassifiedError?a.jsx(kr,{error:o.aiClassifiedError,onRetry:o.handleGenerate,onDismiss:o.clearAiError}):a.jsxs("div",{children:[a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:o.aiError}),a.jsx("button",{onClick:o.handleGenerate,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[o.generating?a.jsx("button",{onClick:o.handleCancelGenerate,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)",border:"none",cursor:"pointer"},children:"Cancel Generation"}):a.jsxs("button",{onClick:o.handleGenerate,disabled:!o.aiPrompt.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:o.aiPrompt.trim()?"#a855f7":"var(--surface-3)",color:o.aiPrompt.trim()?"#fff":"var(--text-tertiary)",cursor:o.aiPrompt.trim()?"pointer":"not-allowed",border:"none"},children:[a.jsx(Po,{size:14}),"Generate"]}),a.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"}),!o.generating&&a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",a.jsx("button",{onClick:()=>o.setMode("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!o.layoutLoading&&o.layout&&o.mode==="manual"&&a.jsxs("div",{className:"space-y-4 animate-fade-in",children:[a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),o.creatableLayouts.length>1&&a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),a.jsx("div",{className:"flex gap-2",children:o.creatableLayouts.map(u=>a.jsx("button",{onClick:()=>{o.setSelectedLayout(u.layout),o.setPlugin(u.existingPlugins[0]||""),o.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:o.selectedLayout===u.layout?"var(--accent)":"var(--surface-3)",color:o.selectedLayout===u.layout?"#fff":"var(--text-secondary)",border:`1px solid ${o.selectedLayout===u.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:u.label},u.layout))})]}),o.selectedLayout!==3&&a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),a.jsxs("select",{value:o.plugin,onChange:u=>{o.setPlugin(u.target.value),o.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa,children:[o.availablePlugins.map(u=>a.jsx("option",{value:u,children:u},u)),a.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),o.plugin==="__new__"&&a.jsx("input",{type:"text",value:o.newPlugin,onChange:u=>o.setNewPlugin(rc(u.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:aa})]}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:o.pathPreview})]}),o.showPluginRecommendation&&o.pluginLayoutInfo&&o.selectedLayout===3&&a.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex items-center justify-between gap-3",style:{background:"rgba(59,130,246,0.08)",color:"var(--text-secondary)",border:"1px solid rgba(59,130,246,0.2)"},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsxs("span",{children:["Plugins detected (",a.jsx("strong",{children:o.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsx("button",{onClick:o.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),a.jsx("button",{onClick:()=>o.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",a.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),a.jsx("input",{type:"text",value:o.name,onChange:u=>o.setName(rc(u.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa})]}),a.jsxs("div",{className:"mb-3",children:[a.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",a.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),a.jsx("textarea",{value:o.description,onChange:u=>o.setDescription(u.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...aa,minHeight:"72px"}})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),a.jsxs("select",{value:o.model,onChange:u=>o.setModel(u.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa,children:[a.jsx("option",{value:"",children:"Any"}),a.jsx("option",{value:"opus",children:"Opus"}),a.jsx("option",{value:"sonnet",children:"Sonnet"}),a.jsx("option",{value:"haiku",children:"Haiku"})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),a.jsx("input",{type:"text",value:o.allowedTools,onChange:u=>o.setAllowedTools(u.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:aa})]})]})]}),a.jsxs("div",{className:"glass-card p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),a.jsxs("div",{children:[a.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),a.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),a.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(u=>a.jsxs("button",{onClick:()=>o.setBodyViewMode(u),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:o.bodyViewMode===u?"var(--surface-4)":"transparent",color:o.bodyViewMode===u?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:o.bodyViewMode===u?600:400,border:"none",cursor:"pointer"},children:[u==="write"?a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"16 18 22 12 16 6"}),a.jsx("polyline",{points:"8 6 2 12 8 18"})]}):a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),a.jsx("span",{children:u==="write"?"Write":"Preview"})]},u))})]}),o.bodyViewMode==="write"?a.jsx("textarea",{value:o.body,onChange:u=>o.setBody(u.target.value),placeholder:`# /my-skill
|
|
71
|
+
|
|
72
|
+
You are an expert at...
|
|
73
|
+
`,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...aa,minHeight:"150px"}}):o.body.trim()?a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:Nr(o.body)}}):a.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"150px",maxHeight:"400px",overflowY:"auto"},children:a.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),a.jsx(by,{skillName:o.name||"{skill}",hasEvals:!1,isDraft:o.draftSaved}),o.error&&a.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(248,113,113,0.2)"},children:o.error}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:o.handleCreate,disabled:o.creating||!o.name||!o.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:o.creating||!o.name||!o.description?"var(--surface-3)":"var(--accent)",color:o.creating||!o.name||!o.description?"var(--text-tertiary)":"#fff",cursor:o.creating||!o.name||!o.description?"not-allowed":"pointer",border:"none"},children:o.creating?"Creating...":"Create Skill"}),a.jsx("button",{onClick:c,className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)",background:"none",border:"none",cursor:"pointer"},children:"Cancel"})]})]})]})}function Sy(){return a.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),a.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),a.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function ec({variant:r,message:c,onRetry:o}){const{setMode:u,setSearch:x}=na(),[v,p]=h.useState(!1);return r==="no-selection"?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[a.jsx("div",{className:"mb-5",children:v?a.jsx(Sy,{}):a.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>p(!0),style:{objectFit:"contain"}})}),a.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),a.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):r==="no-skills"?a.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"})})}),a.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),a.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",a.jsx("code",{className:"px-1.5 py-0.5 rounded text-[11px]",style:{background:"var(--surface-2)"},children:"--root"})," directory, or create your first skill"]}),a.jsxs("button",{onClick:()=>u("create"),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:"var(--accent)",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:b=>{b.currentTarget.style.opacity="0.9"},onMouseLeave:b=>{b.currentTarget.style.opacity="1"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):r==="error"?a.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:a.jsxs("div",{className:"px-5 py-4 rounded-lg text-center max-w-sm",style:{background:"var(--red-muted)",border:"1px solid rgba(248,113,113,0.2)"},children:[a.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:c||"Failed to load skill data"}),o&&a.jsx("button",{onClick:o,className:"px-4 py-2 rounded-lg text-[12px] font-medium",style:{background:"var(--surface-3)",color:"var(--text-primary)",border:"none",cursor:"pointer"},children:"Retry"})]})}):a.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[a.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),a.jsx("button",{onClick:()=>x(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function Lx(){const{state:r,setMobileView:c}=na();return r.isMobile?a.jsxs("button",{onClick:()=>c("list"),className:"flex items-center gap-1.5 px-3 py-2 text-[12px] font-medium",style:{background:"var(--surface-1)",color:"var(--text-secondary)",border:"none",borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",width:"100%"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function Ny(){const{state:r,selectSkill:c,setMode:o,refreshSkills:u}=na();if(r.mode==="create")return a.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[a.jsx(Lx,{}),a.jsx(jy,{onCreated:(b,g)=>{o("browse"),u(),c({plugin:b,skill:g,origin:"source"})},onCancel:()=>o("browse")})]});if(!r.selectedSkill)return r.skillsError?a.jsx(ec,{variant:"error",message:r.skillsError,onRetry:u}):!r.skillsLoading&&r.skills.length===0?a.jsx(ec,{variant:"no-skills"}):a.jsx(ec,{variant:"no-selection"});const{plugin:x,skill:v,origin:p}=r.selectedSkill;return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx(Lx,{}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Qh,{plugin:x,skill:v,origin:p,children:a.jsx(my,{})},`${x}/${v}`)})]})}function Ey(){return a.jsx(Ch,{children:a.jsx(Eh,{children:a.jsx(wh,{left:a.jsx(Oh,{}),right:a.jsx(Ny,{})})})})}bh.createRoot(document.getElementById("root")).render(a.jsx(h.StrictMode,{children:a.jsx(Ey,{})}));
|