vskill 0.4.11 → 0.4.12
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var nx;function rh(){if(nx)return as;nx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(d,m,h){var p=null;if(h!==void 0&&(p=""+h),m.key!==void 0&&(p=""+m.key),"key"in m){h={};for(var
|
|
9
|
+
*/var nx;function rh(){if(nx)return as;nx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(d,m,h){var p=null;if(h!==void 0&&(p=""+h),m.key!==void 0&&(p=""+m.key),"key"in m){h={};for(var b in m)b!=="key"&&(h[b]=m[b])}else h=m;return m=h.ref,{$$typeof:i,type:d,key:p,ref:m!==void 0?m:null,props:h}}return as.Fragment=c,as.jsx=u,as.jsxs=u,as}var sx;function ih(){return sx||(sx=1,Bc.exports=rh()),Bc.exports}var n=ih(),Uc={exports:{}},de={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var rx;function ch(){if(rx)return de;rx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),p=Symbol.for("react.context"),
|
|
17
|
+
*/var rx;function ch(){if(rx)return de;rx=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=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"),E=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),T=Symbol.iterator;function z(S){return S===null||typeof S!="object"?null:(S=T&&S[T]||S["@@iterator"],typeof S=="function"?S:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,V={};function K(S,D,Z){this.props=S,this.context=D,this.refs=V,this.updater=Z||B}K.prototype.isReactComponent={},K.prototype.setState=function(S,D){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,D,"setState")},K.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function P(){}P.prototype=K.prototype;function se(S,D,Z){this.props=S,this.context=D,this.refs=V,this.updater=Z||B}var Y=se.prototype=new P;Y.constructor=se,q(Y,K.prototype),Y.isPureReactComponent=!0;var F=Array.isArray;function le(){}var W={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function he(S,D,Z){var R=Z.ref;return{$$typeof:i,type:S,key:D,ref:R!==void 0?R:null,props:Z}}function re(S,D){return he(S.type,D,S.props)}function ge(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function ve(S){var D={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Z){return D[Z]})}var X=/\/+/g;function ue(S,D){return typeof S=="object"&&S!==null&&S.key!=null?ve(""+S.key):D.toString(36)}function Ee(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(le,le):(S.status="pending",S.then(function(D){S.status==="pending"&&(S.status="fulfilled",S.value=D)},function(D){S.status==="pending"&&(S.status="rejected",S.reason=D)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function N(S,D,Z,R,G){var Q=typeof S;(Q==="undefined"||Q==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(Q){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case i:case c:ee=!0;break;case E:return ee=S._init,N(ee(S._payload),D,Z,R,G)}}if(ee)return G=G(S),ee=R===""?"."+ue(S,0):R,F(G)?(Z="",ee!=null&&(Z=ee.replace(X,"$&/")+"/"),N(G,D,Z,"",function(Ze){return Ze})):G!=null&&(ge(G)&&(G=re(G,Z+(G.key==null||S&&S.key===G.key?"":(""+G.key).replace(X,"$&/")+"/")+ee)),D.push(G)),1;ee=0;var fe=R===""?".":R+":";if(F(S))for(var ye=0;ye<S.length;ye++)R=S[ye],Q=fe+ue(R,ye),ee+=N(R,D,Z,Q,G);else if(ye=z(S),typeof ye=="function")for(S=ye.call(S),ye=0;!(R=S.next()).done;)R=R.value,Q=fe+ue(R,ye++),ee+=N(R,D,Z,Q,G);else if(Q==="object"){if(typeof S.then=="function")return N(Ee(S),D,Z,R,G);throw D=String(S),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return ee}function A(S,D,Z){if(S==null)return S;var R=[],G=0;return N(S,R,"","",function(Q){return D.call(Z,Q,G++)}),R}function J(S){if(S._status===-1){var D=S._result;D=D(),D.then(function(Z){(S._status===0||S._status===-1)&&(S._status=1,S._result=Z)},function(Z){(S._status===0||S._status===-1)&&(S._status=2,S._result=Z)}),S._status===-1&&(S._status=0,S._result=D)}if(S._status===1)return S._result.default;throw S._result}var ce=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},pe={map:A,forEach:function(S,D,Z){A(S,function(){D.apply(this,arguments)},Z)},count:function(S){var D=0;return A(S,function(){D++}),D},toArray:function(S){return A(S,function(D){return D})||[]},only:function(S){if(!ge(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return de.Activity=y,de.Children=pe,de.Component=K,de.Fragment=u,de.Profiler=m,de.PureComponent=se,de.StrictMode=d,de.Suspense=g,de.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,de.__COMPILER_RUNTIME={__proto__:null,c:function(S){return W.H.useMemoCache(S)}},de.cache=function(S){return function(){return S.apply(null,arguments)}},de.cacheSignal=function(){return null},de.cloneElement=function(S,D,Z){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var R=q({},S.props),G=S.key;if(D!=null)for(Q in D.key!==void 0&&(G=""+D.key),D)!ae.call(D,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&D.ref===void 0||(R[Q]=D[Q]);var Q=arguments.length-2;if(Q===1)R.children=Z;else if(1<Q){for(var ee=Array(Q),fe=0;fe<Q;fe++)ee[fe]=arguments[fe+2];R.children=ee}return he(S.type,G,R)},de.createContext=function(S){return S={$$typeof:p,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:h,_context:S},S},de.createElement=function(S,D,Z){var R,G={},Q=null;if(D!=null)for(R in D.key!==void 0&&(Q=""+D.key),D)ae.call(D,R)&&R!=="key"&&R!=="__self"&&R!=="__source"&&(G[R]=D[R]);var ee=arguments.length-2;if(ee===1)G.children=Z;else if(1<ee){for(var fe=Array(ee),ye=0;ye<ee;ye++)fe[ye]=arguments[ye+2];G.children=fe}if(S&&S.defaultProps)for(R in ee=S.defaultProps,ee)G[R]===void 0&&(G[R]=ee[R]);return he(S,Q,G)},de.createRef=function(){return{current:null}},de.forwardRef=function(S){return{$$typeof:b,render:S}},de.isValidElement=ge,de.lazy=function(S){return{$$typeof:E,_payload:{_status:-1,_result:S},_init:J}},de.memo=function(S,D){return{$$typeof:f,type:S,compare:D===void 0?null:D}},de.startTransition=function(S){var D=W.T,Z={};W.T=Z;try{var R=S(),G=W.S;G!==null&&G(Z,R),typeof R=="object"&&R!==null&&typeof R.then=="function"&&R.then(le,ce)}catch(Q){ce(Q)}finally{D!==null&&Z.types!==null&&(D.types=Z.types),W.T=D}},de.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},de.use=function(S){return W.H.use(S)},de.useActionState=function(S,D,Z){return W.H.useActionState(S,D,Z)},de.useCallback=function(S,D){return W.H.useCallback(S,D)},de.useContext=function(S){return W.H.useContext(S)},de.useDebugValue=function(){},de.useDeferredValue=function(S,D){return W.H.useDeferredValue(S,D)},de.useEffect=function(S,D){return W.H.useEffect(S,D)},de.useEffectEvent=function(S){return W.H.useEffectEvent(S)},de.useId=function(){return W.H.useId()},de.useImperativeHandle=function(S,D,Z){return W.H.useImperativeHandle(S,D,Z)},de.useInsertionEffect=function(S,D){return W.H.useInsertionEffect(S,D)},de.useLayoutEffect=function(S,D){return W.H.useLayoutEffect(S,D)},de.useMemo=function(S,D){return W.H.useMemo(S,D)},de.useOptimistic=function(S,D){return W.H.useOptimistic(S,D)},de.useReducer=function(S,D,Z){return W.H.useReducer(S,D,Z)},de.useRef=function(S){return W.H.useRef(S)},de.useState=function(S){return W.H.useState(S)},de.useSyncExternalStore=function(S,D,Z){return W.H.useSyncExternalStore(S,D,Z)},de.useTransition=function(){return W.H.useTransition()},de.version="19.2.4",de}var ix;function ro(){return ix||(ix=1,Uc.exports=ch()),Uc.exports}var v=ro(),Hc={exports:{}},ns={},qc={exports:{}},Yc={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var cx;function oh(){return cx||(cx=1,(function(i){function c(
|
|
25
|
+
*/var cx;function oh(){return cx||(cx=1,(function(i){function c(N,A){var J=N.length;N.push(A);e:for(;0<J;){var ce=J-1>>>1,pe=N[ce];if(0<m(pe,A))N[ce]=A,N[J]=pe,J=ce;else break e}}function u(N){return N.length===0?null:N[0]}function d(N){if(N.length===0)return null;var A=N[0],J=N.pop();if(J!==A){N[0]=J;e:for(var ce=0,pe=N.length,S=pe>>>1;ce<S;){var D=2*(ce+1)-1,Z=N[D],R=D+1,G=N[R];if(0>m(Z,J))R<pe&&0>m(G,Z)?(N[ce]=G,N[R]=J,ce=R):(N[ce]=Z,N[D]=J,ce=D);else if(R<pe&&0>m(G,J))N[ce]=G,N[R]=J,ce=R;else break e}}return A}function m(N,A){var J=N.sortIndex-A.sortIndex;return J!==0?J:N.id-A.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var p=Date,b=p.now();i.unstable_now=function(){return p.now()-b}}var g=[],f=[],E=1,y=null,T=3,z=!1,B=!1,q=!1,V=!1,K=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,se=typeof setImmediate<"u"?setImmediate:null;function Y(N){for(var A=u(f);A!==null;){if(A.callback===null)d(f);else if(A.startTime<=N)d(f),A.sortIndex=A.expirationTime,c(g,A);else break;A=u(f)}}function F(N){if(q=!1,Y(N),!B)if(u(g)!==null)B=!0,le||(le=!0,ve());else{var A=u(f);A!==null&&Ee(F,A.startTime-N)}}var le=!1,W=-1,ae=5,he=-1;function re(){return V?!0:!(i.unstable_now()-he<ae)}function ge(){if(V=!1,le){var N=i.unstable_now();he=N;var A=!0;try{e:{B=!1,q&&(q=!1,P(W),W=-1),z=!0;var J=T;try{t:{for(Y(N),y=u(g);y!==null&&!(y.expirationTime>N&&re());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,T=y.priorityLevel;var pe=ce(y.expirationTime<=N);if(N=i.unstable_now(),typeof pe=="function"){y.callback=pe,Y(N),A=!0;break t}y===u(g)&&d(g),Y(N)}else d(g);y=u(g)}if(y!==null)A=!0;else{var S=u(f);S!==null&&Ee(F,S.startTime-N),A=!1}}break e}finally{y=null,T=J,z=!1}A=void 0}}finally{A?ve():le=!1}}}var ve;if(typeof se=="function")ve=function(){se(ge)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,ue=X.port2;X.port1.onmessage=ge,ve=function(){ue.postMessage(null)}}else ve=function(){K(ge,0)};function Ee(N,A){W=K(function(){N(i.unstable_now())},A)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(N){N.callback=null},i.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<N?Math.floor(1e3/N):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_next=function(N){switch(T){case 1:case 2:case 3:var A=3;break;default:A=T}var J=T;T=A;try{return N()}finally{T=J}},i.unstable_requestPaint=function(){V=!0},i.unstable_runWithPriority=function(N,A){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var J=T;T=N;try{return A()}finally{T=J}},i.unstable_scheduleCallback=function(N,A,J){var ce=i.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ce+J:ce):J=ce,N){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=J+pe,N={id:E++,callback:A,priorityLevel:N,startTime:J,expirationTime:pe,sortIndex:-1},J>ce?(N.sortIndex=J,c(f,N),u(g)===null&&N===u(f)&&(q?(P(W),W=-1):q=!0,Ee(F,J-ce))):(N.sortIndex=pe,c(g,N),B||z||(B=!0,le||(le=!0,ve()))),N},i.unstable_shouldYield=re,i.unstable_wrapCallback=function(N){var A=T;return function(){var J=T;T=A;try{return N.apply(this,arguments)}finally{T=J}}}})(Yc)),Yc}var ox;function uh(){return ox||(ox=1,qc.exports=oh()),qc.exports}var Gc={exports:{}},dt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var ux;function dh(){if(ux)return dt;ux=1;var i=ro();function c(g){var f="https://react.dev/errors/"+g;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var
|
|
33
|
+
*/var ux;function dh(){if(ux)return dt;ux=1;var i=ro();function c(g){var f="https://react.dev/errors/"+g;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var E=2;E<arguments.length;E++)f+="&args[]="+encodeURIComponent(arguments[E])}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 u(){}var d={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},m=Symbol.for("react.portal");function h(g,f,E){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:m,key:y==null?null:""+y,children:g,containerInfo:f,implementation:E}}var p=i.__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 dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=d,dt.createPortal=function(g,f){var E=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 h(g,f,null,E)},dt.flushSync=function(g){var f=p.T,E=d.p;try{if(p.T=null,d.p=2,g)return g()}finally{p.T=f,d.p=E,d.d.f()}},dt.preconnect=function(g,f){typeof g=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,d.d.C(g,f))},dt.prefetchDNS=function(g){typeof g=="string"&&d.d.D(g)},dt.preinit=function(g,f){if(typeof g=="string"&&f&&typeof f.as=="string"){var E=f.as,y=b(E,f.crossOrigin),T=typeof f.integrity=="string"?f.integrity:void 0,z=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;E==="style"?d.d.S(g,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:y,integrity:T,fetchPriority:z}):E==="script"&&d.d.X(g,{crossOrigin:y,integrity:T,fetchPriority:z,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},dt.preinitModule=function(g,f){if(typeof g=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var E=b(f.as,f.crossOrigin);d.d.M(g,{crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&d.d.M(g)},dt.preload=function(g,f){if(typeof g=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var E=f.as,y=b(E,f.crossOrigin);d.d.L(g,E,{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})}},dt.preloadModule=function(g,f){if(typeof g=="string")if(f){var E=b(f.as,f.crossOrigin);d.d.m(g,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:E,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else d.d.m(g)},dt.requestFormReset=function(g){d.d.r(g)},dt.unstable_batchedUpdates=function(g,f){return g(f)},dt.useFormState=function(g,f,E){return p.H.useFormState(g,f,E)},dt.useFormStatus=function(){return p.H.useHostTransitionStatus()},dt.version="19.2.4",dt}var dx;function fh(){if(dx)return Gc.exports;dx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Gc.exports=dh(),Gc.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,37 +38,37 @@
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var fx;function xh(){if(fx)return ns;fx=1;var i=uh(),c=ro(),u=fh();function d(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 m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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
|
|
41
|
+
*/var fx;function xh(){if(fx)return ns;fx=1;var i=uh(),c=ro(),u=fh();function d(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 m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(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(h(e)!==e)throw Error(d(188))}function f(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(d(188));return t!==e?null:e}for(var l=e,a=t;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(a=s.return,a!==null){l=a;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return g(s),e;if(r===a)return g(s),t;r=r.sibling}throw Error(d(188))}if(l.return!==a.return)l=s,a=r;else{for(var o=!1,x=s.child;x;){if(x===l){o=!0,l=s,a=r;break}if(x===a){o=!0,a=s,l=r;break}x=x.sibling}if(!o){for(x=r.child;x;){if(x===l){o=!0,l=r,a=s;break}if(x===a){o=!0,a=r,l=s;break}x=x.sibling}if(!o)throw Error(d(189))}}if(l.alternate!==a)throw Error(d(190))}if(l.tag!==3)throw Error(d(188));return l.stateNode.current===l?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,T=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),se=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),ge=Symbol.iterator;function ve(e){return e===null||typeof e!="object"?null:(e=ge&&e[ge]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case K:return"Profiler";case V:return"StrictMode";case F:return"Suspense";case le:return"SuspenseList";case he:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case se:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case Y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var Ee=Array.isArray,N=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ce=[],pe=-1;function S(e){return{current:e}}function D(e){0>pe||(e.current=ce[pe],ce[pe]=null,pe--)}function Z(e,t){pe++,ce[pe]=e.current,e.current=t}var R=S(null),G=S(null),Q=S(null),ee=S(null);function fe(e,t){switch(Z(Q,t),Z(G,e),Z(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cf(t),e=Af(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}D(R),Z(R,e)}function ye(){D(R),D(G),D(Q)}function Ze(e){e.memoizedState!==null&&Z(ee,e);var t=R.current,l=Af(t,e.type);t!==l&&(Z(G,e),Z(R,l))}function et(e){G.current===e&&(D(R),D(G)),ee.current===e&&(D(ee),Pn._currentValue=J)}var $t,Al;function Wt(e){if($t===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);$t=t&&t[1]||"",Al=-1<l.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+$t+e+Al}var sl=!1;function rl(e,t){if(!e||sl)return"";sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(
|
|
43
|
+
`+$t+e+Al}var sl=!1;function rl(e,t){if(!e||sl)return"";sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(O){var M=O}Reflect.construct(e,[],H)}else{try{H.call()}catch(O){M=O}e.call(H.prototype)}}else{try{throw Error()}catch(O){M=O}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(O){if(O&&M&&typeof O.stack=="string")return[O.stack,M.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),o=r[0],x=r[1];if(o&&x){var j=o.split(`
|
|
44
44
|
`),_=x.split(`
|
|
45
45
|
`);for(s=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;s<_.length&&!_[s].includes("DetermineComponentFrameRoot");)s++;if(a===j.length||s===_.length)for(a=j.length-1,s=_.length-1;1<=a&&0<=s&&j[a]!==_[s];)s--;for(;1<=a&&0<=s;a--,s--)if(j[a]!==_[s]){if(a!==1||s!==1)do if(a--,s--,0>s||j[a]!==_[s]){var L=`
|
|
46
46
|
`+j[a].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=a&&0<=s);break}}}finally{sl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Wt(l):""}function wl(e,t){switch(e.tag){case 26:case 27:case 5:return Wt(e.type);case 16:return Wt("Lazy");case 13:return e.child!==t&&t!==null?Wt("Suspense Fallback"):Wt("Suspense");case 19:return Wt("SuspenseList");case 0:case 15:return rl(e.type,!1);case 11:return rl(e.type.render,!1);case 1:return rl(e.type,!0);case 31:return Wt("Activity");default:return""}}function _l(e){try{var t="",l=null;do t+=wl(e,l),l=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
47
|
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var Ft=Object.prototype.hasOwnProperty,Vt=i.unstable_scheduleCallback,Rl=i.unstable_cancelCallback,il=i.unstable_shouldYield,I=i.unstable_requestPaint,ze=i.unstable_now,mt=i.unstable_getCurrentPriorityLevel,Qt=i.unstable_ImmediatePriority,$=i.unstable_UserBlockingPriority,_e=i.unstable_NormalPriority,Xt=i.unstable_LowPriority,Nt=i.unstable_IdlePriority,pt=i.log,It=i.unstable_setDisableYieldValue,Mt=null,Ve=null;function at(e){if(typeof pt=="function"&&It(e),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(Mt,e)}catch{}}var Ge=Math.clz32?Math.clz32:cl,$e=Math.log,Et=Math.LN2;function cl(e){return e>>>=0,e===0?32:31-($e(e)/Et|0)|0}var tt=256,ol=262144,ra=4194304;function Pt(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 ia(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?s=Pt(a):(o&=x,o!==0?s=Pt(o):l||(l=x&~e,l!==0&&(s=Pt(l))))):(x=a&~r,x!==0?s=Pt(x):o!==0?s=Pt(o):l||(l=a&~e,l!==0&&(s=Pt(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function Ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rs(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 fn(){var e=ra;return ra<<=1,(ra&62914560)===0&&(ra=4194304),e}function xn(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Jx(e,t,l,a,s,r){var o=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 x=e.entanglements,j=e.expirationTimes,_=e.hiddenUpdates;for(l=o&~l;0<l;){var L=31-Ge(l),H=1<<L;x[L]=0,j[L]=-1;var M=_[L];if(M!==null)for(_[L]=null,L=0;L<M.length;L++){var z=M[L];z!==null&&(z.lane&=-536870913)}l&=~H}a!==0&&io(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(o&~t))}function io(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ge(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function co(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Ge(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function oo(e,t){var l=t&-t;return l=(l&42)!==0?1:Tr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Tr(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 Cr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function uo(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:Ff(e.type))}function fo(e,t){var l=A.p;try{return A.p=e,t()}finally{A.p=l}}var zl=Math.random().toString(36).slice(2),rt="__reactFiber$"+zl,ht="__reactProps$"+zl,Ta="__reactContainer$"+zl,Ar="__reactEvents$"+zl,$x="__reactListeners$"+zl,Wx="__reactHandles$"+zl,xo="__reactResources$"+zl,mn="__reactMarker$"+zl;function wr(e){delete e[rt],delete e[ht],delete e[Ar],delete e[$x],delete e[Wx]}function Ca(e){var t=e[rt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ta]||l[rt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Df(e);e!==null;){if(l=e[rt])return l;e=Df(e)}return t}e=l,l=e.parentNode}return null}function Aa(e){if(e=e[rt]||e[Ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function wa(e){var t=e[xo];return t||(t=e[xo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[mn]=!0}var mo=new Set,po={};function oa(e,t){_a(e,t),_a(e+"Capture",t)}function _a(e,t){for(po[e]=t,e=0;e<t.length;e++)mo.add(t[e])}var Fx=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]*$"),ho={},vo={};function Ix(e){return Ft.call(vo,e)?!0:Ft.call(ho,e)?!1:Fx.test(e)?vo[e]=!0:(ho[e]=!0,!1)}function is(e,t,l){if(Ix(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function cs(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 ul(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Px(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){l=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(o){l=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=yo(e)?"checked":"value";e._valueTracker=Px(e,t,""+e[t])}}function go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=yo(e)?e.checked?"true":"false":e.value),e=a,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 em=/[\n"\\]/g;function Ot(e){return e.replace(em,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rr(e,t,l,a,s,r,o,x){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Mr(e,o,zt(t)):l!=null?Mr(e,o,zt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+zt(x):e.removeAttribute("name")}function bo(e,t,l,a,s,r,o,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){_r(e);return}l=l!=null?""+zt(l):"",t=t!=null?""+zt(t):l,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),_r(e)}function Mr(e,t,l){t==="number"&&os(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ra(e,t,l,a){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&&a&&(e[l].defaultSelected=!0)}else{for(l=""+zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function jo(e,t,l){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+zt(l):""}function So(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(d(92));if(Ee(a)){if(1<a.length)throw Error(d(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),_r(e)}function Ma(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var tm=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 No(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||tm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Eo(e,t,l){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&No(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&No(e,r,t[r])}function zr(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 lm=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"]]),am=/^[\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 us(e){return am.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function dl(){}var Or=null;function Dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,Oa=null;function ko(e){var t=Aa(e);if(t&&(e=t.stateNode)){var l=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rr(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[ht]||null;if(!s)throw Error(d(90));Rr(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&go(a)}break e;case"textarea":jo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ra(e,!!l.multiple,t,!1)}}}var Lr=!1;function To(e,t,l){if(Lr)return e(t,l);Lr=!0;try{var a=e(t);return a}finally{if(Lr=!1,(za!==null||Oa!==null)&&(Fs(),za&&(t=za,e=Oa,Oa=za=null,ko(t),e)))for(t=0;t<e.length;t++)ko(e[t])}}function hn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[ht]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(d(231,t,typeof l));return l}var fl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Br=!1;if(fl)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Br=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Br=!1}var Ol=null,Ur=null,ds=null;function Co(){if(ds)return ds;var e,t=Ur,l=t.length,a,s="value"in Ol?Ol.value:Ol.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var o=l-e;for(a=1;a<=o&&t[l-a]===s[r-a];a++);return ds=s.slice(e,1<a?1-a:void 0)}function fs(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 xs(){return!0}function Ao(){return!1}function vt(e){function t(l,a,s,r,o){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=o,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(l=e[x],this[x]=l?l(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?xs:Ao,this.isPropagationStopped=Ao,this}return b(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=xs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=xs)},persist:function(){},isPersistent:xs}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=vt(ua),yn=b({},ua,{view:0,detail:0}),nm=vt(yn),Hr,qr,gn,ps=b({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gr,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"?(Hr=e.screenX-gn.screenX,qr=e.screenY-gn.screenY):qr=Hr=0,gn=e),Hr)},movementY:function(e){return"movementY"in e?e.movementY:qr}}),wo=vt(ps),sm=b({},ps,{dataTransfer:0}),rm=vt(sm),im=b({},yn,{relatedTarget:0}),Yr=vt(im),cm=b({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),om=vt(cm),um=b({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dm=vt(um),fm=b({},ua,{data:0}),_o=vt(fm),xm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mm={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"},pm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pm[e])?!!t[e]:!1}function Gr(){return hm}var vm=b({},yn,{key:function(e){if(e.key){var t=xm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gr,charCode:function(e){return e.type==="keypress"?fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ym=vt(vm),gm=b({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ro=vt(gm),bm=b({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gr}),jm=vt(bm),Sm=b({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nm=vt(Sm),Em=b({},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}),km=vt(Em),Tm=b({},ua,{newState:0,oldState:0}),Cm=vt(Tm),Am=[9,13,27,32],Vr=fl&&"CompositionEvent"in window,bn=null;fl&&"documentMode"in document&&(bn=document.documentMode);var wm=fl&&"TextEvent"in window&&!bn,Mo=fl&&(!Vr||bn&&8<bn&&11>=bn),zo=" ",Oo=!1;function Do(e,t){switch(e){case"keyup":return Am.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Da=!1;function _m(e,t){switch(e){case"compositionend":return Lo(t);case"keypress":return t.which!==32?null:(Oo=!0,zo);case"textInput":return e=t.data,e===zo&&Oo?null:e;default:return null}}function Rm(e,t){if(Da)return e==="compositionend"||!Vr&&Do(e,t)?(e=Co(),ds=Ur=Ol=null,Da=!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 Mo&&t.locale!=="ko"?null:t.data;default:return null}}var Mm={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 Bo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mm[e.type]:t==="textarea"}function Uo(e,t,l,a){za?Oa?Oa.push(a):Oa=[a]:za=a,t=nr(t,"onChange"),0<t.length&&(l=new ms("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var jn=null,Sn=null;function zm(e){jf(e,0)}function hs(e){var t=pn(e);if(go(t))return e}function Ho(e,t){if(e==="change")return t}var qo=!1;if(fl){var Qr;if(fl){var Xr="oninput"in document;if(!Xr){var Yo=document.createElement("div");Yo.setAttribute("oninput","return;"),Xr=typeof Yo.oninput=="function"}Qr=Xr}else Qr=!1;qo=Qr&&(!document.documentMode||9<document.documentMode)}function Go(){jn&&(jn.detachEvent("onpropertychange",Vo),Sn=jn=null)}function Vo(e){if(e.propertyName==="value"&&hs(Sn)){var t=[];Uo(t,Sn,e,Dr(e)),To(zm,t)}}function Om(e,t,l){e==="focusin"?(Go(),jn=t,Sn=l,jn.attachEvent("onpropertychange",Vo)):e==="focusout"&&Go()}function Dm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hs(Sn)}function Lm(e,t){if(e==="click")return hs(t)}function Bm(e,t){if(e==="input"||e==="change")return hs(t)}function Um(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Um;function Nn(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!Ft.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function Qo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xo(e,t){var l=Qo(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Qo(l)}}function Zo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ko(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 Zr(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 Hm=fl&&"documentMode"in document&&11>=document.documentMode,La=null,Kr=null,En=null,Jr=!1;function Jo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||La==null||La!==os(a)||(a=La,"selectionStart"in a&&Zr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),En&&Nn(En,a)||(En=a,a=nr(Kr,"onSelect"),0<a.length&&(t=new ms("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=La)))}function da(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ba={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionrun:da("Transition","TransitionRun"),transitionstart:da("Transition","TransitionStart"),transitioncancel:da("Transition","TransitionCancel"),transitionend:da("Transition","TransitionEnd")},$r={},$o={};fl&&($o=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function fa(e){if($r[e])return $r[e];if(!Ba[e])return e;var t=Ba[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in $o)return $r[e]=t[l];return e}var Wo=fa("animationend"),Fo=fa("animationiteration"),Io=fa("animationstart"),qm=fa("transitionrun"),Ym=fa("transitionstart"),Gm=fa("transitioncancel"),Po=fa("transitionend"),eu=new Map,Wr="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(" ");Wr.push("scrollEnd");function Zt(e,t){eu.set(e,t),oa(t,[e])}var vs=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)},Dt=[],Ua=0,Fr=0;function ys(){for(var e=Ua,t=Fr=Ua=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var o=a.pending;o===null?s.next=s:(s.next=o.next,o.next=s),a.pending=s}r!==0&&tu(l,s,r)}}function gs(e,t,l,a){Dt[Ua++]=e,Dt[Ua++]=t,Dt[Ua++]=l,Dt[Ua++]=a,Fr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ir(e,t,l,a){return gs(e,t,l,a),bs(e)}function xa(e,t){return gs(e,null,null,t),bs(e)}function tu(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,r=e.return;r!==null;)r.childLanes|=l,a=r.alternate,a!==null&&(a.childLanes|=l),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Ge(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function bs(e){if(50<Zn)throw Zn=0,ic=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ha={};function Vm(e,t,l,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,l,a){return new Vm(e,t,l,a)}function Pr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xl(e,t){var l=e.alternate;return l===null?(l=Tt(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 lu(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 js(e,t,l,a,s,r){var o=0;if(a=e,typeof e=="function")Pr(e)&&(o=1);else if(typeof e=="string")o=Jp(e,l,R.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case he:return e=Tt(31,l,t,s),e.elementType=he,e.lanes=r,e;case q:return ma(l.children,s,r,t);case Q:o=8,s|=24;break;case K:return e=Tt(12,l,t,s|2),e.elementType=K,e.lanes=r,e;case F:return e=Tt(13,l,t,s),e.elementType=F,e.lanes=r,e;case le:return e=Tt(19,l,t,s),e.elementType=le,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case se:o=10;break e;case P:o=9;break e;case Y:o=11;break e;case W:o=14;break e;case ae:o=16,a=null;break e}o=29,l=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=Tt(o,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function ma(e,t,l,a){return e=Tt(7,e,a,t),e.lanes=l,e}function ei(e,t,l){return e=Tt(6,e,null,t),e.lanes=l,e}function au(e){var t=Tt(18,null,null,0);return t.stateNode=e,t}function ti(e,t,l){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nu=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var l=nu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:_l(t)},nu.set(e,t),t)}return{value:e,source:t,stack:_l(t)}}var qa=[],Ya=0,Ss=null,kn=0,Bt=[],Ut=0,Dl=null,el=1,tl="";function ml(e,t){qa[Ya++]=kn,qa[Ya++]=Ss,Ss=e,kn=t}function su(e,t,l){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,Dl=e;var a=el;e=tl;var s=32-Ge(a)-1;a&=~(1<<s),l+=1;var r=32-Ge(t)+s;if(30<r){var o=s-s%5;r=(a&(1<<o)-1).toString(32),a>>=o,s-=o,el=1<<32-Ge(t)+s|l<<s|a,tl=r+e}else el=1<<r|l<<s|a,tl=e}function li(e){e.return!==null&&(ml(e,1),su(e,1,0))}function ai(e){for(;e===Ss;)Ss=qa[--Ya],qa[Ya]=null,kn=qa[--Ya],qa[Ya]=null;for(;e===Dl;)Dl=Bt[--Ut],Bt[Ut]=null,tl=Bt[--Ut],Bt[Ut]=null,el=Bt[--Ut],Bt[Ut]=null}function ru(e,t){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,el=t.id,tl=t.overflow,Dl=e}var it=null,Ue=null,ke=!1,Ll=null,Ht=!1,ni=Error(d(519));function Bl(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tn(Lt(t,e)),ni}function iu(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[rt]=e,t[ht]=a,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<Jn.length;l++)je(Jn[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),bo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),So(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||kf(t.textContent,l)?(a.popover!=null&&(je("beforetoggle",t),je("toggle",t)),a.onScroll!=null&&je("scroll",t),a.onScrollEnd!=null&&je("scrollend",t),a.onClick!=null&&(t.onclick=dl),t=!0):t=!1,t||Bl(e,!0)}function cu(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:it=it.return}}function Ga(e){if(e!==it)return!1;if(!ke)return cu(e),ke=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Sc(e.type,e.memoizedProps)),l=!l),l&&Ue&&Bl(e),cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Ue=Of(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Ue=Of(e)}else t===27?(t=Ue,Fl(e.type)?(e=Cc,Cc=null,Ue=e):Ue=t):Ue=it?Yt(e.stateNode.nextSibling):null;return!0}function pa(){Ue=it=null,ke=!1}function si(){var e=Ll;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),Ll=null),e}function Tn(e){Ll===null?Ll=[e]:Ll.push(e)}var ri=N(null),ha=null,pl=null;function Ul(e,t,l){Z(ri,t._currentValue),t._currentValue=l}function hl(e){e._currentValue=ri.current,D(ri)}function ii(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var o=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var j=0;j<t.length;j++)if(x.context===t[j]){r.lanes|=l,x=r.alternate,x!==null&&(x.lanes|=l),ii(r.return,l,e),a||(o=null);break e}r=x.next}}else if(s.tag===18){if(o=s.return,o===null)throw Error(d(341));o.lanes|=l,r=o.alternate,r!==null&&(r.lanes|=l),ii(o,l,e),o=null}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}}function Va(e,t,l,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var o=s.alternate;if(o===null)throw Error(d(387));if(o=o.memoizedProps,o!==null){var x=s.type;kt(s.pendingProps.value,o.value)||(e!==null?e.push(x):e=[x])}}else if(s===ee.current){if(o=s.alternate,o===null)throw Error(d(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}s=s.return}e!==null&&ci(t,e,l,a),t.flags|=262144}function Ns(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ha=e,pl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return ou(ha,e)}function Es(e,t){return ha===null&&va(e),ou(e,t)}function ou(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},pl===null){if(e===null)throw Error(d(308));pl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pl=pl.next=t;return l}var Qm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Xm=i.unstable_scheduleCallback,Zm=i.unstable_NormalPriority,We={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oi(){return{controller:new Qm,data:new Map,refCount:0}}function Cn(e){e.refCount--,e.refCount===0&&Xm(Zm,function(){e.controller.abort()})}var An=null,ui=0,Qa=0,Xa=null;function Km(e,t){if(An===null){var l=An=[];ui=0,Qa=xc(),Xa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ui++,t.then(uu,uu),t}function uu(){if(--ui===0&&An!==null){Xa!==null&&(Xa.status="fulfilled");var e=An;An=null,Qa=0,Xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jm(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var du=E.S;E.S=function(e,t){Jd=ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Km(e,t),du!==null&&du(e,t)};var ya=N(null);function di(){var e=ya.current;return e!==null?e:Be.pooledCache}function ks(e,t){t===null?Z(ya,ya.current):Z(ya,t.pool)}function fu(){var e=di();return e===null?null:{parent:We._currentValue,pool:e}}var Za=Error(d(460)),fi=Error(d(474)),Ts=Error(d(542)),Cs={then:function(){}};function xu(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(dl,dl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e;default:if(typeof t.status=="string")t.then(dl,dl);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e}throw ba=t,Za}}function ga(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ba=l,Za):l}}var ba=null;function pu(){if(ba===null)throw Error(d(459));var e=ba;return ba=null,e}function hu(e){if(e===Za||e===Ts)throw Error(d(483))}var Ka=null,wn=0;function As(e){var t=wn;return wn+=1,Ka===null&&(Ka=[]),mu(Ka,e,t)}function _n(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===T?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vu(e){function t(C,k){if(e){var w=C.deletions;w===null?(C.deletions=[k],C.flags|=16):w.push(k)}}function l(C,k){if(!e)return null;for(;k!==null;)t(C,k),k=k.sibling;return null}function a(C){for(var k=new Map;C!==null;)C.key!==null?k.set(C.key,C):k.set(C.index,C),C=C.sibling;return k}function s(C,k){return C=xl(C,k),C.index=0,C.sibling=null,C}function r(C,k,w){return C.index=w,e?(w=C.alternate,w!==null?(w=w.index,w<k?(C.flags|=67108866,k):w):(C.flags|=67108866,k)):(C.flags|=1048576,k)}function o(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function x(C,k,w,U){return k===null||k.tag!==6?(k=ei(w,C.mode,U),k.return=C,k):(k=s(k,w),k.return=C,k)}function j(C,k,w,U){var ie=w.type;return ie===q?L(C,k,w.props.children,U,w.key):k!==null&&(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type)?(k=s(k,w.props),_n(k,w),k.return=C,k):(k=js(w.type,w.key,w.props,null,C.mode,U),_n(k,w),k.return=C,k)}function _(C,k,w,U){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=ti(w,C.mode,U),k.return=C,k):(k=s(k,w.children||[]),k.return=C,k)}function L(C,k,w,U,ie){return k===null||k.tag!==7?(k=ma(w,C.mode,U,ie),k.return=C,k):(k=s(k,w),k.return=C,k)}function H(C,k,w){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ei(""+k,C.mode,w),k.return=C,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case O:return w=js(k.type,k.key,k.props,null,C.mode,w),_n(w,k),w.return=C,w;case B:return k=ti(k,C.mode,w),k.return=C,k;case ae:return k=ga(k),H(C,k,w)}if(Ee(k)||ve(k))return k=ma(k,C.mode,w,null),k.return=C,k;if(typeof k.then=="function")return H(C,As(k),w);if(k.$$typeof===se)return H(C,Es(C,k),w);ws(C,k)}return null}function M(C,k,w,U){var ie=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ie!==null?null:x(C,k,""+w,U);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case O:return w.key===ie?j(C,k,w,U):null;case B:return w.key===ie?_(C,k,w,U):null;case ae:return w=ga(w),M(C,k,w,U)}if(Ee(w)||ve(w))return ie!==null?null:L(C,k,w,U,null);if(typeof w.then=="function")return M(C,k,As(w),U);if(w.$$typeof===se)return M(C,k,Es(C,w),U);ws(C,w)}return null}function z(C,k,w,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return C=C.get(w)||null,x(k,C,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case O:return C=C.get(U.key===null?w:U.key)||null,j(k,C,U,ie);case B:return C=C.get(U.key===null?w:U.key)||null,_(k,C,U,ie);case ae:return U=ga(U),z(C,k,w,U,ie)}if(Ee(U)||ve(U))return C=C.get(w)||null,L(k,C,U,ie,null);if(typeof U.then=="function")return z(C,k,w,As(U),ie);if(U.$$typeof===se)return z(C,k,w,Es(k,U),ie);ws(k,U)}return null}function te(C,k,w,U){for(var ie=null,Ce=null,ne=k,me=k=0,Ne=null;ne!==null&&me<w.length;me++){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var Ae=M(C,ne,w[me],U);if(Ae===null){ne===null&&(ne=Ne);break}e&&ne&&Ae.alternate===null&&t(C,ne),k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae,ne=Ne}if(me===w.length)return l(C,ne),ke&&ml(C,me),ie;if(ne===null){for(;me<w.length;me++)ne=H(C,w[me],U),ne!==null&&(k=r(ne,k,me),Ce===null?ie=ne:Ce.sibling=ne,Ce=ne);return ke&&ml(C,me),ie}for(ne=a(ne);me<w.length;me++)Ne=z(ne,C,me,w[me],U),Ne!==null&&(e&&Ne.alternate!==null&&ne.delete(Ne.key===null?me:Ne.key),k=r(Ne,k,me),Ce===null?ie=Ne:Ce.sibling=Ne,Ce=Ne);return e&&ne.forEach(function(la){return t(C,la)}),ke&&ml(C,me),ie}function oe(C,k,w,U){if(w==null)throw Error(d(151));for(var ie=null,Ce=null,ne=k,me=k=0,Ne=null,Ae=w.next();ne!==null&&!Ae.done;me++,Ae=w.next()){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var la=M(C,ne,Ae.value,U);if(la===null){ne===null&&(ne=Ne);break}e&&ne&&la.alternate===null&&t(C,ne),k=r(la,k,me),Ce===null?ie=la:Ce.sibling=la,Ce=la,ne=Ne}if(Ae.done)return l(C,ne),ke&&ml(C,me),ie;if(ne===null){for(;!Ae.done;me++,Ae=w.next())Ae=H(C,Ae.value,U),Ae!==null&&(k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return ke&&ml(C,me),ie}for(ne=a(ne);!Ae.done;me++,Ae=w.next())Ae=z(ne,C,me,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&ne.delete(Ae.key===null?me:Ae.key),k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return e&&ne.forEach(function(sh){return t(C,sh)}),ke&&ml(C,me),ie}function Le(C,k,w,U){if(typeof w=="object"&&w!==null&&w.type===q&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case O:e:{for(var ie=w.key;k!==null;){if(k.key===ie){if(ie=w.type,ie===q){if(k.tag===7){l(C,k.sibling),U=s(k,w.props.children),U.return=C,C=U;break e}}else if(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type){l(C,k.sibling),U=s(k,w.props),_n(U,w),U.return=C,C=U;break e}l(C,k);break}else t(C,k);k=k.sibling}w.type===q?(U=ma(w.props.children,C.mode,U,w.key),U.return=C,C=U):(U=js(w.type,w.key,w.props,null,C.mode,U),_n(U,w),U.return=C,C=U)}return o(C);case B:e:{for(ie=w.key;k!==null;){if(k.key===ie)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){l(C,k.sibling),U=s(k,w.children||[]),U.return=C,C=U;break e}else{l(C,k);break}else t(C,k);k=k.sibling}U=ti(w,C.mode,U),U.return=C,C=U}return o(C);case ae:return w=ga(w),Le(C,k,w,U)}if(Ee(w))return te(C,k,w,U);if(ve(w)){if(ie=ve(w),typeof ie!="function")throw Error(d(150));return w=ie.call(w),oe(C,k,w,U)}if(typeof w.then=="function")return Le(C,k,As(w),U);if(w.$$typeof===se)return Le(C,k,Es(C,w),U);ws(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,k!==null&&k.tag===6?(l(C,k.sibling),U=s(k,w),U.return=C,C=U):(l(C,k),U=ei(w,C.mode,U),U.return=C,C=U),o(C)):l(C,k)}return function(C,k,w,U){try{wn=0;var ie=Le(C,k,w,U);return Ka=null,ie}catch(ne){if(ne===Za||ne===Ts)throw ne;var Ce=Tt(29,ne,null,C.mode);return Ce.lanes=U,Ce.return=C,Ce}finally{}}}var ja=vu(!0),yu=vu(!1),Hl=!1;function xi(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 ql(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(we&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=bs(e),tu(e,null,l),t}return gs(e,a,t,l),bs(e)}function Rn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}function pi(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var o={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=o:r=r.next=o,l=l.next}while(l!==null);r===null?s=r=t:r=r.next=t}else s=r=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var hi=!1;function Mn(){if(hi){var e=Xa;if(e!==null)throw e}}function zn(e,t,l,a){hi=!1;var s=e.updateQueue;Hl=!1;var r=s.firstBaseUpdate,o=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var j=x,_=j.next;j.next=null,o===null?r=_:o.next=_,o=j;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==o&&(x===null?L.firstBaseUpdate=_:x.next=_,L.lastBaseUpdate=j))}if(r!==null){var H=s.baseState;o=0,L=_=j=null,x=r;do{var M=x.lane&-536870913,z=M!==x.lane;if(z?(Se&M)===M:(a&M)===M){M!==0&&M===Qa&&(hi=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var te=e,oe=x;M=t;var Le=l;switch(oe.tag){case 1:if(te=oe.payload,typeof te=="function"){H=te.call(Le,H,M);break e}H=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=oe.payload,M=typeof te=="function"?te.call(Le,H,M):te,M==null)break e;H=b({},H,M);break e;case 2:Hl=!0}}M=x.callback,M!==null&&(e.flags|=64,z&&(e.flags|=8192),z=s.callbacks,z===null?s.callbacks=[M]:z.push(M))}else z={lane:M,tag:x.tag,payload:x.payload,callback:x.callback,next:null},L===null?(_=L=z,j=H):L=L.next=z,o|=M;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;z=x,x=z.next,z.next=null,s.lastBaseUpdate=z,s.shared.pending=null}}while(!0);L===null&&(j=H),s.baseState=j,s.firstBaseUpdate=_,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Zl|=o,e.lanes=o,e.memoizedState=H}}function gu(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function bu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)gu(l[e],t)}var Ja=N(null),_s=N(0);function ju(e,t){e=kl,Z(_s,e),Z(Ja,t),kl=e|t.baseLanes}function vi(){Z(_s,kl),Z(Ja,Ja.current)}function yi(){kl=_s.current,D(Ja),D(_s)}var Ct=N(null),qt=null;function Gl(e){var t=e.alternate;Z(Ke,Ke.current&1),Z(Ct,e),qt===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(qt=e)}function gi(e){Z(Ke,Ke.current),Z(Ct,e),qt===null&&(qt=e)}function Su(e){e.tag===22?(Z(Ke,Ke.current),Z(Ct,e),qt===null&&(qt=e)):Vl()}function Vl(){Z(Ke,Ke.current),Z(Ct,Ct.current)}function At(e){D(Ct),qt===e&&(qt=null),D(Ke)}var Ke=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||kc(l)||Tc(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 vl=0,xe=null,Oe=null,Fe=null,Ms=!1,$a=!1,Sa=!1,zs=0,On=0,Wa=null,$m=0;function Qe(){throw Error(d(321))}function bi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!kt(e[l],t[l]))return!1;return!0}function ji(e,t,l,a,s,r){return vl=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?sd:Li,Sa=!1,r=l(a,s),Sa=!1,$a&&(r=Eu(t,l,a,s)),Nu(e),r}function Nu(e){E.H=Bn;var t=Oe!==null&&Oe.next!==null;if(vl=0,Fe=Oe=xe=null,Ms=!1,On=0,Wa=null,t)throw Error(d(300));e===null||Ie||(e=e.dependencies,e!==null&&Ns(e)&&(Ie=!0))}function Eu(e,t,l,a){xe=e;var s=0;do{if($a&&(Wa=null),On=0,$a=!1,25<=s)throw Error(d(301));if(s+=1,Fe=Oe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}E.H=rd,r=t(l,a)}while($a);return r}function Wm(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?Dn(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(xe.flags|=1024),t}function Si(){var e=zs!==0;return zs=0,e}function Ni(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ei(e){if(Ms){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ms=!1}vl=0,Fe=Oe=xe=null,$a=!1,On=zs=0,Wa=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Je(){if(Oe===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Fe===null?xe.memoizedState:Fe.next;if(t!==null)Fe=t,Oe=e;else{if(e===null)throw xe.alternate===null?Error(d(467)):Error(d(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dn(e){var t=On;return On+=1,Wa===null&&(Wa=[]),e=mu(Wa,e,t),t=xe,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?sd:Li),e}function Ds(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dn(e);if(e.$$typeof===se)return ct(e)}throw Error(d(438,String(e)))}function ki(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Os(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=re;return t.index++,l}function yl(e,t){return typeof t=="function"?t(e):t}function Ls(e){var t=Je();return Ti(t,Oe,e)}function Ti(e,t,l){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var o=s.next;s.next=r.next,r.next=o}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=o=null,j=null,_=t,L=!1;do{var H=_.lane&-536870913;if(H!==_.lane?(Se&H)===H:(vl&H)===H){var M=_.revertLane;if(M===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),H===Qa&&(L=!0);else if((vl&M)===M){_=_.next,M===Qa&&(L=!0);continue}else H={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=H,o=r):j=j.next=H,xe.lanes|=M,Zl|=M;H=_.action,Sa&&l(r,H),r=_.hasEagerState?_.eagerState:l(r,H)}else M={lane:H,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=M,o=r):j=j.next=M,xe.lanes|=H,Zl|=H;_=_.next}while(_!==null&&_!==t);if(j===null?o=r:j.next=x,!kt(r,e.memoizedState)&&(Ie=!0,L&&(l=Xa,l!==null)))throw l;e.memoizedState=r,e.baseState=o,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ci(e){var t=Je(),l=t.queue;if(l===null)throw Error(d(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var o=s=s.next;do r=e(r,o.action),o=o.next;while(o!==s);kt(r,t.memoizedState)||(Ie=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function ku(e,t,l){var a=xe,s=Je(),r=ke;if(r){if(l===void 0)throw Error(d(407));l=l()}else l=t();var o=!kt((Oe||s).memoizedState,l);if(o&&(s.memoizedState=l,Ie=!0),s=s.queue,_i(Au.bind(null,a,s,e),[e]),s.getSnapshot!==t||o||Fe!==null&&Fe.memoizedState.tag&1){if(a.flags|=2048,Fa(9,{destroy:void 0},Cu.bind(null,a,s,l,t),null),Be===null)throw Error(d(349));r||(vl&127)!==0||Tu(a,t,l)}return l}function Tu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=Os(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Cu(e,t,l,a){t.value=l,t.getSnapshot=a,wu(t)&&_u(e)}function Au(e,t,l){return l(function(){wu(t)&&_u(e)})}function wu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!kt(e,l)}catch{return!0}}function _u(e){var t=xa(e,2);t!==null&&St(t,e,2)}function Ai(e){var t=ft();if(typeof e=="function"){var l=e;if(e=l(),Sa){at(!0);try{l()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:e},t}function Ru(e,t,l,a){return e.baseState=l,Ti(e,Oe,typeof a=="function"?a:yl)}function Fm(e,t,l,a,s){if(Hs(e))throw Error(d(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){r.listeners.push(o)}};E.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Mu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Mu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=E.T,o={};E.T=o;try{var x=l(s,a),j=E.S;j!==null&&j(o,x),zu(e,t,x)}catch(_){wi(e,t,_)}finally{r!==null&&o.types!==null&&(r.types=o.types),E.T=r}}else try{r=l(s,a),zu(e,t,r)}catch(_){wi(e,t,_)}}function zu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Ou(e,t,a)},function(a){return wi(e,t,a)}):Ou(e,t,l)}function Ou(e,t,l){t.status="fulfilled",t.value=l,Du(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Mu(e,l)))}function wi(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Du(t),t=t.next;while(t!==a)}e.action=null}function Du(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Lu(e,t){return t}function Bu(e,t){if(ke){var l=Be.formState;if(l!==null){e:{var a=xe;if(ke){if(Ue){t:{for(var s=Ue,r=Ht;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ue=Yt(s.nextSibling),a=s.data==="F!";break e}}Bl(a)}a=!1}a&&(t=l[0])}}return l=ft(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lu,lastRenderedState:t},l.queue=a,l=ld.bind(null,xe,a),a.dispatch=l,a=Ai(!1),r=Di.bind(null,xe,!1,a.queue),a=ft(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Fm.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Uu(e){var t=Je();return Hu(t,Oe,e)}function Hu(e,t,l){if(t=Ti(e,t,Lu)[0],e=Ls(yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Dn(t)}catch(o){throw o===Za?Ts:o}else a=t;t=Je();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Fa(9,{destroy:void 0},Im.bind(null,s,l),null)),[a,r,e]}function Im(e,t){e.action=t}function qu(e){var t=Je(),l=Oe;if(l!==null)return Hu(t,l,e);Je(),t=t.memoizedState,l=Je();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Fa(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Os(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Yu(){return Je().memoizedState}function Bs(e,t,l,a){var s=ft();xe.flags|=e,s.memoizedState=Fa(1|t,{destroy:void 0},l,a===void 0?null:a)}function Us(e,t,l,a){var s=Je();a=a===void 0?null:a;var r=s.memoizedState.inst;Oe!==null&&a!==null&&bi(a,Oe.memoizedState.deps)?s.memoizedState=Fa(t,r,l,a):(xe.flags|=e,s.memoizedState=Fa(1|t,r,l,a))}function Gu(e,t){Bs(8390656,8,e,t)}function _i(e,t){Us(2048,8,e,t)}function Pm(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Os(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Vu(e){var t=Je().memoizedState;return Pm({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function Qu(e,t){return Us(4,2,e,t)}function Xu(e,t){return Us(4,4,e,t)}function Zu(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 Ku(e,t,l){l=l!=null?l.concat([e]):null,Us(4,4,Zu.bind(null,t,e),l)}function Ri(){}function Ju(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&bi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function $u(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&bi(t,a[1]))return a[0];if(a=e(),Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a}function Mi(e,t,l){return l===void 0||(vl&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Wd(),xe.lanes|=e,Zl|=e,l)}function Wu(e,t,l,a){return kt(l,t)?l:Ja.current!==null?(e=Mi(e,l,a),kt(e,t)||(Ie=!0),e):(vl&42)===0||(vl&1073741824)!==0&&(Se&261930)===0?(Ie=!0,e.memoizedState=l):(e=Wd(),xe.lanes|=e,Zl|=e,t)}function Fu(e,t,l,a,s){var r=A.p;A.p=r!==0&&8>r?r:8;var o=E.T,x={};E.T=x,Di(e,!1,t,l);try{var j=s(),_=E.S;if(_!==null&&_(x,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var L=Jm(j,a);Ln(e,t,L,Rt(e))}else Ln(e,t,a,Rt(e))}catch(H){Ln(e,t,{then:function(){},status:"rejected",reason:H},Rt())}finally{A.p=r,o!==null&&x.types!==null&&(o.types=x.types),E.T=o}}function ep(){}function zi(e,t,l,a){if(e.tag!==5)throw Error(d(476));var s=Iu(e).queue;Fu(e,s,t,J,l===null?ep:function(){return Pu(e),l(a)})}function Iu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:J},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pu(e){var t=Iu(e);t.next===null&&(t=e.alternate.memoizedState),Ln(e,t.next.queue,{},Rt())}function Oi(){return ct(Pn)}function ed(){return Je().memoizedState}function td(){return Je().memoizedState}function tp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Rt();e=ql(l);var a=Yl(t,e,l);a!==null&&(St(a,t,l),Rn(a,t,l)),t={cache:oi()},e.payload=t;return}t=t.return}}function lp(e,t,l){var a=Rt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)?ad(t,l):(l=Ir(e,t,l,a),l!==null&&(St(l,e,a),nd(l,t,a)))}function ld(e,t,l){var a=Rt();Ln(e,t,l,a)}function Ln(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))ad(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,x=r(o,l);if(s.hasEagerState=!0,s.eagerState=x,kt(x,o))return gs(e,t,s,0),Be===null&&ys(),!1}catch{}finally{}if(l=Ir(e,t,s,a),l!==null)return St(l,e,a),nd(l,t,a),!0}return!1}function Di(e,t,l,a){if(a={lane:2,revertLane:xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(d(479))}else t=Ir(e,l,a,2),t!==null&&St(t,e,2)}function Hs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function ad(e,t){$a=Ms=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function nd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}var Bn={readContext:ct,use:Ds,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Bn.useEffectEvent=Qe;var sd={readContext:ct,use:Ds,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:Gu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Bs(4194308,4,Zu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var l=ft();t=t===void 0?null:t;var a=e();if(Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ft();if(l!==void 0){var s=l(t);if(Sa){at(!0);try{l(t)}finally{at(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=lp.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ld.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ri,useDeferredValue:function(e,t){var l=ft();return Mi(l,e,t)},useTransition:function(){var e=Ai(!1);return e=Fu.bind(null,xe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=ft();if(ke){if(l===void 0)throw Error(d(407));l=l()}else{if(l=t(),Be===null)throw Error(d(349));(Se&127)!==0||Tu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Gu(Au.bind(null,a,r,e),[e]),a.flags|=2048,Fa(9,{destroy:void 0},Cu.bind(null,a,r,l,t),null),l},useId:function(){var e=ft(),t=Be.identifierPrefix;if(ke){var l=tl,a=el;l=(a&~(1<<32-Ge(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=$m++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oi,useFormState:Bu,useActionState:Bu,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Di.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:ki,useCacheRefresh:function(){return ft().memoizedState=tp.bind(null,xe)},useEffectEvent:function(e){var t=ft(),l={impl:e};return t.memoizedState=l,function(){if((we&2)!==0)throw Error(d(440));return l.impl.apply(void 0,arguments)}}},Li={readContext:ct,use:Ds,useCallback:Ju,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:$u,useReducer:Ls,useRef:Yu,useState:function(){return Ls(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Wu(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ls(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Oi,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=Je();return Ru(l,Oe,e,t)},useMemoCache:ki,useCacheRefresh:td};Li.useEffectEvent=Vu;var rd={readContext:ct,use:Ds,useCallback:Ju,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:$u,useReducer:Ci,useRef:Yu,useState:function(){return Ci(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Oe===null?Mi(l,e,t):Wu(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ci(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Oi,useFormState:qu,useActionState:qu,useOptimistic:function(e,t){var l=Je();return Oe!==null?Ru(l,Oe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ki,useCacheRefresh:td};rd.useEffectEvent=Vu;function Bi(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Ui={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Rt(),s=ql(a);s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Rt(),s=ql(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Rt(),a=ql(l);a.tag=2,t!=null&&(a.callback=t),t=Yl(e,a,l),t!==null&&(St(t,e,l),Rn(t,e,l))}};function id(e,t,l,a,s,r,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,o):t.prototype&&t.prototype.isPureReactComponent?!Nn(l,a)||!Nn(s,r):!0}function cd(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function Na(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function od(e){vs(e)}function ud(e){console.error(e)}function dd(e){vs(e)}function qs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function fd(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Hi(e,t,l){return l=ql(l),l.tag=3,l.payload={element:null},l.callback=function(){qs(e,t)},l}function xd(e){return e=ql(e),e.tag=3,e}function md(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){fd(t,l,a)}}var o=l.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){fd(t,l,a),typeof s!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function ap(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Va(t,l,s,!0),l=Ct.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Is():l.alternate===null&&Xe===0&&(Xe=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),uc(e,a,s)),!1;case 22:return l.flags|=65536,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),uc(e,a,s)),!1}throw Error(d(435,l.tag))}return uc(e,a,s),Is(),!1}if(ke)return t=Ct.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==ni&&(e=Error(d(422),{cause:a}),Tn(Lt(e,l)))):(a!==ni&&(t=Error(d(423),{cause:a}),Tn(Lt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Lt(a,l),s=Hi(e.stateNode,a,s),pi(e,s),Xe!==4&&(Xe=2)),!1;var r=Error(d(520),{cause:a});if(r=Lt(r,l),Xn===null?Xn=[r]:Xn.push(r),Xe!==4&&(Xe=2),t===null)return!0;a=Lt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Hi(l.stateNode,a,e),pi(l,e),!1;case 1:if(t=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Kl===null||!Kl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=xd(s),md(s,e,l,a),pi(l,s),!1}l=l.return}while(l!==null);return!1}var qi=Error(d(461)),Ie=!1;function ot(e,t,l,a){t.child=e===null?yu(t,null,l,a):ja(t,e.child,l,a)}function pd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var o={};for(var x in a)x!=="ref"&&(o[x]=a[x])}else o=a;return va(t),a=ji(e,t,l,o,r,s),x=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&x&&li(t),t.flags|=1,ot(e,t,a,s),t.child)}function hd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Pr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,vd(e,t,r,a,s)):(e=js(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Ji(e,s)){var o=r.memoizedProps;if(l=l.compare,l=l!==null?l:Nn,l(o,a)&&e.ref===t.ref)return gl(e,t,s)}return t.flags|=1,e=xl(r,a),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(Nn(r,a)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=a=r,Ji(e,s))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,gl(e,t,s)}return Yi(e,t,l,a,s)}function yd(e,t,l,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return gd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ks(t,r!==null?r.cachePool:null),r!==null?ju(t,r):vi(),Su(t);else return a=t.lanes=536870912,gd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(ks(t,r.cachePool),ju(t,r),Vl(),t.memoizedState=null):(e!==null&&ks(t,null),vi(),Vl());return ot(e,t,s,l),t.child}function Un(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gd(e,t,l,a,s){var r=di();return r=r===null?null:{parent:We._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&ks(t,null),vi(),Su(t),e!==null&&Va(e,t,a,!0),t.childLanes=s,null}function Ys(e,t){return t=Vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function bd(e,t,l){return ja(t,e.child,null,l),e=Ys(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function np(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=Ys(t,a),t.lanes=536870912,Un(null,e);if(gi(t),(e=Ue)?(e=zf(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return t.lanes=536870912,null}return Ys(t,a)}var r=e.memoizedState;if(r!==null){var o=r.dehydrated;if(gi(t),s)if(t.flags&256)t.flags&=-257,t=bd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Ie||Va(e,t,l,!1),s=(l&e.childLanes)!==0,Ie||s){if(a=Be,a!==null&&(o=oo(a,l),o!==0&&o!==r.retryLane))throw r.retryLane=o,xa(e,o),St(a,e,o),qi;Is(),t=bd(e,t,l)}else e=r.treeContext,Ue=Yt(o.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&ru(t,e),t=Ys(t,a),t.flags|=4096;return t}return e=xl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gs(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(d(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Yi(e,t,l,a,s){return va(t),l=ji(e,t,l,a,void 0,s),a=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,s),t.child)}function jd(e,t,l,a,s,r){return va(t),t.updateQueue=null,l=Eu(t,a,l,s),Nu(e),a=Si(),e!==null&&!Ie?(Ni(e,t,r),gl(e,t,r)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,r),t.child)}function Sd(e,t,l,a,s){if(va(t),t.stateNode===null){var r=Ha,o=l.contextType;typeof o=="object"&&o!==null&&(r=ct(o)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ui,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},xi(t),o=l.contextType,r.context=typeof o=="object"&&o!==null?ct(o):Ha,r.state=t.memoizedState,o=l.getDerivedStateFromProps,typeof o=="function"&&(Bi(t,l,o,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(o=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),o!==r.state&&Ui.enqueueReplaceState(r,r.state,null),zn(t,a,r,s),Mn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,j=Na(l,x);r.props=j;var _=r.context,L=l.contextType;o=Ha,typeof L=="object"&&L!==null&&(o=ct(L));var H=l.getDerivedStateFromProps;L=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||_!==o)&&cd(t,r,a,o),Hl=!1;var M=t.memoizedState;r.state=M,zn(t,a,r,s),Mn(),_=t.memoizedState,x||M!==_||Hl?(typeof H=="function"&&(Bi(t,l,H,a),_=t.memoizedState),(j=Hl||id(t,l,j,a,M,_,o))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),r.props=a,r.state=_,r.context=o,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,mi(e,t),o=t.memoizedProps,L=Na(l,o),r.props=L,H=t.pendingProps,M=r.context,_=l.contextType,j=Ha,typeof _=="object"&&_!==null&&(j=ct(_)),x=l.getDerivedStateFromProps,(_=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o!==H||M!==j)&&cd(t,r,a,j),Hl=!1,M=t.memoizedState,r.state=M,zn(t,a,r,s),Mn();var z=t.memoizedState;o!==H||M!==z||Hl||e!==null&&e.dependencies!==null&&Ns(e.dependencies)?(typeof x=="function"&&(Bi(t,l,x,a),z=t.memoizedState),(L=Hl||id(t,l,L,a,M,z,j)||e!==null&&e.dependencies!==null&&Ns(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,z,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,z,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=z),r.props=a,r.state=z,r.context=j,a=L):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Gs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=ja(t,e.child,null,s),t.child=ja(t,null,l,s)):ot(e,t,l,s),t.memoizedState=r.state,e=t.child):e=gl(e,t,s),e}function Nd(e,t,l,a){return pa(),t.flags|=256,ot(e,t,l,a),t.child}var Gi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vi(e){return{baseLanes:e,cachePool:fu()}}function Qi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=_t),e}function Ed(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,o;if((o=r)||(o=e!==null&&e.memoizedState===null?!1:(Ke.current&2)!==0),o&&(s=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Gl(t):Vl(),(e=Ue)?(e=zf(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return Tc(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,s?(Vl(),s=t.mode,x=Vs({mode:"hidden",children:x},s),a=ma(a,s,l,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(null,a)):(Gl(t),Xi(t,x))}var j=e.memoizedState;if(j!==null&&(x=j.dehydrated,x!==null)){if(r)t.flags&256?(Gl(t),t.flags&=-257,t=Zi(e,t,l)):t.memoizedState!==null?(Vl(),t.child=e.child,t.flags|=128,t=null):(Vl(),x=a.fallback,s=t.mode,a=Vs({mode:"visible",children:a.children},s),x=ma(x,s,l,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,ja(t,e.child,null,l),a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,t=Un(null,a));else if(Gl(t),Tc(x)){if(o=x.nextSibling&&x.nextSibling.dataset,o)var _=o.dgst;o=_,a=Error(d(419)),a.stack="",a.digest=o,Tn({value:a,source:null,stack:null}),t=Zi(e,t,l)}else if(Ie||Va(e,t,l,!1),o=(l&e.childLanes)!==0,Ie||o){if(o=Be,o!==null&&(a=oo(o,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,xa(e,a),St(o,e,a),qi;kc(x)||Is(),t=Zi(e,t,l)}else kc(x)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ue=Yt(x.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&ru(t,e),t=Xi(t,a.children),t.flags|=4096);return t}return s?(Vl(),x=a.fallback,s=t.mode,j=e.child,_=j.sibling,a=xl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,_!==null?x=xl(_,x):(x=ma(x,s,l,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Un(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Vi(l):(s=x.cachePool,s!==null?(j=We._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=fu(),x={baseLanes:x.baseLanes|l,cachePool:s}),a.memoizedState=x,a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(e.child,a)):(Gl(t),l=e.child,e=l.sibling,l=xl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=l,t.memoizedState=null,l)}function Xi(e,t){return t=Vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vs(e,t){return e=Tt(22,e,null,t),e.lanes=0,e}function Zi(e,t,l){return ja(t,e.child,null,l),e=Xi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ii(e.return,t,l)}function Ki(e,t,l,a,s,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=l,o.tailMode=s,o.treeForkCount=r)}function Td(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var o=Ke.current,x=(o&2)!==0;if(x?(o=o&1|2,t.flags|=128):o&=1,Z(Ke,o),ot(e,t,a,l),a=ke?kn:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kd(e,l,t);else if(e.tag===19)kd(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),Ki(t,!1,s,l,r,a);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}Ki(t,!0,l,null,r,a);break;case"together":Ki(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function gl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Zl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Va(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,l=xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=xl(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&&Ns(e)))}function sp(e,t,l){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),Ul(t,We,e.memoizedState.cache),pa();break;case 27:case 5:Ze(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:Ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Gl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ed(e,t,l):(Gl(t),e=gl(e,t,l),e!==null?e.sibling:null);Gl(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Va(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Td(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Z(Ke,Ke.current),a)break;return null;case 22:return t.lanes=0,yd(e,t,l,t.pendingProps);case 24:Ul(t,We,e.memoizedState.cache)}return gl(e,t,l)}function Cd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return Ie=!1,sp(e,t,l);Ie=(e.flags&131072)!==0}else Ie=!1,ke&&(t.flags&1048576)!==0&&su(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e=="function")Pr(e)?(a=Na(e,a),t.tag=1,t=Sd(null,t,e,a,l)):(t.tag=0,t=Yi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===Y){t.tag=11,t=pd(null,t,e,a,l);break e}else if(s===W){t.tag=14,t=hd(null,t,e,a,l);break e}}throw t=ue(e)||e,Error(d(306,t,""))}}return t;case 0:return Yi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=Na(a,t.pendingProps),Sd(e,t,a,s,l);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,mi(e,t),zn(t,a,null,l);var o=t.memoizedState;if(a=o.cache,Ul(t,We,a),a!==r.cache&&ci(t,[We],l,!0),Mn(),a=o.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Nd(e,t,a,l);break e}else if(a!==s){s=Lt(Error(d(424)),t),Tn(s),t=Nd(e,t,a,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(Ue=Yt(e.firstChild),it=t,ke=!0,Ll=null,Ht=!0,l=yu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(pa(),a===s){t=gl(e,t,l);break e}ot(e,t,a,l)}t=t.child}return t;case 26:return Gs(e,t),e===null?(l=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=l:ke||(l=t.type,e=t.pendingProps,a=sr(V.current).createElement(l),a[rt]=t,a[ht]=e,ut(a,l,e),nt(a),t.stateNode=a):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ze(t),e===null&&ke&&(a=t.stateNode=Lf(t.type,t.pendingProps,V.current),it=t,Ht=!0,s=Ue,Fl(t.type)?(Cc=s,Ue=Yt(a.firstChild)):Ue=s),ot(e,t,t.pendingProps.children,l),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=a=Ue)&&(a=Dp(a,t.type,t.pendingProps,Ht),a!==null?(t.stateNode=a,it=t,Ue=Yt(a.firstChild),Ht=!1,s=!0):s=!1),s||Bl(t)),Ze(t),s=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,a=r.children,Sc(s,r)?a=null:o!==null&&Sc(s,o)&&(t.flags|=32),t.memoizedState!==null&&(s=ji(e,t,Wm,null,null,l),Pn._currentValue=s),Gs(e,t),ot(e,t,a,l),t.child;case 6:return e===null&&ke&&((e=l=Ue)&&(l=Lp(l,t.pendingProps,Ht),l!==null?(t.stateNode=l,it=t,Ue=null,e=!0):e=!1),e||Bl(t)),null;case 13:return Ed(e,t,l);case 4:return fe(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ja(t,null,a,l):ot(e,t,a,l),t.child;case 11:return pd(e,t,t.type,t.pendingProps,l);case 7:return ot(e,t,t.pendingProps,l),t.child;case 8:return ot(e,t,t.pendingProps.children,l),t.child;case 12:return ot(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Ul(t,t.type,a.value),ot(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,va(t),s=ct(s),a=a(s),t.flags|=1,ot(e,t,a,l),t.child;case 14:return hd(e,t,t.type,t.pendingProps,l);case 15:return vd(e,t,t.type,t.pendingProps,l);case 19:return Td(e,t,l);case 31:return np(e,t,l);case 22:return yd(e,t,l,t.pendingProps);case 24:return va(t),a=ct(We),e===null?(s=di(),s===null&&(s=Be,r=oi(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},xi(t),Ul(t,We,s)):((e.lanes&l)!==0&&(mi(e,t),zn(t,null,null,l),Mn()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ul(t,We,a)):(a=r.cache,Ul(t,We,a),a!==s.cache&&ci(t,[We],l,!0))),ot(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function bl(e){e.flags|=4}function $i(e,t,l,a,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(ef())e.flags|=8192;else throw ba=Cs,fi}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,!Qf(t))if(ef())e.flags|=8192;else throw ba=Cs,fi}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fn():536870912,e.lanes|=t,tn|=t)}function Hn(e,t){if(!ke)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 a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function rp(e,t,l){var a=t.pendingProps;switch(ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hl(We),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ga(t)?bl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,si())),He(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(bl(t),r!==null?(He(t),Ad(t,r)):(He(t),$i(t,s,null,a,l))):r?r!==e.memoizedState?(bl(t),He(t),Ad(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&bl(t),He(t),$i(t,s,e,a,l)),null;case 27:if(et(t),l=V.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return He(t),null}e=R.current,Ga(t)?iu(t):(e=Lf(s,a,l),t.stateNode=e,bl(t))}return He(t),null;case 5:if(et(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return He(t),null}if(r=R.current,Ga(t))iu(t);else{var o=sr(V.current);switch(r){case 1:r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=o.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?o.createElement(s,{is:a.is}):o.createElement(s)}}r[rt]=t,r[ht]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)r.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=r;e:switch(ut(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&bl(t)}}return He(t),$i(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=V.current,Ga(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=it,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[rt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||kf(e.nodeValue,l)),e||Bl(t,!0)}else e=sr(e).createTextNode(a),e[rt]=t,t.stateNode=e}return He(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ga(t),l!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else l=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(At(t),t):(At(t),null);if((t.flags&128)!==0)throw Error(d(558))}return He(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ga(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(317));s[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),s=!1}else s=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(At(t),t):(At(t),null)}return At(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Qs(t,t.updateQueue),He(t),null);case 4:return ye(),e===null&&vc(t.stateNode.containerInfo),He(t),null;case 10:return hl(t.type),He(t),null;case 19:if(D(Ke),a=t.memoizedState,a===null)return He(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Hn(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Rs(e),r!==null){for(t.flags|=128,Hn(a,!1),e=r.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)lu(l,e),l=l.sibling;return Z(Ke,Ke.current&1|2),ke&&ml(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ze()>$s&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Rs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!ke)return He(t),null}else 2*ze()-a.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ze(),e.sibling=null,l=Ke.current,Z(Ke,s?l&1|2:l&1),ke&&ml(t,a.treeForkCount),e):(He(t),null);case 22:case 23:return At(t),yi(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),l=t.updateQueue,l!==null&&Qs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(ya),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),hl(We),He(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function ip(e,t){switch(ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hl(We),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return et(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(d(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ke),null;case 4:return ye(),null;case 10:return hl(t.type),null;case 22:case 23:return At(t),yi(),e!==null&&D(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hl(We),null;case 25:return null;default:return null}}function wd(e,t){switch(ai(t),t.tag){case 3:hl(We),ye();break;case 26:case 27:case 5:et(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:D(Ke);break;case 10:hl(t.type);break;case 22:case 23:At(t),yi(),e!==null&&D(ya);break;case 24:hl(We)}}function qn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var r=l.create,o=l.inst;a=r(),o.destroy=a}l=l.next}while(l!==s)}}catch(x){Me(t,t.return,x)}}function Ql(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var o=a.inst,x=o.destroy;if(x!==void 0){o.destroy=void 0,s=t;var j=l,_=x;try{_()}catch(L){Me(s,j,L)}}}a=a.next}while(a!==r)}}catch(L){Me(t,t.return,L)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{bu(t,l)}catch(a){Me(e,e.return,a)}}}function Rd(e,t,l){l.props=Na(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Me(e,t,a)}}function Yn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){Me(e,t,s)}}function ll(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Me(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){Me(e,t,s)}else l.current=null}function Md(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){Me(e,e.return,s)}}function Wi(e,t,l){try{var a=e.stateNode;wp(a,e.type,l,t),a[ht]=t}catch(s){Me(e,e.return,s)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fl(e.type)||e.tag===4}function Fi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Fl(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 Ii(e,t,l){var a=e.tag;if(a===5||a===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=dl));else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Ii(e,t,l),e=e.sibling;e!==null;)Ii(e,t,l),e=e.sibling}function Xs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Xs(e,t,l),e=e.sibling;e!==null;)Xs(e,t,l),e=e.sibling}function Od(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ut(t,a,l),t[rt]=e,t[ht]=l}catch(r){Me(e,e.return,r)}}var jl=!1,Pe=!1,Pi=!1,Dd=typeof WeakSet=="function"?WeakSet:Set,st=null;function cp(e,t){if(e=e.containerInfo,bc=fr,e=Ko(e),Zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break e}var o=0,x=-1,j=-1,_=0,L=0,H=e,M=null;t:for(;;){for(var z;H!==l||s!==0&&H.nodeType!==3||(x=o+s),H!==r||a!==0&&H.nodeType!==3||(j=o+a),H.nodeType===3&&(o+=H.nodeValue.length),(z=H.firstChild)!==null;)M=H,H=z;for(;;){if(H===e)break t;if(M===l&&++_===s&&(x=o),M===r&&++L===a&&(j=o),(z=H.nextSibling)!==null)break;H=M,M=H.parentNode}H=z}l=x===-1||j===-1?null:{start:x,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(jc={focusedElem:e,selectionRange:l},fr=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,r=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&&r!==null){e=void 0,l=t,s=r.memoizedProps,r=r.memoizedState,a=l.stateNode;try{var te=Na(l.type,s);e=a.getSnapshotBeforeUpdate(te,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Me(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ec(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ec(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(d(163))}if(e=t.sibling,e!==null){e.return=t.return,st=e;break}st=t.return}}function Ld(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Nl(e,l),a&4&&qn(5,l);break;case 1:if(Nl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(o){Me(l,l.return,o)}else{var s=Na(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Me(l,l.return,o)}}a&64&&_d(l),a&512&&Yn(l,l.return);break;case 3:if(Nl(e,l),a&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{bu(e,t)}catch(o){Me(l,l.return,o)}}break;case 27:t===null&&a&4&&Od(l);case 26:case 5:Nl(e,l),t===null&&a&4&&Md(l),a&512&&Yn(l,l.return);break;case 12:Nl(e,l);break;case 31:Nl(e,l),a&4&&Hd(e,l);break;case 13:Nl(e,l),a&4&&qd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=vp.bind(null,l),Bp(e,l))));break;case 22:if(a=l.memoizedState!==null||jl,!a){t=t!==null&&t.memoizedState!==null||Pe,s=jl;var r=Pe;jl=a,(Pe=t)&&!r?El(e,l,(l.subtreeFlags&8772)!==0):Nl(e,l),jl=s,Pe=r}break;case 30:break;default:Nl(e,l)}}function Bd(e){var t=e.alternate;t!==null&&(e.alternate=null,Bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wr(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 Ye=null,yt=!1;function Sl(e,t,l){for(l=l.child;l!==null;)Ud(e,t,l),l=l.sibling}function Ud(e,t,l){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(Mt,l)}catch{}switch(l.tag){case 26:Pe||ll(l,t),Sl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pe||ll(l,t);var a=Ye,s=yt;Fl(l.type)&&(Ye=l.stateNode,yt=!1),Sl(e,t,l),Wn(l.stateNode),Ye=a,yt=s;break;case 5:Pe||ll(l,t);case 6:if(a=Ye,s=yt,Ye=null,Sl(e,t,l),Ye=a,yt=s,Ye!==null)if(yt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(l.stateNode)}catch(r){Me(l,t,r)}else try{Ye.removeChild(l.stateNode)}catch(r){Me(l,t,r)}break;case 18:Ye!==null&&(yt?(e=Ye,Rf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),un(e)):Rf(Ye,l.stateNode));break;case 4:a=Ye,s=yt,Ye=l.stateNode.containerInfo,yt=!0,Sl(e,t,l),Ye=a,yt=s;break;case 0:case 11:case 14:case 15:Ql(2,l,t),Pe||Ql(4,l,t),Sl(e,t,l);break;case 1:Pe||(ll(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Rd(l,t,a)),Sl(e,t,l);break;case 21:Sl(e,t,l);break;case 22:Pe=(a=Pe)||l.memoizedState!==null,Sl(e,t,l),Pe=a;break;default:Sl(e,t,l)}}function Hd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{un(e)}catch(l){Me(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{un(e)}catch(l){Me(t,t.return,l)}}function op(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Dd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Dd),t;default:throw Error(d(435,e.tag))}}function Zs(e,t){var l=op(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=yp.bind(null,e,a);a.then(s,s)}})}function gt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,o=t,x=o;e:for(;x!==null;){switch(x.tag){case 27:if(Fl(x.type)){Ye=x.stateNode,yt=!1;break e}break;case 5:Ye=x.stateNode,yt=!1;break e;case 3:case 4:Ye=x.stateNode.containerInfo,yt=!0;break e}x=x.return}if(Ye===null)throw Error(d(160));Ud(r,o,s),Ye=null,yt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var Kt=null;function Yd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),bt(e),a&4&&(Ql(3,e,e.return),qn(3,e),Ql(5,e,e.return));break;case 1:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&64&&jl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=Kt;if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&4){var r=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[mn]||r[rt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ut(r,a,l),r[rt]=e,nt(r),a=r;break e;case"link":var o=Gf("link","href",s).get(a+(l.href||""));if(o){for(var x=0;x<o.length;x++)if(r=o[x],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;case"meta":if(o=Gf("meta","content",s).get(a+(l.content||""))){for(x=0;x<o.length;x++)if(r=o[x],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;default:throw Error(d(468,a))}r[rt]=e,nt(r),a=r}e.stateNode=a}else Vf(s,e.type,e.stateNode);else e.stateNode=Yf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Vf(s,e.type,e.stateNode):Yf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Wi(e,e.memoizedProps,l.memoizedProps)}break;case 27:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),l!==null&&a&4&&Wi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),e.flags&32){s=e.stateNode;try{Ma(s,"")}catch(te){Me(e,e.return,te)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Wi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Pi=!0);break;case 6:if(gt(t,e),bt(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(te){Me(e,e.return,te)}}break;case 3:if(cr=null,s=Kt,Kt=rr(t.containerInfo),gt(t,e),Kt=s,bt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(te){Me(e,e.return,te)}Pi&&(Pi=!1,Gd(e));break;case 4:a=Kt,Kt=rr(e.stateNode.containerInfo),gt(t,e),bt(e),Kt=a;break;case 12:gt(t,e),bt(e);break;case 31:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 13:gt(t,e),bt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Js=ze()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,_=jl,L=Pe;if(jl=_||s,Pe=L||j,gt(t,e),Pe=L,jl=_,bt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||jl||Pe||Ea(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{x=j.stateNode;var H=j.memoizedProps.style,M=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(te){Me(j,j.return,te)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(te){Me(j,j.return,te)}}}else if(t.tag===18){if(l===null){j=t;try{var z=j.stateNode;s?Mf(z,!0):Mf(j.stateNode,!1)}catch(te){Me(j,j.return,te)}}}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}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Zs(e,l))));break;case 19:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 30:break;case 21:break;default:gt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(zd(a)){l=a;break}a=a.return}if(l==null)throw Error(d(160));switch(l.tag){case 27:var s=l.stateNode,r=Fi(e);Xs(e,r,s);break;case 5:var o=l.stateNode;l.flags&32&&(Ma(o,""),l.flags&=-33);var x=Fi(e);Xs(e,x,o);break;case 3:case 4:var j=l.stateNode.containerInfo,_=Fi(e);Ii(e,_,j);break;default:throw Error(d(161))}}catch(L){Me(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ld(e,t.alternate,t),t=t.sibling}function Ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ql(4,t,t.return),Ea(t);break;case 1:ll(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Rd(t,t.return,l),Ea(t);break;case 27:Wn(t.stateNode);case 26:case 5:ll(t,t.return),Ea(t);break;case 22:t.memoizedState===null&&Ea(t);break;case 30:Ea(t);break;default:Ea(t)}e=e.sibling}}function El(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,o=r.flags;switch(r.tag){case 0:case 11:case 15:El(s,r,l),qn(4,r);break;case 1:if(El(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){Me(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var x=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)gu(j[s],x)}catch(_){Me(a,a.return,_)}}l&&o&64&&_d(r),Yn(r,r.return);break;case 27:Od(r);case 26:case 5:El(s,r,l),l&&a===null&&o&4&&Md(r),Yn(r,r.return);break;case 12:El(s,r,l);break;case 31:El(s,r,l),l&&o&4&&Hd(s,r);break;case 13:El(s,r,l),l&&o&4&&qd(s,r);break;case 22:r.memoizedState===null&&El(s,r,l),Yn(r,r.return);break;case 30:break;default:El(s,r,l)}t=t.sibling}}function ec(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 tc(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 Jt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vd(e,t,l,a),t=t.sibling}function Vd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,l,a),s&2048&&qn(9,t);break;case 1:Jt(e,t,l,a);break;case 3:Jt(e,t,l,a),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){Jt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,o=r.id,x=r.onPostCommit;typeof x=="function"&&x(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Me(t,t.return,j)}}else Jt(e,t,l,a);break;case 31:Jt(e,t,l,a);break;case 13:Jt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,o=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,l,a):Gn(e,t):r._visibility&2?Jt(e,t,l,a):(r._visibility|=2,Ia(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&ec(o,t);break;case 24:Jt(e,t,l,a),s&2048&&tc(t.alternate,t);break;default:Jt(e,t,l,a)}}function Ia(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,o=t,x=l,j=a,_=o.flags;switch(o.tag){case 0:case 11:case 15:Ia(r,o,x,j,s),qn(8,o);break;case 23:break;case 22:var L=o.stateNode;o.memoizedState!==null?L._visibility&2?Ia(r,o,x,j,s):Gn(r,o):(L._visibility|=2,Ia(r,o,x,j,s)),s&&_&2048&&ec(o.alternate,o);break;case 24:Ia(r,o,x,j,s),s&&_&2048&&tc(o.alternate,o);break;default:Ia(r,o,x,j,s)}t=t.sibling}}function Gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,s=a.flags;switch(a.tag){case 22:Gn(l,a),s&2048&&ec(a.alternate,a);break;case 24:Gn(l,a),s&2048&&tc(a.alternate,a);break;default:Gn(l,a)}t=t.sibling}}var Vn=8192;function Pa(e,t,l){if(e.subtreeFlags&Vn)for(e=e.child;e!==null;)Qd(e,t,l),e=e.sibling}function Qd(e,t,l){switch(e.tag){case 26:Pa(e,t,l),e.flags&Vn&&e.memoizedState!==null&&$p(l,Kt,e.memoizedState,e.memoizedProps);break;case 5:Pa(e,t,l);break;case 3:case 4:var a=Kt;Kt=rr(e.stateNode.containerInfo),Pa(e,t,l),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Vn,Vn=16777216,Pa(e,t,l),Vn=a):Pa(e,t,l));break;default:Pa(e,t,l)}}function Xd(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 a=t[l];st=a,Kd(a,e)}Xd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zd(e),e=e.sibling}function Zd(e){switch(e.tag){case 0:case 11:case 15:Qn(e),e.flags&2048&&Ql(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,Ks(e)):Qn(e);break;default:Qn(e)}}function Ks(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,Kd(a,e)}Xd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ql(8,t,t.return),Ks(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ks(t));break;default:Ks(t)}e=e.sibling}}function Kd(e,t){for(;st!==null;){var l=st;switch(l.tag){case 0:case 11:case 15:Ql(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Cn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,st=a;else e:for(l=e;st!==null;){a=st;var s=a.sibling,r=a.return;if(Bd(a),a===l){st=null;break e}if(s!==null){s.return=r,st=s;break e}st=r}}}var up={getCacheForType:function(e){var t=ct(We),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ct(We).controller.signal}},dp=typeof WeakMap=="function"?WeakMap:Map,we=0,Be=null,be=null,Se=0,Re=0,wt=null,Xl=!1,en=!1,lc=!1,kl=0,Xe=0,Zl=0,ka=0,ac=0,_t=0,tn=0,Xn=null,jt=null,nc=!1,Js=0,Jd=0,$s=1/0,Ws=null,Kl=null,lt=0,Jl=null,ln=null,Tl=0,sc=0,rc=null,$d=null,Zn=0,ic=null;function Rt(){return(we&2)!==0&&Se!==0?Se&-Se:E.T!==null?xc():uo()}function Wd(){if(_t===0)if((Se&536870912)===0||ke){var e=ol;ol<<=1,(ol&3932160)===0&&(ol=262144),_t=e}else _t=536870912;return e=Ct.current,e!==null&&(e.flags|=32),_t}function St(e,t,l){(e===Be&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(an(e,0),$l(e,Se,_t,!1)),ca(e,l),((we&2)===0||e!==Be)&&(e===Be&&((we&2)===0&&(ka|=l),Xe===4&&$l(e,Se,_t,!1)),al(e))}function Fd(e,t,l){if((we&6)!==0)throw Error(d(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Ml(e,t),s=a?mp(e,t):oc(e,t,!0),r=a;do{if(s===0){en&&!a&&$l(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!fp(l)){s=oc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var x=e;s=Xn;var j=x.current.memoizedState.isDehydrated;if(j&&(an(x,o).flags|=256),o=oc(x,o,!1),o!==2){if(lc&&!j){x.errorRecoveryDisabledLanes|=r,ka|=r,s=4;break e}r=jt,jt=s,r!==null&&(jt===null?jt=r:jt.push.apply(jt,r))}s=o}if(r=!1,s!==2)continue}}if(s===1){an(e,0),$l(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:$l(a,t,_t,!Xl);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(s=Js+300-ze(),10<s)){if($l(a,t,_t,!Xl),ia(a,0,!0)!==0)break e;Tl=t,a.timeoutHandle=wf(Id.bind(null,a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,"Throttled",-0,0),s);break e}Id(a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,null,-0,0)}}break}while(!0);al(e)}function Id(e,t,l,a,s,r,o,x,j,_,L,H,M,z){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dl},Qd(t,r,H);var te=(r&62914560)===r?Js-ze():(r&4194048)===r?Jd-ze():0;if(te=Wp(H,te),te!==null){Tl=r,e.cancelPendingCommit=te(rf.bind(null,e,t,r,l,a,s,o,x,j,L,H,null,M,z)),$l(e,r,o,!_);return}}rf(e,t,r,l,a,s,o,x,j)}function fp(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 a=0;a<l.length;a++){var s=l[a],r=s.getSnapshot;s=s.value;try{if(!kt(r(),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,a){t&=~ac,t&=~ka,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Ge(s),o=1<<r;a[r]=-1,s&=~o}l!==0&&io(e,l,t)}function Fs(){return(we&6)===0?(Kn(0),!1):!0}function cc(){if(be!==null){if(Re===0)var e=be.return;else e=be,pl=ha=null,Ei(e),Ka=null,wn=0,e=be;for(;e!==null;)wd(e.alternate,e),e=e.return;be=null}}function an(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Mp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Tl=0,cc(),Be=e,be=l=xl(e.current,null),Se=t,Re=0,wt=null,Xl=!1,en=Ml(e,t),lc=!1,tn=_t=ac=ka=Zl=Xe=0,jt=Xn=null,nc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Ge(a),r=1<<s;t|=e[s],a&=~r}return kl=t,ys(),l}function Pd(e,t){xe=null,E.H=Bn,t===Za||t===Ts?(t=pu(),Re=3):t===fi?(t=pu(),Re=4):Re=t===qi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wt=t,be===null&&(Xe=1,qs(e,Lt(t,e.current)))}function ef(){var e=Ct.current;return e===null?!0:(Se&4194048)===Se?qt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===qt:!1}function tf(){var e=E.H;return E.H=Bn,e===null?Bn:e}function lf(){var e=E.A;return E.A=up,e}function Is(){Xe=4,Xl||(Se&4194048)!==Se&&Ct.current!==null||(en=!0),(Zl&134217727)===0&&(ka&134217727)===0||Be===null||$l(Be,Se,_t,!1)}function oc(e,t,l){var a=we;we|=2;var s=tf(),r=lf();(Be!==e||Se!==t)&&(Ws=null,an(e,t)),t=!1;var o=Xe;e:do try{if(Re!==0&&be!==null){var x=be,j=wt;switch(Re){case 8:cc(),o=6;break e;case 3:case 2:case 9:case 6:Ct.current===null&&(t=!0);var _=Re;if(Re=0,wt=null,nn(e,x,j,_),l&&en){o=0;break e}break;default:_=Re,Re=0,wt=null,nn(e,x,j,_)}}xp(),o=Xe;break}catch(L){Pd(e,L)}while(!0);return t&&e.shellSuspendCounter++,pl=ha=null,we=a,E.H=s,E.A=r,be===null&&(Be=null,Se=0,ys()),o}function xp(){for(;be!==null;)af(be)}function mp(e,t){var l=we;we|=2;var a=tf(),s=lf();Be!==e||Se!==t?(Ws=null,$s=ze()+500,an(e,t)):en=Ml(e,t);e:do try{if(Re!==0&&be!==null){t=be;var r=wt;t:switch(Re){case 1:Re=0,wt=null,nn(e,t,r,1);break;case 2:case 9:if(xu(r)){Re=0,wt=null,nf(t);break}t=function(){Re!==2&&Re!==9||Be!==e||(Re=7),al(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:xu(r)?(Re=0,wt=null,nf(t)):(Re=0,wt=null,nn(e,t,r,7));break;case 5:var o=null;switch(be.tag){case 26:o=be.memoizedState;case 5:case 27:var x=be;if(o?Qf(o):x.stateNode.complete){Re=0,wt=null;var j=x.sibling;if(j!==null)be=j;else{var _=x.return;_!==null?(be=_,Ps(_)):be=null}break t}}Re=0,wt=null,nn(e,t,r,5);break;case 6:Re=0,wt=null,nn(e,t,r,6);break;case 8:cc(),Xe=6;break e;default:throw Error(d(462))}}pp();break}catch(L){Pd(e,L)}while(!0);return pl=ha=null,E.H=a,E.A=s,we=l,be!==null?0:(Be=null,Se=0,ys(),Xe)}function pp(){for(;be!==null&&!il();)af(be)}function af(e){var t=Cd(e.alternate,e,kl);e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function nf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=jd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=jd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Ei(t);default:wd(l,t),t=be=lu(t,kl),t=Cd(l,t,kl)}e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function nn(e,t,l,a){pl=ha=null,Ei(t),Ka=null,wn=0;var s=t.return;try{if(ap(e,s,t,l,Se)){Xe=1,qs(e,Lt(l,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Xe=1,qs(e,Lt(l,e.current)),be=null;return}t.flags&32768?(ke||a===1?e=!0:en||(Se&536870912)!==0?e=!1:(Xl=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ct.current,a!==null&&a.tag===13&&(a.flags|=16384))),sf(t,e)):Ps(t)}function Ps(e){var t=e;do{if((t.flags&32768)!==0){sf(t,Xl);return}e=t.return;var l=rp(t.alternate,t,kl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Xe===0&&(Xe=5)}function sf(e,t){do{var l=ip(e.alternate,e);if(l!==null){l.flags&=32767,be=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=l}while(e!==null);Xe=6,be=null}function rf(e,t,l,a,s,r,o,x,j){e.cancelPendingCommit=null;do er();while(lt!==0);if((we&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(r=t.lanes|t.childLanes,r|=Fr,Jx(e,l,r,o,x,j),e===Be&&(be=Be=null,Se=0),ln=t,Jl=e,Tl=l,sc=r,rc=s,$d=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gp(_e,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=E.T,E.T=null,s=A.p,A.p=2,o=we,we|=4;try{cp(e,t,l)}finally{we=o,A.p=s,E.T=a}}lt=1,cf(),of(),uf()}}function cf(){if(lt===1){lt=0;var e=Jl,t=ln,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=E.T,E.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Yd(t,e);var r=jc,o=Ko(e.containerInfo),x=r.focusedElem,j=r.selectionRange;if(o!==x&&x&&x.ownerDocument&&Zo(x.ownerDocument.documentElement,x)){if(j!==null&&Zr(x)){var _=j.start,L=j.end;if(L===void 0&&(L=_),"selectionStart"in x)x.selectionStart=_,x.selectionEnd=Math.min(L,x.value.length);else{var H=x.ownerDocument||document,M=H&&H.defaultView||window;if(M.getSelection){var z=M.getSelection(),te=x.textContent.length,oe=Math.min(j.start,te),Le=j.end===void 0?oe:Math.min(j.end,te);!z.extend&&oe>Le&&(o=Le,Le=oe,oe=o);var C=Xo(x,oe),k=Xo(x,Le);if(C&&k&&(z.rangeCount!==1||z.anchorNode!==C.node||z.anchorOffset!==C.offset||z.focusNode!==k.node||z.focusOffset!==k.offset)){var w=H.createRange();w.setStart(C.node,C.offset),z.removeAllRanges(),oe>Le?(z.addRange(w),z.extend(k.node,k.offset)):(w.setEnd(k.node,k.offset),z.addRange(w))}}}}for(H=[],z=x;z=z.parentNode;)z.nodeType===1&&H.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var U=H[x];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}fr=!!bc,jc=bc=null}finally{we=s,A.p=a,E.T=l}}e.current=t,lt=2}}function of(){if(lt===2){lt=0;var e=Jl,t=ln,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=E.T,E.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Ld(e,t.alternate,t)}finally{we=s,A.p=a,E.T=l}}lt=3}}function uf(){if(lt===4||lt===3){lt=0,I();var e=Jl,t=ln,l=Tl,a=$d;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,ln=Jl=null,df(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Kl=null),Cr(l),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(Mt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=E.T,s=A.p,A.p=2,E.T=null;try{for(var r=e.onRecoverableError,o=0;o<a.length;o++){var x=a[o];r(x.value,{componentStack:x.stack})}}finally{E.T=t,A.p=s}}(Tl&3)!==0&&er(),al(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===ic?Zn++:(Zn=0,ic=e):Zn=0,Kn(0)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cn(t)))}function er(){return cf(),of(),uf(),ff()}function ff(){if(lt!==5)return!1;var e=Jl,t=sc;sc=0;var l=Cr(Tl),a=E.T,s=A.p;try{A.p=32>l?32:l,E.T=null,l=rc,rc=null;var r=Jl,o=Tl;if(lt=0,ln=Jl=null,Tl=0,(we&6)!==0)throw Error(d(331));var x=we;if(we|=4,Zd(r.current),Vd(r,r.current,o,l),we=x,Kn(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(Mt,r)}catch{}return!0}finally{A.p=s,E.T=a,df(e,t)}}function xf(e,t,l){t=Lt(l,t),t=Hi(e.stateNode,t,2),e=Yl(e,t,2),e!==null&&(ca(e,2),al(e))}function Me(e,t,l){if(e.tag===3)xf(e,e,l);else for(;t!==null;){if(t.tag===3){xf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Kl===null||!Kl.has(a))){e=Lt(l,e),l=xd(2),a=Yl(t,l,2),a!==null&&(md(l,a,t,e),ca(a,2),al(a));break}}t=t.return}}function uc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new dp;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(lc=!0,s.add(l),e=hp.bind(null,e,t,l),t.then(e,e))}function hp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Be===e&&(Se&l)===l&&(Xe===4||Xe===3&&(Se&62914560)===Se&&300>ze()-Js?(we&2)===0&&an(e,0):ac|=l,tn===Se&&(tn=0)),al(e)}function mf(e,t){t===0&&(t=fn()),e=xa(e,t),e!==null&&(ca(e,t),al(e))}function vp(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),mf(e,l)}function yp(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),mf(e,l)}function gp(e,t){return Vt(e,t)}var tr=null,sn=null,dc=!1,lr=!1,fc=!1,Wl=0;function al(e){e!==sn&&e.next===null&&(sn===null?tr=sn=e:sn=sn.next=e),lr=!0,dc||(dc=!0,jp())}function Kn(e,t){if(!fc&&lr){fc=!0;do for(var l=!1,a=tr;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var o=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-Ge(42|e)+1)-1,r&=s&~(o&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,yf(a,r))}else r=Se,r=ia(a,a===Be?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||Ml(a,r)||(l=!0,yf(a,r));a=a.next}while(l);fc=!1}}function bp(){pf()}function pf(){lr=dc=!1;var e=0;Wl!==0&&Rp()&&(e=Wl);for(var t=ze(),l=null,a=tr;a!==null;){var s=a.next,r=hf(a,t);r===0?(a.next=null,l===null?tr=s:l.next=s,s===null&&(sn=l)):(l=a,(e!==0||(r&3)!==0)&&(lr=!0)),a=s}lt!==0&<!==5||Kn(e),Wl!==0&&(Wl=0)}function hf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var o=31-Ge(r),x=1<<o,j=s[o];j===-1?((x&l)===0||(x&a)!==0)&&(s[o]=rs(x,t)):j<=t&&(e.expiredLanes|=x),r&=~x}if(t=Be,l=Se,l=ia(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Rl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ml(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Rl(a),Cr(l)){case 2:case 8:l=$;break;case 32:l=_e;break;case 268435456:l=Nt;break;default:l=_e}return a=vf.bind(null,e),l=Vt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Rl(a),e.callbackPriority=2,e.callbackNode=null,2}function vf(e,t){if(lt!==0&<!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(er()&&e.callbackNode!==l)return null;var a=Se;return a=ia(e,e===Be?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Fd(e,a,t),hf(e,ze()),e.callbackNode!=null&&e.callbackNode===l?vf.bind(null,e):null)}function yf(e,t){if(er())return null;Fd(e,t,!0)}function jp(){zp(function(){(we&6)!==0?Vt(Qt,bp):pf()})}function xc(){if(Wl===0){var e=Qa;e===0&&(e=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Wl=e}return Wl}function gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:us(""+e)}function bf(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 Sp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=gf((s[ht]||null).action),o=a.submitter;o&&(t=(t=o[ht]||null)?gf(t.formAction):o.getAttribute("formAction"),t!==null&&(r=t,o=null));var x=new ms("action","action",null,a,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Wl!==0){var j=o?bf(s,o):new FormData(s);zi(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(x.preventDefault(),j=o?bf(s,o):new FormData(s),zi(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var mc=0;mc<Wr.length;mc++){var pc=Wr[mc],Np=pc.toLowerCase(),Ep=pc[0].toUpperCase()+pc.slice(1);Zt(Np,"on"+Ep)}Zt(Wo,"onAnimationEnd"),Zt(Fo,"onAnimationIteration"),Zt(Io,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(qm,"onTransitionRun"),Zt(Ym,"onTransitionStart"),Zt(Gm,"onTransitionCancel"),Zt(Po,"onTransitionEnd"),_a("onMouseEnter",["mouseout","mouseover"]),_a("onMouseLeave",["mouseout","mouseover"]),_a("onPointerEnter",["pointerout","pointerover"]),_a("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),kp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function jf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var o=a.length-1;0<=o;o--){var x=a[o],j=x.instance,_=x.currentTarget;if(x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}else for(o=0;o<a.length;o++){if(x=a[o],j=x.instance,_=x.currentTarget,x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}}}}function je(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var a=e+"__bubble";l.has(a)||(Sf(t,e,2,!1),l.add(a))}function hc(e,t,l){var a=0;t&&(a|=4),Sf(l,e,a,t)}var ar="_reactListening"+Math.random().toString(36).slice(2);function vc(e){if(!e[ar]){e[ar]=!0,mo.forEach(function(l){l!=="selectionchange"&&(kp.has(l)||hc(l,!1,e),hc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ar]||(t[ar]=!0,hc("selectionchange",!1,t))}}function Sf(e,t,l,a){switch(Ff(t)){case 2:var s=Pp;break;case 8:s=eh;break;default:s=Mc}l=s.bind(null,t,l,e),s=void 0,!Br||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?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 yc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var o=a.tag;if(o===3||o===4){var x=a.stateNode.containerInfo;if(x===s)break;if(o===4)for(o=a.return;o!==null;){var j=o.tag;if((j===3||j===4)&&o.stateNode.containerInfo===s)return;o=o.return}for(;x!==null;){if(o=Ca(x),o===null)return;if(j=o.tag,j===5||j===6||j===26||j===27){a=r=o;continue e}x=x.parentNode}}a=a.return}To(function(){var _=r,L=Dr(l),H=[];e:{var M=eu.get(e);if(M!==void 0){var z=ms,te=e;switch(e){case"keypress":if(fs(l)===0)break e;case"keydown":case"keyup":z=ym;break;case"focusin":te="focus",z=Yr;break;case"focusout":te="blur",z=Yr;break;case"beforeblur":case"afterblur":z=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":z=wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=rm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=jm;break;case Wo:case Fo:case Io:z=om;break;case Po:z=Nm;break;case"scroll":case"scrollend":z=nm;break;case"wheel":z=km;break;case"copy":case"cut":case"paste":z=dm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Ro;break;case"toggle":case"beforetoggle":z=Cm}var oe=(t&4)!==0,Le=!oe&&(e==="scroll"||e==="scrollend"),C=oe?M!==null?M+"Capture":null:M;oe=[];for(var k=_,w;k!==null;){var U=k;if(w=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||w===null||C===null||(U=hn(k,C),U!=null&&oe.push($n(k,U,w))),Le)break;k=k.return}0<oe.length&&(M=new z(M,te,null,l,L),H.push({event:M,listeners:oe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",z=e==="mouseout"||e==="pointerout",M&&l!==Or&&(te=l.relatedTarget||l.fromElement)&&(Ca(te)||te[Ta]))break e;if((z||M)&&(M=L.window===L?L:(M=L.ownerDocument)?M.defaultView||M.parentWindow:window,z?(te=l.relatedTarget||l.toElement,z=_,te=te?Ca(te):null,te!==null&&(Le=h(te),oe=te.tag,te!==Le||oe!==5&&oe!==27&&oe!==6)&&(te=null)):(z=null,te=_),z!==te)){if(oe=wo,U="onMouseLeave",C="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(oe=Ro,U="onPointerLeave",C="onPointerEnter",k="pointer"),Le=z==null?M:pn(z),w=te==null?M:pn(te),M=new oe(U,k+"leave",z,l,L),M.target=Le,M.relatedTarget=w,U=null,Ca(L)===_&&(oe=new oe(C,k+"enter",te,l,L),oe.target=w,oe.relatedTarget=Le,U=oe),Le=U,z&&te)t:{for(oe=Tp,C=z,k=te,w=0,U=C;U;U=oe(U))w++;U=0;for(var ie=k;ie;ie=oe(ie))U++;for(;0<w-U;)C=oe(C),w--;for(;0<U-w;)k=oe(k),U--;for(;w--;){if(C===k||k!==null&&C===k.alternate){oe=C;break t}C=oe(C),k=oe(k)}oe=null}else oe=null;z!==null&&Nf(H,M,z,oe,!1),te!==null&&Le!==null&&Nf(H,Le,te,oe,!0)}}e:{if(M=_?pn(_):window,z=M.nodeName&&M.nodeName.toLowerCase(),z==="select"||z==="input"&&M.type==="file")var Ce=Ho;else if(Bo(M))if(qo)Ce=Bm;else{Ce=Dm;var ne=Om}else z=M.nodeName,!z||z.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?_&&zr(_.elementType)&&(Ce=Ho):Ce=Lm;if(Ce&&(Ce=Ce(e,_))){Uo(H,Ce,l,L);break e}ne&&ne(e,M,_),e==="focusout"&&_&&M.type==="number"&&_.memoizedProps.value!=null&&Mr(M,"number",M.value)}switch(ne=_?pn(_):window,e){case"focusin":(Bo(ne)||ne.contentEditable==="true")&&(La=ne,Kr=_,En=null);break;case"focusout":En=Kr=La=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Jo(H,l,L);break;case"selectionchange":if(Hm)break;case"keydown":case"keyup":Jo(H,l,L)}var me;if(Vr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Da?Do(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(Mo&&l.locale!=="ko"&&(Da||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Da&&(me=Co()):(Ol=L,Ur="value"in Ol?Ol.value:Ol.textContent,Da=!0)),ne=nr(_,Ne),0<ne.length&&(Ne=new _o(Ne,e,null,l,L),H.push({event:Ne,listeners:ne}),me?Ne.data=me:(me=Lo(l),me!==null&&(Ne.data=me)))),(me=wm?_m(e,l):Rm(e,l))&&(Ne=nr(_,"onBeforeInput"),0<Ne.length&&(ne=new _o("onBeforeInput","beforeinput",null,l,L),H.push({event:ne,listeners:Ne}),ne.data=me)),Sp(H,e,_,l,L)}jf(H,t)})}function $n(e,t,l){return{instance:e,listener:t,currentTarget:l}}function nr(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=hn(e,l),s!=null&&a.unshift($n(e,s,r)),s=hn(e,t),s!=null&&a.push($n(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nf(e,t,l,a,s){for(var r=t._reactName,o=[];l!==null&&l!==a;){var x=l,j=x.alternate,_=x.stateNode;if(x=x.tag,j!==null&&j===a)break;x!==5&&x!==26&&x!==27||_===null||(j=_,s?(_=hn(l,r),_!=null&&o.unshift($n(l,_,j))):s||(_=hn(l,r),_!=null&&o.push($n(l,_,j)))),l=l.return}o.length!==0&&e.push({event:t,listeners:o})}var Cp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function Ef(e){return(typeof e=="string"?e:""+e).replace(Cp,`
|
|
49
|
-
`).replace(Ap,"")}function kf(e,t){return t=Ef(t),Ef(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ma(e,""+a);break;case"className":cs(e,"class",a);break;case"tabIndex":cs(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(e,l,a);break;case"style":Eo(e,a,r);break;case"data":if(t!=="object"){cs(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="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 r=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=dl);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=us(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":je("beforetoggle",e),je("toggle",e),is(e,"popover",a);break;case"xlinkActuate":ul(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ul(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ul(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ul(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ul(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ul(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ul(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ul(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ul(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":is(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=lm.get(l)||l,is(e,l,a))}}function gc(e,t,l,a,s,r){switch(l){case"style":Eo(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&Ma(e,""+a);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"onClick":a!=null&&(e.onclick=dl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!po.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),r=e[ht]||null,r=r!=null?r[l]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):is(e,l,a)}}}function ut(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var o=l[r];if(o!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,r,o,l,null)}}s&&De(e,t,"srcSet",l.srcSet,l,null),a&&De(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var x=r=o=s=null,j=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":s=L;break;case"type":o=L;break;case"checked":j=L;break;case"defaultChecked":_=L;break;case"value":r=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(d(137,t));break;default:De(e,t,a,L,l,null)}}bo(e,r,x,j,_,o,s,!1);return;case"select":je("invalid",e),a=o=r=null;for(s in l)if(l.hasOwnProperty(s)&&(x=l[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":o=x;break;case"multiple":a=x;default:De(e,t,s,x,l,null)}t=r,l=o,e.multiple=!!a,t!=null?Ra(e,!!a,t,!1):l!=null&&Ra(e,!!a,l,!0);return;case"textarea":je("invalid",e),r=s=a=null;for(o in l)if(l.hasOwnProperty(o)&&(x=l[o],x!=null))switch(o){case"value":a=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(d(91));break;default:De(e,t,o,x,l,null)}So(e,a,s,r);return;case"option":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:De(e,t,j,a,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(a=0;a<Jn.length;a++)je(Jn[a],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,_,a,l,null)}return;default:if(zr(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&gc(e,t,L,a,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(a=l[x],a!=null&&De(e,t,x,a,l,null))}function wp(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,o=null,x=null,j=null,_=null,L=null;for(z in l){var H=l[z];if(l.hasOwnProperty(z)&&H!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":j=H;default:a.hasOwnProperty(z)||De(e,t,z,null,a,H)}}for(var M in a){var z=a[M];if(H=l[M],a.hasOwnProperty(M)&&(z!=null||H!=null))switch(M){case"type":r=z;break;case"name":s=z;break;case"checked":_=z;break;case"defaultChecked":L=z;break;case"value":o=z;break;case"defaultValue":x=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(d(137,t));break;default:z!==H&&De(e,t,M,z,a,H)}}Rr(e,o,x,j,_,L,r,s);return;case"select":z=o=x=M=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":z=j;default:a.hasOwnProperty(r)||De(e,t,r,null,a,j)}for(s in a)if(r=a[s],j=l[s],a.hasOwnProperty(s)&&(r!=null||j!=null))switch(s){case"value":M=r;break;case"defaultValue":x=r;break;case"multiple":o=r;default:r!==j&&De(e,t,s,r,a,j)}t=x,l=o,a=z,M!=null?Ra(e,!!l,M,!1):!!a!=!!l&&(t!=null?Ra(e,!!l,t,!0):Ra(e,!!l,l?[]:"",!1));return;case"textarea":z=M=null;for(x in l)if(s=l[x],l.hasOwnProperty(x)&&s!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:De(e,t,x,null,a,s)}for(o in a)if(s=a[o],r=l[o],a.hasOwnProperty(o)&&(s!=null||r!=null))switch(o){case"value":M=s;break;case"defaultValue":z=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(d(91));break;default:s!==r&&De(e,t,o,s,a,r)}jo(e,M,z);return;case"option":for(var te in l)if(M=l[te],l.hasOwnProperty(te)&&M!=null&&!a.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:De(e,t,te,null,a,M)}for(j in a)if(M=a[j],z=l[j],a.hasOwnProperty(j)&&M!==z&&(M!=null||z!=null))switch(j){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:De(e,t,j,M,a,z)}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 oe in l)M=l[oe],l.hasOwnProperty(oe)&&M!=null&&!a.hasOwnProperty(oe)&&De(e,t,oe,null,a,M);for(_ in a)if(M=a[_],z=l[_],a.hasOwnProperty(_)&&M!==z&&(M!=null||z!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(d(137,t));break;default:De(e,t,_,M,a,z)}return;default:if(zr(t)){for(var Le in l)M=l[Le],l.hasOwnProperty(Le)&&M!==void 0&&!a.hasOwnProperty(Le)&&gc(e,t,Le,void 0,a,M);for(L in a)M=a[L],z=l[L],!a.hasOwnProperty(L)||M===z||M===void 0&&z===void 0||gc(e,t,L,M,a,z);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!a.hasOwnProperty(C)&&De(e,t,C,null,a,M);for(H in a)M=a[H],z=l[H],!a.hasOwnProperty(H)||M===z||M==null&&z==null||De(e,t,H,M,a,z)}function Tf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],r=s.transferSize,o=s.initiatorType,x=s.duration;if(r&&x&&Tf(o)){for(o=0,x=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],_=j.startTime;if(_>x)break;var L=j.transferSize,H=j.initiatorType;L&&Tf(H)&&(j=j.responseEnd,o+=L*(j<x?1:(x-_)/(j-_)))}if(--a,t+=8*(r+o)/(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 bc=null,jc=null;function sr(e){return e.nodeType===9?e:e.ownerDocument}function Cf(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 Sc(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 Nc=null;function Rp(){var e=window.event;return e&&e.type==="popstate"?e===Nc?!1:(Nc=e,!0):(Nc=null,!1)}var wf=typeof setTimeout=="function"?setTimeout:void 0,Mp=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,zp=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(Op)}:wf;function Op(e){setTimeout(function(){throw e})}function Fl(e){return e==="head"}function Rf(e,t){var l=t,a=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(s),un(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Wn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wn(l);for(var r=l.firstChild;r;){var o=r.nextSibling,x=r.nodeName;r[mn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=o}}else l==="body"&&Wn(e.ownerDocument.body);l=s}while(l);un(t)}function Mf(e,t){var l=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ec(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":Ec(l),wr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Dp(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[mn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==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(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function Lp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function zf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function kc(e){return e.data==="$?"||e.data==="$~"}function Tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bp(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(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 Cc=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Df(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 Lf(e,t,l){switch(t=sr(l),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Wn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wr(e)}var Gt=new Map,Bf=new Set;function rr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cl=A.d;A.d={f:Up,r:Hp,D:qp,C:Yp,L:Gp,m:Vp,X:Xp,S:Qp,M:Zp};function Up(){var e=Cl.f(),t=Fs();return e||t}function Hp(e){var t=Aa(e);t!==null&&t.tag===5&&t.type==="form"?Pu(t):Cl.r(e)}var rn=typeof document>"u"?null:document;function Uf(e,t,l){var a=rn;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Bf.has(s)||(Bf.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function qp(e){Cl.D(e),Uf("dns-prefetch",e,null)}function Yp(e,t){Cl.C(e,t),Uf("preconnect",e,t)}function Gp(e,t,l){Cl.L(e,t,l);var a=rn;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=cn(e);break;case"script":r=on(e)}Gt.has(r)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Gt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Fn(r))||t==="script"&&a.querySelector(In(r))||(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function Vp(e,t){Cl.m(e,t);var l=rn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=on(e)}if(!Gt.has(r)&&(e=b({rel:"modulepreload",href:e},t),Gt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(In(r)))return}a=l.createElement("link"),ut(a,"link",e),nt(a),l.head.appendChild(a)}}}function Qp(e,t,l){Cl.S(e,t,l);var a=rn;if(a&&e){var s=wa(a).hoistableStyles,r=cn(e);t=t||"default";var o=s.get(r);if(!o){var x={loading:0,preload:null};if(o=a.querySelector(Fn(r)))x.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Gt.get(r))&&Ac(e,l);var j=o=a.createElement("link");nt(j),ut(j,"link",e),j._p=new Promise(function(_,L){j.onload=_,j.onerror=L}),j.addEventListener("load",function(){x.loading|=1}),j.addEventListener("error",function(){x.loading|=2}),x.loading|=4,ir(o,t,a)}o={type:"stylesheet",instance:o,count:1,state:x},s.set(r,o)}}}function Xp(e,t){Cl.X(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=b({src:e,async:!0},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Zp(e,t){Cl.M(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=b({src:e,async:!0,type:"module"},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Hf(e,t,l,a){var s=(s=V.current)?rr(s):null;if(!s)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=cn(l.href),l=wa(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=cn(l.href);var r=wa(s).hoistableStyles,o=r.get(e);if(o||(s=s.ownerDocument||s,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,o),(r=s.querySelector(Fn(e)))&&!r._p&&(o.instance=r,o.state.loading=5),Gt.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},Gt.set(e,l),r||Kp(s,e,l,o.state))),t&&a===null)throw Error(d(528,""));return o}if(t&&a!==null)throw Error(d(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,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function cn(e){return'href="'+Ot(e)+'"'}function Fn(e){return'link[rel="stylesheet"]['+e+"]"}function qf(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Kp(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",l),nt(t),e.head.appendChild(t))}function on(e){return'[src="'+Ot(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 a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,nt(a),a;var s=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),nt(a),ut(a,"style",s),ir(a,l.precedence,e),t.instance=a;case"stylesheet":s=cn(l.href);var r=e.querySelector(Fn(s));if(r)return t.state.loading|=4,t.instance=r,nt(r),r;a=qf(l),(s=Gt.get(s))&&Ac(a,s),r=(e.ownerDocument||e).createElement("link"),nt(r);var o=r;return o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),t.state.loading|=4,ir(r,l.precedence,e),t.instance=r;case"script":return r=on(l.src),(s=e.querySelector(In(r)))?(t.instance=s,nt(s),s):(a=l,(s=Gt.get(r))&&(a=b({},l),wc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),nt(s),ut(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ir(a,l.precedence,e));return t.instance}function ir(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,o=0;o<a.length;o++){var x=a[o];if(x.dataset.precedence===t)r=x;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cr=null;function Gf(e,t,l){if(cr===null){var a=new Map,s=cr=new Map;s.set(l,a)}else s=cr,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var r=l[s];if(!(r[mn]||r[rt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var o=r.getAttribute(t)||"";o=e+o;var x=a.get(o);x?x.push(r):a.set(o,[r])}}return a}function Vf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Jp(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 Qf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $p(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=cn(a.href),r=t.querySelector(Fn(s));if(r){t=r._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=r,nt(r);return}r=t.ownerDocument||t,a=qf(a),(s=Gt.get(s))&&Ac(a,s),r=r.createElement("link"),nt(r);var o=r;o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),l.instance=r}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 _c=0;function Wp(e,t){return e.stylesheets&&e.count===0&&dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*_p());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ur=null;function dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ur=new Map,t.forEach(Fp,e),ur=null,or.call(e))}function Fp(e,t){if(!(t.state.loading&4)){var l=ur.get(e);if(l)var a=l.get(null);else{l=new Map,ur.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var o=s[r];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(l.set(o.dataset.precedence,o),a=o)}a&&l.set(null,a)}s=t.instance,o=s.getAttribute("data-precedence"),r=l.get(o)||a,r===a&&l.set(null,s),l.set(o,s),this.count++,a=or.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:se,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Ip(e,t,l,a,s,r,o,x,j){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=xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.hiddenUpdates=xn(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Xf(e,t,l,a,s,r,o,x,j,_,L,H){return e=new Ip(e,t,l,o,j,_,L,H,x),t=1,r===!0&&(t|=24),r=Tt(3,null,null,t),e.current=r,r.stateNode=e,t=oi(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},xi(r),e}function Zf(e){return e?(e=Ha,e):Ha}function Kf(e,t,l,a,s,r){s=Zf(s),a.context===null?a.context=s:a.pendingContext=s,a=ql(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Yl(e,a,t),l!==null&&(St(l,e,t),Rn(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 Rc(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function $f(e){if(e.tag===13||e.tag===31){var t=xa(e,67108864);t!==null&&St(t,e,67108864),Rc(e,67108864)}}function Wf(e){if(e.tag===13||e.tag===31){var t=Rt();t=Tr(t);var l=xa(e,t);l!==null&&St(l,e,t),Rc(e,t)}}var fr=!0;function Pp(e,t,l,a){var s=E.T;E.T=null;var r=A.p;try{A.p=2,Mc(e,t,l,a)}finally{A.p=r,E.T=s}}function eh(e,t,l,a){var s=E.T;E.T=null;var r=A.p;try{A.p=8,Mc(e,t,l,a)}finally{A.p=r,E.T=s}}function Mc(e,t,l,a){if(fr){var s=zc(a);if(s===null)yc(e,t,a,xr,l),If(e,a);else if(lh(s,e,t,l,a))a.stopPropagation();else if(If(e,a),t&4&&-1<th.indexOf(e)){for(;s!==null;){var r=Aa(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var o=Pt(r.pendingLanes);if(o!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;o;){var j=1<<31-Ge(o);x.entanglements[1]|=j,o&=~j}al(r),(we&6)===0&&($s=ze()+500,Kn(0))}}break;case 31:case 13:x=xa(r,2),x!==null&&St(x,r,2),Fs(),Rc(r,2)}if(r=zc(a),r===null&&yc(e,t,a,xr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else yc(e,t,a,null,l)}}function zc(e){return e=Dr(e),Oc(e)}var xr=null;function Oc(e){if(xr=null,e=Ca(e),e!==null){var t=h(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=y(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 xr=e,null}function Ff(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(mt()){case Qt:return 2;case $:return 8;case _e:case Xt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Dc=!1,Il=null,Pl=null,ea=null,es=new Map,ts=new Map,ta=[],th="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 If(e,t){switch(e){case"focusin":case"focusout":Il=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function ls(e,t,l,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Aa(t),t!==null&&$f(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lh(e,t,l,a,s){switch(t){case"focusin":return Il=ls(Il,e,t,l,a,s),!0;case"dragenter":return Pl=ls(Pl,e,t,l,a,s),!0;case"mouseover":return ea=ls(ea,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return es.set(r,ls(es.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,ts.set(r,ls(ts.get(r)||null,e,t,l,a,s)),!0}return!1}function Pf(e){var t=Ca(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(l)});return}}else if(t===31){if(t=y(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(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 mr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=zc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Or=a,l.target.dispatchEvent(a),Or=null}else return t=Aa(l),t!==null&&$f(t),e.blockedOn=l,!1;t.shift()}return!0}function ex(e,t,l){mr(e)&&l.delete(t)}function ah(){Dc=!1,Il!==null&&mr(Il)&&(Il=null),Pl!==null&&mr(Pl)&&(Pl=null),ea!==null&&mr(ea)&&(ea=null),es.forEach(ex),ts.forEach(ex)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,ah)))}var hr=null;function tx(e){hr!==e&&(hr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){hr===e&&(hr=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(Oc(a||l)===null)continue;break}var r=Aa(l);r!==null&&(e.splice(t,3),t-=3,zi(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function un(e){function t(j){return pr(j,e)}Il!==null&&pr(Il,e),Pl!==null&&pr(Pl,e),ea!==null&&pr(ea,e),es.forEach(t),ts.forEach(t);for(var l=0;l<ta.length;l++){var a=ta[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ta.length&&(l=ta[0],l.blockedOn===null);)Pf(l),l.blockedOn===null&&ta.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],o=s[ht]||null;if(typeof r=="function")o||tx(l);else if(o){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,o=r[ht]||null)x=o.formAction;else if(Oc(s)!==null)continue}else x=o.action;typeof x=="function"?l[a+1]=x:(l.splice(a,3),a-=3),tx(l)}}}function lx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(o){return s=o})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Lc(e){this._internalRoot=e}vr.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var l=t.current,a=Rt();Kf(l,a,e,t,null,null)},vr.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kf(e.current,2,null,e,null,null),Fs(),t[Ta]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=uo();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ta.length&&t!==0&&t<ta[l].priority;l++);ta.splice(l,0,e),l===0&&Pf(e)}};var ax=c.version;if(ax!=="19.2.4")throw Error(d(527,ax,"19.2.4"));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=f(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var nh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yr.isDisabled&&yr.supportsFiber)try{Mt=yr.inject(nh),Ve=yr}catch{}}return ns.createRoot=function(e,t){if(!m(e))throw Error(d(299));var l=!1,a="",s=od,r=ud,o=dd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Xf(e,1,!1,null,null,l,a,null,s,r,o,lx),e[Ta]=t.current,vc(e),new Lc(t)},ns.hydrateRoot=function(e,t,l){if(!m(e))throw Error(d(299));var a=!1,s="",r=od,o=ud,x=dd,j=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(o=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Xf(e,1,!0,t,l??null,a,s,j,r,o,x,lx),t.context=Zf(null),l=t.current,a=Rt(),a=Tr(a),s=ql(a),s.callback=null,Yl(l,s,a),l=a,t.current.lanes=l,ca(t,l),al(t),e[Ta]=t.current,vc(e),new vr(t)},ns.version="19.2.4",ns}var xx;function mh(){if(xx)return Hc.exports;xx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Hc.exports=xh(),Hc.exports}var ph=mh();const zx="";class Ox extends Error{constructor(c,u){super(c),this.name="ApiError",this.status=u}}async function qe(i,c){const u=await fetch(`${zx}${i}`,c);if(!u.ok){const d=await u.json().catch(()=>({error:u.statusText}));throw new Ox(d.error||`HTTP ${u.status}`,u.status)}return u.json()}const Te={getConfig(){return qe("/api/config")},setConfig(i,c){return qe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:c})})},getSkills(){return qe("/api/skills")},getSkillDetail(i,c){return qe(`/api/skills/${i}/${c}`)},getEvals(i,c){return qe(`/api/skills/${i}/${c}/evals`)},saveEvals(i,c,u){return qe(`/api/skills/${i}/${c}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})},generateEvals(i,c){return qe(`/api/skills/${i}/${c}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,c){const u=await fetch(`${zx}/api/skills/${i}/${c}/benchmark/latest`);if(u.status===404)return null;if(!u.ok){const d=await u.json().catch(()=>({error:u.statusText}));throw new Ox(d.error||`HTTP ${u.status}`,u.status)}return u.json()},getHistory(i,c,u){const d=new URLSearchParams;u!=null&&u.model&&d.set("model",u.model),u!=null&&u.type&&d.set("type",u.type),u!=null&&u.from&&d.set("from",u.from),u!=null&&u.to&&d.set("to",u.to);const m=d.toString();return qe(`/api/skills/${i}/${c}/history${m?"?"+m:""}`)},getHistoryEntry(i,c,u){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(u)}`)},compareRuns(i,c,u,d){return qe(`/api/skills/${i}/${c}/history-compare?a=${encodeURIComponent(u)}&b=${encodeURIComponent(d)}`)},getCaseHistory(i,c,u,d){const m=new URLSearchParams;d&&m.set("model",d);const h=m.toString();return qe(`/api/skills/${i}/${c}/history/case/${u}${h?"?"+h:""}`)},deleteHistoryEntry(i,c,u){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(u)}`,{method:"DELETE"})},deleteSkill(i,c){return qe(`/api/skills/${i}/${c}`,{method:"DELETE"})},improveSkill(i,c,u){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})},instructEdit(i,c,u){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...u})})},applyImprovement(i,c,u){return qe(`/api/skills/${i}/${c}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:u})})},getStats(i,c){return qe(`/api/skills/${i}/${c}/stats`)},getDependencies(i,c){return qe(`/api/skills/${i}/${c}/dependencies`)},getProjectLayout(){return qe("/api/project-layout")},createSkill(i){return qe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return qe("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return qe("/api/skill-creator-status")},generateSkill(i){return qe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,c){return qe(`/api/skills/${i}/${c}/files`)},getSkillFile(i,c,u){return qe(`/api/skills/${i}/${c}/file?path=${encodeURIComponent(u)}`)}};function hh(i){const[c,u]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const d=window.matchMedia(i);u(d.matches);const m=h=>u(h.matches);return d.addEventListener("change",m),()=>d.removeEventListener("change",m)},[i]),c}const vh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function yh(i,c){switch(c.type){case"SELECT_SKILL":return{...i,selectedSkill:c.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:c.mode,selectedSkill:c.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:c.query};case"SET_SKILLS":return{...i,skills:c.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:c.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:c.loading};case"SET_MOBILE":return{...i,isMobile:c.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:c.view};default:return i}}const Dx=v.createContext(null);function sa(){const i=v.useContext(Dx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function gh({children:i}){const[c,u]=v.useReducer(yh,vh),d=hh("(max-width: 767px)");v.useEffect(()=>{u({type:"SET_MOBILE",isMobile:d})},[d]);const m=v.useCallback(()=>{u({type:"SET_SKILLS_LOADING",loading:!0}),Te.getSkills().then(b=>{u({type:"SET_SKILLS",skills:b});const O=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(O){const[,B,q]=O,Q=b.find(K=>K.plugin===B&&K.skill===q);Q&&u({type:"SELECT_SKILL",skill:{plugin:B,skill:q,origin:Q.origin}})}}).catch(b=>u({type:"SET_SKILLS_ERROR",error:b.message}))},[]);v.useEffect(()=>{m()},[m]);const h=v.useCallback(b=>{u({type:"SELECT_SKILL",skill:b}),window.location.hash=`/skills/${b.plugin}/${b.skill}`},[]),p=v.useCallback(()=>{u({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),y=v.useCallback(b=>{u({type:"SET_MODE",mode:b})},[]),g=v.useCallback(b=>{u({type:"SET_SEARCH",query:b})},[]),f=v.useCallback(b=>{u({type:"SET_MOBILE_VIEW",view:b})},[]),S=v.useMemo(()=>({state:c,selectSkill:h,clearSelection:p,setMode:y,setSearch:g,setMobileView:f,refreshSkills:m}),[c,h,p,y,g,f,m]);return n.jsx(Dx.Provider,{value:S,children:i})}const bh={config:null,loading:!0};function jh(i,c){switch(c.type){case"SET_CONFIG":return{config:c.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const Lx=v.createContext(null);function dn(){const i=v.useContext(Lx);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function Sh({children:i}){const[c,u]=v.useReducer(jh,bh),d=v.useCallback(()=>{Te.getConfig().then(p=>u({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);v.useEffect(()=>{d()},[d]);const m=v.useCallback(async(p,y)=>{const g=await Te.setConfig(p,y);return u({type:"SET_CONFIG",config:g}),g},[]),h=v.useMemo(()=>({config:c.config,loading:c.loading,updateConfig:m,refreshConfig:d}),[c,m,d]);return n.jsx(Lx.Provider,{value:h,children:i})}function Nh({left:i,right:c}){const{state:u}=sa();return u.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:u.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:c})}):n.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:i}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:c})]})}function Eh(){const{state:i,setSearch:c}=sa(),[u,d]=v.useState(i.searchQuery),m=v.useRef(null);v.useEffect(()=>(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c(u)},200),()=>{m.current&&clearTimeout(m.current)}),[u,c]),v.useEffect(()=>{i.searchQuery===""&&u!==""&&d("")},[i.searchQuery]);const h=new Set(i.skills.map(p=>p.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.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:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:u,onChange:p=>d(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)"}}),u&&n.jsx("button",{onClick:()=>{d(""),c("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!i.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[i.skills.length," skill",i.skills.length!==1?"s":""," across ",h," plugin",h!==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 px({skill:i,isSelected:c,onSelect:u}){const d=mx[i.benchmarkStatus]||mx.missing,m=i.origin==="installed";return n.jsxs("button",{onClick:u,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:m?.7:1},onMouseEnter:h=>{c||(h.currentTarget.style.background="var(--surface-2)")},onMouseLeave:h=>{c||(h.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[m&&n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.skill]}),n.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:d.bg,color:d.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:d.dot}}),d.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[i.evalCount," eval",i.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[i.assertionCount," assert",i.assertionCount!==1?"s":""]}),i.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(i.lastBenchmark).toLocaleDateString()})]})]})]})}function hx(i){var u;const c={};for(const d of i)(c[u=d.plugin]||(c[u]=[])).push(d);return c}function kh(){const{state:i,selectSkill:c}=sa(),{skills:u,searchQuery:d,selectedSkill:m}=i,[h,p]=v.useState(!1),[y,g]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:S}=v.useMemo(()=>{const b=d.toLowerCase(),T=b?u.filter(q=>q.skill.toLowerCase().includes(b)||q.plugin.toLowerCase().includes(b)):u,O=T.filter(q=>q.origin==="source"),B=T.filter(q=>q.origin==="installed");return{sourceGroups:Object.entries(hx(O)),installedGroups:Object.entries(hx(B))}},[u,d]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(b=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},b))}):f.length===0&&S.length===0?n.jsx("div",{className:"px-4 py-8 text-center",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):n.jsxs("div",{className:"flex-1",children:[f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Th,{title:"Your Skills",count:f.reduce((b,[,T])=>b+T.length,0)}),f.map(([b,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:b,count:T.length}),T.map(O=>{const B=(m==null?void 0:m.plugin)===O.plugin&&(m==null?void 0:m.skill)===O.skill;return n.jsx(px,{skill:O,isSelected:B,onSelect:()=>c({plugin:O.plugin,skill:O.skill,origin:O.origin})},`${O.plugin}/${O.skill}`)})]},b))]}),S.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>p(b=>!b),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:h?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[n.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:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",S.reduce((b,[,T])=>b+T.length,0),")"]}),n.jsx("div",{className:"flex-1"}),n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),h&&n.jsxs(n.Fragment,{children:[!y&&n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.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."}),n.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:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),S.map(([b,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:b,count:T.length}),T.map(O=>{const B=(m==null?void 0:m.plugin)===O.plugin&&(m==null?void 0:m.skill)===O.skill;return n.jsx(px,{skill:O,isSelected:B,onSelect:()=>c({plugin:O.plugin,skill:O.skill,origin:O.origin})},`${O.plugin}/${O.skill}`)})]},b))]})]})]})}function Th({title:i,count:c}){return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]})]})}function vx({plugin:i,count:c}){const[u,d]=v.useState(!1),m=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u?n.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:n.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"})}):n.jsx("img",{src:m,width:16,height:16,alt:"",onError:()=>d(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Ch(){const{config:i,updateConfig:c,refreshConfig:u}=dn(),[d,m]=v.useState(!1),[h,p]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{function b(T){y.current&&!y.current.contains(T.target)&&m(!1)}return d&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[d]);async function g(b,T){p(!0);try{await c(b.id,T.id),m(!1)}catch{u()}finally{p(!1)}}if(!i)return null;const f=wh(i),S=Ah(i);return n.jsxs("div",{ref:y,className:"relative",children:[n.jsxs("button",{onClick:()=>m(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:b=>{d||(b.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:b=>{d||(b.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:S!=null&&S.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&n.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:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(b=>n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:b.available?"var(--green)":"var(--text-tertiary)",opacity:b.available?1:.3}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:b.available?1:.5},children:b.label})]}),b.models.map(T=>{const O=Bx(i,b.id,T.id),B=!b.available||h;return n.jsxs("button",{onClick:()=>!B&&g(b,T),disabled:B,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:O?"var(--accent-muted)":"transparent",color:B?"var(--text-tertiary)":"var(--text-primary)",opacity:B?.4:1,cursor:B?"not-allowed":"pointer"},onMouseEnter:q=>{!B&&!O&&(q.currentTarget.style.background="var(--surface-3)")},onMouseLeave:q=>{O||(q.currentTarget.style.background="transparent")},children:[n.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${O?"var(--accent)":"var(--border-subtle)"}`},children:O&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:O?600:400},title:T.id,children:T.label})]},`${b.id}-${T.id}`)})]},b.id))})]})]})}function Bx(i,c,u){return i.provider!==c?!1:c==="claude-cli"?i.model===`claude-${u}`:i.model===u}function Ah(i){return i.providers.find(c=>c.id===i.provider)}function wh(i){for(const c of i.providers)for(const u of c.models)if(Bx(i,c.id,u.id))return u.label;return i.model}function _h(){const{state:i,setMode:c}=sa(),{config:u}=dn(),[d,m]=v.useState(null),[h,p]=v.useState(!1);return v.useEffect(()=>{Te.getSkillCreatorStatus().then(m).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(u==null?void 0:u.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(Ch,{})})]}),n.jsx(Eh,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.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:i.mode==="create"?"var(--accent)":"var(--surface-3)",color:i.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:y=>{i.mode!=="create"&&(y.currentTarget.style.background="var(--surface-4)",y.currentTarget.style.color="var(--text-primary)")},onMouseLeave:y=>{i.mode!=="create"&&(y.currentTarget.style.background="var(--surface-3)",y.currentTarget.style.color="var(--text-secondary)")},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),d&&(()=>{const y=(u==null?void 0:u.provider)==="claude-cli";return d.installed&&y?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):d.installed&&!y?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!d.installed&&y?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),n.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),n.jsx("button",{onClick:()=>{navigator.clipboard.writeText(d.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:h?"Copied!":d.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(kh,{})})]})}const Rh="modulepreload",Mh=function(i){return"/"+i},yx={},zh=function(c,u,d){let m=Promise.resolve();if(u&&u.length>0){let p=function(f){return Promise.all(f.map(S=>Promise.resolve(S).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),g=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));m=p(u.map(f=>{if(f=Mh(f),f in yx)return;yx[f]=!0;const S=f.endsWith(".css"),b=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const T=document.createElement("link");if(T.rel=S?"stylesheet":Rh,S||(T.as="script"),T.crossOrigin="",T.href=f,g&&T.setAttribute("nonce",g),document.head.appendChild(T),S)return new Promise((O,B)=>{T.addEventListener("load",O),T.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(p){const y=new Event("vite:preloadError",{cancelable:!0});if(y.payload=p,window.dispatchEvent(y),!y.defaultPrevented)throw p}return m.then(p=>{for(const y of p||[])y.status==="rejected"&&h(y.reason);return c().catch(h)})};function Vc(){const[i,c]=v.useState([]),[u,d]=v.useState(!1),[m,h]=v.useState(!1),[p,y]=v.useState(null),g=v.useRef(null),f=v.useCallback(async(b,T)=>{c([]),d(!0),h(!1),y(null);const O=new AbortController;g.current=O;try{const B=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:T?JSON.stringify(T):void 0,signal:O.signal});if(!B.ok||!B.body){let se=`HTTP ${B.status}`;try{const Y=await B.json();Y.error&&(se=Y.error)}catch{}throw new Error(se)}const q=B.body.getReader(),Q=new TextDecoder;let K="",P="";for(;;){const{done:se,value:Y}=await q.read();if(se)break;K+=Q.decode(Y,{stream:!0});const F=K.split(`
|
|
50
|
-
`);K=F.pop()||"";for(const le of F)if(le.startsWith("event: "))P=le.slice(7).trim();else if(le.startsWith("data: ")){try{const W=JSON.parse(le.slice(6)),ae={event:P,data:W};P==="done"?(h(!0),c(he=>[...he,ae])):c(he=>[...he,ae])}catch{}P=""}}}catch(B){B.name!=="AbortError"&&
|
|
51
|
-
`);K=F.pop()||"";for(const le of F)if(le.startsWith("event: "))P=le.slice(7).trim();else if(le.startsWith("data: ")){try{const W=JSON.parse(le.slice(6)),ae={event:P,data:W};c.current.onEvent(f,ae)}catch{}P=""}}c.current.onDone(f)}catch(B){B.name!=="AbortError"&&c.current.onError(f,B.message)}finally{d(B=>{const q=new Set(B);return q.delete(f),q}),m.current.delete(f)}},[]),p=v.useCallback(f=>{var S;(S=m.current.get(f))==null||S.abort()},[]),y=v.useCallback(()=>{for(const f of m.current.values())f.abort()},[]),g=u.size>0;return{runningSet:u,startCase:h,stopCase:p,stopAll:y,isAnyCaseRunning:g}}const Dh={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,loading:!0,error:null};function Lh(i,c){var u,d;switch(c.type){case"SET_LOADING":return{...i,loading:c.loading};case"SET_ERROR":return{...i,error:c.error};case"INIT_DATA":{const m=new Map;if(c.benchmark)for(const p of c.benchmark.cases)m.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(y=>({assertion_id:y.id,text:y.text,pass:y.pass,reasoning:y.reasoning}))});const h=((d=(u=c.evals)==null?void 0:u.evals[0])==null?void 0:d.id)??null;return{...i,skillContent:c.skillContent,savedContent:c.skillContent,isDirty:!1,evals:c.evals,evalsError:c.evalsError??null,latestBenchmark:c.benchmark,inlineResults:m,selectedCaseId:h,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:c.panel};case"SET_CONTENT":return{...i,skillContent:c.content,isDirty:c.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:c.evals};case"SELECT_CASE":return{...i,selectedCaseId:c.caseId};case"CASE_RUN_START":{const m=new Map(i.caseRunStates);return m.set(c.caseId,{status:"running",startedAt:Date.now(),mode:c.mode}),{...i,caseRunStates:m,runMode:c.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"complete",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,c.result),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_ERROR":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"error",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,{status:"error",errorMessage:c.error,assertions:[]}),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_CANCEL":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);return m.set(c.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:m}}case"BULK_RUN_START":{const m=new Map(i.caseRunStates);for(const h of c.caseIds)m.set(h,{status:"queued",mode:c.mode});return{...i,caseRunStates:m,bulkRunActive:!0,runMode:c.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:c.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const m=new Map(i.caseRunStates);for(const[h,p]of m)(p.status==="running"||p.status==="queued")&&m.set(h,{status:"cancelled"});return{...i,caseRunStates:m,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const m=new Map(i.inlineResults);return m.set(c.evalId,c.result),{...i,inlineResults:m}}case"OPEN_IMPROVE":return{...i,improveTarget:c.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...i,improveTarget:null};case"OPEN_AI_EDIT":return{...i,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...i,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...i,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...i,aiEditProgress:[...i.aiEditProgress,c.entry]};case"AI_EDIT_RESULT":{const m=c.evalChanges??[],h=new Map;for(let p=0;p<m.length;p++)h.set(p,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:c.improved,reasoning:c.reasoning,evalChanges:m},aiEditEvalChanges:m,aiEditEvalSelections:h}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:c.message,aiEditClassifiedError:c.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,c.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:c.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:c.classified};case"TOGGLE_EVAL_CHANGE":{const m=new Map(i.aiEditEvalSelections);return m.set(c.index,!m.get(c.index)),{...i,aiEditEvalSelections:m}}case"SELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!0);return{...i,aiEditEvalSelections:m}}case"DESELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!1);return{...i,aiEditEvalSelections:m}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:c.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:c.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:c.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,c.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:c.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:c.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};default:return i}}function Bh(i,c){const u=c.data;if(c.event==="output_ready"&&(i.output=u.output,u.durationMs!=null&&(i.durationMs=u.durationMs),u.tokens!=null&&(i.tokens=u.tokens)),c.event==="outputs_ready"&&(i.output=u.skillOutput,u.skillDurationMs!=null&&(i.durationMs=u.skillDurationMs),u.skillTokens!=null&&(i.tokens=u.skillTokens)),c.event==="assertion_result"){const d={assertion_id:u.assertion_id,text:u.text,pass:u.pass,reasoning:u.reasoning};i.assertions.find(m=>m.assertion_id===d.assertion_id)||i.assertions.push(d)}c.event==="case_complete"&&(i.status=u.status,i.passRate=u.pass_rate,i.errorMessage=u.error_message||void 0,i.classifiedError=u.classified_error||void 0)}const Ux=v.createContext(null);function nl(){const i=v.useContext(Ux);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Uh({plugin:i,skill:c,origin:u,children:d}){const m=u==="installed",[h,p]=v.useReducer(Lh,{...Dh,plugin:i,skill:c}),y=v.useRef(new Set),g=v.useRef(new Set),f=v.useRef(new Map),S=v.useCallback((R,G)=>{let V=f.current.get(R);V||(V={assertions:[]},f.current.set(R,V)),Bh(V,G),p({type:"UPDATE_INLINE_RESULT",evalId:R,result:{...V,assertions:[...V.assertions]}})},[]),b=v.useCallback(R=>{if(g.current.has(R))return;g.current.add(R);const G=f.current.get(R)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:R,result:{...G,assertions:[...G.assertions]}}),y.current.has(R)&&(y.current.delete(R),y.current.size===0&&Te.getLatestBenchmark(i,c).then(V=>p({type:"BULK_RUN_COMPLETE",benchmark:V})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,c]),T=v.useCallback((R,G)=>{g.current.has(R)||(g.current.add(R),p({type:"CASE_RUN_ERROR",caseId:R,error:G}),y.current.has(R)&&(y.current.delete(R),y.current.size===0&&Te.getLatestBenchmark(i,c).then(V=>p({type:"BULK_RUN_COMPLETE",benchmark:V})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,c]),{startCase:O,stopCase:B,stopAll:q}=Oh({onEvent:S,onDone:b,onError:T});v.useEffect(()=>()=>{q()},[q]),v.useEffect(()=>{let R=!1;async function G(){try{const[V,ee,fe]=await Promise.allSettled([Te.getSkillDetail(i,c),Te.getEvals(i,c),Te.getLatestBenchmark(i,c)]);if(R)return;let ye=null,Ze=null;if(ee.status==="fulfilled")ye=ee.value;else{const et=ee.reason;(et==null?void 0:et.status)!==404&&(Ze=(et==null?void 0:et.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:V.status==="fulfilled"?V.value.skillContent:"",evals:ye,evalsError:Ze,benchmark:fe.status==="fulfilled"?fe.value:null})}catch(V){R||p({type:"SET_ERROR",error:V.message})}}return G(),()=>{R=!0}},[i,c]);const Q=v.useCallback(async()=>{if(!m)try{await Te.applyImprovement(i,c,h.skillContent),p({type:"CONTENT_SAVED"})}catch(R){p({type:"SET_ERROR",error:R.message})}},[m,i,c,h.skillContent]),K=v.useCallback(async R=>{if(!m)try{const G=await Te.saveEvals(i,c,R);p({type:"SET_EVALS",evals:G})}catch(G){p({type:"SET_ERROR",error:G.message})}},[m,i,c]),P=v.useCallback((R,G="benchmark")=>{if(m)return;const V=h.caseRunStates.get(R);if((V==null?void 0:V.status)!=="running")if(f.current.delete(R),g.current.delete(R),p({type:"CASE_RUN_START",caseId:R,mode:G}),G==="comparison"){const ee=`/api/skills/${i}/${c}/compare`;O(R,ee,{eval_ids:[R]})}else{const ee=`/api/skills/${i}/${c}/benchmark/case/${R}`;O(R,ee,G==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.caseRunStates,O]),se=v.useCallback((R="benchmark")=>{var ee;if(m)return;const G=((ee=h.evals)==null?void 0:ee.evals)??[];if(G.length===0)return;const V=G.map(fe=>fe.id);for(const fe of V)f.current.delete(fe),g.current.delete(fe);p({type:"BULK_RUN_START",caseIds:V,mode:R}),y.current=new Set(V);for(const fe of V)if(R==="comparison")O(fe,`/api/skills/${i}/${c}/compare`,{eval_ids:[fe]});else{const ye=`/api/skills/${i}/${c}/benchmark/case/${fe}`;O(fe,ye,R==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.evals,O]),Y=v.useCallback(R=>{B(R),p({type:"CASE_RUN_CANCEL",caseId:R}),y.current.delete(R),g.current.add(R)},[B]),F=v.useCallback(()=>{q(),p({type:"CANCEL_ALL"}),y.current.clear()},[q]),le=v.useCallback(async(R,G)=>{p({type:"OPEN_IMPROVE",evalId:R})},[]),W=v.useCallback(async(R,G)=>{try{await Te.applyImprovement(i,c,G),p({type:"SET_CONTENT",content:G}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),P(R,"benchmark")}catch(V){p({type:"SET_ERROR",error:V.message})}},[i,c,P]),ae=Vc(),he=v.useRef(null);v.useEffect(()=>{if(ae.events.length)for(const R of ae.events){const G=R.data;if(R.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),R.event==="done"){const V=G.improved,ee=G.reasoning,fe=G.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:V,reasoning:ee,evalChanges:fe})}if(R.event==="error"){const V=G;p({type:"AI_EDIT_ERROR",message:V.description||"Unknown error",classified:V})}}},[ae.events]),v.useEffect(()=>{ae.error&&p({type:"AI_EDIT_ERROR",message:ae.error})},[ae.error]),v.useEffect(()=>()=>{ae.stop()},[ae.stop]);const re=v.useCallback(async(R,G,V)=>{m||(p({type:"AI_EDIT_LOADING"}),he.current=ae.stop,ae.start(`/api/skills/${i}/${c}/improve?sse`,{mode:"instruct",instruction:R,content:h.skillContent,evals:h.evals??{skill_name:c,evals:[]},provider:G,model:V}))},[m,i,c,h.skillContent,h.evals,ae]),ge=v.useCallback(()=>{ae.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[ae]),ve=v.useCallback(async()=>{const R=h.aiEditResult;if(R!=null&&R.improved)try{if(await Te.applyImprovement(i,c,R.improved),p({type:"SET_CONTENT",content:R.improved}),p({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:V}=await zh(async()=>{const{mergeEvalChanges:ye}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ye}},[]),ee=h.evals??{skill_name:c,evals:[]},fe=V(ee,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const ye=await Te.saveEvals(i,c,fe);p({type:"SET_EVALS",evals:ye})}catch(ye){p({type:"SET_EVALS_RETRY",evalsFile:fe}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ye.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(G){p({type:"SET_ERROR",error:G.message})}},[i,c,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),X=v.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),ue=v.useCallback(R=>{p({type:"TOGGLE_EVAL_CHANGE",index:R})},[]),Ee=v.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),E=v.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),A=v.useCallback(async()=>{const R=h.aiEditEvalsRetry;if(R)try{const G=await Te.saveEvals(i,c,R);p({type:"SET_EVALS",evals:G}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(G){p({type:"SET_ERROR",error:`Retry failed: ${G.message}`})}},[i,c,h.aiEditEvalsRetry]),J=v.useCallback(async()=>{try{const R=await Te.getSkillDetail(i,c);p({type:"SET_CONTENT",content:R.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[i,c]),ce=Vc();v.useEffect(()=>{if(ce.events.length)for(const R of ce.events){const G=R.data;if(R.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),R.event==="done"){const V=G;Te.saveEvals(i,c,V).then(ee=>p({type:"GENERATE_EVALS_DONE",evals:ee})).catch(ee=>p({type:"SET_ERROR",error:ee.message}))}R.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:G})}},[ce.events,i,c]),v.useEffect(()=>{ce.error&&p({type:"SET_ERROR",error:ce.error})},[ce.error]),v.useEffect(()=>()=>{ce.stop()},[ce.stop]);const pe=v.useCallback(async()=>{m||(p({type:"GENERATE_EVALS_START"}),ce.start(`/api/skills/${i}/${c}/generate-evals?sse`))},[m,i,c,ce]),N=Vc();v.useEffect(()=>()=>{N.stop()},[N.stop]),v.useEffect(()=>{if(N.events.length)for(const R of N.events)R.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:R.data}),R.event==="done"&&p({type:"ACTIVATION_DONE",summary:R.data})},[N.events]),v.useEffect(()=>{N.error&&p({type:"ACTIVATION_ERROR",error:N.error})},[N.error]);const D=v.useCallback(R=>{const V=R.trim().split(`
|
|
52
|
-
`).filter(Boolean).map(ee=>ee.startsWith("!")?{prompt:ee.slice(1).trim(),expected:"should_not_activate"}:ee.startsWith("+")?{prompt:ee.slice(1).trim(),expected:"should_activate"}:{prompt:ee.trim(),expected:"auto"});p({type:"ACTIVATION_START"}),
|
|
53
|
-
`);let p="",
|
|
54
|
-
`),u=[];let d=0;for(;d<c.length;)if(c[d].trim().startsWith("|")&&d+1<c.length&&c[d+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(c[d+1])){const m=gx(c[d]);d+=2;const h=[];for(;d<c.length&&c[d].trim().startsWith("|");)h.push(gx(c[d])),d++;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)"',
|
|
48
|
+
`+a.stack}}var Ft=Object.prototype.hasOwnProperty,Vt=i.unstable_scheduleCallback,Rl=i.unstable_cancelCallback,il=i.unstable_shouldYield,I=i.unstable_requestPaint,ze=i.unstable_now,mt=i.unstable_getCurrentPriorityLevel,Qt=i.unstable_ImmediatePriority,$=i.unstable_UserBlockingPriority,_e=i.unstable_NormalPriority,Xt=i.unstable_LowPriority,Nt=i.unstable_IdlePriority,pt=i.log,It=i.unstable_setDisableYieldValue,Mt=null,Ve=null;function at(e){if(typeof pt=="function"&&It(e),Ve&&typeof Ve.setStrictMode=="function")try{Ve.setStrictMode(Mt,e)}catch{}}var Ge=Math.clz32?Math.clz32:cl,$e=Math.log,Et=Math.LN2;function cl(e){return e>>>=0,e===0?32:31-($e(e)/Et|0)|0}var tt=256,ol=262144,ra=4194304;function Pt(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 ia(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var s=0,r=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var x=a&134217727;return x!==0?(a=x&~r,a!==0?s=Pt(a):(o&=x,o!==0?s=Pt(o):l||(l=x&~e,l!==0&&(s=Pt(l))))):(x=a&~r,x!==0?s=Pt(x):o!==0?s=Pt(o):l||(l=a&~e,l!==0&&(s=Pt(l)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,l=t&-t,r>=l||r===32&&(l&4194048)!==0)?t:s}function Ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function rs(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 fn(){var e=ra;return ra<<=1,(ra&62914560)===0&&(ra=4194304),e}function xn(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Jx(e,t,l,a,s,r){var o=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 x=e.entanglements,j=e.expirationTimes,_=e.hiddenUpdates;for(l=o&~l;0<l;){var L=31-Ge(l),H=1<<L;x[L]=0,j[L]=-1;var M=_[L];if(M!==null)for(_[L]=null,L=0;L<M.length;L++){var O=M[L];O!==null&&(O.lane&=-536870913)}l&=~H}a!==0&&io(e,a,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(o&~t))}function io(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ge(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function co(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-Ge(l),s=1<<a;s&t|e[a]&t&&(e[a]|=t),l&=~s}}function oo(e,t){var l=t&-t;return l=(l&42)!==0?1:Tr(l),(l&(e.suspendedLanes|t))!==0?0:l}function Tr(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 Cr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function uo(){var e=A.p;return e!==0?e:(e=window.event,e===void 0?32:Ff(e.type))}function fo(e,t){var l=A.p;try{return A.p=e,t()}finally{A.p=l}}var zl=Math.random().toString(36).slice(2),rt="__reactFiber$"+zl,ht="__reactProps$"+zl,Ta="__reactContainer$"+zl,Ar="__reactEvents$"+zl,$x="__reactListeners$"+zl,Wx="__reactHandles$"+zl,xo="__reactResources$"+zl,mn="__reactMarker$"+zl;function wr(e){delete e[rt],delete e[ht],delete e[Ar],delete e[$x],delete e[Wx]}function Ca(e){var t=e[rt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ta]||l[rt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Df(e);e!==null;){if(l=e[rt])return l;e=Df(e)}return t}e=l,l=e.parentNode}return null}function Aa(e){if(e=e[rt]||e[Ta]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(d(33))}function wa(e){var t=e[xo];return t||(t=e[xo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[mn]=!0}var mo=new Set,po={};function oa(e,t){_a(e,t),_a(e+"Capture",t)}function _a(e,t){for(po[e]=t,e=0;e<t.length;e++)mo.add(t[e])}var Fx=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]*$"),ho={},vo={};function Ix(e){return Ft.call(vo,e)?!0:Ft.call(ho,e)?!1:Fx.test(e)?vo[e]=!0:(ho[e]=!0,!1)}function is(e,t,l){if(Ix(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function cs(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 ul(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Px(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var s=a.get,r=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){l=""+o,r.call(this,o)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(o){l=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _r(e){if(!e._valueTracker){var t=yo(e)?"checked":"value";e._valueTracker=Px(e,t,""+e[t])}}function go(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=yo(e)?e.checked?"true":"false":e.value),e=a,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 em=/[\n"\\]/g;function Ot(e){return e.replace(em,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rr(e,t,l,a,s,r,o,x){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+zt(t)):e.value!==""+zt(t)&&(e.value=""+zt(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Mr(e,o,zt(t)):l!=null?Mr(e,o,zt(l)):a!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+zt(x):e.removeAttribute("name")}function bo(e,t,l,a,s,r,o,x){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){_r(e);return}l=l!=null?""+zt(l):"",t=t!=null?""+zt(t):l,x||t===e.value||(e.value=t),e.defaultValue=t}a=a??s,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=x?e.checked:!!a,e.defaultChecked=!!a,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),_r(e)}function Mr(e,t,l){t==="number"&&os(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ra(e,t,l,a){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&&a&&(e[l].defaultSelected=!0)}else{for(l=""+zt(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,a&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function jo(e,t,l){if(t!=null&&(t=""+zt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+zt(l):""}function So(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(d(92));if(Ee(a)){if(1<a.length)throw Error(d(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=zt(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),_r(e)}function Ma(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var tm=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 No(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||tm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Eo(e,t,l){if(t!=null&&typeof t!="object")throw Error(d(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var s in t)a=t[s],t.hasOwnProperty(s)&&l[s]!==a&&No(e,s,a)}else for(var r in t)t.hasOwnProperty(r)&&No(e,r,t[r])}function zr(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 lm=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"]]),am=/^[\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 us(e){return am.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function dl(){}var Or=null;function Dr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var za=null,Oa=null;function ko(e){var t=Aa(e);if(t&&(e=t.stateNode)){var l=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rr(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="'+Ot(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var s=a[ht]||null;if(!s)throw Error(d(90));Rr(a,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&go(a)}break e;case"textarea":jo(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Ra(e,!!l.multiple,t,!1)}}}var Lr=!1;function To(e,t,l){if(Lr)return e(t,l);Lr=!0;try{var a=e(t);return a}finally{if(Lr=!1,(za!==null||Oa!==null)&&(Fs(),za&&(t=za,e=Oa,Oa=za=null,ko(t),e)))for(t=0;t<e.length;t++)ko(e[t])}}function hn(e,t){var l=e.stateNode;if(l===null)return null;var a=l[ht]||null;if(a===null)return null;l=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(d(231,t,typeof l));return l}var fl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Br=!1;if(fl)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){Br=!0}}),window.addEventListener("test",vn,vn),window.removeEventListener("test",vn,vn)}catch{Br=!1}var Ol=null,Ur=null,ds=null;function Co(){if(ds)return ds;var e,t=Ur,l=t.length,a,s="value"in Ol?Ol.value:Ol.textContent,r=s.length;for(e=0;e<l&&t[e]===s[e];e++);var o=l-e;for(a=1;a<=o&&t[l-a]===s[r-a];a++);return ds=s.slice(e,1<a?1-a:void 0)}function fs(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 xs(){return!0}function Ao(){return!1}function vt(e){function t(l,a,s,r,o){this._reactName=l,this._targetInst=s,this.type=a,this.nativeEvent=r,this.target=o,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(l=e[x],this[x]=l?l(r):r[x]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?xs:Ao,this.isPropagationStopped=Ao,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=xs)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=xs)},persist:function(){},isPersistent:xs}),t}var ua={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ms=vt(ua),yn=y({},ua,{view:0,detail:0}),nm=vt(yn),Hr,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:Gr,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"?(Hr=e.screenX-gn.screenX,qr=e.screenY-gn.screenY):qr=Hr=0,gn=e),Hr)},movementY:function(e){return"movementY"in e?e.movementY:qr}}),wo=vt(ps),sm=y({},ps,{dataTransfer:0}),rm=vt(sm),im=y({},yn,{relatedTarget:0}),Yr=vt(im),cm=y({},ua,{animationName:0,elapsedTime:0,pseudoElement:0}),om=vt(cm),um=y({},ua,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dm=vt(um),fm=y({},ua,{data:0}),_o=vt(fm),xm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mm={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"},pm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pm[e])?!!t[e]:!1}function Gr(){return hm}var vm=y({},yn,{key:function(e){if(e.key){var t=xm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gr,charCode:function(e){return e.type==="keypress"?fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ym=vt(vm),gm=y({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ro=vt(gm),bm=y({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gr}),jm=vt(bm),Sm=y({},ua,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nm=vt(Sm),Em=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}),km=vt(Em),Tm=y({},ua,{newState:0,oldState:0}),Cm=vt(Tm),Am=[9,13,27,32],Vr=fl&&"CompositionEvent"in window,bn=null;fl&&"documentMode"in document&&(bn=document.documentMode);var wm=fl&&"TextEvent"in window&&!bn,Mo=fl&&(!Vr||bn&&8<bn&&11>=bn),zo=" ",Oo=!1;function Do(e,t){switch(e){case"keyup":return Am.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Da=!1;function _m(e,t){switch(e){case"compositionend":return Lo(t);case"keypress":return t.which!==32?null:(Oo=!0,zo);case"textInput":return e=t.data,e===zo&&Oo?null:e;default:return null}}function Rm(e,t){if(Da)return e==="compositionend"||!Vr&&Do(e,t)?(e=Co(),ds=Ur=Ol=null,Da=!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 Mo&&t.locale!=="ko"?null:t.data;default:return null}}var Mm={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 Bo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mm[e.type]:t==="textarea"}function Uo(e,t,l,a){za?Oa?Oa.push(a):Oa=[a]:za=a,t=nr(t,"onChange"),0<t.length&&(l=new ms("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var jn=null,Sn=null;function zm(e){jf(e,0)}function hs(e){var t=pn(e);if(go(t))return e}function Ho(e,t){if(e==="change")return t}var qo=!1;if(fl){var Qr;if(fl){var Xr="oninput"in document;if(!Xr){var Yo=document.createElement("div");Yo.setAttribute("oninput","return;"),Xr=typeof Yo.oninput=="function"}Qr=Xr}else Qr=!1;qo=Qr&&(!document.documentMode||9<document.documentMode)}function Go(){jn&&(jn.detachEvent("onpropertychange",Vo),Sn=jn=null)}function Vo(e){if(e.propertyName==="value"&&hs(Sn)){var t=[];Uo(t,Sn,e,Dr(e)),To(zm,t)}}function Om(e,t,l){e==="focusin"?(Go(),jn=t,Sn=l,jn.attachEvent("onpropertychange",Vo)):e==="focusout"&&Go()}function Dm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hs(Sn)}function Lm(e,t){if(e==="click")return hs(t)}function Bm(e,t){if(e==="input"||e==="change")return hs(t)}function Um(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Um;function Nn(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var s=l[a];if(!Ft.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function Qo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xo(e,t){var l=Qo(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Qo(l)}}function Zo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ko(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 Zr(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 Hm=fl&&"documentMode"in document&&11>=document.documentMode,La=null,Kr=null,En=null,Jr=!1;function Jo(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jr||La==null||La!==os(a)||(a=La,"selectionStart"in a&&Zr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),En&&Nn(En,a)||(En=a,a=nr(Kr,"onSelect"),0<a.length&&(t=new ms("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=La)))}function da(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Ba={animationend:da("Animation","AnimationEnd"),animationiteration:da("Animation","AnimationIteration"),animationstart:da("Animation","AnimationStart"),transitionrun:da("Transition","TransitionRun"),transitionstart:da("Transition","TransitionStart"),transitioncancel:da("Transition","TransitionCancel"),transitionend:da("Transition","TransitionEnd")},$r={},$o={};fl&&($o=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function fa(e){if($r[e])return $r[e];if(!Ba[e])return e;var t=Ba[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in $o)return $r[e]=t[l];return e}var Wo=fa("animationend"),Fo=fa("animationiteration"),Io=fa("animationstart"),qm=fa("transitionrun"),Ym=fa("transitionstart"),Gm=fa("transitioncancel"),Po=fa("transitionend"),eu=new Map,Wr="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(" ");Wr.push("scrollEnd");function Zt(e,t){eu.set(e,t),oa(t,[e])}var vs=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)},Dt=[],Ua=0,Fr=0;function ys(){for(var e=Ua,t=Fr=Ua=0;t<e;){var l=Dt[t];Dt[t++]=null;var a=Dt[t];Dt[t++]=null;var s=Dt[t];Dt[t++]=null;var r=Dt[t];if(Dt[t++]=null,a!==null&&s!==null){var o=a.pending;o===null?s.next=s:(s.next=o.next,o.next=s),a.pending=s}r!==0&&tu(l,s,r)}}function gs(e,t,l,a){Dt[Ua++]=e,Dt[Ua++]=t,Dt[Ua++]=l,Dt[Ua++]=a,Fr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ir(e,t,l,a){return gs(e,t,l,a),bs(e)}function xa(e,t){return gs(e,null,null,t),bs(e)}function tu(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var s=!1,r=e.return;r!==null;)r.childLanes|=l,a=r.alternate,a!==null&&(a.childLanes|=l),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Ge(l),e=r.hiddenUpdates,a=e[s],a===null?e[s]=[t]:a.push(t),t.lane=l|536870912),r):null}function bs(e){if(50<Zn)throw Zn=0,ic=null,Error(d(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ha={};function Vm(e,t,l,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,l,a){return new Vm(e,t,l,a)}function Pr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xl(e,t){var l=e.alternate;return l===null?(l=Tt(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 lu(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 js(e,t,l,a,s,r){var o=0;if(a=e,typeof e=="function")Pr(e)&&(o=1);else if(typeof e=="string")o=Jp(e,l,R.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case he:return e=Tt(31,l,t,s),e.elementType=he,e.lanes=r,e;case q:return ma(l.children,s,r,t);case V:o=8,s|=24;break;case K:return e=Tt(12,l,t,s|2),e.elementType=K,e.lanes=r,e;case F:return e=Tt(13,l,t,s),e.elementType=F,e.lanes=r,e;case le:return e=Tt(19,l,t,s),e.elementType=le,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case se:o=10;break e;case P:o=9;break e;case Y:o=11;break e;case W:o=14;break e;case ae:o=16,a=null;break e}o=29,l=Error(d(130,e===null?"null":typeof e,"")),a=null}return t=Tt(o,l,t,s),t.elementType=e,t.type=a,t.lanes=r,t}function ma(e,t,l,a){return e=Tt(7,e,a,t),e.lanes=l,e}function ei(e,t,l){return e=Tt(6,e,null,t),e.lanes=l,e}function au(e){var t=Tt(18,null,null,0);return t.stateNode=e,t}function ti(e,t,l){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var nu=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var l=nu.get(e);return l!==void 0?l:(t={value:e,source:t,stack:_l(t)},nu.set(e,t),t)}return{value:e,source:t,stack:_l(t)}}var qa=[],Ya=0,Ss=null,kn=0,Bt=[],Ut=0,Dl=null,el=1,tl="";function ml(e,t){qa[Ya++]=kn,qa[Ya++]=Ss,Ss=e,kn=t}function su(e,t,l){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,Dl=e;var a=el;e=tl;var s=32-Ge(a)-1;a&=~(1<<s),l+=1;var r=32-Ge(t)+s;if(30<r){var o=s-s%5;r=(a&(1<<o)-1).toString(32),a>>=o,s-=o,el=1<<32-Ge(t)+s|l<<s|a,tl=r+e}else el=1<<r|l<<s|a,tl=e}function li(e){e.return!==null&&(ml(e,1),su(e,1,0))}function ai(e){for(;e===Ss;)Ss=qa[--Ya],qa[Ya]=null,kn=qa[--Ya],qa[Ya]=null;for(;e===Dl;)Dl=Bt[--Ut],Bt[Ut]=null,tl=Bt[--Ut],Bt[Ut]=null,el=Bt[--Ut],Bt[Ut]=null}function ru(e,t){Bt[Ut++]=el,Bt[Ut++]=tl,Bt[Ut++]=Dl,el=t.id,tl=t.overflow,Dl=e}var it=null,Ue=null,ke=!1,Ll=null,Ht=!1,ni=Error(d(519));function Bl(e){var t=Error(d(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Tn(Lt(t,e)),ni}function iu(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[rt]=e,t[ht]=a,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<Jn.length;l++)je(Jn[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),bo(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),So(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||kf(t.textContent,l)?(a.popover!=null&&(je("beforetoggle",t),je("toggle",t)),a.onScroll!=null&&je("scroll",t),a.onScrollEnd!=null&&je("scrollend",t),a.onClick!=null&&(t.onclick=dl),t=!0):t=!1,t||Bl(e,!0)}function cu(e){for(it=e.return;it;)switch(it.tag){case 5:case 31:case 13:Ht=!1;return;case 27:case 3:Ht=!0;return;default:it=it.return}}function Ga(e){if(e!==it)return!1;if(!ke)return cu(e),ke=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Sc(e.type,e.memoizedProps)),l=!l),l&&Ue&&Bl(e),cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Ue=Of(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(317));Ue=Of(e)}else t===27?(t=Ue,Fl(e.type)?(e=Cc,Cc=null,Ue=e):Ue=t):Ue=it?Yt(e.stateNode.nextSibling):null;return!0}function pa(){Ue=it=null,ke=!1}function si(){var e=Ll;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),Ll=null),e}function Tn(e){Ll===null?Ll=[e]:Ll.push(e)}var ri=S(null),ha=null,pl=null;function Ul(e,t,l){Z(ri,t._currentValue),t._currentValue=l}function hl(e){e._currentValue=ri.current,D(ri)}function ii(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function ci(e,t,l,a){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var o=s.child;r=r.firstContext;e:for(;r!==null;){var x=r;r=s;for(var j=0;j<t.length;j++)if(x.context===t[j]){r.lanes|=l,x=r.alternate,x!==null&&(x.lanes|=l),ii(r.return,l,e),a||(o=null);break e}r=x.next}}else if(s.tag===18){if(o=s.return,o===null)throw Error(d(341));o.lanes|=l,r=o.alternate,r!==null&&(r.lanes|=l),ii(o,l,e),o=null}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}}function Va(e,t,l,a){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var o=s.alternate;if(o===null)throw Error(d(387));if(o=o.memoizedProps,o!==null){var x=s.type;kt(s.pendingProps.value,o.value)||(e!==null?e.push(x):e=[x])}}else if(s===ee.current){if(o=s.alternate,o===null)throw Error(d(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Pn):e=[Pn])}s=s.return}e!==null&&ci(t,e,l,a),t.flags|=262144}function Ns(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ha=e,pl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return ou(ha,e)}function Es(e,t){return ha===null&&va(e),ou(e,t)}function ou(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},pl===null){if(e===null)throw Error(d(308));pl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pl=pl.next=t;return l}var Qm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Xm=i.unstable_scheduleCallback,Zm=i.unstable_NormalPriority,We={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oi(){return{controller:new Qm,data:new Map,refCount:0}}function Cn(e){e.refCount--,e.refCount===0&&Xm(Zm,function(){e.controller.abort()})}var An=null,ui=0,Qa=0,Xa=null;function Km(e,t){if(An===null){var l=An=[];ui=0,Qa=xc(),Xa={status:"pending",value:void 0,then:function(a){l.push(a)}}}return ui++,t.then(uu,uu),t}function uu(){if(--ui===0&&An!==null){Xa!==null&&(Xa.status="fulfilled");var e=An;An=null,Qa=0,Xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Jm(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(a.status="rejected",a.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),a}var du=N.S;N.S=function(e,t){Jd=ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Km(e,t),du!==null&&du(e,t)};var ya=S(null);function di(){var e=ya.current;return e!==null?e:Be.pooledCache}function ks(e,t){t===null?Z(ya,ya.current):Z(ya,t.pool)}function fu(){var e=di();return e===null?null:{parent:We._currentValue,pool:e}}var Za=Error(d(460)),fi=Error(d(474)),Ts=Error(d(542)),Cs={then:function(){}};function xu(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(dl,dl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e;default:if(typeof t.status=="string")t.then(dl,dl);else{if(e=Be,e!==null&&100<e.shellSuspendCounter)throw Error(d(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=a}},function(a){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hu(e),e}throw ba=t,Za}}function ga(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ba=l,Za):l}}var ba=null;function pu(){if(ba===null)throw Error(d(459));var e=ba;return ba=null,e}function hu(e){if(e===Za||e===Ts)throw Error(d(483))}var Ka=null,wn=0;function As(e){var t=wn;return wn+=1,Ka===null&&(Ka=[]),mu(Ka,e,t)}function _n(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ws(e,t){throw t.$$typeof===T?Error(d(525)):(e=Object.prototype.toString.call(t),Error(d(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vu(e){function t(C,k){if(e){var w=C.deletions;w===null?(C.deletions=[k],C.flags|=16):w.push(k)}}function l(C,k){if(!e)return null;for(;k!==null;)t(C,k),k=k.sibling;return null}function a(C){for(var k=new Map;C!==null;)C.key!==null?k.set(C.key,C):k.set(C.index,C),C=C.sibling;return k}function s(C,k){return C=xl(C,k),C.index=0,C.sibling=null,C}function r(C,k,w){return C.index=w,e?(w=C.alternate,w!==null?(w=w.index,w<k?(C.flags|=67108866,k):w):(C.flags|=67108866,k)):(C.flags|=1048576,k)}function o(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function x(C,k,w,U){return k===null||k.tag!==6?(k=ei(w,C.mode,U),k.return=C,k):(k=s(k,w),k.return=C,k)}function j(C,k,w,U){var ie=w.type;return ie===q?L(C,k,w.props.children,U,w.key):k!==null&&(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type)?(k=s(k,w.props),_n(k,w),k.return=C,k):(k=js(w.type,w.key,w.props,null,C.mode,U),_n(k,w),k.return=C,k)}function _(C,k,w,U){return k===null||k.tag!==4||k.stateNode.containerInfo!==w.containerInfo||k.stateNode.implementation!==w.implementation?(k=ti(w,C.mode,U),k.return=C,k):(k=s(k,w.children||[]),k.return=C,k)}function L(C,k,w,U,ie){return k===null||k.tag!==7?(k=ma(w,C.mode,U,ie),k.return=C,k):(k=s(k,w),k.return=C,k)}function H(C,k,w){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=ei(""+k,C.mode,w),k.return=C,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case z:return w=js(k.type,k.key,k.props,null,C.mode,w),_n(w,k),w.return=C,w;case B:return k=ti(k,C.mode,w),k.return=C,k;case ae:return k=ga(k),H(C,k,w)}if(Ee(k)||ve(k))return k=ma(k,C.mode,w,null),k.return=C,k;if(typeof k.then=="function")return H(C,As(k),w);if(k.$$typeof===se)return H(C,Es(C,k),w);ws(C,k)}return null}function M(C,k,w,U){var ie=k!==null?k.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ie!==null?null:x(C,k,""+w,U);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case z:return w.key===ie?j(C,k,w,U):null;case B:return w.key===ie?_(C,k,w,U):null;case ae:return w=ga(w),M(C,k,w,U)}if(Ee(w)||ve(w))return ie!==null?null:L(C,k,w,U,null);if(typeof w.then=="function")return M(C,k,As(w),U);if(w.$$typeof===se)return M(C,k,Es(C,w),U);ws(C,w)}return null}function O(C,k,w,U,ie){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return C=C.get(w)||null,x(k,C,""+U,ie);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return C=C.get(U.key===null?w:U.key)||null,j(k,C,U,ie);case B:return C=C.get(U.key===null?w:U.key)||null,_(k,C,U,ie);case ae:return U=ga(U),O(C,k,w,U,ie)}if(Ee(U)||ve(U))return C=C.get(w)||null,L(k,C,U,ie,null);if(typeof U.then=="function")return O(C,k,w,As(U),ie);if(U.$$typeof===se)return O(C,k,w,Es(k,U),ie);ws(k,U)}return null}function te(C,k,w,U){for(var ie=null,Ce=null,ne=k,me=k=0,Ne=null;ne!==null&&me<w.length;me++){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var Ae=M(C,ne,w[me],U);if(Ae===null){ne===null&&(ne=Ne);break}e&&ne&&Ae.alternate===null&&t(C,ne),k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae,ne=Ne}if(me===w.length)return l(C,ne),ke&&ml(C,me),ie;if(ne===null){for(;me<w.length;me++)ne=H(C,w[me],U),ne!==null&&(k=r(ne,k,me),Ce===null?ie=ne:Ce.sibling=ne,Ce=ne);return ke&&ml(C,me),ie}for(ne=a(ne);me<w.length;me++)Ne=O(ne,C,me,w[me],U),Ne!==null&&(e&&Ne.alternate!==null&&ne.delete(Ne.key===null?me:Ne.key),k=r(Ne,k,me),Ce===null?ie=Ne:Ce.sibling=Ne,Ce=Ne);return e&&ne.forEach(function(la){return t(C,la)}),ke&&ml(C,me),ie}function oe(C,k,w,U){if(w==null)throw Error(d(151));for(var ie=null,Ce=null,ne=k,me=k=0,Ne=null,Ae=w.next();ne!==null&&!Ae.done;me++,Ae=w.next()){ne.index>me?(Ne=ne,ne=null):Ne=ne.sibling;var la=M(C,ne,Ae.value,U);if(la===null){ne===null&&(ne=Ne);break}e&&ne&&la.alternate===null&&t(C,ne),k=r(la,k,me),Ce===null?ie=la:Ce.sibling=la,Ce=la,ne=Ne}if(Ae.done)return l(C,ne),ke&&ml(C,me),ie;if(ne===null){for(;!Ae.done;me++,Ae=w.next())Ae=H(C,Ae.value,U),Ae!==null&&(k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return ke&&ml(C,me),ie}for(ne=a(ne);!Ae.done;me++,Ae=w.next())Ae=O(ne,C,me,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&ne.delete(Ae.key===null?me:Ae.key),k=r(Ae,k,me),Ce===null?ie=Ae:Ce.sibling=Ae,Ce=Ae);return e&&ne.forEach(function(sh){return t(C,sh)}),ke&&ml(C,me),ie}function Le(C,k,w,U){if(typeof w=="object"&&w!==null&&w.type===q&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case z:e:{for(var ie=w.key;k!==null;){if(k.key===ie){if(ie=w.type,ie===q){if(k.tag===7){l(C,k.sibling),U=s(k,w.props.children),U.return=C,C=U;break e}}else if(k.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&ga(ie)===k.type){l(C,k.sibling),U=s(k,w.props),_n(U,w),U.return=C,C=U;break e}l(C,k);break}else t(C,k);k=k.sibling}w.type===q?(U=ma(w.props.children,C.mode,U,w.key),U.return=C,C=U):(U=js(w.type,w.key,w.props,null,C.mode,U),_n(U,w),U.return=C,C=U)}return o(C);case B:e:{for(ie=w.key;k!==null;){if(k.key===ie)if(k.tag===4&&k.stateNode.containerInfo===w.containerInfo&&k.stateNode.implementation===w.implementation){l(C,k.sibling),U=s(k,w.children||[]),U.return=C,C=U;break e}else{l(C,k);break}else t(C,k);k=k.sibling}U=ti(w,C.mode,U),U.return=C,C=U}return o(C);case ae:return w=ga(w),Le(C,k,w,U)}if(Ee(w))return te(C,k,w,U);if(ve(w)){if(ie=ve(w),typeof ie!="function")throw Error(d(150));return w=ie.call(w),oe(C,k,w,U)}if(typeof w.then=="function")return Le(C,k,As(w),U);if(w.$$typeof===se)return Le(C,k,Es(C,w),U);ws(C,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,k!==null&&k.tag===6?(l(C,k.sibling),U=s(k,w),U.return=C,C=U):(l(C,k),U=ei(w,C.mode,U),U.return=C,C=U),o(C)):l(C,k)}return function(C,k,w,U){try{wn=0;var ie=Le(C,k,w,U);return Ka=null,ie}catch(ne){if(ne===Za||ne===Ts)throw ne;var Ce=Tt(29,ne,null,C.mode);return Ce.lanes=U,Ce.return=C,Ce}finally{}}}var ja=vu(!0),yu=vu(!1),Hl=!1;function xi(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 ql(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(we&2)!==0){var s=a.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),a.pending=t,t=bs(e),tu(e,null,l),t}return gs(e,a,t,l),bs(e)}function Rn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}function pi(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var o={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=o:r=r.next=o,l=l.next}while(l!==null);r===null?s=r=t:r=r.next=t}else s=r=t;l={baseState:a.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var hi=!1;function Mn(){if(hi){var e=Xa;if(e!==null)throw e}}function zn(e,t,l,a){hi=!1;var s=e.updateQueue;Hl=!1;var r=s.firstBaseUpdate,o=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var j=x,_=j.next;j.next=null,o===null?r=_:o.next=_,o=j;var L=e.alternate;L!==null&&(L=L.updateQueue,x=L.lastBaseUpdate,x!==o&&(x===null?L.firstBaseUpdate=_:x.next=_,L.lastBaseUpdate=j))}if(r!==null){var H=s.baseState;o=0,L=_=j=null,x=r;do{var M=x.lane&-536870913,O=M!==x.lane;if(O?(Se&M)===M:(a&M)===M){M!==0&&M===Qa&&(hi=!0),L!==null&&(L=L.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var te=e,oe=x;M=t;var Le=l;switch(oe.tag){case 1:if(te=oe.payload,typeof te=="function"){H=te.call(Le,H,M);break e}H=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=oe.payload,M=typeof te=="function"?te.call(Le,H,M):te,M==null)break e;H=y({},H,M);break e;case 2:Hl=!0}}M=x.callback,M!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[M]:O.push(M))}else O={lane:M,tag:x.tag,payload:x.payload,callback:x.callback,next:null},L===null?(_=L=O,j=H):L=L.next=O,o|=M;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;O=x,x=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);L===null&&(j=H),s.baseState=j,s.firstBaseUpdate=_,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Zl|=o,e.lanes=o,e.memoizedState=H}}function gu(e,t){if(typeof e!="function")throw Error(d(191,e));e.call(t)}function bu(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)gu(l[e],t)}var Ja=S(null),_s=S(0);function ju(e,t){e=kl,Z(_s,e),Z(Ja,t),kl=e|t.baseLanes}function vi(){Z(_s,kl),Z(Ja,Ja.current)}function yi(){kl=_s.current,D(Ja),D(_s)}var Ct=S(null),qt=null;function Gl(e){var t=e.alternate;Z(Ke,Ke.current&1),Z(Ct,e),qt===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(qt=e)}function gi(e){Z(Ke,Ke.current),Z(Ct,e),qt===null&&(qt=e)}function Su(e){e.tag===22?(Z(Ke,Ke.current),Z(Ct,e),qt===null&&(qt=e)):Vl()}function Vl(){Z(Ke,Ke.current),Z(Ct,Ct.current)}function At(e){D(Ct),qt===e&&(qt=null),D(Ke)}var Ke=S(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||kc(l)||Tc(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 vl=0,xe=null,Oe=null,Fe=null,Ms=!1,$a=!1,Sa=!1,zs=0,On=0,Wa=null,$m=0;function Qe(){throw Error(d(321))}function bi(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!kt(e[l],t[l]))return!1;return!0}function ji(e,t,l,a,s,r){return vl=r,xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?sd:Li,Sa=!1,r=l(a,s),Sa=!1,$a&&(r=Eu(t,l,a,s)),Nu(e),r}function Nu(e){N.H=Bn;var t=Oe!==null&&Oe.next!==null;if(vl=0,Fe=Oe=xe=null,Ms=!1,On=0,Wa=null,t)throw Error(d(300));e===null||Ie||(e=e.dependencies,e!==null&&Ns(e)&&(Ie=!0))}function Eu(e,t,l,a){xe=e;var s=0;do{if($a&&(Wa=null),On=0,$a=!1,25<=s)throw Error(d(301));if(s+=1,Fe=Oe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}N.H=rd,r=t(l,a)}while($a);return r}function Wm(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?Dn(t):t,e=e.useState()[0],(Oe!==null?Oe.memoizedState:null)!==e&&(xe.flags|=1024),t}function Si(){var e=zs!==0;return zs=0,e}function Ni(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Ei(e){if(Ms){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ms=!1}vl=0,Fe=Oe=xe=null,$a=!1,On=zs=0,Wa=null}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function Je(){if(Oe===null){var e=xe.alternate;e=e!==null?e.memoizedState:null}else e=Oe.next;var t=Fe===null?xe.memoizedState:Fe.next;if(t!==null)Fe=t,Oe=e;else{if(e===null)throw xe.alternate===null?Error(d(467)):Error(d(310));Oe=e,e={memoizedState:Oe.memoizedState,baseState:Oe.baseState,baseQueue:Oe.baseQueue,queue:Oe.queue,next:null},Fe===null?xe.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function Os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dn(e){var t=On;return On+=1,Wa===null&&(Wa=[]),e=mu(Wa,e,t),t=xe,(Fe===null?t.memoizedState:Fe.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?sd:Li),e}function Ds(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dn(e);if(e.$$typeof===se)return ct(e)}throw Error(d(438,String(e)))}function ki(e){var t=null,l=xe.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Os(),xe.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=re;return t.index++,l}function yl(e,t){return typeof t=="function"?t(e):t}function Ls(e){var t=Je();return Ti(t,Oe,e)}function Ti(e,t,l){var a=e.queue;if(a===null)throw Error(d(311));a.lastRenderedReducer=l;var s=e.baseQueue,r=a.pending;if(r!==null){if(s!==null){var o=s.next;s.next=r.next,r.next=o}t.baseQueue=s=r,a.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var x=o=null,j=null,_=t,L=!1;do{var H=_.lane&-536870913;if(H!==_.lane?(Se&H)===H:(vl&H)===H){var M=_.revertLane;if(M===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),H===Qa&&(L=!0);else if((vl&M)===M){_=_.next,M===Qa&&(L=!0);continue}else H={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=H,o=r):j=j.next=H,xe.lanes|=M,Zl|=M;H=_.action,Sa&&l(r,H),r=_.hasEagerState?_.eagerState:l(r,H)}else M={lane:H,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},j===null?(x=j=M,o=r):j=j.next=M,xe.lanes|=H,Zl|=H;_=_.next}while(_!==null&&_!==t);if(j===null?o=r:j.next=x,!kt(r,e.memoizedState)&&(Ie=!0,L&&(l=Xa,l!==null)))throw l;e.memoizedState=r,e.baseState=o,e.baseQueue=j,a.lastRenderedState=r}return s===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ci(e){var t=Je(),l=t.queue;if(l===null)throw Error(d(311));l.lastRenderedReducer=e;var a=l.dispatch,s=l.pending,r=t.memoizedState;if(s!==null){l.pending=null;var o=s=s.next;do r=e(r,o.action),o=o.next;while(o!==s);kt(r,t.memoizedState)||(Ie=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),l.lastRenderedState=r}return[r,a]}function ku(e,t,l){var a=xe,s=Je(),r=ke;if(r){if(l===void 0)throw Error(d(407));l=l()}else l=t();var o=!kt((Oe||s).memoizedState,l);if(o&&(s.memoizedState=l,Ie=!0),s=s.queue,_i(Au.bind(null,a,s,e),[e]),s.getSnapshot!==t||o||Fe!==null&&Fe.memoizedState.tag&1){if(a.flags|=2048,Fa(9,{destroy:void 0},Cu.bind(null,a,s,l,t),null),Be===null)throw Error(d(349));r||(vl&127)!==0||Tu(a,t,l)}return l}function Tu(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=xe.updateQueue,t===null?(t=Os(),xe.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Cu(e,t,l,a){t.value=l,t.getSnapshot=a,wu(t)&&_u(e)}function Au(e,t,l){return l(function(){wu(t)&&_u(e)})}function wu(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!kt(e,l)}catch{return!0}}function _u(e){var t=xa(e,2);t!==null&&St(t,e,2)}function Ai(e){var t=ft();if(typeof e=="function"){var l=e;if(e=l(),Sa){at(!0);try{l()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:e},t}function Ru(e,t,l,a){return e.baseState=l,Ti(e,Oe,typeof a=="function"?a:yl)}function Fm(e,t,l,a,s){if(Hs(e))throw Error(d(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){r.listeners.push(o)}};N.T!==null?l(!0):r.isTransition=!1,a(r),l=t.pending,l===null?(r.next=t.pending=r,Mu(t,r)):(r.next=l.next,t.pending=l.next=r)}}function Mu(e,t){var l=t.action,a=t.payload,s=e.state;if(t.isTransition){var r=N.T,o={};N.T=o;try{var x=l(s,a),j=N.S;j!==null&&j(o,x),zu(e,t,x)}catch(_){wi(e,t,_)}finally{r!==null&&o.types!==null&&(r.types=o.types),N.T=r}}else try{r=l(s,a),zu(e,t,r)}catch(_){wi(e,t,_)}}function zu(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Ou(e,t,a)},function(a){return wi(e,t,a)}):Ou(e,t,l)}function Ou(e,t,l){t.status="fulfilled",t.value=l,Du(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Mu(e,l)))}function wi(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,Du(t),t=t.next;while(t!==a)}e.action=null}function Du(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Lu(e,t){return t}function Bu(e,t){if(ke){var l=Be.formState;if(l!==null){e:{var a=xe;if(ke){if(Ue){t:{for(var s=Ue,r=Ht;s.nodeType!==8;){if(!r){s=null;break t}if(s=Yt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ue=Yt(s.nextSibling),a=s.data==="F!";break e}}Bl(a)}a=!1}a&&(t=l[0])}}return l=ft(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lu,lastRenderedState:t},l.queue=a,l=ld.bind(null,xe,a),a.dispatch=l,a=Ai(!1),r=Di.bind(null,xe,!1,a.queue),a=ft(),s={state:t,dispatch:null,action:e,pending:null},a.queue=s,l=Fm.bind(null,xe,s,r,l),s.dispatch=l,a.memoizedState=e,[t,l,!1]}function Uu(e){var t=Je();return Hu(t,Oe,e)}function Hu(e,t,l){if(t=Ti(e,t,Lu)[0],e=Ls(yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Dn(t)}catch(o){throw o===Za?Ts:o}else a=t;t=Je();var s=t.queue,r=s.dispatch;return l!==t.memoizedState&&(xe.flags|=2048,Fa(9,{destroy:void 0},Im.bind(null,s,l),null)),[a,r,e]}function Im(e,t){e.action=t}function qu(e){var t=Je(),l=Oe;if(l!==null)return Hu(t,l,e);Je(),t=t.memoizedState,l=Je();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Fa(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=xe.updateQueue,t===null&&(t=Os(),xe.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Yu(){return Je().memoizedState}function Bs(e,t,l,a){var s=ft();xe.flags|=e,s.memoizedState=Fa(1|t,{destroy:void 0},l,a===void 0?null:a)}function Us(e,t,l,a){var s=Je();a=a===void 0?null:a;var r=s.memoizedState.inst;Oe!==null&&a!==null&&bi(a,Oe.memoizedState.deps)?s.memoizedState=Fa(t,r,l,a):(xe.flags|=e,s.memoizedState=Fa(1|t,r,l,a))}function Gu(e,t){Bs(8390656,8,e,t)}function _i(e,t){Us(2048,8,e,t)}function Pm(e){xe.flags|=4;var t=xe.updateQueue;if(t===null)t=Os(),xe.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Vu(e){var t=Je().memoizedState;return Pm({ref:t,nextImpl:e}),function(){if((we&2)!==0)throw Error(d(440));return t.impl.apply(void 0,arguments)}}function Qu(e,t){return Us(4,2,e,t)}function Xu(e,t){return Us(4,4,e,t)}function Zu(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 Ku(e,t,l){l=l!=null?l.concat([e]):null,Us(4,4,Zu.bind(null,t,e),l)}function Ri(){}function Ju(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&bi(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function $u(e,t){var l=Je();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&bi(t,a[1]))return a[0];if(a=e(),Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a}function Mi(e,t,l){return l===void 0||(vl&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Wd(),xe.lanes|=e,Zl|=e,l)}function Wu(e,t,l,a){return kt(l,t)?l:Ja.current!==null?(e=Mi(e,l,a),kt(e,t)||(Ie=!0),e):(vl&42)===0||(vl&1073741824)!==0&&(Se&261930)===0?(Ie=!0,e.memoizedState=l):(e=Wd(),xe.lanes|=e,Zl|=e,t)}function Fu(e,t,l,a,s){var r=A.p;A.p=r!==0&&8>r?r:8;var o=N.T,x={};N.T=x,Di(e,!1,t,l);try{var j=s(),_=N.S;if(_!==null&&_(x,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var L=Jm(j,a);Ln(e,t,L,Rt(e))}else Ln(e,t,a,Rt(e))}catch(H){Ln(e,t,{then:function(){},status:"rejected",reason:H},Rt())}finally{A.p=r,o!==null&&x.types!==null&&(o.types=x.types),N.T=o}}function ep(){}function zi(e,t,l,a){if(e.tag!==5)throw Error(d(476));var s=Iu(e).queue;Fu(e,s,t,J,l===null?ep:function(){return Pu(e),l(a)})}function Iu(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:J},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Pu(e){var t=Iu(e);t.next===null&&(t=e.alternate.memoizedState),Ln(e,t.next.queue,{},Rt())}function Oi(){return ct(Pn)}function ed(){return Je().memoizedState}function td(){return Je().memoizedState}function tp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Rt();e=ql(l);var a=Yl(t,e,l);a!==null&&(St(a,t,l),Rn(a,t,l)),t={cache:oi()},e.payload=t;return}t=t.return}}function lp(e,t,l){var a=Rt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hs(e)?ad(t,l):(l=Ir(e,t,l,a),l!==null&&(St(l,e,a),nd(l,t,a)))}function ld(e,t,l){var a=Rt();Ln(e,t,l,a)}function Ln(e,t,l,a){var s={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hs(e))ad(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var o=t.lastRenderedState,x=r(o,l);if(s.hasEagerState=!0,s.eagerState=x,kt(x,o))return gs(e,t,s,0),Be===null&&ys(),!1}catch{}finally{}if(l=Ir(e,t,s,a),l!==null)return St(l,e,a),nd(l,t,a),!0}return!1}function Di(e,t,l,a){if(a={lane:2,revertLane:xc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hs(e)){if(t)throw Error(d(479))}else t=Ir(e,l,a,2),t!==null&&St(t,e,2)}function Hs(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function ad(e,t){$a=Ms=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function nd(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,co(e,l)}}var Bn={readContext:ct,use:Ds,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};Bn.useEffectEvent=Qe;var sd={readContext:ct,use:Ds,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:Gu,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Bs(4194308,4,Zu.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Bs(4194308,4,e,t)},useInsertionEffect:function(e,t){Bs(4,2,e,t)},useMemo:function(e,t){var l=ft();t=t===void 0?null:t;var a=e();if(Sa){at(!0);try{e()}finally{at(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ft();if(l!==void 0){var s=l(t);if(Sa){at(!0);try{l(t)}finally{at(!1)}}}else s=t;return a.memoizedState=a.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},a.queue=e,e=e.dispatch=lp.bind(null,xe,e),[a.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:function(e){e=Ai(e);var t=e.queue,l=ld.bind(null,xe,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Ri,useDeferredValue:function(e,t){var l=ft();return Mi(l,e,t)},useTransition:function(){var e=Ai(!1);return e=Fu.bind(null,xe,e.queue,!0,!1),ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=xe,s=ft();if(ke){if(l===void 0)throw Error(d(407));l=l()}else{if(l=t(),Be===null)throw Error(d(349));(Se&127)!==0||Tu(a,t,l)}s.memoizedState=l;var r={value:l,getSnapshot:t};return s.queue=r,Gu(Au.bind(null,a,r,e),[e]),a.flags|=2048,Fa(9,{destroy:void 0},Cu.bind(null,a,r,l,t),null),l},useId:function(){var e=ft(),t=Be.identifierPrefix;if(ke){var l=tl,a=el;l=(a&~(1<<32-Ge(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=$m++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oi,useFormState:Bu,useActionState:Bu,useOptimistic:function(e){var t=ft();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Di.bind(null,xe,!0,l),l.dispatch=t,[e,t]},useMemoCache:ki,useCacheRefresh:function(){return ft().memoizedState=tp.bind(null,xe)},useEffectEvent:function(e){var t=ft(),l={impl:e};return t.memoizedState=l,function(){if((we&2)!==0)throw Error(d(440));return l.impl.apply(void 0,arguments)}}},Li={readContext:ct,use:Ds,useCallback:Ju,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:$u,useReducer:Ls,useRef:Yu,useState:function(){return Ls(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Wu(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ls(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Oi,useFormState:Uu,useActionState:Uu,useOptimistic:function(e,t){var l=Je();return Ru(l,Oe,e,t)},useMemoCache:ki,useCacheRefresh:td};Li.useEffectEvent=Vu;var rd={readContext:ct,use:Ds,useCallback:Ju,useContext:ct,useEffect:_i,useImperativeHandle:Ku,useInsertionEffect:Qu,useLayoutEffect:Xu,useMemo:$u,useReducer:Ci,useRef:Yu,useState:function(){return Ci(yl)},useDebugValue:Ri,useDeferredValue:function(e,t){var l=Je();return Oe===null?Mi(l,e,t):Wu(l,Oe.memoizedState,e,t)},useTransition:function(){var e=Ci(yl)[0],t=Je().memoizedState;return[typeof e=="boolean"?e:Dn(e),t]},useSyncExternalStore:ku,useId:ed,useHostTransitionStatus:Oi,useFormState:qu,useActionState:qu,useOptimistic:function(e,t){var l=Je();return Oe!==null?Ru(l,Oe,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ki,useCacheRefresh:td};rd.useEffectEvent=Vu;function Bi(e,t,l,a){t=e.memoizedState,l=l(a,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 a=Rt(),s=ql(a);s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Rt(),s=ql(a);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Yl(e,s,a),t!==null&&(St(t,e,a),Rn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Rt(),a=ql(l);a.tag=2,t!=null&&(a.callback=t),t=Yl(e,a,l),t!==null&&(St(t,e,l),Rn(t,e,l))}};function id(e,t,l,a,s,r,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,o):t.prototype&&t.prototype.isPureReactComponent?!Nn(l,a)||!Nn(s,r):!0}function cd(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Ui.enqueueReplaceState(t,t.state,null)}function Na(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}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 od(e){vs(e)}function ud(e){console.error(e)}function dd(e){vs(e)}function qs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function fd(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Hi(e,t,l){return l=ql(l),l.tag=3,l.payload={element:null},l.callback=function(){qs(e,t)},l}function xd(e){return e=ql(e),e.tag=3,e}function md(e,t,l,a){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=a.value;e.payload=function(){return s(r)},e.callback=function(){fd(t,l,a)}}var o=l.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){fd(t,l,a),typeof s!="function"&&(Kl===null?Kl=new Set([this]):Kl.add(this));var x=a.stack;this.componentDidCatch(a.value,{componentStack:x!==null?x:""})})}function ap(e,t,l,a,s){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&Va(t,l,s,!0),l=Ct.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Is():l.alternate===null&&Xe===0&&(Xe=3),l.flags&=-257,l.flags|=65536,l.lanes=s,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),uc(e,a,s)),!1;case 22:return l.flags|=65536,a===Cs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),uc(e,a,s)),!1}throw Error(d(435,l.tag))}return uc(e,a,s),Is(),!1}if(ke)return t=Ct.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,a!==ni&&(e=Error(d(422),{cause:a}),Tn(Lt(e,l)))):(a!==ni&&(t=Error(d(423),{cause:a}),Tn(Lt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,a=Lt(a,l),s=Hi(e.stateNode,a,s),pi(e,s),Xe!==4&&(Xe=2)),!1;var r=Error(d(520),{cause:a});if(r=Lt(r,l),Xn===null?Xn=[r]:Xn.push(r),Xe!==4&&(Xe=2),t===null)return!0;a=Lt(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=Hi(l.stateNode,a,e),pi(l,e),!1;case 1:if(t=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Kl===null||!Kl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=xd(s),md(s,e,l,a),pi(l,s),!1}l=l.return}while(l!==null);return!1}var qi=Error(d(461)),Ie=!1;function ot(e,t,l,a){t.child=e===null?yu(t,null,l,a):ja(t,e.child,l,a)}function pd(e,t,l,a,s){l=l.render;var r=t.ref;if("ref"in a){var o={};for(var x in a)x!=="ref"&&(o[x]=a[x])}else o=a;return va(t),a=ji(e,t,l,o,r,s),x=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&x&&li(t),t.flags|=1,ot(e,t,a,s),t.child)}function hd(e,t,l,a,s){if(e===null){var r=l.type;return typeof r=="function"&&!Pr(r)&&r.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=r,vd(e,t,r,a,s)):(e=js(l.type,null,a,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Ji(e,s)){var o=r.memoizedProps;if(l=l.compare,l=l!==null?l:Nn,l(o,a)&&e.ref===t.ref)return gl(e,t,s)}return t.flags|=1,e=xl(r,a),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,l,a,s){if(e!==null){var r=e.memoizedProps;if(Nn(r,a)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=a=r,Ji(e,s))(e.flags&131072)!==0&&(Ie=!0);else return t.lanes=e.lanes,gl(e,t,s)}return Yi(e,t,l,a,s)}function yd(e,t,l,a){var s=a.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,e!==null){for(a=t.child=e.child,s=0;a!==null;)s=s|a.lanes|a.childLanes,a=a.sibling;a=s&~r}else a=0,t.child=null;return gd(e,t,r,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ks(t,r!==null?r.cachePool:null),r!==null?ju(t,r):vi(),Su(t);else return a=t.lanes=536870912,gd(e,t,r!==null?r.baseLanes|l:l,l,a)}else r!==null?(ks(t,r.cachePool),ju(t,r),Vl(),t.memoizedState=null):(e!==null&&ks(t,null),vi(),Vl());return ot(e,t,s,l),t.child}function Un(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gd(e,t,l,a,s){var r=di();return r=r===null?null:{parent:We._currentValue,pool:r},t.memoizedState={baseLanes:l,cachePool:r},e!==null&&ks(t,null),vi(),Su(t),e!==null&&Va(e,t,a,!0),t.childLanes=s,null}function Ys(e,t){return t=Vs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function bd(e,t,l){return ja(t,e.child,null,l),e=Ys(t,t.pendingProps),e.flags|=2,At(t),t.memoizedState=null,e}function np(e,t,l){var a=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(a.mode==="hidden")return e=Ys(t,a),t.lanes=536870912,Un(null,e);if(gi(t),(e=Ue)?(e=zf(e,Ht),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return t.lanes=536870912,null}return Ys(t,a)}var r=e.memoizedState;if(r!==null){var o=r.dehydrated;if(gi(t),s)if(t.flags&256)t.flags&=-257,t=bd(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(d(558));else if(Ie||Va(e,t,l,!1),s=(l&e.childLanes)!==0,Ie||s){if(a=Be,a!==null&&(o=oo(a,l),o!==0&&o!==r.retryLane))throw r.retryLane=o,xa(e,o),St(a,e,o),qi;Is(),t=bd(e,t,l)}else e=r.treeContext,Ue=Yt(o.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&ru(t,e),t=Ys(t,a),t.flags|=4096;return t}return e=xl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gs(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(d(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Yi(e,t,l,a,s){return va(t),l=ji(e,t,l,a,void 0,s),a=Si(),e!==null&&!Ie?(Ni(e,t,s),gl(e,t,s)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,s),t.child)}function jd(e,t,l,a,s,r){return va(t),t.updateQueue=null,l=Eu(t,a,l,s),Nu(e),a=Si(),e!==null&&!Ie?(Ni(e,t,r),gl(e,t,r)):(ke&&a&&li(t),t.flags|=1,ot(e,t,l,r),t.child)}function Sd(e,t,l,a,s){if(va(t),t.stateNode===null){var r=Ha,o=l.contextType;typeof o=="object"&&o!==null&&(r=ct(o)),r=new l(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ui,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},xi(t),o=l.contextType,r.context=typeof o=="object"&&o!==null?ct(o):Ha,r.state=t.memoizedState,o=l.getDerivedStateFromProps,typeof o=="function"&&(Bi(t,l,o,a),r.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(o=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),o!==r.state&&Ui.enqueueReplaceState(r,r.state,null),zn(t,a,r,s),Mn(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var x=t.memoizedProps,j=Na(l,x);r.props=j;var _=r.context,L=l.contextType;o=Ha,typeof L=="object"&&L!==null&&(o=ct(L));var H=l.getDerivedStateFromProps;L=typeof H=="function"||typeof r.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(x||_!==o)&&cd(t,r,a,o),Hl=!1;var M=t.memoizedState;r.state=M,zn(t,a,r,s),Mn(),_=t.memoizedState,x||M!==_||Hl?(typeof H=="function"&&(Bi(t,l,H,a),_=t.memoizedState),(j=Hl||id(t,l,j,a,M,_,o))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=_),r.props=a,r.state=_,r.context=o,a=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,mi(e,t),o=t.memoizedProps,L=Na(l,o),r.props=L,H=t.pendingProps,M=r.context,_=l.contextType,j=Ha,typeof _=="object"&&_!==null&&(j=ct(_)),x=l.getDerivedStateFromProps,(_=typeof x=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o!==H||M!==j)&&cd(t,r,a,j),Hl=!1,M=t.memoizedState,r.state=M,zn(t,a,r,s),Mn();var O=t.memoizedState;o!==H||M!==O||Hl||e!==null&&e.dependencies!==null&&Ns(e.dependencies)?(typeof x=="function"&&(Bi(t,l,x,a),O=t.memoizedState),(L=Hl||id(t,l,L,a,M,O,j)||e!==null&&e.dependencies!==null&&Ns(e.dependencies))?(_||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,O,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,O,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=O),r.props=a,r.state=O,r.context=j,a=L):(typeof r.componentDidUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Gs(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=ja(t,e.child,null,s),t.child=ja(t,null,l,s)):ot(e,t,l,s),t.memoizedState=r.state,e=t.child):e=gl(e,t,s),e}function Nd(e,t,l,a){return pa(),t.flags|=256,ot(e,t,l,a),t.child}var Gi={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vi(e){return{baseLanes:e,cachePool:fu()}}function Qi(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=_t),e}function Ed(e,t,l){var a=t.pendingProps,s=!1,r=(t.flags&128)!==0,o;if((o=r)||(o=e!==null&&e.memoizedState===null?!1:(Ke.current&2)!==0),o&&(s=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Gl(t):Vl(),(e=Ue)?(e=zf(e,Ht),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Dl!==null?{id:el,overflow:tl}:null,retryLane:536870912,hydrationErrors:null},l=au(e),l.return=t,t.child=l,it=t,Ue=null)):e=null,e===null)throw Bl(t);return Tc(e)?t.lanes=32:t.lanes=536870912,null}var x=a.children;return a=a.fallback,s?(Vl(),s=t.mode,x=Vs({mode:"hidden",children:x},s),a=ma(a,s,l,null),x.return=t,a.return=t,x.sibling=a,t.child=x,a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(null,a)):(Gl(t),Xi(t,x))}var j=e.memoizedState;if(j!==null&&(x=j.dehydrated,x!==null)){if(r)t.flags&256?(Gl(t),t.flags&=-257,t=Zi(e,t,l)):t.memoizedState!==null?(Vl(),t.child=e.child,t.flags|=128,t=null):(Vl(),x=a.fallback,s=t.mode,a=Vs({mode:"visible",children:a.children},s),x=ma(x,s,l,null),x.flags|=2,a.return=t,x.return=t,a.sibling=x,t.child=a,ja(t,e.child,null,l),a=t.child,a.memoizedState=Vi(l),a.childLanes=Qi(e,o,l),t.memoizedState=Gi,t=Un(null,a));else if(Gl(t),Tc(x)){if(o=x.nextSibling&&x.nextSibling.dataset,o)var _=o.dgst;o=_,a=Error(d(419)),a.stack="",a.digest=o,Tn({value:a,source:null,stack:null}),t=Zi(e,t,l)}else if(Ie||Va(e,t,l,!1),o=(l&e.childLanes)!==0,Ie||o){if(o=Be,o!==null&&(a=oo(o,l),a!==0&&a!==j.retryLane))throw j.retryLane=a,xa(e,a),St(o,e,a),qi;kc(x)||Is(),t=Zi(e,t,l)}else kc(x)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Ue=Yt(x.nextSibling),it=t,ke=!0,Ll=null,Ht=!1,e!==null&&ru(t,e),t=Xi(t,a.children),t.flags|=4096);return t}return s?(Vl(),x=a.fallback,s=t.mode,j=e.child,_=j.sibling,a=xl(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,_!==null?x=xl(_,x):(x=ma(x,s,l,null),x.flags|=2),x.return=t,a.return=t,a.sibling=x,t.child=a,Un(null,a),a=t.child,x=e.child.memoizedState,x===null?x=Vi(l):(s=x.cachePool,s!==null?(j=We._currentValue,s=s.parent!==j?{parent:j,pool:j}:s):s=fu(),x={baseLanes:x.baseLanes|l,cachePool:s}),a.memoizedState=x,a.childLanes=Qi(e,o,l),t.memoizedState=Gi,Un(e.child,a)):(Gl(t),l=e.child,e=l.sibling,l=xl(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=l,t.memoizedState=null,l)}function Xi(e,t){return t=Vs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vs(e,t){return e=Tt(22,e,null,t),e.lanes=0,e}function Zi(e,t,l){return ja(t,e.child,null,l),e=Xi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kd(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ii(e.return,t,l)}function Ki(e,t,l,a,s,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:s,treeForkCount:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=l,o.tailMode=s,o.treeForkCount=r)}function Td(e,t,l){var a=t.pendingProps,s=a.revealOrder,r=a.tail;a=a.children;var o=Ke.current,x=(o&2)!==0;if(x?(o=o&1|2,t.flags|=128):o&=1,Z(Ke,o),ot(e,t,a,l),a=ke?kn:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kd(e,l,t);else if(e.tag===19)kd(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),Ki(t,!1,s,l,r,a);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}Ki(t,!0,l,null,r,a);break;case"together":Ki(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function gl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Zl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Va(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,l=xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=xl(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&&Ns(e)))}function sp(e,t,l){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),Ul(t,We,e.memoizedState.cache),pa();break;case 27:case 5:Ze(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:Ul(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,gi(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Gl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Ed(e,t,l):(Gl(t),e=gl(e,t,l),e!==null?e.sibling:null);Gl(t);break;case 19:var s=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(Va(e,t,l,!1),a=(l&t.childLanes)!==0),s){if(a)return Td(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Z(Ke,Ke.current),a)break;return null;case 22:return t.lanes=0,yd(e,t,l,t.pendingProps);case 24:Ul(t,We,e.memoizedState.cache)}return gl(e,t,l)}function Cd(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ie=!0;else{if(!Ji(e,l)&&(t.flags&128)===0)return Ie=!1,sp(e,t,l);Ie=(e.flags&131072)!==0}else Ie=!1,ke&&(t.flags&1048576)!==0&&su(t,kn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e=="function")Pr(e)?(a=Na(e,a),t.tag=1,t=Sd(null,t,e,a,l)):(t.tag=0,t=Yi(null,t,e,a,l));else{if(e!=null){var s=e.$$typeof;if(s===Y){t.tag=11,t=pd(null,t,e,a,l);break e}else if(s===W){t.tag=14,t=hd(null,t,e,a,l);break e}}throw t=ue(e)||e,Error(d(306,t,""))}}return t;case 0:return Yi(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,s=Na(a,t.pendingProps),Sd(e,t,a,s,l);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(d(387));a=t.pendingProps;var r=t.memoizedState;s=r.element,mi(e,t),zn(t,a,null,l);var o=t.memoizedState;if(a=o.cache,Ul(t,We,a),a!==r.cache&&ci(t,[We],l,!0),Mn(),a=o.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Nd(e,t,a,l);break e}else if(a!==s){s=Lt(Error(d(424)),t),Tn(s),t=Nd(e,t,a,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(Ue=Yt(e.firstChild),it=t,ke=!0,Ll=null,Ht=!0,l=yu(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(pa(),a===s){t=gl(e,t,l);break e}ot(e,t,a,l)}t=t.child}return t;case 26:return Gs(e,t),e===null?(l=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=l:ke||(l=t.type,e=t.pendingProps,a=sr(Q.current).createElement(l),a[rt]=t,a[ht]=e,ut(a,l,e),nt(a),t.stateNode=a):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ze(t),e===null&&ke&&(a=t.stateNode=Lf(t.type,t.pendingProps,Q.current),it=t,Ht=!0,s=Ue,Fl(t.type)?(Cc=s,Ue=Yt(a.firstChild)):Ue=s),ot(e,t,t.pendingProps.children,l),Gs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=a=Ue)&&(a=Dp(a,t.type,t.pendingProps,Ht),a!==null?(t.stateNode=a,it=t,Ue=Yt(a.firstChild),Ht=!1,s=!0):s=!1),s||Bl(t)),Ze(t),s=t.type,r=t.pendingProps,o=e!==null?e.memoizedProps:null,a=r.children,Sc(s,r)?a=null:o!==null&&Sc(s,o)&&(t.flags|=32),t.memoizedState!==null&&(s=ji(e,t,Wm,null,null,l),Pn._currentValue=s),Gs(e,t),ot(e,t,a,l),t.child;case 6:return e===null&&ke&&((e=l=Ue)&&(l=Lp(l,t.pendingProps,Ht),l!==null?(t.stateNode=l,it=t,Ue=null,e=!0):e=!1),e||Bl(t)),null;case 13:return Ed(e,t,l);case 4:return fe(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ja(t,null,a,l):ot(e,t,a,l),t.child;case 11:return pd(e,t,t.type,t.pendingProps,l);case 7:return ot(e,t,t.pendingProps,l),t.child;case 8:return ot(e,t,t.pendingProps.children,l),t.child;case 12:return ot(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,Ul(t,t.type,a.value),ot(e,t,a.children,l),t.child;case 9:return s=t.type._context,a=t.pendingProps.children,va(t),s=ct(s),a=a(s),t.flags|=1,ot(e,t,a,l),t.child;case 14:return hd(e,t,t.type,t.pendingProps,l);case 15:return vd(e,t,t.type,t.pendingProps,l);case 19:return Td(e,t,l);case 31:return np(e,t,l);case 22:return yd(e,t,l,t.pendingProps);case 24:return va(t),a=ct(We),e===null?(s=di(),s===null&&(s=Be,r=oi(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),t.memoizedState={parent:a,cache:s},xi(t),Ul(t,We,s)):((e.lanes&l)!==0&&(mi(e,t),zn(t,null,null,l),Mn()),s=e.memoizedState,r=t.memoizedState,s.parent!==a?(s={parent:a,cache:a},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ul(t,We,a)):(a=r.cache,Ul(t,We,a),a!==s.cache&&ci(t,[We],l,!0))),ot(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(d(156,t.tag))}function bl(e){e.flags|=4}function $i(e,t,l,a,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(ef())e.flags|=8192;else throw ba=Cs,fi}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,!Qf(t))if(ef())e.flags|=8192;else throw ba=Cs,fi}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?fn():536870912,e.lanes|=t,tn|=t)}function Hn(e,t){if(!ke)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 a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags&65011712,a|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,a|=s.subtreeFlags,a|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function rp(e,t,l){var a=t.pendingProps;switch(ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),hl(We),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ga(t)?bl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,si())),He(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(bl(t),r!==null?(He(t),Ad(t,r)):(He(t),$i(t,s,null,a,l))):r?r!==e.memoizedState?(bl(t),He(t),Ad(t,r)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&bl(t),He(t),$i(t,s,e,a,l)),null;case 27:if(et(t),l=Q.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return He(t),null}e=R.current,Ga(t)?iu(t):(e=Lf(s,a,l),t.stateNode=e,bl(t))}return He(t),null;case 5:if(et(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(!a){if(t.stateNode===null)throw Error(d(166));return He(t),null}if(r=R.current,Ga(t))iu(t);else{var o=sr(Q.current);switch(r){case 1:r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=o.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=o.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=o.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof a.is=="string"?o.createElement("select",{is:a.is}):o.createElement("select"),a.multiple?r.multiple=!0:a.size&&(r.size=a.size);break;default:r=typeof a.is=="string"?o.createElement(s,{is:a.is}):o.createElement(s)}}r[rt]=t,r[ht]=a;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)r.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=r;e:switch(ut(r,s,a),s){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&bl(t)}}return He(t),$i(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&bl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(d(166));if(e=Q.current,Ga(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,s=it,s!==null)switch(s.tag){case 27:case 5:a=s.memoizedProps}e[rt]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||kf(e.nodeValue,l)),e||Bl(t,!0)}else e=sr(e).createTextNode(a),e[rt]=t,t.stateNode=e}return He(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ga(t),l!==null){if(e===null){if(!a)throw Error(d(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(d(557));e[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else l=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(At(t),t):(At(t),null);if((t.flags&128)!==0)throw Error(d(558))}return He(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ga(t),a!==null&&a.dehydrated!==null){if(e===null){if(!s)throw Error(d(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(d(317));s[rt]=t}else pa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),s=!1}else s=si(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(At(t),t):(At(t),null)}return At(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,s=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(s=a.alternate.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==s&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Qs(t,t.updateQueue),He(t),null);case 4:return ye(),e===null&&vc(t.stateNode.containerInfo),He(t),null;case 10:return hl(t.type),He(t),null;case 19:if(D(Ke),a=t.memoizedState,a===null)return He(t),null;if(s=(t.flags&128)!==0,r=a.rendering,r===null)if(s)Hn(a,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Rs(e),r!==null){for(t.flags|=128,Hn(a,!1),e=r.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)lu(l,e),l=l.sibling;return Z(Ke,Ke.current&1|2),ke&&ml(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ze()>$s&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304)}else{if(!s)if(e=Rs(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!r.alternate&&!ke)return He(t),null}else 2*ze()-a.renderingStartTime>$s&&l!==536870912&&(t.flags|=128,s=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(r.sibling=t.child,t.child=r):(e=a.last,e!==null?e.sibling=r:t.child=r,a.last=r)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ze(),e.sibling=null,l=Ke.current,Z(Ke,s?l&1|2:l&1),ke&&ml(t,a.treeForkCount),e):(He(t),null);case 22:case 23:return At(t),yi(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),l=t.updateQueue,l!==null&&Qs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&D(ya),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),hl(We),He(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function ip(e,t){switch(ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hl(We),ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return et(t),null;case 31:if(t.memoizedState!==null){if(At(t),t.alternate===null)throw Error(d(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(At(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return D(Ke),null;case 4:return ye(),null;case 10:return hl(t.type),null;case 22:case 23:return At(t),yi(),e!==null&&D(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return hl(We),null;case 25:return null;default:return null}}function wd(e,t){switch(ai(t),t.tag){case 3:hl(We),ye();break;case 26:case 27:case 5:et(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&At(t);break;case 13:At(t);break;case 19:D(Ke);break;case 10:hl(t.type);break;case 22:case 23:At(t),yi(),e!==null&&D(ya);break;case 24:hl(We)}}function qn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var s=a.next;l=s;do{if((l.tag&e)===e){a=void 0;var r=l.create,o=l.inst;a=r(),o.destroy=a}l=l.next}while(l!==s)}}catch(x){Me(t,t.return,x)}}function Ql(e,t,l){try{var a=t.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var r=s.next;a=r;do{if((a.tag&e)===e){var o=a.inst,x=o.destroy;if(x!==void 0){o.destroy=void 0,s=t;var j=l,_=x;try{_()}catch(L){Me(s,j,L)}}}a=a.next}while(a!==r)}}catch(L){Me(t,t.return,L)}}function _d(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{bu(t,l)}catch(a){Me(e,e.return,a)}}}function Rd(e,t,l){l.props=Na(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Me(e,t,a)}}function Yn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(s){Me(e,t,s)}}function ll(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(s){Me(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){Me(e,t,s)}else l.current=null}function Md(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(s){Me(e,e.return,s)}}function Wi(e,t,l){try{var a=e.stateNode;wp(a,e.type,l,t),a[ht]=t}catch(s){Me(e,e.return,s)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Fl(e.type)||e.tag===4}function Fi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Fl(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 Ii(e,t,l){var a=e.tag;if(a===5||a===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=dl));else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Ii(e,t,l),e=e.sibling;e!==null;)Ii(e,t,l),e=e.sibling}function Xs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Fl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Xs(e,t,l),e=e.sibling;e!==null;)Xs(e,t,l),e=e.sibling}function Od(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ut(t,a,l),t[rt]=e,t[ht]=l}catch(r){Me(e,e.return,r)}}var jl=!1,Pe=!1,Pi=!1,Dd=typeof WeakSet=="function"?WeakSet:Set,st=null;function cp(e,t){if(e=e.containerInfo,bc=fr,e=Ko(e),Zr(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var s=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break e}var o=0,x=-1,j=-1,_=0,L=0,H=e,M=null;t:for(;;){for(var O;H!==l||s!==0&&H.nodeType!==3||(x=o+s),H!==r||a!==0&&H.nodeType!==3||(j=o+a),H.nodeType===3&&(o+=H.nodeValue.length),(O=H.firstChild)!==null;)M=H,H=O;for(;;){if(H===e)break t;if(M===l&&++_===s&&(x=o),M===r&&++L===a&&(j=o),(O=H.nextSibling)!==null)break;H=M,M=H.parentNode}H=O}l=x===-1||j===-1?null:{start:x,end:j}}else l=null}l=l||{start:0,end:0}}else l=null;for(jc={focusedElem:e,selectionRange:l},fr=!1,st=t;st!==null;)if(t=st,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,st=e;else for(;st!==null;){switch(t=st,r=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&&r!==null){e=void 0,l=t,s=r.memoizedProps,r=r.memoizedState,a=l.stateNode;try{var te=Na(l.type,s);e=a.getSnapshotBeforeUpdate(te,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(oe){Me(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Ec(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ec(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(d(163))}if(e=t.sibling,e!==null){e.return=t.return,st=e;break}st=t.return}}function Ld(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:Nl(e,l),a&4&&qn(5,l);break;case 1:if(Nl(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(o){Me(l,l.return,o)}else{var s=Na(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Me(l,l.return,o)}}a&64&&_d(l),a&512&&Yn(l,l.return);break;case 3:if(Nl(e,l),a&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{bu(e,t)}catch(o){Me(l,l.return,o)}}break;case 27:t===null&&a&4&&Od(l);case 26:case 5:Nl(e,l),t===null&&a&4&&Md(l),a&512&&Yn(l,l.return);break;case 12:Nl(e,l);break;case 31:Nl(e,l),a&4&&Hd(e,l);break;case 13:Nl(e,l),a&4&&qd(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=vp.bind(null,l),Bp(e,l))));break;case 22:if(a=l.memoizedState!==null||jl,!a){t=t!==null&&t.memoizedState!==null||Pe,s=jl;var r=Pe;jl=a,(Pe=t)&&!r?El(e,l,(l.subtreeFlags&8772)!==0):Nl(e,l),jl=s,Pe=r}break;case 30:break;default:Nl(e,l)}}function Bd(e){var t=e.alternate;t!==null&&(e.alternate=null,Bd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wr(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 Ye=null,yt=!1;function Sl(e,t,l){for(l=l.child;l!==null;)Ud(e,t,l),l=l.sibling}function Ud(e,t,l){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(Mt,l)}catch{}switch(l.tag){case 26:Pe||ll(l,t),Sl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pe||ll(l,t);var a=Ye,s=yt;Fl(l.type)&&(Ye=l.stateNode,yt=!1),Sl(e,t,l),Wn(l.stateNode),Ye=a,yt=s;break;case 5:Pe||ll(l,t);case 6:if(a=Ye,s=yt,Ye=null,Sl(e,t,l),Ye=a,yt=s,Ye!==null)if(yt)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(l.stateNode)}catch(r){Me(l,t,r)}else try{Ye.removeChild(l.stateNode)}catch(r){Me(l,t,r)}break;case 18:Ye!==null&&(yt?(e=Ye,Rf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),un(e)):Rf(Ye,l.stateNode));break;case 4:a=Ye,s=yt,Ye=l.stateNode.containerInfo,yt=!0,Sl(e,t,l),Ye=a,yt=s;break;case 0:case 11:case 14:case 15:Ql(2,l,t),Pe||Ql(4,l,t),Sl(e,t,l);break;case 1:Pe||(ll(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Rd(l,t,a)),Sl(e,t,l);break;case 21:Sl(e,t,l);break;case 22:Pe=(a=Pe)||l.memoizedState!==null,Sl(e,t,l),Pe=a;break;default:Sl(e,t,l)}}function Hd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{un(e)}catch(l){Me(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{un(e)}catch(l){Me(t,t.return,l)}}function op(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Dd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Dd),t;default:throw Error(d(435,e.tag))}}function Zs(e,t){var l=op(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var s=yp.bind(null,e,a);a.then(s,s)}})}function gt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var s=l[a],r=e,o=t,x=o;e:for(;x!==null;){switch(x.tag){case 27:if(Fl(x.type)){Ye=x.stateNode,yt=!1;break e}break;case 5:Ye=x.stateNode,yt=!1;break e;case 3:case 4:Ye=x.stateNode.containerInfo,yt=!0;break e}x=x.return}if(Ye===null)throw Error(d(160));Ud(r,o,s),Ye=null,yt=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Yd(t,e),t=t.sibling}var Kt=null;function Yd(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(t,e),bt(e),a&4&&(Ql(3,e,e.return),qn(3,e),Ql(5,e,e.return));break;case 1:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&64&&jl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var s=Kt;if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),a&4){var r=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(a){case"title":r=s.getElementsByTagName("title")[0],(!r||r[mn]||r[rt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(a),s.head.insertBefore(r,s.querySelector("head > title"))),ut(r,a,l),r[rt]=e,nt(r),a=r;break e;case"link":var o=Gf("link","href",s).get(a+(l.href||""));if(o){for(var x=0;x<o.length;x++)if(r=o[x],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;case"meta":if(o=Gf("meta","content",s).get(a+(l.content||""))){for(x=0;x<o.length;x++)if(r=o[x],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){o.splice(x,1);break t}}r=s.createElement(a),ut(r,a,l),s.head.appendChild(r);break;default:throw Error(d(468,a))}r[rt]=e,nt(r),a=r}e.stateNode=a}else Vf(s,e.type,e.stateNode);else e.stateNode=Yf(s,a,e.memoizedProps);else r!==a?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,a===null?Vf(s,e.type,e.stateNode):Yf(s,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Wi(e,e.memoizedProps,l.memoizedProps)}break;case 27:gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),l!==null&&a&4&&Wi(e,e.memoizedProps,l.memoizedProps);break;case 5:if(gt(t,e),bt(e),a&512&&(Pe||l===null||ll(l,l.return)),e.flags&32){s=e.stateNode;try{Ma(s,"")}catch(te){Me(e,e.return,te)}}a&4&&e.stateNode!=null&&(s=e.memoizedProps,Wi(e,s,l!==null?l.memoizedProps:s)),a&1024&&(Pi=!0);break;case 6:if(gt(t,e),bt(e),a&4){if(e.stateNode===null)throw Error(d(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(te){Me(e,e.return,te)}}break;case 3:if(cr=null,s=Kt,Kt=rr(t.containerInfo),gt(t,e),Kt=s,bt(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(te){Me(e,e.return,te)}Pi&&(Pi=!1,Gd(e));break;case 4:a=Kt,Kt=rr(e.stateNode.containerInfo),gt(t,e),bt(e),Kt=a;break;case 12:gt(t,e),bt(e);break;case 31:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 13:gt(t,e),bt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Js=ze()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 22:s=e.memoizedState!==null;var j=l!==null&&l.memoizedState!==null,_=jl,L=Pe;if(jl=_||s,Pe=L||j,gt(t,e),Pe=L,jl=_,bt(e),a&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||j||jl||Pe||Ea(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){j=l=t;try{if(r=j.stateNode,s)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{x=j.stateNode;var H=j.memoizedProps.style,M=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(te){Me(j,j.return,te)}}}else if(t.tag===6){if(l===null){j=t;try{j.stateNode.nodeValue=s?"":j.memoizedProps}catch(te){Me(j,j.return,te)}}}else if(t.tag===18){if(l===null){j=t;try{var O=j.stateNode;s?Mf(O,!0):Mf(j.stateNode,!1)}catch(te){Me(j,j.return,te)}}}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}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Zs(e,l))));break;case 19:gt(t,e),bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Zs(e,a)));break;case 30:break;case 21:break;default:gt(t,e),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(zd(a)){l=a;break}a=a.return}if(l==null)throw Error(d(160));switch(l.tag){case 27:var s=l.stateNode,r=Fi(e);Xs(e,r,s);break;case 5:var o=l.stateNode;l.flags&32&&(Ma(o,""),l.flags&=-33);var x=Fi(e);Xs(e,x,o);break;case 3:case 4:var j=l.stateNode.containerInfo,_=Fi(e);Ii(e,_,j);break;default:throw Error(d(161))}}catch(L){Me(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Gd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Nl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ld(e,t.alternate,t),t=t.sibling}function Ea(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ql(4,t,t.return),Ea(t);break;case 1:ll(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Rd(t,t.return,l),Ea(t);break;case 27:Wn(t.stateNode);case 26:case 5:ll(t,t.return),Ea(t);break;case 22:t.memoizedState===null&&Ea(t);break;case 30:Ea(t);break;default:Ea(t)}e=e.sibling}}function El(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,s=e,r=t,o=r.flags;switch(r.tag){case 0:case 11:case 15:El(s,r,l),qn(4,r);break;case 1:if(El(s,r,l),a=r,s=a.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(_){Me(a,a.return,_)}if(a=r,s=a.updateQueue,s!==null){var x=a.stateNode;try{var j=s.shared.hiddenCallbacks;if(j!==null)for(s.shared.hiddenCallbacks=null,s=0;s<j.length;s++)gu(j[s],x)}catch(_){Me(a,a.return,_)}}l&&o&64&&_d(r),Yn(r,r.return);break;case 27:Od(r);case 26:case 5:El(s,r,l),l&&a===null&&o&4&&Md(r),Yn(r,r.return);break;case 12:El(s,r,l);break;case 31:El(s,r,l),l&&o&4&&Hd(s,r);break;case 13:El(s,r,l),l&&o&4&&qd(s,r);break;case 22:r.memoizedState===null&&El(s,r,l),Yn(r,r.return);break;case 30:break;default:El(s,r,l)}t=t.sibling}}function ec(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 tc(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 Jt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Vd(e,t,l,a),t=t.sibling}function Vd(e,t,l,a){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Jt(e,t,l,a),s&2048&&qn(9,t);break;case 1:Jt(e,t,l,a);break;case 3:Jt(e,t,l,a),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){Jt(e,t,l,a),e=t.stateNode;try{var r=t.memoizedProps,o=r.id,x=r.onPostCommit;typeof x=="function"&&x(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Me(t,t.return,j)}}else Jt(e,t,l,a);break;case 31:Jt(e,t,l,a);break;case 13:Jt(e,t,l,a);break;case 23:break;case 22:r=t.stateNode,o=t.alternate,t.memoizedState!==null?r._visibility&2?Jt(e,t,l,a):Gn(e,t):r._visibility&2?Jt(e,t,l,a):(r._visibility|=2,Ia(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),s&2048&&ec(o,t);break;case 24:Jt(e,t,l,a),s&2048&&tc(t.alternate,t);break;default:Jt(e,t,l,a)}}function Ia(e,t,l,a,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,o=t,x=l,j=a,_=o.flags;switch(o.tag){case 0:case 11:case 15:Ia(r,o,x,j,s),qn(8,o);break;case 23:break;case 22:var L=o.stateNode;o.memoizedState!==null?L._visibility&2?Ia(r,o,x,j,s):Gn(r,o):(L._visibility|=2,Ia(r,o,x,j,s)),s&&_&2048&&ec(o.alternate,o);break;case 24:Ia(r,o,x,j,s),s&&_&2048&&tc(o.alternate,o);break;default:Ia(r,o,x,j,s)}t=t.sibling}}function Gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,s=a.flags;switch(a.tag){case 22:Gn(l,a),s&2048&&ec(a.alternate,a);break;case 24:Gn(l,a),s&2048&&tc(a.alternate,a);break;default:Gn(l,a)}t=t.sibling}}var Vn=8192;function Pa(e,t,l){if(e.subtreeFlags&Vn)for(e=e.child;e!==null;)Qd(e,t,l),e=e.sibling}function Qd(e,t,l){switch(e.tag){case 26:Pa(e,t,l),e.flags&Vn&&e.memoizedState!==null&&$p(l,Kt,e.memoizedState,e.memoizedProps);break;case 5:Pa(e,t,l);break;case 3:case 4:var a=Kt;Kt=rr(e.stateNode.containerInfo),Pa(e,t,l),Kt=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Vn,Vn=16777216,Pa(e,t,l),Vn=a):Pa(e,t,l));break;default:Pa(e,t,l)}}function Xd(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 a=t[l];st=a,Kd(a,e)}Xd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zd(e),e=e.sibling}function Zd(e){switch(e.tag){case 0:case 11:case 15:Qn(e),e.flags&2048&&Ql(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,Ks(e)):Qn(e);break;default:Qn(e)}}function Ks(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];st=a,Kd(a,e)}Xd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ql(8,t,t.return),Ks(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Ks(t));break;default:Ks(t)}e=e.sibling}}function Kd(e,t){for(;st!==null;){var l=st;switch(l.tag){case 0:case 11:case 15:Ql(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Cn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,st=a;else e:for(l=e;st!==null;){a=st;var s=a.sibling,r=a.return;if(Bd(a),a===l){st=null;break e}if(s!==null){s.return=r,st=s;break e}st=r}}}var up={getCacheForType:function(e){var t=ct(We),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return ct(We).controller.signal}},dp=typeof WeakMap=="function"?WeakMap:Map,we=0,Be=null,be=null,Se=0,Re=0,wt=null,Xl=!1,en=!1,lc=!1,kl=0,Xe=0,Zl=0,ka=0,ac=0,_t=0,tn=0,Xn=null,jt=null,nc=!1,Js=0,Jd=0,$s=1/0,Ws=null,Kl=null,lt=0,Jl=null,ln=null,Tl=0,sc=0,rc=null,$d=null,Zn=0,ic=null;function Rt(){return(we&2)!==0&&Se!==0?Se&-Se:N.T!==null?xc():uo()}function Wd(){if(_t===0)if((Se&536870912)===0||ke){var e=ol;ol<<=1,(ol&3932160)===0&&(ol=262144),_t=e}else _t=536870912;return e=Ct.current,e!==null&&(e.flags|=32),_t}function St(e,t,l){(e===Be&&(Re===2||Re===9)||e.cancelPendingCommit!==null)&&(an(e,0),$l(e,Se,_t,!1)),ca(e,l),((we&2)===0||e!==Be)&&(e===Be&&((we&2)===0&&(ka|=l),Xe===4&&$l(e,Se,_t,!1)),al(e))}function Fd(e,t,l){if((we&6)!==0)throw Error(d(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Ml(e,t),s=a?mp(e,t):oc(e,t,!0),r=a;do{if(s===0){en&&!a&&$l(e,t,0,!1);break}else{if(l=e.current.alternate,r&&!fp(l)){s=oc(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var x=e;s=Xn;var j=x.current.memoizedState.isDehydrated;if(j&&(an(x,o).flags|=256),o=oc(x,o,!1),o!==2){if(lc&&!j){x.errorRecoveryDisabledLanes|=r,ka|=r,s=4;break e}r=jt,jt=s,r!==null&&(jt===null?jt=r:jt.push.apply(jt,r))}s=o}if(r=!1,s!==2)continue}}if(s===1){an(e,0),$l(e,t,0,!0);break}e:{switch(a=e,r=s,r){case 0:case 1:throw Error(d(345));case 4:if((t&4194048)!==t)break;case 6:$l(a,t,_t,!Xl);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(d(329))}if((t&62914560)===t&&(s=Js+300-ze(),10<s)){if($l(a,t,_t,!Xl),ia(a,0,!0)!==0)break e;Tl=t,a.timeoutHandle=wf(Id.bind(null,a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,"Throttled",-0,0),s);break e}Id(a,l,jt,Ws,nc,t,_t,ka,tn,Xl,r,null,-0,0)}}break}while(!0);al(e)}function Id(e,t,l,a,s,r,o,x,j,_,L,H,M,O){if(e.timeoutHandle=-1,H=t.subtreeFlags,H&8192||(H&16785408)===16785408){H={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dl},Qd(t,r,H);var te=(r&62914560)===r?Js-ze():(r&4194048)===r?Jd-ze():0;if(te=Wp(H,te),te!==null){Tl=r,e.cancelPendingCommit=te(rf.bind(null,e,t,r,l,a,s,o,x,j,L,H,null,M,O)),$l(e,r,o,!_);return}}rf(e,t,r,l,a,s,o,x,j)}function fp(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 a=0;a<l.length;a++){var s=l[a],r=s.getSnapshot;s=s.value;try{if(!kt(r(),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,a){t&=~ac,t&=~ka,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var s=t;0<s;){var r=31-Ge(s),o=1<<r;a[r]=-1,s&=~o}l!==0&&io(e,l,t)}function Fs(){return(we&6)===0?(Kn(0),!1):!0}function cc(){if(be!==null){if(Re===0)var e=be.return;else e=be,pl=ha=null,Ei(e),Ka=null,wn=0,e=be;for(;e!==null;)wd(e.alternate,e),e=e.return;be=null}}function an(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Mp(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Tl=0,cc(),Be=e,be=l=xl(e.current,null),Se=t,Re=0,wt=null,Xl=!1,en=Ml(e,t),lc=!1,tn=_t=ac=ka=Zl=Xe=0,jt=Xn=null,nc=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var s=31-Ge(a),r=1<<s;t|=e[s],a&=~r}return kl=t,ys(),l}function Pd(e,t){xe=null,N.H=Bn,t===Za||t===Ts?(t=pu(),Re=3):t===fi?(t=pu(),Re=4):Re=t===qi?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wt=t,be===null&&(Xe=1,qs(e,Lt(t,e.current)))}function ef(){var e=Ct.current;return e===null?!0:(Se&4194048)===Se?qt===null:(Se&62914560)===Se||(Se&536870912)!==0?e===qt:!1}function tf(){var e=N.H;return N.H=Bn,e===null?Bn:e}function lf(){var e=N.A;return N.A=up,e}function Is(){Xe=4,Xl||(Se&4194048)!==Se&&Ct.current!==null||(en=!0),(Zl&134217727)===0&&(ka&134217727)===0||Be===null||$l(Be,Se,_t,!1)}function oc(e,t,l){var a=we;we|=2;var s=tf(),r=lf();(Be!==e||Se!==t)&&(Ws=null,an(e,t)),t=!1;var o=Xe;e:do try{if(Re!==0&&be!==null){var x=be,j=wt;switch(Re){case 8:cc(),o=6;break e;case 3:case 2:case 9:case 6:Ct.current===null&&(t=!0);var _=Re;if(Re=0,wt=null,nn(e,x,j,_),l&&en){o=0;break e}break;default:_=Re,Re=0,wt=null,nn(e,x,j,_)}}xp(),o=Xe;break}catch(L){Pd(e,L)}while(!0);return t&&e.shellSuspendCounter++,pl=ha=null,we=a,N.H=s,N.A=r,be===null&&(Be=null,Se=0,ys()),o}function xp(){for(;be!==null;)af(be)}function mp(e,t){var l=we;we|=2;var a=tf(),s=lf();Be!==e||Se!==t?(Ws=null,$s=ze()+500,an(e,t)):en=Ml(e,t);e:do try{if(Re!==0&&be!==null){t=be;var r=wt;t:switch(Re){case 1:Re=0,wt=null,nn(e,t,r,1);break;case 2:case 9:if(xu(r)){Re=0,wt=null,nf(t);break}t=function(){Re!==2&&Re!==9||Be!==e||(Re=7),al(e)},r.then(t,t);break e;case 3:Re=7;break e;case 4:Re=5;break e;case 7:xu(r)?(Re=0,wt=null,nf(t)):(Re=0,wt=null,nn(e,t,r,7));break;case 5:var o=null;switch(be.tag){case 26:o=be.memoizedState;case 5:case 27:var x=be;if(o?Qf(o):x.stateNode.complete){Re=0,wt=null;var j=x.sibling;if(j!==null)be=j;else{var _=x.return;_!==null?(be=_,Ps(_)):be=null}break t}}Re=0,wt=null,nn(e,t,r,5);break;case 6:Re=0,wt=null,nn(e,t,r,6);break;case 8:cc(),Xe=6;break e;default:throw Error(d(462))}}pp();break}catch(L){Pd(e,L)}while(!0);return pl=ha=null,N.H=a,N.A=s,we=l,be!==null?0:(Be=null,Se=0,ys(),Xe)}function pp(){for(;be!==null&&!il();)af(be)}function af(e){var t=Cd(e.alternate,e,kl);e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function nf(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=jd(l,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=jd(l,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Ei(t);default:wd(l,t),t=be=lu(t,kl),t=Cd(l,t,kl)}e.memoizedProps=e.pendingProps,t===null?Ps(e):be=t}function nn(e,t,l,a){pl=ha=null,Ei(t),Ka=null,wn=0;var s=t.return;try{if(ap(e,s,t,l,Se)){Xe=1,qs(e,Lt(l,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Xe=1,qs(e,Lt(l,e.current)),be=null;return}t.flags&32768?(ke||a===1?e=!0:en||(Se&536870912)!==0?e=!1:(Xl=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ct.current,a!==null&&a.tag===13&&(a.flags|=16384))),sf(t,e)):Ps(t)}function Ps(e){var t=e;do{if((t.flags&32768)!==0){sf(t,Xl);return}e=t.return;var l=rp(t.alternate,t,kl);if(l!==null){be=l;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Xe===0&&(Xe=5)}function sf(e,t){do{var l=ip(e.alternate,e);if(l!==null){l.flags&=32767,be=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=l}while(e!==null);Xe=6,be=null}function rf(e,t,l,a,s,r,o,x,j){e.cancelPendingCommit=null;do er();while(lt!==0);if((we&6)!==0)throw Error(d(327));if(t!==null){if(t===e.current)throw Error(d(177));if(r=t.lanes|t.childLanes,r|=Fr,Jx(e,l,r,o,x,j),e===Be&&(be=Be=null,Se=0),ln=t,Jl=e,Tl=l,sc=r,rc=s,$d=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,gp(_e,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=N.T,N.T=null,s=A.p,A.p=2,o=we,we|=4;try{cp(e,t,l)}finally{we=o,A.p=s,N.T=a}}lt=1,cf(),of(),uf()}}function cf(){if(lt===1){lt=0;var e=Jl,t=ln,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Yd(t,e);var r=jc,o=Ko(e.containerInfo),x=r.focusedElem,j=r.selectionRange;if(o!==x&&x&&x.ownerDocument&&Zo(x.ownerDocument.documentElement,x)){if(j!==null&&Zr(x)){var _=j.start,L=j.end;if(L===void 0&&(L=_),"selectionStart"in x)x.selectionStart=_,x.selectionEnd=Math.min(L,x.value.length);else{var H=x.ownerDocument||document,M=H&&H.defaultView||window;if(M.getSelection){var O=M.getSelection(),te=x.textContent.length,oe=Math.min(j.start,te),Le=j.end===void 0?oe:Math.min(j.end,te);!O.extend&&oe>Le&&(o=Le,Le=oe,oe=o);var C=Xo(x,oe),k=Xo(x,Le);if(C&&k&&(O.rangeCount!==1||O.anchorNode!==C.node||O.anchorOffset!==C.offset||O.focusNode!==k.node||O.focusOffset!==k.offset)){var w=H.createRange();w.setStart(C.node,C.offset),O.removeAllRanges(),oe>Le?(O.addRange(w),O.extend(k.node,k.offset)):(w.setEnd(k.node,k.offset),O.addRange(w))}}}}for(H=[],O=x;O=O.parentNode;)O.nodeType===1&&H.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var U=H[x];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}fr=!!bc,jc=bc=null}finally{we=s,A.p=a,N.T=l}}e.current=t,lt=2}}function of(){if(lt===2){lt=0;var e=Jl,t=ln,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=N.T,N.T=null;var a=A.p;A.p=2;var s=we;we|=4;try{Ld(e,t.alternate,t)}finally{we=s,A.p=a,N.T=l}}lt=3}}function uf(){if(lt===4||lt===3){lt=0,I();var e=Jl,t=ln,l=Tl,a=$d;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?lt=5:(lt=0,ln=Jl=null,df(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Kl=null),Cr(l),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot=="function")try{Ve.onCommitFiberRoot(Mt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=N.T,s=A.p,A.p=2,N.T=null;try{for(var r=e.onRecoverableError,o=0;o<a.length;o++){var x=a[o];r(x.value,{componentStack:x.stack})}}finally{N.T=t,A.p=s}}(Tl&3)!==0&&er(),al(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===ic?Zn++:(Zn=0,ic=e):Zn=0,Kn(0)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Cn(t)))}function er(){return cf(),of(),uf(),ff()}function ff(){if(lt!==5)return!1;var e=Jl,t=sc;sc=0;var l=Cr(Tl),a=N.T,s=A.p;try{A.p=32>l?32:l,N.T=null,l=rc,rc=null;var r=Jl,o=Tl;if(lt=0,ln=Jl=null,Tl=0,(we&6)!==0)throw Error(d(331));var x=we;if(we|=4,Zd(r.current),Vd(r,r.current,o,l),we=x,Kn(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot=="function")try{Ve.onPostCommitFiberRoot(Mt,r)}catch{}return!0}finally{A.p=s,N.T=a,df(e,t)}}function xf(e,t,l){t=Lt(l,t),t=Hi(e.stateNode,t,2),e=Yl(e,t,2),e!==null&&(ca(e,2),al(e))}function Me(e,t,l){if(e.tag===3)xf(e,e,l);else for(;t!==null;){if(t.tag===3){xf(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Kl===null||!Kl.has(a))){e=Lt(l,e),l=xd(2),a=Yl(t,l,2),a!==null&&(md(l,a,t,e),ca(a,2),al(a));break}}t=t.return}}function uc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new dp;var s=new Set;a.set(t,s)}else s=a.get(t),s===void 0&&(s=new Set,a.set(t,s));s.has(l)||(lc=!0,s.add(l),e=hp.bind(null,e,t,l),t.then(e,e))}function hp(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Be===e&&(Se&l)===l&&(Xe===4||Xe===3&&(Se&62914560)===Se&&300>ze()-Js?(we&2)===0&&an(e,0):ac|=l,tn===Se&&(tn=0)),al(e)}function mf(e,t){t===0&&(t=fn()),e=xa(e,t),e!==null&&(ca(e,t),al(e))}function vp(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),mf(e,l)}function yp(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(d(314))}a!==null&&a.delete(t),mf(e,l)}function gp(e,t){return Vt(e,t)}var tr=null,sn=null,dc=!1,lr=!1,fc=!1,Wl=0;function al(e){e!==sn&&e.next===null&&(sn===null?tr=sn=e:sn=sn.next=e),lr=!0,dc||(dc=!0,jp())}function Kn(e,t){if(!fc&&lr){fc=!0;do for(var l=!1,a=tr;a!==null;){if(e!==0){var s=a.pendingLanes;if(s===0)var r=0;else{var o=a.suspendedLanes,x=a.pingedLanes;r=(1<<31-Ge(42|e)+1)-1,r&=s&~(o&~x),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,yf(a,r))}else r=Se,r=ia(a,a===Be?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||Ml(a,r)||(l=!0,yf(a,r));a=a.next}while(l);fc=!1}}function bp(){pf()}function pf(){lr=dc=!1;var e=0;Wl!==0&&Rp()&&(e=Wl);for(var t=ze(),l=null,a=tr;a!==null;){var s=a.next,r=hf(a,t);r===0?(a.next=null,l===null?tr=s:l.next=s,s===null&&(sn=l)):(l=a,(e!==0||(r&3)!==0)&&(lr=!0)),a=s}lt!==0&<!==5||Kn(e),Wl!==0&&(Wl=0)}function hf(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var o=31-Ge(r),x=1<<o,j=s[o];j===-1?((x&l)===0||(x&a)!==0)&&(s[o]=rs(x,t)):j<=t&&(e.expiredLanes|=x),r&=~x}if(t=Be,l=Se,l=ia(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(Re===2||Re===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Rl(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ml(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Rl(a),Cr(l)){case 2:case 8:l=$;break;case 32:l=_e;break;case 268435456:l=Nt;break;default:l=_e}return a=vf.bind(null,e),l=Vt(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Rl(a),e.callbackPriority=2,e.callbackNode=null,2}function vf(e,t){if(lt!==0&<!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(er()&&e.callbackNode!==l)return null;var a=Se;return a=ia(e,e===Be?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Fd(e,a,t),hf(e,ze()),e.callbackNode!=null&&e.callbackNode===l?vf.bind(null,e):null)}function yf(e,t){if(er())return null;Fd(e,t,!0)}function jp(){zp(function(){(we&6)!==0?Vt(Qt,bp):pf()})}function xc(){if(Wl===0){var e=Qa;e===0&&(e=tt,tt<<=1,(tt&261888)===0&&(tt=256)),Wl=e}return Wl}function gf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:us(""+e)}function bf(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 Sp(e,t,l,a,s){if(t==="submit"&&l&&l.stateNode===s){var r=gf((s[ht]||null).action),o=a.submitter;o&&(t=(t=o[ht]||null)?gf(t.formAction):o.getAttribute("formAction"),t!==null&&(r=t,o=null));var x=new ms("action","action",null,a,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Wl!==0){var j=o?bf(s,o):new FormData(s);zi(l,{pending:!0,data:j,method:s.method,action:r},null,j)}}else typeof r=="function"&&(x.preventDefault(),j=o?bf(s,o):new FormData(s),zi(l,{pending:!0,data:j,method:s.method,action:r},r,j))},currentTarget:s}]})}}for(var mc=0;mc<Wr.length;mc++){var pc=Wr[mc],Np=pc.toLowerCase(),Ep=pc[0].toUpperCase()+pc.slice(1);Zt(Np,"on"+Ep)}Zt(Wo,"onAnimationEnd"),Zt(Fo,"onAnimationIteration"),Zt(Io,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(qm,"onTransitionRun"),Zt(Ym,"onTransitionStart"),Zt(Gm,"onTransitionCancel"),Zt(Po,"onTransitionEnd"),_a("onMouseEnter",["mouseout","mouseover"]),_a("onMouseLeave",["mouseout","mouseover"]),_a("onPointerEnter",["pointerout","pointerover"]),_a("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),kp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function jf(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],s=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var o=a.length-1;0<=o;o--){var x=a[o],j=x.instance,_=x.currentTarget;if(x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}else for(o=0;o<a.length;o++){if(x=a[o],j=x.instance,_=x.currentTarget,x=x.listener,j!==r&&s.isPropagationStopped())break e;r=x,s.currentTarget=_;try{r(s)}catch(L){vs(L)}s.currentTarget=null,r=j}}}}function je(e,t){var l=t[Ar];l===void 0&&(l=t[Ar]=new Set);var a=e+"__bubble";l.has(a)||(Sf(t,e,2,!1),l.add(a))}function hc(e,t,l){var a=0;t&&(a|=4),Sf(l,e,a,t)}var ar="_reactListening"+Math.random().toString(36).slice(2);function vc(e){if(!e[ar]){e[ar]=!0,mo.forEach(function(l){l!=="selectionchange"&&(kp.has(l)||hc(l,!1,e),hc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ar]||(t[ar]=!0,hc("selectionchange",!1,t))}}function Sf(e,t,l,a){switch(Ff(t)){case 2:var s=Pp;break;case 8:s=eh;break;default:s=Mc}l=s.bind(null,t,l,e),s=void 0,!Br||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),a?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 yc(e,t,l,a,s){var r=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var o=a.tag;if(o===3||o===4){var x=a.stateNode.containerInfo;if(x===s)break;if(o===4)for(o=a.return;o!==null;){var j=o.tag;if((j===3||j===4)&&o.stateNode.containerInfo===s)return;o=o.return}for(;x!==null;){if(o=Ca(x),o===null)return;if(j=o.tag,j===5||j===6||j===26||j===27){a=r=o;continue e}x=x.parentNode}}a=a.return}To(function(){var _=r,L=Dr(l),H=[];e:{var M=eu.get(e);if(M!==void 0){var O=ms,te=e;switch(e){case"keypress":if(fs(l)===0)break e;case"keydown":case"keyup":O=ym;break;case"focusin":te="focus",O=Yr;break;case"focusout":te="blur",O=Yr;break;case"beforeblur":case"afterblur":O=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":O=wo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=rm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=jm;break;case Wo:case Fo:case Io:O=om;break;case Po:O=Nm;break;case"scroll":case"scrollend":O=nm;break;case"wheel":O=km;break;case"copy":case"cut":case"paste":O=dm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Ro;break;case"toggle":case"beforetoggle":O=Cm}var oe=(t&4)!==0,Le=!oe&&(e==="scroll"||e==="scrollend"),C=oe?M!==null?M+"Capture":null:M;oe=[];for(var k=_,w;k!==null;){var U=k;if(w=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||w===null||C===null||(U=hn(k,C),U!=null&&oe.push($n(k,U,w))),Le)break;k=k.return}0<oe.length&&(M=new O(M,te,null,l,L),H.push({event:M,listeners:oe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",M&&l!==Or&&(te=l.relatedTarget||l.fromElement)&&(Ca(te)||te[Ta]))break e;if((O||M)&&(M=L.window===L?L:(M=L.ownerDocument)?M.defaultView||M.parentWindow:window,O?(te=l.relatedTarget||l.toElement,O=_,te=te?Ca(te):null,te!==null&&(Le=h(te),oe=te.tag,te!==Le||oe!==5&&oe!==27&&oe!==6)&&(te=null)):(O=null,te=_),O!==te)){if(oe=wo,U="onMouseLeave",C="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(oe=Ro,U="onPointerLeave",C="onPointerEnter",k="pointer"),Le=O==null?M:pn(O),w=te==null?M:pn(te),M=new oe(U,k+"leave",O,l,L),M.target=Le,M.relatedTarget=w,U=null,Ca(L)===_&&(oe=new oe(C,k+"enter",te,l,L),oe.target=w,oe.relatedTarget=Le,U=oe),Le=U,O&&te)t:{for(oe=Tp,C=O,k=te,w=0,U=C;U;U=oe(U))w++;U=0;for(var ie=k;ie;ie=oe(ie))U++;for(;0<w-U;)C=oe(C),w--;for(;0<U-w;)k=oe(k),U--;for(;w--;){if(C===k||k!==null&&C===k.alternate){oe=C;break t}C=oe(C),k=oe(k)}oe=null}else oe=null;O!==null&&Nf(H,M,O,oe,!1),te!==null&&Le!==null&&Nf(H,Le,te,oe,!0)}}e:{if(M=_?pn(_):window,O=M.nodeName&&M.nodeName.toLowerCase(),O==="select"||O==="input"&&M.type==="file")var Ce=Ho;else if(Bo(M))if(qo)Ce=Bm;else{Ce=Dm;var ne=Om}else O=M.nodeName,!O||O.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?_&&zr(_.elementType)&&(Ce=Ho):Ce=Lm;if(Ce&&(Ce=Ce(e,_))){Uo(H,Ce,l,L);break e}ne&&ne(e,M,_),e==="focusout"&&_&&M.type==="number"&&_.memoizedProps.value!=null&&Mr(M,"number",M.value)}switch(ne=_?pn(_):window,e){case"focusin":(Bo(ne)||ne.contentEditable==="true")&&(La=ne,Kr=_,En=null);break;case"focusout":En=Kr=La=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,Jo(H,l,L);break;case"selectionchange":if(Hm)break;case"keydown":case"keyup":Jo(H,l,L)}var me;if(Vr)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Da?Do(e,l)&&(Ne="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ne="onCompositionStart");Ne&&(Mo&&l.locale!=="ko"&&(Da||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Da&&(me=Co()):(Ol=L,Ur="value"in Ol?Ol.value:Ol.textContent,Da=!0)),ne=nr(_,Ne),0<ne.length&&(Ne=new _o(Ne,e,null,l,L),H.push({event:Ne,listeners:ne}),me?Ne.data=me:(me=Lo(l),me!==null&&(Ne.data=me)))),(me=wm?_m(e,l):Rm(e,l))&&(Ne=nr(_,"onBeforeInput"),0<Ne.length&&(ne=new _o("onBeforeInput","beforeinput",null,l,L),H.push({event:ne,listeners:Ne}),ne.data=me)),Sp(H,e,_,l,L)}jf(H,t)})}function $n(e,t,l){return{instance:e,listener:t,currentTarget:l}}function nr(e,t){for(var l=t+"Capture",a=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=hn(e,l),s!=null&&a.unshift($n(e,s,r)),s=hn(e,t),s!=null&&a.push($n(e,s,r))),e.tag===3)return a;e=e.return}return[]}function Tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nf(e,t,l,a,s){for(var r=t._reactName,o=[];l!==null&&l!==a;){var x=l,j=x.alternate,_=x.stateNode;if(x=x.tag,j!==null&&j===a)break;x!==5&&x!==26&&x!==27||_===null||(j=_,s?(_=hn(l,r),_!=null&&o.unshift($n(l,_,j))):s||(_=hn(l,r),_!=null&&o.push($n(l,_,j)))),l=l.return}o.length!==0&&e.push({event:t,listeners:o})}var Cp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function Ef(e){return(typeof e=="string"?e:""+e).replace(Cp,`
|
|
49
|
+
`).replace(Ap,"")}function kf(e,t){return t=Ef(t),Ef(e)===t}function De(e,t,l,a,s,r){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ma(e,""+a);break;case"className":cs(e,"class",a);break;case"tabIndex":cs(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(e,l,a);break;case"style":Eo(e,a,r);break;case"data":if(t!=="object"){cs(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="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 r=="function"&&(l==="formAction"?(t!=="input"&&De(e,t,"name",s.name,s,null),De(e,t,"formEncType",s.formEncType,s,null),De(e,t,"formMethod",s.formMethod,s,null),De(e,t,"formTarget",s.formTarget,s,null)):(De(e,t,"encType",s.encType,s,null),De(e,t,"method",s.method,s,null),De(e,t,"target",s.target,s,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=us(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=dl);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=us(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":je("beforetoggle",e),je("toggle",e),is(e,"popover",a);break;case"xlinkActuate":ul(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ul(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ul(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ul(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ul(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ul(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ul(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ul(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ul(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":is(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=lm.get(l)||l,is(e,l,a))}}function gc(e,t,l,a,s,r){switch(l){case"style":Eo(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(d(61));if(l=a.__html,l!=null){if(s.children!=null)throw Error(d(60));e.innerHTML=l}}break;case"children":typeof a=="string"?Ma(e,a):(typeof a=="number"||typeof a=="bigint")&&Ma(e,""+a);break;case"onScroll":a!=null&&je("scroll",e);break;case"onScrollEnd":a!=null&&je("scrollend",e);break;case"onClick":a!=null&&(e.onclick=dl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!po.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),r=e[ht]||null,r=r!=null?r[l]:null,typeof r=="function"&&e.removeEventListener(t,r,s),typeof a=="function")){typeof r!="function"&&r!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,s);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):is(e,l,a)}}}function ut(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var a=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var o=l[r];if(o!=null)switch(r){case"src":a=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,r,o,l,null)}}s&&De(e,t,"srcSet",l.srcSet,l,null),a&&De(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var x=r=o=s=null,j=null,_=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":s=L;break;case"type":o=L;break;case"checked":j=L;break;case"defaultChecked":_=L;break;case"value":r=L;break;case"defaultValue":x=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(d(137,t));break;default:De(e,t,a,L,l,null)}}bo(e,r,x,j,_,o,s,!1);return;case"select":je("invalid",e),a=o=r=null;for(s in l)if(l.hasOwnProperty(s)&&(x=l[s],x!=null))switch(s){case"value":r=x;break;case"defaultValue":o=x;break;case"multiple":a=x;default:De(e,t,s,x,l,null)}t=r,l=o,e.multiple=!!a,t!=null?Ra(e,!!a,t,!1):l!=null&&Ra(e,!!a,l,!0);return;case"textarea":je("invalid",e),r=s=a=null;for(o in l)if(l.hasOwnProperty(o)&&(x=l[o],x!=null))switch(o){case"value":a=x;break;case"defaultValue":s=x;break;case"children":r=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(d(91));break;default:De(e,t,o,x,l,null)}So(e,a,s,r);return;case"option":for(j in l)if(l.hasOwnProperty(j)&&(a=l[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:De(e,t,j,a,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(a=0;a<Jn.length;a++)je(Jn[a],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("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(_)&&(a=l[_],a!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(d(137,t));default:De(e,t,_,a,l,null)}return;default:if(zr(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&gc(e,t,L,a,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(a=l[x],a!=null&&De(e,t,x,a,l,null))}function wp(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,o=null,x=null,j=null,_=null,L=null;for(O in l){var H=l[O];if(l.hasOwnProperty(O)&&H!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":j=H;default:a.hasOwnProperty(O)||De(e,t,O,null,a,H)}}for(var M in a){var O=a[M];if(H=l[M],a.hasOwnProperty(M)&&(O!=null||H!=null))switch(M){case"type":r=O;break;case"name":s=O;break;case"checked":_=O;break;case"defaultChecked":L=O;break;case"value":o=O;break;case"defaultValue":x=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(d(137,t));break;default:O!==H&&De(e,t,M,O,a,H)}}Rr(e,o,x,j,_,L,r,s);return;case"select":O=o=x=M=null;for(r in l)if(j=l[r],l.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":O=j;default:a.hasOwnProperty(r)||De(e,t,r,null,a,j)}for(s in a)if(r=a[s],j=l[s],a.hasOwnProperty(s)&&(r!=null||j!=null))switch(s){case"value":M=r;break;case"defaultValue":x=r;break;case"multiple":o=r;default:r!==j&&De(e,t,s,r,a,j)}t=x,l=o,a=O,M!=null?Ra(e,!!l,M,!1):!!a!=!!l&&(t!=null?Ra(e,!!l,t,!0):Ra(e,!!l,l?[]:"",!1));return;case"textarea":O=M=null;for(x in l)if(s=l[x],l.hasOwnProperty(x)&&s!=null&&!a.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:De(e,t,x,null,a,s)}for(o in a)if(s=a[o],r=l[o],a.hasOwnProperty(o)&&(s!=null||r!=null))switch(o){case"value":M=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(d(91));break;default:s!==r&&De(e,t,o,s,a,r)}jo(e,M,O);return;case"option":for(var te in l)if(M=l[te],l.hasOwnProperty(te)&&M!=null&&!a.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:De(e,t,te,null,a,M)}for(j in a)if(M=a[j],O=l[j],a.hasOwnProperty(j)&&M!==O&&(M!=null||O!=null))switch(j){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:De(e,t,j,M,a,O)}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 oe in l)M=l[oe],l.hasOwnProperty(oe)&&M!=null&&!a.hasOwnProperty(oe)&&De(e,t,oe,null,a,M);for(_ in a)if(M=a[_],O=l[_],a.hasOwnProperty(_)&&M!==O&&(M!=null||O!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(d(137,t));break;default:De(e,t,_,M,a,O)}return;default:if(zr(t)){for(var Le in l)M=l[Le],l.hasOwnProperty(Le)&&M!==void 0&&!a.hasOwnProperty(Le)&&gc(e,t,Le,void 0,a,M);for(L in a)M=a[L],O=l[L],!a.hasOwnProperty(L)||M===O||M===void 0&&O===void 0||gc(e,t,L,M,a,O);return}}for(var C in l)M=l[C],l.hasOwnProperty(C)&&M!=null&&!a.hasOwnProperty(C)&&De(e,t,C,null,a,M);for(H in a)M=a[H],O=l[H],!a.hasOwnProperty(H)||M===O||M==null&&O==null||De(e,t,H,M,a,O)}function Tf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var s=l[a],r=s.transferSize,o=s.initiatorType,x=s.duration;if(r&&x&&Tf(o)){for(o=0,x=s.responseEnd,a+=1;a<l.length;a++){var j=l[a],_=j.startTime;if(_>x)break;var L=j.transferSize,H=j.initiatorType;L&&Tf(H)&&(j=j.responseEnd,o+=L*(j<x?1:(x-_)/(j-_)))}if(--a,t+=8*(r+o)/(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 bc=null,jc=null;function sr(e){return e.nodeType===9?e:e.ownerDocument}function Cf(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 Sc(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 Nc=null;function Rp(){var e=window.event;return e&&e.type==="popstate"?e===Nc?!1:(Nc=e,!0):(Nc=null,!1)}var wf=typeof setTimeout=="function"?setTimeout:void 0,Mp=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,zp=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(Op)}:wf;function Op(e){setTimeout(function(){throw e})}function Fl(e){return e==="head"}function Rf(e,t){var l=t,a=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(s),un(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")Wn(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Wn(l);for(var r=l.firstChild;r;){var o=r.nextSibling,x=r.nodeName;r[mn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=o}}else l==="body"&&Wn(e.ownerDocument.body);l=s}while(l);un(t)}function Mf(e,t){var l=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Ec(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":Ec(l),wr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Dp(e,t,l,a){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[mn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==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(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Yt(e.nextSibling),e===null)break}return null}function Lp(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Yt(e.nextSibling),e===null))return null;return e}function zf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Yt(e.nextSibling),e===null))return null;return e}function kc(e){return e.data==="$?"||e.data==="$~"}function Tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Bp(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yt(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 Cc=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Yt(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Df(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 Lf(e,t,l){switch(t=sr(l),e){case"html":if(e=t.documentElement,!e)throw Error(d(452));return e;case"head":if(e=t.head,!e)throw Error(d(453));return e;case"body":if(e=t.body,!e)throw Error(d(454));return e;default:throw Error(d(451))}}function Wn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wr(e)}var Gt=new Map,Bf=new Set;function rr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cl=A.d;A.d={f:Up,r:Hp,D:qp,C:Yp,L:Gp,m:Vp,X:Xp,S:Qp,M:Zp};function Up(){var e=Cl.f(),t=Fs();return e||t}function Hp(e){var t=Aa(e);t!==null&&t.tag===5&&t.type==="form"?Pu(t):Cl.r(e)}var rn=typeof document>"u"?null:document;function Uf(e,t,l){var a=rn;if(a&&typeof t=="string"&&t){var s=Ot(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Bf.has(s)||(Bf.add(s),e={rel:e,crossOrigin:l,href:t},a.querySelector(s)===null&&(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function qp(e){Cl.D(e),Uf("dns-prefetch",e,null)}function Yp(e,t){Cl.C(e,t),Uf("preconnect",e,t)}function Gp(e,t,l){Cl.L(e,t,l);var a=rn;if(a&&e&&t){var s='link[rel="preload"][as="'+Ot(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Ot(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Ot(l.imageSizes)+'"]')):s+='[href="'+Ot(e)+'"]';var r=s;switch(t){case"style":r=cn(e);break;case"script":r=on(e)}Gt.has(r)||(e=y({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Gt.set(r,e),a.querySelector(s)!==null||t==="style"&&a.querySelector(Fn(r))||t==="script"&&a.querySelector(In(r))||(t=a.createElement("link"),ut(t,"link",e),nt(t),a.head.appendChild(t)))}}function Vp(e,t){Cl.m(e,t);var l=rn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Ot(a)+'"][href="'+Ot(e)+'"]',r=s;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=on(e)}if(!Gt.has(r)&&(e=y({rel:"modulepreload",href:e},t),Gt.set(r,e),l.querySelector(s)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(In(r)))return}a=l.createElement("link"),ut(a,"link",e),nt(a),l.head.appendChild(a)}}}function Qp(e,t,l){Cl.S(e,t,l);var a=rn;if(a&&e){var s=wa(a).hoistableStyles,r=cn(e);t=t||"default";var o=s.get(r);if(!o){var x={loading:0,preload:null};if(o=a.querySelector(Fn(r)))x.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Gt.get(r))&&Ac(e,l);var j=o=a.createElement("link");nt(j),ut(j,"link",e),j._p=new Promise(function(_,L){j.onload=_,j.onerror=L}),j.addEventListener("load",function(){x.loading|=1}),j.addEventListener("error",function(){x.loading|=2}),x.loading|=4,ir(o,t,a)}o={type:"stylesheet",instance:o,count:1,state:x},s.set(r,o)}}}function Xp(e,t){Cl.X(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=y({src:e,async:!0},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Zp(e,t){Cl.M(e,t);var l=rn;if(l&&e){var a=wa(l).hoistableScripts,s=on(e),r=a.get(s);r||(r=l.querySelector(In(s)),r||(e=y({src:e,async:!0,type:"module"},t),(t=Gt.get(s))&&wc(e,t),r=l.createElement("script"),nt(r),ut(r,"link",e),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(s,r))}}function Hf(e,t,l,a){var s=(s=Q.current)?rr(s):null;if(!s)throw Error(d(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=cn(l.href),l=wa(s).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=cn(l.href);var r=wa(s).hoistableStyles,o=r.get(e);if(o||(s=s.ownerDocument||s,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,o),(r=s.querySelector(Fn(e)))&&!r._p&&(o.instance=r,o.state.loading=5),Gt.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},Gt.set(e,l),r||Kp(s,e,l,o.state))),t&&a===null)throw Error(d(528,""));return o}if(t&&a!==null)throw Error(d(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,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,e))}}function cn(e){return'href="'+Ot(e)+'"'}function Fn(e){return'link[rel="stylesheet"]['+e+"]"}function qf(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Kp(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),ut(t,"link",l),nt(t),e.head.appendChild(t))}function on(e){return'[src="'+Ot(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 a=e.querySelector('style[data-href~="'+Ot(l.href)+'"]');if(a)return t.instance=a,nt(a),a;var s=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),nt(a),ut(a,"style",s),ir(a,l.precedence,e),t.instance=a;case"stylesheet":s=cn(l.href);var r=e.querySelector(Fn(s));if(r)return t.state.loading|=4,t.instance=r,nt(r),r;a=qf(l),(s=Gt.get(s))&&Ac(a,s),r=(e.ownerDocument||e).createElement("link"),nt(r);var o=r;return o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),t.state.loading|=4,ir(r,l.precedence,e),t.instance=r;case"script":return r=on(l.src),(s=e.querySelector(In(r)))?(t.instance=s,nt(s),s):(a=l,(s=Gt.get(r))&&(a=y({},l),wc(a,s)),e=e.ownerDocument||e,s=e.createElement("script"),nt(s),ut(s,"link",a),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ir(a,l.precedence,e));return t.instance}function ir(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=a.length?a[a.length-1]:null,r=s,o=0;o<a.length;o++){var x=a[o];if(x.dataset.precedence===t)r=x;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var cr=null;function Gf(e,t,l){if(cr===null){var a=new Map,s=cr=new Map;s.set(l,a)}else s=cr,a=s.get(l),a||(a=new Map,s.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var r=l[s];if(!(r[mn]||r[rt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var o=r.getAttribute(t)||"";o=e+o;var x=a.get(o);x?x.push(r):a.set(o,[r])}}return a}function Vf(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Jp(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 Qf(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $p(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=cn(a.href),r=t.querySelector(Fn(s));if(r){t=r._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=r,nt(r);return}r=t.ownerDocument||t,a=qf(a),(s=Gt.get(s))&&Ac(a,s),r=r.createElement("link"),nt(r);var o=r;o._p=new Promise(function(x,j){o.onload=x,o.onerror=j}),ut(r,"link",a),l.instance=r}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 _c=0;function Wp(e,t){return e.stylesheets&&e.count===0&&dr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&_c===0&&(_c=62500*_p());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dr(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>_c?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(s)}}:null}function or(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ur=null;function dr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ur=new Map,t.forEach(Fp,e),ur=null,or.call(e))}function Fp(e,t){if(!(t.state.loading&4)){var l=ur.get(e);if(l)var a=l.get(null);else{l=new Map,ur.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var o=s[r];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(l.set(o.dataset.precedence,o),a=o)}a&&l.set(null,a)}s=t.instance,o=s.getAttribute("data-precedence"),r=l.get(o)||a,r===a&&l.set(null,s),l.set(o,s),this.count++,a=or.bind(this),s.addEventListener("load",a),s.addEventListener("error",a),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Pn={$$typeof:se,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function Ip(e,t,l,a,s,r,o,x,j){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=xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.hiddenUpdates=xn(null),this.identifierPrefix=a,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function Xf(e,t,l,a,s,r,o,x,j,_,L,H){return e=new Ip(e,t,l,o,j,_,L,H,x),t=1,r===!0&&(t|=24),r=Tt(3,null,null,t),e.current=r,r.stateNode=e,t=oi(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:l,cache:t},xi(r),e}function Zf(e){return e?(e=Ha,e):Ha}function Kf(e,t,l,a,s,r){s=Zf(s),a.context===null?a.context=s:a.pendingContext=s,a=ql(t),a.payload={element:l},r=r===void 0?null:r,r!==null&&(a.callback=r),l=Yl(e,a,t),l!==null&&(St(l,e,t),Rn(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 Rc(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function $f(e){if(e.tag===13||e.tag===31){var t=xa(e,67108864);t!==null&&St(t,e,67108864),Rc(e,67108864)}}function Wf(e){if(e.tag===13||e.tag===31){var t=Rt();t=Tr(t);var l=xa(e,t);l!==null&&St(l,e,t),Rc(e,t)}}var fr=!0;function Pp(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=2,Mc(e,t,l,a)}finally{A.p=r,N.T=s}}function eh(e,t,l,a){var s=N.T;N.T=null;var r=A.p;try{A.p=8,Mc(e,t,l,a)}finally{A.p=r,N.T=s}}function Mc(e,t,l,a){if(fr){var s=zc(a);if(s===null)yc(e,t,a,xr,l),If(e,a);else if(lh(s,e,t,l,a))a.stopPropagation();else if(If(e,a),t&4&&-1<th.indexOf(e)){for(;s!==null;){var r=Aa(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var o=Pt(r.pendingLanes);if(o!==0){var x=r;for(x.pendingLanes|=2,x.entangledLanes|=2;o;){var j=1<<31-Ge(o);x.entanglements[1]|=j,o&=~j}al(r),(we&6)===0&&($s=ze()+500,Kn(0))}}break;case 31:case 13:x=xa(r,2),x!==null&&St(x,r,2),Fs(),Rc(r,2)}if(r=zc(a),r===null&&yc(e,t,a,xr,l),r===s)break;s=r}s!==null&&a.stopPropagation()}else yc(e,t,a,null,l)}}function zc(e){return e=Dr(e),Oc(e)}var xr=null;function Oc(e){if(xr=null,e=Ca(e),e!==null){var t=h(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 xr=e,null}function Ff(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(mt()){case Qt:return 2;case $:return 8;case _e:case Xt:return 32;case Nt:return 268435456;default:return 32}default:return 32}}var Dc=!1,Il=null,Pl=null,ea=null,es=new Map,ts=new Map,ta=[],th="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 If(e,t){switch(e){case"focusin":case"focusout":Il=null;break;case"dragenter":case"dragleave":Pl=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":es.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ts.delete(t.pointerId)}}function ls(e,t,l,a,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Aa(t),t!==null&&$f(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lh(e,t,l,a,s){switch(t){case"focusin":return Il=ls(Il,e,t,l,a,s),!0;case"dragenter":return Pl=ls(Pl,e,t,l,a,s),!0;case"mouseover":return ea=ls(ea,e,t,l,a,s),!0;case"pointerover":var r=s.pointerId;return es.set(r,ls(es.get(r)||null,e,t,l,a,s)),!0;case"gotpointercapture":return r=s.pointerId,ts.set(r,ls(ts.get(r)||null,e,t,l,a,s)),!0}return!1}function Pf(e){var t=Ca(e.target);if(t!==null){var l=h(t);if(l!==null){if(t=l.tag,t===13){if(t=p(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(l)});return}}else if(t===31){if(t=b(l),t!==null){e.blockedOn=t,fo(e.priority,function(){Wf(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 mr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=zc(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Or=a,l.target.dispatchEvent(a),Or=null}else return t=Aa(l),t!==null&&$f(t),e.blockedOn=l,!1;t.shift()}return!0}function ex(e,t,l){mr(e)&&l.delete(t)}function ah(){Dc=!1,Il!==null&&mr(Il)&&(Il=null),Pl!==null&&mr(Pl)&&(Pl=null),ea!==null&&mr(ea)&&(ea=null),es.forEach(ex),ts.forEach(ex)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Dc||(Dc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,ah)))}var hr=null;function tx(e){hr!==e&&(hr=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){hr===e&&(hr=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],s=e[t+2];if(typeof a!="function"){if(Oc(a||l)===null)continue;break}var r=Aa(l);r!==null&&(e.splice(t,3),t-=3,zi(r,{pending:!0,data:s,method:l.method,action:a},a,s))}}))}function un(e){function t(j){return pr(j,e)}Il!==null&&pr(Il,e),Pl!==null&&pr(Pl,e),ea!==null&&pr(ea,e),es.forEach(t),ts.forEach(t);for(var l=0;l<ta.length;l++){var a=ta[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ta.length&&(l=ta[0],l.blockedOn===null);)Pf(l),l.blockedOn===null&&ta.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var s=l[a],r=l[a+1],o=s[ht]||null;if(typeof r=="function")o||tx(l);else if(o){var x=null;if(r&&r.hasAttribute("formAction")){if(s=r,o=r[ht]||null)x=o.formAction;else if(Oc(s)!==null)continue}else x=o.action;typeof x=="function"?l[a+1]=x:(l.splice(a,3),a-=3),tx(l)}}}function lx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(o){return s=o})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Lc(e){this._internalRoot=e}vr.prototype.render=Lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(d(409));var l=t.current,a=Rt();Kf(l,a,e,t,null,null)},vr.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kf(e.current,2,null,e,null,null),Fs(),t[Ta]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=uo();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ta.length&&t!==0&&t<ta[l].priority;l++);ta.splice(l,0,e),l===0&&Pf(e)}};var ax=c.version;if(ax!=="19.2.4")throw Error(d(527,ax,"19.2.4"));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(d(188)):(e=Object.keys(e).join(","),Error(d(268,e)));return e=f(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var nh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yr.isDisabled&&yr.supportsFiber)try{Mt=yr.inject(nh),Ve=yr}catch{}}return ns.createRoot=function(e,t){if(!m(e))throw Error(d(299));var l=!1,a="",s=od,r=ud,o=dd;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Xf(e,1,!1,null,null,l,a,null,s,r,o,lx),e[Ta]=t.current,vc(e),new Lc(t)},ns.hydrateRoot=function(e,t,l){if(!m(e))throw Error(d(299));var a=!1,s="",r=od,o=ud,x=dd,j=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(o=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(j=l.formState)),t=Xf(e,1,!0,t,l??null,a,s,j,r,o,x,lx),t.context=Zf(null),l=t.current,a=Rt(),a=Tr(a),s=ql(a),s.callback=null,Yl(l,s,a),l=a,t.current.lanes=l,ca(t,l),al(t),e[Ta]=t.current,vc(e),new vr(t)},ns.version="19.2.4",ns}var xx;function mh(){if(xx)return Hc.exports;xx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Hc.exports=xh(),Hc.exports}var ph=mh();const zx="";class Ox extends Error{constructor(c,u){super(c),this.name="ApiError",this.status=u}}async function qe(i,c){const u=await fetch(`${zx}${i}`,c);if(!u.ok){const d=await u.json().catch(()=>({error:u.statusText}));throw new Ox(d.error||`HTTP ${u.status}`,u.status)}return u.json()}const Te={getConfig(){return qe("/api/config")},setConfig(i,c){return qe("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:i,model:c})})},getSkills(){return qe("/api/skills")},getSkillDetail(i,c){return qe(`/api/skills/${i}/${c}`)},getEvals(i,c){return qe(`/api/skills/${i}/${c}/evals`)},saveEvals(i,c,u){return qe(`/api/skills/${i}/${c}/evals`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})},generateEvals(i,c){return qe(`/api/skills/${i}/${c}/generate-evals`,{method:"POST"})},async getLatestBenchmark(i,c){const u=await fetch(`${zx}/api/skills/${i}/${c}/benchmark/latest`);if(u.status===404)return null;if(!u.ok){const d=await u.json().catch(()=>({error:u.statusText}));throw new Ox(d.error||`HTTP ${u.status}`,u.status)}return u.json()},getHistory(i,c,u){const d=new URLSearchParams;u!=null&&u.model&&d.set("model",u.model),u!=null&&u.type&&d.set("type",u.type),u!=null&&u.from&&d.set("from",u.from),u!=null&&u.to&&d.set("to",u.to);const m=d.toString();return qe(`/api/skills/${i}/${c}/history${m?"?"+m:""}`)},getHistoryEntry(i,c,u){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(u)}`)},compareRuns(i,c,u,d){return qe(`/api/skills/${i}/${c}/history-compare?a=${encodeURIComponent(u)}&b=${encodeURIComponent(d)}`)},getCaseHistory(i,c,u,d){const m=new URLSearchParams;d&&m.set("model",d);const h=m.toString();return qe(`/api/skills/${i}/${c}/history/case/${u}${h?"?"+h:""}`)},deleteHistoryEntry(i,c,u){return qe(`/api/skills/${i}/${c}/history/${encodeURIComponent(u)}`,{method:"DELETE"})},deleteSkill(i,c){return qe(`/api/skills/${i}/${c}`,{method:"DELETE"})},improveSkill(i,c,u){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)})},instructEdit(i,c,u){return qe(`/api/skills/${i}/${c}/improve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"instruct",...u})})},applyImprovement(i,c,u){return qe(`/api/skills/${i}/${c}/apply-improvement`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:u})})},getStats(i,c){return qe(`/api/skills/${i}/${c}/stats`)},getDependencies(i,c){return qe(`/api/skills/${i}/${c}/dependencies`)},getProjectLayout(){return qe("/api/project-layout")},createSkill(i){return qe("/api/skills/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},saveDraft(i){return qe("/api/skills/save-draft",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillCreatorStatus(){return qe("/api/skill-creator-status")},generateSkill(i){return qe("/api/skills/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})},getSkillFiles(i,c){return qe(`/api/skills/${i}/${c}/files`)},getSkillFile(i,c,u){return qe(`/api/skills/${i}/${c}/file?path=${encodeURIComponent(u)}`)}};function hh(i){const[c,u]=v.useState(()=>typeof window>"u"?!1:window.matchMedia(i).matches);return v.useEffect(()=>{const d=window.matchMedia(i);u(d.matches);const m=h=>u(h.matches);return d.addEventListener("change",m),()=>d.removeEventListener("change",m)},[i]),c}const vh={selectedSkill:null,mode:"browse",searchQuery:"",skills:[],skillsLoading:!0,skillsError:null,isMobile:!1,mobileView:"list"};function yh(i,c){switch(c.type){case"SELECT_SKILL":return{...i,selectedSkill:c.skill,mode:"browse",mobileView:i.isMobile?"detail":i.mobileView};case"CLEAR_SELECTION":return{...i,selectedSkill:null};case"SET_MODE":return{...i,mode:c.mode,selectedSkill:c.mode==="create"?null:i.selectedSkill};case"SET_SEARCH":return{...i,searchQuery:c.query};case"SET_SKILLS":return{...i,skills:c.skills,skillsLoading:!1,skillsError:null};case"SET_SKILLS_ERROR":return{...i,skillsError:c.error,skillsLoading:!1};case"SET_SKILLS_LOADING":return{...i,skillsLoading:c.loading};case"SET_MOBILE":return{...i,isMobile:c.isMobile};case"SET_MOBILE_VIEW":return{...i,mobileView:c.view};default:return i}}const Dx=v.createContext(null);function sa(){const i=v.useContext(Dx);if(!i)throw new Error("useStudio must be used within StudioProvider");return i}function gh({children:i}){const[c,u]=v.useReducer(yh,vh),d=hh("(max-width: 767px)");v.useEffect(()=>{u({type:"SET_MOBILE",isMobile:d})},[d]);const m=v.useCallback(()=>{u({type:"SET_SKILLS_LOADING",loading:!0}),Te.getSkills().then(y=>{u({type:"SET_SKILLS",skills:y});const z=window.location.hash.match(/^#\/skills\/([^/]+)\/([^/?]+)/);if(z){const[,B,q]=z,V=y.find(K=>K.plugin===B&&K.skill===q);V&&u({type:"SELECT_SKILL",skill:{plugin:B,skill:q,origin:V.origin}})}}).catch(y=>u({type:"SET_SKILLS_ERROR",error:y.message}))},[]);v.useEffect(()=>{m()},[m]);const h=v.useCallback(y=>{u({type:"SELECT_SKILL",skill:y}),window.location.hash=`/skills/${y.plugin}/${y.skill}`},[]),p=v.useCallback(()=>{u({type:"CLEAR_SELECTION"}),window.location.hash.startsWith("#/skills/")&&history.replaceState(null,"",window.location.pathname+window.location.search)},[]),b=v.useCallback(y=>{u({type:"SET_MODE",mode:y})},[]),g=v.useCallback(y=>{u({type:"SET_SEARCH",query:y})},[]),f=v.useCallback(y=>{u({type:"SET_MOBILE_VIEW",view:y})},[]),E=v.useMemo(()=>({state:c,selectSkill:h,clearSelection:p,setMode:b,setSearch:g,setMobileView:f,refreshSkills:m}),[c,h,p,b,g,f,m]);return n.jsx(Dx.Provider,{value:E,children:i})}const bh={config:null,loading:!0};function jh(i,c){switch(c.type){case"SET_CONFIG":return{config:c.config,loading:!1};case"SET_LOADING":return{...i,loading:!0};default:return i}}const Lx=v.createContext(null);function dn(){const i=v.useContext(Lx);if(!i)throw new Error("useConfig must be used within ConfigProvider");return i}function Sh({children:i}){const[c,u]=v.useReducer(jh,bh),d=v.useCallback(()=>{Te.getConfig().then(p=>u({type:"SET_CONFIG",config:p})).catch(()=>{})},[]);v.useEffect(()=>{d()},[d]);const m=v.useCallback(async(p,b)=>{const g=await Te.setConfig(p,b);return u({type:"SET_CONFIG",config:g}),g},[]),h=v.useMemo(()=>({config:c.config,loading:c.loading,updateConfig:m,refreshConfig:d}),[c,m,d]);return n.jsx(Lx.Provider,{value:h,children:i})}function Nh({left:i,right:c}){const{state:u}=sa();return u.isMobile?n.jsx("div",{style:{height:"100vh",overflow:"hidden",background:"var(--surface-0)"},children:u.mobileView==="list"?n.jsx("div",{style:{height:"100%",overflowY:"auto",background:"var(--surface-1)"},children:i}):n.jsx("div",{style:{height:"100%",overflowY:"auto"},children:c})}):n.jsxs("div",{className:"studio-grid",style:{display:"grid",gridTemplateColumns:"280px 1px 1fr",height:"100vh",overflow:"hidden"},children:[n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-1)"},children:i}),n.jsx("div",{style:{background:"var(--border-subtle)"}}),n.jsx("div",{style:{overflowY:"auto",background:"var(--surface-0)"},children:c})]})}function Eh(){const{state:i,setSearch:c}=sa(),[u,d]=v.useState(i.searchQuery),m=v.useRef(null);v.useEffect(()=>(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{c(u)},200),()=>{m.current&&clearTimeout(m.current)}),[u,c]),v.useEffect(()=>{i.searchQuery===""&&u!==""&&d("")},[i.searchQuery]);const h=new Set(i.skills.map(p=>p.plugin)).size;return n.jsxs("div",{className:"px-3 py-2",children:[n.jsxs("div",{className:"relative",children:[n.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:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),n.jsx("input",{type:"text",value:u,onChange:p=>d(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)"}}),u&&n.jsx("button",{onClick:()=>{d(""),c("")},style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-tertiary)",padding:2},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!i.skillsLoading&&n.jsxs("div",{className:"text-[11px] mt-1.5 px-1",style:{color:"var(--text-tertiary)"},children:[i.skills.length," skill",i.skills.length!==1?"s":""," across ",h," plugin",h!==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 px({skill:i,isSelected:c,onSelect:u}){const d=mx[i.benchmarkStatus]||mx.missing,m=i.origin==="installed";return n.jsxs("button",{onClick:u,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:m?.7:1},onMouseEnter:h=>{c||(h.currentTarget.style.background="var(--surface-2)")},onMouseLeave:h=>{c||(h.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("span",{className:"flex items-center gap-1.5 text-[13px] font-medium truncate",style:{color:"var(--text-primary)"},children:[m&&n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.skill]}),n.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:d.bg,color:d.text},children:[n.jsx("span",{className:"rounded-full",style:{width:5,height:5,background:d.dot}}),d.label]})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("span",{children:[i.evalCount," eval",i.evalCount!==1?"s":""]}),n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsxs("span",{children:[i.assertionCount," assert",i.assertionCount!==1?"s":""]}),i.lastBenchmark&&n.jsxs(n.Fragment,{children:[n.jsx("span",{style:{color:"var(--border-subtle)"},children:"|"}),n.jsx("span",{children:new Date(i.lastBenchmark).toLocaleDateString()})]})]})]})}function hx(i){var u;const c={};for(const d of i)(c[u=d.plugin]||(c[u]=[])).push(d);return c}function kh(){const{state:i,selectSkill:c}=sa(),{skills:u,searchQuery:d,selectedSkill:m}=i,[h,p]=v.useState(!1),[b,g]=v.useState(()=>{try{return sessionStorage.getItem("vskill-origin-banner-dismissed")==="1"}catch{return!1}}),{sourceGroups:f,installedGroups:E}=v.useMemo(()=>{const y=d.toLowerCase(),T=y?u.filter(q=>q.skill.toLowerCase().includes(y)||q.plugin.toLowerCase().includes(y)):u,z=T.filter(q=>q.origin==="source"),B=T.filter(q=>q.origin==="installed");return{sourceGroups:Object.entries(hx(z)),installedGroups:Object.entries(hx(B))}},[u,d]);return i.skillsLoading?n.jsx("div",{className:"px-3 py-4 space-y-3",children:[1,2,3].map(y=>n.jsx("div",{className:"skeleton h-14 w-full rounded-lg"},y))}):f.length===0&&E.length===0?n.jsx("div",{className:"px-4 py-8 text-center",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No skills match your search"})}):n.jsxs("div",{className:"flex-1",children:[f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Th,{title:"Your Skills",count:f.reduce((y,[,T])=>y+T.length,0)}),f.map(([y,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:y,count:T.length}),T.map(z=>{const B=(m==null?void 0:m.plugin)===z.plugin&&(m==null?void 0:m.skill)===z.skill;return n.jsx(px,{skill:z,isSelected:B,onSelect:()=>c({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},y))]}),E.length>0&&n.jsxs(n.Fragment,{children:[n.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:h?"1px solid var(--border-subtle)":"none",cursor:"pointer"},children:[n.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:h?"rotate(90deg)":"rotate(0deg)",transition:"transform 150ms ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Installed"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",E.reduce((y,[,T])=>y+T.length,0),")"]}),n.jsx("div",{className:"flex-1"}),n.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:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]}),h&&n.jsxs(n.Fragment,{children:[!b&&n.jsxs("div",{className:"flex items-start gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.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."}),n.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:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),E.map(([y,T])=>n.jsxs("div",{children:[n.jsx(vx,{plugin:y,count:T.length}),T.map(z=>{const B=(m==null?void 0:m.plugin)===z.plugin&&(m==null?void 0:m.skill)===z.skill;return n.jsx(px,{skill:z,isSelected:B,onSelect:()=>c({plugin:z.plugin,skill:z.skill,origin:z.origin})},`${z.plugin}/${z.skill}`)})]},y))]})]})]})}function Th({title:i,count:c}){return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]})]})}function vx({plugin:i,count:c}){const[u,d]=v.useState(!1),m=`/images/icons/${i}.webp`;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[u?n.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:n.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"})}):n.jsx("img",{src:m,width:16,height:16,alt:"",onError:()=>d(!0),style:{objectFit:"contain"}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:i}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",c,")"]}),n.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border-subtle)"}})]})}function Ch(){const{config:i,updateConfig:c,refreshConfig:u}=dn(),[d,m]=v.useState(!1),[h,p]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{function y(T){b.current&&!b.current.contains(T.target)&&m(!1)}return d&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[d]);async function g(y,T){p(!0);try{await c(y.id,T.id),m(!1)}catch{u()}finally{p(!1)}}if(!i)return null;const f=wh(i),E=Ah(i);return n.jsxs("div",{ref:b,className:"relative",children:[n.jsxs("button",{onClick:()=>m(!d),className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-[11px] transition-all duration-150",style:{background:d?"var(--surface-3)":"var(--surface-2)",border:`1px solid ${d?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},onMouseEnter:y=>{d||(y.currentTarget.style.borderColor="var(--accent)")},onMouseLeave:y=>{d||(y.currentTarget.style.borderColor="var(--border-subtle)")},children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:E!=null&&E.available?"var(--green)":"var(--text-tertiary)"}}),n.jsx("span",{className:"flex-1 text-left font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",style:{transform:d?"rotate(180deg)":"rotate(0)",transition:"transform 0.15s ease",flexShrink:0},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),d&&n.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:[n.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Select Model"})}),n.jsx("div",{className:"py-1 max-h-72 overflow-y-auto",children:i.providers.map(y=>n.jsxs("div",{children:[n.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[n.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}}),n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",opacity:y.available?1:.5},children:y.label})]}),y.models.map(T=>{const z=Bx(i,y.id,T.id),B=!y.available||h;return n.jsxs("button",{onClick:()=>!B&&g(y,T),disabled:B,className:"w-full px-3 py-1.5 flex items-center gap-2.5 text-left transition-all duration-100",style:{background:z?"var(--accent-muted)":"transparent",color:B?"var(--text-tertiary)":"var(--text-primary)",opacity:B?.4:1,cursor:B?"not-allowed":"pointer"},onMouseEnter:q=>{!B&&!z&&(q.currentTarget.style.background="var(--surface-3)")},onMouseLeave:q=>{z||(q.currentTarget.style.background="transparent")},children:[n.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 flex items-center justify-center",style:{border:`2px solid ${z?"var(--accent)":"var(--border-subtle)"}`},children:z&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}})}),n.jsx("span",{className:"text-[12px]",style:{fontWeight:z?600:400},title:T.id,children:T.label})]},`${y.id}-${T.id}`)})]},y.id))})]})]})}function Bx(i,c,u){return i.provider!==c?!1:c==="claude-cli"?i.model===`claude-${u}`:i.model===u}function Ah(i){return i.providers.find(c=>c.id===i.provider)}function wh(i){for(const c of i.providers)for(const u of c.models)if(Bx(i,c.id,u.id))return u.label;return i.model}function _h(){const{state:i,setMode:c}=sa(),{config:u}=dn(),[d,m]=v.useState(null),[h,p]=v.useState(!1);return v.useEffect(()=>{Te.getSkillCreatorStatus().then(m).catch(()=>{})},[]),n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsxs("div",{className:"px-4 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"var(--accent-muted)"},children:n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-[14px] font-semibold truncate",style:{color:"var(--text-primary)",letterSpacing:"-0.01em"},children:"Skill Studio"}),n.jsx("div",{className:"text-[11px] truncate",style:{color:"var(--text-tertiary)"},children:(u==null?void 0:u.projectName)||"vskill"})]})]}),n.jsx("div",{className:"mt-3",children:n.jsx(Ch,{})})]}),n.jsx(Eh,{}),n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.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:i.mode==="create"?"var(--accent)":"var(--surface-3)",color:i.mode==="create"?"#fff":"var(--text-secondary)",border:"none",cursor:"pointer"},onMouseEnter:b=>{i.mode!=="create"&&(b.currentTarget.style.background="var(--surface-4)",b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{i.mode!=="create"&&(b.currentTarget.style.background="var(--surface-3)",b.currentTarget.style.color="var(--text-secondary)")},children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"New Skill"]})}),d&&(()=>{const b=(u==null?void 0:u.provider)==="claude-cli";return d.installed&&b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--green)"}}),"Skill Creator installed"]})}):d.installed&&!b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-[11px]",style:{color:"var(--text-tertiary)",opacity:.5},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--text-tertiary)"}}),"Skill Creator (Claude only)"]})}):!d.installed&&b?n.jsx("div",{className:"px-3 pb-2 flex-shrink-0",children:n.jsxs("div",{className:"px-3 py-2 rounded-lg text-[11px]",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",style:{color:"var(--yellow)"},children:[n.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:"var(--yellow)"}}),n.jsx("span",{className:"font-medium",children:"Skill Creator not installed"})]}),n.jsx("button",{onClick:()=>{navigator.clipboard.writeText(d.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:h?"Copied!":d.installCommand})]})}):null})(),n.jsx("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(kh,{})})]})}const Rh="modulepreload",Mh=function(i){return"/"+i},yx={},zh=function(c,u,d){let m=Promise.resolve();if(u&&u.length>0){let p=function(f){return Promise.all(f.map(E=>Promise.resolve(E).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"));m=p(u.map(f=>{if(f=Mh(f),f in yx)return;yx[f]=!0;const E=f.endsWith(".css"),y=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const T=document.createElement("link");if(T.rel=E?"stylesheet":Rh,E||(T.as="script"),T.crossOrigin="",T.href=f,g&&T.setAttribute("nonce",g),document.head.appendChild(T),E)return new Promise((z,B)=>{T.addEventListener("load",z),T.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${f}`)))})}))}function h(p){const b=new Event("vite:preloadError",{cancelable:!0});if(b.payload=p,window.dispatchEvent(b),!b.defaultPrevented)throw p}return m.then(p=>{for(const b of p||[])b.status==="rejected"&&h(b.reason);return c().catch(h)})};function Vc(){const[i,c]=v.useState([]),[u,d]=v.useState(!1),[m,h]=v.useState(!1),[p,b]=v.useState(null),g=v.useRef(null),f=v.useCallback(async(y,T)=>{c([]),d(!0),h(!1),b(null);const z=new AbortController;g.current=z;try{const B=await fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:T?JSON.stringify(T):void 0,signal:z.signal});if(!B.ok||!B.body){let se=`HTTP ${B.status}`;try{const Y=await B.json();Y.error&&(se=Y.error)}catch{}throw new Error(se)}const q=B.body.getReader(),V=new TextDecoder;let K="",P="";for(;;){const{done:se,value:Y}=await q.read();if(se)break;K+=V.decode(Y,{stream:!0});const F=K.split(`
|
|
50
|
+
`);K=F.pop()||"";for(const le of F)if(le.startsWith("event: "))P=le.slice(7).trim();else if(le.startsWith("data: ")){try{const W=JSON.parse(le.slice(6)),ae={event:P,data:W};P==="done"?(h(!0),c(he=>[...he,ae])):c(he=>[...he,ae])}catch{}P=""}}}catch(B){B.name!=="AbortError"&&b(B.message)}finally{d(!1),g.current=null}},[]),E=v.useCallback(()=>{var y;(y=g.current)==null||y.abort()},[]);return{events:i,running:u,done:m,error:p,start:f,stop:E}}function Oh(i){const c=v.useRef(i);c.current=i;const[u,d]=v.useState(new Set),m=v.useRef(new Map),h=v.useCallback(async(f,E,y)=>{var z;(z=m.current.get(f))==null||z.abort();const T=new AbortController;m.current.set(f,T),d(B=>{const q=new Set(B);return q.add(f),q});try{const B=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:y?JSON.stringify(y):void 0,signal:T.signal});if(!B.ok||!B.body){let se=`HTTP ${B.status}`;try{const Y=await B.json();Y.error&&(se=Y.error)}catch{}throw new Error(se)}const q=B.body.getReader(),V=new TextDecoder;let K="",P="";for(;;){const{done:se,value:Y}=await q.read();if(se)break;K+=V.decode(Y,{stream:!0});const F=K.split(`
|
|
51
|
+
`);K=F.pop()||"";for(const le of F)if(le.startsWith("event: "))P=le.slice(7).trim();else if(le.startsWith("data: ")){try{const W=JSON.parse(le.slice(6)),ae={event:P,data:W};c.current.onEvent(f,ae)}catch{}P=""}}c.current.onDone(f)}catch(B){B.name!=="AbortError"&&c.current.onError(f,B.message)}finally{d(B=>{const q=new Set(B);return q.delete(f),q}),m.current.delete(f)}},[]),p=v.useCallback(f=>{var E;(E=m.current.get(f))==null||E.abort()},[]),b=v.useCallback(()=>{for(const f of m.current.values())f.abort()},[]),g=u.size>0;return{runningSet:u,startCase:h,stopCase:p,stopAll:b,isAnyCaseRunning:g}}const Dh={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,loading:!0,error:null};function Lh(i,c){var u,d;switch(c.type){case"SET_LOADING":return{...i,loading:c.loading};case"SET_ERROR":return{...i,error:c.error};case"INIT_DATA":{const m=new Map;if(c.benchmark)for(const p of c.benchmark.cases)m.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 h=((d=(u=c.evals)==null?void 0:u.evals[0])==null?void 0:d.id)??null;return{...i,skillContent:c.skillContent,savedContent:c.skillContent,isDirty:!1,evals:c.evals,evalsError:c.evalsError??null,latestBenchmark:c.benchmark,inlineResults:m,selectedCaseId:h,loading:!1,error:null}}case"SET_PANEL":return{...i,activePanel:c.panel};case"SET_CONTENT":return{...i,skillContent:c.content,isDirty:c.content!==i.savedContent};case"CONTENT_SAVED":return{...i,savedContent:i.skillContent,isDirty:!1};case"SET_EVALS":return{...i,evals:c.evals};case"SELECT_CASE":return{...i,selectedCaseId:c.caseId};case"CASE_RUN_START":{const m=new Map(i.caseRunStates);return m.set(c.caseId,{status:"running",startedAt:Date.now(),mode:c.mode}),{...i,caseRunStates:m,runMode:c.mode,activePanel:"run"}}case"CASE_RUN_COMPLETE":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"complete",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,c.result),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_ERROR":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);m.set(c.caseId,{status:"error",mode:h==null?void 0:h.mode});const p=new Map(i.inlineResults);return p.set(c.caseId,{status:"error",errorMessage:c.error,assertions:[]}),{...i,caseRunStates:m,inlineResults:p}}case"CASE_RUN_CANCEL":{const m=new Map(i.caseRunStates),h=m.get(c.caseId);return m.set(c.caseId,{status:"cancelled",mode:h==null?void 0:h.mode}),{...i,caseRunStates:m}}case"BULK_RUN_START":{const m=new Map(i.caseRunStates);for(const h of c.caseIds)m.set(h,{status:"queued",mode:c.mode});return{...i,caseRunStates:m,bulkRunActive:!0,runMode:c.mode,activePanel:"run"}}case"BULK_RUN_COMPLETE":return{...i,bulkRunActive:!1,latestBenchmark:c.benchmark??i.latestBenchmark,iterationCount:i.iterationCount+1};case"CANCEL_ALL":{const m=new Map(i.caseRunStates);for(const[h,p]of m)(p.status==="running"||p.status==="queued")&&m.set(h,{status:"cancelled"});return{...i,caseRunStates:m,bulkRunActive:!1}}case"UPDATE_INLINE_RESULT":{const m=new Map(i.inlineResults);return m.set(c.evalId,c.result),{...i,inlineResults:m}}case"OPEN_IMPROVE":return{...i,improveTarget:c.evalId,activePanel:"editor"};case"CLOSE_IMPROVE":return{...i,improveTarget:null};case"OPEN_AI_EDIT":return{...i,aiEditOpen:!0,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"CLOSE_AI_EDIT":return{...i,aiEditOpen:!1,aiEditLoading:!1,aiEditResult:null,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[],aiEditEvalChanges:[],aiEditEvalSelections:new Map,aiEditEvalsRetry:null};case"AI_EDIT_LOADING":return{...i,aiEditLoading:!0,aiEditError:null,aiEditClassifiedError:null,aiEditProgress:[]};case"AI_EDIT_PROGRESS":return{...i,aiEditProgress:[...i.aiEditProgress,c.entry]};case"AI_EDIT_RESULT":{const m=c.evalChanges??[],h=new Map;for(let p=0;p<m.length;p++)h.set(p,!0);return{...i,aiEditLoading:!1,aiEditResult:{improved:c.improved,reasoning:c.reasoning,evalChanges:m},aiEditEvalChanges:m,aiEditEvalSelections:h}}case"AI_EDIT_ERROR":return{...i,aiEditLoading:!1,aiEditError:c.message,aiEditClassifiedError:c.classified??null};case"GENERATE_EVALS_START":return{...i,generateEvalsLoading:!0,generateEvalsProgress:[],generateEvalsError:null};case"GENERATE_EVALS_PROGRESS":return{...i,generateEvalsProgress:[...i.generateEvalsProgress,c.entry]};case"GENERATE_EVALS_DONE":return{...i,generateEvalsLoading:!1,evals:c.evals};case"GENERATE_EVALS_ERROR":return{...i,generateEvalsLoading:!1,generateEvalsError:c.classified};case"TOGGLE_EVAL_CHANGE":{const m=new Map(i.aiEditEvalSelections);return m.set(c.index,!m.get(c.index)),{...i,aiEditEvalSelections:m}}case"SELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!0);return{...i,aiEditEvalSelections:m}}case"DESELECT_ALL_EVAL_CHANGES":{const m=new Map(i.aiEditEvalSelections);for(const h of m.keys())m.set(h,!1);return{...i,aiEditEvalSelections:m}}case"SET_EVALS_RETRY":return{...i,aiEditEvalsRetry:c.evalsFile};case"SET_REGRESSIONS":return{...i,regressions:c.regressions};case"INCREMENT_ITERATION":return{...i,iterationCount:i.iterationCount+1};case"SET_ACTIVATION_PROMPTS":return{...i,activationPrompts:c.prompts};case"ACTIVATION_START":return{...i,activationRunning:!0,activationResults:[],activationSummary:null,activationError:null};case"ACTIVATION_RESULT":return{...i,activationResults:[...i.activationResults,c.result]};case"ACTIVATION_DONE":return{...i,activationRunning:!1,activationSummary:c.summary};case"ACTIVATION_ERROR":return{...i,activationRunning:!1,activationError:c.error};case"ACTIVATION_RESET":return{...i,activationResults:[],activationSummary:null,activationError:null};default:return i}}function Bh(i,c){const u=c.data;if(c.event==="output_ready"&&(i.output=u.output,u.durationMs!=null&&(i.durationMs=u.durationMs),u.tokens!=null&&(i.tokens=u.tokens)),c.event==="outputs_ready"&&(i.output=u.skillOutput,u.skillDurationMs!=null&&(i.durationMs=u.skillDurationMs),u.skillTokens!=null&&(i.tokens=u.skillTokens)),c.event==="assertion_result"){const d={assertion_id:u.assertion_id,text:u.text,pass:u.pass,reasoning:u.reasoning};i.assertions.find(m=>m.assertion_id===d.assertion_id)||i.assertions.push(d)}c.event==="case_complete"&&(i.status=u.status,i.passRate=u.pass_rate,i.errorMessage=u.error_message||void 0,i.classifiedError=u.classified_error||void 0)}const Ux=v.createContext(null);function nl(){const i=v.useContext(Ux);if(!i)throw new Error("useWorkspace must be used within WorkspaceProvider");return i}function Uh({plugin:i,skill:c,origin:u,children:d}){const m=u==="installed",[h,p]=v.useReducer(Lh,{...Dh,plugin:i,skill:c}),b=v.useRef(new Set),g=v.useRef(new Set),f=v.useRef(new Map),E=v.useCallback((R,G)=>{let Q=f.current.get(R);Q||(Q={assertions:[]},f.current.set(R,Q)),Bh(Q,G),p({type:"UPDATE_INLINE_RESULT",evalId:R,result:{...Q,assertions:[...Q.assertions]}})},[]),y=v.useCallback(R=>{if(g.current.has(R))return;g.current.add(R);const G=f.current.get(R)??{assertions:[]};p({type:"CASE_RUN_COMPLETE",caseId:R,result:{...G,assertions:[...G.assertions]}}),b.current.has(R)&&(b.current.delete(R),b.current.size===0&&Te.getLatestBenchmark(i,c).then(Q=>p({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null})))},[i,c]),T=v.useCallback((R,G)=>{g.current.has(R)||(g.current.add(R),p({type:"CASE_RUN_ERROR",caseId:R,error:G}),b.current.has(R)&&(b.current.delete(R),b.current.size===0&&Te.getLatestBenchmark(i,c).then(Q=>p({type:"BULK_RUN_COMPLETE",benchmark:Q})).catch(()=>p({type:"BULK_RUN_COMPLETE",benchmark:null}))))},[i,c]),{startCase:z,stopCase:B,stopAll:q}=Oh({onEvent:E,onDone:y,onError:T});v.useEffect(()=>()=>{q()},[q]),v.useEffect(()=>{let R=!1;async function G(){try{const[Q,ee,fe]=await Promise.allSettled([Te.getSkillDetail(i,c),Te.getEvals(i,c),Te.getLatestBenchmark(i,c)]);if(R)return;let ye=null,Ze=null;if(ee.status==="fulfilled")ye=ee.value;else{const et=ee.reason;(et==null?void 0:et.status)!==404&&(Ze=(et==null?void 0:et.message)??"Failed to load test cases")}p({type:"INIT_DATA",skillContent:Q.status==="fulfilled"?Q.value.skillContent:"",evals:ye,evalsError:Ze,benchmark:fe.status==="fulfilled"?fe.value:null})}catch(Q){R||p({type:"SET_ERROR",error:Q.message})}}return G(),()=>{R=!0}},[i,c]);const V=v.useCallback(async()=>{if(!m)try{await Te.applyImprovement(i,c,h.skillContent),p({type:"CONTENT_SAVED"})}catch(R){p({type:"SET_ERROR",error:R.message})}},[m,i,c,h.skillContent]),K=v.useCallback(async R=>{if(!m)try{const G=await Te.saveEvals(i,c,R);p({type:"SET_EVALS",evals:G})}catch(G){p({type:"SET_ERROR",error:G.message})}},[m,i,c]),P=v.useCallback((R,G="benchmark")=>{if(m)return;const Q=h.caseRunStates.get(R);if((Q==null?void 0:Q.status)!=="running")if(f.current.delete(R),g.current.delete(R),p({type:"CASE_RUN_START",caseId:R,mode:G}),G==="comparison"){const ee=`/api/skills/${i}/${c}/compare`;z(R,ee,{eval_ids:[R]})}else{const ee=`/api/skills/${i}/${c}/benchmark/case/${R}`;z(R,ee,G==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.caseRunStates,z]),se=v.useCallback((R="benchmark")=>{var ee;if(m)return;const G=((ee=h.evals)==null?void 0:ee.evals)??[];if(G.length===0)return;const Q=G.map(fe=>fe.id);for(const fe of Q)f.current.delete(fe),g.current.delete(fe);p({type:"BULK_RUN_START",caseIds:Q,mode:R}),b.current=new Set(Q);for(const fe of Q)if(R==="comparison")z(fe,`/api/skills/${i}/${c}/compare`,{eval_ids:[fe]});else{const ye=`/api/skills/${i}/${c}/benchmark/case/${fe}`;z(fe,ye,R==="baseline"?{baseline_only:!0}:void 0)}},[m,i,c,h.evals,z]),Y=v.useCallback(R=>{B(R),p({type:"CASE_RUN_CANCEL",caseId:R}),b.current.delete(R),g.current.add(R)},[B]),F=v.useCallback(()=>{q(),p({type:"CANCEL_ALL"}),b.current.clear()},[q]),le=v.useCallback(async(R,G)=>{p({type:"OPEN_IMPROVE",evalId:R})},[]),W=v.useCallback(async(R,G)=>{try{await Te.applyImprovement(i,c,G),p({type:"SET_CONTENT",content:G}),p({type:"CONTENT_SAVED"}),p({type:"CLOSE_IMPROVE"}),P(R,"benchmark")}catch(Q){p({type:"SET_ERROR",error:Q.message})}},[i,c,P]),ae=Vc(),he=v.useRef(null);v.useEffect(()=>{if(ae.events.length)for(const R of ae.events){const G=R.data;if(R.event==="progress"&&p({type:"AI_EDIT_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),R.event==="done"){const Q=G.improved,ee=G.reasoning,fe=G.evalChanges??[];p({type:"AI_EDIT_RESULT",improved:Q,reasoning:ee,evalChanges:fe})}if(R.event==="error"){const Q=G;p({type:"AI_EDIT_ERROR",message:Q.description||"Unknown error",classified:Q})}}},[ae.events]),v.useEffect(()=>{ae.error&&p({type:"AI_EDIT_ERROR",message:ae.error})},[ae.error]),v.useEffect(()=>()=>{ae.stop()},[ae.stop]);const re=v.useCallback(async(R,G,Q)=>{m||(p({type:"AI_EDIT_LOADING"}),he.current=ae.stop,ae.start(`/api/skills/${i}/${c}/improve?sse`,{mode:"instruct",instruction:R,content:h.skillContent,evals:h.evals??{skill_name:c,evals:[]},provider:G,model:Q}))},[m,i,c,h.skillContent,h.evals,ae]),ge=v.useCallback(()=>{ae.stop(),p({type:"AI_EDIT_ERROR",message:"Cancelled"})},[ae]),ve=v.useCallback(async()=>{const R=h.aiEditResult;if(R!=null&&R.improved)try{if(await Te.applyImprovement(i,c,R.improved),p({type:"SET_CONTENT",content:R.improved}),p({type:"CONTENT_SAVED"}),h.aiEditEvalChanges.length>0&&Array.from(h.aiEditEvalSelections.values()).some(Boolean)){const{mergeEvalChanges:Q}=await zh(async()=>{const{mergeEvalChanges:ye}=await import("./mergeEvalChanges-Dpbbs4d4.js");return{mergeEvalChanges:ye}},[]),ee=h.evals??{skill_name:c,evals:[]},fe=Q(ee,h.aiEditEvalChanges,h.aiEditEvalSelections);try{const ye=await Te.saveEvals(i,c,fe);p({type:"SET_EVALS",evals:ye})}catch(ye){p({type:"SET_EVALS_RETRY",evalsFile:fe}),p({type:"SET_ERROR",error:`SKILL.md saved, but test cases failed to save: ${ye.message}. You can retry from the AI Edit panel.`});return}}p({type:"CLOSE_AI_EDIT"})}catch(G){p({type:"SET_ERROR",error:G.message})}},[i,c,h.aiEditResult,h.evals,h.aiEditEvalChanges,h.aiEditEvalSelections]),X=v.useCallback(()=>{p({type:"CLOSE_AI_EDIT"})},[]),ue=v.useCallback(R=>{p({type:"TOGGLE_EVAL_CHANGE",index:R})},[]),Ee=v.useCallback(()=>{p({type:"SELECT_ALL_EVAL_CHANGES"})},[]),N=v.useCallback(()=>{p({type:"DESELECT_ALL_EVAL_CHANGES"})},[]),A=v.useCallback(async()=>{const R=h.aiEditEvalsRetry;if(R)try{const G=await Te.saveEvals(i,c,R);p({type:"SET_EVALS",evals:G}),p({type:"SET_ERROR",error:null}),p({type:"CLOSE_AI_EDIT"})}catch(G){p({type:"SET_ERROR",error:`Retry failed: ${G.message}`})}},[i,c,h.aiEditEvalsRetry]),J=v.useCallback(async()=>{try{const R=await Te.getSkillDetail(i,c);p({type:"SET_CONTENT",content:R.skillContent}),p({type:"CONTENT_SAVED"})}catch{}},[i,c]),ce=Vc();v.useEffect(()=>{if(ce.events.length)for(const R of ce.events){const G=R.data;if(R.event==="progress"&&p({type:"GENERATE_EVALS_PROGRESS",entry:{timestamp:Date.now(),phase:G.phase,message:G.message}}),R.event==="done"){const Q=G;Te.saveEvals(i,c,Q).then(ee=>p({type:"GENERATE_EVALS_DONE",evals:ee})).catch(ee=>p({type:"SET_ERROR",error:ee.message}))}R.event==="error"&&p({type:"GENERATE_EVALS_ERROR",classified:G})}},[ce.events,i,c]),v.useEffect(()=>{ce.error&&p({type:"SET_ERROR",error:ce.error})},[ce.error]),v.useEffect(()=>()=>{ce.stop()},[ce.stop]);const pe=v.useCallback(async()=>{m||(p({type:"GENERATE_EVALS_START"}),ce.start(`/api/skills/${i}/${c}/generate-evals?sse`))},[m,i,c,ce]),S=Vc();v.useEffect(()=>()=>{S.stop()},[S.stop]),v.useEffect(()=>{if(S.events.length)for(const R of S.events)R.event==="prompt_result"&&p({type:"ACTIVATION_RESULT",result:R.data}),R.event==="done"&&p({type:"ACTIVATION_DONE",summary:R.data})},[S.events]),v.useEffect(()=>{S.error&&p({type:"ACTIVATION_ERROR",error:S.error})},[S.error]);const D=v.useCallback(R=>{const Q=R.trim().split(`
|
|
52
|
+
`).filter(Boolean).map(ee=>ee.startsWith("!")?{prompt:ee.slice(1).trim(),expected:"should_not_activate"}:ee.startsWith("+")?{prompt:ee.slice(1).trim(),expected:"should_activate"}:{prompt:ee.trim(),expected:"auto"});p({type:"ACTIVATION_START"}),S.start(`/api/skills/${i}/${c}/activation-test`,{prompts:Q})},[i,c,S]),Z=v.useMemo(()=>({state:h,dispatch:p,isReadOnly:m,saveContent:V,saveEvals:K,runCase:P,runAll:se,cancelCase:Y,cancelAll:F,improveForCase:le,applyImproveAndRerun:W,refreshSkillContent:J,generateEvals:pe,runActivationTest:D,submitAiEdit:re,cancelAiEdit:ge,applyAiEdit:ve,discardAiEdit:X,toggleEvalChange:ue,selectAllEvalChanges:Ee,deselectAllEvalChanges:N,retryEvalsSave:A}),[h,m,V,K,P,se,Y,F,le,W,J,pe,D,re,ge,ve,X,ue,Ee,N,A]);return n.jsx(Ux.Provider,{value:Z,children:d})}function Hh({state:i,isReadOnly:c,onDelete:u}){const{plugin:d,skill:m,evals:h,latestBenchmark:p,isDirty:b,caseRunStates:g,regressions:f,iterationCount:E}=i,y=Array.from(g.values()).some(K=>K.status==="running"||K.status==="queued"),T=p==null?void 0:p.overall_pass_rate,z=(h==null?void 0:h.evals.reduce((K,P)=>K+P.assertions.length,0))??0,B=(h==null?void 0:h.evals.length)??0,q=T!=null?T>=80?"var(--green)":T>=50?"var(--yellow)":"var(--red)":"var(--text-tertiary)",V=T!=null?T>=80?"var(--green-muted)":T>=50?"var(--yellow-muted)":"var(--red-muted)":"var(--surface-3)";return n.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:[n.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.jsx("span",{style:{color:"var(--text-tertiary)"},children:d}),n.jsx(qh,{}),n.jsx("span",{className:"font-medium",style:{color:"var(--text-primary)"},children:m}),c&&n.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:[n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"installed"]}),b&&n.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&&n.jsxs("span",{className:"ml-2 flex items-center gap-1.5 text-[11px]",style:{color:"var(--accent)"},children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),"Running..."]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!c&&u&&n.jsx("button",{disabled:y,onClick:()=>{window.confirm(`Delete skill "${m}"? This cannot be undone.`)&&u()},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:K=>{y||(K.currentTarget.style.color="var(--red)")},onMouseLeave:K=>{K.currentTarget.style.color="var(--text-tertiary)"},children:n.jsx(Yh,{})}),f.length>0&&n.jsxs("span",{className:"pill",style:{background:"var(--red-muted)",color:"var(--red)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.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"}),n.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),n.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),f.length," regression",f.length>1?"s":""]}),E>0&&n.jsxs("span",{className:"pill",style:{background:"var(--purple-muted)",color:"var(--purple)"},children:["Iter ",E]}),n.jsx("span",{className:"pill",style:{background:V,color:q},children:T!=null?`${Math.round(T*100)}%`:"--"}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[B," case",B!==1?"s":""," / ",z," assert",z!==1?"s":""]})]})]})}function qh(){return n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Yh(){return n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.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"}),n.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),n.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}const Gh=[{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:"deps",label:"Deps",shortcut:"6"}]}];function Vh({id:i}){const c={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};switch(i){case"editor":return n.jsxs("svg",{...c,children:[n.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),n.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 n.jsxs("svg",{...c,children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.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 n.jsx("svg",{...c,children:n.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})});case"activation":return n.jsxs("svg",{...c,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]});case"history":return n.jsxs("svg",{...c,children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"12 6 12 12 16 14"})]});case"deps":return n.jsxs("svg",{...c,children:[n.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"}),n.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 Qh({activePanel:i,onPanelChange:c,isDirty:u,isRunning:d,hasRegressions:m,isActivationRunning:h}){return n.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:Gh.map((p,b)=>n.jsxs("div",{className:"flex items-center",children:[b>0&&n.jsx("div",{style:{width:1,height:20,background:"var(--border-subtle)",margin:"0 6px",flexShrink:0}}),p.tabs.map(g=>{const f=i===g.id,E=g.id==="editor"&&u||g.id==="run"&&d||g.id==="activation"&&h||g.id==="history"&&m,y=g.id==="run"||g.id==="activation"?"var(--accent)":g.id==="history"?"var(--red)":"var(--yellow)";return n.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:[n.jsx(Vh,{id:g.id}),g.label,E&&n.jsx("span",{className:"absolute top-1.5 right-1 rounded-full",style:{width:5,height:5,background:y}})]},g.id)})]},p.label))})}function Xh(i){const c=i.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!c)return{metadata:{},body:i};const u=c[1],d=c[2].trim(),m={},h=u.split(`
|
|
53
|
+
`);let p="",b=!1;for(const g of h){const f=g.match(/^[ \t]+([\w-]+):\s*(.*)$/);if(f&&p&&b){const T=f[1],z=f[2].trim();let B=m[p];if((typeof B!="object"||Array.isArray(B))&&(B={},m[p]=B),!z)B[T]=[];else{const q=z.match(/^\[(.+)\]$/);q?B[T]=q[1].split(",").map(V=>V.trim().replace(/^["']|["']$/g,"")).filter(Boolean):B[T]=z.replace(/^["']|["']$/g,"")}continue}const E=g.match(/^\s+-\s+(.+)$/);if(E&&p){b=!1;const T=m[p];Array.isArray(T)?T.push(E[1].trim().replace(/^["']|["']$/g,"")):m[p]=[E[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){m[p]={},b=!0;continue}const z=T.match(/^\[(.+)\]$/);if(z){m[p]=z[1].split(",").map(B=>B.trim().replace(/^["']|["']$/g,"")).filter(Boolean);continue}m[p]=T.replace(/^["']|["']$/g,"")}}return{metadata:m,body:d}}function Nr(i){if(!i)return"";try{let c=i.replace(/^---\n[\s\S]*?\n---\n?/,""),u=Zh(c);return u=u.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>'),u=u.replace(/^### (.+)$/gm,'<div style="font-weight:600;font-size:14px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/^## (.+)$/gm,'<div style="font-weight:700;font-size:15px;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/^# (.+)$/gm,'<div style="font-weight:700;font-size:1rem;margin:0.75rem 0 0.25rem;color:var(--text-primary)">$1</div>'),u=u.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:var(--accent);text-decoration:underline">$1</a>'),u=u.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),u=u.replace(/\*([^*]+)\*/g,"<em>$1</em>"),u=u.replace(/`([^`]+)`/g,'<code style="background:var(--surface-3);padding:0.1rem 0.3rem;border-radius:3px;font-size:0.85em">$1</code>'),u=u.replace(/^- (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">• $1</div>'),u=u.replace(/^(\d+)\. (.+)$/gm,'<div style="padding-left:1rem;margin:0.15rem 0">$1. $2</div>'),u=u.replace(/\n\n/g,'<div style="height:0.5rem"></div>'),u=u.replace(/\n/g,"<br/>"),u}catch{return`<pre style="white-space:pre-wrap;font-size:12px;line-height:1.5">${i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</pre>`}}function Zh(i){const c=i.split(`
|
|
54
|
+
`),u=[];let d=0;for(;d<c.length;)if(c[d].trim().startsWith("|")&&d+1<c.length&&c[d+1].trim().startsWith("|")&&/\|[\s-:]+\|/.test(c[d+1])){const m=gx(c[d]);d+=2;const h=[];for(;d<c.length&&c[d].trim().startsWith("|");)h.push(gx(c[d])),d++;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 m)g+=`<th ${p}>${f}</th>`;g+="</tr></thead><tbody>";for(const f of h){g+="<tr>";for(const E of f)g+=`<td ${b}>${E}</td>`;g+="</tr>"}g+="</tbody></table>",u.push(g)}else u.push(c[d]),d++;return u.join(`
|
|
55
55
|
`)}function gx(i){return i.split("|").map(c=>c.trim()).filter(c=>c.length>0)}function Er(i,c){const u=i.split(`
|
|
56
56
|
`),d=c.split(`
|
|
57
|
-
`);if(u.length>1e3||d.length>1e3)return[...u.map(
|
|
58
|
-
`);pe=R.pop()||"";for(const G of R)if(G.startsWith("event: "))N=G.slice(7).trim();else if(G.startsWith("data: ")){try{const V=JSON.parse(G.slice(6));N==="progress"?le(ee=>[...ee,{phase:V.phase,message:V.message,timestamp:Date.now()}]):N==="done"||N==="complete"?(B(V.improved),Q(V.reasoning||""),T(Er(V.original||u,V.improved)),h("diff_shown")):N==="error"&&(P(V.message||V.description||"Unknown error"),V.category&&Y(V),h("open"))}catch{}N=""}}}catch(A){A.name!=="AbortError"&&(P(A.message),h("open"))}finally{he.current=null}}async function X(){ae(!0);try{await Te.applyImprovement(i,c,O),d(O),h("closed")}catch(E){P(E.message)}finally{ae(!1)}}function ue(){h("closed"),T([]),B(""),Q(""),P(null)}if(m==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!u,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const Ee=re();return n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),n.jsx("button",{onClick:ue,className:"w-7 h-7 rounded-lg 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:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(m==="open"||m==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:y,onChange:E=>{g(E.target.value);const A=p==null?void 0:p.providers.find(J=>J.id===E.target.value);A!=null&&A.models[0]&&S(A.models[0].id)},disabled:m==="loading",children:p==null?void 0:p.providers.filter(E=>E.available).map(E=>n.jsx("option",{value:E.id,children:E.label},E.id))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:E=>S(E.target.value),disabled:m==="loading",children:Ee==null?void 0:Ee.models.map(E=>n.jsx("option",{value:E.id,children:E.label},E.id))})]}),m==="loading"?n.jsx("button",{onClick:ge,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ve,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),m==="loading"&&F.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(ss,{entries:F,isRunning:!0})})]}),K&&n.jsx("div",{className:"mb-4",children:se?n.jsx(kr,{error:se,onRetry:ve,onDismiss:()=>{P(null),Y(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:K})}),m==="diff_shown"&&n.jsxs(n.Fragment,{children:[q&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),q]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:b.map((E,A)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] 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:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:E.type==="added"?"+":E.type==="removed"?"-":" "}),E.content]},A))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:X,disabled:W,className:"btn btn-primary",children:W?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),n.jsx("button",{onClick:ue,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const jx={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"}},$h={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function Wh({change:i,index:c,selected:u,onToggle:d,originalEval:m}){var b;const[h,p]=v.useState(!1),y=jx[i.action]??jx.add,g=$h[i.action]??"var(--border-subtle)",f=i.action==="remove"?(m==null?void 0:m.name)??`Eval #${i.evalId}`:((b=i.eval)==null?void 0:b.name)??"Unnamed",S=v.useCallback(()=>d(c),[d,c]);return n.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:u?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:u,onChange:S,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:y.bg,color:y.color,padding:"1px 6px"},children:y.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>p(!h),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:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:h?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&n.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[i.action==="add"&&i.eval&&n.jsx(Fh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&m&&n.jsx(Ih,{original:m,proposed:i.eval}),i.action==="remove"&&m&&n.jsx(Ph,{evalCase:m})]})]})}function Fh({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(to,{label:"Prompt",value:i.prompt}),n.jsx(to,{label:"Expected",value:i.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(u=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",u.text]},u.id))})]})]})}function Ih({original:i,proposed:c}){const u=[];i.name!==c.name&&u.push({label:"Name",old:i.name,new:c.name}),i.prompt!==c.prompt&&u.push({label:"Prompt",old:i.prompt,new:c.prompt}),i.expected_output!==c.expected_output&&u.push({label:"Expected",old:i.expected_output,new:c.expected_output});const d=i.assertions??[],m=c.assertions??[],h=new Set(d.map(f=>f.text)),p=new Set(m.map(f=>f.text)),y=m.filter(f=>!h.has(f.text)),g=d.filter(f=>!p.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[u.map(f=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),n.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[n.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",lo(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",lo(f.new,120)]})]})]},f.label)),(y.length>0||g.length>0)&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),n.jsxs("div",{className:"mt-1 space-y-0.5",children:[g.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),y.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),u.length===0&&y.length===0&&g.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Ph({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(to,{label:"Prompt",value:i.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(u=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:u.text},u.id))})]})]})}function to({label:i,value:c}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),n.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:lo(c,300)})]})}function lo(i,c){return i.length>c?i.slice(0,c)+"...":i}const Sx={remove:0,modify:1,add:2};function ev({changes:i,selections:c,currentEvals:u,onToggle:d,onSelectAll:m,onDeselectAll:h}){if(i.length===0)return null;const p=i.map((g,f)=>({change:g,originalIndex:f}));p.sort((g,f)=>(Sx[g.change.action]??2)-(Sx[f.change.action]??2));const y=Array.from(c.values()).filter(Boolean).length;return n.jsxs("div",{className:"mt-3 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",y,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:m,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"}),n.jsx("button",{onClick:h,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"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:p.map(({change:g,originalIndex:f})=>n.jsx(Wh,{change:g,index:f,selected:c.get(f)??!1,onToggle:d,originalEval:g.evalId!=null?u.find(S=>S.id===g.evalId):void 0},f))})]})}function tv(){var E;const{state:i,dispatch:c,submitAiEdit:u,applyAiEdit:d,discardAiEdit:m,cancelAiEdit:h,toggleEvalChange:p,selectAllEvalChanges:y,deselectAllEvalChanges:g,retryEvalsSave:f}=nl(),{aiEditLoading:S,aiEditResult:b,aiEditError:T,aiEditClassifiedError:O,aiEditProgress:B,aiEditEvalChanges:q,aiEditEvalSelections:Q,aiEditEvalsRetry:K}=i,[P,se]=v.useState(""),{config:Y}=dn(),[F,le]=v.useState("claude-cli"),[W,ae]=v.useState("opus"),he=v.useRef(null);v.useEffect(()=>{var A;(A=he.current)==null||A.focus()},[]),v.useEffect(()=>{if(!Y)return;Y.providers.find(J=>J.id==="claude-cli"&&J.available)&&(le("claude-cli"),ae("opus"))},[Y]);const re=Y==null?void 0:Y.providers.find(A=>A.id===F&&A.available),ge=v.useCallback(()=>{const A=P.trim();!A||S||u(A,F,W)},[P,S,u,F,W]),ve=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ge()),A.key==="Escape"&&(A.preventDefault(),S?h():m())},[ge,S,h,m]),X=v.useCallback(()=>{c({type:"CLOSE_AI_EDIT"}),c({type:"OPEN_AI_EDIT"})},[c]),ue=b?Er(i.skillContent,b.improved):[],Ee=((E=i.evals)==null?void 0:E.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:m,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:A=>{A.currentTarget.style.background="var(--surface-3)"},onMouseLeave:A=>{A.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:he,value:P,onChange:A=>se(A.target.value),onKeyDown:ve,placeholder:"e.g., Add an error handling section...",disabled:S,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:A=>{const J=A.currentTarget;J.style.height="auto",J.style.height=Math.min(J.scrollHeight,96)+"px"}})}),n.jsxs("div",{style:{minWidth:100},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:F,onChange:A=>{le(A.target.value);const J=Y==null?void 0:Y.providers.find(ce=>ce.id===A.target.value);J!=null&&J.models[0]&&ae(J.models[0].id)},disabled:S,style:{width:"100%"},children:Y==null?void 0:Y.providers.filter(A=>A.available).map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:W,onChange:A=>ae(A.target.value),disabled:S,style:{width:"100%"},children:re==null?void 0:re.models.map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),S?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:ge,disabled:!P.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),S&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(ss,{entries:B,isRunning:!0})})]}),T&&n.jsx("div",{className:"mt-3",children:O?n.jsx(kr,{error:O,onRetry:X,onDismiss:m}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),b&&n.jsxs("div",{className:"animate-fade-in",children:[b.reasoning&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),b.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:ue.map((A,J)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:A.type==="added"?"rgba(34,197,94,0.1)":A.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:A.type==="added"?"var(--green)":A.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:A.type==="added"?"3px solid var(--green)":A.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:A.type==="added"?"+":A.type==="removed"?"-":" "}),A.content]},J))}),n.jsx(ev,{changes:q,selections:Q,currentEvals:Ee,onToggle:p,onSelectAll:y,onDeselectAll:g}),K&&n.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:[n.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),n.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("button",{onClick:d,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:m,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:X,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function lv(i,c){const[u,d]=v.useState([]),[m,h]=v.useState("SKILL.md"),[p,y]=v.useState(null),[g,f]=v.useState(!1),[S,b]=v.useState(null),T=v.useCallback(async()=>{try{const q=await Te.getSkillFiles(i,c);d(q.files)}catch{d([])}},[i,c]);v.useEffect(()=>{h("SKILL.md"),y(null),b(null),T()},[i,c,T]);const O=v.useCallback(async q=>{if(h(q),q==="SKILL.md"){y(null),b(null);return}f(!0),b(null);try{const Q=await Te.getSkillFile(i,c,q);y(Q)}catch(Q){b(`Unable to open file: ${Q.message}`),y(null)}finally{f(!1)}},[i,c]),B=v.useCallback(()=>{T()},[T]);return{files:u,activeFile:m,secondaryContent:p,loading:g,error:S,selectFile:O,refresh:B,isSkillMd:m==="SKILL.md"}}function av(i){const c=[],u=new Map;for(const d of i){const m=d.path.split("/"),p={name:m[m.length-1],path:d.path,type:d.type,children:[]};u.set(d.path,p)}for(const d of i){const m=d.path.split("/");if(m.length===1){const h=u.get(d.path);h&&c.push(h)}else{const h=m.slice(0,-1).join("/"),p=u.get(h),y=u.get(d.path);p&&y&&p.children.push(y)}}return c}function Hx({expanded:i}){return n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function qx(){return n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 nv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function sv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("polyline",{points:"1 20 1 14 7 14"}),n.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:i,depth:c,activeFile:u,onSelect:d}){const[m,h]=v.useState(!0),p=i.path===u;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>h(!m),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:[n.jsx(Hx,{expanded:m}),n.jsx(qx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),m&&i.children.map(y=>n.jsx(Yx,{node:y,depth:c+1,activeFile:u,onSelect:d},y.path))]}):n.jsxs("button",{onClick:()=>d(i.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:[n.jsx("span",{style:{width:10}}),n.jsx(nv,{}),n.jsx("span",{children:i.name})]})}function rv({files:i,activeFile:c,onSelect:u,onRefresh:d}){const[m,h]=v.useState(!1),p=v.useMemo(()=>av(i),[i]);return n.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>h(!m),children:[n.jsx(Hx,{expanded:m}),n.jsx(qx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),n.jsx("button",{onClick:y=>{y.stopPropagation(),d()},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:n.jsx(sv,{})})]}),m&&n.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?n.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(y=>n.jsx(Yx,{node:y,depth:0,activeFile:c,onSelect:g=>{u(g),h(!1)}},y.path))})]})}function gr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function iv(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function cv(i){const c=i.toLowerCase();return c.endsWith(".json")?"json":c.endsWith(".md")?"md":"other"}function Nx({content:i}){return n.jsx("textarea",{readOnly:!0,value:i,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 Ex({content:i,fileType:c}){if(c==="json"){const u=iv(i);return n.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:u})}return c==="md"?n.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(i)}}):n.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:i})}function ov({file:i,loading:c,error:u,viewMode:d}){const[m,h]=v.useState(d),p=d!==m?d:m;if(c)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(u)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:n.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[n.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),n.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:u})]})});if(!i)return null;if(i.binary)return n.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",gr(i.size),") — cannot be displayed"]});const y=i.content??"",g=cv(i.path);return n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[i.truncated&&n.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 ",gr(512*1024)," — ",gr(i.size)," total"]}),g!=="other"&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[["raw","split","preview"].map(f=>n.jsx("button",{onClick:()=>h(f),style:{padding:"2px 8px",fontSize:11,background:p===f?"var(--accent-muted)":"none",color:p===f?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:f},f)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center"},children:[gr(i.size)," · read-only"]})]}),n.jsx("div",{style:{flex:1,display:"flex",minHeight:0},children:p==="split"&&g!=="other"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:n.jsx(Nx,{content:y})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:n.jsx(Ex,{content:y,fileType:g})})]}):p==="preview"&&g!=="other"?n.jsx(Ex,{content:y,fileType:g}):n.jsx(Nx,{content:y})})]})}function uv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function dv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function fv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function xv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}function Qc({size:i=15}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function mv(){const{state:i,dispatch:c,saveContent:u,isReadOnly:d}=nl(),{plugin:m,skill:h,skillContent:p,isDirty:y,improveTarget:g,aiEditOpen:f}=i,[S,b]=v.useState("split"),[T,O]=v.useState(!1),B=v.useRef(null),[q,Q]=v.useState(!1),[K,P]=v.useState(""),[se,Y]=v.useState(!1),[F,le]=v.useState(null),[W,ae]=v.useState([]),[he,re]=v.useState([]),[ge,ve]=v.useState(null),X=v.useRef(null),{config:ue}=dn(),{files:Ee,activeFile:E,secondaryContent:A,loading:J,error:ce,selectFile:pe,refresh:N,isSkillMd:D}=lv(m??"",h??"");v.useEffect(()=>()=>{var I;(I=X.current)==null||I.abort()},[]);const{metadata:Z,body:R}=Xh(p),G=Z["allowed-tools"],V=Array.isArray(G)?G:typeof G=="string"?[G]:[],ee=Z.name,fe=Z.description,ye=Z.metadata,Ze=typeof ye=="object"&&!Array.isArray(ye)?ye:null,et=Z.version||(Ze==null?void 0:Ze.version),$t=Z.tags||(Ze==null?void 0:Ze.tags),Al=Array.isArray($t)?$t:typeof $t=="string"?$t.split(",").map(I=>I.trim()).filter(Boolean):[],Wt=new Set(["name","description","metadata","allowed-tools","version","tags"]),sl=Object.entries(Z).filter(([I])=>!Wt.has(I)),rl=v.useCallback(async()=>{O(!0),await u(),O(!1)},[u]),wl=v.useCallback(I=>{(I.ctrlKey||I.metaKey)&&I.key==="s"&&(I.preventDefault(),I.stopPropagation(),y&&rl()),(I.ctrlKey||I.metaKey)&&I.key==="k"&&(I.preventDefault(),I.stopPropagation(),c({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[y,rl,f,c]),_l=v.useCallback(async()=>{var ze,mt;if(!K.trim())return;(ze=X.current)==null||ze.abort();const I=new AbortController;X.current=I,Y(!0),ve(null),re([]),le(null),ae([]);try{const Qt=(ue==null?void 0:ue.provider)||"claude-cli",$=(ue==null?void 0:ue.model)||"sonnet",_e=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:K,provider:Qt,model:$}),signal:I.signal});if(!_e.ok||!_e.body){let Mt=`HTTP ${_e.status}`;try{const Ve=await _e.json();Ve.error&&(Mt=Ve.error)}catch{}throw new Error(Mt)}const Xt=_e.body.getReader(),Nt=new TextDecoder;let pt="",It="";for(;;){const{done:Mt,value:Ve}=await Xt.read();if(Mt)break;pt+=Nt.decode(Ve,{stream:!0});const at=pt.split(`
|
|
57
|
+
`);if(u.length>1e3||d.length>1e3)return[...u.map(E=>({type:"unchanged",content:E}))];const m=u.length,h=d.length,p=Array.from({length:m+1},()=>new Array(h+1).fill(0));for(let E=1;E<=m;E++)for(let y=1;y<=h;y++)u[E-1]===d[y-1]?p[E][y]=p[E-1][y-1]+1:p[E][y]=Math.max(p[E-1][y],p[E][y-1]);const b=[];let g=m,f=h;for(;g>0||f>0;)g>0&&f>0&&u[g-1]===d[f-1]?(b.push({type:"unchanged",content:u[g-1]}),g--,f--):f>0&&(g===0||p[g][f-1]>=p[g-1][f])?(b.push({type:"added",content:d[f-1]}),f--):(b.push({type:"removed",content:u[g-1]}),g--);return b.reverse()}function Kh(i,c){if(c&&new Set(["generating","comparing","judging","judging_assertion","preparing","parsing","generating_skill","generating_baseline","scoring","action_items"]).has(i))return n.jsx("div",{className:"spinner",style:{width:10,height:10,flexShrink:0}});const d=new Set(["generating","comparing","preparing","generating_skill","generating_baseline","scoring","action_items"]);return n.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:d.has(i)?"var(--accent)":"var(--green)"}})}function ss({entries:i,isRunning:c}){const[u,d]=v.useState(!1),m=v.useRef(null);return v.useEffect(()=>{m.current&&!u&&(m.current.scrollTop=m.current.scrollHeight)},[i,u]),i.length===0&&!c?null:n.jsxs("div",{className:"mt-2 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("button",{onClick:()=>d(!u),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:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-tertiary)"},children:[n.jsxs("span",{className:"flex items-center gap-2",children:[c&&n.jsx("div",{className:"spinner",style:{width:10,height:10}}),"Progress Log (",i.length,")"]}),n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:u?"rotate(0)":"rotate(180deg)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),!u&&n.jsx("div",{ref:m,className:"px-3 pb-3 space-y-1 max-h-48 overflow-y-auto",children:i.map((h,p)=>{const b=p===i.length-1&&c,g=p===0?"0s":`+${((h.timestamp-i[0].timestamp)/1e3).toFixed(1)}s`;return n.jsxs("div",{className:"flex items-center gap-2 text-[11px] animate-fade-in",style:{opacity:b?1:.7},children:[Kh(h.phase,b),n.jsx("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)",width:40},children:g}),n.jsx("span",{style:{color:b?"var(--text-primary)":"var(--text-secondary)"},children:h.message}),h.current!=null&&h.total!=null&&n.jsxs("span",{className:"font-mono flex-shrink-0",style:{color:"var(--text-tertiary)"},children:["[",h.current,"/",h.total,"]"]})]},p)})})]})}const bx={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:i,onRetry:c,onDismiss:u}){const[d,m]=v.useState(null),h=v.useRef(null);v.useEffect(()=>(i.category==="rate_limit"&&i.retryAfterMs?m(Math.ceil(i.retryAfterMs/1e3)):m(null),()=>{h.current&&clearInterval(h.current)}),[i]),v.useEffect(()=>{if(!(d==null||d<=0))return h.current=setInterval(()=>{m(g=>g==null||g<=1?(h.current&&clearInterval(h.current),0):g-1)},1e3),()=>{h.current&&clearInterval(h.current)}},[d!=null&&d>0]);const p=bx[i.category]||bx.unknown,b=d!=null&&d>0;return n.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:[n.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{style:{fontSize:14},children:p.icon}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:p.color},children:i.title})]}),u&&n.jsx("button",{onClick:u,className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-3.5 pb-3",children:[n.jsx("p",{className:"text-[11.5px] mb-1.5",style:{color:"var(--text-secondary)"},children:i.description}),n.jsx("p",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.hint}),(c||d!=null)&&n.jsx("div",{className:"flex items-center gap-2 mt-2.5",children:c&&n.jsx("button",{onClick:c,disabled:b,className:"btn btn-secondary text-[11px]",style:{padding:"4px 10px",opacity:b?.5:1},children:b?`Retry in ${d}s`:"Retry"})})]})]})}function Jh({plugin:i,skill:c,skillContent:u,onApplied:d}){const[m,h]=v.useState("closed"),{config:p}=dn(),[b,g]=v.useState("claude-cli"),[f,E]=v.useState("opus"),[y,T]=v.useState([]),[z,B]=v.useState(""),[q,V]=v.useState(""),[K,P]=v.useState(null),[se,Y]=v.useState(null),[F,le]=v.useState([]),[W,ae]=v.useState(!1),he=v.useRef(null);v.useEffect(()=>{if(!p)return;p.providers.find(A=>A.id==="claude-cli"&&A.available)&&(g("claude-cli"),E("opus"))},[p]),v.useEffect(()=>()=>{var N;(N=he.current)==null||N.abort()},[]);function re(){return p==null?void 0:p.providers.find(N=>N.id===b&&N.available)}const ge=v.useCallback(()=>{var N;(N=he.current)==null||N.abort(),h("open")},[]);async function ve(){h("loading"),P(null),Y(null),le([]);const N=new AbortController;he.current=N;try{const A=await fetch(`/api/skills/${encodeURIComponent(i)}/${encodeURIComponent(c)}/improve?sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:b,model:f}),signal:N.signal});if(!A.ok||!A.body){let D=`HTTP ${A.status}`;try{const Z=await A.json();Z.error&&(D=Z.error)}catch{}throw new Error(D)}const J=A.body.getReader(),ce=new TextDecoder;let pe="",S="";for(;;){const{done:D,value:Z}=await J.read();if(D)break;pe+=ce.decode(Z,{stream:!0});const R=pe.split(`
|
|
58
|
+
`);pe=R.pop()||"";for(const G of R)if(G.startsWith("event: "))S=G.slice(7).trim();else if(G.startsWith("data: ")){try{const Q=JSON.parse(G.slice(6));S==="progress"?le(ee=>[...ee,{phase:Q.phase,message:Q.message,timestamp:Date.now()}]):S==="done"||S==="complete"?(B(Q.improved),V(Q.reasoning||""),T(Er(Q.original||u,Q.improved)),h("diff_shown")):S==="error"&&(P(Q.message||Q.description||"Unknown error"),Q.category&&Y(Q),h("open"))}catch{}S=""}}}catch(A){A.name!=="AbortError"&&(P(A.message),h("open"))}finally{he.current=null}}async function X(){ae(!0);try{await Te.applyImprovement(i,c,z),d(z),h("closed")}catch(N){P(N.message)}finally{ae(!1)}}function ue(){h("closed"),T([]),B(""),V(""),P(null)}if(m==="closed")return n.jsxs("button",{onClick:()=>h("open"),className:"btn btn-secondary mb-5",disabled:!u,children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),"Improve Skill"]});const Ee=re();return n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden animate-fade-in",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Skill Improvement"})]}),n.jsx("button",{onClick:ue,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:N=>{N.currentTarget.style.background="var(--surface-3)"},onMouseLeave:N=>{N.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-5 py-4",children:[(m==="open"||m==="loading")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-3 mb-4",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:b,onChange:N=>{g(N.target.value);const A=p==null?void 0:p.providers.find(J=>J.id===N.target.value);A!=null&&A.models[0]&&E(A.models[0].id)},disabled:m==="loading",children:p==null?void 0:p.providers.filter(N=>N.available).map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[12px] py-1.5",value:f,onChange:N=>E(N.target.value),disabled:m==="loading",children:Ee==null?void 0:Ee.models.map(N=>n.jsx("option",{value:N.id,children:N.label},N.id))})]}),m==="loading"?n.jsx("button",{onClick:ge,className:"btn btn-secondary flex-shrink-0",children:"Cancel"}):n.jsx("button",{onClick:ve,className:"btn btn-primary flex-shrink-0",children:"Improve"})]}),m==="loading"&&F.length>0&&n.jsx("div",{className:"mt-3",children:n.jsx(ss,{entries:F,isRunning:!0})})]}),K&&n.jsx("div",{className:"mb-4",children:se?n.jsx(kr,{error:se,onRetry:ve,onDismiss:()=>{P(null),Y(null)}}):n.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:K})}),m==="diff_shown"&&n.jsxs(n.Fragment,{children:[q&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),q]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-4",style:{border:"1px solid var(--border-subtle)",maxHeight:"400px",overflowY:"auto"},children:y.map((N,A)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:N.type==="added"?"rgba(34,197,94,0.1)":N.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:N.type==="added"?"var(--green)":N.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:N.type==="added"?"3px solid var(--green)":N.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:N.type==="added"?"+":N.type==="removed"?"-":" "}),N.content]},A))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:X,disabled:W,className:"btn btn-primary",children:W?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{width:12,height:12}})," Applying..."]}):n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Apply"]})}),n.jsx("button",{onClick:ue,className:"btn btn-secondary",children:"Discard"})]})]})]})]})}const jx={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"}},$h={remove:"var(--red)",modify:"#fbbf24",add:"var(--green)"};function Wh({change:i,index:c,selected:u,onToggle:d,originalEval:m}){var y;const[h,p]=v.useState(!1),b=jx[i.action]??jx.add,g=$h[i.action]??"var(--border-subtle)",f=i.action==="remove"?(m==null?void 0:m.name)??`Eval #${i.evalId}`:((y=i.eval)==null?void 0:y.name)??"Unnamed",E=v.useCallback(()=>d(c),[d,c]);return n.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:u?1:.5},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsx("input",{type:"checkbox",checked:u,onChange:E,className:"flex-shrink-0",style:{accentColor:"var(--accent)"}}),n.jsx("span",{className:"pill text-[9px] font-bold flex-shrink-0",style:{background:b.bg,color:b.color,padding:"1px 6px"},children:b.label}),n.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:"var(--text-primary)"},children:f}),n.jsx("span",{className:"text-[11px] truncate flex-1",style:{color:"var(--text-tertiary)"},children:i.reason}),n.jsx("button",{onClick:()=>p(!h),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:n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:h?"rotate(90deg)":"rotate(0)",transition:"transform 0.15s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),h&&n.jsxs("div",{className:"px-4 pb-3 animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)"},children:[i.action==="add"&&i.eval&&n.jsx(Fh,{evalCase:i.eval}),i.action==="modify"&&i.eval&&m&&n.jsx(Ih,{original:m,proposed:i.eval}),i.action==="remove"&&m&&n.jsx(Ph,{evalCase:m})]})]})}function Fh({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[n.jsx(to,{label:"Prompt",value:i.prompt}),n.jsx(to,{label:"Expected",value:i.expected_output}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-1",children:(i.assertions??[]).map(u=>n.jsxs("div",{className:"text-[11px] flex items-start gap-1.5",style:{color:"var(--text-secondary)"},children:[n.jsx("span",{style:{color:"var(--green)"},children:"+"})," ",u.text]},u.id))})]})]})}function Ih({original:i,proposed:c}){const u=[];i.name!==c.name&&u.push({label:"Name",old:i.name,new:c.name}),i.prompt!==c.prompt&&u.push({label:"Prompt",old:i.prompt,new:c.prompt}),i.expected_output!==c.expected_output&&u.push({label:"Expected",old:i.expected_output,new:c.expected_output});const d=i.assertions??[],m=c.assertions??[],h=new Set(d.map(f=>f.text)),p=new Set(m.map(f=>f.text)),b=m.filter(f=>!h.has(f.text)),g=d.filter(f=>!p.has(f.text));return n.jsxs("div",{className:"pt-2.5 space-y-2",children:[u.map(f=>n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:f.label}),n.jsxs("div",{className:"mt-1 text-[11px] font-mono rounded p-2",style:{background:"var(--surface-1)"},children:[n.jsxs("div",{style:{color:"var(--red)",textDecoration:"line-through"},children:["- ",lo(f.old,120)]}),n.jsxs("div",{style:{color:"var(--green)"},children:["+ ",lo(f.new,120)]})]})]},f.label)),(b.length>0||g.length>0)&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"Assertions"}),n.jsxs("div",{className:"mt-1 space-y-0.5",children:[g.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--red)"},children:["- ",f.text]},f.id)),b.map(f=>n.jsxs("div",{className:"text-[11px]",style:{color:"var(--green)"},children:["+ ",f.text]},f.id))]})]}),u.length===0&&b.length===0&&g.length===0&&n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"No visible field changes"})]})}function Ph({evalCase:i}){var c;return n.jsxs("div",{className:"pt-2.5 space-y-2",style:{opacity:.7},children:[n.jsx(to,{label:"Prompt",value:i.prompt}),n.jsxs("div",{children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Assertions (",((c=i.assertions)==null?void 0:c.length)??0,")"]}),n.jsx("div",{className:"mt-1 space-y-0.5",children:(i.assertions??[]).map(u=>n.jsx("div",{className:"text-[11px]",style:{color:"var(--red)",textDecoration:"line-through"},children:u.text},u.id))})]})]})}function to({label:i,value:c}){return n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),n.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:lo(c,300)})]})}function lo(i,c){return i.length>c?i.slice(0,c)+"...":i}const Sx={remove:0,modify:1,add:2};function ev({changes:i,selections:c,currentEvals:u,onToggle:d,onSelectAll:m,onDeselectAll:h}){if(i.length===0)return null;const p=i.map((g,f)=>({change:g,originalIndex:f}));p.sort((g,f)=>(Sx[g.change.action]??2)-(Sx[f.change.action]??2));const b=Array.from(c.values()).filter(Boolean).length;return n.jsxs("div",{className:"mt-3 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Test Case Changes"}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["(",b,"/",i.length," selected)"]})]}),n.jsxs("div",{className:"flex gap-1.5",children:[n.jsx("button",{onClick:m,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"}),n.jsx("button",{onClick:h,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"})]})]}),n.jsx("div",{className:"space-y-1.5 overflow-auto",style:{maxHeight:240},children:p.map(({change:g,originalIndex:f})=>n.jsx(Wh,{change:g,index:f,selected:c.get(f)??!1,onToggle:d,originalEval:g.evalId!=null?u.find(E=>E.id===g.evalId):void 0},f))})]})}function tv(){var N;const{state:i,dispatch:c,submitAiEdit:u,applyAiEdit:d,discardAiEdit:m,cancelAiEdit:h,toggleEvalChange:p,selectAllEvalChanges:b,deselectAllEvalChanges:g,retryEvalsSave:f}=nl(),{aiEditLoading:E,aiEditResult:y,aiEditError:T,aiEditClassifiedError:z,aiEditProgress:B,aiEditEvalChanges:q,aiEditEvalSelections:V,aiEditEvalsRetry:K}=i,[P,se]=v.useState(""),{config:Y}=dn(),[F,le]=v.useState("claude-cli"),[W,ae]=v.useState("opus"),he=v.useRef(null);v.useEffect(()=>{var A;(A=he.current)==null||A.focus()},[]),v.useEffect(()=>{if(!Y)return;Y.providers.find(J=>J.id==="claude-cli"&&J.available)&&(le("claude-cli"),ae("opus"))},[Y]);const re=Y==null?void 0:Y.providers.find(A=>A.id===F&&A.available),ge=v.useCallback(()=>{const A=P.trim();!A||E||u(A,F,W)},[P,E,u,F,W]),ve=v.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),ge()),A.key==="Escape"&&(A.preventDefault(),E?h():m())},[ge,E,h,m]),X=v.useCallback(()=>{c({type:"CLOSE_AI_EDIT"}),c({type:"OPEN_AI_EDIT"})},[c]),ue=y?Er(i.skillContent,y.improved):[],Ee=((N=i.evals)==null?void 0:N.evals)??[];return n.jsxs("div",{className:"animate-fade-in",style:{background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"AI Edit"}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:"Describe what to change — Enter to submit, Esc to dismiss"})]}),n.jsx("button",{onClick:m,className:"w-6 h-6 rounded-md flex items-center justify-center transition-colors duration-150",style:{color:"var(--text-tertiary)"},onMouseEnter:A=>{A.currentTarget.style.background="var(--surface-3)"},onMouseLeave:A=>{A.currentTarget.style.background="transparent"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n.jsxs("div",{className:"px-4 py-3",children:[!y&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-end gap-2.5",children:[n.jsx("div",{className:"flex-1",children:n.jsx("textarea",{ref:he,value:P,onChange:A=>se(A.target.value),onKeyDown:ve,placeholder:"e.g., Add an error handling section...",disabled:E,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:A=>{const J=A.currentTarget;J.style.height="auto",J.style.height=Math.min(J.scrollHeight,96)+"px"}})}),n.jsxs("div",{style:{minWidth:100},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:F,onChange:A=>{le(A.target.value);const J=Y==null?void 0:Y.providers.find(ce=>ce.id===A.target.value);J!=null&&J.models[0]&&ae(J.models[0].id)},disabled:E,style:{width:"100%"},children:Y==null?void 0:Y.providers.filter(A=>A.available).map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),n.jsxs("div",{style:{minWidth:80},children:[n.jsx("label",{className:"text-[10px] font-medium mb-0.5 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsx("select",{className:"input-field text-[11px] py-1",value:W,onChange:A=>ae(A.target.value),disabled:E,style:{width:"100%"},children:re==null?void 0:re.models.map(A=>n.jsx("option",{value:A.id,children:A.label},A.id))})]}),E?n.jsx("button",{onClick:h,className:"btn btn-secondary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Cancel"}):n.jsx("button",{onClick:ge,disabled:!P.trim(),className:"btn btn-primary flex-shrink-0 text-[11px]",style:{padding:"6px 14px"},children:"Submit"})]}),E&&B.length>0&&n.jsx("div",{className:"mt-2.5",children:n.jsx(ss,{entries:B,isRunning:!0})})]}),T&&n.jsx("div",{className:"mt-3",children:z?n.jsx(kr,{error:z,onRetry:X,onDismiss:m}):n.jsx("div",{className:"px-3 py-2.5 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:T})}),y&&n.jsxs("div",{className:"animate-fade-in",children:[y.reasoning&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),y.reasoning]}),n.jsx("div",{className:"mb-1",children:n.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"})}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:300,overflowY:"auto"},children:ue.map((A,J)=>n.jsxs("div",{className:"px-3 py-0.5 text-[10.5px] font-mono",style:{background:A.type==="added"?"rgba(34,197,94,0.1)":A.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:A.type==="added"?"var(--green)":A.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:A.type==="added"?"3px solid var(--green)":A.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:A.type==="added"?"+":A.type==="removed"?"-":" "}),A.content]},J))}),n.jsx(ev,{changes:q,selections:V,currentEvals:Ee,onToggle:p,onSelectAll:b,onDeselectAll:g}),K&&n.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:[n.jsx("span",{children:"Test case save failed. SKILL.md was saved successfully."}),n.jsx("button",{onClick:f,className:"btn text-[11px]",style:{background:"rgba(251,191,36,0.2)",color:"#fbbf24",padding:"3px 10px"},children:"Retry Save"})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("button",{onClick:d,className:"btn btn-primary text-[11px]",style:{padding:"5px 12px"},children:[n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:m,className:"btn btn-secondary text-[11px]",style:{padding:"5px 12px"},children:"Discard"}),n.jsx("button",{onClick:X,className:"btn btn-ghost text-[11px]",style:{padding:"5px 12px"},children:"Try Again"})]})]})]})]})}function lv(i,c){const[u,d]=v.useState([]),[m,h]=v.useState("SKILL.md"),[p,b]=v.useState(null),[g,f]=v.useState(!1),[E,y]=v.useState(null),T=v.useCallback(async()=>{try{const q=await Te.getSkillFiles(i,c);d(q.files)}catch{d([])}},[i,c]);v.useEffect(()=>{h("SKILL.md"),b(null),y(null),T()},[i,c,T]);const z=v.useCallback(async q=>{if(h(q),q==="SKILL.md"){b(null),y(null);return}f(!0),y(null);try{const V=await Te.getSkillFile(i,c,q);b(V)}catch(V){y(`Unable to open file: ${V.message}`),b(null)}finally{f(!1)}},[i,c]),B=v.useCallback(()=>{T()},[T]);return{files:u,activeFile:m,secondaryContent:p,loading:g,error:E,selectFile:z,refresh:B,isSkillMd:m==="SKILL.md"}}function av(i){const c=[],u=new Map;for(const d of i){const m=d.path.split("/"),p={name:m[m.length-1],path:d.path,type:d.type,children:[]};u.set(d.path,p)}for(const d of i){const m=d.path.split("/");if(m.length===1){const h=u.get(d.path);h&&c.push(h)}else{const h=m.slice(0,-1).join("/"),p=u.get(h),b=u.get(d.path);p&&b&&p.children.push(b)}}return c}function Hx({expanded:i}){return n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:i?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})})}function qx(){return n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 nv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function sv(){return n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"23 4 23 10 17 10"}),n.jsx("polyline",{points:"1 20 1 14 7 14"}),n.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:i,depth:c,activeFile:u,onSelect:d}){const[m,h]=v.useState(!0),p=i.path===u;return i.type==="dir"?n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>h(!m),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:[n.jsx(Hx,{expanded:m}),n.jsx(qx,{}),n.jsxs("span",{children:[i.name,"/"]})]}),m&&i.children.map(b=>n.jsx(Yx,{node:b,depth:c+1,activeFile:u,onSelect:d},b.path))]}):n.jsxs("button",{onClick:()=>d(i.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:[n.jsx("span",{style:{width:10}}),n.jsx(nv,{}),n.jsx("span",{children:i.name})]})}function rv({files:i,activeFile:c,onSelect:u,onRefresh:d}){const[m,h]=v.useState(!1),p=v.useMemo(()=>av(i),[i]);return n.jsxs("div",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 8px",cursor:"pointer",userSelect:"none"},onClick:()=>h(!m),children:[n.jsx(Hx,{expanded:m}),n.jsx(qx,{}),n.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}),n.jsx("button",{onClick:b=>{b.stopPropagation(),d()},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:n.jsx(sv,{})})]}),m&&n.jsx("div",{style:{maxHeight:240,overflowY:"auto",padding:"2px 4px 4px"},children:p.length===0?n.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 8px"},children:"No files found"}):p.map(b=>n.jsx(Yx,{node:b,depth:0,activeFile:c,onSelect:g=>{u(g),h(!1)}},b.path))})]})}function gr(i){return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function iv(i){try{return JSON.stringify(JSON.parse(i),null,2)}catch{return i}}function cv(i){const c=i.toLowerCase();return c.endsWith(".json")?"json":c.endsWith(".md")?"md":"other"}function Nx({content:i}){return n.jsx("textarea",{readOnly:!0,value:i,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 Ex({content:i,fileType:c}){if(c==="json"){const u=iv(i);return n.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:u})}return c==="md"?n.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(i)}}):n.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:i})}function ov({file:i,loading:c,error:u,viewMode:d}){const[m,h]=v.useState(d),p=d!==m?d:m;if(c)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:"Loading…"});if(u)return n.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:n.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:8,padding:"16px 20px",maxWidth:400,textAlign:"center"},children:[n.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",fontWeight:600,marginBottom:6},children:"Unable to open file"}),n.jsx("div",{style:{fontSize:12,color:"var(--text-tertiary)"},children:u})]})});if(!i)return null;if(i.binary)return n.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-tertiary)",fontSize:13},children:["Binary file (",gr(i.size),") — cannot be displayed"]});const b=i.content??"",g=cv(i.path);return n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[i.truncated&&n.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 ",gr(512*1024)," — ",gr(i.size)," total"]}),g!=="other"&&n.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-0)"},children:[["raw","split","preview"].map(f=>n.jsx("button",{onClick:()=>h(f),style:{padding:"2px 8px",fontSize:11,background:p===f?"var(--accent-muted)":"none",color:p===f?"var(--accent)":"var(--text-tertiary)",border:"none",borderRadius:3,cursor:"pointer",textTransform:"capitalize"},children:f},f)),n.jsxs("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)",display:"flex",alignItems:"center"},children:[gr(i.size)," · read-only"]})]}),n.jsx("div",{style:{flex:1,display:"flex",minHeight:0},children:p==="split"&&g!=="other"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-subtle)"},children:n.jsx(Nx,{content:b})}),n.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"auto"},children:n.jsx(Ex,{content:b,fileType:g})})]}):p==="preview"&&g!=="other"?n.jsx(Ex,{content:b,fileType:g}):n.jsx(Nx,{content:b})})]})}function uv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function dv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3"}),n.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"21"})]})}function fv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function xv({size:i=15}){return n.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M15 4V2"}),n.jsx("path",{d:"M15 16v-2"}),n.jsx("path",{d:"M8 9h2"}),n.jsx("path",{d:"M20 9h2"}),n.jsx("path",{d:"M17.8 11.8L19 13"}),n.jsx("path",{d:"M15 9h.01"}),n.jsx("path",{d:"M17.8 6.2L19 5"}),n.jsx("path",{d:"M11 6.2L9.7 5"}),n.jsx("path",{d:"M3 21l9-9"})]})}function Qc({size:i=15}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"})})}function mv(){const{state:i,dispatch:c,saveContent:u,isReadOnly:d}=nl(),{plugin:m,skill:h,skillContent:p,isDirty:b,improveTarget:g,aiEditOpen:f}=i,[E,y]=v.useState("split"),[T,z]=v.useState(!1),B=v.useRef(null),[q,V]=v.useState(!1),[K,P]=v.useState(""),[se,Y]=v.useState(!1),[F,le]=v.useState(null),[W,ae]=v.useState([]),[he,re]=v.useState([]),[ge,ve]=v.useState(null),X=v.useRef(null),{config:ue}=dn(),{files:Ee,activeFile:N,secondaryContent:A,loading:J,error:ce,selectFile:pe,refresh:S,isSkillMd:D}=lv(m??"",h??"");v.useEffect(()=>()=>{var I;(I=X.current)==null||I.abort()},[]);const{metadata:Z,body:R}=Xh(p),G=Z["allowed-tools"],Q=Array.isArray(G)?G:typeof G=="string"?[G]:[],ee=Z.name,fe=Z.description,ye=Z.metadata,Ze=typeof ye=="object"&&!Array.isArray(ye)?ye:null,et=Z.version||(Ze==null?void 0:Ze.version),$t=Z.tags||(Ze==null?void 0:Ze.tags),Al=Array.isArray($t)?$t:typeof $t=="string"?$t.split(",").map(I=>I.trim()).filter(Boolean):[],Wt=new Set(["name","description","metadata","allowed-tools","version","tags"]),sl=Object.entries(Z).filter(([I])=>!Wt.has(I)),rl=v.useCallback(async()=>{z(!0),await u(),z(!1)},[u]),wl=v.useCallback(I=>{(I.ctrlKey||I.metaKey)&&I.key==="s"&&(I.preventDefault(),I.stopPropagation(),b&&rl()),(I.ctrlKey||I.metaKey)&&I.key==="k"&&(I.preventDefault(),I.stopPropagation(),c({type:f?"CLOSE_AI_EDIT":"OPEN_AI_EDIT"}))},[b,rl,f,c]),_l=v.useCallback(async()=>{var ze,mt;if(!K.trim())return;(ze=X.current)==null||ze.abort();const I=new AbortController;X.current=I,Y(!0),ve(null),re([]),le(null),ae([]);try{const Qt=(ue==null?void 0:ue.provider)||"claude-cli",$=(ue==null?void 0:ue.model)||"sonnet",_e=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:K,provider:Qt,model:$}),signal:I.signal});if(!_e.ok||!_e.body){let Mt=`HTTP ${_e.status}`;try{const Ve=await _e.json();Ve.error&&(Mt=Ve.error)}catch{}throw new Error(Mt)}const Xt=_e.body.getReader(),Nt=new TextDecoder;let pt="",It="";for(;;){const{done:Mt,value:Ve}=await Xt.read();if(Mt)break;pt+=Nt.decode(Ve,{stream:!0});const at=pt.split(`
|
|
59
59
|
`);pt=at.pop()||"";for(const Ge of at)if(Ge.startsWith("event: "))It=Ge.slice(7).trim();else if(Ge.startsWith("data: ")){try{const $e=JSON.parse(Ge.slice(6));if(It==="progress")re(Et=>[...Et,{phase:$e.phase,message:$e.message,timestamp:Date.now()}]);else if(It==="done"||It==="complete"){const Et=["---"];$e.name&&Et.push(`name: ${$e.name}`),$e.description&&Et.push(`description: "${$e.description.replace(/"/g,'\\"')}"`),$e.model&&Et.push(`model: ${$e.model}`),(mt=$e.allowedTools)!=null&&mt.trim()&&Et.push(`allowed-tools: ${$e.allowedTools.trim()}`),Et.push("---","",$e.body||"");const cl=Et.join(`
|
|
60
|
-
`);le(cl),ae(Er(p,cl)),Y(!1)}else It==="error"&&(ve($e.message||$e.description||"Generation failed"),Y(!1))}catch{}It=""}}}catch(Qt){Qt.name!=="AbortError"&&ve(Qt.message)}finally{Y(!1),X.current=null}},[K,ue,p]),Ft=v.useCallback(()=>{F&&c({type:"SET_CONTENT",content:F}),Q(!1),le(null),ae([]),P(""),re([])},[F,c]),Vt=v.useCallback(()=>{Q(!1),le(null),ae([]),P(""),re([]),ve(null)},[]),Rl=v.useCallback(()=>{var I;q?((I=X.current)==null||I.abort(),Vt()):(f&&c({type:"CLOSE_AI_EDIT"}),Q(!0))},[q,f,c,Vt]),il=[{mode:"raw",icon:n.jsx(uv,{}),label:"Editor"},{mode:"split",icon:n.jsx(dv,{}),label:"Split"},{mode:"preview",icon:n.jsx(fv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:wl,tabIndex:-1,children:[n.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:[n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:il.map(({mode:I,icon:ze,label:mt})=>n.jsxs("button",{onClick:()=>b(I),title:mt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:S===I?"var(--surface-4)":"transparent",color:S===I?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:S===I?600:400,border:"none",cursor:"pointer"},children:[ze,n.jsx("span",{style:{letterSpacing:"0.01em"},children:mt})]},I))}),D?d?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{f?c({type:"CLOSE_AI_EDIT"}):(q&&Vt(),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:[n.jsx(xv,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Rl,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:q?600:400,border:"none",cursor:"pointer",color:q?"#a855f7":"var(--text-tertiary)",background:q?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Qc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),y&&n.jsx("button",{onClick:()=>c({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:rl,disabled:!y||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),m&&h&&n.jsx(rv,{files:Ee,activeFile:E,onSelect:pe,onRefresh:N}),!D&&n.jsx(ov,{file:A,loading:J,error:ce,viewMode:S}),D&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:S==="raw"||S==="preview"?"1fr":"1fr 1fr"},children:[S!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:S==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:p,onChange:I=>{d||c({type:"SET_CONTENT",content:I.target.value})},onKeyDown:wl,spellCheck:!1,readOnly:d,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:d?.7:1}})}),S!=="raw"&&n.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(ee||et||fe)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[ee&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:ee}),et&&n.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",et]})]}),fe&&n.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:fe})]}),Al.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:Al.map(I=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:I},I))}),V.length>0&&n.jsx("div",{style:{marginBottom:16},children:n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),V.map(I=>n.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:I},I))]})}),sl.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:sl.map(([I,ze],mt)=>{const Qt=Array.isArray(ze)?ze.join(", "):typeof ze=="object"?Object.entries(ze).map(([$,_e])=>`${$}: ${Array.isArray(_e)?_e.join(", "):_e}`).join(" | "):ze;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:mt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:I}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Qt})]},I)})}),(ee||fe||Al.length>0||V.length>0||sl.length>0)&&R&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),R&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(R)}})]})})]}),D&&f&&n.jsx(tv,{}),D&&q&&n.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:n.jsxs("div",{className:"px-4 py-3",children:[!F&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),n.jsx("div",{className:"flex gap-2 mb-2",children:n.jsx("textarea",{value:K,onChange:I=>P(I.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:se,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:se?.5:1},onKeyDown:I=>{I.key==="Enter"&&(I.ctrlKey||I.metaKey)&&K.trim()&&!se&&(I.preventDefault(),_l())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[se?n.jsx("button",{onClick:()=>{var I;(I=X.current)==null||I.abort(),Y(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:_l,disabled:!K.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Vt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),se&&he.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(ss,{entries:he,isRunning:!0})}),ge&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ge,n.jsx("button",{onClick:_l,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),F&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:W.map((I,ze)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:I.type==="added"?"rgba(34,197,94,0.1)":I.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:I.type==="added"?"var(--green)":I.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:I.type==="added"?"3px solid var(--green)":I.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:I.type==="added"?"+":I.type==="removed"?"-":" "}),I.content]},ze))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Ft,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:Vt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),D&&g!==null&&m&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Jh,{plugin:m,skill:h,skillContent:p,onApplied:I=>{c({type:"SET_CONTENT",content:I}),c({type:"CONTENT_SAVED"}),c({type:"CLOSE_IMPROVE"})}})})]})}function ao(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Gx(i){const c=new Date(i);return c.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Vx(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}const pv=new Set(["benchmark","comparison","baseline"]);function kx(i,c,u,d){return i.map(({rate:m,idx:h,total:p})=>{const y=d+h/(p-1)*(c-d*2),g=d+(u-d*2)-m*(u-d*2);return`${y},${g}`})}function Qx({entries:i}){const c=i.filter(S=>pv.has(S.type)).slice().reverse(),u=c.map((S,b,T)=>({rate:S.pass_rate,idx:b,total:T.length})).filter((S,b)=>{const T=c[b].type;return T==="benchmark"||T==="comparison"}),d=c.flatMap((S,b)=>S.type==="baseline"?[{rate:S.pass_rate,idx:b,total:c.length}]:S.type==="comparison"&&S.baselinePassRate!=null?[{rate:S.baselinePassRate,idx:b,total:c.length}]:[]);if(u.length<2&&d.length<2)return null;const m=80,h=24,p=2,y=u.length>=2?kx(u,m,h,p):[],g=d.length>=2?kx(d,m,h,p):[],f=y[y.length-1];return n.jsxs("svg",{width:m,height:h,style:{display:"block",flexShrink:0},children:[g.length>0&&n.jsx("polyline",{points:g.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),y.length>0&&n.jsx("polyline",{points:y.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),f&&n.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function hv(i,c,u){const[d,m]=v.useState(null),[h,p]=v.useState(!1),y=v.useRef("");v.useEffect(()=>{const f=`${i}/${c}/${u}`;y.current!==f&&(y.current=f,p(!0),Te.getCaseHistory(i,c,u).then(S=>m(S)).catch(()=>m([])).finally(()=>p(!1)))},[i,c,u]);const g=v.useCallback(()=>{p(!0),y.current="",Te.getCaseHistory(i,c,u).then(f=>m(f)).catch(()=>m([])).finally(()=>p(!1))},[i,c,u]);return{entries:d,loading:h,refetch:g}}function vv(i,c,u){const d={flaky:!1,nonDiscriminating:!1,regression:!1};if(!u||u.length===0)return d;const h=u.slice(0,10).map(g=>g.assertions.find(f=>f.id===i)).filter(Boolean);if(h.length>=2){const f=h.filter(S=>S.pass).length/h.length;f>=.3&&f<=.7&&(d.flaky=!0)}const p=u.find(g=>g.type==="benchmark"),y=u.find(g=>g.type==="baseline");if(p&&y){const g=p.assertions.find(S=>S.id===i),f=y.assertions.find(S=>S.id===i);g!=null&&g.pass&&(f!=null&&f.pass)&&(d.nonDiscriminating=!0)}if(c&&!c.pass&&u.length>=1){const f=u[0].assertions.find(S=>S.id===i);f!=null&&f.pass&&(d.regression=!0)}return d}function yv(){var he;const{state:i,dispatch:c,saveEvals:u,runCase:d,runAll:m,cancelCase:h,cancelAll:p,generateEvals:y,isReadOnly:g}=nl(),{evals:f,evalsError:S,selectedCaseId:b,inlineResults:T,caseRunStates:O,generateEvalsLoading:B,generateEvalsProgress:q,generateEvalsError:Q}=i,K=v.useMemo(()=>{for(const re of O.values())if(re.status==="running"||re.status==="queued")return!0;return!1},[O]),[P,se]=v.useState(!1),Y={skill_name:i.skill,evals:[]},F=f??Y,le=F.evals,W=le.find(re=>re.id===b)??null,ae=v.useCallback(()=>{y()},[y]);return!f||le.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:S?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:S?n.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:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsx("div",{className:"text-center",children:S?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),n.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:S}),n.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"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>se(!0),disabled:g,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:ae,disabled:B||g,className:"btn btn-secondary text-[12px]",children:B?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),B&&q.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(ss,{entries:q,isRunning:!0})}),Q&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(kr,{error:Q,onRetry:ae})}),P&&n.jsx(Tx,{evals:F,onSave:re=>{u(re),se(!1)},onCancel:()=>se(!1)})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[n.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",le.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:K?n.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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m("benchmark"),disabled:le.length===0||g,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>m("comparison"),disabled:le.length===0||g,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:le.map(re=>{const ge=T.get(re.id),ve=b===re.id;return n.jsxs("button",{onClick:()=>c({type:"SELECT_CASE",caseId:re.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:ve?"var(--accent-muted)":"transparent",borderLeft:ve?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:X=>{ve||(X.currentTarget.style.background="var(--surface-2)")},onMouseLeave:X=>{ve||(X.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:ve?"var(--text-primary)":"var(--text-secondary)"},children:["#",re.id," ",re.name]}),n.jsx(Xx,{result:ge})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[re.assertions.length," assertion",re.assertions.length!==1?"s":"",(ge==null?void 0:ge.passRate)!=null&&n.jsx(jv,{passRate:ge.passRate})]})]},re.id)})}),n.jsx("div",{className:"px-3 py-2",children:!g&&n.jsx("button",{onClick:()=>se(!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:re=>{re.currentTarget.style.borderColor="var(--accent)",re.currentTarget.style.color="var(--accent)"},onMouseLeave:re=>{re.currentTarget.style.borderColor="var(--border-default)",re.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:W?n.jsx(gv,{evalCase:W,result:T.get(W.id),evals:f,caseStatus:((he=O.get(W.id))==null?void 0:he.status)??"idle",onSaveEvals:u,onRun:re=>d(re,"benchmark"),onCompare:re=>d(re,"comparison"),onCancel:re=>h(re),onImprove:re=>c({type:"OPEN_IMPROVE",evalId:re})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),P&&n.jsx(Tx,{evals:F,onSave:re=>{u(re),se(!1)},onCancel:()=>se(!1)})]})}function gv({evalCase:i,result:c,evals:u,caseStatus:d,onSaveEvals:m,onRun:h,onCompare:p,onCancel:y,onImprove:g}){const{state:f,isReadOnly:S}=nl(),{plugin:b,skill:T}=f,{entries:O,loading:B}=hv(b,T,i.id),[q,Q]=v.useState(!1),[K,P]=v.useState(i.prompt),[se,Y]=v.useState(!1),[F,le]=v.useState(i.expected_output);v.useState(()=>{P(i.prompt),le(i.expected_output)});const W=v.useCallback(E=>{m({...u,evals:u.evals.map(A=>A.id===E.id?E:A)})},[u,m]),ae=v.useCallback(()=>{W({...i,prompt:K}),Q(!1)},[i,K,W]),he=v.useCallback(()=>{W({...i,expected_output:F}),Y(!1)},[i,F,W]),re=v.useCallback(()=>{W({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,W]),ge=v.useCallback((E,A)=>{W({...i,assertions:i.assertions.map(J=>J.id===E?{...J,text:A}:J)})},[i,W]),ve=v.useCallback(E=>{W({...i,assertions:i.assertions.filter(A=>A.id!==E)})},[i,W]),X=v.useCallback(()=>{confirm("Delete this test case?")&&m({...u,evals:u.evals.filter(E=>E.id!==i.id)})},[u,i.id,m]),ue=c&&c.assertions.length>0&&c.assertions.every(E=>E.pass),Ee=c&&c.assertions.some(E=>!E.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(Xx,{result:c})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[d==="running"||d==="queued"?n.jsxs("button",{onClick:()=>y(i.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>h(i.id),disabled:S,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>p(i.id),disabled:S,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),Ee&&!S&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:()=>g(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!S&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:X,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.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"})]})})]})]}),ue&&n.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:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Xc,{title:"Prompt",children:q?n.jsxs("div",{children:[n.jsx("textarea",{value:K,onChange:E=>P(E.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:ae,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{P(i.prompt),Q(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:S?"default":"pointer"},onClick:()=>{S||Q(!0)},onMouseEnter:E=>{S||(E.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:E=>{E.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:S?"No prompt":"Click to edit prompt..."})})}),n.jsx(Xc,{title:"Expected Output",children:se?n.jsxs("div",{children:[n.jsx("textarea",{value:F,onChange:E=>le(E.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:he,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{le(i.expected_output),Y(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:S?"default":"pointer"},onClick:()=>{S||Y(!0)},onMouseEnter:E=>{S||(E.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:E=>{E.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:S?"No expected output":"Click to edit expected output..."})})}),n.jsx(Xc,{title:`Assertions (${i.assertions.length})`,action:S?void 0:n.jsx("button",{onClick:re,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:i.assertions.length===0?n.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):n.jsx("div",{className:"space-y-2",children:i.assertions.map(E=>{const A=c==null?void 0:c.assertions.find(ce=>ce.assertion_id===E.id),J=vv(E.id,A,O);return n.jsx(bv,{assertion:E,result:A,badges:J,isReadOnly:S,onUpdate:ce=>ge(E.id,ce),onDelete:()=>ve(E.id)},E.id)})})}),(c==null?void 0:c.output)&&n.jsx(Sv,{output:c.output,durationMs:c.durationMs,tokens:c.tokens}),n.jsx(Nv,{evalId:i.id,sharedEntries:O,sharedLoading:B})]},i.id)}function bv({assertion:i,result:c,badges:u,isReadOnly:d,onUpdate:m,onDelete:h}){const[p,y]=v.useState(!1),[g,f]=v.useState(i.text),[S,b]=v.useState(!1),T=()=>{m(g),y(!1)};return n.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:n.jsxs("div",{className:"flex items-start gap-2",children:[c?n.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?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.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"}),(u==null?void 0:u.regression)&&n.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:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(u==null?void 0:u.flaky)&&n.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"}),(u==null?void 0:u.nonDiscriminating)&&n.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?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:g,onChange:O=>f(O.target.value),onKeyDown:O=>{O.key==="Enter"&&T(),O.key==="Escape"&&y(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:T,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:d?"default":"pointer"},onClick:()=>{d||(f(i.text),y(!0))},children:i.text}),(c==null?void 0:c.reasoning)&&n.jsx("button",{onClick:()=>b(!S),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:S?"Hide reasoning":"Show reasoning"}),S&&(c==null?void 0:c.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:c.reasoning})]}),!d&&n.jsx("button",{onClick:h,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:O=>{O.currentTarget.style.color="var(--red)",O.currentTarget.style.opacity="1"},onMouseLeave:O=>{O.currentTarget.style.color="var(--text-tertiary)",O.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Xc({title:i,action:c,children:u}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),c]}),u]})}function Xx({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const c=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:c?"var(--green-muted)":"var(--red-muted)",color:c?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function jv({passRate:i}){const c=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${c}%`,background:c>=80?"var(--green)":c>=50?"var(--yellow)":"var(--red)"}})})})}function Sv({output:i,durationMs:c,tokens:u}){const[d,m]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>m(!d),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:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:d?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(c/1e3).toFixed(1),"s)"]}),u!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",u," tokens)"]})]}),d&&n.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:i})]})}function Zc(i){return i==="baseline"?"right":i==="comparison"?"full":"left"}function Kc({entry:i}){return n.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Gx(i.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:i.type==="benchmark"?"rgba(99,131,255,0.15)":i.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:i.type==="benchmark"?"#6383ff":i.type==="comparison"?"var(--purple)":"#fb923c"},children:i.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:ao(i.pass_rate)},children:[Math.round(i.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[i.durationMs!=null&&n.jsx("span",{children:Vx(i.durationMs)}),i.tokens!=null&&n.jsxs("span",{children:[i.tokens>=1e3?`${(i.tokens/1e3).toFixed(1)}k`:i.tokens," tok"]})]}),i.type==="comparison"&&i.baselinePassRate!=null&&(()=>{const c=i.pass_rate-i.baselinePassRate,u=c>.001?"skill":c<-.001?"baseline":"tie",d=c>0?"+":"",m=u==="skill"?"var(--green)":u==="baseline"?"var(--red)":"var(--text-tertiary)";return n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:c>=0?"var(--green)":"var(--red)"},children:[d,(c*100).toFixed(1),"%"]}),n.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:m},children:u})]})})(),n.jsx("div",{className:"space-y-0.5",children:i.assertions.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.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?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:c.text})]},c.id))})]})}function Nv({evalId:i,sharedEntries:c,sharedLoading:u}){const{state:d,dispatch:m}=nl(),{plugin:h,skill:p}=d,[y,g]=v.useState(!0),f=c??null,S=u??!1,b=v.useCallback(()=>{g(!y)},[y]),T=f?f.slice(0,10):[],O=T.some(q=>Zc(q.type)==="left"),B=T.some(q=>Zc(q.type)==="right");return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:b,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:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:y?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),y&&n.jsx("div",{className:"animate-fade-in",children:S?n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?n.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):n.jsxs("div",{children:[T.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Qx,{entries:T})}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!O&&n.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!B&&n.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((q,Q)=>{const K=Zc(q.type);return K==="full"?n.jsx("div",{style:{gridColumn:"1 / -1"},children:n.jsx(Kc,{entry:q})},Q):K==="left"?n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"},children:n.jsx(Kc,{entry:q})},Q),n.jsx("div",{style:{gridColumn:"2"}},`${Q}-spacer`)]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"}},`${Q}-spacer`),n.jsx("div",{style:{gridColumn:"2"},children:n.jsx(Kc,{entry:q})},Q)]})})]}),n.jsx("button",{onClick:()=>m({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:q=>{q.currentTarget.style.textDecoration="underline"},onMouseLeave:q=>{q.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function Tx({evals:i,onSave:c,onCancel:u}){const[d,m]=v.useState(""),[h,p]=v.useState(""),[y,g]=v.useState(""),[f,S]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),b=Math.max(0,...i.evals.map(O=>O.id))+1,T=()=>{if(!d.trim()||!h.trim())return;const O={id:b,name:d.trim(),prompt:h.trim(),expected_output:y.trim(),files:[],assertions:f.filter(B=>B.text.trim())};c({...i,evals:[...i.evals,O]})};return n.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:n.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:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:d,onChange:O=>m(O.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:h,onChange:O=>p(O.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:y,onChange:O=>g(O.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((O,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:O.text,onChange:q=>S(f.map((Q,K)=>K===B?{...Q,text:q.target.value}:Q)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>S(f.filter((q,Q)=>Q!==B)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},O.id)),n.jsx("button",{onClick:()=>S([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:T,disabled:!d.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Ev(i,c){const u=i+c,d=u*10,m=u*25,h=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${h(d)}–${h(m)}`}function kv(){const{state:i,runCase:c,runAll:u,cancelCase:d,cancelAll:m,isReadOnly:h}=nl(),{evals:p,caseRunStates:y,bulkRunActive:g,latestBenchmark:f,inlineResults:S}=i,b=(p==null?void 0:p.evals)??[],T=v.useMemo(()=>{for(const Y of y.values())if(Y.status==="running"||Y.status==="queued")return!0;return!1},[y]),O=b.filter(Y=>{const F=y.get(Y.id);return F&&(F.status==="complete"||F.status==="error"||F.status==="cancelled")}).length,B=b.filter(Y=>{const F=y.get(Y.id);return F&&(F.status==="running"||F.status==="queued")}).length,q=v.useRef(null),[Q,K]=v.useState(0);v.useEffect(()=>{if(T&&!q.current&&(q.current=Date.now()),!T){q.current=null,K(0);return}const Y=setInterval(()=>{q.current&&K(Math.round((Date.now()-q.current)/1e3))},1e3);return()=>clearInterval(Y)},[T]);const P=b.reduce((Y,F)=>Y+F.assertions.length,0),se=v.useMemo(()=>Ev(b.length,P),[b.length,P]);return n.jsxs("div",{className:"p-5",children:[h&&n.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:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),n.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),T&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[B," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T&&n.jsxs("button",{onClick:m,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>u("comparison"),disabled:b.length===0||T||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>u("benchmark"),disabled:b.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>u("baseline"),disabled:b.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&b.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",O,"/",b.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(O/b.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${O/b.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",Q>=60?`${Math.floor(Q/60)}m ${Q%60}s`:`${Q}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",se]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:b.map(Y=>{const F=S.get(Y.id),le=y.get(Y.id),W=(le==null?void 0:le.status)??"idle";return n.jsx(Cv,{name:Y.name,evalId:Y.id,result:F,caseStatus:W,runMode:(le==null?void 0:le.mode)??null,isReadOnly:h,onRun:ae=>c(ae,"benchmark"),onBaseline:ae=>c(ae,"baseline"),onCompare:ae=>c(ae,"comparison"),onCancel:ae=>d(ae)},Y.id)})}),!T&&f&&f.cases.length>0&&n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),n.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&&n.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&&n.jsx("button",{onClick:()=>u("comparison"),disabled:b.length===0||h,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:b.length===0?.5:1},children:"Run Final A/B Comparison"})]}),f.comparison&&n.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Cx,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(Cx,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.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 Tv={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 Cv({name:i,evalId:c,result:u,caseStatus:d,runMode:m,isReadOnly:h,onRun:p,onBaseline:y,onCompare:g,onCancel:f}){const[S,b]=v.useState(!1),T=d==="running"||d==="queued",O=d==="complete"||d==="error";return n.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:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[d==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),d==="queued"&&n.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),n.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",c," ",i]}),m&&(T||O)&&(()=>{const B=Tv[m];return B?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:B.bg,color:B.color,padding:"1px 6px"},children:B.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T?n.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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>g(c),disabled:h,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>p(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>y(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),u&&u.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:u.status==="pass"?"var(--green-muted)":(u.status==="error","var(--red-muted)"),color:u.status==="pass"?"var(--green)":"var(--red)"},children:u.passRate!=null?`${Math.round(u.passRate*100)}%`:u.status}),d==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),u&&u.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:u.assertions.map(B=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:B.pass?"var(--green)":"var(--red)"},children:B.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:B.text})]},B.assertion_id))}),u.output&&n.jsx("button",{onClick:()=>b(!S),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:S?"Hide output":"Show output"}),S&&u.output&&n.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:u.output})]}),u&&u.errorMessage&&n.jsx(Av,{errorMessage:u.errorMessage,classifiedError:u.classifiedError})]})}const Jc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Av({errorMessage:i,classifiedError:c}){const[u,d]=v.useState(!1),m=(c==null?void 0:c.title)??"Error",h=c==null?void 0:c.hint,p=c?Jc[c.category]??Jc.unknown:Jc.unknown;return n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[n.jsx("span",{style:{fontSize:12},children:p}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:m}),n.jsx("button",{onClick:()=>d(!u),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:u?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),u&&n.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:i})]})})}function Cx({label:i,value:c,color:u}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:u},children:[Math.round(c*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c*100}%`,background:u}})})]})}const Ax={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)"}},wv=[{label:"Should activate",prompts:["+How do I use this feature?","+Show me best practices for this","+What's the recommended approach?"]},{label:"Should NOT activate",prompts:["!What's the weather today?","!Write me a poem","!How do I cook pasta?"]}];function _v(){const{state:i,dispatch:c,runActivationTest:u}=nl(),{plugin:d,skill:m,activationPrompts:h,activationResults:p,activationSummary:y,activationRunning:g,activationError:f}=i,[S,b]=v.useState(h),[T,O]=v.useState(null);v.useEffect(()=>{c({type:"SET_ACTIVATION_PROMPTS",prompts:S})},[S,c]),v.useEffect(()=>{fetch(`/api/skills/${d}/${m}/description`).then(Y=>Y.json()).then(Y=>O(Y.rawContent||Y.description||null)).catch(()=>O(null))},[d,m]);function B(){u(S)}function q(Y){const F=S.trim(),le=F?`${F}
|
|
60
|
+
`);le(cl),ae(Er(p,cl)),Y(!1)}else It==="error"&&(ve($e.message||$e.description||"Generation failed"),Y(!1))}catch{}It=""}}}catch(Qt){Qt.name!=="AbortError"&&ve(Qt.message)}finally{Y(!1),X.current=null}},[K,ue,p]),Ft=v.useCallback(()=>{F&&c({type:"SET_CONTENT",content:F}),V(!1),le(null),ae([]),P(""),re([])},[F,c]),Vt=v.useCallback(()=>{V(!1),le(null),ae([]),P(""),re([]),ve(null)},[]),Rl=v.useCallback(()=>{var I;q?((I=X.current)==null||I.abort(),Vt()):(f&&c({type:"CLOSE_AI_EDIT"}),V(!0))},[q,f,c,Vt]),il=[{mode:"raw",icon:n.jsx(uv,{}),label:"Editor"},{mode:"split",icon:n.jsx(dv,{}),label:"Split"},{mode:"preview",icon:n.jsx(fv,{}),label:"Preview"}];return n.jsxs("div",{className:"flex flex-col h-full",onKeyDown:wl,tabIndex:-1,children:[n.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:[n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:il.map(({mode:I,icon:ze,label:mt})=>n.jsxs("button",{onClick:()=>y(I),title:mt,className:"flex items-center gap-1.5 rounded-md transition-all duration-150",style:{padding:"5px 10px",background:E===I?"var(--surface-4)":"transparent",color:E===I?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:E===I?600:400,border:"none",cursor:"pointer"},children:[ze,n.jsx("span",{style:{letterSpacing:"0.01em"},children:mt})]},I))}),D?d?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("span",{className:"flex items-center gap-1.5 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Read-only"]})}):n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("button",{onClick:()=>{f?c({type:"CLOSE_AI_EDIT"}):(q&&Vt(),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:[n.jsx(xv,{size:13}),n.jsx("span",{children:"AI Edit"})]}),n.jsxs("button",{onClick:Rl,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:q?600:400,border:"none",cursor:"pointer",color:q?"#a855f7":"var(--text-tertiary)",background:q?"rgba(168,85,247,0.12)":"transparent"},children:[n.jsx(Qc,{size:13}),n.jsx("span",{children:"Regenerate"})]}),n.jsx("div",{style:{width:1,height:16,background:"var(--border-subtle)"}}),b&&n.jsx("button",{onClick:()=>c({type:"SET_CONTENT",content:i.savedContent}),className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Discard"}),n.jsx("button",{onClick:rl,disabled:!b||T,className:"btn btn-primary text-[11px]",style:{padding:"5px 14px"},children:T?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:11,height:11,borderWidth:1.5}})," Saving..."]}):"Save"})]}):null]}),m&&h&&n.jsx(rv,{files:Ee,activeFile:N,onSelect:pe,onRefresh:S}),!D&&n.jsx(ov,{file:A,loading:J,error:ce,viewMode:E}),D&&n.jsxs("div",{className:"flex-1 overflow-hidden",style:{display:"grid",gridTemplateColumns:E==="raw"||E==="preview"?"1fr":"1fr 1fr"},children:[E!=="preview"&&n.jsx("div",{className:"flex flex-col overflow-hidden",style:{borderRight:E==="split"?"1px solid var(--border-subtle)":"none"},children:n.jsx("textarea",{ref:B,value:p,onChange:I=>{d||c({type:"SET_CONTENT",content:I.target.value})},onKeyDown:wl,spellCheck:!1,readOnly:d,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:d?.7:1}})}),E!=="raw"&&n.jsx("div",{className:"overflow-auto",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{padding:"20px 24px",maxWidth:720},children:[(ee||et||fe)&&n.jsxs("div",{style:{marginBottom:20},children:[n.jsxs("div",{className:"flex items-baseline gap-3",style:{marginBottom:8},children:[ee&&n.jsx("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text-primary)",letterSpacing:"-0.02em",lineHeight:1.2,margin:0},children:ee}),et&&n.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",et]})]}),fe&&n.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:fe})]}),Al.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-1.5",style:{marginBottom:16},children:Al.map(I=>n.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-tertiary)",background:"var(--surface-2)",padding:"3px 8px",borderRadius:4,letterSpacing:"0.02em"},children:I},I))}),Q.length>0&&n.jsx("div",{style:{marginBottom:16},children:n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",marginRight:4},children:"Tools"}),Q.map(I=>n.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:I},I))]})}),sl.length>0&&n.jsx("div",{style:{marginBottom:16,padding:"8px 0",borderTop:"1px solid var(--border-subtle)",borderBottom:"1px solid var(--border-subtle)"},children:sl.map(([I,ze],mt)=>{const Qt=Array.isArray(ze)?ze.join(", "):typeof ze=="object"?Object.entries(ze).map(([$,_e])=>`${$}: ${Array.isArray(_e)?_e.join(", "):_e}`).join(" | "):ze;return n.jsxs("div",{className:"flex items-baseline gap-3",style:{padding:"4px 0",borderTop:mt>0?"1px solid var(--border-subtle)":"none"},children:[n.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-tertiary)",minWidth:80,flexShrink:0},children:I}),n.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)"},children:Qt})]},I)})}),(ee||fe||Al.length>0||Q.length>0||sl.length>0)&&R&&n.jsx("div",{style:{height:1,background:"linear-gradient(90deg, var(--accent) 0%, var(--border-subtle) 40%, transparent 100%)",marginBottom:20,opacity:.5}}),R&&n.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto",style:{color:"var(--text-secondary)",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:Nr(R)}})]})})]}),D&&f&&n.jsx(tv,{}),D&&q&&n.jsx("div",{className:"animate-fade-in",style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:n.jsxs("div",{className:"px-4 py-3",children:[!F&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerate Skill"})]}),n.jsx("div",{className:"flex gap-2 mb-2",children:n.jsx("textarea",{value:K,onChange:I=>P(I.target.value),placeholder:"Describe what this skill should do...",rows:2,disabled:se,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:se?.5:1},onKeyDown:I=>{I.key==="Enter"&&(I.ctrlKey||I.metaKey)&&K.trim()&&!se&&(I.preventDefault(),_l())}})}),n.jsxs("div",{className:"flex items-center gap-2",children:[se?n.jsx("button",{onClick:()=>{var I;(I=X.current)==null||I.abort(),Y(!1)},className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Cancel"}):n.jsx("button",{onClick:_l,disabled:!K.trim(),className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:"Generate"}),n.jsx("button",{onClick:Vt,className:"btn btn-ghost text-[11px]",style:{padding:"4px 8px"},children:"Close"})]}),se&&he.length>0&&n.jsx("div",{className:"mt-2",children:n.jsx(ss,{entries:he,isRunning:!0})}),ge&&n.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)"},children:[ge,n.jsx("button",{onClick:_l,className:"ml-2 underline",style:{color:"var(--red)"},children:"Retry"})]})]}),F&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx(Qc,{size:14}),n.jsx("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:"Regenerated — Review Changes"})]}),n.jsx("div",{className:"rounded-lg overflow-hidden mb-3",style:{border:"1px solid var(--border-subtle)",maxHeight:"300px",overflowY:"auto"},children:W.map((I,ze)=>n.jsxs("div",{className:"px-3 py-0.5 text-[11px] font-mono",style:{background:I.type==="added"?"rgba(34,197,94,0.1)":I.type==="removed"?"rgba(239,68,68,0.1)":"transparent",color:I.type==="added"?"var(--green)":I.type==="removed"?"var(--red)":"var(--text-secondary)",borderLeft:I.type==="added"?"3px solid var(--green)":I.type==="removed"?"3px solid var(--red)":"3px solid transparent"},children:[n.jsx("span",{style:{userSelect:"none",opacity:.5,marginRight:8},children:I.type==="added"?"+":I.type==="removed"?"-":" "}),I.content]},ze))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:Ft,className:"btn btn-primary text-[11px]",style:{padding:"4px 12px"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Apply"]}),n.jsx("button",{onClick:Vt,className:"btn btn-secondary text-[11px]",style:{padding:"4px 12px"},children:"Discard"})]})]})]})}),D&&g!==null&&m&&h&&n.jsx("div",{style:{borderTop:"1px solid var(--border-subtle)"},children:n.jsx(Jh,{plugin:m,skill:h,skillContent:p,onApplied:I=>{c({type:"SET_CONTENT",content:I}),c({type:"CONTENT_SAVED"}),c({type:"CLOSE_IMPROVE"})}})})]})}function ao(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Gx(i){const c=new Date(i);return c.toLocaleDateString(void 0,{month:"short",day:"numeric"})+", "+c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Vx(i){return i==null?"--":i>=1e3?`${(i/1e3).toFixed(1)}s`:`${i}ms`}const pv=new Set(["benchmark","comparison","baseline"]);function kx(i,c,u,d){return i.map(({rate:m,idx:h,total:p})=>{const b=d+h/(p-1)*(c-d*2),g=d+(u-d*2)-m*(u-d*2);return`${b},${g}`})}function Qx({entries:i}){const c=i.filter(y=>pv.has(y.type)).slice().reverse(),u=c.map((y,T,z)=>({rate:y.pass_rate,idx:T,total:z.length})).filter((y,T)=>{const z=c[T].type;return z==="benchmark"||z==="comparison"}),d=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(u.length<2&&d.length<2)return null;const m=80,h=24,p=2,b=u.length>=2?kx(u,m,h,p):[],g=d.length>=2?kx(d,m,h,p):[],f=b[b.length-1],E=g[g.length-1];return n.jsxs("svg",{width:m,height:h,style:{display:"block",flexShrink:0},children:[g.length>0&&n.jsx("polyline",{points:g.join(" "),fill:"none",stroke:"var(--text-tertiary)",strokeWidth:1.5,strokeLinejoin:"round",strokeDasharray:"3 2"}),b.length>0&&n.jsx("polyline",{points:b.join(" "),fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),E&&n.jsx("circle",{cx:parseFloat(E.split(",")[0]),cy:parseFloat(E.split(",")[1]),r:2.5,fill:"var(--text-tertiary)"}),f&&n.jsx("circle",{cx:parseFloat(f.split(",")[0]),cy:parseFloat(f.split(",")[1]),r:2.5,fill:"var(--accent)"})]})}function hv(i,c,u){const[d,m]=v.useState(null),[h,p]=v.useState(!1),b=v.useRef("");v.useEffect(()=>{const f=`${i}/${c}/${u}`;b.current!==f&&(b.current=f,p(!0),Te.getCaseHistory(i,c,u).then(E=>m(E)).catch(()=>m([])).finally(()=>p(!1)))},[i,c,u]);const g=v.useCallback(()=>{p(!0),b.current="",Te.getCaseHistory(i,c,u).then(f=>m(f)).catch(()=>m([])).finally(()=>p(!1))},[i,c,u]);return{entries:d,loading:h,refetch:g}}function vv(i,c,u){const d={flaky:!1,nonDiscriminating:!1,regression:!1};if(!u||u.length===0)return d;const h=u.slice(0,10).map(g=>g.assertions.find(f=>f.id===i)).filter(Boolean);if(h.length>=2){const f=h.filter(E=>E.pass).length/h.length;f>=.3&&f<=.7&&(d.flaky=!0)}const p=u.find(g=>g.type==="benchmark"),b=u.find(g=>g.type==="baseline");if(p&&b){const g=p.assertions.find(E=>E.id===i),f=b.assertions.find(E=>E.id===i);g!=null&&g.pass&&(f!=null&&f.pass)&&(d.nonDiscriminating=!0)}if(c&&!c.pass&&u.length>=1){const f=u[0].assertions.find(E=>E.id===i);f!=null&&f.pass&&(d.regression=!0)}return d}function yv(){var he;const{state:i,dispatch:c,saveEvals:u,runCase:d,runAll:m,cancelCase:h,cancelAll:p,generateEvals:b,isReadOnly:g}=nl(),{evals:f,evalsError:E,selectedCaseId:y,inlineResults:T,caseRunStates:z,generateEvalsLoading:B,generateEvalsProgress:q,generateEvalsError:V}=i,K=v.useMemo(()=>{for(const re of z.values())if(re.status==="running"||re.status==="queued")return!0;return!1},[z]),[P,se]=v.useState(!1),Y={skill_name:i.skill,evals:[]},F=f??Y,le=F.evals,W=le.find(re=>re.id===y)??null,ae=v.useCallback(()=>{b()},[b]);return!f||le.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 px-8",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center",style:{background:E?"var(--error-muted, #3f1a1a)":"var(--accent-muted)"},children:E?n.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:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}):n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M9 11l3 3L22 4"}),n.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}),n.jsx("div",{className:"text-center",children:E?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--error, #f87171)"},children:"Invalid evals.json"}),n.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:E}),n.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"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-primary)"},children:"No test cases yet"}),n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Create test cases to start evaluating your skill"})]})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>se(!0),disabled:g,className:"btn btn-primary text-[12px]",children:"Create Test Case"}),n.jsx("button",{onClick:ae,disabled:B||g,className:"btn btn-secondary text-[12px]",children:B?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}})," Generating..."]}):"Generate with AI"})]}),B&&q.length>0&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(ss,{entries:q,isRunning:!0})}),V&&n.jsx("div",{className:"w-full max-w-md mt-3",children:n.jsx(kr,{error:V,onRetry:ae})}),P&&n.jsx(Tx,{evals:F,onSave:re=>{u(re),se(!1)},onCancel:()=>se(!1)})]}):n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",height:"100%",overflow:"hidden"},children:[n.jsxs("div",{className:"overflow-auto",style:{borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:["Test Cases (",le.length,")"]}),n.jsx("div",{className:"flex items-center gap-1.5",children:K?n.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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m("benchmark"),disabled:le.length===0||g,className:"btn btn-primary text-[10px] px-2 py-0.5",children:"Run All"}),n.jsx("button",{onClick:()=>m("comparison"),disabled:le.length===0||g,className:"btn btn-purple text-[10px] px-2 py-0.5",children:"Compare All"})]})})]}),n.jsx("div",{className:"py-1",children:le.map(re=>{const ge=T.get(re.id),ve=y===re.id;return n.jsxs("button",{onClick:()=>c({type:"SELECT_CASE",caseId:re.id}),className:"w-full text-left px-3 py-2.5 transition-all duration-150",style:{background:ve?"var(--accent-muted)":"transparent",borderLeft:ve?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:X=>{ve||(X.currentTarget.style.background="var(--surface-2)")},onMouseLeave:X=>{ve||(X.currentTarget.style.background="transparent")},children:[n.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[n.jsxs("span",{className:"text-[12px] font-medium truncate",style:{color:ve?"var(--text-primary)":"var(--text-secondary)"},children:["#",re.id," ",re.name]}),n.jsx(Xx,{result:ge})]}),n.jsxs("div",{className:"text-[11px] flex items-center gap-2",style:{color:"var(--text-tertiary)"},children:[re.assertions.length," assertion",re.assertions.length!==1?"s":"",(ge==null?void 0:ge.passRate)!=null&&n.jsx(jv,{passRate:ge.passRate})]})]},re.id)})}),n.jsx("div",{className:"px-3 py-2",children:!g&&n.jsx("button",{onClick:()=>se(!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:re=>{re.currentTarget.style.borderColor="var(--accent)",re.currentTarget.style.color="var(--accent)"},onMouseLeave:re=>{re.currentTarget.style.borderColor="var(--border-default)",re.currentTarget.style.color="var(--text-tertiary)"},children:"+ Add Test Case"})})]}),n.jsx("div",{className:"overflow-auto",children:W?n.jsx(gv,{evalCase:W,result:T.get(W.id),evals:f,caseStatus:((he=z.get(W.id))==null?void 0:he.status)??"idle",onSaveEvals:u,onRun:re=>d(re,"benchmark"),onCompare:re=>d(re,"comparison"),onCancel:re=>h(re),onImprove:re=>c({type:"OPEN_IMPROVE",evalId:re})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"Select a test case"})}),P&&n.jsx(Tx,{evals:F,onSave:re=>{u(re),se(!1)},onCancel:()=>se(!1)})]})}function gv({evalCase:i,result:c,evals:u,caseStatus:d,onSaveEvals:m,onRun:h,onCompare:p,onCancel:b,onImprove:g}){const{state:f,isReadOnly:E}=nl(),{plugin:y,skill:T}=f,{entries:z,loading:B}=hv(y,T,i.id),[q,V]=v.useState(!1),[K,P]=v.useState(i.prompt),[se,Y]=v.useState(!1),[F,le]=v.useState(i.expected_output);v.useState(()=>{P(i.prompt),le(i.expected_output)});const W=v.useCallback(N=>{m({...u,evals:u.evals.map(A=>A.id===N.id?N:A)})},[u,m]),ae=v.useCallback(()=>{W({...i,prompt:K}),V(!1)},[i,K,W]),he=v.useCallback(()=>{W({...i,expected_output:F}),Y(!1)},[i,F,W]),re=v.useCallback(()=>{W({...i,assertions:[...i.assertions,{id:`assert-${Date.now()}`,text:"New assertion",type:"boolean"}]})},[i,W]),ge=v.useCallback((N,A)=>{W({...i,assertions:i.assertions.map(J=>J.id===N?{...J,text:A}:J)})},[i,W]),ve=v.useCallback(N=>{W({...i,assertions:i.assertions.filter(A=>A.id!==N)})},[i,W]),X=v.useCallback(()=>{confirm("Delete this test case?")&&m({...u,evals:u.evals.filter(N=>N.id!==i.id)})},[u,i.id,m]),ue=c&&c.assertions.length>0&&c.assertions.every(N=>N.pass),Ee=c&&c.assertions.some(N=>!N.pass);return n.jsxs("div",{className:"p-5 animate-fade-in",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-[16px] font-semibold",style:{color:"var(--text-primary)"},children:["#",i.id," ",i.name]}),n.jsx(Xx,{result:c})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[d==="running"||d==="queued"?n.jsxs("button",{onClick:()=>b(i.id),className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel"]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>h(i.id),disabled:E,className:"btn btn-primary text-[12px]",children:"Run"}),n.jsx("button",{onClick:()=>p(i.id),disabled:E,className:"btn btn-purple text-[12px]",children:"A/B Compare"})]}),Ee&&!E&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:()=>g(i.id),className:"btn btn-secondary text-[12px]",children:"Fix with AI"}),!E&&d!=="running"&&d!=="queued"&&n.jsx("button",{onClick:X,className:"btn btn-ghost text-[12px]",style:{color:"var(--red)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("polyline",{points:"3 6 5 6 21 6"}),n.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"})]})})]})]}),ue&&n.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:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",children:[n.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),n.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--green)"},children:"All assertions passing"})]}),n.jsx(Xc,{title:"Prompt",children:q?n.jsxs("div",{children:[n.jsx("textarea",{value:K,onChange:N=>P(N.target.value),className:"input-field w-full",rows:4,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:ae,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{P(i.prompt),V(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:E?"default":"pointer"},onClick:()=>{E||V(!0)},onMouseEnter:N=>{E||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.prompt||n.jsx("span",{style:{color:"var(--text-tertiary)",fontStyle:"italic"},children:E?"No prompt":"Click to edit prompt..."})})}),n.jsx(Xc,{title:"Expected Output",children:se?n.jsxs("div",{children:[n.jsx("textarea",{value:F,onChange:N=>le(N.target.value),className:"input-field w-full",rows:3,style:{fontFamily:"var(--font-mono, ui-monospace, monospace)",fontSize:12},autoFocus:!0}),n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx("button",{onClick:he,className:"btn btn-primary text-[12px]",children:"Save"}),n.jsx("button",{onClick:()=>{le(i.expected_output),Y(!1)},className:"btn btn-ghost text-[12px]",children:"Cancel"})]})]}):n.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:E?"default":"pointer"},onClick:()=>{E||Y(!0)},onMouseEnter:N=>{E||(N.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:N=>{N.currentTarget.style.borderColor="var(--border-subtle)"},children:i.expected_output||n.jsx("span",{style:{fontStyle:"italic"},children:E?"No expected output":"Click to edit expected output..."})})}),n.jsx(Xc,{title:`Assertions (${i.assertions.length})`,action:E?void 0:n.jsx("button",{onClick:re,className:"btn btn-ghost text-[11px]",children:"+ Add"}),children:i.assertions.length===0?n.jsx("div",{className:"text-[12px] text-center py-4",style:{color:"var(--text-tertiary)"},children:'No assertions. Click "+ Add" to create one.'}):n.jsx("div",{className:"space-y-2",children:i.assertions.map(N=>{const A=c==null?void 0:c.assertions.find(ce=>ce.assertion_id===N.id),J=vv(N.id,A,z);return n.jsx(bv,{assertion:N,result:A,badges:J,isReadOnly:E,onUpdate:ce=>ge(N.id,ce),onDelete:()=>ve(N.id)},N.id)})})}),(c==null?void 0:c.output)&&n.jsx(Sv,{output:c.output,durationMs:c.durationMs,tokens:c.tokens}),n.jsx(Nv,{evalId:i.id,sharedEntries:z,sharedLoading:B})]},i.id)}function bv({assertion:i,result:c,badges:u,isReadOnly:d,onUpdate:m,onDelete:h}){const[p,b]=v.useState(!1),[g,f]=v.useState(i.text),[E,y]=v.useState(!1),T=()=>{m(g),b(!1)};return n.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:n.jsxs("div",{className:"flex items-start gap-2",children:[c?n.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?n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}):n.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"}),(u==null?void 0:u.regression)&&n.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:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("polyline",{points:"19 12 12 19 5 12"})]})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.jsx("span",{className:"text-[10px] font-mono font-semibold",style:{color:"var(--text-tertiary)"},children:i.id}),(u==null?void 0:u.flaky)&&n.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"}),(u==null?void 0:u.nonDiscriminating)&&n.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?n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{value:g,onChange:z=>f(z.target.value),onKeyDown:z=>{z.key==="Enter"&&T(),z.key==="Escape"&&b(!1)},className:"input-field flex-1 text-[12px]",autoFocus:!0}),n.jsx("button",{onClick:T,className:"btn btn-primary text-[11px]",children:"Save"})]}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-secondary)",cursor:d?"default":"pointer"},onClick:()=>{d||(f(i.text),b(!0))},children:i.text}),(c==null?void 0:c.reasoning)&&n.jsx("button",{onClick:()=>y(!E),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide reasoning":"Show reasoning"}),E&&(c==null?void 0:c.reasoning)&&n.jsx("div",{className:"mt-1 text-[11px] p-2 rounded",style:{background:"var(--surface-1)",color:"var(--text-tertiary)"},children:c.reasoning})]}),!d&&n.jsx("button",{onClick:h,className:"btn btn-ghost p-1 opacity-0 group-hover:opacity-100",style:{color:"var(--text-tertiary)"},onMouseEnter:z=>{z.currentTarget.style.color="var(--red)",z.currentTarget.style.opacity="1"},onMouseLeave:z=>{z.currentTarget.style.color="var(--text-tertiary)",z.currentTarget.style.opacity=""},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})})}function Xc({title:i,action:c,children:u}){return n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:i}),c]}),u]})}function Xx({result:i}){if(!i||i.status==null)return n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"--"});const c=i.status==="pass";return n.jsx("span",{className:"pill text-[10px]",style:{background:c?"var(--green-muted)":"var(--red-muted)",color:c?"var(--green)":"var(--red)"},children:i.passRate!=null?`${Math.round(i.passRate*100)}%`:i.status})}function jv({passRate:i}){const c=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-1",children:n.jsx("div",{className:"rounded-full overflow-hidden",style:{width:32,height:4,background:"var(--surface-4)"},children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${c}%`,background:c>=80?"var(--green)":c>=50?"var(--yellow)":"var(--red)"}})})})}function Sv({output:i,durationMs:c,tokens:u}){const[d,m]=v.useState(!1);return n.jsxs("div",{className:"mb-5",children:[n.jsxs("button",{onClick:()=>m(!d),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:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:d?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease"},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"LLM Output",c!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",(c/1e3).toFixed(1),"s)"]}),u!=null&&n.jsxs("span",{style:{fontWeight:400},children:["(",u," tokens)"]})]}),d&&n.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:i})]})}function Zc(i){return i==="baseline"?"right":i==="comparison"?"full":"left"}function Kc({entry:i}){return n.jsxs("div",{className:"rounded-lg px-3 py-2.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Gx(i.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:i.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:i.type==="benchmark"?"rgba(99,131,255,0.15)":i.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:i.type==="benchmark"?"#6383ff":i.type==="comparison"?"var(--purple)":"#fb923c"},children:i.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:ao(i.pass_rate)},children:[Math.round(i.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-1.5 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[i.durationMs!=null&&n.jsx("span",{children:Vx(i.durationMs)}),i.tokens!=null&&n.jsxs("span",{children:[i.tokens>=1e3?`${(i.tokens/1e3).toFixed(1)}k`:i.tokens," tok"]})]}),i.type==="comparison"&&i.baselinePassRate!=null&&(()=>{const c=i.pass_rate-i.baselinePassRate,u=c>.001?"skill":c<-.001?"baseline":"tie",d=c>0?"+":"",m=u==="skill"?"var(--green)":u==="baseline"?"var(--red)":"var(--text-tertiary)";return n.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"vs baseline:"}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:c>=0?"var(--green)":"var(--red)"},children:[d,(c*100).toFixed(1),"%"]}),n.jsx("span",{className:"pill text-[9px]",style:{padding:"1px 5px",background:"rgba(0,0,0,0.2)",color:m},children:u})]})})(),n.jsx("div",{className:"space-y-0.5",children:i.assertions.map(c=>n.jsxs("div",{className:"flex items-start gap-1.5",children:[n.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?n.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:c.text})]},c.id))})]})}function Nv({evalId:i,sharedEntries:c,sharedLoading:u}){const{state:d,dispatch:m}=nl(),{plugin:h,skill:p}=d,[b,g]=v.useState(!0),f=c??null,E=u??!1,y=v.useCallback(()=>{g(q=>!q)},[]),T=f?f.slice(0,10):[],z=T.some(q=>{const V=Zc(q.type);return V==="left"||V==="full"}),B=T.some(q=>{const V=Zc(q.type);return V==="right"||V==="full"});return n.jsxs("div",{className:"mb-5",children:[n.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:[n.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:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),"Execution History",f&&f.length>0&&n.jsxs("span",{style:{fontWeight:400},children:["(",f.length," run",f.length!==1?"s":"",")"]})]}),b&&n.jsx("div",{className:"animate-fade-in",children:E?n.jsxs("div",{className:"flex items-center gap-2 py-3",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):!f||f.length===0?n.jsx("div",{className:"text-[12px] py-3",style:{color:"var(--text-tertiary)"},children:"No history for this case"}):n.jsxs("div",{children:[T.length>=2&&n.jsx("div",{className:"mb-2",children:n.jsx(Qx,{entries:T})}),n.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"1"},children:"Skill"}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)",gridColumn:"2"},children:"Baseline"}),!z&&n.jsx("div",{style:{gridColumn:"1",fontSize:12,color:"var(--text-tertiary)"},children:"No skill runs"}),!B&&n.jsx("div",{style:{gridColumn:"2",fontSize:12,color:"var(--text-tertiary)"},children:"No baseline runs"}),T.map((q,V)=>{const K=Zc(q.type);return K==="full"?n.jsx("div",{style:{gridColumn:"1 / -1"},children:n.jsx(Kc,{entry:q})},V):K==="left"?n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"},children:n.jsx(Kc,{entry:q})}),n.jsx("div",{style:{gridColumn:"2"}})]},V):n.jsxs(v.Fragment,{children:[n.jsx("div",{style:{gridColumn:"1"}}),n.jsx("div",{style:{gridColumn:"2"},children:n.jsx(Kc,{entry:q})})]},V)})]}),n.jsx("button",{onClick:()=>m({type:"SET_PANEL",panel:"history"}),className:"mt-2 text-[11px] font-medium transition-colors duration-150",style:{color:"var(--accent)"},onMouseEnter:q=>{q.currentTarget.style.textDecoration="underline"},onMouseLeave:q=>{q.currentTarget.style.textDecoration="none"},children:"View full history →"})]})})]})}function Tx({evals:i,onSave:c,onCancel:u}){const[d,m]=v.useState(""),[h,p]=v.useState(""),[b,g]=v.useState(""),[f,E]=v.useState([{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),y=Math.max(0,...i.evals.map(z=>z.id))+1,T=()=>{if(!d.trim()||!h.trim())return;const z={id:y,name:d.trim(),prompt:h.trim(),expected_output:b.trim(),files:[],assertions:f.filter(B=>B.text.trim())};c({...i,evals:[...i.evals,z]})};return n.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:n.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:[n.jsx("div",{className:"text-[15px] font-semibold mb-4",style:{color:"var(--text-primary)"},children:"New Test Case"}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Name"}),n.jsx("input",{value:d,onChange:z=>m(z.target.value),className:"input-field",placeholder:"e.g., auth-check",autoFocus:!0})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Prompt"}),n.jsx("textarea",{value:h,onChange:z=>p(z.target.value),className:"input-field",rows:3,placeholder:"User prompt to test..."})]}),n.jsxs("label",{className:"block mb-3",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Expected Output"}),n.jsx("textarea",{value:b,onChange:z=>g(z.target.value),className:"input-field",rows:2,placeholder:"Description of expected behavior..."})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Assertions"}),f.map((z,B)=>n.jsxs("div",{className:"flex gap-2 mb-2",children:[n.jsx("input",{value:z.text,onChange:q=>E(f.map((V,K)=>K===B?{...V,text:q.target.value}:V)),className:"input-field flex-1 text-[12px]",placeholder:"e.g., Output includes a greeting"}),f.length>1&&n.jsx("button",{onClick:()=>E(f.filter((q,V)=>V!==B)),className:"btn btn-ghost p-1",style:{color:"var(--text-tertiary)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},z.id)),n.jsx("button",{onClick:()=>E([...f,{id:`assert-${Date.now()}`,text:"",type:"boolean"}]),className:"text-[11px] mt-1 transition-colors duration-150",style:{color:"var(--accent)"},children:"+ Add Assertion"})]}),n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:u,className:"btn btn-secondary text-[12px]",children:"Cancel"}),n.jsx("button",{onClick:T,disabled:!d.trim()||!h.trim(),className:"btn btn-primary text-[12px]",children:"Save"})]})]})})}function Ev(i,c){const u=i+c,d=u*10,m=u*25,h=p=>p>=60?`${Math.round(p/60)}m`:`${p}s`;return`${h(d)}–${h(m)}`}function kv(){const{state:i,runCase:c,runAll:u,cancelCase:d,cancelAll:m,isReadOnly:h}=nl(),{evals:p,caseRunStates:b,bulkRunActive:g,latestBenchmark:f,inlineResults:E}=i,y=(p==null?void 0:p.evals)??[],T=v.useMemo(()=>{for(const Y of b.values())if(Y.status==="running"||Y.status==="queued")return!0;return!1},[b]),z=y.filter(Y=>{const F=b.get(Y.id);return F&&(F.status==="complete"||F.status==="error"||F.status==="cancelled")}).length,B=y.filter(Y=>{const F=b.get(Y.id);return F&&(F.status==="running"||F.status==="queued")}).length,q=v.useRef(null),[V,K]=v.useState(0);v.useEffect(()=>{if(T&&!q.current&&(q.current=Date.now()),!T){q.current=null,K(0);return}const Y=setInterval(()=>{q.current&&K(Math.round((Date.now()-q.current)/1e3))},1e3);return()=>clearInterval(Y)},[T]);const P=y.reduce((Y,F)=>Y+F.assertions.length,0),se=v.useMemo(()=>Ev(y.length,P),[y.length,P]);return n.jsxs("div",{className:"p-5",children:[h&&n.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:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),n.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Installed skill — benchmarking is disabled. Edit the source skill to run benchmarks."]}),n.jsxs("div",{className:"rounded-xl p-4 mb-5",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Benchmark"}),T&&n.jsxs("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:[B," running"]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T&&n.jsxs("button",{onClick:m,className:"btn text-[12px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid rgba(239,68,68,0.3)"},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",style:{marginRight:4},children:n.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})}),"Cancel All"]}),n.jsx("button",{onClick:()=>u("comparison"),disabled:y.length===0||T||h,className:"btn btn-primary text-[12px]",children:"Compare All"}),n.jsx("button",{onClick:()=>u("benchmark"),disabled:y.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Skill Only"}),n.jsx("button",{onClick:()=>u("baseline"),disabled:y.length===0||T||h,className:"btn btn-secondary text-[12px]",children:"Baseline Only"})]})]}),T&&y.length>0&&n.jsxs("div",{className:"mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("span",{className:"text-[12px] font-medium",style:{color:"var(--text-secondary)"},children:["Progress: ",z,"/",y.length," cases"]}),n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:[Math.round(z/y.length*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${z/y.length*100}%`,background:"var(--accent)"}})}),n.jsxs("div",{className:"flex items-center justify-between mt-1.5",children:[n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Elapsed: ",V>=60?`${Math.floor(V/60)}m ${V%60}s`:`${V}s`]}),n.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:["Est. total: ",se]})]})]}),n.jsx("div",{className:"space-y-3 stagger-children",children:y.map(Y=>{const F=E.get(Y.id),le=b.get(Y.id),W=(le==null?void 0:le.status)??"idle";return n.jsx(Cv,{name:Y.name,evalId:Y.id,result:F,caseStatus:W,runMode:(le==null?void 0:le.mode)??null,isReadOnly:h,onRun:ae=>c(ae,"benchmark"),onBaseline:ae=>c(ae,"baseline"),onCompare:ae=>c(ae,"comparison"),onCancel:ae=>d(ae)},Y.id)})}),!T&&f&&f.cases.length>0&&n.jsxs("div",{className:"mt-5",children:[n.jsxs("div",{className:"rounded-xl p-4 mb-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall Pass Rate"}),n.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&&n.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&&n.jsx("button",{onClick:()=>u("comparison"),disabled:y.length===0||h,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&&n.jsxs("div",{className:"rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"Skill vs Baseline"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Cx,{label:"Skill",value:f.comparison.skillPassRate,color:"var(--accent)"}),n.jsx(Cx,{label:"Baseline",value:f.comparison.baselinePassRate,color:"var(--text-tertiary)"})]}),n.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 Tv={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 Cv({name:i,evalId:c,result:u,caseStatus:d,runMode:m,isReadOnly:h,onRun:p,onBaseline:b,onCompare:g,onCancel:f}){const[E,y]=v.useState(!1),T=d==="running"||d==="queued",z=d==="complete"||d==="error";return n.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:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[d==="running"&&n.jsx("span",{className:"spinner",style:{width:14,height:14,borderWidth:1.5}}),d==="queued"&&n.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--text-tertiary)"},children:"queued"}),n.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:["#",c," ",i]}),m&&(T||z)&&(()=>{const B=Tv[m];return B?n.jsx("span",{className:"pill text-[9px] font-semibold",style:{background:B.bg,color:B.color,padding:"1px 6px"},children:B.label}):null})()]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T?n.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"}):n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>g(c),disabled:h,className:"btn btn-primary text-[10px] px-2 py-1",children:"Compare"}),n.jsx("button",{onClick:()=>p(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Skill"}),n.jsx("button",{onClick:()=>b(c),disabled:h,className:"btn btn-secondary text-[10px] px-2 py-1",children:"Base"})]}),u&&u.status!=null&&n.jsx("span",{className:"pill text-[10px]",style:{background:u.status==="pass"?"var(--green-muted)":(u.status==="error","var(--red-muted)"),color:u.status==="pass"?"var(--green)":"var(--red)"},children:u.passRate!=null?`${Math.round(u.passRate*100)}%`:u.status}),d==="cancelled"&&n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:"cancelled"})]})]}),u&&u.assertions.length>0&&n.jsxs("div",{className:"px-4 pb-3",children:[n.jsx("div",{className:"space-y-1",children:u.assertions.map(B=>n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsx("span",{style:{color:B.pass?"var(--green)":"var(--red)"},children:B.pass?"PASS":"FAIL"}),n.jsx("span",{style:{color:"var(--text-secondary)"},children:B.text})]},B.assertion_id))}),u.output&&n.jsx("button",{onClick:()=>y(!E),className:"text-[11px] mt-2 transition-colors duration-150",style:{color:"var(--text-tertiary)"},children:E?"Hide output":"Show output"}),E&&u.output&&n.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:u.output})]}),u&&u.errorMessage&&n.jsx(Av,{errorMessage:u.errorMessage,classifiedError:u.classifiedError})]})}const Jc={rate_limit:"⏱",context_window:"⚠",auth:"🔒",timeout:"⌛",provider_unavailable:"⚡",parse_error:"❓",unknown:"❌"};function Av({errorMessage:i,classifiedError:c}){const[u,d]=v.useState(!1),m=(c==null?void 0:c.title)??"Error",h=c==null?void 0:c.hint,p=c?Jc[c.category]??Jc.unknown:Jc.unknown;return n.jsx("div",{className:"px-4 pb-3",children:n.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--red-muted)",border:"1px solid rgba(239,68,68,0.2)"},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[n.jsx("span",{style:{fontSize:12},children:p}),n.jsx("span",{className:"text-[11.5px] font-semibold flex-1",style:{color:"var(--red)"},children:m}),n.jsx("button",{onClick:()=>d(!u),className:"text-[10px] px-1.5 py-0.5 rounded transition-colors duration-150",style:{color:"var(--text-tertiary)",background:"transparent"},children:u?"Hide details":"Details"})]}),h&&n.jsx("div",{className:"px-3 pb-2 text-[10.5px]",style:{color:"var(--text-secondary)"},children:h}),u&&n.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:i})]})})}function Cx({label:i,value:c,color:u}){return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:i}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:u},children:[Math.round(c*100),"%"]})]}),n.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c*100}%`,background:u}})})]})}const Ax={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)"}},wv=[{label:"Should activate",prompts:["+How do I use this feature?","+Show me best practices for this","+What's the recommended approach?"]},{label:"Should NOT activate",prompts:["!What's the weather today?","!Write me a poem","!How do I cook pasta?"]}];function _v(){const{state:i,dispatch:c,runActivationTest:u}=nl(),{plugin:d,skill:m,activationPrompts:h,activationResults:p,activationSummary:b,activationRunning:g,activationError:f}=i,[E,y]=v.useState(h),[T,z]=v.useState(null);v.useEffect(()=>{c({type:"SET_ACTIVATION_PROMPTS",prompts:E})},[E,c]),v.useEffect(()=>{fetch(`/api/skills/${d}/${m}/description`).then(Y=>Y.json()).then(Y=>z(Y.rawContent||Y.description||null)).catch(()=>z(null))},[d,m]);function B(){u(E)}function q(Y){const F=E.trim(),le=F?`${F}
|
|
61
61
|
${Y.join(`
|
|
62
62
|
`)}`:Y.join(`
|
|
63
|
-
`);
|
|
64
|
-
`).filter(Boolean).length,K=p.filter(Y=>Y.classification==="TP"||Y.classification==="TN"),P=p.filter(Y=>Y.classification==="FP"||Y.classification==="FN"),se=(T==null?void 0:T.replace(/^---[\s\S]*?---\s*/,"").trim())??null;return n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.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."})]}),n.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[n.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:wv.map(Y=>n.jsxs("button",{onClick:()=>q(Y.prompts),className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},onMouseEnter:F=>{F.currentTarget.style.color="var(--text-primary)",F.currentTarget.style.background="var(--surface-3)"},onMouseLeave:F=>{F.currentTarget.style.color="var(--text-tertiary)",F.currentTarget.style.background="var(--surface-2)"},children:["+ ",Y.label]},Y.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:
|
|
63
|
+
`);y(le)}const V=E.trim().split(`
|
|
64
|
+
`).filter(Boolean).length,K=p.filter(Y=>Y.classification==="TP"||Y.classification==="TN"),P=p.filter(Y=>Y.classification==="FP"||Y.classification==="FN"),se=(T==null?void 0:T.replace(/^---[\s\S]*?---\s*/,"").trim())??null;return n.jsxs("div",{className:"p-5 space-y-5",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-[14px] font-semibold",style:{color:"var(--text-primary)"},children:"Activation Test"}),n.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."})]}),n.jsxs("div",{className:"grid grid-cols-[3fr_2fr] gap-4 items-stretch",children:[n.jsxs("div",{className:"glass-card p-4 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("label",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Test Prompts"}),n.jsx("div",{className:"flex gap-1.5",children:wv.map(Y=>n.jsxs("button",{onClick:()=>q(Y.prompts),className:"text-[10px] px-2.5 py-1 rounded-md transition-colors duration-150",style:{background:"var(--surface-2)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},onMouseEnter:F=>{F.currentTarget.style.color="var(--text-primary)",F.currentTarget.style.background="var(--surface-3)"},onMouseLeave:F=>{F.currentTarget.style.color="var(--text-tertiary)",F.currentTarget.style.background="var(--surface-2)"},children:["+ ",Y.label]},Y.label))})]}),n.jsx("textarea",{className:"input-field resize-y font-mono text-[12px]",style:{minHeight:140,height:140},value:E,onChange:Y=>y(Y.target.value),placeholder:`How do I write a unit test?
|
|
65
65
|
What edge cases should I test?
|
|
66
66
|
+Deploy this to production
|
|
67
67
|
!What's the weather like today?
|
|
68
|
-
!Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx(br,{}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),n.jsx(br,{}),n.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[Q," prompt",Q!==1?"s":""]})]}),n.jsx("button",{onClick:B,disabled:g||!S.trim(),className:"btn btn-primary self-start",children:g?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})})]}),n.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[n.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),n.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:se?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Nr(se)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),f&&n.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:f}),g&&p.length===0&&n.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),p.length>0&&n.jsxs("div",{className:"space-y-5",children:[P.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),n.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",P.length,")"]}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:P.map((Y,F)=>n.jsx(wx,{result:Y},`incorrect-${F}`))})]}),K.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"16 10 11 15 8 12"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",K.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:K.map((Y,F)=>n.jsx(wx,{result:Y},`correct-${F}`))})]})]}),y&&n.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),y.autoClassifiedCount!=null&&y.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[y.autoClassifiedCount," of ",y.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx($c,{label:"Precision",value:y.precision,description:"Of all activations, how many were correct?",detail:`${y.tp} true / ${y.tp+y.fp} total activations`}),n.jsx($c,{label:"Recall",value:y.recall,description:"Of expected activations, how many fired?",detail:`${y.tp} activated / ${y.tp+y.fn} expected`}),n.jsx($c,{label:"Reliability",value:y.reliability,description:"Overall correct classification rate",detail:`${y.tp+y.tn} correct / ${y.total} total`})]}),n.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[n.jsx(jr,{label:"True Positive",abbr:"TP",count:y.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(jr,{label:"False Positive",abbr:"FP",count:y.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(jr,{label:"False Negative",abbr:"FN",count:y.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(jr,{label:"True Negative",abbr:"TN",count:y.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]})]})}function br(){return n.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function wx({result:i}){const c=Ax[i.classification]||Ax.FN,u=i.classification==="TP"||i.classification==="TN";return n.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:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.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:u?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:i.prompt})}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[n.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:c.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:i.classification}),n.jsx("span",{style:{color:i.activate?"var(--green)":"var(--text-tertiary)"},children:i.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",i.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[i.confidence," confidence"]}),i.autoClassified&&n.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"})]}),i.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:i.reasoning})]})]})}function $c({label:i,value:c,description:u,detail:d}){const m=Math.round(c*100),h=m>=80?"var(--green)":m>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:h},children:[m,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:u}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:d})]})}function jr({abbr:i,count:c,bg:u,color:d,description:m}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:u},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:d},children:c}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:d},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:m})]})}const Wc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},_x={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},no=600,so=180,xt=40,Fc=no-xt*2,aa=so-xt*2,Rv=[25,50,75,100];function Rx(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Mv({entries:i}){const[c,u]=v.useState(null);if(i.length<2)return null;const d=i.length,m=i.map((y,g)=>{const f=xt+g/(d-1)*Fc,S=y.passRate*100,b=xt+aa-S/100*aa;return{x:f,y:b,pct:S,entry:y}}),h=m.map(y=>`${y.x},${y.y}`).join(" "),p=Array.from(new Set(i.map(y=>y.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:p.map(y=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Wc[y]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:_x[y]??y})]},y))}),n.jsxs("svg",{width:no,height:so,viewBox:`0 0 ${no} ${so}`,style:{display:"block",overflow:"visible"},children:[Rv.map(y=>{const g=xt+aa-y/100*aa;return n.jsxs("g",{children:[n.jsx("line",{x1:xt,y1:g,x2:xt+Fc,y2:g,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:xt-8,y:g+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[y,"%"]})]},y)}),n.jsx("line",{x1:xt,y1:xt+aa,x2:xt+Fc,y2:xt+aa,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:xt-8,y:xt+aa+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:h,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),m.map((y,g)=>n.jsx("circle",{cx:y.x,cy:y.y,r:5,fill:Wc[y.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:f=>{f.currentTarget.setAttribute("r","7"),u({x:y.x,y:y.y,entry:y.entry})},onMouseLeave:f=>{f.currentTarget.setAttribute("r","5"),u(null)}},g)),zv(d).map(y=>n.jsx("text",{x:m[y].x,y:xt+aa+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:Rx(i[y].timestamp)},y))]}),c&&n.jsxs("div",{style:{position:"absolute",left:c.x,top:c.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:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:Rx(c.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:c.entry.model}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Wc[c.entry.type]??"var(--text-tertiary)",color:"#fff"},children:_x[c.entry.type]??c.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(c.entry.passRate*100),"%"]})]})]})]})}function zv(i){return i<=3?Array.from({length:i},(c,u)=>u):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function Sr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Ov(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function Dv({rate:i,label:c}){const u=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:c}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(i)},children:[u,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,background:Sr(i)}})})]})})}function Lv({points:i}){if(i.length<2)return null;const c=200,u=48,d=4,m=i.length,h=i.map((g,f)=>{const S=d+f/(m-1)*(c-d*2),b=d+(u-d*2)-g.passRate*(u-d*2);return{x:S,y:b}}),p=`M ${h[0].x},${u-d} `+h.map(g=>`L ${g.x},${g.y}`).join(" ")+` L ${h[h.length-1].x},${u-d} Z`,y=h.map((g,f)=>`${f===0?"M":"L"} ${g.x},${g.y}`).join(" ");return n.jsxs("svg",{width:c,height:u,style:{display:"block"},children:[n.jsx("path",{d:p,fill:"var(--accent-muted)"}),n.jsx("path",{d:y,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:h[h.length-1].x,cy:h[h.length-1].y,r:3,fill:"var(--accent)"})]})}function Bv({plugin:i,skill:c}){const[u,d]=v.useState(null),[m,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),Te.getStats(i,c).then(d).catch(()=>d(null)).finally(()=>h(!1))},[i,c]),m)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!u||u.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const p=u.trendPoints.length>0?u.trendPoints[u.trendPoints.length-1].passRate:0,y=u.trendPoints.length>0?u.trendPoints[0].passRate:0,g=p-y,f=u.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:u.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:Sr(p)},children:[Math.round(p*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:g>=0?"var(--green)":"var(--red)"},children:[g>=0?"+":"",Math.round(g*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:u.modelStats.length})]})]}),u.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(Lv,{points:u.trendPoints})]}),u.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:u.modelStats.map(S=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:S.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:S.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:Sr(S.avgPassRate)},children:[Math.round(S.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Ov(S.avgDurationMs)})]},S.model))})]})]}),f.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),n.jsx("div",{className:"space-y-3",children:f.map(S=>n.jsxs("button",{className:"block w-full text-left rounded-lg p-2 -mx-2 transition-colors duration-150",style:{background:"transparent"},onMouseEnter:b=>{b.currentTarget.style.background="var(--surface-2)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},onClick:()=>{},children:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.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:["#",S.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:S.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[S.totalRuns," runs"]})]}),n.jsx(Dv,{rate:S.passRate,label:S.text})]},`${S.evalId}:${S.id}`))})]})]})}function Uv({plugin:i,skill:c}){const[u,d]=v.useState(null),[m,h]=v.useState(null),[p,y]=v.useState({}),[g,f]=v.useState({});v.useEffect(()=>{Te.getEvals(i,c).then(d).catch(()=>d(null))},[i,c]);async function S(b){if(m===b){h(null);return}if(h(b),!p[b]){f(T=>({...T,[b]:!0}));try{const T=await Te.getCaseHistory(i,c,b);y(O=>({...O,[b]:T}))}catch{y(T=>({...T,[b]:[]}))}finally{f(T=>({...T,[b]:!1}))}}}return u?n.jsx("div",{className:"space-y-2 stagger-children",children:u.evals.map(b=>{const T=p[b.id]||[],O=m===b.id,B=g[b.id],q=T.length>0?T[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>S(b.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:O?"var(--surface-2)":"transparent"},onMouseEnter:Q=>{O||(Q.currentTarget.style.background="var(--surface-2)")},onMouseLeave:Q=>{O||(Q.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:O?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.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:["#",b.id]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:b.name}),T.length>=2&&n.jsx(Qx,{entries:T}),q!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:ao(q)},children:[Math.round(q*100),"%"]}),T.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.length," runs"]})]}),O&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:B?n.jsxs("div",{className:"p-4 flex items-center gap-2",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):T.length===0?n.jsx("div",{className:"p-4",children:n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):n.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:T.map((Q,K)=>n.jsxs("div",{className:"p-4",style:{background:K===0?"var(--surface-2)":"transparent"},children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Gx(Q.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:Q.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:Q.type==="benchmark"?"rgba(99,131,255,0.15)":Q.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:Q.type==="benchmark"?"#6383ff":Q.type==="comparison"?"var(--purple)":"#fb923c"},children:Q.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:ao(Q.pass_rate)},children:[Math.round(Q.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[Q.durationMs!=null&&n.jsx("span",{children:Vx(Q.durationMs)}),Q.tokens!=null&&n.jsxs("span",{children:[Q.tokens>=1e3?`${(Q.tokens/1e3).toFixed(1)}k`:Q.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:Q.assertions.map(P=>n.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[n.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:P.pass?"var(--green)":"var(--red)"},children:n.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:P.pass?n.jsx("polyline",{points:"20 6 9 17 4 12"}):n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:P.text}),P.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:P.reasoning})]})]},P.id))})]},K))})})]},b.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function Hv(){const{state:i,dispatch:c}=nl(),{plugin:u,skill:d}=i,[m,h]=v.useState("timeline"),[p,y]=v.useState([]),[g,f]=v.useState(!0),[S,b]=v.useState(""),[T,O]=v.useState(""),[B,q]=v.useState(!1),[Q,K]=v.useState([]),[P,se]=v.useState(null),[Y,F]=v.useState(!1),[le,W]=v.useState(null),[ae,he]=v.useState(!1);v.useEffect(()=>{f(!0),Te.getHistory(u,d,{model:S||void 0,type:T||void 0}).then(X=>{y(X),X.length>=2&&Te.compareRuns(u,d,X[0].timestamp,X[1].timestamp).then(ue=>{const Ee=ue.regressions.filter(E=>E.change==="regression");c({type:"SET_REGRESSIONS",regressions:Ee})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[u,d,S,T]);const re=v.useCallback(async X=>{if(B){K(ue=>ue.includes(X)?ue.filter(Ee=>Ee!==X):ue.length>=2?[ue[1],X]:[...ue,X]);return}he(!0);try{const ue=await Te.getHistoryEntry(u,d,X);W(ue)}catch{}finally{he(!1)}},[u,d,B]),ge=v.useCallback(async()=>{if(Q.length===2){F(!0);try{const X=await Te.compareRuns(u,d,Q[0],Q[1]);se(X)}catch{}finally{F(!1)}}},[u,d,Q]),ve=[...new Set(p.map(X=>X.model))];return g?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"skeleton h-12 rounded-lg"}),n.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(X=>n.jsx("button",{onClick:()=>h(X),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:m===X?"var(--accent-muted)":"transparent",color:m===X?"var(--accent)":"var(--text-tertiary)"},children:X==="timeline"?"Timeline":X==="per-eval"?"Per Eval":"Statistics"},X))}),m==="timeline"&&n.jsxs("div",{children:[p.length>0&&n.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:n.jsx(Mv,{entries:p})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:S,onChange:X=>b(X.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ve.map(X=>n.jsx("option",{value:X,children:X},X))]}),n.jsxs("select",{value:T,onChange:X=>O(X.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"benchmark",children:"Benchmark"}),n.jsx("option",{value:"comparison",children:"Comparison"}),n.jsx("option",{value:"baseline",children:"Baseline"}),n.jsx("option",{value:"model-compare",children:"Model Compare"}),n.jsx("option",{value:"improve",children:"AI Improve"}),n.jsx("option",{value:"instruct",children:"AI Edit"}),n.jsx("option",{value:"ai-generate",children:"AI Generate"}),n.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{q(!B),K([]),se(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&Q.length===2&&n.jsx("button",{onClick:ge,disabled:Y,className:"btn btn-primary text-[12px]",children:Y?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:p.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(X=>{const ue=Q.includes(X.timestamp);return n.jsx("button",{onClick:()=>re(X.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ue?"var(--accent-muted)":"var(--surface-1)",border:ue?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-subtle)")},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:ue?"var(--accent)":"var(--border-default)",background:ue?"var(--accent)":"transparent"},children:ue&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(X.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:X.type==="comparison"?"var(--purple-muted)":X.type==="baseline"?"var(--surface-3)":X.type==="model-compare"?"rgba(56,189,248,0.15)":X.type==="improve"||X.type==="instruct"?"rgba(168,85,247,0.15)":X.type==="ai-generate"?"rgba(34,197,94,0.15)":X.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:X.type==="comparison"?"var(--purple)":X.type==="baseline"?"var(--text-tertiary)":X.type==="model-compare"?"#38bdf8":X.type==="improve"||X.type==="instruct"?"#a855f7":X.type==="ai-generate"?"#22c55e":X.type==="eval-generate"?"#fb923c":"var(--accent)"},children:X.type==="model-compare"?"model compare":X.type==="improve"?"ai improve":X.type==="instruct"?"ai edit":X.type==="ai-generate"?"ai generate":X.type==="eval-generate"?"eval generate":X.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:X.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:X.passRate>=.8?"var(--green)":X.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(X.passRate*100),"%"]})]})]})},X.timestamp)})}),P&&n.jsx(qv,{result:P}),le&&!B&&n.jsx(Yv,{run:le,onClose:()=>W(null)})]}),m==="per-eval"&&n.jsx(Uv,{plugin:u,skill:d}),m==="statistics"&&n.jsx(Bv,{plugin:u,skill:d})]})}function qv({result:i}){const c=i.regressions.filter(d=>d.change==="regression"),u=i.regressions.filter(d=>d.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),c.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",c.length,")"]}),c.map(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:d.assertionId})," (was passing, now failing)"]},`${d.evalId}-${d.assertionId}`))]}),u.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",u.length,")"]}),u.map(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:d.assertionId})," (was failing, now passing)"]},`${d.evalId}-${d.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(d=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateA!=null?d.passRateA>=.8?"var(--green)":d.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateA!=null?`${Math.round(d.passRateA*100)}%`:d.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateB!=null?d.passRateB>=.8?"var(--green)":d.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateB!=null?`${Math.round(d.passRateB*100)}%`:d.statusB})]},d.eval_id))})]})})]})}function Yv({run:i,onClose:c}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Gv,{run:i,onClose:c}):n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(i.timestamp).toLocaleString()]}),n.jsx("button",{onClick:c,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",i.model," | Cases: ",i.cases.length," | Pass Rate: ",i.overall_pass_rate!=null?`${Math.round(i.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:i.cases.map(u=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:u.status==="pass"?"var(--green)":"var(--red)"},children:u.pass_rate!=null?`${Math.round(u.pass_rate*100)}%`:u.status})]})},u.eval_id))})]})}function Gv({run:i,onClose:c}){var h;const u=v.useMemo(()=>i.improve?Er(i.improve.original,i.improve.improved):[],[i.improve]),d=v.useMemo(()=>{const p=u.filter(g=>g.type==="added").length,y=u.filter(g=>g.type==="removed").length;return{added:p,removed:y}},[u]),m=v.useMemo(()=>{let p=0,y=0;return u.map(g=>g.type==="removed"?(p++,{...g,origNum:p,newNum:null}):g.type==="added"?(y++,{...g,origNum:null,newNum:y}):(p++,y++,{...g,origNum:p,newNum:y}))},[u]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",d.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",d.removed]})]}),n.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:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((h=i.improve)==null?void 0:h.reasoning)&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),i.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:m.map((p,y)=>n.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[n.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??""}),n.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??""}),n.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"?"-":" "}),n.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||""})]},y))})})})]})}function Vv({plugin:i,skill:c}){const[u,d]=v.useState([]),[m,h]=v.useState([]),[p,y]=v.useState(!0),[g,f]=v.useState(null);v.useEffect(()=>{Te.getDependencies(i,c).then(b=>{d(b.mcpDependencies),h(b.skillDependencies)}).catch(()=>{}).finally(()=>y(!1))},[i,c]);async function S(b,T){try{await navigator.clipboard.writeText(T),f(b),setTimeout(()=>f(null),2e3)}catch{}}return p?null:u.length===0&&m.length===0?n.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"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.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"}),n.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"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:u.length+m.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[u.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),u.map(b=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:b.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.transport})]}),n.jsx("button",{onClick:()=>S(b.server,b.configSnippet),className:"btn btn-ghost text-[11px] py-1 px-2",style:{color:g===b.server?"var(--green)":"var(--accent)"},children:g===b.server?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.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"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:b.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:b.matchedTools.map(T=>n.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))})]},b.server))]}),m.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:m.map(b=>n.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:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:b.name}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:b.source==="frontmatter"?"frontmatter":"referenced"})]},b.name))})]})]})]})}function Qv(){const{state:i}=nl(),{plugin:c,skill:u}=i,[d,m]=v.useState(null),[h,p]=v.useState(!0);return v.useEffect(()=>{Te.getDependencies(c,u).then(m).catch(()=>{}).finally(()=>p(!1))},[c,u]),h?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):d?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(Vv,{plugin:c,skill:u})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const Xv=["editor","tests","run","activation","history","deps"];function Zv(i){return i!=null&&Xv.includes(i)}function Kv(){const{state:i,dispatch:c,saveContent:u,isReadOnly:d}=nl(),{refreshSkills:m,clearSelection:h}=sa(),p=v.useCallback(async()=>{try{await Te.deleteSkill(i.plugin,i.skill),m(),h()}catch(f){const S=f instanceof Error?f.message:String(f);c({type:"SET_ERROR",error:`Failed to delete skill: ${S}`})}},[i.plugin,i.skill,m,h,c]);v.useEffect(()=>{const S=new URLSearchParams(window.location.search).get("panel");Zv(S)&&S!==i.activePanel&&c({type:"SET_PANEL",panel:S})},[]),v.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const S=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",S)},[i.activePanel]);const y=v.useCallback(f=>{const S=f.ctrlKey||f.metaKey;if(S&&f.key>="1"&&f.key<="6"){f.preventDefault(),c({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(f.key)-1]});return}if(S&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&u();return}},[i.isDirty,u,c]);if(v.useEffect(()=>(window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)),[y]),i.loading)return n.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"spinner spinner-lg"}),n.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const g=Array.from(i.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Hh,{state:i,isReadOnly:d,onDelete:d?void 0:p}),n.jsx(Qh,{activePanel:i.activePanel,onPanelChange:f=>c({type:"SET_PANEL",panel:f}),isDirty:i.isDirty,isRunning:g,hasRegressions:i.regressions.length>0,isActivationRunning:i.activationRunning}),n.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[i.activePanel==="editor"&&n.jsx(mv,{}),i.activePanel==="tests"&&n.jsx(yv,{}),i.activePanel==="run"&&n.jsx(kv,{}),i.activePanel==="activation"&&n.jsx(_v,{}),i.activePanel==="history"&&n.jsx(Hv,{}),i.activePanel==="deps"&&n.jsx(Qv,{})]},i.activePanel)})]})}function Zx(){return n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 Jv(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Kx({node:i,depth:c=0}){var u;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${c*16}px`,color:i.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[i.type==="dir"?n.jsx(Zx,{}):n.jsx(Jv,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(u=i.children)==null?void 0:u.map(d=>n.jsx(Kx,{node:d,depth:c+1},d.name))]})}function $v(i,c,u){const d=[];c&&d.push({name:"evals.json",type:"file"}),d.push({name:"history",type:"dir"});const m=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:d}];return u&&m.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:m}}function Wv({skillName:i,hasEvals:c,isDraft:u}){const d=$v(i,c,u);return n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsx(Zx,{})}),"Skill Structure"]}),n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:n.jsx(Kx,{node:d})})]})}function Ic(i,c=!0){let u=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return c&&(u=u.replace(/^-+|-+$/g,"")),u}function Fv(i,c,u,d){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(c){case 1:return`${h}/${u}/skills/${d}/SKILL.md`;case 2:return`${h}/plugins/${u}/skills/${d}/SKILL.md`;case 3:return`${h}/skills/${d}/SKILL.md`}}const na={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Pc({size:i=14,color:c="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 Iv({onCreated:i,onCancel:c}){const[u,d]=v.useState("manual"),[m,h]=v.useState(null),[p,y]=v.useState(!0),{config:g}=dn(),[f,S]=v.useState(""),[b,T]=v.useState(3),[O,B]=v.useState(""),[q,Q]=v.useState(""),[K,P]=v.useState(""),[se,Y]=v.useState(""),[F,le]=v.useState(""),[W,ae]=v.useState(""),[he,re]=v.useState(null),[ge,ve]=v.useState("write"),[X,ue]=v.useState(!1),[Ee,E]=v.useState(null),[A,J]=v.useState(""),[ce,pe]=v.useState(!1),[N,D]=v.useState(!1),[Z,R]=v.useState(null),[G,V]=v.useState(null),[ee,fe]=v.useState([]),ye=v.useRef(null),Ze=v.useRef(null),et=v.useRef(null),[$t,Al]=v.useState(!1),[Wt,sl]=v.useState([]),[rl,wl]=v.useState(!1);v.useEffect(()=>{Te.getProjectLayout().then($=>{h($),T($.suggestedLayout);const _e=$.detectedLayouts.find(Xt=>Xt.layout===$.suggestedLayout);_e!=null&&_e.existingPlugins.length&&B(_e.existingPlugins[0])}).catch(()=>{}).finally(()=>y(!1))},[]),v.useEffect(()=>{var $;u==="ai"&&(($=ye.current)==null||$.focus())},[u]),v.useEffect(()=>()=>{var $;($=Ze.current)==null||$.abort()},[]);const _l=v.useMemo(()=>{var $;return m?(($=m.detectedLayouts.find(_e=>_e.layout===b))==null?void 0:$.existingPlugins)||[]:[]},[m,b]),Ft=O==="__new__"?q:O,Vt=m?Fv(m.root,b,Ft||"{plugin}",f||"{skill}"):"",Rl=v.useMemo(()=>m?m.detectedLayouts.filter($=>$.layout!==4):[],[m]),il=v.useMemo(()=>{if(!m)return null;const $=m.detectedLayouts.find(Nt=>Nt.layout===2&&Nt.existingPlugins.length>0),_e=m.detectedLayouts.find(Nt=>Nt.layout===1&&Nt.existingPlugins.length>0),Xt=$||_e;return Xt?{layout:Xt.layout,plugins:Xt.existingPlugins}:null},[m]),I=v.useCallback(()=>{if(!g)return{provider:"claude-cli",model:"sonnet"};const $=g.provider||"claude-cli";let _e=g.model||"sonnet";return $==="claude-cli"&&_e.startsWith("claude-")&&(_e=_e.replace("claude-","")),{provider:$,model:_e}},[g]),ze=v.useCallback(()=>{var $;($=Ze.current)==null||$.abort(),pe(!1)},[]);async function mt(){var Nt;if(R(null),V(null),fe([]),et.current=null,!A.trim()){R("Describe what your skill should do");return}pe(!0);const $=new AbortController;Ze.current=$;const{provider:_e,model:Xt}=I();try{const pt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:A.trim(),provider:_e,model:Xt}),signal:$.signal});if(!pt.ok||!pt.body){let Ge=`HTTP ${pt.status}`;try{const $e=await pt.json();$e.error&&(Ge=$e.error)}catch{}throw new Error(Ge)}const It=pt.body.getReader(),Mt=new TextDecoder;let Ve="",at="";for(;;){const{done:Ge,value:$e}=await It.read();if(Ge)break;Ve+=Mt.decode($e,{stream:!0});const Et=Ve.split(`
|
|
69
|
-
`);Ve=Et.pop()||"";for(const cl of Et)if(cl.startsWith("event: "))at=cl.slice(7).trim();else if(cl.startsWith("data: ")){try{const tt=JSON.parse(cl.slice(6));if(at==="progress")fe(ol=>[...ol,{phase:tt.phase,message:tt.message,timestamp:Date.now()}]);else if(at==="done"||at==="complete"){const ol=tt.name,ra=tt.description,Pt=tt.model||"",ia=tt.allowedTools||"",Ml=tt.body,rs=(Nt=tt.evals)!=null&&Nt.length?tt.evals:null,fn={prompt:A.trim(),provider:I().provider,model:I().model,reasoning:tt.reasoning||""};
|
|
68
|
+
!Write me a poem about flowers`}),n.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1 text-[11px]",style:{color:"var(--text-tertiary)"},children:[n.jsx("span",{children:"One prompt per line"}),n.jsx(br,{}),n.jsx("span",{children:"No prefix = auto-classify"}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"+"}),"= must activate"]}),n.jsx(br,{}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("code",{className:"px-1 rounded",style:{background:"var(--surface-2)"},children:"!"}),"= must NOT activate"]}),n.jsx(br,{}),n.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[V," prompt",V!==1?"s":""]})]}),n.jsx("button",{onClick:B,disabled:g||!E.trim(),className:"btn btn-primary self-start",children:g?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"spinner",style:{borderTopColor:"#fff",borderColor:"rgba(255,255,255,0.2)",width:14,height:14}}),"Testing..."]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("circle",{cx:"12",cy:"12",r:"6"}),n.jsx("circle",{cx:"12",cy:"12",r:"2"})]}),"Run Activation Test"]})})]}),n.jsxs("div",{className:"glass-card flex flex-col overflow-hidden",children:[n.jsx("div",{className:"px-4 pt-3.5 pb-2.5 flex-shrink-0",style:{borderBottom:"1px solid var(--border-subtle)"},children:n.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest",style:{color:"var(--text-tertiary)"},children:"Skill Description"})}),n.jsx("div",{className:"flex-1 overflow-auto px-4 py-3",style:{minHeight:0},children:se?n.jsx("div",{className:"text-[12px] leading-relaxed",style:{color:"var(--text-secondary)"},dangerouslySetInnerHTML:{__html:Nr(se)}}):n.jsx("div",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No description available"})})]})]}),f&&n.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:f}),g&&p.length===0&&n.jsxs("div",{className:"text-center py-12 animate-fade-in",children:[n.jsx("div",{className:"spinner-lg mx-auto mb-4"}),n.jsx("p",{className:"text-[14px]",style:{color:"var(--text-secondary)"},children:"Testing activation against skill description..."})]}),p.length>0&&n.jsxs("div",{className:"space-y-5",children:[P.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--red)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),n.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--red)"},children:["Incorrect (",P.length,")"]}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:"— These need attention"})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:P.map((Y,F)=>n.jsx(wx,{result:Y},`incorrect-${F}`))})]}),K.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--green)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("polyline",{points:"16 10 11 15 8 12"})]}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--green)"},children:["Correct (",K.length,")"]})]}),n.jsx("div",{className:"space-y-1.5 stagger-children",children:K.map((Y,F)=>n.jsx(wx,{result:Y},`correct-${F}`))})]})]}),b&&n.jsxs("div",{className:"glass-card p-6 animate-fade-in-scale",style:{borderColor:"var(--border-active)",borderWidth:2},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-2",style:{color:"var(--text-tertiary)"},children:"Summary"}),b.autoClassifiedCount!=null&&b.autoClassifiedCount>0&&n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:[b.autoClassifiedCount," of ",b.total," prompts auto-classified from skill name and tags"]}),n.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-5",children:[n.jsx($c,{label:"Precision",value:b.precision,description:"Of all activations, how many were correct?",detail:`${b.tp} true / ${b.tp+b.fp} total activations`}),n.jsx($c,{label:"Recall",value:b.recall,description:"Of expected activations, how many fired?",detail:`${b.tp} activated / ${b.tp+b.fn} expected`}),n.jsx($c,{label:"Reliability",value:b.reliability,description:"Overall correct classification rate",detail:`${b.tp+b.tn} correct / ${b.total} total`})]}),n.jsxs("div",{className:"pt-4",style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-3 text-center",style:{color:"var(--text-tertiary)"},children:"Confusion Matrix"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-xs mx-auto",children:[n.jsx(jr,{label:"True Positive",abbr:"TP",count:b.tp,bg:"var(--green-muted)",color:"var(--green)",description:"Correctly activated"}),n.jsx(jr,{label:"False Positive",abbr:"FP",count:b.fp,bg:"var(--red-muted)",color:"var(--red)",description:"Wrongly activated"}),n.jsx(jr,{label:"False Negative",abbr:"FN",count:b.fn,bg:"rgba(248,113,113,0.06)",color:"rgba(248,113,113,0.6)",description:"Missed activation"}),n.jsx(jr,{label:"True Negative",abbr:"TN",count:b.tn,bg:"rgba(52,211,153,0.06)",color:"rgba(52,211,153,0.6)",description:"Correctly silent"})]})]})]})]})}function br(){return n.jsx("span",{style:{color:"var(--border-subtle)",userSelect:"none"},children:"·"})}function wx({result:i}){const c=Ax[i.classification]||Ax.FN,u=i.classification==="TP"||i.classification==="TN";return n.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:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.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:u?n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})}):n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:c.text,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:i.prompt})}),n.jsxs("div",{className:"flex items-center gap-3 text-[12px]",children:[n.jsx("span",{className:"pill",style:{background:"rgba(0,0,0,0.1)",color:c.text,fontWeight:700,fontSize:"10px",padding:"1px 6px"},children:i.classification}),n.jsx("span",{style:{color:i.activate?"var(--green)":"var(--text-tertiary)"},children:i.activate?"Activated":"Silent"}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:["Expected: ",i.expected==="should_activate"?"activate":"stay silent"]}),n.jsxs("span",{style:{color:"var(--text-tertiary)"},children:[i.confidence," confidence"]}),i.autoClassified&&n.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"})]}),i.reasoning&&n.jsx("div",{className:"text-[11px] mt-1.5",style:{color:"var(--text-tertiary)"},children:i.reasoning})]})]})}function $c({label:i,value:c,description:u,detail:d}){const m=Math.round(c*100),h=m>=80?"var(--green)":m>=60?"var(--yellow)":"var(--red)";return n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-[28px] font-bold tracking-tight",style:{color:h},children:[m,"%"]}),n.jsx("div",{className:"text-[12px] font-medium mt-0.5",style:{color:"var(--text-secondary)"},children:i}),n.jsx("div",{className:"text-[10px] mt-1",style:{color:"var(--text-tertiary)"},children:u}),n.jsx("div",{className:"text-[10px] mt-0.5 font-mono",style:{color:"var(--text-tertiary)"},children:d})]})}function jr({abbr:i,count:c,bg:u,color:d,description:m}){return n.jsxs("div",{className:"text-center p-3 rounded-lg",style:{background:u},children:[n.jsx("div",{className:"text-[20px] font-bold",style:{color:d},children:c}),n.jsx("div",{className:"text-[11px] font-semibold",style:{color:d},children:i}),n.jsx("div",{className:"text-[9px] mt-0.5",style:{color:"var(--text-tertiary)"},children:m})]})}const Wc={benchmark:"#6383ff",comparison:"#a78bfa",baseline:"#fb923c"},_x={benchmark:"Benchmark",comparison:"Comparison",baseline:"Baseline"},no=600,so=180,xt=40,Fc=no-xt*2,aa=so-xt*2,Rv=[25,50,75,100];function Rx(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Mv({entries:i}){const[c,u]=v.useState(null);if(i.length<2)return null;const d=i.length,m=i.map((b,g)=>{const f=xt+g/(d-1)*Fc,E=b.passRate*100,y=xt+aa-E/100*aa;return{x:f,y,pct:E,entry:b}}),h=m.map(b=>`${b.x},${b.y}`).join(" "),p=Array.from(new Set(i.map(b=>b.type)));return n.jsxs("div",{className:"glass-card p-5 animate-fade-in",style:{position:"relative"},children:[n.jsx("div",{className:"text-[13px] font-semibold mb-2",style:{color:"var(--text-primary)"},children:"Pass Rate Trend"}),n.jsx("div",{className:"flex items-center gap-5 mb-3",children:p.map(b=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:Wc[b]??"var(--text-tertiary)"}}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-secondary)"},children:_x[b]??b})]},b))}),n.jsxs("svg",{width:no,height:so,viewBox:`0 0 ${no} ${so}`,style:{display:"block",overflow:"visible"},children:[Rv.map(b=>{const g=xt+aa-b/100*aa;return n.jsxs("g",{children:[n.jsx("line",{x1:xt,y1:g,x2:xt+Fc,y2:g,stroke:"var(--border-subtle)",strokeWidth:.5,strokeDasharray:"4 4"}),n.jsxs("text",{x:xt-8,y:g+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:[b,"%"]})]},b)}),n.jsx("line",{x1:xt,y1:xt+aa,x2:xt+Fc,y2:xt+aa,stroke:"var(--border-subtle)",strokeWidth:1}),n.jsx("text",{x:xt-8,y:xt+aa+3.5,textAnchor:"end",style:{fill:"var(--text-tertiary)",fontSize:10},children:"0%"}),n.jsx("polyline",{points:h,fill:"none",stroke:"var(--border-subtle)",strokeWidth:1.5,strokeLinejoin:"round"}),m.map((b,g)=>n.jsx("circle",{cx:b.x,cy:b.y,r:5,fill:Wc[b.entry.type]??"var(--text-tertiary)",stroke:"var(--surface-2)",strokeWidth:2,style:{cursor:"pointer",transition:"r 0.15s ease"},onMouseEnter:f=>{f.currentTarget.setAttribute("r","7"),u({x:b.x,y:b.y,entry:b.entry})},onMouseLeave:f=>{f.currentTarget.setAttribute("r","5"),u(null)}},g)),zv(d).map(b=>n.jsx("text",{x:m[b].x,y:xt+aa+16,textAnchor:"middle",style:{fill:"var(--text-tertiary)",fontSize:10},children:Rx(i[b].timestamp)},b))]}),c&&n.jsxs("div",{style:{position:"absolute",left:c.x,top:c.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:[n.jsx("div",{className:"text-[11px] font-medium",style:{color:"var(--text-primary)"},children:Rx(c.entry.timestamp)}),n.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-tertiary)"},children:c.entry.model}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded-full",style:{background:Wc[c.entry.type]??"var(--text-tertiary)",color:"#fff"},children:_x[c.entry.type]??c.entry.type}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:"var(--text-primary)"},children:[Math.round(c.entry.passRate*100),"%"]})]})]})]})}function zv(i){return i<=3?Array.from({length:i},(c,u)=>u):i<=6?[0,Math.floor(i/2),i-1]:[0,Math.floor(i/3),Math.floor(2*i/3),i-1]}function Sr(i){return i>=.8?"var(--green)":i>=.5?"var(--yellow)":"var(--red)"}function Ov(i){return i>=1e3?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`}function Dv({rate:i,label:c}){const u=Math.round(i*100);return n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-primary)",maxWidth:"70%"},children:c}),n.jsxs("span",{className:"text-[11px] font-semibold",style:{color:Sr(i)},children:[u,"%"]})]}),n.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:"var(--surface-3)"},children:n.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,background:Sr(i)}})})]})})}function Lv({points:i}){if(i.length<2)return null;const c=200,u=48,d=4,m=i.length,h=i.map((g,f)=>{const E=d+f/(m-1)*(c-d*2),y=d+(u-d*2)-g.passRate*(u-d*2);return{x:E,y}}),p=`M ${h[0].x},${u-d} `+h.map(g=>`L ${g.x},${g.y}`).join(" ")+` L ${h[h.length-1].x},${u-d} Z`,b=h.map((g,f)=>`${f===0?"M":"L"} ${g.x},${g.y}`).join(" ");return n.jsxs("svg",{width:c,height:u,style:{display:"block"},children:[n.jsx("path",{d:p,fill:"var(--accent-muted)"}),n.jsx("path",{d:b,fill:"none",stroke:"var(--accent)",strokeWidth:1.5,strokeLinejoin:"round"}),n.jsx("circle",{cx:h[h.length-1].x,cy:h[h.length-1].y,r:3,fill:"var(--accent)"})]})}function Bv({plugin:i,skill:c}){const[u,d]=v.useState(null),[m,h]=v.useState(!0);if(v.useEffect(()=>{h(!0),Te.getStats(i,c).then(d).catch(()=>d(null)).finally(()=>h(!1))},[i,c]),m)return n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"skeleton h-24 rounded-xl"}),n.jsx("div",{className:"skeleton h-48 rounded-xl"}),n.jsx("div",{className:"skeleton h-36 rounded-xl"})]});if(!u||u.totalRuns===0)return n.jsxs("div",{className:"text-center py-12",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center mx-auto mb-3",style:{background:"var(--surface-2)"},children:n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"1.5",children:[n.jsx("path",{d:"M18 20V10"}),n.jsx("path",{d:"M12 20V4"}),n.jsx("path",{d:"M6 20v-6"})]})}),n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark data yet"}),n.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"Run some benchmarks to see statistics"})]});const p=u.trendPoints.length>0?u.trendPoints[u.trendPoints.length-1].passRate:0,b=u.trendPoints.length>0?u.trendPoints[0].passRate:0,g=p-b,f=u.assertionStats.slice(0,10);return n.jsxs("div",{className:"space-y-4 stagger-children",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Total Runs"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:u.totalRuns})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Latest Pass Rate"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:Sr(p)},children:[Math.round(p*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Trend"}),n.jsxs("div",{className:"text-[24px] font-bold",style:{color:g>=0?"var(--green)":"var(--red)"},children:[g>=0?"+":"",Math.round(g*100),"%"]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-widest font-semibold mb-1",style:{color:"var(--text-tertiary)"},children:"Models Tested"}),n.jsx("div",{className:"text-[24px] font-bold",style:{color:"var(--text-primary)"},children:u.modelStats.length})]})]}),u.trendPoints.length>=2&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Pass Rate Over Time"}),n.jsx(Lv,{points:u.trendPoints})]}),u.modelStats.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Model Performance"}),n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("th",{style:{textAlign:"left",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Model"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Runs"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Pass Rate"}),n.jsx("th",{style:{textAlign:"center",padding:"6px 8px",color:"var(--text-tertiary)",fontWeight:600,fontSize:11},children:"Avg Duration"})]})}),n.jsx("tbody",{children:u.modelStats.map(E=>n.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[n.jsx("td",{style:{padding:"8px",color:"var(--text-primary)",fontWeight:500},children:E.model}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:E.runs}),n.jsx("td",{style:{padding:"8px",textAlign:"center"},children:n.jsxs("span",{className:"font-semibold",style:{color:Sr(E.avgPassRate)},children:[Math.round(E.avgPassRate*100),"%"]})}),n.jsx("td",{style:{padding:"8px",textAlign:"center",fontFamily:"var(--font-mono, monospace)",color:"var(--text-secondary)"},children:Ov(E.avgDurationMs)})]},E.model))})]})]}),f.length>0&&n.jsxs("div",{className:"glass-card p-5",children:[n.jsx("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Weakest Assertions"}),n.jsx("div",{className:"space-y-3",children:f.map(E=>n.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:[n.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[n.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:["#",E.evalId]}),n.jsx("span",{className:"text-[10px] truncate",style:{color:"var(--text-tertiary)"},children:E.evalName}),n.jsxs("span",{className:"text-[10px] ml-auto flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[E.totalRuns," runs"]})]}),n.jsx(Dv,{rate:E.passRate,label:E.text})]},`${E.evalId}:${E.id}`))})]})]})}function Uv({plugin:i,skill:c}){const[u,d]=v.useState(null),[m,h]=v.useState(null),[p,b]=v.useState({}),[g,f]=v.useState({});v.useEffect(()=>{Te.getEvals(i,c).then(d).catch(()=>d(null))},[i,c]);async function E(y){if(m===y){h(null);return}if(h(y),!p[y]){f(T=>({...T,[y]:!0}));try{const T=await Te.getCaseHistory(i,c,y);b(z=>({...z,[y]:T}))}catch{b(T=>({...T,[y]:[]}))}finally{f(T=>({...T,[y]:!1}))}}}return u?n.jsx("div",{className:"space-y-2 stagger-children",children:u.evals.map(y=>{const T=p[y.id]||[],z=m===y.id,B=g[y.id],q=T.length>0?T[0].pass_rate:null;return n.jsxs("div",{className:"glass-card overflow-hidden",children:[n.jsxs("button",{onClick:()=>E(y.id),className:"w-full text-left p-4 flex items-center gap-3 transition-colors duration-150",style:{background:z?"var(--surface-2)":"transparent"},onMouseEnter:V=>{z||(V.currentTarget.style.background="var(--surface-2)")},onMouseLeave:V=>{z||(V.currentTarget.style.background="transparent")},children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2.5",strokeLinecap:"round",style:{transform:z?"rotate(90deg)":"rotate(0)",transition:"transform 0.2s ease",flexShrink:0},children:n.jsx("polyline",{points:"9 18 15 12 9 6"})}),n.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]}),n.jsx("span",{className:"text-[13px] font-medium flex-1 truncate",style:{color:"var(--text-primary)"},children:y.name}),T.length>=2&&n.jsx(Qx,{entries:T}),q!=null&&n.jsxs("span",{className:"text-[12px] font-semibold flex-shrink-0",style:{color:ao(q)},children:[Math.round(q*100),"%"]}),T.length>0&&n.jsxs("span",{className:"text-[10px] flex-shrink-0",style:{color:"var(--text-tertiary)",fontFamily:"var(--font-mono, monospace)"},children:[T.length," runs"]})]}),z&&n.jsx("div",{className:"border-t animate-fade-in",style:{borderColor:"var(--border-subtle)"},children:B?n.jsxs("div",{className:"p-4 flex items-center gap-2",children:[n.jsx("div",{className:"spinner",style:{width:14,height:14}}),n.jsx("span",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Loading history..."})]}):T.length===0?n.jsx("div",{className:"p-4",children:n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"No history for this eval case"})}):n.jsx("div",{className:"divide-y",style:{borderColor:"var(--border-subtle)"},children:T.map((V,K)=>n.jsxs("div",{className:"p-4",style:{background:K===0?"var(--surface-2)":"transparent"},children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:Gx(V.timestamp)}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:V.model}),n.jsx("span",{className:"pill",style:{fontSize:9,padding:"1px 6px",background:V.type==="benchmark"?"rgba(99,131,255,0.15)":V.type==="comparison"?"var(--purple-muted)":"rgba(251,146,60,0.15)",color:V.type==="benchmark"?"#6383ff":V.type==="comparison"?"var(--purple)":"#fb923c"},children:V.type}),n.jsxs("span",{className:"text-[12px] font-semibold ml-auto",style:{color:ao(V.pass_rate)},children:[Math.round(V.pass_rate*100),"%"]})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-2 text-[10px]",style:{fontFamily:"var(--font-mono, monospace)",color:"var(--text-tertiary)"},children:[V.durationMs!=null&&n.jsx("span",{children:Vx(V.durationMs)}),V.tokens!=null&&n.jsxs("span",{children:[V.tokens>=1e3?`${(V.tokens/1e3).toFixed(1)}k`:V.tokens," tok"]})]}),n.jsx("div",{className:"space-y-1",children:V.assertions.map(P=>n.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[n.jsx("div",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",style:{background:P.pass?"var(--green)":"var(--red)"},children:n.jsx("svg",{width:"7",height:"7",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",children:P.pass?n.jsx("polyline",{points:"20 6 9 17 4 12"}):n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-[11px]",style:{color:"var(--text-primary)"},children:P.text}),P.reasoning&&n.jsx("div",{className:"text-[10px] mt-0.5",style:{color:"var(--text-tertiary)"},children:P.reasoning})]})]},P.id))})]},K))})})]},y.id)})}):n.jsx("div",{className:"text-center py-12",children:n.jsx("p",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"No eval cases found"})})}function Hv(){const{state:i,dispatch:c}=nl(),{plugin:u,skill:d}=i,[m,h]=v.useState("timeline"),[p,b]=v.useState([]),[g,f]=v.useState(!0),[E,y]=v.useState(""),[T,z]=v.useState(""),[B,q]=v.useState(!1),[V,K]=v.useState([]),[P,se]=v.useState(null),[Y,F]=v.useState(!1),[le,W]=v.useState(null),[ae,he]=v.useState(!1);v.useEffect(()=>{f(!0),Te.getHistory(u,d,{model:E||void 0,type:T||void 0}).then(X=>{b(X),X.length>=2&&Te.compareRuns(u,d,X[0].timestamp,X[1].timestamp).then(ue=>{const Ee=ue.regressions.filter(N=>N.change==="regression");c({type:"SET_REGRESSIONS",regressions:Ee})}).catch(()=>{})}).catch(()=>{}).finally(()=>f(!1))},[u,d,E,T]);const re=v.useCallback(async X=>{if(B){K(ue=>ue.includes(X)?ue.filter(Ee=>Ee!==X):ue.length>=2?[ue[1],X]:[...ue,X]);return}he(!0);try{const ue=await Te.getHistoryEntry(u,d,X);W(ue)}catch{}finally{he(!1)}},[u,d,B]),ge=v.useCallback(async()=>{if(V.length===2){F(!0);try{const X=await Te.compareRuns(u,d,V[0],V[1]);se(X)}catch{}finally{F(!1)}}},[u,d,V]),ve=[...new Set(p.map(X=>X.model))];return g?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-48 rounded-xl mb-4"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"skeleton h-12 rounded-lg"}),n.jsx("div",{className:"skeleton h-12 rounded-lg"})]})]}):n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"flex items-center gap-1 mb-4",children:["timeline","per-eval","statistics"].map(X=>n.jsx("button",{onClick:()=>h(X),className:"px-4 py-2 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:m===X?"var(--accent-muted)":"transparent",color:m===X?"var(--accent)":"var(--text-tertiary)"},children:X==="timeline"?"Timeline":X==="per-eval"?"Per Eval":"Statistics"},X))}),m==="timeline"&&n.jsxs("div",{children:[p.length>0&&n.jsx("div",{className:"mb-5 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:n.jsx(Mv,{entries:p})}),n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsxs("select",{value:E,onChange:X=>y(X.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Models"}),ve.map(X=>n.jsx("option",{value:X,children:X},X))]}),n.jsxs("select",{value:T,onChange:X=>z(X.target.value),className:"input-field text-[12px]",style:{width:150},children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"benchmark",children:"Benchmark"}),n.jsx("option",{value:"comparison",children:"Comparison"}),n.jsx("option",{value:"baseline",children:"Baseline"}),n.jsx("option",{value:"model-compare",children:"Model Compare"}),n.jsx("option",{value:"improve",children:"AI Improve"}),n.jsx("option",{value:"instruct",children:"AI Edit"}),n.jsx("option",{value:"ai-generate",children:"AI Generate"}),n.jsx("option",{value:"eval-generate",children:"Eval Generate"})]}),n.jsx("div",{className:"flex-1"}),n.jsx("button",{onClick:()=>{q(!B),K([]),se(null)},className:`btn text-[12px] ${B?"btn-primary":"btn-secondary"}`,children:B?"Exit Compare":"Compare Runs"}),B&&V.length===2&&n.jsx("button",{onClick:ge,disabled:Y,className:"btn btn-primary text-[12px]",children:Y?"Comparing...":"Compare"})]}),n.jsx("div",{className:"space-y-2",children:p.length===0?n.jsx("div",{className:"text-center py-8 text-[13px]",style:{color:"var(--text-tertiary)"},children:"No benchmark runs yet"}):p.map(X=>{const ue=V.includes(X.timestamp);return n.jsx("button",{onClick:()=>re(X.timestamp),className:"w-full text-left rounded-lg px-4 py-3 transition-all duration-150",style:{background:ue?"var(--accent-muted)":"var(--surface-1)",border:ue?"1px solid var(--accent)":"1px solid var(--border-subtle)"},onMouseEnter:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-hover)")},onMouseLeave:Ee=>{ue||(Ee.currentTarget.style.borderColor="var(--border-subtle)")},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[B&&n.jsx("span",{className:"w-4 h-4 rounded border flex items-center justify-center",style:{borderColor:ue?"var(--accent)":"var(--border-default)",background:ue?"var(--accent)":"transparent"},children:ue&&n.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:new Date(X.timestamp).toLocaleString()}),n.jsx("span",{className:"pill text-[9px]",style:{background:X.type==="comparison"?"var(--purple-muted)":X.type==="baseline"?"var(--surface-3)":X.type==="model-compare"?"rgba(56,189,248,0.15)":X.type==="improve"||X.type==="instruct"?"rgba(168,85,247,0.15)":X.type==="ai-generate"?"rgba(34,197,94,0.15)":X.type==="eval-generate"?"rgba(251,146,60,0.15)":"var(--accent-muted)",color:X.type==="comparison"?"var(--purple)":X.type==="baseline"?"var(--text-tertiary)":X.type==="model-compare"?"#38bdf8":X.type==="improve"||X.type==="instruct"?"#a855f7":X.type==="ai-generate"?"#22c55e":X.type==="eval-generate"?"#fb923c":"var(--accent)"},children:X.type==="model-compare"?"model compare":X.type==="improve"?"ai improve":X.type==="instruct"?"ai edit":X.type==="ai-generate"?"ai generate":X.type==="eval-generate"?"eval generate":X.type})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:X.model}),n.jsxs("span",{className:"text-[12px] font-semibold",style:{color:X.passRate>=.8?"var(--green)":X.passRate>=.5?"var(--yellow)":"var(--red)"},children:[Math.round(X.passRate*100),"%"]})]})]})},X.timestamp)})}),P&&n.jsx(qv,{result:P}),le&&!B&&n.jsx(Yv,{run:le,onClose:()=>W(null)})]}),m==="per-eval"&&n.jsx(Uv,{plugin:u,skill:d}),m==="statistics"&&n.jsx(Bv,{plugin:u,skill:d})]})}function qv({result:i}){const c=i.regressions.filter(d=>d.change==="regression"),u=i.regressions.filter(d=>d.change==="improvement");return n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Comparison: ",new Date(i.runA.timestamp).toLocaleDateString()," vs ",new Date(i.runB.timestamp).toLocaleDateString()]}),c.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--red)"},children:["Regressions (",c.length,")"]}),c.map(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--red)"},children:d.assertionId})," (was passing, now failing)"]},`${d.evalId}-${d.assertionId}`))]}),u.length>0&&n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--green)"},children:["Improvements (",u.length,")"]}),u.map(d=>n.jsxs("div",{className:"text-[12px] py-1",style:{color:"var(--text-secondary)"},children:["#",d.evalId," ",d.evalName,": ",n.jsx("span",{style:{color:"var(--green)"},children:d.assertionId})," (was failing, now passing)"]},`${d.evalId}-${d.assertionId}`))]}),n.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider mb-2 mt-3",style:{color:"var(--text-tertiary)"},children:"Case Diffs"}),n.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)"},children:n.jsxs("table",{className:"w-full text-[12px]",children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:"var(--surface-2)"},children:[n.jsx("th",{className:"text-left px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Case"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run A"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",style:{color:"var(--text-tertiary)"},children:"Run B"})]})}),n.jsx("tbody",{children:i.caseDiffs.map(d=>n.jsxs("tr",{style:{borderTop:"1px solid var(--border-subtle)"},children:[n.jsxs("td",{className:"px-3 py-2",style:{color:"var(--text-secondary)"},children:["#",d.eval_id," ",d.eval_name]}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateA!=null?d.passRateA>=.8?"var(--green)":d.passRateA>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateA!=null?`${Math.round(d.passRateA*100)}%`:d.statusA}),n.jsx("td",{className:"text-right px-3 py-2",style:{color:d.passRateB!=null?d.passRateB>=.8?"var(--green)":d.passRateB>=.5?"var(--yellow)":"var(--red)":"var(--text-tertiary)"},children:d.passRateB!=null?`${Math.round(d.passRateB*100)}%`:d.statusB})]},d.eval_id))})]})})]})}function Yv({run:i,onClose:c}){return(i.type==="improve"||i.type==="instruct")&&i.improve?n.jsx(Gv,{run:i,onClose:c}):n.jsxs("div",{className:"mt-4 rounded-xl p-4",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:["Run: ",new Date(i.timestamp).toLocaleString()]}),n.jsx("button",{onClick:c,className:"btn btn-ghost text-[11px]",children:"Close"})]}),n.jsxs("div",{className:"text-[11px] mb-3",style:{color:"var(--text-tertiary)"},children:["Model: ",i.model," | Cases: ",i.cases.length," | Pass Rate: ",i.overall_pass_rate!=null?`${Math.round(i.overall_pass_rate*100)}%`:"--"]}),n.jsx("div",{className:"space-y-2",children:i.cases.map(u=>n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-2)"},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[12px]",style:{color:"var(--text-secondary)"},children:["#",u.eval_id," ",u.eval_name]}),n.jsx("span",{className:"text-[11px] font-semibold",style:{color:u.status==="pass"?"var(--green)":"var(--red)"},children:u.pass_rate!=null?`${Math.round(u.pass_rate*100)}%`:u.status})]})},u.eval_id))})]})}function Gv({run:i,onClose:c}){var h;const u=v.useMemo(()=>i.improve?Er(i.improve.original,i.improve.improved):[],[i.improve]),d=v.useMemo(()=>{const p=u.filter(g=>g.type==="added").length,b=u.filter(g=>g.type==="removed").length;return{added:p,removed:b}},[u]),m=v.useMemo(()=>{let p=0,b=0;return u.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}))},[u]);return n.jsxs("div",{className:"mt-4 rounded-xl overflow-hidden animate-fade-in",style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)"},children:[n.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:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#a855f7",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md Changes"}),n.jsxs("div",{className:"text-[10px]",style:{color:"var(--text-tertiary)"},children:[new Date(i.timestamp).toLocaleString()," · ",i.model]})]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[n.jsxs("span",{style:{color:"var(--green)"},children:["+",d.added]}),n.jsxs("span",{style:{color:"var(--red)"},children:["-",d.removed]})]}),n.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:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),((h=i.improve)==null?void 0:h.reasoning)&&n.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:[n.jsx("span",{className:"font-semibold",style:{color:"#a855f7"},children:"AI Reasoning: "}),i.improve.reasoning]}),n.jsx("div",{className:"mx-4 my-4 rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",maxHeight:480,overflowY:"auto"},children:n.jsx("table",{className:"w-full",style:{borderCollapse:"collapse",fontFamily:"var(--font-mono, monospace)"},children:n.jsx("tbody",{children:m.map((p,b)=>n.jsxs("tr",{style:{background:p.type==="added"?"rgba(34,197,94,0.08)":p.type==="removed"?"rgba(239,68,68,0.08)":"transparent"},children:[n.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??""}),n.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??""}),n.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"?"-":" "}),n.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 Vv({plugin:i,skill:c}){const[u,d]=v.useState([]),[m,h]=v.useState([]),[p,b]=v.useState(!0),[g,f]=v.useState(null);v.useEffect(()=>{Te.getDependencies(i,c).then(y=>{d(y.mcpDependencies),h(y.skillDependencies)}).catch(()=>{}).finally(()=>b(!1))},[i,c]);async function E(y,T){try{await navigator.clipboard.writeText(T),f(y),setTimeout(()=>f(null),2e3)}catch{}}return p?null:u.length===0&&m.length===0?n.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"}):n.jsxs("div",{className:"mb-5 rounded-xl overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[n.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:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"rgba(234,179,8,0.15)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#eab308",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.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"}),n.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"})]})}),n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"Dependencies"}),n.jsx("span",{className:"pill text-[10px]",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:u.length+m.length})]}),n.jsxs("div",{className:"px-5 py-4",children:[u.length>0&&n.jsxs("div",{className:"space-y-3 mb-4",children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-tertiary)"},children:"MCP Servers"}),u.map(y=>n.jsxs("div",{className:"p-3 rounded-lg",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--text-primary)"},children:y.server}),n.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded",style:{background:"var(--surface-3)",color:"var(--text-tertiary)"},children:y.transport})]}),n.jsx("button",{onClick:()=>E(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?n.jsxs(n.Fragment,{children:[n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})," Copied!"]}):n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.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"]})})]}),n.jsx("div",{className:"text-[11px] mb-2 font-mono",style:{color:"var(--text-tertiary)"},children:y.url}),n.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.matchedTools.map(T=>n.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))]}),m.length>0&&n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--text-tertiary)"},children:"Skill Dependencies"}),n.jsx("div",{className:"space-y-1.5",children:m.map(y=>n.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:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-tertiary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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"})}),n.jsx("span",{className:"text-[12px] font-medium",style:{color:"var(--text-primary)"},children:y.name}),n.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 Qv(){const{state:i}=nl(),{plugin:c,skill:u}=i,[d,m]=v.useState(null),[h,p]=v.useState(!0);return v.useEffect(()=>{Te.getDependencies(c,u).then(m).catch(()=>{}).finally(()=>p(!1))},[c,u]),h?n.jsxs("div",{className:"p-5",children:[n.jsx("div",{className:"skeleton h-5 w-32 mb-4"}),n.jsx("div",{className:"skeleton h-32 rounded-xl"})]}):d?n.jsx("div",{className:"p-5 max-w-3xl",children:n.jsx(Vv,{plugin:c,skill:u})}):n.jsx("div",{className:"flex items-center justify-center h-full text-[13px]",style:{color:"var(--text-tertiary)"},children:"No dependency information available"})}const Xv=["editor","tests","run","activation","history","deps"];function Zv(i){return i!=null&&Xv.includes(i)}function Kv(){const{state:i,dispatch:c,saveContent:u,isReadOnly:d}=nl(),{refreshSkills:m,clearSelection:h}=sa(),p=v.useCallback(async()=>{try{await Te.deleteSkill(i.plugin,i.skill),m(),h()}catch(f){const E=f instanceof Error?f.message:String(f);c({type:"SET_ERROR",error:`Failed to delete skill: ${E}`})}},[i.plugin,i.skill,m,h,c]);v.useEffect(()=>{const E=new URLSearchParams(window.location.search).get("panel");Zv(E)&&E!==i.activePanel&&c({type:"SET_PANEL",panel:E})},[]),v.useEffect(()=>{const f=new URLSearchParams(window.location.search);f.set("panel",i.activePanel);const E=`${window.location.pathname}?${f.toString()}${window.location.hash}`;history.replaceState(null,"",E)},[i.activePanel]);const b=v.useCallback(f=>{const E=f.ctrlKey||f.metaKey;if(E&&f.key>="1"&&f.key<="6"){f.preventDefault(),c({type:"SET_PANEL",panel:["editor","tests","run","activation","history","deps"][parseInt(f.key)-1]});return}if(E&&f.key==="s"&&!f.shiftKey){f.preventDefault(),i.isDirty&&u();return}},[i.isDirty,u,c]);if(v.useEffect(()=>(window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)),[b]),i.loading)return n.jsx("div",{className:"flex items-center justify-center h-full",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"spinner spinner-lg"}),n.jsx("span",{className:"text-[13px]",style:{color:"var(--text-tertiary)"},children:"Loading workspace..."})]})});const g=Array.from(i.caseRunStates.values()).some(f=>f.status==="running"||f.status==="queued");return n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[n.jsx(Hh,{state:i,isReadOnly:d,onDelete:d?void 0:p}),n.jsx(Qh,{activePanel:i.activePanel,onPanelChange:f=>c({type:"SET_PANEL",panel:f}),isDirty:i.isDirty,isRunning:g,hasRegressions:i.regressions.length>0,isActivationRunning:i.activationRunning}),n.jsx("div",{className:"flex-1 overflow-hidden",style:{background:"var(--surface-0)"},children:n.jsxs("div",{className:"animate-fade-in",style:{height:"100%",overflow:"auto"},children:[i.activePanel==="editor"&&n.jsx(mv,{}),i.activePanel==="tests"&&n.jsx(yv,{}),i.activePanel==="run"&&n.jsx(kv,{}),i.activePanel==="activation"&&n.jsx(_v,{}),i.activePanel==="history"&&n.jsx(Hv,{}),i.activePanel==="deps"&&n.jsx(Qv,{})]},i.activePanel)})]})}function Zx(){return n.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 Jv(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Kx({node:i,depth:c=0}){var u;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",style:{paddingLeft:`${c*16}px`,color:i.type==="dir"?"var(--text-secondary)":"var(--text-tertiary)",fontSize:12,fontFamily:"var(--font-mono, monospace)"},children:[i.type==="dir"?n.jsx(Zx,{}):n.jsx(Jv,{}),n.jsxs("span",{children:[i.name,i.type==="dir"?"/":""]})]}),(u=i.children)==null?void 0:u.map(d=>n.jsx(Kx,{node:d,depth:c+1},d.name))]})}function $v(i,c,u){const d=[];c&&d.push({name:"evals.json",type:"file"}),d.push({name:"history",type:"dir"});const m=[{name:"SKILL.md",type:"file"},{name:"evals",type:"dir",children:d}];return u&&m.push({name:"draft.json",type:"file"}),{name:i||"{skill}",type:"dir",children:m}}function Wv({skillName:i,hasEvals:c,isDraft:u}){const d=$v(i,c,u);return n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsx(Zx,{})}),"Skill Structure"]}),n.jsx("div",{className:"rounded-lg px-3 py-2",style:{background:"var(--surface-0)",border:"1px solid var(--border-subtle)"},children:n.jsx(Kx,{node:d})})]})}function Ic(i,c=!0){let u=i.toLowerCase().replace(/[^a-z0-9]+/g,"-");return c&&(u=u.replace(/^-+|-+$/g,"")),u}function Fv(i,c,u,d){const h=`.../${i.split("/").slice(-2).join("/")}`;switch(c){case 1:return`${h}/${u}/skills/${d}/SKILL.md`;case 2:return`${h}/plugins/${u}/skills/${d}/SKILL.md`;case 3:return`${h}/skills/${d}/SKILL.md`}}const na={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Pc({size:i=14,color:c="currentColor"}){return n.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.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 Iv({onCreated:i,onCancel:c}){const[u,d]=v.useState("manual"),[m,h]=v.useState(null),[p,b]=v.useState(!0),{config:g}=dn(),[f,E]=v.useState(""),[y,T]=v.useState(3),[z,B]=v.useState(""),[q,V]=v.useState(""),[K,P]=v.useState(""),[se,Y]=v.useState(""),[F,le]=v.useState(""),[W,ae]=v.useState(""),[he,re]=v.useState(null),[ge,ve]=v.useState("write"),[X,ue]=v.useState(!1),[Ee,N]=v.useState(null),[A,J]=v.useState(""),[ce,pe]=v.useState(!1),[S,D]=v.useState(!1),[Z,R]=v.useState(null),[G,Q]=v.useState(null),[ee,fe]=v.useState([]),ye=v.useRef(null),Ze=v.useRef(null),et=v.useRef(null),[$t,Al]=v.useState(!1),[Wt,sl]=v.useState([]),[rl,wl]=v.useState(!1);v.useEffect(()=>{Te.getProjectLayout().then($=>{h($),T($.suggestedLayout);const _e=$.detectedLayouts.find(Xt=>Xt.layout===$.suggestedLayout);_e!=null&&_e.existingPlugins.length&&B(_e.existingPlugins[0])}).catch(()=>{}).finally(()=>b(!1))},[]),v.useEffect(()=>{var $;u==="ai"&&(($=ye.current)==null||$.focus())},[u]),v.useEffect(()=>()=>{var $;($=Ze.current)==null||$.abort()},[]);const _l=v.useMemo(()=>{var $;return m?(($=m.detectedLayouts.find(_e=>_e.layout===y))==null?void 0:$.existingPlugins)||[]:[]},[m,y]),Ft=z==="__new__"?q:z,Vt=m?Fv(m.root,y,Ft||"{plugin}",f||"{skill}"):"",Rl=v.useMemo(()=>m?m.detectedLayouts.filter($=>$.layout!==4):[],[m]),il=v.useMemo(()=>{if(!m)return null;const $=m.detectedLayouts.find(Nt=>Nt.layout===2&&Nt.existingPlugins.length>0),_e=m.detectedLayouts.find(Nt=>Nt.layout===1&&Nt.existingPlugins.length>0),Xt=$||_e;return Xt?{layout:Xt.layout,plugins:Xt.existingPlugins}:null},[m]),I=v.useCallback(()=>{if(!g)return{provider:"claude-cli",model:"sonnet"};const $=g.provider||"claude-cli";let _e=g.model||"sonnet";return $==="claude-cli"&&_e.startsWith("claude-")&&(_e=_e.replace("claude-","")),{provider:$,model:_e}},[g]),ze=v.useCallback(()=>{var $;($=Ze.current)==null||$.abort(),pe(!1)},[]);async function mt(){var Nt;if(R(null),Q(null),fe([]),et.current=null,!A.trim()){R("Describe what your skill should do");return}pe(!0);const $=new AbortController;Ze.current=$;const{provider:_e,model:Xt}=I();try{const pt=await fetch("/api/skills/generate?sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:A.trim(),provider:_e,model:Xt}),signal:$.signal});if(!pt.ok||!pt.body){let Ge=`HTTP ${pt.status}`;try{const $e=await pt.json();$e.error&&(Ge=$e.error)}catch{}throw new Error(Ge)}const It=pt.body.getReader(),Mt=new TextDecoder;let Ve="",at="";for(;;){const{done:Ge,value:$e}=await It.read();if(Ge)break;Ve+=Mt.decode($e,{stream:!0});const Et=Ve.split(`
|
|
69
|
+
`);Ve=Et.pop()||"";for(const cl of Et)if(cl.startsWith("event: "))at=cl.slice(7).trim();else if(cl.startsWith("data: ")){try{const tt=JSON.parse(cl.slice(6));if(at==="progress")fe(ol=>[...ol,{phase:tt.phase,message:tt.message,timestamp:Date.now()}]);else if(at==="done"||at==="complete"){const ol=tt.name,ra=tt.description,Pt=tt.model||"",ia=tt.allowedTools||"",Ml=tt.body,rs=(Nt=tt.evals)!=null&&Nt.length?tt.evals:null,fn={prompt:A.trim(),provider:I().provider,model:I().model,reasoning:tt.reasoning||""};E(ol),P(ra),Y(Pt),le(ia),ae(Ml),re(rs),D(!0),et.current=fn,d("manual"),y===3&&il&&wl(!0);const xn={name:ol,plugin:Ft||"",layout:y,description:ra,model:Pt||void 0,allowedTools:ia||void 0,body:Ml,evals:rs||void 0,aiMeta:fn};Te.saveDraft(xn).then(ca=>{Al(!0),sl(ca.files)}).catch(()=>{})}else at==="error"&&(R(tt.message||tt.description||"Unknown error"),tt.category&&Q(tt))}catch{}at=""}}}catch(pt){pt.name!=="AbortError"&&R(pt.message)}finally{pe(!1),Ze.current=null}}async function Qt(){if(N(null),!f.trim()){N("Skill name is required");return}if(!K.trim()){N("Description is required");return}if(y!==3&&!Ft.trim()){N("Plugin name is required");return}ue(!0);try{const $=await Te.createSkill({name:Ic(f),plugin:Ft||"",layout:y,description:K,model:se||void 0,allowedTools:F||void 0,body:W,evals:he||void 0,aiMeta:et.current||void 0});i($.plugin,$.skill)}catch($){N($.message)}finally{ue(!1)}}return n.jsxs("div",{className:"px-8 py-6 max-w-4xl animate-fade-in overflow-auto h-full",children:[n.jsxs("div",{className:"mb-5",children:[n.jsx("h2",{className:"text-[20px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),n.jsx("div",{className:"flex items-center justify-between mt-2",children:n.jsxs("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[n.jsx("button",{onClick:()=>d("manual"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:u==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:u==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:u==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none",cursor:"pointer",border:"none"},children:"Manual"}),n.jsx("button",{onClick:()=>d("ai"),className:"px-3 py-1.5 rounded-md text-[12px] font-medium transition-all duration-200",style:{background:u==="ai"?"rgba(168,85,247,0.15)":"transparent",color:u==="ai"?"#a855f7":"var(--text-tertiary)",boxShadow:u==="ai"?"0 1px 3px rgba(168,85,247,0.15)":"none",cursor:"pointer",border:"none"},children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Pc,{size:12}),"AI-Assisted"]})})]})})]}),p&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),n.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!p&&m&&u==="ai"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[n.jsx("div",{className:"w-5 h-5 rounded-md flex items-center justify-center",style:{background:"rgba(168,85,247,0.15)"},children:n.jsx(Pc,{size:11,color:"#a855f7"})}),"Describe Your Skill"]}),n.jsx("textarea",{ref:ye,value:A,onChange:$=>J($.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
70
70
|
|
|
71
|
-
Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:ce,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...na,minHeight:"120px"},onKeyDown:$=>{$.key==="Enter"&&($.metaKey||$.ctrlKey)&&($.preventDefault(),mt())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),ce&&ee.length>0&&n.jsx(ss,{entries:ee,isRunning:!0}),Z&&n.jsx("div",{children:G?n.jsx(kr,{error:G,onRetry:mt,onDismiss:()=>{R(null),
|
|
71
|
+
Include any specific behaviors, constraints, or output formats you want.`,rows:5,disabled:ce,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...na,minHeight:"120px"},onKeyDown:$=>{$.key==="Enter"&&($.metaKey||$.ctrlKey)&&($.preventDefault(),mt())}}),n.jsxs("p",{className:"text-[11px] mt-2",style:{color:"var(--text-tertiary)"},children:["Describe what the skill should do. The AI will generate the name, description, system prompt, and test cases.",n.jsx("span",{className:"ml-1",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]})]}),ce&&ee.length>0&&n.jsx(ss,{entries:ee,isRunning:!0}),Z&&n.jsx("div",{children:G?n.jsx(kr,{error:G,onRetry:mt,onDismiss:()=>{R(null),Q(null)}}):n.jsxs("div",{children:[n.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:Z}),n.jsx("button",{onClick:mt,className:"mt-2 text-[12px] font-medium",style:{color:"#a855f7",background:"none",border:"none",cursor:"pointer"},children:"Retry"})]})}),n.jsxs("div",{className:"flex items-center gap-3",children:[ce?n.jsx("button",{onClick:ze,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"}):n.jsxs("button",{onClick:mt,disabled:!A.trim(),className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:A.trim()?"#a855f7":"var(--surface-3)",color:A.trim()?"#fff":"var(--text-tertiary)",cursor:A.trim()?"pointer":"not-allowed",border:"none"},children:[n.jsx(Pc,{size:14}),"Generate"]}),n.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"}),!ce&&n.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-tertiary)"},children:["or fill in the form manually",n.jsx("button",{onClick:()=>d("manual"),className:"ml-1 font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer"},children:"below"})]})]})]}),!p&&m&&u==="manual"&&n.jsxs("div",{className:"space-y-4 animate-fade-in",children:[n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),Rl.length>1&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),n.jsx("div",{className:"flex gap-2",children:Rl.map($=>n.jsx("button",{onClick:()=>{T($.layout),B($.existingPlugins[0]||""),V("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:y===$.layout?"var(--accent)":"var(--surface-3)",color:y===$.layout?"#fff":"var(--text-secondary)",border:`1px solid ${y===$.layout?"var(--accent)":"var(--border-subtle)"}`,cursor:"pointer"},children:$.label},$.layout))})]}),y!==3&&n.jsxs("div",{className:"mb-3",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),n.jsxs("select",{value:z,onChange:$=>{B($.target.value),V("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na,children:[_l.map($=>n.jsx("option",{value:$,children:$},$)),n.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),z==="__new__"&&n.jsx("input",{type:"text",value:q,onChange:$=>V(Ic($.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:na})]}),n.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:Vt})]}),rl&&il&&y===3&&n.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:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#3b82f6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),n.jsxs("span",{children:["Plugins detected (",n.jsx("strong",{children:il.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:()=>{T(il.layout),B(il.plugins[0]),wl(!1)},className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},children:"Use plugin"}),n.jsx("button",{onClick:()=>wl(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:n.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Name ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("input",{type:"text",value:f,onChange:$=>E(Ic($.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:["Description ",n.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),n.jsx("textarea",{value:K,onChange:$=>P($.target.value),placeholder:"Brief description",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...na,minHeight:"72px"}})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Model"}),n.jsxs("select",{value:se,onChange:$=>Y($.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na,children:[n.jsx("option",{value:"",children:"Any"}),n.jsx("option",{value:"opus",children:"Opus"}),n.jsx("option",{value:"sonnet",children:"Sonnet"}),n.jsx("option",{value:"haiku",children:"Haiku"})]})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-1 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),n.jsx("input",{type:"text",value:F,onChange:$=>le($.target.value),placeholder:"Read, Write, Edit...",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:na})]})]})]}),n.jsxs("div",{className:"glass-card p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),n.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),n.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map($=>n.jsxs("button",{onClick:()=>ve($),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:ge===$?"var(--surface-4)":"transparent",color:ge===$?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:ge===$?600:400,border:"none",cursor:"pointer"},children:[$==="write"?n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 18 22 12 16 6"}),n.jsx("polyline",{points:"8 6 2 12 8 18"})]}):n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),n.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),n.jsx("span",{children:$==="write"?"Write":"Preview"})]},$))})]}),ge==="write"?n.jsx("textarea",{value:W,onChange:$=>ae($.target.value),placeholder:`# /my-skill
|
|
72
72
|
|
|
73
73
|
You are an expert at...
|
|
74
|
-
`,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...na,minHeight:"150px"}}):W.trim()?n.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(W)}}):n.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:n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),n.jsx(Wv,{skillName:f||"{skill}",hasEvals:!!(he&&he.length>0),isDraft:$t}),Ee&&n.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:Ee}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Qt,disabled:X||!f||!K,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:X||!f||!K?"var(--surface-3)":"var(--accent)",color:X||!f||!K?"var(--text-tertiary)":"#fff",cursor:X||!f||!K?"not-allowed":"pointer",border:"none"},children:X?"Saving...":
|
|
74
|
+
`,rows:8,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...na,minHeight:"150px"}}):W.trim()?n.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(W)}}):n.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:n.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),n.jsx(Wv,{skillName:f||"{skill}",hasEvals:!!(he&&he.length>0),isDraft:$t}),Ee&&n.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:Ee}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:Qt,disabled:X||!f||!K,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:X||!f||!K?"var(--surface-3)":"var(--accent)",color:X||!f||!K?"var(--text-tertiary)":"#fff",cursor:X||!f||!K?"not-allowed":"pointer",border:"none"},children:X?"Saving...":S?"Save":"Create Skill"}),n.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 Pv(){return n.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center",style:{background:"var(--surface-2)"},children:n.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:[n.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"}),n.jsx("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),n.jsx("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]})})}function eo({variant:i,message:c,onRetry:u}){const{setMode:d,setSearch:m}=sa(),[h,p]=v.useState(!1);return i==="no-selection"?n.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:[n.jsx("div",{className:"mb-5",children:h?n.jsx(Pv,{}):n.jsx("img",{src:"/images/empty-studio.webp",width:128,height:128,alt:"",onError:()=>p(!0),style:{objectFit:"contain"}})}),n.jsx("p",{className:"text-[14px] font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Select a skill to view details"}),n.jsx("p",{className:"text-[12px]",style:{color:"var(--text-tertiary)"},children:"Choose a skill from the list to edit, test, and evaluate"})]}):i==="no-skills"?n.jsxs("div",{className:"text-center py-12 px-4 animate-fade-in-scale",children:[n.jsx("div",{className:"w-14 h-14 rounded-2xl flex items-center justify-center mx-auto mb-4",style:{background:"var(--surface-2)"},children:n.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:n.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"})})}),n.jsx("p",{className:"text-[14px] font-medium",style:{color:"var(--text-secondary)"},children:"No skills found"}),n.jsxs("p",{className:"text-[12px] mt-1 mb-4",style:{color:"var(--text-tertiary)"},children:["Check your ",n.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"]}),n.jsxs("button",{onClick:()=>d("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:[n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),n.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create Your First Skill"]})]}):i==="error"?n.jsx("div",{className:"flex flex-col items-center justify-center h-full px-8 animate-fade-in",children:n.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:[n.jsx("p",{className:"text-[13px] mb-3",style:{color:"var(--red)"},children:c||"Failed to load skill data"}),u&&n.jsx("button",{onClick:u,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"})]})}):n.jsxs("div",{className:"px-4 py-8 text-center animate-fade-in",children:[n.jsx("p",{className:"text-[13px] mb-2",style:{color:"var(--text-tertiary)"},children:"No skills match your search"}),n.jsx("button",{onClick:()=>m(""),className:"text-[12px] font-medium",style:{color:"var(--accent)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline"},children:"Clear search"})]})}function Mx(){const{state:i,setMobileView:c}=sa();return i.isMobile?n.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:[n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to skills"]}):null}function ey(){const{state:i,selectSkill:c,setMode:u,refreshSkills:d}=sa();if(i.mode==="create")return n.jsxs("div",{className:"h-full overflow-auto animate-fade-in",children:[n.jsx(Mx,{}),n.jsx(Iv,{onCreated:(b,g)=>{u("browse"),d(),c({plugin:b,skill:g,origin:"source"})},onCancel:()=>u("browse")})]});if(!i.selectedSkill)return i.skillsError?n.jsx(eo,{variant:"error",message:i.skillsError,onRetry:d}):!i.skillsLoading&&i.skills.length===0?n.jsx(eo,{variant:"no-skills"}):n.jsx(eo,{variant:"no-selection"});const{plugin:m,skill:h,origin:p}=i.selectedSkill;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(Mx,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Uh,{plugin:m,skill:h,origin:p,children:n.jsx(Kv,{})},`${m}/${h}`)})]})}function ty(){return n.jsx(Sh,{children:n.jsx(gh,{children:n.jsx(Nh,{left:n.jsx(_h,{}),right:n.jsx(ey,{})})})})}ph.createRoot(document.getElementById("root")).render(n.jsx(v.StrictMode,{children:n.jsx(ty,{})}));
|