@axlsdk/studio 0.23.3 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/{chunk-XK2DRXKB.js → chunk-PFPLZQ5X.js} +650 -51
- package/dist/chunk-PFPLZQ5X.js.map +1 -0
- package/dist/cli.cjs +648 -49
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/assets/index-CuWKncEa.js +320 -0
- package/dist/client/assets/index-DinaGVe2.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/middleware.cjs +648 -49
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.js +1 -1
- package/dist/server/index.cjs +648 -49
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +28 -0
- package/dist/server/index.d.ts +28 -0
- package/dist/server/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-XK2DRXKB.js.map +0 -1
- package/dist/client/assets/index-Bc4iQdXy.css +0 -1
- package/dist/client/assets/index-DIx_trGA.js +0 -318
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
var $y=Object.defineProperty;var Xx=s=>{throw TypeError(s)};var Hy=(s,r,o)=>r in s?$y(s,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[r]=o;var ll=(s,r,o)=>Hy(s,typeof r!="symbol"?r+"":r,o),Yd=(s,r,o)=>r.has(s)||Xx("Cannot "+o);var U=(s,r,o)=>(Yd(s,r,"read from private field"),o?o.call(s):r.get(s)),Te=(s,r,o)=>r.has(s)?Xx("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,o),ge=(s,r,o,i)=>(Yd(s,r,"write to private field"),i?i.call(s,o):r.set(s,o),o),Be=(s,r,o)=>(Yd(s,r,"access private method"),o);var ic=(s,r,o,i)=>({set _(d){ge(s,r,d,o)},get _(){return U(s,r,i)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=o(d);fetch(d.href,f)}})();var Kd={exports:{}},wo={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Fx;function qy(){if(Fx)return wo;Fx=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(i,d,f){var h=null;if(f!==void 0&&(h=""+f),d.key!==void 0&&(h=""+d.key),"key"in d){f={};for(var m in d)m!=="key"&&(f[m]=d[m])}else f=d;return d=f.ref,{$$typeof:s,type:i,key:h,ref:d!==void 0?d:null,props:f}}return wo.Fragment=r,wo.jsx=o,wo.jsxs=o,wo}var Ix;function By(){return Ix||(Ix=1,Kd.exports=qy()),Kd.exports}var n=By(),Vd={exports:{}},De={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Zx;function Gy(){if(Zx)return De;Zx=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),k=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=k&&O[k]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,_={};function D(O,G,P){this.props=O,this.context=G,this.refs=_,this.updater=P||C}D.prototype.isReactComponent={},D.prototype.setState=function(O,G){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,G,"setState")},D.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function $(){}$.prototype=D.prototype;function T(O,G,P){this.props=O,this.context=G,this.refs=_,this.updater=P||C}var j=T.prototype=new $;j.constructor=T,A(j,D.prototype),j.isPureReactComponent=!0;var S=Array.isArray;function E(){}var B={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function q(O,G,P){var le=P.ref;return{$$typeof:s,type:O,key:G,ref:le!==void 0?le:null,props:P}}function K(O,G){return q(O.type,G,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===s}function re(O){var G={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(P){return G[P]})}var we=/\/+/g;function me(O,G){return typeof O=="object"&&O!==null&&O.key!=null?re(""+O.key):G.toString(36)}function Z(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(E,E):(O.status="pending",O.then(function(G){O.status==="pending"&&(O.status="fulfilled",O.value=G)},function(G){O.status==="pending"&&(O.status="rejected",O.reason=G)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function M(O,G,P,le,he){var ie=typeof O;(ie==="undefined"||ie==="boolean")&&(O=null);var fe=!1;if(O===null)fe=!0;else switch(ie){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(O.$$typeof){case s:case r:fe=!0;break;case v:return fe=O._init,M(fe(O._payload),G,P,le,he)}}if(fe)return he=he(O),fe=le===""?"."+me(O,0):le,S(he)?(P="",fe!=null&&(P=fe.replace(we,"$&/")+"/"),M(he,G,P,"",function(ce){return ce})):he!=null&&(F(he)&&(he=K(he,P+(he.key==null||O&&O.key===he.key?"":(""+he.key).replace(we,"$&/")+"/")+fe)),G.push(he)),1;fe=0;var I=le===""?".":le+":";if(S(O))for(var oe=0;oe<O.length;oe++)le=O[oe],ie=I+me(le,oe),fe+=M(le,G,P,ie,he);else if(oe=w(O),typeof oe=="function")for(O=oe.call(O),oe=0;!(le=O.next()).done;)le=le.value,ie=I+me(le,oe++),fe+=M(le,G,P,ie,he);else if(ie==="object"){if(typeof O.then=="function")return M(Z(O),G,P,le,he);throw G=String(O),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return fe}function R(O,G,P){if(O==null)return O;var le=[],he=0;return M(O,le,"","",function(ie){return G.call(P,ie,he++)}),le}function ne(O){if(O._status===-1){var G=O._result;G=G(),G.then(function(P){(O._status===0||O._status===-1)&&(O._status=1,O._result=P)},function(P){(O._status===0||O._status===-1)&&(O._status=2,O._result=P)}),O._status===-1&&(O._status=0,O._result=G)}if(O._status===1)return O._result.default;throw O._result}var je=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},xe={map:R,forEach:function(O,G,P){R(O,function(){G.apply(this,arguments)},P)},count:function(O){var G=0;return R(O,function(){G++}),G},toArray:function(O){return R(O,function(G){return G})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return De.Activity=y,De.Children=xe,De.Component=D,De.Fragment=o,De.Profiler=d,De.PureComponent=T,De.StrictMode=i,De.Suspense=p,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,De.__COMPILER_RUNTIME={__proto__:null,c:function(O){return B.H.useMemoCache(O)}},De.cache=function(O){return function(){return O.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(O,G,P){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var le=A({},O.props),he=O.key;if(G!=null)for(ie in G.key!==void 0&&(he=""+G.key),G)!te.call(G,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&G.ref===void 0||(le[ie]=G[ie]);var ie=arguments.length-2;if(ie===1)le.children=P;else if(1<ie){for(var fe=Array(ie),I=0;I<ie;I++)fe[I]=arguments[I+2];le.children=fe}return q(O.type,he,le)},De.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:f,_context:O},O},De.createElement=function(O,G,P){var le,he={},ie=null;if(G!=null)for(le in G.key!==void 0&&(ie=""+G.key),G)te.call(G,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(he[le]=G[le]);var fe=arguments.length-2;if(fe===1)he.children=P;else if(1<fe){for(var I=Array(fe),oe=0;oe<fe;oe++)I[oe]=arguments[oe+2];he.children=I}if(O&&O.defaultProps)for(le in fe=O.defaultProps,fe)he[le]===void 0&&(he[le]=fe[le]);return q(O,ie,he)},De.createRef=function(){return{current:null}},De.forwardRef=function(O){return{$$typeof:m,render:O}},De.isValidElement=F,De.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:ne}},De.memo=function(O,G){return{$$typeof:x,type:O,compare:G===void 0?null:G}},De.startTransition=function(O){var G=B.T,P={};B.T=P;try{var le=O(),he=B.S;he!==null&&he(P,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(E,je)}catch(ie){je(ie)}finally{G!==null&&P.types!==null&&(G.types=P.types),B.T=G}},De.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},De.use=function(O){return B.H.use(O)},De.useActionState=function(O,G,P){return B.H.useActionState(O,G,P)},De.useCallback=function(O,G){return B.H.useCallback(O,G)},De.useContext=function(O){return B.H.useContext(O)},De.useDebugValue=function(){},De.useDeferredValue=function(O,G){return B.H.useDeferredValue(O,G)},De.useEffect=function(O,G){return B.H.useEffect(O,G)},De.useEffectEvent=function(O){return B.H.useEffectEvent(O)},De.useId=function(){return B.H.useId()},De.useImperativeHandle=function(O,G,P){return B.H.useImperativeHandle(O,G,P)},De.useInsertionEffect=function(O,G){return B.H.useInsertionEffect(O,G)},De.useLayoutEffect=function(O,G){return B.H.useLayoutEffect(O,G)},De.useMemo=function(O,G){return B.H.useMemo(O,G)},De.useOptimistic=function(O,G){return B.H.useOptimistic(O,G)},De.useReducer=function(O,G,P){return B.H.useReducer(O,G,P)},De.useRef=function(O){return B.H.useRef(O)},De.useState=function(O){return B.H.useState(O)},De.useSyncExternalStore=function(O,G,P){return B.H.useSyncExternalStore(O,G,P)},De.useTransition=function(){return B.H.useTransition()},De.version="19.2.4",De}var Jx;function Df(){return Jx||(Jx=1,Vd.exports=Gy()),Vd.exports}var b=Df(),Xd={exports:{}},ko={},Fd={exports:{}},Id={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Wx;function Qy(){return Wx||(Wx=1,(function(s){function r(M,R){var ne=M.length;M.push(R);e:for(;0<ne;){var je=ne-1>>>1,xe=M[je];if(0<d(xe,R))M[je]=R,M[ne]=xe,ne=je;else break e}}function o(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var R=M[0],ne=M.pop();if(ne!==R){M[0]=ne;e:for(var je=0,xe=M.length,O=xe>>>1;je<O;){var G=2*(je+1)-1,P=M[G],le=G+1,he=M[le];if(0>d(P,ne))le<xe&&0>d(he,P)?(M[je]=he,M[le]=ne,je=le):(M[je]=P,M[G]=ne,je=G);else if(le<xe&&0>d(he,ne))M[je]=he,M[le]=ne,je=le;else break e}}return R}function d(M,R){var ne=M.sortIndex-R.sortIndex;return ne!==0?ne:M.id-R.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();s.unstable_now=function(){return h.now()-m}}var p=[],x=[],v=1,y=null,k=3,w=!1,C=!1,A=!1,_=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function j(M){for(var R=o(x);R!==null;){if(R.callback===null)i(x);else if(R.startTime<=M)i(x),R.sortIndex=R.expirationTime,r(p,R);else break;R=o(x)}}function S(M){if(A=!1,j(M),!C)if(o(p)!==null)C=!0,E||(E=!0,re());else{var R=o(x);R!==null&&Z(S,R.startTime-M)}}var E=!1,B=-1,te=5,q=-1;function K(){return _?!0:!(s.unstable_now()-q<te)}function F(){if(_=!1,E){var M=s.unstable_now();q=M;var R=!0;try{e:{C=!1,A&&(A=!1,$(B),B=-1),w=!0;var ne=k;try{t:{for(j(M),y=o(p);y!==null&&!(y.expirationTime>M&&K());){var je=y.callback;if(typeof je=="function"){y.callback=null,k=y.priorityLevel;var xe=je(y.expirationTime<=M);if(M=s.unstable_now(),typeof xe=="function"){y.callback=xe,j(M),R=!0;break t}y===o(p)&&i(p),j(M)}else i(p);y=o(p)}if(y!==null)R=!0;else{var O=o(x);O!==null&&Z(S,O.startTime-M),R=!1}}break e}finally{y=null,k=ne,w=!1}R=void 0}}finally{R?re():E=!1}}}var re;if(typeof T=="function")re=function(){T(F)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,me=we.port2;we.port1.onmessage=F,re=function(){me.postMessage(null)}}else re=function(){D(F,0)};function Z(M,R){B=D(function(){M(s.unstable_now())},R)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(M){M.callback=null},s.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<M?Math.floor(1e3/M):5},s.unstable_getCurrentPriorityLevel=function(){return k},s.unstable_next=function(M){switch(k){case 1:case 2:case 3:var R=3;break;default:R=k}var ne=k;k=R;try{return M()}finally{k=ne}},s.unstable_requestPaint=function(){_=!0},s.unstable_runWithPriority=function(M,R){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ne=k;k=M;try{return R()}finally{k=ne}},s.unstable_scheduleCallback=function(M,R,ne){var je=s.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?je+ne:je):ne=je,M){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=ne+xe,M={id:v++,callback:R,priorityLevel:M,startTime:ne,expirationTime:xe,sortIndex:-1},ne>je?(M.sortIndex=ne,r(x,M),o(p)===null&&M===o(x)&&(A?($(B),B=-1):A=!0,Z(S,ne-je))):(M.sortIndex=xe,r(p,M),C||w||(C=!0,E||(E=!0,re()))),M},s.unstable_shouldYield=K,s.unstable_wrapCallback=function(M){var R=k;return function(){var ne=k;k=R;try{return M.apply(this,arguments)}finally{k=ne}}}})(Id)),Id}var Px;function Yy(){return Px||(Px=1,Fd.exports=Qy()),Fd.exports}var Zd={exports:{}},Wt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var e0;function Ky(){if(e0)return Wt;e0=1;var s=Df();function r(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(p,x,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:p,containerInfo:x,implementation:v}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Wt.createPortal=function(p,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(r(299));return f(p,x,null,v)},Wt.flushSync=function(p){var x=h.T,v=i.p;try{if(h.T=null,i.p=2,p)return p()}finally{h.T=x,i.p=v,i.d.f()}},Wt.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,i.d.C(p,x))},Wt.prefetchDNS=function(p){typeof p=="string"&&i.d.D(p)},Wt.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var v=x.as,y=m(v,x.crossOrigin),k=typeof x.integrity=="string"?x.integrity:void 0,w=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?i.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:k,fetchPriority:w}):v==="script"&&i.d.X(p,{crossOrigin:y,integrity:k,fetchPriority:w,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Wt.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=m(x.as,x.crossOrigin);i.d.M(p,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&i.d.M(p)},Wt.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,y=m(v,x.crossOrigin);i.d.L(p,v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Wt.preloadModule=function(p,x){if(typeof p=="string")if(x){var v=m(x.as,x.crossOrigin);i.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else i.d.m(p)},Wt.requestFormReset=function(p){i.d.r(p)},Wt.unstable_batchedUpdates=function(p,x){return p(x)},Wt.useFormState=function(p,x,v){return h.H.useFormState(p,x,v)},Wt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Wt.version="19.2.4",Wt}var t0;function Vy(){if(t0)return Zd.exports;t0=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Zd.exports=Ky(),Zd.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var n0;function Xy(){if(n0)return ko;n0=1;var s=Yy(),r=Df(),o=Vy();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(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 m(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 p(e){if(f(e)!==e)throw Error(i(188))}function x(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,l=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(l=c.return,l!==null){a=l;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return p(c),e;if(u===l)return p(c),t;u=u.sibling}throw Error(i(188))}if(a.return!==l.return)a=c,l=u;else{for(var g=!1,N=c.child;N;){if(N===a){g=!0,a=c,l=u;break}if(N===l){g=!0,l=c,a=u;break}N=N.sibling}if(!g){for(N=u.child;N;){if(N===a){g=!0,a=u,l=c;break}if(N===l){g=!0,l=u,a=c;break}N=N.sibling}if(!g)throw Error(i(189))}}if(a.alternate!==l)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),T=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var we=Symbol.for("react.client.reference");function me(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case D:return"Profiler";case _:return"StrictMode";case S:return"Suspense";case E:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var Z=Array.isArray,M=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},je=[],xe=-1;function O(e){return{current:e}}function G(e){0>xe||(e.current=je[xe],je[xe]=null,xe--)}function P(e,t){xe++,je[xe]=e.current,e.current=t}var le=O(null),he=O(null),ie=O(null),fe=O(null);function I(e,t){switch(P(ie,t),P(he,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xx(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xx(t),e=gx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(le),P(le,e)}function oe(){G(le),G(he),G(ie)}function ce(e){e.memoizedState!==null&&P(fe,e);var t=le.current,a=gx(t,e.type);t!==a&&(P(he,e),P(le,a))}function ve(e){he.current===e&&(G(le),G(he)),fe.current===e&&(G(fe),yo._currentValue=ne)}var Ne,Ze;function mt(e){if(Ne===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||"",Ze=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ne+e+Ze}var pe=!1;function Ce(e,t){if(!e||pe)return"";pe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(J){var X=J}Reflect.construct(e,[],se)}else{try{se.call()}catch(J){X=J}e.call(se.prototype)}}else{try{throw Error()}catch(J){X=J}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(J){if(J&&X&&typeof J.stack=="string")return[J.stack,X.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),g=u[0],N=u[1];if(g&&N){var z=g.split(`
|
|
44
|
+
`),V=N.split(`
|
|
45
|
+
`);for(c=l=0;l<z.length&&!z[l].includes("DetermineComponentFrameRoot");)l++;for(;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;if(l===z.length||c===V.length)for(l=z.length-1,c=V.length-1;1<=l&&0<=c&&z[l]!==V[c];)c--;for(;1<=l&&0<=c;l--,c--)if(z[l]!==V[c]){if(l!==1||c!==1)do if(l--,c--,0>c||z[l]!==V[c]){var ee=`
|
|
46
|
+
`+z[l].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=l&&0<=c);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?mt(a):""}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return mt("Activity");default:return""}}function Mt(e){try{var t="",a=null;do t+=Ie(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var Gt=Object.prototype.hasOwnProperty,vn=s.unstable_scheduleCallback,Ee=s.unstable_cancelCallback,ut=s.unstable_shouldYield,at=s.unstable_requestPaint,$e=s.unstable_now,bn=s.unstable_getCurrentPriorityLevel,Rn=s.unstable_ImmediatePriority,It=s.unstable_UserBlockingPriority,Zt=s.unstable_NormalPriority,fa=s.unstable_LowPriority,Vn=s.unstable_IdlePriority,Ds=s.log,zs=s.unstable_setDisableYieldValue,yn=null,_e=null;function jt(e){if(typeof Ds=="function"&&zs(e),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(yn,e)}catch{}}var zt=Math.clz32?Math.clz32:He,jn=Math.log,Ya=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(jn(e)/Ya|0)|0}var Nn=256,Ue=262144,Ka=4194304;function ma(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 yr(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,u=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var N=l&134217727;return N!==0?(l=N&~u,l!==0?c=ma(l):(g&=N,g!==0?c=ma(g):a||(a=N&~e,a!==0&&(c=ma(a))))):(N=l&~u,N!==0?c=ma(N):g!==0?c=ma(g):a||(a=l&~e,a!==0&&(c=ma(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function Us(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Lc(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 Fo(){var e=Ka;return Ka<<=1,(Ka&62914560)===0&&(Ka=4194304),e}function Va(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ea(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xa(e,t,a,l,c,u){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var N=e.entanglements,z=e.expirationTimes,V=e.hiddenUpdates;for(a=g&~a;0<a;){var ee=31-zt(a),se=1<<ee;N[ee]=0,z[ee]=-1;var X=V[ee];if(X!==null)for(V[ee]=null,ee=0;ee<X.length;ee++){var J=X[ee];J!==null&&(J.lane&=-536870913)}a&=~se}l!==0&&jr(e,l,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(g&~t))}function jr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-zt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function ta(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-zt(a),c=1<<l;c&t|e[l]&t&&(e[l]|=t),a&=~c}}function Nr(e,t){var a=t&-t;return a=(a&42)!==0?1:Rl(a),(a&(e.suspendedLanes|t))!==0?0:a}function Rl(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 Sr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ls(){var e=R.p;return e!==0?e:(e=window.event,e===void 0?32:qx(e.type))}function Io(e,t){var a=R.p;try{return R.p=e,t()}finally{R.p=a}}var on=Math.random().toString(36).slice(2),Nt="__reactFiber$"+on,Jt="__reactProps$"+on,ha="__reactContainer$"+on,Dl="__reactEvents$"+on,Zo="__reactListeners$"+on,Jo="__reactHandles$"+on,zl="__reactResources$"+on,Fa="__reactMarker$"+on;function wr(e){delete e[Nt],delete e[Jt],delete e[Dl],delete e[Zo],delete e[Jo]}function pa(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ha]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=wx(e);e!==null;){if(a=e[Nt])return a;e=wx(e)}return t}e=a,a=e.parentNode}return null}function W(e){if(e=e[Nt]||e[ha]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ue(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function de(e){var t=e[zl];return t||(t=e[zl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ye(e){e[Fa]=!0}var be=new Set,Ge={};function Oe(e,t){ze(e,t),ze(e+"Capture",t)}function ze(e,t){for(Ge[e]=t,e=0;e<t.length;e++)be.add(t[e])}var Je=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]*$"),dt={},pt={};function kr(e){return Gt.call(pt,e)?!0:Gt.call(dt,e)?!1:Je.test(e)?pt[e]=!0:(dt[e]=!0,!1)}function xa(e,t,a){if(kr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function $s(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function $t(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Ht(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wo(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(g){a=""+g,u.call(this,g)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qs(e){if(!e._valueTracker){var t=Hs(e)?"checked":"value";e._valueTracker=Wo(e,t,""+e[t])}}function Cr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Hs(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Bs(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 Gs=/[\n"\\]/g;function Qt(e){return e.replace(Gs,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function $c(e,t,a,l,c,u,g,N){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ht(t)):e.value!==""+Ht(t)&&(e.value=""+Ht(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Hc(e,g,Ht(t)):a!=null?Hc(e,g,Ht(a)):l!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Ht(N):e.removeAttribute("name")}function um(e,t,a,l,c,u,g,N){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){qs(e);return}a=a!=null?""+Ht(a):"",t=t!=null?""+Ht(t):a,N||t===e.value||(e.value=t),e.defaultValue=t}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=N?e.checked:!!l,e.defaultChecked=!!l,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),qs(e)}function Hc(e,t,a){t==="number"&&Bs(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Er(e,t,a,l){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ht(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function dm(e,t,a){if(t!=null&&(t=""+Ht(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ht(a):""}function fm(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(i(92));if(Z(l)){if(1<l.length)throw Error(i(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Ht(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),qs(e)}function Tr(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Rv=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 mm(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Rv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function hm(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in t)l=t[c],t.hasOwnProperty(c)&&a[c]!==l&&mm(e,c,l)}else for(var u in t)t.hasOwnProperty(u)&&mm(e,u,t[u])}function qc(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 Dv=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"]]),zv=/^[\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 Po(e){return zv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ga(){}var Bc=null;function Gc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mr=null,Ar=null;function pm(e){var t=W(e);if(t&&(e=t.stateNode)){var a=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if($c(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Qt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var c=l[Jt]||null;if(!c)throw Error(i(90));$c(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Cr(l)}break e;case"textarea":dm(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Er(e,!!a.multiple,t,!1)}}}var Qc=!1;function xm(e,t,a){if(Qc)return e(t,a);Qc=!0;try{var l=e(t);return l}finally{if(Qc=!1,(Mr!==null||Ar!==null)&&(qi(),Mr&&(t=Mr,e=Ar,Ar=Mr=null,pm(t),e)))for(t=0;t<e.length;t++)pm(e[t])}}function Ul(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Jt]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(i(231,t,typeof a));return a}var va=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yc=!1;if(va)try{var Ll={};Object.defineProperty(Ll,"passive",{get:function(){Yc=!0}}),window.addEventListener("test",Ll,Ll),window.removeEventListener("test",Ll,Ll)}catch{Yc=!1}var Ia=null,Kc=null,ei=null;function gm(){if(ei)return ei;var e,t=Kc,a=t.length,l,c="value"in Ia?Ia.value:Ia.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var g=a-e;for(l=1;l<=g&&t[a-l]===c[u-l];l++);return ei=c.slice(e,1<l?1-l:void 0)}function ti(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 ni(){return!0}function vm(){return!1}function cn(e){function t(a,l,c,u,g){this._reactName=a,this._targetInst=c,this.type=l,this.nativeEvent=u,this.target=g,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(a=e[N],this[N]=a?a(u):u[N]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?ni:vm,this.isPropagationStopped=vm,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ni)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ni)},persist:function(){},isPersistent:ni}),t}var Qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ai=cn(Qs),$l=y({},Qs,{view:0,detail:0}),Uv=cn($l),Vc,Xc,Hl,si=y({},$l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ic,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!==Hl&&(Hl&&e.type==="mousemove"?(Vc=e.screenX-Hl.screenX,Xc=e.screenY-Hl.screenY):Xc=Vc=0,Hl=e),Vc)},movementY:function(e){return"movementY"in e?e.movementY:Xc}}),bm=cn(si),Lv=y({},si,{dataTransfer:0}),$v=cn(Lv),Hv=y({},$l,{relatedTarget:0}),Fc=cn(Hv),qv=y({},Qs,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=cn(qv),Gv=y({},Qs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qv=cn(Gv),Yv=y({},Qs,{data:0}),ym=cn(Yv),Kv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={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"},Xv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xv[e])?!!t[e]:!1}function Ic(){return Fv}var Iv=y({},$l,{key:function(e){if(e.key){var t=Kv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ti(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ic,charCode:function(e){return e.type==="keypress"?ti(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ti(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zv=cn(Iv),Jv=y({},si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jm=cn(Jv),Wv=y({},$l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ic}),Pv=cn(Wv),eb=y({},Qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),tb=cn(eb),nb=y({},si,{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}),ab=cn(nb),sb=y({},Qs,{newState:0,oldState:0}),rb=cn(sb),lb=[9,13,27,32],Zc=va&&"CompositionEvent"in window,ql=null;va&&"documentMode"in document&&(ql=document.documentMode);var ob=va&&"TextEvent"in window&&!ql,Nm=va&&(!Zc||ql&&8<ql&&11>=ql),Sm=" ",wm=!1;function km(e,t){switch(e){case"keyup":return lb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function ib(e,t){switch(e){case"compositionend":return Cm(t);case"keypress":return t.which!==32?null:(wm=!0,Sm);case"textInput":return e=t.data,e===Sm&&wm?null:e;default:return null}}function cb(e,t){if(_r)return e==="compositionend"||!Zc&&km(e,t)?(e=gm(),ei=Kc=Ia=null,_r=!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 Nm&&t.locale!=="ko"?null:t.data;default:return null}}var ub={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 Em(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ub[e.type]:t==="textarea"}function Tm(e,t,a,l){Mr?Ar?Ar.push(l):Ar=[l]:Mr=l,t=Xi(t,"onChange"),0<t.length&&(a=new ai("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Bl=null,Gl=null;function db(e){ux(e,0)}function ri(e){var t=ue(e);if(Cr(t))return e}function Mm(e,t){if(e==="change")return t}var Am=!1;if(va){var Jc;if(va){var Wc="oninput"in document;if(!Wc){var _m=document.createElement("div");_m.setAttribute("oninput","return;"),Wc=typeof _m.oninput=="function"}Jc=Wc}else Jc=!1;Am=Jc&&(!document.documentMode||9<document.documentMode)}function Om(){Bl&&(Bl.detachEvent("onpropertychange",Rm),Gl=Bl=null)}function Rm(e){if(e.propertyName==="value"&&ri(Gl)){var t=[];Tm(t,Gl,e,Gc(e)),xm(db,t)}}function fb(e,t,a){e==="focusin"?(Om(),Bl=t,Gl=a,Bl.attachEvent("onpropertychange",Rm)):e==="focusout"&&Om()}function mb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ri(Gl)}function hb(e,t){if(e==="click")return ri(t)}function pb(e,t){if(e==="input"||e==="change")return ri(t)}function xb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Sn=typeof Object.is=="function"?Object.is:xb;function Ql(e,t){if(Sn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var c=a[l];if(!Gt.call(t,c)||!Sn(e[c],t[c]))return!1}return!0}function Dm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zm(e,t){var a=Dm(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Dm(a)}}function Um(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Um(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bs(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Bs(e.document)}return t}function Pc(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 gb=va&&"documentMode"in document&&11>=document.documentMode,Or=null,eu=null,Yl=null,tu=!1;function $m(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;tu||Or==null||Or!==Bs(l)||(l=Or,"selectionStart"in l&&Pc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Yl&&Ql(Yl,l)||(Yl=l,l=Xi(eu,"onSelect"),0<l.length&&(t=new ai("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Or)))}function Ys(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Rr={animationend:Ys("Animation","AnimationEnd"),animationiteration:Ys("Animation","AnimationIteration"),animationstart:Ys("Animation","AnimationStart"),transitionrun:Ys("Transition","TransitionRun"),transitionstart:Ys("Transition","TransitionStart"),transitioncancel:Ys("Transition","TransitionCancel"),transitionend:Ys("Transition","TransitionEnd")},nu={},Hm={};va&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function Ks(e){if(nu[e])return nu[e];if(!Rr[e])return e;var t=Rr[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Hm)return nu[e]=t[a];return e}var qm=Ks("animationend"),Bm=Ks("animationiteration"),Gm=Ks("animationstart"),vb=Ks("transitionrun"),bb=Ks("transitionstart"),yb=Ks("transitioncancel"),Qm=Ks("transitionend"),Ym=new Map,au="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(" ");au.push("scrollEnd");function Xn(e,t){Ym.set(e,t),Oe(t,[e])}var li=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)},Dn=[],Dr=0,su=0;function oi(){for(var e=Dr,t=su=Dr=0;t<e;){var a=Dn[t];Dn[t++]=null;var l=Dn[t];Dn[t++]=null;var c=Dn[t];Dn[t++]=null;var u=Dn[t];if(Dn[t++]=null,l!==null&&c!==null){var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}u!==0&&Km(a,c,u)}}function ii(e,t,a,l){Dn[Dr++]=e,Dn[Dr++]=t,Dn[Dr++]=a,Dn[Dr++]=l,su|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ru(e,t,a,l){return ii(e,t,a,l),ci(e)}function Vs(e,t){return ii(e,null,null,t),ci(e)}function Km(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var c=!1,u=e.return;u!==null;)u.childLanes|=a,l=u.alternate,l!==null&&(l.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-zt(a),e=u.hiddenUpdates,l=e[c],l===null?e[c]=[t]:l.push(t),t.lane=a|536870912),u):null}function ci(e){if(50<mo)throw mo=0,hd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zr={};function jb(e,t,a,l){this.tag=e,this.key=a,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(e,t,a,l){return new jb(e,t,a,l)}function lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ba(e,t){var a=e.alternate;return a===null?(a=wn(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Vm(e,t){e.flags&=65011714;var a=e.alternate;return a===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=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ui(e,t,a,l,c,u){var g=0;if(l=e,typeof e=="function")lu(e)&&(g=1);else if(typeof e=="string")g=Cy(e,a,le.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=wn(31,a,t,c),e.elementType=q,e.lanes=u,e;case A:return Xs(a.children,c,u,t);case _:g=8,c|=24;break;case D:return e=wn(12,a,t,c|2),e.elementType=D,e.lanes=u,e;case S:return e=wn(13,a,t,c),e.elementType=S,e.lanes=u,e;case E:return e=wn(19,a,t,c),e.elementType=E,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:g=10;break e;case $:g=9;break e;case j:g=11;break e;case B:g=14;break e;case te:g=16,l=null;break e}g=29,a=Error(i(130,e===null?"null":typeof e,"")),l=null}return t=wn(g,a,t,c),t.elementType=e,t.type=l,t.lanes=u,t}function Xs(e,t,a,l){return e=wn(7,e,l,t),e.lanes=a,e}function ou(e,t,a){return e=wn(6,e,null,t),e.lanes=a,e}function Xm(e){var t=wn(18,null,null,0);return t.stateNode=e,t}function iu(e,t,a){return t=wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fm=new WeakMap;function zn(e,t){if(typeof e=="object"&&e!==null){var a=Fm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Mt(t)},Fm.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var Ur=[],Lr=0,di=null,Kl=0,Un=[],Ln=0,Za=null,na=1,aa="";function ya(e,t){Ur[Lr++]=Kl,Ur[Lr++]=di,di=e,Kl=t}function Im(e,t,a){Un[Ln++]=na,Un[Ln++]=aa,Un[Ln++]=Za,Za=e;var l=na;e=aa;var c=32-zt(l)-1;l&=~(1<<c),a+=1;var u=32-zt(t)+c;if(30<u){var g=c-c%5;u=(l&(1<<g)-1).toString(32),l>>=g,c-=g,na=1<<32-zt(t)+c|a<<c|l,aa=u+e}else na=1<<u|a<<c|l,aa=e}function cu(e){e.return!==null&&(ya(e,1),Im(e,1,0))}function uu(e){for(;e===di;)di=Ur[--Lr],Ur[Lr]=null,Kl=Ur[--Lr],Ur[Lr]=null;for(;e===Za;)Za=Un[--Ln],Un[Ln]=null,aa=Un[--Ln],Un[Ln]=null,na=Un[--Ln],Un[Ln]=null}function Zm(e,t){Un[Ln++]=na,Un[Ln++]=aa,Un[Ln++]=Za,na=t.id,aa=t.overflow,Za=e}var Yt=null,xt=null,Xe=!1,Ja=null,$n=!1,du=Error(i(519));function Wa(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl(zn(t,e)),du}function Jm(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Nt]=e,t[Jt]=l,a){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(a=0;a<po.length;a++)Ye(po[a],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),um(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),fm(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||hx(t.textContent,a)?(l.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),l.onScroll!=null&&Ye("scroll",t),l.onScrollEnd!=null&&Ye("scrollend",t),l.onClick!=null&&(t.onclick=ga),t=!0):t=!1,t||Wa(e,!0)}function Wm(e){for(Yt=e.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:$n=!1;return;case 27:case 3:$n=!0;return;default:Yt=Yt.return}}function $r(e){if(e!==Yt)return!1;if(!Xe)return Wm(e),Xe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Md(e.type,e.memoizedProps)),a=!a),a&&xt&&Wa(e),Wm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));xt=Sx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));xt=Sx(e)}else t===27?(t=xt,fs(e.type)?(e=Dd,Dd=null,xt=e):xt=t):xt=Yt?qn(e.stateNode.nextSibling):null;return!0}function Fs(){xt=Yt=null,Xe=!1}function fu(){var e=Ja;return e!==null&&(mn===null?mn=e:mn.push.apply(mn,e),Ja=null),e}function Vl(e){Ja===null?Ja=[e]:Ja.push(e)}var mu=O(null),Is=null,ja=null;function Pa(e,t,a){P(mu,t._currentValue),t._currentValue=a}function Na(e){e._currentValue=mu.current,G(mu)}function hu(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function pu(e,t,a,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var g=c.child;u=u.firstContext;e:for(;u!==null;){var N=u;u=c;for(var z=0;z<t.length;z++)if(N.context===t[z]){u.lanes|=a,N=u.alternate,N!==null&&(N.lanes|=a),hu(u.return,a,e),l||(g=null);break e}u=N.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(i(341));g.lanes|=a,u=g.alternate,u!==null&&(u.lanes|=a),hu(g,a,e),g=null}else g=c.child;if(g!==null)g.return=c;else for(g=c;g!==null;){if(g===e){g=null;break}if(c=g.sibling,c!==null){c.return=g.return,g=c;break}g=g.return}c=g}}function Hr(e,t,a,l){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var g=c.alternate;if(g===null)throw Error(i(387));if(g=g.memoizedProps,g!==null){var N=c.type;Sn(c.pendingProps.value,g.value)||(e!==null?e.push(N):e=[N])}}else if(c===fe.current){if(g=c.alternate,g===null)throw Error(i(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(yo):e=[yo])}c=c.return}e!==null&&pu(t,e,a,l),t.flags|=262144}function fi(e){for(e=e.firstContext;e!==null;){if(!Sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zs(e){Is=e,ja=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return Pm(Is,e)}function mi(e,t){return Is===null&&Zs(e),Pm(e,t)}function Pm(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ja===null){if(e===null)throw Error(i(308));ja=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ja=ja.next=t;return a}var Nb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Sb=s.unstable_scheduleCallback,wb=s.unstable_NormalPriority,At={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xu(){return{controller:new Nb,data:new Map,refCount:0}}function Xl(e){e.refCount--,e.refCount===0&&Sb(wb,function(){e.controller.abort()})}var Fl=null,gu=0,qr=0,Br=null;function kb(e,t){if(Fl===null){var a=Fl=[];gu=0,qr=yd(),Br={status:"pending",value:void 0,then:function(l){a.push(l)}}}return gu++,t.then(eh,eh),t}function eh(){if(--gu===0&&Fl!==null){Br!==null&&(Br.status="fulfilled");var e=Fl;Fl=null,qr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Cb(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(l.status="rejected",l.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),l}var th=M.S;M.S=function(e,t){$p=$e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kb(e,t),th!==null&&th(e,t)};var Js=O(null);function vu(){var e=Js.current;return e!==null?e:ft.pooledCache}function hi(e,t){t===null?P(Js,Js.current):P(Js,t.pool)}function nh(){var e=vu();return e===null?null:{parent:At._currentValue,pool:e}}var Gr=Error(i(460)),bu=Error(i(474)),pi=Error(i(542)),xi={then:function(){}};function ah(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ga,ga),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lh(e),e;default:if(typeof t.status=="string")t.then(ga,ga);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=l}},function(l){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lh(e),e}throw Ps=t,Gr}}function Ws(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ps=a,Gr):a}}var Ps=null;function rh(){if(Ps===null)throw Error(i(459));var e=Ps;return Ps=null,e}function lh(e){if(e===Gr||e===pi)throw Error(i(483))}var Qr=null,Il=0;function gi(e){var t=Il;return Il+=1,Qr===null&&(Qr=[]),sh(Qr,e,t)}function Zl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function vi(e,t){throw t.$$typeof===k?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function oh(e){function t(H,L){if(e){var Y=H.deletions;Y===null?(H.deletions=[L],H.flags|=16):Y.push(L)}}function a(H,L){if(!e)return null;for(;L!==null;)t(H,L),L=L.sibling;return null}function l(H){for(var L=new Map;H!==null;)H.key!==null?L.set(H.key,H):L.set(H.index,H),H=H.sibling;return L}function c(H,L){return H=ba(H,L),H.index=0,H.sibling=null,H}function u(H,L,Y){return H.index=Y,e?(Y=H.alternate,Y!==null?(Y=Y.index,Y<L?(H.flags|=67108866,L):Y):(H.flags|=67108866,L)):(H.flags|=1048576,L)}function g(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function N(H,L,Y,ae){return L===null||L.tag!==6?(L=ou(Y,H.mode,ae),L.return=H,L):(L=c(L,Y),L.return=H,L)}function z(H,L,Y,ae){var Me=Y.type;return Me===A?ee(H,L,Y.props.children,ae,Y.key):L!==null&&(L.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===te&&Ws(Me)===L.type)?(L=c(L,Y.props),Zl(L,Y),L.return=H,L):(L=ui(Y.type,Y.key,Y.props,null,H.mode,ae),Zl(L,Y),L.return=H,L)}function V(H,L,Y,ae){return L===null||L.tag!==4||L.stateNode.containerInfo!==Y.containerInfo||L.stateNode.implementation!==Y.implementation?(L=iu(Y,H.mode,ae),L.return=H,L):(L=c(L,Y.children||[]),L.return=H,L)}function ee(H,L,Y,ae,Me){return L===null||L.tag!==7?(L=Xs(Y,H.mode,ae,Me),L.return=H,L):(L=c(L,Y),L.return=H,L)}function se(H,L,Y){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=ou(""+L,H.mode,Y),L.return=H,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return Y=ui(L.type,L.key,L.props,null,H.mode,Y),Zl(Y,L),Y.return=H,Y;case C:return L=iu(L,H.mode,Y),L.return=H,L;case te:return L=Ws(L),se(H,L,Y)}if(Z(L)||re(L))return L=Xs(L,H.mode,Y,null),L.return=H,L;if(typeof L.then=="function")return se(H,gi(L),Y);if(L.$$typeof===T)return se(H,mi(H,L),Y);vi(H,L)}return null}function X(H,L,Y,ae){var Me=L!==null?L.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Me!==null?null:N(H,L,""+Y,ae);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===Me?z(H,L,Y,ae):null;case C:return Y.key===Me?V(H,L,Y,ae):null;case te:return Y=Ws(Y),X(H,L,Y,ae)}if(Z(Y)||re(Y))return Me!==null?null:ee(H,L,Y,ae,null);if(typeof Y.then=="function")return X(H,L,gi(Y),ae);if(Y.$$typeof===T)return X(H,L,mi(H,Y),ae);vi(H,Y)}return null}function J(H,L,Y,ae,Me){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return H=H.get(Y)||null,N(L,H,""+ae,Me);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return H=H.get(ae.key===null?Y:ae.key)||null,z(L,H,ae,Me);case C:return H=H.get(ae.key===null?Y:ae.key)||null,V(L,H,ae,Me);case te:return ae=Ws(ae),J(H,L,Y,ae,Me)}if(Z(ae)||re(ae))return H=H.get(Y)||null,ee(L,H,ae,Me,null);if(typeof ae.then=="function")return J(H,L,Y,gi(ae),Me);if(ae.$$typeof===T)return J(H,L,Y,mi(L,ae),Me);vi(L,ae)}return null}function Se(H,L,Y,ae){for(var Me=null,We=null,ke=L,qe=L=0,Ve=null;ke!==null&&qe<Y.length;qe++){ke.index>qe?(Ve=ke,ke=null):Ve=ke.sibling;var Pe=X(H,ke,Y[qe],ae);if(Pe===null){ke===null&&(ke=Ve);break}e&&ke&&Pe.alternate===null&&t(H,ke),L=u(Pe,L,qe),We===null?Me=Pe:We.sibling=Pe,We=Pe,ke=Ve}if(qe===Y.length)return a(H,ke),Xe&&ya(H,qe),Me;if(ke===null){for(;qe<Y.length;qe++)ke=se(H,Y[qe],ae),ke!==null&&(L=u(ke,L,qe),We===null?Me=ke:We.sibling=ke,We=ke);return Xe&&ya(H,qe),Me}for(ke=l(ke);qe<Y.length;qe++)Ve=J(ke,H,qe,Y[qe],ae),Ve!==null&&(e&&Ve.alternate!==null&&ke.delete(Ve.key===null?qe:Ve.key),L=u(Ve,L,qe),We===null?Me=Ve:We.sibling=Ve,We=Ve);return e&&ke.forEach(function(gs){return t(H,gs)}),Xe&&ya(H,qe),Me}function Ae(H,L,Y,ae){if(Y==null)throw Error(i(151));for(var Me=null,We=null,ke=L,qe=L=0,Ve=null,Pe=Y.next();ke!==null&&!Pe.done;qe++,Pe=Y.next()){ke.index>qe?(Ve=ke,ke=null):Ve=ke.sibling;var gs=X(H,ke,Pe.value,ae);if(gs===null){ke===null&&(ke=Ve);break}e&&ke&&gs.alternate===null&&t(H,ke),L=u(gs,L,qe),We===null?Me=gs:We.sibling=gs,We=gs,ke=Ve}if(Pe.done)return a(H,ke),Xe&&ya(H,qe),Me;if(ke===null){for(;!Pe.done;qe++,Pe=Y.next())Pe=se(H,Pe.value,ae),Pe!==null&&(L=u(Pe,L,qe),We===null?Me=Pe:We.sibling=Pe,We=Pe);return Xe&&ya(H,qe),Me}for(ke=l(ke);!Pe.done;qe++,Pe=Y.next())Pe=J(ke,H,qe,Pe.value,ae),Pe!==null&&(e&&Pe.alternate!==null&&ke.delete(Pe.key===null?qe:Pe.key),L=u(Pe,L,qe),We===null?Me=Pe:We.sibling=Pe,We=Pe);return e&&ke.forEach(function(Ly){return t(H,Ly)}),Xe&&ya(H,qe),Me}function ct(H,L,Y,ae){if(typeof Y=="object"&&Y!==null&&Y.type===A&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var Me=Y.key;L!==null;){if(L.key===Me){if(Me=Y.type,Me===A){if(L.tag===7){a(H,L.sibling),ae=c(L,Y.props.children),ae.return=H,H=ae;break e}}else if(L.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===te&&Ws(Me)===L.type){a(H,L.sibling),ae=c(L,Y.props),Zl(ae,Y),ae.return=H,H=ae;break e}a(H,L);break}else t(H,L);L=L.sibling}Y.type===A?(ae=Xs(Y.props.children,H.mode,ae,Y.key),ae.return=H,H=ae):(ae=ui(Y.type,Y.key,Y.props,null,H.mode,ae),Zl(ae,Y),ae.return=H,H=ae)}return g(H);case C:e:{for(Me=Y.key;L!==null;){if(L.key===Me)if(L.tag===4&&L.stateNode.containerInfo===Y.containerInfo&&L.stateNode.implementation===Y.implementation){a(H,L.sibling),ae=c(L,Y.children||[]),ae.return=H,H=ae;break e}else{a(H,L);break}else t(H,L);L=L.sibling}ae=iu(Y,H.mode,ae),ae.return=H,H=ae}return g(H);case te:return Y=Ws(Y),ct(H,L,Y,ae)}if(Z(Y))return Se(H,L,Y,ae);if(re(Y)){if(Me=re(Y),typeof Me!="function")throw Error(i(150));return Y=Me.call(Y),Ae(H,L,Y,ae)}if(typeof Y.then=="function")return ct(H,L,gi(Y),ae);if(Y.$$typeof===T)return ct(H,L,mi(H,Y),ae);vi(H,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,L!==null&&L.tag===6?(a(H,L.sibling),ae=c(L,Y),ae.return=H,H=ae):(a(H,L),ae=ou(Y,H.mode,ae),ae.return=H,H=ae),g(H)):a(H,L)}return function(H,L,Y,ae){try{Il=0;var Me=ct(H,L,Y,ae);return Qr=null,Me}catch(ke){if(ke===Gr||ke===pi)throw ke;var We=wn(29,ke,null,H.mode);return We.lanes=ae,We.return=H,We}finally{}}}var er=oh(!0),ih=oh(!1),es=!1;function yu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ju(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 ts(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ns(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(et&2)!==0){var c=l.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),l.pending=t,t=ci(e),Km(e,null,a),t}return ii(e,l,t,a),ci(e)}function Jl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,ta(e,a)}}function Nu(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=g:u=u.next=g,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Su=!1;function Wl(){if(Su){var e=Br;if(e!==null)throw e}}function Pl(e,t,a,l){Su=!1;var c=e.updateQueue;es=!1;var u=c.firstBaseUpdate,g=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var z=N,V=z.next;z.next=null,g===null?u=V:g.next=V,g=z;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==g&&(N===null?ee.firstBaseUpdate=V:N.next=V,ee.lastBaseUpdate=z))}if(u!==null){var se=c.baseState;g=0,ee=V=z=null,N=u;do{var X=N.lane&-536870913,J=X!==N.lane;if(J?(Ke&X)===X:(l&X)===X){X!==0&&X===qr&&(Su=!0),ee!==null&&(ee=ee.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Se=e,Ae=N;X=t;var ct=a;switch(Ae.tag){case 1:if(Se=Ae.payload,typeof Se=="function"){se=Se.call(ct,se,X);break e}se=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ae.payload,X=typeof Se=="function"?Se.call(ct,se,X):Se,X==null)break e;se=y({},se,X);break e;case 2:es=!0}}X=N.callback,X!==null&&(e.flags|=64,J&&(e.flags|=8192),J=c.callbacks,J===null?c.callbacks=[X]:J.push(X))}else J={lane:X,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(V=ee=J,z=se):ee=ee.next=J,g|=X;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;J=N,N=J.next,J.next=null,c.lastBaseUpdate=J,c.shared.pending=null}}while(!0);ee===null&&(z=se),c.baseState=z,c.firstBaseUpdate=V,c.lastBaseUpdate=ee,u===null&&(c.shared.lanes=0),os|=g,e.lanes=g,e.memoizedState=se}}function ch(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function uh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)ch(a[e],t)}var Yr=O(null),bi=O(0);function dh(e,t){e=_a,P(bi,e),P(Yr,t),_a=e|t.baseLanes}function wu(){P(bi,_a),P(Yr,Yr.current)}function ku(){_a=bi.current,G(Yr),G(bi)}var kn=O(null),Hn=null;function as(e){var t=e.alternate;P(Et,Et.current&1),P(kn,e),Hn===null&&(t===null||Yr.current!==null||t.memoizedState!==null)&&(Hn=e)}function Cu(e){P(Et,Et.current),P(kn,e),Hn===null&&(Hn=e)}function fh(e){e.tag===22?(P(Et,Et.current),P(kn,e),Hn===null&&(Hn=e)):ss()}function ss(){P(Et,Et.current),P(kn,kn.current)}function Cn(e){G(kn),Hn===e&&(Hn=null),G(Et)}var Et=O(0);function yi(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Od(a)||Rd(a)))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 Sa=0,Le=null,ot=null,_t=null,ji=!1,Kr=!1,tr=!1,Ni=0,eo=0,Vr=null,Eb=0;function St(){throw Error(i(321))}function Eu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Sn(e[a],t[a]))return!1;return!0}function Tu(e,t,a,l,c,u){return Sa=u,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Ih:Qu,tr=!1,u=a(l,c),tr=!1,Kr&&(u=hh(t,a,l,c)),mh(e),u}function mh(e){M.H=ao;var t=ot!==null&&ot.next!==null;if(Sa=0,_t=ot=Le=null,ji=!1,eo=0,Vr=null,t)throw Error(i(300));e===null||Ot||(e=e.dependencies,e!==null&&fi(e)&&(Ot=!0))}function hh(e,t,a,l){Le=e;var c=0;do{if(Kr&&(Vr=null),eo=0,Kr=!1,25<=c)throw Error(i(301));if(c+=1,_t=ot=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=Zh,u=t(a,l)}while(Kr);return u}function Tb(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?to(t):t,e=e.useState()[0],(ot!==null?ot.memoizedState:null)!==e&&(Le.flags|=1024),t}function Mu(){var e=Ni!==0;return Ni=0,e}function Au(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function _u(e){if(ji){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ji=!1}Sa=0,_t=ot=Le=null,Kr=!1,eo=Ni=0,Vr=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Le.memoizedState=_t=e:_t=_t.next=e,_t}function Tt(){if(ot===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=_t===null?Le.memoizedState:_t.next;if(t!==null)_t=t,ot=e;else{if(e===null)throw Le.alternate===null?Error(i(467)):Error(i(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},_t===null?Le.memoizedState=_t=e:_t=_t.next=e}return _t}function Si(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function to(e){var t=eo;return eo+=1,Vr===null&&(Vr=[]),e=sh(Vr,e,t),t=Le,(_t===null?t.memoizedState:_t.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ih:Qu),e}function wi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return to(e);if(e.$$typeof===T)return Kt(e)}throw Error(i(438,String(e)))}function Ou(e){var t=null,a=Le.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=Le.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Si(),Le.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=K;return t.index++,a}function wa(e,t){return typeof t=="function"?t(e):t}function ki(e){var t=Tt();return Ru(t,ot,e)}function Ru(e,t,a){var l=e.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=a;var c=e.baseQueue,u=l.pending;if(u!==null){if(c!==null){var g=c.next;c.next=u.next,u.next=g}t.baseQueue=c=u,l.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var N=g=null,z=null,V=t,ee=!1;do{var se=V.lane&-536870913;if(se!==V.lane?(Ke&se)===se:(Sa&se)===se){var X=V.revertLane;if(X===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),se===qr&&(ee=!0);else if((Sa&X)===X){V=V.next,X===qr&&(ee=!0);continue}else se={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(N=z=se,g=u):z=z.next=se,Le.lanes|=X,os|=X;se=V.action,tr&&a(u,se),u=V.hasEagerState?V.eagerState:a(u,se)}else X={lane:se,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},z===null?(N=z=X,g=u):z=z.next=X,Le.lanes|=se,os|=se;V=V.next}while(V!==null&&V!==t);if(z===null?g=u:z.next=N,!Sn(u,e.memoizedState)&&(Ot=!0,ee&&(a=Br,a!==null)))throw a;e.memoizedState=u,e.baseState=g,e.baseQueue=z,l.lastRenderedState=u}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Du(e){var t=Tt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var l=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var g=c=c.next;do u=e(u,g.action),g=g.next;while(g!==c);Sn(u,t.memoizedState)||(Ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,l]}function ph(e,t,a){var l=Le,c=Tt(),u=Xe;if(u){if(a===void 0)throw Error(i(407));a=a()}else a=t();var g=!Sn((ot||c).memoizedState,a);if(g&&(c.memoizedState=a,Ot=!0),c=c.queue,Lu(vh.bind(null,l,c,e),[e]),c.getSnapshot!==t||g||_t!==null&&_t.memoizedState.tag&1){if(l.flags|=2048,Xr(9,{destroy:void 0},gh.bind(null,l,c,a,t),null),ft===null)throw Error(i(349));u||(Sa&127)!==0||xh(l,t,a)}return a}function xh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Le.updateQueue,t===null?(t=Si(),Le.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function gh(e,t,a,l){t.value=a,t.getSnapshot=l,bh(t)&&yh(e)}function vh(e,t,a){return a(function(){bh(t)&&yh(e)})}function bh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Sn(e,a)}catch{return!0}}function yh(e){var t=Vs(e,2);t!==null&&hn(t,e,2)}function zu(e){var t=tn();if(typeof e=="function"){var a=e;if(e=a(),tr){jt(!0);try{a()}finally{jt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:e},t}function jh(e,t,a,l){return e.baseState=a,Ru(e,ot,typeof l=="function"?l:wa)}function Mb(e,t,a,l,c){if(Ti(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){u.listeners.push(g)}};M.T!==null?a(!0):u.isTransition=!1,l(u),a=t.pending,a===null?(u.next=t.pending=u,Nh(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Nh(e,t){var a=t.action,l=t.payload,c=e.state;if(t.isTransition){var u=M.T,g={};M.T=g;try{var N=a(c,l),z=M.S;z!==null&&z(g,N),Sh(e,t,N)}catch(V){Uu(e,t,V)}finally{u!==null&&g.types!==null&&(u.types=g.types),M.T=u}}else try{u=a(c,l),Sh(e,t,u)}catch(V){Uu(e,t,V)}}function Sh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){wh(e,t,l)},function(l){return Uu(e,t,l)}):wh(e,t,a)}function wh(e,t,a){t.status="fulfilled",t.value=a,kh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Nh(e,a)))}function Uu(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,kh(t),t=t.next;while(t!==l)}e.action=null}function kh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ch(e,t){return t}function Eh(e,t){if(Xe){var a=ft.formState;if(a!==null){e:{var l=Le;if(Xe){if(xt){t:{for(var c=xt,u=$n;c.nodeType!==8;){if(!u){c=null;break t}if(c=qn(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){xt=qn(c.nextSibling),l=c.data==="F!";break e}}Wa(l)}l=!1}l&&(t=a[0])}}return a=tn(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ch,lastRenderedState:t},a.queue=l,a=Vh.bind(null,Le,l),l.dispatch=a,l=zu(!1),u=Gu.bind(null,Le,!1,l.queue),l=tn(),c={state:t,dispatch:null,action:e,pending:null},l.queue=c,a=Mb.bind(null,Le,c,u,a),c.dispatch=a,l.memoizedState=e,[t,a,!1]}function Th(e){var t=Tt();return Mh(t,ot,e)}function Mh(e,t,a){if(t=Ru(e,t,Ch)[0],e=ki(wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=to(t)}catch(g){throw g===Gr?pi:g}else l=t;t=Tt();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Le.flags|=2048,Xr(9,{destroy:void 0},Ab.bind(null,c,a),null)),[l,u,e]}function Ab(e,t){e.action=t}function Ah(e){var t=Tt(),a=ot;if(a!==null)return Mh(t,a,e);Tt(),t=t.memoizedState,a=Tt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Xr(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=Le.updateQueue,t===null&&(t=Si(),Le.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function _h(){return Tt().memoizedState}function Ci(e,t,a,l){var c=tn();Le.flags|=e,c.memoizedState=Xr(1|t,{destroy:void 0},a,l===void 0?null:l)}function Ei(e,t,a,l){var c=Tt();l=l===void 0?null:l;var u=c.memoizedState.inst;ot!==null&&l!==null&&Eu(l,ot.memoizedState.deps)?c.memoizedState=Xr(t,u,a,l):(Le.flags|=e,c.memoizedState=Xr(1|t,u,a,l))}function Oh(e,t){Ci(8390656,8,e,t)}function Lu(e,t){Ei(2048,8,e,t)}function _b(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=Si(),Le.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Rh(e){var t=Tt().memoizedState;return _b({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Dh(e,t){return Ei(4,2,e,t)}function zh(e,t){return Ei(4,4,e,t)}function Uh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Lh(e,t,a){a=a!=null?a.concat([e]):null,Ei(4,4,Uh.bind(null,t,e),a)}function $u(){}function $h(e,t){var a=Tt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Eu(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Hh(e,t){var a=Tt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Eu(t,l[1]))return l[0];if(l=e(),tr){jt(!0);try{e()}finally{jt(!1)}}return a.memoizedState=[l,t],l}function Hu(e,t,a){return a===void 0||(Sa&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=qp(),Le.lanes|=e,os|=e,a)}function qh(e,t,a,l){return Sn(a,t)?a:Yr.current!==null?(e=Hu(e,a,l),Sn(e,t)||(Ot=!0),e):(Sa&42)===0||(Sa&1073741824)!==0&&(Ke&261930)===0?(Ot=!0,e.memoizedState=a):(e=qp(),Le.lanes|=e,os|=e,t)}function Bh(e,t,a,l,c){var u=R.p;R.p=u!==0&&8>u?u:8;var g=M.T,N={};M.T=N,Gu(e,!1,t,a);try{var z=c(),V=M.S;if(V!==null&&V(N,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ee=Cb(z,l);no(e,t,ee,Mn(e))}else no(e,t,l,Mn(e))}catch(se){no(e,t,{then:function(){},status:"rejected",reason:se},Mn())}finally{R.p=u,g!==null&&N.types!==null&&(g.types=N.types),M.T=g}}function Ob(){}function qu(e,t,a,l){if(e.tag!==5)throw Error(i(476));var c=Gh(e).queue;Bh(e,c,t,ne,a===null?Ob:function(){return Qh(e),a(l)})}function Gh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qh(e){var t=Gh(e);t.next===null&&(t=e.alternate.memoizedState),no(e,t.next.queue,{},Mn())}function Bu(){return Kt(yo)}function Yh(){return Tt().memoizedState}function Kh(){return Tt().memoizedState}function Rb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Mn();e=ts(a);var l=ns(t,e,a);l!==null&&(hn(l,t,a),Jl(l,t,a)),t={cache:xu()},e.payload=t;return}t=t.return}}function Db(e,t,a){var l=Mn();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ti(e)?Xh(t,a):(a=ru(e,t,a,l),a!==null&&(hn(a,e,l),Fh(a,t,l)))}function Vh(e,t,a){var l=Mn();no(e,t,a,l)}function no(e,t,a,l){var c={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ti(e))Xh(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var g=t.lastRenderedState,N=u(g,a);if(c.hasEagerState=!0,c.eagerState=N,Sn(N,g))return ii(e,t,c,0),ft===null&&oi(),!1}catch{}finally{}if(a=ru(e,t,c,l),a!==null)return hn(a,e,l),Fh(a,t,l),!0}return!1}function Gu(e,t,a,l){if(l={lane:2,revertLane:yd(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ti(e)){if(t)throw Error(i(479))}else t=ru(e,a,l,2),t!==null&&hn(t,e,2)}function Ti(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Xh(e,t){Kr=ji=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Fh(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,ta(e,a)}}var ao={readContext:Kt,use:wi,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};ao.useEffectEvent=St;var Ih={readContext:Kt,use:wi,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:Oh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ci(4194308,4,Uh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ci(4194308,4,e,t)},useInsertionEffect:function(e,t){Ci(4,2,e,t)},useMemo:function(e,t){var a=tn();t=t===void 0?null:t;var l=e();if(tr){jt(!0);try{e()}finally{jt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=tn();if(a!==void 0){var c=a(t);if(tr){jt(!0);try{a(t)}finally{jt(!1)}}}else c=t;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=Db.bind(null,Le,e),[l.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:function(e){e=zu(e);var t=e.queue,a=Vh.bind(null,Le,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:$u,useDeferredValue:function(e,t){var a=tn();return Hu(a,e,t)},useTransition:function(){var e=zu(!1);return e=Bh.bind(null,Le,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Le,c=tn();if(Xe){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),ft===null)throw Error(i(349));(Ke&127)!==0||xh(l,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,Oh(vh.bind(null,l,u,e),[e]),l.flags|=2048,Xr(9,{destroy:void 0},gh.bind(null,l,u,a,t),null),a},useId:function(){var e=tn(),t=ft.identifierPrefix;if(Xe){var a=aa,l=na;a=(l&~(1<<32-zt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Ni++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Eb++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bu,useFormState:Eh,useActionState:Eh,useOptimistic:function(e){var t=tn();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Gu.bind(null,Le,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ou,useCacheRefresh:function(){return tn().memoizedState=Rb.bind(null,Le)},useEffectEvent:function(e){var t=tn(),a={impl:e};return t.memoizedState=a,function(){if((et&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Qu={readContext:Kt,use:wi,useCallback:$h,useContext:Kt,useEffect:Lu,useImperativeHandle:Lh,useInsertionEffect:Dh,useLayoutEffect:zh,useMemo:Hh,useReducer:ki,useRef:_h,useState:function(){return ki(wa)},useDebugValue:$u,useDeferredValue:function(e,t){var a=Tt();return qh(a,ot.memoizedState,e,t)},useTransition:function(){var e=ki(wa)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:to(e),t]},useSyncExternalStore:ph,useId:Yh,useHostTransitionStatus:Bu,useFormState:Th,useActionState:Th,useOptimistic:function(e,t){var a=Tt();return jh(a,ot,e,t)},useMemoCache:Ou,useCacheRefresh:Kh};Qu.useEffectEvent=Rh;var Zh={readContext:Kt,use:wi,useCallback:$h,useContext:Kt,useEffect:Lu,useImperativeHandle:Lh,useInsertionEffect:Dh,useLayoutEffect:zh,useMemo:Hh,useReducer:Du,useRef:_h,useState:function(){return Du(wa)},useDebugValue:$u,useDeferredValue:function(e,t){var a=Tt();return ot===null?Hu(a,e,t):qh(a,ot.memoizedState,e,t)},useTransition:function(){var e=Du(wa)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:to(e),t]},useSyncExternalStore:ph,useId:Yh,useHostTransitionStatus:Bu,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var a=Tt();return ot!==null?jh(a,ot,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ou,useCacheRefresh:Kh};Zh.useEffectEvent=Rh;function Yu(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ku={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Mn(),c=ts(l);c.payload=t,a!=null&&(c.callback=a),t=ns(e,c,l),t!==null&&(hn(t,e,l),Jl(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Mn(),c=ts(l);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=ns(e,c,l),t!==null&&(hn(t,e,l),Jl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Mn(),l=ts(a);l.tag=2,t!=null&&(l.callback=t),t=ns(e,l,a),t!==null&&(hn(t,e,a),Jl(t,e,a))}};function Jh(e,t,a,l,c,u,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,g):t.prototype&&t.prototype.isPureReactComponent?!Ql(a,l)||!Ql(c,u):!0}function Wh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Ku.enqueueReplaceState(t,t.state,null)}function nr(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var c in e)a[c]===void 0&&(a[c]=e[c])}return a}function Ph(e){li(e)}function ep(e){console.error(e)}function tp(e){li(e)}function Mi(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function np(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Vu(e,t,a){return a=ts(a),a.tag=3,a.payload={element:null},a.callback=function(){Mi(e,t)},a}function ap(e){return e=ts(e),e.tag=3,e}function sp(e,t,a,l){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=l.value;e.payload=function(){return c(u)},e.callback=function(){np(t,a,l)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){np(t,a,l),typeof c!="function"&&(is===null?is=new Set([this]):is.add(this));var N=l.stack;this.componentDidCatch(l.value,{componentStack:N!==null?N:""})})}function zb(e,t,a,l,c){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Hr(t,a,c,!0),a=kn.current,a!==null){switch(a.tag){case 31:case 13:return Hn===null?Bi():a.alternate===null&&wt===0&&(wt=3),a.flags&=-257,a.flags|=65536,a.lanes=c,l===xi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),gd(e,l,c)),!1;case 22:return a.flags|=65536,l===xi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),gd(e,l,c)),!1}throw Error(i(435,a.tag))}return gd(e,l,c),Bi(),!1}if(Xe)return t=kn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,l!==du&&(e=Error(i(422),{cause:l}),Vl(zn(e,a)))):(l!==du&&(t=Error(i(423),{cause:l}),Vl(zn(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=zn(l,a),c=Vu(e.stateNode,l,c),Nu(e,c),wt!==4&&(wt=2)),!1;var u=Error(i(520),{cause:l});if(u=zn(u,a),fo===null?fo=[u]:fo.push(u),wt!==4&&(wt=2),t===null)return!0;l=zn(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Vu(a.stateNode,l,e),Nu(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(is===null||!is.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=ap(c),sp(c,e,a,l),Nu(a,c),!1}a=a.return}while(a!==null);return!1}var Xu=Error(i(461)),Ot=!1;function Vt(e,t,a,l){t.child=e===null?ih(t,null,a,l):er(t,e.child,a,l)}function rp(e,t,a,l,c){a=a.render;var u=t.ref;if("ref"in l){var g={};for(var N in l)N!=="ref"&&(g[N]=l[N])}else g=l;return Zs(t),l=Tu(e,t,a,g,u,c),N=Mu(),e!==null&&!Ot?(Au(e,t,c),ka(e,t,c)):(Xe&&N&&cu(t),t.flags|=1,Vt(e,t,l,c),t.child)}function lp(e,t,a,l,c){if(e===null){var u=a.type;return typeof u=="function"&&!lu(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,op(e,t,u,l,c)):(e=ui(a.type,null,l,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!td(e,c)){var g=u.memoizedProps;if(a=a.compare,a=a!==null?a:Ql,a(g,l)&&e.ref===t.ref)return ka(e,t,c)}return t.flags|=1,e=ba(u,l),e.ref=t.ref,e.return=t,t.child=e}function op(e,t,a,l,c){if(e!==null){var u=e.memoizedProps;if(Ql(u,l)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=l=u,td(e,c))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,ka(e,t,c)}return Fu(e,t,a,l,c)}function ip(e,t,a,l){var c=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|a:a,e!==null){for(l=t.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~u}else l=0,t.child=null;return cp(e,t,u,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&hi(t,u!==null?u.cachePool:null),u!==null?dh(t,u):wu(),fh(t);else return l=t.lanes=536870912,cp(e,t,u!==null?u.baseLanes|a:a,a,l)}else u!==null?(hi(t,u.cachePool),dh(t,u),ss(),t.memoizedState=null):(e!==null&&hi(t,null),wu(),ss());return Vt(e,t,c,a),t.child}function so(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cp(e,t,a,l,c){var u=vu();return u=u===null?null:{parent:At._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&hi(t,null),wu(),fh(t),e!==null&&Hr(e,t,l,!0),t.childLanes=c,null}function Ai(e,t){return t=Oi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function up(e,t,a){return er(t,e.child,null,a),e=Ai(t,t.pendingProps),e.flags|=2,Cn(t),t.memoizedState=null,e}function Ub(e,t,a){var l=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(l.mode==="hidden")return e=Ai(t,l),t.lanes=536870912,so(null,e);if(Cu(t),(e=xt)?(e=Nx(e,$n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:na,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},a=Xm(e),a.return=t,t.child=a,Yt=t,xt=null)):e=null,e===null)throw Wa(t);return t.lanes=536870912,null}return Ai(t,l)}var u=e.memoizedState;if(u!==null){var g=u.dehydrated;if(Cu(t),c)if(t.flags&256)t.flags&=-257,t=up(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Ot||Hr(e,t,a,!1),c=(a&e.childLanes)!==0,Ot||c){if(l=ft,l!==null&&(g=Nr(l,a),g!==0&&g!==u.retryLane))throw u.retryLane=g,Vs(e,g),hn(l,e,g),Xu;Bi(),t=up(e,t,a)}else e=u.treeContext,xt=qn(g.nextSibling),Yt=t,Xe=!0,Ja=null,$n=!1,e!==null&&Zm(t,e),t=Ai(t,l),t.flags|=4096;return t}return e=ba(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _i(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Fu(e,t,a,l,c){return Zs(t),a=Tu(e,t,a,l,void 0,c),l=Mu(),e!==null&&!Ot?(Au(e,t,c),ka(e,t,c)):(Xe&&l&&cu(t),t.flags|=1,Vt(e,t,a,c),t.child)}function dp(e,t,a,l,c,u){return Zs(t),t.updateQueue=null,a=hh(t,l,a,c),mh(e),l=Mu(),e!==null&&!Ot?(Au(e,t,u),ka(e,t,u)):(Xe&&l&&cu(t),t.flags|=1,Vt(e,t,a,u),t.child)}function fp(e,t,a,l,c){if(Zs(t),t.stateNode===null){var u=zr,g=a.contextType;typeof g=="object"&&g!==null&&(u=Kt(g)),u=new a(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Ku,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},yu(t),g=a.contextType,u.context=typeof g=="object"&&g!==null?Kt(g):zr,u.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(Yu(t,a,g,l),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(g=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),g!==u.state&&Ku.enqueueReplaceState(u,u.state,null),Pl(t,l,u,c),Wl(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var N=t.memoizedProps,z=nr(a,N);u.props=z;var V=u.context,ee=a.contextType;g=zr,typeof ee=="object"&&ee!==null&&(g=Kt(ee));var se=a.getDerivedStateFromProps;ee=typeof se=="function"||typeof u.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ee||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(N||V!==g)&&Wh(t,u,l,g),es=!1;var X=t.memoizedState;u.state=X,Pl(t,l,u,c),Wl(),V=t.memoizedState,N||X!==V||es?(typeof se=="function"&&(Yu(t,a,se,l),V=t.memoizedState),(z=es||Jh(t,a,z,l,X,V,g))?(ee||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=V),u.props=l,u.state=V,u.context=g,l=z):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,ju(e,t),g=t.memoizedProps,ee=nr(a,g),u.props=ee,se=t.pendingProps,X=u.context,V=a.contextType,z=zr,typeof V=="object"&&V!==null&&(z=Kt(V)),N=a.getDerivedStateFromProps,(V=typeof N=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g!==se||X!==z)&&Wh(t,u,l,z),es=!1,X=t.memoizedState,u.state=X,Pl(t,l,u,c),Wl();var J=t.memoizedState;g!==se||X!==J||es||e!==null&&e.dependencies!==null&&fi(e.dependencies)?(typeof N=="function"&&(Yu(t,a,N,l),J=t.memoizedState),(ee=es||Jh(t,a,ee,l,X,J,z)||e!==null&&e.dependencies!==null&&fi(e.dependencies))?(V||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,J,z),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,J,z)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=J),u.props=l,u.state=J,u.context=z,l=ee):(typeof u.componentDidUpdate!="function"||g===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,_i(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=er(t,e.child,null,c),t.child=er(t,null,a,c)):Vt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=ka(e,t,c),e}function mp(e,t,a,l){return Fs(),t.flags|=256,Vt(e,t,a,l),t.child}var Iu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zu(e){return{baseLanes:e,cachePool:nh()}}function Ju(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Tn),e}function hp(e,t,a){var l=t.pendingProps,c=!1,u=(t.flags&128)!==0,g;if((g=u)||(g=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),g&&(c=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(c?as(t):ss(),(e=xt)?(e=Nx(e,$n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:na,overflow:aa}:null,retryLane:536870912,hydrationErrors:null},a=Xm(e),a.return=t,t.child=a,Yt=t,xt=null)):e=null,e===null)throw Wa(t);return Rd(e)?t.lanes=32:t.lanes=536870912,null}var N=l.children;return l=l.fallback,c?(ss(),c=t.mode,N=Oi({mode:"hidden",children:N},c),l=Xs(l,c,a,null),N.return=t,l.return=t,N.sibling=l,t.child=N,l=t.child,l.memoizedState=Zu(a),l.childLanes=Ju(e,g,a),t.memoizedState=Iu,so(null,l)):(as(t),Wu(t,N))}var z=e.memoizedState;if(z!==null&&(N=z.dehydrated,N!==null)){if(u)t.flags&256?(as(t),t.flags&=-257,t=Pu(e,t,a)):t.memoizedState!==null?(ss(),t.child=e.child,t.flags|=128,t=null):(ss(),N=l.fallback,c=t.mode,l=Oi({mode:"visible",children:l.children},c),N=Xs(N,c,a,null),N.flags|=2,l.return=t,N.return=t,l.sibling=N,t.child=l,er(t,e.child,null,a),l=t.child,l.memoizedState=Zu(a),l.childLanes=Ju(e,g,a),t.memoizedState=Iu,t=so(null,l));else if(as(t),Rd(N)){if(g=N.nextSibling&&N.nextSibling.dataset,g)var V=g.dgst;g=V,l=Error(i(419)),l.stack="",l.digest=g,Vl({value:l,source:null,stack:null}),t=Pu(e,t,a)}else if(Ot||Hr(e,t,a,!1),g=(a&e.childLanes)!==0,Ot||g){if(g=ft,g!==null&&(l=Nr(g,a),l!==0&&l!==z.retryLane))throw z.retryLane=l,Vs(e,l),hn(g,e,l),Xu;Od(N)||Bi(),t=Pu(e,t,a)}else Od(N)?(t.flags|=192,t.child=e.child,t=null):(e=z.treeContext,xt=qn(N.nextSibling),Yt=t,Xe=!0,Ja=null,$n=!1,e!==null&&Zm(t,e),t=Wu(t,l.children),t.flags|=4096);return t}return c?(ss(),N=l.fallback,c=t.mode,z=e.child,V=z.sibling,l=ba(z,{mode:"hidden",children:l.children}),l.subtreeFlags=z.subtreeFlags&65011712,V!==null?N=ba(V,N):(N=Xs(N,c,a,null),N.flags|=2),N.return=t,l.return=t,l.sibling=N,t.child=l,so(null,l),l=t.child,N=e.child.memoizedState,N===null?N=Zu(a):(c=N.cachePool,c!==null?(z=At._currentValue,c=c.parent!==z?{parent:z,pool:z}:c):c=nh(),N={baseLanes:N.baseLanes|a,cachePool:c}),l.memoizedState=N,l.childLanes=Ju(e,g,a),t.memoizedState=Iu,so(e.child,l)):(as(t),a=e.child,e=a.sibling,a=ba(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function Wu(e,t){return t=Oi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Oi(e,t){return e=wn(22,e,null,t),e.lanes=0,e}function Pu(e,t,a){return er(t,e.child,null,a),e=Wu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pp(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),hu(e.return,t,a)}function ed(e,t,a,l,c,u){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:c,treeForkCount:u}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=a,g.tailMode=c,g.treeForkCount=u)}function xp(e,t,a){var l=t.pendingProps,c=l.revealOrder,u=l.tail;l=l.children;var g=Et.current,N=(g&2)!==0;if(N?(g=g&1|2,t.flags|=128):g&=1,P(Et,g),Vt(e,t,l,a),l=Xe?Kl:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&pp(e,a,t);else if(e.tag===19)pp(e,a,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(c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&yi(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),ed(t,!1,c,a,u,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&yi(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}ed(t,!0,a,null,u,l);break;case"together":ed(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ka(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),os|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Hr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=ba(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ba(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function td(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fi(e)))}function Lb(e,t,a){switch(t.tag){case 3:I(t,t.stateNode.containerInfo),Pa(t,At,e.memoizedState.cache),Fs();break;case 27:case 5:ce(t);break;case 4:I(t,t.stateNode.containerInfo);break;case 10:Pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cu(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(as(t),t.flags|=128,null):(a&t.child.childLanes)!==0?hp(e,t,a):(as(t),e=ka(e,t,a),e!==null?e.sibling:null);as(t);break;case 19:var c=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Hr(e,t,a,!1),l=(a&t.childLanes)!==0),c){if(l)return xp(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),P(Et,Et.current),l)break;return null;case 22:return t.lanes=0,ip(e,t,a,t.pendingProps);case 24:Pa(t,At,e.memoizedState.cache)}return ka(e,t,a)}function gp(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!td(e,a)&&(t.flags&128)===0)return Ot=!1,Lb(e,t,a);Ot=(e.flags&131072)!==0}else Ot=!1,Xe&&(t.flags&1048576)!==0&&Im(t,Kl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ws(t.elementType),t.type=e,typeof e=="function")lu(e)?(l=nr(e,l),t.tag=1,t=fp(null,t,e,l,a)):(t.tag=0,t=Fu(null,t,e,l,a));else{if(e!=null){var c=e.$$typeof;if(c===j){t.tag=11,t=rp(null,t,e,l,a);break e}else if(c===B){t.tag=14,t=lp(null,t,e,l,a);break e}}throw t=me(e)||e,Error(i(306,t,""))}}return t;case 0:return Fu(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,c=nr(l,t.pendingProps),fp(e,t,l,c,a);case 3:e:{if(I(t,t.stateNode.containerInfo),e===null)throw Error(i(387));l=t.pendingProps;var u=t.memoizedState;c=u.element,ju(e,t),Pl(t,l,null,a);var g=t.memoizedState;if(l=g.cache,Pa(t,At,l),l!==u.cache&&pu(t,[At],a,!0),Wl(),l=g.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=mp(e,t,l,a);break e}else if(l!==c){c=zn(Error(i(424)),t),Vl(c),t=mp(e,t,l,a);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(xt=qn(e.firstChild),Yt=t,Xe=!0,Ja=null,$n=!0,a=ih(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Fs(),l===c){t=ka(e,t,a);break e}Vt(e,t,l,a)}t=t.child}return t;case 26:return _i(e,t),e===null?(a=Tx(t.type,null,t.pendingProps,null))?t.memoizedState=a:Xe||(a=t.type,e=t.pendingProps,l=Fi(ie.current).createElement(a),l[Nt]=t,l[Jt]=e,Xt(l,a,e),ye(l),t.stateNode=l):t.memoizedState=Tx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&Xe&&(l=t.stateNode=kx(t.type,t.pendingProps,ie.current),Yt=t,$n=!0,c=xt,fs(t.type)?(Dd=c,xt=qn(l.firstChild)):xt=c),Vt(e,t,t.pendingProps.children,a),_i(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((c=l=xt)&&(l=my(l,t.type,t.pendingProps,$n),l!==null?(t.stateNode=l,Yt=t,xt=qn(l.firstChild),$n=!1,c=!0):c=!1),c||Wa(t)),ce(t),c=t.type,u=t.pendingProps,g=e!==null?e.memoizedProps:null,l=u.children,Md(c,u)?l=null:g!==null&&Md(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Tu(e,t,Tb,null,null,a),yo._currentValue=c),_i(e,t),Vt(e,t,l,a),t.child;case 6:return e===null&&Xe&&((e=a=xt)&&(a=hy(a,t.pendingProps,$n),a!==null?(t.stateNode=a,Yt=t,xt=null,e=!0):e=!1),e||Wa(t)),null;case 13:return hp(e,t,a);case 4:return I(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=er(t,null,l,a):Vt(e,t,l,a),t.child;case 11:return rp(e,t,t.type,t.pendingProps,a);case 7:return Vt(e,t,t.pendingProps,a),t.child;case 8:return Vt(e,t,t.pendingProps.children,a),t.child;case 12:return Vt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,Pa(t,t.type,l.value),Vt(e,t,l.children,a),t.child;case 9:return c=t.type._context,l=t.pendingProps.children,Zs(t),c=Kt(c),l=l(c),t.flags|=1,Vt(e,t,l,a),t.child;case 14:return lp(e,t,t.type,t.pendingProps,a);case 15:return op(e,t,t.type,t.pendingProps,a);case 19:return xp(e,t,a);case 31:return Ub(e,t,a);case 22:return ip(e,t,a,t.pendingProps);case 24:return Zs(t),l=Kt(At),e===null?(c=vu(),c===null&&(c=ft,u=xu(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:l,cache:c},yu(t),Pa(t,At,c)):((e.lanes&a)!==0&&(ju(e,t),Pl(t,null,null,a),Wl()),c=e.memoizedState,u=t.memoizedState,c.parent!==l?(c={parent:l,cache:l},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Pa(t,At,l)):(l=u.cache,Pa(t,At,l),l!==c.cache&&pu(t,[At],a,!0))),Vt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ca(e){e.flags|=4}function nd(e,t,a,l,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Yp())e.flags|=8192;else throw Ps=xi,bu}else e.flags&=-16777217}function vp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rx(t))if(Yp())e.flags|=8192;else throw Ps=xi,bu}function Ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fo():536870912,e.lanes|=t,Jr|=t)}function ro(e,t){if(!Xe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function $b(e,t,a){var l=t.pendingProps;switch(uu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Na(At),oe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&($r(t)?Ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,fu())),gt(t),null;case 26:var c=t.type,u=t.memoizedState;return e===null?(Ca(t),u!==null?(gt(t),vp(t,u)):(gt(t),nd(t,c,null,l,a))):u?u!==e.memoizedState?(Ca(t),gt(t),vp(t,u)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Ca(t),gt(t),nd(t,c,e,l,a)),null;case 27:if(ve(t),a=ie.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ca(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return gt(t),null}e=le.current,$r(t)?Jm(t):(e=kx(c,l,a),t.stateNode=e,Ca(t))}return gt(t),null;case 5:if(ve(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Ca(t);else{if(!l){if(t.stateNode===null)throw Error(i(166));return gt(t),null}if(u=le.current,$r(t))Jm(t);else{var g=Fi(ie.current);switch(u){case 1:u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":u=g.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":u=g.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":u=g.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?g.createElement("select",{is:l.is}):g.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?g.createElement(c,{is:l.is}):g.createElement(c)}}u[Nt]=t,u[Jt]=l;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)u.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=u;e:switch(Xt(u,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ca(t)}}return gt(t),nd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ca(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(e=ie.current,$r(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,c=Yt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||hx(e.nodeValue,a)),e||Wa(t,!0)}else e=Fi(e).createTextNode(l),e[Nt]=t,t.stateNode=e}return gt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=$r(t),a!==null){if(e===null){if(!l)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Nt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else a=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Cn(t),t):(Cn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return gt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=$r(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Nt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),c=!1}else c=fu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Cn(t),t):(Cn(t),null)}return Cn(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==c&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ri(t,t.updateQueue),gt(t),null);case 4:return oe(),e===null&&wd(t.stateNode.containerInfo),gt(t),null;case 10:return Na(t.type),gt(t),null;case 19:if(G(Et),l=t.memoizedState,l===null)return gt(t),null;if(c=(t.flags&128)!==0,u=l.rendering,u===null)if(c)ro(l,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=yi(e),u!==null){for(t.flags|=128,ro(l,!1),e=u.updateQueue,t.updateQueue=e,Ri(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Vm(a,e),a=a.sibling;return P(Et,Et.current&1|2),Xe&&ya(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&$e()>$i&&(t.flags|=128,c=!0,ro(l,!1),t.lanes=4194304)}else{if(!c)if(e=yi(u),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ri(t,e),ro(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!Xe)return gt(t),null}else 2*$e()-l.renderingStartTime>$i&&a!==536870912&&(t.flags|=128,c=!0,ro(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$e(),e.sibling=null,a=Et.current,P(Et,c?a&1|2:a&1),Xe&&ya(t,l.treeForkCount),e):(gt(t),null);case 22:case 23:return Cn(t),ku(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),a=t.updateQueue,a!==null&&Ri(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&G(Js),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Na(At),gt(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hb(e,t){switch(uu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Na(At),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(Cn(t),t.alternate===null)throw Error(i(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Cn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Et),null;case 4:return oe(),null;case 10:return Na(t.type),null;case 22:case 23:return Cn(t),ku(),e!==null&&G(Js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Na(At),null;case 25:return null;default:return null}}function bp(e,t){switch(uu(t),t.tag){case 3:Na(At),oe();break;case 26:case 27:case 5:ve(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&Cn(t);break;case 13:Cn(t);break;case 19:G(Et);break;case 10:Na(t.type);break;case 22:case 23:Cn(t),ku(),e!==null&&G(Js);break;case 24:Na(At)}}function lo(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var c=l.next;a=c;do{if((a.tag&e)===e){l=void 0;var u=a.create,g=a.inst;l=u(),g.destroy=l}a=a.next}while(a!==c)}}catch(N){rt(t,t.return,N)}}function rs(e,t,a){try{var l=t.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var u=c.next;l=u;do{if((l.tag&e)===e){var g=l.inst,N=g.destroy;if(N!==void 0){g.destroy=void 0,c=t;var z=a,V=N;try{V()}catch(ee){rt(c,z,ee)}}}l=l.next}while(l!==u)}}catch(ee){rt(t,t.return,ee)}}function yp(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{uh(t,a)}catch(l){rt(e,e.return,l)}}}function jp(e,t,a){a.props=nr(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){rt(e,t,l)}}function oo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(c){rt(e,t,c)}}function sa(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(c){rt(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){rt(e,t,c)}else a.current=null}function Np(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(c){rt(e,e.return,c)}}function ad(e,t,a){try{var l=e.stateNode;oy(l,e.type,a,t),l[Jt]=t}catch(c){rt(e,e.return,c)}}function Sp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fs(e.type)||e.tag===4}function sd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sp(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&&fs(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 rd(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ga));else if(l!==4&&(l===27&&fs(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(rd(e,t,a),e=e.sibling;e!==null;)rd(e,t,a),e=e.sibling}function Di(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&fs(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Di(e,t,a),e=e.sibling;e!==null;)Di(e,t,a),e=e.sibling}function wp(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Xt(t,l,a),t[Nt]=e,t[Jt]=a}catch(u){rt(e,e.return,u)}}var Ea=!1,Rt=!1,ld=!1,kp=typeof WeakSet=="function"?WeakSet:Set,qt=null;function qb(e,t){if(e=e.containerInfo,Ed=tc,e=Lm(e),Pc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var c=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var g=0,N=-1,z=-1,V=0,ee=0,se=e,X=null;t:for(;;){for(var J;se!==a||c!==0&&se.nodeType!==3||(N=g+c),se!==u||l!==0&&se.nodeType!==3||(z=g+l),se.nodeType===3&&(g+=se.nodeValue.length),(J=se.firstChild)!==null;)X=se,se=J;for(;;){if(se===e)break t;if(X===a&&++V===c&&(N=g),X===u&&++ee===l&&(z=g),(J=se.nextSibling)!==null)break;se=X,X=se.parentNode}se=J}a=N===-1||z===-1?null:{start:N,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(Td={focusedElem:e,selectionRange:a},tc=!1,qt=t;qt!==null;)if(t=qt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,qt=e;else for(;qt!==null;){switch(t=qt,u=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(a=0;a<e.length;a++)c=e[a],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,c=u.memoizedProps,u=u.memoizedState,l=a.stateNode;try{var Se=nr(a.type,c);e=l.getSnapshotBeforeUpdate(Se,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ae){rt(a,a.return,Ae)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)_d(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_d(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,qt=e;break}qt=t.return}}function Cp(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ma(e,a),l&4&&lo(5,a);break;case 1:if(Ma(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){rt(a,a.return,g)}else{var c=nr(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){rt(a,a.return,g)}}l&64&&yp(a),l&512&&oo(a,a.return);break;case 3:if(Ma(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{uh(e,t)}catch(g){rt(a,a.return,g)}}break;case 27:t===null&&l&4&&wp(a);case 26:case 5:Ma(e,a),t===null&&l&4&&Np(a),l&512&&oo(a,a.return);break;case 12:Ma(e,a);break;case 31:Ma(e,a),l&4&&Mp(e,a);break;case 13:Ma(e,a),l&4&&Ap(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ib.bind(null,a),py(e,a))));break;case 22:if(l=a.memoizedState!==null||Ea,!l){t=t!==null&&t.memoizedState!==null||Rt,c=Ea;var u=Rt;Ea=l,(Rt=t)&&!u?Aa(e,a,(a.subtreeFlags&8772)!==0):Ma(e,a),Ea=c,Rt=u}break;case 30:break;default:Ma(e,a)}}function Ep(e){var t=e.alternate;t!==null&&(e.alternate=null,Ep(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 bt=null,un=!1;function Ta(e,t,a){for(a=a.child;a!==null;)Tp(e,t,a),a=a.sibling}function Tp(e,t,a){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(yn,a)}catch{}switch(a.tag){case 26:Rt||sa(a,t),Ta(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||sa(a,t);var l=bt,c=un;fs(a.type)&&(bt=a.stateNode,un=!1),Ta(e,t,a),go(a.stateNode),bt=l,un=c;break;case 5:Rt||sa(a,t);case 6:if(l=bt,c=un,bt=null,Ta(e,t,a),bt=l,un=c,bt!==null)if(un)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(a.stateNode)}catch(u){rt(a,t,u)}else try{bt.removeChild(a.stateNode)}catch(u){rt(a,t,u)}break;case 18:bt!==null&&(un?(e=bt,yx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),rl(e)):yx(bt,a.stateNode));break;case 4:l=bt,c=un,bt=a.stateNode.containerInfo,un=!0,Ta(e,t,a),bt=l,un=c;break;case 0:case 11:case 14:case 15:rs(2,a,t),Rt||rs(4,a,t),Ta(e,t,a);break;case 1:Rt||(sa(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&jp(a,t,l)),Ta(e,t,a);break;case 21:Ta(e,t,a);break;case 22:Rt=(l=Rt)||a.memoizedState!==null,Ta(e,t,a),Rt=l;break;default:Ta(e,t,a)}}function Mp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{rl(e)}catch(a){rt(t,t.return,a)}}}function Ap(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{rl(e)}catch(a){rt(t,t.return,a)}}function Bb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new kp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new kp),t;default:throw Error(i(435,e.tag))}}function zi(e,t){var a=Bb(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var c=Zb.bind(null,e,l);l.then(c,c)}})}function dn(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var c=a[l],u=e,g=t,N=g;e:for(;N!==null;){switch(N.tag){case 27:if(fs(N.type)){bt=N.stateNode,un=!1;break e}break;case 5:bt=N.stateNode,un=!1;break e;case 3:case 4:bt=N.stateNode.containerInfo,un=!0;break e}N=N.return}if(bt===null)throw Error(i(160));Tp(u,g,c),bt=null,un=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_p(t,e),t=t.sibling}var Fn=null;function _p(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dn(t,e),fn(e),l&4&&(rs(3,e,e.return),lo(3,e),rs(5,e,e.return));break;case 1:dn(t,e),fn(e),l&512&&(Rt||a===null||sa(a,a.return)),l&64&&Ea&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var c=Fn;if(dn(t,e),fn(e),l&512&&(Rt||a===null||sa(a,a.return)),l&4){var u=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":u=c.getElementsByTagName("title")[0],(!u||u[Fa]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(l),c.head.insertBefore(u,c.querySelector("head > title"))),Xt(u,l,a),u[Nt]=e,ye(u),l=u;break e;case"link":var g=_x("link","href",c).get(l+(a.href||""));if(g){for(var N=0;N<g.length;N++)if(u=g[N],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(N,1);break t}}u=c.createElement(l),Xt(u,l,a),c.head.appendChild(u);break;case"meta":if(g=_x("meta","content",c).get(l+(a.content||""))){for(N=0;N<g.length;N++)if(u=g[N],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(N,1);break t}}u=c.createElement(l),Xt(u,l,a),c.head.appendChild(u);break;default:throw Error(i(468,l))}u[Nt]=e,ye(u),l=u}e.stateNode=l}else Ox(c,e.type,e.stateNode);else e.stateNode=Ax(c,l,e.memoizedProps);else u!==l?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,l===null?Ox(c,e.type,e.stateNode):Ax(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ad(e,e.memoizedProps,a.memoizedProps)}break;case 27:dn(t,e),fn(e),l&512&&(Rt||a===null||sa(a,a.return)),a!==null&&l&4&&ad(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dn(t,e),fn(e),l&512&&(Rt||a===null||sa(a,a.return)),e.flags&32){c=e.stateNode;try{Tr(c,"")}catch(Se){rt(e,e.return,Se)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,ad(e,c,a!==null?a.memoizedProps:c)),l&1024&&(ld=!0);break;case 6:if(dn(t,e),fn(e),l&4){if(e.stateNode===null)throw Error(i(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(Se){rt(e,e.return,Se)}}break;case 3:if(Ji=null,c=Fn,Fn=Ii(t.containerInfo),dn(t,e),Fn=c,fn(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{rl(t.containerInfo)}catch(Se){rt(e,e.return,Se)}ld&&(ld=!1,Op(e));break;case 4:l=Fn,Fn=Ii(e.stateNode.containerInfo),dn(t,e),fn(e),Fn=l;break;case 12:dn(t,e),fn(e);break;case 31:dn(t,e),fn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 13:dn(t,e),fn(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Li=$e()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 22:c=e.memoizedState!==null;var z=a!==null&&a.memoizedState!==null,V=Ea,ee=Rt;if(Ea=V||c,Rt=ee||z,dn(t,e),Rt=ee,Ea=V,fn(e),l&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||z||Ea||Rt||ar(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){z=a=t;try{if(u=z.stateNode,c)g=u.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{N=z.stateNode;var se=z.memoizedProps.style,X=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Se){rt(z,z.return,Se)}}}else if(t.tag===6){if(a===null){z=t;try{z.stateNode.nodeValue=c?"":z.memoizedProps}catch(Se){rt(z,z.return,Se)}}}else if(t.tag===18){if(a===null){z=t;try{var J=z.stateNode;c?jx(J,!0):jx(z.stateNode,!1)}catch(Se){rt(z,z.return,Se)}}}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;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,zi(e,a))));break;case 19:dn(t,e),fn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zi(e,l)));break;case 30:break;case 21:break;default:dn(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Sp(l)){a=l;break}l=l.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,u=sd(e);Di(e,u,c);break;case 5:var g=a.stateNode;a.flags&32&&(Tr(g,""),a.flags&=-33);var N=sd(e);Di(e,N,g);break;case 3:case 4:var z=a.stateNode.containerInfo,V=sd(e);rd(e,V,z);break;default:throw Error(i(161))}}catch(ee){rt(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Op(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Op(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ma(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Cp(e,t.alternate,t),t=t.sibling}function ar(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:rs(4,t,t.return),ar(t);break;case 1:sa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&jp(t,t.return,a),ar(t);break;case 27:go(t.stateNode);case 26:case 5:sa(t,t.return),ar(t);break;case 22:t.memoizedState===null&&ar(t);break;case 30:ar(t);break;default:ar(t)}e=e.sibling}}function Aa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,c=e,u=t,g=u.flags;switch(u.tag){case 0:case 11:case 15:Aa(c,u,a),lo(4,u);break;case 1:if(Aa(c,u,a),l=u,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(V){rt(l,l.return,V)}if(l=u,c=l.updateQueue,c!==null){var N=l.stateNode;try{var z=c.shared.hiddenCallbacks;if(z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<z.length;c++)ch(z[c],N)}catch(V){rt(l,l.return,V)}}a&&g&64&&yp(u),oo(u,u.return);break;case 27:wp(u);case 26:case 5:Aa(c,u,a),a&&l===null&&g&4&&Np(u),oo(u,u.return);break;case 12:Aa(c,u,a);break;case 31:Aa(c,u,a),a&&g&4&&Mp(c,u);break;case 13:Aa(c,u,a),a&&g&4&&Ap(c,u);break;case 22:u.memoizedState===null&&Aa(c,u,a),oo(u,u.return);break;case 30:break;default:Aa(c,u,a)}t=t.sibling}}function od(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Xl(a))}function id(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xl(e))}function In(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rp(e,t,a,l),t=t.sibling}function Rp(e,t,a,l){var c=t.flags;switch(t.tag){case 0:case 11:case 15:In(e,t,a,l),c&2048&&lo(9,t);break;case 1:In(e,t,a,l);break;case 3:In(e,t,a,l),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xl(e)));break;case 12:if(c&2048){In(e,t,a,l),e=t.stateNode;try{var u=t.memoizedProps,g=u.id,N=u.onPostCommit;typeof N=="function"&&N(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(z){rt(t,t.return,z)}}else In(e,t,a,l);break;case 31:In(e,t,a,l);break;case 13:In(e,t,a,l);break;case 23:break;case 22:u=t.stateNode,g=t.alternate,t.memoizedState!==null?u._visibility&2?In(e,t,a,l):io(e,t):u._visibility&2?In(e,t,a,l):(u._visibility|=2,Fr(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),c&2048&&od(g,t);break;case 24:In(e,t,a,l),c&2048&&id(t.alternate,t);break;default:In(e,t,a,l)}}function Fr(e,t,a,l,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,g=t,N=a,z=l,V=g.flags;switch(g.tag){case 0:case 11:case 15:Fr(u,g,N,z,c),lo(8,g);break;case 23:break;case 22:var ee=g.stateNode;g.memoizedState!==null?ee._visibility&2?Fr(u,g,N,z,c):io(u,g):(ee._visibility|=2,Fr(u,g,N,z,c)),c&&V&2048&&od(g.alternate,g);break;case 24:Fr(u,g,N,z,c),c&&V&2048&&id(g.alternate,g);break;default:Fr(u,g,N,z,c)}t=t.sibling}}function io(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,c=l.flags;switch(l.tag){case 22:io(a,l),c&2048&&od(l.alternate,l);break;case 24:io(a,l),c&2048&&id(l.alternate,l);break;default:io(a,l)}t=t.sibling}}var co=8192;function Ir(e,t,a){if(e.subtreeFlags&co)for(e=e.child;e!==null;)Dp(e,t,a),e=e.sibling}function Dp(e,t,a){switch(e.tag){case 26:Ir(e,t,a),e.flags&co&&e.memoizedState!==null&&Ey(a,Fn,e.memoizedState,e.memoizedProps);break;case 5:Ir(e,t,a);break;case 3:case 4:var l=Fn;Fn=Ii(e.stateNode.containerInfo),Ir(e,t,a),Fn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=co,co=16777216,Ir(e,t,a),co=l):Ir(e,t,a));break;default:Ir(e,t,a)}}function zp(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 uo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];qt=l,Lp(l,e)}zp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Up(e),e=e.sibling}function Up(e){switch(e.tag){case 0:case 11:case 15:uo(e),e.flags&2048&&rs(9,e,e.return);break;case 3:uo(e);break;case 12:uo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ui(e)):uo(e);break;default:uo(e)}}function Ui(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];qt=l,Lp(l,e)}zp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rs(8,t,t.return),Ui(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ui(t));break;default:Ui(t)}e=e.sibling}}function Lp(e,t){for(;qt!==null;){var a=qt;switch(a.tag){case 0:case 11:case 15:rs(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Xl(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,qt=l;else e:for(a=e;qt!==null;){l=qt;var c=l.sibling,u=l.return;if(Ep(l),l===a){qt=null;break e}if(c!==null){c.return=u,qt=c;break e}qt=u}}}var Gb={getCacheForType:function(e){var t=Kt(At),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Kt(At).controller.signal}},Qb=typeof WeakMap=="function"?WeakMap:Map,et=0,ft=null,Qe=null,Ke=0,st=0,En=null,ls=!1,Zr=!1,cd=!1,_a=0,wt=0,os=0,sr=0,ud=0,Tn=0,Jr=0,fo=null,mn=null,dd=!1,Li=0,$p=0,$i=1/0,Hi=null,is=null,Ut=0,cs=null,Wr=null,Oa=0,fd=0,md=null,Hp=null,mo=0,hd=null;function Mn(){return(et&2)!==0&&Ke!==0?Ke&-Ke:M.T!==null?yd():Ls()}function qp(){if(Tn===0)if((Ke&536870912)===0||Xe){var e=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),Tn=e}else Tn=536870912;return e=kn.current,e!==null&&(e.flags|=32),Tn}function hn(e,t,a){(e===ft&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Pr(e,0),us(e,Ke,Tn,!1)),ea(e,a),((et&2)===0||e!==ft)&&(e===ft&&((et&2)===0&&(sr|=a),wt===4&&us(e,Ke,Tn,!1)),ra(e))}function Bp(e,t,a){if((et&6)!==0)throw Error(i(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Us(e,t),c=l?Vb(e,t):xd(e,t,!0),u=l;do{if(c===0){Zr&&!l&&us(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!Yb(a)){c=xd(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var N=e;c=fo;var z=N.current.memoizedState.isDehydrated;if(z&&(Pr(N,g).flags|=256),g=xd(N,g,!1),g!==2){if(cd&&!z){N.errorRecoveryDisabledLanes|=u,sr|=u,c=4;break e}u=mn,mn=c,u!==null&&(mn===null?mn=u:mn.push.apply(mn,u))}c=g}if(u=!1,c!==2)continue}}if(c===1){Pr(e,0),us(e,t,0,!0);break}e:{switch(l=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:us(l,t,Tn,!ls);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Li+300-$e(),10<c)){if(us(l,t,Tn,!ls),yr(l,0,!0)!==0)break e;Oa=t,l.timeoutHandle=vx(Gp.bind(null,l,a,mn,Hi,dd,t,Tn,sr,Jr,ls,u,"Throttled",-0,0),c);break e}Gp(l,a,mn,Hi,dd,t,Tn,sr,Jr,ls,u,null,-0,0)}}break}while(!0);ra(e)}function Gp(e,t,a,l,c,u,g,N,z,V,ee,se,X,J){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ga},Dp(t,u,se);var Se=(u&62914560)===u?Li-$e():(u&4194048)===u?$p-$e():0;if(Se=Ty(se,Se),Se!==null){Oa=u,e.cancelPendingCommit=Se(Zp.bind(null,e,t,u,a,l,c,g,N,z,ee,se,null,X,J)),us(e,u,g,!V);return}}Zp(e,t,u,a,l,c,g,N,z)}function Yb(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var c=a[l],u=c.getSnapshot;c=c.value;try{if(!Sn(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 us(e,t,a,l){t&=~ud,t&=~sr,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var c=t;0<c;){var u=31-zt(c),g=1<<u;l[u]=-1,c&=~g}a!==0&&jr(e,a,t)}function qi(){return(et&6)===0?(ho(0),!1):!0}function pd(){if(Qe!==null){if(st===0)var e=Qe.return;else e=Qe,ja=Is=null,_u(e),Qr=null,Il=0,e=Qe;for(;e!==null;)bp(e.alternate,e),e=e.return;Qe=null}}function Pr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,uy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Oa=0,pd(),ft=e,Qe=a=ba(e.current,null),Ke=t,st=0,En=null,ls=!1,Zr=Us(e,t),cd=!1,Jr=Tn=ud=sr=os=wt=0,mn=fo=null,dd=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var c=31-zt(l),u=1<<c;t|=e[c],l&=~u}return _a=t,oi(),a}function Qp(e,t){Le=null,M.H=ao,t===Gr||t===pi?(t=rh(),st=3):t===bu?(t=rh(),st=4):st=t===Xu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,En=t,Qe===null&&(wt=1,Mi(e,zn(t,e.current)))}function Yp(){var e=kn.current;return e===null?!0:(Ke&4194048)===Ke?Hn===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===Hn:!1}function Kp(){var e=M.H;return M.H=ao,e===null?ao:e}function Vp(){var e=M.A;return M.A=Gb,e}function Bi(){wt=4,ls||(Ke&4194048)!==Ke&&kn.current!==null||(Zr=!0),(os&134217727)===0&&(sr&134217727)===0||ft===null||us(ft,Ke,Tn,!1)}function xd(e,t,a){var l=et;et|=2;var c=Kp(),u=Vp();(ft!==e||Ke!==t)&&(Hi=null,Pr(e,t)),t=!1;var g=wt;e:do try{if(st!==0&&Qe!==null){var N=Qe,z=En;switch(st){case 8:pd(),g=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(t=!0);var V=st;if(st=0,En=null,el(e,N,z,V),a&&Zr){g=0;break e}break;default:V=st,st=0,En=null,el(e,N,z,V)}}Kb(),g=wt;break}catch(ee){Qp(e,ee)}while(!0);return t&&e.shellSuspendCounter++,ja=Is=null,et=l,M.H=c,M.A=u,Qe===null&&(ft=null,Ke=0,oi()),g}function Kb(){for(;Qe!==null;)Xp(Qe)}function Vb(e,t){var a=et;et|=2;var l=Kp(),c=Vp();ft!==e||Ke!==t?(Hi=null,$i=$e()+500,Pr(e,t)):Zr=Us(e,t);e:do try{if(st!==0&&Qe!==null){t=Qe;var u=En;t:switch(st){case 1:st=0,En=null,el(e,t,u,1);break;case 2:case 9:if(ah(u)){st=0,En=null,Fp(t);break}t=function(){st!==2&&st!==9||ft!==e||(st=7),ra(e)},u.then(t,t);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:ah(u)?(st=0,En=null,Fp(t)):(st=0,En=null,el(e,t,u,7));break;case 5:var g=null;switch(Qe.tag){case 26:g=Qe.memoizedState;case 5:case 27:var N=Qe;if(g?Rx(g):N.stateNode.complete){st=0,En=null;var z=N.sibling;if(z!==null)Qe=z;else{var V=N.return;V!==null?(Qe=V,Gi(V)):Qe=null}break t}}st=0,En=null,el(e,t,u,5);break;case 6:st=0,En=null,el(e,t,u,6);break;case 8:pd(),wt=6;break e;default:throw Error(i(462))}}Xb();break}catch(ee){Qp(e,ee)}while(!0);return ja=Is=null,M.H=l,M.A=c,et=a,Qe!==null?0:(ft=null,Ke=0,oi(),wt)}function Xb(){for(;Qe!==null&&!ut();)Xp(Qe)}function Xp(e){var t=gp(e.alternate,e,_a);e.memoizedProps=e.pendingProps,t===null?Gi(e):Qe=t}function Fp(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=dp(a,t,t.pendingProps,t.type,void 0,Ke);break;case 11:t=dp(a,t,t.pendingProps,t.type.render,t.ref,Ke);break;case 5:_u(t);default:bp(a,t),t=Qe=Vm(t,_a),t=gp(a,t,_a)}e.memoizedProps=e.pendingProps,t===null?Gi(e):Qe=t}function el(e,t,a,l){ja=Is=null,_u(t),Qr=null,Il=0;var c=t.return;try{if(zb(e,c,t,a,Ke)){wt=1,Mi(e,zn(a,e.current)),Qe=null;return}}catch(u){if(c!==null)throw Qe=c,u;wt=1,Mi(e,zn(a,e.current)),Qe=null;return}t.flags&32768?(Xe||l===1?e=!0:Zr||(Ke&536870912)!==0?e=!1:(ls=e=!0,(l===2||l===9||l===3||l===6)&&(l=kn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ip(t,e)):Gi(t)}function Gi(e){var t=e;do{if((t.flags&32768)!==0){Ip(t,ls);return}e=t.return;var a=$b(t.alternate,t,_a);if(a!==null){Qe=a;return}if(t=t.sibling,t!==null){Qe=t;return}Qe=t=e}while(t!==null);wt===0&&(wt=5)}function Ip(e,t){do{var a=Hb(e.alternate,e);if(a!==null){a.flags&=32767,Qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Qe=e;return}Qe=e=a}while(e!==null);wt=6,Qe=null}function Zp(e,t,a,l,c,u,g,N,z){e.cancelPendingCommit=null;do Qi();while(Ut!==0);if((et&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=su,Xa(e,a,u,g,N,z),e===ft&&(Qe=ft=null,Ke=0),Wr=t,cs=e,Oa=a,fd=u,md=c,Hp=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jb(Zt,function(){return tx(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,c=R.p,R.p=2,g=et,et|=4;try{qb(e,t,a)}finally{et=g,R.p=c,M.T=l}}Ut=1,Jp(),Wp(),Pp()}}function Jp(){if(Ut===1){Ut=0;var e=cs,t=Wr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var l=R.p;R.p=2;var c=et;et|=4;try{_p(t,e);var u=Td,g=Lm(e.containerInfo),N=u.focusedElem,z=u.selectionRange;if(g!==N&&N&&N.ownerDocument&&Um(N.ownerDocument.documentElement,N)){if(z!==null&&Pc(N)){var V=z.start,ee=z.end;if(ee===void 0&&(ee=V),"selectionStart"in N)N.selectionStart=V,N.selectionEnd=Math.min(ee,N.value.length);else{var se=N.ownerDocument||document,X=se&&se.defaultView||window;if(X.getSelection){var J=X.getSelection(),Se=N.textContent.length,Ae=Math.min(z.start,Se),ct=z.end===void 0?Ae:Math.min(z.end,Se);!J.extend&&Ae>ct&&(g=ct,ct=Ae,Ae=g);var H=zm(N,Ae),L=zm(N,ct);if(H&&L&&(J.rangeCount!==1||J.anchorNode!==H.node||J.anchorOffset!==H.offset||J.focusNode!==L.node||J.focusOffset!==L.offset)){var Y=se.createRange();Y.setStart(H.node,H.offset),J.removeAllRanges(),Ae>ct?(J.addRange(Y),J.extend(L.node,L.offset)):(Y.setEnd(L.node,L.offset),J.addRange(Y))}}}}for(se=[],J=N;J=J.parentNode;)J.nodeType===1&&se.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var ae=se[N];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}tc=!!Ed,Td=Ed=null}finally{et=c,R.p=l,M.T=a}}e.current=t,Ut=2}}function Wp(){if(Ut===2){Ut=0;var e=cs,t=Wr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var l=R.p;R.p=2;var c=et;et|=4;try{Cp(e,t.alternate,t)}finally{et=c,R.p=l,M.T=a}}Ut=3}}function Pp(){if(Ut===4||Ut===3){Ut=0,at();var e=cs,t=Wr,a=Oa,l=Hp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ut=5:(Ut=0,Wr=cs=null,ex(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(is=null),Sr(a),t=t.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(yn,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,c=R.p,R.p=2,M.T=null;try{for(var u=e.onRecoverableError,g=0;g<l.length;g++){var N=l[g];u(N.value,{componentStack:N.stack})}}finally{M.T=t,R.p=c}}(Oa&3)!==0&&Qi(),ra(e),c=e.pendingLanes,(a&261930)!==0&&(c&42)!==0?e===hd?mo++:(mo=0,hd=e):mo=0,ho(0)}}function ex(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xl(t)))}function Qi(){return Jp(),Wp(),Pp(),tx()}function tx(){if(Ut!==5)return!1;var e=cs,t=fd;fd=0;var a=Sr(Oa),l=M.T,c=R.p;try{R.p=32>a?32:a,M.T=null,a=md,md=null;var u=cs,g=Oa;if(Ut=0,Wr=cs=null,Oa=0,(et&6)!==0)throw Error(i(331));var N=et;if(et|=4,Up(u.current),Rp(u,u.current,g,a),et=N,ho(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(yn,u)}catch{}return!0}finally{R.p=c,M.T=l,ex(e,t)}}function nx(e,t,a){t=zn(a,t),t=Vu(e.stateNode,t,2),e=ns(e,t,2),e!==null&&(ea(e,2),ra(e))}function rt(e,t,a){if(e.tag===3)nx(e,e,a);else for(;t!==null;){if(t.tag===3){nx(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(is===null||!is.has(l))){e=zn(a,e),a=ap(2),l=ns(t,a,2),l!==null&&(sp(a,l,t,e),ea(l,2),ra(l));break}}t=t.return}}function gd(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Qb;var c=new Set;l.set(t,c)}else c=l.get(t),c===void 0&&(c=new Set,l.set(t,c));c.has(a)||(cd=!0,c.add(a),e=Fb.bind(null,e,t,a),t.then(e,e))}function Fb(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ft===e&&(Ke&a)===a&&(wt===4||wt===3&&(Ke&62914560)===Ke&&300>$e()-Li?(et&2)===0&&Pr(e,0):ud|=a,Jr===Ke&&(Jr=0)),ra(e)}function ax(e,t){t===0&&(t=Fo()),e=Vs(e,t),e!==null&&(ea(e,t),ra(e))}function Ib(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),ax(e,a)}function Zb(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(i(314))}l!==null&&l.delete(t),ax(e,a)}function Jb(e,t){return vn(e,t)}var Yi=null,tl=null,vd=!1,Ki=!1,bd=!1,ds=0;function ra(e){e!==tl&&e.next===null&&(tl===null?Yi=tl=e:tl=tl.next=e),Ki=!0,vd||(vd=!0,Pb())}function ho(e,t){if(!bd&&Ki){bd=!0;do for(var a=!1,l=Yi;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var u=0;else{var g=l.suspendedLanes,N=l.pingedLanes;u=(1<<31-zt(42|e)+1)-1,u&=c&~(g&~N),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,ox(l,u))}else u=Ke,u=yr(l,l===ft?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||Us(l,u)||(a=!0,ox(l,u));l=l.next}while(a);bd=!1}}function Wb(){sx()}function sx(){Ki=vd=!1;var e=0;ds!==0&&cy()&&(e=ds);for(var t=$e(),a=null,l=Yi;l!==null;){var c=l.next,u=rx(l,t);u===0?(l.next=null,a===null?Yi=c:a.next=c,c===null&&(tl=a)):(a=l,(e!==0||(u&3)!==0)&&(Ki=!0)),l=c}Ut!==0&&Ut!==5||ho(e),ds!==0&&(ds=0)}function rx(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var g=31-zt(u),N=1<<g,z=c[g];z===-1?((N&a)===0||(N&l)!==0)&&(c[g]=Lc(N,t)):z<=t&&(e.expiredLanes|=N),u&=~N}if(t=ft,a=Ke,a=yr(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(st===2||st===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ee(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Us(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Ee(l),Sr(a)){case 2:case 8:a=It;break;case 32:a=Zt;break;case 268435456:a=Vn;break;default:a=Zt}return l=lx.bind(null,e),a=vn(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Ee(l),e.callbackPriority=2,e.callbackNode=null,2}function lx(e,t){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Qi()&&e.callbackNode!==a)return null;var l=Ke;return l=yr(e,e===ft?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Bp(e,l,t),rx(e,$e()),e.callbackNode!=null&&e.callbackNode===a?lx.bind(null,e):null)}function ox(e,t){if(Qi())return null;Bp(e,t,!0)}function Pb(){dy(function(){(et&6)!==0?vn(Rn,Wb):sx()})}function yd(){if(ds===0){var e=qr;e===0&&(e=Nn,Nn<<=1,(Nn&261888)===0&&(Nn=256)),ds=e}return ds}function ix(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Po(""+e)}function cx(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function ey(e,t,a,l,c){if(t==="submit"&&a&&a.stateNode===c){var u=ix((c[Jt]||null).action),g=l.submitter;g&&(t=(t=g[Jt]||null)?ix(t.formAction):g.getAttribute("formAction"),t!==null&&(u=t,g=null));var N=new ai("action","action",null,l,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ds!==0){var z=g?cx(c,g):new FormData(c);qu(a,{pending:!0,data:z,method:c.method,action:u},null,z)}}else typeof u=="function"&&(N.preventDefault(),z=g?cx(c,g):new FormData(c),qu(a,{pending:!0,data:z,method:c.method,action:u},u,z))},currentTarget:c}]})}}for(var jd=0;jd<au.length;jd++){var Nd=au[jd],ty=Nd.toLowerCase(),ny=Nd[0].toUpperCase()+Nd.slice(1);Xn(ty,"on"+ny)}Xn(qm,"onAnimationEnd"),Xn(Bm,"onAnimationIteration"),Xn(Gm,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(vb,"onTransitionRun"),Xn(bb,"onTransitionStart"),Xn(yb,"onTransitionCancel"),Xn(Qm,"onTransitionEnd"),ze("onMouseEnter",["mouseout","mouseover"]),ze("onMouseLeave",["mouseout","mouseover"]),ze("onPointerEnter",["pointerout","pointerover"]),ze("onPointerLeave",["pointerout","pointerover"]),Oe("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Oe("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Oe("onBeforeInput",["compositionend","keypress","textInput","paste"]),Oe("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Oe("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Oe("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var po="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(" "),ay=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(po));function ux(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],c=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var g=l.length-1;0<=g;g--){var N=l[g],z=N.instance,V=N.currentTarget;if(N=N.listener,z!==u&&c.isPropagationStopped())break e;u=N,c.currentTarget=V;try{u(c)}catch(ee){li(ee)}c.currentTarget=null,u=z}else for(g=0;g<l.length;g++){if(N=l[g],z=N.instance,V=N.currentTarget,N=N.listener,z!==u&&c.isPropagationStopped())break e;u=N,c.currentTarget=V;try{u(c)}catch(ee){li(ee)}c.currentTarget=null,u=z}}}}function Ye(e,t){var a=t[Dl];a===void 0&&(a=t[Dl]=new Set);var l=e+"__bubble";a.has(l)||(dx(t,e,2,!1),a.add(l))}function Sd(e,t,a){var l=0;t&&(l|=4),dx(a,e,l,t)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function wd(e){if(!e[Vi]){e[Vi]=!0,be.forEach(function(a){a!=="selectionchange"&&(ay.has(a)||Sd(a,!1,e),Sd(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vi]||(t[Vi]=!0,Sd("selectionchange",!1,t))}}function dx(e,t,a,l){switch(qx(t)){case 2:var c=_y;break;case 8:c=Oy;break;default:c=Hd}a=c.bind(null,t,a,e),c=void 0,!Yc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function kd(e,t,a,l,c){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var g=l.tag;if(g===3||g===4){var N=l.stateNode.containerInfo;if(N===c)break;if(g===4)for(g=l.return;g!==null;){var z=g.tag;if((z===3||z===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;N!==null;){if(g=pa(N),g===null)return;if(z=g.tag,z===5||z===6||z===26||z===27){l=u=g;continue e}N=N.parentNode}}l=l.return}xm(function(){var V=u,ee=Gc(a),se=[];e:{var X=Ym.get(e);if(X!==void 0){var J=ai,Se=e;switch(e){case"keypress":if(ti(a)===0)break e;case"keydown":case"keyup":J=Zv;break;case"focusin":Se="focus",J=Fc;break;case"focusout":Se="blur",J=Fc;break;case"beforeblur":case"afterblur":J=Fc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=bm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=$v;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=Pv;break;case qm:case Bm:case Gm:J=Bv;break;case Qm:J=tb;break;case"scroll":case"scrollend":J=Uv;break;case"wheel":J=ab;break;case"copy":case"cut":case"paste":J=Qv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=jm;break;case"toggle":case"beforetoggle":J=rb}var Ae=(t&4)!==0,ct=!Ae&&(e==="scroll"||e==="scrollend"),H=Ae?X!==null?X+"Capture":null:X;Ae=[];for(var L=V,Y;L!==null;){var ae=L;if(Y=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||Y===null||H===null||(ae=Ul(L,H),ae!=null&&Ae.push(xo(L,ae,Y))),ct)break;L=L.return}0<Ae.length&&(X=new J(X,Se,null,a,ee),se.push({event:X,listeners:Ae}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",X&&a!==Bc&&(Se=a.relatedTarget||a.fromElement)&&(pa(Se)||Se[ha]))break e;if((J||X)&&(X=ee.window===ee?ee:(X=ee.ownerDocument)?X.defaultView||X.parentWindow:window,J?(Se=a.relatedTarget||a.toElement,J=V,Se=Se?pa(Se):null,Se!==null&&(ct=f(Se),Ae=Se.tag,Se!==ct||Ae!==5&&Ae!==27&&Ae!==6)&&(Se=null)):(J=null,Se=V),J!==Se)){if(Ae=bm,ae="onMouseLeave",H="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=jm,ae="onPointerLeave",H="onPointerEnter",L="pointer"),ct=J==null?X:ue(J),Y=Se==null?X:ue(Se),X=new Ae(ae,L+"leave",J,a,ee),X.target=ct,X.relatedTarget=Y,ae=null,pa(ee)===V&&(Ae=new Ae(H,L+"enter",Se,a,ee),Ae.target=Y,Ae.relatedTarget=ct,ae=Ae),ct=ae,J&&Se)t:{for(Ae=sy,H=J,L=Se,Y=0,ae=H;ae;ae=Ae(ae))Y++;ae=0;for(var Me=L;Me;Me=Ae(Me))ae++;for(;0<Y-ae;)H=Ae(H),Y--;for(;0<ae-Y;)L=Ae(L),ae--;for(;Y--;){if(H===L||L!==null&&H===L.alternate){Ae=H;break t}H=Ae(H),L=Ae(L)}Ae=null}else Ae=null;J!==null&&fx(se,X,J,Ae,!1),Se!==null&&ct!==null&&fx(se,ct,Se,Ae,!0)}}e:{if(X=V?ue(V):window,J=X.nodeName&&X.nodeName.toLowerCase(),J==="select"||J==="input"&&X.type==="file")var We=Mm;else if(Em(X))if(Am)We=pb;else{We=mb;var ke=fb}else J=X.nodeName,!J||J.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?V&&qc(V.elementType)&&(We=Mm):We=hb;if(We&&(We=We(e,V))){Tm(se,We,a,ee);break e}ke&&ke(e,X,V),e==="focusout"&&V&&X.type==="number"&&V.memoizedProps.value!=null&&Hc(X,"number",X.value)}switch(ke=V?ue(V):window,e){case"focusin":(Em(ke)||ke.contentEditable==="true")&&(Or=ke,eu=V,Yl=null);break;case"focusout":Yl=eu=Or=null;break;case"mousedown":tu=!0;break;case"contextmenu":case"mouseup":case"dragend":tu=!1,$m(se,a,ee);break;case"selectionchange":if(gb)break;case"keydown":case"keyup":$m(se,a,ee)}var qe;if(Zc)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else _r?km(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Nm&&a.locale!=="ko"&&(_r||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&_r&&(qe=gm()):(Ia=ee,Kc="value"in Ia?Ia.value:Ia.textContent,_r=!0)),ke=Xi(V,Ve),0<ke.length&&(Ve=new ym(Ve,e,null,a,ee),se.push({event:Ve,listeners:ke}),qe?Ve.data=qe:(qe=Cm(a),qe!==null&&(Ve.data=qe)))),(qe=ob?ib(e,a):cb(e,a))&&(Ve=Xi(V,"onBeforeInput"),0<Ve.length&&(ke=new ym("onBeforeInput","beforeinput",null,a,ee),se.push({event:ke,listeners:Ve}),ke.data=qe)),ey(se,e,V,a,ee)}ux(se,t)})}function xo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Xi(e,t){for(var a=t+"Capture",l=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=Ul(e,a),c!=null&&l.unshift(xo(e,c,u)),c=Ul(e,t),c!=null&&l.push(xo(e,c,u))),e.tag===3)return l;e=e.return}return[]}function sy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function fx(e,t,a,l,c){for(var u=t._reactName,g=[];a!==null&&a!==l;){var N=a,z=N.alternate,V=N.stateNode;if(N=N.tag,z!==null&&z===l)break;N!==5&&N!==26&&N!==27||V===null||(z=V,c?(V=Ul(a,u),V!=null&&g.unshift(xo(a,V,z))):c||(V=Ul(a,u),V!=null&&g.push(xo(a,V,z)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var ry=/\r\n?/g,ly=/\u0000|\uFFFD/g;function mx(e){return(typeof e=="string"?e:""+e).replace(ry,`
|
|
49
|
+
`).replace(ly,"")}function hx(e,t){return t=mx(t),mx(e)===t}function it(e,t,a,l,c,u){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Tr(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Tr(e,""+l);break;case"className":$s(e,"class",l);break;case"tabIndex":$s(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":$s(e,a,l);break;case"style":hm(e,l,u);break;case"data":if(t!=="object"){$s(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Po(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 u=="function"&&(a==="formAction"?(t!=="input"&&it(e,t,"name",c.name,c,null),it(e,t,"formEncType",c.formEncType,c,null),it(e,t,"formMethod",c.formMethod,c,null),it(e,t,"formTarget",c.formTarget,c,null)):(it(e,t,"encType",c.encType,c,null),it(e,t,"method",c.method,c,null),it(e,t,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Po(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=ga);break;case"onScroll":l!=null&&Ye("scroll",e);break;case"onScrollEnd":l!=null&&Ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Po(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),xa(e,"popover",l);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":xa(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Dv.get(a)||a,xa(e,a,l))}}function Cd(e,t,a,l,c,u){switch(a){case"style":hm(e,l,u);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(i(61));if(a=l.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof l=="string"?Tr(e,l):(typeof l=="number"||typeof l=="bigint")&&Tr(e,""+l);break;case"onScroll":l!=null&&Ye("scroll",e);break;case"onScrollEnd":l!=null&&Ye("scrollend",e);break;case"onClick":l!=null&&(e.onclick=ga);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ge.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),u=e[Jt]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof l=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,c);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):xa(e,a,l)}}}function Xt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var l=!1,c=!1,u;for(u in a)if(a.hasOwnProperty(u)){var g=a[u];if(g!=null)switch(u){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:it(e,t,u,g,a,null)}}c&&it(e,t,"srcSet",a.srcSet,a,null),l&&it(e,t,"src",a.src,a,null);return;case"input":Ye("invalid",e);var N=u=g=c=null,z=null,V=null;for(l in a)if(a.hasOwnProperty(l)){var ee=a[l];if(ee!=null)switch(l){case"name":c=ee;break;case"type":g=ee;break;case"checked":z=ee;break;case"defaultChecked":V=ee;break;case"value":u=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,t));break;default:it(e,t,l,ee,a,null)}}um(e,u,N,z,V,g,c,!1);return;case"select":Ye("invalid",e),l=g=u=null;for(c in a)if(a.hasOwnProperty(c)&&(N=a[c],N!=null))switch(c){case"value":u=N;break;case"defaultValue":g=N;break;case"multiple":l=N;default:it(e,t,c,N,a,null)}t=u,a=g,e.multiple=!!l,t!=null?Er(e,!!l,t,!1):a!=null&&Er(e,!!l,a,!0);return;case"textarea":Ye("invalid",e),u=c=l=null;for(g in a)if(a.hasOwnProperty(g)&&(N=a[g],N!=null))switch(g){case"value":l=N;break;case"defaultValue":c=N;break;case"children":u=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(i(91));break;default:it(e,t,g,N,a,null)}fm(e,l,c,u);return;case"option":for(z in a)if(a.hasOwnProperty(z)&&(l=a[z],l!=null))switch(z){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:it(e,t,z,l,a,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(l=0;l<po.length;l++)Ye(po[l],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(V in a)if(a.hasOwnProperty(V)&&(l=a[V],l!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:it(e,t,V,l,a,null)}return;default:if(qc(t)){for(ee in a)a.hasOwnProperty(ee)&&(l=a[ee],l!==void 0&&Cd(e,t,ee,l,a,void 0));return}}for(N in a)a.hasOwnProperty(N)&&(l=a[N],l!=null&&it(e,t,N,l,a,null))}function oy(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,u=null,g=null,N=null,z=null,V=null,ee=null;for(J in a){var se=a[J];if(a.hasOwnProperty(J)&&se!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":z=se;default:l.hasOwnProperty(J)||it(e,t,J,null,l,se)}}for(var X in l){var J=l[X];if(se=a[X],l.hasOwnProperty(X)&&(J!=null||se!=null))switch(X){case"type":u=J;break;case"name":c=J;break;case"checked":V=J;break;case"defaultChecked":ee=J;break;case"value":g=J;break;case"defaultValue":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(i(137,t));break;default:J!==se&&it(e,t,X,J,l,se)}}$c(e,g,N,z,V,ee,u,c);return;case"select":J=g=N=X=null;for(u in a)if(z=a[u],a.hasOwnProperty(u)&&z!=null)switch(u){case"value":break;case"multiple":J=z;default:l.hasOwnProperty(u)||it(e,t,u,null,l,z)}for(c in l)if(u=l[c],z=a[c],l.hasOwnProperty(c)&&(u!=null||z!=null))switch(c){case"value":X=u;break;case"defaultValue":N=u;break;case"multiple":g=u;default:u!==z&&it(e,t,c,u,l,z)}t=N,a=g,l=J,X!=null?Er(e,!!a,X,!1):!!l!=!!a&&(t!=null?Er(e,!!a,t,!0):Er(e,!!a,a?[]:"",!1));return;case"textarea":J=X=null;for(N in a)if(c=a[N],a.hasOwnProperty(N)&&c!=null&&!l.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:it(e,t,N,null,l,c)}for(g in l)if(c=l[g],u=a[g],l.hasOwnProperty(g)&&(c!=null||u!=null))switch(g){case"value":X=c;break;case"defaultValue":J=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&it(e,t,g,c,l,u)}dm(e,X,J);return;case"option":for(var Se in a)if(X=a[Se],a.hasOwnProperty(Se)&&X!=null&&!l.hasOwnProperty(Se))switch(Se){case"selected":e.selected=!1;break;default:it(e,t,Se,null,l,X)}for(z in l)if(X=l[z],J=a[z],l.hasOwnProperty(z)&&X!==J&&(X!=null||J!=null))switch(z){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:it(e,t,z,X,l,J)}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 Ae in a)X=a[Ae],a.hasOwnProperty(Ae)&&X!=null&&!l.hasOwnProperty(Ae)&&it(e,t,Ae,null,l,X);for(V in l)if(X=l[V],J=a[V],l.hasOwnProperty(V)&&X!==J&&(X!=null||J!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:it(e,t,V,X,l,J)}return;default:if(qc(t)){for(var ct in a)X=a[ct],a.hasOwnProperty(ct)&&X!==void 0&&!l.hasOwnProperty(ct)&&Cd(e,t,ct,void 0,l,X);for(ee in l)X=l[ee],J=a[ee],!l.hasOwnProperty(ee)||X===J||X===void 0&&J===void 0||Cd(e,t,ee,X,l,J);return}}for(var H in a)X=a[H],a.hasOwnProperty(H)&&X!=null&&!l.hasOwnProperty(H)&&it(e,t,H,null,l,X);for(se in l)X=l[se],J=a[se],!l.hasOwnProperty(se)||X===J||X==null&&J==null||it(e,t,se,X,l,J)}function px(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var c=a[l],u=c.transferSize,g=c.initiatorType,N=c.duration;if(u&&N&&px(g)){for(g=0,N=c.responseEnd,l+=1;l<a.length;l++){var z=a[l],V=z.startTime;if(V>N)break;var ee=z.transferSize,se=z.initiatorType;ee&&px(se)&&(z=z.responseEnd,g+=ee*(z<N?1:(N-V)/(z-V)))}if(--l,t+=8*(u+g)/(c.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 Ed=null,Td=null;function Fi(e){return e.nodeType===9?e:e.ownerDocument}function xx(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 gx(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 Md(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 Ad=null;function cy(){var e=window.event;return e&&e.type==="popstate"?e===Ad?!1:(Ad=e,!0):(Ad=null,!1)}var vx=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,bx=typeof Promise=="function"?Promise:void 0,dy=typeof queueMicrotask=="function"?queueMicrotask:typeof bx<"u"?function(e){return bx.resolve(null).then(e).catch(fy)}:vx;function fy(e){setTimeout(function(){throw e})}function fs(e){return e==="head"}function yx(e,t){var a=t,l=0;do{var c=a.nextSibling;if(e.removeChild(a),c&&c.nodeType===8)if(a=c.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(c),rl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")go(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,go(a);for(var u=a.firstChild;u;){var g=u.nextSibling,N=u.nodeName;u[Fa]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=g}}else a==="body"&&go(e.ownerDocument.body);a=c}while(a);rl(t)}function jx(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function _d(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":_d(a),wr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function my(e,t,a,l){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Fa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function hy(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=qn(e.nextSibling),e===null))return null;return e}function Nx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function Od(e){return e.data==="$?"||e.data==="$~"}function Rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function py(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function qn(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 Dd=null;function Sx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return qn(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function wx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function kx(e,t,a){switch(t=Fi(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function go(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wr(e)}var Bn=new Map,Cx=new Set;function Ii(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ra=R.d;R.d={f:xy,r:gy,D:vy,C:by,L:yy,m:jy,X:Sy,S:Ny,M:wy};function xy(){var e=Ra.f(),t=qi();return e||t}function gy(e){var t=W(e);t!==null&&t.tag===5&&t.type==="form"?Qh(t):Ra.r(e)}var nl=typeof document>"u"?null:document;function Ex(e,t,a){var l=nl;if(l&&typeof t=="string"&&t){var c=Qt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),Cx.has(c)||(Cx.add(c),e={rel:e,crossOrigin:a,href:t},l.querySelector(c)===null&&(t=l.createElement("link"),Xt(t,"link",e),ye(t),l.head.appendChild(t)))}}function vy(e){Ra.D(e),Ex("dns-prefetch",e,null)}function by(e,t){Ra.C(e,t),Ex("preconnect",e,t)}function yy(e,t,a){Ra.L(e,t,a);var l=nl;if(l&&e&&t){var c='link[rel="preload"][as="'+Qt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+Qt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+Qt(a.imageSizes)+'"]')):c+='[href="'+Qt(e)+'"]';var u=c;switch(t){case"style":u=al(e);break;case"script":u=sl(e)}Bn.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Bn.set(u,e),l.querySelector(c)!==null||t==="style"&&l.querySelector(vo(u))||t==="script"&&l.querySelector(bo(u))||(t=l.createElement("link"),Xt(t,"link",e),ye(t),l.head.appendChild(t)))}}function jy(e,t){Ra.m(e,t);var a=nl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Qt(l)+'"][href="'+Qt(e)+'"]',u=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=sl(e)}if(!Bn.has(u)&&(e=y({rel:"modulepreload",href:e},t),Bn.set(u,e),a.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bo(u)))return}l=a.createElement("link"),Xt(l,"link",e),ye(l),a.head.appendChild(l)}}}function Ny(e,t,a){Ra.S(e,t,a);var l=nl;if(l&&e){var c=de(l).hoistableStyles,u=al(e);t=t||"default";var g=c.get(u);if(!g){var N={loading:0,preload:null};if(g=l.querySelector(vo(u)))N.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Bn.get(u))&&zd(e,a);var z=g=l.createElement("link");ye(z),Xt(z,"link",e),z._p=new Promise(function(V,ee){z.onload=V,z.onerror=ee}),z.addEventListener("load",function(){N.loading|=1}),z.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Zi(g,t,l)}g={type:"stylesheet",instance:g,count:1,state:N},c.set(u,g)}}}function Sy(e,t){Ra.X(e,t);var a=nl;if(a&&e){var l=de(a).hoistableScripts,c=sl(e),u=l.get(c);u||(u=a.querySelector(bo(c)),u||(e=y({src:e,async:!0},t),(t=Bn.get(c))&&Ud(e,t),u=a.createElement("script"),ye(u),Xt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function wy(e,t){Ra.M(e,t);var a=nl;if(a&&e){var l=de(a).hoistableScripts,c=sl(e),u=l.get(c);u||(u=a.querySelector(bo(c)),u||(e=y({src:e,async:!0,type:"module"},t),(t=Bn.get(c))&&Ud(e,t),u=a.createElement("script"),ye(u),Xt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(c,u))}}function Tx(e,t,a,l){var c=(c=ie.current)?Ii(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=al(a.href),a=de(c).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=al(a.href);var u=de(c).hoistableStyles,g=u.get(e);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,g),(u=c.querySelector(vo(e)))&&!u._p&&(g.instance=u,g.state.loading=5),Bn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Bn.set(e,a),u||ky(c,e,a,g.state))),t&&l===null)throw Error(i(528,""));return g}if(t&&l!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=sl(a),a=de(c).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function al(e){return'href="'+Qt(e)+'"'}function vo(e){return'link[rel="stylesheet"]['+e+"]"}function Mx(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function ky(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Xt(t,"link",a),ye(t),e.head.appendChild(t))}function sl(e){return'[src="'+Qt(e)+'"]'}function bo(e){return"script[async]"+e}function Ax(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Qt(a.href)+'"]');if(l)return t.instance=l,ye(l),l;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ye(l),Xt(l,"style",c),Zi(l,a.precedence,e),t.instance=l;case"stylesheet":c=al(a.href);var u=e.querySelector(vo(c));if(u)return t.state.loading|=4,t.instance=u,ye(u),u;l=Mx(a),(c=Bn.get(c))&&zd(l,c),u=(e.ownerDocument||e).createElement("link"),ye(u);var g=u;return g._p=new Promise(function(N,z){g.onload=N,g.onerror=z}),Xt(u,"link",l),t.state.loading|=4,Zi(u,a.precedence,e),t.instance=u;case"script":return u=sl(a.src),(c=e.querySelector(bo(u)))?(t.instance=c,ye(c),c):(l=a,(c=Bn.get(u))&&(l=y({},a),Ud(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),ye(c),Xt(c,"link",l),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Zi(l,a.precedence,e));return t.instance}function Zi(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,u=c,g=0;g<l.length;g++){var N=l[g];if(N.dataset.precedence===t)u=N;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function zd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ji=null;function _x(e,t,a){if(Ji===null){var l=new Map,c=Ji=new Map;c.set(a,l)}else c=Ji,l=c.get(a),l||(l=new Map,c.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[Fa]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var g=u.getAttribute(t)||"";g=e+g;var N=l.get(g);N?N.push(u):l.set(g,[u])}}return l}function Ox(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Cy(e,t,a){if(a===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 Rx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ey(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var c=al(l.href),u=t.querySelector(vo(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Wi.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,ye(u);return}u=t.ownerDocument||t,l=Mx(l),(c=Bn.get(c))&&zd(l,c),u=u.createElement("link"),ye(u);var g=u;g._p=new Promise(function(N,z){g.onload=N,g.onerror=z}),Xt(u,"link",l),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Wi.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Ld=0;function Ty(e,t){return e.stylesheets&&e.count===0&&ec(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Ld===0&&(Ld=62500*iy());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Ld?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function Wi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Pi=null;function ec(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Pi=new Map,t.forEach(My,e),Pi=null,Wi.call(e))}function My(e,t){if(!(t.state.loading&4)){var a=Pi.get(e);if(a)var l=a.get(null);else{a=new Map,Pi.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var g=c[u];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),l=g)}l&&a.set(null,l)}c=t.instance,g=c.getAttribute("data-precedence"),u=a.get(g)||l,u===l&&a.set(null,c),a.set(g,c),this.count++,l=Wi.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var yo={$$typeof:T,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Ay(e,t,a,l,c,u,g,N,z){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=Va(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Va(0),this.hiddenUpdates=Va(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function Dx(e,t,a,l,c,u,g,N,z,V,ee,se){return e=new Ay(e,t,a,g,z,V,ee,se,N),t=1,u===!0&&(t|=24),u=wn(3,null,null,t),e.current=u,u.stateNode=e,t=xu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:a,cache:t},yu(u),e}function zx(e){return e?(e=zr,e):zr}function Ux(e,t,a,l,c,u){c=zx(c),l.context===null?l.context=c:l.pendingContext=c,l=ts(t),l.payload={element:a},u=u===void 0?null:u,u!==null&&(l.callback=u),a=ns(e,l,t),a!==null&&(hn(a,e,t),Jl(a,e,t))}function Lx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function $d(e,t){Lx(e,t),(e=e.alternate)&&Lx(e,t)}function $x(e){if(e.tag===13||e.tag===31){var t=Vs(e,67108864);t!==null&&hn(t,e,67108864),$d(e,67108864)}}function Hx(e){if(e.tag===13||e.tag===31){var t=Mn();t=Rl(t);var a=Vs(e,t);a!==null&&hn(a,e,t),$d(e,t)}}var tc=!0;function _y(e,t,a,l){var c=M.T;M.T=null;var u=R.p;try{R.p=2,Hd(e,t,a,l)}finally{R.p=u,M.T=c}}function Oy(e,t,a,l){var c=M.T;M.T=null;var u=R.p;try{R.p=8,Hd(e,t,a,l)}finally{R.p=u,M.T=c}}function Hd(e,t,a,l){if(tc){var c=qd(l);if(c===null)kd(e,t,l,nc,a),Bx(e,l);else if(Dy(c,e,t,a,l))l.stopPropagation();else if(Bx(e,l),t&4&&-1<Ry.indexOf(e)){for(;c!==null;){var u=W(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var g=ma(u.pendingLanes);if(g!==0){var N=u;for(N.pendingLanes|=2,N.entangledLanes|=2;g;){var z=1<<31-zt(g);N.entanglements[1]|=z,g&=~z}ra(u),(et&6)===0&&($i=$e()+500,ho(0))}}break;case 31:case 13:N=Vs(u,2),N!==null&&hn(N,u,2),qi(),$d(u,2)}if(u=qd(l),u===null&&kd(e,t,l,nc,a),u===c)break;c=u}c!==null&&l.stopPropagation()}else kd(e,t,l,null,a)}}function qd(e){return e=Gc(e),Bd(e)}var nc=null;function Bd(e){if(nc=null,e=pa(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return nc=e,null}function qx(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(bn()){case Rn:return 2;case It:return 8;case Zt:case fa:return 32;case Vn:return 268435456;default:return 32}default:return 32}}var Gd=!1,ms=null,hs=null,ps=null,jo=new Map,No=new Map,xs=[],Ry="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 Bx(e,t){switch(e){case"focusin":case"focusout":ms=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ps=null;break;case"pointerover":case"pointerout":jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":No.delete(t.pointerId)}}function So(e,t,a,l,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:u,targetContainers:[c]},t!==null&&(t=W(t),t!==null&&$x(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Dy(e,t,a,l,c){switch(t){case"focusin":return ms=So(ms,e,t,a,l,c),!0;case"dragenter":return hs=So(hs,e,t,a,l,c),!0;case"mouseover":return ps=So(ps,e,t,a,l,c),!0;case"pointerover":var u=c.pointerId;return jo.set(u,So(jo.get(u)||null,e,t,a,l,c)),!0;case"gotpointercapture":return u=c.pointerId,No.set(u,So(No.get(u)||null,e,t,a,l,c)),!0}return!1}function Gx(e){var t=pa(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Io(e.priority,function(){Hx(a)});return}}else if(t===31){if(t=m(a),t!==null){e.blockedOn=t,Io(e.priority,function(){Hx(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ac(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=qd(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Bc=l,a.target.dispatchEvent(l),Bc=null}else return t=W(a),t!==null&&$x(t),e.blockedOn=a,!1;t.shift()}return!0}function Qx(e,t,a){ac(e)&&a.delete(t)}function zy(){Gd=!1,ms!==null&&ac(ms)&&(ms=null),hs!==null&&ac(hs)&&(hs=null),ps!==null&&ac(ps)&&(ps=null),jo.forEach(Qx),No.forEach(Qx)}function sc(e,t){e.blockedOn===t&&(e.blockedOn=null,Gd||(Gd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,zy)))}var rc=null;function Yx(e){rc!==e&&(rc=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){rc===e&&(rc=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],c=e[t+2];if(typeof l!="function"){if(Bd(l||a)===null)continue;break}var u=W(a);u!==null&&(e.splice(t,3),t-=3,qu(u,{pending:!0,data:c,method:a.method,action:l},l,c))}}))}function rl(e){function t(z){return sc(z,e)}ms!==null&&sc(ms,e),hs!==null&&sc(hs,e),ps!==null&&sc(ps,e),jo.forEach(t),No.forEach(t);for(var a=0;a<xs.length;a++){var l=xs[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<xs.length&&(a=xs[0],a.blockedOn===null);)Gx(a),a.blockedOn===null&&xs.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var c=a[l],u=a[l+1],g=c[Jt]||null;if(typeof u=="function")g||Yx(a);else if(g){var N=null;if(u&&u.hasAttribute("formAction")){if(c=u,g=u[Jt]||null)N=g.formAction;else if(Bd(c)!==null)continue}else N=g.action;typeof N=="function"?a[l+1]=N:(a.splice(l,3),l-=3),Yx(a)}}}function Kx(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(g){return c=g})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Qd(e){this._internalRoot=e}lc.prototype.render=Qd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,l=Mn();Ux(a,l,e,t,null,null)},lc.prototype.unmount=Qd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ux(e.current,2,null,e,null,null),qi(),t[ha]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ls();e={blockedOn:null,target:e,priority:t};for(var a=0;a<xs.length&&t!==0&&t<xs[a].priority;a++);xs.splice(a,0,e),a===0&&Gx(e)}};var Vx=r.version;if(Vx!=="19.2.4")throw Error(i(527,Vx,"19.2.4"));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Uy={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oc.isDisabled&&oc.supportsFiber)try{yn=oc.inject(Uy),_e=oc}catch{}}return ko.createRoot=function(e,t){if(!d(e))throw Error(i(299));var a=!1,l="",c=Ph,u=ep,g=tp;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Dx(e,1,!1,null,null,a,l,null,c,u,g,Kx),e[ha]=t.current,wd(e),new Qd(t)},ko.hydrateRoot=function(e,t,a){if(!d(e))throw Error(i(299));var l=!1,c="",u=Ph,g=ep,N=tp,z=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(N=a.onRecoverableError),a.formState!==void 0&&(z=a.formState)),t=Dx(e,1,!0,t,a??null,l,c,z,u,g,N,Kx),t.context=zx(null),a=t.current,l=Mn(),l=Rl(l),c=ts(l),c.callback=null,ns(a,c,l),a=l,t.current.lanes=a,ea(t,a),ra(t),e[ha]=t.current,wd(e),new lc(t)},ko.version="19.2.4",ko}var a0;function Fy(){if(a0)return Xd.exports;a0=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(r){console.error(r)}}return s(),Xd.exports=Xy(),Xd.exports}var Iy=Fy(),El=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Zy={setTimeout:(s,r)=>setTimeout(s,r),clearTimeout:s=>clearTimeout(s),setInterval:(s,r)=>setInterval(s,r),clearInterval:s=>clearInterval(s)},ys,Rf,eg,Jy=(eg=class{constructor(){Te(this,ys,Zy);Te(this,Rf,!1)}setTimeoutProvider(s){ge(this,ys,s)}setTimeout(s,r){return U(this,ys).setTimeout(s,r)}clearTimeout(s){U(this,ys).clearTimeout(s)}setInterval(s,r){return U(this,ys).setInterval(s,r)}clearInterval(s){U(this,ys).clearInterval(s)}},ys=new WeakMap,Rf=new WeakMap,eg),lr=new Jy;function Wy(s){setTimeout(s,0)}var gr=typeof window>"u"||"Deno"in globalThis;function an(){}function Py(s,r){return typeof s=="function"?s(r):s}function lf(s){return typeof s=="number"&&s>=0&&s!==1/0}function dg(s,r){return Math.max(s+(r||0)-Date.now(),0)}function As(s,r){return typeof s=="function"?s(r):s}function Qn(s,r){return typeof s=="function"?s(r):s}function s0(s,r){const{type:o="all",exact:i,fetchStatus:d,predicate:f,queryKey:h,stale:m}=s;if(h){if(i){if(r.queryHash!==zf(h,r.options))return!1}else if(!Oo(r.queryKey,h))return!1}if(o!=="all"){const p=r.isActive();if(o==="active"&&!p||o==="inactive"&&p)return!1}return!(typeof m=="boolean"&&r.isStale()!==m||d&&d!==r.state.fetchStatus||f&&!f(r))}function r0(s,r){const{exact:o,status:i,predicate:d,mutationKey:f}=s;if(f){if(!r.options.mutationKey)return!1;if(o){if(vr(r.options.mutationKey)!==vr(f))return!1}else if(!Oo(r.options.mutationKey,f))return!1}return!(i&&r.state.status!==i||d&&!d(r))}function zf(s,r){return((r==null?void 0:r.queryKeyHashFn)||vr)(s)}function vr(s){return JSON.stringify(s,(r,o)=>of(o)?Object.keys(o).sort().reduce((i,d)=>(i[d]=o[d],i),{}):o)}function Oo(s,r){return s===r?!0:typeof s!=typeof r?!1:s&&r&&typeof s=="object"&&typeof r=="object"?Object.keys(r).every(o=>Oo(s[o],r[o])):!1}var e1=Object.prototype.hasOwnProperty;function fg(s,r,o=0){if(s===r)return s;if(o>500)return r;const i=l0(s)&&l0(r);if(!i&&!(of(s)&&of(r)))return r;const f=(i?s:Object.keys(s)).length,h=i?r:Object.keys(r),m=h.length,p=i?new Array(m):{};let x=0;for(let v=0;v<m;v++){const y=i?v:h[v],k=s[y],w=r[y];if(k===w){p[y]=k,(i?v<f:e1.call(s,y))&&x++;continue}if(k===null||w===null||typeof k!="object"||typeof w!="object"){p[y]=w;continue}const C=fg(k,w,o+1);p[y]=C,C===k&&x++}return f===m&&x===f?s:p}function yc(s,r){if(!r||Object.keys(s).length!==Object.keys(r).length)return!1;for(const o in s)if(s[o]!==r[o])return!1;return!0}function l0(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function of(s){if(!o0(s))return!1;const r=s.constructor;if(r===void 0)return!0;const o=r.prototype;return!(!o0(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function o0(s){return Object.prototype.toString.call(s)==="[object Object]"}function t1(s){return new Promise(r=>{lr.setTimeout(r,s)})}function cf(s,r,o){return typeof o.structuralSharing=="function"?o.structuralSharing(s,r):o.structuralSharing!==!1?fg(s,r):r}function n1(s,r,o=0){const i=[...s,r];return o&&i.length>o?i.slice(1):i}function a1(s,r,o=0){const i=[r,...s];return o&&i.length>o?i.slice(0,-1):i}var Uf=Symbol();function mg(s,r){return!s.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!s.queryFn||s.queryFn===Uf?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function Lf(s,r){return typeof s=="function"?s(...r):!!s}function s1(s,r,o){let i=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??(d=r()),i||(i=!0,d.aborted?o():d.addEventListener("abort",o,{once:!0})),d)}),s}var ir,js,fl,tg,r1=(tg=class extends El{constructor(){super();Te(this,ir);Te(this,js);Te(this,fl);ge(this,fl,r=>{if(!gr&&window.addEventListener){const o=()=>r();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){U(this,js)||this.setEventListener(U(this,fl))}onUnsubscribe(){var r;this.hasListeners()||((r=U(this,js))==null||r.call(this),ge(this,js,void 0))}setEventListener(r){var o;ge(this,fl,r),(o=U(this,js))==null||o.call(this),ge(this,js,r(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(r){U(this,ir)!==r&&(ge(this,ir,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(o=>{o(r)})}isFocused(){var r;return typeof U(this,ir)=="boolean"?U(this,ir):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},ir=new WeakMap,js=new WeakMap,fl=new WeakMap,tg),$f=new r1;function uf(){let s,r;const o=new Promise((d,f)=>{s=d,r=f});o.status="pending",o.catch(()=>{});function i(d){Object.assign(o,d),delete o.resolve,delete o.reject}return o.resolve=d=>{i({status:"fulfilled",value:d}),s(d)},o.reject=d=>{i({status:"rejected",reason:d}),r(d)},o}var l1=Wy;function o1(){let s=[],r=0,o=m=>{m()},i=m=>{m()},d=l1;const f=m=>{r?s.push(m):d(()=>{o(m)})},h=()=>{const m=s;s=[],m.length&&d(()=>{i(()=>{m.forEach(p=>{o(p)})})})};return{batch:m=>{let p;r++;try{p=m()}finally{r--,r||h()}return p},batchCalls:m=>(...p)=>{f(()=>{m(...p)})},schedule:f,setNotifyFunction:m=>{o=m},setBatchNotifyFunction:m=>{i=m},setScheduler:m=>{d=m}}}var Lt=o1(),ml,Ns,hl,ng,i1=(ng=class extends El{constructor(){super();Te(this,ml,!0);Te(this,Ns);Te(this,hl);ge(this,hl,r=>{if(!gr&&window.addEventListener){const o=()=>r(!0),i=()=>r(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",i)}}})}onSubscribe(){U(this,Ns)||this.setEventListener(U(this,hl))}onUnsubscribe(){var r;this.hasListeners()||((r=U(this,Ns))==null||r.call(this),ge(this,Ns,void 0))}setEventListener(r){var o;ge(this,hl,r),(o=U(this,Ns))==null||o.call(this),ge(this,Ns,r(this.setOnline.bind(this)))}setOnline(r){U(this,ml)!==r&&(ge(this,ml,r),this.listeners.forEach(i=>{i(r)}))}isOnline(){return U(this,ml)}},ml=new WeakMap,Ns=new WeakMap,hl=new WeakMap,ng),jc=new i1;function c1(s){return Math.min(1e3*2**s,3e4)}function hg(s){return(s??"online")==="online"?jc.isOnline():!0}var df=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function pg(s){let r=!1,o=0,i;const d=uf(),f=()=>d.status!=="pending",h=A=>{var _;if(!f()){const D=new df(A);k(D),(_=s.onCancel)==null||_.call(s,D)}},m=()=>{r=!0},p=()=>{r=!1},x=()=>$f.isFocused()&&(s.networkMode==="always"||jc.isOnline())&&s.canRun(),v=()=>hg(s.networkMode)&&s.canRun(),y=A=>{f()||(i==null||i(),d.resolve(A))},k=A=>{f()||(i==null||i(),d.reject(A))},w=()=>new Promise(A=>{var _;i=D=>{(f()||x())&&A(D)},(_=s.onPause)==null||_.call(s)}).then(()=>{var A;i=void 0,f()||(A=s.onContinue)==null||A.call(s)}),C=()=>{if(f())return;let A;const _=o===0?s.initialPromise:void 0;try{A=_??s.fn()}catch(D){A=Promise.reject(D)}Promise.resolve(A).then(y).catch(D=>{var E;if(f())return;const $=s.retry??(gr?0:3),T=s.retryDelay??c1,j=typeof T=="function"?T(o,D):T,S=$===!0||typeof $=="number"&&o<$||typeof $=="function"&&$(o,D);if(r||!S){k(D);return}o++,(E=s.onFail)==null||E.call(s,o,D),t1(j).then(()=>x()?void 0:w()).then(()=>{r?k(D):C()})})};return{promise:d,status:()=>d.status,cancel:h,continue:()=>(i==null||i(),d),cancelRetry:m,continueRetry:p,canStart:v,start:()=>(v()?C():w().then(C),d)}}var cr,ag,xg=(ag=class{constructor(){Te(this,cr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lf(this.gcTime)&&ge(this,cr,lr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(gr?1/0:300*1e3))}clearGcTimeout(){U(this,cr)&&(lr.clearTimeout(U(this,cr)),ge(this,cr,void 0))}},cr=new WeakMap,ag),ur,pl,Gn,dr,Bt,Lo,fr,Jn,Da,sg,u1=(sg=class extends xg{constructor(r){super();Te(this,Jn);Te(this,ur);Te(this,pl);Te(this,Gn);Te(this,dr);Te(this,Bt);Te(this,Lo);Te(this,fr);ge(this,fr,!1),ge(this,Lo,r.defaultOptions),this.setOptions(r.options),this.observers=[],ge(this,dr,r.client),ge(this,Gn,U(this,dr).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ge(this,ur,c0(this.options)),this.state=r.state??U(this,ur),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=U(this,Bt))==null?void 0:r.promise}setOptions(r){if(this.options={...U(this,Lo),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=c0(this.options);o.data!==void 0&&(this.setState(i0(o.data,o.dataUpdatedAt)),ge(this,ur,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&U(this,Gn).remove(this)}setData(r,o){const i=cf(this.state.data,r,this.options);return Be(this,Jn,Da).call(this,{data:i,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),i}setState(r,o){Be(this,Jn,Da).call(this,{type:"setState",state:r,setStateOptions:o})}cancel(r){var i,d;const o=(i=U(this,Bt))==null?void 0:i.promise;return(d=U(this,Bt))==null||d.cancel(r),o?o.then(an).catch(an):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,ur))}isActive(){return this.observers.some(r=>Qn(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>As(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!dg(this.state.dataUpdatedAt,r)}onFocus(){var o;const r=this.observers.find(i=>i.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(o=U(this,Bt))==null||o.continue()}onOnline(){var o;const r=this.observers.find(i=>i.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(o=U(this,Bt))==null||o.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),U(this,Gn).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(o=>o!==r),this.observers.length||(U(this,Bt)&&(U(this,fr)?U(this,Bt).cancel({revert:!0}):U(this,Bt).cancelRetry()),this.scheduleGc()),U(this,Gn).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,Jn,Da).call(this,{type:"invalidate"})}async fetch(r,o){var p,x,v,y,k,w,C,A,_,D,$,T;if(this.state.fetchStatus!=="idle"&&((p=U(this,Bt))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(U(this,Bt))return U(this,Bt).continueRetry(),U(this,Bt).promise}if(r&&this.setOptions(r),!this.options.queryFn){const j=this.observers.find(S=>S.options.queryFn);j&&this.setOptions(j.options)}const i=new AbortController,d=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(ge(this,fr,!0),i.signal)})},f=()=>{const j=mg(this.options,o),E=(()=>{const B={client:U(this,dr),queryKey:this.queryKey,meta:this.meta};return d(B),B})();return ge(this,fr,!1),this.options.persister?this.options.persister(j,E,this):j(E)},m=(()=>{const j={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:U(this,dr),state:this.state,fetchFn:f};return d(j),j})();(x=this.options.behavior)==null||x.onFetch(m,this),ge(this,pl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=m.fetchOptions)==null?void 0:v.meta))&&Be(this,Jn,Da).call(this,{type:"fetch",meta:(y=m.fetchOptions)==null?void 0:y.meta}),ge(this,Bt,pg({initialPromise:o==null?void 0:o.initialPromise,fn:m.fetchFn,onCancel:j=>{j instanceof df&&j.revert&&this.setState({...U(this,pl),fetchStatus:"idle"}),i.abort()},onFail:(j,S)=>{Be(this,Jn,Da).call(this,{type:"failed",failureCount:j,error:S})},onPause:()=>{Be(this,Jn,Da).call(this,{type:"pause"})},onContinue:()=>{Be(this,Jn,Da).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const j=await U(this,Bt).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(w=(k=U(this,Gn).config).onSuccess)==null||w.call(k,j,this),(A=(C=U(this,Gn).config).onSettled)==null||A.call(C,j,this.state.error,this),j}catch(j){if(j instanceof df){if(j.silent)return U(this,Bt).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Be(this,Jn,Da).call(this,{type:"error",error:j}),(D=(_=U(this,Gn).config).onError)==null||D.call(_,j,this),(T=($=U(this,Gn).config).onSettled)==null||T.call($,this.state.data,j,this),j}finally{this.scheduleGc()}}},ur=new WeakMap,pl=new WeakMap,Gn=new WeakMap,dr=new WeakMap,Bt=new WeakMap,Lo=new WeakMap,fr=new WeakMap,Jn=new WeakSet,Da=function(r){const o=i=>{switch(r.type){case"failed":return{...i,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...gg(i.data,this.options),fetchMeta:r.meta??null};case"success":const d={...i,...i0(r.data,r.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,pl,r.manual?d:void 0),d;case"error":const f=r.error;return{...i,error:f,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...r.state}}};this.state=o(this.state),Lt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),U(this,Gn).notify({query:this,type:"updated",action:r})})},sg);function gg(s,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hg(r.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function i0(s,r){return{data:s,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c0(s){const r=typeof s.initialData=="function"?s.initialData():s.initialData,o=r!==void 0,i=o?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:o?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var pn,Fe,$o,nn,mr,xl,za,Ss,Ho,gl,vl,hr,pr,ws,bl,nt,Ao,ff,mf,hf,pf,xf,gf,vf,vg,rg,d1=(rg=class extends El{constructor(r,o){super();Te(this,nt);Te(this,pn);Te(this,Fe);Te(this,$o);Te(this,nn);Te(this,mr);Te(this,xl);Te(this,za);Te(this,Ss);Te(this,Ho);Te(this,gl);Te(this,vl);Te(this,hr);Te(this,pr);Te(this,ws);Te(this,bl,new Set);this.options=o,ge(this,pn,r),ge(this,Ss,null),ge(this,za,uf()),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,Fe).addObserver(this),u0(U(this,Fe),this.options)?Be(this,nt,Ao).call(this):this.updateResult(),Be(this,nt,pf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bf(U(this,Fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bf(U(this,Fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,nt,xf).call(this),Be(this,nt,gf).call(this),U(this,Fe).removeObserver(this)}setOptions(r){const o=this.options,i=U(this,Fe);if(this.options=U(this,pn).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qn(this.options.enabled,U(this,Fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,nt,vf).call(this),U(this,Fe).setOptions(this.options),o._defaulted&&!yc(this.options,o)&&U(this,pn).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,Fe),observer:this});const d=this.hasListeners();d&&d0(U(this,Fe),i,this.options,o)&&Be(this,nt,Ao).call(this),this.updateResult(),d&&(U(this,Fe)!==i||Qn(this.options.enabled,U(this,Fe))!==Qn(o.enabled,U(this,Fe))||As(this.options.staleTime,U(this,Fe))!==As(o.staleTime,U(this,Fe)))&&Be(this,nt,ff).call(this);const f=Be(this,nt,mf).call(this);d&&(U(this,Fe)!==i||Qn(this.options.enabled,U(this,Fe))!==Qn(o.enabled,U(this,Fe))||f!==U(this,ws))&&Be(this,nt,hf).call(this,f)}getOptimisticResult(r){const o=U(this,pn).getQueryCache().build(U(this,pn),r),i=this.createResult(o,r);return m1(this,i)&&(ge(this,nn,i),ge(this,xl,this.options),ge(this,mr,U(this,Fe).state)),i}getCurrentResult(){return U(this,nn)}trackResult(r,o){return new Proxy(r,{get:(i,d)=>(this.trackProp(d),o==null||o(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&U(this,za).status==="pending"&&U(this,za).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,d))})}trackProp(r){U(this,bl).add(r)}getCurrentQuery(){return U(this,Fe)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const o=U(this,pn).defaultQueryOptions(r),i=U(this,pn).getQueryCache().build(U(this,pn),o);return i.fetch().then(()=>this.createResult(i,o))}fetch(r){return Be(this,nt,Ao).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,nn)))}createResult(r,o){var q;const i=U(this,Fe),d=this.options,f=U(this,nn),h=U(this,mr),m=U(this,xl),x=r!==i?r.state:U(this,$o),{state:v}=r;let y={...v},k=!1,w;if(o._optimisticResults){const K=this.hasListeners(),F=!K&&u0(r,o),re=K&&d0(r,i,o,d);(F||re)&&(y={...y,...gg(v.data,r.options)}),o._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:C,errorUpdatedAt:A,status:_}=y;w=y.data;let D=!1;if(o.placeholderData!==void 0&&w===void 0&&_==="pending"){let K;f!=null&&f.isPlaceholderData&&o.placeholderData===(m==null?void 0:m.placeholderData)?(K=f.data,D=!0):K=typeof o.placeholderData=="function"?o.placeholderData((q=U(this,vl))==null?void 0:q.state.data,U(this,vl)):o.placeholderData,K!==void 0&&(_="success",w=cf(f==null?void 0:f.data,K,o),k=!0)}if(o.select&&w!==void 0&&!D)if(f&&w===(h==null?void 0:h.data)&&o.select===U(this,Ho))w=U(this,gl);else try{ge(this,Ho,o.select),w=o.select(w),w=cf(f==null?void 0:f.data,w,o),ge(this,gl,w),ge(this,Ss,null)}catch(K){ge(this,Ss,K)}U(this,Ss)&&(C=U(this,Ss),w=U(this,gl),A=Date.now(),_="error");const $=y.fetchStatus==="fetching",T=_==="pending",j=_==="error",S=T&&$,E=w!==void 0,te={status:_,fetchStatus:y.fetchStatus,isPending:T,isSuccess:_==="success",isError:j,isInitialLoading:S,isLoading:S,data:w,dataUpdatedAt:y.dataUpdatedAt,error:C,errorUpdatedAt:A,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>x.dataUpdateCount||y.errorUpdateCount>x.errorUpdateCount,isFetching:$,isRefetching:$&&!T,isLoadingError:j&&!E,isPaused:y.fetchStatus==="paused",isPlaceholderData:k,isRefetchError:j&&E,isStale:Hf(r,o),refetch:this.refetch,promise:U(this,za),isEnabled:Qn(o.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const K=te.data!==void 0,F=te.status==="error"&&!K,re=Z=>{F?Z.reject(te.error):K&&Z.resolve(te.data)},we=()=>{const Z=ge(this,za,te.promise=uf());re(Z)},me=U(this,za);switch(me.status){case"pending":r.queryHash===i.queryHash&&re(me);break;case"fulfilled":(F||te.data!==me.value)&&we();break;case"rejected":(!F||te.error!==me.reason)&&we();break}}return te}updateResult(){const r=U(this,nn),o=this.createResult(U(this,Fe),this.options);if(ge(this,mr,U(this,Fe).state),ge(this,xl,this.options),U(this,mr).data!==void 0&&ge(this,vl,U(this,Fe)),yc(o,r))return;ge(this,nn,o);const i=()=>{if(!r)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!U(this,bl).size)return!0;const h=new Set(f??U(this,bl));return this.options.throwOnError&&h.add("error"),Object.keys(U(this,nn)).some(m=>{const p=m;return U(this,nn)[p]!==r[p]&&h.has(p)})};Be(this,nt,vg).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,nt,pf).call(this)}},pn=new WeakMap,Fe=new WeakMap,$o=new WeakMap,nn=new WeakMap,mr=new WeakMap,xl=new WeakMap,za=new WeakMap,Ss=new WeakMap,Ho=new WeakMap,gl=new WeakMap,vl=new WeakMap,hr=new WeakMap,pr=new WeakMap,ws=new WeakMap,bl=new WeakMap,nt=new WeakSet,Ao=function(r){Be(this,nt,vf).call(this);let o=U(this,Fe).fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(an)),o},ff=function(){Be(this,nt,xf).call(this);const r=As(this.options.staleTime,U(this,Fe));if(gr||U(this,nn).isStale||!lf(r))return;const i=dg(U(this,nn).dataUpdatedAt,r)+1;ge(this,hr,lr.setTimeout(()=>{U(this,nn).isStale||this.updateResult()},i))},mf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,Fe)):this.options.refetchInterval)??!1},hf=function(r){Be(this,nt,gf).call(this),ge(this,ws,r),!(gr||Qn(this.options.enabled,U(this,Fe))===!1||!lf(U(this,ws))||U(this,ws)===0)&&ge(this,pr,lr.setInterval(()=>{(this.options.refetchIntervalInBackground||$f.isFocused())&&Be(this,nt,Ao).call(this)},U(this,ws)))},pf=function(){Be(this,nt,ff).call(this),Be(this,nt,hf).call(this,Be(this,nt,mf).call(this))},xf=function(){U(this,hr)&&(lr.clearTimeout(U(this,hr)),ge(this,hr,void 0))},gf=function(){U(this,pr)&&(lr.clearInterval(U(this,pr)),ge(this,pr,void 0))},vf=function(){const r=U(this,pn).getQueryCache().build(U(this,pn),this.options);if(r===U(this,Fe))return;const o=U(this,Fe);ge(this,Fe,r),ge(this,$o,r.state),this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))},vg=function(r){Lt.batch(()=>{r.listeners&&this.listeners.forEach(o=>{o(U(this,nn))}),U(this,pn).getQueryCache().notify({query:U(this,Fe),type:"observerResultsUpdated"})})},rg);function f1(s,r){return Qn(r.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&r.retryOnMount===!1)}function u0(s,r){return f1(s,r)||s.state.data!==void 0&&bf(s,r,r.refetchOnMount)}function bf(s,r,o){if(Qn(r.enabled,s)!==!1&&As(r.staleTime,s)!=="static"){const i=typeof o=="function"?o(s):o;return i==="always"||i!==!1&&Hf(s,r)}return!1}function d0(s,r,o,i){return(s!==r||Qn(i.enabled,s)===!1)&&(!o.suspense||s.state.status!=="error")&&Hf(s,o)}function Hf(s,r){return Qn(r.enabled,s)!==!1&&s.isStaleByTime(As(r.staleTime,s))}function m1(s,r){return!yc(s.getCurrentResult(),r)}function f0(s){return{onFetch:(r,o)=>{var v,y,k,w,C;const i=r.options,d=(k=(y=(v=r.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:k.direction,f=((w=r.state.data)==null?void 0:w.pages)||[],h=((C=r.state.data)==null?void 0:C.pageParams)||[];let m={pages:[],pageParams:[]},p=0;const x=async()=>{let A=!1;const _=T=>{s1(T,()=>r.signal,()=>A=!0)},D=mg(r.options,r.fetchOptions),$=async(T,j,S)=>{if(A)return Promise.reject();if(j==null&&T.pages.length)return Promise.resolve(T);const B=(()=>{const F={client:r.client,queryKey:r.queryKey,pageParam:j,direction:S?"backward":"forward",meta:r.options.meta};return _(F),F})(),te=await D(B),{maxPages:q}=r.options,K=S?a1:n1;return{pages:K(T.pages,te,q),pageParams:K(T.pageParams,j,q)}};if(d&&f.length){const T=d==="backward",j=T?h1:m0,S={pages:f,pageParams:h},E=j(i,S);m=await $(S,E,T)}else{const T=s??f.length;do{const j=p===0?h[0]??i.initialPageParam:m0(i,m);if(p>0&&j==null)break;m=await $(m,j),p++}while(p<T)}return m};r.options.persister?r.fetchFn=()=>{var A,_;return(_=(A=r.options).persister)==null?void 0:_.call(A,x,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},o)}:r.fetchFn=x}}}function m0(s,{pages:r,pageParams:o}){const i=r.length-1;return r.length>0?s.getNextPageParam(r[i],r,o[i],o):void 0}function h1(s,{pages:r,pageParams:o}){var i;return r.length>0?(i=s.getPreviousPageParam)==null?void 0:i.call(s,r[0],r,o[0],o):void 0}var qo,oa,Pt,xr,ia,vs,lg,p1=(lg=class extends xg{constructor(r){super();Te(this,ia);Te(this,qo);Te(this,oa);Te(this,Pt);Te(this,xr);ge(this,qo,r.client),this.mutationId=r.mutationId,ge(this,Pt,r.mutationCache),ge(this,oa,[]),this.state=r.state||bg(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){U(this,oa).includes(r)||(U(this,oa).push(r),this.clearGcTimeout(),U(this,Pt).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ge(this,oa,U(this,oa).filter(o=>o!==r)),this.scheduleGc(),U(this,Pt).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){U(this,oa).length||(this.state.status==="pending"?this.scheduleGc():U(this,Pt).remove(this))}continue(){var r;return((r=U(this,xr))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var h,m,p,x,v,y,k,w,C,A,_,D,$,T,j,S,E,B;const o=()=>{Be(this,ia,vs).call(this,{type:"continue"})},i={client:U(this,qo),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,xr,pg({fn:()=>this.options.mutationFn?this.options.mutationFn(r,i):Promise.reject(new Error("No mutationFn found")),onFail:(te,q)=>{Be(this,ia,vs).call(this,{type:"failed",failureCount:te,error:q})},onPause:()=>{Be(this,ia,vs).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>U(this,Pt).canRun(this)}));const d=this.state.status==="pending",f=!U(this,xr).canStart();try{if(d)o();else{Be(this,ia,vs).call(this,{type:"pending",variables:r,isPaused:f}),U(this,Pt).config.onMutate&&await U(this,Pt).config.onMutate(r,this,i);const q=await((m=(h=this.options).onMutate)==null?void 0:m.call(h,r,i));q!==this.state.context&&Be(this,ia,vs).call(this,{type:"pending",context:q,variables:r,isPaused:f})}const te=await U(this,xr).start();return await((x=(p=U(this,Pt).config).onSuccess)==null?void 0:x.call(p,te,r,this.state.context,this,i)),await((y=(v=this.options).onSuccess)==null?void 0:y.call(v,te,r,this.state.context,i)),await((w=(k=U(this,Pt).config).onSettled)==null?void 0:w.call(k,te,null,this.state.variables,this.state.context,this,i)),await((A=(C=this.options).onSettled)==null?void 0:A.call(C,te,null,r,this.state.context,i)),Be(this,ia,vs).call(this,{type:"success",data:te}),te}catch(te){try{await((D=(_=U(this,Pt).config).onError)==null?void 0:D.call(_,te,r,this.state.context,this,i))}catch(q){Promise.reject(q)}try{await((T=($=this.options).onError)==null?void 0:T.call($,te,r,this.state.context,i))}catch(q){Promise.reject(q)}try{await((S=(j=U(this,Pt).config).onSettled)==null?void 0:S.call(j,void 0,te,this.state.variables,this.state.context,this,i))}catch(q){Promise.reject(q)}try{await((B=(E=this.options).onSettled)==null?void 0:B.call(E,void 0,te,r,this.state.context,i))}catch(q){Promise.reject(q)}throw Be(this,ia,vs).call(this,{type:"error",error:te}),te}finally{U(this,Pt).runNext(this)}}},qo=new WeakMap,oa=new WeakMap,Pt=new WeakMap,xr=new WeakMap,ia=new WeakSet,vs=function(r){const o=i=>{switch(r.type){case"failed":return{...i,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...i,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:r.error,failureCount:i.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=o(this.state),Lt.batch(()=>{U(this,oa).forEach(i=>{i.onMutationUpdate(r)}),U(this,Pt).notify({mutation:this,type:"updated",action:r})})},lg);function bg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ua,Wn,Bo,og,x1=(og=class extends El{constructor(r={}){super();Te(this,Ua);Te(this,Wn);Te(this,Bo);this.config=r,ge(this,Ua,new Set),ge(this,Wn,new Map),ge(this,Bo,0)}build(r,o,i){const d=new p1({client:r,mutationCache:this,mutationId:++ic(this,Bo)._,options:r.defaultMutationOptions(o),state:i});return this.add(d),d}add(r){U(this,Ua).add(r);const o=cc(r);if(typeof o=="string"){const i=U(this,Wn).get(o);i?i.push(r):U(this,Wn).set(o,[r])}this.notify({type:"added",mutation:r})}remove(r){if(U(this,Ua).delete(r)){const o=cc(r);if(typeof o=="string"){const i=U(this,Wn).get(o);if(i)if(i.length>1){const d=i.indexOf(r);d!==-1&&i.splice(d,1)}else i[0]===r&&U(this,Wn).delete(o)}}this.notify({type:"removed",mutation:r})}canRun(r){const o=cc(r);if(typeof o=="string"){const i=U(this,Wn).get(o),d=i==null?void 0:i.find(f=>f.state.status==="pending");return!d||d===r}else return!0}runNext(r){var i;const o=cc(r);if(typeof o=="string"){const d=(i=U(this,Wn).get(o))==null?void 0:i.find(f=>f!==r&&f.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Lt.batch(()=>{U(this,Ua).forEach(r=>{this.notify({type:"removed",mutation:r})}),U(this,Ua).clear(),U(this,Wn).clear()})}getAll(){return Array.from(U(this,Ua))}find(r){const o={exact:!0,...r};return this.getAll().find(i=>r0(o,i))}findAll(r={}){return this.getAll().filter(o=>r0(r,o))}notify(r){Lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}resumePausedMutations(){const r=this.getAll().filter(o=>o.state.isPaused);return Lt.batch(()=>Promise.all(r.map(o=>o.continue().catch(an))))}},Ua=new WeakMap,Wn=new WeakMap,Bo=new WeakMap,og);function cc(s){var r;return(r=s.options.scope)==null?void 0:r.id}var La,ks,xn,$a,qa,pc,yf,ig,g1=(ig=class extends El{constructor(o,i){super();Te(this,qa);Te(this,La);Te(this,ks);Te(this,xn);Te(this,$a);ge(this,La,o),this.setOptions(i),this.bindMethods(),Be(this,qa,pc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(o){var d;const i=this.options;this.options=U(this,La).defaultMutationOptions(o),yc(this.options,i)||U(this,La).getMutationCache().notify({type:"observerOptionsUpdated",mutation:U(this,xn),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&vr(i.mutationKey)!==vr(this.options.mutationKey)?this.reset():((d=U(this,xn))==null?void 0:d.state.status)==="pending"&&U(this,xn).setOptions(this.options)}onUnsubscribe(){var o;this.hasListeners()||(o=U(this,xn))==null||o.removeObserver(this)}onMutationUpdate(o){Be(this,qa,pc).call(this),Be(this,qa,yf).call(this,o)}getCurrentResult(){return U(this,ks)}reset(){var o;(o=U(this,xn))==null||o.removeObserver(this),ge(this,xn,void 0),Be(this,qa,pc).call(this),Be(this,qa,yf).call(this)}mutate(o,i){var d;return ge(this,$a,i),(d=U(this,xn))==null||d.removeObserver(this),ge(this,xn,U(this,La).getMutationCache().build(U(this,La),this.options)),U(this,xn).addObserver(this),U(this,xn).execute(o)}},La=new WeakMap,ks=new WeakMap,xn=new WeakMap,$a=new WeakMap,qa=new WeakSet,pc=function(){var i;const o=((i=U(this,xn))==null?void 0:i.state)??bg();ge(this,ks,{...o,isPending:o.status==="pending",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset})},yf=function(o){Lt.batch(()=>{var i,d,f,h,m,p,x,v;if(U(this,$a)&&this.hasListeners()){const y=U(this,ks).variables,k=U(this,ks).context,w={client:U(this,La),meta:this.options.meta,mutationKey:this.options.mutationKey};if((o==null?void 0:o.type)==="success"){try{(d=(i=U(this,$a)).onSuccess)==null||d.call(i,o.data,y,k,w)}catch(C){Promise.reject(C)}try{(h=(f=U(this,$a)).onSettled)==null||h.call(f,o.data,null,y,k,w)}catch(C){Promise.reject(C)}}else if((o==null?void 0:o.type)==="error"){try{(p=(m=U(this,$a)).onError)==null||p.call(m,o.error,y,k,w)}catch(C){Promise.reject(C)}try{(v=(x=U(this,$a)).onSettled)==null||v.call(x,void 0,o.error,y,k,w)}catch(C){Promise.reject(C)}}}this.listeners.forEach(y=>{y(U(this,ks))})})},ig),ca,cg,v1=(cg=class extends El{constructor(r={}){super();Te(this,ca);this.config=r,ge(this,ca,new Map)}build(r,o,i){const d=o.queryKey,f=o.queryHash??zf(d,o);let h=this.get(f);return h||(h=new u1({client:r,queryKey:d,queryHash:f,options:r.defaultQueryOptions(o),state:i,defaultOptions:r.getQueryDefaults(d)}),this.add(h)),h}add(r){U(this,ca).has(r.queryHash)||(U(this,ca).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const o=U(this,ca).get(r.queryHash);o&&(r.destroy(),o===r&&U(this,ca).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){Lt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return U(this,ca).get(r)}getAll(){return[...U(this,ca).values()]}find(r){const o={exact:!0,...r};return this.getAll().find(i=>s0(o,i))}findAll(r={}){const o=this.getAll();return Object.keys(r).length>0?o.filter(i=>s0(r,i)):o}notify(r){Lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}onFocus(){Lt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){Lt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},ca=new WeakMap,cg),kt,Cs,Es,yl,jl,Ts,Nl,Sl,ug,b1=(ug=class{constructor(s={}){Te(this,kt);Te(this,Cs);Te(this,Es);Te(this,yl);Te(this,jl);Te(this,Ts);Te(this,Nl);Te(this,Sl);ge(this,kt,s.queryCache||new v1),ge(this,Cs,s.mutationCache||new x1),ge(this,Es,s.defaultOptions||{}),ge(this,yl,new Map),ge(this,jl,new Map),ge(this,Ts,0)}mount(){ic(this,Ts)._++,U(this,Ts)===1&&(ge(this,Nl,$f.subscribe(async s=>{s&&(await this.resumePausedMutations(),U(this,kt).onFocus())})),ge(this,Sl,jc.subscribe(async s=>{s&&(await this.resumePausedMutations(),U(this,kt).onOnline())})))}unmount(){var s,r;ic(this,Ts)._--,U(this,Ts)===0&&((s=U(this,Nl))==null||s.call(this),ge(this,Nl,void 0),(r=U(this,Sl))==null||r.call(this),ge(this,Sl,void 0))}isFetching(s){return U(this,kt).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return U(this,Cs).findAll({...s,status:"pending"}).length}getQueryData(s){var o;const r=this.defaultQueryOptions({queryKey:s});return(o=U(this,kt).get(r.queryHash))==null?void 0:o.state.data}ensureQueryData(s){const r=this.defaultQueryOptions(s),o=U(this,kt).build(this,r),i=o.state.data;return i===void 0?this.fetchQuery(s):(s.revalidateIfStale&&o.isStaleByTime(As(r.staleTime,o))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(s){return U(this,kt).findAll(s).map(({queryKey:r,state:o})=>{const i=o.data;return[r,i]})}setQueryData(s,r,o){const i=this.defaultQueryOptions({queryKey:s}),d=U(this,kt).get(i.queryHash),f=d==null?void 0:d.state.data,h=Py(r,f);if(h!==void 0)return U(this,kt).build(this,i).setData(h,{...o,manual:!0})}setQueriesData(s,r,o){return Lt.batch(()=>U(this,kt).findAll(s).map(({queryKey:i})=>[i,this.setQueryData(i,r,o)]))}getQueryState(s){var o;const r=this.defaultQueryOptions({queryKey:s});return(o=U(this,kt).get(r.queryHash))==null?void 0:o.state}removeQueries(s){const r=U(this,kt);Lt.batch(()=>{r.findAll(s).forEach(o=>{r.remove(o)})})}resetQueries(s,r){const o=U(this,kt);return Lt.batch(()=>(o.findAll(s).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...s},r)))}cancelQueries(s,r={}){const o={revert:!0,...r},i=Lt.batch(()=>U(this,kt).findAll(s).map(d=>d.cancel(o)));return Promise.all(i).then(an).catch(an)}invalidateQueries(s,r={}){return Lt.batch(()=>(U(this,kt).findAll(s).forEach(o=>{o.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},r)))}refetchQueries(s,r={}){const o={...r,cancelRefetch:r.cancelRefetch??!0},i=Lt.batch(()=>U(this,kt).findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,o);return o.throwOnError||(f=f.catch(an)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(i).then(an)}fetchQuery(s){const r=this.defaultQueryOptions(s);r.retry===void 0&&(r.retry=!1);const o=U(this,kt).build(this,r);return o.isStaleByTime(As(r.staleTime,o))?o.fetch(r):Promise.resolve(o.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(an).catch(an)}fetchInfiniteQuery(s){return s.behavior=f0(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(an).catch(an)}ensureInfiniteQueryData(s){return s.behavior=f0(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return jc.isOnline()?U(this,Cs).resumePausedMutations():Promise.resolve()}getQueryCache(){return U(this,kt)}getMutationCache(){return U(this,Cs)}getDefaultOptions(){return U(this,Es)}setDefaultOptions(s){ge(this,Es,s)}setQueryDefaults(s,r){U(this,yl).set(vr(s),{queryKey:s,defaultOptions:r})}getQueryDefaults(s){const r=[...U(this,yl).values()],o={};return r.forEach(i=>{Oo(s,i.queryKey)&&Object.assign(o,i.defaultOptions)}),o}setMutationDefaults(s,r){U(this,jl).set(vr(s),{mutationKey:s,defaultOptions:r})}getMutationDefaults(s){const r=[...U(this,jl).values()],o={};return r.forEach(i=>{Oo(s,i.mutationKey)&&Object.assign(o,i.defaultOptions)}),o}defaultQueryOptions(s){if(s._defaulted)return s;const r={...U(this,Es).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return r.queryHash||(r.queryHash=zf(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Uf&&(r.enabled=!1),r}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...U(this,Es).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){U(this,kt).clear(),U(this,Cs).clear()}},kt=new WeakMap,Cs=new WeakMap,Es=new WeakMap,yl=new WeakMap,jl=new WeakMap,Ts=new WeakMap,Nl=new WeakMap,Sl=new WeakMap,ug),yg=b.createContext(void 0),Go=s=>{const r=b.useContext(yg);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},y1=({client:s,children:r})=>(b.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),n.jsx(yg.Provider,{value:s,children:r})),jg=b.createContext(!1),j1=()=>b.useContext(jg);jg.Provider;function N1(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var S1=b.createContext(N1()),w1=()=>b.useContext(S1),k1=(s,r,o)=>{const i=o!=null&&o.state.error&&typeof s.throwOnError=="function"?Lf(s.throwOnError,[o.state.error,o]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||i)&&(r.isReset()||(s.retryOnMount=!1))},C1=s=>{b.useEffect(()=>{s.clearReset()},[s])},E1=({result:s,errorResetBoundary:r,throwOnError:o,query:i,suspense:d})=>s.isError&&!r.isReset()&&!s.isFetching&&i&&(d&&s.data===void 0||Lf(o,[s.error,i])),T1=s=>{if(s.suspense){const o=d=>d==="static"?d:Math.max(d??1e3,1e3),i=s.staleTime;s.staleTime=typeof i=="function"?(...d)=>o(i(...d)):o(i),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},M1=(s,r)=>s.isLoading&&s.isFetching&&!r,A1=(s,r)=>(s==null?void 0:s.suspense)&&r.isPending,h0=(s,r,o)=>r.fetchOptimistic(s).catch(()=>{o.clearReset()});function _1(s,r,o){var k,w,C,A;const i=j1(),d=w1(),f=Go(),h=f.defaultQueryOptions(s);(w=(k=f.getDefaultOptions().queries)==null?void 0:k._experimental_beforeQuery)==null||w.call(k,h);const m=f.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",T1(h),k1(h,d,m),C1(d);const p=!f.getQueryCache().get(h.queryHash),[x]=b.useState(()=>new r(f,h)),v=x.getOptimisticResult(h),y=!i&&s.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(_=>{const D=y?x.subscribe(Lt.batchCalls(_)):an;return x.updateResult(),D},[x,y]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),b.useEffect(()=>{x.setOptions(h)},[h,x]),A1(h,v))throw h0(h,x,d);if(E1({result:v,errorResetBoundary:d,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw v.error;if((A=(C=f.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||A.call(C,h,v),h.experimental_prefetchInRender&&!gr&&M1(v,i)){const _=p?h0(h,x,d):m==null?void 0:m.promise;_==null||_.catch(an).finally(()=>{x.updateResult()})}return h.notifyOnChangeProps?v:x.trackResult(v)}function ln(s,r){return _1(s,d1)}function jf(s,r){const o=Go(),[i]=b.useState(()=>new g1(o,s));b.useEffect(()=>{i.setOptions(s)},[i,s]);const d=b.useSyncExternalStore(b.useCallback(h=>i.subscribe(Lt.batchCalls(h)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),f=b.useCallback((h,m)=>{i.mutate(h,m).catch(an)},[i]);if(d.error&&Lf(i.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}const O1=new b1({defaultOptions:{queries:{staleTime:5e3,retry:1}}}),qf="axl.studio.theme",Ng="(prefers-color-scheme: dark)",p0="dark",R1=["auto","light","dark"];function Bf(){try{const s=localStorage.getItem(qf);if(s&&R1.includes(s))return s}catch{}return"auto"}function D1(s){try{localStorage.setItem(qf,s)}catch{}}function z1(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia(Ng).matches?"dark":"light"}function Gf(s){return s==="auto"?z1():s}function Qf(s){if(typeof document>"u")return;const r=document.documentElement;s==="dark"?r.classList.add(p0):r.classList.remove(p0)}function Sg(s){if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(Ng),o=()=>{const d=Bf();s(d,Gf(d))},i=d=>{d.key!==null&&d.key!==qf||o()};return r.addEventListener("change",o),window.addEventListener("storage",i),()=>{r.removeEventListener("change",o),window.removeEventListener("storage",i)}}function U1(){return Sg((s,r)=>{Qf(r)})}function L1(s){return s==="auto"?"light":s==="light"?"dark":"auto"}/**
|
|
50
|
+
* react-router v7.13.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var x0="popstate";function $1(s={}){function r(i,d){let{pathname:f,search:h,hash:m}=i.location;return Nf("",{pathname:f,search:h,hash:m},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function o(i,d){return typeof d=="string"?d:Ro(d)}return q1(r,o,null,s)}function yt(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function Pn(s,r){if(!s){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function H1(){return Math.random().toString(36).substring(2,10)}function g0(s,r){return{usr:s.state,key:s.key,idx:r}}function Nf(s,r,o=null,i){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof r=="string"?Tl(r):r,state:o,key:r&&r.key||i||H1()}}function Ro({pathname:s="/",search:r="",hash:o=""}){return r&&r!=="?"&&(s+=r.charAt(0)==="?"?r:"?"+r),o&&o!=="#"&&(s+=o.charAt(0)==="#"?o:"#"+o),s}function Tl(s){let r={};if(s){let o=s.indexOf("#");o>=0&&(r.hash=s.substring(o),s=s.substring(0,o));let i=s.indexOf("?");i>=0&&(r.search=s.substring(i),s=s.substring(0,i)),s&&(r.pathname=s)}return r}function q1(s,r,o,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,h=d.history,m="POP",p=null,x=v();x==null&&(x=0,h.replaceState({...h.state,idx:x},""));function v(){return(h.state||{idx:null}).idx}function y(){m="POP";let _=v(),D=_==null?null:_-x;x=_,p&&p({action:m,location:A.location,delta:D})}function k(_,D){m="PUSH";let $=Nf(A.location,_,D);x=v()+1;let T=g0($,x),j=A.createHref($);try{h.pushState(T,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;d.location.assign(j)}f&&p&&p({action:m,location:A.location,delta:1})}function w(_,D){m="REPLACE";let $=Nf(A.location,_,D);x=v();let T=g0($,x),j=A.createHref($);h.replaceState(T,"",j),f&&p&&p({action:m,location:A.location,delta:0})}function C(_){return B1(_)}let A={get action(){return m},get location(){return s(d,h)},listen(_){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(x0,y),p=_,()=>{d.removeEventListener(x0,y),p=null}},createHref(_){return r(d,_)},createURL:C,encodeLocation(_){let D=C(_);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:k,replace:w,go(_){return h.go(_)}};return A}function B1(s,r=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),yt(o,"No window.location.(origin|href) available to create URL");let i=typeof s=="string"?s:Ro(s);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=o+i),new URL(i,o)}function wg(s,r,o="/"){return G1(s,r,o,!1)}function G1(s,r,o,i){let d=typeof r=="string"?Tl(r):r,f=Ba(d.pathname||"/",o);if(f==null)return null;let h=kg(s);Q1(h);let m=null;for(let p=0;m==null&&p<h.length;++p){let x=ej(f);m=W1(h[p],x,i)}return m}function kg(s,r=[],o=[],i="",d=!1){let f=(h,m,p=d,x)=>{let v={relativePath:x===void 0?h.path||"":x,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(i)&&p)return;yt(v.relativePath.startsWith(i),`Absolute route path "${v.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(i.length)}let y=Ha([i,v.relativePath]),k=o.concat(v);h.children&&h.children.length>0&&(yt(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),kg(h.children,r,k,y,p)),!(h.path==null&&!h.index)&&r.push({path:y,score:Z1(y,h.index),routesMeta:k})};return s.forEach((h,m)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))f(h,m);else for(let x of Cg(h.path))f(h,m,!0,x)}),r}function Cg(s){let r=s.split("/");if(r.length===0)return[];let[o,...i]=r,d=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let h=Cg(i.join("/")),m=[];return m.push(...h.map(p=>p===""?f:[f,p].join("/"))),d&&m.push(...h),m.map(p=>s.startsWith("/")&&p===""?"/":p)}function Q1(s){s.sort((r,o)=>r.score!==o.score?o.score-r.score:J1(r.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Y1=/^:[\w-]+$/,K1=3,V1=2,X1=1,F1=10,I1=-2,v0=s=>s==="*";function Z1(s,r){let o=s.split("/"),i=o.length;return o.some(v0)&&(i+=I1),r&&(i+=V1),o.filter(d=>!v0(d)).reduce((d,f)=>d+(Y1.test(f)?K1:f===""?X1:F1),i)}function J1(s,r){return s.length===r.length&&s.slice(0,-1).every((i,d)=>i===r[d])?s[s.length-1]-r[r.length-1]:0}function W1(s,r,o=!1){let{routesMeta:i}=s,d={},f="/",h=[];for(let m=0;m<i.length;++m){let p=i[m],x=m===i.length-1,v=f==="/"?r:r.slice(f.length)||"/",y=Nc({path:p.relativePath,caseSensitive:p.caseSensitive,end:x},v),k=p.route;if(!y&&x&&o&&!i[i.length-1].route.index&&(y=Nc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!y)return null;Object.assign(d,y.params),h.push({params:d,pathname:Ha([f,y.pathname]),pathnameBase:sj(Ha([f,y.pathnameBase])),route:k}),y.pathnameBase!=="/"&&(f=Ha([f,y.pathnameBase]))}return h}function Nc(s,r){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[o,i]=P1(s.path,s.caseSensitive,s.end),d=r.match(o);if(!d)return null;let f=d[0],h=f.replace(/(.)\/+$/,"$1"),m=d.slice(1);return{params:i.reduce((x,{paramName:v,isOptional:y},k)=>{if(v==="*"){let C=m[k]||"";h=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const w=m[k];return y&&!w?x[v]=void 0:x[v]=(w||"").replace(/%2F/g,"/"),x},{}),pathname:f,pathnameBase:h,pattern:s}}function P1(s,r=!1,o=!0){Pn(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let i=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p)=>(i.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(i.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,r?void 0:"i"),i]}function ej(s){try{return s.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Pn(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),s}}function Ba(s,r){if(r==="/")return s;if(!s.toLowerCase().startsWith(r.toLowerCase()))return null;let o=r.endsWith("/")?r.length-1:r.length,i=s.charAt(o);return i&&i!=="/"?null:s.slice(o)||"/"}var tj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function nj(s,r="/"){let{pathname:o,search:i="",hash:d=""}=typeof s=="string"?Tl(s):s,f;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?f=b0(o.substring(1),"/"):f=b0(o,r)):f=r,{pathname:f,search:rj(i),hash:lj(d)}}function b0(s,r){let o=r.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function Jd(s,r,o,i){return`Cannot include a '${s}' character in a manually specified \`to.${r}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aj(s){return s.filter((r,o)=>o===0||r.route.path&&r.route.path.length>0)}function Yf(s){let r=aj(s);return r.map((o,i)=>i===r.length-1?o.pathname:o.pathnameBase)}function Kf(s,r,o,i=!1){let d;typeof s=="string"?d=Tl(s):(d={...s},yt(!d.pathname||!d.pathname.includes("?"),Jd("?","pathname","search",d)),yt(!d.pathname||!d.pathname.includes("#"),Jd("#","pathname","hash",d)),yt(!d.search||!d.search.includes("#"),Jd("#","search","hash",d)));let f=s===""||d.pathname==="",h=f?"/":d.pathname,m;if(h==null)m=o;else{let y=r.length-1;if(!i&&h.startsWith("..")){let k=h.split("/");for(;k[0]==="..";)k.shift(),y-=1;d.pathname=k.join("/")}m=y>=0?r[y]:"/"}let p=nj(d,m),x=h&&h!=="/"&&h.endsWith("/"),v=(f||h===".")&&o.endsWith("/");return!p.pathname.endsWith("/")&&(x||v)&&(p.pathname+="/"),p}var Ha=s=>s.join("/").replace(/\/\/+/g,"/"),sj=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),rj=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,lj=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,oj=class{constructor(s,r,o,i=!1){this.status=s,this.statusText=r||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function ij(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function cj(s){return s.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Eg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tg(s,r){let o=s;if(typeof o!="string"||!tj.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,d=!1;if(Eg)try{let f=new URL(window.location.href),h=o.startsWith("//")?new URL(f.protocol+o):new URL(o),m=Ba(h.pathname,r);h.origin===f.origin&&m!=null?o=m+h.search+h.hash:d=!0}catch{Pn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Mg=["POST","PUT","PATCH","DELETE"];new Set(Mg);var uj=["GET",...Mg];new Set(uj);var Ml=b.createContext(null);Ml.displayName="DataRouter";var _c=b.createContext(null);_c.displayName="DataRouterState";var dj=b.createContext(!1),Ag=b.createContext({isTransitioning:!1});Ag.displayName="ViewTransition";var fj=b.createContext(new Map);fj.displayName="Fetchers";var mj=b.createContext(null);mj.displayName="Await";var On=b.createContext(null);On.displayName="Navigation";var Qo=b.createContext(null);Qo.displayName="Location";var da=b.createContext({outlet:null,matches:[],isDataRoute:!1});da.displayName="Route";var Vf=b.createContext(null);Vf.displayName="RouteError";var _g="REACT_ROUTER_ERROR",hj="REDIRECT",pj="ROUTE_ERROR_RESPONSE";function xj(s){if(s.startsWith(`${_g}:${hj}:{`))try{let r=JSON.parse(s.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function gj(s){if(s.startsWith(`${_g}:${pj}:{`))try{let r=JSON.parse(s.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new oj(r.status,r.statusText,r.data)}catch{}}function vj(s,{relative:r}={}){yt(Al(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=b.useContext(On),{hash:d,pathname:f,search:h}=Yo(s,{relative:r}),m=f;return o!=="/"&&(m=f==="/"?o:Ha([o,f])),i.createHref({pathname:m,search:h,hash:d})}function Al(){return b.useContext(Qo)!=null}function Rs(){return yt(Al(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Qo).location}var Og="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rg(s){b.useContext(On).static||b.useLayoutEffect(s)}function Dg(){let{isDataRoute:s}=b.useContext(da);return s?_j():bj()}function bj(){yt(Al(),"useNavigate() may be used only in the context of a <Router> component.");let s=b.useContext(Ml),{basename:r,navigator:o}=b.useContext(On),{matches:i}=b.useContext(da),{pathname:d}=Rs(),f=JSON.stringify(Yf(i)),h=b.useRef(!1);return Rg(()=>{h.current=!0}),b.useCallback((p,x={})=>{if(Pn(h.current,Og),!h.current)return;if(typeof p=="number"){o.go(p);return}let v=Kf(p,JSON.parse(f),d,x.relative==="path");s==null&&r!=="/"&&(v.pathname=v.pathname==="/"?r:Ha([r,v.pathname])),(x.replace?o.replace:o.push)(v,x.state,x)},[r,o,f,d,s])}b.createContext(null);function Yo(s,{relative:r}={}){let{matches:o}=b.useContext(da),{pathname:i}=Rs(),d=JSON.stringify(Yf(o));return b.useMemo(()=>Kf(s,JSON.parse(d),i,r==="path"),[s,d,i,r])}function yj(s,r){return zg(s,r)}function zg(s,r,o,i,d){var $;yt(Al(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=b.useContext(On),{matches:h}=b.useContext(da),m=h[h.length-1],p=m?m.params:{},x=m?m.pathname:"/",v=m?m.pathnameBase:"/",y=m&&m.route;{let T=y&&y.path||"";Lg(x,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let k=Rs(),w;if(r){let T=typeof r=="string"?Tl(r):r;yt(v==="/"||(($=T.pathname)==null?void 0:$.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${T.pathname}" was given in the \`location\` prop.`),w=T}else w=k;let C=w.pathname||"/",A=C;if(v!=="/"){let T=v.replace(/^\//,"").split("/");A="/"+C.replace(/^\//,"").split("/").slice(T.length).join("/")}let _=wg(s,{pathname:A});Pn(y||_!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),Pn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let D=kj(_&&_.map(T=>Object.assign({},T,{params:Object.assign({},p,T.params),pathname:Ha([v,f.encodeLocation?f.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?v:Ha([v,f.encodeLocation?f.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),h,o,i,d);return r&&D?b.createElement(Qo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},D):D}function jj(){let s=Aj(),r=ij(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),o=s instanceof Error?s.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",s),h=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},r),o?b.createElement("pre",{style:d},o):null,h)}var Nj=b.createElement(jj,null),Ug=class extends b.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,r){return r.location!==s.location||r.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:r.error,location:r.location,revalidation:s.revalidation||r.revalidation}}componentDidCatch(s,r){this.props.onError?this.props.onError(s,r):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const o=gj(s.digest);o&&(s=o)}let r=s!==void 0?b.createElement(da.Provider,{value:this.props.routeContext},b.createElement(Vf.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?b.createElement(Sj,{error:s},r):r}};Ug.contextType=dj;var Wd=new WeakMap;function Sj({children:s,error:r}){let{basename:o}=b.useContext(On);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let i=xj(r.digest);if(i){let d=Wd.get(r);if(d)throw d;let f=Tg(i.location,o);if(Eg&&!Wd.get(r))if(f.isExternal||i.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw Wd.set(r,h),h}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return s}function wj({routeContext:s,match:r,children:o}){let i=b.useContext(Ml);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(da.Provider,{value:s},o)}function kj(s,r=[],o=null,i=null,d=null){if(s==null){if(!o)return null;if(o.errors)s=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)s=o.matches;else return null}let f=s,h=o==null?void 0:o.errors;if(h!=null){let v=f.findIndex(y=>y.route.id&&(h==null?void 0:h[y.route.id])!==void 0);yt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,v+1))}let m=!1,p=-1;if(o)for(let v=0;v<f.length;v++){let y=f[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=v),y.route.id){let{loaderData:k,errors:w}=o,C=y.route.loader&&!k.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||C){m=!0,p>=0?f=f.slice(0,p+1):f=[f[0]];break}}}let x=o&&i?(v,y)=>{var k,w;i(v,{location:o.location,params:((w=(k=o.matches)==null?void 0:k[0])==null?void 0:w.params)??{},unstable_pattern:cj(o.matches),errorInfo:y})}:void 0;return f.reduceRight((v,y,k)=>{let w,C=!1,A=null,_=null;o&&(w=h&&y.route.id?h[y.route.id]:void 0,A=y.route.errorElement||Nj,m&&(p<0&&k===0?(Lg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,_=null):p===k&&(C=!0,_=y.route.hydrateFallbackElement||null)));let D=r.concat(f.slice(0,k+1)),$=()=>{let T;return w?T=A:C?T=_:y.route.Component?T=b.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=v,b.createElement(wj,{match:y,routeContext:{outlet:v,matches:D,isDataRoute:o!=null},children:T})};return o&&(y.route.ErrorBoundary||y.route.errorElement||k===0)?b.createElement(Ug,{location:o.location,revalidation:o.revalidation,component:A,error:w,children:$(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:x}):$()},null)}function Xf(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Cj(s){let r=b.useContext(Ml);return yt(r,Xf(s)),r}function Ej(s){let r=b.useContext(_c);return yt(r,Xf(s)),r}function Tj(s){let r=b.useContext(da);return yt(r,Xf(s)),r}function Ff(s){let r=Tj(s),o=r.matches[r.matches.length-1];return yt(o.route.id,`${s} can only be used on routes that contain a unique "id"`),o.route.id}function Mj(){return Ff("useRouteId")}function Aj(){var i;let s=b.useContext(Vf),r=Ej("useRouteError"),o=Ff("useRouteError");return s!==void 0?s:(i=r.errors)==null?void 0:i[o]}function _j(){let{router:s}=Cj("useNavigate"),r=Ff("useNavigate"),o=b.useRef(!1);return Rg(()=>{o.current=!0}),b.useCallback(async(d,f={})=>{Pn(o.current,Og),o.current&&(typeof d=="number"?await s.navigate(d):await s.navigate(d,{fromRouteId:r,...f}))},[s,r])}var y0={};function Lg(s,r,o){!r&&!y0[s]&&(y0[s]=!0,Pn(!1,o))}b.memo(Oj);function Oj({routes:s,future:r,state:o,onError:i}){return zg(s,void 0,o,i,r)}function Rj({to:s,replace:r,state:o,relative:i}){yt(Al(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=b.useContext(On);Pn(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=b.useContext(da),{pathname:h}=Rs(),m=Dg(),p=Kf(s,Yf(f),h,i==="path"),x=JSON.stringify(p);return b.useEffect(()=>{m(JSON.parse(x),{replace:r,state:o,relative:i})},[m,x,i,r,o]),null}function la(s){yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Dj({basename:s="/",children:r=null,location:o,navigationType:i="POP",navigator:d,static:f=!1,unstable_useTransitions:h}){yt(!Al(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:d,static:f,unstable_useTransitions:h,future:{}}),[m,d,f,h]);typeof o=="string"&&(o=Tl(o));let{pathname:x="/",search:v="",hash:y="",state:k=null,key:w="default"}=o,C=b.useMemo(()=>{let A=Ba(x,m);return A==null?null:{location:{pathname:A,search:v,hash:y,state:k,key:w},navigationType:i}},[m,x,v,y,k,w,i]);return Pn(C!=null,`<Router basename="${m}"> is not able to match the URL "${x}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:b.createElement(On.Provider,{value:p},b.createElement(Qo.Provider,{children:r,value:C}))}function zj({children:s,location:r}){return yj(Sf(s),r)}function Sf(s,r=[]){let o=[];return b.Children.forEach(s,(i,d)=>{if(!b.isValidElement(i))return;let f=[...r,d];if(i.type===b.Fragment){o.push.apply(o,Sf(i.props.children,f));return}yt(i.type===la,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let h={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(h.children=Sf(i.props.children,f)),o.push(h)}),o}var xc="get",gc="application/x-www-form-urlencoded";function Oc(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function Uj(s){return Oc(s)&&s.tagName.toLowerCase()==="button"}function Lj(s){return Oc(s)&&s.tagName.toLowerCase()==="form"}function $j(s){return Oc(s)&&s.tagName.toLowerCase()==="input"}function Hj(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function qj(s,r){return s.button===0&&(!r||r==="_self")&&!Hj(s)}var uc=null;function Bj(){if(uc===null)try{new FormData(document.createElement("form"),0),uc=!1}catch{uc=!0}return uc}var Gj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pd(s){return s!=null&&!Gj.has(s)?(Pn(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gc}"`),null):s}function Qj(s,r){let o,i,d,f,h;if(Lj(s)){let m=s.getAttribute("action");i=m?Ba(m,r):null,o=s.getAttribute("method")||xc,d=Pd(s.getAttribute("enctype"))||gc,f=new FormData(s)}else if(Uj(s)||$j(s)&&(s.type==="submit"||s.type==="image")){let m=s.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=s.getAttribute("formaction")||m.getAttribute("action");if(i=p?Ba(p,r):null,o=s.getAttribute("formmethod")||m.getAttribute("method")||xc,d=Pd(s.getAttribute("formenctype"))||Pd(m.getAttribute("enctype"))||gc,f=new FormData(m,s),!Bj()){let{name:x,type:v,value:y}=s;if(v==="image"){let k=x?`${x}.`:"";f.append(`${k}x`,"0"),f.append(`${k}y`,"0")}else x&&f.append(x,y)}}else{if(Oc(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=xc,i=null,d=gc,h=s}return f&&d==="text/plain"&&(h=f,f=void 0),{action:i,method:o.toLowerCase(),encType:d,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function If(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function Yj(s,r,o,i){let d=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return o?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${i}`:d.pathname=`${d.pathname}.${i}`:d.pathname==="/"?d.pathname=`_root.${i}`:r&&Ba(d.pathname,r)==="/"?d.pathname=`${r.replace(/\/$/,"")}/_root.${i}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${i}`,d}async function Kj(s,r){if(s.id in r)return r[s.id];try{let o=await import(s.module);return r[s.id]=o,o}catch(o){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vj(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function Xj(s,r,o){let i=await Promise.all(s.map(async d=>{let f=r.routes[d.route.id];if(f){let h=await Kj(f,o);return h.links?h.links():[]}return[]}));return Jj(i.flat(1).filter(Vj).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function j0(s,r,o,i,d,f){let h=(p,x)=>o[x]?p.route.id!==o[x].route.id:!0,m=(p,x)=>{var v;return o[x].pathname!==p.pathname||((v=o[x].route.path)==null?void 0:v.endsWith("*"))&&o[x].params["*"]!==p.params["*"]};return f==="assets"?r.filter((p,x)=>h(p,x)||m(p,x)):f==="data"?r.filter((p,x)=>{var y;let v=i.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(h(p,x)||m(p,x))return!0;if(p.route.shouldRevalidate){let k=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((y=o[0])==null?void 0:y.params)||{},nextUrl:new URL(s,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof k=="boolean")return k}return!0}):[]}function Fj(s,r,{includeHydrateFallback:o}={}){return Ij(s.map(i=>{let d=r.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),o&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function Ij(s){return[...new Set(s)]}function Zj(s){let r={},o=Object.keys(s).sort();for(let i of o)r[i]=s[i];return r}function Jj(s,r){let o=new Set;return new Set(r),s.reduce((i,d)=>{let f=JSON.stringify(Zj(d));return o.has(f)||(o.add(f),i.push({key:f,link:d})),i},[])}function $g(){let s=b.useContext(Ml);return If(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Wj(){let s=b.useContext(_c);return If(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Zf=b.createContext(void 0);Zf.displayName="FrameworkContext";function Hg(){let s=b.useContext(Zf);return If(s,"You must render this element inside a <HydratedRouter> element"),s}function Pj(s,r){let o=b.useContext(Zf),[i,d]=b.useState(!1),[f,h]=b.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:x,onMouseLeave:v,onTouchStart:y}=r,k=b.useRef(null);b.useEffect(()=>{if(s==="render"&&h(!0),s==="viewport"){let A=D=>{D.forEach($=>{h($.isIntersecting)})},_=new IntersectionObserver(A,{threshold:.5});return k.current&&_.observe(k.current),()=>{_.disconnect()}}},[s]),b.useEffect(()=>{if(i){let A=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(A)}}},[i]);let w=()=>{d(!0)},C=()=>{d(!1),h(!1)};return o?s!=="intent"?[f,k,{}]:[f,k,{onFocus:Co(m,w),onBlur:Co(p,C),onMouseEnter:Co(x,w),onMouseLeave:Co(v,C),onTouchStart:Co(y,w)}]:[!1,k,{}]}function Co(s,r){return o=>{s&&s(o),o.defaultPrevented||r(o)}}function eN({page:s,...r}){let{router:o}=$g(),i=b.useMemo(()=>wg(o.routes,s,o.basename),[o.routes,s,o.basename]);return i?b.createElement(nN,{page:s,matches:i,...r}):null}function tN(s){let{manifest:r,routeModules:o}=Hg(),[i,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return Xj(s,r,o).then(h=>{f||d(h)}),()=>{f=!0}},[s,r,o]),i}function nN({page:s,matches:r,...o}){let i=Rs(),{future:d,manifest:f,routeModules:h}=Hg(),{basename:m}=$g(),{loaderData:p,matches:x}=Wj(),v=b.useMemo(()=>j0(s,r,x,f,i,"data"),[s,r,x,f,i]),y=b.useMemo(()=>j0(s,r,x,f,i,"assets"),[s,r,x,f,i]),k=b.useMemo(()=>{if(s===i.pathname+i.search+i.hash)return[];let A=new Set,_=!1;if(r.forEach($=>{var j;let T=f.routes[$.route.id];!T||!T.hasLoader||(!v.some(S=>S.route.id===$.route.id)&&$.route.id in p&&((j=h[$.route.id])!=null&&j.shouldRevalidate)||T.hasClientLoader?_=!0:A.add($.route.id))}),A.size===0)return[];let D=Yj(s,m,d.unstable_trailingSlashAwareDataRequests,"data");return _&&A.size>0&&D.searchParams.set("_routes",r.filter($=>A.has($.route.id)).map($=>$.route.id).join(",")),[D.pathname+D.search]},[m,d.unstable_trailingSlashAwareDataRequests,p,i,f,v,r,s,h]),w=b.useMemo(()=>Fj(y,f),[y,f]),C=tN(y);return b.createElement(b.Fragment,null,k.map(A=>b.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...o})),w.map(A=>b.createElement("link",{key:A,rel:"modulepreload",href:A,...o})),C.map(({key:A,link:_})=>b.createElement("link",{key:A,nonce:o.nonce,..._,crossOrigin:_.crossOrigin??o.crossOrigin})))}function aN(...s){return r=>{s.forEach(o=>{typeof o=="function"?o(r):o!=null&&(o.current=r)})}}var sN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{sN&&(window.__reactRouterVersion="7.13.0")}catch{}function rN({basename:s,children:r,unstable_useTransitions:o,window:i}){let d=b.useRef();d.current==null&&(d.current=$1({window:i,v5Compat:!0}));let f=d.current,[h,m]=b.useState({action:f.action,location:f.location}),p=b.useCallback(x=>{o===!1?m(x):b.startTransition(()=>m(x))},[o]);return b.useLayoutEffect(()=>f.listen(p),[f,p]),b.createElement(Dj,{basename:s,children:r,location:h.location,navigationType:h.action,navigator:f,unstable_useTransitions:o})}var qg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bg=b.forwardRef(function({onClick:r,discover:o="render",prefetch:i="none",relative:d,reloadDocument:f,replace:h,state:m,target:p,to:x,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},C){let{basename:A,unstable_useTransitions:_}=b.useContext(On),D=typeof x=="string"&&qg.test(x),$=Tg(x,A);x=$.to;let T=vj(x,{relative:d}),[j,S,E]=Pj(i,w),B=iN(x,{replace:h,state:m,target:p,preventScrollReset:v,relative:d,viewTransition:y,unstable_defaultShouldRevalidate:k,unstable_useTransitions:_});function te(K){r&&r(K),K.defaultPrevented||B(K)}let q=b.createElement("a",{...w,...E,href:$.absoluteURL||T,onClick:$.isExternal||f?r:te,ref:aN(C,S),target:p,"data-discover":!D&&o==="render"?"true":void 0});return j&&!D?b.createElement(b.Fragment,null,q,b.createElement(eN,{page:T})):q});Bg.displayName="Link";var Gg=b.forwardRef(function({"aria-current":r="page",caseSensitive:o=!1,className:i="",end:d=!1,style:f,to:h,viewTransition:m,children:p,...x},v){let y=Yo(h,{relative:x.relative}),k=Rs(),w=b.useContext(_c),{navigator:C,basename:A}=b.useContext(On),_=w!=null&&mN(y)&&m===!0,D=C.encodeLocation?C.encodeLocation(y).pathname:y.pathname,$=k.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||($=$.toLowerCase(),T=T?T.toLowerCase():null,D=D.toLowerCase()),T&&A&&(T=Ba(T,A)||T);const j=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let S=$===D||!d&&$.startsWith(D)&&$.charAt(j)==="/",E=T!=null&&(T===D||!d&&T.startsWith(D)&&T.charAt(D.length)==="/"),B={isActive:S,isPending:E,isTransitioning:_},te=S?r:void 0,q;typeof i=="function"?q=i(B):q=[i,S?"active":null,E?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let K=typeof f=="function"?f(B):f;return b.createElement(Bg,{...x,"aria-current":te,className:q,ref:v,style:K,to:h,viewTransition:m},typeof p=="function"?p(B):p)});Gg.displayName="NavLink";var lN=b.forwardRef(({discover:s="render",fetcherKey:r,navigate:o,reloadDocument:i,replace:d,state:f,method:h=xc,action:m,onSubmit:p,relative:x,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},C)=>{let{unstable_useTransitions:A}=b.useContext(On),_=dN(),D=fN(m,{relative:x}),$=h.toLowerCase()==="get"?"get":"post",T=typeof m=="string"&&qg.test(m),j=S=>{if(p&&p(S),S.defaultPrevented)return;S.preventDefault();let E=S.nativeEvent.submitter,B=(E==null?void 0:E.getAttribute("formmethod"))||h,te=()=>_(E||S.currentTarget,{fetcherKey:r,method:B,navigate:o,replace:d,state:f,relative:x,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:k});A&&o!==!1?b.startTransition(()=>te()):te()};return b.createElement("form",{ref:C,method:$,action:D,onSubmit:i?p:j,...w,"data-discover":!T&&s==="render"?"true":void 0})});lN.displayName="Form";function oN(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qg(s){let r=b.useContext(Ml);return yt(r,oN(s)),r}function iN(s,{target:r,replace:o,state:i,preventScrollReset:d,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m,unstable_useTransitions:p}={}){let x=Dg(),v=Rs(),y=Yo(s,{relative:f});return b.useCallback(k=>{if(qj(k,r)){k.preventDefault();let w=o!==void 0?o:Ro(v)===Ro(y),C=()=>x(s,{replace:w,state:i,preventScrollReset:d,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m});p?b.startTransition(()=>C()):C()}},[v,x,y,o,i,r,s,d,f,h,m,p])}var cN=0,uN=()=>`__${String(++cN)}__`;function dN(){let{router:s}=Qg("useSubmit"),{basename:r}=b.useContext(On),o=Mj(),i=s.fetch,d=s.navigate;return b.useCallback(async(f,h={})=>{let{action:m,method:p,encType:x,formData:v,body:y}=Qj(f,r);if(h.navigate===!1){let k=h.fetcherKey||uN();await i(k,o,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||x,flushSync:h.flushSync})}else await d(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||x,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,d,r,o])}function fN(s,{relative:r}={}){let{basename:o}=b.useContext(On),i=b.useContext(da);yt(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...Yo(s||".",{relative:r})},h=Rs();if(s==null){f.search=h.search;let m=new URLSearchParams(f.search),p=m.getAll("index");if(p.some(v=>v==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let v=m.toString();f.search=v?`?${v}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:Ha([o,f.pathname])),Ro(f)}function mN(s,{relative:r}={}){let o=b.useContext(Ag);yt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Qg("useViewTransitionState"),d=Yo(s,{relative:r});if(!o.isTransitioning)return!1;let f=Ba(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Ba(o.nextLocation.pathname,i)||o.nextLocation.pathname;return Nc(d.pathname,h)!=null||Nc(d.pathname,f)!=null}/**
|
|
61
|
+
* @license lucide-react v0.474.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const hN=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yg=(...s)=>s.filter((r,o,i)=>!!r&&r.trim()!==""&&i.indexOf(r)===o).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.474.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var pN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
|
+
* @license lucide-react v0.474.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const xN=b.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:h,...m},p)=>b.createElement("svg",{ref:p,...pN,width:r,height:r,stroke:s,strokeWidth:i?Number(o)*24/Number(r):o,className:Yg("lucide",d),...m},[...h.map(([x,v])=>b.createElement(x,v)),...Array.isArray(f)?f:[f]]));/**
|
|
76
|
+
* @license lucide-react v0.474.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Re=(s,r)=>{const o=b.forwardRef(({className:i,...d},f)=>b.createElement(xN,{ref:f,iconNode:r,className:Yg(`lucide-${hN(s)}`,i),...d}));return o.displayName=`${s}`,o};/**
|
|
81
|
+
* @license lucide-react v0.474.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const gN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Rc=Re("Activity",gN);/**
|
|
86
|
+
* @license lucide-react v0.474.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const vN=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],bN=Re("ArrowLeftRight",vN);/**
|
|
91
|
+
* @license lucide-react v0.474.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const yN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],jN=Re("ArrowLeft",yN);/**
|
|
96
|
+
* @license lucide-react v0.474.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const NN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wl=Re("ArrowRight",NN);/**
|
|
101
|
+
* @license lucide-react v0.474.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const SN=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Kg=Re("Brain",SN);/**
|
|
106
|
+
* @license lucide-react v0.474.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const wN=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],kN=Re("ChartColumn",wN);/**
|
|
111
|
+
* @license lucide-react v0.474.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const CN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vg=Re("Check",CN);/**
|
|
116
|
+
* @license lucide-react v0.474.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const EN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ga=Re("ChevronDown",EN);/**
|
|
121
|
+
* @license lucide-react v0.474.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const TN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],MN=Re("ChevronLeft",TN);/**
|
|
126
|
+
* @license lucide-react v0.474.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const AN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kn=Re("ChevronRight",AN);/**
|
|
131
|
+
* @license lucide-react v0.474.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const _N=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ON=Re("ChevronUp",_N);/**
|
|
136
|
+
* @license lucide-react v0.474.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const RN=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],Xg=Re("ChevronsDownUp",RN);/**
|
|
141
|
+
* @license lucide-react v0.474.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const DN=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Fg=Re("ChevronsUpDown",DN);/**
|
|
146
|
+
* @license lucide-react v0.474.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const zN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ig=Re("CircleX",zN);/**
|
|
151
|
+
* @license lucide-react v0.474.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const UN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],N0=Re("Clock",UN);/**
|
|
156
|
+
* @license lucide-react v0.474.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const LN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],$N=Re("Copy",LN);/**
|
|
161
|
+
* @license lucide-react v0.474.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const HN=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Zg=Re("DollarSign",HN);/**
|
|
166
|
+
* @license lucide-react v0.474.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const qN=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],BN=Re("Download",qN);/**
|
|
171
|
+
* @license lucide-react v0.474.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const GN=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],kl=Re("FlaskConical",GN);/**
|
|
176
|
+
* @license lucide-react v0.474.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const QN=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],YN=Re("ImagePlus",QN);/**
|
|
181
|
+
* @license lucide-react v0.474.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const KN=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Jf=Re("Layers",KN);/**
|
|
186
|
+
* @license lucide-react v0.474.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const VN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],XN=Re("LoaderCircle",VN);/**
|
|
191
|
+
* @license lucide-react v0.474.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const FN=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]],IN=Re("MessageSquarePlus",FN);/**
|
|
196
|
+
* @license lucide-react v0.474.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const ZN=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Jg=Re("MessageSquare",ZN);/**
|
|
201
|
+
* @license lucide-react v0.474.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const JN=[["path",{d:"M5 12h14",key:"1ays0h"}]],WN=Re("Minus",JN);/**
|
|
206
|
+
* @license lucide-react v0.474.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const PN=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],e2=Re("MonitorSmartphone",PN);/**
|
|
211
|
+
* @license lucide-react v0.474.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const t2=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],n2=Re("Moon",t2);/**
|
|
216
|
+
* @license lucide-react v0.474.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const a2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],s2=Re("PanelLeftClose",a2);/**
|
|
221
|
+
* @license lucide-react v0.474.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const r2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],l2=Re("PanelLeftOpen",r2);/**
|
|
226
|
+
* @license lucide-react v0.474.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const o2=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],i2=Re("Pencil",o2);/**
|
|
231
|
+
* @license lucide-react v0.474.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const c2=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Wf=Re("Play",c2);/**
|
|
236
|
+
* @license lucide-react v0.474.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const u2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Wg=Re("Plus",u2);/**
|
|
241
|
+
* @license lucide-react v0.474.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const d2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],f2=Re("RefreshCw",d2);/**
|
|
246
|
+
* @license lucide-react v0.474.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const m2=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],h2=Re("RotateCw",m2);/**
|
|
251
|
+
* @license lucide-react v0.474.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const p2=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],wf=Re("Search",p2);/**
|
|
256
|
+
* @license lucide-react v0.474.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const x2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],g2=Re("Send",x2);/**
|
|
261
|
+
* @license lucide-react v0.474.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const v2=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],b2=Re("ShieldCheck",v2);/**
|
|
266
|
+
* @license lucide-react v0.474.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const y2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],j2=Re("Sun",y2);/**
|
|
271
|
+
* @license lucide-react v0.474.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const N2=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Pf=Re("Trash2",N2);/**
|
|
276
|
+
* @license lucide-react v0.474.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const S2=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],w2=Re("TrendingUp",S2);/**
|
|
281
|
+
* @license lucide-react v0.474.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const k2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pg=Re("TriangleAlert",k2);/**
|
|
286
|
+
* @license lucide-react v0.474.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const C2=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],E2=Re("Upload",C2);/**
|
|
291
|
+
* @license lucide-react v0.474.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const T2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],ev=Re("Users",T2);/**
|
|
296
|
+
* @license lucide-react v0.474.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const M2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],tv=Re("Wrench",M2);/**
|
|
301
|
+
* @license lucide-react v0.474.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const A2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],em=Re("X",A2);function Q(...s){return s.filter(Boolean).join(" ")}function vt(s){if(!Number.isFinite(s)||s===0)return"$0.00";const r=Math.abs(s);if(r<1e-6)return"< $0.000001";if(r<1e-4){const[o,i]=s.toExponential(2).split("e");return`$${o}e${parseInt(i,10)}`}return r<.01?`$${s.toFixed(6)}`:`$${s.toFixed(2)}`}function ht(s){return s<1e3?`${Math.round(s)}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}function Yn(s){return s.toLocaleString()}function Cl(s,r=80){const o=i=>i.length<=r?i:i.slice(0,r-3)+"…";if(typeof s=="string")return o(s);if(typeof s=="object"&&s!==null&&!Array.isArray(s)){const i=s;for(const d of["question","prompt","text","input","query","message","content","name","title"])if(typeof i[d]=="string"&&i[d].length>0)return o(i[d]);for(const d of Object.values(i))if(typeof d=="string"&&d.length>0)return o(d)}return o(JSON.stringify(s))}function _2(s){switch(s){case"running":return"text-blue-500";case"completed":return"text-green-500";case"failed":return"text-red-500";case"waiting":return"text-amber-500";default:return"text-[hsl(var(--muted-foreground))]"}}const O2={auto:{icon:e2,label:"System",ariaLabel:"Theme: follow system. Switch to light."},light:{icon:j2,label:"Light",ariaLabel:"Theme: light. Switch to dark."},dark:{icon:n2,label:"Dark",ariaLabel:"Theme: dark. Switch to system."}};function R2({compact:s=!1}){const[r,o]=b.useState(()=>Bf());b.useEffect(()=>Sg(h=>o(h)),[]);const i=b.useCallback(()=>{o(h=>{const m=L1(h);return D1(m),Qf(Gf(m)),m})},[]),d=O2[r],f=d.icon;return n.jsxs("button",{type:"button",onClick:i,title:d.ariaLabel,"aria-label":d.ariaLabel,className:Q("inline-flex items-center gap-2 rounded-md text-xs transition-colors","text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]",s?"p-2 justify-center":"px-2 py-1.5"),children:[n.jsx(f,{size:14}),!s&&n.jsx("span",{children:d.label})]})}const D2=[{to:"/playground",label:"Playground",icon:Jg},{to:"/workflows",label:"Workflows",icon:Wf},{to:"/traces",label:"Traces",icon:Rc},{to:"/costs",label:"Costs",icon:Zg},{to:"/memory",label:"Memory",icon:Kg},{to:"/sessions",label:"Sessions",icon:ev},{to:"/tools",label:"Tools",icon:tv},{to:"/evals",label:"Evals",icon:kl}],nv="axl.studio.sidebar.collapsed",av="(max-width: 767px)";function z2(){try{const s=localStorage.getItem(nv);return s==="1"?!0:s==="0"?!1:null}catch{return null}}function U2(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia(av).matches}function L2(s){const r=s.tagName;return!!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||s.isContentEditable)}function $2(){const[{collapsed:s,hasExplicitPreference:r},o]=b.useState(()=>{const m=z2();return{collapsed:m??U2(),hasExplicitPreference:m!==null}}),i=b.useRef(r);b.useEffect(()=>{i.current=r},[r]);const d=b.useCallback(()=>{o(m=>{const p=!m.collapsed;try{localStorage.setItem(nv,p?"1":"0")}catch{}return{collapsed:p,hasExplicitPreference:!0}})},[]);b.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const m=window.matchMedia(av),p=()=>{i.current||o(x=>({...x,collapsed:m.matches}))};return m.addEventListener("change",p),()=>m.removeEventListener("change",p)},[]),b.useEffect(()=>{const m=p=>{if(p.shiftKey||p.altKey||!(p.metaKey||p.ctrlKey)||p.key.toLowerCase()!=="b")return;const x=p.target;x&&L2(x)||(p.preventDefault(),d())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[d]);const f=s?l2:s2,h=typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.userAgent)?"⌘B":"Ctrl+B";return n.jsxs("aside",{className:Q("border-r border-[hsl(var(--border))] bg-[hsl(var(--card))] flex flex-col h-screen transition-[width] duration-150 ease-out",s?"w-14":"w-56"),children:[n.jsxs("div",{className:Q("p-4 border-b border-[hsl(var(--border))] flex items-center",s?"justify-center":"justify-between gap-2"),children:[!s&&n.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Axl Studio"}),n.jsx("button",{type:"button",onClick:d,title:`${s?"Expand":"Collapse"} sidebar (${h})`,"aria-label":`${s?"Expand":"Collapse"} sidebar`,"aria-expanded":!s,"aria-controls":"axl-studio-sidebar-nav","aria-keyshortcuts":"Meta+B Control+B",className:"p-2 rounded-md text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))] transition-colors",children:n.jsx(f,{size:16})})]}),n.jsx("nav",{id:"axl-studio-sidebar-nav",className:"flex-1 p-2 space-y-0.5",children:D2.map(({to:m,label:p,icon:x})=>n.jsxs(Gg,{to:m,title:s?p:void 0,className:({isActive:v})=>Q("flex items-center gap-2.5 rounded-md text-sm transition-colors",s?"justify-center px-2 py-2.5":"px-3 py-2",v?"bg-[hsl(var(--accent))] text-[hsl(var(--accent-foreground))] font-medium":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"),children:[n.jsx(x,{size:16}),!s&&p]},m))}),n.jsxs("div",{className:Q("border-t border-[hsl(var(--border))]",s?"p-2 flex justify-center":"p-3 flex items-center justify-between gap-2"),children:[!s&&n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"@axlsdk/studio"}),n.jsx(R2,{compact:s})]})]})}function sv(s){if(s.type==="ask_end")return 0;const r=s.cost;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:0}function br({title:s,description:r,actions:o,className:i}){return n.jsxs("header",{className:Q("shrink-0 flex flex-wrap items-center justify-between gap-y-3 gap-x-3 sm:gap-x-6 px-4 sm:px-6 py-4 sm:min-h-[68px]","border-b border-[hsl(var(--border))]",i),children:[n.jsxs("div",{className:"min-w-0 flex-1 basis-[200px]",children:[n.jsx("h2",{className:"text-xl font-semibold leading-tight truncate",title:s,children:s}),n.jsx("div",{className:"mt-1 text-xs text-[hsl(var(--muted-foreground))] truncate",children:r??" "})]}),o&&n.jsx("div",{className:"flex items-center gap-2 flex-wrap shrink-0 ml-auto",children:o})]})}function rn({title:s,description:r,icon:o}){return n.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[o&&n.jsx("div",{className:"mb-3 text-[hsl(var(--muted-foreground))]",children:o}),n.jsx("h3",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:s}),r&&n.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))] mt-1 max-w-sm",children:r})]})}function H2({text:s,className:r}){return n.jsxs("div",{className:`whitespace-pre-wrap ${r??""}`,children:[s,n.jsx("span",{className:"animate-pulse",children:"|"})]})}function rv(s){if(s==null)return"null";if(Array.isArray(s))return"array";const r=typeof s;return r==="object"?"object":r==="number"?"number":r==="boolean"?"boolean":"string"}function q2(s,r){if(r==="array"){const o=s;return o.length===0?"[]":`[${o.length}]`}if(r==="object"){const o=Object.keys(s);return o.length===0?"{}":o.length<=4?`{ ${o.join(", ")} }`:`{ ${o.slice(0,3).join(", ")}, …${o.length-3} more }`}return""}function B2(s,r){return r==="array"?s.map((o,i)=>[i,o]):r==="object"?Object.entries(s):[]}const An={key:"text-[hsl(var(--foreground))]",string:"text-emerald-700 dark:text-emerald-400",number:"text-blue-600 dark:text-blue-400",boolean:"text-amber-600 dark:text-amber-400",null:"text-[hsl(var(--muted-foreground))] italic",punct:"text-[hsl(var(--muted-foreground))]"},Eo="w-3.5 shrink-0 flex items-center justify-center pt-0.5",lv="inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] shadow-sm text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer";function G2({text:s}){const[r,o]=b.useState(!1),i=b.useRef(void 0);b.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const d=b.useCallback(f=>{f.stopPropagation(),navigator.clipboard.writeText(s),o(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>o(!1),2e3)},[s]);return n.jsxs("button",{onClick:d,className:lv,children:[r?n.jsx(Vg,{size:10,className:"text-emerald-500"}):n.jsx($N,{size:10}),r?"Copied":"Copy"]})}function Q2({value:s,type:r}){if(r==="null")return n.jsx("span",{className:An.null,children:"null"});if(r==="boolean")return n.jsx("span",{className:An.boolean,children:String(s)});if(r==="number")return n.jsx("span",{className:An.number,children:String(s)});if(r==="string"){const o=s;return o.includes(`
|
|
306
|
+
`)&&o.length>80?n.jsxs("span",{className:An.string,children:['"',o,'"']}):n.jsxs("span",{className:An.string,children:['"',o,'"']})}return null}const dc=100,Y2=b.memo(function s({value:r,label:o,depth:i,expandDepth:d,isLast:f}){const h=rv(r),m=h==="object"||h==="array",[p,x]=b.useState(i<d),[v,y]=b.useState(!1),k=f?"":",",w=o!=null?typeof o=="number"?n.jsxs("span",{className:An.punct,children:[o,": "]}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:An.key,children:['"',o,'"']}),n.jsx("span",{className:An.punct,children:": "})]}):null;if(!m)return n.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded",children:[n.jsx("span",{className:Eo}),n.jsxs("span",{children:[w,n.jsx(Q2,{value:r,type:h}),n.jsx("span",{className:An.punct,children:k})]})]});const C=B2(r,h),A=h==="array"?"[":"{",_=h==="array"?"]":"}";return C.length===0?n.jsxs("div",{className:"flex items-start leading-relaxed",children:[n.jsx("span",{className:Eo}),n.jsxs("span",{children:[w,n.jsxs("span",{className:An.punct,children:[A,_,k]})]})]}):n.jsxs("div",{children:[n.jsxs("div",{className:Q("flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",p&&"hidden"),onClick:()=>x(!0),children:[n.jsx("span",{className:Eo,children:n.jsx(Kn,{size:10,className:"text-[hsl(var(--muted-foreground))]"})}),n.jsxs("span",{children:[w,n.jsxs("span",{className:An.punct,children:[q2(r,h),k]})]})]}),n.jsxs("div",{className:Q(!p&&"hidden"),children:[n.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",onClick:()=>x(!1),children:[n.jsx("span",{className:Eo,children:n.jsx(Kn,{size:10,className:"text-[hsl(var(--muted-foreground))] rotate-90 transition-transform"})}),n.jsxs("span",{children:[w,n.jsx("span",{className:An.punct,children:A})]})]}),n.jsxs("div",{className:"pl-5 border-l border-[hsl(var(--border))]/40 ml-1.5",children:[(v?C:C.slice(0,dc)).map(([D,$],T,j)=>n.jsx(s,{value:$,label:D,depth:i+1,expandDepth:d,isLast:!v&&C.length>dc?!1:T===j.length-1},typeof D=="number"?D:String(D))),!v&&C.length>dc&&n.jsxs("button",{onClick:D=>{D.stopPropagation(),y(!0)},className:"text-[10px] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] py-1 transition-colors",children:["Show all ",C.length," items (",C.length-dc," more)"]})]}),n.jsxs("div",{className:"flex items-start leading-relaxed",children:[n.jsx("span",{className:Eo}),n.jsxs("span",{className:An.punct,children:[_,k]})]})]})]})});function Ct({data:s,defaultExpandDepth:r,maxHeight:o,className:i,collapsed:d}){const f=r??(d?0:2),h=o??"24rem",m=JSON.stringify(s,null,2),[p,x]=b.useState(0),[v,y]=b.useState(f),k=v===1/0,w=b.useCallback(()=>{y(_=>_===1/0?0:1/0),x(_=>_+1)},[]),C=rv(s),A=C==="object"||C==="array";return n.jsxs("div",{className:Q("relative group/json",i),children:[n.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-0.5 opacity-0 group-hover/json:opacity-100 transition-opacity z-10",children:[A&&n.jsxs("button",{onClick:_=>{_.stopPropagation(),w()},className:lv,children:[k?n.jsx(Xg,{size:10}):n.jsx(Fg,{size:10}),k?"Collapse":"Expand"]}),n.jsx(G2,{text:m})]}),n.jsx("div",{className:"text-xs font-mono overflow-auto rounded-lg bg-[hsl(var(--secondary))] p-3",style:{maxHeight:h},children:n.jsx(Y2,{value:s,depth:0,expandDepth:v,isLast:!0},p)})]})}function Do({items:s,value:r,onSelect:o,getKey:i,getLabel:d,getDescription:f,searchMatch:h,placeholder:m="Select…",searchPlaceholder:p="Search…",emptyLabel:x="No results",shortcut:v=!1,variant:y="picker",triggerClassName:k,popoverWidth:w,ariaLabel:C}){const A=w??(y==="filter"?260:440),[_,D]=b.useState(!1),[$,T]=b.useState(""),[j,S]=b.useState(0),E=b.useRef(!1),B=b.useRef(null),te=b.useRef(null),q=b.useRef(null),K=b.useRef(null),[F,re]=b.useState(!1),we=b.useId(),me=`cmdpicker-pop-${we}`,Z=G=>`cmdpicker-opt-${we}-${G}`,M=b.useMemo(()=>{const G=$.trim().toLowerCase();return G?h?s.filter(P=>h(P,G)):s.filter(P=>d(P).toLowerCase().includes(G)):s},[s,$,h,d]),R=b.useMemo(()=>{if(!r)return null;const G=s.find(P=>i(P)===r);return G?d(G):null},[s,r,i]);b.useEffect(()=>{if(E.current){S(P=>Math.max(0,Math.min(P,M.length-1)));return}const G=M.findIndex(P=>i(P)===r);S(G>=0?G:0)},[M,r,i]),b.useEffect(()=>{var le;if(!_){T(""),E.current=!1;return}const G=425,P=(le=K.current)==null?void 0:le.getBoundingClientRect();if(P){const he=window.innerHeight-P.bottom,ie=P.top;re(he<G&&ie>he)}requestAnimationFrame(()=>{var he;return(he=q.current)==null?void 0:he.focus()})},[_]),b.useEffect(()=>{if(!_)return;const G=P=>{var he,ie;const le=P.target;(he=B.current)!=null&&he.contains(le)||(ie=te.current)!=null&&ie.contains(le)||D(!1)};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[_]),b.useEffect(()=>{if(!v)return;const G=P=>{var le;if((P.metaKey||P.ctrlKey)&&P.key==="k"){const he=P.target,ie=!!(he&&((le=te.current)!=null&&le.contains(he)));if(((he==null?void 0:he.tagName)==="INPUT"||(he==null?void 0:he.tagName)==="TEXTAREA"||(he==null?void 0:he.isContentEditable)===!0)&&!ie)return;P.preventDefault(),D(I=>!I)}};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[v]);const ne=b.useCallback(G=>{o(G),D(!1),requestAnimationFrame(()=>{var P;return(P=K.current)==null?void 0:P.focus()})},[o]),je=b.useCallback(G=>{var P;if(G.key==="ArrowDown")G.preventDefault(),E.current=!0,S(le=>Math.min(le+1,Math.max(0,M.length-1)));else if(G.key==="ArrowUp")G.preventDefault(),E.current=!0,S(le=>Math.max(le-1,0));else if(G.key==="Enter"){G.preventDefault();const le=M[j];le&&ne(i(le))}else G.key==="Escape"?(G.preventDefault(),D(!1),(P=K.current)==null||P.focus()):G.key==="Tab"&&D(!1)},[M,j,ne,i]),xe=R??m,O=y==="filter";return n.jsxs("div",{ref:B,className:"relative inline-flex",children:[n.jsxs("button",{ref:K,type:"button",onClick:()=>D(G=>!G),"aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?me:void 0,"aria-label":C??(R?`Selected: ${R}`:m),className:Q("group inline-flex items-center gap-2 text-sm cursor-pointer transition-colors","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","hover:bg-[hsl(var(--muted))]",O?"px-3 py-1.5 text-xs":"pl-4 pr-3 py-2 min-w-[240px] max-w-[320px]",k),children:[!O&&n.jsx(wf,{size:13,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),n.jsx("span",{className:Q("flex-1 text-left truncate",O?"":"font-medium",!R&&"text-[hsl(var(--muted-foreground))] font-normal"),children:xe}),O?n.jsx(Ga,{size:12,className:"text-[hsl(var(--muted-foreground))] shrink-0 opacity-70"}):v?n.jsxs("kbd",{className:Q("hidden md:inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-mono rounded","border border-[hsl(var(--border))] bg-[hsl(var(--background))]","text-[hsl(var(--muted-foreground))]"),children:[n.jsx("span",{className:"text-xs leading-none",children:"⌘"}),"K"]}):null]}),_&&n.jsxs("div",{ref:te,id:me,role:"listbox","aria-label":C??m,"aria-activedescendant":M[j]?Z(j):void 0,style:{width:A},className:Q("absolute right-0 z-50",F?"bottom-[calc(100%+8px)]":"top-[calc(100%+8px)]","rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--background))]","shadow-2xl overflow-hidden popover-enter"),children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[hsl(var(--border))]",children:[n.jsx(wf,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),n.jsx("input",{ref:q,type:"text",value:$,onChange:G=>{T(G.target.value),E.current=!1},onKeyDown:je,placeholder:p,"aria-label":p,className:Q("flex-1 bg-transparent text-sm focus:outline-none","placeholder:text-[hsl(var(--muted-foreground))]")}),n.jsx("kbd",{className:Q("text-[10px] font-mono px-1.5 py-0.5 rounded","border border-[hsl(var(--border))]","text-[hsl(var(--muted-foreground))]"),children:"ESC"})]}),n.jsx("div",{className:"max-h-[340px] overflow-y-auto py-1.5",children:M.length===0?n.jsx("div",{className:"px-4 py-8 text-center text-xs text-[hsl(var(--muted-foreground))]",children:$?`No results for "${$}"`:x}):M.map((G,P)=>{const le=i(G),he=d(G),ie=f==null?void 0:f(G),fe=P===j,I=le===r;return n.jsxs("button",{id:Z(P),type:"button",role:"option","aria-selected":fe,onClick:()=>ne(le),onMouseEnter:()=>{E.current=!0,S(P)},className:Q("w-full flex items-center gap-3 px-4 py-2.5 text-left cursor-pointer","transition-colors",fe&&"bg-[hsl(var(--muted))]"),children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm font-medium truncate",children:he||m}),ie&&n.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:ie})]}),I&&n.jsx(Vg,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0","aria-label":"Currently selected"})]},le||`__empty__${P}`)})}),n.jsxs("div",{className:Q("flex items-center justify-between px-4 py-2 border-t border-[hsl(var(--border))]","bg-[hsl(var(--muted))]/40 text-[10px] text-[hsl(var(--muted-foreground))]"),children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"font-mono opacity-70",children:"↑↓"})," navigate"]}),n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("kbd",{className:"font-mono opacity-70",children:"↵"})," select"]})]}),n.jsxs("span",{className:"tabular-nums",children:[M.length," of ",s.length]})]})]})]})}function ua({cost:s,unpriced:r,className:o}){return n.jsx("span",{title:r?"Lower bound — this ask used an unpriced model (cost unknown)":void 0,className:`inline-flex items-center whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${o??""}`,children:r?`≥ ${vt(s)}`:vt(s)})}function tm({ms:s,className:r}){return n.jsx("span",{className:`inline-flex items-center whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${r??""}`,children:ht(s)})}function ef(s){switch(s){case"schema":return"Schema";case"validate":return"Validate";case"guardrail":return"Guardrail";case"initial":return"Initial"}}function K2(s){const{stage:r,attempt:o,maxAttempts:i,status:d,className:f}=s;let h,m;if(d==="committed")h="bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200",m=`Committed ${o}/${i}`;else if(d==="failed")h="bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200",m=`${ef(r)} failed (${o}/${i})`;else{const p=r!=="initial";h=p?"bg-amber-100 text-amber-900 dark:bg-amber-900/30 dark:text-amber-200":"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200",m=p?`Retrying — ${ef(r)} ${o}/${i}`:`${ef(r)} ${o}/${i}`}return n.jsx("span",{className:Q("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",h,f),"data-testid":"retry-indicator","data-status":d,"data-stage":r,children:m})}function V2(s){var h;const r=new Map,o=new Set;for(const m of s){if(m.type==="log"){const x=m.data;(x==null?void 0:x.event)==="ask_discarded"&&typeof x.askId=="string"&&o.add(x.askId)}if(m.type==="handoff_start"&&m.fromAskId){const x=r.get(m.fromAskId),v=((h=m.data)==null?void 0:h.target)??m.toAskId??"";x&&m.toAskId&&(x.handoffsOut.push({toAskId:m.toAskId,target:v}),r.has(m.toAskId)||r.set(m.toAskId,{askId:m.toAskId,parentAskId:m.fromAskId,depth:typeof m.targetDepth=="number"?m.targetDepth:x.depth+1,agent:v||void 0,cost:0,status:"running",events:[],children:[],handoffsOut:[]}));continue}if(m.type==="handoff_return"||!("askId"in m)||typeof m.askId!="string")continue;let p=r.get(m.askId);switch(p||(p={askId:m.askId,parentAskId:m.parentAskId,depth:m.depth??0,agent:m.agent,cost:0,status:"running",events:[],children:[],handoffsOut:[]},r.set(m.askId,p)),p.events.push(m),m.type){case"ask_start":p.startedAt=m.timestamp,p.agent=p.agent??m.agent;break;case"ask_end":if(p.endedAt=m.timestamp,typeof m.cost=="number"&&(p.cost=m.cost),m.unpriced&&(p.unpriced=!0),!m.outcome)break;m.outcome.ok?(p.status="completed",p.outcomeResult=m.outcome.result):(p.status="failed",p.outcomeError=m.outcome.error);break;case"agent_call_start":p.model=p.model??m.model;break;case"agent_call_end":p.status==="running"&&typeof m.cost=="number"&&(p.cost+=m.cost);break;case"tool_call_end":p.status==="running"&&typeof m.cost=="number"&&(p.cost+=m.cost);break;case"pipeline":p.lastPipeline={status:m.status,stage:m.stage,attempt:m.attempt,maxAttempts:m.maxAttempts},m.status==="failed"&&p.status==="running"?p.status="retrying":m.status==="start"&&p.status==="retrying"&&(p.status="running");break}}for(const m of o){const p=r.get(m);p&&p.status==="completed"&&(p.status="discarded")}const i=[];for(const m of r.values()){const p=m.parentAskId?r.get(m.parentAskId):void 0;p?p.children.push(m):i.push(m)}const d=(m,p)=>(m.startedAt??0)-(p.startedAt??0),f=m=>{m.sort(d);for(const p of m)f(p.children)};return f(i),i}function X2(s){switch(s){case"running":return"bg-sky-100 text-sky-900 dark:bg-sky-900/30 dark:text-sky-200";case"retrying":return"bg-amber-100 text-amber-900 dark:bg-amber-900/30 dark:text-amber-200";case"completed":return"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200";case"failed":return"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200";case"discarded":return"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400"}}function ov(s){const{node:r,selectedAskId:o,onSelectAsk:i}=s,d=o===r.askId,[f,h]=b.useState(!0),m=r.children.length>0,p=r.startedAt!==void 0&&r.endedAt!==void 0?r.endedAt-r.startedAt:void 0;return n.jsxs("div",{className:Q("select-none",r.status==="discarded"&&"opacity-60"),"data-ask-id":r.askId,"data-status":r.status,children:[n.jsxs("div",{"data-testid":"ask-node",role:"button",tabIndex:0,onClick:()=>i==null?void 0:i(r.askId),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),i==null||i(r.askId))},className:Q("flex items-center gap-2 rounded px-2 py-1 text-sm cursor-pointer","hover:bg-slate-50 dark:hover:bg-slate-800/50",d&&"bg-sky-50 ring-1 ring-sky-300 dark:bg-sky-900/20 dark:ring-sky-700"),style:{paddingLeft:`${r.depth*16+8}px`},children:[m?n.jsx("button",{type:"button","aria-label":f?"Collapse":"Expand",onClick:x=>{x.stopPropagation(),h(v=>!v)},className:"text-[hsl(var(--muted-foreground))]",children:f?n.jsx(Ga,{className:"h-3.5 w-3.5"}):n.jsx(Kn,{className:"h-3.5 w-3.5"})}):n.jsx("span",{className:"w-3.5"}),n.jsx("span",{className:Q("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",X2(r.status)),children:r.status}),n.jsx("span",{"data-testid":"ask-node-agent",className:"font-medium truncate",title:r.askId,children:r.agent??"<unknown>"}),r.model&&n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono truncate",children:r.model}),n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono truncate",title:r.askId,children:r.askId.slice(0,8)}),n.jsxs("span",{className:"ml-auto flex items-center gap-2",children:[r.lastPipeline&&r.status==="retrying"&&n.jsx(K2,{stage:r.lastPipeline.stage??"initial",attempt:r.lastPipeline.attempt??1,maxAttempts:r.lastPipeline.maxAttempts??1,status:"failed"}),p!==void 0&&n.jsx(tm,{ms:p}),n.jsx(ua,{cost:r.cost,unpriced:r.unpriced})]})]}),r.handoffsOut.length>0&&n.jsx("div",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300 mt-0.5",style:{paddingLeft:`${r.depth*16+32}px`},children:r.handoffsOut.map((x,v)=>n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(wl,{className:"h-3 w-3"}),"handoff → ",x.target,n.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:["(",x.toAskId.slice(0,8),")"]})]},v))}),f&&r.children.map(x=>n.jsx(ov,{node:x,selectedAskId:o,onSelectAsk:i},x.askId))]})}function F2(s){let r,o,i;for(const d of s)d.type==="workflow_start"?r=d.workflow??r:d.type==="workflow_end"&&(r=d.workflow??r,o=d.data.status??o,i=d.data.duration??i);return!r&&!o?null:{name:r,status:o,duration:i}}function iv(s){const{events:r,selectedAskId:o,onSelectAsk:i}=s,d=b.useMemo(()=>V2(r),[r]),f=b.useMemo(()=>F2(r),[r]);return d.length===0&&!f?n.jsx("div",{className:"text-sm text-[hsl(var(--muted-foreground))] py-4 text-center",children:"No asks recorded yet. Events will appear here as `ctx.ask()` calls fire."}):n.jsxs("div",{"data-testid":"ask-tree",className:"space-y-0.5",children:[f&&n.jsxs("div",{"data-testid":"ask-tree-workflow-header",className:Q("flex items-center gap-2 rounded px-2 py-1 text-xs font-medium","bg-slate-50 dark:bg-slate-800/40 border-l-2 border-slate-400 dark:border-slate-600"),children:[n.jsxs("span",{className:"text-slate-700 dark:text-slate-200",children:["workflow · ",f.name??"(unnamed)"]}),f.status&&n.jsx("span",{className:Q("ml-auto inline-flex items-center rounded px-1.5 py-0.5 text-[10px]",f.status==="completed"?"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200":f.status==="failed"?"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200":"bg-sky-100 text-sky-900 dark:bg-sky-900/30 dark:text-sky-200"),children:f.status}),f.duration!==void 0&&n.jsxs("span",{className:"font-mono text-slate-500 dark:text-slate-400",children:[f.duration,"ms"]})]}),d.map(h=>n.jsx(ov,{node:h,selectedAskId:o,onSelectAsk:i},h.askId))]})}function S0(s){return s.eventSchemaVersion??1}const I2={workflow_start:"bg-green-500",workflow_end:"bg-green-500",ask_start:"bg-sky-500",ask_end:"bg-sky-500",agent_call_start:"bg-blue-500",agent_call_end:"bg-blue-500",tool_call_start:"bg-purple-500",tool_call_end:"bg-purple-500",tool_call_rejected:"bg-red-400",tool_approval:"bg-purple-400",tool_denied:"bg-red-400",handoff_start:"bg-amber-500",handoff_return:"bg-amber-500",delegate:"bg-amber-500",pipeline:"bg-violet-500",guardrail:"bg-violet-400",schema_check:"bg-violet-400",validate:"bg-violet-400",verify:"bg-teal-500",memory_remember:"bg-emerald-500",memory_recall:"bg-emerald-500",memory_forget:"bg-emerald-500",checkpoint_save:"bg-emerald-400",checkpoint_replay:"bg-emerald-400",await_human:"bg-yellow-500",await_human_resolved:"bg-yellow-500",token:"bg-slate-300",partial_object:"bg-slate-300",log:"bg-slate-400",done:"bg-zinc-700",error:"bg-red-500"},Z2="bg-pink-400";function J2(s){var r,o,i,d,f,h;switch(s.type){case"tool_denied":return!0;case"tool_call_rejected":return!0;case"tool_call_end":return s.schemaVersion===2&&(s.data.outcome.status==="failed"||s.data.outcome.status==="denied");case"guardrail":return((r=s.data)==null?void 0:r.blocked)===!0;case"schema_check":case"validate":return((o=s.data)==null?void 0:o.valid)===!1;case"pipeline":return s.status==="failed";case"verify":return((i=s.data)==null?void 0:i.passed)===!1;case"tool_approval":return((d=s.data)==null?void 0:d.approved)===!1;case"ask_end":return s.outcome.ok===!1;case"workflow_end":return((f=s.data)==null?void 0:f.status)==="failed"||((h=s.data)==null?void 0:h.aborted)===!0;case"log":{const m=s.data;return m!=null&&typeof m=="object"&&"error"in m&&m.error!=null}default:return!1}}function W2(s){return I2[s]??Z2}function w0(s){return s.type==="tool_call_end"&&s.schemaVersion===2&&s.data.outcome.status==="cancelled"?"bg-amber-500":J2(s)?"bg-red-500":W2(s.type)}function cv(s){return"depth"in s&&typeof s.depth=="number"?s.depth:0}function uv(s){return s.type!=="agent_call_start"?null:s.data??null}function dv(s){return s.type!=="agent_call_end"?null:s.data??null}function fv(s){return s.type==="guardrail"||s.type==="schema_check"||s.type==="validate"?s.data??null:null}function P2(s){return s.type!=="tool_approval"?null:s.data??null}function eS(s){var r,o;return s.type==="agent_call_start"?!!((r=s.data)!=null&&r.retryReason):s.type==="agent_call_end"?!!((o=s.data)!=null&&o.retryReason):!1}const nm=b.createContext({level:0,version:0});function or(s){const{level:r,version:o}=b.useContext(nm),i=r===1;return n.jsx(Ct,{...s,defaultExpandDepth:i?1/0:s.defaultExpandDepth,collapsed:i?!1:s.collapsed},`trace-expand-v${o}`)}function gn({label:s,content:r,tone:o="neutral",defaultOpen:i=!1}){const{level:d,version:f}=b.useContext(nm),[h,m]=b.useState(i);b.useEffect(()=>{f!==0&&m(d===1)},[f,d]);const p={neutral:"border-[hsl(var(--border))] bg-[hsl(var(--background))]",warning:"border-amber-400/40 bg-amber-50 dark:bg-amber-950/20",info:"border-blue-400/40 bg-blue-50 dark:bg-blue-950/20"}[o];return n.jsxs("div",{className:Q("rounded-lg border mb-2",p),children:[n.jsxs("button",{onClick:()=>m(x=>!x),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium text-left hover:bg-[hsl(var(--muted))]/50",children:[h?n.jsx(Ga,{size:11}):n.jsx(Kn,{size:11}),n.jsx("span",{className:"uppercase tracking-wider opacity-70",children:s}),!h&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal truncate ml-1",children:[r.slice(0,80),r.length>80?"…":""]})]}),h&&n.jsx("pre",{className:"px-3 pb-2.5 text-[11px] font-mono whitespace-pre-wrap break-words max-h-80 overflow-auto",children:r})]})}function tS({label:s,value:r}){return n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[10px] rounded-full bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",children:[n.jsx("span",{className:"opacity-60",children:s}),n.jsx("span",{className:"font-mono text-[hsl(var(--foreground))]",children:typeof r=="object"?JSON.stringify(r):String(r)})]})}function nS({event:s}){const r=uv(s);return r?n.jsxs(n.Fragment,{children:[s.model&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Model:"})," ",s.model,r.turn!=null&&n.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:["· turn ",r.turn]})]}),r.params&&Object.keys(r.params).length>0&&n.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:Object.entries(r.params).map(([o,i])=>n.jsx(tS,{label:o,value:i},o))}),r.toolNames&&r.toolNames.length>0&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Tools:"})," ",n.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:r.toolNames.join(", ")})]}),r.system&&n.jsx(gn,{label:"System prompt",content:r.system,tone:"info"}),r.prompt&&n.jsx(gn,{label:"Prompt",content:r.prompt,defaultOpen:!0}),r.messages&&n.jsx(gn,{label:`Messages (verbose) — ${r.messages.length}`,content:r.messages.map(o=>`[${o.role}]
|
|
307
|
+
${o.content??""}`).join(`
|
|
308
|
+
|
|
309
|
+
───
|
|
310
|
+
|
|
311
|
+
`)})]}):null}function aS({event:s}){const r=dv(s);return r?n.jsxs(n.Fragment,{children:[s.model&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Model:"})," ",s.model,r.turn!=null&&n.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:["· turn ",r.turn]})]}),s.promptVersion&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Version:"})," ",s.promptVersion]}),s.tokens&&(s.tokens.input!=null||s.tokens.output!=null)&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Tokens:"}),s.tokens.input!=null?` in=${s.tokens.input}`:"",s.tokens.output!=null?` out=${s.tokens.output}`:"",s.tokens.reasoning?` reasoning=${s.tokens.reasoning}`:""]}),r.thinking&&n.jsx(gn,{label:"Thinking",content:r.thinking,tone:"info"}),r.response&&n.jsx(gn,{label:"Response",content:r.response,defaultOpen:!0}),r.error&&n.jsx(gn,{label:"Provider error",content:r.error,tone:"warning",defaultOpen:!0})]}):null}function sS({event:s}){const r=P2(s);return r?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex items-center gap-2 mb-2 text-xs",children:n.jsx("span",{className:Q("px-2 py-0.5 rounded-full text-[10px] font-medium",r.approved?"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300":"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300"),children:r.approved?"APPROVED":"DENIED"})}),r.reason&&n.jsxs("p",{className:"text-xs mb-2",children:[n.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.args!==void 0&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mb-1",children:"Arguments"}),n.jsx(or,{data:r.args})]})]}):null}function mv({status:s}){const r=s==="succeeded"?"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300":s==="cancelled"?"bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300":"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300";return n.jsx("span",{className:Q("px-2 py-0.5 rounded-full text-[10px] font-medium",r),children:s.toUpperCase()})}function rS({event:s}){if(s.type!=="tool_call_end"||s.schemaVersion!==2)return null;const{outcome:r}=s.data;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[n.jsx(mv,{status:r.status}),r.status==="failed"&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[r.failure.phase," · ",r.failure.kind," · ",r.failure.disposition]}),r.status==="cancelled"&&n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:r.cancellation.phase})]}),s.data.requestedTool&&s.data.requestedTool!==s.tool&&n.jsxs("p",{className:"text-xs mb-2",children:[n.jsx("strong",{children:"Requested as:"})," ",s.data.requestedTool]}),n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mb-1",children:"Arguments"}),n.jsx(or,{data:s.data.args}),r.status==="succeeded"&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mt-2 mb-1",children:"Result"}),n.jsx(or,{data:r.result})]}),r.status==="failed"&&"result"in r.failure&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mt-2 mb-1",children:"Result before failure"}),n.jsx(or,{data:r.failure.result})]}),r.status==="failed"&&n.jsx(gn,{label:"Host failure",content:`${r.failure.error.name}: ${r.failure.error.message}`,tone:"warning",defaultOpen:!0}),r.status==="denied"&&r.reason&&n.jsxs("p",{className:"text-xs mt-2",children:[n.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.status==="cancelled"&&r.cancellation.reason&&n.jsxs("p",{className:"text-xs mt-2",children:[n.jsx("strong",{children:"Reason:"})," ",r.cancellation.reason]}),r.status==="cancelled"&&"result"in r.cancellation&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mt-2 mb-1",children:"Result before cancellation"}),n.jsx(or,{data:r.cancellation.result})]})]})}function lS({event:s}){return s.type!=="tool_call_rejected"?null:n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[n.jsx(mv,{status:"rejected"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:s.data.reason})]}),n.jsxs("p",{className:"text-xs mb-2",children:[n.jsx("strong",{children:"Requested tool:"})," ",s.data.requestedTool]}),s.data.reason==="unavailable"&&n.jsxs("p",{className:"text-xs mb-2",children:[n.jsx("strong",{children:"Available tools:"})," ",s.data.availableTools.join(", ")||"none"]}),s.data.reason==="invalid_arguments"&&n.jsx(or,{data:{args:s.data.args,issues:s.data.issues}}),s.data.reason==="invalid_json"&&n.jsx(gn,{label:"Parse error",content:s.data.message,tone:"warning",defaultOpen:!0})]})}function oS({event:s}){const r=fv(s);if(!r)return null;const o=r.valid===!1||r.blocked===!0;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[n.jsx("span",{className:Q("px-2 py-0.5 rounded-full text-[10px] font-medium",o?"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300":"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300"),children:o?"FAILED":"PASSED"}),r.attempt!=null&&r.maxAttempts!=null&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["attempt ",r.attempt," of ",r.maxAttempts]}),r.guardrailType&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["· ",r.guardrailType]})]}),r.reason&&n.jsxs("p",{className:"text-xs mb-2",children:[n.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.feedbackMessage&&n.jsx(gn,{label:"Retry feedback sent to LLM",content:r.feedbackMessage,tone:"warning",defaultOpen:!0})]})}function iS(s){switch(s.type){case"text":return`text (${s.characters} characters)`;case"image":case"audio":{const r=s.mediaType?`, ${s.mediaType}`:"",o=s.bytes!==void 0?`, ${s.bytes} bytes`:"";return`${s.type} (${s.source}${r}${o})`}default:return`unknown (${String(s.type)})`}}function cS({event:s}){if(s.type!=="ask_start")return null;const{prompt:r}=s;return n.jsxs(n.Fragment,{children:[r.length>0?n.jsx(gn,{label:"Prompt",content:r,defaultOpen:!0}):n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"(no prompt)"}),s.input&&n.jsxs("div",{className:"mt-2 text-xs text-[hsl(var(--muted-foreground))]",children:[n.jsx("strong",{children:"Model input:"})," ",s.input.parts.map(iS).join(", ")]})]})}function uS({event:s}){if(s.type!=="ask_end")return null;const{outcome:r,cost:o,duration:i}=s;return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Outcome:"})," ",n.jsx("span",{className:r.ok?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:r.ok?"ok":"error"})]}),n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Ask cost:"})," ",vt(o)]}),n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Duration:"})," ",i,"ms"]}),r.ok&&r.result!==void 0&&n.jsx(gn,{label:"Result",content:typeof r.result=="string"?r.result:JSON.stringify(r.result,null,2),defaultOpen:!0}),!r.ok&&r.error&&n.jsx(gn,{label:"Error",content:r.error,tone:"warning",defaultOpen:!0})]})}function dS({event:s}){if(s.type!=="pipeline")return null;const{status:r,stage:o,attempt:i,maxAttempts:d}=s,f=s.status==="failed"?s.reason:void 0;return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Pipeline:"})," ",o," · ",r," · attempt ",i,"/",d]}),f&&n.jsx(gn,{label:"Failure reason",content:f,tone:"warning",defaultOpen:!0})]})}function fS({event:s}){if(s.type==="handoff_start"){if(!s.data)return null;const{source:r,target:o,mode:i,message:d}=s.data;return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Handoff starts:"})," ",r," → ",o,i?` · ${i}`:""]}),d&&n.jsx(gn,{label:"Prompt to target",content:d,defaultOpen:!0})]})}if(s.type==="handoff_return"){if(!s.data)return null;const{source:r,target:o,duration:i}=s.data;return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Handoff returns:"})," ",r," → ",o]}),typeof i=="number"&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Round-trip duration:"})," ",i,"ms"]})]})}return null}function mS({event:s}){const r="data"in s?s.data:void 0;return n.jsxs(n.Fragment,{children:[s.model&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Model:"})," ",s.model]}),s.promptVersion&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Version:"})," ",s.promptVersion]}),s.tokens&&(s.tokens.input!=null||s.tokens.output!=null)&&n.jsxs("p",{className:"text-xs mb-1",children:[n.jsx("strong",{children:"Tokens:"}),s.tokens.input!=null?` in=${s.tokens.input}`:"",s.tokens.output!=null?` out=${s.tokens.output}`:"",s.tokens.reasoning?` reasoning=${s.tokens.reasoning}`:""]}),r!=null&&n.jsx(or,{data:r,collapsed:!0})]})}function hS({event:s,index:r,isExpanded:o,onToggle:i,maxDuration:d,baseDepth:f,lifecycleBadge:h}){var w,C;const m=Math.max(0,cv(s)-f),p=eS(s),x=fv(s),v=s.type==="guardrail"||s.type==="schema_check"||s.type==="validate",y=v&&((x==null?void 0:x.valid)===!1||(x==null?void 0:x.blocked)===!0),k=s.step!=null&&s.step!==Number.MAX_SAFE_INTEGER?`#${s.step}`:"";return n.jsxs("div",{children:[n.jsxs("button",{onClick:i,className:Q("w-full flex items-center gap-2 px-3 py-1.5 text-xs rounded-xl cursor-pointer hover:bg-[hsl(var(--accent))] text-left",p||y?"bg-amber-100/60 dark:bg-amber-950/30 ring-1 ring-amber-400/40":"bg-[hsl(var(--secondary))]"),style:{marginLeft:`${m*16}px`},children:[o?n.jsx(Ga,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}):n.jsx(Kn,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}),n.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))] w-8 truncate",children:k||`#${r}`}),n.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${w0(s)}`}),n.jsx("span",{className:"font-medium w-28 truncate",children:s.type}),h&&n.jsx("span",{className:Q("px-1.5 py-0.5 text-[9px] font-medium rounded-full whitespace-nowrap",h==="succeeded"||h==="approved"?"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300":h==="running"||h==="accepted"||h==="legacy result"||h==="legacy"?"bg-slate-200 text-slate-800 dark:bg-slate-800 dark:text-slate-200":h.includes("incomplete")||h==="cancelled"?"bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300":"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300"),children:h}),p&&n.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[9px] font-medium rounded-full bg-amber-200 text-amber-900 dark:bg-amber-800 dark:text-amber-100",title:`Retry after ${((w=uv(s))==null?void 0:w.retryReason)??((C=dv(s))==null?void 0:C.retryReason)} failure`,children:[n.jsx(h2,{size:9}),"retry"]}),(x==null?void 0:x.attempt)!=null&&x.maxAttempts!=null&&n.jsxs("span",{className:"px-1.5 py-0.5 text-[9px] font-medium rounded-full bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",title:`Attempt ${x.attempt} of ${x.maxAttempts}`,children:[x.attempt,"/",x.maxAttempts]}),s.agent&&n.jsx("span",{className:"text-blue-600 dark:text-blue-400 w-28 truncate",children:s.agent}),"tool"in s&&s.tool&&n.jsx("span",{className:"text-purple-600 dark:text-purple-400 w-28 truncate",children:s.tool}),n.jsx("div",{className:"flex-1 h-3 bg-[hsl(var(--background))] rounded overflow-hidden",children:s.duration!=null&&s.duration>0&&n.jsx("div",{className:`h-full rounded ${w0(s)}`,style:{width:`${Math.max(s.duration/d*100,2)}%`,opacity:.7}})}),s.duration!=null&&n.jsx(tm,{ms:s.duration}),s.cost!=null&&s.cost>0&&n.jsx(ua,{cost:s.cost})]}),o&&n.jsx("div",{className:"mt-1 mb-2 p-3 rounded-xl bg-[hsl(var(--card))] border border-[hsl(var(--border))]",style:{marginLeft:`${m*16+32}px`},children:s.type==="agent_call_start"?n.jsx(nS,{event:s}):s.type==="agent_call_end"?n.jsx(aS,{event:s}):v?n.jsx(oS,{event:s}):s.type==="tool_approval"?n.jsx(sS,{event:s}):s.type==="tool_call_end"&&s.schemaVersion===2?n.jsx(rS,{event:s}):s.type==="tool_call_rejected"?n.jsx(lS,{event:s}):s.type==="ask_start"?n.jsx(cS,{event:s}):s.type==="ask_end"?n.jsx(uS,{event:s}):s.type==="pipeline"?n.jsx(dS,{event:s}):s.type==="handoff_start"||s.type==="handoff_return"?n.jsx(fS,{event:s}):n.jsx(mS,{event:s})})]})}function Ko({events:s,lifecycleEvents:r=s,traceComplete:o,maxDuration:i,showToolbar:d=!0,header:f}){const[h,m]=b.useState(new Set),[p,x]=b.useState(0),[v,y]=b.useState(0),k=b.useMemo(()=>i??Math.max(...s.map($=>$.duration??0),1),[s,i]),w=b.useMemo(()=>{const $=new Map,T=o??r.some(E=>E.type==="done"||E.type==="error"||E.type==="workflow_end"||E.type==="log"&&typeof E.data=="object"&&E.data!==null&&"event"in E.data&&E.data.event==="events_truncated"),j=new Set(r.filter(E=>E.type==="tool_call_end"&&E.schemaVersion===2).map(E=>`${E.executionId}\0${E.askId}\0${E.callId}`)),S=r.filter(E=>E.type==="tool_call_end"&&E.schemaVersion!==2);for(const E of r)if(E.type==="tool_call_start")if(E.schemaVersion===2){const B=`${E.executionId}\0${E.askId}\0${E.callId}`;$.set(E,j.has(B)?"accepted":T?"incomplete trace":"running")}else{const B=S.some(te=>{const q="callId"in E?E.callId:void 0,K="callId"in te?te.callId:void 0;return q!=null&&K!=null?q===K:te.tool===E.tool});$.set(E,B?"legacy":T?"legacy incomplete":"legacy")}else E.type==="tool_call_end"?$.set(E,E.schemaVersion===2?E.data.outcome.status:"legacy result"):E.type==="tool_call_rejected"?$.set(E,"rejected"):E.type==="tool_denied"?$.set(E,"legacy denied"):E.type==="tool_approval"&&$.set(E,E.data.approved?"approved":"denied");return $},[r,o]),C=b.useMemo(()=>{let $=1/0;for(const T of s){const j=cv(T);j<$&&($=j)}return Number.isFinite($)?$:0},[s]),A=$=>{m(T=>{const j=new Set(T);return j.has($)?j.delete($):j.add($),j})},_=()=>{const $=s.map((T,j)=>T.step??j);m(new Set($)),x(1),y(T=>T+1)},D=()=>{m(new Set),x(0),y($=>$+1)};return n.jsxs(n.Fragment,{children:[d&&n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[s.length," event",s.length!==1?"s":"",f&&n.jsx("span",{className:"ml-2",children:f})]}),s.length>0&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsxs("button",{onClick:_,className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md hover:bg-[hsl(var(--accent))] text-[hsl(var(--muted-foreground))]",title:"Expand all — including inner sections",children:[n.jsx(Fg,{size:12}),"Expand"]}),n.jsxs("button",{onClick:D,className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md hover:bg-[hsl(var(--accent))] text-[hsl(var(--muted-foreground))]",title:"Collapse all",children:[n.jsx(Xg,{size:12}),"Collapse"]})]})]}),n.jsx(nm.Provider,{value:{level:p,version:v},children:n.jsx("div",{className:"space-y-1",children:s.map(($,T)=>{const j=$.step??T;return n.jsx(hS,{event:$,index:T,isExpanded:h.has(j),onToggle:()=>A(j),maxDuration:k,baseDepth:C,lifecycleBadge:w.get($)},j)})})})]})}const k0="axl.studio.split.",C0=2,pS=6;function E0(s,r){return s<=0?!1:s<2*r+pS}function tf(s,r,o){return Math.min(o,Math.max(r,s))}function _l({left:s,right:r,defaultPercent:o=50,minPercent:i=20,maxPercent:d=80,minPx:f=200,storageKey:h,className:m}){const[p,x]=b.useState(()=>{if(!h)return o;try{const S=localStorage.getItem(k0+h);if(!S)return o;const E=Number(S);return Number.isFinite(E)?tf(E,i,d):o}catch{return o}}),[v,y]=b.useState(!1),k=b.useRef(null),w=b.useRef(!1),C=b.useRef(null),A=b.useRef(null);b.useEffect(()=>{if(h)try{localStorage.setItem(k0+h,String(p))}catch{}},[h,p]),b.useEffect(()=>{const S=k.current;if(!S||typeof ResizeObserver>"u"){S&&y(E0(S.getBoundingClientRect().width,f));return}const E=new ResizeObserver(B=>{const te=B[0];if(!te)return;const q=te.contentRect.width;y(E0(q,f))});return E.observe(S),()=>E.disconnect()},[f]);const _=b.useCallback(()=>{var B;const S=((B=k.current)==null?void 0:B.getBoundingClientRect().width)??0;if(!S||!Number.isFinite(S))return{min:i,max:d};const E=f/S*100;return{min:Math.max(i,E),max:Math.min(d,100-E)}},[i,d,f]);b.useEffect(()=>()=>{C.current&&(document.removeEventListener("mousemove",C.current),document.removeEventListener("touchmove",C.current)),A.current&&(document.removeEventListener("mouseup",A.current),document.removeEventListener("touchend",A.current),document.removeEventListener("touchcancel",A.current)),w.current&&(document.body.style.cursor="",document.body.style.userSelect="")},[]);const D=b.useCallback(S=>{w.current=!0;const E=S,B=k.current;if(!B)return;const te=B.getBoundingClientRect().width,q=p,K=re=>{var je;if(!w.current)return;const we=B.getBoundingClientRect().width||te,M=(("touches"in re?((je=re.touches[0])==null?void 0:je.clientX)??E:re.clientX)-E)/we*100,{min:R,max:ne}=_();x(tf(q+M,R,ne))},F=()=>{w.current=!1,document.removeEventListener("mousemove",K),document.removeEventListener("touchmove",K),document.removeEventListener("mouseup",F),document.removeEventListener("touchend",F),document.removeEventListener("touchcancel",F),document.body.style.cursor="",document.body.style.userSelect="",C.current=null,A.current=null};C.current=K,A.current=F,document.addEventListener("mousemove",K),document.addEventListener("touchmove",K,{passive:!1}),document.addEventListener("mouseup",F),document.addEventListener("touchend",F),document.addEventListener("touchcancel",F),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[p,_]),$=b.useCallback(S=>{S.preventDefault(),D(S.clientX)},[D]),T=b.useCallback(S=>{const E=S.touches[0];E&&D(E.clientX)},[D]),j=b.useCallback(S=>{if(S.key!=="ArrowLeft"&&S.key!=="ArrowRight")return;S.preventDefault();const E=S.key==="ArrowLeft"?-1:1,B=S.shiftKey?C0*5:C0,{min:te,max:q}=_();x(K=>tf(K+E*B,te,q))},[_]);return v?n.jsxs("div",{ref:k,className:Q("flex flex-col min-h-0",m),children:[n.jsx("div",{className:"min-h-0 min-w-0 flex flex-col flex-1 overflow-auto",children:s}),n.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"h-px shrink-0 bg-[hsl(var(--border))]"}),n.jsx("div",{className:"min-h-0 min-w-0 flex flex-col flex-1 overflow-auto",children:r})]}):n.jsxs("div",{ref:k,className:Q("flex min-h-0",m),children:[n.jsx("div",{className:"min-h-0 min-w-0 flex flex-col",style:{width:`${p}%`},children:s}),n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":Math.round(p),"aria-valuemin":i,"aria-valuemax":d,tabIndex:0,onMouseDown:$,onTouchStart:T,onKeyDown:j,className:"w-1.5 shrink-0 cursor-col-resize bg-[hsl(var(--border))] hover:bg-[hsl(var(--ring))] focus:bg-[hsl(var(--ring))] focus:outline-none transition-colors"}),n.jsx("div",{className:"min-h-0 min-w-0 flex flex-col",style:{width:`${100-p}%`},children:r})]})}const am=(window.__AXL_STUDIO_BASE__??"")+"/api";async function lt(s,r){const o=await fetch(`${am}${s}`,{headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(o.status===413){if((o.headers.get("content-type")??"").includes("application/json")){const h=await o.json().catch(()=>{});if(h&&!h.ok)throw new Error(h.error.message)}throw new Error(`Request body too large (HTTP 413). If you're importing a large eval file through an embedded Studio middleware, raise your host framework's JSON body limit on the Studio mount. See the Studio README "Host body limits" section.`)}if(!(o.headers.get("content-type")??"").includes("application/json")){const h=(await o.text().catch(()=>"")).slice(0,200).trim();throw new Error(`Server returned HTTP ${o.status} with non-JSON response`+(h?`: ${h}`:""))}let d;try{d=await o.json()}catch(f){throw new Error(`Failed to parse server response as JSON (HTTP ${o.status}): ${f instanceof Error?f.message:String(f)}`)}if(!d.ok)throw new Error(d.error.message);return d.data}const xS=()=>lt("/health"),gS=()=>lt("/workflows"),vS=s=>lt(`/workflows/${encodeURIComponent(s)}`),bS=(s,r,o=!1)=>lt(`/workflows/${encodeURIComponent(s)}/execute`,{method:"POST",body:JSON.stringify({input:r,stream:o})}),yS=()=>lt("/executions"),jS=()=>lt("/sessions"),NS=s=>lt(`/sessions/${encodeURIComponent(s)}`),SS=s=>lt(`/sessions/${encodeURIComponent(s)}`,{method:"DELETE"}),wS=()=>lt("/agents"),kS=()=>lt("/tools"),CS=s=>lt(`/tools/${encodeURIComponent(s)}`),ES=(s,r)=>lt(`/tools/${encodeURIComponent(s)}/test`,{method:"POST",body:JSON.stringify({input:r})}),TS=s=>lt(`/memory/${encodeURIComponent(s)}`),MS=(s,r,o)=>lt(`/memory/${encodeURIComponent(s)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({value:o})}),AS=(s,r)=>lt(`/memory/${encodeURIComponent(s)}/${encodeURIComponent(r)}`,{method:"DELETE"}),_S=(s,r,o)=>lt("/memory/search",{method:"POST",body:JSON.stringify({query:s,scope:r,limit:o})}),OS=(s="7d")=>lt(`/costs?window=${s}`),RS=(s="7d")=>lt(`/eval-trends?window=${s}`),DS=(s="7d")=>lt(`/workflow-stats?window=${s}`),zS=(s="7d")=>lt(`/trace-stats?window=${s}`),US=()=>lt("/evals"),LS=()=>lt("/evals/history"),$S=(s,r)=>lt(`/evals/${encodeURIComponent(s)}/run`,{method:"POST",body:JSON.stringify({runs:r==null?void 0:r.runs,stream:!0,captureTraces:r==null?void 0:r.captureTraces})}),hv=s=>lt(`/evals/runs/${encodeURIComponent(s)}/cancel`,{method:"POST"}),HS=(s,r)=>lt(`/evals/${encodeURIComponent(s)}/rescore`,{method:"POST",body:JSON.stringify({resultId:r})}),qS=(s,r,o)=>lt("/evals/compare",{method:"POST",body:JSON.stringify({baselineId:s,candidateId:r,options:o})}),BS=(s,r)=>lt("/evals/import",{method:"POST",body:JSON.stringify({result:s,eval:r})}),GS=s=>lt(`/evals/history/${encodeURIComponent(s)}`,{method:"DELETE"});async function QS(s){let r;try{r=await fetch(`${am}/evals/${encodeURIComponent(s)}/diagnostics`)}catch(d){return{ok:!1,gone:!1,message:d instanceof Error?d.message:String(d)}}const o=await r.json().catch(()=>{});if(r.ok&&(o!=null&&o.ok))return{ok:!0,manifest:o.data};const i=o&&!o.ok?o.error.message:`Server returned HTTP ${r.status} for diagnostics`;return{ok:!1,gone:r.status===404,message:i}}async function T0(s){const r=await fetch(`${am}/evals/${encodeURIComponent(s)}/diagnostics/records`);if(!r.ok){const o=await r.json().catch(()=>{});throw new Error(o&&!o.ok?o.error.message:`Server returned HTTP ${r.status} for captured requests`)}return r}const M0=(s,r,o,i)=>lt("/playground/chat",{method:"POST",body:JSON.stringify(i?{message:s,sessionId:r,agent:o,image:i}:{message:s,sessionId:r,agent:o})});class YS{constructor(){ll(this,"ws",null);ll(this,"listeners",new Map);ll(this,"connectionListeners",new Set);ll(this,"reconnectTimer",null);ll(this,"url");const r=window.location.protocol==="https:"?"wss:":"ws:",o=window.__AXL_STUDIO_BASE__??"";this.url=`${r}//${window.location.host}${o}/ws`}connect(){var r;((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{for(const o of this.connectionListeners)o(!0);for(const o of this.listeners.keys())this.send({type:"subscribe",channel:o})},this.ws.onmessage=o=>{try{const i=JSON.parse(o.data);if(i.type==="event"&&i.channel){const d=this.listeners.get(i.channel);if(d)for(const h of d)h(i.data);const f=i.channel.indexOf(":");if(f>0){const h=i.channel.substring(0,f)+":*",m=this.listeners.get(h);if(m)for(const p of m)p(i.data)}}}catch{}},this.ws.onclose=()=>{for(const o of this.connectionListeners)o(!1);this.scheduleReconnect()},this.ws.onerror=()=>{var o;(o=this.ws)==null||o.close()})}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},2e3))}send(r){var o;((o=this.ws)==null?void 0:o.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}subscribe(r,o){let i=this.listeners.get(r);return i||(i=new Set,this.listeners.set(r,i),this.send({type:"subscribe",channel:r})),i.add(o),this.connect(),()=>{i.delete(o),i.size===0&&(this.listeners.delete(r),this.send({type:"unsubscribe",channel:r}))}}subscribeConnection(r){return this.connectionListeners.add(r),()=>this.connectionListeners.delete(r)}disconnect(){var r;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(r=this.ws)==null||r.close(),this.ws=null}}const _o=new YS;function sm(s,r,o){const i=b.useRef(r);i.current=r;const d=b.useRef(o);d.current=o,b.useEffect(()=>{var m;if(!s)return;const f=_o.subscribe(s,p=>i.current(p)),h=(m=_o.subscribeConnection)==null?void 0:m.call(_o,p=>{var x;p||(x=d.current)==null||x.call(d)});return()=>{f(),h==null||h()}},[s])}const A0={tokens:"",events:[],done:!1,interrupted:!1,error:null,result:null};function pv(s){const[r,o]=b.useState(A0),i=b.useRef(null);b.useEffect(()=>{if(s===i.current)return;const h=i.current;i.current=s,s!==null?o(A0):h!==null&&o(m=>({...m,done:!1,result:null,error:null}))},[s]);const d=b.useCallback(h=>{const m=h;o(p=>{var x,v;switch(m.type){case"token":{const k=(m.depth??0)===0?p.tokens+(m.data??""):p.tokens;return{...p,tokens:k,events:[...p.events,m]}}case"done":return{...p,done:!0,result:((x=m.data)==null?void 0:x.result)??null,events:[...p.events,m]};case"error":return{...p,done:!0,error:((v=m.data)==null?void 0:v.message)||"Unknown error",events:[...p.events,m]};default:return{...p,events:[...p.events,m]}}})},[]),f=b.useCallback(()=>{o(h=>h.done?h:{...h,interrupted:!0})},[]);return sm(s?`execution:${s}`:null,d,f),r}const _0=5*1024*1024,KS=["image/png","image/jpeg","image/webp","image/gif"];function VS(s){return typeof s=="string"&&KS.includes(s)}function XS(s){if(s.length===0||s.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(s))return;const r=s.endsWith("==")?2:s.endsWith("=")?1:0;return s.length/4*3-r}function FS({status:s}){const r=s==="succeeded"?"bg-green-100 text-green-800 dark:bg-green-950/40 dark:text-green-300":s==="running"?"bg-blue-100 text-blue-800 dark:bg-blue-950/40 dark:text-blue-300":s==="incomplete"||s==="cancelled"?"bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300":"bg-red-100 text-red-800 dark:bg-red-950/40 dark:text-red-300";return n.jsx("span",{className:Q("px-1.5 py-0.5 text-[9px] font-medium rounded-full",r),children:s})}const IS=new Set(["tool_call_start","tool_call_rejected","handoff_start","tool_approval"]);function ZS(s){var f;let r=null;const o=new Map;let i=null;const d=h=>{for(const m of[...o.keys()])m.startsWith(h+"|")&&(o.delete(m),i===m&&(i=null))};for(const h of s)if(h.type==="partial_object")r={askId:h.askId??"",object:(f=h.data)==null?void 0:f.object};else if(h.type==="string_delta"){const m=h.askId??"",p=`${m}|${h.data.path}`,x=o.get(p);o.set(p,{askId:m,path:h.data.path,accumulated:((x==null?void 0:x.accumulated)??"")+h.data.delta}),i=p}else(h.type==="pipeline"&&h.status==="failed"||h.type==="ask_end")&&d(h.askId??"");return{latestPartial:r,latestStringDelta:i?o.get(i)??null:null}}function JS({partial:s,streamingField:r}){return n.jsxs("div",{className:"space-y-2",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[hsl(var(--muted-foreground))]",children:"Streaming structured output"}),n.jsx(Ct,{data:s,defaultExpandDepth:3}),r&&r.accumulated.length>0&&n.jsxs("div",{className:"border-t border-[hsl(var(--border))] pt-2",children:[n.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-[hsl(var(--muted-foreground))] mb-1",children:["Writing ",n.jsx("code",{className:"font-mono",children:r.path})]}),n.jsxs("div",{className:"whitespace-pre-wrap font-mono text-xs",children:[r.accumulated,n.jsx("span",{className:"inline-block w-1.5 h-3 ml-0.5 align-middle bg-[hsl(var(--foreground))] animate-pulse"})]})]})]})}function WS(s){if(!s)return;const r=s.trim();if(!(!r.startsWith("{")&&!r.startsWith("[")))try{return JSON.parse(r)}catch{return}}function PS(){const[s,r]=b.useState([]),[o,i]=b.useState(""),[d,f]=b.useState(null),[h,m]=b.useState(null),[p,x]=b.useState(!1),v=b.useRef(null),y=b.useRef(null),k=b.useRef(0),w=b.useRef(null),[C,A]=b.useState(null),[_,D]=b.useState(null),[$,T]=b.useState(""),[j,S]=b.useState(!1),[E,B]=b.useState(0),[te,q]=b.useState({input:0,output:0}),[K,F]=b.useState(!1),re=b.useRef(!1),we=b.useRef(null),me=b.useRef(0),Z=b.useRef(0),{data:M=[]}=ln({queryKey:["agents"],queryFn:wS}),R=pv(_);b.useEffect(()=>{if(R.tokens&&j&&r(I=>{const oe=I[I.length-1];return(oe==null?void 0:oe.role)==="assistant"?[...I.slice(0,-1),{...oe,content:R.tokens}]:[...I,{role:"assistant",content:R.tokens}]}),R.done&&j){if(S(!1),D(null),R.error)r(I=>{const oe=I[I.length-1];return(oe==null?void 0:oe.role)==="assistant"&&!oe.content?[...I.slice(0,-1),{role:"assistant",content:`Error: ${R.error}`}]:[...I,{role:"assistant",content:`Error: ${R.error}`}]});else if(R.result!=null){let I=null;if(typeof R.result=="string"){const ve=R.result.trim();if(ve.startsWith("{")||ve.startsWith("["))try{I=JSON.stringify(JSON.parse(ve))}catch{}}else typeof R.result=="object"&&(I=JSON.stringify(R.result));if(!(!R.tokens||I!==null))return;const ce=I??(typeof R.result=="string"?R.result:JSON.stringify(R.result));r(ve=>{const Ne=ve[ve.length-1];return(Ne==null?void 0:Ne.role)==="assistant"?[...ve.slice(0,-1),{...Ne,content:ce}]:[...ve,{role:"assistant",content:ce}]})}}},[R.tokens,R.done,R.error,j]),b.useEffect(()=>{var Ze,mt;const I=new Map,oe=[],ce=[],ve=[];for(const pe of R.events)if(pe.type==="tool_call_start"){const Ce=`${pe.executionId}\0${pe.askId}\0${pe.callId}`;I.set(Ce,{name:pe.tool,args:(Ze=pe.data)==null?void 0:Ze.args,callId:pe.callId,executionId:pe.executionId,askId:pe.askId,startObserved:!0,status:"running"}),oe.push(Ce)}else if(pe.type==="tool_call_end"){const Ce=`${pe.executionId}\0${pe.askId}\0${pe.callId}`,Ie=I.get(Ce);if(!Ie||Ie.status!=="rejected"){const Mt={name:pe.tool,args:pe.data.args,callId:pe.callId,executionId:pe.executionId,askId:pe.askId,startObserved:Ie!=null},Gt=pe.data.outcome;switch(Gt.status){case"succeeded":I.set(Ce,{...Mt,status:"succeeded",result:Gt.result});break;case"failed":I.set(Ce,{...Mt,status:"failed",failure:Gt.failure});break;case"denied":I.set(Ce,{...Mt,status:"denied",reason:Gt.reason});break;case"cancelled":I.set(Ce,{...Mt,status:"cancelled",cancellation:Gt.cancellation});break}Ie||oe.push(Ce)}}else if(pe.type==="tool_call_rejected"){const Ce=`${pe.executionId}\0${pe.askId}\0${pe.callId}`;I.set(Ce,{name:pe.tool,callId:pe.callId,executionId:pe.executionId,askId:pe.askId,status:"rejected",rejection:pe.data}),oe.push(Ce)}else if(pe.type==="handoff_start"){const Ce=pe.data;Ce&&ce.push({source:Ce.source,target:Ce.target,mode:Ce.mode})}else pe.type==="tool_approval"&&ve.push({tool:pe.tool,approved:((mt=pe.data)==null?void 0:mt.approved)===!0});if(R.done||R.interrupted)for(const[pe,Ce]of I)Ce.status==="running"&&I.set(pe,{...Ce,status:"incomplete"});const Ne=oe.flatMap(pe=>{const Ce=I.get(pe);return Ce?[Ce]:[]});(Ne.length>0||ce.length>0||ve.length>0)&&r(pe=>{const Ce=pe[pe.length-1];return(Ce==null?void 0:Ce.role)==="assistant"?[...pe.slice(0,-1),{...Ce,toolCalls:Ne.length>0?Ne:Ce.toolCalls,handoffs:ce.length>0?ce:Ce.handoffs,approvals:ve.length>0?ve:Ce.approvals}]:pe})},[R.events,R.done,R.interrupted]),b.useEffect(()=>{const I=R.events.slice(me.current);if(I.length===0)return;me.current=R.events.length;let oe=0,ce=0,ve=0;for(const Ne of I)oe+=sv(Ne),Ne.type==="agent_call_end"&&Ne.tokens&&(ce+=Ne.tokens.input??0,ve+=Ne.tokens.output??0);oe>0&&B(Ne=>Ne+oe),(ce>0||ve>0)&&q(Ne=>({input:Ne.input+ce,output:Ne.output+ve}))},[R.events]),b.useEffect(()=>{if(K||re.current){Z.current=R.events.length;return}for(let I=Z.current;I<R.events.length;I++){const oe=R.events[I];if(!oe)continue;const ce="depth"in oe&&typeof oe.depth=="number"?oe.depth:0;if(IS.has(oe.type)||ce>=1){F(!0),Z.current=R.events.length;return}}Z.current=R.events.length},[R.events,K]),b.useEffect(()=>{var I;(I=we.current)==null||I.scrollIntoView({behavior:"smooth"})},[s]);const ne=b.useCallback(I=>{var oe;k.current+=1,(oe=y.current)==null||oe.abort(),y.current=null,w.current&&URL.revokeObjectURL(w.current),w.current=null,f(null),m(I??null),x(!1),v.current&&(v.current.value="")},[]),je=b.useCallback(()=>ne(),[ne]),xe=b.useCallback(I=>{var Ze;const oe=(Ze=I.target.files)==null?void 0:Ze[0];if(!oe)return;if(ne(),!VS(oe.type)){m("Choose a PNG, JPEG, WebP, or GIF image.");return}const ce=oe.type;if(oe.size>_0){m("Image must be 5 MiB or smaller.");return}const ve=new FileReader,Ne=k.current;y.current=ve,x(!0),ve.onerror=()=>{Ne===k.current&&(y.current=null,x(!1),m("Could not read that image."))},ve.onload=()=>{if(Ne!==k.current)return;y.current=null,x(!1);const pe=(typeof ve.result=="string"?ve.result:"").split(",",2)[1]??"",Ce=XS(pe);if(Ce===void 0||Ce>_0){m("Could not read that image safely.");return}const Ie=URL.createObjectURL(oe);w.current=Ie,f({mediaType:ce,data:pe,previewUrl:Ie}),m(null)},ve.readAsDataURL(oe)},[ne]);b.useEffect(()=>()=>{var I;k.current+=1,(I=y.current)==null||I.abort(),w.current&&URL.revokeObjectURL(w.current)},[]);const O=b.useCallback(async()=>{if(!o.trim()||j||p)return;const I=o.trim();i(""),r(oe=>[...oe,{role:"user",content:I}]),S(!0);try{const oe=d?await M0(I,C??void 0,$||void 0,{mediaType:d.mediaType,data:d.data}):await M0(I,C??void 0,$||void 0);ne(),A(oe.sessionId),D(oe.executionId)}catch(oe){S(!1),r(ce=>[...ce,{role:"assistant",content:`Error: ${oe instanceof Error?oe.message:String(oe)}`}])}},[o,j,p,C,$,d,ne]),G=I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),O())},P=E>0||te.input>0,le=s.length,he=b.useMemo(()=>ZS(R.events),[R.events]),ie=R.events.filter(I=>I.type!=="token"&&I.type!=="partial_object"&&I.type!=="string_delta"&&I.type!=="done"&&I.type!=="error"),fe=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex-1 overflow-auto p-3 sm:p-5 space-y-4",children:[s.length===0&&n.jsx(rn,{title:"Start a conversation",description:"Type a message below to chat with an agent. Tool calls, handoffs, and streaming responses will be displayed in real-time."}),s.map((I,oe)=>n.jsx("div",{className:`flex ${I.role==="user"?"justify-end":"justify-start"}`,children:n.jsxs("div",{className:`max-w-[80%] rounded-xl px-4 py-2.5 text-sm ${I.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]":"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]"}`,children:[(()=>{const ce=I.role==="assistant"&&j&&oe===s.length-1;if(ce&&he.latestPartial)return n.jsx(JS,{partial:he.latestPartial.object,streamingField:he.latestStringDelta});if(ce)return n.jsx(H2,{text:I.content});const ve=I.role==="assistant"?WS(I.content):void 0;return ve!==void 0?n.jsx(Ct,{data:ve,defaultExpandDepth:3}):n.jsx("div",{className:"whitespace-pre-wrap",children:I.content})})(),I.handoffs&&I.handoffs.length>0&&n.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:I.handoffs.map((ce,ve)=>n.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[n.jsx(wl,{size:12,className:"text-amber-500"}),n.jsx("span",{className:"font-medium",children:ce.source}),n.jsx(wl,{size:10}),n.jsx("span",{className:"font-medium",children:ce.target}),n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",ce.mode,")"]})]},ve))}),I.approvals&&I.approvals.length>0&&n.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:I.approvals.map((ce,ve)=>n.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[n.jsx(b2,{size:12,className:ce.approved?"text-green-500":"text-red-500"}),n.jsxs("span",{children:["Tool ",n.jsx("span",{className:"font-mono",children:ce.tool}),":"," ",ce.approved?"approved":"denied"]})]},ve))}),I.toolCalls&&I.toolCalls.length>0&&n.jsx("div",{className:"mt-2 space-y-2 border-t border-[hsl(var(--border))] pt-2",children:I.toolCalls.map((ce,ve)=>n.jsxs("div",{className:"text-xs",children:[n.jsxs("div",{className:"flex items-center gap-2 font-medium mb-1",children:[n.jsxs("span",{children:["Tool: ",ce.name]}),n.jsx(FS,{status:ce.status})]}),n.jsxs("div",{className:"space-y-1",children:[ce.status!=="rejected"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Input:"}),n.jsx(Ct,{data:ce.args,collapsed:!0})]}),ce.status!=="rejected"&&!ce.startObserved&&n.jsx("div",{className:"text-amber-600 dark:text-amber-400",children:"Terminal observed without its matching start; the trace is incomplete."}),ce.status==="succeeded"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Output:"}),n.jsx(Ct,{data:ce.result,collapsed:!0})]}),ce.status==="failed"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-red-600 dark:text-red-400",children:["Failed in ",ce.failure.phase,": ",ce.failure.error.name," —"," ",ce.failure.error.message]}),"result"in ce.failure&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Output before failure:"}),n.jsx(Ct,{data:ce.failure.result,collapsed:!0})]})]}),ce.status==="denied"&&ce.reason&&n.jsxs("div",{className:"text-red-600 dark:text-red-400",children:["Reason: ",ce.reason]}),ce.status==="cancelled"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-amber-600 dark:text-amber-400",children:["Cancelled in ",ce.cancellation.phase,ce.cancellation.reason?`: ${ce.cancellation.reason}`:""]}),"result"in ce.cancellation&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Output before cancellation:"}),n.jsx(Ct,{data:ce.cancellation.result,collapsed:!0})]})]}),ce.status==="incomplete"&&n.jsx("div",{className:"text-amber-600 dark:text-amber-400",children:"Trace ended before a matching tool terminal was observed."}),ce.status==="rejected"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-red-600 dark:text-red-400",children:["Rejected before execution: ",ce.rejection.reason]}),ce.rejection.reason==="invalid_arguments"&&n.jsx(Ct,{data:{args:ce.rejection.args,issues:ce.rejection.issues},collapsed:!0})]})]})]},ve))})]})},oe)),n.jsx("div",{ref:we})]}),n.jsxs("div",{className:"border-t border-[hsl(var(--border))] p-4 shrink-0",children:[(d||h)&&n.jsxs("div",{className:"max-w-3xl mx-auto mb-2",children:[d&&n.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--secondary))] p-1.5 text-xs text-[hsl(var(--secondary-foreground))]",children:[n.jsx("img",{src:d.previewUrl,alt:"Selected image preview",className:"h-10 w-10 rounded object-cover"}),n.jsx("span",{children:"Image attached"}),n.jsx("button",{type:"button",onClick:je,"aria-label":"Remove selected image",className:"rounded p-1 hover:bg-[hsl(var(--background))]",children:n.jsx(em,{size:14})})]}),h&&n.jsx("p",{role:"alert",className:"mt-1 text-xs text-red-600 dark:text-red-400",children:h})]}),n.jsxs("div",{className:"flex items-end gap-2 max-w-3xl mx-auto",children:[n.jsx("input",{ref:v,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",className:"hidden","aria-label":"Choose image",onChange:xe}),n.jsx("button",{type:"button",onClick:()=>{var I;return(I=v.current)==null?void 0:I.click()},disabled:j||p,"aria-label":"Attach image",title:"Attach PNG, JPEG, WebP, or GIF (max 5 MiB)",className:"p-2.5 rounded-xl border border-[hsl(var(--input))] hover:bg-[hsl(var(--secondary))] disabled:opacity-50",children:n.jsx(YN,{size:16})}),n.jsx("textarea",{value:o,onChange:I=>i(I.target.value),onKeyDown:G,placeholder:"Type a message...",rows:1,className:"flex-1 px-3 py-2.5 text-sm rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] resize-none focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]"}),n.jsx("button",{onClick:O,disabled:!o.trim()||j||p,className:"p-2.5 rounded-xl bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 disabled:opacity-50 transition-opacity",children:n.jsx(g2,{size:16})})]})]})]});return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Agent Playground",description:le>0?n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[le," message",le!==1?"s":""]}),C&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{className:"font-mono",children:["session ",C.slice(0,8)]})]})]}):M.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[M.length," registered agent",M.length!==1?"s":""]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{children:"pick one or use the default"})]}):"Interactive chat with registered agents",actions:n.jsxs(n.Fragment,{children:[P&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[E>0&&n.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:vt(E)}),te.input>0&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:[Yn(te.input+te.output)," tok"]})]}),n.jsxs("button",{type:"button",onClick:()=>{F(I=>(I&&(re.current=!0),!I))},"aria-pressed":K,title:"Show execution activity (tool calls, handoffs, agent calls)",className:Q("inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs","ring-1 ring-[hsl(var(--input))] hover:ring-[hsl(var(--ring))]",K?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"bg-[hsl(var(--background))] text-[hsl(var(--muted-foreground))]"),children:[n.jsx(Rc,{size:12}),"Activity"]}),n.jsxs("div",{className:Q("inline-flex items-stretch rounded-full bg-[hsl(var(--background))]","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[n.jsx(Do,{items:M,value:$,onSelect:T,getKey:I=>I.name,getLabel:I=>I.name,getDescription:I=>n.jsxs(n.Fragment,{children:[n.jsx("span",{children:I.model}),I.tools.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1",children:"·"}),n.jsxs("span",{children:[I.tools.length," tool",I.tools.length!==1?"s":""]})]}),I.handoffs.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1",children:"·"}),n.jsxs("span",{children:[I.handoffs.length," handoff",I.handoffs.length!==1?"s":""]})]})]}),searchMatch:(I,oe)=>I.name.toLowerCase().includes(oe)||I.model.toLowerCase().includes(oe)||I.tools.some(ce=>ce.toLowerCase().includes(oe)),placeholder:"Default agent",searchPlaceholder:"Search agents…",emptyLabel:"No agents registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an agent"}),n.jsxs("button",{onClick:()=>{ne(),r([]),A(null),D(null),B(0),q({input:0,output:0}),F(!1),re.current=!1,me.current=0,Z.current=0},className:Q("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","border-l border-[hsl(var(--input))] rounded-r-full","hover:bg-[hsl(var(--muted))] transition-colors","focus:outline-none focus-visible:bg-[hsl(var(--muted))]"),children:[n.jsx(IN,{size:12}),"New chat"]})]})]})}),K?n.jsx(_l,{className:"flex-1",left:fe,right:n.jsxs("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5 space-y-4",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Activity"}),n.jsx(iv,{events:R.events}),ie.length>0?n.jsx(Ko,{events:ie,lifecycleEvents:R.events,traceComplete:R.done||R.interrupted,showToolbar:!1}):n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"Events will appear here as the agent executes."})]})}):n.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:fe})]})}function xv({value:s,onChange:r,placeholder:o,className:i}){const[d,f]=b.useState(!1),[h,m]=b.useState(null),p=b.useRef(null),x=b.useCallback(y=>{const k=y.target.value;r(k);try{k.trim()&&JSON.parse(k),m(null)}catch(w){m(w instanceof Error?w.message:"Invalid JSON")}},[r]);b.useEffect(()=>{var y;d&&((y=p.current)==null||y.focus())},[d]);let v=null;try{v=s.trim()?JSON.parse(s):{}}catch{}return v===null||d?n.jsxs("div",{className:i,children:[n.jsx("textarea",{ref:p,value:s,onChange:x,onBlur:()=>{h||f(!1)},placeholder:o??"{}",className:"w-full h-40 p-3 text-xs font-mono rounded-xl bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] border-none resize-y focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))]",spellCheck:!1}),h&&n.jsx("p",{className:"text-xs text-red-500 mt-1",children:h})]}):n.jsx("div",{className:i,children:n.jsxs("div",{children:[n.jsx(Ct,{data:v,maxHeight:"12rem"}),n.jsxs("button",{onClick:()=>f(!0),className:"mt-1.5 inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[n.jsx(i2,{size:10}),"Edit"]})]})})}function gv({schema:s,onSubmit:r,submitLabel:o="Submit",className:i}){const[d,f]=b.useState({}),h=s.properties??{},m=new Set(s.required??[]),p=b.useCallback(x=>{x.preventDefault();const v={};for(const[y,k]of Object.entries(h)){const w=d[y]??"";if(!(!w&&!m.has(y)))if(k.type==="number")v[y]=Number(w);else if(k.type==="boolean")v[y]=w==="true";else if(k.type==="object"||k.type==="array")try{v[y]=JSON.parse(w)}catch{v[y]=w}else v[y]=w}r(v)},[d,h,m,r]);return n.jsxs("form",{onSubmit:p,className:`space-y-3 ${i??""}`,children:[Object.entries(h).map(([x,v])=>n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-[hsl(var(--foreground))] mb-1",children:[x,m.has(x)&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"}),v.description&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal ml-1",children:["- ",v.description]})]}),v.enum?n.jsxs("select",{value:d[x]??"",onChange:y=>f({...d,[x]:y.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[n.jsx("option",{value:"",children:"Select..."}),v.enum.map(y=>n.jsx("option",{value:y,children:y},y))]}):v.type==="boolean"?n.jsxs("select",{value:d[x]??"",onChange:y=>f({...d,[x]:y.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[n.jsx("option",{value:"",children:"Select..."}),n.jsx("option",{value:"true",children:"true"}),n.jsx("option",{value:"false",children:"false"})]}):n.jsx("input",{type:v.type==="number"?"number":"text",value:d[x]??"",onChange:y=>f({...d,[x]:y.target.value}),placeholder:v.type??"string",className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]},x)),n.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-medium rounded-md bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 transition-opacity",children:o})]})}function vv({status:s,className:r}){return n.jsxs("span",{className:Q("inline-flex items-center gap-1.5 whitespace-nowrap px-2 py-0.5 rounded-full text-xs font-medium",_2(s),s==="running"&&"animate-pulse",r),children:[n.jsx("span",{className:Q("w-1.5 h-1.5 rounded-full",s==="running"&&"bg-blue-500",s==="completed"&&"bg-green-500",s==="failed"&&"bg-red-500",s==="waiting"&&"bg-amber-500")}),s]})}function tt({label:s,value:r,subtitle:o,subtitleColor:i,accent:d,tint:f,badge:h}){return n.jsxs("div",{className:Q("px-4 py-3.5 rounded-xl min-w-0",f||"bg-[hsl(var(--card))] border border-[hsl(var(--border))]"),children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] truncate",children:s}),h?n.jsx("div",{className:"mt-1",children:h}):n.jsx("p",{className:Q("text-lg sm:text-2xl font-semibold mt-1 font-mono tracking-tight truncate select-text",d),title:r,children:r}),o&&n.jsx("p",{className:Q("text-xs mt-0.5 truncate",i??"text-[hsl(var(--muted-foreground))]"),title:o,children:o})]})}function ew(s){const{events:r,askId:o,onClose:i,className:d}=s,{filtered:f,summary:h}=b.useMemo(()=>{var _;const m=r.filter(D=>"askId"in D&&D.askId===o||(D.type==="handoff_start"||D.type==="handoff_return")&&(D.fromAskId===o||D.toAskId===o)),p=m.find(D=>D.type==="ask_start"),x=m.find(D=>D.type==="ask_end"),v=(p==null?void 0:p.agent)??((_=m.find(D=>"agent"in D&&!!D.agent))==null?void 0:_.agent),y=p==null?void 0:p.prompt,k=x==null?void 0:x.cost,w=(x==null?void 0:x.unpriced)===!0,C=p&&x&&typeof p.timestamp=="number"&&typeof x.timestamp=="number"?x.timestamp-p.timestamp:void 0,A=x==null?void 0:x.outcome;return{filtered:m,summary:{agent:v,prompt:y,cost:k,unpriced:w,duration:C,outcome:A}}},[r,o]);return n.jsxs("div",{"data-testid":"ask-details","data-ask-id":o,className:Q("flex flex-col h-full bg-white border-l border-slate-200 dark:bg-slate-900 dark:border-slate-700",d),children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"font-medium truncate",children:h.agent??"<unknown agent>"}),n.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",title:o,children:o.slice(0,8)})]}),i&&n.jsx("button",{type:"button",onClick:i,"aria-label":"Close ask details",className:"rounded p-1 hover:bg-slate-100 dark:hover:bg-slate-800",children:n.jsx(em,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"px-4 py-2 border-b border-slate-200 dark:border-slate-700 flex items-center gap-3 text-xs",children:[h.duration!==void 0&&n.jsx(tm,{ms:h.duration}),typeof h.cost=="number"&&n.jsx(ua,{cost:h.cost,unpriced:h.unpriced}),h.outcome&&n.jsx("span",{className:Q("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium",h.outcome.ok?"bg-emerald-100 text-emerald-900 dark:bg-emerald-900/30 dark:text-emerald-200":"bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200"),children:h.outcome.ok?"ok":"failed"})]}),h.prompt&&n.jsxs("div",{className:"px-4 py-2 border-b border-slate-200 text-sm dark:border-slate-700",children:[n.jsx("div",{className:"text-xs uppercase tracking-wide text-[hsl(var(--muted-foreground))] mb-1",children:"Prompt"}),n.jsx("div",{className:"font-mono whitespace-pre-wrap break-words",children:h.prompt})]}),n.jsx("div",{className:"flex-1 overflow-auto px-2 py-2",children:f.length===0?n.jsx("div",{className:"text-sm text-[hsl(var(--muted-foreground))] py-4 text-center",children:"No events for this ask."}):n.jsx(Ko,{events:f})})]})}const bv=[{id:"24h",label:"24h"},{id:"7d",label:"7d"},{id:"30d",label:"30d"},{id:"all",label:"All"}],yv="axl.studio.window";function tw(){try{const s=localStorage.getItem(yv);if(s&&bv.some(r=>r.id===s))return s}catch{}return"7d"}function nw(s){try{localStorage.setItem(yv,s)}catch{}}function _s({value:s,onChange:r}){return n.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-[hsl(var(--muted))]",role:"radiogroup","aria-label":"Time window",children:bv.map(o=>n.jsx("button",{type:"button",role:"radio","aria-checked":s===o.id,"aria-label":`Window: ${o.label}`,onClick:()=>r(o.id),className:Q("px-2.5 py-1 text-xs font-medium rounded-md transition-all cursor-pointer",s===o.id?"bg-[hsl(var(--background))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:o.label},o.id))})}function Dc(s,r){const[o,i]=b.useState(tw),[d,f]=b.useState(null),[h,m]=b.useState(null),{data:p}=ln({queryKey:[s,o],queryFn:()=>r(o)});return sm(s,b.useCallback(v=>{const y=v;y.snapshots&&(f(y.snapshots),typeof y.updatedAt=="number"&&m(y.updatedAt))},[])),{window:o,handleWindowChange:v=>{i(v),nw(v)},data:(d==null?void 0:d[o])??p??null,updatedAt:h}}function aw({onWorkflowClick:s,selectedWorkflow:r}={}){const{window:o,handleWindowChange:i,data:d}=Dc("workflow-stats",DS),f=!d||d.totalExecutions===0,h=d?Object.entries(d.byWorkflow).sort(([,m],[,p])=>p.total-m.total):[];return f?n.jsxs("div",{className:"space-y-3 mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),n.jsx(_s,{value:o,onChange:i})]}),n.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))] italic",children:["No executions in the ",o," window. Try a wider window."]})]}):n.jsxs("div",{className:"space-y-3 mb-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),n.jsx(_s,{value:o,onChange:i})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[n.jsx(tt,{label:"Total Executions",value:String(d.totalExecutions),subtitle:o}),n.jsx(tt,{label:"Failure Rate",value:`${(d.failureRate*100).toFixed(1)}%`,subtitle:d.failureRate>.1?"high":"normal",subtitleColor:d.failureRate>.1?"text-red-500":void 0})]}),h.length>0&&n.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs min-w-[560px]",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("th",{className:"py-2 px-3 text-left font-medium",children:"Workflow"}),n.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Total"}),n.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Failed"}),n.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"50th percentile duration (approximate for workflows with 200+ executions)",children:"p50"}),n.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"95th percentile duration (approximate for workflows with 200+ executions)",children:"p95"}),n.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Avg"})]})}),n.jsx("tbody",{children:h.map(([m,p])=>n.jsxs("tr",{onClick:s?()=>s(m):void 0,className:Q("border-b last:border-b-0 border-[hsl(var(--border))]",s&&"cursor-pointer hover:bg-[hsl(var(--accent))]",r===m&&"bg-[hsl(var(--accent))]"),title:s?"Click to select this workflow":void 0,children:[n.jsx("td",{className:"py-2 px-3 font-mono",children:m}),n.jsx("td",{className:"py-2 px-3 text-right",children:p.total}),n.jsx("td",{className:"py-2 px-3 text-right",children:p.failed>0?n.jsx("span",{className:"text-red-500",children:p.failed}):"0"}),n.jsx("td",{className:"py-2 px-3 text-right font-mono",children:p.durationP50!=null?ht(p.durationP50):"—"}),n.jsx("td",{className:"py-2 px-3 text-right font-mono",children:p.durationP95!=null?ht(p.durationP95):"—"}),n.jsx("td",{className:"py-2 px-3 text-right font-mono",children:ht(p.avgDuration)})]},m))})]})})]})}function sw(){const[s,r]=b.useState(""),[o,i]=b.useState("{}"),[d,f]=b.useState(!0),[h,m]=b.useState(null),[p,x]=b.useState(void 0),[v,y]=b.useState(null),[k,w]=b.useState("idle"),[C,A]=b.useState("run"),[_,D]=b.useState("tree"),[$,T]=b.useState(void 0),{data:j=[]}=ln({queryKey:["workflows"],queryFn:gS}),{data:S}=ln({queryKey:["workflow",s],queryFn:()=>vS(s),enabled:!!s}),E=pv(h),B=b.useCallback(async R=>{if(s){x(void 0),y(null),w("running");try{const ne=await bS(s,R,!0);ne.streaming&&ne.executionId?m(ne.executionId):(x(ne.result),w("completed"))}catch(ne){y(ne instanceof Error?ne.message:String(ne)),w("failed")}}},[s]),te=b.useCallback(()=>{try{const R=JSON.parse(o);B(R)}catch(R){y(R instanceof Error?R.message:String(R)),w("failed")}},[o,B]),q=b.useCallback(R=>{r(R),i("{}"),x(void 0),y(null),w("idle")},[]),K=j.find(R=>R.name===s),F=b.useCallback(R=>{B(R)},[B]);b.useEffect(()=>{E.done&&k==="running"&&(w(E.error?"failed":"completed"),E.error&&y(E.error),E.result!==void 0&&x(E.result),m(null))},[E.done,E.error,E.result,k]);const re=E.events,we=!!(S!=null&&S.inputSchema),me=Math.max(...re.map(R=>R.duration??0),1),Z=re.reduce((R,ne)=>R+(ne.duration??0),0),M=re.reduce((R,ne)=>R+sv(ne),0);return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Workflow Runner",description:K?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:K.name}),(K.hasInputSchema||K.hasOutputSchema)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[K.hasInputSchema&&"input schema",K.hasInputSchema&&K.hasOutputSchema&&" · ",K.hasOutputSchema&&"output schema"]})]})]}):j.length>0?`${j.length} registered workflow${j.length!==1?"s":""} · select one to run`:"No workflows registered",actions:j.length>0&&n.jsxs("div",{className:Q("inline-flex items-stretch rounded-full bg-[hsl(var(--background))] shrink-0","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[n.jsx(Do,{items:j,value:s,onSelect:q,getKey:R=>R.name,getLabel:R=>R.name,getDescription:R=>{const ne=[];return R.hasInputSchema&&ne.push("input schema"),R.hasOutputSchema&&ne.push("output schema"),ne.length>0?ne.join(" · "):"no schema"},placeholder:"Select workflow",searchPlaceholder:"Search workflows…",emptyLabel:"No workflows registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select a workflow"}),n.jsxs("button",{onClick:te,disabled:!s||k==="running",className:Q("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] rounded-r-full","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-[hsl(var(--foreground))]","disabled:opacity-40 disabled:cursor-not-allowed transition-opacity"),children:[n.jsx(Wf,{size:12,className:Q("fill-current",k==="running"&&"animate-spin fill-none")}),k==="running"?"Running…":"Run"]})]})}),n.jsx("div",{role:"tablist","aria-label":"Workflow Runner views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:["run","stats"].map(R=>n.jsx("button",{type:"button",role:"tab","aria-selected":C===R,onClick:()=>A(R),className:Q("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",C===R?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:R.charAt(0).toUpperCase()+R.slice(1)},R))}),C==="stats"&&n.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 sm:p-5",children:n.jsx(aw,{onWorkflowClick:R=>{q(R),A("run")},selectedWorkflow:s})}),C==="run"&&n.jsx(_l,{className:"flex-1",defaultPercent:30,minPercent:15,maxPercent:50,left:n.jsxs("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5 space-y-4",children:[we&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>f(!0),className:Q("px-3 py-1 text-xs rounded-lg transition-colors",d?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:"Form"}),n.jsx("button",{onClick:()=>f(!1),className:Q("px-3 py-1 text-xs rounded-lg transition-colors",d?"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]":"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]"),children:"JSON"})]}),we&&d?n.jsx(gv,{schema:S.inputSchema,onSubmit:F,submitLabel:k==="running"?"Running…":"Execute"}):n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Input (JSON)"}),n.jsx(xv,{value:o,onChange:i})]}),(S==null?void 0:S.outputSchema)!=null&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Output Schema"}),n.jsx(Ct,{data:S.outputSchema,collapsed:!0})]})]}),right:n.jsx("div",{className:"flex-1 overflow-y-auto p-3 sm:p-5",children:k==="idle"?n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx(rn,{icon:n.jsx(kl,{size:32}),title:"No execution",description:"Select a workflow and click Run to see results."})}):n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[n.jsx(tt,{label:"Status",badge:n.jsx(vv,{status:k})}),n.jsx(tt,{label:"Steps",value:String(re.length)}),n.jsx(tt,{label:"Duration",value:Z>0?ht(Z):"—"}),n.jsx(tt,{label:"Cost",value:M>0?vt(M):"—"})]}),v&&n.jsx("div",{className:"p-4 rounded-xl bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm",children:v}),p!==void 0&&n.jsxs("div",{children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),n.jsx(Ct,{data:p})]}),re.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Timeline"}),n.jsxs("div",{className:"flex gap-1 text-xs",children:[n.jsx("button",{type:"button",onClick:()=>D("tree"),className:Q("px-2 py-0.5 rounded",_==="tree"?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--secondary))]/50"),children:"Tree"}),n.jsx("button",{type:"button",onClick:()=>D("flat"),className:Q("px-2 py-0.5 rounded",_==="flat"?"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--secondary))]/50"),children:"Flat"})]})]}),_==="tree"?n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_360px] gap-3 max-w-[960px]",children:[n.jsx(iv,{events:re,selectedAskId:$,onSelectAsk:T}),$&&n.jsx(ew,{events:re,askId:$,onClose:()=>T(void 0),className:"max-h-[600px] rounded border border-slate-200 dark:border-slate-700"})]}):n.jsx(Ko,{events:re,maxDuration:me,traceComplete:E.done||E.interrupted})]}),k==="running"&&re.length===0&&n.jsxs("div",{className:"flex items-center justify-center py-12 text-sm text-[hsl(var(--muted-foreground))]",children:[n.jsx(kl,{size:16,className:"animate-pulse mr-2"}),"Executing workflow…"]})]})})})]})}function O0({data:s,maxBars:r,defaultColor:o="hsl(var(--primary))",formatValue:i=f=>String(f),className:d}){const f=[...s].sort((p,x)=>x.value-p.value),h=r?f.slice(0,r):f,m=h.length>0?Math.max(...h.map(p=>p.value)):1;return h.length===0?n.jsx("p",{className:Q("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"}):n.jsx("div",{className:Q("space-y-1",d),children:h.map(p=>{const x=m>0?p.value/m*100:0;return n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:p.label,children:p.label}),n.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))]",children:n.jsx("div",{className:"absolute inset-y-0 left-0 rounded",style:{width:`${x}%`,backgroundColor:p.color??o,opacity:.7}})}),n.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:i(p.value)})]},p.label)})})}function fc({data:s,maxBars:r,formatValue:o=f=>String(f),showLegend:i=!0,className:d}){const h=[...s.map(v=>({...v,total:v.segments.reduce((y,k)=>y+k.value,0)}))].sort((v,y)=>y.total-v.total),m=r?h.slice(0,r):h,p=m.length>0?Math.max(...m.map(v=>v.total)):1;if(m.length===0)return n.jsx("p",{className:Q("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"});const x=new Map;for(const v of m)for(const y of v.segments)x.has(y.name)||x.set(y.name,y.color);return n.jsxs("div",{className:Q("space-y-2",d),children:[i&&x.size>0&&n.jsx("div",{className:"flex flex-wrap gap-3 text-[10px] text-[hsl(var(--muted-foreground))]",children:Array.from(x.entries()).map(([v,y])=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:y}}),n.jsx("span",{children:v})]},v))}),n.jsx("div",{className:"space-y-1",children:m.map(v=>{const y=p>0?v.total/p*100:0;return n.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[n.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:v.label,children:v.label}),n.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))] overflow-hidden",children:n.jsx("div",{className:"absolute inset-y-0 left-0 flex",style:{width:`${y}%`},children:v.segments.map((k,w)=>{const C=v.total>0?k.value/v.total*100:0;return n.jsx("div",{style:{width:`${C}%`,backgroundColor:k.color,opacity:.75},title:`${k.name}: ${k.value}`},`${k.name}-${w}`)})})}),n.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:o(v.total)})]},v.label)})})]})}const nf={schema:"#f59e0b",validate:"#eab308",guardrail:"#ef4444"},rw={agent_call:"#3b82f6",tool_call:"#10b981",tool_call_rejected:"#ef4444",tool_approval:"#14b8a6",tool_denied:"#ef4444",workflow_start:"#8b5cf6",workflow_end:"#6366f1",log:"#64748b",guardrail:"#dc2626",schema_check:"#f59e0b",validate:"#eab308",delegate:"#ec4899",handoff:"#f97316",verify:"#06b6d4"};function lw(s){return rw[s]??"#64748b"}function ow(){const{window:s,handleWindowChange:r,data:o}=Dc("trace-stats",zS);if(!o||o.totalEvents===0)return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),n.jsx(_s,{value:s,onChange:r})]}),n.jsx(rn,{icon:n.jsx(kN,{size:32}),title:"No trace stats yet",description:"Execute workflows to see trace statistics."})]});const i=Object.entries(o.eventTypeCounts).sort(([,x],[,v])=>v-x),d=Object.entries(o.byTool).sort(([,x],[,v])=>v.accepted+v.legacy.calls-(x.accepted+x.legacy.calls)),f=Object.entries(o.retryByAgent).filter(([,x])=>x.schema+x.validate+x.guardrail>0),h=i.map(([x,v])=>({label:x,value:v,color:lw(x)})),m=d.filter(([,x])=>x.accepted>0).map(([x,v])=>({label:x,value:v.accepted})),p=f.map(([x,v])=>({label:x,segments:[{name:"schema",value:v.schema,color:nf.schema},{name:"validate",value:v.validate,color:nf.validate},{name:"guardrail",value:v.guardrail,color:nf.guardrail}].filter(y=>y.value>0)}));return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),n.jsx(_s,{value:s,onChange:r})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsx(tt,{label:"Total Events",value:String(o.totalEvents),subtitle:s}),n.jsx(tt,{label:"Event Types",value:String(i.length),subtitle:"distinct types"}),n.jsx(tt,{label:"Tools Used",value:String(d.length),subtitle:d.length===1?"tool":"tools"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[n.jsx("h4",{className:"text-sm font-medium mb-3",children:"Event Type Distribution"}),n.jsx(O0,{data:h,formatValue:x=>x.toString()})]}),n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[n.jsxs("h4",{className:"text-sm font-medium mb-3",children:["Accepted Tool Calls"," ",m.length>10&&n.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"(top 10)"})]}),m.length===0?n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No accepted v2 tool calls in window"}):n.jsx(O0,{data:m,maxBars:10})]}),d.some(([,x])=>x.succeeded+x.failed+x.denied+x.cancelled+x.rejected>0)&&n.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[n.jsx("h4",{className:"text-sm font-medium mb-3",children:"Tool Lifecycle Outcomes (v2)"}),n.jsx(fc,{data:d.filter(([,x])=>x.succeeded+x.failed+x.denied+x.cancelled+x.rejected>0).map(([x,v])=>({label:x,segments:[{name:"succeeded",value:v.succeeded,color:"#10b981"},{name:"failed",value:v.failed,color:"#ef4444"},{name:"denied",value:v.denied,color:"#dc2626"},{name:"cancelled",value:v.cancelled,color:"#f59e0b"},{name:"rejected",value:v.rejected,color:"#be123c"}].filter(y=>y.value>0)})),formatValue:x=>x.toString()})]}),d.some(([,x])=>x.legacy.calls+x.legacy.approved+x.legacy.denied>0)&&n.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-amber-500/30 bg-amber-500/5 p-4",children:[n.jsx("h4",{className:"text-sm font-medium mb-1",children:"Legacy Tool Lifecycle (v1)"}),n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))] mb-3",children:"Historical call, approval, and denial counts are kept separate because v1 did not record the v2 terminal outcome union."}),n.jsx(fc,{data:d.filter(([,x])=>x.legacy.calls+x.legacy.approved+x.legacy.denied>0).map(([x,v])=>({label:x,segments:[{name:"legacy calls",value:v.legacy.calls,color:"#64748b"},{name:"legacy approved",value:v.legacy.approved,color:"#059669"},{name:"legacy denied",value:v.legacy.denied,color:"#b91c1c"}].filter(y=>y.value>0)})),formatValue:x=>x.toString()})]}),f.length>0&&n.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[n.jsx("h4",{className:"text-sm font-medium mb-3",children:"Retries by Agent"}),n.jsx(fc,{data:p,formatValue:x=>x.toString()})]}),d.some(([,x])=>x.approved+x.denied>0)&&n.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[n.jsx("h4",{className:"text-sm font-medium mb-3",children:"Tool Approvals / Denials"}),n.jsx(fc,{data:d.filter(([,x])=>x.approved+x.denied>0).map(([x,v])=>({label:x,segments:[{name:"approved",value:v.approved,color:"#10b981"},{name:"denied",value:v.denied,color:"#ef4444"}].filter(y=>y.value>0)})),formatValue:x=>x.toString()})]})]})]})}const iw={running:"border-l-blue-500",completed:"border-l-green-500",failed:"border-l-red-500"};function cw(s){const r=new Date(s),o=new Date;return r.getFullYear()===o.getFullYear()&&r.getMonth()===o.getMonth()&&r.getDate()===o.getDate()?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):r.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function uw(s){switch(s.reason){case"branch_drain_timeout":return`Trace incomplete: terminal finalization stopped after ${s.timeoutMs} ms with ${s.pendingContinuations} branch continuations still running.`;case"queue_overflow":return`Trace incomplete: ${s.droppedEvents} queued events were dropped.`;case"persistence_truncated":return`Trace incomplete: persisted events were truncated at ${s.maxEvents} entries.`;case"process_interrupted":return"Trace incomplete: the process terminated before the execution reached a terminal boundary."}}function dw(){var j;const[s,r]=b.useState("events"),[o,i]=b.useState(null),[d,f]=b.useState([]),[h,m]=b.useState(""),[p,x]=b.useState(""),{data:v=[],refetch:y}=ln({queryKey:["executions"],queryFn:yS,refetchInterval:3e3});sm("trace:*",b.useCallback(S=>{f(E=>[...E.slice(-200),S])},[]));const k=o?o.events:d;let w=k;h&&(w=w.filter(S=>S.type===h)),p&&(w=w.filter(S=>S.agent===p));const C=b.useMemo(()=>[...new Set(k.map(S=>S.type))].sort(),[k]),A=b.useMemo(()=>[...new Set(k.map(S=>S.agent).filter(S=>!!S))].sort(),[k]),_=b.useMemo(()=>[{value:"",label:"All types"},...C.map(S=>({value:S,label:S}))],[C]),D=b.useMemo(()=>[{value:"",label:"All agents"},...A.map(S=>({value:S,label:S}))],[A]),$=Math.max(...w.map(S=>S.duration??0),1),T=b.useMemo(()=>{if(!o)return null;const S=[...new Set(o.events.map(E=>E.model).filter(Boolean))];return{duration:o.duration,eventCount:o.events.length,cost:o.totalCost,models:S}},[o]);return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Trace Explorer",description:o?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:o.workflow}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{className:"font-mono",children:o.executionId.slice(0,8)}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[o.events.length," event",o.events.length!==1?"s":""]})]}):n.jsxs(n.Fragment,{children:[v.length," execution",v.length!==1?"s":"",n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),d.length," live event",d.length!==1?"s":""]}),actions:n.jsxs(n.Fragment,{children:[n.jsx(Do,{items:_,value:h,onSelect:m,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All types",searchPlaceholder:"Filter types…",variant:"filter",triggerClassName:Q("rounded-full shadow-sm ring-1 transition-shadow",h?"ring-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"ring-[hsl(var(--input))]"),ariaLabel:"Filter by event type"}),A.length>0&&n.jsx(Do,{items:D,value:p,onSelect:x,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All agents",searchPlaceholder:"Filter agents…",variant:"filter",triggerClassName:Q("rounded-full shadow-sm ring-1 transition-shadow",p?"ring-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"ring-[hsl(var(--input))]"),ariaLabel:"Filter by agent"}),n.jsxs("button",{onClick:()=>{y(),f([])},className:Q("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","ring-1 ring-[hsl(var(--input))] bg-[hsl(var(--background))] shadow-sm","hover:bg-[hsl(var(--muted))] hover:ring-[hsl(var(--ring))]","focus:outline-none focus-visible:ring-[hsl(var(--ring))] transition-all"),children:[n.jsx(f2,{size:12}),"Refresh"]})]})}),n.jsx("div",{role:"tablist","aria-label":"Trace views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:["events","stats"].map(S=>n.jsx("button",{type:"button",role:"tab","aria-selected":s===S,onClick:()=>r(S),className:Q("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",s===S?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:S.charAt(0).toUpperCase()+S.slice(1)},S))}),s==="stats"&&n.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:n.jsx(ow,{})}),s==="events"&&n.jsx(_l,{className:"flex-1",defaultPercent:25,minPercent:15,maxPercent:40,left:n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-2",children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Executions"}),n.jsxs("button",{onClick:()=>{i(null)},className:Q("w-full text-left px-3 py-2 text-xs rounded-xl border",o?"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]":"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]"),children:["Live Events (",d.length,")"]}),v.map(S=>n.jsxs("button",{onClick:()=>{i(S)},className:Q("w-full text-left px-3 py-2.5 text-xs rounded-xl border border-l-[3px] transition-colors",iw[S.status]??"border-l-slate-400",(o==null?void 0:o.executionId)===S.executionId?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"),children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-medium truncate",children:S.workflow}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[S0(S)===1&&n.jsx("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400",title:"Legacy v1 lifecycle semantics",children:"legacy v1"}),n.jsx(vv,{status:S.status})]})]}),n.jsxs("div",{className:"flex items-center justify-between mt-1",children:[n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] truncate",children:[S.executionId.slice(0,8),"… | ",S.events.length," events"]}),(S.totalCost>0||S.unpriced)&&n.jsx(ua,{cost:S.totalCost,unpriced:S.unpriced})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[n.jsx("span",{children:cw(S.startedAt)}),S.duration>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-[hsl(var(--border))]",children:"·"}),n.jsx("span",{children:ht(S.duration)})]})]})]},S.executionId)),v.length===0&&n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No executions yet"})]}),right:n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[T&&n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[n.jsx(tt,{label:"Duration",value:ht(T.duration)}),n.jsx(tt,{label:"Events",value:String(T.eventCount)}),n.jsx(tt,{label:"Cost",value:T.cost>0?vt(T.cost):"—"}),n.jsx(tt,{label:"Model",value:T.models.length>0?T.models[0]:"—",subtitle:T.models.length>1?`+${T.models.length-1} more`:void 0})]}),o&&S0(o)===1&&n.jsx("div",{className:"mb-4 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Legacy v1 lifecycle: tool outcomes retain their historical semantics and may contain unmatched starts."}),((j=o==null?void 0:o.observation)==null?void 0:j.complete)===!1&&n.jsx("div",{className:"mb-4 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:uw(o.observation)}),(o==null?void 0:o.status)==="completed"&&o.result!=null&&n.jsxs("div",{className:"mb-4",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),n.jsx(Ct,{data:o.result})]}),w.length===0?n.jsx(rn,{icon:n.jsx(Rc,{size:32}),title:"No trace events",description:"Execute a workflow to see trace events here."}):n.jsx(Ko,{events:w,lifecycleEvents:k,traceComplete:o?o.status!=="running":void 0,maxDuration:$})]})})]})}function kf({title:s,description:r,actions:o,children:i}){return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:s,description:r,actions:o}),n.jsx("main",{className:"flex-1 overflow-auto p-4 sm:p-6",children:i})]})}function R0({tokens:s,label:r,className:o}){return n.jsxs("span",{className:`inline-flex items-center gap-1 whitespace-nowrap px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${o??""}`,children:[r&&n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:r}),Yn(s)]})}function fw(s,r){const o=Math.max(0,r-s);return o<1e3?"just now":o<6e4?`${Math.floor(o/1e3)}s ago`:o<36e5?`${Math.floor(o/6e4)}m ago`:`${Math.floor(o/36e5)}h ago`}function mw(){const{window:s,handleWindowChange:r,data:o,updatedAt:i}=Dc("costs",OS),[d,f]=b.useState(()=>Date.now());if(b.useEffect(()=>{const j=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(j)},[]),!o)return n.jsx(kf,{title:"Cost Dashboard",description:"Spending across agents, models, and workflows",actions:n.jsx(_s,{value:s,onChange:r}),children:n.jsx(rn,{icon:n.jsx(Zg,{size:32}),title:"No cost data",description:"Execute workflows to see cost data."})});const h=o.totalTokens.reasoning>0,m=Object.keys(o.byAgent).length,p=Object.keys(o.byModel).length,x=Object.values(o.byWorkflow).reduce((j,S)=>j+S.executions,0),v=o.retry??{primary:0,primaryCalls:0,schema:0,schemaCalls:0,validate:0,validateCalls:0,guardrail:0,guardrailCalls:0,retryCalls:0},y=v.schema+v.validate+v.guardrail,k=o.totalCost>0?y/o.totalCost*100:0,w=o.byEmbedder??{},C=Object.entries(w),A=C.reduce((j,[,S])=>j+S.cost,0),_=C.reduce((j,[,S])=>j+S.calls,0),D=C.reduce((j,[,S])=>j+(S.unpricedCalls??0),0),$=C.reduce((j,[,S])=>j+S.tokens,0),T=o.totalCost>0?A/o.totalCost*100:0;return n.jsxs(kf,{title:"Cost Dashboard",description:o.totalCost>0?n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[vt(o.totalCost)," total"]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[m," agent",m!==1?"s":""]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[p," model",p!==1?"s":""]})]}):"Spending across agents, models, and workflows",actions:n.jsx(_s,{value:s,onChange:r}),children:[n.jsxs("div",{className:Q("grid grid-cols-1 sm:grid-cols-2 gap-3 mb-8",h?"lg:grid-cols-4":"lg:grid-cols-3"),children:[n.jsx(tt,{label:"Total Cost",value:o.unpricedCalls>0?`≥ ${vt(o.totalCost)}`:vt(o.totalCost),subtitle:o.unpricedCalls>0?`${s} · lower bound (${o.unpricedCalls} unpriced call${o.unpricedCalls!==1?"s":""})`:s}),n.jsx(tt,{label:"Input Tokens",value:Yn(o.totalTokens.input),subtitle:"prompt"}),n.jsx(tt,{label:"Output Tokens",value:Yn(o.totalTokens.output),subtitle:"completion"}),h&&n.jsx(tt,{label:"Reasoning Tokens",value:Yn(o.totalTokens.reasoning),subtitle:"thinking"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Agent"}),Object.keys(o.byAgent).length===0?n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No agent data"}):n.jsx(To,{columns:[{label:"Agent",sortKey:j=>j.agent,render:j=>n.jsx("span",{className:"font-mono",children:j.agent})},{label:"Calls",sortKey:j=>j.calls,render:j=>n.jsx("span",{children:j.calls})},{label:"Cost",sortKey:j=>j.cost,render:j=>n.jsx(ua,{cost:j.cost,unpriced:j.unpricedCalls>0})}],rows:Object.entries(o.byAgent).map(([j,S])=>({agent:j,cost:S.cost,calls:S.calls,unpricedCalls:S.unpricedCalls??0})),rowKey:j=>j.agent,defaultSort:{index:2,dir:"desc"},costValue:j=>j.cost})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Model"}),Object.keys(o.byModel).length===0?n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No model data"}):n.jsx(To,{columns:[{label:"Model",sortKey:j=>j.model,render:j=>n.jsx("span",{className:"font-mono",children:j.model})},{label:"Calls",sortKey:j=>j.calls,render:j=>n.jsx("span",{children:j.calls})},{label:"Tokens",sortKey:j=>j.tokens,render:j=>n.jsx(R0,{tokens:j.tokens})},{label:"Cost",sortKey:j=>j.cost,render:j=>n.jsx(ua,{cost:j.cost,unpriced:j.unpricedCalls>0})}],rows:Object.entries(o.byModel).map(([j,S])=>({model:j,calls:S.calls,tokens:S.tokens.input+S.tokens.output,cost:S.cost,unpricedCalls:S.unpricedCalls??0})),rowKey:j=>j.model,defaultSort:{index:3,dir:"desc"},costValue:j=>j.cost})]}),n.jsxs("div",{className:"lg:col-span-2",children:[n.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Workflow"}),Object.keys(o.byWorkflow).length===0?n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No workflow data"}):n.jsx(To,{columns:[{label:"Workflow",sortKey:j=>j.workflow,render:j=>n.jsx("span",{className:"font-mono",children:j.workflow})},{label:"Executions",sortKey:j=>j.executions,render:j=>n.jsx("span",{children:j.executions})},{label:"Total Cost",sortKey:j=>j.cost,render:j=>n.jsx(ua,{cost:j.cost,unpriced:j.unpricedCalls>0})},{label:"Avg Cost",sortKey:j=>j.avgCost,render:j=>n.jsx(ua,{cost:j.avgCost,unpriced:j.unpricedCalls>0})}],rows:Object.entries(o.byWorkflow).map(([j,S])=>({workflow:j,executions:S.executions,cost:S.cost,avgCost:S.executions>0?S.cost/S.executions:0,unpricedCalls:S.unpricedCalls??0})),rowKey:j=>j.workflow,defaultSort:{index:2,dir:"desc"},costValue:j=>j.cost})]}),C.length>0&&n.jsxs("div",{className:"lg:col-span-2",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Memory (Embedder)"}),n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[D>0?`≥ ${vt(A)}`:vt(A)," ","across ",_," call",_!==1?"s":"",n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),Yn($)," tokens",T>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),T.toFixed(1),"% of total"]})]})]}),n.jsx(To,{columns:[{label:"Embedder Model",sortKey:j=>j.model,render:j=>n.jsx("span",{className:"font-mono",children:j.model})},{label:"Calls",sortKey:j=>j.calls,render:j=>n.jsx("span",{children:j.calls})},{label:"Tokens",sortKey:j=>j.tokens,render:j=>n.jsx(R0,{tokens:j.tokens})},{label:"Cost",sortKey:j=>j.cost,render:j=>n.jsx(ua,{cost:j.cost,unpriced:j.unpricedCalls>0})}],rows:C.map(([j,S])=>({model:j,calls:S.calls,tokens:S.tokens,cost:S.cost,unpricedCalls:S.unpricedCalls??0})),rowKey:j=>j.model,defaultSort:{index:3,dir:"desc"},costValue:j=>j.cost})]}),(y>0||v.retryCalls>0)&&n.jsxs("div",{className:"lg:col-span-2",children:[n.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Retry Overhead"}),n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[vt(y)," across ",v.retryCalls," retry call",v.retryCalls!==1?"s":"",k>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),k.toFixed(1),"% of total"]})]})]}),n.jsx(To,{columns:[{label:"Reason",sortKey:j=>j.reason,render:j=>j.reasonLabel},{label:"Calls",sortKey:j=>j.calls,render:j=>n.jsx("span",{children:j.calls})},{label:"Cost",sortKey:j=>j.cost,render:j=>n.jsx(ua,{cost:j.cost})}],rows:[{reason:"primary",reasonLabel:n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"primary (first attempt)"}),calls:v.primaryCalls,cost:v.primary},{reason:"schema",reasonLabel:n.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"schema retry"}),calls:v.schemaCalls,cost:v.schema},{reason:"validate",reasonLabel:n.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"validate retry"}),calls:v.validateCalls,cost:v.validate},{reason:"guardrail",reasonLabel:n.jsx("span",{className:"font-mono text-rose-600 dark:text-rose-400",children:"guardrail retry"}),calls:v.guardrailCalls,cost:v.guardrail}],rowKey:j=>j.reason,defaultSort:{index:2,dir:"desc"},costValue:j=>j.cost})]})]}),n.jsxs("div",{className:"mt-6 pt-3 border-t border-[hsl(var(--border))] text-[11px] text-[hsl(var(--muted-foreground))] flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Window: ",n.jsx("span",{className:"font-mono",children:s})]}),n.jsx("span",{className:"opacity-40",children:"·"}),n.jsxs("span",{children:["Last updated: ",i!=null?fw(i,d):"pending"]}),n.jsx("span",{className:"opacity-40",children:"·"}),n.jsxs("span",{children:[x," execution",x!==1?"s":""," in window"]})]})]})}function To({columns:s,rows:r,rowKey:o,defaultSort:i,costValue:d}){const f=(i==null?void 0:i.index)??s.findIndex(C=>C.sortKey!==void 0),h=(i==null?void 0:i.dir)??"desc",[m,p]=b.useState(f),[x,v]=b.useState(h),y=b.useMemo(()=>{const C=s[m];if(!(C!=null&&C.sortKey))return r;const A=C.sortKey,_=[...r];return _.sort((D,$)=>{const T=A(D),j=A($);if(typeof T=="number"&&typeof j=="number")return x==="asc"?T-j:j-T;const S=String(T),E=String(j);return x==="asc"?S.localeCompare(E):E.localeCompare(S)}),_},[r,s,m,x]),k=b.useMemo(()=>{if(!d)return 0;let C=0;for(const A of r){const _=d(A);_>C&&(C=_)}return C},[r,d]),w=C=>{s[C].sortKey&&(m===C?v(A=>A==="desc"?"asc":"desc"):(p(C),v("desc")))};return n.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs min-w-[480px]",children:[n.jsx("thead",{children:n.jsx("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:s.map((C,A)=>{const _=C.align??(A===0?"left":"right"),D=C.sortKey!==void 0,$=D&&m===A,T=$?x==="asc"?" ↑":" ↓":"";return n.jsxs("th",{"aria-sort":$?x==="asc"?"ascending":"descending":void 0,className:Q("py-2 px-3 font-medium",_==="left"?"text-left":"text-right",D&&"cursor-pointer select-none hover:text-[hsl(var(--foreground))]",D&&!$&&"text-[hsl(var(--muted-foreground))]"),onClick:D?()=>w(A):void 0,title:D?"Click to sort":void 0,children:[C.label,T]},C.label)})})}),n.jsx("tbody",{children:y.map(C=>{const A=d?d(C):0;return n.jsx("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:s.map((_,D)=>{const $=_.align??(D===0?"left":"right");return n.jsxs("td",{className:Q("py-2 px-3 relative",$==="left"?"text-left":"text-right"),children:[D===s.length-1&&k>0&&n.jsx("div",{className:"absolute inset-y-0 right-0 bg-[hsl(var(--primary)/0.08)] rounded-sm",style:{width:`${A/k*100}%`}}),n.jsx("span",{className:"relative",children:_.render(C)})]},_.label)})},o(C))})})]})})}function hw(){const[s,r]=b.useState("session"),[o,i]=b.useState(""),[d,f]=b.useState("{}"),[h,m]=b.useState(!1),[p,x]=b.useState(""),[v,y]=b.useState(null),[k,w]=b.useState(null),C=Go(),{data:A=[]}=ln({queryKey:["memory",s],queryFn:()=>TS(s)}),_=jf({mutationFn:({key:S,value:E})=>MS(s,S,E),onSuccess:()=>{C.invalidateQueries({queryKey:["memory",s]}),m(!1),i(""),f("{}")}}),D=jf({mutationFn:S=>AS(s,S),onSuccess:()=>{C.invalidateQueries({queryKey:["memory",s]}),w(null)}}),$=b.useCallback(async()=>{if(!p.trim())return;const S=await _S(p,s);y(S.results)},[p,s]),T=b.useCallback(()=>{if(o.trim())try{const S=JSON.parse(d);_.mutate({key:o,value:S})}catch{_.mutate({key:o,value:d})}},[o,d,_]),j=b.useCallback(S=>{k===S?D.mutate(S):w(S)},[k,D]);return n.jsxs(kf,{title:"Memory Browser",description:A.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[A.length," entr",A.length!==1?"ies":"y"]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[s," scope"]})]}):"Key-value entries stored via ctx.remember()",actions:n.jsxs("button",{type:"button",onClick:()=>m(!h),className:Q("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] shadow-sm","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-[hsl(var(--ring))]","transition-opacity"),children:[n.jsx(Wg,{size:12}),"Add entry"]}),children:[n.jsxs("div",{role:"tablist","aria-label":"Memory scope",className:"flex items-center gap-0 mb-4 border-b border-[hsl(var(--border))]",children:[["session","global"].map(S=>n.jsx("button",{type:"button",role:"tab","aria-selected":s===S,onClick:()=>{r(S),y(null),w(null)},className:Q("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors",s===S?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:S.charAt(0).toUpperCase()+S.slice(1)},S)),n.jsx("div",{className:"flex-1"}),n.jsxs("div",{className:"flex items-center gap-1 -mb-px pb-2",children:[n.jsx("input",{value:p,onChange:S=>x(S.target.value),onKeyDown:S=>S.key==="Enter"&&$(),placeholder:"Semantic search...",className:"px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))] w-48"}),n.jsx("button",{onClick:$,className:"p-1.5 rounded-md hover:bg-[hsl(var(--accent))]",children:n.jsx(wf,{size:14})})]})]}),h&&n.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] space-y-3",children:[n.jsx("input",{value:o,onChange:S=>i(S.target.value),placeholder:"Key",className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]"}),n.jsx(xv,{value:d,onChange:f,placeholder:"Value (JSON)"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:T,disabled:!o.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 disabled:opacity-50",children:"Save"}),n.jsx("button",{onClick:()=>m(!1),className:"px-3 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]})]}),v&&n.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("h3",{className:"text-sm font-medium mb-2",children:"Search Results"}),v.length===0?n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No results found"}):n.jsx(Ct,{data:v})]}),A.length===0?n.jsx(rn,{icon:n.jsx(Kg,{size:32}),title:"No memory entries",description:`No entries in the ${s} scope. Use ctx.remember() in workflows or add entries manually.`}):n.jsx("div",{className:"space-y-2",children:A.map(S=>n.jsxs("div",{className:"p-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-sm font-mono font-medium",children:S.key}),n.jsx("div",{className:"flex items-center gap-1",children:k===S.key?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>j(S.key),className:"px-2 py-0.5 text-xs rounded bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))]",children:"Confirm"}),n.jsx("button",{onClick:()=>w(null),className:"px-2 py-0.5 text-xs rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]}):n.jsx("button",{onClick:()=>j(S.key),className:"p-1 rounded hover:bg-[hsl(var(--destructive))] hover:text-[hsl(var(--destructive-foreground))] text-[hsl(var(--muted-foreground))]",children:n.jsx(Pf,{size:14})})})]}),n.jsx(Ct,{data:S.value,collapsed:!0})]},S.key))})]})}function pw(s){try{return JSON.parse(s)}catch{return s}}function xw(s){switch(s.type){case"text":return`Text: ${s.characters} characters`;case"image":case"audio":{const r=s.type==="image"?"Image":"Audio",o=s.mediaType?` (${s.mediaType})`:"",i=s.bytes!==void 0?`, ${s.bytes} bytes`:"";return`${r}: ${s.source}${o}${i}`}default:return`Unknown part: ${String(s.type)}`}}function gw(s,r){if(typeof s!="string")return n.jsxs("div",{className:"space-y-1 text-xs text-[hsl(var(--muted-foreground))]",children:[n.jsx("div",{children:"Rich model input"}),s.parts.map((o,i)=>n.jsx("div",{children:xw(o)},i))]});if(r==="assistant"){const o=s.trim();if(o.startsWith("{")||o.startsWith("["))try{const i=JSON.parse(o);return n.jsx(Ct,{data:i,collapsed:!0})}catch{}}return n.jsx("div",{className:"whitespace-pre-wrap",children:s})}function vw(){const[s,r]=b.useState(null),[o,i]=b.useState(null),[d,f]=b.useState(null),[h,m]=b.useState(null),p=Go(),{data:x=[]}=ln({queryKey:["sessions"],queryFn:jS,refetchInterval:5e3}),{data:v}=ln({queryKey:["session",s],queryFn:()=>NS(s),enabled:!!s}),y=jf({mutationFn:SS,onSuccess:()=>{p.invalidateQueries({queryKey:["sessions"]}),r(null),f(null)}}),k=v!=null&&v.history?o!==null?v.history.slice(0,o+1):v.history:[];return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Session Manager",description:x.length>0?s&&v?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-mono",children:v.id.slice(0,16)}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[v.history.length," message",v.history.length!==1?"s":""]})]}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[x.length," active session",x.length!==1?"s":""]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{children:"select one to replay"})]}):"Multi-turn conversations tracked via runtime.session()"}),n.jsx(_l,{className:"flex-1",defaultPercent:33,minPercent:20,maxPercent:50,left:n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6 space-y-2",children:[n.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Sessions (",x.length,")"]}),x.length===0?n.jsx(rn,{icon:n.jsx(ev,{size:24}),title:"No sessions",description:"Sessions are created when using runtime.session()"}):x.map(w=>n.jsxs("button",{onClick:()=>{r(w.id),i(null)},className:`w-full text-left px-3 py-2.5 text-xs rounded-xl border transition-colors ${s===w.id?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[n.jsx("div",{className:"font-mono truncate text-[11px]",title:w.id,children:w.id}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[hsl(var(--muted-foreground))] mt-1",children:[n.jsx(Jg,{size:11}),n.jsxs("span",{children:[w.messageCount," message",w.messageCount!==1?"s":""]})]})]},w.id))]}),right:n.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:v?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium font-mono",children:v.id}),n.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[v.history.length," messages"]})]}),d===v.id?n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>y.mutate(v.id),className:"px-2 py-1 text-xs rounded-md bg-red-600 text-white hover:bg-red-700 dark:bg-red-700 dark:hover:bg-red-800",children:"Confirm"}),n.jsx("button",{onClick:()=>f(null),className:"px-2 py-1 text-xs rounded-md border border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]}):n.jsxs("button",{onClick:()=>f(v.id),className:"flex items-center gap-1 px-2 py-1 text-xs rounded-md border border-red-300 text-red-600 hover:bg-red-50 dark:border-red-800 dark:text-red-400 dark:hover:bg-red-950",children:[n.jsx(Pf,{size:12}),"Delete"]})]}),v.handoffHistory&&v.handoffHistory.length>0&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-xs font-medium mb-2",children:"Handoff Chain"}),n.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:v.handoffHistory.map((w,C)=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:w.source}),n.jsx(wl,{size:12,className:"text-[hsl(var(--muted-foreground))]"}),n.jsx("span",{className:"px-2 py-0.5 text-xs rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:w.target}),n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["(",w.mode,")"]}),C<v.handoffHistory.length-1&&n.jsx("span",{className:"mx-1 text-[hsl(var(--muted-foreground))]",children:"|"})]},C))})]}),v.history.length>1&&n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-xs font-medium",children:"Replay"}),n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:o!==null?`${o+1} / ${v.history.length}`:`${v.history.length} / ${v.history.length}`})]}),n.jsx("input",{type:"range",min:0,max:v.history.length-1,value:o??v.history.length-1,onChange:w=>i(Number(w.target.value)),className:"w-full h-1.5 rounded-full appearance-none cursor-pointer bg-[hsl(var(--secondary))] [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3.5 [&::-webkit-slider-thumb]:h-3.5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[hsl(var(--primary))] [&::-webkit-slider-thumb]:shadow-sm [&::-moz-range-thumb]:w-3.5 [&::-moz-range-thumb]:h-3.5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-[hsl(var(--primary))] [&::-moz-range-thumb]:border-0"}),n.jsxs("div",{className:"flex justify-between mt-1",children:[n.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Start"}),n.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Latest"})]})]}),n.jsx("div",{className:"space-y-3",children:k.map((w,C)=>{const A=h!==null&&w.role==="assistant"&&w.agent!==h;return n.jsxs("div",{className:`p-3 rounded-xl text-sm transition-opacity ${A?"opacity-30":""} ${w.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] ml-8":w.role==="assistant"?"bg-[hsl(var(--secondary))] mr-8":"bg-[hsl(var(--muted))] text-xs font-mono"}`,children:[n.jsxs("div",{className:"text-xs font-medium mb-1 flex items-center gap-1.5",children:[n.jsx("span",{className:"opacity-70",children:w.role}),w.agent&&n.jsx("button",{type:"button",onClick:()=>m(h===w.agent?null:w.agent??null),className:`px-1.5 py-0.5 rounded font-mono text-[10px] truncate max-w-[12rem] cursor-pointer transition-colors ${h===w.agent?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]":"bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]"}`,title:h===w.agent?"Click to clear filter":`Click to highlight messages from ${w.agent}`,children:w.agent})]}),gw(w.content,w.role),w.tool_calls&&w.tool_calls.length>0&&n.jsx("div",{className:"mt-2 space-y-1",children:w.tool_calls.map(_=>n.jsxs("details",{className:"text-xs",children:[n.jsx("summary",{className:"cursor-pointer font-mono",children:_.function.name}),n.jsx(Ct,{data:pw(_.function.arguments),collapsed:!0})]},_.id))})]},C)})})]}):n.jsx(rn,{title:"Select a session",description:"Click a session to view its history"})})})]})}function bw(){const[s,r]=b.useState(null),[o,i]=b.useState(void 0),[d,f]=b.useState(null),[h,m]=b.useState(!1),[p,x]=b.useState(!1),{data:v=[]}=ln({queryKey:["tools"],queryFn:kS}),{data:y}=ln({queryKey:["tool",s],queryFn:()=>CS(s),enabled:!!s}),k=b.useCallback(async C=>{if(s){i(null),f(null),m(!0);try{const A=await ES(s,C);i(A.result)}catch(A){f(A instanceof Error?A.message:String(A))}finally{m(!1)}}},[s]),w=v.find(C=>C.name===s);return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Tool Inspector",description:w?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-mono",children:w.name}),w.description&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{children:w.description})]})]}):v.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"whitespace-nowrap",children:[v.length," registered tool",v.length!==1?"s":""]}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{children:"select one to inspect"})]}):"Registered tools with schemas and direct testing"}),n.jsx(_l,{className:"flex-1",defaultPercent:33,minPercent:20,maxPercent:50,left:n.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Tools (",v.length,")"]}),v.length===0?n.jsx(rn,{icon:n.jsx(tv,{size:24}),title:"No tools",description:"Register tools with runtime.registerTool()"}):v.map(C=>n.jsxs("button",{onClick:()=>{r(C.name),i(void 0),f(null),x(!1)},className:`w-full text-left px-3 py-2 text-xs rounded-xl border ${s===C.name?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[n.jsx("div",{className:"font-medium",children:C.name}),n.jsx("div",{className:"text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:C.description}),n.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[C.sensitive&&n.jsx("span",{className:"px-1 py-0.5 rounded bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-300 text-[10px]",children:"sensitive"}),C.requireApproval&&n.jsx("span",{className:"px-1 py-0.5 rounded bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 text-[10px]",children:"approval"})]})]},C.name))]})}),right:n.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:s?y?n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-lg font-medium",children:y.name}),n.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:y.description})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.sensitive&&n.jsx("span",{className:"px-2 py-1 text-xs rounded-md bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-300",children:"Sensitive"}),y.requireApproval&&n.jsx("span",{className:"px-2 py-1 text-xs rounded-md bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300",children:"Requires Approval"}),y.retry.attempts&&y.retry.attempts>1&&n.jsxs("span",{className:"px-2 py-1 text-xs rounded-md bg-green-100 dark:bg-green-900 text-green-700 dark:text-green-300",children:["Retry: ",y.retry.attempts,"x ",y.retry.backoff]}),y.hasHooks&&y.hooks&&n.jsxs("span",{className:"px-2 py-1 text-xs rounded-md bg-purple-100 dark:bg-purple-900 text-purple-700 dark:text-purple-300",children:["Hooks:"," ",[y.hooks.hasBefore&&"before",y.hooks.hasAfter&&"after"].filter(Boolean).join(" + ")]})]}),n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>x(!p),className:"flex items-center gap-1.5 text-sm font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",children:[n.jsx(Kn,{size:14,className:Q("transition-transform",p&&"rotate-90")}),"View raw schema"]}),p&&n.jsx("div",{className:"mt-2",children:n.jsx(Ct,{data:y.inputSchema})})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium mb-2",children:"Test Tool"}),n.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:n.jsx(gv,{schema:y.inputSchema,onSubmit:k,submitLabel:h?"Running...":"Run Tool"})})]}),o!==void 0&&n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium mb-2",children:"Result"}),n.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:n.jsx(Ct,{data:o})})]}),d&&n.jsx("div",{className:"p-3 rounded-xl bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm",children:d})]}):n.jsxs("div",{className:"flex items-center gap-2 text-sm text-[hsl(var(--muted-foreground))]",children:[n.jsx(XN,{size:16,className:"animate-spin"}),"Loading tool details..."]}):n.jsx(rn,{title:"Select a tool",description:"Click a tool to view its schema and test it"})})})]})}const Sc={status:"idle",evalRunId:null,evalName:null,runCount:1,startedAt:null,progress:null,done:null,error:null},yw=300*1e3;let Ft=Sc;const Cf=new Set;let vc=null,cl=null;function Zn(s){Ft=s;for(const r of Cf)r()}function jw(){return Ft}function Nw(s){return Cf.add(s),()=>Cf.delete(s)}function ul(){vc&&(vc(),vc=null),cl&&(clearTimeout(cl),cl=null)}function D0(){cl&&clearTimeout(cl),cl=setTimeout(()=>{Ft.status==="running"&&(Zn({...Ft,status:"error",error:"Lost contact with the server — no progress received. The eval may still be running; check the History tab."}),ul())},yw)}function Sw(){return b.useSyncExternalStore(Nw,jw)}async function ww(s,r,o=!1){if(Ft.status==="running"&&Ft.evalRunId)try{await hv(Ft.evalRunId)}catch{}ul(),Zn({...Sc,status:"running",evalName:s,runCount:r,startedAt:Date.now()});let i;try{i=(await $S(s,{runs:r,captureTraces:o})).evalRunId}catch(d){Zn({...Sc,status:"error",error:d instanceof Error?d.message:String(d)});return}Zn({...Ft,evalRunId:i}),D0(),vc=_o.subscribe(`eval:${i}`,d=>{var h;const f=d;switch(D0(),f.type){case"item_done":{const m=f.itemIndex,p=f.totalItems,x=typeof f.run=="number"?f.run:1,v=typeof f.totalRuns=="number"?f.totalRuns:1;Zn({...Ft,progress:{completedItems:m+1,totalItems:p,completedRuns:x-1,totalRuns:v}});break}case"run_done":{const m=f.run,p=f.totalRuns;Zn({...Ft,progress:{completedItems:0,totalItems:((h=Ft.progress)==null?void 0:h.totalItems)??0,completedRuns:m,totalRuns:p}});break}case"done":{const m=typeof f.evalResultId=="string"?f.evalResultId:null,p=typeof f.runGroupId=="string"?f.runGroupId:void 0;Zn(m?{...Ft,status:"done",done:p?{evalResultId:m,runGroupId:p}:{evalResultId:m}}:{...Ft,status:"error",error:"Eval completed without a result id — cannot adopt from history."}),ul();break}case"error":Zn({...Ft,status:"error",error:f.message}),ul();break}})}async function kw(){if(Ft.evalRunId)try{await hv(Ft.evalRunId)}catch{}Zn({...Ft,status:"error",error:"Cancelled"}),ul()}function z0(){Zn(Sc),ul()}function Cw({points:s,width:r=80,height:o=22,className:i}){const d=_=>(_.completeness??"unverified")==="complete",f=s.filter(_=>!d(_)).length,h=f===0?`Cost over time across ${s.length} measured runs.`:`Cost over time across ${s.length} runs. ${f} of them are lower bounds or unverified totals, drawn as hollow points on dashed segments — the shape between them is not a measured trend.`;if(s.length===0)return n.jsx("div",{className:Q("inline-block",i),style:{width:r,height:o}});const m=s.map(_=>_.cost),p=Math.min(...m),x=Math.max(...m),v=Math.max(.001,x-p),y=3,k=o-y*2,w=s.map((_,D)=>({x:s.length===1?r/2:D/(s.length-1)*r,y:y+k-(_.cost-p)/v*k,measured:d(_)})),C="hsl(var(--primary))",A="hsl(38 92% 45%)";return n.jsxs("svg",{width:r,height:o,viewBox:`0 0 ${r} ${o}`,role:"img","aria-label":h,className:Q("inline-block overflow-visible",i),children:[n.jsx("title",{children:h}),w.slice(1).map((_,D)=>{const $=w[D],T=$.measured&&_.measured;return n.jsx("line",{x1:$.x,y1:$.y,x2:_.x,y2:_.y,stroke:T?C:A,strokeWidth:1.25,...T?{}:{strokeDasharray:"2 2"}},D)}),w.map((_,D)=>_.measured?n.jsx("circle",{cx:_.x,cy:_.y,r:1.6,fill:C},D):n.jsx("circle",{cx:_.x,cy:_.y,r:2.1,fill:"none",stroke:A,strokeWidth:1.25},D))]})}function Ew(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,cachedTokens:0,cacheWriteTokens:0,audioSeconds:0}}function Vo(){return{version:1,currency:"USD",knownCost:0,completeness:"complete",reasons:{},usage:Ew(),operations:{total:0,settled:0,unknown:0,denied:0,byKind:{}},breakdown:{generation:0,judging:0,external:0},provenance:{}}}function Ms(s){return typeof s=="number"&&Number.isFinite(s)&&s>=0?s:0}function Ol(s){var o;if(s!=null&&s.accounting)return s.accounting;const r=((o=s==null?void 0:s.metadata)==null?void 0:o.rescored)===!0;return{...Vo(),knownCost:Ms(s==null?void 0:s.totalCost),completeness:"unverified",scope:r?"rescore":"run"}}function bc(s){if(s!=null&&s.accounting)return s.accounting;const r=Ms(s==null?void 0:s.cost),o=Ms(s==null?void 0:s.scorerCost);return{...Vo(),knownCost:r+o,completeness:"unverified",breakdown:{generation:r,judging:o,external:0}}}function Tw(s){if(s!=null&&s.accounting)return s.accounting;const r=Ms(s==null?void 0:s.cost);return{...Vo(),knownCost:r,completeness:"unverified",breakdown:{generation:0,judging:r,external:0}}}function af(s,r){if(r)for(const[o,i]of Object.entries(r))typeof i=="number"&&Number.isFinite(i)&&(s[o]=(s[o]??0)+i)}function U0(s){var d,f,h,m,p,x,v,y;const r=Vo();let o=!1,i=!1;for(const k of s)if(k){if(k.completeness==="unverified"?o=!0:k.completeness==="incomplete"&&(i=!0),r.knownCost+=Ms(k.knownCost),af(r.reasons,k.reasons),af(r.operations.byKind,(d=k.operations)==null?void 0:d.byKind),af(r.provenance,k.provenance),k.usage)for(const w of Object.keys(r.usage)){const C=k.usage[w];typeof C=="number"&&Number.isFinite(C)&&(r.usage[w]+=C)}r.operations.total+=((f=k.operations)==null?void 0:f.total)??0,r.operations.settled+=((h=k.operations)==null?void 0:h.settled)??0,r.operations.unknown+=((m=k.operations)==null?void 0:m.unknown)??0,r.operations.denied+=((p=k.operations)==null?void 0:p.denied)??0,r.breakdown.generation+=Ms((x=k.breakdown)==null?void 0:x.generation),r.breakdown.judging+=Ms((v=k.breakdown)==null?void 0:v.judging),r.breakdown.external+=Ms((y=k.breakdown)==null?void 0:y.external)}return r.completeness=o?"unverified":i?"incomplete":"complete",r}function Mw(s){return Object.entries(s.reasons??{}).filter(([,r])=>typeof r=="number"&&r>0).map(([r,o])=>`${o} ${r}`).join(", ")}function wc(s){return s.completeness==="complete"?"complete":s.completeness==="unverified"?"unverified (legacy)":`incomplete: ${Mw(s)||"unknown spend"}`}function kc(s){return s.completeness==="incomplete"?"≥ ":""}function jv(s){return s.completeness==="complete"?null:s.completeness==="unverified"?"unverified":"incomplete"}function Nv(s,r="Known spend"){const o=`${r} ${vt(s.knownCost)}, ${wc(s)}`;return s.completeness==="incomplete"?`${o}. This is a lower bound — Axl could not price every operation.`:s.completeness==="unverified"?`${o}. This run predates measured accounting, so the figure is repeated as reported and cannot be certified.`:o}function Sv(s){const r=s.budget;if(!r)return null;const o=vt(r.limit),i=vt(r.knownSpend);if(r.status==="open")return`${i} of ${o} (open)`;const d=r.closedBy?`, first observed by ${r.closedBy}`:"";return`STOPPED — ${i} known spend against a ${o} limit, ${vt(r.knownOvershoot)} over${d}`}function Aw(s){return s?L0(s.items)+Object.values(s.scorers??{}).reduce((r,o)=>r+L0(o),0):0}function L0(s){return $0(s==null?void 0:s.budget_skipped)+$0(s==null?void 0:s.budget_interrupted)}function $0(s){return typeof s=="number"&&Number.isFinite(s)&&s>0?s:0}function _w(s){var r;return((r=s.budget)==null?void 0:r.status)!=="closed"?!1:Aw(s.coverage)>0}function Xo(s){return _w({budget:Ol(s).budget,coverage:s.summary.coverage})}const H0={completed:"completed",failed:"failed",cancelled:"cancelled",budget_skipped:"budget skipped",budget_interrupted:"budget interrupted"},Ow={completed:"Ran to completion (its scorers may still have been stopped)",failed:"The workflow threw",cancelled:"Cancelled by the caller before or during execution",budget_skipped:"Never started — the run budget had already closed. No operations, no spend",budget_interrupted:"Started and charged, then a further operation was denied by the budget"},Ef={scored:"scored",failed:"failed",skipped:"not applicable",cancelled:"cancelled",budget_skipped:"not run (budget)",budget_interrupted:"budget interrupted"},Rw={scored:"Produced a valid numeric score",failed:"Ran and threw, or returned an out-of-range score",skipped:"Not applicable — the scorer's `applies` predicate returned false for this item",cancelled:"Cancelled by the caller before or during the call",budget_skipped:"Never started — the run budget had closed. NOT a zero score; excluded from the mean",budget_interrupted:"Started, then hit an operation the budget denied"},Dw=["budget_skipped","budget_interrupted","cancelled"];function bs(s){return(s==null?void 0:s.outcome)??null}function ol(s){return(s==null?void 0:s.outcome)??null}function wv(s){const r=ol(s);return r!=null&&Dw.includes(r)}function sn({accounting:s,label:r="Known spend",className:o,compact:i}){const d=jv(s);return n.jsxs("span",{className:Q("inline-flex items-center gap-1 whitespace-nowrap",o),title:Nv(s,r),"aria-label":`${r} ${vt(s.knownCost)}, ${wc(s)}`,children:[n.jsxs("span",{className:"font-mono tabular-nums",children:[kc(s),vt(s.knownCost)]}),d&&!i&&n.jsx(zw,{accounting:s})]})}function zw({accounting:s,className:r}){const o=jv(s);if(!o)return null;const i=s.completeness==="unverified";return n.jsx("span",{title:Nv(s),className:Q("inline-flex items-center px-1 py-0.5 rounded text-[9px] font-medium uppercase tracking-wide",i?"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]":"bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",r),children:o})}function Uw({series:s,xMin:r,xMax:o,yMin:i,yMax:d,yDomain:f,yClamp:h,height:m=160,padding:p={top:8,right:8,bottom:20,left:32},formatX:x=C=>String(C),formatY:v=C=>C.toFixed(2),onPointClick:y,ariaLabel:k,className:w}){const[C,A]=b.useState(null),[_,D]=b.useState({width:480,height:m}),$=(f==null?void 0:f.strategy)??"data",T=(f==null?void 0:f.minSpan)??.1,j=(f==null?void 0:f.padPct)??.1;let S,E;if($==="fixed"||i!=null&&d!=null)S=i??0,E=d??1;else{const Z=[];for(const M of s)for(const R of M.points)Number.isFinite(R.y)&&Z.push(R.y);if(Z.length===0)S=i??0,E=d??1;else{let M=Math.min(...Z),R=Math.max(...Z);if(R-M<T){const G=(M+R)/2;M=G-T/2,R=G+T/2}const je=Math.max(T,R-M)*j;let xe=M-je,O=R+je;(h==null?void 0:h.min)!=null&&(xe=Math.max(xe,h.min)),(h==null?void 0:h.max)!=null&&(O=Math.min(O,h.max)),S=i??xe,E=d??O}}const B=Math.max(1,_.width-p.left-p.right),te=Math.max(1,_.height-p.top-p.bottom),q=Math.max(1,o-r),K=Math.max(.001,E-S),F=Z=>p.left+(Z-r)/q*B,re=Z=>p.top+te-(Z-S)/K*te,we=Z=>{const M=Z.currentTarget.getBoundingClientRect(),R=Z.clientX-M.left,ne=r+(R-p.left)/B*q;let je=null,xe=1/0;for(const P of s)for(const le of P.points){const he=Math.abs(le.x-ne);he<xe&&(xe=he,je={series:P,point:le})}if(!je)return;const O=je.point.x,G=[];for(const P of s){const le=P.points.find(he=>he.x===O);le&&G.push({series:P,point:le})}A({x:O,points:G})},me=[S,S+(E-S)*.25,S+(E-S)*.5,S+(E-S)*.75,E];return n.jsxs("div",{className:Q("relative w-full",w),ref:Z=>{Z&&Z.clientWidth>0&&Z.clientWidth!==_.width&&D({width:Z.clientWidth,height:m})},children:[n.jsxs("svg",{width:"100%",height:_.height,viewBox:`0 0 ${_.width} ${_.height}`,preserveAspectRatio:"none",role:"img","aria-label":k??`Line chart with ${s.length} series and ${s.reduce((Z,M)=>Z+M.points.length,0)} data points.`,onMouseMove:we,onMouseLeave:()=>A(null),onClick:y&&C&&C.points.length>0?()=>{const Z=C.points[0];y(Z.series,Z.point)}:void 0,className:Q("block",y&&C&&C.points.length>0&&"cursor-pointer"),children:[me.map(Z=>n.jsxs("g",{children:[n.jsx("line",{x1:p.left,x2:_.width-p.right,y1:re(Z),y2:re(Z),stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"2 3"}),n.jsx("text",{x:p.left-4,y:re(Z)+3,textAnchor:"end",fontSize:9,fill:"currentColor",fillOpacity:.5,children:v(Z)})]},Z)),(()=>{const Z=C?new Set(C.points.map(M=>M.series.name)):null;return s.map(M=>{const R=[...M.points].filter(xe=>Number.isFinite(xe.x)&&Number.isFinite(xe.y)).sort((xe,O)=>xe.x-O.x);if(R.length===0)return null;const ne=R.map((xe,O)=>`${O===0?"M":"L"} ${F(xe.x).toFixed(2)} ${re(xe.y).toFixed(2)}`).join(" "),je=!Z||Z.has(M.name);return n.jsxs("g",{style:{opacity:je?1:.2,transition:"opacity 120ms ease-out"},children:[n.jsx("path",{d:ne,stroke:M.color,strokeWidth:je&&Z?2:1.5,fill:"none"}),R.map((xe,O)=>xe.partial?n.jsx("circle",{cx:F(xe.x),cy:re(xe.y),r:3,fill:"hsl(var(--background))",stroke:M.color,strokeWidth:1.5,children:n.jsxs("title",{children:["Partial batch",xe.label?` — ${xe.label}`:""," (fewer runs completed than planned)"]})},O):n.jsx("circle",{cx:F(xe.x),cy:re(xe.y),r:2.5,fill:M.color},O))]},M.name)})})(),C&&n.jsxs("g",{children:[n.jsx("line",{x1:F(C.x),x2:F(C.x),y1:p.top,y2:_.height-p.bottom,stroke:"currentColor",strokeOpacity:.15}),C.points.map(({series:Z,point:M})=>n.jsx("circle",{cx:F(M.x),cy:re(M.y),r:4,fill:Z.color,stroke:"hsl(var(--background))",strokeWidth:1.5},Z.name))]}),n.jsx("text",{x:p.left,y:_.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"start",children:x(r)}),n.jsx("text",{x:_.width-p.right,y:_.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"end",children:x(o)})]}),C&&(()=>{var xe;const Z=F(C.x),M=8,R=240,je=Z>_.width/2?{right:`${Math.max(M,_.width-Z+M)}px`,top:`${p.top+2}px`,maxWidth:`${R}px`}:{left:`${Math.min(Z+M,_.width-M)}px`,top:`${p.top+2}px`,maxWidth:`${R}px`};return n.jsxs("div",{className:"pointer-events-none absolute z-10 rounded border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-2 py-1 text-[10px] shadow-sm",style:je,children:[n.jsx("div",{className:"mb-0.5 text-[hsl(var(--muted-foreground))]",children:x(C.x)}),C.points.map(({series:O,point:G})=>n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{backgroundColor:O.color}}),n.jsx("span",{className:"font-mono truncate",children:O.name}),n.jsx("span",{className:"ml-auto font-mono shrink-0",children:v(G.y)})]},O.name)),((xe=C.points[0])==null?void 0:xe.point.label)&&n.jsx("div",{className:"mt-0.5 truncate text-[hsl(var(--muted-foreground))]",children:C.points[0].point.label})]})})()]})}function q0(s){return s>=.8?"text-green-600 dark:text-green-400":s>=.5?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function sf(s){return s.toFixed(3)}function Lw(s){return s==="complete"?"complete":s==="incomplete"?"incomplete (lower bound)":"unverified (legacy)"}const B0=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316"];function rr(s,r){return B0[r%B0.length]??"#64748b"}function $w(s){const r=new Date(s),i=Date.now()-s,d=1440*60*1e3;return i<d?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):i<7*d?r.toLocaleDateString([],{weekday:"short"}):r.toLocaleDateString()}function Hw({onViewRun:s}={}){const{window:r,handleWindowChange:o,data:i}=Dc("eval-trends",RS),[d,f]=b.useState("scorer");if(!i||i.totalRuns===0)return n.jsxs("div",{className:"flex-1 overflow-auto p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),n.jsx(_s,{value:r,onChange:o})]}),n.jsx(rn,{icon:n.jsx(w2,{size:32}),title:"No eval trends yet",description:"Run evaluations to see score trends over time."})]});const h=Object.keys(i.byEval).sort(),m={knownCost:i.totalCost,completeness:i.totalCostCompleteness??"unverified"};return n.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),n.jsx(_s,{value:r,onChange:o})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsx(tt,{label:"Total Runs",value:String(i.totalRuns),subtitle:r}),n.jsx(tt,{label:"Evals Tracked",value:String(h.length),subtitle:h.length===1?"eval":"evals"}),n.jsx(tt,{label:"Known Spend",value:kc(m)+vt(i.totalCost),subtitle:`all evals · ${Lw(i.totalCostCompleteness)}`,subtitleColor:(i.totalCostCompleteness??"unverified")==="complete"?void 0:"text-amber-600 dark:text-amber-400"})]}),n.jsxs("div",{className:"flex items-center gap-1 text-xs",role:"group","aria-label":"Trend chart view mode",children:[n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] mr-1",children:"View:"}),["scorer","model","duration"].map(p=>n.jsx("button",{onClick:()=>f(p),"aria-pressed":d===p,className:Q("px-2.5 py-1 rounded-md transition-colors",d===p?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:p==="scorer"?"By Scorer":p==="model"?"By Model":"Duration"},p))]}),h.map(p=>{const x=i.byEval[p],v=Object.keys(x.scoreMean).sort(),y=[...x.runs].sort((q,K)=>q.timestamp-K.timestamp),k=(()=>{const q=new Map;for(const F of y)F.runGroupId&&q.set(F.runGroupId,(q.get(F.runGroupId)??0)+1);const K=new Set;for(const F of y)F.runGroupId&&typeof F.batchAttempted=="number"&&(q.get(F.runGroupId)??0)<F.batchAttempted&&K.add(F.id);return K})();let w=[],C=[],A="",_,D=q=>q.toFixed(2);if(d==="scorer")A="Score Trend by Scorer",_={min:0,max:1},w=v.map((q,K)=>({name:q,color:rr(q,K),points:y.filter(F=>F.scores[q]!=null).map(F=>({x:F.timestamp,y:F.scores[q],label:F.model?`${F.id.slice(0,8)}… · ${F.model}`:F.id,meta:F,...k.has(F.id)?{partial:!0}:{}}))})),C=v.map((q,K)=>({name:q,color:rr(q,K)}));else if(d==="model"){A="Score Trend by Model (mean of all scorers)",_={min:0,max:1};const q=new Map;for(const F of y){const re=F.model??"unknown",we=q.get(re)??[];we.push(F),q.set(re,we)}const K=[...q.keys()].sort();w=K.map((F,re)=>{const we=q.get(F)??[];return{name:F,color:rr(F,re),points:we.map(me=>{const Z=Object.values(me.scores).filter(R=>Number.isFinite(R));if(Z.length===0)return null;const M=Z.reduce((R,ne)=>R+ne,0)/Z.length;return{x:me.timestamp,y:M,label:`${me.id.slice(0,8)}… · ${F}`,meta:me,...k.has(me.id)?{partial:!0}:{}}}).filter(me=>me!==null)}}),C=K.map((F,re)=>({name:F,color:rr(F,re)}))}else{A="Duration Trend by Model",D=F=>ht(F);const q=new Map;for(const F of y){if(F.duration==null)continue;const re=F.model??"unknown",we=q.get(re)??[];we.push(F),q.set(re,we)}const K=[...q.keys()].sort();w=K.map((F,re)=>{const we=q.get(F)??[];return{name:F,color:rr(F,re),points:we.map(me=>({x:me.timestamp,y:me.duration,label:`${me.id.slice(0,8)}… · ${F}`,meta:me,...k.has(me.id)?{partial:!0}:{}}))}}),C=K.map((F,re)=>({name:F,color:rr(F,re)}))}const $=y.length>0?y[0].timestamp:0,T=y.length>0?y[y.length-1].timestamp:1,j=y.map(q=>({cost:q.cost,completeness:q.completeness})),S=j.filter(q=>(q.completeness??"unverified")!=="complete").length,E={...Vo(),knownCost:x.costTotal,completeness:x.costCompleteness??"unverified"},B=w.some(q=>q.points.length>=2),te=d==="duration"&&y.every(q=>q.duration==null)?"No duration metadata recorded on these runs.":(d==="model"||d==="duration")&&y.every(q=>q.model==null)?'No model metadata recorded on these runs — each run will show as "unknown".':null;return n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-3 bg-[hsl(var(--card))] border-b border-[hsl(var(--border))] flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-mono text-sm font-medium",children:p}),n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))] ml-2",children:[x.runCount," run",x.runCount!==1?"s":""]})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[j.length>1&&n.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-[hsl(var(--muted-foreground))]",children:[n.jsx("span",{children:"cost"}),n.jsx(Cw,{points:j,width:80,height:22}),S>0&&n.jsxs("span",{className:"text-[9px] font-medium uppercase tracking-wide text-amber-600 dark:text-amber-400",children:[S," of ",j.length," not measured"]})]}),n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(sn,{accounting:E,label:`Known spend across ${x.runCount} run${x.runCount===1?"":"s"}`}),(x.budgetStoppedRuns??0)>0&&n.jsx("span",{className:"text-[9px] font-medium uppercase tracking-wide text-amber-600 dark:text-amber-400",title:`${x.budgetStoppedRuns} run(s) in this window stopped on budget`,children:"budget stopped"})]})]})]}),y.length>1&&n.jsxs("div",{className:"px-4 py-3 border-b border-[hsl(var(--border))]",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:A}),n.jsxs("div",{className:"flex flex-wrap gap-2 text-[10px]",children:[C.map(q=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:q.color}}),n.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:q.name})]},q.name)),k.size>0&&n.jsxs("div",{className:"flex items-center gap-1",title:"Hollow ring marks a partial-batch run (fewer runs completed than were planned). The line still passes through it; the marker style is the only difference.",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full border",style:{borderColor:"hsl(var(--muted-foreground))",backgroundColor:"hsl(var(--background))"}}),n.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:"partial"})]})]})]}),te?n.jsx("p",{className:"py-4 text-xs text-[hsl(var(--muted-foreground))] italic",children:te}):B?n.jsx(Uw,{series:w,xMin:$,xMax:T,yClamp:_,yDomain:{strategy:"data",minSpan:d==="duration"?100:.1,padPct:.1},height:180,formatX:$w,formatY:D,ariaLabel:`${p}: ${A}, ${w.length} series across ${y.length} runs. Click a point to view that run.`,onPointClick:s?(q,K)=>{const F=K.meta;F!=null&&F.id&&s(F.id)}:void 0}):n.jsx("p",{className:"py-4 text-xs text-[hsl(var(--muted-foreground))] italic",children:d==="scorer"?"Need at least 2 runs to draw a trend.":d==="model"?"Not enough runs per model yet — need at least 2 runs from the same model to draw a trend.":"Not enough runs per model with duration to draw a trend."})]}),y.length===1&&v.length>0&&n.jsx("p",{className:"px-4 py-2 text-[11px] text-[hsl(var(--muted-foreground))] border-b border-[hsl(var(--border))]",children:"Only one run in window — run again to see trend line."}),v.length>0&&n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("th",{className:"py-2 px-4 text-left font-medium",children:"Scorer"}),n.jsx("th",{className:"py-2 px-4 text-right font-medium",children:"Latest"}),n.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:x.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Mean",x.runCount>50?"*":""]}),n.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:x.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Std",x.runCount>50?"*":""]})]})}),n.jsx("tbody",{children:v.map((q,K)=>n.jsxs("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:[n.jsx("td",{className:"py-2 px-4 font-mono",children:n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:d==="scorer"?rr(q,K):"hsl(var(--muted-foreground) / 0.4)"}}),q]})}),n.jsx("td",{className:Q("py-2 px-4 text-right font-mono",q0(x.latestScores[q]??0)),children:x.latestScores[q]!=null?sf(x.latestScores[q]):"—"}),n.jsx("td",{className:Q("py-2 px-4 text-right font-mono",q0(x.scoreMean[q]??0)),children:sf(x.scoreMean[q]??0)}),n.jsx("td",{className:"py-2 px-4 text-right font-mono text-[hsl(var(--muted-foreground))]",children:sf(x.scoreStd[q]??0)})]},q))})]}),x.runCount>50&&n.jsx("p",{className:"px-4 pt-2 text-[10px] text-[hsl(var(--muted-foreground))]",children:"* Mean and Std computed over the 50 most recent runs"})]},p)})]})}function G0(s){var D,$,T,j;if(s.length===0)return null;const r=s[0],o=Object.keys(((D=r.summary)==null?void 0:D.scorers)??{}),i={};for(const S of o){const E=s.filter(me=>{var M,R,ne;const Z=(ne=(R=(M=me.summary)==null?void 0:M.scorers)==null?void 0:R[S])==null?void 0:ne.scored;return Z==null||Z>0}),te=(E.length>0?E:s).map(me=>{var Z,M,R;return((R=(M=(Z=me.summary)==null?void 0:Z.scorers)==null?void 0:M[S])==null?void 0:R.mean)??0}),q=te.reduce((me,Z)=>me+Z,0)/te.length,K=te.length>1?Math.sqrt(te.reduce((me,Z)=>me+(Z-q)**2,0)/(te.length-1)):0,F=s.reduce((me,Z)=>{var M,R,ne;return me+(((ne=(R=(M=Z.summary)==null?void 0:M.scorers)==null?void 0:R[S])==null?void 0:ne.scored)??0)},0),re=s.reduce((me,Z)=>{var M,R,ne;return me+(((ne=(R=(M=Z.summary)==null?void 0:M.scorers)==null?void 0:R[S])==null?void 0:ne.failed)??0)},0),we=s.reduce((me,Z)=>{var M,R,ne;return me+(((ne=(R=(M=Z.summary)==null?void 0:M.scorers)==null?void 0:R[S])==null?void 0:ne.skipped)??0)},0);i[S]={mean:Math.round(q*1e3)/1e3,std:Math.round(K*1e3)/1e3,min:Math.round(Math.min(...te)*1e3)/1e3,max:Math.round(Math.max(...te)*1e3)/1e3,scored:F,failed:re,skipped:we}}const d=new Set,f=[];for(const S of s){const E=($=S.metadata)==null?void 0:$.workflows;if(Array.isArray(E))for(const B of E)typeof B=="string"&&!d.has(B)&&(d.add(B),f.push(B))}const h=zo(s),m=s.filter(Xo).length,p={runGroupId:((T=r.metadata)==null?void 0:T.runGroupId)??"",runCount:s.length,workflows:f.length>0?f:void 0,scorers:i,accounting:h,...m>0?{budgetStoppedRuns:m}:{}};let x;for(const S of s){const E=(j=S.metadata)==null?void 0:j.batchAttempted;if(typeof E=="number"&&Number.isFinite(E)){x=E;break}}const v=x!==void 0&&s.length<x,y=v?s.map(S=>{var E;return(E=S.metadata)==null?void 0:E.batchFailure}).find(S=>typeof S=="string"&&S.length>0):void 0,k=Qw(s),w=Bw(s),C=Gw(s),{modelTiming:A,..._}=r.summary??{};return{...r,accounting:h,totalCost:h.knownCost,...h.completeness!=="complete"?{unpriced:!0}:{},summary:{..._,...w?{coverage:w}:{},...k.length>0?{degraded:k}:{},...C?{itemErrorRate:C}:{}},_multiRun:{aggregate:p,allRuns:s,...v&&{partial:!0,batchCompleted:s.length,batchAttempted:x,...y?{batchFailure:y}:{}}}}}const Q0=["completed","failed","cancelled","budget_skipped","budget_interrupted"],kv=["scored","failed","skipped","cancelled","budget_skipped","budget_interrupted"];function qw(){return Object.fromEntries(kv.map(s=>[s,0]))}function Bw(s){var d;const r=s.filter(f=>{var h;return(h=f.summary)==null?void 0:h.coverage});if(r.length===0)return;const o=Object.fromEntries(Q0.map(f=>[f,0])),i={};for(const f of r){const h=f.summary.coverage;for(const m of Q0)o[m]+=((d=h.items)==null?void 0:d[m])??0;for(const[m,p]of Object.entries(h.scorers??{})){const x=i[m]??(i[m]=qw());for(const v of kv)x[v]+=(p==null?void 0:p[v])??0}}return{items:o,scorers:i}}function Gw(s){var f;let r,o=0;for(const h of s){const m=(f=h.summary)==null?void 0:f.itemErrorRate;m&&(m.exceeded&&o++,(!r||m.rate>r.rate)&&(r=m))}if(!r)return;const{runsExceeded:i,...d}=r;return{...d,runsExceeded:o}}function Qw(s){const r=new Map;for(const o of s)for(const i of Ev(o)){const d=r.get(i.scorer);if(!d)r.set(i.scorer,{...i,runsAffected:1});else{const f=i.rate>d.rate?i:d;r.set(i.scorer,{...f,runsAffected:d.runsAffected+1})}}return[...r.values()]}function Cc(s){return s>=.8?"bg-emerald-100 dark:bg-emerald-900/50 text-emerald-700 dark:text-emerald-300":s>=.5?"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300":"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300"}function zc(s){return s>=.8?"bg-emerald-500 dark:bg-emerald-400":s>=.5?"bg-amber-500 dark:bg-amber-400":"bg-red-500 dark:bg-red-400"}function Dt(s){return s>=.8?"text-emerald-600 dark:text-emerald-400":s>=.5?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function Y0(s){return s>=.8?"bg-emerald-50/60 dark:bg-emerald-950/20":s>=.5?"bg-amber-50/60 dark:bg-amber-950/20":"bg-red-50/60 dark:bg-red-950/20"}function Yw(s){var r;return Array.isArray((r=s.metadata)==null?void 0:r.models)?s.metadata.models.filter(o=>typeof o=="string"):[]}function Cv(s,r){var f;const o=[];let i=0,d=0;for(const h of s){if(h.error)continue;const m=h.scores[r],p=(f=h.scoreDetails)==null?void 0:f[r];if((p==null?void 0:p.outcome)!==void 0){p.outcome==="scored"&&m!=null?o.push(m):p.outcome==="failed"?i++:p.outcome==="skipped"&&d++;continue}m!=null?o.push(m):(p==null?void 0:p.skipped)===!0?d++:(p==null?void 0:p.duration)!=null&&i++}return{scores:o,failed:i,skipped:d}}function Kw(s,r,o){const i=o?Cv(o,r):void 0,d=s.skipped??(i==null?void 0:i.skipped)??0;return s.scored!=null&&s.failed!=null?{scored:s.scored,failed:s.failed,skipped:d}:i?{scored:i.scores.length,failed:i.failed,skipped:d}:{scored:s.scored??0,failed:s.failed??0,skipped:d}}function Qa(s){var r;return Array.isArray((r=s.metadata)==null?void 0:r.models)?s.metadata.models.filter(o=>typeof o=="string"):[]}function Vw(s){var o;const r=(o=s.metadata)==null?void 0:o.droppedAnnotationKeys;return Array.isArray(r)?r.filter(i=>typeof i=="string"):[]}function Xw(s){var o,i;if(((o=s.metadata)==null?void 0:o.scorerFiltered)!==!0)return[];const r=(i=s.metadata)==null?void 0:i.scorersRun;return Array.isArray(r)?r.filter(d=>typeof d=="string"):[]}function Ev(s){var o;const r=(o=s.summary)==null?void 0:o.degraded;return Array.isArray(r)?r.filter(i=>i!=null&&typeof i=="object"&&typeof i.scorer=="string"&&typeof i.rate=="number"&&typeof i.limit=="number"&&(i.type==="llm"||i.type==="deterministic")&&typeof i.scored=="number"&&typeof i.failed=="number"):[]}function Os(s){var i;const r=(i=s.metadata)==null?void 0:i.modelCounts;if(!r||typeof r!="object")return null;const o={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(o[d]=f);return Object.keys(o).length>0?o:null}function dl(s){var d,f;const r=(d=s._multiRun)==null?void 0:d.aggregate.workflows;if(Array.isArray(r)&&r.length>0){const h=r.filter(m=>typeof m=="string");if(h.length>0)return h}const o=(f=s.metadata)==null?void 0:f.workflows;if(Array.isArray(o)){const h=o.filter(m=>typeof m=="string");if(h.length>0)return h}const i=s.workflow;return typeof i=="string"&&i?[i]:[]}function Tf(s){var i;const r=(i=s.metadata)==null?void 0:i.workflowCounts;if(!r||typeof r!="object")return null;const o={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(o[d]=f);return Object.keys(o).length>0?o:null}function _n(s){const r=s.indexOf(":");return r>=0?s.slice(r+1):s}function Tv(s){var i;const r=(i=s.metadata)==null?void 0:i.tokens;if(!r||typeof r!="object")return null;const o=r;return typeof o.input!="number"?null:{input:o.input,output:typeof o.output=="number"?o.output:0,reasoning:typeof o.reasoning=="number"?o.reasoning:0}}function Fw(s){var o;const r=(o=s.metadata)==null?void 0:o.agentCalls;return typeof r=="number"?r:0}function Mf(s){const r={input:0,output:0,reasoning:0};for(const o of s.items){const i=Tv(o);i&&(r.input+=i.input,r.output+=i.output,r.reasoning+=i.reasoning)}return r}function rm(s){const r=new Map;for(const o of s){const i=o.data,d=Os(i);if(d)for(const[f,h]of Object.entries(d))r.set(f,(r.get(f)??0)+h);else for(const f of Qa(i))r.set(f,(r.get(f)??0)+1)}return[...r.entries()].sort((o,i)=>i[1]-o[1])}function K0(s){const r={input:0,output:0,reasoning:0};for(const o of s){const i=Mf(o);r.input+=i.input,r.output+=i.output,r.reasoning+=i.reasoning}return r}function zo(s){const r=s.map(Ol),o=r.length>0&&r.every(i=>i.scope==="rescore")?"rescore":"run";return r.length===0?{...U0([]),completeness:"unverified",scope:o}:{...U0(r),scope:o}}function lm({failed:s,skipped:r,scored:o}){const i=s??0;return n.jsxs(n.Fragment,{children:[i>0&&n.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300 align-middle",title:`${s} scorer run(s) failed — the mean is computed over the runs/items that succeeded.`,children:o!=null?`${o}/${o+i} scored, ${i} failed`:`${i} failed`}),(r??0)>0&&n.jsxs("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))] align-middle",title:`${r} item(s) not applicable to this scorer (applies predicate returned false) — excluded from the mean and the failure rate`,children:["N/A: ",r]})]})}function Iw(s,r){if(r===0)return"text-[hsl(var(--muted-foreground))]";const o=s/r;return o<.02?"text-[hsl(var(--muted-foreground))]":o<=.05?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function Zw({name:s,stats:r,isLlm:o}){const i=(r.scored??0)>0;return n.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[n.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[s,o&&n.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"}),n.jsx(lm,{failed:r.failed,skipped:r.skipped})]}),i?n.jsxs(n.Fragment,{children:[n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono font-medium",Dt(r.mean)),children:r.mean.toFixed(3)}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",Iw(r.std,r.mean)),children:r.std.toFixed(3)}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",Dt(r.min)),children:r.min.toFixed(3)}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",Dt(r.max)),children:r.max.toFixed(3)})]}):n.jsx("td",{colSpan:4,className:"px-3 py-2.5 text-center text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]})}const Jw={completed:"bg-emerald-100 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300",failed:"bg-red-100 text-red-700 dark:bg-red-950/50 dark:text-red-300",cancelled:"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",budget_skipped:"bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",budget_interrupted:"bg-orange-100 text-orange-900 dark:bg-orange-950/60 dark:text-orange-200"},Ww={scored:"bg-emerald-100 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300",failed:"bg-red-100 text-red-700 dark:bg-red-950/50 dark:text-red-300",skipped:"bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",cancelled:"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",budget_skipped:"bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",budget_interrupted:"bg-orange-100 text-orange-900 dark:bg-orange-950/60 dark:text-orange-200"};function Uc({outcome:s,className:r}){return s?n.jsx("span",{title:Ow[s],"aria-label":`Item outcome: ${H0[s]}`,className:Q("inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium whitespace-nowrap",Jw[s],r),children:H0[s]}):null}function Ec({outcome:s,className:r}){return s?n.jsx("span",{title:Rw[s],"aria-label":`Scorer outcome: ${Ef[s]}`,className:Q("inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium whitespace-nowrap",Ww[s],r),children:Ef[s]}):null}const Pw=["completed","failed","cancelled","budget_skipped","budget_interrupted"];function Mv({result:s,className:r}){if(!Xo(s))return null;const o=Sv(Ol(s));return n.jsx("span",{title:`Budget: ${o}. The run is incomplete by design; this is NOT a model or scorer failure.`,"aria-label":"Budget stopped",className:Q("inline-flex items-center px-1.5 py-0.5 rounded-md text-[9px] font-medium uppercase tracking-wide bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",r),children:"budget stopped"})}function il({label:s,children:r}){return n.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))] shrink-0",children:s}),n.jsx("span",{className:"text-xs text-[hsl(var(--foreground))]",children:r})]})}function ek({coverage:s}){const r=Object.keys(s.scorers??{});return n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(il,{label:"Items",children:n.jsx("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:Pw.map(o=>{var i;return n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Uc,{outcome:o}),n.jsx("span",{className:"font-mono tabular-nums text-[hsl(var(--muted-foreground))]",children:((i=s.items)==null?void 0:i[o])??0})]},o)})})}),r.map(o=>{const i=s.scorers[o]??{},d=Object.keys(Ef).filter(f=>(i[f]??0)>0);return d.length===0?null:n.jsx(il,{label:o,children:n.jsx("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:d.map(f=>n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ec,{outcome:f}),n.jsx("span",{className:"font-mono tabular-nums text-[hsl(var(--muted-foreground))]",children:i[f]})]},f))})},o)})]})}function tk({result:s}){var h,m;const r=Ol(s),o=(h=s.summary)==null?void 0:h.coverage,i=Sv(r),d=r.callerReported,f=((m=s.summary)==null?void 0:m.failures)??0;return n.jsxs("div",{className:"px-4 py-3 border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50 space-y-2",children:[n.jsxs(il,{label:"Known spend",children:[n.jsx(sn,{accounting:r}),r.breakdown&&(r.breakdown.generation>0||r.breakdown.judging>0)&&n.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))] font-mono text-[11px]",children:[n.jsx(sn,{accounting:{...r,knownCost:r.breakdown.generation},label:"Generation spend",compact:!0})," generation · ",n.jsx(sn,{accounting:{...r,knownCost:r.breakdown.judging},label:"Judging spend",compact:!0})," judging"]})]}),i&&n.jsx(il,{label:"Budget",children:n.jsx("span",{className:Q("font-mono text-[11px]",Xo(s)?"text-amber-700 dark:text-amber-300":"text-[hsl(var(--muted-foreground))]"),children:i})}),o&&n.jsx(ek,{coverage:o}),n.jsxs(il,{label:"With errors",children:[n.jsx("span",{className:"font-mono tabular-nums text-[hsl(var(--muted-foreground))]",title:"Legacy count of items carrying an error string. It still includes cancelled and budget-stopped items, which also carry one — read the item outcomes above to tell a model failure from a budget stop.",children:f}),n.jsx("span",{className:"ml-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:"items carrying an error string (includes cancelled / budget-stopped)"})]}),d&&d.costItems>0&&n.jsx(il,{label:"Caller-reported",children:n.jsxs("span",{className:"font-mono text-[11px] text-[hsl(var(--muted-foreground))]",title:"Values the executeWorkflow callback claimed. Kept for inspection and never summed into known spend, which measures Axl-observed operations.",children:["$",d.costTotal.toFixed(2)," across ",d.costItems," item",d.costItems===1?"":"s"," — caller-reported (not counted)"]})})]})}const Av=200;function om(s){const r=s==null?void 0:s.diagnostics;if(!(!r||typeof r!="object")&&!(typeof r.artifactId!="string"||typeof r.status!="string"))return r}function Tc(s){return s?s.status!=="unavailable"&&s.artifactId!=="":!1}function nk(s){const r=om(s);return Tc(r)&&((r==null?void 0:r.records)??0)>0}function ak(s){return Tc(s)?{records:Number.isFinite(s.records)?s.records:void 0,bytes:Number.isFinite(s.bytes)?s.bytes:void 0}:{records:void 0,bytes:void 0}}function sk(s,r){const o=f=>f.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),i=o(s??"")||"eval",d=o(r)||"result";return`${i}-${d}.requests.jsonl`}function rk(s){return s===void 0||!Number.isFinite(s)||s<0?"unknown":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}const lk={complete:"every dispatched operation was captured",truncated:"capture stopped at a size limit — some operations are missing",interrupted:"the run ended before capture was finalized — some operations are missing",unavailable:"the captured bytes are not stored"};async function*ok(s){const r=s.body;if(!r||typeof r.getReader!="function"){const d=await s.text();d&&(yield d);return}const o=r.getReader(),i=new TextDecoder;try{for(;;){const{done:f,value:h}=await o.read();if(f)break;h&&(yield i.decode(h,{stream:!0}))}const d=i.decode();d&&(yield d)}finally{await o.cancel().catch(()=>{})}}function ik(s){const r=new Map,o=[];let i=0;for(const d of s){const f=typeof(d==null?void 0:d.operationId)=="string"?d.operationId:"",h=f===""?`\0anonymous-${i+=1}`:f;let m=r.get(h);m||(m={operationId:f,records:[],retries:0},r.set(h,m),o.push(m)),m.records.push(d),(d==null?void 0:d.phase)==="start"?m.start??(m.start=d):(d==null?void 0:d.phase)==="end"?m.end??(m.end=d):(d==null?void 0:d.phase)==="attempt"&&(m.retries+=1)}return o}async function ck(s,r=Av){const o=[],i=new Set;let d=0,f=0,h=!1,m="";const p=x=>{const v=x.trim();if(v==="")return;let y;try{y=JSON.parse(v)}catch{f+=1;return}if(!y||typeof y!="object"){f+=1;return}const k=y,w=typeof k.operationId=="string"?k.operationId:"";if(!(w!==""&&i.has(w))){if(i.size+d>=r){h=!0;return}w===""?d+=1:i.add(w)}o.push(k)};for await(const x of ok(s)){m+=x;let v=m.indexOf(`
|
|
312
|
+
`);for(;v!==-1;)p(m.slice(0,v)),m=m.slice(v+1),v=m.indexOf(`
|
|
313
|
+
`)}return m.trim()!==""&&p(m),{records:o,malformed:f,cappedEarly:h}}const uk={complete:"text-[hsl(var(--muted-foreground))]",truncated:"text-amber-700 dark:text-amber-300",interrupted:"text-amber-700 dark:text-amber-300",unavailable:"text-amber-700 dark:text-amber-300"};function en({label:s,children:r}){return n.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[n.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))] shrink-0",children:s}),n.jsx("span",{className:"text-xs text-[hsl(var(--foreground))]",children:r})]})}function Uo({what:s}){return n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",title:`${s} is not recorded`,children:"unknown"})}function dk(s,r){const o=new Blob([s],{type:"application/x-ndjson"}),i=URL.createObjectURL(o),d=document.createElement("a");d.href=i,d.download=r,document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(i),0)}function fk(s){const r=[];return s.cappedEarly&&r.push(`Showing the first ${Av} operations. Download the .jsonl for the rest.`),s.malformed>0&&r.push(`${s.malformed} line(s) could not be parsed and are not shown.`),r.length>0?r.join(" "):null}function Mc(s){var r;if(((r=s==null?void 0:s.captured)==null?void 0:r.truncated)===!0)return s.captured.reason??"record exceeded the size limit"}function _v(s){return s.some(r=>{var o;return((o=r.captured)==null?void 0:o.redacted)===!0})}function mk(s){var o;const r=new Set;for(const i of s)for(const d of((o=i.captured)==null?void 0:o.omitted)??[])r.add(d);return[...r]}function hk({operation:s,index:r}){var w,C;const[o,i]=b.useState(!1),d=s.start??s.records[0],f=s.end,h=(d==null?void 0:d.caseIndex)!==void 0?`case ${d.caseIndex}${d.scorer?` · ${d.scorer}`:""}`:d!=null&&d.scorer?d.scorer:void 0,m=(f==null?void 0:f.transportAttempts)??(d==null?void 0:d.transportAttempts),p=Number.isFinite(m)?m:void 0,x=(C=(w=f==null?void 0:f.response)==null?void 0:w.timing)==null?void 0:C.totalMs,v=Mc(s.start),y=Mc(f),k=!f||f.response===void 0&&f.error===void 0;return n.jsxs("li",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[n.jsxs("button",{type:"button",onClick:()=>i(A=>!A),"aria-expanded":o,className:"w-full text-left px-3 py-2 hover:bg-[hsl(var(--muted))]/60 focus:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--ring))]",children:[n.jsxs("span",{className:"flex items-baseline gap-2 flex-wrap text-[11px]",children:[n.jsx("span",{className:"font-mono text-[hsl(var(--foreground))]",children:d==null?void 0:d.model}),n.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:d==null?void 0:d.kind}),h&&n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:h}),(d==null?void 0:d.turn)!==void 0&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["turn ",d.turn]}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:p!==void 0?n.jsxs(n.Fragment,{children:["attempt ",p]}):n.jsxs(n.Fragment,{children:["attempt ",n.jsx(Uo,{what:"Transport attempt"})]})}),(f==null?void 0:f.termination)!==void 0&&n.jsxs("span",{className:"text-amber-700 dark:text-amber-300",title:"The operation ended deliberately without a response — not a call that never came back.",children:["terminated: ",f.termination]}),(f==null?void 0:f.error)&&n.jsxs("span",{className:"text-red-700 dark:text-red-300",children:["error: ",f.error.message]}),k&&y===void 0&&n.jsx("span",{className:"text-amber-700 dark:text-amber-300",title:f?"The operation was sealed without a response.":"The artifact holds no end record for this operation.",children:"no response recorded"}),v!==void 0&&n.jsxs("span",{className:"text-amber-700 dark:text-amber-300",children:["request stub — ",v]}),y!==void 0&&n.jsxs("span",{className:"text-amber-700 dark:text-amber-300",children:["response stub — ",y]}),_v(s.records)&&n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",title:"This record's content was scrubbed — when it was written, or on the way out of this deployment.",children:"redacted"}),n.jsx("span",{className:"ml-auto font-mono text-[10px] text-[hsl(var(--muted-foreground))]",children:x!==void 0?ht(x):null})]}),n.jsx("span",{className:"block font-mono text-[10px] text-[hsl(var(--muted-foreground))] mt-0.5",children:s.operationId})]}),o&&n.jsx("div",{className:"px-3 pb-3 space-y-2 text-[11px]",children:n.jsx(pk,{operation:s,index:r})})]})}function Mo({label:s,value:r}){return n.jsxs("div",{children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-1",children:s}),n.jsx("pre",{className:"overflow-x-auto rounded-md bg-[hsl(var(--muted))] p-2 font-mono text-[10px] text-[hsl(var(--foreground))] whitespace-pre-wrap break-words",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})}function pk({operation:s,index:r}){var v;const o=s.start,i=s.end,d=o==null?void 0:o.request,f=i==null?void 0:i.response,h=(v=s.records.find(y=>y.correction))==null?void 0:v.correction,m=mk(s.records),p=Mc(o),x=Mc(i);return n.jsxs("div",{className:"space-y-2","data-testid":`operation-detail-${r}`,children:[h&&n.jsx(Mo,{label:`Correction (${h.stage}${h.reason?`: ${h.reason}`:""})`,value:h.feedbackMessage}),d?n.jsxs(n.Fragment,{children:[n.jsx(Mo,{label:"Request options",value:d.options}),d.providerOptionKeys&&d.providerOptionKeys.length>0&&n.jsx(en,{label:"Provider option keys",children:n.jsx("span",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))]",title:"Keys only — Axl never stores providerOptions values, which can carry credentials.",children:d.providerOptionKeys.join(", ")})}),d.tools&&d.tools.length>0&&n.jsx(en,{label:"Tools",children:n.jsx("span",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))]",children:d.tools.map(y=>y.name).join(", ")})}),n.jsx(Mo,{label:"Messages",value:d.messages})]}):n.jsx(en,{label:"Request",children:p!==void 0?n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["the record was replaced by a stub — ",p]}):o?n.jsx(Uo,{what:"The request"}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"no start record — the artifact does not hold this operation’s request"})}),f?n.jsxs(n.Fragment,{children:[n.jsx(Mo,{label:"Response",value:f.content}),n.jsx(en,{label:"Usage",children:f.usage?n.jsx("span",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))]",children:JSON.stringify(f.usage)}):n.jsx(Uo,{what:"Usage"})})]}):i!=null&&i.error?n.jsx(Mo,{label:"Error",value:i.error}):n.jsx(en,{label:"Response",children:n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:x!==void 0?n.jsxs(n.Fragment,{children:["the record was replaced by a stub — ",x]}):n.jsxs(n.Fragment,{children:["no response recorded",(i==null?void 0:i.termination)!==void 0?` — the operation was terminated: ${i.termination}`:i?" — the operation was sealed without one":" — the artifact holds no end record for this operation"]})})}),s.retries>0&&n.jsx(en,{label:"Transport retries",children:n.jsx("span",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))]",children:s.retries})}),m.length>0&&n.jsx(en,{label:"Omitted",children:n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:m.join(", ")})})]})}function xk({result:s,evalName:r}){const o=om(s),i=s.id,d=s._multiRun!==void 0,f=!d&&Tc(o),[h,m]=b.useState(i),[p,x]=b.useState(!1),[v,y]=b.useState(!1),[k,w]=b.useState(null);h!==i&&(m(i),x(!1),y(!1),w(null));const C=b.useRef(!0);b.useEffect(()=>(C.current=!0,()=>{C.current=!1}),[]);const A=ln({queryKey:["eval-diagnostics",i],queryFn:()=>QS(i),enabled:f,retry:!1}),_=ln({queryKey:["eval-diagnostics-records",i],queryFn:async()=>ck(await T0(i)),enabled:p&&f,retry:!1}),D=b.useCallback(async()=>{y(!0),w(null);try{const le=await(await T0(i)).text();dk(le,sk(r,i))}catch(P){C.current&&w(P instanceof Error?P.message:String(P))}finally{C.current&&y(!1)}},[i,r]),$=b.useCallback(()=>{w(null),x(P=>!P)},[]);if(!o||d)return null;const T=A.data,j=T!=null&&T.ok?T.manifest:void 0,S=(T==null?void 0:T.ok)===!1&&T.gone,E=(T==null?void 0:T.ok)===!1&&!T.gone?T.message:void 0,B=p?_.data:void 0,te=B?ik(B.records):void 0,q=B?fk(B):null,K=p&&_.error instanceof Error?_.error.message:null,F=v||p&&_.isFetching,re=k??K,we=S?"unavailable":(j==null?void 0:j.status)??o.status,me=S?(T==null?void 0:T.ok)===!1?T.message:void 0:(j==null?void 0:j.reason)??o.reason,Z=!S&&Tc({...o,status:we,artifactId:o.artifactId}),M=Z?ak({...o,status:we,records:(j==null?void 0:j.records)??o.records,bytes:(j==null?void 0:j.bytes)??o.bytes}):{records:void 0,bytes:void 0},R=(j==null?void 0:j.expiresAt)??o.expiresAt,ne=(j==null?void 0:j.redaction)??o.redaction,je=(j==null?void 0:j.fidelity)??o.fidelity,xe=j==null?void 0:j.copiedFrom,O=lk[we],G=ne==="none"&&((te==null?void 0:te.some(P=>_v(P.records)))??!1);return n.jsxs("section",{"aria-labelledby":`captured-requests-${i}`,className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsxs("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))] flex items-center justify-between gap-3",children:[n.jsx("h3",{id:`captured-requests-${i}`,className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Captured requests"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>void $(),disabled:!Z||F,className:"text-[11px] px-2 py-1 rounded-md border border-[hsl(var(--border))] text-[hsl(var(--foreground))] hover:bg-[hsl(var(--muted))] disabled:opacity-50 disabled:cursor-not-allowed",children:p?"Hide captured records":"Show captured records"}),n.jsx("button",{type:"button",onClick:()=>void D(),disabled:!Z||F,className:"text-[11px] px-2 py-1 rounded-md border border-[hsl(var(--border))] text-[hsl(var(--foreground))] hover:bg-[hsl(var(--muted))] disabled:opacity-50 disabled:cursor-not-allowed",children:"Download records (.jsonl)"})]})]}),n.jsxs("div",{className:"px-4 py-3 space-y-2",children:[n.jsx(en,{label:"Status",children:n.jsx("span",{className:Q("font-mono text-[11px]",uk[we]??"text-amber-700 dark:text-amber-300"),children:O===void 0?we:`${we} — ${O}`})}),me&&n.jsx(en,{label:"Reason",children:n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:me})}),n.jsxs(en,{label:"Records",children:[M.records!==void 0?n.jsx("span",{className:"font-mono tabular-nums text-[hsl(var(--muted-foreground))]",children:M.records}):n.jsx(Uo,{what:"The record count"}),n.jsx("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:M.bytes!==void 0?rk(M.bytes):n.jsx(Uo,{what:"Size"})})]}),n.jsx(en,{label:"Fidelity",children:n.jsx("span",{className:"font-mono text-[11px] text-[hsl(var(--muted-foreground))]",children:je})}),n.jsx(en,{label:"Redaction",children:n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:ne==="applied"?"applied — the stored bytes are redacted":"none — the stored bytes are NOT redacted"})}),n.jsx(en,{label:"Expires",children:R!==void 0&&Number.isFinite(R)?n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:new Date(R).toLocaleString()}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"no expiry recorded"})}),xe&&n.jsx(en,{label:"Copied from",children:n.jsxs("span",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))]",title:"This artifact was copied from the run this one rescored; the copied records keep their original operation ids.",children:["artifact ",xe.artifactId," (run ",xe.ownerId,")"]})}),E!==void 0&&n.jsx(en,{label:"Note",children:n.jsxs("span",{className:"text-amber-700 dark:text-amber-300",children:["could not confirm the artifact is still stored: ",E]})}),re&&n.jsx(en,{label:"Error",children:n.jsx("span",{className:"text-red-700 dark:text-red-300",children:re})})]}),te!==void 0&&n.jsxs("div",{className:"border-t border-[hsl(var(--border))]",children:[q&&n.jsx("p",{className:"px-4 py-2 text-[11px] text-amber-700 dark:text-amber-300",children:q}),G&&n.jsx("p",{className:"px-4 py-2 text-[11px] text-amber-700 dark:text-amber-300",children:"Delivered redacted by this deployment’s trace.redact; the stored bytes are not."}),te.length===0?n.jsx("p",{className:"px-4 py-3 text-[11px] text-[hsl(var(--muted-foreground))]",children:"The artifact holds no records."}):n.jsx("ul",{"aria-label":"Captured request records",className:"divide-y-0",children:te.map((P,le)=>n.jsx(hk,{operation:P,index:le},`${P.operationId}-${le}`))})]})]})}function gk({result:s}){if(!nk(s))return null;const r=om(s);return n.jsx("span",{"aria-label":"Captured requests available",title:`${r==null?void 0:r.records} captured request record(s) — open the run to inspect or download them.`,className:"inline-flex items-center px-1.5 py-0.5 rounded-md text-[9px] font-medium uppercase tracking-wide bg-sky-100 text-sky-900 dark:bg-sky-950/60 dark:text-sky-200",children:"requests"})}function vk({coverage:s}){if(!s)return null;const r=Object.entries(s.scorers).map(([o,i])=>({name:o,notRun:i.budget_skipped+i.budget_interrupted,scored:i.scored})).filter(o=>o.notRun>0);return r.length===0?null:n.jsxs("div",{role:"status",className:"px-4 py-2 border-b border-amber-300/60 bg-amber-50 dark:border-amber-500/40 dark:bg-amber-950/40 text-[11px] text-amber-900 dark:text-amber-200",children:["Budget stops thinned these means — each is over the items the judge actually scored:"," ",r.map(o=>`${o.name} (${o.notRun} of ${o.scored+o.notRun} not run)`).join(", "),"."]})}const bk=20;function V0({result:s}){const r=Vw(s);if(r.length===0)return null;const o=r.slice(0,bk),i=r.length-o.length,d=r.length===1;return n.jsxs("div",{className:"mb-3 rounded-md border border-amber-300/60 bg-amber-50 dark:border-amber-500/40 dark:bg-amber-950/40 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",role:"status",children:[n.jsxs("div",{className:"font-medium",children:[r.length," annotation ",d?"key":"keys"," dropped by the dataset schema"]}),n.jsxs("div",{className:"mt-1 text-amber-800/90 dark:text-amber-300/90",children:["Stripped before reaching scorers, so any scorer reading ",d?"it":"them"," silently sees ",n.jsx("code",{className:"font-mono",children:"undefined"}),". Declare ",d?"it":"them"," in the dataset’s ",n.jsx("code",{className:"font-mono",children:"annotations"})," schema."]}),n.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[o.map(f=>n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 text-[10px] font-mono font-medium",children:f},f)),i>0&&n.jsxs("span",{className:"px-1.5 py-0.5 text-[10px] text-amber-800/80 dark:text-amber-300/80 font-medium",children:["+",i," more"]})]})]})}const yk=20;function X0({result:s}){const r=Xw(s);if(r.length===0)return null;const o=r.slice(0,yk),i=r.length-o.length,d=r.length===1;return n.jsxs("div",{className:"mb-3 rounded-md border border-amber-300/60 bg-amber-50 dark:border-amber-500/40 dark:bg-amber-950/40 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",role:"status",children:[n.jsxs("div",{className:"font-medium",children:["Filtered scorer subset — ran ",r.length," ",d?"scorer":"scorers"]}),n.jsxs("div",{className:"mt-1 text-amber-800/90 dark:text-amber-300/90",children:["Only ",d?"this scorer was":"these scorers were"," run, not the eval’s full set. This is not a full-coverage run — don’t use it as a baseline."]}),n.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[o.map(f=>n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 dark:bg-amber-900/50 text-amber-800 dark:text-amber-200 text-[10px] font-mono font-medium",children:f},f)),i>0&&n.jsxs("span",{className:"px-1.5 py-0.5 text-[10px] text-amber-800/80 dark:text-amber-300/80 font-medium",children:["+",i," more"]})]})]})}const jk=5;function Nk(s){const r=s.scored+s.failed,o=(s.rate*100).toFixed(1),i=`"${s.scorer}" failed ${o}% (${s.failed}/${r})`,d=s.runsAffected!=null&&s.runsAffected>0?` (in ${s.runsAffected} run${s.runsAffected===1?"":"s"})`:"";return s.type==="deterministic"?`${i} — deterministic scorers tolerate no failures${d}`:`${i} — over the ${(s.limit*100).toFixed(1)}% limit (llm)${d}`}function F0({result:s}){const r=Ev(s);if(r.length===0)return null;const o=r.slice(0,jk),i=r.length-o.length,d=r.length===1;return n.jsxs("div",{className:"mb-3 rounded-md border border-amber-300/60 bg-amber-50 dark:border-amber-500/40 dark:bg-amber-950/40 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",role:"status",children:[n.jsxs("div",{className:"font-medium",children:[r.length," ",d?"scorer":"scorers"," exceeded the failure-rate tolerance"]}),n.jsxs("div",{className:"mt-1 text-amber-800/90 dark:text-amber-300/90",children:[d?"This scorer":"These scorers"," ran and failed on too many items, so the reported mean rests on a thinned, unrepresentative sample — don’t trust it."]}),n.jsxs("ul",{className:"mt-2 space-y-0.5",children:[o.map(f=>n.jsx("li",{className:"text-[11px] font-mono text-amber-800/90 dark:text-amber-300/90",children:Nk(f)},f.scorer)),i>0&&n.jsxs("li",{className:"text-[11px] text-amber-800/80 dark:text-amber-300/80 font-medium",children:["+",i," more"]})]})]})}function Sk({result:s,scorerTypes:r}){const o=s.summary,i=s.items,d=o.scorers?Object.entries(o.scorers):[],f=d.length>0||o.timing!=null;return n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Summary"})}),n.jsx("div",{className:Q("overflow-x-auto",!f&&"hidden"),children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[n.jsx("th",{className:"text-left px-4 py-2 font-medium w-48",children:"Metric"}),n.jsx("th",{className:"px-4 py-2 w-28"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Mean"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P50"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P95"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Min"}),n.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Max"})]})}),n.jsxs("tbody",{children:[d.map(([h,m])=>{const{scored:p,failed:x,skipped:v}=Kw(m,h,i),y=p>0;return n.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[n.jsxs("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--foreground))]",children:[h,(r==null?void 0:r[h])==="llm"&&n.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"}),n.jsx(lm,{failed:x,skipped:v,scored:p})]}),y?n.jsxs(n.Fragment,{children:[n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"h-2 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:n.jsx("div",{className:Q("h-full rounded-full transition-all",zc(m.mean)),style:{width:`${m.mean*100}%`}})})}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono font-medium",Dt(m.mean)),children:m.mean.toFixed(3)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:m.p50.toFixed(3)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:m.p95.toFixed(3)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:m.min.toFixed(3)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:m.max.toFixed(3)})]}):n.jsx("td",{colSpan:6,className:"px-3 py-2.5 text-center text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]},h)}),o.timing&&n.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[n.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing"}),n.jsx("td",{className:"px-4 py-2.5"}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(o.timing.mean)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(o.timing.p50)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(o.timing.p95)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(o.timing.min)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(o.timing.max)})]})]})]})}),n.jsx(tk,{result:s})]})}function wk({items:s,scorerNames:r,onSelectItem:o,errorFilter:i,onErrorFilterChange:d,scorerFilter:f,onScorerFilterChange:h,threshold:m,onThresholdChange:p,sortField:x,onSortFieldChange:v,sortDir:y,onSortDirChange:k}){const w=m!==""?parseFloat(m):null,C=i!=="all"||f!==""&&w!=null&&!isNaN(w),A=b.useMemo(()=>s.map((T,j)=>({item:T,index:j})),[s]),_=b.useMemo(()=>{let T=A;return i==="errors"?T=T.filter(({item:j})=>!!j.error):i==="no-errors"&&(T=T.filter(({item:j})=>!j.error)),f&&w!=null&&!isNaN(w)&&(T=T.filter(({item:j})=>{const S=j.scores[f];return S!=null&&S<w})),T},[A,i,f,w]),D=b.useMemo(()=>{const T=[..._],j=y==="asc"?1:-1;return T.sort((S,E)=>{let B,te;return x==="index"?(B=S.index,te=E.index):x==="duration"?(B=S.item.duration??1/0,te=E.item.duration??1/0):x==="cost"?(B=bc(S.item).knownCost,te=bc(E.item).knownCost):(B=S.item.scores[x]??-1/0,te=E.item.scores[x]??-1/0),(B-te)*j}),T},[_,x,y]),$=[{value:"index",label:"Item #"},{value:"duration",label:"Duration"},{value:"cost",label:"Cost"},...r.map(T=>({value:T,label:T}))];return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"All Items"}),n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono tabular-nums",children:C?`${_.length} of ${s.length}`:String(s.length)}),C&&n.jsx("button",{onClick:()=>{d("all"),h(""),p("")},className:"text-xs text-[hsl(var(--primary))] hover:underline cursor-pointer",children:"Reset"})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("select",{value:i,onChange:T=>d(T.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[n.jsx("option",{value:"all",children:"All"}),n.jsx("option",{value:"errors",children:"Errors"}),n.jsx("option",{value:"no-errors",children:"Passed"})]}),r.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("select",{value:f,onChange:T=>h(T.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[n.jsx("option",{value:"",children:"Score filter…"}),r.map(T=>n.jsx("option",{value:T,children:T},T))]}),f&&n.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",placeholder:"< threshold",value:m,onChange:T=>p(T.target.value),className:"w-20 px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]}),n.jsx("div",{className:"w-px h-4 bg-[hsl(var(--border))]"}),n.jsx("select",{value:x,onChange:T=>v(T.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:$.map(T=>n.jsx("option",{value:T.value,children:T.label},T.value))}),n.jsx("button",{onClick:()=>k(y==="asc"?"desc":"asc"),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:y==="asc"?"Ascending":"Descending",children:y==="asc"?"↑":"↓"})]})]}),D.length===0&&C&&n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))] py-6 text-center",children:"No items match the current filters."}),D.length>0&&n.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[n.jsx("th",{className:"text-left px-3 py-2.5 font-medium w-10",children:"#"}),n.jsx("th",{className:"text-left px-3 py-2.5 font-medium min-w-[180px]",children:"Input"}),r.map(T=>n.jsx("th",{className:"text-right px-2 py-2.5 font-medium font-mono max-w-24 truncate",title:T,children:T},T)),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Duration"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Cost"}),n.jsx("th",{className:"w-8"})]})}),n.jsx("tbody",{children:D.map(({item:T,index:j})=>n.jsxs("tr",{onClick:()=>o(j),className:"border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors group",children:[n.jsxs("td",{className:"px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:[j+1,n.jsx(Uc,{outcome:bs(T),className:"ml-1.5"}),bs(T)==null&&T.error&&n.jsx("span",{className:"ml-1 inline-flex items-center text-red-500",title:"Workflow error","aria-label":"Workflow error",children:n.jsx(Ig,{size:12})}),!T.error&&T.scorerErrors&&T.scorerErrors.length>0&&n.jsx("span",{className:"ml-1 inline-flex items-center text-amber-500",title:"Scorer errors","aria-label":"Scorer errors",children:n.jsx(Pg,{size:12})})]}),n.jsx("td",{className:"px-3 py-2 max-w-xs",children:n.jsx("span",{className:"text-[11px] leading-tight text-[hsl(var(--muted-foreground))] truncate block group-hover:text-[hsl(var(--foreground))] transition-colors",children:Cl(T.input)==="[redacted]"?`Item ${j+1}`:Cl(T.input)})}),r.map(S=>{var q;const E=T.scores[S],B=(q=T.scoreDetails)==null?void 0:q[S],te=(B==null?void 0:B.skipped)===!0;return n.jsx("td",{className:"text-right px-2 py-2 font-mono",children:E!=null?n.jsx("span",{className:Q("font-medium tabular-nums",Dt(E)),children:E.toFixed(2)}):wv(B)?n.jsx(Ec,{outcome:ol(B)}):te?n.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",title:"Not applicable (N/A)",children:"N/A"}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",title:(B==null?void 0:B.duration)!=null?"Scorer failed":void 0,children:"—"})},S)}),n.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:T.duration!=null?ht(T.duration):"—"}),n.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:n.jsx(sn,{accounting:bc(T),label:`Item ${j+1} known spend`,compact:!0})}),n.jsx("td",{className:"px-2 py-2",children:n.jsx(Kn,{size:12,className:"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60 transition-opacity"})})]},j))})]})})})]})}const I0=300;function kk({text:s}){const[r,o]=b.useState(!1),i=s.length>I0;return n.jsxs("div",{children:[n.jsx("pre",{className:"text-xs font-mono p-3 rounded-lg bg-[hsl(var(--secondary))] overflow-auto max-h-96 whitespace-pre-wrap leading-relaxed",children:i&&!r?s.slice(0,I0)+"…":s}),i&&n.jsx("button",{onClick:()=>o(!r),className:"text-xs text-[hsl(var(--primary))] hover:underline mt-1.5 cursor-pointer",children:r?"Show less":"Show more"})]})}function rf({label:s,data:r}){return n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))]/50 border-b border-[hsl(var(--border))]",children:n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:s})}),n.jsx("div",{className:"p-4",children:n.jsx(Ct,{data:r,collapsed:!0})})]})}function Ck({traces:s}){const[r,o]=b.useState(!1);return n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsxs("button",{onClick:()=>o(i=>!i),className:"w-full flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))]/50 border-b border-[hsl(var(--border))] hover:bg-[hsl(var(--muted))] text-left cursor-pointer",children:[n.jsx("span",{className:Q("text-[11px]",r?"rotate-0":"rotate-90"),children:"▶"}),n.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Trace"}),n.jsxs("span",{className:"text-[11px] text-[hsl(var(--muted-foreground))] ml-1",children:[s.length," event",s.length!==1?"s":""]})]}),!r&&n.jsx("div",{className:"p-2",children:n.jsx(Ko,{events:s})})]})}function Ek({failure:s}){const r=[];return s.provider&&r.push(s.provider),s.status!==void 0&&r.push(s.status===0?"network":`HTTP ${s.status}`),s.retryable!==void 0&&r.push(s.retryable?"retryable":"not retryable"),s.requestId&&r.push(`request ${s.requestId}`),n.jsxs("div",{"data-testid":"item-failure-cause",className:"text-xs font-mono text-red-700 dark:text-red-300",children:[n.jsx("span",{className:"font-sans font-medium",children:"Cause: "}),[s.name,...r].join(" · ")]})}function Tk({item:s,itemIndex:r,scorerNames:o,onBack:i}){var k;const d=s.scorerErrors??[],f=Yw(s),h=Tv(s),m=Fw(s),p=bc(s),x={...p,knownCost:p.breakdown.generation},v={...p,knownCost:p.breakdown.judging},y=bs(s);return n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("nav",{className:"flex items-center gap-1.5 text-sm",children:[n.jsx("button",{onClick:i,className:"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:"Overview"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"/"}),n.jsxs("span",{className:"font-medium",children:["Item #",r+1]}),n.jsx(Uc,{outcome:y,className:"ml-1"}),y==null&&s.error&&n.jsx("span",{className:"ml-1 inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/30",children:"Error"})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))] font-mono",children:[f.length>0&&f.map(w=>n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-medium",title:w,children:_n(w)},w)),h&&n.jsxs("span",{title:`Input: ${h.input.toLocaleString()} Output: ${h.output.toLocaleString()}${h.reasoning?` Reasoning: ${h.reasoning.toLocaleString()}`:""}`,children:[(h.input+h.output+h.reasoning).toLocaleString()," tok"]}),m>1&&n.jsxs("span",{title:`${m} agent calls for this item`,children:[m," calls"]}),s.duration!=null&&n.jsx("span",{children:ht(s.duration)}),n.jsx(sn,{accounting:p,label:`Item ${r+1} known spend`})]})]}),o.length>0&&n.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3 px-4 rounded-xl bg-[hsl(var(--muted))]/50",children:o.map(w=>{var _,D,$,T;const C=s.scores[w],A=((D=(_=s.scoreDetails)==null?void 0:_[w])==null?void 0:D.skipped)===!0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:w}),C!=null?n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"w-12 h-1.5 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:n.jsx("div",{className:Q("h-full rounded-full",zc(C)),style:{width:`${C*100}%`}})}),n.jsx("span",{className:Q("text-xs font-mono font-medium tabular-nums",Dt(C)),children:C.toFixed(2)})]}):wv(($=s.scoreDetails)==null?void 0:$[w])?n.jsx(Ec,{outcome:ol((T=s.scoreDetails)==null?void 0:T[w])}):A?n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",title:"Not applicable (N/A)",children:"N/A"}):n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:"—"})]},w)})}),(s.error||s.failure)&&n.jsxs("div",{className:"p-3 rounded-xl bg-red-50 dark:bg-red-950/30 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-xs font-mono space-y-1.5",children:[s.failure&&n.jsx(Ek,{failure:s.failure}),s.error&&n.jsx("div",{children:s.error})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[n.jsx(rf,{label:"Input",data:s.input}),n.jsx(rf,{label:"Output",data:s.output})]}),s.annotations!=null&&n.jsx(rf,{label:"Expected (Annotations)",data:s.annotations}),n.jsxs("div",{className:"flex items-center gap-3 text-xs text-[hsl(var(--muted-foreground))] flex-wrap",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:["Generation:",n.jsx(sn,{accounting:x,label:"Generation spend"})]}),n.jsx("span",{children:"+"}),n.jsxs("span",{className:"flex items-center gap-1.5",children:["Judging:",n.jsx(sn,{accounting:v,label:"Judging spend"})]}),n.jsx("span",{children:"="}),n.jsx("span",{className:"flex items-center gap-1.5 font-medium text-[hsl(var(--foreground))]",children:n.jsx(sn,{accounting:p,label:"Item known spend"})})]}),((k=s.callerReport)==null?void 0:k.cost)!=null&&n.jsxs("div",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",title:"Returned by the executeWorkflow callback. Kept for inspection; never summed into known spend.",children:["$",s.callerReport.cost.toFixed(2)," — caller-reported (not counted)"]}),s.traces&&s.traces.length>0&&n.jsx(Ck,{traces:s.traces}),o.length>0&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Results"}),o.map(w=>{var $;const C=s.scores[w],A=($=s.scoreDetails)==null?void 0:$[w],_=d.find(T=>T.includes(`"${w}"`)),D=(A==null?void 0:A.skipped)===!0;return n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))]/50",children:[n.jsx("span",{className:"font-mono text-xs font-medium",children:w}),C!=null&&n.jsx("span",{className:Q("px-2 py-0.5 rounded-full text-xs font-mono font-medium",Cc(C)),children:C.toFixed(3)}),n.jsx(Ec,{outcome:ol(A)}),C==null&&D&&ol(A)==null&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]",title:"Skipped — the scorer's `applies` predicate returned false for this item (excluded from the mean and failure rate)",children:"N/A"}),C==null&&!D&&!_&&ol(A)==null&&n.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",children:"null"}),n.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(A==null?void 0:A.duration)!=null&&n.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",children:ht(A.duration)}),((A==null?void 0:A.accounting)||(A==null?void 0:A.cost)!=null)&&n.jsx(sn,{accounting:Tw(A),label:`${w} judging spend`,className:"text-xs text-[hsl(var(--muted-foreground))]"})]})]}),((A==null?void 0:A.metadata)||_||D)&&n.jsxs("div",{className:"px-4 py-3 space-y-2",children:[D&&n.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Not applicable — the scorer’s ",n.jsx("code",{children:"applies"})," predicate returned false for this item, so it was skipped (excluded from the mean and the failure rate)."]}),(A==null?void 0:A.metadata)&&typeof A.metadata.reasoning=="string"&&A.metadata.reasoning.length>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Reasoning"}),n.jsx(kk,{text:A.metadata.reasoning})]}),(A==null?void 0:A.metadata)&&(()=>{const T=Object.keys(A.metadata).filter(S=>S!=="reasoning");if(T.length===0)return null;const j={};for(const S of T)j[S]=A.metadata[S];return n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Metadata"}),n.jsx(Ct,{data:j,collapsed:!0})]})})(),_&&n.jsx("div",{className:"text-xs text-amber-600 dark:text-amber-400 font-mono p-2.5 rounded-lg bg-amber-50 dark:bg-amber-950/30",children:_})]})]},w)})]})]})}function Mk(s,r){const o=r.map(i=>s.scores[i]).filter(i=>i!=null);return o.length===0?null:o.reduce((i,d)=>i+d,0)/o.length}function Ak({items:s,scorerNames:r,selectedIndex:o,onSelectItem:i,onDeselectItem:d}){const f=b.useMemo(()=>s.map((p,x)=>({item:p,index:x,avg:Mk(p,r),label:Cl(p.input,60)})),[s,r]),h=s.filter(p=>bs(p)!=null?bs(p)==="failed":!!p.error).length,m=s.filter(p=>{const x=bs(p);return x==="budget_skipped"||x==="budget_interrupted"}).length;return n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx("div",{className:"shrink-0 px-4 py-3 border-b border-[hsl(var(--border))]",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("button",{onClick:d,className:Q("text-xs font-medium transition-colors cursor-pointer",o==null?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:[s.length," items"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[h>0&&n.jsxs("span",{className:"text-[10px] font-medium text-red-600 dark:text-red-400",children:[h," failed"]}),m>0&&n.jsxs("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",title:"Items the run budget skipped or interrupted — not model failures",children:[m," stopped on budget"]}),h===0&&m===0&&n.jsx("span",{className:"text-[10px] font-medium text-emerald-600 dark:text-emerald-400",children:"all passed"})]})]})}),n.jsx("div",{className:"flex-1 overflow-y-auto",children:f.map(({item:p,index:x,avg:v,label:y})=>{const k=o===x;return n.jsxs("button",{onClick:()=>i(x),className:Q("w-full text-left px-4 py-2.5 flex items-center gap-3 border-b border-[hsl(var(--border))]/50 transition-colors group cursor-pointer",k?"bg-[hsl(var(--accent))] border-l-2 border-l-[hsl(var(--foreground))]":"hover:bg-[hsl(var(--accent))]/50 border-l-2 border-l-transparent"),children:[n.jsx("span",{className:Q("text-[10px] font-mono w-5 shrink-0",k?"text-[hsl(var(--foreground))] font-medium":"text-[hsl(var(--muted-foreground))]"),children:x+1}),n.jsx("span",{className:Q("flex-1 text-xs truncate leading-snug",k?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] group-hover:text-[hsl(var(--foreground))]"),children:y}),n.jsx(Uc,{outcome:bs(p),className:"shrink-0"}),bs(p)==null&&p.error&&n.jsx("span",{className:"inline-flex items-center text-red-500 shrink-0",title:"Workflow error","aria-label":"Workflow error",children:n.jsx(Ig,{size:11})}),!p.error&&p.scorerErrors&&p.scorerErrors.length>0&&n.jsx("span",{className:"inline-flex items-center text-amber-500 shrink-0",title:"Scorer errors","aria-label":"Scorer errors",children:n.jsx(Pg,{size:11})}),v!=null?n.jsx("span",{className:Q("text-[11px] font-mono font-medium shrink-0 tabular-nums",Dt(v)),children:v.toFixed(2)}):n.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] shrink-0",children:"-"}),n.jsx(Kn,{size:12,className:Q("shrink-0 transition-all",k?"text-[hsl(var(--foreground))] opacity-100":"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60")})]},x)})})]})}function _k({name:s,scores:r,mean:o,failed:i,skipped:d}){const f=n.jsx(lm,{failed:i,skipped:d});return r.length===0?n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"w-28 text-xs font-mono truncate text-[hsl(var(--muted-foreground))]",title:s,children:s}),n.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No valid scores"}),f]}):n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"w-28 text-xs font-mono truncate",title:s,children:[s,f]}),n.jsxs("div",{className:"flex-1 h-5 relative bg-[hsl(var(--secondary))] rounded",children:[[.25,.5,.75].map(h=>n.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-[hsl(var(--border))]",style:{left:`${h*100}%`}},h)),r.map((h,m)=>n.jsx("div",{className:Q("absolute w-1 top-[3px] bottom-[3px] rounded-sm",zc(h)),style:{left:`${Math.max(1,Math.min(99,h*100))}%`,transform:"translateX(-50%)",opacity:.45},title:h.toFixed(3)},m)),n.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[hsl(var(--foreground))]",style:{left:`${o*100}%`,opacity:.3},title:`Mean: ${o.toFixed(3)}`})]}),n.jsx("span",{className:"w-12 text-xs font-mono text-right text-[hsl(var(--muted-foreground))] tabular-nums",children:o.toFixed(3)})]})}function Ok({items:s,scorerNames:r}){const o=b.useMemo(()=>r.map(i=>{const{scores:d,failed:f,skipped:h}=Cv(s,i),m=d.length>0?d.reduce((p,x)=>p+x,0)/d.length:0;return{name:i,scores:d,mean:m,failed:f,skipped:h}}),[s,r]);return r.length===0?null:n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Score Distribution"})}),n.jsxs("div",{className:"p-4 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("span",{className:"w-28"}),n.jsxs("div",{className:"flex-1 flex justify-between text-[10px] font-mono text-[hsl(var(--muted-foreground))]",children:[n.jsx("span",{children:"0"}),n.jsx("span",{children:"0.25"}),n.jsx("span",{children:"0.5"}),n.jsx("span",{children:"0.75"}),n.jsx("span",{children:"1.0"})]}),n.jsx("span",{className:"w-12"})]}),o.map(i=>n.jsx(_k,{name:i.name,scores:i.scores,mean:i.mean,failed:i.failed,skipped:i.skipped},i.name))]})]})}function mc({field:s,current:r,dir:o,onSort:i,align:d,className:f,children:h}){const m=r===s;return n.jsxs("th",{className:Q(d==="right"?"text-right":"text-left","px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",f,d==="left"&&"px-4"),onClick:()=>i(s),children:[h,m&&n.jsx("span",{className:"ml-0.5",children:o==="desc"?"▼":"▲"})]})}function Rk({baseline:s,candidate:r,scorerNames:o,baselineRuns:i,candidateRuns:d,scorerTypes:f}){const[h,m]=b.useState(o[0]??""),[p,x]=b.useState("delta"),[v,y]=b.useState("desc"),[k,w]=b.useState(!1),C=i&&i.length>1||d&&d.length>1,A=(i==null?void 0:i.length)??1,_=(d==null?void 0:d.length)??1,[D,$]=b.useState(null),T=E=>{p===E?y(B=>B==="desc"?"asc":"desc"):(x(E),y(E==="index"?"asc":"desc"))},j=Math.min(s.items.length,r.items.length),S=b.useMemo(()=>{var te,q,K,F,re,we,me,Z;const E=[],B=Math.min((i==null?void 0:i.length)??0,(d==null?void 0:d.length)??0);for(let M=0;M<j;M++){const R=s.items[M].scores[h]??null,ne=r.items[M].scores[h]??null,je=(te=s.items[M].scoreDetails)==null?void 0:te[h],xe=(q=r.items[M].scoreDetails)==null?void 0:q[h],O=(je==null?void 0:je.skipped)===!0,G=(xe==null?void 0:xe.skipped)===!0,P=R==null&&!O&&(je==null?void 0:je.duration)!=null,le=ne==null&&!G&&(xe==null?void 0:xe.duration)!=null,he=O||G,ie=!he&&R!=null&&ne!=null?ne-R:0;let fe;if(B>1){fe=[];for(let I=0;I<B;I++){const oe=(K=i[I])==null?void 0:K.items[M],ce=(F=d[I])==null?void 0:F.items[M],ve=oe==null?void 0:oe.scores[h],Ne=ce==null?void 0:ce.scores[h];!(((we=(re=oe==null?void 0:oe.scoreDetails)==null?void 0:re[h])==null?void 0:we.skipped)===!0||((Z=(me=ce==null?void 0:ce.scoreDetails)==null?void 0:me[h])==null?void 0:Z.skipped)===!0)&&ve!=null&&Ne!=null&&fe.push(Ne-ve)}}E.push({index:M,input:s.items[M].input,baselineScore:R,candidateScore:ne,delta:ie,baselineSkipped:O,candidateSkipped:G,baselineFailed:P,candidateFailed:le,nonComparable:he,runDeltas:fe})}return E.sort((M,R)=>{let ne,je;switch(p){case"index":ne=M.index,je=R.index;break;case"baseline":ne=M.baselineScore??-1,je=R.baselineScore??-1;break;case"candidate":ne=M.candidateScore??-1,je=R.candidateScore??-1;break;case"delta":default:ne=Math.abs(M.delta),je=Math.abs(R.delta);break}return v==="desc"?je-ne:ne-je}),E},[s,r,h,p,v,j,i,d]);return o.length===0||j===0?null:n.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[n.jsxs("button",{onClick:()=>w(E=>!E),className:"w-full flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[k?n.jsx(Kn,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}):n.jsx(Ga,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}),n.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["All Items (",j,")",C&&n.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," scores averaged across"," ",A===_?`${A} runs`:`${A} / ${_} runs`]})]})]}),!k&&n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))] flex-wrap",children:o.map(E=>n.jsxs("button",{onClick:()=>m(E),className:Q("px-2 py-1 text-[11px] font-mono rounded-md transition-colors cursor-pointer",h===E?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))] font-medium":"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--foreground))]"),children:[E,(f==null?void 0:f[E])==="llm"&&n.jsx("span",{className:"ml-1 text-[8px] opacity-70",children:"LLM"})]},E))}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[n.jsx(mc,{field:"index",current:p,dir:v,onSort:T,align:"left",className:"w-10",children:"#"}),n.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Input"}),n.jsxs(mc,{field:"baseline",current:p,dir:v,onSort:T,align:"right",children:["Baseline",C&&A>1&&n.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",A,")"]})]}),n.jsxs(mc,{field:"candidate",current:p,dir:v,onSort:T,align:"right",children:["Candidate",C&&_>1&&n.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",_,")"]})]}),n.jsx(mc,{field:"delta",current:p,dir:v,onSort:T,align:"right",children:"Delta"})]})}),n.jsx("tbody",{children:S.map(E=>{const B=D===E.index,te=E.delta>0?"text-emerald-600 dark:text-emerald-400":E.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return n.jsxs("tr",{className:Q("border-b border-[hsl(var(--border))] last:border-b-0 cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",B&&"bg-[hsl(var(--accent))]"),children:[n.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",onClick:()=>$(B?null:E.index),children:E.index+1}),n.jsx("td",{className:"px-3 py-2.5 max-w-xs truncate",onClick:()=>$(B?null:E.index),children:Cl(E.input)}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",E.baselineScore!=null?Dt(E.baselineScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>$(B?null:E.index),children:E.baselineScore!=null?E.baselineScore.toFixed(3):E.baselineSkipped?n.jsx("span",{title:"Not applicable (N/A)",children:"N/A"}):n.jsx("span",{title:E.baselineFailed?"Scorer failed":void 0,children:"—"})}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",E.candidateScore!=null?Dt(E.candidateScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>$(B?null:E.index),children:E.candidateScore!=null?E.candidateScore.toFixed(3):E.candidateSkipped?n.jsx("span",{title:"Not applicable (N/A)",children:"N/A"}):n.jsx("span",{title:E.candidateFailed?"Scorer failed":void 0,children:"—"})}),n.jsxs("td",{className:Q("px-3 py-2.5 text-right",E.nonComparable?"text-[hsl(var(--muted-foreground))]":te),onClick:()=>$(B?null:E.index),children:[n.jsx("div",{className:"font-mono",children:E.nonComparable?n.jsx("span",{title:"Not comparable — a side was skipped (N/A) for this scorer",children:"N/A"}):E.delta!==0?`${E.delta>0?"+":""}${E.delta.toFixed(3)}`:"—"}),E.runDeltas&&E.runDeltas.length>1&&n.jsxs("div",{className:"flex items-center justify-end gap-0.5 mt-1",title:E.runDeltas.map((q,K)=>`Run ${K+1}: ${q>=0?"+":""}${q.toFixed(3)}`).join(", "),children:[E.runDeltas.map((q,K)=>n.jsx("div",{className:Q("w-1.5 h-1.5 rounded-full",q<0?"bg-red-500 dark:bg-red-400":q>0?"bg-emerald-500 dark:bg-emerald-400":"bg-[hsl(var(--muted-foreground))]")},K)),n.jsxs("span",{className:"text-[9px] text-[hsl(var(--muted-foreground))] ml-0.5",children:[E.runDeltas.filter(q=>E.delta<0?q<0:q>0).length,"/",E.runDeltas.length]})]})]})]},E.index)})})]})}),D!=null&&D<s.items.length&&D<r.items.length&&n.jsx(Ov,{baselineItem:s.items[D],candidateItem:r.items[D],scorer:h,baselineRunItems:i==null?void 0:i.map(E=>E.items[D]).filter(Boolean),candidateRunItems:d==null?void 0:d.map(E=>E.items[D]).filter(Boolean)})]})]})}function Dk({stats:s}){const r=s.n,o=s.baselineScored,i=s.candidateScored,d=s.baselineSkipped??0,f=s.candidateSkipped??0,h=s.baselineFailed??0,m=s.candidateFailed??0;if(!(r!=null&&o!=null&&i!=null&&(d+f+h+m>0||r<Math.min(o,i))))return null;const x=(v,y,k)=>`${v} scored${y>0?`, ${y} N/A`:""}${k>0?`, ${k} failed`:""}`;return n.jsxs("div",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))] mt-0.5 underline decoration-dotted underline-offset-2 cursor-help",title:`Delta compares per-side means — baseline over ${x(o,d,h)}; candidate over ${x(i,f,m)}. The CI / significance use the ${r} item(s) scored on BOTH sides, so the delta and CI rest on different samples here.`,children:["paired n=",r," · per-side ",o,"/",i]})}function zk({text:s,children:r}){return n.jsxs("span",{className:"relative group/tip cursor-help",children:[r,n.jsx("span",{className:"invisible group-hover/tip:visible absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 px-2.5 py-1.5 text-[10px] leading-snug rounded-md bg-[hsl(var(--foreground))] text-[hsl(var(--background))] whitespace-normal w-56 z-50 shadow-md pointer-events-none",children:s})]})}function Z0({value:s,percent:r,invert:o,format:i,muted:d}){const f=!d&&(o?s<0:s>0),h=!d&&(o?s>0:s<0),m=f?"text-emerald-600 dark:text-emerald-400":h?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]",p=i?`${s>0?"+":s<0?"-":""}${i(Math.abs(s))}`:`${s>0?"+":""}${Math.abs(s)<100?s.toFixed(3):s.toFixed(0)}`,x=r==null?"n/a":`${r>0?"+":""}${r.toFixed(1)}%`;return n.jsx("td",{className:Q("px-3 py-2.5 text-right",m),children:n.jsxs("div",{className:"font-mono",children:[p," (",x,")"]})})}function J0(s){return(s>=0?"+":"")+s.toFixed(4)}function Uk({compareResult:s,baseline:r,candidate:o,isGroupComparison:i,baselineRuns:d,candidateRuns:f}){var je,xe,O,G,P,le,he;const[h,m]=b.useState(null),[p,x]=b.useState("delta"),[v,y]=b.useState("desc"),[k,w]=b.useState({}),C=(ie,fe)=>{(h==null?void 0:h.type)===ie&&(h==null?void 0:h.index)===fe?m(null):m({type:ie,index:fe})},A=((je=r==null?void 0:r.metadata)==null?void 0:je.scorerTypes)??((xe=o==null?void 0:o.metadata)==null?void 0:xe.scorerTypes),_=(d==null?void 0:d.length)??1,D=(f==null?void 0:f.length)??1,$=i?`averaged across ${_===D?`${_} runs`:`${_} / ${D} runs`}`:null,T=(O=s.baseline)==null?void 0:O.partial,j=(G=s.candidate)==null?void 0:G.partial,S=(P=s.baseline)==null?void 0:P.runCount,E=(le=s.candidate)==null?void 0:le.runCount,B=S!=null&&d!=null&&S<d.length,te=E!=null&&f!=null&&E<f.length,q=B||te,K=b.useMemo(()=>{const ie=Object.entries(s.scorers);return ie.sort((fe,I)=>{if(p==="delta"){const ve=fe[1].significant===!0?1:0,Ne=I[1].significant===!0?1:0;if(ve!==Ne)return Ne-ve}let oe,ce;switch(p){case"metric":return v==="asc"?fe[0].localeCompare(I[0]):I[0].localeCompare(fe[0]);case"baseline":oe=fe[1].baselineMean,ce=I[1].baselineMean;break;case"candidate":oe=fe[1].candidateMean,ce=I[1].candidateMean;break;case"delta":default:oe=Math.abs(fe[1].delta),ce=Math.abs(I[1].delta);break}return v==="desc"?ce-oe:oe-ce}),ie},[s.scorers,p,v]),F=K.some(([,ie])=>ie.ci!=null),re=ie=>{p===ie?y(fe=>fe==="desc"?"asc":"desc"):(x(ie),y("desc"))},we=ie=>p===ie?v==="desc"?" ▼":" ▲":"",me=K.filter(([,ie])=>ie.significant===!0).length,Z=s.regressions.length,M=s.improvements.length,R=((he=s.cost)==null?void 0:he.certified)===!0,ne=s.cost&&!R?s.cost.reason??"costs are not comparable":void 0;return n.jsxs("div",{className:"space-y-6",children:[(T||j)&&n.jsx("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-amber-300/60 dark:border-amber-500/40 bg-amber-50 dark:bg-amber-950/40",role:"status",children:n.jsxs("div",{className:"text-sm text-amber-900 dark:text-amber-200",children:[n.jsx("div",{className:"font-medium",children:"Partial batch in this comparison."}),n.jsxs("ul",{className:"mt-1 space-y-0.5 text-amber-800/90 dark:text-amber-300/90 list-disc list-inside",children:[T&&n.jsxs("li",{children:["Baseline pooled ",T.completed," of an attempted"," ",T.attempted," runs."]}),j&&n.jsxs("li",{children:["Candidate pooled ",j.completed," of an attempted"," ",j.attempted," runs."]})]}),n.jsx("div",{className:"mt-1 text-amber-800/80 dark:text-amber-300/80",children:"Statistics below are computed honestly for the included runs."})]})}),q&&n.jsx("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-blue-300/60 dark:border-blue-500/40 bg-blue-50 dark:bg-blue-950/40",role:"status",children:n.jsxs("div",{className:"text-sm text-blue-900 dark:text-blue-200",children:[n.jsxs("div",{className:"font-medium",children:["Comparing ",S," baseline vs ",E," candidate run",E===1?"":"s","."]}),n.jsxs("div",{className:"mt-1 text-blue-800/90 dark:text-blue-300/90",children:["You pooled ",(d==null?void 0:d.length)??1," baseline and ",(f==null?void 0:f.length)??1," ","candidate run",((f==null?void 0:f.length)??1)===1?"":"s","; the comparison uses the first ",Math.min(S??0,E??0)," from each side so the displayed means and paired bootstrap CI are computed over the same sample. Re-pool symmetrically if you want every selected run included."]})]})}),K.length>0&&(()=>{const ie=K.some(([,ve])=>ve.significant===!0&&ve.delta<0),fe=K.some(([,ve])=>ve.significant===!0&&ve.delta>0),I=s.regressions.length>0,oe=K.every(([,ve])=>ve.significant===!1),ce=(ve,Ne)=>{const Ze=Ne.delta<0?Ne.pRegression!=null?`${Math.round(Ne.pRegression*100)}%`:null:Ne.pImprovement!=null?`${Math.round(Ne.pImprovement*100)}%`:null,mt=`${Ne.delta>0?"+":""}${Ne.delta.toFixed(3)}`;return`${ve} ${mt}${Ze?` (${Ze} probability)`:""}`};if(ie){const ve=K.filter(([,Ne])=>Ne.significant===!0&&Ne.delta<0);return n.jsxs("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-red-200 dark:border-red-900 bg-red-50 dark:bg-red-950/30",children:[n.jsx("div",{className:"h-6 w-6 rounded-full bg-red-100 dark:bg-red-900/50 flex items-center justify-center shrink-0 mt-0.5",children:n.jsx("span",{className:"text-red-600 dark:text-red-400 text-xs font-bold",children:"✕"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:"Significant regression detected"}),n.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-0.5",children:ve.map(([Ne,Ze])=>ce(Ne,Ze)).join("; ")})]})]})}if(fe){const ve=K.filter(([,Ne])=>Ne.significant===!0&&Ne.delta>0);return n.jsxs("div",{className:"flex items-start gap-2.5 px-4 py-3 rounded-xl border border-emerald-200 dark:border-emerald-900 bg-emerald-50 dark:bg-emerald-950/30",children:[n.jsx("div",{className:"h-6 w-6 rounded-full bg-emerald-100 dark:bg-emerald-900/50 flex items-center justify-center shrink-0 mt-0.5",children:n.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-emerald-800 dark:text-emerald-200",children:"Significant improvement detected"}),n.jsx("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 mt-0.5",children:ve.map(([Ne,Ze])=>ce(Ne,Ze)).join("; ")})]})]})}return I&&oe?n.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-xl border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/30",children:[n.jsx("div",{className:"h-6 w-6 rounded-full bg-amber-100 dark:bg-amber-900/50 flex items-center justify-center shrink-0",children:n.jsx("span",{className:"text-amber-600 dark:text-amber-400 text-xs font-bold",children:"~"})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:[s.regressions.length," item regressions, but not statistically significant"]}),n.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:i?"Even with pooled multi-run data, the score differences are within normal variation.":"Score differences are within normal LLM variation. Consider multi-run for stronger confidence."})]})]}):n.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[n.jsx("div",{className:"h-6 w-6 rounded-full bg-emerald-100 dark:bg-emerald-900/50 flex items-center justify-center shrink-0",children:n.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium",children:"No significant changes"}),n.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"Scores are stable between baseline and candidate"})]})]})})(),(()=>{const ie=(_e,jt)=>{const zt=jt&&jt.length>0?jt:_e?[_e]:[],jn=new Set;for(const Ya of zt)for(const He of Qa(Ya))jn.add(He);return[...jn]},fe=d&&d.length>0?d:r?[r]:[],I=f&&f.length>0?f:o?[o]:[],oe=(_e,jt)=>{const zt=jt&&jt.length>0?jt:_e?[_e]:[],jn=new Set,Ya=[];for(const He of zt)for(const Nn of dl(He))jn.has(Nn)||(jn.add(Nn),Ya.push(Nn));return Ya},ce=ie(r,d),ve=ie(o,f),Ne=oe(r,d),Ze=oe(o,f),mt=K0(fe),pe=K0(I),Ce=mt.input+mt.output+mt.reasoning,Ie=pe.input+pe.output+pe.reasoning,Mt=zo(fe),Gt=zo(I),vn=Mt.knownCost,Ee=Gt.knownCost,ut=Mt.completeness==="complete"&&Gt.completeness==="complete",at=Ne.length>0||Ze.length>0,$e=new Set(Ne),bn=new Set(Ze),Rn=$e.size!==bn.size||Ne.some(_e=>!bn.has(_e)),It=ce.length>0||ve.length>0,Zt=Ce>0&&Ie>0,fa=vn>0||Ee>0||!ut;if(!at&&!It&&!Zt&&!fa)return null;const Vn=new Set(ce),Ds=new Set(ve),zs=Vn.size!==Ds.size||ce.some(_e=>!Ds.has(_e)),yn=Ce>0?(Ie-Ce)/Ce*100:0;return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 rounded-lg bg-[hsl(var(--muted))]/50 text-xs flex-wrap",children:[at&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:Ne.length>1||Ze.length>1?"Workflows":"Workflow"}),n.jsx("div",{className:"flex items-center gap-1.5",children:Ne.length>0?Ne.map(_e=>n.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:_e,children:_e},_e)):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),n.jsx("div",{className:"flex items-center gap-1.5",children:Ze.length>0?Ze.map(_e=>n.jsx("span",{className:Q("px-1.5 py-0.5 rounded font-mono",Rn?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border border-[hsl(var(--border))] bg-[hsl(var(--background))]"),title:_e,children:_e},_e)):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),Rn&&n.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),It&&n.jsxs(n.Fragment,{children:[at&&n.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Models"}),n.jsx("div",{className:"flex items-center gap-1.5",children:ce.length>0?ce.map(_e=>n.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:_e,children:_n(_e)},_e)):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),n.jsx("div",{className:"flex items-center gap-1.5",children:ve.length>0?ve.map(_e=>n.jsx("span",{className:Q("px-1.5 py-0.5 rounded font-mono",zs?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"border border-[hsl(var(--border))] bg-[hsl(var(--background))]"),title:_e,children:_n(_e)},_e)):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),zs&&n.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),Zt&&n.jsxs(n.Fragment,{children:[It&&n.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Tokens"}),n.jsx("span",{className:"font-mono",children:Ce.toLocaleString()}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),n.jsx("span",{className:"font-mono",children:Ie.toLocaleString()}),Math.abs(yn)>=1&&n.jsxs("span",{className:Q("text-[10px] font-medium",yn>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[yn>0?"+":"",yn.toFixed(0),"%"]})]}),fa&&n.jsxs(n.Fragment,{children:[(It||Zt)&&n.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Cost"}),n.jsx(sn,{accounting:Mt,label:"Baseline known spend"}),n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),n.jsx(sn,{accounting:Gt,label:"Candidate known spend"}),ut&&vn>0&&Ee>0&&(()=>{const _e=(Ee-vn)/vn*100;return Math.abs(_e)>=1?n.jsxs("span",{className:Q("text-[10px] font-medium",_e>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[_e>0?"+":"",_e.toFixed(0),"%"]}):null})(),!ut&&n.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",title:"One or both sides have incomplete or unverified accounting, so the two spend figures are not comparable as a percentage.",children:"not comparable"})]})]})})(),n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Significant"}),n.jsx("div",{className:"text-lg font-semibold mt-0.5",children:me})]}),n.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Regressions"}),n.jsx("div",{className:Q("text-lg font-semibold mt-0.5",Z>0?"text-red-600 dark:text-red-400":""),children:Z})]}),n.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Improvements"}),n.jsx("div",{className:Q("text-lg font-semibold mt-0.5",M>0?"text-emerald-600 dark:text-emerald-400":""),children:M})]}),s.cost&&n.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Cost Delta"}),n.jsxs("div",{className:Q("text-lg font-semibold mt-0.5",R?s.cost.delta>0?"text-red-600 dark:text-red-400":s.cost.delta<0?"text-emerald-600 dark:text-emerald-400":"":"text-[hsl(var(--muted-foreground))]"),children:[s.cost.delta>0?"+":s.cost.delta<0?"-":"",vt(Math.abs(s.cost.delta))]}),n.jsx("div",{className:Q("text-[10px] mt-0.5",R?"text-[hsl(var(--muted-foreground))]":"text-amber-600 dark:text-amber-400"),title:R?void 0:ne,children:R?"certified":"not certified"})]})]}),K.length>0&&n.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:n.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Scorer Comparison",$&&n.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," ",$]})]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[n.jsxs("th",{className:"text-left px-4 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>re("metric"),children:["Metric",we("metric")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>re("baseline"),children:["Baseline",i&&_>1&&n.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",_,")"]}),T&&n.jsxs("span",{className:"font-normal ml-1 px-1 py-0.5 rounded text-[9px] uppercase tracking-wide bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",title:`Partial batch — ${T.completed} of ${T.attempted} runs included`,children:[T.completed,"/",T.attempted]}),we("baseline")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>re("candidate"),children:["Candidate",i&&D>1&&n.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",D,")"]}),j&&n.jsxs("span",{className:"font-normal ml-1 px-1 py-0.5 rounded text-[9px] uppercase tracking-wide bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",title:`Partial batch — ${j.completed} of ${j.attempted} runs included`,children:[j.completed,"/",j.attempted]}),we("candidate")]}),n.jsx("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>re("delta"),children:F?n.jsxs(zk,{text:"Score delta with 95% confidence interval via paired bootstrap. If the CI excludes zero and the effect exceeds the practical threshold, the difference is significant (shown with a colored left border). The Baseline and Candidate columns are per-side means (each over that side's own scored items); the CI is paired over items scored on BOTH sides. A per-row 'paired n' note appears when the two samples diverge — different skips (N/A) or failures per side.",children:["Delta",we("delta")]}):n.jsxs(n.Fragment,{children:["Delta",we("delta")]})})]})}),n.jsxs("tbody",{children:[K.map(([ie,fe])=>{const I=fe.delta>0?"+":(fe.delta<0,""),oe=fe.delta>0?"text-emerald-600 dark:text-emerald-400":fe.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return n.jsxs("tr",{className:Q("border-b border-[hsl(var(--border))] last:border-b-0",fe.significant===!0&&fe.delta<0&&"border-l-[3px] border-l-red-500",fe.significant===!0&&fe.delta>0&&"border-l-[3px] border-l-emerald-500"),children:[n.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[ie,(A==null?void 0:A[ie])==="llm"&&n.jsx("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",fe.baselineScored===0?"text-[hsl(var(--muted-foreground))]":Dt(fe.baselineMean)),children:fe.baselineMean.toFixed(3)}),n.jsx("td",{className:Q("px-3 py-2.5 text-right font-mono",fe.candidateScored===0?"text-[hsl(var(--muted-foreground))]":Dt(fe.candidateMean)),children:fe.candidateMean.toFixed(3)}),n.jsxs("td",{className:"px-3 py-2.5 text-right",children:[n.jsxs("div",{className:Q("font-mono",oe),children:[I,Math.abs(fe.delta).toFixed(3)," (",I,Math.abs(fe.deltaPercent).toFixed(1),"%)"]}),fe.ci&&n.jsxs("div",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))] mt-0.5",children:["CI [",J0(fe.ci.lower),", ",J0(fe.ci.upper),"]"]}),fe.pRegression!=null&&fe.pImprovement!=null&&(()=>{const ce=fe.pRegression??0,ve=fe.pImprovement??0;if(ce===0&&ve===0)return null;let Ne,Ze,mt;if(ce>ve)Ze=ce,Ne="regression",mt=Math.round(Ze*100)>=95?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";else if(ve>ce)Ze=ve,Ne="improvement",mt=Math.round(Ze*100)>=95?"text-emerald-600 dark:text-emerald-400":"text-[hsl(var(--muted-foreground))]";else return null;const pe=Math.round(Ze*100);return n.jsxs("div",{className:Q("text-[10px] mt-0.5",mt),children:[pe,"% probability of ",Ne,fe.n!=null&&n.jsxs("span",{className:"opacity-60 ml-1",children:["(n=",fe.n,")"]})]})})(),n.jsx(Dk,{stats:fe})]})]},ie)}),s.timing&&n.jsxs("tr",{className:"border-t-2 border-[hsl(var(--border))]",children:[n.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing (mean)"}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(s.timing.baselineMean)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ht(s.timing.candidateMean)}),n.jsx(Z0,{value:s.timing.delta,percent:s.timing.deltaPercent,invert:!0,format:ht})]}),s.cost!=null&&n.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[n.jsxs("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:[n.jsx("div",{children:"Known spend (per run)"}),n.jsx("div",{className:Q("text-[10px] font-sans normal-case mt-0.5",R?"text-[hsl(var(--muted-foreground))]":"text-amber-600 dark:text-amber-400"),children:R?"certified — both sides complete and equally covered":`not certified: ${ne}`})]}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:vt(s.cost.baselineTotal)}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:vt(s.cost.candidateTotal)}),n.jsx(Z0,{value:s.cost.delta,percent:s.cost.deltaPercent,invert:!0,muted:!R,format:vt})]})]})]})})]}),[{type:"regression",items:s.regressions,borderColor:"border-red-200 dark:border-red-900",bgColor:"bg-red-50 dark:bg-red-950/30",textColor:"text-red-700 dark:text-red-300",deltaColor:"text-red-600 dark:text-red-400",label:"Regressions",direction:-1},{type:"improvement",items:s.improvements,borderColor:"border-emerald-200 dark:border-emerald-900",bgColor:"bg-emerald-50 dark:bg-emerald-950/30",textColor:"text-emerald-700 dark:text-emerald-300",deltaColor:"text-emerald-600 dark:text-emerald-400",label:"Improvements",direction:1}].filter(ie=>ie.items.length>0).map(ie=>{const fe=d&&f&&d.length>1,I=fe?Math.min(d.length,f.length):0,oe=ie.items.map((Ee,ut)=>{var $e,bn,Rn,It;let at=0;if(fe)for(let Zt=0;Zt<I;Zt++){const fa=(bn=($e=d[Zt])==null?void 0:$e.items[Ee.itemIndex])==null?void 0:bn.scores[Ee.scorer],Vn=(It=(Rn=f[Zt])==null?void 0:Rn.items[Ee.itemIndex])==null?void 0:It.scores[Ee.scorer];fa!=null&&Vn!=null&&(ie.direction<0?Vn<fa:Vn>fa)&&at++}return{...Ee,originalIndex:ut,consistentCount:at,totalRuns:I}});fe?oe.sort((Ee,ut)=>ut.consistentCount-Ee.consistentCount||Math.abs(ut.delta)-Math.abs(Ee.delta)):oe.sort((Ee,ut)=>Math.abs(ut.delta)-Math.abs(Ee.delta));const ce=[...new Set(ie.items.map(Ee=>Ee.scorer))],ve=ce.length===1?ce[0]:null,Ne=new Map;for(const Ee of oe)Ne.has(Ee.scorer)||Ne.set(Ee.scorer,[]),Ne.get(Ee.scorer).push(Ee);const Ze=Ee=>{const ut=(h==null?void 0:h.type)===ie.type&&h.index===Ee.originalIndex,at=r==null?void 0:r.items[Ee.itemIndex],$e=o==null?void 0:o.items[Ee.itemIndex],bn=Ee.input?Cl(Ee.input,40):`Item #${Ee.itemIndex+1}`,Rn=fe?Ee.consistentCount===I?"":Ee.consistentCount===0?"opacity-40":"opacity-65":"";return n.jsxs("div",{className:Rn,children:[n.jsxs("button",{onClick:()=>C(ie.type,Ee.originalIndex),className:"w-full text-left flex items-center gap-3 px-4 py-2.5 text-xs hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:[fe&&n.jsxs("span",{className:Q("shrink-0 text-[10px] font-mono font-medium px-1.5 py-0.5 rounded",Ee.consistentCount===I?ie.type==="regression"?"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300":"bg-emerald-100 dark:bg-emerald-900/40 text-emerald-700 dark:text-emerald-300":"bg-[hsl(var(--muted))] text-[hsl(var(--muted-foreground))]"),children:[Ee.consistentCount,"/",I]}),n.jsxs("span",{className:"min-w-0 truncate flex-1",children:[n.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:["#",Ee.itemIndex+1]})," ",n.jsx("span",{children:bn})]}),n.jsxs("span",{className:Q("font-mono shrink-0",ie.deltaColor),children:[Ee.baselineScore.toFixed(2)," ","→"," ",Ee.candidateScore.toFixed(2)," ",n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",Ee.delta>0?"+":"",Ee.delta.toFixed(2),")"]})]})]}),ut&&at&&$e&&n.jsx(Ov,{baselineItem:at,candidateItem:$e,scorer:Ee.scorer,baselineRunItems:d==null?void 0:d.map(It=>It.items[Ee.itemIndex]).filter(Boolean),candidateRunItems:f==null?void 0:f.map(It=>It.items[Ee.itemIndex]).filter(Boolean)})]},Ee.originalIndex)},mt=5;let pe,Ce;if(fe){const Ee=Math.ceil(I/2);pe=oe.filter(ut=>ut.consistentCount>=Ee),Ce=oe.filter(ut=>ut.consistentCount<Ee)}else pe=oe.slice(0,mt),Ce=oe.slice(mt);const Ie=k[ie.type]??!1,Mt=fe?`${Ce.length} likely noise (minority of runs)`:`${Ce.length} more`,Gt=Ee=>{const ut=new Map;for(const at of Ee)ut.has(at.scorer)||ut.set(at.scorer,[]),ut.get(at.scorer).push(at);return ut},vn=Ee=>{if(ve)return n.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:Ee.map(Ze)});const ut=Gt(Ee);return n.jsx("div",{children:[...ut.entries()].map(([at,$e])=>n.jsxs("div",{children:[n.jsxs("div",{className:Q("px-4 py-2 border-b border-t border-[hsl(var(--border))]",ie.type==="regression"?"bg-red-50/30 dark:bg-red-950/5":"bg-emerald-50/30 dark:bg-emerald-950/5"),children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:at}),n.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-1.5",children:["(",$e.length,")"]})]}),n.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:$e.map(Ze)})]},at))})};return n.jsxs("div",{className:Q("border rounded-lg overflow-hidden",ie.borderColor),children:[n.jsx("div",{className:Q("px-4 py-2.5 border-b",ie.bgColor,ie.borderColor),children:n.jsxs("h3",{className:Q("text-xs font-medium",ie.textColor),children:[ie.label," (",pe.length,Ce.length>0?` + ${Ce.length} noise`:"",")",$&&n.jsxs("span",{className:"font-normal opacity-70 ml-1",children:[" — ","scores ",$]})]})}),pe.length>0?vn(pe):n.jsxs("div",{className:"px-4 py-3 text-xs text-[hsl(var(--muted-foreground))]",children:["No reliable ",ie.label.toLowerCase()," detected (all within noise)."]}),Ce.length>0&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>w(Ee=>({...Ee,[ie.type]:!Ie})),className:"w-full flex items-center justify-center gap-1.5 px-4 py-2 text-[11px] font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors border-t border-dashed border-[hsl(var(--border))] cursor-pointer",children:[Ie?n.jsx(ON,{className:"h-3 w-3"}):n.jsx(Ga,{className:"h-3 w-3"}),Ie?"Hide":"Show"," ",Mt]}),Ie&&vn(Ce)]})]},ie.type)}),r&&o&&n.jsx(Rk,{baseline:r,candidate:o,scorerNames:K.map(([ie])=>ie),baselineRuns:d??void 0,candidateRuns:f??void 0,scorerTypes:A})]})}function W0({label:s,item:r,scorer:o}){var f,h;const i=(f=r.scoreDetails)==null?void 0:f[o],d=typeof((h=i==null?void 0:i.metadata)==null?void 0:h.reasoning)=="string"?i.metadata.reasoning:null;return n.jsxs("div",{className:"p-4 space-y-3",children:[n.jsx("h5",{className:"font-medium text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px]",children:s}),n.jsx(Ct,{data:r.output,collapsed:!0}),(i==null?void 0:i.score)!=null&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Score:"}),n.jsx("span",{className:Q("px-2 py-0.5 rounded-full font-mono font-medium",Cc(i.score)),children:i.score.toFixed(3)})]}),d&&n.jsxs("div",{children:[n.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Reasoning"}),n.jsx("pre",{className:"text-xs font-mono p-2 rounded-md bg-[hsl(var(--secondary))] overflow-auto max-h-48 whitespace-pre-wrap leading-relaxed",children:d})]})]})}function Ov({baselineItem:s,candidateItem:r,scorer:o,baselineRunItems:i,candidateRunItems:d}){var w,C,A,_;const[f,h]=b.useState(0),m=i&&i.length>1||d&&d.length>1,p=Math.max((i==null?void 0:i.length)??1,(d==null?void 0:d.length)??1),x=m&&i?i[f]??s:s,v=m&&d?d[f]??r:r,y=(C=(w=s.scoreDetails)==null?void 0:w[o])==null?void 0:C.score,k=(_=(A=r.scoreDetails)==null?void 0:A[o])==null?void 0:_.score;return n.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[m&&(y!=null||k!=null)&&n.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[n.jsxs("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Mean across ",p," runs"]}),n.jsxs("div",{className:"flex items-center gap-3",children:[y!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Baseline:"}),n.jsx("span",{className:Q("font-mono font-medium",Dt(y)),children:y.toFixed(3)})]}),k!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Candidate:"}),n.jsx("span",{className:Q("font-mono font-medium",Dt(k)),children:k.toFixed(3)})]}),y!=null&&k!=null&&n.jsxs("span",{className:Q("font-mono",k-y>0?"text-emerald-600 dark:text-emerald-400":k-y<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]"),children:["(",k-y>0?"+":"",(k-y).toFixed(3),")"]})]})]}),m&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),n.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:p},(D,$)=>n.jsx("button",{onClick:()=>h($),className:Q("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",$===f?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:$+1},$))}),n.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-auto",children:["Showing output and reasoning from run ",f+1," of ",p]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[n.jsx("div",{className:"border-r border-[hsl(var(--border))]",children:n.jsx(W0,{label:"Baseline",item:x,scorer:o})}),n.jsx(W0,{label:"Candidate",item:v,scorer:o})]})]})}function Ac(s){const r=Date.now()-s;return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:new Date(s).toLocaleDateString()}function im(s){return s.data.dataset??""}function Lk(s){var r;return(r=s.data.metadata)==null?void 0:r.runGroupId}function $k(s){var d;const r=new Map,o=[];for(const f of s){const h=Lk(f);h?(r.has(h)||r.set(h,[]),r.get(h).push(f)):o.push(f)}const i=[];for(const[f,h]of r){if(h.length===1){o.push(h[0]);continue}const m=h[0].data,p=Object.keys(((d=m.summary)==null?void 0:d.scorers)??{}),x={};for(const v of p){const y=h.map(k=>{var w,C,A;return((A=(C=(w=k.data.summary)==null?void 0:w.scorers)==null?void 0:C[v])==null?void 0:A.mean)??0});x[v]={mean:y.reduce((k,w)=>k+w,0)/y.length}}i.push({type:"group",groupId:f,entries:h.sort((v,y)=>y.timestamp-v.timestamp),evalName:h[0].eval,timestamp:Math.max(...h.map(v=>v.timestamp)),dataset:im(h[0]),runCount:h.length,aggregateScorers:x})}for(const f of o)i.push({type:"single",entry:f});return i.sort((f,h)=>{const m=f.type==="group"?f.timestamp:f.entry.timestamp;return(h.type==="group"?h.timestamp:h.entry.timestamp)-m}),i}function cm({scorers:s}){const r=Object.entries(s);return r.length===0?null:n.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:r.map(([o,i])=>n.jsx("div",{className:"relative h-3.5 w-4 rounded-sm bg-[hsl(var(--muted))] overflow-hidden",title:`${o}: ${i.mean.toFixed(3)}`,children:n.jsx("div",{className:Q("absolute bottom-0 left-0 right-0 rounded-sm",zc(i.mean)),style:{height:`${Math.max(0,Math.min(100,i.mean*100))}%`}})},o))})}function Af({data:s}){var i;const r=(i=s.summary)==null?void 0:i.scorers;if(!r)return null;const o={};for(const[d,f]of Object.entries(r))o[d]={mean:f.mean};return n.jsx(cm,{scorers:o})}function Hk({selection:s,history:r,pickerItems:o,placeholder:i}){if(!s)return n.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:i});if(s.groupIds&&s.groupIds.length>1){const p=o.find(x=>x.type==="group"&&x.entries.some(v=>v.id===s.id));if(p&&p.type==="group"){const x=rm(p.entries);return n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx(cm,{scorers:p.aggregateScorers}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm font-medium truncate",children:p.evalName}),n.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300",children:[n.jsx(Jf,{className:"h-2.5 w-2.5"}),p.runCount," runs"]}),x.map(([v,y])=>n.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${v} — ${y} calls`,children:[_n(v)," ",n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",y,")"]})]},v))]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[n.jsx(N0,{className:"h-2.5 w-2.5"}),Ac(p.timestamp)]})]})]})}}const d=r.find(p=>p.id===s.id);if(!d)return n.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:i});const f=d.data,h=Qa(f),m=Os(f);return n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx(Af,{data:f}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-sm font-medium truncate",children:d.eval}),h.map(p=>n.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:m?`${p} — ${m[p]} calls`:p,children:[_n(p),m&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" (",m[p],")"]})]},p))]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[n.jsx(N0,{className:"h-2.5 w-2.5"}),Ac(d.timestamp),n.jsx("span",{className:"opacity-50",children:"·"}),n.jsx("span",{className:"font-mono",children:d.id.slice(0,8)})]})]})]})}function P0({label:s,selection:r,pickerItems:o,disabledSelection:i,history:d,onChange:f,filterDataset:h}){const[m,p]=b.useState(!1),[x,v]=b.useState(null),y=b.useRef(null);b.useEffect(()=>{function C(A){y.current&&!y.current.contains(A.target)&&(p(!1),v(null))}return m&&document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[m]);const k=h?o.filter(C=>C.type==="group"?C.dataset===h:im(C.entry)===h):o,w=new Set((i==null?void 0:i.groupIds)??(i?[i.id]:[]));return n.jsxs("div",{ref:y,className:"flex-1 min-w-0 relative",children:[n.jsx("label",{className:"block text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-1.5",children:s}),n.jsxs("button",{onClick:()=>{p(!m),v(null)},className:Q("w-full px-3 py-2 rounded-lg border text-left flex items-center justify-between gap-2 transition-colors min-h-[44px] cursor-pointer",m?"border-[hsl(var(--foreground))] ring-1 ring-[hsl(var(--foreground))]":"border-[hsl(var(--input))] hover:border-[hsl(var(--foreground))/30]","bg-[hsl(var(--background))]"),children:[n.jsx(Hk,{selection:r,history:d,pickerItems:o,placeholder:`Select ${s.toLowerCase()}...`}),n.jsx(Ga,{className:Q("h-3.5 w-3.5 shrink-0 text-[hsl(var(--muted-foreground))] transition-transform",m&&"rotate-180")})]}),m&&n.jsx("div",{className:"absolute z-50 top-full left-0 right-0 mt-1 max-h-72 overflow-y-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--background))] shadow-lg",children:k.length===0?n.jsx("div",{className:"px-3 py-4 text-xs text-center text-[hsl(var(--muted-foreground))]",children:"No matching runs"}):k.map(C=>{var T;if(C.type==="group"){const j=x===C.groupId,S=(T=r==null?void 0:r.groupIds)==null?void 0:T.some(E=>C.entries.some(B=>B.id===E));return n.jsxs("div",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[n.jsxs("div",{className:"flex items-stretch",children:[n.jsxs("button",{onClick:()=>{f({id:C.entries[0].id,groupIds:C.entries.map(E=>E.id)}),p(!1),v(null)},className:Q("flex-1 text-left px-3 py-2.5 flex items-center gap-2.5 transition-colors cursor-pointer",S?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"),children:[n.jsx(cm,{scorers:C.aggregateScorers}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-xs font-medium truncate",children:C.evalName}),n.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-medium bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300",children:[n.jsx(Jf,{className:"h-2 w-2"}),C.runCount," runs"]}),rm(C.entries).map(([E,B])=>n.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${E} — ${B} calls`,children:[_n(E)," ",n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",B,")"]})]},E))]}),n.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[Ac(C.timestamp),n.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),"pooled comparison"]})]}),S&&n.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]}),n.jsx("button",{onClick:E=>{E.stopPropagation(),v(j?null:C.groupId)},className:"shrink-0 w-8 flex items-center justify-center border-l border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:j?"Hide individual runs":"Show individual runs",children:j?n.jsx(Ga,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"}):n.jsx(Kn,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"})})]}),j&&C.entries.map(E=>{var K;const B=E.data,te=(r==null?void 0:r.id)===E.id&&!(r!=null&&r.groupIds),q=w.has(E.id);return n.jsxs("button",{onClick:()=>{f({id:E.id}),p(!1),v(null)},disabled:q,className:Q("w-full text-left pl-8 pr-3 py-2 flex items-center gap-2.5 transition-colors border-t border-[hsl(var(--border))] cursor-pointer","bg-[hsl(var(--muted))]/30",te?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",q&&"opacity-30 cursor-not-allowed"),children:[n.jsx(Af,{data:B}),n.jsx("div",{className:"min-w-0 flex-1",children:n.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[n.jsxs("span",{children:["Run ",(((K=B.metadata)==null?void 0:K.runIndex)??0)+1]}),n.jsx("span",{className:"opacity-50",children:"·"}),n.jsx("span",{className:"font-mono",children:E.id.slice(0,8)}),(()=>{const F=Os(B);return Qa(B).map(re=>n.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[9px]",title:F?`${re} — ${F[re]} calls`:re,children:[_n(re),F&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",F[re],")"]})]},re))})()]})}),te&&n.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},E.id)})]},C.groupId)}const{entry:A}=C,_=A.data,D=(r==null?void 0:r.id)===A.id,$=w.has(A.id);return n.jsxs("button",{onClick:()=>{f({id:A.id}),p(!1),v(null)},disabled:$,className:Q("w-full text-left px-3 py-2.5 flex items-center gap-2.5 transition-colors border-b border-[hsl(var(--border))] last:border-b-0 cursor-pointer",D?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",$&&"opacity-30 cursor-not-allowed"),children:[n.jsx(Af,{data:_}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-xs font-medium truncate",children:A.eval}),(()=>{const j=Os(_);return Qa(_).map(S=>n.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:j?`${S} — ${j[S]} calls`:S,children:[_n(S),j&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",j[S],")"]})]},S))})()]}),n.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[Ac(A.timestamp),n.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),n.jsx("span",{className:"font-mono",children:A.id.slice(0,8)}),n.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),_.summary.count," items"]})]}),D&&n.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},A.id)})})]})}function qk({history:s,baselineSelection:r,candidateSelection:o,onBaselineChange:i,onCandidateChange:d,onCompare:f,comparing:h}){const m=b.useMemo(()=>$k(s),[s]),p=r?s.find(y=>y.id===r.id):null,x=p?im(p):null,v=r!=null&&o!=null&&r.id!==o.id&&!h;return n.jsx("div",{className:"space-y-3",children:n.jsxs("div",{className:"flex items-end gap-2",children:[n.jsx(P0,{label:"Baseline",selection:r,pickerItems:m,disabledSelection:o,history:s,onChange:i,filterDataset:null}),n.jsx("button",{onClick:()=>{if(r&&o){const y=r;i(o),d(y)}},disabled:!r||!o,className:"shrink-0 p-2 rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors mb-[1px] cursor-pointer",title:"Swap baseline and candidate",children:n.jsx(bN,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"})}),n.jsx(P0,{label:"Candidate",selection:o,pickerItems:m,disabledSelection:r,history:s,onChange:d,filterDataset:x}),n.jsx("button",{onClick:f,disabled:!v,className:Q("shrink-0 px-5 py-2 text-sm font-medium rounded-lg transition-all cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))]","hover:opacity-90 disabled:opacity-40"),children:h?"Comparing…":"Compare"})]})})}function Bk({currentIndex:s,totalRuns:r,aggregate:o,onIndexChange:i}){const d=s===-1,f=s>-1,h=s<r-1;return n.jsx("div",{className:"px-6",children:n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 rounded-lg bg-[hsl(var(--muted))]",children:[n.jsx("button",{onClick:()=>i(s-1),disabled:!f,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:n.jsx(MN,{size:16})}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"text-sm font-medium",children:d?`Aggregate (${r} runs)`:`Run ${s+1} of ${r}`}),!d&&n.jsx("button",{onClick:()=>i(-1),className:"ml-3 text-xs text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] underline transition-colors cursor-pointer",children:"View aggregate"}),d&&(()=>{const m=Object.values(o.scorers),p=m.reduce((x,v)=>x+v.mean,0)/Math.max(m.length,1);return n.jsxs("div",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Overall mean: ",p.toFixed(3)," across ",m.length," scorer",m.length!==1?"s":"",o.accounting&&n.jsxs("span",{className:"ml-2 inline-flex items-center gap-1",children:[n.jsx("span",{"aria-hidden":"true",children:"·"}),n.jsx(sn,{accounting:o.accounting,label:"Group known spend"}),(o.budgetStoppedRuns??0)>0&&n.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",title:`${o.budgetStoppedRuns} run(s) in this group stopped on budget`,children:"budget stopped"})]})]})})()]}),n.jsx("button",{onClick:()=>i(s+1),disabled:!h,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:n.jsx(Kn,{size:16})})]})})}function Gk(s){var f;const r={},o=[];for(const h of s){const m=h.data;if(!((f=m.summary)!=null&&f.scorers))continue;const p=[];for(const[x,v]of Object.entries(m.summary.scorers))r[x]||(r[x]=[]),r[x].push(v.mean),p.push(v.mean);p.length>0&&o.push(p.reduce((x,v)=>x+v,0)/p.length)}const i={};for(const[h,m]of Object.entries(r)){const p=m.reduce((v,y)=>v+y,0)/m.length,x=m.length>1?Math.sqrt(m.reduce((v,y)=>v+(y-p)**2,0)/(m.length-1)):0;i[h]={mean:p,std:x}}let d=null;if(o.length>0){const h=o.reduce((p,x)=>p+x,0)/o.length,m=o.length>1?Math.sqrt(o.reduce((p,x)=>p+(x-h)**2,0)/(o.length-1)):0;d={mean:h,std:m}}return{scorers:i,overall:d}}function Qk(s){const r=s.eval.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"eval",o=s.id.slice(0,8),i=new Date(s.timestamp).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z"),d=`${r}-${o}-${i}.json`,f=JSON.stringify(s.data,null,2),h=new Blob([f],{type:"application/json"}),m=URL.createObjectURL(h),p=document.createElement("a");p.href=m,p.download=d,document.body.appendChild(p),p.click(),document.body.removeChild(p),setTimeout(()=>URL.revokeObjectURL(m),0)}function Yk({history:s,evalFilter:r,onEvalFilterChange:o,onSelect:i,onSelectGroup:d,onRescore:f,onDelete:h,registeredEvalNames:m,readOnly:p,expandedGroups:x,onToggleGroup:v}){const[y,k]=b.useState(null),w=[...new Set(s.map(j=>j.eval))].sort(),C=b.useMemo(()=>r?s.filter(j=>j.eval===r):s,[s,r]),{rows:A,scorerCols:_}=b.useMemo(()=>{var te,q;const j=new Map,S=[];for(const K of C){const re=(te=K.data.metadata)==null?void 0:te.runGroupId;re?(j.has(re)||j.set(re,[]),j.get(re).push(K)):S.push(K)}const E=[];for(const[K,F]of j)F.sort((re,we)=>we.timestamp-re.timestamp),F.length===1?E.push({type:"entry",entry:F[0]}):E.push({type:"group",groupId:K,entries:F,evalName:F[0].eval,newestTimestamp:F[0].timestamp});for(const K of S)E.push({type:"entry",entry:K});E.sort((K,F)=>{const re=K.type==="group"?K.newestTimestamp:K.entry.timestamp;return(F.type==="group"?F.newestTimestamp:F.entry.timestamp)-re});const B=new Set;for(const K of C){const F=K.data;if((q=F.summary)!=null&&q.scorers)for(const re of Object.keys(F.summary.scorers))B.add(re)}return{rows:E,scorerCols:[...B].sort()}},[C]),D=b.useMemo(()=>{var S;const j={};for(const E of C){const te=(S=E.data.metadata)==null?void 0:S.scorerTypes;te&&Object.assign(j,te)}return j},[C]),$=8+_.length+(f?1:0),T=(j,S,E)=>{const B=j.data,te=y===j.id;return n.jsxs(b.Fragment,{children:[n.jsxs("tr",{"data-entry-id":j.id,className:Q("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",E&&!S&&"bg-[hsl(var(--accent))]/30",te&&"bg-[hsl(var(--accent))]/40"),onClick:()=>k(te?null:j.id),children:[n.jsx("td",{className:Q("px-3 py-2.5 font-mono",S&&"pl-9"),children:n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[S&&n.jsx("span",{className:"inline-block w-1 h-3 mr-0.5 rounded-sm bg-[hsl(var(--border))]"}),j.eval]}),(()=>{const q=dl(B);if(q.length===0||q.length===1&&q[0]===j.eval)return null;const K=Tf(B),F=K?`Workflows: ${q.map(re=>`${re} (${K[re]??"?"} calls)`).join(", ")}`:`Workflows: ${q.join(", ")}`;return n.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px]",title:F,children:q.join(" · ")})})()]})}),n.jsx("td",{className:"px-3 py-2.5",children:(()=>{const q=Qa(B);if(q.length===0)return n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"});const K=Os(B);return n.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:q.map(F=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:K?`${F} — ${K[F]} calls`:F,children:[_n(F),K&&K[F]!=null&&n.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",K[F],")"]})]},F))})})()}),n.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(j.timestamp).toLocaleString()}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:B.summary.count}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:(()=>{var re;const q=(re=B.summary.coverage)==null?void 0:re.items,K=q?q.failed:B.summary.failures,F=q?`${q.failed} failed, ${q.cancelled} cancelled, ${q.budget_skipped} budget-skipped, ${q.budget_interrupted} budget-interrupted. This column is the legacy count of items carrying an error string, which includes all of them.`:"Legacy count of items carrying an error string — includes cancelled and budget-stopped items.";return n.jsx("span",{title:F,className:K>0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]",children:B.summary.failures})})()}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:B.duration>0?ht(B.duration):"-"}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:n.jsxs("span",{className:"inline-flex items-center gap-1 justify-end",children:[n.jsx(sn,{accounting:Ol(B)}),n.jsx(Mv,{result:B}),n.jsx(gk,{result:B})]})}),(()=>{var F;const q=Object.values(((F=B.summary)==null?void 0:F.scorers)??{}).map(re=>re.mean),K=q.length>0?q.reduce((re,we)=>re+we,0)/q.length:null;return n.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:K!=null?n.jsx("span",{className:Dt(K),children:K.toFixed(3)}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})})})(),_.map(q=>{var F,re;const K=(re=(F=B.summary)==null?void 0:F.scorers)==null?void 0:re[q];return n.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:K?n.jsxs("div",{children:[n.jsx("span",{className:Dt(K.mean),children:K.mean.toFixed(3)}),K.min!==K.max&&n.jsxs("div",{className:"text-[9px] text-[hsl(var(--muted-foreground))]",children:[K.min.toFixed(2),"–",K.max.toFixed(2)]})]}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},q)}),f&&n.jsx("td",{className:"px-3 py-2.5"})]}),te&&(()=>{var F,re,we;const q=(F=B.metadata)==null?void 0:F.scorerTypes,K=(re=B.metadata)==null?void 0:re.originalId;return n.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:n.jsx("td",{colSpan:$,className:"px-4 py-3",children:n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-[hsl(var(--muted-foreground))] flex-wrap",children:[n.jsxs("span",{children:["ID: ",n.jsx("span",{className:"font-mono",children:B.id.slice(0,8)})]}),n.jsxs("span",{children:["Dataset:"," ",n.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:B.dataset})]}),(()=>{const me=dl(B);return me.length===0?null:n.jsxs("span",{children:[me.length>1?"Workflows":"Workflow",":"," ",n.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:me.join(", ")})]})})(),(()=>{const me=Qa(B);if(me.length===0)return null;const Z=Os(B);return n.jsx("span",{className:"inline-flex items-center gap-1",children:me.map(M=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono",title:Z?`${M} — ${Z[M]} calls`:M,children:[_n(M),Z&&Z[M]!=null&&n.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",Z[M],")"]})]},M))})})(),!!((we=B.metadata)!=null&&we.rescored)&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:"Rescored"}),K&&n.jsxs("span",{children:["from"," ",n.jsx("button",{onClick:me=>{me.stopPropagation(),k(K),requestAnimationFrame(()=>{var Z;(Z=document.querySelector(`[data-entry-id="${CSS.escape(K)}"]`))==null||Z.scrollIntoView({behavior:"smooth",block:"center"})})},className:"font-mono underline hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:K.slice(0,8)})]}),q&&Object.keys(q).length>0&&n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Scorers:",Object.entries(q).sort(([me],[Z])=>me.localeCompare(Z)).map(([me,Z])=>n.jsx("span",{className:Q("px-1.5 py-0.5 rounded font-mono cursor-default",Z==="llm"?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400":"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"),title:Z==="llm"?`${me} — LLM scorer (scores may vary between runs)`:`${me} — deterministic scorer`,children:me},me))]})]}),n.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f&&(()=>{const me=!m||m.has(j.eval),Z=me&&!p,M=p?"Rescore unavailable — Studio is mounted in read-only mode.":me?"Re-run scorers on saved outputs without re-executing the workflow":`Rescore unavailable — no registered eval named "${j.eval}". Imported CLI artifacts can only be rescored when the runtime has a matching registered eval config.`;return n.jsx("button",{onClick:R=>{R.stopPropagation(),Z&&f(j.eval,j.id)},disabled:!Z,className:Q("px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] transition-colors",Z?"hover:bg-[hsl(var(--accent))] cursor-pointer":"opacity-40 cursor-not-allowed"),title:M,children:"Rescore"})})(),n.jsx("button",{onClick:me=>{me.stopPropagation(),Qk(j)},className:"p-1 rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors",title:`Export this result as JSON (${j.eval}-${j.id.slice(0,8)}-...json)`,"aria-label":"Export result as JSON",children:n.jsx(BN,{size:12})}),h&&n.jsx("button",{onClick:me=>{me.stopPropagation(),!p&&h(j)},disabled:p,className:Q("p-1 rounded border border-[hsl(var(--input))] transition-colors",p?"opacity-40 cursor-not-allowed":"hover:bg-red-50 hover:border-red-200 hover:text-red-600 dark:hover:bg-red-950/30 dark:hover:border-red-900 dark:hover:text-red-400 cursor-pointer"),title:p?"Delete unavailable — Studio is mounted in read-only mode.":"Delete this history entry","aria-label":"Delete history entry",children:n.jsx(Pf,{size:12})}),n.jsxs("button",{onClick:me=>{me.stopPropagation(),i(B)},className:"inline-flex items-center gap-1 px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:"Open full run details in the Run tab",children:["View Details",n.jsx(wl,{size:10})]})]})]})})})})()]},j.id)};return n.jsxs("div",{children:[w.length>1&&n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsxs("select",{value:r,onChange:j=>o(j.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[n.jsx("option",{value:"",children:"All evals"}),w.map(j=>n.jsx("option",{value:j,children:j},j))]}),r&&n.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[C.length," run",C.length!==1?"s":""]})]}),n.jsx("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[n.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Eval"}),n.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Model"}),n.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Timestamp"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Items"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Failures"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Duration"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Cost"}),n.jsx("th",{className:"text-right px-3 py-2.5 font-medium border-l border-[hsl(var(--border))]",children:"Overall"}),_.map(j=>n.jsxs("th",{className:"text-right px-3 py-2.5 font-medium font-mono whitespace-nowrap",title:j,children:[j,D[j]==="llm"&&n.jsx("span",{className:"ml-1 px-1 py-0.5 text-[9px] font-medium rounded bg-purple-100 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400 align-middle",title:"LLM scorer — scores may vary between runs",children:"LLM"})]},j)),f&&n.jsx("th",{className:"px-3 py-2.5 font-medium w-8"})]})}),n.jsx("tbody",{children:A.map((j,S)=>{if(j.type==="group"){const E=x.has(j.groupId),B=Gk(j.entries),te=B.scorers,q=j.entries.reduce((Z,M)=>Z+M.data.summary.count,0),K=(()=>{var Z;for(const M of j.entries){const R=(Z=M.data.metadata)==null?void 0:Z.batchAttempted;if(typeof R=="number")return R}})(),F=K!==void 0&&j.entries.length<K,re=j.entries.reduce((Z,M)=>Z+M.data.duration,0),we=zo(j.entries.map(Z=>Z.data)),me=j.entries.some(Z=>Xo(Z.data));return n.jsxs(b.Fragment,{children:[n.jsxs("tr",{className:Q("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",S===0&&"bg-[hsl(var(--accent))]/30"),onClick:()=>v(j.groupId),children:[n.jsx("td",{className:"px-3 py-2.5 font-mono",children:n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("span",{className:"shrink-0 p-0.5 -m-0.5",children:E?n.jsx(Ga,{size:14}):n.jsx(Kn,{size:14})}),j.evalName]}),(()=>{const Z=new Set,M=[];for(const R of j.entries)for(const ne of dl(R.data))Z.has(ne)||(Z.add(ne),M.push(ne));return M.length===0||M.length===1&&M[0]===j.evalName?null:n.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px] pl-[22px]",title:`Workflows: ${M.join(", ")}`,children:M.join(" · ")})})()]})}),n.jsx("td",{className:"px-3 py-2.5",children:(()=>{const Z=rm(j.entries);return Z.length===0?n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"}):n.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:Z.map(([M,R])=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:`${M} — ${R} calls`,children:[_n(M),n.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",R,")"]})]},M))})})()}),n.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(j.newestTimestamp).toLocaleString()}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:q}),n.jsx("td",{className:"px-3 py-2.5 text-right",children:n.jsxs("span",{className:Q("inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md",F?"bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200":"bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]"),title:F?`Partial batch — ${j.entries.length} of ${K} runs completed`:void 0,children:[n.jsx(Jf,{size:10}),F?n.jsxs(n.Fragment,{children:[j.entries.length,"/",K," runs",n.jsx("span",{className:"font-medium uppercase tracking-wide text-[9px] ml-1",children:"partial"})]}):n.jsxs(n.Fragment,{children:[j.entries.length," runs"]})]})}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:re>0?ht(re):"-"}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:n.jsxs("span",{className:"inline-flex items-center gap-1 justify-end",children:[n.jsx(sn,{accounting:we,label:"Group known spend"}),me&&n.jsx("span",{title:"At least one run in this group stopped on budget — the group covers less work than a complete batch.","aria-label":"Budget stopped",className:"inline-flex items-center px-1.5 py-0.5 rounded-md text-[9px] font-medium uppercase tracking-wide bg-amber-100 text-amber-900 dark:bg-amber-950/60 dark:text-amber-200",children:"budget stopped"})]})}),n.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:B.overall?n.jsxs("span",{className:Dt(B.overall.mean),children:[B.overall.mean.toFixed(3),B.overall.std>0&&n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal",children:[" ± ",B.overall.std.toFixed(3)]})]}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})}),_.map(Z=>{const M=te[Z];return n.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:M?n.jsxs("span",{className:Dt(M.mean),children:[M.mean.toFixed(3),n.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" "," ± ",M.std.toFixed(3)]})]}):n.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},Z)}),f&&n.jsx("td",{className:"px-3 py-2.5"})]}),E&&n.jsxs(n.Fragment,{children:[d&&n.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:n.jsx("td",{colSpan:$,className:"px-4 py-2.5",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[j.entries.length," runs in this group"]}),n.jsxs("button",{onClick:Z=>{Z.stopPropagation(),d(j.entries)},className:"inline-flex items-center gap-1 px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",title:"View combined statistics across all runs in this group",children:["View Aggregate",n.jsx(wl,{size:10})]})]})})}),j.entries.map(Z=>T(Z,!0,!1))]})]},j.groupId)}return T(j.entry,!1,S===0)})})]})})})]})}const _f=1,Of=25,Kk=5,hc=s=>Math.max(_f,Math.min(Of,Math.round(s)));function Vk({evals:s,selectedEval:r,onSelectEval:o,runCount:i,onRunCountChange:d,captureTraces:f,onCaptureTracesChange:h,running:m,onRun:p}){return n.jsxs("div",{className:Q("inline-flex items-stretch rounded-full bg-[hsl(var(--background))]","ring-1 ring-[hsl(var(--input))] shadow-sm","hover:ring-[hsl(var(--ring))] focus-within:ring-[hsl(var(--ring))]","transition-shadow"),children:[n.jsx(Do,{items:s,value:r,onSelect:o,getKey:x=>x.name,getLabel:x=>x.name,getDescription:x=>n.jsxs(n.Fragment,{children:[n.jsx("span",{children:x.workflow}),n.jsx("span",{className:"opacity-40 mx-1",children:"·"}),n.jsx("span",{children:x.dataset}),n.jsx("span",{className:"opacity-40 mx-1",children:"·"}),n.jsxs("span",{children:[x.scorers.length," scorer",x.scorers.length!==1?"s":""]})]}),searchMatch:(x,v)=>x.name.toLowerCase().includes(v)||x.workflow.toLowerCase().includes(v)||x.dataset.toLowerCase().includes(v),placeholder:"Select eval",searchPlaceholder:"Search evals…",emptyLabel:"No evals registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an eval"}),n.jsx(Xk,{value:i,onChange:d,disabled:m}),n.jsx("button",{type:"button",role:"switch","aria-checked":f,"aria-label":"Capture per-item trace events",onClick:()=>h(!f),disabled:m,title:f?"Capturing per-item traces (click to disable) — traces appear inline on each item":"Capture per-item traces — extra memory, but lets you inspect every event per item",className:Q("flex items-center px-2 border-l border-[hsl(var(--input))] transition-colors cursor-pointer","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed",f?"text-[hsl(var(--foreground))] bg-[hsl(var(--muted))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]"),children:n.jsx(Rc,{size:12,strokeWidth:2.5})}),n.jsxs("button",{type:"button",onClick:p,disabled:!r||m,className:Q("inline-flex items-center gap-1.5 pl-3.5 pr-4 py-2 text-sm font-medium cursor-pointer","bg-[hsl(var(--foreground))] text-[hsl(var(--background))] rounded-r-full","hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-[hsl(var(--foreground))]","disabled:opacity-40 disabled:cursor-not-allowed transition-opacity"),children:[n.jsx(Wf,{size:12,className:Q("fill-current",m&&"animate-spin fill-none")}),m?"Running…":"Run"]})]})}function Xk({value:s,onChange:r,disabled:o=!1}){const[i,d]=b.useState(!1),[f,h]=b.useState(""),m=b.useRef(null),p=b.useRef(!1),x=b.useCallback((D,$)=>{const T=($?Kk:1)*D;r(hc(s+T))},[s,r]),v=b.useCallback(()=>{o||(p.current=!1,h(String(s)),d(!0))},[s,o]);b.useEffect(()=>{i||h(String(s))},[s,i]),b.useEffect(()=>{i&&requestAnimationFrame(()=>{var D,$;(D=m.current)==null||D.focus(),($=m.current)==null||$.select()})},[i]);const y=b.useCallback(()=>{if(p.current){d(!1);return}p.current=!0;const D=parseInt(f,10);Number.isNaN(D)||r(hc(D)),d(!1)},[f,r]),k=b.useCallback(()=>{p.current=!0,d(!1)},[]),w=b.useCallback(D=>{if(D.key==="Enter")D.preventDefault(),y();else if(D.key==="Escape")D.preventDefault(),k();else if(D.key==="ArrowUp"){D.preventDefault();const $=parseInt(f,10);Number.isNaN($)||h(String(hc($+1)))}else if(D.key==="ArrowDown"){D.preventDefault();const $=parseInt(f,10);Number.isNaN($)||h(String(hc($-1)))}},[y,k,f]),C=b.useCallback(D=>{o||(D.key==="Enter"||D.key===" "?(D.preventDefault(),v()):D.key==="ArrowUp"?(D.preventDefault(),x(1,D.shiftKey)):D.key==="ArrowDown"&&(D.preventDefault(),x(-1,D.shiftKey)))},[o,v,x]),A=s<=_f,_=s>=Of;return n.jsxs("div",{className:"flex items-stretch border-l border-[hsl(var(--input))]",role:"group","aria-label":"Run count",children:[n.jsx("button",{type:"button",onClick:D=>x(-1,D.shiftKey),disabled:o||A,title:"Decrease runs — Shift+click: −5","aria-label":"Decrease run count",className:Q("flex items-center px-1.5 transition-colors cursor-pointer","text-[hsl(var(--muted-foreground))]","hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[hsl(var(--muted-foreground))]"),children:n.jsx(WN,{size:12,strokeWidth:2.5})}),i?n.jsx("input",{ref:m,type:"text",inputMode:"numeric",value:f,onChange:D=>h(D.target.value.replace(/[^0-9]/g,"").slice(0,2)),onKeyDown:w,onBlur:y,"aria-label":"Run count",className:Q("w-10 text-center text-xs font-semibold tabular-nums bg-transparent","focus:outline-none text-[hsl(var(--foreground))]")}):n.jsxs("button",{type:"button",role:"spinbutton","aria-valuenow":s,"aria-valuemin":_f,"aria-valuemax":Of,"aria-valuetext":`${s} run${s!==1?"s":""}`,onClick:v,onKeyDown:C,disabled:o,title:"Click or press Enter to type a value — Arrow keys step","aria-label":`Run count: ${s}. Press Enter to edit, arrow keys to step.`,className:Q("flex items-center justify-center min-w-[2.5rem] px-1 text-xs tabular-nums cursor-text","transition-colors hover:bg-[hsl(var(--muted))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-60 disabled:cursor-not-allowed",s>1?"text-[hsl(var(--foreground))] font-semibold":"text-[hsl(var(--muted-foreground))]"),children:[n.jsx("span",{className:"opacity-50 mr-0.5",children:"×"}),s]}),n.jsx("button",{type:"button",onClick:D=>x(1,D.shiftKey),disabled:o||_,title:"Increase runs — Shift+click: +5","aria-label":"Increase run count",className:Q("flex items-center px-1.5 transition-colors cursor-pointer","text-[hsl(var(--muted-foreground))]","hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]","focus:outline-none focus-visible:bg-[hsl(var(--muted))]","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[hsl(var(--muted-foreground))]"),children:n.jsx(Wg,{size:12,strokeWidth:2.5})})]})}function Fk(){var Zo,Jo,zl,Fa,wr,pa;const s=Go(),[r,o]=b.useState("run"),[i,d]=b.useState(""),f=Sw(),h=f.status==="running",[m,p]=b.useState(null),[x,v]=b.useState(null),[y,k]=b.useState(null),[w,C]=b.useState(1),[A,_]=b.useState(!0),[D,$]=b.useState(-1),[T,j]=b.useState(new Set),[S,E]=b.useState(null),[B,te]=b.useState(0),[q,K]=b.useState(null),[F,re]=b.useState("all"),[we,me]=b.useState(""),[Z,M]=b.useState(""),[R,ne]=b.useState("index"),[je,xe]=b.useState("asc"),[O,G]=b.useState("mean"),[P,le]=b.useState("asc"),[he,ie]=b.useState(""),[fe,I]=b.useState(!1),[oe,ce]=b.useState(null),[ve,Ne]=b.useState(null),[Ze,mt]=b.useState(null),[pe,Ce]=b.useState(null),[Ie,Mt]=b.useState(null),[Gt,vn]=b.useState(null),[Ee,ut]=b.useState(null),{data:at=[]}=ln({queryKey:["evals"],queryFn:US}),{data:$e=[]}=ln({queryKey:["evalHistory"],queryFn:LS}),{data:bn,isLoading:Rn,isError:It}=ln({queryKey:["health"],queryFn:xS,staleTime:1/0}),Zt=!!(bn!=null&&bn.readOnly),Vn=(!Rn||It)&&!Zt,Ds=b.useRef(null),[zs,yn]=b.useState(!1),[_e,jt]=b.useState(null);b.useEffect(()=>{if(!_e)return;const W=setTimeout(()=>jt(null),6e3);return()=>clearTimeout(W)},[_e]),b.useEffect(()=>{if(x!=="Cancelled")return;const W=setTimeout(()=>v(null),4e3);return()=>clearTimeout(W)},[x]);const zt=b.useCallback(async W=>{var ue;v(null),jt(null),yn(!0);try{const de=await W.text();let ye;try{ye=JSON.parse(de)}catch{throw new Error(`${W.name} is not valid JSON`)}const be=await BS(ye),Ge="imported"in be?be.imported:[be],Oe=Ge.length,ze=(ue=Ge[0])==null?void 0:ue.id;await s.invalidateQueries({queryKey:["evalHistory"]});const Je=Oe>1?` (${Oe} runs)`:"";if(!ze)throw new Error("Import succeeded but no entries were returned");pe?Ie?jt(`Imported ${W.name}${Je} — added to history (both compare slots full)`):(Mt({id:ze}),jt(`Imported ${W.name}${Je} — selected as candidate`)):(Ce({id:ze}),jt(`Imported ${W.name}${Je} — selected as baseline`))}catch(de){v(de instanceof Error?de.message:String(de))}finally{yn(!1)}},[s,pe,Ie]);b.useEffect(()=>{var be;if(pe||Ie||$e.length<2)return;const W=$e[0].eval,ue=$e.filter(Ge=>Ge.eval===W);if(ue.length<2)return;const de=new Set,ye=[];for(const Ge of ue){const Oe=(be=Ge.data.metadata)==null?void 0:be.runGroupId,ze=Oe??Ge.id;if(!de.has(ze)){if(de.add(ze),Oe){const Je=ue.filter(dt=>{var pt;return((pt=dt.data.metadata)==null?void 0:pt.runGroupId)===Oe}).map(dt=>dt.id);Je.length>1?ye.push({id:Je[0],groupIds:Je}):ye.push({id:Je[0]})}else ye.push({id:Ge.id});if(ye.length>=2)break}}ye.length>=2&&(Mt(ye[0]),Ce(ye[1]))},[$e,pe,Ie]);const jn=at.find(W=>W.name===i),Ya=b.useMemo(()=>new Set(at.map(W=>W.name)),[at]),He=m==null?void 0:m._multiRun,Nn=He!=null&&D===-1,Ue=He&&D>=0?He.allRuns[D]:m;b.useEffect(()=>{k(null)},[D]);const Ka=b.useRef(f.status);b.useEffect(()=>{if(Ka.current!==f.status)if(Ka.current=f.status,f.status==="done"&&f.done){const{evalResultId:W,runGroupId:ue}=f.done;(async()=>{try{await s.refetchQueries({queryKey:["evalHistory"]});const de=s.getQueryData(["evalHistory"])??[],ye=de.find(be=>be.id===W);if(!ye){v(`Eval completed but result ${W} was not found in history.`);return}if(ue){const Ge=de.filter(ze=>{var Je;return((Je=ze.data.metadata)==null?void 0:Je.runGroupId)===ue}).map(ze=>ze.data),Oe=G0(Ge);p(Oe??ye.data)}else p(ye.data);k(null),$(-1)}catch(de){v(de instanceof Error?de.message:String(de))}finally{z0()}})()}else f.status==="error"&&f.error&&(Ka.current!=="done"&&v(f.error),s.invalidateQueries({queryKey:["evalHistory"]}),z0())},[f.status,f.done,f.error,s]);const ma=b.useCallback(async()=>{if(i){v(null),p(null),k(null),$(-1);try{await ww(i,w,A)}catch(W){v(W instanceof Error?W.message:String(W))}}},[i,w,A]),yr=b.useCallback(async()=>{if(!(!pe||!Ie)){I(!0),ce(null);try{const W=Oe=>Oe.groupIds&&Oe.groupIds.length>1?Oe.groupIds:Oe.id,ue=W(pe),de=W(Ie),ye=Oe=>{var $s;const ze=$e.find($t=>$t.id===Oe.id);if(!ze)return null;const Je=ze.data;if(!Oe.groupIds||Oe.groupIds.length<=1)return Je;const dt=Oe.groupIds.map($t=>{var Ht;return(Ht=$e.find(Hs=>Hs.id===$t))==null?void 0:Ht.data}).filter($t=>$t!=null),pt=Math.min(...dt.map($t=>$t.items.length)),kr=Object.keys((($s=Je.summary)==null?void 0:$s.scorers)??{}),xa=Array.from({length:pt},($t,Ht)=>{const Hs={},Wo={};for(const qs of kr){const Cr=dt.map(Gs=>{var Qt;return(Qt=Gs.items[Ht])==null?void 0:Qt.scores[qs]}).filter(Gs=>Gs!=null),Bs=Cr.length>0?Math.round(Cr.reduce((Gs,Qt)=>Gs+Qt,0)/Cr.length*1e3)/1e3:null;Hs[qs]=Bs,Wo[qs]={score:Bs}}return{...Je.items[Ht],scores:Hs,scoreDetails:Wo}});return{...Je,items:xa}};Ne(ye(pe)),mt(ye(Ie));const be=Oe=>!Oe.groupIds||Oe.groupIds.length<=1?null:Oe.groupIds.map(ze=>{var Je;return(Je=$e.find(dt=>dt.id===ze))==null?void 0:Je.data}).filter(ze=>ze!=null);vn(be(pe)),ut(be(Ie));const Ge=await qS(ue,de);ce(Ge)}catch(W){v(W instanceof Error?W.message:String(W))}finally{I(!1)}}},[$e,pe,Ie]),Us=b.useCallback(async(W,ue)=>{v(null);try{const de=await HS(W,ue);p(de),k(null),$(-1),o("run"),s.invalidateQueries({queryKey:["evalHistory"]})}catch(de){v(de instanceof Error?de.message:String(de))}},[s]),Lc=b.useCallback(async W=>{var ye;v(null);const ue=W.id.slice(0,8);if(window.confirm(`Delete this eval history entry?
|
|
314
|
+
|
|
315
|
+
${W.eval} (${ue})
|
|
316
|
+
|
|
317
|
+
This cannot be undone.`))try{await GS(W.id);const be=Ge=>{var Oe;return Ge?Ge.id===W.id?!0:!!((Oe=Ge.groupIds)!=null&&Oe.includes(W.id)):!1};if(be(pe)&&Ce(null),be(Ie)&&Mt(null),m){const Ge=m.id===W.id,Oe=!!((ye=m._multiRun)!=null&&ye.allRuns.some(ze=>ze.id===W.id));(Ge||Oe)&&(p(null),k(null),$(-1),E(null))}s.invalidateQueries({queryKey:["evalHistory"]})}catch(be){v(be instanceof Error?be.message:String(be))}},[s,pe,Ie,m]),Fo=b.useCallback(W=>{j(ue=>{const de=new Set(ue);return de.has(W)?de.delete(W):de.add(W),de})},[]),Va=(Zo=m==null?void 0:m.metadata)==null?void 0:Zo.scorerTypes,ea=(Jo=Ue==null?void 0:Ue.summary)!=null&&Jo.scorers?Object.keys(Ue.summary.scorers):[],Xa=(zl=Ue==null?void 0:Ue.summary)!=null&&zl.scorers?Object.entries(Ue.summary.scorers):[],jr=Xa.length>0?Xa.reduce((W,[,ue])=>W+ue.mean,0)/Xa.length:0,ta=He?Object.entries(He.aggregate.scorers):[],Nr=ta.length>0?ta.reduce((W,[,ue])=>W+ue.mean,0)/ta.length:0,Rl=b.useMemo(()=>{if(!He)return 0;const W=He.allRuns,ue=Object.keys(He.aggregate.scorers);if(ue.length===0||W.length<=1)return 0;const de=W.map(be=>{const Ge=ue.map(Oe=>{var ze,Je,dt;return(dt=(Je=(ze=be.summary)==null?void 0:ze.scorers)==null?void 0:Je[Oe])==null?void 0:dt.mean}).filter(Oe=>Oe!=null);return Ge.length>0?Ge.reduce((Oe,ze)=>Oe+ze,0)/Ge.length:0}),ye=de.reduce((be,Ge)=>be+Ge,0)/de.length;return Math.sqrt(de.reduce((be,Ge)=>be+(Ge-ye)**2,0)/(de.length-1))},[He]),Sr=He?He.allRuns.reduce((W,ue)=>W+ue.duration,0):0,Ls=b.useMemo(()=>zo(He?He.allRuns:[]),[He]),Io=b.useMemo(()=>{if(!He)return[];const W=Object.entries(He.aggregate.scorers);return W.sort((ue,de)=>{let ye,be;switch(O){case"scorer":return P==="asc"?ue[0].localeCompare(de[0]):de[0].localeCompare(ue[0]);case"mean":ye=ue[1].mean,be=de[1].mean;break;case"std":ye=ue[1].std,be=de[1].std;break;case"min":ye=ue[1].min,be=de[1].min;break;case"max":default:ye=ue[1].max,be=de[1].max;break}return P==="desc"?be-ye:ye-be}),W},[He,O,P]),on=W=>{O===W?le(ue=>ue==="desc"?"asc":"desc"):(G(W),le("asc"))},Nt=W=>O===W?P==="desc"?" ▼":" ▲":"",Jt=5,ha=b.useMemo(()=>{var ye;if(!Nn||!m)return[];const W=m.items,ue=Object.keys(((ye=m.summary)==null?void 0:ye.scorers)??{});if(ue.length===0||W.length===0)return[];const de=W.map((be,Ge)=>{const Oe=ue.map(Je=>be.scores[Je]).filter(Je=>Je!=null),ze=Oe.length>0?Oe.reduce((Je,dt)=>Je+dt,0)/Oe.length:1;return{item:be,index:Ge,avgScore:ze,scores:be.scores}});return de.sort((be,Ge)=>be.avgScore-Ge.avgScore),de.slice(0,Jt)},[Nn,m]),Dl=["run","history","compare","trends"];return n.jsxs("div",{className:"flex flex-col h-screen",children:[n.jsx(br,{title:"Eval Runner",description:jn?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:jn.workflow}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsx("span",{children:jn.dataset}),n.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),n.jsxs("span",{children:[jn.scorers.length," scorer",jn.scorers.length!==1?"s":""]})]}):at.length>0?`${at.length} registered eval${at.length!==1?"s":""} · select one to run`:"No evals registered",actions:n.jsxs(n.Fragment,{children:[Vn&&n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:Ds,type:"file",accept:"application/json,.json",className:"hidden",onChange:W=>{var de;const ue=(de=W.target.files)==null?void 0:de[0];ue&&zt(ue),W.target.value=""}}),n.jsxs("button",{type:"button",onClick:()=>{var W;return(W=Ds.current)==null?void 0:W.click()},disabled:zs,className:Q("inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-full cursor-pointer","ring-1 ring-[hsl(var(--input))] bg-[hsl(var(--background))] shadow-sm","hover:bg-[hsl(var(--muted))] hover:ring-[hsl(var(--ring))]","focus:outline-none focus-visible:ring-[hsl(var(--ring))] transition-all","disabled:opacity-40 disabled:cursor-not-allowed"),title:"Import an eval result JSON file (e.g. from `axl-eval --output`). Imported entries persist as long as the runtime's state store does.",children:[n.jsx(E2,{size:12}),zs?"Importing…":"Import result"]})]}),at.length>0&&Vn&&n.jsx(Vk,{evals:at,selectedEval:i,onSelectEval:d,runCount:w,onRunCountChange:C,captureTraces:A,onCaptureTracesChange:_,running:h,onRun:ma})]})}),n.jsx("div",{role:"tablist","aria-label":"Eval views",className:"shrink-0 flex items-center gap-1 px-4 sm:px-6 border-b border-[hsl(var(--border))]",children:Dl.map(W=>n.jsx("button",{type:"button",role:"tab","aria-selected":r===W,onClick:()=>o(W),className:Q("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",r===W?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:W.charAt(0).toUpperCase()+W.slice(1)},W))}),x&&n.jsx("div",{className:"shrink-0 px-6 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950/30",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsx("div",{className:"text-sm text-red-700 dark:text-red-300 whitespace-pre-wrap break-words",children:x}),n.jsx("button",{onClick:()=>v(null),className:"shrink-0 text-xs text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-200 cursor-pointer","aria-label":"Dismiss error",children:"Dismiss"})]})}),_e&&n.jsx("div",{className:"shrink-0 px-6 py-2 border-b border-emerald-200 dark:border-emerald-900 bg-emerald-50 dark:bg-emerald-950/30",children:n.jsxs("div",{className:"flex items-start justify-between gap-4",children:[n.jsx("div",{className:"text-xs text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap break-words",children:_e}),n.jsx("button",{onClick:()=>jt(null),className:"shrink-0 text-xs text-emerald-600 dark:text-emerald-400 hover:text-emerald-900 dark:hover:text-emerald-200 cursor-pointer","aria-label":"Dismiss import status",children:"Dismiss"})]})}),r==="run"&&n.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:at.length===0?n.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:n.jsx(rn,{icon:n.jsx(kl,{size:32}),title:"No evals registered",description:"Define evals with defineEval() and load them via the evals middleware option or runtime.registerEval()."})}):m?n.jsxs(n.Fragment,{children:[(q==="history"||q==="trends")&&n.jsx("div",{className:"shrink-0 px-6 pt-4",children:n.jsxs("button",{onClick:()=>{o(q),K(null)},className:"inline-flex items-center gap-1.5 text-xs text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:[n.jsx(jN,{size:14}),"Back to ",q==="history"?"History":"Trends"]})}),He&&n.jsx("div",{className:"shrink-0 pt-4",children:n.jsx(Bk,{currentIndex:D,totalRuns:He.allRuns.length,aggregate:He.aggregate,onIndexChange:$})}),(He==null?void 0:He.partial)&&n.jsxs("div",{className:"shrink-0 mx-6 mt-4 rounded-md border border-amber-300/60 bg-amber-50 dark:border-amber-500/40 dark:bg-amber-950/40 px-4 py-3 text-sm text-amber-900 dark:text-amber-200",role:"status",children:[n.jsxs("div",{className:"font-medium",children:["Partial batch — ",He.batchCompleted??He.allRuns.length," of"," ",He.batchAttempted??"?"," runs completed."]}),He.batchFailure&&n.jsxs("div",{className:"mt-1 text-amber-800/90 dark:text-amber-300/90",children:["Stopped after: ",He.batchFailure]}),n.jsxs("div",{className:"mt-1 text-amber-800/80 dark:text-amber-300/80",children:["Aggregate stats below are computed over the ",He.allRuns.length," completed run",He.allRuns.length===1?"":"s","."]})]}),Nn?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"shrink-0 px-6 py-4",children:[n.jsxs("div",{className:"flex items-start justify-between mb-3",children:[n.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-x-4 gap-y-1.5",children:[(()=>{const W=m?dl(m):[];if(W.length===0)return null;const ue=m?Tf(m):null;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:W.length>1?"Workflows":"Workflow"}),W.map(de=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:ue?`${de} — ${ue[de]} calls`:de,children:[de,ue&&ue[de]!=null&&n.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",ue[de],")"]})]},de))]})})(),(()=>{const W=m?Qa(m):[];if(W.length===0)return null;const ue=m?Os(m):null;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:W.length>1?"Models":"Model"}),W.map(de=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:ue?`${de} — ${ue[de]} calls`:de,children:[_n(de),ue&&ue[de]!=null&&n.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",ue[de],")"]})]},de))]})})()]}),n.jsx("button",{onClick:()=>{var ue;const W=(ue=m==null?void 0:m.metadata)==null?void 0:ue.runGroupId;if(W){const de=$e.filter(ye=>{var be;return((be=ye.data.metadata)==null?void 0:be.runGroupId)===W}).map(ye=>ye.id);de.length>0&&Mt({id:de[0],groupIds:de})}else if(m){const de=$e.find(ye=>ye.id===m.id);de&&Mt({id:de.id})}o("compare")},className:"px-3 py-1.5 text-xs font-medium rounded-lg border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",children:"Compare with previous..."})]}),m&&n.jsx(V0,{result:m}),m&&n.jsx(X0,{result:m}),m&&n.jsx(F0,{result:m}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[n.jsx(tt,{label:"Runs",value:String(He.aggregate.runCount),subtitle:"individual runs"}),n.jsx(tt,{label:"Mean Score",value:ta.length>0?Nr.toFixed(3):"—",accent:ta.length>0?Dt(Nr):void 0,tint:ta.length>0?Y0(Nr):void 0,subtitle:ta.length>0?`± ${Rl.toFixed(3)} across runs`:"across all scorers"}),n.jsx(tt,{label:"Total Duration",value:Sr>0?ht(Sr):"—",subtitle:"all runs combined"}),n.jsx(tt,{label:"Known Spend",value:kc(Ls)+vt(Ls.knownCost),subtitle:`all runs combined · ${wc(Ls)}`,subtitleColor:Ls.completeness==="complete"?void 0:"text-amber-600 dark:text-amber-400"}),(()=>{const W=He.allRuns,ue={input:0,output:0,reasoning:0};for(const ye of W){const be=Mf(ye);ue.input+=be.input,ue.output+=be.output,ue.reasoning+=be.reasoning}const de=ue.input+ue.output+ue.reasoning;return de>0?n.jsx(tt,{label:"Total Tokens",value:Yn(de),subtitle:`${Yn(ue.input)} in / ${Yn(ue.output)} out`}):null})()]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto px-6 pb-6 space-y-6",children:[n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Per-Scorer Aggregate"})}),n.jsx(vk,{coverage:m==null?void 0:m.summary.coverage}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-xs",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[n.jsxs("th",{className:"text-left px-4 py-2 font-medium w-48 cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>on("scorer"),children:["Scorer",Nt("scorer")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>on("mean"),children:["Mean",Nt("mean")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>on("std"),children:["Std",Nt("std")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>on("min"),children:["Min",Nt("min")]}),n.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>on("max"),children:["Max",Nt("max")]})]})}),n.jsx("tbody",{children:Io.map(([W,ue])=>n.jsx(Zw,{name:W,stats:ue,isLlm:(Va==null?void 0:Va[W])==="llm"},W))})]})})]}),ha.length>0&&n.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:n.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Lowest Scoring Items"})}),n.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:ha.map(({item:W,index:ue,avgScore:de,scores:ye})=>{var Je;const be=S===ue,Ge=He==null?void 0:He.allRuns,Oe=(Ge==null?void 0:Ge.length)??0,ze=be&&Ge?(Je=Ge[B])==null?void 0:Je.items[ue]:null;return n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>{E(be?null:ue),te(0)},className:Q("w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",be&&"bg-[hsl(var(--accent))]"),children:[n.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-[hsl(var(--muted-foreground))] w-6 text-right",children:["#",ue+1]}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-xs truncate",children:Cl(W.input,60)}),n.jsx("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:Object.entries(ye).map(([dt,pt])=>pt!=null?n.jsxs("span",{className:Q("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",Cc(pt)),title:dt,children:[dt,": ",pt.toFixed(2)]},dt):null)})]}),n.jsx("span",{className:Q("shrink-0 text-xs font-mono font-medium",Dt(de)),children:de.toFixed(3)})]}),be&&n.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[Oe>1&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),n.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:Oe},(dt,pt)=>n.jsx("button",{onClick:()=>te(pt),className:Q("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",pt===B?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:pt+1},pt))})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[ze&&n.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Object.entries(ze.scores).map(([dt,pt])=>pt!=null?n.jsxs("span",{className:Q("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",Cc(pt)),children:[dt,": ",pt.toFixed(3)]},dt):null)}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Output"}),n.jsx(Ct,{data:(ze==null?void 0:ze.output)??W.output,collapsed:!0})]}),(ze==null?void 0:ze.scoreDetails)&&Object.entries(ze.scoreDetails).map(([dt,pt])=>{var xa;const kr=typeof((xa=pt==null?void 0:pt.metadata)==null?void 0:xa.reasoning)=="string"?pt.metadata.reasoning:null;return kr?n.jsxs("div",{children:[n.jsxs("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:[dt," reasoning"]}),n.jsx("pre",{className:"text-xs font-mono p-2 rounded-md bg-[hsl(var(--secondary))] overflow-auto max-h-32 whitespace-pre-wrap leading-relaxed",children:kr})]},dt):null})]})]})]},ue)})})]})]})]}):Ue?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"shrink-0 px-6 py-4",children:[(()=>{const W=dl(Ue),ue=Tf(Ue),de=Qa(Ue),ye=Os(Ue);return W.length===0&&de.length===0?null:n.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 mb-3",children:[W.length>0&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:W.length>1?"Workflows":"Workflow"}),W.map(be=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:ue?`${be} — ${ue[be]} calls`:be,children:[be,ue&&ue[be]!=null&&n.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",ue[be],")"]})]},be))]}),de.length>0&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:de.length>1?"Models":"Model"}),de.map(be=>n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-mono font-medium",title:ye?`${be} — ${ye[be]} calls`:be,children:[_n(be),ye&&ye[be]!=null&&n.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",ye[be],")"]})]},be))]})]})})(),n.jsx(V0,{result:Ue}),n.jsx(X0,{result:Ue}),n.jsx(F0,{result:Ue}),Xo(Ue)&&n.jsxs("div",{className:"mb-3 flex items-center gap-2 px-3 py-2 rounded-lg text-xs bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-900 text-amber-800 dark:text-amber-200",children:[n.jsx(Mv,{result:Ue}),n.jsx("span",{children:"This run stopped admitting spend at its budget, so it covers less than the whole dataset. That is not a model or scorer failure."})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[(()=>{var be;const W=(be=Ue.summary.coverage)==null?void 0:be.items,ue=Ue.summary.failures,de=W?W.budget_skipped+W.budget_interrupted:0,ye=W?de>0?`${W.completed} completed · ${de} stopped on budget`:W.failed>0?`${W.failed} failed`:"all completed":ue>0?`${ue} with errors`:"all passed";return n.jsx(tt,{label:"Items",value:String(Ue.summary.count),subtitle:ye,subtitleColor:de>0?"text-amber-600 dark:text-amber-400":((W==null?void 0:W.failed)??ue)>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"})})(),n.jsx(tt,{label:"Mean Score",value:Xa.length>0?jr.toFixed(3):"—",accent:Xa.length>0?Dt(jr):void 0,tint:Xa.length>0?Y0(jr):void 0,subtitle:"across all scorers"}),n.jsx(tt,{label:"Duration",value:Ue.summary.timing?ht(Ue.summary.timing.mean):ht(Ue.duration),subtitle:Ue.summary.timing?`p95 ${ht(Ue.summary.timing.p95)}`:"total"}),(()=>{const W=Ol(Ue);return n.jsx(tt,{label:"Known Spend",value:kc(W)+vt(W.knownCost),subtitle:wc(W),subtitleColor:W.completeness==="complete"?void 0:"text-amber-600 dark:text-amber-400"})})(),(()=>{const W=Mf(Ue),ue=W.input+W.output+W.reasoning;return ue>0?n.jsx(tt,{label:"Tokens",value:Yn(ue),subtitle:`${Yn(W.input)} in / ${Yn(W.output)} out`}):null})()]})]}),n.jsx(_l,{className:"flex-1 border-t border-[hsl(var(--border))]",defaultPercent:30,minPercent:15,maxPercent:50,left:n.jsx("div",{className:"flex-1 overflow-y-auto bg-[hsl(var(--card))]",children:n.jsx(Ak,{items:Ue.items,scorerNames:ea,selectedIndex:y,onSelectItem:k,onDeselectItem:()=>k(null)})}),right:n.jsx("div",{className:"flex-1 overflow-y-auto",children:y!=null?n.jsx("div",{className:"p-6",children:n.jsx(Tk,{item:Ue.items[y],itemIndex:y,scorerNames:ea,onBack:()=>k(null)})}):n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx(Sk,{result:Ue,scorerTypes:Va}),!Nn&&n.jsx(xk,{result:Ue,evalName:((Fa=$e.find(W=>W.id===Ue.id))==null?void 0:Fa.eval)||i||void 0},Ue.id),n.jsx(Ok,{items:Ue.items,scorerNames:ea}),Ue.items.length>0&&n.jsx(wk,{items:Ue.items,scorerNames:ea,onSelectItem:k,errorFilter:F,onErrorFilterChange:re,scorerFilter:we,onScorerFilterChange:me,threshold:Z,onThresholdChange:M,sortField:R,onSortFieldChange:ne,sortDir:je,onSortDirChange:xe})]})})})]}):null]}):h?n.jsx(Ik,{exec:f,onCancel:kw}):n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(rn,{icon:n.jsx(kl,{size:32}),title:"No results",description:"Select an eval and run it to see results."})})}),r==="history"&&n.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:$e.length===0?n.jsx(rn,{title:"No eval history",description:"Run evaluations to build history."}):n.jsx(Yk,{history:$e,evalFilter:he,onEvalFilterChange:ie,onSelect:W=>{p(W),k(null),$(-1),K("history"),o("run")},onSelectGroup:W=>{const ue=W.map(ye=>ye.data),de=G0(ue);de&&(p(de),k(null),$(-1),K("history"),o("run"))},onRescore:Us,onDelete:Lc,registeredEvalNames:Ya,readOnly:Zt,expandedGroups:T,onToggleGroup:Fo})}),r==="trends"&&n.jsx(Hw,{onViewRun:W=>{const ue=$e.find(de=>de.id===W);ue&&(p(ue.data),k(null),$(-1),K("trends"),o("run"))}}),r==="compare"&&n.jsx("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:n.jsx("div",{className:"space-y-4",children:$e.length<2?n.jsx(rn,{title:"Need at least 2 eval runs",description:"Run evaluations to compare results."}):n.jsxs(n.Fragment,{children:[n.jsx(qk,{history:$e,baselineSelection:pe,candidateSelection:Ie,onBaselineChange:Ce,onCandidateChange:Mt,onCompare:yr,comparing:fe}),oe&&n.jsx(Uk,{compareResult:oe,baseline:ve,candidate:Ze,isGroupComparison:(((wr=pe==null?void 0:pe.groupIds)==null?void 0:wr.length)??0)>1||(((pa=Ie==null?void 0:Ie.groupIds)==null?void 0:pa.length)??0)>1,baselineRuns:Gt,candidateRuns:Ee})]})})})]})}function Ik({exec:s,onCancel:r}){const[o,i]=b.useState(0);b.useEffect(()=>{if(!s.startedAt)return;i(Math.floor((Date.now()-s.startedAt)/1e3));const C=setInterval(()=>{i(Math.floor((Date.now()-s.startedAt)/1e3))},1e3);return()=>clearInterval(C)},[s.startedAt]);const d=Math.floor(o/60),f=o%60,h=d>0?`${d}m ${f}s`:`${f}s`,m=s.progress,p=(s.runCount??1)>1,x=(m==null?void 0:m.totalItems)??0,v=(m==null?void 0:m.completedItems)??0,y=(m==null?void 0:m.completedRuns)??0,k=(m==null?void 0:m.totalRuns)??s.runCount??1,w=x>0?Math.round(v/x*100):0;return n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-5",children:[n.jsxs("div",{className:"relative",children:[n.jsx(kl,{size:28,className:"text-[hsl(var(--muted-foreground))]"}),n.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500 animate-ping"}),n.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500"})]}),n.jsxs("div",{className:"text-center space-y-1",children:[n.jsx("p",{className:"text-sm font-medium",children:p?`Run ${y+1} of ${k}`:"Running evaluation…"}),s.evalName&&n.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[s.evalName,p?` · ${k} runs`:""]})]}),x>0&&n.jsxs("div",{className:"w-56 space-y-1.5",children:[n.jsx("div",{className:"h-1.5 rounded-full bg-[hsl(var(--muted))] overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-300 ease-out",style:{width:`${w}%`}})}),n.jsxs("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] text-center tabular-nums",children:[v," / ",x," items"]})]}),n.jsx("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] tabular-nums",children:h}),n.jsxs("button",{onClick:r,className:`inline-flex items-center gap-1.5 px-3 py-1 text-xs rounded-md
|
|
318
|
+
border border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))]
|
|
319
|
+
hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]
|
|
320
|
+
transition-colors cursor-pointer`,children:[n.jsx(em,{size:12}),"Cancel"]})]})}function Zk(){return n.jsx(rN,{basename:window.__AXL_STUDIO_BASE__||"/",children:n.jsxs("div",{className:"flex h-screen overflow-hidden",children:[n.jsx($2,{}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsxs(zj,{children:[n.jsx(la,{path:"/playground",element:n.jsx(PS,{})}),n.jsx(la,{path:"/workflows",element:n.jsx(sw,{})}),n.jsx(la,{path:"/traces",element:n.jsx(dw,{})}),n.jsx(la,{path:"/costs",element:n.jsx(mw,{})}),n.jsx(la,{path:"/memory",element:n.jsx(hw,{})}),n.jsx(la,{path:"/sessions",element:n.jsx(vw,{})}),n.jsx(la,{path:"/tools",element:n.jsx(bw,{})}),n.jsx(la,{path:"/evals",element:n.jsx(Fk,{})}),n.jsx(la,{path:"*",element:n.jsx(Rj,{to:"/playground",replace:!0})})]})})]})})}Qf(Gf(Bf()));U1();Iy.createRoot(document.getElementById("root")).render(n.jsx(b.StrictMode,{children:n.jsx(y1,{client:O1,children:n.jsx(Zk,{})})}));
|