@axlsdk/studio 0.14.0 → 0.15.0
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 +68 -10
- package/dist/chunk-IPDMFFTQ.js +2142 -0
- package/dist/chunk-IPDMFFTQ.js.map +1 -0
- package/dist/cli.cjs +1094 -117
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/assets/index-CLKKOaE2.css +1 -0
- package/dist/client/assets/index-rvds50cZ.js +278 -0
- package/dist/client/index.html +2 -2
- package/dist/{connection-manager-B7AWpsCD.d.cts → connection-manager-BMPahDuY.d.cts} +63 -1
- package/dist/{connection-manager-B7AWpsCD.d.ts → connection-manager-BMPahDuY.d.ts} +63 -1
- package/dist/middleware.cjs +1123 -123
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.cts +52 -5
- package/dist/middleware.d.ts +52 -5
- package/dist/middleware.js +30 -7
- package/dist/middleware.js.map +1 -1
- package/dist/server/index.cjs +1097 -116
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +165 -28
- package/dist/server/index.d.ts +165 -28
- package/dist/server/index.js +7 -3
- package/package.json +10 -6
- package/dist/chunk-HUKUQDYL.js +0 -1163
- package/dist/chunk-HUKUQDYL.js.map +0 -1
- package/dist/client/assets/index-7aDhMztu.css +0 -1
- package/dist/client/assets/index-Bzr3vDPz.js +0 -255
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
var Ny=Object.defineProperty;var fx=s=>{throw TypeError(s)};var Sy=(s,r,i)=>r in s?Ny(s,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[r]=i;var ri=(s,r,i)=>Sy(s,typeof r!="symbol"?r+"":r,i),yd=(s,r,i)=>r.has(s)||fx("Cannot "+i);var M=(s,r,i)=>(yd(s,r,"read from private field"),i?i.call(s):r.get(s)),be=(s,r,i)=>r.has(s)?fx("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,i),fe=(s,r,i,u)=>(yd(s,r,"write to private field"),u?u.call(s,i):r.set(s,i),i),Oe=(s,r,i)=>(yd(s,r,"access private method"),i);var Yo=(s,r,i,u)=>({set _(d){fe(s,r,d,i)},get _(){return M(s,r,u)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&u(p)}).observe(document,{childList:!0,subtree:!0});function i(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 u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var bd={exports:{}},ii={};/**
|
|
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 hx;function wy(){if(hx)return ii;hx=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(u,d,f){var p=null;if(f!==void 0&&(p=""+f),d.key!==void 0&&(p=""+d.key),"key"in d){f={};for(var x in d)x!=="key"&&(f[x]=d[x])}else f=d;return d=f.ref,{$$typeof:s,type:u,key:p,ref:d!==void 0?d:null,props:f}}return ii.Fragment=r,ii.jsx=i,ii.jsxs=i,ii}var mx;function Cy(){return mx||(mx=1,bd.exports=wy()),bd.exports}var a=Cy(),jd={exports:{}},Ee={};/**
|
|
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 px;function Ey(){if(px)return Ee;px=1;var s=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function T(E){return E===null||typeof E!="object"?null:(E=C&&E[C]||E["@@iterator"],typeof E=="function"?E:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,O={};function z(E,H,I){this.props=E,this.context=H,this.refs=O,this.updater=I||w}z.prototype.isReactComponent={},z.prototype.setState=function(E,H){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,H,"setState")},z.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function K(){}K.prototype=z.prototype;function N(E,H,I){this.props=E,this.context=H,this.refs=O,this.updater=I||w}var S=N.prototype=new K;S.constructor=N,A(S,z.prototype),S.isPureReactComponent=!0;var D=Array.isArray;function U(){}var B={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function Z(E,H,I){var oe=I.ref;return{$$typeof:s,type:E,key:H,ref:oe!==void 0?oe:null,props:I}}function J(E,H){return Z(E.type,H,E.props)}function ne(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function Q(E){var H={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(I){return H[I]})}var $=/\/+/g;function re(E,H){return typeof E=="object"&&E!==null&&E.key!=null?Q(""+E.key):H.toString(36)}function le(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(U,U):(E.status="pending",E.then(function(H){E.status==="pending"&&(E.status="fulfilled",E.value=H)},function(H){E.status==="pending"&&(E.status="rejected",E.reason=H)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function _(E,H,I,oe,de){var ye=typeof E;(ye==="undefined"||ye==="boolean")&&(E=null);var ce=!1;if(E===null)ce=!0;else switch(ye){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(E.$$typeof){case s:case r:ce=!0;break;case y:return ce=E._init,_(ce(E._payload),H,I,oe,de)}}if(ce)return de=de(E),ce=oe===""?"."+re(E,0):oe,D(de)?(I="",ce!=null&&(I=ce.replace($,"$&/")+"/"),_(de,H,I,"",function(ft){return ft})):de!=null&&(ne(de)&&(de=J(de,I+(de.key==null||E&&E.key===de.key?"":(""+de.key).replace($,"$&/")+"/")+ce)),H.push(de)),1;ce=0;var we=oe===""?".":oe+":";if(D(E))for(var ke=0;ke<E.length;ke++)oe=E[ke],ye=we+re(oe,ke),ce+=_(oe,H,I,ye,de);else if(ke=T(E),typeof ke=="function")for(E=ke.call(E),ke=0;!(oe=E.next()).done;)oe=oe.value,ye=we+re(oe,ke++),ce+=_(oe,H,I,ye,de);else if(ye==="object"){if(typeof E.then=="function")return _(le(E),H,I,oe,de);throw H=String(E),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ce}function F(E,H,I){if(E==null)return E;var oe=[],de=0;return _(E,oe,"","",function(ye){return H.call(I,ye,de++)}),oe}function ie(E){if(E._status===-1){var H=E._result;H=H(),H.then(function(I){(E._status===0||E._status===-1)&&(E._status=1,E._result=I)},function(I){(E._status===0||E._status===-1)&&(E._status=2,E._result=I)}),E._status===-1&&(E._status=0,E._result=H)}if(E._status===1)return E._result.default;throw E._result}var he=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},pe={map:F,forEach:function(E,H,I){F(E,function(){H.apply(this,arguments)},I)},count:function(E){var H=0;return F(E,function(){H++}),H},toArray:function(E){return F(E,function(H){return H})||[]},only:function(E){if(!ne(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ee.Activity=v,Ee.Children=pe,Ee.Component=z,Ee.Fragment=i,Ee.Profiler=d,Ee.PureComponent=N,Ee.StrictMode=u,Ee.Suspense=m,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(E){return B.H.useMemoCache(E)}},Ee.cache=function(E){return function(){return E.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(E,H,I){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var oe=A({},E.props),de=E.key;if(H!=null)for(ye in H.key!==void 0&&(de=""+H.key),H)!q.call(H,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&H.ref===void 0||(oe[ye]=H[ye]);var ye=arguments.length-2;if(ye===1)oe.children=I;else if(1<ye){for(var ce=Array(ye),we=0;we<ye;we++)ce[we]=arguments[we+2];oe.children=ce}return Z(E.type,de,oe)},Ee.createContext=function(E){return E={$$typeof:p,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},Ee.createElement=function(E,H,I){var oe,de={},ye=null;if(H!=null)for(oe in H.key!==void 0&&(ye=""+H.key),H)q.call(H,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(de[oe]=H[oe]);var ce=arguments.length-2;if(ce===1)de.children=I;else if(1<ce){for(var we=Array(ce),ke=0;ke<ce;ke++)we[ke]=arguments[ke+2];de.children=we}if(E&&E.defaultProps)for(oe in ce=E.defaultProps,ce)de[oe]===void 0&&(de[oe]=ce[oe]);return Z(E,ye,de)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(E){return{$$typeof:x,render:E}},Ee.isValidElement=ne,Ee.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:ie}},Ee.memo=function(E,H){return{$$typeof:g,type:E,compare:H===void 0?null:H}},Ee.startTransition=function(E){var H=B.T,I={};B.T=I;try{var oe=E(),de=B.S;de!==null&&de(I,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(U,he)}catch(ye){he(ye)}finally{H!==null&&I.types!==null&&(H.types=I.types),B.T=H}},Ee.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Ee.use=function(E){return B.H.use(E)},Ee.useActionState=function(E,H,I){return B.H.useActionState(E,H,I)},Ee.useCallback=function(E,H){return B.H.useCallback(E,H)},Ee.useContext=function(E){return B.H.useContext(E)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(E,H){return B.H.useDeferredValue(E,H)},Ee.useEffect=function(E,H){return B.H.useEffect(E,H)},Ee.useEffectEvent=function(E){return B.H.useEffectEvent(E)},Ee.useId=function(){return B.H.useId()},Ee.useImperativeHandle=function(E,H,I){return B.H.useImperativeHandle(E,H,I)},Ee.useInsertionEffect=function(E,H){return B.H.useInsertionEffect(E,H)},Ee.useLayoutEffect=function(E,H){return B.H.useLayoutEffect(E,H)},Ee.useMemo=function(E,H){return B.H.useMemo(E,H)},Ee.useOptimistic=function(E,H){return B.H.useOptimistic(E,H)},Ee.useReducer=function(E,H,I){return B.H.useReducer(E,H,I)},Ee.useRef=function(E){return B.H.useRef(E)},Ee.useState=function(E){return B.H.useState(E)},Ee.useSyncExternalStore=function(E,H,I){return B.H.useSyncExternalStore(E,H,I)},Ee.useTransition=function(){return B.H.useTransition()},Ee.version="19.2.4",Ee}var xx;function af(){return xx||(xx=1,jd.exports=Ey()),jd.exports}var b=af(),Nd={exports:{}},oi={},Sd={exports:{}},wd={};/**
|
|
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 gx;function Ty(){return gx||(gx=1,(function(s){function r(_,F){var ie=_.length;_.push(F);e:for(;0<ie;){var he=ie-1>>>1,pe=_[he];if(0<d(pe,F))_[he]=F,_[ie]=pe,ie=he;else break e}}function i(_){return _.length===0?null:_[0]}function u(_){if(_.length===0)return null;var F=_[0],ie=_.pop();if(ie!==F){_[0]=ie;e:for(var he=0,pe=_.length,E=pe>>>1;he<E;){var H=2*(he+1)-1,I=_[H],oe=H+1,de=_[oe];if(0>d(I,ie))oe<pe&&0>d(de,I)?(_[he]=de,_[oe]=ie,he=oe):(_[he]=I,_[H]=ie,he=H);else if(oe<pe&&0>d(de,ie))_[he]=de,_[oe]=ie,he=oe;else break e}}return F}function d(_,F){var ie=_.sortIndex-F.sortIndex;return ie!==0?ie:_.id-F.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 p=Date,x=p.now();s.unstable_now=function(){return p.now()-x}}var m=[],g=[],y=1,v=null,C=3,T=!1,w=!1,A=!1,O=!1,z=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function S(_){for(var F=i(g);F!==null;){if(F.callback===null)u(g);else if(F.startTime<=_)u(g),F.sortIndex=F.expirationTime,r(m,F);else break;F=i(g)}}function D(_){if(A=!1,S(_),!w)if(i(m)!==null)w=!0,U||(U=!0,Q());else{var F=i(g);F!==null&&le(D,F.startTime-_)}}var U=!1,B=-1,q=5,Z=-1;function J(){return O?!0:!(s.unstable_now()-Z<q)}function ne(){if(O=!1,U){var _=s.unstable_now();Z=_;var F=!0;try{e:{w=!1,A&&(A=!1,K(B),B=-1),T=!0;var ie=C;try{t:{for(S(_),v=i(m);v!==null&&!(v.expirationTime>_&&J());){var he=v.callback;if(typeof he=="function"){v.callback=null,C=v.priorityLevel;var pe=he(v.expirationTime<=_);if(_=s.unstable_now(),typeof pe=="function"){v.callback=pe,S(_),F=!0;break t}v===i(m)&&u(m),S(_)}else u(m);v=i(m)}if(v!==null)F=!0;else{var E=i(g);E!==null&&le(D,E.startTime-_),F=!1}}break e}finally{v=null,C=ie,T=!1}F=void 0}}finally{F?Q():U=!1}}}var Q;if(typeof N=="function")Q=function(){N(ne)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,re=$.port2;$.port1.onmessage=ne,Q=function(){re.postMessage(null)}}else Q=function(){z(ne,0)};function le(_,F){B=z(function(){_(s.unstable_now())},F)}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(_){_.callback=null},s.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<_?Math.floor(1e3/_):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_next=function(_){switch(C){case 1:case 2:case 3:var F=3;break;default:F=C}var ie=C;C=F;try{return _()}finally{C=ie}},s.unstable_requestPaint=function(){O=!0},s.unstable_runWithPriority=function(_,F){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var ie=C;C=_;try{return F()}finally{C=ie}},s.unstable_scheduleCallback=function(_,F,ie){var he=s.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?he+ie:he):ie=he,_){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=ie+pe,_={id:y++,callback:F,priorityLevel:_,startTime:ie,expirationTime:pe,sortIndex:-1},ie>he?(_.sortIndex=ie,r(g,_),i(m)===null&&_===i(g)&&(A?(K(B),B=-1):A=!0,le(D,ie-he))):(_.sortIndex=pe,r(m,_),w||T||(w=!0,U||(U=!0,Q()))),_},s.unstable_shouldYield=J,s.unstable_wrapCallback=function(_){var F=C;return function(){var ie=C;C=F;try{return _.apply(this,arguments)}finally{C=ie}}}})(wd)),wd}var vx;function ky(){return vx||(vx=1,Sd.exports=Ty()),Sd.exports}var Cd={exports:{}},Qt={};/**
|
|
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 yx;function My(){if(yx)return Qt;yx=1;var s=af();function r(m){var g="https://react.dev/errors/"+m;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(m,g,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:v==null?null:""+v,children:m,containerInfo:g,implementation:y}}var p=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(m,g){if(m==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Qt.createPortal=function(m,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(r(299));return f(m,g,null,y)},Qt.flushSync=function(m){var g=p.T,y=u.p;try{if(p.T=null,u.p=2,m)return m()}finally{p.T=g,u.p=y,u.d.f()}},Qt.preconnect=function(m,g){typeof m=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(m,g))},Qt.prefetchDNS=function(m){typeof m=="string"&&u.d.D(m)},Qt.preinit=function(m,g){if(typeof m=="string"&&g&&typeof g.as=="string"){var y=g.as,v=x(y,g.crossOrigin),C=typeof g.integrity=="string"?g.integrity:void 0,T=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?u.d.S(m,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:C,fetchPriority:T}):y==="script"&&u.d.X(m,{crossOrigin:v,integrity:C,fetchPriority:T,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Qt.preinitModule=function(m,g){if(typeof m=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=x(g.as,g.crossOrigin);u.d.M(m,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(m)},Qt.preload=function(m,g){if(typeof m=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,v=x(y,g.crossOrigin);u.d.L(m,y,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Qt.preloadModule=function(m,g){if(typeof m=="string")if(g){var y=x(g.as,g.crossOrigin);u.d.m(m,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(m)},Qt.requestFormReset=function(m){u.d.r(m)},Qt.unstable_batchedUpdates=function(m,g){return m(g)},Qt.useFormState=function(m,g,y){return p.H.useFormState(m,g,y)},Qt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Qt.version="19.2.4",Qt}var bx;function Oy(){if(bx)return Cd.exports;bx=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(),Cd.exports=My(),Cd.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 jx;function Ay(){if(jx)return oi;jx=1;var s=ky(),r=af(),i=Oy();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(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 m(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return m(o),e;if(c===l)return m(o),t;c=c.sibling}throw Error(u(188))}if(n.return!==l.return)n=o,l=c;else{for(var h=!1,j=o.child;j;){if(j===n){h=!0,n=o,l=c;break}if(j===l){h=!0,l=o,n=c;break}j=j.sibling}if(!h){for(j=c.child;j;){if(j===n){h=!0,n=c,l=o;break}if(j===l){h=!0,l=c,n=o;break}j=j.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,C=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),N=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case z:return"Profiler";case O:return"StrictMode";case D:return"Suspense";case U:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case N:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case S: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:re(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var le=Array.isArray,_=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},he=[],pe=-1;function E(e){return{current:e}}function H(e){0>pe||(e.current=he[pe],he[pe]=null,pe--)}function I(e,t){pe++,he[pe]=e.current,e.current=t}var oe=E(null),de=E(null),ye=E(null),ce=E(null);function we(e,t){switch(I(ye,t),I(de,e),I(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Up(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(oe),I(oe,e)}function ke(){H(oe),H(de),H(ye)}function ft(e){e.memoizedState!==null&&I(ce,e);var t=oe.current,n=Up(t,e.type);t!==n&&(I(de,e),I(oe,n))}function Yt(e){de.current===e&&(H(oe),H(de)),ce.current===e&&(H(ce),ni._currentValue=ie)}var rn,on;function Ot(e){if(rn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);rn=t&&t[1]||"",on=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+rn+e+on}var nt=!1;function At(e,t){if(!e||nt)return"";nt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(V){var X=V}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(V){X=V}e.call(ae.prototype)}}else{try{throw Error()}catch(V){X=V}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(V){if(V&&X&&typeof V.stack=="string")return[V.stack,X.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),h=c[0],j=c[1];if(h&&j){var k=h.split(`
|
|
44
|
+
`),Y=j.split(`
|
|
45
|
+
`);for(o=l=0;l<k.length&&!k[l].includes("DetermineComponentFrameRoot");)l++;for(;o<Y.length&&!Y[o].includes("DetermineComponentFrameRoot");)o++;if(l===k.length||o===Y.length)for(l=k.length-1,o=Y.length-1;1<=l&&0<=o&&k[l]!==Y[o];)o--;for(;1<=l&&0<=o;l--,o--)if(k[l]!==Y[o]){if(l!==1||o!==1)do if(l--,o--,0>o||k[l]!==Y[o]){var P=`
|
|
46
|
+
`+k[l].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=l&&0<=o);break}}}finally{nt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ot(n):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return Ot(e.type);case 16:return Ot("Lazy");case 13:return e.child!==t&&t!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return At(e.type,!1);case 11:return At(e.type.render,!1);case 1:return At(e.type,!0);case 31:return Ot("Activity");default:return""}}function Rt(e){try{var t="",n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
47
|
+
Error generating stack: `+l.message+`
|
|
48
|
+
`+l.stack}}var In=Object.prototype.hasOwnProperty,An=s.unstable_scheduleCallback,Bn=s.unstable_cancelCallback,bl=s.unstable_shouldYield,Kt=s.unstable_requestPaint,Xe=s.unstable_now,mr=s.unstable_getCurrentPriorityLevel,Ci=s.unstable_ImmediatePriority,Ei=s.unstable_UserBlockingPriority,jl=s.unstable_NormalPriority,kf=s.unstable_LowPriority,pr=s.unstable_IdlePriority,Ti=s.log,ki=s.unstable_setDisableYieldValue,Ma=null,Ct=null;function $t(e){if(typeof Ti=="function"&&ki(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Ma,e)}catch{}}var Xt=Math.clz32?Math.clz32:at,Nl=Math.log,cu=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(Nl(e)/cu|0)|0}var Oa=256,Re=262144,Aa=4194304;function Pn(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 ls(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var j=l&134217727;return j!==0?(l=j&~c,l!==0?o=Pn(l):(h&=j,h!==0?o=Pn(h):n||(n=j&~e,n!==0&&(o=Pn(n))))):(j=l&~c,j!==0?o=Pn(j):h!==0?o=Pn(h):n||(n=l&~e,n!==0&&(o=Pn(n)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:o}function Sl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function du(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 Mi(){var e=Aa;return Aa<<=1,(Aa&62914560)===0&&(Aa=4194304),e}function Ra(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _a(e,t,n,l,o,c){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var j=e.entanglements,k=e.expirationTimes,Y=e.hiddenUpdates;for(n=h&~n;0<n;){var P=31-Xt(n),ae=1<<P;j[P]=0,k[P]=-1;var X=Y[P];if(X!==null)for(Y[P]=null,P=0;P<X.length;P++){var V=X[P];V!==null&&(V.lane&=-536870913)}n&=~ae}l!==0&&ss(e,l,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function ss(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Xt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Gn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-Xt(n),o=1<<l;o&t|e[l]&t&&(e[l]|=t),n&=~o}}function rs(e,t){var n=t&-t;return n=(n&42)!==0?1:xr(n),(n&(e.suspendedLanes|t))!==0?0:n}function xr(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 is(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gr(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:sx(e.type))}function Oi(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Wt=Math.random().toString(36).slice(2),dt="__reactFiber$"+Wt,Bt="__reactProps$"+Wt,za="__reactContainer$"+Wt,os="__reactEvents$"+Wt,fu="__reactListeners$"+Wt,Ai="__reactHandles$"+Wt,vr="__reactResources$"+Wt,Da="__reactMarker$"+Wt;function us(e){delete e[dt],delete e[Bt],delete e[os],delete e[fu],delete e[Ai]}function ea(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[za]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Yp(e);e!==null;){if(n=e[dt])return n;e=Yp(e)}return t}e=n,n=e.parentNode}return null}function ee(e){if(e=e[dt]||e[za]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function se(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function ue(e){var t=e[vr];return t||(t=e[vr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function me(e){e[Da]=!0}var xe=new Set,Ue={};function Ce(e,t){Ae(e,t),Ae(e+"Capture",t)}function Ae(e,t){for(Ue[e]=t,e=0;e<t.length;e++)xe.add(t[e])}var Ve=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]*$"),et={},st={};function cs(e){return In.call(st,e)?!0:In.call(et,e)?!1:Ve.test(e)?st[e]=!0:(et[e]=!0,!1)}function ta(e,t,n){if(cs(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function wl(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Et(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Cl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ri(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function El(e){if(!e._valueTracker){var t=Cl(e)?"checked":"value";e._valueTracker=Ri(e,t,""+e[t])}}function ds(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Cl(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Tl(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 kl=/[\n"\\]/g;function _t(e){return e.replace(kl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hu(e,t,n,l,o,c,h,j){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tt(t)):e.value!==""+Tt(t)&&(e.value=""+Tt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?mu(e,h,Tt(t)):n!=null?mu(e,h,Tt(n)):l!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+Tt(j):e.removeAttribute("name")}function Mf(e,t,n,l,o,c,h,j){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){El(e);return}n=n!=null?""+Tt(n):"",t=t!=null?""+Tt(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}l=l??o,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=j?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),El(e)}function mu(e,t,n){t==="number"&&Tl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fs(e,t,n,l){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Tt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,l&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Of(e,t,n){if(t!=null&&(t=""+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Tt(n):""}function Af(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(u(92));if(le(l)){if(1<l.length)throw Error(u(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Tt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),El(e)}function hs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var g0=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 Rf(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||g0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function _f(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var o in t)l=t[o],t.hasOwnProperty(o)&&n[o]!==l&&Rf(e,o,l)}else for(var c in t)t.hasOwnProperty(c)&&Rf(e,c,t[c])}function pu(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 v0=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"]]),y0=/^[\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 _i(e){return y0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var xu=null;function gu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ms=null,ps=null;function zf(e){var t=ee(e);if(t&&(e=t.stateNode)){var n=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(hu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_t(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var o=l[Bt]||null;if(!o)throw Error(u(90));hu(l,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&ds(l)}break e;case"textarea":Of(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fs(e,!!n.multiple,t,!1)}}}var vu=!1;function Df(e,t,n){if(vu)return e(t,n);vu=!0;try{var l=e(t);return l}finally{if(vu=!1,(ms!==null||ps!==null)&&(jo(),ms&&(t=ms,e=ps,ps=ms=null,zf(t),e)))for(t=0;t<e.length;t++)zf(e[t])}}function yr(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Bt]||null;if(l===null)return null;n=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(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(aa)try{var br={};Object.defineProperty(br,"passive",{get:function(){yu=!0}}),window.addEventListener("test",br,br),window.removeEventListener("test",br,br)}catch{yu=!1}var Ua=null,bu=null,zi=null;function Uf(){if(zi)return zi;var e,t=bu,n=t.length,l,o="value"in Ua?Ua.value:Ua.textContent,c=o.length;for(e=0;e<n&&t[e]===o[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===o[c-l];l++);return zi=o.slice(e,1<l?1-l:void 0)}function Di(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 Ui(){return!0}function Lf(){return!1}function It(e){function t(n,l,o,c,h){this._reactName=n,this._targetInst=o,this.type=l,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(c):c[j]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ui:Lf,this.isPropagationStopped=Lf,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var Ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Li=It(Ml),jr=v({},Ml,{view:0,detail:0}),b0=It(jr),ju,Nu,Nr,Hi=v({},jr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wu,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!==Nr&&(Nr&&e.type==="mousemove"?(ju=e.screenX-Nr.screenX,Nu=e.screenY-Nr.screenY):Nu=ju=0,Nr=e),ju)},movementY:function(e){return"movementY"in e?e.movementY:Nu}}),Hf=It(Hi),j0=v({},Hi,{dataTransfer:0}),N0=It(j0),S0=v({},jr,{relatedTarget:0}),Su=It(S0),w0=v({},Ml,{animationName:0,elapsedTime:0,pseudoElement:0}),C0=It(w0),E0=v({},Ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),T0=It(E0),k0=v({},Ml,{data:0}),qf=It(k0),M0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O0={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"},A0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function R0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=A0[e])?!!t[e]:!1}function wu(){return R0}var _0=v({},jr,{key:function(e){if(e.key){var t=M0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Di(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?O0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wu,charCode:function(e){return e.type==="keypress"?Di(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Di(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z0=It(_0),D0=v({},Hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bf=It(D0),U0=v({},jr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wu}),L0=It(U0),H0=v({},Ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),q0=It(H0),B0=v({},Hi,{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}),Q0=It(B0),G0=v({},Ml,{newState:0,oldState:0}),Y0=It(G0),K0=[9,13,27,32],Cu=aa&&"CompositionEvent"in window,Sr=null;aa&&"documentMode"in document&&(Sr=document.documentMode);var $0=aa&&"TextEvent"in window&&!Sr,Qf=aa&&(!Cu||Sr&&8<Sr&&11>=Sr),Gf=" ",Yf=!1;function Kf(e,t){switch(e){case"keyup":return K0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $f(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function X0(e,t){switch(e){case"compositionend":return $f(t);case"keypress":return t.which!==32?null:(Yf=!0,Gf);case"textInput":return e=t.data,e===Gf&&Yf?null:e;default:return null}}function V0(e,t){if(xs)return e==="compositionend"||!Cu&&Kf(e,t)?(e=Uf(),zi=bu=Ua=null,xs=!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 Qf&&t.locale!=="ko"?null:t.data;default:return null}}var Z0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Xf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Z0[e.type]:t==="textarea"}function Vf(e,t,n,l){ms?ps?ps.push(l):ps=[l]:ms=l,t=ko(t,"onChange"),0<t.length&&(n=new Li("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var wr=null,Cr=null;function J0(e){Mp(e,0)}function qi(e){var t=se(e);if(ds(t))return e}function Zf(e,t){if(e==="change")return t}var Jf=!1;if(aa){var Eu;if(aa){var Tu="oninput"in document;if(!Tu){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),Tu=typeof Ff.oninput=="function"}Eu=Tu}else Eu=!1;Jf=Eu&&(!document.documentMode||9<document.documentMode)}function Wf(){wr&&(wr.detachEvent("onpropertychange",If),Cr=wr=null)}function If(e){if(e.propertyName==="value"&&qi(Cr)){var t=[];Vf(t,Cr,e,gu(e)),Df(J0,t)}}function F0(e,t,n){e==="focusin"?(Wf(),wr=t,Cr=n,wr.attachEvent("onpropertychange",If)):e==="focusout"&&Wf()}function W0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(Cr)}function I0(e,t){if(e==="click")return qi(t)}function P0(e,t){if(e==="input"||e==="change")return qi(t)}function ev(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var un=typeof Object.is=="function"?Object.is:ev;function Er(e,t){if(un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var o=n[l];if(!In.call(t,o)||!un(e[o],t[o]))return!1}return!0}function Pf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eh(e,t){var n=Pf(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pf(n)}}function th(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?th(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tl(e.document)}return t}function ku(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 tv=aa&&"documentMode"in document&&11>=document.documentMode,gs=null,Mu=null,Tr=null,Ou=!1;function ah(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ou||gs==null||gs!==Tl(l)||(l=gs,"selectionStart"in l&&ku(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}),Tr&&Er(Tr,l)||(Tr=l,l=ko(Mu,"onSelect"),0<l.length&&(t=new Li("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=gs)))}function Ol(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vs={animationend:Ol("Animation","AnimationEnd"),animationiteration:Ol("Animation","AnimationIteration"),animationstart:Ol("Animation","AnimationStart"),transitionrun:Ol("Transition","TransitionRun"),transitionstart:Ol("Transition","TransitionStart"),transitioncancel:Ol("Transition","TransitionCancel"),transitionend:Ol("Transition","TransitionEnd")},Au={},lh={};aa&&(lh=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function Al(e){if(Au[e])return Au[e];if(!vs[e])return e;var t=vs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in lh)return Au[e]=t[n];return e}var sh=Al("animationend"),rh=Al("animationiteration"),ih=Al("animationstart"),nv=Al("transitionrun"),av=Al("transitionstart"),lv=Al("transitioncancel"),oh=Al("transitionend"),uh=new Map,Ru="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(" ");Ru.push("scrollEnd");function Rn(e,t){uh.set(e,t),Ce(t,[e])}var Bi=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)},bn=[],ys=0,_u=0;function Qi(){for(var e=ys,t=_u=ys=0;t<e;){var n=bn[t];bn[t++]=null;var l=bn[t];bn[t++]=null;var o=bn[t];bn[t++]=null;var c=bn[t];if(bn[t++]=null,l!==null&&o!==null){var h=l.pending;h===null?o.next=o:(o.next=h.next,h.next=o),l.pending=o}c!==0&&ch(n,o,c)}}function Gi(e,t,n,l){bn[ys++]=e,bn[ys++]=t,bn[ys++]=n,bn[ys++]=l,_u|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function zu(e,t,n,l){return Gi(e,t,n,l),Yi(e)}function Rl(e,t){return Gi(e,null,null,t),Yi(e)}function ch(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var o=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-Xt(n),e=c.hiddenUpdates,l=e[o],l===null?e[o]=[t]:l.push(t),t.lane=n|536870912),c):null}function Yi(e){if(50<Jr)throw Jr=0,Yc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bs={};function sv(e,t,n,l){this.tag=e,this.key=n,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 cn(e,t,n,l){return new sv(e,t,n,l)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function la(e,t){var n=e.alternate;return n===null?(n=cn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function dh(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ki(e,t,n,l,o,c){var h=0;if(l=e,typeof e=="function")Du(e)&&(h=1);else if(typeof e=="string")h=cy(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=cn(31,n,t,o),e.elementType=Z,e.lanes=c,e;case A:return _l(n.children,o,c,t);case O:h=8,o|=24;break;case z:return e=cn(12,n,t,o|2),e.elementType=z,e.lanes=c,e;case D:return e=cn(13,n,t,o),e.elementType=D,e.lanes=c,e;case U:return e=cn(19,n,t,o),e.elementType=U,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:h=10;break e;case K:h=9;break e;case S:h=11;break e;case B:h=14;break e;case q:h=16,l=null;break e}h=29,n=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=cn(h,n,t,o),t.elementType=e,t.type=l,t.lanes=c,t}function _l(e,t,n,l){return e=cn(7,e,l,t),e.lanes=n,e}function Uu(e,t,n){return e=cn(6,e,null,t),e.lanes=n,e}function fh(e){var t=cn(18,null,null,0);return t.stateNode=e,t}function Lu(e,t,n){return t=cn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hh=new WeakMap;function jn(e,t){if(typeof e=="object"&&e!==null){var n=hh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rt(t)},hh.set(e,t),t)}return{value:e,source:t,stack:Rt(t)}}var js=[],Ns=0,$i=null,kr=0,Nn=[],Sn=0,La=null,Yn=1,Kn="";function sa(e,t){js[Ns++]=kr,js[Ns++]=$i,$i=e,kr=t}function mh(e,t,n){Nn[Sn++]=Yn,Nn[Sn++]=Kn,Nn[Sn++]=La,La=e;var l=Yn;e=Kn;var o=32-Xt(l)-1;l&=~(1<<o),n+=1;var c=32-Xt(t)+o;if(30<c){var h=o-o%5;c=(l&(1<<h)-1).toString(32),l>>=h,o-=h,Yn=1<<32-Xt(t)+o|n<<o|l,Kn=c+e}else Yn=1<<c|n<<o|l,Kn=e}function Hu(e){e.return!==null&&(sa(e,1),mh(e,1,0))}function qu(e){for(;e===$i;)$i=js[--Ns],js[Ns]=null,kr=js[--Ns],js[Ns]=null;for(;e===La;)La=Nn[--Sn],Nn[Sn]=null,Kn=Nn[--Sn],Nn[Sn]=null,Yn=Nn[--Sn],Nn[Sn]=null}function ph(e,t){Nn[Sn++]=Yn,Nn[Sn++]=Kn,Nn[Sn++]=La,Yn=t.id,Kn=t.overflow,La=e}var zt=null,rt=null,qe=!1,Ha=null,wn=!1,Bu=Error(u(519));function qa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mr(jn(t,e)),Bu}function xh(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[dt]=e,t[Bt]=l,n){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(n=0;n<Wr.length;n++)ze(Wr[n],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Mf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Af(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||_p(t.textContent,n)?(l.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),l.onScroll!=null&&ze("scroll",t),l.onScrollEnd!=null&&ze("scrollend",t),l.onClick!=null&&(t.onclick=na),t=!0):t=!1,t||qa(e,!0)}function gh(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:wn=!1;return;case 27:case 3:wn=!0;return;default:zt=zt.return}}function Ss(e){if(e!==zt)return!1;if(!qe)return gh(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||ld(e.type,e.memoizedProps)),n=!n),n&&rt&&qa(e),gh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));rt=Gp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));rt=Gp(e)}else t===27?(t=rt,Pa(e.type)?(e=ud,ud=null,rt=e):rt=t):rt=zt?En(e.stateNode.nextSibling):null;return!0}function zl(){rt=zt=null,qe=!1}function Qu(){var e=Ha;return e!==null&&(nn===null?nn=e:nn.push.apply(nn,e),Ha=null),e}function Mr(e){Ha===null?Ha=[e]:Ha.push(e)}var Gu=E(null),Dl=null,ra=null;function Ba(e,t,n){I(Gu,t._currentValue),t._currentValue=n}function ia(e){e._currentValue=Gu.current,H(Gu)}function Yu(e,t,n){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===n)break;e=e.return}}function Ku(e,t,n,l){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var h=o.child;c=c.firstContext;e:for(;c!==null;){var j=c;c=o;for(var k=0;k<t.length;k++)if(j.context===t[k]){c.lanes|=n,j=c.alternate,j!==null&&(j.lanes|=n),Yu(c.return,n,e),l||(h=null);break e}c=j.next}}else if(o.tag===18){if(h=o.return,h===null)throw Error(u(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),Yu(h,n,e),h=null}else h=o.child;if(h!==null)h.return=o;else for(h=o;h!==null;){if(h===e){h=null;break}if(o=h.sibling,o!==null){o.return=h.return,h=o;break}h=h.return}o=h}}function ws(e,t,n,l){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var h=o.alternate;if(h===null)throw Error(u(387));if(h=h.memoizedProps,h!==null){var j=o.type;un(o.pendingProps.value,h.value)||(e!==null?e.push(j):e=[j])}}else if(o===ce.current){if(h=o.alternate,h===null)throw Error(u(387));h.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(ni):e=[ni])}o=o.return}e!==null&&Ku(t,e,n,l),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ul(e){Dl=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return vh(Dl,e)}function Vi(e,t){return Dl===null&&Ul(e),vh(e,t)}function vh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ra===null){if(e===null)throw Error(u(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return n}var rv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},iv=s.unstable_scheduleCallback,ov=s.unstable_NormalPriority,vt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $u(){return{controller:new rv,data:new Map,refCount:0}}function Or(e){e.refCount--,e.refCount===0&&iv(ov,function(){e.controller.abort()})}var Ar=null,Xu=0,Cs=0,Es=null;function uv(e,t){if(Ar===null){var n=Ar=[];Xu=0,Cs=Jc(),Es={status:"pending",value:void 0,then:function(l){n.push(l)}}}return Xu++,t.then(yh,yh),t}function yh(){if(--Xu===0&&Ar!==null){Es!==null&&(Es.status="fulfilled");var e=Ar;Ar=null,Cs=0,Es=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cv(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(o){n.push(o)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var o=0;o<n.length;o++)(0,n[o])(t)},function(o){for(l.status="rejected",l.reason=o,o=0;o<n.length;o++)(0,n[o])(void 0)}),l}var bh=_.S;_.S=function(e,t){ap=Xe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&uv(e,t),bh!==null&&bh(e,t)};var Ll=E(null);function Vu(){var e=Ll.current;return e!==null?e:tt.pooledCache}function Zi(e,t){t===null?I(Ll,Ll.current):I(Ll,t.pool)}function jh(){var e=Vu();return e===null?null:{parent:vt._currentValue,pool:e}}var Ts=Error(u(460)),Zu=Error(u(474)),Ji=Error(u(542)),Fi={then:function(){}};function Nh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Sh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(na,na),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e;default:if(typeof t.status=="string")t.then(na,na);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=l}},function(l){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e}throw ql=t,Ts}}function Hl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ql=n,Ts):n}}var ql=null;function wh(){if(ql===null)throw Error(u(459));var e=ql;return ql=null,e}function Ch(e){if(e===Ts||e===Ji)throw Error(u(483))}var ks=null,Rr=0;function Wi(e){var t=Rr;return Rr+=1,ks===null&&(ks=[]),Sh(ks,e,t)}function _r(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ii(e,t){throw t.$$typeof===C?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Eh(e){function t(L,R){if(e){var G=L.deletions;G===null?(L.deletions=[R],L.flags|=16):G.push(R)}}function n(L,R){if(!e)return null;for(;R!==null;)t(L,R),R=R.sibling;return null}function l(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function o(L,R){return L=la(L,R),L.index=0,L.sibling=null,L}function c(L,R,G){return L.index=G,e?(G=L.alternate,G!==null?(G=G.index,G<R?(L.flags|=67108866,R):G):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function h(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function j(L,R,G,te){return R===null||R.tag!==6?(R=Uu(G,L.mode,te),R.return=L,R):(R=o(R,G),R.return=L,R)}function k(L,R,G,te){var je=G.type;return je===A?P(L,R,G.props.children,te,G.key):R!==null&&(R.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===q&&Hl(je)===R.type)?(R=o(R,G.props),_r(R,G),R.return=L,R):(R=Ki(G.type,G.key,G.props,null,L.mode,te),_r(R,G),R.return=L,R)}function Y(L,R,G,te){return R===null||R.tag!==4||R.stateNode.containerInfo!==G.containerInfo||R.stateNode.implementation!==G.implementation?(R=Lu(G,L.mode,te),R.return=L,R):(R=o(R,G.children||[]),R.return=L,R)}function P(L,R,G,te,je){return R===null||R.tag!==7?(R=_l(G,L.mode,te,je),R.return=L,R):(R=o(R,G),R.return=L,R)}function ae(L,R,G){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Uu(""+R,L.mode,G),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case T:return G=Ki(R.type,R.key,R.props,null,L.mode,G),_r(G,R),G.return=L,G;case w:return R=Lu(R,L.mode,G),R.return=L,R;case q:return R=Hl(R),ae(L,R,G)}if(le(R)||Q(R))return R=_l(R,L.mode,G,null),R.return=L,R;if(typeof R.then=="function")return ae(L,Wi(R),G);if(R.$$typeof===N)return ae(L,Vi(L,R),G);Ii(L,R)}return null}function X(L,R,G,te){var je=R!==null?R.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return je!==null?null:j(L,R,""+G,te);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case T:return G.key===je?k(L,R,G,te):null;case w:return G.key===je?Y(L,R,G,te):null;case q:return G=Hl(G),X(L,R,G,te)}if(le(G)||Q(G))return je!==null?null:P(L,R,G,te,null);if(typeof G.then=="function")return X(L,R,Wi(G),te);if(G.$$typeof===N)return X(L,R,Vi(L,G),te);Ii(L,G)}return null}function V(L,R,G,te,je){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return L=L.get(G)||null,j(R,L,""+te,je);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case T:return L=L.get(te.key===null?G:te.key)||null,k(R,L,te,je);case w:return L=L.get(te.key===null?G:te.key)||null,Y(R,L,te,je);case q:return te=Hl(te),V(L,R,G,te,je)}if(le(te)||Q(te))return L=L.get(G)||null,P(R,L,te,je,null);if(typeof te.then=="function")return V(L,R,G,Wi(te),je);if(te.$$typeof===N)return V(L,R,G,Vi(R,te),je);Ii(R,te)}return null}function ge(L,R,G,te){for(var je=null,Qe=null,ve=R,Me=R=0,He=null;ve!==null&&Me<G.length;Me++){ve.index>Me?(He=ve,ve=null):He=ve.sibling;var Ge=X(L,ve,G[Me],te);if(Ge===null){ve===null&&(ve=He);break}e&&ve&&Ge.alternate===null&&t(L,ve),R=c(Ge,R,Me),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge,ve=He}if(Me===G.length)return n(L,ve),qe&&sa(L,Me),je;if(ve===null){for(;Me<G.length;Me++)ve=ae(L,G[Me],te),ve!==null&&(R=c(ve,R,Me),Qe===null?je=ve:Qe.sibling=ve,Qe=ve);return qe&&sa(L,Me),je}for(ve=l(ve);Me<G.length;Me++)He=V(ve,L,Me,G[Me],te),He!==null&&(e&&He.alternate!==null&&ve.delete(He.key===null?Me:He.key),R=c(He,R,Me),Qe===null?je=He:Qe.sibling=He,Qe=He);return e&&ve.forEach(function(ll){return t(L,ll)}),qe&&sa(L,Me),je}function Ne(L,R,G,te){if(G==null)throw Error(u(151));for(var je=null,Qe=null,ve=R,Me=R=0,He=null,Ge=G.next();ve!==null&&!Ge.done;Me++,Ge=G.next()){ve.index>Me?(He=ve,ve=null):He=ve.sibling;var ll=X(L,ve,Ge.value,te);if(ll===null){ve===null&&(ve=He);break}e&&ve&&ll.alternate===null&&t(L,ve),R=c(ll,R,Me),Qe===null?je=ll:Qe.sibling=ll,Qe=ll,ve=He}if(Ge.done)return n(L,ve),qe&&sa(L,Me),je;if(ve===null){for(;!Ge.done;Me++,Ge=G.next())Ge=ae(L,Ge.value,te),Ge!==null&&(R=c(Ge,R,Me),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge);return qe&&sa(L,Me),je}for(ve=l(ve);!Ge.done;Me++,Ge=G.next())Ge=V(ve,L,Me,Ge.value,te),Ge!==null&&(e&&Ge.alternate!==null&&ve.delete(Ge.key===null?Me:Ge.key),R=c(Ge,R,Me),Qe===null?je=Ge:Qe.sibling=Ge,Qe=Ge);return e&&ve.forEach(function(jy){return t(L,jy)}),qe&&sa(L,Me),je}function Pe(L,R,G,te){if(typeof G=="object"&&G!==null&&G.type===A&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case T:e:{for(var je=G.key;R!==null;){if(R.key===je){if(je=G.type,je===A){if(R.tag===7){n(L,R.sibling),te=o(R,G.props.children),te.return=L,L=te;break e}}else if(R.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===q&&Hl(je)===R.type){n(L,R.sibling),te=o(R,G.props),_r(te,G),te.return=L,L=te;break e}n(L,R);break}else t(L,R);R=R.sibling}G.type===A?(te=_l(G.props.children,L.mode,te,G.key),te.return=L,L=te):(te=Ki(G.type,G.key,G.props,null,L.mode,te),_r(te,G),te.return=L,L=te)}return h(L);case w:e:{for(je=G.key;R!==null;){if(R.key===je)if(R.tag===4&&R.stateNode.containerInfo===G.containerInfo&&R.stateNode.implementation===G.implementation){n(L,R.sibling),te=o(R,G.children||[]),te.return=L,L=te;break e}else{n(L,R);break}else t(L,R);R=R.sibling}te=Lu(G,L.mode,te),te.return=L,L=te}return h(L);case q:return G=Hl(G),Pe(L,R,G,te)}if(le(G))return ge(L,R,G,te);if(Q(G)){if(je=Q(G),typeof je!="function")throw Error(u(150));return G=je.call(G),Ne(L,R,G,te)}if(typeof G.then=="function")return Pe(L,R,Wi(G),te);if(G.$$typeof===N)return Pe(L,R,Vi(L,G),te);Ii(L,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,R!==null&&R.tag===6?(n(L,R.sibling),te=o(R,G),te.return=L,L=te):(n(L,R),te=Uu(G,L.mode,te),te.return=L,L=te),h(L)):n(L,R)}return function(L,R,G,te){try{Rr=0;var je=Pe(L,R,G,te);return ks=null,je}catch(ve){if(ve===Ts||ve===Ji)throw ve;var Qe=cn(29,ve,null,L.mode);return Qe.lanes=te,Qe.return=L,Qe}finally{}}}var Bl=Eh(!0),Th=Eh(!1),Qa=!1;function Ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fu(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 Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ya(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var o=l.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),l.pending=t,t=Yi(e),ch(e,null,n),t}return Gi(e,l,t,n),Yi(e)}function zr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Gn(e,n)}}function Wu(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var o=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?o=c=t:c=c.next=t}else o=c=t;n={baseState:l.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Iu=!1;function Dr(){if(Iu){var e=Es;if(e!==null)throw e}}function Ur(e,t,n,l){Iu=!1;var o=e.updateQueue;Qa=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,j=o.shared.pending;if(j!==null){o.shared.pending=null;var k=j,Y=k.next;k.next=null,h===null?c=Y:h.next=Y,h=k;var P=e.alternate;P!==null&&(P=P.updateQueue,j=P.lastBaseUpdate,j!==h&&(j===null?P.firstBaseUpdate=Y:j.next=Y,P.lastBaseUpdate=k))}if(c!==null){var ae=o.baseState;h=0,P=Y=k=null,j=c;do{var X=j.lane&-536870913,V=X!==j.lane;if(V?(Le&X)===X:(l&X)===X){X!==0&&X===Cs&&(Iu=!0),P!==null&&(P=P.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var ge=e,Ne=j;X=t;var Pe=n;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){ae=ge.call(Pe,ae,X);break e}ae=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,X=typeof ge=="function"?ge.call(Pe,ae,X):ge,X==null)break e;ae=v({},ae,X);break e;case 2:Qa=!0}}X=j.callback,X!==null&&(e.flags|=64,V&&(e.flags|=8192),V=o.callbacks,V===null?o.callbacks=[X]:V.push(X))}else V={lane:X,tag:j.tag,payload:j.payload,callback:j.callback,next:null},P===null?(Y=P=V,k=ae):P=P.next=V,h|=X;if(j=j.next,j===null){if(j=o.shared.pending,j===null)break;V=j,j=V.next,V.next=null,o.lastBaseUpdate=V,o.shared.pending=null}}while(!0);P===null&&(k=ae),o.baseState=k,o.firstBaseUpdate=Y,o.lastBaseUpdate=P,c===null&&(o.shared.lanes=0),Za|=h,e.lanes=h,e.memoizedState=ae}}function kh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Mh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)kh(n[e],t)}var Ms=E(null),Pi=E(0);function Oh(e,t){e=xa,I(Pi,e),I(Ms,t),xa=e|t.baseLanes}function Pu(){I(Pi,xa),I(Ms,Ms.current)}function ec(){xa=Pi.current,H(Ms),H(Pi)}var dn=E(null),Cn=null;function Ka(e){var t=e.alternate;I(xt,xt.current&1),I(dn,e),Cn===null&&(t===null||Ms.current!==null||t.memoizedState!==null)&&(Cn=e)}function tc(e){I(xt,xt.current),I(dn,e),Cn===null&&(Cn=e)}function Ah(e){e.tag===22?(I(xt,xt.current),I(dn,e),Cn===null&&(Cn=e)):$a()}function $a(){I(xt,xt.current),I(dn,dn.current)}function fn(e){H(dn),Cn===e&&(Cn=null),H(xt)}var xt=E(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||id(n)||od(n)))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 oa=0,Te=null,We=null,yt=null,to=!1,Os=!1,Ql=!1,no=0,Lr=0,As=null,dv=0;function ht(){throw Error(u(321))}function nc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!un(e[n],t[n]))return!1;return!0}function ac(e,t,n,l,o,c){return oa=c,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?mm:vc,Ql=!1,c=n(l,o),Ql=!1,Os&&(c=_h(t,n,l,o)),Rh(e),c}function Rh(e){_.H=Br;var t=We!==null&&We.next!==null;if(oa=0,yt=We=Te=null,to=!1,Lr=0,As=null,t)throw Error(u(300));e===null||bt||(e=e.dependencies,e!==null&&Xi(e)&&(bt=!0))}function _h(e,t,n,l){Te=e;var o=0;do{if(Os&&(As=null),Lr=0,Os=!1,25<=o)throw Error(u(301));if(o+=1,yt=We=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}_.H=pm,c=t(n,l)}while(Os);return c}function fv(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?Hr(t):t,e=e.useState()[0],(We!==null?We.memoizedState:null)!==e&&(Te.flags|=1024),t}function lc(){var e=no!==0;return no=0,e}function sc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rc(e){if(to){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}to=!1}oa=0,yt=We=Te=null,Os=!1,Lr=no=0,As=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Te.memoizedState=yt=e:yt=yt.next=e,yt}function gt(){if(We===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=yt===null?Te.memoizedState:yt.next;if(t!==null)yt=t,We=e;else{if(e===null)throw Te.alternate===null?Error(u(467)):Error(u(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},yt===null?Te.memoizedState=yt=e:yt=yt.next=e}return yt}function ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Hr(e){var t=Lr;return Lr+=1,As===null&&(As=[]),e=Sh(As,e,t),t=Te,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?mm:vc),e}function lo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Hr(e);if(e.$$typeof===N)return Dt(e)}throw Error(u(438,String(e)))}function ic(e){var t=null,n=Te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ao(),Te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=J;return t.index++,n}function ua(e,t){return typeof t=="function"?t(e):t}function so(e){var t=gt();return oc(t,We,e)}function oc(e,t,n){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=n;var o=e.baseQueue,c=l.pending;if(c!==null){if(o!==null){var h=o.next;o.next=c.next,c.next=h}t.baseQueue=o=c,l.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var j=h=null,k=null,Y=t,P=!1;do{var ae=Y.lane&-536870913;if(ae!==Y.lane?(Le&ae)===ae:(oa&ae)===ae){var X=Y.revertLane;if(X===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),ae===Cs&&(P=!0);else if((oa&X)===X){Y=Y.next,X===Cs&&(P=!0);continue}else ae={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},k===null?(j=k=ae,h=c):k=k.next=ae,Te.lanes|=X,Za|=X;ae=Y.action,Ql&&n(c,ae),c=Y.hasEagerState?Y.eagerState:n(c,ae)}else X={lane:ae,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},k===null?(j=k=X,h=c):k=k.next=X,Te.lanes|=ae,Za|=ae;Y=Y.next}while(Y!==null&&Y!==t);if(k===null?h=c:k.next=j,!un(c,e.memoizedState)&&(bt=!0,P&&(n=Es,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=k,l.lastRenderedState=c}return o===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function uc(e){var t=gt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,o=n.pending,c=t.memoizedState;if(o!==null){n.pending=null;var h=o=o.next;do c=e(c,h.action),h=h.next;while(h!==o);un(c,t.memoizedState)||(bt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function zh(e,t,n){var l=Te,o=gt(),c=qe;if(c){if(n===void 0)throw Error(u(407));n=n()}else n=t();var h=!un((We||o).memoizedState,n);if(h&&(o.memoizedState=n,bt=!0),o=o.queue,fc(Lh.bind(null,l,o,e),[e]),o.getSnapshot!==t||h||yt!==null&&yt.memoizedState.tag&1){if(l.flags|=2048,Rs(9,{destroy:void 0},Uh.bind(null,l,o,n,t),null),tt===null)throw Error(u(349));c||(oa&127)!==0||Dh(l,t,n)}return n}function Dh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t=ao(),Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uh(e,t,n,l){t.value=n,t.getSnapshot=l,Hh(t)&&qh(e)}function Lh(e,t,n){return n(function(){Hh(t)&&qh(e)})}function Hh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!un(e,n)}catch{return!0}}function qh(e){var t=Rl(e,2);t!==null&&an(t,e,2)}function cc(e){var t=Vt();if(typeof e=="function"){var n=e;if(e=n(),Ql){$t(!0);try{n()}finally{$t(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:e},t}function Bh(e,t,n,l){return e.baseState=n,oc(e,We,typeof l=="function"?l:ua)}function hv(e,t,n,l,o){if(oo(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};_.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,Qh(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Qh(e,t){var n=t.action,l=t.payload,o=e.state;if(t.isTransition){var c=_.T,h={};_.T=h;try{var j=n(o,l),k=_.S;k!==null&&k(h,j),Gh(e,t,j)}catch(Y){dc(e,t,Y)}finally{c!==null&&h.types!==null&&(c.types=h.types),_.T=c}}else try{c=n(o,l),Gh(e,t,c)}catch(Y){dc(e,t,Y)}}function Gh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Yh(e,t,l)},function(l){return dc(e,t,l)}):Yh(e,t,n)}function Yh(e,t,n){t.status="fulfilled",t.value=n,Kh(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qh(e,n)))}function dc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,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 $h(e,t){return t}function Xh(e,t){if(qe){var n=tt.formState;if(n!==null){e:{var l=Te;if(qe){if(rt){t:{for(var o=rt,c=wn;o.nodeType!==8;){if(!c){o=null;break t}if(o=En(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){rt=En(o.nextSibling),l=o.data==="F!";break e}}qa(l)}l=!1}l&&(t=n[0])}}return n=Vt(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$h,lastRenderedState:t},n.queue=l,n=dm.bind(null,Te,l),l.dispatch=n,l=cc(!1),c=gc.bind(null,Te,!1,l.queue),l=Vt(),o={state:t,dispatch:null,action:e,pending:null},l.queue=o,n=hv.bind(null,Te,o,c,n),o.dispatch=n,l.memoizedState=e,[t,n,!1]}function Vh(e){var t=gt();return Zh(t,We,e)}function Zh(e,t,n){if(t=oc(e,t,$h)[0],e=so(ua)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Hr(t)}catch(h){throw h===Ts?Ji:h}else l=t;t=gt();var o=t.queue,c=o.dispatch;return n!==t.memoizedState&&(Te.flags|=2048,Rs(9,{destroy:void 0},mv.bind(null,o,n),null)),[l,c,e]}function mv(e,t){e.action=t}function Jh(e){var t=gt(),n=We;if(n!==null)return Zh(t,n,e);gt(),t=t.memoizedState,n=gt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Rs(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Te.updateQueue,t===null&&(t=ao(),Te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Fh(){return gt().memoizedState}function ro(e,t,n,l){var o=Vt();Te.flags|=e,o.memoizedState=Rs(1|t,{destroy:void 0},n,l===void 0?null:l)}function io(e,t,n,l){var o=gt();l=l===void 0?null:l;var c=o.memoizedState.inst;We!==null&&l!==null&&nc(l,We.memoizedState.deps)?o.memoizedState=Rs(t,c,n,l):(Te.flags|=e,o.memoizedState=Rs(1|t,c,n,l))}function Wh(e,t){ro(8390656,8,e,t)}function fc(e,t){io(2048,8,e,t)}function pv(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=ao(),Te.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ih(e){var t=gt().memoizedState;return pv({ref:t,nextImpl:e}),function(){if((Ye&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Ph(e,t){return io(4,2,e,t)}function em(e,t){return io(4,4,e,t)}function tm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nm(e,t,n){n=n!=null?n.concat([e]):null,io(4,4,tm.bind(null,t,e),n)}function hc(){}function am(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&nc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function lm(e,t){var n=gt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&nc(t,l[1]))return l[0];if(l=e(),Ql){$t(!0);try{e()}finally{$t(!1)}}return n.memoizedState=[l,t],l}function mc(e,t,n){return n===void 0||(oa&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=sp(),Te.lanes|=e,Za|=e,n)}function sm(e,t,n,l){return un(n,t)?n:Ms.current!==null?(e=mc(e,n,l),un(e,t)||(bt=!0),e):(oa&42)===0||(oa&1073741824)!==0&&(Le&261930)===0?(bt=!0,e.memoizedState=n):(e=sp(),Te.lanes|=e,Za|=e,t)}function rm(e,t,n,l,o){var c=F.p;F.p=c!==0&&8>c?c:8;var h=_.T,j={};_.T=j,gc(e,!1,t,n);try{var k=o(),Y=_.S;if(Y!==null&&Y(j,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var P=cv(k,l);qr(e,t,P,pn(e))}else qr(e,t,l,pn(e))}catch(ae){qr(e,t,{then:function(){},status:"rejected",reason:ae},pn())}finally{F.p=c,h!==null&&j.types!==null&&(h.types=j.types),_.T=h}}function xv(){}function pc(e,t,n,l){if(e.tag!==5)throw Error(u(476));var o=im(e).queue;rm(e,o,t,ie,n===null?xv:function(){return om(e),n(l)})}function im(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function om(e){var t=im(e);t.next===null&&(t=e.alternate.memoizedState),qr(e,t.next.queue,{},pn())}function xc(){return Dt(ni)}function um(){return gt().memoizedState}function cm(){return gt().memoizedState}function gv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pn();e=Ga(n);var l=Ya(t,e,n);l!==null&&(an(l,t,n),zr(l,t,n)),t={cache:$u()},e.payload=t;return}t=t.return}}function vv(e,t,n){var l=pn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oo(e)?fm(t,n):(n=zu(e,t,n,l),n!==null&&(an(n,e,l),hm(n,t,l)))}function dm(e,t,n){var l=pn();qr(e,t,n,l)}function qr(e,t,n,l){var o={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(oo(e))fm(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,j=c(h,n);if(o.hasEagerState=!0,o.eagerState=j,un(j,h))return Gi(e,t,o,0),tt===null&&Qi(),!1}catch{}finally{}if(n=zu(e,t,o,l),n!==null)return an(n,e,l),hm(n,t,l),!0}return!1}function gc(e,t,n,l){if(l={lane:2,revertLane:Jc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(u(479))}else t=zu(e,n,l,2),t!==null&&an(t,e,2)}function oo(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function fm(e,t){Os=to=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hm(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Gn(e,n)}}var Br={readContext:Dt,use:lo,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};Br.useEffectEvent=ht;var mm={readContext:Dt,use:lo,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Wh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,tm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=Vt();t=t===void 0?null:t;var l=e();if(Ql){$t(!0);try{e()}finally{$t(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Vt();if(n!==void 0){var o=n(t);if(Ql){$t(!0);try{n(t)}finally{$t(!1)}}}else o=t;return l.memoizedState=l.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},l.queue=e,e=e.dispatch=vv.bind(null,Te,e),[l.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=cc(e);var t=e.queue,n=dm.bind(null,Te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hc,useDeferredValue:function(e,t){var n=Vt();return mc(n,e,t)},useTransition:function(){var e=cc(!1);return e=rm.bind(null,Te,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Te,o=Vt();if(qe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),tt===null)throw Error(u(349));(Le&127)!==0||Dh(l,t,n)}o.memoizedState=n;var c={value:n,getSnapshot:t};return o.queue=c,Wh(Lh.bind(null,l,c,e),[e]),l.flags|=2048,Rs(9,{destroy:void 0},Uh.bind(null,l,c,n,t),null),n},useId:function(){var e=Vt(),t=tt.identifierPrefix;if(qe){var n=Kn,l=Yn;n=(l&~(1<<32-Xt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=no++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=dv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xc,useFormState:Xh,useActionState:Xh,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,Te,!0,n),n.dispatch=t,[e,t]},useMemoCache:ic,useCacheRefresh:function(){return Vt().memoizedState=gv.bind(null,Te)},useEffectEvent:function(e){var t=Vt(),n={impl:e};return t.memoizedState=n,function(){if((Ye&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Dt,use:lo,useCallback:am,useContext:Dt,useEffect:fc,useImperativeHandle:nm,useInsertionEffect:Ph,useLayoutEffect:em,useMemo:lm,useReducer:so,useRef:Fh,useState:function(){return so(ua)},useDebugValue:hc,useDeferredValue:function(e,t){var n=gt();return sm(n,We.memoizedState,e,t)},useTransition:function(){var e=so(ua)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Hr(e),t]},useSyncExternalStore:zh,useId:um,useHostTransitionStatus:xc,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var n=gt();return Bh(n,We,e,t)},useMemoCache:ic,useCacheRefresh:cm};vc.useEffectEvent=Ih;var pm={readContext:Dt,use:lo,useCallback:am,useContext:Dt,useEffect:fc,useImperativeHandle:nm,useInsertionEffect:Ph,useLayoutEffect:em,useMemo:lm,useReducer:uc,useRef:Fh,useState:function(){return uc(ua)},useDebugValue:hc,useDeferredValue:function(e,t){var n=gt();return We===null?mc(n,e,t):sm(n,We.memoizedState,e,t)},useTransition:function(){var e=uc(ua)[0],t=gt().memoizedState;return[typeof e=="boolean"?e:Hr(e),t]},useSyncExternalStore:zh,useId:um,useHostTransitionStatus:xc,useFormState:Jh,useActionState:Jh,useOptimistic:function(e,t){var n=gt();return We!==null?Bh(n,We,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ic,useCacheRefresh:cm};pm.useEffectEvent=Ih;function yc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=pn(),o=Ga(l);o.payload=t,n!=null&&(o.callback=n),t=Ya(e,o,l),t!==null&&(an(t,e,l),zr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=pn(),o=Ga(l);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Ya(e,o,l),t!==null&&(an(t,e,l),zr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pn(),l=Ga(n);l.tag=2,t!=null&&(l.callback=t),t=Ya(e,l,n),t!==null&&(an(t,e,n),zr(t,e,n))}};function xm(e,t,n,l,o,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,h):t.prototype&&t.prototype.isPureReactComponent?!Er(n,l)||!Er(o,c):!0}function gm(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&bc.enqueueReplaceState(t,t.state,null)}function Gl(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var o in e)n[o]===void 0&&(n[o]=e[o])}return n}function vm(e){Bi(e)}function ym(e){console.error(e)}function bm(e){Bi(e)}function uo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function jm(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function jc(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){uo(e,t)},n}function Nm(e){return e=Ga(e),e.tag=3,e}function Sm(e,t,n,l){var o=n.type.getDerivedStateFromError;if(typeof o=="function"){var c=l.value;e.payload=function(){return o(c)},e.callback=function(){jm(t,n,l)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){jm(t,n,l),typeof o!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var j=l.stack;this.componentDidCatch(l.value,{componentStack:j!==null?j:""})})}function yv(e,t,n,l,o){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&ws(t,n,o,!0),n=dn.current,n!==null){switch(n.tag){case 31:case 13:return Cn===null?No():n.alternate===null&&mt===0&&(mt=3),n.flags&=-257,n.flags|=65536,n.lanes=o,l===Fi?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),Xc(e,l,o)),!1;case 22:return n.flags|=65536,l===Fi?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),Xc(e,l,o)),!1}throw Error(u(435,n.tag))}return Xc(e,l,o),No(),!1}if(qe)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,l!==Bu&&(e=Error(u(422),{cause:l}),Mr(jn(e,n)))):(l!==Bu&&(t=Error(u(423),{cause:l}),Mr(jn(t,n))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,l=jn(l,n),o=jc(e.stateNode,l,o),Wu(e,o),mt!==4&&(mt=2)),!1;var c=Error(u(520),{cause:l});if(c=jn(c,n),Zr===null?Zr=[c]:Zr.push(c),mt!==4&&(mt=2),t===null)return!0;l=jn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=jc(n.stateNode,l,e),Wu(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ja===null||!Ja.has(c))))return n.flags|=65536,o&=-o,n.lanes|=o,o=Nm(o),Sm(o,e,n,l),Wu(n,o),!1}n=n.return}while(n!==null);return!1}var Nc=Error(u(461)),bt=!1;function Ut(e,t,n,l){t.child=e===null?Th(t,null,n,l):Bl(t,e.child,n,l)}function wm(e,t,n,l,o){n=n.render;var c=t.ref;if("ref"in l){var h={};for(var j in l)j!=="ref"&&(h[j]=l[j])}else h=l;return Ul(t),l=ac(e,t,n,h,c,o),j=lc(),e!==null&&!bt?(sc(e,t,o),ca(e,t,o)):(qe&&j&&Hu(t),t.flags|=1,Ut(e,t,l,o),t.child)}function Cm(e,t,n,l,o){if(e===null){var c=n.type;return typeof c=="function"&&!Du(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,Em(e,t,c,l,o)):(e=Ki(n.type,null,l,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Oc(e,o)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Er,n(h,l)&&e.ref===t.ref)return ca(e,t,o)}return t.flags|=1,e=la(c,l),e.ref=t.ref,e.return=t,t.child=e}function Em(e,t,n,l,o){if(e!==null){var c=e.memoizedProps;if(Er(c,l)&&e.ref===t.ref)if(bt=!1,t.pendingProps=l=c,Oc(e,o))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,ca(e,t,o)}return Sc(e,t,n,l,o)}function Tm(e,t,n,l){var o=l.children,c=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(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,o=0;l!==null;)o=o|l.lanes|l.childLanes,l=l.sibling;l=o&~c}else l=0,t.child=null;return km(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zi(t,c!==null?c.cachePool:null),c!==null?Oh(t,c):Pu(),Ah(t);else return l=t.lanes=536870912,km(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(Zi(t,c.cachePool),Oh(t,c),$a(),t.memoizedState=null):(e!==null&&Zi(t,null),Pu(),$a());return Ut(e,t,o,n),t.child}function Qr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function km(e,t,n,l,o){var c=Vu();return c=c===null?null:{parent:vt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&Zi(t,null),Pu(),Ah(t),e!==null&&ws(e,t,l,!0),t.childLanes=o,null}function co(e,t){return t=ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mm(e,t,n){return Bl(t,e.child,null,n),e=co(t,t.pendingProps),e.flags|=2,fn(t),t.memoizedState=null,e}function bv(e,t,n){var l=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(l.mode==="hidden")return e=co(t,l),t.lanes=536870912,Qr(null,e);if(tc(t),(e=rt)?(e=Qp(e,wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:Yn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},n=fh(e),n.return=t,t.child=n,zt=t,rt=null)):e=null,e===null)throw qa(t);return t.lanes=536870912,null}return co(t,l)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(tc(t),o)if(t.flags&256)t.flags&=-257,t=Mm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(bt||ws(e,t,n,!1),o=(n&e.childLanes)!==0,bt||o){if(l=tt,l!==null&&(h=rs(l,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,Rl(e,h),an(l,e,h),Nc;No(),t=Mm(e,t,n)}else e=c.treeContext,rt=En(h.nextSibling),zt=t,qe=!0,Ha=null,wn=!1,e!==null&&ph(t,e),t=co(t,l),t.flags|=4096;return t}return e=la(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fo(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Sc(e,t,n,l,o){return Ul(t),n=ac(e,t,n,l,void 0,o),l=lc(),e!==null&&!bt?(sc(e,t,o),ca(e,t,o)):(qe&&l&&Hu(t),t.flags|=1,Ut(e,t,n,o),t.child)}function Om(e,t,n,l,o,c){return Ul(t),t.updateQueue=null,n=_h(t,l,n,o),Rh(e),l=lc(),e!==null&&!bt?(sc(e,t,c),ca(e,t,c)):(qe&&l&&Hu(t),t.flags|=1,Ut(e,t,n,c),t.child)}function Am(e,t,n,l,o){if(Ul(t),t.stateNode===null){var c=bs,h=n.contextType;typeof h=="object"&&h!==null&&(c=Dt(h)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=bc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},Ju(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?Dt(h):bs,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(yc(t,n,h,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&bc.enqueueReplaceState(c,c.state,null),Ur(t,l,c,o),Dr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var j=t.memoizedProps,k=Gl(n,j);c.props=k;var Y=c.context,P=n.contextType;h=bs,typeof P=="object"&&P!==null&&(h=Dt(P));var ae=n.getDerivedStateFromProps;P=typeof ae=="function"||typeof c.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,P||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(j||Y!==h)&&gm(t,c,l,h),Qa=!1;var X=t.memoizedState;c.state=X,Ur(t,l,c,o),Dr(),Y=t.memoizedState,j||X!==Y||Qa?(typeof ae=="function"&&(yc(t,n,ae,l),Y=t.memoizedState),(k=Qa||xm(t,n,k,l,X,Y,h))?(P||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=Y),c.props=l,c.state=Y,c.context=h,l=k):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,Fu(e,t),h=t.memoizedProps,P=Gl(n,h),c.props=P,ae=t.pendingProps,X=c.context,Y=n.contextType,k=bs,typeof Y=="object"&&Y!==null&&(k=Dt(Y)),j=n.getDerivedStateFromProps,(Y=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==ae||X!==k)&&gm(t,c,l,k),Qa=!1,X=t.memoizedState,c.state=X,Ur(t,l,c,o),Dr();var V=t.memoizedState;h!==ae||X!==V||Qa||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof j=="function"&&(yc(t,n,j,l),V=t.memoizedState),(P=Qa||xm(t,n,P,l,X,V,k)||e!==null&&e.dependencies!==null&&Xi(e.dependencies))?(Y||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,V,k),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,V,k)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=V),c.props=l,c.state=V,c.context=k,l=P):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,fo(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Bl(t,e.child,null,o),t.child=Bl(t,null,n,o)):Ut(e,t,n,o),t.memoizedState=c.state,e=t.child):e=ca(e,t,o),e}function Rm(e,t,n,l){return zl(),t.flags|=256,Ut(e,t,n,l),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:jh()}}function Ec(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=mn),e}function _m(e,t,n){var l=t.pendingProps,o=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),h&&(o=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(o?Ka(t):$a(),(e=rt)?(e=Qp(e,wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:La!==null?{id:Yn,overflow:Kn}:null,retryLane:536870912,hydrationErrors:null},n=fh(e),n.return=t,t.child=n,zt=t,rt=null)):e=null,e===null)throw qa(t);return od(e)?t.lanes=32:t.lanes=536870912,null}var j=l.children;return l=l.fallback,o?($a(),o=t.mode,j=ho({mode:"hidden",children:j},o),l=_l(l,o,n,null),j.return=t,l.return=t,j.sibling=l,t.child=j,l=t.child,l.memoizedState=Cc(n),l.childLanes=Ec(e,h,n),t.memoizedState=wc,Qr(null,l)):(Ka(t),Tc(t,j))}var k=e.memoizedState;if(k!==null&&(j=k.dehydrated,j!==null)){if(c)t.flags&256?(Ka(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState!==null?($a(),t.child=e.child,t.flags|=128,t=null):($a(),j=l.fallback,o=t.mode,l=ho({mode:"visible",children:l.children},o),j=_l(j,o,n,null),j.flags|=2,l.return=t,j.return=t,l.sibling=j,t.child=l,Bl(t,e.child,null,n),l=t.child,l.memoizedState=Cc(n),l.childLanes=Ec(e,h,n),t.memoizedState=wc,t=Qr(null,l));else if(Ka(t),od(j)){if(h=j.nextSibling&&j.nextSibling.dataset,h)var Y=h.dgst;h=Y,l=Error(u(419)),l.stack="",l.digest=h,Mr({value:l,source:null,stack:null}),t=kc(e,t,n)}else if(bt||ws(e,t,n,!1),h=(n&e.childLanes)!==0,bt||h){if(h=tt,h!==null&&(l=rs(h,n),l!==0&&l!==k.retryLane))throw k.retryLane=l,Rl(e,l),an(h,e,l),Nc;id(j)||No(),t=kc(e,t,n)}else id(j)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,rt=En(j.nextSibling),zt=t,qe=!0,Ha=null,wn=!1,e!==null&&ph(t,e),t=Tc(t,l.children),t.flags|=4096);return t}return o?($a(),j=l.fallback,o=t.mode,k=e.child,Y=k.sibling,l=la(k,{mode:"hidden",children:l.children}),l.subtreeFlags=k.subtreeFlags&65011712,Y!==null?j=la(Y,j):(j=_l(j,o,n,null),j.flags|=2),j.return=t,l.return=t,l.sibling=j,t.child=l,Qr(null,l),l=t.child,j=e.child.memoizedState,j===null?j=Cc(n):(o=j.cachePool,o!==null?(k=vt._currentValue,o=o.parent!==k?{parent:k,pool:k}:o):o=jh(),j={baseLanes:j.baseLanes|n,cachePool:o}),l.memoizedState=j,l.childLanes=Ec(e,h,n),t.memoizedState=wc,Qr(e.child,l)):(Ka(t),n=e.child,e=n.sibling,n=la(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=cn(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return Bl(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zm(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Yu(e.return,t,n)}function Mc(e,t,n,l,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:o,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=n,h.tailMode=o,h.treeForkCount=c)}function Dm(e,t,n){var l=t.pendingProps,o=l.revealOrder,c=l.tail;l=l.children;var h=xt.current,j=(h&2)!==0;if(j?(h=h&1|2,t.flags|=128):h&=1,I(xt,h),Ut(e,t,l,n),l=qe?kr:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zm(e,n,t);else if(e.tag===19)zm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Mc(t,!1,o,n,c,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&eo(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Mc(t,!0,n,null,c,l);break;case"together":Mc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function ca(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Za|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ws(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=la(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=la(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xi(e)))}function jv(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),Ba(t,vt,e.memoizedState.cache),zl();break;case 27:case 5:ft(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:Ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ka(t),t.flags|=128,null):(n&t.child.childLanes)!==0?_m(e,t,n):(Ka(t),e=ca(e,t,n),e!==null?e.sibling:null);Ka(t);break;case 19:var o=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(ws(e,t,n,!1),l=(n&t.childLanes)!==0),o){if(l)return Dm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),I(xt,xt.current),l)break;return null;case 22:return t.lanes=0,Tm(e,t,n,t.pendingProps);case 24:Ba(t,vt,e.memoizedState.cache)}return ca(e,t,n)}function Um(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!Oc(e,n)&&(t.flags&128)===0)return bt=!1,jv(e,t,n);bt=(e.flags&131072)!==0}else bt=!1,qe&&(t.flags&1048576)!==0&&mh(t,kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Hl(t.elementType),t.type=e,typeof e=="function")Du(e)?(l=Gl(e,l),t.tag=1,t=Am(null,t,e,l,n)):(t.tag=0,t=Sc(null,t,e,l,n));else{if(e!=null){var o=e.$$typeof;if(o===S){t.tag=11,t=wm(null,t,e,l,n);break e}else if(o===B){t.tag=14,t=Cm(null,t,e,l,n);break e}}throw t=re(e)||e,Error(u(306,t,""))}}return t;case 0:return Sc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,o=Gl(l,t.pendingProps),Am(e,t,l,o,n);case 3:e:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(u(387));l=t.pendingProps;var c=t.memoizedState;o=c.element,Fu(e,t),Ur(t,l,null,n);var h=t.memoizedState;if(l=h.cache,Ba(t,vt,l),l!==c.cache&&Ku(t,[vt],n,!0),Dr(),l=h.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=Rm(e,t,l,n);break e}else if(l!==o){o=jn(Error(u(424)),t),Mr(o),t=Rm(e,t,l,n);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(rt=En(e.firstChild),zt=t,qe=!0,Ha=null,wn=!0,n=Th(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zl(),l===o){t=ca(e,t,n);break e}Ut(e,t,l,n)}t=t.child}return t;case 26:return fo(e,t),e===null?(n=Vp(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,l=Mo(ye.current).createElement(n),l[dt]=t,l[Bt]=e,Lt(l,n,e),me(l),t.stateNode=l):t.memoizedState=Vp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ft(t),e===null&&qe&&(l=t.stateNode=Kp(t.type,t.pendingProps,ye.current),zt=t,wn=!0,o=rt,Pa(t.type)?(ud=o,rt=En(l.firstChild)):rt=o),Ut(e,t,t.pendingProps.children,n),fo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((o=l=rt)&&(l=Wv(l,t.type,t.pendingProps,wn),l!==null?(t.stateNode=l,zt=t,rt=En(l.firstChild),wn=!1,o=!0):o=!1),o||qa(t)),ft(t),o=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,l=c.children,ld(o,c)?l=null:h!==null&&ld(o,h)&&(t.flags|=32),t.memoizedState!==null&&(o=ac(e,t,fv,null,null,n),ni._currentValue=o),fo(e,t),Ut(e,t,l,n),t.child;case 6:return e===null&&qe&&((e=n=rt)&&(n=Iv(n,t.pendingProps,wn),n!==null?(t.stateNode=n,zt=t,rt=null,e=!0):e=!1),e||qa(t)),null;case 13:return _m(e,t,n);case 4:return we(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Bl(t,null,l,n):Ut(e,t,l,n),t.child;case 11:return wm(e,t,t.type,t.pendingProps,n);case 7:return Ut(e,t,t.pendingProps,n),t.child;case 8:return Ut(e,t,t.pendingProps.children,n),t.child;case 12:return Ut(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Ba(t,t.type,l.value),Ut(e,t,l.children,n),t.child;case 9:return o=t.type._context,l=t.pendingProps.children,Ul(t),o=Dt(o),l=l(o),t.flags|=1,Ut(e,t,l,n),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,n);case 15:return Em(e,t,t.type,t.pendingProps,n);case 19:return Dm(e,t,n);case 31:return bv(e,t,n);case 22:return Tm(e,t,n,t.pendingProps);case 24:return Ul(t),l=Dt(vt),e===null?(o=Vu(),o===null&&(o=tt,c=$u(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=n),o=c),t.memoizedState={parent:l,cache:o},Ju(t),Ba(t,vt,o)):((e.lanes&n)!==0&&(Fu(e,t),Ur(t,null,null,n),Dr()),o=e.memoizedState,c=t.memoizedState,o.parent!==l?(o={parent:l,cache:l},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ba(t,vt,l)):(l=c.cache,Ba(t,vt,l),l!==o.cache&&Ku(t,[vt],n,!0))),Ut(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function da(e){e.flags|=4}function Ac(e,t,n,l,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(up())e.flags|=8192;else throw ql=Fi,Zu}else e.flags&=-16777217}function Lm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ip(t))if(up())e.flags|=8192;else throw ql=Fi,Zu}function mo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Mi():536870912,e.lanes|=t,Us|=t)}function Gr(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags&65011712,l|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,l|=o.subtreeFlags,l|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Nv(e,t,n){var l=t.pendingProps;switch(qu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ia(vt),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ss(t)?da(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Qu())),it(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(da(t),c!==null?(it(t),Lm(t,c)):(it(t),Ac(t,o,null,l,n))):c?c!==e.memoizedState?(da(t),it(t),Lm(t,c)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&da(t),it(t),Ac(t,o,e,l,n)),null;case 27:if(Yt(t),n=ye.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&da(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return it(t),null}e=oe.current,Ss(t)?xh(t):(e=Kp(o,l,n),t.stateNode=e,da(t))}return it(t),null;case 5:if(Yt(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&da(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return it(t),null}if(c=oe.current,Ss(t))xh(t);else{var h=Mo(ye.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?h.createElement(o,{is:l.is}):h.createElement(o)}}c[dt]=t,c[Bt]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Lt(c,o,l),o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&da(t)}}return it(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&da(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=ye.current,Ss(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,o=zt,o!==null)switch(o.tag){case 27:case 5:l=o.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||_p(e.nodeValue,n)),e||qa(t,!0)}else e=Mo(e).createTextNode(l),e[dt]=t,t.stateNode=e}return it(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ss(t),n!==null){if(e===null){if(!l)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[dt]=t}else zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else n=Qu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(fn(t),t):(fn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return it(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Ss(t),l!==null&&l.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[dt]=t}else zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),o=!1}else o=Qu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(fn(t),t):(fn(t),null)}return fn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,o=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(o=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==o&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),mo(t,t.updateQueue),it(t),null);case 4:return ke(),e===null&&Pc(t.stateNode.containerInfo),it(t),null;case 10:return ia(t.type),it(t),null;case 19:if(H(xt),l=t.memoizedState,l===null)return it(t),null;if(o=(t.flags&128)!==0,c=l.rendering,c===null)if(o)Gr(l,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=eo(e),c!==null){for(t.flags|=128,Gr(l,!1),e=c.updateQueue,t.updateQueue=e,mo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)dh(n,e),n=n.sibling;return I(xt,xt.current&1|2),qe&&sa(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Xe()>yo&&(t.flags|=128,o=!0,Gr(l,!1),t.lanes=4194304)}else{if(!o)if(e=eo(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,mo(t,e),Gr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!qe)return it(t),null}else 2*Xe()-l.renderingStartTime>yo&&n!==536870912&&(t.flags|=128,o=!0,Gr(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Xe(),e.sibling=null,n=xt.current,I(xt,o?n&1|2:n&1),qe&&sa(t,l.treeForkCount),e):(it(t),null);case 22:case 23:return fn(t),ec(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&mo(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&H(Ll),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ia(vt),it(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Sv(e,t){switch(qu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ia(vt),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Yt(t),null;case 31:if(t.memoizedState!==null){if(fn(t),t.alternate===null)throw Error(u(340));zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(fn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(xt),null;case 4:return ke(),null;case 10:return ia(t.type),null;case 22:case 23:return fn(t),ec(),e!==null&&H(Ll),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ia(vt),null;case 25:return null;default:return null}}function Hm(e,t){switch(qu(t),t.tag){case 3:ia(vt),ke();break;case 26:case 27:case 5:Yt(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&fn(t);break;case 13:fn(t);break;case 19:H(xt);break;case 10:ia(t.type);break;case 22:case 23:fn(t),ec(),e!==null&&H(Ll);break;case 24:ia(vt)}}function Yr(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var o=l.next;n=o;do{if((n.tag&e)===e){l=void 0;var c=n.create,h=n.inst;l=c(),h.destroy=l}n=n.next}while(n!==o)}}catch(j){Je(t,t.return,j)}}function Xa(e,t,n){try{var l=t.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var c=o.next;l=c;do{if((l.tag&e)===e){var h=l.inst,j=h.destroy;if(j!==void 0){h.destroy=void 0,o=t;var k=n,Y=j;try{Y()}catch(P){Je(o,k,P)}}}l=l.next}while(l!==c)}}catch(P){Je(t,t.return,P)}}function qm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Mh(t,n)}catch(l){Je(e,e.return,l)}}}function Bm(e,t,n){n.props=Gl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Je(e,t,l)}}function Kr(e,t){try{var n=e.ref;if(n!==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 n=="function"?e.refCleanup=n(l):n.current=l}}catch(o){Je(e,t,o)}}function $n(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(o){Je(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(o){Je(e,t,o)}else n.current=null}function Qm(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(o){Je(e,e.return,o)}}function Rc(e,t,n){try{var l=e.stateNode;$v(l,e.type,n,t),l[Bt]=t}catch(o){Je(e,e.return,o)}}function Gm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pa(e.type)||e.tag===4}function _c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gm(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&&Pa(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 zc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=na));else if(l!==4&&(l===27&&Pa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(zc(e,t,n),e=e.sibling;e!==null;)zc(e,t,n),e=e.sibling}function po(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Pa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(po(e,t,n),e=e.sibling;e!==null;)po(e,t,n),e=e.sibling}function Ym(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);Lt(t,l,n),t[dt]=e,t[Bt]=n}catch(c){Je(e,e.return,c)}}var fa=!1,jt=!1,Dc=!1,Km=typeof WeakSet=="function"?WeakSet:Set,kt=null;function wv(e,t){if(e=e.containerInfo,nd=Uo,e=nh(e),ku(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var o=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,j=-1,k=-1,Y=0,P=0,ae=e,X=null;t:for(;;){for(var V;ae!==n||o!==0&&ae.nodeType!==3||(j=h+o),ae!==c||l!==0&&ae.nodeType!==3||(k=h+l),ae.nodeType===3&&(h+=ae.nodeValue.length),(V=ae.firstChild)!==null;)X=ae,ae=V;for(;;){if(ae===e)break t;if(X===n&&++Y===o&&(j=h),X===c&&++P===l&&(k=h),(V=ae.nextSibling)!==null)break;ae=X,X=ae.parentNode}ae=V}n=j===-1||k===-1?null:{start:j,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(ad={focusedElem:e,selectionRange:n},Uo=!1,kt=t;kt!==null;)if(t=kt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,kt=e;else for(;kt!==null;){switch(t=kt,c=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(n=0;n<e.length;n++)o=e[n],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,o=c.memoizedProps,c=c.memoizedState,l=n.stateNode;try{var ge=Gl(n.type,o);e=l.getSnapshotBeforeUpdate(ge,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){Je(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,kt=e;break}kt=t.return}}function $m(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:ma(e,n),l&4&&Yr(5,n);break;case 1:if(ma(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){Je(n,n.return,h)}else{var o=Gl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){Je(n,n.return,h)}}l&64&&qm(n),l&512&&Kr(n,n.return);break;case 3:if(ma(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Mh(e,t)}catch(h){Je(n,n.return,h)}}break;case 27:t===null&&l&4&&Ym(n);case 26:case 5:ma(e,n),t===null&&l&4&&Qm(n),l&512&&Kr(n,n.return);break;case 12:ma(e,n);break;case 31:ma(e,n),l&4&&Zm(e,n);break;case 13:ma(e,n),l&4&&Jm(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_v.bind(null,n),Pv(e,n))));break;case 22:if(l=n.memoizedState!==null||fa,!l){t=t!==null&&t.memoizedState!==null||jt,o=fa;var c=jt;fa=l,(jt=t)&&!c?pa(e,n,(n.subtreeFlags&8772)!==0):ma(e,n),fa=o,jt=c}break;case 30:break;default:ma(e,n)}}function Xm(e){var t=e.alternate;t!==null&&(e.alternate=null,Xm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&us(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 ut=null,Pt=!1;function ha(e,t,n){for(n=n.child;n!==null;)Vm(e,t,n),n=n.sibling}function Vm(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Ma,n)}catch{}switch(n.tag){case 26:jt||$n(n,t),ha(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:jt||$n(n,t);var l=ut,o=Pt;Pa(n.type)&&(ut=n.stateNode,Pt=!1),ha(e,t,n),Pr(n.stateNode),ut=l,Pt=o;break;case 5:jt||$n(n,t);case 6:if(l=ut,o=Pt,ut=null,ha(e,t,n),ut=l,Pt=o,ut!==null)if(Pt)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(n.stateNode)}catch(c){Je(n,t,c)}else try{ut.removeChild(n.stateNode)}catch(c){Je(n,t,c)}break;case 18:ut!==null&&(Pt?(e=ut,qp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ks(e)):qp(ut,n.stateNode));break;case 4:l=ut,o=Pt,ut=n.stateNode.containerInfo,Pt=!0,ha(e,t,n),ut=l,Pt=o;break;case 0:case 11:case 14:case 15:Xa(2,n,t),jt||Xa(4,n,t),ha(e,t,n);break;case 1:jt||($n(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Bm(n,t,l)),ha(e,t,n);break;case 21:ha(e,t,n);break;case 22:jt=(l=jt)||n.memoizedState!==null,ha(e,t,n),jt=l;break;default:ha(e,t,n)}}function Zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ks(e)}catch(n){Je(t,t.return,n)}}}function Jm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ks(e)}catch(n){Je(t,t.return,n)}}function Cv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Km),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Km),t;default:throw Error(u(435,e.tag))}}function xo(e,t){var n=Cv(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var o=zv.bind(null,e,l);l.then(o,o)}})}function en(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var o=n[l],c=e,h=t,j=h;e:for(;j!==null;){switch(j.tag){case 27:if(Pa(j.type)){ut=j.stateNode,Pt=!1;break e}break;case 5:ut=j.stateNode,Pt=!1;break e;case 3:case 4:ut=j.stateNode.containerInfo,Pt=!0;break e}j=j.return}if(ut===null)throw Error(u(160));Vm(c,h,o),ut=null,Pt=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fm(t,e),t=t.sibling}var _n=null;function Fm(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:en(t,e),tn(e),l&4&&(Xa(3,e,e.return),Yr(3,e),Xa(5,e,e.return));break;case 1:en(t,e),tn(e),l&512&&(jt||n===null||$n(n,n.return)),l&64&&fa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var o=_n;if(en(t,e),tn(e),l&512&&(jt||n===null||$n(n,n.return)),l&4){var c=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(l){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Da]||c[dt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(l),o.head.insertBefore(c,o.querySelector("head > title"))),Lt(c,l,n),c[dt]=e,me(c),l=c;break e;case"link":var h=Fp("link","href",o).get(l+(n.href||""));if(h){for(var j=0;j<h.length;j++)if(c=h[j],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(j,1);break t}}c=o.createElement(l),Lt(c,l,n),o.head.appendChild(c);break;case"meta":if(h=Fp("meta","content",o).get(l+(n.content||""))){for(j=0;j<h.length;j++)if(c=h[j],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(j,1);break t}}c=o.createElement(l),Lt(c,l,n),o.head.appendChild(c);break;default:throw Error(u(468,l))}c[dt]=e,me(c),l=c}e.stateNode=l}else Wp(o,e.type,e.stateNode);else e.stateNode=Jp(o,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?Wp(o,e.type,e.stateNode):Jp(o,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Rc(e,e.memoizedProps,n.memoizedProps)}break;case 27:en(t,e),tn(e),l&512&&(jt||n===null||$n(n,n.return)),n!==null&&l&4&&Rc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(en(t,e),tn(e),l&512&&(jt||n===null||$n(n,n.return)),e.flags&32){o=e.stateNode;try{hs(o,"")}catch(ge){Je(e,e.return,ge)}}l&4&&e.stateNode!=null&&(o=e.memoizedProps,Rc(e,o,n!==null?n.memoizedProps:o)),l&1024&&(Dc=!0);break;case 6:if(en(t,e),tn(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){Je(e,e.return,ge)}}break;case 3:if(Ro=null,o=_n,_n=Oo(t.containerInfo),en(t,e),_n=o,tn(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Ks(t.containerInfo)}catch(ge){Je(e,e.return,ge)}Dc&&(Dc=!1,Wm(e));break;case 4:l=_n,_n=Oo(e.stateNode.containerInfo),en(t,e),tn(e),_n=l;break;case 12:en(t,e),tn(e);break;case 31:en(t,e),tn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 13:en(t,e),tn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(vo=Xe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 22:o=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,Y=fa,P=jt;if(fa=Y||o,jt=P||k,en(t,e),jt=P,fa=Y,tn(e),l&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(n===null||k||fa||jt||Yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(c=k.stateNode,o)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{j=k.stateNode;var ae=k.memoizedProps.style,X=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;j.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(ge){Je(k,k.return,ge)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=o?"":k.memoizedProps}catch(ge){Je(k,k.return,ge)}}}else if(t.tag===18){if(n===null){k=t;try{var V=k.stateNode;o?Bp(V,!0):Bp(k.stateNode,!1)}catch(ge){Je(k,k.return,ge)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,xo(e,n))));break;case 19:en(t,e),tn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xo(e,l)));break;case 30:break;case 21:break;default:en(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Gm(l)){n=l;break}l=l.return}if(n==null)throw Error(u(160));switch(n.tag){case 27:var o=n.stateNode,c=_c(e);po(e,c,o);break;case 5:var h=n.stateNode;n.flags&32&&(hs(h,""),n.flags&=-33);var j=_c(e);po(e,j,h);break;case 3:case 4:var k=n.stateNode.containerInfo,Y=_c(e);zc(e,Y,k);break;default:throw Error(u(161))}}catch(P){Je(e,e.return,P)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wm(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;)$m(e,t.alternate,t),t=t.sibling}function Yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Xa(4,t,t.return),Yl(t);break;case 1:$n(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Bm(t,t.return,n),Yl(t);break;case 27:Pr(t.stateNode);case 26:case 5:$n(t,t.return),Yl(t);break;case 22:t.memoizedState===null&&Yl(t);break;case 30:Yl(t);break;default:Yl(t)}e=e.sibling}}function pa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,o=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:pa(o,c,n),Yr(4,c);break;case 1:if(pa(o,c,n),l=c,o=l.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(Y){Je(l,l.return,Y)}if(l=c,o=l.updateQueue,o!==null){var j=l.stateNode;try{var k=o.shared.hiddenCallbacks;if(k!==null)for(o.shared.hiddenCallbacks=null,o=0;o<k.length;o++)kh(k[o],j)}catch(Y){Je(l,l.return,Y)}}n&&h&64&&qm(c),Kr(c,c.return);break;case 27:Ym(c);case 26:case 5:pa(o,c,n),n&&l===null&&h&4&&Qm(c),Kr(c,c.return);break;case 12:pa(o,c,n);break;case 31:pa(o,c,n),n&&h&4&&Zm(o,c);break;case 13:pa(o,c,n),n&&h&4&&Jm(o,c);break;case 22:c.memoizedState===null&&pa(o,c,n),Kr(c,c.return);break;case 30:break;default:pa(o,c,n)}t=t.sibling}}function Uc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Or(n))}function Lc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Or(e))}function zn(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Im(e,t,n,l),t=t.sibling}function Im(e,t,n,l){var o=t.flags;switch(t.tag){case 0:case 11:case 15:zn(e,t,n,l),o&2048&&Yr(9,t);break;case 1:zn(e,t,n,l);break;case 3:zn(e,t,n,l),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Or(e)));break;case 12:if(o&2048){zn(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,j=c.onPostCommit;typeof j=="function"&&j(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){Je(t,t.return,k)}}else zn(e,t,n,l);break;case 31:zn(e,t,n,l);break;case 13:zn(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?zn(e,t,n,l):$r(e,t):c._visibility&2?zn(e,t,n,l):(c._visibility|=2,_s(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Uc(h,t);break;case 24:zn(e,t,n,l),o&2048&&Lc(t.alternate,t);break;default:zn(e,t,n,l)}}function _s(e,t,n,l,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,j=n,k=l,Y=h.flags;switch(h.tag){case 0:case 11:case 15:_s(c,h,j,k,o),Yr(8,h);break;case 23:break;case 22:var P=h.stateNode;h.memoizedState!==null?P._visibility&2?_s(c,h,j,k,o):$r(c,h):(P._visibility|=2,_s(c,h,j,k,o)),o&&Y&2048&&Uc(h.alternate,h);break;case 24:_s(c,h,j,k,o),o&&Y&2048&&Lc(h.alternate,h);break;default:_s(c,h,j,k,o)}t=t.sibling}}function $r(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,o=l.flags;switch(l.tag){case 22:$r(n,l),o&2048&&Uc(l.alternate,l);break;case 24:$r(n,l),o&2048&&Lc(l.alternate,l);break;default:$r(n,l)}t=t.sibling}}var Xr=8192;function zs(e,t,n){if(e.subtreeFlags&Xr)for(e=e.child;e!==null;)Pm(e,t,n),e=e.sibling}function Pm(e,t,n){switch(e.tag){case 26:zs(e,t,n),e.flags&Xr&&e.memoizedState!==null&&dy(n,_n,e.memoizedState,e.memoizedProps);break;case 5:zs(e,t,n);break;case 3:case 4:var l=_n;_n=Oo(e.stateNode.containerInfo),zs(e,t,n),_n=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Xr,Xr=16777216,zs(e,t,n),Xr=l):zs(e,t,n));break;default:zs(e,t,n)}}function ep(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 Vr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];kt=l,np(l,e)}ep(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)tp(e),e=e.sibling}function tp(e){switch(e.tag){case 0:case 11:case 15:Vr(e),e.flags&2048&&Xa(9,e,e.return);break;case 3:Vr(e);break;case 12:Vr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,go(e)):Vr(e);break;default:Vr(e)}}function go(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];kt=l,np(l,e)}ep(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Xa(8,t,t.return),go(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,go(t));break;default:go(t)}e=e.sibling}}function np(e,t){for(;kt!==null;){var n=kt;switch(n.tag){case 0:case 11:case 15:Xa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Or(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,kt=l;else e:for(n=e;kt!==null;){l=kt;var o=l.sibling,c=l.return;if(Xm(l),l===n){kt=null;break e}if(o!==null){o.return=c,kt=o;break e}kt=c}}}var Ev={getCacheForType:function(e){var t=Dt(vt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Dt(vt).controller.signal}},Tv=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,_e=null,Le=0,Ze=0,hn=null,Va=!1,Ds=!1,Hc=!1,xa=0,mt=0,Za=0,Kl=0,qc=0,mn=0,Us=0,Zr=null,nn=null,Bc=!1,vo=0,ap=0,yo=1/0,bo=null,Ja=null,St=0,Fa=null,Ls=null,ga=0,Qc=0,Gc=null,lp=null,Jr=0,Yc=null;function pn(){return(Ye&2)!==0&&Le!==0?Le&-Le:_.T!==null?Jc():gr()}function sp(){if(mn===0)if((Le&536870912)===0||qe){var e=Re;Re<<=1,(Re&3932160)===0&&(Re=262144),mn=e}else mn=536870912;return e=dn.current,e!==null&&(e.flags|=32),mn}function an(e,t,n){(e===tt&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)&&(Hs(e,0),Wa(e,Le,mn,!1)),Qn(e,n),((Ye&2)===0||e!==tt)&&(e===tt&&((Ye&2)===0&&(Kl|=n),mt===4&&Wa(e,Le,mn,!1)),Xn(e))}function rp(e,t,n){if((Ye&6)!==0)throw Error(u(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Sl(e,t),o=l?Ov(e,t):$c(e,t,!0),c=l;do{if(o===0){Ds&&!l&&Wa(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!kv(n)){o=$c(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var j=e;o=Zr;var k=j.current.memoizedState.isDehydrated;if(k&&(Hs(j,h).flags|=256),h=$c(j,h,!1),h!==2){if(Hc&&!k){j.errorRecoveryDisabledLanes|=c,Kl|=c,o=4;break e}c=nn,nn=o,c!==null&&(nn===null?nn=c:nn.push.apply(nn,c))}o=h}if(c=!1,o!==2)continue}}if(o===1){Hs(e,0),Wa(e,t,0,!0);break}e:{switch(l=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Wa(l,t,mn,!Va);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=vo+300-Xe(),10<o)){if(Wa(l,t,mn,!Va),ls(l,0,!0)!==0)break e;ga=t,l.timeoutHandle=Lp(ip.bind(null,l,n,nn,bo,Bc,t,mn,Kl,Us,Va,c,"Throttled",-0,0),o);break e}ip(l,n,nn,bo,Bc,t,mn,Kl,Us,Va,c,null,-0,0)}}break}while(!0);Xn(e)}function ip(e,t,n,l,o,c,h,j,k,Y,P,ae,X,V){if(e.timeoutHandle=-1,ae=t.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},Pm(t,c,ae);var ge=(c&62914560)===c?vo-Xe():(c&4194048)===c?ap-Xe():0;if(ge=fy(ae,ge),ge!==null){ga=c,e.cancelPendingCommit=ge(pp.bind(null,e,t,c,n,l,o,h,j,k,P,ae,null,X,V)),Wa(e,c,h,!Y);return}}pp(e,t,c,n,l,o,h,j,k)}function kv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var o=n[l],c=o.getSnapshot;o=o.value;try{if(!un(c(),o))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wa(e,t,n,l){t&=~qc,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var o=t;0<o;){var c=31-Xt(o),h=1<<c;l[c]=-1,o&=~h}n!==0&&ss(e,n,t)}function jo(){return(Ye&6)===0?(Fr(0),!1):!0}function Kc(){if(_e!==null){if(Ze===0)var e=_e.return;else e=_e,ra=Dl=null,rc(e),ks=null,Rr=0,e=_e;for(;e!==null;)Hm(e.alternate,e),e=e.return;_e=null}}function Hs(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ga=0,Kc(),tt=e,_e=n=la(e.current,null),Le=t,Ze=0,hn=null,Va=!1,Ds=Sl(e,t),Hc=!1,Us=mn=qc=Kl=Za=mt=0,nn=Zr=null,Bc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var o=31-Xt(l),c=1<<o;t|=e[o],l&=~c}return xa=t,Qi(),n}function op(e,t){Te=null,_.H=Br,t===Ts||t===Ji?(t=wh(),Ze=3):t===Zu?(t=wh(),Ze=4):Ze=t===Nc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,_e===null&&(mt=1,uo(e,jn(t,e.current)))}function up(){var e=dn.current;return e===null?!0:(Le&4194048)===Le?Cn===null:(Le&62914560)===Le||(Le&536870912)!==0?e===Cn:!1}function cp(){var e=_.H;return _.H=Br,e===null?Br:e}function dp(){var e=_.A;return _.A=Ev,e}function No(){mt=4,Va||(Le&4194048)!==Le&&dn.current!==null||(Ds=!0),(Za&134217727)===0&&(Kl&134217727)===0||tt===null||Wa(tt,Le,mn,!1)}function $c(e,t,n){var l=Ye;Ye|=2;var o=cp(),c=dp();(tt!==e||Le!==t)&&(bo=null,Hs(e,t)),t=!1;var h=mt;e:do try{if(Ze!==0&&_e!==null){var j=_e,k=hn;switch(Ze){case 8:Kc(),h=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var Y=Ze;if(Ze=0,hn=null,qs(e,j,k,Y),n&&Ds){h=0;break e}break;default:Y=Ze,Ze=0,hn=null,qs(e,j,k,Y)}}Mv(),h=mt;break}catch(P){op(e,P)}while(!0);return t&&e.shellSuspendCounter++,ra=Dl=null,Ye=l,_.H=o,_.A=c,_e===null&&(tt=null,Le=0,Qi()),h}function Mv(){for(;_e!==null;)fp(_e)}function Ov(e,t){var n=Ye;Ye|=2;var l=cp(),o=dp();tt!==e||Le!==t?(bo=null,yo=Xe()+500,Hs(e,t)):Ds=Sl(e,t);e:do try{if(Ze!==0&&_e!==null){t=_e;var c=hn;t:switch(Ze){case 1:Ze=0,hn=null,qs(e,t,c,1);break;case 2:case 9:if(Nh(c)){Ze=0,hn=null,hp(t);break}t=function(){Ze!==2&&Ze!==9||tt!==e||(Ze=7),Xn(e)},c.then(t,t);break e;case 3:Ze=7;break e;case 4:Ze=5;break e;case 7:Nh(c)?(Ze=0,hn=null,hp(t)):(Ze=0,hn=null,qs(e,t,c,7));break;case 5:var h=null;switch(_e.tag){case 26:h=_e.memoizedState;case 5:case 27:var j=_e;if(h?Ip(h):j.stateNode.complete){Ze=0,hn=null;var k=j.sibling;if(k!==null)_e=k;else{var Y=j.return;Y!==null?(_e=Y,So(Y)):_e=null}break t}}Ze=0,hn=null,qs(e,t,c,5);break;case 6:Ze=0,hn=null,qs(e,t,c,6);break;case 8:Kc(),mt=6;break e;default:throw Error(u(462))}}Av();break}catch(P){op(e,P)}while(!0);return ra=Dl=null,_.H=l,_.A=o,Ye=n,_e!==null?0:(tt=null,Le=0,Qi(),mt)}function Av(){for(;_e!==null&&!bl();)fp(_e)}function fp(e){var t=Um(e.alternate,e,xa);e.memoizedProps=e.pendingProps,t===null?So(e):_e=t}function hp(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Om(n,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=Om(n,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:rc(t);default:Hm(n,t),t=_e=dh(t,xa),t=Um(n,t,xa)}e.memoizedProps=e.pendingProps,t===null?So(e):_e=t}function qs(e,t,n,l){ra=Dl=null,rc(t),ks=null,Rr=0;var o=t.return;try{if(yv(e,o,t,n,Le)){mt=1,uo(e,jn(n,e.current)),_e=null;return}}catch(c){if(o!==null)throw _e=o,c;mt=1,uo(e,jn(n,e.current)),_e=null;return}t.flags&32768?(qe||l===1?e=!0:Ds||(Le&536870912)!==0?e=!1:(Va=e=!0,(l===2||l===9||l===3||l===6)&&(l=dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),mp(t,e)):So(t)}function So(e){var t=e;do{if((t.flags&32768)!==0){mp(t,Va);return}e=t.return;var n=Nv(t.alternate,t,xa);if(n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);mt===0&&(mt=5)}function mp(e,t){do{var n=Sv(e.alternate,e);if(n!==null){n.flags&=32767,_e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=n}while(e!==null);mt=6,_e=null}function pp(e,t,n,l,o,c,h,j,k){e.cancelPendingCommit=null;do wo();while(St!==0);if((Ye&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=_u,_a(e,n,c,h,j,k),e===tt&&(_e=tt=null,Le=0),Ls=t,Fa=e,ga=n,Qc=c,Gc=o,lp=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Dv(jl,function(){return bp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=_.T,_.T=null,o=F.p,F.p=2,h=Ye,Ye|=4;try{wv(e,t,n)}finally{Ye=h,F.p=o,_.T=l}}St=1,xp(),gp(),vp()}}function xp(){if(St===1){St=0;var e=Fa,t=Ls,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=_.T,_.T=null;var l=F.p;F.p=2;var o=Ye;Ye|=4;try{Fm(t,e);var c=ad,h=nh(e.containerInfo),j=c.focusedElem,k=c.selectionRange;if(h!==j&&j&&j.ownerDocument&&th(j.ownerDocument.documentElement,j)){if(k!==null&&ku(j)){var Y=k.start,P=k.end;if(P===void 0&&(P=Y),"selectionStart"in j)j.selectionStart=Y,j.selectionEnd=Math.min(P,j.value.length);else{var ae=j.ownerDocument||document,X=ae&&ae.defaultView||window;if(X.getSelection){var V=X.getSelection(),ge=j.textContent.length,Ne=Math.min(k.start,ge),Pe=k.end===void 0?Ne:Math.min(k.end,ge);!V.extend&&Ne>Pe&&(h=Pe,Pe=Ne,Ne=h);var L=eh(j,Ne),R=eh(j,Pe);if(L&&R&&(V.rangeCount!==1||V.anchorNode!==L.node||V.anchorOffset!==L.offset||V.focusNode!==R.node||V.focusOffset!==R.offset)){var G=ae.createRange();G.setStart(L.node,L.offset),V.removeAllRanges(),Ne>Pe?(V.addRange(G),V.extend(R.node,R.offset)):(G.setEnd(R.node,R.offset),V.addRange(G))}}}}for(ae=[],V=j;V=V.parentNode;)V.nodeType===1&&ae.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<ae.length;j++){var te=ae[j];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Uo=!!nd,ad=nd=null}finally{Ye=o,F.p=l,_.T=n}}e.current=t,St=2}}function gp(){if(St===2){St=0;var e=Fa,t=Ls,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=_.T,_.T=null;var l=F.p;F.p=2;var o=Ye;Ye|=4;try{$m(e,t.alternate,t)}finally{Ye=o,F.p=l,_.T=n}}St=3}}function vp(){if(St===4||St===3){St=0,Kt();var e=Fa,t=Ls,n=ga,l=lp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?St=5:(St=0,Ls=Fa=null,yp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Ja=null),is(n),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Ma,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=_.T,o=F.p,F.p=2,_.T=null;try{for(var c=e.onRecoverableError,h=0;h<l.length;h++){var j=l[h];c(j.value,{componentStack:j.stack})}}finally{_.T=t,F.p=o}}(ga&3)!==0&&wo(),Xn(e),o=e.pendingLanes,(n&261930)!==0&&(o&42)!==0?e===Yc?Jr++:(Jr=0,Yc=e):Jr=0,Fr(0)}}function yp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Or(t)))}function wo(){return xp(),gp(),vp(),bp()}function bp(){if(St!==5)return!1;var e=Fa,t=Qc;Qc=0;var n=is(ga),l=_.T,o=F.p;try{F.p=32>n?32:n,_.T=null,n=Gc,Gc=null;var c=Fa,h=ga;if(St=0,Ls=Fa=null,ga=0,(Ye&6)!==0)throw Error(u(331));var j=Ye;if(Ye|=4,tp(c.current),Im(c,c.current,h,n),Ye=j,Fr(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Ma,c)}catch{}return!0}finally{F.p=o,_.T=l,yp(e,t)}}function jp(e,t,n){t=jn(n,t),t=jc(e.stateNode,t,2),e=Ya(e,t,2),e!==null&&(Qn(e,2),Xn(e))}function Je(e,t,n){if(e.tag===3)jp(e,e,n);else for(;t!==null;){if(t.tag===3){jp(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ja===null||!Ja.has(l))){e=jn(n,e),n=Nm(2),l=Ya(t,n,2),l!==null&&(Sm(n,l,t,e),Qn(l,2),Xn(l));break}}t=t.return}}function Xc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Tv;var o=new Set;l.set(t,o)}else o=l.get(t),o===void 0&&(o=new Set,l.set(t,o));o.has(n)||(Hc=!0,o.add(n),e=Rv.bind(null,e,t,n),t.then(e,e))}function Rv(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,tt===e&&(Le&n)===n&&(mt===4||mt===3&&(Le&62914560)===Le&&300>Xe()-vo?(Ye&2)===0&&Hs(e,0):qc|=n,Us===Le&&(Us=0)),Xn(e)}function Np(e,t){t===0&&(t=Mi()),e=Rl(e,t),e!==null&&(Qn(e,t),Xn(e))}function _v(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Np(e,n)}function zv(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),Np(e,n)}function Dv(e,t){return An(e,t)}var Co=null,Bs=null,Vc=!1,Eo=!1,Zc=!1,Ia=0;function Xn(e){e!==Bs&&e.next===null&&(Bs===null?Co=Bs=e:Bs=Bs.next=e),Eo=!0,Vc||(Vc=!0,Lv())}function Fr(e,t){if(!Zc&&Eo){Zc=!0;do for(var n=!1,l=Co;l!==null;){if(e!==0){var o=l.pendingLanes;if(o===0)var c=0;else{var h=l.suspendedLanes,j=l.pingedLanes;c=(1<<31-Xt(42|e)+1)-1,c&=o&~(h&~j),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,Ep(l,c))}else c=Le,c=ls(l,l===tt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Sl(l,c)||(n=!0,Ep(l,c));l=l.next}while(n);Zc=!1}}function Uv(){Sp()}function Sp(){Eo=Vc=!1;var e=0;Ia!==0&&Vv()&&(e=Ia);for(var t=Xe(),n=null,l=Co;l!==null;){var o=l.next,c=wp(l,t);c===0?(l.next=null,n===null?Co=o:n.next=o,o===null&&(Bs=n)):(n=l,(e!==0||(c&3)!==0)&&(Eo=!0)),l=o}St!==0&&St!==5||Fr(e),Ia!==0&&(Ia=0)}function wp(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-Xt(c),j=1<<h,k=o[h];k===-1?((j&n)===0||(j&l)!==0)&&(o[h]=du(j,t)):k<=t&&(e.expiredLanes|=j),c&=~j}if(t=tt,n=Le,n=ls(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Ze===2||Ze===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Bn(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Sl(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Bn(l),is(n)){case 2:case 8:n=Ei;break;case 32:n=jl;break;case 268435456:n=pr;break;default:n=jl}return l=Cp.bind(null,e),n=An(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Bn(l),e.callbackPriority=2,e.callbackNode=null,2}function Cp(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(wo()&&e.callbackNode!==n)return null;var l=Le;return l=ls(e,e===tt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(rp(e,l,t),wp(e,Xe()),e.callbackNode!=null&&e.callbackNode===n?Cp.bind(null,e):null)}function Ep(e,t){if(wo())return null;rp(e,t,!0)}function Lv(){Jv(function(){(Ye&6)!==0?An(Ci,Uv):Sp()})}function Jc(){if(Ia===0){var e=Cs;e===0&&(e=Oa,Oa<<=1,(Oa&261888)===0&&(Oa=256)),Ia=e}return Ia}function Tp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_i(""+e)}function kp(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Hv(e,t,n,l,o){if(t==="submit"&&n&&n.stateNode===o){var c=Tp((o[Bt]||null).action),h=l.submitter;h&&(t=(t=h[Bt]||null)?Tp(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var j=new Li("action","action",null,l,o);e.push({event:j,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ia!==0){var k=h?kp(o,h):new FormData(o);pc(n,{pending:!0,data:k,method:o.method,action:c},null,k)}}else typeof c=="function"&&(j.preventDefault(),k=h?kp(o,h):new FormData(o),pc(n,{pending:!0,data:k,method:o.method,action:c},c,k))},currentTarget:o}]})}}for(var Fc=0;Fc<Ru.length;Fc++){var Wc=Ru[Fc],qv=Wc.toLowerCase(),Bv=Wc[0].toUpperCase()+Wc.slice(1);Rn(qv,"on"+Bv)}Rn(sh,"onAnimationEnd"),Rn(rh,"onAnimationIteration"),Rn(ih,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(nv,"onTransitionRun"),Rn(av,"onTransitionStart"),Rn(lv,"onTransitionCancel"),Rn(oh,"onTransitionEnd"),Ae("onMouseEnter",["mouseout","mouseover"]),Ae("onMouseLeave",["mouseout","mouseover"]),Ae("onPointerEnter",["pointerout","pointerover"]),Ae("onPointerLeave",["pointerout","pointerover"]),Ce("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ce("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ce("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ce("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ce("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ce("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wr="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(" "),Qv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wr));function Mp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],o=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var h=l.length-1;0<=h;h--){var j=l[h],k=j.instance,Y=j.currentTarget;if(j=j.listener,k!==c&&o.isPropagationStopped())break e;c=j,o.currentTarget=Y;try{c(o)}catch(P){Bi(P)}o.currentTarget=null,c=k}else for(h=0;h<l.length;h++){if(j=l[h],k=j.instance,Y=j.currentTarget,j=j.listener,k!==c&&o.isPropagationStopped())break e;c=j,o.currentTarget=Y;try{c(o)}catch(P){Bi(P)}o.currentTarget=null,c=k}}}}function ze(e,t){var n=t[os];n===void 0&&(n=t[os]=new Set);var l=e+"__bubble";n.has(l)||(Op(t,e,2,!1),n.add(l))}function Ic(e,t,n){var l=0;t&&(l|=4),Op(n,e,l,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function Pc(e){if(!e[To]){e[To]=!0,xe.forEach(function(n){n!=="selectionchange"&&(Qv.has(n)||Ic(n,!1,e),Ic(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,Ic("selectionchange",!1,t))}}function Op(e,t,n,l){switch(sx(t)){case 2:var o=py;break;case 8:o=xy;break;default:o=md}n=o.bind(null,t,n,e),o=void 0,!yu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),l?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ed(e,t,n,l,o){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var j=l.stateNode.containerInfo;if(j===o)break;if(h===4)for(h=l.return;h!==null;){var k=h.tag;if((k===3||k===4)&&h.stateNode.containerInfo===o)return;h=h.return}for(;j!==null;){if(h=ea(j),h===null)return;if(k=h.tag,k===5||k===6||k===26||k===27){l=c=h;continue e}j=j.parentNode}}l=l.return}Df(function(){var Y=c,P=gu(n),ae=[];e:{var X=uh.get(e);if(X!==void 0){var V=Li,ge=e;switch(e){case"keypress":if(Di(n)===0)break e;case"keydown":case"keyup":V=z0;break;case"focusin":ge="focus",V=Su;break;case"focusout":ge="blur",V=Su;break;case"beforeblur":case"afterblur":V=Su;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=N0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=L0;break;case sh:case rh:case ih:V=C0;break;case oh:V=q0;break;case"scroll":case"scrollend":V=b0;break;case"wheel":V=Q0;break;case"copy":case"cut":case"paste":V=T0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Bf;break;case"toggle":case"beforetoggle":V=Y0}var Ne=(t&4)!==0,Pe=!Ne&&(e==="scroll"||e==="scrollend"),L=Ne?X!==null?X+"Capture":null:X;Ne=[];for(var R=Y,G;R!==null;){var te=R;if(G=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||G===null||L===null||(te=yr(R,L),te!=null&&Ne.push(Ir(R,te,G))),Pe)break;R=R.return}0<Ne.length&&(X=new V(X,ge,null,n,P),ae.push({event:X,listeners:Ne}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",X&&n!==xu&&(ge=n.relatedTarget||n.fromElement)&&(ea(ge)||ge[za]))break e;if((V||X)&&(X=P.window===P?P:(X=P.ownerDocument)?X.defaultView||X.parentWindow:window,V?(ge=n.relatedTarget||n.toElement,V=Y,ge=ge?ea(ge):null,ge!==null&&(Pe=f(ge),Ne=ge.tag,ge!==Pe||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(V=null,ge=Y),V!==ge)){if(Ne=Hf,te="onMouseLeave",L="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=Bf,te="onPointerLeave",L="onPointerEnter",R="pointer"),Pe=V==null?X:se(V),G=ge==null?X:se(ge),X=new Ne(te,R+"leave",V,n,P),X.target=Pe,X.relatedTarget=G,te=null,ea(P)===Y&&(Ne=new Ne(L,R+"enter",ge,n,P),Ne.target=G,Ne.relatedTarget=Pe,te=Ne),Pe=te,V&&ge)t:{for(Ne=Gv,L=V,R=ge,G=0,te=L;te;te=Ne(te))G++;te=0;for(var je=R;je;je=Ne(je))te++;for(;0<G-te;)L=Ne(L),G--;for(;0<te-G;)R=Ne(R),te--;for(;G--;){if(L===R||R!==null&&L===R.alternate){Ne=L;break t}L=Ne(L),R=Ne(R)}Ne=null}else Ne=null;V!==null&&Ap(ae,X,V,Ne,!1),ge!==null&&Pe!==null&&Ap(ae,Pe,ge,Ne,!0)}}e:{if(X=Y?se(Y):window,V=X.nodeName&&X.nodeName.toLowerCase(),V==="select"||V==="input"&&X.type==="file")var Qe=Zf;else if(Xf(X))if(Jf)Qe=P0;else{Qe=W0;var ve=F0}else V=X.nodeName,!V||V.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&pu(Y.elementType)&&(Qe=Zf):Qe=I0;if(Qe&&(Qe=Qe(e,Y))){Vf(ae,Qe,n,P);break e}ve&&ve(e,X,Y),e==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&mu(X,"number",X.value)}switch(ve=Y?se(Y):window,e){case"focusin":(Xf(ve)||ve.contentEditable==="true")&&(gs=ve,Mu=Y,Tr=null);break;case"focusout":Tr=Mu=gs=null;break;case"mousedown":Ou=!0;break;case"contextmenu":case"mouseup":case"dragend":Ou=!1,ah(ae,n,P);break;case"selectionchange":if(tv)break;case"keydown":case"keyup":ah(ae,n,P)}var Me;if(Cu)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else xs?Kf(e,n)&&(He="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(He="onCompositionStart");He&&(Qf&&n.locale!=="ko"&&(xs||He!=="onCompositionStart"?He==="onCompositionEnd"&&xs&&(Me=Uf()):(Ua=P,bu="value"in Ua?Ua.value:Ua.textContent,xs=!0)),ve=ko(Y,He),0<ve.length&&(He=new qf(He,e,null,n,P),ae.push({event:He,listeners:ve}),Me?He.data=Me:(Me=$f(n),Me!==null&&(He.data=Me)))),(Me=$0?X0(e,n):V0(e,n))&&(He=ko(Y,"onBeforeInput"),0<He.length&&(ve=new qf("onBeforeInput","beforeinput",null,n,P),ae.push({event:ve,listeners:He}),ve.data=Me)),Hv(ae,e,Y,n,P)}Mp(ae,t)})}function Ir(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ko(e,t){for(var n=t+"Capture",l=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=yr(e,n),o!=null&&l.unshift(Ir(e,o,c)),o=yr(e,t),o!=null&&l.push(Ir(e,o,c))),e.tag===3)return l;e=e.return}return[]}function Gv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ap(e,t,n,l,o){for(var c=t._reactName,h=[];n!==null&&n!==l;){var j=n,k=j.alternate,Y=j.stateNode;if(j=j.tag,k!==null&&k===l)break;j!==5&&j!==26&&j!==27||Y===null||(k=Y,o?(Y=yr(n,c),Y!=null&&h.unshift(Ir(n,Y,k))):o||(Y=yr(n,c),Y!=null&&h.push(Ir(n,Y,k)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Yv=/\r\n?/g,Kv=/\u0000|\uFFFD/g;function Rp(e){return(typeof e=="string"?e:""+e).replace(Yv,`
|
|
49
|
+
`).replace(Kv,"")}function _p(e,t){return t=Rp(t),Rp(e)===t}function Ie(e,t,n,l,o,c){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||hs(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&hs(e,""+l);break;case"className":wl(e,"class",l);break;case"tabIndex":wl(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,n,l);break;case"style":_f(e,l,c);break;case"data":if(t!=="object"){wl(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_i(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&Ie(e,t,"name",o.name,o,null),Ie(e,t,"formEncType",o.formEncType,o,null),Ie(e,t,"formMethod",o.formMethod,o,null),Ie(e,t,"formTarget",o.formTarget,o,null)):(Ie(e,t,"encType",o.encType,o,null),Ie(e,t,"method",o.method,o,null),Ie(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=_i(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=na);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}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}n=_i(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);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(n,""+l):e.removeAttribute(n);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(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ze("beforetoggle",e),ze("toggle",e),ta(e,"popover",l);break;case"xlinkActuate":Et(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Et(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Et(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Et(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Et(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Et(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Et(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Et(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Et(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ta(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=v0.get(n)||n,ta(e,n,l))}}function td(e,t,n,l,o,c){switch(n){case"style":_f(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=n}}break;case"children":typeof l=="string"?hs(e,l):(typeof l=="number"||typeof l=="bigint")&&hs(e,""+l);break;case"onScroll":l!=null&&ze("scroll",e);break;case"onScrollEnd":l!=null&&ze("scrollend",e);break;case"onClick":l!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ue.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),c=e[Bt]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof l=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,o);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):ta(e,n,l)}}}function Lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var l=!1,o=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ie(e,t,c,h,n,null)}}o&&Ie(e,t,"srcSet",n.srcSet,n,null),l&&Ie(e,t,"src",n.src,n,null);return;case"input":ze("invalid",e);var j=c=h=o=null,k=null,Y=null;for(l in n)if(n.hasOwnProperty(l)){var P=n[l];if(P!=null)switch(l){case"name":o=P;break;case"type":h=P;break;case"checked":k=P;break;case"defaultChecked":Y=P;break;case"value":c=P;break;case"defaultValue":j=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(u(137,t));break;default:Ie(e,t,l,P,n,null)}}Mf(e,c,j,k,Y,h,o,!1);return;case"select":ze("invalid",e),l=h=c=null;for(o in n)if(n.hasOwnProperty(o)&&(j=n[o],j!=null))switch(o){case"value":c=j;break;case"defaultValue":h=j;break;case"multiple":l=j;default:Ie(e,t,o,j,n,null)}t=c,n=h,e.multiple=!!l,t!=null?fs(e,!!l,t,!1):n!=null&&fs(e,!!l,n,!0);return;case"textarea":ze("invalid",e),c=o=l=null;for(h in n)if(n.hasOwnProperty(h)&&(j=n[h],j!=null))switch(h){case"value":l=j;break;case"defaultValue":o=j;break;case"children":c=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(u(91));break;default:Ie(e,t,h,j,n,null)}Af(e,l,o,c);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(l=n[k],l!=null))switch(k){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ie(e,t,k,l,n,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(l=0;l<Wr.length;l++)ze(Wr[l],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(Y in n)if(n.hasOwnProperty(Y)&&(l=n[Y],l!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ie(e,t,Y,l,n,null)}return;default:if(pu(t)){for(P in n)n.hasOwnProperty(P)&&(l=n[P],l!==void 0&&td(e,t,P,l,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(l=n[j],l!=null&&Ie(e,t,j,l,n,null))}function $v(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,h=null,j=null,k=null,Y=null,P=null;for(V in n){var ae=n[V];if(n.hasOwnProperty(V)&&ae!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":k=ae;default:l.hasOwnProperty(V)||Ie(e,t,V,null,l,ae)}}for(var X in l){var V=l[X];if(ae=n[X],l.hasOwnProperty(X)&&(V!=null||ae!=null))switch(X){case"type":c=V;break;case"name":o=V;break;case"checked":Y=V;break;case"defaultChecked":P=V;break;case"value":h=V;break;case"defaultValue":j=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(u(137,t));break;default:V!==ae&&Ie(e,t,X,V,l,ae)}}hu(e,h,j,k,Y,P,c,o);return;case"select":V=h=j=X=null;for(c in n)if(k=n[c],n.hasOwnProperty(c)&&k!=null)switch(c){case"value":break;case"multiple":V=k;default:l.hasOwnProperty(c)||Ie(e,t,c,null,l,k)}for(o in l)if(c=l[o],k=n[o],l.hasOwnProperty(o)&&(c!=null||k!=null))switch(o){case"value":X=c;break;case"defaultValue":j=c;break;case"multiple":h=c;default:c!==k&&Ie(e,t,o,c,l,k)}t=j,n=h,l=V,X!=null?fs(e,!!n,X,!1):!!l!=!!n&&(t!=null?fs(e,!!n,t,!0):fs(e,!!n,n?[]:"",!1));return;case"textarea":V=X=null;for(j in n)if(o=n[j],n.hasOwnProperty(j)&&o!=null&&!l.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ie(e,t,j,null,l,o)}for(h in l)if(o=l[h],c=n[h],l.hasOwnProperty(h)&&(o!=null||c!=null))switch(h){case"value":X=o;break;case"defaultValue":V=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Ie(e,t,h,o,l,c)}Of(e,X,V);return;case"option":for(var ge in n)if(X=n[ge],n.hasOwnProperty(ge)&&X!=null&&!l.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:Ie(e,t,ge,null,l,X)}for(k in l)if(X=l[k],V=n[k],l.hasOwnProperty(k)&&X!==V&&(X!=null||V!=null))switch(k){case"selected":e.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:Ie(e,t,k,X,l,V)}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 Ne in n)X=n[Ne],n.hasOwnProperty(Ne)&&X!=null&&!l.hasOwnProperty(Ne)&&Ie(e,t,Ne,null,l,X);for(Y in l)if(X=l[Y],V=n[Y],l.hasOwnProperty(Y)&&X!==V&&(X!=null||V!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(u(137,t));break;default:Ie(e,t,Y,X,l,V)}return;default:if(pu(t)){for(var Pe in n)X=n[Pe],n.hasOwnProperty(Pe)&&X!==void 0&&!l.hasOwnProperty(Pe)&&td(e,t,Pe,void 0,l,X);for(P in l)X=l[P],V=n[P],!l.hasOwnProperty(P)||X===V||X===void 0&&V===void 0||td(e,t,P,X,l,V);return}}for(var L in n)X=n[L],n.hasOwnProperty(L)&&X!=null&&!l.hasOwnProperty(L)&&Ie(e,t,L,null,l,X);for(ae in l)X=l[ae],V=n[ae],!l.hasOwnProperty(ae)||X===V||X==null&&V==null||Ie(e,t,ae,X,l,V)}function zp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var o=n[l],c=o.transferSize,h=o.initiatorType,j=o.duration;if(c&&j&&zp(h)){for(h=0,j=o.responseEnd,l+=1;l<n.length;l++){var k=n[l],Y=k.startTime;if(Y>j)break;var P=k.transferSize,ae=k.initiatorType;P&&zp(ae)&&(k=k.responseEnd,h+=P*(k<j?1:(j-Y)/(k-Y)))}if(--l,t+=8*(c+h)/(o.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 nd=null,ad=null;function Mo(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Up(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 ld(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 sd=null;function Vv(){var e=window.event;return e&&e.type==="popstate"?e===sd?!1:(sd=e,!0):(sd=null,!1)}var Lp=typeof setTimeout=="function"?setTimeout:void 0,Zv=typeof clearTimeout=="function"?clearTimeout:void 0,Hp=typeof Promise=="function"?Promise:void 0,Jv=typeof queueMicrotask=="function"?queueMicrotask:typeof Hp<"u"?function(e){return Hp.resolve(null).then(e).catch(Fv)}:Lp;function Fv(e){setTimeout(function(){throw e})}function Pa(e){return e==="head"}function qp(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(o),Ks(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Pr(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Pr(n);for(var c=n.firstChild;c;){var h=c.nextSibling,j=c.nodeName;c[Da]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&Pr(e.ownerDocument.body);n=o}while(n);Ks(t)}function Bp(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function rd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":rd(n),us(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Wv(e,t,n,l){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Da])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=En(e.nextSibling),e===null)break}return null}function Iv(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=En(e.nextSibling),e===null))return null;return e}function Qp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=En(e.nextSibling),e===null))return null;return e}function id(e){return e.data==="$?"||e.data==="$~"}function od(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Pv(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function En(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 ud=null;function Gp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return En(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Yp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Kp(e,t,n){switch(t=Mo(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Pr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);us(e)}var Tn=new Map,$p=new Set;function Oo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var va=F.d;F.d={f:ey,r:ty,D:ny,C:ay,L:ly,m:sy,X:iy,S:ry,M:oy};function ey(){var e=va.f(),t=jo();return e||t}function ty(e){var t=ee(e);t!==null&&t.tag===5&&t.type==="form"?om(t):va.r(e)}var Qs=typeof document>"u"?null:document;function Xp(e,t,n){var l=Qs;if(l&&typeof t=="string"&&t){var o=_t(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),$p.has(o)||($p.add(o),e={rel:e,crossOrigin:n,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),Lt(t,"link",e),me(t),l.head.appendChild(t)))}}function ny(e){va.D(e),Xp("dns-prefetch",e,null)}function ay(e,t){va.C(e,t),Xp("preconnect",e,t)}function ly(e,t,n){va.L(e,t,n);var l=Qs;if(l&&e&&t){var o='link[rel="preload"][as="'+_t(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+_t(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+_t(n.imageSizes)+'"]')):o+='[href="'+_t(e)+'"]';var c=o;switch(t){case"style":c=Gs(e);break;case"script":c=Ys(e)}Tn.has(c)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Tn.set(c,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(ei(c))||t==="script"&&l.querySelector(ti(c))||(t=l.createElement("link"),Lt(t,"link",e),me(t),l.head.appendChild(t)))}}function sy(e,t){va.m(e,t);var n=Qs;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+_t(l)+'"][href="'+_t(e)+'"]',c=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Ys(e)}if(!Tn.has(c)&&(e=v({rel:"modulepreload",href:e},t),Tn.set(c,e),n.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ti(c)))return}l=n.createElement("link"),Lt(l,"link",e),me(l),n.head.appendChild(l)}}}function ry(e,t,n){va.S(e,t,n);var l=Qs;if(l&&e){var o=ue(l).hoistableStyles,c=Gs(e);t=t||"default";var h=o.get(c);if(!h){var j={loading:0,preload:null};if(h=l.querySelector(ei(c)))j.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Tn.get(c))&&cd(e,n);var k=h=l.createElement("link");me(k),Lt(k,"link",e),k._p=new Promise(function(Y,P){k.onload=Y,k.onerror=P}),k.addEventListener("load",function(){j.loading|=1}),k.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ao(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:j},o.set(c,h)}}}function iy(e,t){va.X(e,t);var n=Qs;if(n&&e){var l=ue(n).hoistableScripts,o=Ys(e),c=l.get(o);c||(c=n.querySelector(ti(o)),c||(e=v({src:e,async:!0},t),(t=Tn.get(o))&&dd(e,t),c=n.createElement("script"),me(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function oy(e,t){va.M(e,t);var n=Qs;if(n&&e){var l=ue(n).hoistableScripts,o=Ys(e),c=l.get(o);c||(c=n.querySelector(ti(o)),c||(e=v({src:e,async:!0,type:"module"},t),(t=Tn.get(o))&&dd(e,t),c=n.createElement("script"),me(c),Lt(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(o,c))}}function Vp(e,t,n,l){var o=(o=ye.current)?Oo(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Gs(n.href),n=ue(o).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Gs(n.href);var c=ue(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(ei(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Tn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tn.set(e,n),c||uy(o,e,n,h.state))),t&&l===null)throw Error(u(528,""));return h}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ys(n),n=ue(o).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Gs(e){return'href="'+_t(e)+'"'}function ei(e){return'link[rel="stylesheet"]['+e+"]"}function Zp(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function uy(e,t,n,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}),Lt(t,"link",n),me(t),e.head.appendChild(t))}function Ys(e){return'[src="'+_t(e)+'"]'}function ti(e){return"script[async]"+e}function Jp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+_t(n.href)+'"]');if(l)return t.instance=l,me(l),l;var o=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),me(l),Lt(l,"style",o),Ao(l,n.precedence,e),t.instance=l;case"stylesheet":o=Gs(n.href);var c=e.querySelector(ei(o));if(c)return t.state.loading|=4,t.instance=c,me(c),c;l=Zp(n),(o=Tn.get(o))&&cd(l,o),c=(e.ownerDocument||e).createElement("link"),me(c);var h=c;return h._p=new Promise(function(j,k){h.onload=j,h.onerror=k}),Lt(c,"link",l),t.state.loading|=4,Ao(c,n.precedence,e),t.instance=c;case"script":return c=Ys(n.src),(o=e.querySelector(ti(c)))?(t.instance=o,me(o),o):(l=n,(o=Tn.get(c))&&(l=v({},n),dd(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),me(o),Lt(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ao(l,n.precedence,e));return t.instance}function Ao(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,c=o,h=0;h<l.length;h++){var j=l[h];if(j.dataset.precedence===t)c=j;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function cd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function dd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ro=null;function Fp(e,t,n){if(Ro===null){var l=new Map,o=Ro=new Map;o.set(n,l)}else o=Ro,l=o.get(n),l||(l=new Map,o.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var c=n[o];if(!(c[Da]||c[dt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var j=l.get(h);j?j.push(c):l.set(h,[c])}}return l}function Wp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function cy(e,t,n){if(n===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 Ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dy(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=Gs(l.href),c=t.querySelector(ei(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_o.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,me(c);return}c=t.ownerDocument||t,l=Zp(l),(o=Tn.get(o))&&cd(l,o),c=c.createElement("link"),me(c);var h=c;h._p=new Promise(function(j,k){h.onload=j,h.onerror=k}),Lt(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=_o.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var fd=0;function fy(e,t){return e.stylesheets&&e.count===0&&Do(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Do(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&fd===0&&(fd=62500*Xv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Do(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>fd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function _o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Do(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var zo=null;function Do(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,zo=new Map,t.forEach(hy,e),zo=null,_o.call(e))}function hy(e,t){if(!(t.state.loading&4)){var n=zo.get(e);if(n)var l=n.get(null);else{n=new Map,zo.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var h=o[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),l=h)}l&&n.set(null,l)}o=t.instance,h=o.getAttribute("data-precedence"),c=n.get(h)||l,c===l&&n.set(null,o),n.set(h,o),this.count++,l=_o.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var ni={$$typeof:N,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function my(e,t,n,l,o,c,h,j,k){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=Ra(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ra(0),this.hiddenUpdates=Ra(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function Pp(e,t,n,l,o,c,h,j,k,Y,P,ae){return e=new my(e,t,n,h,k,Y,P,ae,j),t=1,c===!0&&(t|=24),c=cn(3,null,null,t),e.current=c,c.stateNode=e,t=$u(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},Ju(c),e}function ex(e){return e?(e=bs,e):bs}function tx(e,t,n,l,o,c){o=ex(o),l.context===null?l.context=o:l.pendingContext=o,l=Ga(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=Ya(e,l,t),n!==null&&(an(n,e,t),zr(n,e,t))}function nx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hd(e,t){nx(e,t),(e=e.alternate)&&nx(e,t)}function ax(e){if(e.tag===13||e.tag===31){var t=Rl(e,67108864);t!==null&&an(t,e,67108864),hd(e,67108864)}}function lx(e){if(e.tag===13||e.tag===31){var t=pn();t=xr(t);var n=Rl(e,t);n!==null&&an(n,e,t),hd(e,t)}}var Uo=!0;function py(e,t,n,l){var o=_.T;_.T=null;var c=F.p;try{F.p=2,md(e,t,n,l)}finally{F.p=c,_.T=o}}function xy(e,t,n,l){var o=_.T;_.T=null;var c=F.p;try{F.p=8,md(e,t,n,l)}finally{F.p=c,_.T=o}}function md(e,t,n,l){if(Uo){var o=pd(l);if(o===null)ed(e,t,l,Lo,n),rx(e,l);else if(vy(o,e,t,n,l))l.stopPropagation();else if(rx(e,l),t&4&&-1<gy.indexOf(e)){for(;o!==null;){var c=ee(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=Pn(c.pendingLanes);if(h!==0){var j=c;for(j.pendingLanes|=2,j.entangledLanes|=2;h;){var k=1<<31-Xt(h);j.entanglements[1]|=k,h&=~k}Xn(c),(Ye&6)===0&&(yo=Xe()+500,Fr(0))}}break;case 31:case 13:j=Rl(c,2),j!==null&&an(j,c,2),jo(),hd(c,2)}if(c=pd(l),c===null&&ed(e,t,l,Lo,n),c===o)break;o=c}o!==null&&l.stopPropagation()}else ed(e,t,l,null,n)}}function pd(e){return e=gu(e),xd(e)}var Lo=null;function xd(e){if(Lo=null,e=ea(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=x(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Lo=e,null}function sx(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(mr()){case Ci:return 2;case Ei:return 8;case jl:case kf:return 32;case pr:return 268435456;default:return 32}default:return 32}}var gd=!1,el=null,tl=null,nl=null,ai=new Map,li=new Map,al=[],gy="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 rx(e,t){switch(e){case"focusin":case"focusout":el=null;break;case"dragenter":case"dragleave":tl=null;break;case"mouseover":case"mouseout":nl=null;break;case"pointerover":case"pointerout":ai.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":li.delete(t.pointerId)}}function si(e,t,n,l,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[o]},t!==null&&(t=ee(t),t!==null&&ax(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function vy(e,t,n,l,o){switch(t){case"focusin":return el=si(el,e,t,n,l,o),!0;case"dragenter":return tl=si(tl,e,t,n,l,o),!0;case"mouseover":return nl=si(nl,e,t,n,l,o),!0;case"pointerover":var c=o.pointerId;return ai.set(c,si(ai.get(c)||null,e,t,n,l,o)),!0;case"gotpointercapture":return c=o.pointerId,li.set(c,si(li.get(c)||null,e,t,n,l,o)),!0}return!1}function ix(e){var t=ea(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,Oi(e.priority,function(){lx(n)});return}}else if(t===31){if(t=x(n),t!==null){e.blockedOn=t,Oi(e.priority,function(){lx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ho(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pd(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);xu=l,n.target.dispatchEvent(l),xu=null}else return t=ee(n),t!==null&&ax(t),e.blockedOn=n,!1;t.shift()}return!0}function ox(e,t,n){Ho(e)&&n.delete(t)}function yy(){gd=!1,el!==null&&Ho(el)&&(el=null),tl!==null&&Ho(tl)&&(tl=null),nl!==null&&Ho(nl)&&(nl=null),ai.forEach(ox),li.forEach(ox)}function qo(e,t){e.blockedOn===t&&(e.blockedOn=null,gd||(gd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,yy)))}var Bo=null;function ux(e){Bo!==e&&(Bo=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Bo===e&&(Bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(xd(l||n)===null)continue;break}var c=ee(n);c!==null&&(e.splice(t,3),t-=3,pc(c,{pending:!0,data:o,method:n.method,action:l},l,o))}}))}function Ks(e){function t(k){return qo(k,e)}el!==null&&qo(el,e),tl!==null&&qo(tl,e),nl!==null&&qo(nl,e),ai.forEach(t),li.forEach(t);for(var n=0;n<al.length;n++){var l=al[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<al.length&&(n=al[0],n.blockedOn===null);)ix(n),n.blockedOn===null&&al.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var o=n[l],c=n[l+1],h=o[Bt]||null;if(typeof c=="function")h||ux(n);else if(h){var j=null;if(c&&c.hasAttribute("formAction")){if(o=c,h=c[Bt]||null)j=h.formAction;else if(xd(o)!==null)continue}else j=h.action;typeof j=="function"?n[l+1]=j:(n.splice(l,3),l-=3),ux(n)}}}function cx(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return o=h})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function vd(e){this._internalRoot=e}Qo.prototype.render=vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,l=pn();tx(n,l,e,t,null,null)},Qo.prototype.unmount=vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tx(e.current,2,null,e,null,null),jo(),t[za]=null}};function Qo(e){this._internalRoot=e}Qo.prototype.unstable_scheduleHydration=function(e){if(e){var t=gr();e={blockedOn:null,target:e,priority:t};for(var n=0;n<al.length&&t!==0&&t<al[n].priority;n++);al.splice(n,0,e),n===0&&ix(e)}};var dx=r.version;if(dx!=="19.2.4")throw Error(u(527,dx,"19.2.4"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var by={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{Ma=Go.inject(by),Ct=Go}catch{}}return oi.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,l="",o=vm,c=ym,h=bm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Pp(e,1,!1,null,null,n,l,null,o,c,h,cx),e[za]=t.current,Pc(e),new vd(t)},oi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var l=!1,o="",c=vm,h=ym,j=bm,k=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=Pp(e,1,!0,t,n??null,l,o,k,c,h,j,cx),t.context=ex(null),n=t.current,l=pn(),l=xr(l),o=Ga(l),o.callback=null,Ya(n,o,l),n=l,t.current.lanes=n,Qn(t,n),Xn(t),e[za]=t.current,Pc(e),new Qo(t)},oi.version="19.2.4",oi}var Nx;function Ry(){if(Nx)return Nd.exports;Nx=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(),Nd.exports=Ay(),Nd.exports}var _y=Ry(),cr=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)},rl,nf,sg,Dy=(sg=class{constructor(){be(this,rl,zy);be(this,nf,!1)}setTimeoutProvider(s){fe(this,rl,s)}setTimeout(s,r){return M(this,rl).setTimeout(s,r)}clearTimeout(s){M(this,rl).clearTimeout(s)}setInterval(s,r){return M(this,rl).setInterval(s,r)}clearInterval(s){M(this,rl).clearInterval(s)}},rl=new WeakMap,nf=new WeakMap,sg),Xl=new Dy;function Uy(s){setTimeout(s,0)}var ns=typeof window>"u"||"Deno"in globalThis;function Jt(){}function Ly(s,r){return typeof s=="function"?s(r):s}function Rd(s){return typeof s=="number"&&s>=0&&s!==1/0}function xg(s,r){return Math.max(s+(r||0)-Date.now(),0)}function pl(s,r){return typeof s=="function"?s(r):s}function Mn(s,r){return typeof s=="function"?s(r):s}function Sx(s,r){const{type:i="all",exact:u,fetchStatus:d,predicate:f,queryKey:p,stale:x}=s;if(p){if(u){if(r.queryHash!==lf(p,r.options))return!1}else if(!hi(r.queryKey,p))return!1}if(i!=="all"){const m=r.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof x=="boolean"&&r.isStale()!==x||d&&d!==r.state.fetchStatus||f&&!f(r))}function wx(s,r){const{exact:i,status:u,predicate:d,mutationKey:f}=s;if(f){if(!r.options.mutationKey)return!1;if(i){if(as(r.options.mutationKey)!==as(f))return!1}else if(!hi(r.options.mutationKey,f))return!1}return!(u&&r.state.status!==u||d&&!d(r))}function lf(s,r){return((r==null?void 0:r.queryKeyHashFn)||as)(s)}function as(s){return JSON.stringify(s,(r,i)=>_d(i)?Object.keys(i).sort().reduce((u,d)=>(u[d]=i[d],u),{}):i)}function hi(s,r){return s===r?!0:typeof s!=typeof r?!1:s&&r&&typeof s=="object"&&typeof r=="object"?Object.keys(r).every(i=>hi(s[i],r[i])):!1}var Hy=Object.prototype.hasOwnProperty;function gg(s,r,i=0){if(s===r)return s;if(i>500)return r;const u=Cx(s)&&Cx(r);if(!u&&!(_d(s)&&_d(r)))return r;const f=(u?s:Object.keys(s)).length,p=u?r:Object.keys(r),x=p.length,m=u?new Array(x):{};let g=0;for(let y=0;y<x;y++){const v=u?y:p[y],C=s[v],T=r[v];if(C===T){m[v]=C,(u?y<f:Hy.call(s,v))&&g++;continue}if(C===null||T===null||typeof C!="object"||typeof T!="object"){m[v]=T;continue}const w=gg(C,T,i+1);m[v]=w,w===C&&g++}return f===x&&g===f?s:m}function Po(s,r){if(!r||Object.keys(s).length!==Object.keys(r).length)return!1;for(const i in s)if(s[i]!==r[i])return!1;return!0}function Cx(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function _d(s){if(!Ex(s))return!1;const r=s.constructor;if(r===void 0)return!0;const i=r.prototype;return!(!Ex(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function Ex(s){return Object.prototype.toString.call(s)==="[object Object]"}function qy(s){return new Promise(r=>{Xl.setTimeout(r,s)})}function zd(s,r,i){return typeof i.structuralSharing=="function"?i.structuralSharing(s,r):i.structuralSharing!==!1?gg(s,r):r}function By(s,r,i=0){const u=[...s,r];return i&&u.length>i?u.slice(1):u}function Qy(s,r,i=0){const u=[r,...s];return i&&u.length>i?u.slice(0,-1):u}var sf=Symbol();function vg(s,r){return!s.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!s.queryFn||s.queryFn===sf?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function rf(s,r){return typeof s=="function"?s(...r):!!s}function Gy(s,r,i){let u=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??(d=r()),u||(u=!0,d.aborted?i():d.addEventListener("abort",i,{once:!0})),d)}),s}var Vl,il,Js,rg,Yy=(rg=class extends cr{constructor(){super();be(this,Vl);be(this,il);be(this,Js);fe(this,Js,r=>{if(!ns&&window.addEventListener){const i=()=>r();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){M(this,il)||this.setEventListener(M(this,Js))}onUnsubscribe(){var r;this.hasListeners()||((r=M(this,il))==null||r.call(this),fe(this,il,void 0))}setEventListener(r){var i;fe(this,Js,r),(i=M(this,il))==null||i.call(this),fe(this,il,r(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(r){M(this,Vl)!==r&&(fe(this,Vl,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(i=>{i(r)})}isFocused(){var r;return typeof M(this,Vl)=="boolean"?M(this,Vl):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},Vl=new WeakMap,il=new WeakMap,Js=new WeakMap,rg),of=new Yy;function Dd(){let s,r;const i=new Promise((d,f)=>{s=d,r=f});i.status="pending",i.catch(()=>{});function u(d){Object.assign(i,d),delete i.resolve,delete i.reject}return i.resolve=d=>{u({status:"fulfilled",value:d}),s(d)},i.reject=d=>{u({status:"rejected",reason:d}),r(d)},i}var Ky=Uy;function $y(){let s=[],r=0,i=x=>{x()},u=x=>{x()},d=Ky;const f=x=>{r?s.push(x):d(()=>{i(x)})},p=()=>{const x=s;s=[],x.length&&d(()=>{u(()=>{x.forEach(m=>{i(m)})})})};return{batch:x=>{let m;r++;try{m=x()}finally{r--,r||p()}return m},batchCalls:x=>(...m)=>{f(()=>{x(...m)})},schedule:f,setNotifyFunction:x=>{i=x},setBatchNotifyFunction:x=>{u=x},setScheduler:x=>{d=x}}}var wt=$y(),Fs,ol,Ws,ig,Xy=(ig=class extends cr{constructor(){super();be(this,Fs,!0);be(this,ol);be(this,Ws);fe(this,Ws,r=>{if(!ns&&window.addEventListener){const i=()=>r(!0),u=()=>r(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",u)}}})}onSubscribe(){M(this,ol)||this.setEventListener(M(this,Ws))}onUnsubscribe(){var r;this.hasListeners()||((r=M(this,ol))==null||r.call(this),fe(this,ol,void 0))}setEventListener(r){var i;fe(this,Ws,r),(i=M(this,ol))==null||i.call(this),fe(this,ol,r(this.setOnline.bind(this)))}setOnline(r){M(this,Fs)!==r&&(fe(this,Fs,r),this.listeners.forEach(u=>{u(r)}))}isOnline(){return M(this,Fs)}},Fs=new WeakMap,ol=new WeakMap,Ws=new WeakMap,ig),eu=new Xy;function Vy(s){return Math.min(1e3*2**s,3e4)}function yg(s){return(s??"online")==="online"?eu.isOnline():!0}var Ud=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function bg(s){let r=!1,i=0,u;const d=Dd(),f=()=>d.status!=="pending",p=A=>{var O;if(!f()){const z=new Ud(A);C(z),(O=s.onCancel)==null||O.call(s,z)}},x=()=>{r=!0},m=()=>{r=!1},g=()=>of.isFocused()&&(s.networkMode==="always"||eu.isOnline())&&s.canRun(),y=()=>yg(s.networkMode)&&s.canRun(),v=A=>{f()||(u==null||u(),d.resolve(A))},C=A=>{f()||(u==null||u(),d.reject(A))},T=()=>new Promise(A=>{var O;u=z=>{(f()||g())&&A(z)},(O=s.onPause)==null||O.call(s)}).then(()=>{var A;u=void 0,f()||(A=s.onContinue)==null||A.call(s)}),w=()=>{if(f())return;let A;const O=i===0?s.initialPromise:void 0;try{A=O??s.fn()}catch(z){A=Promise.reject(z)}Promise.resolve(A).then(v).catch(z=>{var U;if(f())return;const K=s.retry??(ns?0:3),N=s.retryDelay??Vy,S=typeof N=="function"?N(i,z):N,D=K===!0||typeof K=="number"&&i<K||typeof K=="function"&&K(i,z);if(r||!D){C(z);return}i++,(U=s.onFail)==null||U.call(s,i,z),qy(S).then(()=>g()?void 0:T()).then(()=>{r?C(z):w()})})};return{promise:d,status:()=>d.status,cancel:p,continue:()=>(u==null||u(),d),cancelRetry:x,continueRetry:m,canStart:y,start:()=>(y()?w():T().then(w),d)}}var Zl,og,jg=(og=class{constructor(){be(this,Zl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rd(this.gcTime)&&fe(this,Zl,Xl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(ns?1/0:300*1e3))}clearGcTimeout(){M(this,Zl)&&(Xl.clearTimeout(M(this,Zl)),fe(this,Zl,void 0))}},Zl=new WeakMap,og),Jl,Is,kn,Fl,Mt,gi,Wl,Un,ya,ug,Zy=(ug=class extends jg{constructor(r){super();be(this,Un);be(this,Jl);be(this,Is);be(this,kn);be(this,Fl);be(this,Mt);be(this,gi);be(this,Wl);fe(this,Wl,!1),fe(this,gi,r.defaultOptions),this.setOptions(r.options),this.observers=[],fe(this,Fl,r.client),fe(this,kn,M(this,Fl).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,fe(this,Jl,kx(this.options)),this.state=r.state??M(this,Jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=M(this,Mt))==null?void 0:r.promise}setOptions(r){if(this.options={...M(this,gi),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=kx(this.options);i.data!==void 0&&(this.setState(Tx(i.data,i.dataUpdatedAt)),fe(this,Jl,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,kn).remove(this)}setData(r,i){const u=zd(this.state.data,r,this.options);return Oe(this,Un,ya).call(this,{data:u,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),u}setState(r,i){Oe(this,Un,ya).call(this,{type:"setState",state:r,setStateOptions:i})}cancel(r){var u,d;const i=(u=M(this,Mt))==null?void 0:u.promise;return(d=M(this,Mt))==null||d.cancel(r),i?i.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,Jl))}isActive(){return this.observers.some(r=>Mn(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>pl(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:!xg(this.state.dataUpdatedAt,r)}onFocus(){var i;const r=this.observers.find(u=>u.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(i=M(this,Mt))==null||i.continue()}onOnline(){var i;const r=this.observers.find(u=>u.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(i=M(this,Mt))==null||i.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),M(this,kn).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(i=>i!==r),this.observers.length||(M(this,Mt)&&(M(this,Wl)?M(this,Mt).cancel({revert:!0}):M(this,Mt).cancelRetry()),this.scheduleGc()),M(this,kn).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Oe(this,Un,ya).call(this,{type:"invalidate"})}async fetch(r,i){var m,g,y,v,C,T,w,A,O,z,K,N;if(this.state.fetchStatus!=="idle"&&((m=M(this,Mt))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(M(this,Mt))return M(this,Mt).continueRetry(),M(this,Mt).promise}if(r&&this.setOptions(r),!this.options.queryFn){const S=this.observers.find(D=>D.options.queryFn);S&&this.setOptions(S.options)}const u=new AbortController,d=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(fe(this,Wl,!0),u.signal)})},f=()=>{const S=vg(this.options,i),U=(()=>{const B={client:M(this,Fl),queryKey:this.queryKey,meta:this.meta};return d(B),B})();return fe(this,Wl,!1),this.options.persister?this.options.persister(S,U,this):S(U)},x=(()=>{const S={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:M(this,Fl),state:this.state,fetchFn:f};return d(S),S})();(g=this.options.behavior)==null||g.onFetch(x,this),fe(this,Is,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=x.fetchOptions)==null?void 0:y.meta))&&Oe(this,Un,ya).call(this,{type:"fetch",meta:(v=x.fetchOptions)==null?void 0:v.meta}),fe(this,Mt,bg({initialPromise:i==null?void 0:i.initialPromise,fn:x.fetchFn,onCancel:S=>{S instanceof Ud&&S.revert&&this.setState({...M(this,Is),fetchStatus:"idle"}),u.abort()},onFail:(S,D)=>{Oe(this,Un,ya).call(this,{type:"failed",failureCount:S,error:D})},onPause:()=>{Oe(this,Un,ya).call(this,{type:"pause"})},onContinue:()=>{Oe(this,Un,ya).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{const S=await M(this,Mt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(T=(C=M(this,kn).config).onSuccess)==null||T.call(C,S,this),(A=(w=M(this,kn).config).onSettled)==null||A.call(w,S,this.state.error,this),S}catch(S){if(S instanceof Ud){if(S.silent)return M(this,Mt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Oe(this,Un,ya).call(this,{type:"error",error:S}),(z=(O=M(this,kn).config).onError)==null||z.call(O,S,this),(N=(K=M(this,kn).config).onSettled)==null||N.call(K,this.state.data,S,this),S}finally{this.scheduleGc()}}},Jl=new WeakMap,Is=new WeakMap,kn=new WeakMap,Fl=new WeakMap,Mt=new WeakMap,gi=new WeakMap,Wl=new WeakMap,Un=new WeakSet,ya=function(r){const i=u=>{switch(r.type){case"failed":return{...u,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...Ng(u.data,this.options),fetchMeta:r.meta??null};case"success":const d={...u,...Tx(r.data,r.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return fe(this,Is,r.manual?d:void 0),d;case"error":const f=r.error;return{...u,error:f,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...r.state}}};this.state=i(this.state),wt.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),M(this,kn).notify({query:this,type:"updated",action:r})})},ug);function Ng(s,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yg(r.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function Tx(s,r){return{data:s,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function kx(s){const r=typeof s.initialData=="function"?s.initialData():s.initialData,i=r!==void 0,u=i?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:i?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var ln,Be,vi,Zt,Il,Ps,ja,ul,yi,er,tr,Pl,es,cl,nr,$e,fi,Ld,Hd,qd,Bd,Qd,Gd,Yd,Sg,cg,Jy=(cg=class extends cr{constructor(r,i){super();be(this,$e);be(this,ln);be(this,Be);be(this,vi);be(this,Zt);be(this,Il);be(this,Ps);be(this,ja);be(this,ul);be(this,yi);be(this,er);be(this,tr);be(this,Pl);be(this,es);be(this,cl);be(this,nr,new Set);this.options=i,fe(this,ln,r),fe(this,ul,null),fe(this,ja,Dd()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,Be).addObserver(this),Mx(M(this,Be),this.options)?Oe(this,$e,fi).call(this):this.updateResult(),Oe(this,$e,Bd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kd(M(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kd(M(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Oe(this,$e,Qd).call(this),Oe(this,$e,Gd).call(this),M(this,Be).removeObserver(this)}setOptions(r){const i=this.options,u=M(this,Be);if(this.options=M(this,ln).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Mn(this.options.enabled,M(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Oe(this,$e,Yd).call(this),M(this,Be).setOptions(this.options),i._defaulted&&!Po(this.options,i)&&M(this,ln).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,Be),observer:this});const d=this.hasListeners();d&&Ox(M(this,Be),u,this.options,i)&&Oe(this,$e,fi).call(this),this.updateResult(),d&&(M(this,Be)!==u||Mn(this.options.enabled,M(this,Be))!==Mn(i.enabled,M(this,Be))||pl(this.options.staleTime,M(this,Be))!==pl(i.staleTime,M(this,Be)))&&Oe(this,$e,Ld).call(this);const f=Oe(this,$e,Hd).call(this);d&&(M(this,Be)!==u||Mn(this.options.enabled,M(this,Be))!==Mn(i.enabled,M(this,Be))||f!==M(this,cl))&&Oe(this,$e,qd).call(this,f)}getOptimisticResult(r){const i=M(this,ln).getQueryCache().build(M(this,ln),r),u=this.createResult(i,r);return Wy(this,u)&&(fe(this,Zt,u),fe(this,Ps,this.options),fe(this,Il,M(this,Be).state)),u}getCurrentResult(){return M(this,Zt)}trackResult(r,i){return new Proxy(r,{get:(u,d)=>(this.trackProp(d),i==null||i(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&M(this,ja).status==="pending"&&M(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(r){M(this,nr).add(r)}getCurrentQuery(){return M(this,Be)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const i=M(this,ln).defaultQueryOptions(r),u=M(this,ln).getQueryCache().build(M(this,ln),i);return u.fetch().then(()=>this.createResult(u,i))}fetch(r){return Oe(this,$e,fi).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,Zt)))}createResult(r,i){var Z;const u=M(this,Be),d=this.options,f=M(this,Zt),p=M(this,Il),x=M(this,Ps),g=r!==u?r.state:M(this,vi),{state:y}=r;let v={...y},C=!1,T;if(i._optimisticResults){const J=this.hasListeners(),ne=!J&&Mx(r,i),Q=J&&Ox(r,u,i,d);(ne||Q)&&(v={...v,...Ng(y.data,r.options)}),i._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:w,errorUpdatedAt:A,status:O}=v;T=v.data;let z=!1;if(i.placeholderData!==void 0&&T===void 0&&O==="pending"){let J;f!=null&&f.isPlaceholderData&&i.placeholderData===(x==null?void 0:x.placeholderData)?(J=f.data,z=!0):J=typeof i.placeholderData=="function"?i.placeholderData((Z=M(this,tr))==null?void 0:Z.state.data,M(this,tr)):i.placeholderData,J!==void 0&&(O="success",T=zd(f==null?void 0:f.data,J,i),C=!0)}if(i.select&&T!==void 0&&!z)if(f&&T===(p==null?void 0:p.data)&&i.select===M(this,yi))T=M(this,er);else try{fe(this,yi,i.select),T=i.select(T),T=zd(f==null?void 0:f.data,T,i),fe(this,er,T),fe(this,ul,null)}catch(J){fe(this,ul,J)}M(this,ul)&&(w=M(this,ul),T=M(this,er),A=Date.now(),O="error");const K=v.fetchStatus==="fetching",N=O==="pending",S=O==="error",D=N&&K,U=T!==void 0,q={status:O,fetchStatus:v.fetchStatus,isPending:N,isSuccess:O==="success",isError:S,isInitialLoading:D,isLoading:D,data:T,dataUpdatedAt:v.dataUpdatedAt,error:w,errorUpdatedAt:A,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:K,isRefetching:K&&!N,isLoadingError:S&&!U,isPaused:v.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:S&&U,isStale:uf(r,i),refetch:this.refetch,promise:M(this,ja),isEnabled:Mn(i.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const J=q.data!==void 0,ne=q.status==="error"&&!J,Q=le=>{ne?le.reject(q.error):J&&le.resolve(q.data)},$=()=>{const le=fe(this,ja,q.promise=Dd());Q(le)},re=M(this,ja);switch(re.status){case"pending":r.queryHash===u.queryHash&&Q(re);break;case"fulfilled":(ne||q.data!==re.value)&&$();break;case"rejected":(!ne||q.error!==re.reason)&&$();break}}return q}updateResult(){const r=M(this,Zt),i=this.createResult(M(this,Be),this.options);if(fe(this,Il,M(this,Be).state),fe(this,Ps,this.options),M(this,Il).data!==void 0&&fe(this,tr,M(this,Be)),Po(i,r))return;fe(this,Zt,i);const u=()=>{if(!r)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!M(this,nr).size)return!0;const p=new Set(f??M(this,nr));return this.options.throwOnError&&p.add("error"),Object.keys(M(this,Zt)).some(x=>{const m=x;return M(this,Zt)[m]!==r[m]&&p.has(m)})};Oe(this,$e,Sg).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Oe(this,$e,Bd).call(this)}},ln=new WeakMap,Be=new WeakMap,vi=new WeakMap,Zt=new WeakMap,Il=new WeakMap,Ps=new WeakMap,ja=new WeakMap,ul=new WeakMap,yi=new WeakMap,er=new WeakMap,tr=new WeakMap,Pl=new WeakMap,es=new WeakMap,cl=new WeakMap,nr=new WeakMap,$e=new WeakSet,fi=function(r){Oe(this,$e,Yd).call(this);let i=M(this,Be).fetch(this.options,r);return r!=null&&r.throwOnError||(i=i.catch(Jt)),i},Ld=function(){Oe(this,$e,Qd).call(this);const r=pl(this.options.staleTime,M(this,Be));if(ns||M(this,Zt).isStale||!Rd(r))return;const u=xg(M(this,Zt).dataUpdatedAt,r)+1;fe(this,Pl,Xl.setTimeout(()=>{M(this,Zt).isStale||this.updateResult()},u))},Hd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,Be)):this.options.refetchInterval)??!1},qd=function(r){Oe(this,$e,Gd).call(this),fe(this,cl,r),!(ns||Mn(this.options.enabled,M(this,Be))===!1||!Rd(M(this,cl))||M(this,cl)===0)&&fe(this,es,Xl.setInterval(()=>{(this.options.refetchIntervalInBackground||of.isFocused())&&Oe(this,$e,fi).call(this)},M(this,cl)))},Bd=function(){Oe(this,$e,Ld).call(this),Oe(this,$e,qd).call(this,Oe(this,$e,Hd).call(this))},Qd=function(){M(this,Pl)&&(Xl.clearTimeout(M(this,Pl)),fe(this,Pl,void 0))},Gd=function(){M(this,es)&&(Xl.clearInterval(M(this,es)),fe(this,es,void 0))},Yd=function(){const r=M(this,ln).getQueryCache().build(M(this,ln),this.options);if(r===M(this,Be))return;const i=M(this,Be);fe(this,Be,r),fe(this,vi,r.state),this.hasListeners()&&(i==null||i.removeObserver(this),r.addObserver(this))},Sg=function(r){wt.batch(()=>{r.listeners&&this.listeners.forEach(i=>{i(M(this,Zt))}),M(this,ln).getQueryCache().notify({query:M(this,Be),type:"observerResultsUpdated"})})},cg);function Fy(s,r){return Mn(r.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&r.retryOnMount===!1)}function Mx(s,r){return Fy(s,r)||s.state.data!==void 0&&Kd(s,r,r.refetchOnMount)}function Kd(s,r,i){if(Mn(r.enabled,s)!==!1&&pl(r.staleTime,s)!=="static"){const u=typeof i=="function"?i(s):i;return u==="always"||u!==!1&&uf(s,r)}return!1}function Ox(s,r,i,u){return(s!==r||Mn(u.enabled,s)===!1)&&(!i.suspense||s.state.status!=="error")&&uf(s,i)}function uf(s,r){return Mn(r.enabled,s)!==!1&&s.isStaleByTime(pl(r.staleTime,s))}function Wy(s,r){return!Po(s.getCurrentResult(),r)}function Ax(s){return{onFetch:(r,i)=>{var y,v,C,T,w;const u=r.options,d=(C=(v=(y=r.fetchOptions)==null?void 0:y.meta)==null?void 0:v.fetchMore)==null?void 0:C.direction,f=((T=r.state.data)==null?void 0:T.pages)||[],p=((w=r.state.data)==null?void 0:w.pageParams)||[];let x={pages:[],pageParams:[]},m=0;const g=async()=>{let A=!1;const O=N=>{Gy(N,()=>r.signal,()=>A=!0)},z=vg(r.options,r.fetchOptions),K=async(N,S,D)=>{if(A)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const B=(()=>{const ne={client:r.client,queryKey:r.queryKey,pageParam:S,direction:D?"backward":"forward",meta:r.options.meta};return O(ne),ne})(),q=await z(B),{maxPages:Z}=r.options,J=D?Qy:By;return{pages:J(N.pages,q,Z),pageParams:J(N.pageParams,S,Z)}};if(d&&f.length){const N=d==="backward",S=N?Iy:Rx,D={pages:f,pageParams:p},U=S(u,D);x=await K(D,U,N)}else{const N=s??f.length;do{const S=m===0?p[0]??u.initialPageParam:Rx(u,x);if(m>0&&S==null)break;x=await K(x,S),m++}while(m<N)}return x};r.options.persister?r.fetchFn=()=>{var A,O;return(O=(A=r.options).persister)==null?void 0:O.call(A,g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},i)}:r.fetchFn=g}}}function Rx(s,{pages:r,pageParams:i}){const u=r.length-1;return r.length>0?s.getNextPageParam(r[u],r,i[u],i):void 0}function Iy(s,{pages:r,pageParams:i}){var u;return r.length>0?(u=s.getPreviousPageParam)==null?void 0:u.call(s,r[0],r,i[0],i):void 0}var bi,Zn,Gt,ts,Jn,sl,dg,Py=(dg=class extends jg{constructor(r){super();be(this,Jn);be(this,bi);be(this,Zn);be(this,Gt);be(this,ts);fe(this,bi,r.client),this.mutationId=r.mutationId,fe(this,Gt,r.mutationCache),fe(this,Zn,[]),this.state=r.state||wg(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){M(this,Zn).includes(r)||(M(this,Zn).push(r),this.clearGcTimeout(),M(this,Gt).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){fe(this,Zn,M(this,Zn).filter(i=>i!==r)),this.scheduleGc(),M(this,Gt).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){M(this,Zn).length||(this.state.status==="pending"?this.scheduleGc():M(this,Gt).remove(this))}continue(){var r;return((r=M(this,ts))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var p,x,m,g,y,v,C,T,w,A,O,z,K,N,S,D,U,B;const i=()=>{Oe(this,Jn,sl).call(this,{type:"continue"})},u={client:M(this,bi),meta:this.options.meta,mutationKey:this.options.mutationKey};fe(this,ts,bg({fn:()=>this.options.mutationFn?this.options.mutationFn(r,u):Promise.reject(new Error("No mutationFn found")),onFail:(q,Z)=>{Oe(this,Jn,sl).call(this,{type:"failed",failureCount:q,error:Z})},onPause:()=>{Oe(this,Jn,sl).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,Gt).canRun(this)}));const d=this.state.status==="pending",f=!M(this,ts).canStart();try{if(d)i();else{Oe(this,Jn,sl).call(this,{type:"pending",variables:r,isPaused:f}),M(this,Gt).config.onMutate&&await M(this,Gt).config.onMutate(r,this,u);const Z=await((x=(p=this.options).onMutate)==null?void 0:x.call(p,r,u));Z!==this.state.context&&Oe(this,Jn,sl).call(this,{type:"pending",context:Z,variables:r,isPaused:f})}const q=await M(this,ts).start();return await((g=(m=M(this,Gt).config).onSuccess)==null?void 0:g.call(m,q,r,this.state.context,this,u)),await((v=(y=this.options).onSuccess)==null?void 0:v.call(y,q,r,this.state.context,u)),await((T=(C=M(this,Gt).config).onSettled)==null?void 0:T.call(C,q,null,this.state.variables,this.state.context,this,u)),await((A=(w=this.options).onSettled)==null?void 0:A.call(w,q,null,r,this.state.context,u)),Oe(this,Jn,sl).call(this,{type:"success",data:q}),q}catch(q){try{await((z=(O=M(this,Gt).config).onError)==null?void 0:z.call(O,q,r,this.state.context,this,u))}catch(Z){Promise.reject(Z)}try{await((N=(K=this.options).onError)==null?void 0:N.call(K,q,r,this.state.context,u))}catch(Z){Promise.reject(Z)}try{await((D=(S=M(this,Gt).config).onSettled)==null?void 0:D.call(S,void 0,q,this.state.variables,this.state.context,this,u))}catch(Z){Promise.reject(Z)}try{await((B=(U=this.options).onSettled)==null?void 0:B.call(U,void 0,q,r,this.state.context,u))}catch(Z){Promise.reject(Z)}throw Oe(this,Jn,sl).call(this,{type:"error",error:q}),q}finally{M(this,Gt).runNext(this)}}},bi=new WeakMap,Zn=new WeakMap,Gt=new WeakMap,ts=new WeakMap,Jn=new WeakSet,sl=function(r){const i=u=>{switch(r.type){case"failed":return{...u,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,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{...u,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:r.error,failureCount:u.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=i(this.state),wt.batch(()=>{M(this,Zn).forEach(u=>{u.onMutationUpdate(r)}),M(this,Gt).notify({mutation:this,type:"updated",action:r})})},dg);function wg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Na,Ln,ji,fg,eb=(fg=class extends cr{constructor(r={}){super();be(this,Na);be(this,Ln);be(this,ji);this.config=r,fe(this,Na,new Set),fe(this,Ln,new Map),fe(this,ji,0)}build(r,i,u){const d=new Py({client:r,mutationCache:this,mutationId:++Yo(this,ji)._,options:r.defaultMutationOptions(i),state:u});return this.add(d),d}add(r){M(this,Na).add(r);const i=Ko(r);if(typeof i=="string"){const u=M(this,Ln).get(i);u?u.push(r):M(this,Ln).set(i,[r])}this.notify({type:"added",mutation:r})}remove(r){if(M(this,Na).delete(r)){const i=Ko(r);if(typeof i=="string"){const u=M(this,Ln).get(i);if(u)if(u.length>1){const d=u.indexOf(r);d!==-1&&u.splice(d,1)}else u[0]===r&&M(this,Ln).delete(i)}}this.notify({type:"removed",mutation:r})}canRun(r){const i=Ko(r);if(typeof i=="string"){const u=M(this,Ln).get(i),d=u==null?void 0:u.find(f=>f.state.status==="pending");return!d||d===r}else return!0}runNext(r){var u;const i=Ko(r);if(typeof i=="string"){const d=(u=M(this,Ln).get(i))==null?void 0:u.find(f=>f!==r&&f.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{M(this,Na).forEach(r=>{this.notify({type:"removed",mutation:r})}),M(this,Na).clear(),M(this,Ln).clear()})}getAll(){return Array.from(M(this,Na))}find(r){const i={exact:!0,...r};return this.getAll().find(u=>wx(i,u))}findAll(r={}){return this.getAll().filter(i=>wx(r,i))}notify(r){wt.batch(()=>{this.listeners.forEach(i=>{i(r)})})}resumePausedMutations(){const r=this.getAll().filter(i=>i.state.isPaused);return wt.batch(()=>Promise.all(r.map(i=>i.continue().catch(Jt))))}},Na=new WeakMap,Ln=new WeakMap,ji=new WeakMap,fg);function Ko(s){var r;return(r=s.options.scope)==null?void 0:r.id}var Sa,dl,sn,wa,Ea,Jo,$d,hg,tb=(hg=class extends cr{constructor(i,u){super();be(this,Ea);be(this,Sa);be(this,dl);be(this,sn);be(this,wa);fe(this,Sa,i),this.setOptions(u),this.bindMethods(),Oe(this,Ea,Jo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var d;const u=this.options;this.options=M(this,Sa).defaultMutationOptions(i),Po(this.options,u)||M(this,Sa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,sn),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&as(u.mutationKey)!==as(this.options.mutationKey)?this.reset():((d=M(this,sn))==null?void 0:d.state.status)==="pending"&&M(this,sn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=M(this,sn))==null||i.removeObserver(this)}onMutationUpdate(i){Oe(this,Ea,Jo).call(this),Oe(this,Ea,$d).call(this,i)}getCurrentResult(){return M(this,dl)}reset(){var i;(i=M(this,sn))==null||i.removeObserver(this),fe(this,sn,void 0),Oe(this,Ea,Jo).call(this),Oe(this,Ea,$d).call(this)}mutate(i,u){var d;return fe(this,wa,u),(d=M(this,sn))==null||d.removeObserver(this),fe(this,sn,M(this,Sa).getMutationCache().build(M(this,Sa),this.options)),M(this,sn).addObserver(this),M(this,sn).execute(i)}},Sa=new WeakMap,dl=new WeakMap,sn=new WeakMap,wa=new WeakMap,Ea=new WeakSet,Jo=function(){var u;const i=((u=M(this,sn))==null?void 0:u.state)??wg();fe(this,dl,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},$d=function(i){wt.batch(()=>{var u,d,f,p,x,m,g,y;if(M(this,wa)&&this.hasListeners()){const v=M(this,dl).variables,C=M(this,dl).context,T={client:M(this,Sa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(d=(u=M(this,wa)).onSuccess)==null||d.call(u,i.data,v,C,T)}catch(w){Promise.reject(w)}try{(p=(f=M(this,wa)).onSettled)==null||p.call(f,i.data,null,v,C,T)}catch(w){Promise.reject(w)}}else if((i==null?void 0:i.type)==="error"){try{(m=(x=M(this,wa)).onError)==null||m.call(x,i.error,v,C,T)}catch(w){Promise.reject(w)}try{(y=(g=M(this,wa)).onSettled)==null||y.call(g,void 0,i.error,v,C,T)}catch(w){Promise.reject(w)}}}this.listeners.forEach(v=>{v(M(this,dl))})})},hg),Fn,mg,nb=(mg=class extends cr{constructor(r={}){super();be(this,Fn);this.config=r,fe(this,Fn,new Map)}build(r,i,u){const d=i.queryKey,f=i.queryHash??lf(d,i);let p=this.get(f);return p||(p=new Zy({client:r,queryKey:d,queryHash:f,options:r.defaultQueryOptions(i),state:u,defaultOptions:r.getQueryDefaults(d)}),this.add(p)),p}add(r){M(this,Fn).has(r.queryHash)||(M(this,Fn).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const i=M(this,Fn).get(r.queryHash);i&&(r.destroy(),i===r&&M(this,Fn).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){wt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return M(this,Fn).get(r)}getAll(){return[...M(this,Fn).values()]}find(r){const i={exact:!0,...r};return this.getAll().find(u=>Sx(i,u))}findAll(r={}){const i=this.getAll();return Object.keys(r).length>0?i.filter(u=>Sx(r,u)):i}notify(r){wt.batch(()=>{this.listeners.forEach(i=>{i(r)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},Fn=new WeakMap,mg),pt,fl,hl,ar,lr,ml,sr,rr,pg,ab=(pg=class{constructor(s={}){be(this,pt);be(this,fl);be(this,hl);be(this,ar);be(this,lr);be(this,ml);be(this,sr);be(this,rr);fe(this,pt,s.queryCache||new nb),fe(this,fl,s.mutationCache||new eb),fe(this,hl,s.defaultOptions||{}),fe(this,ar,new Map),fe(this,lr,new Map),fe(this,ml,0)}mount(){Yo(this,ml)._++,M(this,ml)===1&&(fe(this,sr,of.subscribe(async s=>{s&&(await this.resumePausedMutations(),M(this,pt).onFocus())})),fe(this,rr,eu.subscribe(async s=>{s&&(await this.resumePausedMutations(),M(this,pt).onOnline())})))}unmount(){var s,r;Yo(this,ml)._--,M(this,ml)===0&&((s=M(this,sr))==null||s.call(this),fe(this,sr,void 0),(r=M(this,rr))==null||r.call(this),fe(this,rr,void 0))}isFetching(s){return M(this,pt).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return M(this,fl).findAll({...s,status:"pending"}).length}getQueryData(s){var i;const r=this.defaultQueryOptions({queryKey:s});return(i=M(this,pt).get(r.queryHash))==null?void 0:i.state.data}ensureQueryData(s){const r=this.defaultQueryOptions(s),i=M(this,pt).build(this,r),u=i.state.data;return u===void 0?this.fetchQuery(s):(s.revalidateIfStale&&i.isStaleByTime(pl(r.staleTime,i))&&this.prefetchQuery(r),Promise.resolve(u))}getQueriesData(s){return M(this,pt).findAll(s).map(({queryKey:r,state:i})=>{const u=i.data;return[r,u]})}setQueryData(s,r,i){const u=this.defaultQueryOptions({queryKey:s}),d=M(this,pt).get(u.queryHash),f=d==null?void 0:d.state.data,p=Ly(r,f);if(p!==void 0)return M(this,pt).build(this,u).setData(p,{...i,manual:!0})}setQueriesData(s,r,i){return wt.batch(()=>M(this,pt).findAll(s).map(({queryKey:u})=>[u,this.setQueryData(u,r,i)]))}getQueryState(s){var i;const r=this.defaultQueryOptions({queryKey:s});return(i=M(this,pt).get(r.queryHash))==null?void 0:i.state}removeQueries(s){const r=M(this,pt);wt.batch(()=>{r.findAll(s).forEach(i=>{r.remove(i)})})}resetQueries(s,r){const i=M(this,pt);return wt.batch(()=>(i.findAll(s).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...s},r)))}cancelQueries(s,r={}){const i={revert:!0,...r},u=wt.batch(()=>M(this,pt).findAll(s).map(d=>d.cancel(i)));return Promise.all(u).then(Jt).catch(Jt)}invalidateQueries(s,r={}){return wt.batch(()=>(M(this,pt).findAll(s).forEach(i=>{i.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 i={...r,cancelRefetch:r.cancelRefetch??!0},u=wt.batch(()=>M(this,pt).findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,i);return i.throwOnError||(f=f.catch(Jt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(u).then(Jt)}fetchQuery(s){const r=this.defaultQueryOptions(s);r.retry===void 0&&(r.retry=!1);const i=M(this,pt).build(this,r);return i.isStaleByTime(pl(r.staleTime,i))?i.fetch(r):Promise.resolve(i.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Jt).catch(Jt)}fetchInfiniteQuery(s){return s.behavior=Ax(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Jt).catch(Jt)}ensureInfiniteQueryData(s){return s.behavior=Ax(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return eu.isOnline()?M(this,fl).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,pt)}getMutationCache(){return M(this,fl)}getDefaultOptions(){return M(this,hl)}setDefaultOptions(s){fe(this,hl,s)}setQueryDefaults(s,r){M(this,ar).set(as(s),{queryKey:s,defaultOptions:r})}getQueryDefaults(s){const r=[...M(this,ar).values()],i={};return r.forEach(u=>{hi(s,u.queryKey)&&Object.assign(i,u.defaultOptions)}),i}setMutationDefaults(s,r){M(this,lr).set(as(s),{mutationKey:s,defaultOptions:r})}getMutationDefaults(s){const r=[...M(this,lr).values()],i={};return r.forEach(u=>{hi(s,u.mutationKey)&&Object.assign(i,u.defaultOptions)}),i}defaultQueryOptions(s){if(s._defaulted)return s;const r={...M(this,hl).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return r.queryHash||(r.queryHash=lf(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===sf&&(r.enabled=!1),r}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...M(this,hl).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){M(this,pt).clear(),M(this,fl).clear()}},pt=new WeakMap,fl=new WeakMap,hl=new WeakMap,ar=new WeakMap,lr=new WeakMap,ml=new WeakMap,sr=new WeakMap,rr=new WeakMap,pg),Cg=b.createContext(void 0),Ni=s=>{const r=b.useContext(Cg);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},lb=({client:s,children:r})=>(b.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),a.jsx(Cg.Provider,{value:s,children:r})),Eg=b.createContext(!1),sb=()=>b.useContext(Eg);Eg.Provider;function rb(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var ib=b.createContext(rb()),ob=()=>b.useContext(ib),ub=(s,r,i)=>{const u=i!=null&&i.state.error&&typeof s.throwOnError=="function"?rf(s.throwOnError,[i.state.error,i]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||u)&&(r.isReset()||(s.retryOnMount=!1))},cb=s=>{b.useEffect(()=>{s.clearReset()},[s])},db=({result:s,errorResetBoundary:r,throwOnError:i,query:u,suspense:d})=>s.isError&&!r.isReset()&&!s.isFetching&&u&&(d&&s.data===void 0||rf(i,[s.error,u])),fb=s=>{if(s.suspense){const i=d=>d==="static"?d:Math.max(d??1e3,1e3),u=s.staleTime;s.staleTime=typeof u=="function"?(...d)=>i(u(...d)):i(u),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},hb=(s,r)=>s.isLoading&&s.isFetching&&!r,mb=(s,r)=>(s==null?void 0:s.suspense)&&r.isPending,_x=(s,r,i)=>r.fetchOptimistic(s).catch(()=>{i.clearReset()});function pb(s,r,i){var C,T,w,A;const u=sb(),d=ob(),f=Ni(),p=f.defaultQueryOptions(s);(T=(C=f.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||T.call(C,p);const x=f.getQueryCache().get(p.queryHash);p._optimisticResults=u?"isRestoring":"optimistic",fb(p),ub(p,d,x),cb(d);const m=!f.getQueryCache().get(p.queryHash),[g]=b.useState(()=>new r(f,p)),y=g.getOptimisticResult(p),v=!u&&s.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(O=>{const z=v?g.subscribe(wt.batchCalls(O)):Jt;return g.updateResult(),z},[g,v]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),b.useEffect(()=>{g.setOptions(p)},[p,g]),mb(p,y))throw _x(p,g,d);if(db({result:y,errorResetBoundary:d,throwOnError:p.throwOnError,query:x,suspense:p.suspense}))throw y.error;if((A=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||A.call(w,p,y),p.experimental_prefetchInRender&&!ns&&hb(y,u)){const O=m?_x(p,g,d):x==null?void 0:x.promise;O==null||O.catch(Jt).finally(()=>{g.updateResult()})}return p.notifyOnChangeProps?y:g.trackResult(y)}function gn(s,r){return pb(s,Jy)}function Xd(s,r){const i=Ni(),[u]=b.useState(()=>new tb(i,s));b.useEffect(()=>{u.setOptions(s)},[u,s]);const d=b.useSyncExternalStore(b.useCallback(p=>u.subscribe(wt.batchCalls(p)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),f=b.useCallback((p,x)=>{u.mutate(p,x).catch(Jt)},[u]);if(d.error&&rf(u.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:f,mutateAsync:d.mutate}}const xb=new ab({defaultOptions:{queries:{staleTime:5e3,retry:1}}});/**
|
|
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 zx="popstate";function gb(s={}){function r(u,d){let{pathname:f,search:p,hash:x}=u.location;return Vd("",{pathname:f,search:p,hash:x},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function i(u,d){return typeof d=="string"?d:mi(d)}return yb(r,i,null,s)}function ct(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function Hn(s,r){if(!s){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function vb(){return Math.random().toString(36).substring(2,10)}function Dx(s,r){return{usr:s.state,key:s.key,idx:r}}function Vd(s,r,i=null,u){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof r=="string"?dr(r):r,state:i,key:r&&r.key||u||vb()}}function mi({pathname:s="/",search:r="",hash:i=""}){return r&&r!=="?"&&(s+=r.charAt(0)==="?"?r:"?"+r),i&&i!=="#"&&(s+=i.charAt(0)==="#"?i:"#"+i),s}function dr(s){let r={};if(s){let i=s.indexOf("#");i>=0&&(r.hash=s.substring(i),s=s.substring(0,i));let u=s.indexOf("?");u>=0&&(r.search=s.substring(u),s=s.substring(0,u)),s&&(r.pathname=s)}return r}function yb(s,r,i,u={}){let{window:d=document.defaultView,v5Compat:f=!1}=u,p=d.history,x="POP",m=null,g=y();g==null&&(g=0,p.replaceState({...p.state,idx:g},""));function y(){return(p.state||{idx:null}).idx}function v(){x="POP";let O=y(),z=O==null?null:O-g;g=O,m&&m({action:x,location:A.location,delta:z})}function C(O,z){x="PUSH";let K=Vd(A.location,O,z);g=y()+1;let N=Dx(K,g),S=A.createHref(K);try{p.pushState(N,"",S)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;d.location.assign(S)}f&&m&&m({action:x,location:A.location,delta:1})}function T(O,z){x="REPLACE";let K=Vd(A.location,O,z);g=y();let N=Dx(K,g),S=A.createHref(K);p.replaceState(N,"",S),f&&m&&m({action:x,location:A.location,delta:0})}function w(O){return bb(O)}let A={get action(){return x},get location(){return s(d,p)},listen(O){if(m)throw new Error("A history only accepts one active listener");return d.addEventListener(zx,v),m=O,()=>{d.removeEventListener(zx,v),m=null}},createHref(O){return r(d,O)},createURL:w,encodeLocation(O){let z=w(O);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:C,replace:T,go(O){return p.go(O)}};return A}function bb(s,r=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),ct(i,"No window.location.(origin|href) available to create URL");let u=typeof s=="string"?s:mi(s);return u=u.replace(/ $/,"%20"),!r&&u.startsWith("//")&&(u=i+u),new URL(u,i)}function Tg(s,r,i="/"){return jb(s,r,i,!1)}function jb(s,r,i,u){let d=typeof r=="string"?dr(r):r,f=Ta(d.pathname||"/",i);if(f==null)return null;let p=kg(s);Nb(p);let x=null;for(let m=0;x==null&&m<p.length;++m){let g=_b(f);x=Ab(p[m],g,u)}return x}function kg(s,r=[],i=[],u="",d=!1){let f=(p,x,m=d,g)=>{let y={relativePath:g===void 0?p.path||"":g,caseSensitive:p.caseSensitive===!0,childrenIndex:x,route:p};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(u)&&m)return;ct(y.relativePath.startsWith(u),`Absolute route path "${y.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(u.length)}let v=Ca([u,y.relativePath]),C=i.concat(y);p.children&&p.children.length>0&&(ct(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),kg(p.children,r,C,v,m)),!(p.path==null&&!p.index)&&r.push({path:v,score:Mb(v,p.index),routesMeta:C})};return s.forEach((p,x)=>{var m;if(p.path===""||!((m=p.path)!=null&&m.includes("?")))f(p,x);else for(let g of Mg(p.path))f(p,x,!0,g)}),r}function Mg(s){let r=s.split("/");if(r.length===0)return[];let[i,...u]=r,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let p=Mg(u.join("/")),x=[];return x.push(...p.map(m=>m===""?f:[f,m].join("/"))),d&&x.push(...p),x.map(m=>s.startsWith("/")&&m===""?"/":m)}function Nb(s){s.sort((r,i)=>r.score!==i.score?i.score-r.score:Ob(r.routesMeta.map(u=>u.childrenIndex),i.routesMeta.map(u=>u.childrenIndex)))}var Sb=/^:[\w-]+$/,wb=3,Cb=2,Eb=1,Tb=10,kb=-2,Ux=s=>s==="*";function Mb(s,r){let i=s.split("/"),u=i.length;return i.some(Ux)&&(u+=kb),r&&(u+=Cb),i.filter(d=>!Ux(d)).reduce((d,f)=>d+(Sb.test(f)?wb:f===""?Eb:Tb),u)}function Ob(s,r){return s.length===r.length&&s.slice(0,-1).every((u,d)=>u===r[d])?s[s.length-1]-r[r.length-1]:0}function Ab(s,r,i=!1){let{routesMeta:u}=s,d={},f="/",p=[];for(let x=0;x<u.length;++x){let m=u[x],g=x===u.length-1,y=f==="/"?r:r.slice(f.length)||"/",v=tu({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},y),C=m.route;if(!v&&g&&i&&!u[u.length-1].route.index&&(v=tu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!v)return null;Object.assign(d,v.params),p.push({params:d,pathname:Ca([f,v.pathname]),pathnameBase:Lb(Ca([f,v.pathnameBase])),route:C}),v.pathnameBase!=="/"&&(f=Ca([f,v.pathnameBase]))}return p}function tu(s,r){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[i,u]=Rb(s.path,s.caseSensitive,s.end),d=r.match(i);if(!d)return null;let f=d[0],p=f.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:u.reduce((g,{paramName:y,isOptional:v},C)=>{if(y==="*"){let w=x[C]||"";p=f.slice(0,f.length-w.length).replace(/(.)\/+$/,"$1")}const T=x[C];return v&&!T?g[y]=void 0:g[y]=(T||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:p,pattern:s}}function Rb(s,r=!1,i=!0){Hn(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 u=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,x,m)=>(u.push({paramName:x,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(u.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,r?void 0:"i"),u]}function _b(s){try{return s.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Hn(!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 Ta(s,r){if(r==="/")return s;if(!s.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,u=s.charAt(i);return u&&u!=="/"?null:s.slice(i)||"/"}var zb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Db(s,r="/"){let{pathname:i,search:u="",hash:d=""}=typeof s=="string"?dr(s):s,f;return i?(i=i.replace(/\/\/+/g,"/"),i.startsWith("/")?f=Lx(i.substring(1),"/"):f=Lx(i,r)):f=r,{pathname:f,search:Hb(u),hash:qb(d)}}function Lx(s,r){let i=r.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function Ed(s,r,i,u){return`Cannot include a '${s}' character in a manually specified \`to.${r}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ub(s){return s.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function cf(s){let r=Ub(s);return r.map((i,u)=>u===r.length-1?i.pathname:i.pathnameBase)}function df(s,r,i,u=!1){let d;typeof s=="string"?d=dr(s):(d={...s},ct(!d.pathname||!d.pathname.includes("?"),Ed("?","pathname","search",d)),ct(!d.pathname||!d.pathname.includes("#"),Ed("#","pathname","hash",d)),ct(!d.search||!d.search.includes("#"),Ed("#","search","hash",d)));let f=s===""||d.pathname==="",p=f?"/":d.pathname,x;if(p==null)x=i;else{let v=r.length-1;if(!u&&p.startsWith("..")){let C=p.split("/");for(;C[0]==="..";)C.shift(),v-=1;d.pathname=C.join("/")}x=v>=0?r[v]:"/"}let m=Db(d,x),g=p&&p!=="/"&&p.endsWith("/"),y=(f||p===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(g||y)&&(m.pathname+="/"),m}var Ca=s=>s.join("/").replace(/\/\/+/g,"/"),Lb=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Hb=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,qb=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Bb=class{constructor(s,r,i,u=!1){this.status=s,this.statusText=r||"",this.internal=u,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Qb(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Gb(s){return s.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Og=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ag(s,r){let i=s;if(typeof i!="string"||!zb.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let u=i,d=!1;if(Og)try{let f=new URL(window.location.href),p=i.startsWith("//")?new URL(f.protocol+i):new URL(i),x=Ta(p.pathname,r);p.origin===f.origin&&x!=null?i=x+p.search+p.hash:d=!0}catch{Hn(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Rg=["POST","PUT","PATCH","DELETE"];new Set(Rg);var Yb=["GET",...Rg];new Set(Yb);var fr=b.createContext(null);fr.displayName="DataRouter";var su=b.createContext(null);su.displayName="DataRouterState";var Kb=b.createContext(!1),_g=b.createContext({isTransitioning:!1});_g.displayName="ViewTransition";var $b=b.createContext(new Map);$b.displayName="Fetchers";var Xb=b.createContext(null);Xb.displayName="Await";var yn=b.createContext(null);yn.displayName="Navigation";var Si=b.createContext(null);Si.displayName="Location";var Wn=b.createContext({outlet:null,matches:[],isDataRoute:!1});Wn.displayName="Route";var ff=b.createContext(null);ff.displayName="RouteError";var zg="REACT_ROUTER_ERROR",Vb="REDIRECT",Zb="ROUTE_ERROR_RESPONSE";function Jb(s){if(s.startsWith(`${zg}:${Vb}:{`))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 Fb(s){if(s.startsWith(`${zg}:${Zb}:{`))try{let r=JSON.parse(s.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Bb(r.status,r.statusText,r.data)}catch{}}function Wb(s,{relative:r}={}){ct(hr(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:u}=b.useContext(yn),{hash:d,pathname:f,search:p}=wi(s,{relative:r}),x=f;return i!=="/"&&(x=f==="/"?i:Ca([i,f])),u.createHref({pathname:x,search:p,hash:d})}function hr(){return b.useContext(Si)!=null}function yl(){return ct(hr(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Si).location}var Dg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ug(s){b.useContext(yn).static||b.useLayoutEffect(s)}function Lg(){let{isDataRoute:s}=b.useContext(Wn);return s?c1():Ib()}function Ib(){ct(hr(),"useNavigate() may be used only in the context of a <Router> component.");let s=b.useContext(fr),{basename:r,navigator:i}=b.useContext(yn),{matches:u}=b.useContext(Wn),{pathname:d}=yl(),f=JSON.stringify(cf(u)),p=b.useRef(!1);return Ug(()=>{p.current=!0}),b.useCallback((m,g={})=>{if(Hn(p.current,Dg),!p.current)return;if(typeof m=="number"){i.go(m);return}let y=df(m,JSON.parse(f),d,g.relative==="path");s==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:Ca([r,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[r,i,f,d,s])}b.createContext(null);function wi(s,{relative:r}={}){let{matches:i}=b.useContext(Wn),{pathname:u}=yl(),d=JSON.stringify(cf(i));return b.useMemo(()=>df(s,JSON.parse(d),u,r==="path"),[s,d,u,r])}function Pb(s,r){return Hg(s,r)}function Hg(s,r,i,u,d){var K;ct(hr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=b.useContext(yn),{matches:p}=b.useContext(Wn),x=p[p.length-1],m=x?x.params:{},g=x?x.pathname:"/",y=x?x.pathnameBase:"/",v=x&&x.route;{let N=v&&v.path||"";Bg(g,!v||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${N}">) 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="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let C=yl(),T;if(r){let N=typeof r=="string"?dr(r):r;ct(y==="/"||((K=N.pathname)==null?void 0:K.startsWith(y)),`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 "${y}" but pathname "${N.pathname}" was given in the \`location\` prop.`),T=N}else T=C;let w=T.pathname||"/",A=w;if(y!=="/"){let N=y.replace(/^\//,"").split("/");A="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let O=Tg(s,{pathname:A});Hn(v||O!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Hn(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.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 z=l1(O&&O.map(N=>Object.assign({},N,{params:Object.assign({},m,N.params),pathname:Ca([y,f.encodeLocation?f.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?y:Ca([y,f.encodeLocation?f.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),p,i,u,d);return r&&z?b.createElement(Si.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},z):z}function e1(){let s=u1(),r=Qb(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),i=s instanceof Error?s.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},f={padding:"2px 4px",backgroundColor:u},p=null;return console.error("Error handled by React Router default ErrorBoundary:",s),p=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),i?b.createElement("pre",{style:d},i):null,p)}var t1=b.createElement(e1,null),qg=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 i=Fb(s.digest);i&&(s=i)}let r=s!==void 0?b.createElement(Wn.Provider,{value:this.props.routeContext},b.createElement(ff.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?b.createElement(n1,{error:s},r):r}};qg.contextType=Kb;var Td=new WeakMap;function n1({children:s,error:r}){let{basename:i}=b.useContext(yn);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let u=Jb(r.digest);if(u){let d=Td.get(r);if(d)throw d;let f=Ag(u.location,i);if(Og&&!Td.get(r))if(f.isExternal||u.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:u.replace}));throw Td.set(r,p),p}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return s}function a1({routeContext:s,match:r,children:i}){let u=b.useContext(fr);return u&&u.static&&u.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Wn.Provider,{value:s},i)}function l1(s,r=[],i=null,u=null,d=null){if(s==null){if(!i)return null;if(i.errors)s=i.matches;else if(r.length===0&&!i.initialized&&i.matches.length>0)s=i.matches;else return null}let f=s,p=i==null?void 0:i.errors;if(p!=null){let y=f.findIndex(v=>v.route.id&&(p==null?void 0:p[v.route.id])!==void 0);ct(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(p).join(",")}`),f=f.slice(0,Math.min(f.length,y+1))}let x=!1,m=-1;if(i)for(let y=0;y<f.length;y++){let v=f[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=y),v.route.id){let{loaderData:C,errors:T}=i,w=v.route.loader&&!C.hasOwnProperty(v.route.id)&&(!T||T[v.route.id]===void 0);if(v.route.lazy||w){x=!0,m>=0?f=f.slice(0,m+1):f=[f[0]];break}}}let g=i&&u?(y,v)=>{var C,T;u(y,{location:i.location,params:((T=(C=i.matches)==null?void 0:C[0])==null?void 0:T.params)??{},unstable_pattern:Gb(i.matches),errorInfo:v})}:void 0;return f.reduceRight((y,v,C)=>{let T,w=!1,A=null,O=null;i&&(T=p&&v.route.id?p[v.route.id]:void 0,A=v.route.errorElement||t1,x&&(m<0&&C===0?(Bg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,O=null):m===C&&(w=!0,O=v.route.hydrateFallbackElement||null)));let z=r.concat(f.slice(0,C+1)),K=()=>{let N;return T?N=A:w?N=O:v.route.Component?N=b.createElement(v.route.Component,null):v.route.element?N=v.route.element:N=y,b.createElement(a1,{match:v,routeContext:{outlet:y,matches:z,isDataRoute:i!=null},children:N})};return i&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?b.createElement(qg,{location:i.location,revalidation:i.revalidation,component:A,error:T,children:K(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):K()},null)}function hf(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s1(s){let r=b.useContext(fr);return ct(r,hf(s)),r}function r1(s){let r=b.useContext(su);return ct(r,hf(s)),r}function i1(s){let r=b.useContext(Wn);return ct(r,hf(s)),r}function mf(s){let r=i1(s),i=r.matches[r.matches.length-1];return ct(i.route.id,`${s} can only be used on routes that contain a unique "id"`),i.route.id}function o1(){return mf("useRouteId")}function u1(){var u;let s=b.useContext(ff),r=r1("useRouteError"),i=mf("useRouteError");return s!==void 0?s:(u=r.errors)==null?void 0:u[i]}function c1(){let{router:s}=s1("useNavigate"),r=mf("useNavigate"),i=b.useRef(!1);return Ug(()=>{i.current=!0}),b.useCallback(async(d,f={})=>{Hn(i.current,Dg),i.current&&(typeof d=="number"?await s.navigate(d):await s.navigate(d,{fromRouteId:r,...f}))},[s,r])}var Hx={};function Bg(s,r,i){!r&&!Hx[s]&&(Hx[s]=!0,Hn(!1,i))}b.memo(d1);function d1({routes:s,future:r,state:i,onError:u}){return Hg(s,void 0,i,u,r)}function f1({to:s,replace:r,state:i,relative:u}){ct(hr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=b.useContext(yn);Hn(!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(Wn),{pathname:p}=yl(),x=Lg(),m=df(s,cf(f),p,u==="path"),g=JSON.stringify(m);return b.useEffect(()=>{x(JSON.parse(g),{replace:r,state:i,relative:u})},[x,g,u,r,i]),null}function Vn(s){ct(!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 h1({basename:s="/",children:r=null,location:i,navigationType:u="POP",navigator:d,static:f=!1,unstable_useTransitions:p}){ct(!hr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=s.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:x,navigator:d,static:f,unstable_useTransitions:p,future:{}}),[x,d,f,p]);typeof i=="string"&&(i=dr(i));let{pathname:g="/",search:y="",hash:v="",state:C=null,key:T="default"}=i,w=b.useMemo(()=>{let A=Ta(g,x);return A==null?null:{location:{pathname:A,search:y,hash:v,state:C,key:T},navigationType:u}},[x,g,y,v,C,T,u]);return Hn(w!=null,`<Router basename="${x}"> is not able to match the URL "${g}${y}${v}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:b.createElement(yn.Provider,{value:m},b.createElement(Si.Provider,{children:r,value:w}))}function m1({children:s,location:r}){return Pb(Zd(s),r)}function Zd(s,r=[]){let i=[];return b.Children.forEach(s,(u,d)=>{if(!b.isValidElement(u))return;let f=[...r,d];if(u.type===b.Fragment){i.push.apply(i,Zd(u.props.children,f));return}ct(u.type===Vn,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!u.props.index||!u.props.children,"An index route cannot have child routes.");let p={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(p.children=Zd(u.props.children,f)),i.push(p)}),i}var Fo="get",Wo="application/x-www-form-urlencoded";function ru(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function p1(s){return ru(s)&&s.tagName.toLowerCase()==="button"}function x1(s){return ru(s)&&s.tagName.toLowerCase()==="form"}function g1(s){return ru(s)&&s.tagName.toLowerCase()==="input"}function v1(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function y1(s,r){return s.button===0&&(!r||r==="_self")&&!v1(s)}var $o=null;function b1(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var j1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kd(s){return s!=null&&!j1.has(s)?(Hn(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wo}"`),null):s}function N1(s,r){let i,u,d,f,p;if(x1(s)){let x=s.getAttribute("action");u=x?Ta(x,r):null,i=s.getAttribute("method")||Fo,d=kd(s.getAttribute("enctype"))||Wo,f=new FormData(s)}else if(p1(s)||g1(s)&&(s.type==="submit"||s.type==="image")){let x=s.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=s.getAttribute("formaction")||x.getAttribute("action");if(u=m?Ta(m,r):null,i=s.getAttribute("formmethod")||x.getAttribute("method")||Fo,d=kd(s.getAttribute("formenctype"))||kd(x.getAttribute("enctype"))||Wo,f=new FormData(x,s),!b1()){let{name:g,type:y,value:v}=s;if(y==="image"){let C=g?`${g}.`:"";f.append(`${C}x`,"0"),f.append(`${C}y`,"0")}else g&&f.append(g,v)}}else{if(ru(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Fo,u=null,d=Wo,p=s}return f&&d==="text/plain"&&(p=f,f=void 0),{action:u,method:i.toLowerCase(),encType:d,formData:f,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function pf(s,r){if(s===!1||s===null||typeof s>"u")throw new Error(r)}function S1(s,r,i,u){let d=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return i?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:r&&Ta(d.pathname,r)==="/"?d.pathname=`${r.replace(/\/$/,"")}/_root.${u}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${u}`,d}async function w1(s,r){if(s.id in r)return r[s.id];try{let i=await import(s.module);return r[s.id]=i,i}catch(i){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function C1(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 E1(s,r,i){let u=await Promise.all(s.map(async d=>{let f=r.routes[d.route.id];if(f){let p=await w1(f,i);return p.links?p.links():[]}return[]}));return O1(u.flat(1).filter(C1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function qx(s,r,i,u,d,f){let p=(m,g)=>i[g]?m.route.id!==i[g].route.id:!0,x=(m,g)=>{var y;return i[g].pathname!==m.pathname||((y=i[g].route.path)==null?void 0:y.endsWith("*"))&&i[g].params["*"]!==m.params["*"]};return f==="assets"?r.filter((m,g)=>p(m,g)||x(m,g)):f==="data"?r.filter((m,g)=>{var v;let y=u.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(p(m,g)||x(m,g))return!0;if(m.route.shouldRevalidate){let C=m.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(s,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function T1(s,r,{includeHydrateFallback:i}={}){return k1(s.map(u=>{let d=r.routes[u.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),i&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function k1(s){return[...new Set(s)]}function M1(s){let r={},i=Object.keys(s).sort();for(let u of i)r[u]=s[u];return r}function O1(s,r){let i=new Set;return new Set(r),s.reduce((u,d)=>{let f=JSON.stringify(M1(d));return i.has(f)||(i.add(f),u.push({key:f,link:d})),u},[])}function Qg(){let s=b.useContext(fr);return pf(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function A1(){let s=b.useContext(su);return pf(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var xf=b.createContext(void 0);xf.displayName="FrameworkContext";function Gg(){let s=b.useContext(xf);return pf(s,"You must render this element inside a <HydratedRouter> element"),s}function R1(s,r){let i=b.useContext(xf),[u,d]=b.useState(!1),[f,p]=b.useState(!1),{onFocus:x,onBlur:m,onMouseEnter:g,onMouseLeave:y,onTouchStart:v}=r,C=b.useRef(null);b.useEffect(()=>{if(s==="render"&&p(!0),s==="viewport"){let A=z=>{z.forEach(K=>{p(K.isIntersecting)})},O=new IntersectionObserver(A,{threshold:.5});return C.current&&O.observe(C.current),()=>{O.disconnect()}}},[s]),b.useEffect(()=>{if(u){let A=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(A)}}},[u]);let T=()=>{d(!0)},w=()=>{d(!1),p(!1)};return i?s!=="intent"?[f,C,{}]:[f,C,{onFocus:ui(x,T),onBlur:ui(m,w),onMouseEnter:ui(g,T),onMouseLeave:ui(y,w),onTouchStart:ui(v,T)}]:[!1,C,{}]}function ui(s,r){return i=>{s&&s(i),i.defaultPrevented||r(i)}}function _1({page:s,...r}){let{router:i}=Qg(),u=b.useMemo(()=>Tg(i.routes,s,i.basename),[i.routes,s,i.basename]);return u?b.createElement(D1,{page:s,matches:u,...r}):null}function z1(s){let{manifest:r,routeModules:i}=Gg(),[u,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return E1(s,r,i).then(p=>{f||d(p)}),()=>{f=!0}},[s,r,i]),u}function D1({page:s,matches:r,...i}){let u=yl(),{future:d,manifest:f,routeModules:p}=Gg(),{basename:x}=Qg(),{loaderData:m,matches:g}=A1(),y=b.useMemo(()=>qx(s,r,g,f,u,"data"),[s,r,g,f,u]),v=b.useMemo(()=>qx(s,r,g,f,u,"assets"),[s,r,g,f,u]),C=b.useMemo(()=>{if(s===u.pathname+u.search+u.hash)return[];let A=new Set,O=!1;if(r.forEach(K=>{var S;let N=f.routes[K.route.id];!N||!N.hasLoader||(!y.some(D=>D.route.id===K.route.id)&&K.route.id in m&&((S=p[K.route.id])!=null&&S.shouldRevalidate)||N.hasClientLoader?O=!0:A.add(K.route.id))}),A.size===0)return[];let z=S1(s,x,d.unstable_trailingSlashAwareDataRequests,"data");return O&&A.size>0&&z.searchParams.set("_routes",r.filter(K=>A.has(K.route.id)).map(K=>K.route.id).join(",")),[z.pathname+z.search]},[x,d.unstable_trailingSlashAwareDataRequests,m,u,f,y,r,s,p]),T=b.useMemo(()=>T1(v,f),[v,f]),w=z1(v);return b.createElement(b.Fragment,null,C.map(A=>b.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...i})),T.map(A=>b.createElement("link",{key:A,rel:"modulepreload",href:A,...i})),w.map(({key:A,link:O})=>b.createElement("link",{key:A,nonce:i.nonce,...O,crossOrigin:O.crossOrigin??i.crossOrigin})))}function U1(...s){return r=>{s.forEach(i=>{typeof i=="function"?i(r):i!=null&&(i.current=r)})}}var L1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{L1&&(window.__reactRouterVersion="7.13.0")}catch{}function H1({basename:s,children:r,unstable_useTransitions:i,window:u}){let d=b.useRef();d.current==null&&(d.current=gb({window:u,v5Compat:!0}));let f=d.current,[p,x]=b.useState({action:f.action,location:f.location}),m=b.useCallback(g=>{i===!1?x(g):b.startTransition(()=>x(g))},[i]);return b.useLayoutEffect(()=>f.listen(m),[f,m]),b.createElement(h1,{basename:s,children:r,location:p.location,navigationType:p.action,navigator:f,unstable_useTransitions:i})}var Yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kg=b.forwardRef(function({onClick:r,discover:i="render",prefetch:u="none",relative:d,reloadDocument:f,replace:p,state:x,target:m,to:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:C,...T},w){let{basename:A,unstable_useTransitions:O}=b.useContext(yn),z=typeof g=="string"&&Yg.test(g),K=Ag(g,A);g=K.to;let N=Wb(g,{relative:d}),[S,D,U]=R1(u,T),B=Q1(g,{replace:p,state:x,target:m,preventScrollReset:y,relative:d,viewTransition:v,unstable_defaultShouldRevalidate:C,unstable_useTransitions:O});function q(J){r&&r(J),J.defaultPrevented||B(J)}let Z=b.createElement("a",{...T,...U,href:K.absoluteURL||N,onClick:K.isExternal||f?r:q,ref:U1(w,D),target:m,"data-discover":!z&&i==="render"?"true":void 0});return S&&!z?b.createElement(b.Fragment,null,Z,b.createElement(_1,{page:N})):Z});Kg.displayName="Link";var $g=b.forwardRef(function({"aria-current":r="page",caseSensitive:i=!1,className:u="",end:d=!1,style:f,to:p,viewTransition:x,children:m,...g},y){let v=wi(p,{relative:g.relative}),C=yl(),T=b.useContext(su),{navigator:w,basename:A}=b.useContext(yn),O=T!=null&&X1(v)&&x===!0,z=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,K=C.pathname,N=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;i||(K=K.toLowerCase(),N=N?N.toLowerCase():null,z=z.toLowerCase()),N&&A&&(N=Ta(N,A)||N);const S=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let D=K===z||!d&&K.startsWith(z)&&K.charAt(S)==="/",U=N!=null&&(N===z||!d&&N.startsWith(z)&&N.charAt(z.length)==="/"),B={isActive:D,isPending:U,isTransitioning:O},q=D?r:void 0,Z;typeof u=="function"?Z=u(B):Z=[u,D?"active":null,U?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let J=typeof f=="function"?f(B):f;return b.createElement(Kg,{...g,"aria-current":q,className:Z,ref:y,style:J,to:p,viewTransition:x},typeof m=="function"?m(B):m)});$g.displayName="NavLink";var q1=b.forwardRef(({discover:s="render",fetcherKey:r,navigate:i,reloadDocument:u,replace:d,state:f,method:p=Fo,action:x,onSubmit:m,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:C,...T},w)=>{let{unstable_useTransitions:A}=b.useContext(yn),O=K1(),z=$1(x,{relative:g}),K=p.toLowerCase()==="get"?"get":"post",N=typeof x=="string"&&Yg.test(x),S=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let U=D.nativeEvent.submitter,B=(U==null?void 0:U.getAttribute("formmethod"))||p,q=()=>O(U||D.currentTarget,{fetcherKey:r,method:B,navigate:i,replace:d,state:f,relative:g,preventScrollReset:y,viewTransition:v,unstable_defaultShouldRevalidate:C});A&&i!==!1?b.startTransition(()=>q()):q()};return b.createElement("form",{ref:w,method:K,action:z,onSubmit:u?m:S,...T,"data-discover":!N&&s==="render"?"true":void 0})});q1.displayName="Form";function B1(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xg(s){let r=b.useContext(fr);return ct(r,B1(s)),r}function Q1(s,{target:r,replace:i,state:u,preventScrollReset:d,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:x,unstable_useTransitions:m}={}){let g=Lg(),y=yl(),v=wi(s,{relative:f});return b.useCallback(C=>{if(y1(C,r)){C.preventDefault();let T=i!==void 0?i:mi(y)===mi(v),w=()=>g(s,{replace:T,state:u,preventScrollReset:d,relative:f,viewTransition:p,unstable_defaultShouldRevalidate:x});m?b.startTransition(()=>w()):w()}},[y,g,v,i,u,r,s,d,f,p,x,m])}var G1=0,Y1=()=>`__${String(++G1)}__`;function K1(){let{router:s}=Xg("useSubmit"),{basename:r}=b.useContext(yn),i=o1(),u=s.fetch,d=s.navigate;return b.useCallback(async(f,p={})=>{let{action:x,method:m,encType:g,formData:y,body:v}=N1(f,r);if(p.navigate===!1){let C=p.fetcherKey||Y1();await u(C,i,p.action||x,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:y,body:v,formMethod:p.method||m,formEncType:p.encType||g,flushSync:p.flushSync})}else await d(p.action||x,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:y,body:v,formMethod:p.method||m,formEncType:p.encType||g,replace:p.replace,state:p.state,fromRouteId:i,flushSync:p.flushSync,viewTransition:p.viewTransition})},[u,d,r,i])}function $1(s,{relative:r}={}){let{basename:i}=b.useContext(yn),u=b.useContext(Wn);ct(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),f={...wi(s||".",{relative:r})},p=yl();if(s==null){f.search=p.search;let x=new URLSearchParams(f.search),m=x.getAll("index");if(m.some(y=>y==="")){x.delete("index"),m.filter(v=>v).forEach(v=>x.append("index",v));let y=x.toString();f.search=y?`?${y}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Ca([i,f.pathname])),mi(f)}function X1(s,{relative:r}={}){let i=b.useContext(_g);ct(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Xg("useViewTransitionState"),d=wi(s,{relative:r});if(!i.isTransitioning)return!1;let f=Ta(i.currentLocation.pathname,u)||i.currentLocation.pathname,p=Ta(i.nextLocation.pathname,u)||i.nextLocation.pathname;return tu(d.pathname,p)!=null||tu(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 V1=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vg=(...s)=>s.filter((r,i,u)=>!!r&&r.trim()!==""&&u.indexOf(r)===i).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 Z1={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 J1=b.forwardRef(({color:s="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:p,...x},m)=>b.createElement("svg",{ref:m,...Z1,width:r,height:r,stroke:s,strokeWidth:u?Number(i)*24/Number(r):i,className:Vg("lucide",d),...x},[...p.map(([g,y])=>b.createElement(g,y)),...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 De=(s,r)=>{const i=b.forwardRef(({className:u,...d},f)=>b.createElement(J1,{ref:f,iconNode:r,className:Vg(`lucide-${V1(s)}`,u),...d}));return i.displayName=`${s}`,i};/**
|
|
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 F1=[["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"}]],gf=De("Activity",F1);/**
|
|
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 W1=[["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"}]],I1=De("ArrowLeftRight",W1);/**
|
|
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 P1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ej=De("ArrowLeft",P1);/**
|
|
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 tj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],pi=De("ArrowRight",tj);/**
|
|
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 nj=[["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"}]],Zg=De("Brain",nj);/**
|
|
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 aj=[["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"}]],lj=De("ChartColumn",aj);/**
|
|
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 sj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jg=De("Check",sj);/**
|
|
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 rj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xl=De("ChevronDown",rj);/**
|
|
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 ij=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oj=De("ChevronLeft",ij);/**
|
|
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 uj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qn=De("ChevronRight",uj);/**
|
|
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 cj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],dj=De("ChevronUp",cj);/**
|
|
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 fj=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],Fg=De("ChevronsDownUp",fj);/**
|
|
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 hj=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Wg=De("ChevronsUpDown",hj);/**
|
|
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 mj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Bx=De("Clock",mj);/**
|
|
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 pj=[["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"}]],xj=De("Copy",pj);/**
|
|
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 gj=[["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"}]],Ig=De("DollarSign",gj);/**
|
|
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 vj=[["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"}]],yj=De("Download",vj);/**
|
|
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 bj=[["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"}]],ir=De("FlaskConical",bj);/**
|
|
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 jj=[["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"}]],vf=De("Layers",jj);/**
|
|
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 Nj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Sj=De("LoaderCircle",Nj);/**
|
|
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 wj=[["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"}]],Cj=De("MessageSquarePlus",wj);/**
|
|
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 Ej=[["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"}]],Pg=De("MessageSquare",Ej);/**
|
|
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 Tj=[["path",{d:"M5 12h14",key:"1ays0h"}]],kj=De("Minus",Tj);/**
|
|
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 Mj=[["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"}]],Oj=De("Pencil",Mj);/**
|
|
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 Aj=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],yf=De("Play",Aj);/**
|
|
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 Rj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],e0=De("Plus",Rj);/**
|
|
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 _j=[["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"}]],zj=De("RefreshCw",_j);/**
|
|
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 Dj=[["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"}]],Uj=De("RotateCw",Dj);/**
|
|
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 Lj=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jd=De("Search",Lj);/**
|
|
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 Hj=[["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"}]],qj=De("Send",Hj);/**
|
|
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 Bj=[["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"}]],Qj=De("ShieldCheck",Bj);/**
|
|
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 Gj=[["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"}]],bf=De("Trash2",Gj);/**
|
|
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 Yj=[["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"}]],Kj=De("TrendingUp",Yj);/**
|
|
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 $j=[["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"}]],Xj=De("Upload",$j);/**
|
|
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 Vj=[["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"}]],t0=De("Users",Vj);/**
|
|
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 Zj=[["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"}]],n0=De("Wrench",Zj);/**
|
|
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 Jj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fj=De("X",Jj);function W(...s){return s.filter(Boolean).join(" ")}function lt(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[i,u]=s.toExponential(2).split("e");return`$${i}e${parseInt(u,10)}`}return r<.01?`$${s.toFixed(6)}`:`$${s.toFixed(2)}`}function ot(s){return s<1e3?`${Math.round(s)}ms`:s<6e4?`${(s/1e3).toFixed(1)}s`:`${(s/6e4).toFixed(1)}m`}function On(s){return s.toLocaleString()}function or(s,r=80){const i=u=>u.length<=r?u:u.slice(0,r-3)+"…";if(typeof s=="string")return i(s);if(typeof s=="object"&&s!==null&&!Array.isArray(s)){const u=s;for(const d of["question","prompt","text","input","query","message","content","name","title"])if(typeof u[d]=="string"&&u[d].length>0)return i(u[d]);for(const d of Object.values(u))if(typeof d=="string"&&d.length>0)return i(d)}return i(JSON.stringify(s))}function Wj(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-gray-500"}}const Ij=[{to:"/playground",label:"Playground",icon:Pg},{to:"/workflows",label:"Workflows",icon:yf},{to:"/traces",label:"Traces",icon:gf},{to:"/costs",label:"Costs",icon:Ig},{to:"/memory",label:"Memory",icon:Zg},{to:"/sessions",label:"Sessions",icon:t0},{to:"/tools",label:"Tools",icon:n0},{to:"/evals",label:"Evals",icon:ir}];function Pj(){return a.jsxs("aside",{className:"w-56 border-r border-[hsl(var(--border))] bg-[hsl(var(--card))] flex flex-col h-screen",children:[a.jsx("div",{className:"p-4 border-b border-[hsl(var(--border))]",children:a.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:"Axl Studio"})}),a.jsx("nav",{className:"flex-1 p-2 space-y-0.5",children:Ij.map(({to:s,label:r,icon:i})=>a.jsxs($g,{to:s,className:({isActive:u})=>W("flex items-center gap-2.5 px-3 py-2 rounded-md text-sm transition-colors",u?"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:[a.jsx(i,{size:16}),r]},s))}),a.jsx("div",{className:"p-4 border-t border-[hsl(var(--border))] text-xs text-[hsl(var(--muted-foreground))]",children:"@axlsdk/studio"})]})}function iu({title:s,description:r,actions:i,className:u}){return a.jsxs("header",{className:W("shrink-0 flex items-center justify-between gap-6 px-6 py-4 min-h-[68px]","border-b border-[hsl(var(--border))]",u),children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("h2",{className:"text-xl font-semibold leading-tight",children:s}),a.jsx("div",{className:"mt-1 text-xs text-[hsl(var(--muted-foreground))] truncate",children:r??" "})]}),i&&a.jsx("div",{className:"flex items-center gap-2 shrink-0",children:i})]})}function ur({title:s,description:r,actions:i,children:u}){return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(iu,{title:s,description:r,actions:i}),a.jsx("main",{className:"flex-1 overflow-auto p-6",children:u})]})}function Ft({title:s,description:r,icon:i}){return a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[i&&a.jsx("div",{className:"mb-3 text-[hsl(var(--muted-foreground))]",children:i}),a.jsx("h3",{className:"text-sm font-medium text-[hsl(var(--foreground))]",children:s}),r&&a.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))] mt-1 max-w-sm",children:r})]})}function eN({text:s,className:r}){return a.jsxs("div",{className:`whitespace-pre-wrap ${r??""}`,children:[s,a.jsx("span",{className:"animate-pulse",children:"|"})]})}function a0(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 tN(s,r){if(r==="array"){const i=s;return i.length===0?"[]":`[${i.length}]`}if(r==="object"){const i=Object.keys(s);return i.length===0?"{}":i.length<=4?`{ ${i.join(", ")} }`:`{ ${i.slice(0,3).join(", ")}, …${i.length-3} more }`}return""}function nN(s,r){return r==="array"?s.map((i,u)=>[u,i]):r==="object"?Object.entries(s):[]}const xn={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))]"},ci="w-3.5 shrink-0 flex items-center justify-center pt-0.5",l0="inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer";function aN({text:s}){const[r,i]=b.useState(!1),u=b.useRef(void 0);b.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const d=b.useCallback(f=>{f.stopPropagation(),navigator.clipboard.writeText(s),i(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>i(!1),2e3)},[s]);return a.jsxs("button",{onClick:d,className:l0,children:[r?a.jsx(Jg,{size:10,className:"text-emerald-500"}):a.jsx(xj,{size:10}),r?"Copied":"Copy"]})}function lN({value:s,type:r}){if(r==="null")return a.jsx("span",{className:xn.null,children:"null"});if(r==="boolean")return a.jsx("span",{className:xn.boolean,children:String(s)});if(r==="number")return a.jsx("span",{className:xn.number,children:String(s)});if(r==="string"){const i=s;return i.includes(`
|
|
266
|
+
`)&&i.length>80?a.jsxs("span",{className:xn.string,children:['"',i,'"']}):a.jsxs("span",{className:xn.string,children:['"',i,'"']})}return null}const Xo=100,sN=b.memo(function s({value:r,label:i,depth:u,expandDepth:d,isLast:f}){const p=a0(r),x=p==="object"||p==="array",[m,g]=b.useState(u<d),[y,v]=b.useState(!1),C=f?"":",",T=i!=null?typeof i=="number"?a.jsxs("span",{className:xn.punct,children:[i,": "]}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:xn.key,children:['"',i,'"']}),a.jsx("span",{className:xn.punct,children:": "})]}):null;if(!x)return a.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded",children:[a.jsx("span",{className:ci}),a.jsxs("span",{children:[T,a.jsx(lN,{value:r,type:p}),a.jsx("span",{className:xn.punct,children:C})]})]});const w=nN(r,p),A=p==="array"?"[":"{",O=p==="array"?"]":"}";return w.length===0?a.jsxs("div",{className:"flex items-start leading-relaxed",children:[a.jsx("span",{className:ci}),a.jsxs("span",{children:[T,a.jsxs("span",{className:xn.punct,children:[A,O,C]})]})]}):a.jsxs("div",{children:[a.jsxs("div",{className:W("flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",m&&"hidden"),onClick:()=>g(!0),children:[a.jsx("span",{className:ci,children:a.jsx(qn,{size:10,className:"text-[hsl(var(--muted-foreground))]"})}),a.jsxs("span",{children:[T,a.jsxs("span",{className:xn.punct,children:[tN(r,p),C]})]})]}),a.jsxs("div",{className:W(!m&&"hidden"),children:[a.jsxs("div",{className:"flex items-start leading-relaxed hover:bg-[hsl(var(--accent))]/40 rounded cursor-pointer",onClick:()=>g(!1),children:[a.jsx("span",{className:ci,children:a.jsx(qn,{size:10,className:"text-[hsl(var(--muted-foreground))] rotate-90 transition-transform"})}),a.jsxs("span",{children:[T,a.jsx("span",{className:xn.punct,children:A})]})]}),a.jsxs("div",{className:"pl-5 border-l border-[hsl(var(--border))]/40 ml-1.5",children:[(y?w:w.slice(0,Xo)).map(([z,K],N,S)=>a.jsx(s,{value:K,label:z,depth:u+1,expandDepth:d,isLast:!y&&w.length>Xo?!1:N===S.length-1},typeof z=="number"?z:String(z))),!y&&w.length>Xo&&a.jsxs("button",{onClick:z=>{z.stopPropagation(),v(!0)},className:"text-[10px] text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] py-1 transition-colors",children:["Show all ",w.length," items (",w.length-Xo," more)"]})]}),a.jsxs("div",{className:"flex items-start leading-relaxed",children:[a.jsx("span",{className:ci}),a.jsxs("span",{className:xn.punct,children:[O,C]})]})]})]})});function qt({data:s,defaultExpandDepth:r,maxHeight:i,className:u,collapsed:d}){const f=r??(d?0:2),p=i??"24rem",x=JSON.stringify(s,null,2),[m,g]=b.useState(0),[y,v]=b.useState(f),C=y===1/0,T=b.useCallback(()=>{v(O=>O===1/0?0:1/0),g(O=>O+1)},[]),w=a0(s),A=w==="object"||w==="array";return a.jsxs("div",{className:W("relative group/json",u),children:[a.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-1 opacity-0 group-hover/json:opacity-100 transition-opacity z-10",children:[A&&a.jsxs("button",{onClick:O=>{O.stopPropagation(),T()},className:l0,children:[C?a.jsx(Fg,{size:10}):a.jsx(Wg,{size:10}),C?"Collapse":"Expand"]}),a.jsx(aN,{text:x})]}),a.jsx("div",{className:"text-xs font-mono overflow-auto rounded-lg bg-[hsl(var(--secondary))] p-3",style:{maxHeight:p},children:a.jsx(sN,{value:s,depth:0,expandDepth:y,isLast:!0},m)})]})}function xi({items:s,value:r,onSelect:i,getKey:u,getLabel:d,getDescription:f,searchMatch:p,placeholder:x="Select…",searchPlaceholder:m="Search…",emptyLabel:g="No results",shortcut:y=!1,variant:v="picker",triggerClassName:C,popoverWidth:T,ariaLabel:w}){const A=T??(v==="filter"?260:440),[O,z]=b.useState(!1),[K,N]=b.useState(""),[S,D]=b.useState(0),U=b.useRef(!1),B=b.useRef(null),q=b.useRef(null),Z=b.useRef(null),J=b.useRef(null),[ne,Q]=b.useState(!1),$=b.useId(),re=`cmdpicker-pop-${$}`,le=H=>`cmdpicker-opt-${$}-${H}`,_=b.useMemo(()=>{const H=K.trim().toLowerCase();return H?p?s.filter(I=>p(I,H)):s.filter(I=>d(I).toLowerCase().includes(H)):s},[s,K,p,d]),F=b.useMemo(()=>{if(!r)return null;const H=s.find(I=>u(I)===r);return H?d(H):null},[s,r,u]);b.useEffect(()=>{if(U.current){D(I=>Math.max(0,Math.min(I,_.length-1)));return}const H=_.findIndex(I=>u(I)===r);D(H>=0?H:0)},[_,r,u]),b.useEffect(()=>{var oe;if(!O){N(""),U.current=!1;return}const H=425,I=(oe=J.current)==null?void 0:oe.getBoundingClientRect();if(I){const de=window.innerHeight-I.bottom,ye=I.top;Q(de<H&&ye>de)}requestAnimationFrame(()=>{var de;return(de=Z.current)==null?void 0:de.focus()})},[O]),b.useEffect(()=>{if(!O)return;const H=I=>{var de,ye;const oe=I.target;(de=B.current)!=null&&de.contains(oe)||(ye=q.current)!=null&&ye.contains(oe)||z(!1)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[O]),b.useEffect(()=>{if(!y)return;const H=I=>{var oe;if((I.metaKey||I.ctrlKey)&&I.key==="k"){const de=I.target,ye=!!(de&&((oe=q.current)!=null&&oe.contains(de)));if(((de==null?void 0:de.tagName)==="INPUT"||(de==null?void 0:de.tagName)==="TEXTAREA"||(de==null?void 0:de.isContentEditable)===!0)&&!ye)return;I.preventDefault(),z(we=>!we)}};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[y]);const ie=b.useCallback(H=>{i(H),z(!1),requestAnimationFrame(()=>{var I;return(I=J.current)==null?void 0:I.focus()})},[i]),he=b.useCallback(H=>{var I;if(H.key==="ArrowDown")H.preventDefault(),U.current=!0,D(oe=>Math.min(oe+1,Math.max(0,_.length-1)));else if(H.key==="ArrowUp")H.preventDefault(),U.current=!0,D(oe=>Math.max(oe-1,0));else if(H.key==="Enter"){H.preventDefault();const oe=_[S];oe&&ie(u(oe))}else H.key==="Escape"?(H.preventDefault(),z(!1),(I=J.current)==null||I.focus()):H.key==="Tab"&&z(!1)},[_,S,ie,u]),pe=F??x,E=v==="filter";return a.jsxs("div",{ref:B,className:"relative inline-flex",children:[a.jsxs("button",{ref:J,type:"button",onClick:()=>z(H=>!H),"aria-haspopup":"listbox","aria-expanded":O,"aria-controls":O?re:void 0,"aria-label":w??(F?`Selected: ${F}`:x),className:W("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))]",E?"px-3 py-1.5 text-xs":"pl-4 pr-3 py-2 min-w-[240px] max-w-[320px]",C),children:[!E&&a.jsx(Jd,{size:13,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),a.jsx("span",{className:W("flex-1 text-left truncate",E?"":"font-medium",!F&&"text-[hsl(var(--muted-foreground))] font-normal"),children:pe}),E?a.jsx(xl,{size:12,className:"text-[hsl(var(--muted-foreground))] shrink-0 opacity-70"}):y?a.jsxs("kbd",{className:W("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:[a.jsx("span",{className:"text-xs leading-none",children:"⌘"}),"K"]}):null]}),O&&a.jsxs("div",{ref:q,id:re,role:"listbox","aria-label":w??x,"aria-activedescendant":_[S]?le(S):void 0,style:{width:A},className:W("absolute right-0 z-50",ne?"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:[a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 border-b border-[hsl(var(--border))]",children:[a.jsx(Jd,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0"}),a.jsx("input",{ref:Z,type:"text",value:K,onChange:H=>{N(H.target.value),U.current=!1},onKeyDown:he,placeholder:m,"aria-label":m,className:W("flex-1 bg-transparent text-sm focus:outline-none","placeholder:text-[hsl(var(--muted-foreground))]")}),a.jsx("kbd",{className:W("text-[10px] font-mono px-1.5 py-0.5 rounded","border border-[hsl(var(--border))]","text-[hsl(var(--muted-foreground))]"),children:"ESC"})]}),a.jsx("div",{className:"max-h-[340px] overflow-y-auto py-1.5",children:_.length===0?a.jsx("div",{className:"px-4 py-8 text-center text-xs text-[hsl(var(--muted-foreground))]",children:K?`No results for "${K}"`:g}):_.map((H,I)=>{const oe=u(H),de=d(H),ye=f==null?void 0:f(H),ce=I===S,we=oe===r;return a.jsxs("button",{id:le(I),type:"button",role:"option","aria-selected":ce,onClick:()=>ie(oe),onMouseEnter:()=>{U.current=!0,D(I)},className:W("w-full flex items-center gap-3 px-4 py-2.5 text-left cursor-pointer","transition-colors",ce&&"bg-[hsl(var(--muted))]"),children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium truncate",children:de||x}),ye&&a.jsx("div",{className:"text-[10px] uppercase tracking-[0.08em] text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:ye})]}),we&&a.jsx(Jg,{size:14,className:"text-[hsl(var(--muted-foreground))] shrink-0","aria-label":"Currently selected"})]},oe||`__empty__${I}`)})}),a.jsxs("div",{className:W("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:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"font-mono opacity-70",children:"↑↓"})," navigate"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("kbd",{className:"font-mono opacity-70",children:"↵"})," select"]})]}),a.jsxs("span",{className:"tabular-nums",children:[_.length," of ",s.length]})]})]})]})}const rN=(window.__AXL_STUDIO_BASE__??"")+"/api";async function Fe(s,r){const i=await fetch(`${rN}${s}`,{headers:{"Content-Type":"application/json",...r==null?void 0:r.headers},...r});if(i.status===413)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(!(i.headers.get("content-type")??"").includes("application/json")){const p=(await i.text().catch(()=>"")).slice(0,200).trim();throw new Error(`Server returned HTTP ${i.status} with non-JSON response`+(p?`: ${p}`:""))}let d;try{d=await i.json()}catch(f){throw new Error(`Failed to parse server response as JSON (HTTP ${i.status}): ${f instanceof Error?f.message:String(f)}`)}if(!d.ok)throw new Error(d.error.message);return d.data}const iN=()=>Fe("/health"),oN=()=>Fe("/workflows"),uN=s=>Fe(`/workflows/${encodeURIComponent(s)}`),cN=(s,r,i=!1)=>Fe(`/workflows/${encodeURIComponent(s)}/execute`,{method:"POST",body:JSON.stringify({input:r,stream:i})}),dN=()=>Fe("/executions"),fN=()=>Fe("/sessions"),hN=s=>Fe(`/sessions/${encodeURIComponent(s)}`),mN=s=>Fe(`/sessions/${encodeURIComponent(s)}`,{method:"DELETE"}),pN=()=>Fe("/agents"),xN=()=>Fe("/tools"),gN=s=>Fe(`/tools/${encodeURIComponent(s)}`),vN=(s,r)=>Fe(`/tools/${encodeURIComponent(s)}/test`,{method:"POST",body:JSON.stringify({input:r})}),yN=s=>Fe(`/memory/${encodeURIComponent(s)}`),bN=(s,r,i)=>Fe(`/memory/${encodeURIComponent(s)}/${encodeURIComponent(r)}`,{method:"PUT",body:JSON.stringify({value:i})}),jN=(s,r)=>Fe(`/memory/${encodeURIComponent(s)}/${encodeURIComponent(r)}`,{method:"DELETE"}),NN=(s,r,i)=>Fe("/memory/search",{method:"POST",body:JSON.stringify({query:s,scope:r,limit:i})}),SN=(s="7d")=>Fe(`/costs?window=${s}`),wN=(s="7d")=>Fe(`/eval-trends?window=${s}`),CN=(s="7d")=>Fe(`/workflow-stats?window=${s}`),EN=(s="7d")=>Fe(`/trace-stats?window=${s}`),TN=()=>Fe("/evals"),kN=()=>Fe("/evals/history"),MN=(s,r)=>Fe(`/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})}),s0=s=>Fe(`/evals/runs/${encodeURIComponent(s)}/cancel`,{method:"POST"}),ON=(s,r)=>Fe(`/evals/${encodeURIComponent(s)}/rescore`,{method:"POST",body:JSON.stringify({resultId:r})}),AN=(s,r,i)=>Fe("/evals/compare",{method:"POST",body:JSON.stringify({baselineId:s,candidateId:r,options:i})}),RN=(s,r)=>Fe("/evals/import",{method:"POST",body:JSON.stringify({result:s,eval:r})}),_N=s=>Fe(`/evals/history/${encodeURIComponent(s)}`,{method:"DELETE"}),zN=(s,r,i)=>Fe("/playground/chat",{method:"POST",body:JSON.stringify({message:s,sessionId:r,agent:i})});class DN{constructor(){ri(this,"ws",null);ri(this,"listeners",new Map);ri(this,"reconnectTimer",null);ri(this,"url");const r=window.location.protocol==="https:"?"wss:":"ws:",i=window.__AXL_STUDIO_BASE__??"";this.url=`${r}//${window.location.host}${i}/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 i of this.listeners.keys())this.send({type:"subscribe",channel:i})},this.ws.onmessage=i=>{try{const u=JSON.parse(i.data);if(u.type==="event"&&u.channel){const d=this.listeners.get(u.channel);if(d)for(const p of d)p(u.data);const f=u.channel.indexOf(":");if(f>0){const p=u.channel.substring(0,f)+":*",x=this.listeners.get(p);if(x)for(const m of x)m(u.data)}}}catch{}},this.ws.onclose=()=>{this.scheduleReconnect()},this.ws.onerror=()=>{var i;(i=this.ws)==null||i.close()})}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},2e3))}send(r){var i;((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}subscribe(r,i){let u=this.listeners.get(r);return u||(u=new Set,this.listeners.set(r,u),this.send({type:"subscribe",channel:r})),u.add(i),this.connect(),()=>{u.delete(i),u.size===0&&(this.listeners.delete(r),this.send({type:"unsubscribe",channel:r}))}}disconnect(){var r;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(r=this.ws)==null||r.close(),this.ws=null}}const r0=new DN;function jf(s,r){const i=b.useRef(r);i.current=r,b.useEffect(()=>{if(s)return r0.subscribe(s,u=>i.current(u))},[s])}const Qx={tokens:"",events:[],done:!1,error:null,result:null};function i0(s){const[r,i]=b.useState(Qx),u=b.useRef(null);b.useEffect(()=>{if(s===u.current)return;const f=u.current;u.current=s,s!==null?i(Qx):f!==null&&i(p=>({...p,done:!1,result:null,error:null}))},[s]);const d=b.useCallback(f=>{const p=f;i(x=>{switch(p.type){case"token":return{...x,tokens:x.tokens+p.data,events:[...x.events,p]};case"done":return{...x,done:!0,result:p.data,events:[...x.events,p]};case"error":return{...x,done:!0,error:p.message,events:[...x.events,p]};default:return{...x,events:[...x.events,p]}}})},[]);return jf(s?`execution:${s}`:null,d),r}function UN(){const[s,r]=b.useState([]),[i,u]=b.useState(""),[d,f]=b.useState(null),[p,x]=b.useState(null),[m,g]=b.useState(""),[y,v]=b.useState(!1),[C,T]=b.useState(0),[w,A]=b.useState({input:0,output:0}),O=b.useRef(null),z=b.useRef(0),{data:K=[]}=gn({queryKey:["agents"],queryFn:pN}),N=i0(p);b.useEffect(()=>{N.tokens&&y&&r(q=>{const Z=q[q.length-1];return(Z==null?void 0:Z.role)==="assistant"?[...q.slice(0,-1),{...Z,content:N.tokens}]:[...q,{role:"assistant",content:N.tokens}]}),N.done&&(v(!1),x(null),N.error&&r(q=>{const Z=q[q.length-1];return(Z==null?void 0:Z.role)==="assistant"&&!Z.content?[...q.slice(0,-1),{role:"assistant",content:`Error: ${N.error}`}]:[...q,{role:"assistant",content:`Error: ${N.error}`}]}))},[N.tokens,N.done,N.error,y]),b.useEffect(()=>{const q=[],Z=[],J=[];for(const ne of N.events){if(ne.type==="tool_call"&&q.push({name:ne.name,args:ne.args,callId:ne.callId}),ne.type==="tool_result"){const Q=ne.callId?q.find($=>$.callId===ne.callId):q.find($=>$.name===ne.name&&!$.result);Q&&(Q.result=ne.result)}ne.type==="handoff"&&Z.push({source:ne.source,target:ne.target,mode:ne.mode??"oneway"}),ne.type==="tool_approval"&&J.push({tool:ne.name,approved:ne.approved})}(q.length>0||Z.length>0||J.length>0)&&r(ne=>{const Q=ne[ne.length-1];return(Q==null?void 0:Q.role)==="assistant"?[...ne.slice(0,-1),{...Q,toolCalls:q.length>0?q:Q.toolCalls,handoffs:Z.length>0?Z:Q.handoffs,approvals:J.length>0?J:Q.approvals}]:ne})},[N.events]),b.useEffect(()=>{const q=N.events.slice(z.current);if(q.length===0)return;z.current=N.events.length;let Z=0,J=0,ne=0;for(const Q of q)Q.type==="agent_end"&&Q.cost&&(Z+=Q.cost),Q.type==="step"&&Q.data.tokens&&(J+=Q.data.tokens.input??0,ne+=Q.data.tokens.output??0);Z>0&&T(Q=>Q+Z),(J>0||ne>0)&&A(Q=>({input:Q.input+J,output:Q.output+ne}))},[N.events]),b.useEffect(()=>{var q;(q=O.current)==null||q.scrollIntoView({behavior:"smooth"})},[s]);const S=b.useCallback(async()=>{if(!i.trim()||y)return;const q=i.trim();u(""),r(Z=>[...Z,{role:"user",content:q}]),v(!0);try{const Z=await zN(q,d??void 0,m||void 0);f(Z.sessionId),x(Z.executionId)}catch(Z){v(!1),r(J=>[...J,{role:"assistant",content:`Error: ${Z instanceof Error?Z.message:String(Z)}`}])}},[i,y,d,m]),D=q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),S())},U=C>0||w.input>0,B=s.length;return a.jsx(ur,{title:"Agent Playground",description:B>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[B," message",B!==1?"s":""]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{className:"font-mono",children:["session ",d.slice(0,8)]})]})]}):K.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[K.length," registered agent",K.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"pick one or use the default"})]}):"Interactive chat with registered agents",actions:a.jsxs(a.Fragment,{children:[U&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[C>0&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:lt(C)}),w.input>0&&a.jsxs("span",{className:"px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]",children:[On(w.input+w.output)," tok"]})]}),a.jsxs("div",{className:W("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:[a.jsx(xi,{items:K,value:m,onSelect:g,getKey:q=>q.name,getLabel:q=>q.name,getDescription:q=>a.jsxs(a.Fragment,{children:[a.jsx("span",{children:q.model}),q.tools.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[q.tools.length," tool",q.tools.length!==1?"s":""]})]}),q.handoffs.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[q.handoffs.length," handoff",q.handoffs.length!==1?"s":""]})]})]}),searchMatch:(q,Z)=>q.name.toLowerCase().includes(Z)||q.model.toLowerCase().includes(Z)||q.tools.some(J=>J.toLowerCase().includes(Z)),placeholder:"Default agent",searchPlaceholder:"Search agents…",emptyLabel:"No agents registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an agent"}),a.jsxs("button",{onClick:()=>{r([]),f(null),x(null),T(0),A({input:0,output:0})},className:W("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:[a.jsx(Cj,{size:12}),"New chat"]})]})]}),children:a.jsxs("div",{className:"flex flex-col h-full max-w-3xl mx-auto",children:[a.jsxs("div",{className:"flex-1 overflow-auto space-y-4 pb-4",children:[s.length===0&&a.jsx(Ft,{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((q,Z)=>a.jsx("div",{className:`flex ${q.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-xl px-4 py-2.5 text-sm ${q.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]":"bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))]"}`,children:[q.role==="assistant"&&y&&Z===s.length-1?a.jsx(eN,{text:q.content}):a.jsx("div",{className:"whitespace-pre-wrap",children:q.content}),q.handoffs&&q.handoffs.length>0&&a.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:q.handoffs.map((J,ne)=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx(pi,{size:12,className:"text-amber-500"}),a.jsx("span",{className:"font-medium",children:J.source}),a.jsx(pi,{size:10}),a.jsx("span",{className:"font-medium",children:J.target}),a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",J.mode,")"]})]},ne))}),q.approvals&&q.approvals.length>0&&a.jsx("div",{className:"mt-2 space-y-1 border-t border-[hsl(var(--border))] pt-2",children:q.approvals.map((J,ne)=>a.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[a.jsx(Qj,{size:12,className:J.approved?"text-green-500":"text-red-500"}),a.jsxs("span",{children:["Tool ",a.jsx("span",{className:"font-mono",children:J.tool}),":"," ",J.approved?"approved":"denied"]})]},ne))}),q.toolCalls&&q.toolCalls.length>0&&a.jsx("div",{className:"mt-2 space-y-2 border-t border-[hsl(var(--border))] pt-2",children:q.toolCalls.map((J,ne)=>a.jsxs("div",{className:"text-xs",children:[a.jsxs("div",{className:"font-medium mb-1",children:["Tool: ",J.name]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Input:"}),a.jsx(qt,{data:J.args,collapsed:!0}),J.result!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-[hsl(var(--muted-foreground))]",children:"Output:"}),a.jsx(qt,{data:J.result,collapsed:!0})]})]})]},ne))})]})},Z)),a.jsx("div",{ref:O})]}),a.jsx("div",{className:"border-t border-[hsl(var(--border))] pt-4",children:a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx("textarea",{value:i,onChange:q=>u(q.target.value),onKeyDown:D,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))]"}),a.jsx("button",{onClick:S,disabled:!i.trim()||y,className:"p-2.5 rounded-xl bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] hover:opacity-90 disabled:opacity-50 transition-opacity",children:a.jsx(qj,{size:16})})]})})]})})}function o0({value:s,onChange:r,placeholder:i,className:u}){const[d,f]=b.useState(!1),[p,x]=b.useState(null),m=b.useRef(null),g=b.useCallback(v=>{const C=v.target.value;r(C);try{C.trim()&&JSON.parse(C),x(null)}catch(T){x(T instanceof Error?T.message:"Invalid JSON")}},[r]);b.useEffect(()=>{var v;d&&((v=m.current)==null||v.focus())},[d]);let y=null;try{y=s.trim()?JSON.parse(s):{}}catch{}return y===null||d?a.jsxs("div",{className:u,children:[a.jsx("textarea",{ref:m,value:s,onChange:g,onBlur:()=>{p||f(!1)},placeholder:i??"{}",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}),p&&a.jsx("p",{className:"text-xs text-red-500 mt-1",children:p})]}):a.jsx("div",{className:u,children:a.jsxs("div",{children:[a.jsx(qt,{data:y,maxHeight:"12rem"}),a.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:[a.jsx(Oj,{size:10}),"Edit"]})]})})}function u0({schema:s,onSubmit:r,submitLabel:i="Submit",className:u}){const[d,f]=b.useState({}),p=s.properties??{},x=new Set(s.required??[]),m=b.useCallback(g=>{g.preventDefault();const y={};for(const[v,C]of Object.entries(p)){const T=d[v]??"";if(!(!T&&!x.has(v)))if(C.type==="number")y[v]=Number(T);else if(C.type==="boolean")y[v]=T==="true";else if(C.type==="object"||C.type==="array")try{y[v]=JSON.parse(T)}catch{y[v]=T}else y[v]=T}r(y)},[d,p,x,r]);return a.jsxs("form",{onSubmit:m,className:`space-y-3 ${u??""}`,children:[Object.entries(p).map(([g,y])=>a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs font-medium text-[hsl(var(--foreground))] mb-1",children:[g,x.has(g)&&a.jsx("span",{className:"text-red-500 ml-0.5",children:"*"}),y.description&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal ml-1",children:["- ",y.description]})]}),y.enum?a.jsxs("select",{value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Select..."}),y.enum.map(v=>a.jsx("option",{value:v,children:v},v))]}):y.type==="boolean"?a.jsxs("select",{value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Select..."}),a.jsx("option",{value:"true",children:"true"}),a.jsx("option",{value:"false",children:"false"})]}):a.jsx("input",{type:y.type==="number"?"number":"text",value:d[g]??"",onChange:v=>f({...d,[g]:v.target.value}),placeholder:y.type??"string",className:"w-full px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]},g)),a.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:i})]})}function c0({status:s,className:r}){return a.jsxs("span",{className:W("inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium",Wj(s),s==="running"&&"animate-pulse",r),children:[a.jsx("span",{className:W("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 Ke({label:s,value:r,subtitle:i,subtitleColor:u,accent:d,tint:f,badge:p}){return a.jsxs("div",{className:W("px-4 py-3.5 rounded-xl",f||"bg-[hsl(var(--card))] border border-[hsl(var(--border))]"),children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:s}),p?a.jsx("div",{className:"mt-1",children:p}):a.jsx("p",{className:W("text-2xl font-semibold mt-1 font-mono tracking-tight",d),children:r}),i&&a.jsx("p",{className:W("text-xs mt-0.5",u??"text-[hsl(var(--muted-foreground))]"),children:i})]})}function ba({cost:s,className:r}){return a.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${r??""}`,children:lt(s)})}function LN({ms:s,className:r}){return a.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${r??""}`,children:ot(s)})}const HN={agent_call:"bg-blue-500",tool_call:"bg-purple-500",tool_approval:"bg-purple-300",tool_denied:"bg-red-400",workflow_start:"bg-green-500",workflow_end:"bg-green-400",handoff:"bg-amber-500",delegate:"bg-amber-400",await_human:"bg-red-500",vote_start:"bg-cyan-500",spawn:"bg-indigo-500",guardrail:"bg-rose-400",schema_check:"bg-teal-500",validate:"bg-teal-400",verify:"bg-teal-300",log:"bg-slate-400"};function qN(s){const r=s.type;if(r==="tool_denied")return!0;if(r==="guardrail"||r==="schema_check"||r==="validate"){const i=s.data;return(i==null?void 0:i.valid)===!1||(i==null?void 0:i.blocked)===!0}if(r==="verify"){const i=s.data;return(i==null?void 0:i.passed)===!1}if(r==="tool_approval"){const i=s.data;return(i==null?void 0:i.approved)===!1}if(r==="workflow_end"){const i=s.data;return(i==null?void 0:i.status)==="failed"||(i==null?void 0:i.aborted)===!0}if(r==="log"){const i=s.data;return(i==null?void 0:i.error)!==void 0&&(i==null?void 0:i.error)!==null}return!1}function BN(s){return HN[s]??"bg-slate-500"}function Gx(s){return qN(s)?"bg-red-500":BN(s.type)}function QN(s){const r=s.type,i=s.parentToolCallId?2:0;return r==="workflow_start"||r==="workflow_end"?0+i:r==="agent_call"||r==="spawn"||r==="vote_start"||r==="delegate"?1+i:r==="tool_call"||r==="tool_approval"||r==="tool_denied"||r==="handoff"||r==="guardrail"||r==="schema_check"||r==="validate"||r==="verify"?2+i:1+i}function Nf(s){return s.type!=="agent_call"||!s.data?null:s.data}function d0(s){return s.type!=="guardrail"&&s.type!=="schema_check"&&s.type!=="validate"?null:s.data??null}function GN(s){const r=Nf(s);return!!(r!=null&&r.retryReason)}const Sf=b.createContext({level:0,version:0});function f0(s){const{level:r,version:i}=b.useContext(Sf),u=r===1;return a.jsx(qt,{...s,defaultExpandDepth:u?1/0:s.defaultExpandDepth,collapsed:u?!1:s.collapsed},`trace-expand-v${i}`)}function $s({label:s,content:r,tone:i="neutral",defaultOpen:u=!1}){const{level:d,version:f}=b.useContext(Sf),[p,x]=b.useState(u);b.useEffect(()=>{f!==0&&x(d===1)},[f,d]);const m={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"}[i];return a.jsxs("div",{className:W("rounded-lg border mb-2",m),children:[a.jsxs("button",{onClick:()=>x(g=>!g),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:[p?a.jsx(xl,{size:11}):a.jsx(qn,{size:11}),a.jsx("span",{className:"uppercase tracking-wider opacity-70",children:s}),!p&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal truncate ml-1",children:[r.slice(0,80),r.length>80?"…":""]})]}),p&&a.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 YN({label:s,value:r}){return a.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:[a.jsx("span",{className:"opacity-60",children:s}),a.jsx("span",{className:"font-mono text-[hsl(var(--foreground))]",children:typeof r=="object"?JSON.stringify(r):String(r)})]})}function KN({event:s}){const r=Nf(s);return r?a.jsxs(a.Fragment,{children:[s.model&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Model:"})," ",s.model,r.turn!=null&&a.jsxs("span",{className:"ml-2 text-[hsl(var(--muted-foreground))]",children:["· turn ",r.turn]})]}),s.promptVersion&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Version:"})," ",s.promptVersion]}),s.tokens&&(s.tokens.input!=null||s.tokens.output!=null)&&a.jsxs("p",{className:"text-xs mb-1",children:[a.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.params&&Object.keys(r.params).length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:Object.entries(r.params).map(([i,u])=>a.jsx(YN,{label:i,value:u},i))}),r.system&&a.jsx($s,{label:"System prompt",content:r.system,tone:"info"}),r.prompt&&a.jsx($s,{label:"Prompt",content:r.prompt,defaultOpen:!0}),r.thinking&&a.jsx($s,{label:"Thinking",content:r.thinking,tone:"info"}),r.response&&a.jsx($s,{label:"Response",content:r.response,defaultOpen:!0}),r.messages&&a.jsx($s,{label:`Messages (verbose) — ${r.messages.length}`,content:r.messages.map(i=>`[${i.role}]
|
|
267
|
+
${i.content??""}`).join(`
|
|
268
|
+
|
|
269
|
+
───
|
|
270
|
+
|
|
271
|
+
`)})]}):null}function $N({event:s}){const r=s.data??null;return r?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center gap-2 mb-2 text-xs",children:a.jsx("span",{className:W("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&&a.jsxs("p",{className:"text-xs mb-2",children:[a.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.args!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider opacity-70 mb-1",children:"Arguments"}),a.jsx(f0,{data:r.args})]})]}):null}function XN({event:s}){const r=d0(s);if(!r)return null;const i=r.valid===!1||r.blocked===!0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs",children:[a.jsx("span",{className:W("px-2 py-0.5 rounded-full text-[10px] font-medium",i?"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:i?"FAILED":"PASSED"}),r.attempt!=null&&r.maxAttempts!=null&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["attempt ",r.attempt," of ",r.maxAttempts]}),r.guardrailType&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["· ",r.guardrailType]})]}),r.reason&&a.jsxs("p",{className:"text-xs mb-2",children:[a.jsx("strong",{children:"Reason:"})," ",r.reason]}),r.feedbackMessage&&a.jsx($s,{label:"Retry feedback sent to LLM",content:r.feedbackMessage,tone:"warning",defaultOpen:!0})]})}function VN({event:s}){return a.jsxs(a.Fragment,{children:[s.model&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Model:"})," ",s.model]}),s.promptVersion&&a.jsxs("p",{className:"text-xs mb-1",children:[a.jsx("strong",{children:"Version:"})," ",s.promptVersion]}),s.tokens&&(s.tokens.input!=null||s.tokens.output!=null)&&a.jsxs("p",{className:"text-xs mb-1",children:[a.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}`:""]}),s.data!=null&&a.jsx(f0,{data:s.data,collapsed:!0})]})}function ZN({event:s,index:r,isExpanded:i,onToggle:u,maxDuration:d}){var y;const f=QN(s),p=GN(s),x=d0(s),m=s.type==="guardrail"||s.type==="schema_check"||s.type==="validate",g=m&&((x==null?void 0:x.valid)===!1||(x==null?void 0:x.blocked)===!0);return a.jsxs("div",{children:[a.jsxs("button",{onClick:u,className:W("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||g?"bg-amber-100/60 dark:bg-amber-950/30 ring-1 ring-amber-400/40":"bg-[hsl(var(--secondary))]"),style:{marginLeft:`${f*16}px`},children:[i?a.jsx(xl,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}):a.jsx(qn,{size:12,className:"shrink-0 text-[hsl(var(--muted-foreground))]"}),a.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))] w-8",children:["#",s.step!=null?s.step:r]}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${Gx(s)}`}),a.jsx("span",{className:"font-medium w-28 truncate",children:s.type}),p&&a.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 ${(y=Nf(s))==null?void 0:y.retryReason} failure`,children:[a.jsx(Uj,{size:9}),"retry"]}),(x==null?void 0:x.attempt)!=null&&x.maxAttempts!=null&&a.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&&a.jsx("span",{className:"text-blue-600 dark:text-blue-400 w-28 truncate",children:s.agent}),s.tool&&a.jsx("span",{className:"text-purple-600 dark:text-purple-400 w-28 truncate",children:s.tool}),a.jsx("div",{className:"flex-1 h-3 bg-[hsl(var(--background))] rounded overflow-hidden",children:s.duration!=null&&s.duration>0&&a.jsx("div",{className:`h-full rounded ${Gx(s)}`,style:{width:`${Math.max(s.duration/d*100,2)}%`,opacity:.7}})}),s.duration!=null&&a.jsx(LN,{ms:s.duration}),s.cost!=null&&s.cost>0&&a.jsx(ba,{cost:s.cost})]}),i&&a.jsx("div",{className:"mt-1 mb-2 p-3 rounded-xl bg-[hsl(var(--card))] border border-[hsl(var(--border))]",style:{marginLeft:`${f*16+32}px`},children:s.type==="agent_call"?a.jsx(KN,{event:s}):m?a.jsx(XN,{event:s}):s.type==="tool_approval"?a.jsx($N,{event:s}):a.jsx(VN,{event:s})})]})}function wf({events:s,maxDuration:r,showToolbar:i=!0,header:u}){const[d,f]=b.useState(new Set),[p,x]=b.useState(0),[m,g]=b.useState(0),y=b.useMemo(()=>r??Math.max(...s.map(w=>w.duration??0),1),[s,r]),v=w=>{f(A=>{const O=new Set(A);return O.has(w)?O.delete(w):O.add(w),O})},C=()=>{const w=s.map((A,O)=>A.step??O);f(new Set(w)),x(1),g(A=>A+1)},T=()=>{f(new Set),x(0),g(w=>w+1)};return a.jsxs(a.Fragment,{children:[i&&a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[s.length," event",s.length!==1?"s":"",u&&a.jsx("span",{className:"ml-2",children:u})]}),s.length>0&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("button",{onClick:C,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:[a.jsx(Wg,{size:12}),"Expand"]}),a.jsxs("button",{onClick:T,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:[a.jsx(Fg,{size:12}),"Collapse"]})]})]}),a.jsx(Sf.Provider,{value:{level:p,version:m},children:a.jsx("div",{className:"space-y-1",children:s.map((w,A)=>{const O=w.step??A;return a.jsx(ZN,{event:w,index:A,isExpanded:d.has(O),onToggle:()=>v(O),maxDuration:y},O)})})})]})}const h0=[{id:"24h",label:"24h"},{id:"7d",label:"7d"},{id:"30d",label:"30d"},{id:"all",label:"All"}],m0="axl.studio.window";function JN(){try{const s=localStorage.getItem(m0);if(s&&h0.some(r=>r.id===s))return s}catch{}return"7d"}function FN(s){try{localStorage.setItem(m0,s)}catch{}}function gl({value:s,onChange:r}){return a.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:h0.map(i=>a.jsx("button",{type:"button",role:"radio","aria-checked":s===i.id,"aria-label":`Window: ${i.label}`,onClick:()=>r(i.id),className:W("px-2.5 py-1 text-xs font-medium rounded-md transition-all cursor-pointer",s===i.id?"bg-[hsl(var(--background))] text-[hsl(var(--foreground))] shadow-sm":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:i.label},i.id))})}function ou(s,r){const[i,u]=b.useState(JN),[d,f]=b.useState(null),[p,x]=b.useState(null),{data:m}=gn({queryKey:[s,i],queryFn:()=>r(i)});return jf(s,b.useCallback(y=>{const v=y;v.snapshots&&(f(v.snapshots),typeof v.updatedAt=="number"&&x(v.updatedAt))},[])),{window:i,handleWindowChange:y=>{u(y),FN(y)},data:(d==null?void 0:d[i])??m??null,updatedAt:p}}function WN({onWorkflowClick:s,selectedWorkflow:r}={}){const{window:i,handleWindowChange:u,data:d}=ou("workflow-stats",CN),f=!d||d.totalExecutions===0,p=d?Object.entries(d.byWorkflow).sort(([,x],[,m])=>m.total-x.total):[];return f?a.jsxs("div",{className:"space-y-3 mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),a.jsx(gl,{value:i,onChange:u})]}),a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))] italic",children:["No executions in the ",i," window. Try a wider window."]})]}):a.jsxs("div",{className:"space-y-3 mb-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Workflow Stats"}),a.jsx(gl,{value:i,onChange:u})]}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(Ke,{label:"Total Executions",value:String(d.totalExecutions),subtitle:i}),a.jsx(Ke,{label:"Failure Rate",value:`${(d.failureRate*100).toFixed(1)}%`,subtitle:d.failureRate>.1?"high":"normal",subtitleColor:d.failureRate>.1?"text-red-500":void 0})]}),p.length>0&&a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("th",{className:"py-2 px-3 text-left font-medium",children:"Workflow"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Total"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Failed"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"50th percentile duration (approximate for workflows with 200+ executions)",children:"p50"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",title:"95th percentile duration (approximate for workflows with 200+ executions)",children:"p95"}),a.jsx("th",{className:"py-2 px-3 text-right font-medium",children:"Avg"})]})}),a.jsx("tbody",{children:p.map(([x,m])=>a.jsxs("tr",{onClick:s?()=>s(x):void 0,className:W("border-b last:border-b-0 border-[hsl(var(--border))]",s&&"cursor-pointer hover:bg-[hsl(var(--accent))]",r===x&&"bg-[hsl(var(--accent))]"),title:s?"Click to select this workflow":void 0,children:[a.jsx("td",{className:"py-2 px-3 font-mono",children:x}),a.jsx("td",{className:"py-2 px-3 text-right",children:m.total}),a.jsx("td",{className:"py-2 px-3 text-right",children:m.failed>0?a.jsx("span",{className:"text-red-500",children:m.failed}):"0"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:m.durationP50!=null?ot(m.durationP50):"—"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:m.durationP95!=null?ot(m.durationP95):"—"}),a.jsx("td",{className:"py-2 px-3 text-right font-mono",children:ot(m.avgDuration)})]},x))})]})})]})}function IN(){const[s,r]=b.useState(""),[i,u]=b.useState("{}"),[d,f]=b.useState(!0),[p,x]=b.useState(null),[m,g]=b.useState(void 0),[y,v]=b.useState(null),[C,T]=b.useState("idle"),[w,A]=b.useState("run"),{data:O=[]}=gn({queryKey:["workflows"],queryFn:oN}),{data:z}=gn({queryKey:["workflow",s],queryFn:()=>uN(s),enabled:!!s}),K=i0(p),N=b.useCallback(async $=>{if(s){g(void 0),v(null),T("running");try{const re=await cN(s,$,!0);re.streaming&&re.executionId?x(re.executionId):(g(re.result),T("completed"))}catch(re){v(re instanceof Error?re.message:String(re)),T("failed")}}},[s]),S=b.useCallback(()=>{try{const $=JSON.parse(i);N($)}catch($){v($ instanceof Error?$.message:String($)),T("failed")}},[i,N]),D=b.useCallback($=>{r($),u("{}"),g(void 0),v(null),T("idle")},[]),U=O.find($=>$.name===s),B=b.useCallback($=>{N($)},[N]);b.useEffect(()=>{K.done&&C==="running"&&(T(K.error?"failed":"completed"),K.error&&v(K.error),K.result!==void 0&&g(K.result),x(null))},[K.done,K.error,K.result,C]);const q=K.events.filter($=>$.type==="step").map($=>$.data),Z=!!(z!=null&&z.inputSchema),J=Math.max(...q.map($=>$.duration??0),1),ne=q.reduce(($,re)=>$+(re.duration??0),0),Q=q.reduce(($,re)=>$+(re.cost??0),0);return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(iu,{title:"Workflow Runner",description:U?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:U.name}),(U.hasInputSchema||U.hasOutputSchema)&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[U.hasInputSchema&&"input schema",U.hasInputSchema&&U.hasOutputSchema&&" · ",U.hasOutputSchema&&"output schema"]})]})]}):O.length>0?`${O.length} registered workflow${O.length!==1?"s":""} · select one to run`:"No workflows registered",actions:O.length>0&&a.jsxs("div",{className:W("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:[a.jsx(xi,{items:O,value:s,onSelect:D,getKey:$=>$.name,getLabel:$=>$.name,getDescription:$=>{const re=[];return $.hasInputSchema&&re.push("input schema"),$.hasOutputSchema&&re.push("output schema"),re.length>0?re.join(" · "):"no schema"},placeholder:"Select workflow",searchPlaceholder:"Search workflows…",emptyLabel:"No workflows registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select a workflow"}),a.jsxs("button",{onClick:S,disabled:!s||C==="running",className:W("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:[a.jsx(yf,{size:12,className:W("fill-current",C==="running"&&"animate-spin fill-none")}),C==="running"?"Running…":"Run"]})]})}),a.jsx("div",{role:"tablist","aria-label":"Workflow Runner views",className:"shrink-0 flex items-center gap-1 px-6 border-b border-[hsl(var(--border))]",children:["run","stats"].map($=>a.jsx("button",{type:"button",role:"tab","aria-selected":w===$,onClick:()=>A($),className:W("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",w===$?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:$.charAt(0).toUpperCase()+$.slice(1)},$))}),w==="stats"&&a.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:a.jsx(WN,{onWorkflowClick:$=>{D($),A("run")},selectedWorkflow:s})}),w==="run"&&a.jsxs("div",{className:"flex-1 min-h-0 flex",children:[a.jsxs("div",{className:"w-[320px] xl:w-[360px] shrink-0 border-r border-[hsl(var(--border))] overflow-y-auto p-5 space-y-4",children:[Z&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>f(!0),className:W("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"}),a.jsx("button",{onClick:()=>f(!1),className:W("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"})]}),Z&&d?a.jsx(u0,{schema:z.inputSchema,onSubmit:B,submitLabel:C==="running"?"Running…":"Execute"}):a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Input (JSON)"}),a.jsx(o0,{value:i,onChange:u})]}),(z==null?void 0:z.outputSchema)!=null&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Output Schema"}),a.jsx(qt,{data:z.outputSchema,collapsed:!0})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:C==="idle"?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(Ft,{icon:a.jsx(ir,{size:32}),title:"No execution",description:"Select a workflow and click Run to see results."})}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(Ke,{label:"Status",badge:a.jsx(c0,{status:C})}),a.jsx(Ke,{label:"Steps",value:String(q.length)}),a.jsx(Ke,{label:"Duration",value:ne>0?ot(ne):"—"}),a.jsx(Ke,{label:"Cost",value:Q>0?lt(Q):"—"})]}),y&&a.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:y}),m!==void 0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),a.jsx(qt,{data:m})]}),q.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Timeline"}),a.jsx(wf,{events:q,maxDuration:J})]}),C==="running"&&q.length===0&&a.jsxs("div",{className:"flex items-center justify-center py-12 text-sm text-[hsl(var(--muted-foreground))]",children:[a.jsx(ir,{size:16,className:"animate-pulse mr-2"}),"Executing workflow…"]})]})})]})]})}function Yx({data:s,maxBars:r,defaultColor:i="hsl(var(--primary))",formatValue:u=f=>String(f),className:d}){const f=[...s].sort((m,g)=>g.value-m.value),p=r?f.slice(0,r):f,x=p.length>0?Math.max(...p.map(m=>m.value)):1;return p.length===0?a.jsx("p",{className:W("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"}):a.jsx("div",{className:W("space-y-1",d),children:p.map(m=>{const g=x>0?m.value/x*100:0;return a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:m.label,children:m.label}),a.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))]",children:a.jsx("div",{className:"absolute inset-y-0 left-0 rounded",style:{width:`${g}%`,backgroundColor:m.color??i,opacity:.7}})}),a.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:u(m.value)})]},m.label)})})}function Kx({data:s,maxBars:r,formatValue:i=f=>String(f),showLegend:u=!0,className:d}){const p=[...s.map(y=>({...y,total:y.segments.reduce((v,C)=>v+C.value,0)}))].sort((y,v)=>v.total-y.total),x=r?p.slice(0,r):p,m=x.length>0?Math.max(...x.map(y=>y.total)):1;if(x.length===0)return a.jsx("p",{className:W("text-xs text-[hsl(var(--muted-foreground))]",d),children:"No data"});const g=new Map;for(const y of x)for(const v of y.segments)g.has(v.name)||g.set(v.name,v.color);return a.jsxs("div",{className:W("space-y-2",d),children:[u&&g.size>0&&a.jsx("div",{className:"flex flex-wrap gap-3 text-[10px] text-[hsl(var(--muted-foreground))]",children:Array.from(g.entries()).map(([y,v])=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:v}}),a.jsx("span",{children:y})]},y))}),a.jsx("div",{className:"space-y-1",children:x.map(y=>{const v=m>0?y.total/m*100:0;return a.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[a.jsx("div",{className:"w-24 truncate font-mono text-[hsl(var(--muted-foreground))]",title:y.label,children:y.label}),a.jsx("div",{className:"relative flex-1 h-5 rounded bg-[hsl(var(--muted))] overflow-hidden",children:a.jsx("div",{className:"absolute inset-y-0 left-0 flex",style:{width:`${v}%`},children:y.segments.map((C,T)=>{const w=y.total>0?C.value/y.total*100:0;return a.jsx("div",{style:{width:`${w}%`,backgroundColor:C.color,opacity:.75},title:`${C.name}: ${C.value}`},`${C.name}-${T}`)})})}),a.jsx("div",{className:"w-12 text-right font-mono tabular-nums",children:i(y.total)})]},y.label)})})]})}const Md={schema:"#f59e0b",validate:"#eab308",guardrail:"#ef4444"},PN={agent_call:"#3b82f6",tool_call:"#10b981",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 e2(s){return PN[s]??"#64748b"}function t2(){const{window:s,handleWindowChange:r,data:i}=ou("trace-stats",EN);if(!i||i.totalEvents===0)return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),a.jsx(gl,{value:s,onChange:r})]}),a.jsx(Ft,{icon:a.jsx(lj,{size:32}),title:"No trace stats yet",description:"Execute workflows to see trace statistics."})]});const u=Object.entries(i.eventTypeCounts).sort(([,g],[,y])=>y-g),d=Object.entries(i.byTool).sort(([,g],[,y])=>y.calls-g.calls),f=Object.entries(i.retryByAgent).filter(([,g])=>g.schema+g.validate+g.guardrail>0),p=u.map(([g,y])=>({label:g,value:y,color:e2(g)})),x=d.map(([g,y])=>({label:g,value:y.calls})),m=f.map(([g,y])=>({label:g,segments:[{name:"schema",value:y.schema,color:Md.schema},{name:"validate",value:y.validate,color:Md.validate},{name:"guardrail",value:y.guardrail,color:Md.guardrail}].filter(v=>v.value>0)}));return a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Trace Stats"}),a.jsx(gl,{value:s,onChange:r})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsx(Ke,{label:"Total Events",value:String(i.totalEvents),subtitle:s}),a.jsx(Ke,{label:"Event Types",value:String(u.length),subtitle:"distinct types"}),a.jsx(Ke,{label:"Tools Used",value:String(d.length),subtitle:d.length===1?"tool":"tools"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Event Type Distribution"}),a.jsx(Yx,{data:p,formatValue:g=>g.toString()})]}),a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsxs("h4",{className:"text-sm font-medium mb-3",children:["Tool Calls ",d.length>10&&a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"(top 10)"})]}),d.length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No tool activity in window"}):a.jsx(Yx,{data:x,maxBars:10})]}),f.length>0&&a.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Retries by Agent"}),a.jsx(Kx,{data:m,formatValue:g=>g.toString()})]}),d.some(([,g])=>g.approved+g.denied>0)&&a.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-[hsl(var(--border))] p-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-3",children:"Tool Approvals / Denials"}),a.jsx(Kx,{data:d.filter(([,g])=>g.approved+g.denied>0).map(([g,y])=>({label:g,segments:[{name:"approved",value:y.approved,color:"#10b981"},{name:"denied",value:y.denied,color:"#ef4444"}].filter(v=>v.value>0)})),formatValue:g=>g.toString()})]})]})]})}const n2={running:"border-l-blue-500",completed:"border-l-green-500",failed:"border-l-red-500"};function a2(s){const r=new Date(s),i=new Date;return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.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 l2(){const[s,r]=b.useState("events"),[i,u]=b.useState(null),[d,f]=b.useState([]),[p,x]=b.useState(""),[m,g]=b.useState(""),{data:y=[],refetch:v}=gn({queryKey:["executions"],queryFn:dN,refetchInterval:3e3});jf("trace:*",b.useCallback(S=>{f(D=>[...D.slice(-200),S])},[]));const C=i?i.steps:d;let T=C;p&&(T=T.filter(S=>S.type===p)),m&&(T=T.filter(S=>S.agent===m));const w=b.useMemo(()=>[...new Set(C.map(S=>S.type))].sort(),[C]),A=b.useMemo(()=>[...new Set(C.map(S=>S.agent).filter(S=>!!S))].sort(),[C]),O=b.useMemo(()=>[{value:"",label:"All types"},...w.map(S=>({value:S,label:S}))],[w]),z=b.useMemo(()=>[{value:"",label:"All agents"},...A.map(S=>({value:S,label:S}))],[A]),K=Math.max(...T.map(S=>S.duration??0),1),N=b.useMemo(()=>{if(!i)return null;const S=[...new Set(i.steps.map(D=>D.model).filter(Boolean))];return{duration:i.duration,eventCount:i.steps.length,cost:i.totalCost,models:S}},[i]);return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(iu,{title:"Trace Explorer",description:i?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:i.workflow}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{className:"font-mono",children:i.executionId.slice(0,8)}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[i.steps.length," event",i.steps.length!==1?"s":""]})]}):a.jsxs(a.Fragment,{children:[y.length," execution",y.length!==1?"s":"",a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),d.length," live event",d.length!==1?"s":""]}),actions:a.jsxs(a.Fragment,{children:[a.jsx(xi,{items:O,value:p,onSelect:x,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All types",searchPlaceholder:"Filter types…",variant:"filter",triggerClassName:W("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 event type"}),A.length>0&&a.jsx(xi,{items:z,value:m,onSelect:g,getKey:S=>S.value,getLabel:S=>S.label,placeholder:"All agents",searchPlaceholder:"Filter agents…",variant:"filter",triggerClassName:W("rounded-full shadow-sm ring-1 transition-shadow",m?"ring-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"ring-[hsl(var(--input))]"),ariaLabel:"Filter by agent"}),a.jsxs("button",{onClick:()=>{v(),f([])},className:W("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:[a.jsx(zj,{size:12}),"Refresh"]})]})}),a.jsx("div",{role:"tablist","aria-label":"Trace views",className:"shrink-0 flex items-center gap-1 px-6 border-b border-[hsl(var(--border))]",children:["events","stats"].map(S=>a.jsx("button",{type:"button",role:"tab","aria-selected":s===S,onClick:()=>r(S),className:W("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"&&a.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:a.jsx(t2,{})}),s==="events"&&a.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-6",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-2",children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Executions"}),a.jsxs("button",{onClick:()=>{u(null)},className:W("w-full text-left px-3 py-2 text-xs rounded-xl border",i?"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]":"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]"),children:["Live Events (",d.length,")"]}),y.map(S=>a.jsxs("button",{onClick:()=>{u(S)},className:W("w-full text-left px-3 py-2.5 text-xs rounded-xl border border-l-[3px] transition-colors",n2[S.status]??"border-l-slate-400",(i==null?void 0:i.executionId)===S.executionId?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"),children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"font-medium truncate",children:S.workflow}),a.jsx(c0,{status:S.status})]}),a.jsxs("div",{className:"flex items-center justify-between mt-1",children:[a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] truncate",children:[S.executionId.slice(0,8),"… | ",S.steps.length," steps"]}),S.totalCost>0&&a.jsx(ba,{cost:S.totalCost})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx("span",{children:a2(S.startedAt)}),S.duration>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[hsl(var(--border))]",children:"·"}),a.jsx("span",{children:ot(S.duration)})]})]})]},S.executionId)),y.length===0&&a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No executions yet"})]}),a.jsxs("div",{className:"lg:col-span-3",children:[N&&a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[a.jsx(Ke,{label:"Duration",value:ot(N.duration)}),a.jsx(Ke,{label:"Events",value:String(N.eventCount)}),a.jsx(Ke,{label:"Cost",value:N.cost>0?lt(N.cost):"—"}),a.jsx(Ke,{label:"Model",value:N.models.length>0?N.models[0]:"—",subtitle:N.models.length>1?`+${N.models.length-1} more`:void 0})]}),(i==null?void 0:i.status)==="completed"&&i.result!=null&&a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-2",children:"Result"}),a.jsx(qt,{data:i.result})]}),T.length===0?a.jsx(Ft,{icon:a.jsx(gf,{size:32}),title:"No trace events",description:"Execute a workflow to see trace events here."}):a.jsx(wf,{events:T,maxDuration:K})]})]})})]})}function $x({tokens:s,label:r,className:i}){return a.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-mono bg-[hsl(var(--secondary))] text-[hsl(var(--secondary-foreground))] ${i??""}`,children:[r&&a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:r}),On(s)]})}function s2(s,r){const i=Math.max(0,r-s);return i<1e3?"just now":i<6e4?`${Math.floor(i/1e3)}s ago`:i<36e5?`${Math.floor(i/6e4)}m ago`:`${Math.floor(i/36e5)}h ago`}function r2(){const{window:s,handleWindowChange:r,data:i,updatedAt:u}=ou("costs",SN),[d,f]=b.useState(()=>Date.now());if(b.useEffect(()=>{const N=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(N)},[]),!i)return a.jsx(ur,{title:"Cost Dashboard",description:"Spending across agents, models, and workflows",actions:a.jsx(gl,{value:s,onChange:r}),children:a.jsx(Ft,{icon:a.jsx(Ig,{size:32}),title:"No cost data",description:"Execute workflows to see cost data."})});const p=i.totalTokens.reasoning>0,x=Object.keys(i.byAgent).length,m=Object.keys(i.byModel).length,g=Object.values(i.byWorkflow).reduce((N,S)=>N+S.executions,0),y=i.retry??{primary:0,primaryCalls:0,schema:0,schemaCalls:0,validate:0,validateCalls:0,guardrail:0,guardrailCalls:0,retryCalls:0},v=y.schema+y.validate+y.guardrail,C=i.totalCost>0?v/i.totalCost*100:0,T=i.byEmbedder??{},w=Object.entries(T),A=w.reduce((N,[,S])=>N+S.cost,0),O=w.reduce((N,[,S])=>N+S.calls,0),z=w.reduce((N,[,S])=>N+S.tokens,0),K=i.totalCost>0?A/i.totalCost*100:0;return a.jsxs(ur,{title:"Cost Dashboard",description:i.totalCost>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[lt(i.totalCost)," total"]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[x," agent",x!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[m," model",m!==1?"s":""]})]}):"Spending across agents, models, and workflows",actions:a.jsx(gl,{value:s,onChange:r}),children:[a.jsxs("div",{className:W("grid grid-cols-1 sm:grid-cols-2 gap-3 mb-8",p?"lg:grid-cols-4":"lg:grid-cols-3"),children:[a.jsx(Ke,{label:"Total Cost",value:lt(i.totalCost),subtitle:s}),a.jsx(Ke,{label:"Input Tokens",value:On(i.totalTokens.input),subtitle:"prompt"}),a.jsx(Ke,{label:"Output Tokens",value:On(i.totalTokens.output),subtitle:"completion"}),p&&a.jsx(Ke,{label:"Reasoning Tokens",value:On(i.totalTokens.reasoning),subtitle:"thinking"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Agent"}),Object.keys(i.byAgent).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No agent data"}):a.jsx(di,{columns:[{label:"Agent",sortKey:N=>N.agent,render:N=>a.jsx("span",{className:"font-mono",children:N.agent})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(ba,{cost:N.cost})}],rows:Object.entries(i.byAgent).map(([N,S])=>({agent:N,cost:S.cost,calls:S.calls})),rowKey:N=>N.agent,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Model"}),Object.keys(i.byModel).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No model data"}):a.jsx(di,{columns:[{label:"Model",sortKey:N=>N.model,render:N=>a.jsx("span",{className:"font-mono",children:N.model})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Tokens",sortKey:N=>N.tokens,render:N=>a.jsx($x,{tokens:N.tokens})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(ba,{cost:N.cost})}],rows:Object.entries(i.byModel).map(([N,S])=>({model:N,calls:S.calls,tokens:S.tokens.input+S.tokens.output,cost:S.cost})),rowKey:N=>N.model,defaultSort:{index:3,dir:"desc"},costValue:N=>N.cost})]}),a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h3",{className:"text-sm font-medium mb-3",children:"Cost by Workflow"}),Object.keys(i.byWorkflow).length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No workflow data"}):a.jsx(di,{columns:[{label:"Workflow",sortKey:N=>N.workflow,render:N=>a.jsx("span",{className:"font-mono",children:N.workflow})},{label:"Executions",sortKey:N=>N.executions,render:N=>a.jsx("span",{children:N.executions})},{label:"Total Cost",sortKey:N=>N.cost,render:N=>a.jsx(ba,{cost:N.cost})},{label:"Avg Cost",sortKey:N=>N.avgCost,render:N=>a.jsx(ba,{cost:N.avgCost})}],rows:Object.entries(i.byWorkflow).map(([N,S])=>({workflow:N,executions:S.executions,cost:S.cost,avgCost:S.executions>0?S.cost/S.executions:0})),rowKey:N=>N.workflow,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]}),w.length>0&&a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Memory (Embedder)"}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[lt(A)," across ",O," call",O!==1?"s":"",a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),On(z)," tokens",K>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),K.toFixed(1),"% of total"]})]})]}),a.jsx(di,{columns:[{label:"Embedder Model",sortKey:N=>N.model,render:N=>a.jsx("span",{className:"font-mono",children:N.model})},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Tokens",sortKey:N=>N.tokens,render:N=>a.jsx($x,{tokens:N.tokens})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(ba,{cost:N.cost})}],rows:w.map(([N,S])=>({model:N,calls:S.calls,tokens:S.tokens,cost:S.cost})),rowKey:N=>N.model,defaultSort:{index:3,dir:"desc"},costValue:N=>N.cost})]}),(v>0||y.retryCalls>0)&&a.jsxs("div",{className:"lg:col-span-2",children:[a.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Retry Overhead"}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[lt(v)," across ",y.retryCalls," retry call",y.retryCalls!==1?"s":"",C>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),C.toFixed(1),"% of total"]})]})]}),a.jsx(di,{columns:[{label:"Reason",sortKey:N=>N.reason,render:N=>N.reasonLabel},{label:"Calls",sortKey:N=>N.calls,render:N=>a.jsx("span",{children:N.calls})},{label:"Cost",sortKey:N=>N.cost,render:N=>a.jsx(ba,{cost:N.cost})}],rows:[{reason:"primary",reasonLabel:a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"primary (first attempt)"}),calls:y.primaryCalls,cost:y.primary},{reason:"schema",reasonLabel:a.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"schema retry"}),calls:y.schemaCalls,cost:y.schema},{reason:"validate",reasonLabel:a.jsx("span",{className:"font-mono text-teal-600 dark:text-teal-400",children:"validate retry"}),calls:y.validateCalls,cost:y.validate},{reason:"guardrail",reasonLabel:a.jsx("span",{className:"font-mono text-rose-600 dark:text-rose-400",children:"guardrail retry"}),calls:y.guardrailCalls,cost:y.guardrail}],rowKey:N=>N.reason,defaultSort:{index:2,dir:"desc"},costValue:N=>N.cost})]})]}),a.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:[a.jsxs("span",{children:["Window: ",a.jsx("span",{className:"font-mono",children:s})]}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsxs("span",{children:["Last updated:"," ",u!=null?s2(u,d):"pending"]}),a.jsx("span",{className:"opacity-40",children:"·"}),a.jsxs("span",{children:[g," execution",g!==1?"s":""," in window"]})]})]})}function di({columns:s,rows:r,rowKey:i,defaultSort:u,costValue:d}){const f=(u==null?void 0:u.index)??s.findIndex(w=>w.sortKey!==void 0),p=(u==null?void 0:u.dir)??"desc",[x,m]=b.useState(f),[g,y]=b.useState(p),v=b.useMemo(()=>{const w=s[x];if(!(w!=null&&w.sortKey))return r;const A=w.sortKey,O=[...r];return O.sort((z,K)=>{const N=A(z),S=A(K);if(typeof N=="number"&&typeof S=="number")return g==="asc"?N-S:S-N;const D=String(N),U=String(S);return g==="asc"?D.localeCompare(U):U.localeCompare(D)}),O},[r,s,x,g]),C=b.useMemo(()=>{if(!d)return 0;let w=0;for(const A of r){const O=d(A);O>w&&(w=O)}return w},[r,d]),T=w=>{s[w].sortKey&&(x===w?y(A=>A==="desc"?"asc":"desc"):(m(w),y("desc")))};return a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsx("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:s.map((w,A)=>{const O=w.align??(A===0?"left":"right"),z=w.sortKey!==void 0,K=z&&x===A,N=K?g==="asc"?" ↑":" ↓":"";return a.jsxs("th",{"aria-sort":K?g==="asc"?"ascending":"descending":void 0,className:W("py-2 px-3 font-medium",O==="left"?"text-left":"text-right",z&&"cursor-pointer select-none hover:text-[hsl(var(--foreground))]",z&&!K&&"text-[hsl(var(--muted-foreground))]"),onClick:z?()=>T(A):void 0,title:z?"Click to sort":void 0,children:[w.label,N]},w.label)})})}),a.jsx("tbody",{children:v.map(w=>{const A=d?d(w):0;return a.jsx("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:s.map((O,z)=>{const K=O.align??(z===0?"left":"right");return a.jsxs("td",{className:W("py-2 px-3 relative",K==="left"?"text-left":"text-right"),children:[z===s.length-1&&C>0&&a.jsx("div",{className:"absolute inset-y-0 right-0 bg-[hsl(var(--primary)/0.08)] rounded-sm",style:{width:`${A/C*100}%`}}),a.jsx("span",{className:"relative",children:O.render(w)})]},O.label)})},i(w))})})]})})}function i2(){const[s,r]=b.useState("session"),[i,u]=b.useState(""),[d,f]=b.useState("{}"),[p,x]=b.useState(!1),[m,g]=b.useState(""),[y,v]=b.useState(null),[C,T]=b.useState(null),w=Ni(),{data:A=[]}=gn({queryKey:["memory",s],queryFn:()=>yN(s)}),O=Xd({mutationFn:({key:D,value:U})=>bN(s,D,U),onSuccess:()=>{w.invalidateQueries({queryKey:["memory",s]}),x(!1),u(""),f("{}")}}),z=Xd({mutationFn:D=>jN(s,D),onSuccess:()=>{w.invalidateQueries({queryKey:["memory",s]}),T(null)}}),K=b.useCallback(async()=>{if(!m.trim())return;const D=await NN(m,s);v(D.results)},[m,s]),N=b.useCallback(()=>{if(i.trim())try{const D=JSON.parse(d);O.mutate({key:i,value:D})}catch{O.mutate({key:i,value:d})}},[i,d,O]),S=b.useCallback(D=>{C===D?z.mutate(D):T(D)},[C,z]);return a.jsxs(ur,{title:"Memory Browser",description:A.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[A.length," entr",A.length!==1?"ies":"y"]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[s," scope"]})]}):"Key-value entries stored via ctx.remember()",actions:a.jsxs("button",{type:"button",onClick:()=>x(!p),className:W("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:[a.jsx(e0,{size:12}),"Add entry"]}),children:[a.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(D=>a.jsx("button",{type:"button",role:"tab","aria-selected":s===D,onClick:()=>{r(D),v(null),T(null)},className:W("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors",s===D?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:D.charAt(0).toUpperCase()+D.slice(1)},D)),a.jsx("div",{className:"flex-1"}),a.jsxs("div",{className:"flex items-center gap-1 -mb-px pb-2",children:[a.jsx("input",{value:m,onChange:D=>g(D.target.value),onKeyDown:D=>D.key==="Enter"&&K(),placeholder:"Semantic search...",className:"px-2 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] bg-[hsl(var(--background))] w-48"}),a.jsx("button",{onClick:K,className:"p-1.5 rounded-md hover:bg-[hsl(var(--accent))]",children:a.jsx(Jd,{size:14})})]})]}),p&&a.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] space-y-3",children:[a.jsx("input",{value:i,onChange:D=>u(D.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))]"}),a.jsx(o0,{value:d,onChange:f,placeholder:"Value (JSON)"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:N,disabled:!i.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"}),a.jsx("button",{onClick:()=>x(!1),className:"px-3 py-1.5 text-sm rounded-md border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]})]}),y&&a.jsxs("div",{className:"mb-4 p-4 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Search Results"}),y.length===0?a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No results found"}):a.jsx(qt,{data:y})]}),A.length===0?a.jsx(Ft,{icon:a.jsx(Zg,{size:32}),title:"No memory entries",description:`No entries in the ${s} scope. Use ctx.remember() in workflows or add entries manually.`}):a.jsx("div",{className:"space-y-2",children:A.map(D=>a.jsxs("div",{className:"p-3 rounded-xl border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-mono font-medium",children:D.key}),a.jsx("div",{className:"flex items-center gap-1",children:C===D.key?a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>S(D.key),className:"px-2 py-0.5 text-xs rounded bg-[hsl(var(--destructive))] text-[hsl(var(--destructive-foreground))]",children:"Confirm"}),a.jsx("button",{onClick:()=>T(null),className:"px-2 py-0.5 text-xs rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))]",children:"Cancel"})]}):a.jsx("button",{onClick:()=>S(D.key),className:"p-1 rounded hover:bg-[hsl(var(--destructive))] hover:text-[hsl(var(--destructive-foreground))] text-[hsl(var(--muted-foreground))]",children:a.jsx(bf,{size:14})})})]}),a.jsx(qt,{data:D.value,collapsed:!0})]},D.key))})]})}function o2(s){try{return JSON.parse(s)}catch{return s}}function u2(s,r){if(r==="assistant"){const i=s.trim();if(i.startsWith("{")||i.startsWith("["))try{const u=JSON.parse(i);return a.jsx(qt,{data:u,collapsed:!0})}catch{}}return a.jsx("div",{className:"whitespace-pre-wrap",children:s})}function c2(){const[s,r]=b.useState(null),[i,u]=b.useState(null),[d,f]=b.useState(null),p=Ni(),{data:x=[]}=gn({queryKey:["sessions"],queryFn:fN,refetchInterval:5e3}),{data:m}=gn({queryKey:["session",s],queryFn:()=>hN(s),enabled:!!s}),g=Xd({mutationFn:mN,onSuccess:()=>{p.invalidateQueries({queryKey:["sessions"]}),r(null),f(null)}}),y=m!=null&&m.history?i!==null?m.history.slice(0,i+1):m.history:[];return a.jsx(ur,{title:"Session Manager",description:x.length>0?s&&m?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-mono",children:m.id.slice(0,16)}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[m.history.length," message",m.history.length!==1?"s":""]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[x.length," active session",x.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"select one to replay"})]}):"Multi-turn conversations tracked via runtime.session()",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Sessions (",x.length,")"]}),x.length===0?a.jsx(Ft,{icon:a.jsx(t0,{size:24}),title:"No sessions",description:"Sessions are created when using runtime.session()"}):x.map(v=>a.jsxs("button",{onClick:()=>{r(v.id),u(null)},className:`w-full text-left px-3 py-2.5 text-xs rounded-xl border transition-colors ${s===v.id?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[a.jsx("div",{className:"font-mono truncate text-[11px]",title:v.id,children:v.id}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[hsl(var(--muted-foreground))] mt-1",children:[a.jsx(Pg,{size:11}),a.jsxs("span",{children:[v.messageCount," message",v.messageCount!==1?"s":""]})]})]},v.id))]}),a.jsx("div",{className:"lg:col-span-2",children:m?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium font-mono",children:m.id}),a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[m.history.length," messages"]})]}),d===m.id?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:()=>g.mutate(m.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"}),a.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"})]}):a.jsxs("button",{onClick:()=>f(m.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:[a.jsx(bf,{size:12}),"Delete"]})]}),m.handoffHistory&&m.handoffHistory.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-medium mb-2",children:"Handoff Chain"}),a.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:m.handoffHistory.map((v,C)=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.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:v.source}),a.jsx(pi,{size:12,className:"text-[hsl(var(--muted-foreground))]"}),a.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:v.target}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["(",v.mode,")"]}),C<m.handoffHistory.length-1&&a.jsx("span",{className:"mx-1 text-[hsl(var(--muted-foreground))]",children:"|"})]},C))})]}),m.history.length>1&&a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] p-3",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("label",{className:"text-xs font-medium",children:"Replay"}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:i!==null?`${i+1} / ${m.history.length}`:`${m.history.length} / ${m.history.length}`})]}),a.jsx("input",{type:"range",min:0,max:m.history.length-1,value:i??m.history.length-1,onChange:v=>u(Number(v.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"}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Start"}),a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:"Latest"})]})]}),a.jsx("div",{className:"space-y-3",children:y.map((v,C)=>a.jsxs("div",{className:`p-3 rounded-xl text-sm ${v.role==="user"?"bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))] ml-8":v.role==="assistant"?"bg-[hsl(var(--secondary))] mr-8":"bg-[hsl(var(--muted))] text-xs font-mono"}`,children:[a.jsx("div",{className:"text-xs font-medium mb-1 opacity-70",children:v.role}),u2(v.content,v.role),v.tool_calls&&v.tool_calls.length>0&&a.jsx("div",{className:"mt-2 space-y-1",children:v.tool_calls.map(T=>a.jsxs("details",{className:"text-xs",children:[a.jsx("summary",{className:"cursor-pointer font-mono",children:T.function.name}),a.jsx(qt,{data:o2(T.function.arguments),collapsed:!0})]},T.id))})]},C))})]}):a.jsx(Ft,{title:"Select a session",description:"Click a session to view its history"})})]})})}function d2(){const[s,r]=b.useState(null),[i,u]=b.useState(void 0),[d,f]=b.useState(null),[p,x]=b.useState(!1),[m,g]=b.useState(!1),{data:y=[]}=gn({queryKey:["tools"],queryFn:xN}),{data:v}=gn({queryKey:["tool",s],queryFn:()=>gN(s),enabled:!!s}),C=b.useCallback(async w=>{if(s){u(null),f(null),x(!0);try{const A=await vN(s,w);u(A.result)}catch(A){f(A instanceof Error?A.message:String(A))}finally{x(!1)}}},[s]),T=y.find(w=>w.name===s);return a.jsx(ur,{title:"Tool Inspector",description:T?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"font-mono",children:T.name}),T.description&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:T.description})]})]}):y.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("span",{className:"whitespace-nowrap",children:[y.length," registered tool",y.length!==1?"s":""]}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:"select one to inspect"})]}):"Registered tools with schemas and direct testing",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Tools (",y.length,")"]}),y.length===0?a.jsx(Ft,{icon:a.jsx(n0,{size:24}),title:"No tools",description:"Register tools with runtime.registerTool()"}):y.map(w=>a.jsxs("button",{onClick:()=>{r(w.name),u(void 0),f(null),g(!1)},className:`w-full text-left px-3 py-2 text-xs rounded-xl border ${s===w.name?"border-[hsl(var(--primary))] bg-[hsl(var(--accent))]":"border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))]"}`,children:[a.jsx("div",{className:"font-medium",children:w.name}),a.jsx("div",{className:"text-[hsl(var(--muted-foreground))] mt-0.5 truncate",children:w.description}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[w.sensitive&&a.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"}),w.requireApproval&&a.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"})]})]},w.name))]}),a.jsx("div",{className:"lg:col-span-2",children:s?v?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-medium",children:v.name}),a.jsx("p",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:v.description})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.sensitive&&a.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"}),v.requireApproval&&a.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"}),v.retry.attempts&&v.retry.attempts>1&&a.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: ",v.retry.attempts,"x ",v.retry.backoff]}),v.hasHooks&&v.hooks&&a.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:"," ",[v.hooks.hasBefore&&"before",v.hooks.hasAfter&&"after"].filter(Boolean).join(" + ")]})]}),a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>g(!m),className:"flex items-center gap-1.5 text-sm font-medium text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors",children:[a.jsx(qn,{size:14,className:W("transition-transform",m&&"rotate-90")}),"View raw schema"]}),m&&a.jsx("div",{className:"mt-2",children:a.jsx(qt,{data:v.inputSchema})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Test Tool"}),a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:a.jsx(u0,{schema:v.inputSchema,onSubmit:C,submitLabel:p?"Running...":"Run Tool"})})]}),i!==void 0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Result"}),a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] p-4 bg-[hsl(var(--card))]",children:a.jsx(qt,{data:i})})]}),d&&a.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})]}):a.jsxs("div",{className:"flex items-center gap-2 text-sm text-[hsl(var(--muted-foreground))]",children:[a.jsx(Sj,{size:16,className:"animate-spin"}),"Loading tool details..."]}):a.jsx(Ft,{title:"Select a tool",description:"Click a tool to view its schema and test it"})})]})})}const nu={status:"idle",evalRunId:null,evalName:null,runCount:1,startedAt:null,progress:null,done:null,error:null},f2=300*1e3;let Ht=nu;const Fd=new Set;let Io=null,Xs=null;function Dn(s){Ht=s;for(const r of Fd)r()}function h2(){return Ht}function m2(s){return Fd.add(s),()=>Fd.delete(s)}function Vs(){Io&&(Io(),Io=null),Xs&&(clearTimeout(Xs),Xs=null)}function Xx(){Xs&&clearTimeout(Xs),Xs=setTimeout(()=>{Ht.status==="running"&&(Dn({...Ht,status:"error",error:"Lost contact with the server — no progress received. The eval may still be running; check the History tab."}),Vs())},f2)}function p2(){return b.useSyncExternalStore(m2,h2)}async function x2(s,r,i=!1){if(Ht.status==="running"&&Ht.evalRunId)try{await s0(Ht.evalRunId)}catch{}Vs(),Dn({...nu,status:"running",evalName:s,runCount:r,startedAt:Date.now()});let u;try{u=(await MN(s,{runs:r,captureTraces:i})).evalRunId}catch(d){Dn({...nu,status:"error",error:d instanceof Error?d.message:String(d)});return}Dn({...Ht,evalRunId:u}),Xx(),Io=r0.subscribe(`eval:${u}`,d=>{var p;const f=d;switch(Xx(),f.type){case"item_done":{const x=f.itemIndex,m=f.totalItems,g=typeof f.run=="number"?f.run:1,y=typeof f.totalRuns=="number"?f.totalRuns:1;Dn({...Ht,progress:{completedItems:x+1,totalItems:m,completedRuns:g-1,totalRuns:y}});break}case"run_done":{const x=f.run,m=f.totalRuns;Dn({...Ht,progress:{completedItems:0,totalItems:((p=Ht.progress)==null?void 0:p.totalItems)??0,completedRuns:x,totalRuns:m}});break}case"done":{const x=typeof f.evalResultId=="string"?f.evalResultId:null,m=typeof f.runGroupId=="string"?f.runGroupId:void 0;Dn(x?{...Ht,status:"done",done:m?{evalResultId:x,runGroupId:m}:{evalResultId:x}}:{...Ht,status:"error",error:"Eval completed without a result id — cannot adopt from history."}),Vs();break}case"error":Dn({...Ht,status:"error",error:f.message}),Vs();break}})}async function g2(){if(Ht.evalRunId)try{await s0(Ht.evalRunId)}catch{}Dn({...Ht,status:"error",error:"Cancelled"}),Vs()}function Vx(){Dn(nu),Vs()}function v2({series:s,xMin:r,xMax:i,yMin:u,yMax:d,yDomain:f,yClamp:p,height:x=160,padding:m={top:8,right:8,bottom:20,left:32},formatX:g=w=>String(w),formatY:y=w=>w.toFixed(2),onPointClick:v,ariaLabel:C,className:T}){const[w,A]=b.useState(null),[O,z]=b.useState({width:480,height:x}),K=(f==null?void 0:f.strategy)??"data",N=(f==null?void 0:f.minSpan)??.1,S=(f==null?void 0:f.padPct)??.1;let D,U;if(K==="fixed"||u!=null&&d!=null)D=u??0,U=d??1;else{const le=[];for(const _ of s)for(const F of _.points)Number.isFinite(F.y)&&le.push(F.y);if(le.length===0)D=u??0,U=d??1;else{let _=Math.min(...le),F=Math.max(...le);if(F-_<N){const H=(_+F)/2;_=H-N/2,F=H+N/2}const he=Math.max(N,F-_)*S;let pe=_-he,E=F+he;(p==null?void 0:p.min)!=null&&(pe=Math.max(pe,p.min)),(p==null?void 0:p.max)!=null&&(E=Math.min(E,p.max)),D=u??pe,U=d??E}}const B=Math.max(1,O.width-m.left-m.right),q=Math.max(1,O.height-m.top-m.bottom),Z=Math.max(1,i-r),J=Math.max(.001,U-D),ne=le=>m.left+(le-r)/Z*B,Q=le=>m.top+q-(le-D)/J*q,$=le=>{const _=le.currentTarget.getBoundingClientRect(),F=le.clientX-_.left,ie=r+(F-m.left)/B*Z;let he=null,pe=1/0;for(const I of s)for(const oe of I.points){const de=Math.abs(oe.x-ie);de<pe&&(pe=de,he={series:I,point:oe})}if(!he)return;const E=he.point.x,H=[];for(const I of s){const oe=I.points.find(de=>de.x===E);oe&&H.push({series:I,point:oe})}A({x:E,points:H})},re=[D,D+(U-D)*.25,D+(U-D)*.5,D+(U-D)*.75,U];return a.jsxs("div",{className:W("relative w-full",T),ref:le=>{le&&le.clientWidth>0&&le.clientWidth!==O.width&&z({width:le.clientWidth,height:x})},children:[a.jsxs("svg",{width:"100%",height:O.height,viewBox:`0 0 ${O.width} ${O.height}`,preserveAspectRatio:"none",role:"img","aria-label":C??`Line chart with ${s.length} series and ${s.reduce((le,_)=>le+_.points.length,0)} data points.`,onMouseMove:$,onMouseLeave:()=>A(null),onClick:v&&w&&w.points.length>0?()=>{const le=w.points[0];v(le.series,le.point)}:void 0,className:W("block",v&&w&&w.points.length>0&&"cursor-pointer"),children:[re.map(le=>a.jsxs("g",{children:[a.jsx("line",{x1:m.left,x2:O.width-m.right,y1:Q(le),y2:Q(le),stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"2 3"}),a.jsx("text",{x:m.left-4,y:Q(le)+3,textAnchor:"end",fontSize:9,fill:"currentColor",fillOpacity:.5,children:y(le)})]},le)),(()=>{const le=w?new Set(w.points.map(_=>_.series.name)):null;return s.map(_=>{const F=[..._.points].filter(pe=>Number.isFinite(pe.x)&&Number.isFinite(pe.y)).sort((pe,E)=>pe.x-E.x);if(F.length===0)return null;const ie=F.map((pe,E)=>`${E===0?"M":"L"} ${ne(pe.x).toFixed(2)} ${Q(pe.y).toFixed(2)}`).join(" "),he=!le||le.has(_.name);return a.jsxs("g",{style:{opacity:he?1:.2,transition:"opacity 120ms ease-out"},children:[a.jsx("path",{d:ie,stroke:_.color,strokeWidth:he&&le?2:1.5,fill:"none"}),F.map((pe,E)=>a.jsx("circle",{cx:ne(pe.x),cy:Q(pe.y),r:2.5,fill:_.color},E))]},_.name)})})(),w&&a.jsxs("g",{children:[a.jsx("line",{x1:ne(w.x),x2:ne(w.x),y1:m.top,y2:O.height-m.bottom,stroke:"currentColor",strokeOpacity:.15}),w.points.map(({series:le,point:_})=>a.jsx("circle",{cx:ne(_.x),cy:Q(_.y),r:4,fill:le.color,stroke:"hsl(var(--background))",strokeWidth:1.5},le.name))]}),a.jsx("text",{x:m.left,y:O.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"start",children:g(r)}),a.jsx("text",{x:O.width-m.right,y:O.height-4,fontSize:9,fill:"currentColor",fillOpacity:.5,textAnchor:"end",children:g(i)})]}),w&&(()=>{var pe;const le=ne(w.x),_=8,F=240,he=le>O.width/2?{right:`${Math.max(_,O.width-le+_)}px`,top:`${m.top+2}px`,maxWidth:`${F}px`}:{left:`${Math.min(le+_,O.width-_)}px`,top:`${m.top+2}px`,maxWidth:`${F}px`};return a.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:he,children:[a.jsx("div",{className:"mb-0.5 text-[hsl(var(--muted-foreground))]",children:g(w.x)}),w.points.map(({series:E,point:H})=>a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{backgroundColor:E.color}}),a.jsx("span",{className:"font-mono truncate",children:E.name}),a.jsx("span",{className:"ml-auto font-mono shrink-0",children:y(H.y)})]},E.name)),((pe=w.points[0])==null?void 0:pe.point.label)&&a.jsx("div",{className:"mt-0.5 truncate text-[hsl(var(--muted-foreground))]",children:w.points[0].point.label})]})})()]})}function y2({values:s,color:r="hsl(var(--primary))",width:i=120,height:u=24,fill:d=!0,className:f}){if(s.length===0)return a.jsx("div",{className:W("inline-block",f),style:{width:i,height:u}});if(s.length===1)return a.jsx("svg",{width:i,height:u,className:W("inline-block",f),children:a.jsx("circle",{cx:i/2,cy:u/2,r:2,fill:r})});const p=Math.min(...s),x=Math.max(...s),m=Math.max(.001,x-p),g=2,y=u-g*2,C=s.map((w,A)=>{const O=A/(s.length-1)*i,z=g+y-(w-p)/m*y;return[O,z]}).map(([w,A],O)=>`${O===0?"M":"L"} ${w.toFixed(1)} ${A.toFixed(1)}`).join(" "),T=d?`${C} L ${i} ${u} L 0 ${u} Z`:null;return a.jsxs("svg",{width:i,height:u,viewBox:`0 0 ${i} ${u}`,className:W("inline-block",f),children:[T&&a.jsx("path",{d:T,fill:r,fillOpacity:.12}),a.jsx("path",{d:C,stroke:r,strokeWidth:1.25,fill:"none"})]})}function Zx(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 Od(s){return s.toFixed(3)}const Jx=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316"];function $l(s,r){return Jx[r%Jx.length]??"#64748b"}function b2(s){const r=new Date(s),u=Date.now()-s,d=1440*60*1e3;return u<d?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):u<7*d?r.toLocaleDateString([],{weekday:"short"}):r.toLocaleDateString()}function j2({onViewRun:s}={}){const{window:r,handleWindowChange:i,data:u}=ou("eval-trends",wN),[d,f]=b.useState("scorer");if(!u||u.totalRuns===0)return a.jsxs("div",{className:"flex-1 overflow-auto p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),a.jsx(gl,{value:r,onChange:i})]}),a.jsx(Ft,{icon:a.jsx(Kj,{size:32}),title:"No eval trends yet",description:"Run evaluations to see score trends over time."})]});const p=Object.keys(u.byEval).sort();return a.jsxs("div",{className:"flex-1 overflow-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Eval Trends"}),a.jsx(gl,{value:r,onChange:i})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[a.jsx(Ke,{label:"Total Runs",value:String(u.totalRuns),subtitle:r}),a.jsx(Ke,{label:"Evals Tracked",value:String(p.length),subtitle:p.length===1?"eval":"evals"}),a.jsx(Ke,{label:"Total Cost",value:lt(u.totalCost),subtitle:"all evals"})]}),a.jsxs("div",{className:"flex items-center gap-1 text-xs",role:"group","aria-label":"Trend chart view mode",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] mr-1",children:"View:"}),["scorer","model","duration"].map(x=>a.jsx("button",{onClick:()=>f(x),"aria-pressed":d===x,className:W("px-2.5 py-1 rounded-md transition-colors",d===x?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:x==="scorer"?"By Scorer":x==="model"?"By Model":"Duration"},x))]}),p.map(x=>{const m=u.byEval[x],g=Object.keys(m.scoreMean).sort(),y=[...m.runs].sort((D,U)=>D.timestamp-U.timestamp);let v=[],C=[],T="",w,A=D=>D.toFixed(2);if(d==="scorer")T="Score Trend by Scorer",w={min:0,max:1},v=g.map((D,U)=>({name:D,color:$l(D,U),points:y.filter(B=>B.scores[D]!=null).map(B=>({x:B.timestamp,y:B.scores[D],label:B.model?`${B.id.slice(0,8)}… · ${B.model}`:B.id,meta:B}))})),C=g.map((D,U)=>({name:D,color:$l(D,U)}));else if(d==="model"){T="Score Trend by Model (mean of all scorers)",w={min:0,max:1};const D=new Map;for(const B of y){const q=B.model??"unknown",Z=D.get(q)??[];Z.push(B),D.set(q,Z)}const U=[...D.keys()].sort();v=U.map((B,q)=>{const Z=D.get(B)??[];return{name:B,color:$l(B,q),points:Z.map(J=>{const ne=Object.values(J.scores).filter($=>Number.isFinite($));if(ne.length===0)return null;const Q=ne.reduce(($,re)=>$+re,0)/ne.length;return{x:J.timestamp,y:Q,label:`${J.id.slice(0,8)}… · ${B}`,meta:J}}).filter(J=>J!==null)}}),C=U.map((B,q)=>({name:B,color:$l(B,q)}))}else{T="Duration Trend by Model",A=B=>ot(B);const D=new Map;for(const B of y){if(B.duration==null)continue;const q=B.model??"unknown",Z=D.get(q)??[];Z.push(B),D.set(q,Z)}const U=[...D.keys()].sort();v=U.map((B,q)=>{const Z=D.get(B)??[];return{name:B,color:$l(B,q),points:Z.map(J=>({x:J.timestamp,y:J.duration,label:`${J.id.slice(0,8)}… · ${B}`,meta:J}))}}),C=U.map((B,q)=>({name:B,color:$l(B,q)}))}const O=y.length>0?y[0].timestamp:0,z=y.length>0?y[y.length-1].timestamp:1,K=y.map(D=>D.cost),N=v.some(D=>D.points.length>=2),S=d==="duration"&&y.every(D=>D.duration==null)?"No duration metadata recorded on these runs.":(d==="model"||d==="duration")&&y.every(D=>D.model==null)?'No model metadata recorded on these runs — each run will show as "unknown".':null;return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 bg-[hsl(var(--card))] border-b border-[hsl(var(--border))] flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-sm font-medium",children:x}),a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))] ml-2",children:[m.runCount," run",m.runCount!==1?"s":""]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[K.length>1&&a.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-[hsl(var(--muted-foreground))]",title:"Cost over time",children:[a.jsx("span",{children:"cost"}),a.jsx(y2,{values:K,color:"hsl(var(--primary))",width:80,height:22})]}),a.jsx(ba,{cost:m.costTotal})]})]}),y.length>1&&a.jsxs("div",{className:"px-4 py-3 border-b border-[hsl(var(--border))]",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:T}),a.jsx("div",{className:"flex flex-wrap gap-2 text-[10px]",children:C.map(D=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:D.color}}),a.jsx("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:D.name})]},D.name))})]}),S?a.jsx("p",{className:"py-4 text-xs text-[hsl(var(--muted-foreground))] italic",children:S}):N?a.jsx(v2,{series:v,xMin:O,xMax:z,yClamp:w,yDomain:{strategy:"data",minSpan:d==="duration"?100:.1,padPct:.1},height:180,formatX:b2,formatY:A,ariaLabel:`${x}: ${T}, ${v.length} series across ${y.length} runs. Click a point to view that run.`,onPointClick:s?(D,U)=>{const B=U.meta;B!=null&&B.id&&s(B.id)}:void 0}):a.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&&g.length>0&&a.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."}),g.length>0&&a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("th",{className:"py-2 px-4 text-left font-medium",children:"Scorer"}),a.jsx("th",{className:"py-2 px-4 text-right font-medium",children:"Latest"}),a.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:m.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Mean",m.runCount>50?"*":""]}),a.jsxs("th",{className:"py-2 px-4 text-right font-medium",title:m.runCount>50?"Computed over the 50 most recent runs":void 0,children:["Std",m.runCount>50?"*":""]})]})}),a.jsx("tbody",{children:g.map((D,U)=>a.jsxs("tr",{className:"border-b last:border-b-0 border-[hsl(var(--border))]",children:[a.jsx("td",{className:"py-2 px-4 font-mono",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:d==="scorer"?$l(D,U):"hsl(var(--muted-foreground) / 0.4)"}}),D]})}),a.jsx("td",{className:W("py-2 px-4 text-right font-mono",Zx(m.latestScores[D]??0)),children:m.latestScores[D]!=null?Od(m.latestScores[D]):"—"}),a.jsx("td",{className:W("py-2 px-4 text-right font-mono",Zx(m.scoreMean[D]??0)),children:Od(m.scoreMean[D]??0)}),a.jsx("td",{className:"py-2 px-4 text-right font-mono text-[hsl(var(--muted-foreground))]",children:Od(m.scoreStd[D]??0)})]},D))})]}),m.runCount>50&&a.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"})]},x)})]})}function Fx(s){var x,m,g;if(s.length===0)return null;const r=s[0],i=Object.keys(((x=r.summary)==null?void 0:x.scorers)??{}),u={};for(const y of i){const v=s.map(w=>{var A,O,z;return((z=(O=(A=w.summary)==null?void 0:A.scorers)==null?void 0:O[y])==null?void 0:z.mean)??0}),C=v.reduce((w,A)=>w+A,0)/v.length,T=v.length>1?Math.sqrt(v.reduce((w,A)=>w+(A-C)**2,0)/(v.length-1)):0;u[y]={mean:Math.round(C*1e3)/1e3,std:Math.round(T*1e3)/1e3,min:Math.round(Math.min(...v)*1e3)/1e3,max:Math.round(Math.max(...v)*1e3)/1e3}}const d=new Set,f=[];for(const y of s){const v=(m=y.metadata)==null?void 0:m.workflows;if(Array.isArray(v))for(const C of v)typeof C=="string"&&!d.has(C)&&(d.add(C),f.push(C))}const p={runGroupId:((g=r.metadata)==null?void 0:g.runGroupId)??"",runCount:s.length,workflows:f.length>0?f:void 0,scorers:u};return{...r,_multiRun:{aggregate:p,allRuns:s}}}function au(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 uu(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 Nt(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 Wx(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 N2(s){var r;return Array.isArray((r=s.metadata)==null?void 0:r.models)?s.metadata.models.filter(i=>typeof i=="string"):[]}function ka(s){var r;return Array.isArray((r=s.metadata)==null?void 0:r.models)?s.metadata.models.filter(i=>typeof i=="string"):[]}function vl(s){var u;const r=(u=s.metadata)==null?void 0:u.modelCounts;if(!r||typeof r!="object")return null;const i={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(i[d]=f);return Object.keys(i).length>0?i:null}function Zs(s){var d,f;const r=(d=s._multiRun)==null?void 0:d.aggregate.workflows;if(Array.isArray(r)&&r.length>0){const p=r.filter(x=>typeof x=="string");if(p.length>0)return p}const i=(f=s.metadata)==null?void 0:f.workflows;if(Array.isArray(i)){const p=i.filter(x=>typeof x=="string");if(p.length>0)return p}const u=s.workflow;return typeof u=="string"&&u?[u]:[]}function Wd(s){var u;const r=(u=s.metadata)==null?void 0:u.workflowCounts;if(!r||typeof r!="object")return null;const i={};for(const[d,f]of Object.entries(r))typeof f=="number"&&(i[d]=f);return Object.keys(i).length>0?i:null}function vn(s){const r=s.indexOf(":");return r>=0?s.slice(r+1):s}function p0(s){var u;const r=(u=s.metadata)==null?void 0:u.tokens;if(!r||typeof r!="object")return null;const i=r;return typeof i.input!="number"?null:{input:i.input,output:typeof i.output=="number"?i.output:0,reasoning:typeof i.reasoning=="number"?i.reasoning:0}}function S2(s){var i;const r=(i=s.metadata)==null?void 0:i.agentCalls;return typeof r=="number"?r:0}function Id(s){const r={input:0,output:0,reasoning:0};for(const i of s.items){const u=p0(i);u&&(r.input+=u.input,r.output+=u.output,r.reasoning+=u.reasoning)}return r}function Cf(s){const r=new Map;for(const i of s){const u=i.data,d=vl(u);if(d)for(const[f,p]of Object.entries(d))r.set(f,(r.get(f)??0)+p);else for(const f of ka(u))r.set(f,(r.get(f)??0)+1)}return[...r.entries()].sort((i,u)=>u[1]-i[1])}function Ix(s){const r={input:0,output:0,reasoning:0};for(const i of s){const u=Id(i);r.input+=u.input,r.output+=u.output,r.reasoning+=u.reasoning}return r}function Px(s){return s.reduce((r,i)=>r+i.totalCost,0)}function w2({summary:s,items:r,totalCost:i,scorerTypes:u}){const d=s.scorers?Object.entries(s.scorers):[];return d.length===0&&!s.timing&&i<=0?null:a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Summary"})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsx("th",{className:"text-left px-4 py-2 font-medium w-48",children:"Metric"}),a.jsx("th",{className:"px-4 py-2 w-28"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Mean"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P50"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"P95"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Min"}),a.jsx("th",{className:"text-right px-3 py-2 font-medium",children:"Max"})]})}),a.jsxs("tbody",{children:[d.map(([f,p])=>{const x=r.some(m=>!m.error&&m.scores[f]!=null);return a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--foreground))]",children:[f,(u==null?void 0:u[f])==="llm"&&a.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"})]}),x?a.jsxs(a.Fragment,{children:[a.jsx("td",{className:"px-4 py-2.5",children:a.jsx("div",{className:"h-2 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:a.jsx("div",{className:W("h-full rounded-full transition-all",uu(p.mean)),style:{width:`${p.mean*100}%`}})})}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono font-medium",Nt(p.mean)),children:p.mean.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:p.p50.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:p.p95.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:p.min.toFixed(3)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:p.max.toFixed(3)})]}):a.jsx("td",{colSpan:6,className:"px-3 py-2.5 text-center text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]},f)}),s.timing&&a.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing"}),a.jsx("td",{className:"px-4 py-2.5"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.mean)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.p50)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.p95)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.min)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.max)})]})]})]})}),i>0&&a.jsx("div",{className:"px-4 py-2 border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Total cost: ",a.jsx("span",{className:"font-mono font-medium",children:lt(i)})]})})]})}function C2({items:s,scorerNames:r,onSelectItem:i,errorFilter:u,onErrorFilterChange:d,scorerFilter:f,onScorerFilterChange:p,threshold:x,onThresholdChange:m,sortField:g,onSortFieldChange:y,sortDir:v,onSortDirChange:C}){const T=x!==""?parseFloat(x):null,w=u!=="all"||f!==""&&T!=null&&!isNaN(T),A=b.useMemo(()=>s.map((N,S)=>({item:N,index:S})),[s]),O=b.useMemo(()=>{let N=A;return u==="errors"?N=N.filter(({item:S})=>!!S.error):u==="no-errors"&&(N=N.filter(({item:S})=>!S.error)),f&&T!=null&&!isNaN(T)&&(N=N.filter(({item:S})=>{const D=S.scores[f];return D!=null&&D<T})),N},[A,u,f,T]),z=b.useMemo(()=>{const N=[...O],S=v==="asc"?1:-1;return N.sort((D,U)=>{let B,q;return g==="index"?(B=D.index,q=U.index):g==="duration"?(B=D.item.duration??1/0,q=U.item.duration??1/0):g==="cost"?(B=D.item.cost??1/0,q=U.item.cost??1/0):(B=D.item.scores[g]??-1/0,q=U.item.scores[g]??-1/0),(B-q)*S}),N},[O,g,v]),K=[{value:"index",label:"Item #"},{value:"duration",label:"Duration"},{value:"cost",label:"Cost"},...r.map(N=>({value:N,label:N}))];return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"All Items"}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono tabular-nums",children:w?`${O.length} of ${s.length}`:String(s.length)}),w&&a.jsx("button",{onClick:()=>{d("all"),p(""),m("")},className:"text-xs text-[hsl(var(--primary))] hover:underline cursor-pointer",children:"Reset"})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs("select",{value:u,onChange:N=>d(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"all",children:"All"}),a.jsx("option",{value:"errors",children:"Errors"}),a.jsx("option",{value:"no-errors",children:"Passed"})]}),r.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("select",{value:f,onChange:N=>p(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"Score filter…"}),r.map(N=>a.jsx("option",{value:N,children:N},N))]}),f&&a.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",placeholder:"< threshold",value:x,onChange:N=>m(N.target.value),className:"w-20 px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]"})]}),a.jsx("div",{className:"w-px h-4 bg-[hsl(var(--border))]"}),a.jsx("select",{value:g,onChange:N=>y(N.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:K.map(N=>a.jsx("option",{value:N.value,children:N.label},N.value))}),a.jsx("button",{onClick:()=>C(v==="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:v==="asc"?"Ascending":"Descending",children:v==="asc"?"↑":"↓"})]})]}),z.length===0&&w&&a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))] py-6 text-center",children:"No items match the current filters."}),z.length>0&&a.jsx("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[a.jsx("th",{className:"text-left px-3 py-2.5 font-medium w-10",children:"#"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium min-w-[180px]",children:"Input"}),r.map(N=>a.jsx("th",{className:"text-right px-2 py-2.5 font-medium font-mono max-w-24 truncate",title:N,children:N},N)),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Duration"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium w-16",children:"Cost"}),a.jsx("th",{className:"w-8"})]})}),a.jsx("tbody",{children:z.map(({item:N,index:S})=>a.jsxs("tr",{onClick:()=>i(S),className:"border-t border-[hsl(var(--border))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors group",children:[a.jsxs("td",{className:"px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:[S+1,N.error&&a.jsx("span",{className:"ml-1 text-red-500",title:"Workflow error",children:"!"}),!N.error&&N.scorerErrors&&N.scorerErrors.length>0&&a.jsx("span",{className:"ml-1 text-amber-500",title:"Scorer errors",children:"!"})]}),a.jsx("td",{className:"px-3 py-2 max-w-xs",children:a.jsx("span",{className:"text-[11px] leading-tight text-[hsl(var(--muted-foreground))] truncate block group-hover:text-[hsl(var(--foreground))] transition-colors",children:or(N.input)==="[redacted]"?`Item ${S+1}`:or(N.input)})}),r.map(D=>{const U=N.scores[D];return a.jsx("td",{className:"text-right px-2 py-2 font-mono",children:U!=null?a.jsx("span",{className:W("font-medium tabular-nums",Nt(U)),children:U.toFixed(2)}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"—"})},D)}),a.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:N.duration!=null?ot(N.duration):"—"}),a.jsx("td",{className:"text-right px-3 py-2 font-mono text-[hsl(var(--muted-foreground))]",children:N.cost!=null&&N.cost>0?lt(N.cost):"—"}),a.jsx("td",{className:"px-2 py-2",children:a.jsx(qn,{size:12,className:"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60 transition-opacity"})})]},S))})]})})})]})}const eg=300;function E2({text:s}){const[r,i]=b.useState(!1),u=s.length>eg;return a.jsxs("div",{children:[a.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:u&&!r?s.slice(0,eg)+"…":s}),u&&a.jsx("button",{onClick:()=>i(!r),className:"text-xs text-[hsl(var(--primary))] hover:underline mt-1.5 cursor-pointer",children:r?"Show less":"Show more"})]})}function Ad({label:s,data:r}){return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))]/50 border-b border-[hsl(var(--border))]",children:a.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:s})}),a.jsx("div",{className:"p-4",children:a.jsx(qt,{data:r,collapsed:!0})})]})}function T2({traces:s}){const[r,i]=b.useState(!1);return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("button",{onClick:()=>i(u=>!u),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:[a.jsx("span",{className:W("text-[11px]",r?"rotate-0":"rotate-90"),children:"▶"}),a.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Trace"}),a.jsxs("span",{className:"text-[11px] text-[hsl(var(--muted-foreground))] ml-1",children:[s.length," event",s.length!==1?"s":""]})]}),!r&&a.jsx("div",{className:"p-2",children:a.jsx(wf,{events:s})})]})}function k2({item:s,itemIndex:r,scorerNames:i,onBack:u}){const d=s.scorerErrors??[],f=N2(s),p=p0(s),x=S2(s),m=s.cost??0,g=s.scorerCost??0,y=m+g;return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("nav",{className:"flex items-center gap-1.5 text-sm",children:[a.jsx("button",{onClick:u,className:"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:"Overview"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"/"}),a.jsxs("span",{className:"font-medium",children:["Item #",r+1]}),s.error&&a.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"})]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))] font-mono",children:[f.length>0&&f.map(v=>a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] text-[10px] font-medium",title:v,children:vn(v)},v)),p&&a.jsxs("span",{title:`Input: ${p.input.toLocaleString()} Output: ${p.output.toLocaleString()}${p.reasoning?` Reasoning: ${p.reasoning.toLocaleString()}`:""}`,children:[(p.input+p.output+p.reasoning).toLocaleString()," tok"]}),x>1&&a.jsxs("span",{title:`${x} agent calls for this item`,children:[x," calls"]}),s.duration!=null&&a.jsx("span",{children:ot(s.duration)}),y>0&&a.jsx("span",{children:lt(y)})]})]}),i.length>0&&a.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:i.map(v=>{const C=s.scores[v];return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:v}),C!=null?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-12 h-1.5 bg-[hsl(var(--secondary))] rounded-full overflow-hidden",children:a.jsx("div",{className:W("h-full rounded-full",uu(C)),style:{width:`${C*100}%`}})}),a.jsx("span",{className:W("text-xs font-mono font-medium tabular-nums",Nt(C)),children:C.toFixed(2)})]}):a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))] font-mono",children:"—"})]},v)})}),s.error&&a.jsx("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",children:s.error}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[a.jsx(Ad,{label:"Input",data:s.input}),a.jsx(Ad,{label:"Output",data:s.output})]}),s.annotations!=null&&a.jsx(Ad,{label:"Expected (Annotations)",data:s.annotations}),y>0&&m>0&&g>0&&a.jsxs("div",{className:"flex items-center gap-3 text-xs text-[hsl(var(--muted-foreground))] font-mono",children:[a.jsxs("span",{children:["Workflow: ",lt(m)]}),a.jsx("span",{children:"+"}),a.jsxs("span",{children:["Scoring: ",lt(g)]}),a.jsx("span",{children:"="}),a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:lt(y)})]}),s.traces&&s.traces.length>0&&a.jsx(T2,{traces:s.traces}),i.length>0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Scorer Results"}),i.map(v=>{var A;const C=s.scores[v],T=(A=s.scoreDetails)==null?void 0:A[v],w=d.find(O=>O.includes(`"${v}"`));return a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-[hsl(var(--muted))]/50",children:[a.jsx("span",{className:"font-mono text-xs font-medium",children:v}),C!=null&&a.jsx("span",{className:W("px-2 py-0.5 rounded-full text-xs font-mono font-medium",au(C)),children:C.toFixed(3)}),C==null&&!w&&a.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"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[(T==null?void 0:T.duration)!=null&&a.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",children:ot(T.duration)}),(T==null?void 0:T.cost)!=null&&T.cost>0&&a.jsx("span",{className:"text-xs font-mono text-[hsl(var(--muted-foreground))]",children:lt(T.cost)})]})]}),((T==null?void 0:T.metadata)||w)&&a.jsxs("div",{className:"px-4 py-3 space-y-2",children:[(T==null?void 0:T.metadata)&&typeof T.metadata.reasoning=="string"&&T.metadata.reasoning.length>0&&a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Reasoning"}),a.jsx(E2,{text:T.metadata.reasoning})]}),(T==null?void 0:T.metadata)&&(()=>{const O=Object.keys(T.metadata).filter(K=>K!=="reasoning");if(O.length===0)return null;const z={};for(const K of O)z[K]=T.metadata[K];return a.jsxs("div",{children:[a.jsx("span",{className:"text-[11px] font-medium text-[hsl(var(--muted-foreground))] block mb-1.5 uppercase tracking-wider",children:"Metadata"}),a.jsx(qt,{data:z,collapsed:!0})]})})(),w&&a.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})]})]},v)})]})]})}function M2(s,r){const i=r.map(u=>s.scores[u]).filter(u=>u!=null);return i.length===0?null:i.reduce((u,d)=>u+d,0)/i.length}function O2({items:s,scorerNames:r,selectedIndex:i,onSelectItem:u,onDeselectItem:d}){const f=b.useMemo(()=>s.map((x,m)=>({item:x,index:m,avg:M2(x,r),label:or(x.input,60)})),[s,r]),p=s.filter(x=>x.error).length;return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0 px-4 py-3 border-b border-[hsl(var(--border))]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("button",{onClick:d,className:W("text-xs font-medium transition-colors cursor-pointer",i==null?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:[s.length," items"]}),p>0?a.jsxs("span",{className:"text-[10px] font-medium text-red-600 dark:text-red-400",children:[p," failed"]}):a.jsx("span",{className:"text-[10px] font-medium text-emerald-600 dark:text-emerald-400",children:"all passed"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:f.map(({item:x,index:m,avg:g,label:y})=>{const v=i===m;return a.jsxs("button",{onClick:()=>u(m),className:W("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",v?"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:[a.jsx("span",{className:W("text-[10px] font-mono w-5 shrink-0",v?"text-[hsl(var(--foreground))] font-medium":"text-[hsl(var(--muted-foreground))]"),children:m+1}),a.jsx("span",{className:W("flex-1 text-xs truncate leading-snug",v?"text-[hsl(var(--foreground))]":"text-[hsl(var(--muted-foreground))] group-hover:text-[hsl(var(--foreground))]"),children:y}),x.error&&a.jsx("span",{className:"text-[10px] text-red-500 shrink-0",title:"Workflow error",children:"!"}),!x.error&&x.scorerErrors&&x.scorerErrors.length>0&&a.jsx("span",{className:"text-[10px] text-amber-500 shrink-0",title:"Scorer errors",children:"!"}),g!=null?a.jsx("span",{className:W("text-[11px] font-mono font-medium shrink-0 tabular-nums",Nt(g)),children:g.toFixed(2)}):a.jsx("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] shrink-0",children:"-"}),a.jsx(qn,{size:12,className:W("shrink-0 transition-all",v?"text-[hsl(var(--foreground))] opacity-100":"text-[hsl(var(--muted-foreground))] opacity-0 group-hover:opacity-60")})]},m)})})]})}function A2({name:s,scores:r,mean:i}){return r.length===0?a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-28 text-xs font-mono truncate text-[hsl(var(--muted-foreground))]",title:s,children:s}),a.jsx("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"No valid scores"})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"w-28 text-xs font-mono truncate",title:s,children:s}),a.jsxs("div",{className:"flex-1 h-5 relative bg-[hsl(var(--secondary))] rounded",children:[[.25,.5,.75].map(u=>a.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-[hsl(var(--border))]",style:{left:`${u*100}%`}},u)),r.map((u,d)=>a.jsx("div",{className:W("absolute w-1 top-[3px] bottom-[3px] rounded-sm",uu(u)),style:{left:`${Math.max(1,Math.min(99,u*100))}%`,transform:"translateX(-50%)",opacity:.45},title:u.toFixed(3)},d)),a.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-[hsl(var(--foreground))]",style:{left:`${i*100}%`,opacity:.3},title:`Mean: ${i.toFixed(3)}`})]}),a.jsx("span",{className:"w-12 text-xs font-mono text-right text-[hsl(var(--muted-foreground))] tabular-nums",children:i.toFixed(3)})]})}function R2({items:s,scorerNames:r}){const i=b.useMemo(()=>r.map(u=>{const d=[];for(const p of s){const x=p.scores[u];x!=null&&!p.error&&d.push(x)}const f=d.length>0?d.reduce((p,x)=>p+x,0)/d.length:0;return{name:u,scores:d,mean:f}}),[s,r]);return r.length===0?null:a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Score Distribution"})}),a.jsxs("div",{className:"p-4 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[a.jsx("span",{className:"w-28"}),a.jsxs("div",{className:"flex-1 flex justify-between text-[10px] font-mono text-[hsl(var(--muted-foreground))]",children:[a.jsx("span",{children:"0"}),a.jsx("span",{children:"0.25"}),a.jsx("span",{children:"0.5"}),a.jsx("span",{children:"0.75"}),a.jsx("span",{children:"1.0"})]}),a.jsx("span",{className:"w-12"})]}),i.map(u=>a.jsx(A2,{name:u.name,scores:u.scores,mean:u.mean},u.name))]})]})}function Vo({field:s,current:r,dir:i,onSort:u,align:d,className:f,children:p}){const x=r===s;return a.jsxs("th",{className:W(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:()=>u(s),children:[p,x&&a.jsx("span",{className:"ml-0.5",children:i==="desc"?"▼":"▲"})]})}function _2({baseline:s,candidate:r,scorerNames:i,baselineRuns:u,candidateRuns:d,scorerTypes:f}){const[p,x]=b.useState(i[0]??""),[m,g]=b.useState("delta"),[y,v]=b.useState("desc"),[C,T]=b.useState(!1),w=u&&u.length>1||d&&d.length>1,A=(u==null?void 0:u.length)??1,O=(d==null?void 0:d.length)??1,[z,K]=b.useState(null),N=U=>{m===U?v(B=>B==="desc"?"asc":"desc"):(g(U),v(U==="index"?"asc":"desc"))},S=Math.min(s.items.length,r.items.length),D=b.useMemo(()=>{var q,Z,J,ne;const U=[],B=Math.min((u==null?void 0:u.length)??0,(d==null?void 0:d.length)??0);for(let Q=0;Q<S;Q++){const $=s.items[Q].scores[p]??null,re=r.items[Q].scores[p]??null,le=$!=null&&re!=null?re-$:0;let _;if(B>1){_=[];for(let F=0;F<B;F++){const ie=(Z=(q=u[F])==null?void 0:q.items[Q])==null?void 0:Z.scores[p],he=(ne=(J=d[F])==null?void 0:J.items[Q])==null?void 0:ne.scores[p];ie!=null&&he!=null&&_.push(he-ie)}}U.push({index:Q,input:s.items[Q].input,baselineScore:$,candidateScore:re,delta:le,runDeltas:_})}return U.sort((Q,$)=>{let re,le;switch(m){case"index":re=Q.index,le=$.index;break;case"baseline":re=Q.baselineScore??-1,le=$.baselineScore??-1;break;case"candidate":re=Q.candidateScore??-1,le=$.candidateScore??-1;break;case"delta":default:re=Math.abs(Q.delta),le=Math.abs($.delta);break}return y==="desc"?le-re:re-le}),U},[s,r,p,m,y,S,u,d]);return i.length===0||S===0?null:a.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>T(U=>!U),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:[C?a.jsx(qn,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}):a.jsx(xl,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"}),a.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["All Items (",S,")",w&&a.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," scores averaged across"," ",A===O?`${A} runs`:`${A} / ${O} runs`]})]})]}),!C&&a.jsxs("div",{children:[a.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:i.map(U=>a.jsxs("button",{onClick:()=>x(U),className:W("px-2 py-1 text-[11px] font-mono rounded-md transition-colors cursor-pointer",p===U?"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:[U,(f==null?void 0:f[U])==="llm"&&a.jsx("span",{className:"ml-1 text-[8px] opacity-70",children:"LLM"})]},U))}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsx(Vo,{field:"index",current:m,dir:y,onSort:N,align:"left",className:"w-10",children:"#"}),a.jsx("th",{className:"text-left px-3 py-2 font-medium",children:"Input"}),a.jsxs(Vo,{field:"baseline",current:m,dir:y,onSort:N,align:"right",children:["Baseline",w&&A>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",A,")"]})]}),a.jsxs(Vo,{field:"candidate",current:m,dir:y,onSort:N,align:"right",children:["Candidate",w&&O>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",O,")"]})]}),a.jsx(Vo,{field:"delta",current:m,dir:y,onSort:N,align:"right",children:"Delta"})]})}),a.jsx("tbody",{children:D.map(U=>{const B=z===U.index,q=U.delta>0?"text-emerald-600 dark:text-emerald-400":U.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return a.jsxs("tr",{className:W("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:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",onClick:()=>K(B?null:U.index),children:U.index+1}),a.jsx("td",{className:"px-3 py-2.5 max-w-xs truncate",onClick:()=>K(B?null:U.index),children:or(U.input)}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",U.baselineScore!=null?Nt(U.baselineScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>K(B?null:U.index),children:U.baselineScore!=null?U.baselineScore.toFixed(3):"—"}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",U.candidateScore!=null?Nt(U.candidateScore):"text-[hsl(var(--muted-foreground))]"),onClick:()=>K(B?null:U.index),children:U.candidateScore!=null?U.candidateScore.toFixed(3):"—"}),a.jsxs("td",{className:W("px-3 py-2.5 text-right",q),onClick:()=>K(B?null:U.index),children:[a.jsx("div",{className:"font-mono",children:U.delta!==0?`${U.delta>0?"+":""}${U.delta.toFixed(3)}`:"—"}),U.runDeltas&&U.runDeltas.length>1&&a.jsxs("div",{className:"flex items-center justify-end gap-0.5 mt-1",title:U.runDeltas.map((Z,J)=>`Run ${J+1}: ${Z>=0?"+":""}${Z.toFixed(3)}`).join(", "),children:[U.runDeltas.map((Z,J)=>a.jsx("div",{className:W("w-1.5 h-1.5 rounded-full",Z<0?"bg-red-500 dark:bg-red-400":Z>0?"bg-emerald-500 dark:bg-emerald-400":"bg-[hsl(var(--muted-foreground))]")},J)),a.jsxs("span",{className:"text-[9px] text-[hsl(var(--muted-foreground))] ml-0.5",children:[U.runDeltas.filter(Z=>U.delta<0?Z<0:Z>0).length,"/",U.runDeltas.length]})]})]})]},U.index)})})]})}),z!=null&&z<s.items.length&&z<r.items.length&&a.jsx(x0,{baselineItem:s.items[z],candidateItem:r.items[z],scorer:p,baselineRunItems:u==null?void 0:u.map(U=>U.items[z]).filter(Boolean),candidateRunItems:d==null?void 0:d.map(U=>U.items[z]).filter(Boolean)})]})]})}function z2({text:s,children:r}){return a.jsxs("span",{className:"relative group/tip cursor-help",children:[r,a.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 tg({value:s,percent:r,invert:i,format:u}){const d=i?s<0:s>0,f=i?s>0:s<0,p=d?"text-emerald-600 dark:text-emerald-400":f?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]",x=u?`${s>0?"+":s<0?"-":""}${u(Math.abs(s))}`:`${s>0?"+":""}${Math.abs(s)<100?s.toFixed(3):s.toFixed(0)}`,m=`${r>0?"+":""}${r.toFixed(1)}%`;return a.jsx("td",{className:W("px-3 py-2.5 text-right",p),children:a.jsxs("div",{className:"font-mono",children:[x," (",m,")"]})})}function ng(s){return(s>=0?"+":"")+s.toFixed(4)}function D2({compareResult:s,baseline:r,candidate:i,isGroupComparison:u,baselineRuns:d,candidateRuns:f}){var J,ne;const[p,x]=b.useState(null),[m,g]=b.useState("delta"),[y,v]=b.useState("desc"),[C,T]=b.useState({}),w=(Q,$)=>{(p==null?void 0:p.type)===Q&&(p==null?void 0:p.index)===$?x(null):x({type:Q,index:$})},A=((J=r==null?void 0:r.metadata)==null?void 0:J.scorerTypes)??((ne=i==null?void 0:i.metadata)==null?void 0:ne.scorerTypes),O=(d==null?void 0:d.length)??1,z=(f==null?void 0:f.length)??1,K=u?`averaged across ${O===z?`${O} runs`:`${O} / ${z} runs`}`:null,N=b.useMemo(()=>{const Q=Object.entries(s.scorers);return Q.sort(($,re)=>{if(m==="delta"){const F=$[1].significant===!0?1:0,ie=re[1].significant===!0?1:0;if(F!==ie)return ie-F}let le,_;switch(m){case"metric":return y==="asc"?$[0].localeCompare(re[0]):re[0].localeCompare($[0]);case"baseline":le=$[1].baselineMean,_=re[1].baselineMean;break;case"candidate":le=$[1].candidateMean,_=re[1].candidateMean;break;case"delta":default:le=Math.abs($[1].delta),_=Math.abs(re[1].delta);break}return y==="desc"?_-le:le-_}),Q},[s.scorers,m,y]),S=N.some(([,Q])=>Q.ci!=null),D=Q=>{m===Q?v($=>$==="desc"?"asc":"desc"):(g(Q),v("desc"))},U=Q=>m===Q?y==="desc"?" ▼":" ▲":"",B=N.filter(([,Q])=>Q.significant===!0).length,q=s.regressions.length,Z=s.improvements.length;return a.jsxs("div",{className:"space-y-6",children:[N.length>0&&(()=>{const Q=N.some(([,F])=>F.significant===!0&&F.delta<0),$=N.some(([,F])=>F.significant===!0&&F.delta>0),re=s.regressions.length>0,le=N.every(([,F])=>F.significant===!1),_=(F,ie)=>{const he=ie.delta<0?ie.pRegression!=null?`${Math.round(ie.pRegression*100)}%`:null:ie.pImprovement!=null?`${Math.round(ie.pImprovement*100)}%`:null,pe=`${ie.delta>0?"+":""}${ie.delta.toFixed(3)}`;return`${F} ${pe}${he?` (${he} probability)`:""}`};if(Q){const F=N.filter(([,ie])=>ie.significant===!0&&ie.delta<0);return a.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:[a.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:a.jsx("span",{className:"text-red-600 dark:text-red-400 text-xs font-bold",children:"✕"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:"Significant regression detected"}),a.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-0.5",children:F.map(([ie,he])=>_(ie,he)).join("; ")})]})]})}if($){const F=N.filter(([,ie])=>ie.significant===!0&&ie.delta>0);return a.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:[a.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:a.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-emerald-800 dark:text-emerald-200",children:"Significant improvement detected"}),a.jsx("p",{className:"text-xs text-emerald-600 dark:text-emerald-400 mt-0.5",children:F.map(([ie,he])=>_(ie,he)).join("; ")})]})]})}return re&&le?a.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:[a.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:a.jsx("span",{className:"text-amber-600 dark:text-amber-400 text-xs font-bold",children:"~"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:[s.regressions.length," item regressions, but not statistically significant"]}),a.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:u?"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."})]})]}):a.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:[a.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:a.jsx("span",{className:"text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:"✓"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:"No significant changes"}),a.jsx("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:"Scores are stable between baseline and candidate"})]})]})})(),(()=>{const Q=(Se,Rt)=>{const In=Rt&&Rt.length>0?Rt:Se?[Se]:[],An=new Set;for(const Bn of In)for(const bl of ka(Bn))An.add(bl);return[...An]},$=d&&d.length>0?d:r?[r]:[],re=f&&f.length>0?f:i?[i]:[],le=(Se,Rt)=>{const In=Rt&&Rt.length>0?Rt:Se?[Se]:[],An=new Set,Bn=[];for(const bl of In)for(const Kt of Zs(bl))An.has(Kt)||(An.add(Kt),Bn.push(Kt));return Bn},_=Q(r,d),F=Q(i,f),ie=le(r,d),he=le(i,f),pe=Ix($),E=Ix(re),H=pe.input+pe.output+pe.reasoning,I=E.input+E.output+E.reasoning,oe=Px($),de=Px(re),ye=ie.length>0||he.length>0,ce=new Set(ie),we=new Set(he),ke=ce.size!==we.size||ie.some(Se=>!we.has(Se)),ft=_.length>0||F.length>0,Yt=H>0&&I>0,rn=oe>0||de>0;if(!ye&&!ft&&!Yt&&!rn)return null;const on=new Set(_),Ot=new Set(F),nt=on.size!==Ot.size||_.some(Se=>!Ot.has(Se)),At=H>0?(I-H)/H*100:0;return a.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:[ye&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:ie.length>1||he.length>1?"Workflows":"Workflow"}),a.jsx("div",{className:"flex items-center gap-1.5",children:ie.length>0?ie.map(Se=>a.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:Se,children:Se},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("div",{className:"flex items-center gap-1.5",children:he.length>0?he.map(Se=>a.jsx("span",{className:W("px-1.5 py-0.5 rounded font-mono",ke?"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:Se,children:Se},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),ke&&a.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),ft&&a.jsxs(a.Fragment,{children:[ye&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Models"}),a.jsx("div",{className:"flex items-center gap-1.5",children:_.length>0?_.map(Se=>a.jsx("span",{className:"px-1.5 py-0.5 rounded border border-[hsl(var(--border))] bg-[hsl(var(--background))] font-mono",title:Se,children:vn(Se)},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("div",{className:"flex items-center gap-1.5",children:F.length>0?F.map(Se=>a.jsx("span",{className:W("px-1.5 py-0.5 rounded font-mono",nt?"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:Se,children:vn(Se)},Se)):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] italic",children:"unknown"})}),nt&&a.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400",children:"changed"})]}),Yt&&a.jsxs(a.Fragment,{children:[ft&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Tokens"}),a.jsx("span",{className:"font-mono",children:H.toLocaleString()}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("span",{className:"font-mono",children:I.toLocaleString()}),Math.abs(At)>=1&&a.jsxs("span",{className:W("text-[10px] font-medium",At>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[At>0?"+":"",At.toFixed(0),"%"]})]}),rn&&a.jsxs(a.Fragment,{children:[(ft||Yt)&&a.jsx("span",{className:"text-[hsl(var(--border))]",children:"|"}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px] font-medium shrink-0",children:"Cost"}),a.jsx("span",{className:"font-mono",children:lt(oe)}),a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"→"}),a.jsx("span",{className:"font-mono",children:lt(de)}),oe>0&&de>0&&(()=>{const Se=(de-oe)/oe*100;return Math.abs(Se)>=1?a.jsxs("span",{className:W("text-[10px] font-medium",Se>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"),children:[Se>0?"+":"",Se.toFixed(0),"%"]}):null})()]})]})})(),a.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Significant"}),a.jsx("div",{className:"text-lg font-semibold mt-0.5",children:B})]}),a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Regressions"}),a.jsx("div",{className:W("text-lg font-semibold mt-0.5",q>0?"text-red-600 dark:text-red-400":""),children:q})]}),a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Improvements"}),a.jsx("div",{className:W("text-lg font-semibold mt-0.5",Z>0?"text-emerald-600 dark:text-emerald-400":""),children:Z})]}),s.cost&&a.jsxs("div",{className:"px-3 py-2 rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Cost Delta"}),a.jsxs("div",{className:W("text-lg font-semibold mt-0.5",s.cost.delta>0?"text-red-600 dark:text-red-400":s.cost.delta<0?"text-emerald-600 dark:text-emerald-400":""),children:[s.cost.delta>0?"+":"",lt(Math.abs(s.cost.delta))]})]})]}),N.length>0&&a.jsxs("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Scorer Comparison",K&&a.jsxs("span",{className:"normal-case tracking-normal font-normal ml-1.5 opacity-70",children:["—"," ",K]})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsxs("th",{className:"text-left px-4 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>D("metric"),children:["Metric",U("metric")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>D("baseline"),children:["Baseline",u&&O>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",O,")"]}),U("baseline")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>D("candidate"),children:["Candidate",u&&z>1&&a.jsxs("span",{className:"font-normal opacity-60 ml-0.5",children:["(",z,")"]}),U("candidate")]}),a.jsx("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>D("delta"),children:S?a.jsxs(z2,{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).",children:["Delta",U("delta")]}):a.jsxs(a.Fragment,{children:["Delta",U("delta")]})})]})}),a.jsxs("tbody",{children:[N.map(([Q,$])=>{const re=$.delta>0?"+":($.delta<0,""),le=$.delta>0?"text-emerald-600 dark:text-emerald-400":$.delta<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";return a.jsxs("tr",{className:W("border-b border-[hsl(var(--border))] last:border-b-0",$.significant===!0&&$.delta<0&&"border-l-[3px] border-l-red-500",$.significant===!0&&$.delta>0&&"border-l-[3px] border-l-emerald-500"),children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[Q,(A==null?void 0:A[Q])==="llm"&&a.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"})]}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",Nt($.baselineMean)),children:$.baselineMean.toFixed(3)}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",Nt($.candidateMean)),children:$.candidateMean.toFixed(3)}),a.jsxs("td",{className:"px-3 py-2.5 text-right",children:[a.jsxs("div",{className:W("font-mono",le),children:[re,Math.abs($.delta).toFixed(3)," (",re,Math.abs($.deltaPercent).toFixed(1),"%)"]}),$.ci&&a.jsxs("div",{className:"font-mono text-[10px] text-[hsl(var(--muted-foreground))] mt-0.5",children:["CI [",ng($.ci.lower),", ",ng($.ci.upper),"]"]}),$.pRegression!=null&&$.pImprovement!=null&&(()=>{const _=$.pRegression??0,F=$.pImprovement??0;if(_===0&&F===0)return null;let ie,he,pe;if(_>F)he=_,ie="regression",pe=Math.round(he*100)>=95?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]";else if(F>_)he=F,ie="improvement",pe=Math.round(he*100)>=95?"text-emerald-600 dark:text-emerald-400":"text-[hsl(var(--muted-foreground))]";else return null;const E=Math.round(he*100);return a.jsxs("div",{className:W("text-[10px] mt-0.5",pe),children:[E,"% probability of ",ie,$.n!=null&&a.jsxs("span",{className:"opacity-60 ml-1",children:["(n=",$.n,")"]})]})})()]})]},Q)}),s.timing&&a.jsxs("tr",{className:"border-t-2 border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Timing (mean)"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.baselineMean)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ot(s.timing.candidateMean)}),a.jsx(tg,{value:s.timing.delta,percent:s.timing.deltaPercent,invert:!0,format:ot})]}),s.cost!=null&&a.jsxs("tr",{className:"border-t border-[hsl(var(--border))]",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-[hsl(var(--muted-foreground))]",children:"Cost (total)"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:lt(s.cost.baselineTotal)}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:lt(s.cost.candidateTotal)}),a.jsx(tg,{value:s.cost.delta,percent:s.cost.deltaPercent,invert:!0,format:lt})]})]})]})})]}),[{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(Q=>Q.items.length>0).map(Q=>{const $=d&&f&&d.length>1,re=$?Math.min(d.length,f.length):0,le=Q.items.map((ce,we)=>{var ft,Yt,rn,on;let ke=0;if($)for(let Ot=0;Ot<re;Ot++){const nt=(Yt=(ft=d[Ot])==null?void 0:ft.items[ce.itemIndex])==null?void 0:Yt.scores[ce.scorer],At=(on=(rn=f[Ot])==null?void 0:rn.items[ce.itemIndex])==null?void 0:on.scores[ce.scorer];nt!=null&&At!=null&&(Q.direction<0?At<nt:At>nt)&&ke++}return{...ce,originalIndex:we,consistentCount:ke,totalRuns:re}});$?le.sort((ce,we)=>we.consistentCount-ce.consistentCount||Math.abs(we.delta)-Math.abs(ce.delta)):le.sort((ce,we)=>Math.abs(we.delta)-Math.abs(ce.delta));const _=[...new Set(Q.items.map(ce=>ce.scorer))],F=_.length===1?_[0]:null,ie=new Map;for(const ce of le)ie.has(ce.scorer)||ie.set(ce.scorer,[]),ie.get(ce.scorer).push(ce);const he=ce=>{const we=(p==null?void 0:p.type)===Q.type&&p.index===ce.originalIndex,ke=r==null?void 0:r.items[ce.itemIndex],ft=i==null?void 0:i.items[ce.itemIndex],Yt=ce.input?or(ce.input,40):`Item #${ce.itemIndex+1}`,rn=$?ce.consistentCount===re?"":ce.consistentCount===0?"opacity-40":"opacity-65":"";return a.jsxs("div",{className:rn,children:[a.jsxs("button",{onClick:()=>w(Q.type,ce.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:[$&&a.jsxs("span",{className:W("shrink-0 text-[10px] font-mono font-medium px-1.5 py-0.5 rounded",ce.consistentCount===re?Q.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:[ce.consistentCount,"/",re]}),a.jsxs("span",{className:"min-w-0 truncate flex-1",children:[a.jsxs("span",{className:"font-mono text-[hsl(var(--muted-foreground))]",children:["#",ce.itemIndex+1]})," ",a.jsx("span",{children:Yt})]}),a.jsxs("span",{className:W("font-mono shrink-0",Q.deltaColor),children:[ce.baselineScore.toFixed(2)," ","→"," ",ce.candidateScore.toFixed(2)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",ce.delta>0?"+":"",ce.delta.toFixed(2),")"]})]})]}),we&&ke&&ft&&a.jsx(x0,{baselineItem:ke,candidateItem:ft,scorer:ce.scorer,baselineRunItems:d==null?void 0:d.map(on=>on.items[ce.itemIndex]).filter(Boolean),candidateRunItems:f==null?void 0:f.map(on=>on.items[ce.itemIndex]).filter(Boolean)})]},ce.originalIndex)},pe=5;let E,H;if($){const ce=Math.ceil(re/2);E=le.filter(we=>we.consistentCount>=ce),H=le.filter(we=>we.consistentCount<ce)}else E=le.slice(0,pe),H=le.slice(pe);const I=C[Q.type]??!1,oe=$?`${H.length} likely noise (minority of runs)`:`${H.length} more`,de=ce=>{const we=new Map;for(const ke of ce)we.has(ke.scorer)||we.set(ke.scorer,[]),we.get(ke.scorer).push(ke);return we},ye=ce=>{if(F)return a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:ce.map(he)});const we=de(ce);return a.jsx("div",{children:[...we.entries()].map(([ke,ft])=>a.jsxs("div",{children:[a.jsxs("div",{className:W("px-4 py-2 border-b border-t border-[hsl(var(--border))]",Q.type==="regression"?"bg-red-50/30 dark:bg-red-950/5":"bg-emerald-50/30 dark:bg-emerald-950/5"),children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ke}),a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-1.5",children:["(",ft.length,")"]})]}),a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:ft.map(he)})]},ke))})};return a.jsxs("div",{className:W("border rounded-lg overflow-hidden",Q.borderColor),children:[a.jsx("div",{className:W("px-4 py-2.5 border-b",Q.bgColor,Q.borderColor),children:a.jsxs("h3",{className:W("text-xs font-medium",Q.textColor),children:[Q.label," (",E.length,H.length>0?` + ${H.length} noise`:"",")",K&&a.jsxs("span",{className:"font-normal opacity-70 ml-1",children:[" — ","scores ",K]})]})}),E.length>0?ye(E):a.jsxs("div",{className:"px-4 py-3 text-xs text-[hsl(var(--muted-foreground))]",children:["No reliable ",Q.label.toLowerCase()," detected (all within noise)."]}),H.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>T(ce=>({...ce,[Q.type]:!I})),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:[I?a.jsx(dj,{className:"h-3 w-3"}):a.jsx(xl,{className:"h-3 w-3"}),I?"Hide":"Show"," ",oe]}),I&&ye(H)]})]},Q.type)}),r&&i&&a.jsx(_2,{baseline:r,candidate:i,scorerNames:N.map(([Q])=>Q),baselineRuns:d??void 0,candidateRuns:f??void 0,scorerTypes:A})]})}function ag({label:s,item:r,scorer:i}){var f,p;const u=(f=r.scoreDetails)==null?void 0:f[i],d=typeof((p=u==null?void 0:u.metadata)==null?void 0:p.reasoning)=="string"?u.metadata.reasoning:null;return a.jsxs("div",{className:"p-4 space-y-3",children:[a.jsx("h5",{className:"font-medium text-[hsl(var(--muted-foreground))] uppercase tracking-wider text-[10px]",children:s}),a.jsx(qt,{data:r.output,collapsed:!0}),(u==null?void 0:u.score)!=null&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Score:"}),a.jsx("span",{className:W("px-2 py-0.5 rounded-full font-mono font-medium",au(u.score)),children:u.score.toFixed(3)})]}),d&&a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Reasoning"}),a.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 x0({baselineItem:s,candidateItem:r,scorer:i,baselineRunItems:u,candidateRunItems:d}){var T,w,A,O;const[f,p]=b.useState(0),x=u&&u.length>1||d&&d.length>1,m=Math.max((u==null?void 0:u.length)??1,(d==null?void 0:d.length)??1),g=x&&u?u[f]??s:s,y=x&&d?d[f]??r:r,v=(w=(T=s.scoreDetails)==null?void 0:T[i])==null?void 0:w.score,C=(O=(A=r.scoreDetails)==null?void 0:A[i])==null?void 0:O.score;return a.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[x&&(v!=null||C!=null)&&a.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:[a.jsxs("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:["Mean across ",m," runs"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[v!=null&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Baseline:"}),a.jsx("span",{className:W("font-mono font-medium",Nt(v)),children:v.toFixed(3)})]}),C!=null&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"Candidate:"}),a.jsx("span",{className:W("font-mono font-medium",Nt(C)),children:C.toFixed(3)})]}),v!=null&&C!=null&&a.jsxs("span",{className:W("font-mono",C-v>0?"text-emerald-600 dark:text-emerald-400":C-v<0?"text-red-600 dark:text-red-400":"text-[hsl(var(--muted-foreground))]"),children:["(",C-v>0?"+":"",(C-v).toFixed(3),")"]})]})]}),x&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),a.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:m},(z,K)=>a.jsx("button",{onClick:()=>p(K),className:W("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",K===f?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:K+1},K))}),a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))] ml-auto",children:["Showing output and reasoning from run ",f+1," of ",m]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsx("div",{className:"border-r border-[hsl(var(--border))]",children:a.jsx(ag,{label:"Baseline",item:g,scorer:i})}),a.jsx(ag,{label:"Candidate",item:y,scorer:i})]})]})}function lu(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 Ef(s){return s.data.dataset??""}function U2(s){var r;return(r=s.data.metadata)==null?void 0:r.runGroupId}function L2(s){var d;const r=new Map,i=[];for(const f of s){const p=U2(f);p?(r.has(p)||r.set(p,[]),r.get(p).push(f)):i.push(f)}const u=[];for(const[f,p]of r){if(p.length===1){i.push(p[0]);continue}const x=p[0].data,m=Object.keys(((d=x.summary)==null?void 0:d.scorers)??{}),g={};for(const y of m){const v=p.map(C=>{var T,w,A;return((A=(w=(T=C.data.summary)==null?void 0:T.scorers)==null?void 0:w[y])==null?void 0:A.mean)??0});g[y]={mean:v.reduce((C,T)=>C+T,0)/v.length}}u.push({type:"group",groupId:f,entries:p.sort((y,v)=>v.timestamp-y.timestamp),evalName:p[0].eval,timestamp:Math.max(...p.map(y=>y.timestamp)),dataset:Ef(p[0]),runCount:p.length,aggregateScorers:g})}for(const f of i)u.push({type:"single",entry:f});return u.sort((f,p)=>{const x=f.type==="group"?f.timestamp:f.entry.timestamp;return(p.type==="group"?p.timestamp:p.entry.timestamp)-x}),u}function Tf({scorers:s}){const r=Object.entries(s);return r.length===0?null:a.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:r.map(([i,u])=>a.jsx("div",{className:"relative h-3.5 w-4 rounded-sm bg-[hsl(var(--muted))] overflow-hidden",title:`${i}: ${u.mean.toFixed(3)}`,children:a.jsx("div",{className:W("absolute bottom-0 left-0 right-0 rounded-sm",uu(u.mean)),style:{height:`${Math.max(0,Math.min(100,u.mean*100))}%`}})},i))})}function Pd({data:s}){var u;const r=(u=s.summary)==null?void 0:u.scorers;if(!r)return null;const i={};for(const[d,f]of Object.entries(r))i[d]={mean:f.mean};return a.jsx(Tf,{scorers:i})}function H2({selection:s,history:r,pickerItems:i,placeholder:u}){if(!s)return a.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:u});if(s.groupIds&&s.groupIds.length>1){const m=i.find(g=>g.type==="group"&&g.entries.some(y=>y.id===s.id));if(m&&m.type==="group"){const g=Cf(m.entries);return a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx(Tf,{scorers:m.aggregateScorers}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:m.evalName}),a.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:[a.jsx(vf,{className:"h-2.5 w-2.5"}),m.runCount," runs"]}),g.map(([y,v])=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${y} — ${v} calls`,children:[vn(y)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",v,")"]})]},y))]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx(Bx,{className:"h-2.5 w-2.5"}),lu(m.timestamp)]})]})]})}}const d=r.find(m=>m.id===s.id);if(!d)return a.jsx("span",{className:"text-sm text-[hsl(var(--muted-foreground))]",children:u});const f=d.data,p=ka(f),x=vl(f);return a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx(Pd,{data:f}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-sm font-medium truncate",children:d.eval}),p.map(m=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:x?`${m} — ${x[m]} calls`:m,children:[vn(m),x&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" (",x[m],")"]})]},m))]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsx(Bx,{className:"h-2.5 w-2.5"}),lu(d.timestamp),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"font-mono",children:d.id.slice(0,8)})]})]})]})}function lg({label:s,selection:r,pickerItems:i,disabledSelection:u,history:d,onChange:f,filterDataset:p}){const[x,m]=b.useState(!1),[g,y]=b.useState(null),v=b.useRef(null);b.useEffect(()=>{function w(A){v.current&&!v.current.contains(A.target)&&(m(!1),y(null))}return x&&document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[x]);const C=p?i.filter(w=>w.type==="group"?w.dataset===p:Ef(w.entry)===p):i,T=new Set((u==null?void 0:u.groupIds)??(u?[u.id]:[]));return a.jsxs("div",{ref:v,className:"flex-1 min-w-0 relative",children:[a.jsx("label",{className:"block text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))] mb-1.5",children:s}),a.jsxs("button",{onClick:()=>{m(!x),y(null)},className:W("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",x?"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:[a.jsx(H2,{selection:r,history:d,pickerItems:i,placeholder:`Select ${s.toLowerCase()}...`}),a.jsx(xl,{className:W("h-3.5 w-3.5 shrink-0 text-[hsl(var(--muted-foreground))] transition-transform",x&&"rotate-180")})]}),x&&a.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:C.length===0?a.jsx("div",{className:"px-3 py-4 text-xs text-center text-[hsl(var(--muted-foreground))]",children:"No matching runs"}):C.map(w=>{var N;if(w.type==="group"){const S=g===w.groupId,D=(N=r==null?void 0:r.groupIds)==null?void 0:N.some(U=>w.entries.some(B=>B.id===U));return a.jsxs("div",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("div",{className:"flex items-stretch",children:[a.jsxs("button",{onClick:()=>{f({id:w.entries[0].id,groupIds:w.entries.map(U=>U.id)}),m(!1),y(null)},className:W("flex-1 text-left px-3 py-2.5 flex items-center gap-2.5 transition-colors cursor-pointer",D?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]"),children:[a.jsx(Tf,{scorers:w.aggregateScorers}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium truncate",children:w.evalName}),a.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:[a.jsx(vf,{className:"h-2 w-2"}),w.runCount," runs"]}),Cf(w.entries).map(([U,B])=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:`${U} — ${B} calls`,children:[vn(U)," ",a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:["(",B,")"]})]},U))]}),a.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[lu(w.timestamp),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),"pooled comparison"]})]}),D&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]}),a.jsx("button",{onClick:U=>{U.stopPropagation(),y(S?null:w.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:S?"Hide individual runs":"Show individual runs",children:S?a.jsx(xl,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"}):a.jsx(qn,{className:"h-3 w-3 text-[hsl(var(--muted-foreground))]"})})]}),S&&w.entries.map(U=>{var J;const B=U.data,q=(r==null?void 0:r.id)===U.id&&!(r!=null&&r.groupIds),Z=T.has(U.id);return a.jsxs("button",{onClick:()=>{f({id:U.id}),m(!1),y(null)},disabled:Z,className:W("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",q?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",Z&&"opacity-30 cursor-not-allowed"),children:[a.jsx(Pd,{data:B}),a.jsx("div",{className:"min-w-0 flex-1",children:a.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[hsl(var(--muted-foreground))]",children:[a.jsxs("span",{children:["Run ",(((J=B.metadata)==null?void 0:J.runIndex)??0)+1]}),a.jsx("span",{className:"opacity-50",children:"·"}),a.jsx("span",{className:"font-mono",children:U.id.slice(0,8)}),(()=>{const ne=vl(B);return ka(B).map(Q=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[9px]",title:ne?`${Q} — ${ne[Q]} calls`:Q,children:[vn(Q),ne&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",ne[Q],")"]})]},Q))})()]})}),q&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},U.id)})]},w.groupId)}const{entry:A}=w,O=A.data,z=(r==null?void 0:r.id)===A.id,K=T.has(A.id);return a.jsxs("button",{onClick:()=>{f({id:A.id}),m(!1),y(null)},disabled:K,className:W("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",z?"bg-[hsl(var(--accent))]":"hover:bg-[hsl(var(--accent))]",K&&"opacity-30 cursor-not-allowed"),children:[a.jsx(Pd,{data:O}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-xs font-medium truncate",children:A.eval}),(()=>{const S=vl(O);return ka(O).map(D=>a.jsxs("span",{className:"px-1 py-0.5 rounded bg-[hsl(var(--secondary))] font-mono text-[9px]",title:S?`${D} — ${S[D]} calls`:D,children:[vn(D),S&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" ","(",S[D],")"]})]},D))})()]}),a.jsxs("div",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[lu(A.timestamp),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),a.jsx("span",{className:"font-mono",children:A.id.slice(0,8)}),a.jsxs("span",{className:"opacity-50",children:[" ","·"," "]}),O.summary.count," items"]})]}),z&&a.jsx("div",{className:"shrink-0 h-1.5 w-1.5 rounded-full bg-[hsl(var(--foreground))]"})]},A.id)})})]})}function q2({history:s,baselineSelection:r,candidateSelection:i,onBaselineChange:u,onCandidateChange:d,onCompare:f,comparing:p}){const x=b.useMemo(()=>L2(s),[s]),m=r?s.find(v=>v.id===r.id):null,g=m?Ef(m):null,y=r!=null&&i!=null&&r.id!==i.id&&!p;return a.jsx("div",{className:"space-y-3",children:a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx(lg,{label:"Baseline",selection:r,pickerItems:x,disabledSelection:i,history:s,onChange:u,filterDataset:null}),a.jsx("button",{onClick:()=>{if(r&&i){const v=r;u(i),d(v)}},disabled:!r||!i,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:a.jsx(I1,{className:"h-3.5 w-3.5 text-[hsl(var(--muted-foreground))]"})}),a.jsx(lg,{label:"Candidate",selection:i,pickerItems:x,disabledSelection:r,history:s,onChange:d,filterDataset:g}),a.jsx("button",{onClick:f,disabled:!y,className:W("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:p?"Comparing…":"Compare"})]})})}function B2({currentIndex:s,totalRuns:r,aggregate:i,onIndexChange:u}){const d=s===-1,f=s>-1,p=s<r-1;return a.jsx("div",{className:"px-6",children:a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 rounded-lg bg-[hsl(var(--muted))]",children:[a.jsx("button",{onClick:()=>u(s-1),disabled:!f,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:a.jsx(oj,{size:16})}),a.jsxs("div",{className:"text-center",children:[a.jsx("span",{className:"text-sm font-medium",children:d?`Aggregate (${r} runs)`:`Run ${s+1} of ${r}`}),!d&&a.jsx("button",{onClick:()=>u(-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 x=Object.values(i.scorers),m=x.reduce((g,y)=>g+y.mean,0)/Math.max(x.length,1);return a.jsxs("div",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:["Overall mean: ",m.toFixed(3)," across ",x.length," scorer",x.length!==1?"s":""]})})()]}),a.jsx("button",{onClick:()=>u(s+1),disabled:!p,className:"p-1 rounded hover:bg-[hsl(var(--accent))] disabled:opacity-30 transition-colors cursor-pointer",children:a.jsx(qn,{size:16})})]})})}function Q2(s){var f;const r={},i=[];for(const p of s){const x=p.data;if(!((f=x.summary)!=null&&f.scorers))continue;const m=[];for(const[g,y]of Object.entries(x.summary.scorers))r[g]||(r[g]=[]),r[g].push(y.mean),m.push(y.mean);m.length>0&&i.push(m.reduce((g,y)=>g+y,0)/m.length)}const u={};for(const[p,x]of Object.entries(r)){const m=x.reduce((y,v)=>y+v,0)/x.length,g=x.length>1?Math.sqrt(x.reduce((y,v)=>y+(v-m)**2,0)/(x.length-1)):0;u[p]={mean:m,std:g}}let d=null;if(i.length>0){const p=i.reduce((m,g)=>m+g,0)/i.length,x=i.length>1?Math.sqrt(i.reduce((m,g)=>m+(g-p)**2,0)/(i.length-1)):0;d={mean:p,std:x}}return{scorers:u,overall:d}}function G2(s){const r=s.eval.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"eval",i=s.id.slice(0,8),u=new Date(s.timestamp).toISOString().replace(/[-:]/g,"").replace(/\.\d{3}Z$/,"Z"),d=`${r}-${i}-${u}.json`,f=JSON.stringify(s.data,null,2),p=new Blob([f],{type:"application/json"}),x=URL.createObjectURL(p),m=document.createElement("a");m.href=x,m.download=d,document.body.appendChild(m),m.click(),document.body.removeChild(m),setTimeout(()=>URL.revokeObjectURL(x),0)}function Y2({history:s,evalFilter:r,onEvalFilterChange:i,onSelect:u,onSelectGroup:d,onRescore:f,onDelete:p,registeredEvalNames:x,readOnly:m,expandedGroups:g,onToggleGroup:y}){const[v,C]=b.useState(null),T=[...new Set(s.map(S=>S.eval))].sort(),w=b.useMemo(()=>r?s.filter(S=>S.eval===r):s,[s,r]),{rows:A,scorerCols:O}=b.useMemo(()=>{var q,Z;const S=new Map,D=[];for(const J of w){const Q=(q=J.data.metadata)==null?void 0:q.runGroupId;Q?(S.has(Q)||S.set(Q,[]),S.get(Q).push(J)):D.push(J)}const U=[];for(const[J,ne]of S)ne.sort((Q,$)=>$.timestamp-Q.timestamp),ne.length===1?U.push({type:"entry",entry:ne[0]}):U.push({type:"group",groupId:J,entries:ne,evalName:ne[0].eval,newestTimestamp:ne[0].timestamp});for(const J of D)U.push({type:"entry",entry:J});U.sort((J,ne)=>{const Q=J.type==="group"?J.newestTimestamp:J.entry.timestamp;return(ne.type==="group"?ne.newestTimestamp:ne.entry.timestamp)-Q});const B=new Set;for(const J of w){const ne=J.data;if((Z=ne.summary)!=null&&Z.scorers)for(const Q of Object.keys(ne.summary.scorers))B.add(Q)}return{rows:U,scorerCols:[...B].sort()}},[w]),z=b.useMemo(()=>{var D;const S={};for(const U of w){const q=(D=U.data.metadata)==null?void 0:D.scorerTypes;q&&Object.assign(S,q)}return S},[w]),K=8+O.length+(f?1:0),N=(S,D,U)=>{const B=S.data,q=v===S.id;return a.jsxs(b.Fragment,{children:[a.jsxs("tr",{"data-entry-id":S.id,className:W("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",U&&!D&&"bg-[hsl(var(--accent))]/30",q&&"bg-[hsl(var(--accent))]/40"),onClick:()=>C(q?null:S.id),children:[a.jsx("td",{className:W("px-3 py-2.5 font-mono",D&&"pl-9"),children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[D&&a.jsx("span",{className:"inline-block w-1 h-3 mr-0.5 rounded-sm bg-[hsl(var(--border))]"}),S.eval]}),(()=>{const Z=Zs(B);if(Z.length===0||Z.length===1&&Z[0]===S.eval)return null;const J=Wd(B),ne=J?`Workflows: ${Z.map(Q=>`${Q} (${J[Q]??"?"} calls)`).join(", ")}`:`Workflows: ${Z.join(", ")}`;return a.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px]",title:ne,children:Z.join(" · ")})})()]})}),a.jsx("td",{className:"px-3 py-2.5",children:(()=>{const Z=ka(B);if(Z.length===0)return a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"});const J=vl(B);return a.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:Z.map(ne=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:J?`${ne} — ${J[ne]} calls`:ne,children:[vn(ne),J&&J[ne]!=null&&a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",J[ne],")"]})]},ne))})})()}),a.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(S.timestamp).toLocaleString()}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:B.summary.count}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:B.summary.failures>0?a.jsx("span",{className:"text-red-600 dark:text-red-400",children:B.summary.failures}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"0"})}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:B.duration>0?ot(B.duration):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:B.totalCost>0?lt(B.totalCost):"-"}),(()=>{var ne;const Z=Object.values(((ne=B.summary)==null?void 0:ne.scorers)??{}).map(Q=>Q.mean),J=Z.length>0?Z.reduce((Q,$)=>Q+$,0)/Z.length:null;return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:J!=null?a.jsx("span",{className:Nt(J),children:J.toFixed(3)}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})})})(),O.map(Z=>{var ne,Q;const J=(Q=(ne=B.summary)==null?void 0:ne.scorers)==null?void 0:Q[Z];return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:J?a.jsxs("div",{children:[a.jsx("span",{className:Nt(J.mean),children:J.mean.toFixed(3)}),J.min!==J.max&&a.jsxs("div",{className:"text-[9px] text-[hsl(var(--muted-foreground))]",children:[J.min.toFixed(2),"–",J.max.toFixed(2)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},Z)}),f&&a.jsx("td",{className:"px-3 py-2.5"})]}),q&&(()=>{var ne,Q,$;const Z=(ne=B.metadata)==null?void 0:ne.scorerTypes,J=(Q=B.metadata)==null?void 0:Q.originalId;return a.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsx("td",{colSpan:K,className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-[hsl(var(--muted-foreground))] flex-wrap",children:[a.jsxs("span",{children:["ID: ",a.jsx("span",{className:"font-mono",children:B.id.slice(0,8)})]}),a.jsxs("span",{children:["Dataset:"," ",a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:B.dataset})]}),(()=>{const re=Zs(B);return re.length===0?null:a.jsxs("span",{children:[re.length>1?"Workflows":"Workflow",":"," ",a.jsx("span",{className:"font-medium text-[hsl(var(--foreground))]",children:re.join(", ")})]})})(),(()=>{const re=ka(B);if(re.length===0)return null;const le=vl(B);return a.jsx("span",{className:"inline-flex items-center gap-1",children:re.map(_=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono",title:le?`${_} — ${le[_]} calls`:_,children:[vn(_),le&&le[_]!=null&&a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",le[_],")"]})]},_))})})(),!!(($=B.metadata)!=null&&$.rescored)&&a.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"}),J&&a.jsxs("span",{children:["from"," ",a.jsx("button",{onClick:re=>{re.stopPropagation(),C(J),requestAnimationFrame(()=>{var le;(le=document.querySelector(`[data-entry-id="${CSS.escape(J)}"]`))==null||le.scrollIntoView({behavior:"smooth",block:"center"})})},className:"font-mono underline hover:text-[hsl(var(--foreground))] transition-colors cursor-pointer",children:J.slice(0,8)})]}),Z&&Object.keys(Z).length>0&&a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Scorers:",Object.entries(Z).sort(([re],[le])=>re.localeCompare(le)).map(([re,le])=>a.jsx("span",{className:W("px-1.5 py-0.5 rounded font-mono cursor-default",le==="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:le==="llm"?`${re} — LLM scorer (scores may vary between runs)`:`${re} — deterministic scorer`,children:re},re))]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f&&(()=>{const re=!x||x.has(S.eval),le=re&&!m,_=m?"Rescore unavailable — Studio is mounted in read-only mode.":re?"Re-run scorers on saved outputs without re-executing the workflow":`Rescore unavailable — no registered eval named "${S.eval}". Imported CLI artifacts can only be rescored when the runtime has a matching registered eval config.`;return a.jsx("button",{onClick:F=>{F.stopPropagation(),le&&f(S.eval,S.id)},disabled:!le,className:W("px-2.5 py-1 text-[10px] font-medium rounded border border-[hsl(var(--input))] transition-colors",le?"hover:bg-[hsl(var(--accent))] cursor-pointer":"opacity-40 cursor-not-allowed"),title:_,children:"Rescore"})})(),a.jsx("button",{onClick:re=>{re.stopPropagation(),G2(S)},className:"p-1 rounded border border-[hsl(var(--input))] hover:bg-[hsl(var(--accent))] cursor-pointer transition-colors",title:`Export this result as JSON (${S.eval}-${S.id.slice(0,8)}-...json)`,"aria-label":"Export result as JSON",children:a.jsx(yj,{size:12})}),p&&a.jsx("button",{onClick:re=>{re.stopPropagation(),!m&&p(S)},disabled:m,className:W("p-1 rounded border border-[hsl(var(--input))] transition-colors",m?"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:m?"Delete unavailable — Studio is mounted in read-only mode.":"Delete this history entry","aria-label":"Delete history entry",children:a.jsx(bf,{size:12})}),a.jsxs("button",{onClick:re=>{re.stopPropagation(),u(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",a.jsx(pi,{size:10})]})]})]})})})})()]},S.id)};return a.jsxs("div",{children:[T.length>1&&a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsxs("select",{value:r,onChange:S=>i(S.target.value),className:"px-2 py-1 text-xs rounded-lg border border-[hsl(var(--input))] bg-[hsl(var(--background))]",children:[a.jsx("option",{value:"",children:"All evals"}),T.map(S=>a.jsx("option",{value:S,children:S},S))]}),r&&a.jsxs("span",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[w.length," run",w.length!==1?"s":""]})]}),a.jsx("div",{className:"border border-[hsl(var(--border))] rounded-xl overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-[hsl(var(--muted))]",children:[a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Eval"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Model"}),a.jsx("th",{className:"text-left px-3 py-2.5 font-medium",children:"Timestamp"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Items"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Failures"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Duration"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium",children:"Cost"}),a.jsx("th",{className:"text-right px-3 py-2.5 font-medium border-l border-[hsl(var(--border))]",children:"Overall"}),O.map(S=>a.jsxs("th",{className:"text-right px-3 py-2.5 font-medium font-mono whitespace-nowrap",title:S,children:[S,z[S]==="llm"&&a.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"})]},S)),f&&a.jsx("th",{className:"px-3 py-2.5 font-medium w-8"})]})}),a.jsx("tbody",{children:A.map((S,D)=>{if(S.type==="group"){const U=g.has(S.groupId),B=Q2(S.entries),q=B.scorers,Z=S.entries.reduce((Q,$)=>Q+$.data.summary.count,0),J=S.entries.reduce((Q,$)=>Q+$.data.duration,0),ne=S.entries.reduce((Q,$)=>Q+$.data.totalCost,0);return a.jsxs(b.Fragment,{children:[a.jsxs("tr",{className:W("border-t border-[hsl(var(--border))] cursor-pointer hover:bg-[hsl(var(--accent))] transition-colors",D===0&&"bg-[hsl(var(--accent))]/30"),onClick:()=>y(S.groupId),children:[a.jsx("td",{className:"px-3 py-2.5 font-mono",children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"shrink-0 p-0.5 -m-0.5",children:U?a.jsx(xl,{size:14}):a.jsx(qn,{size:14})}),S.evalName]}),(()=>{const Q=new Set,$=[];for(const re of S.entries)for(const le of Zs(re.data))Q.has(le)||(Q.add(le),$.push(le));return $.length===0||$.length===1&&$[0]===S.evalName?null:a.jsx("span",{className:"text-[10px] font-normal text-[hsl(var(--muted-foreground))] truncate max-w-[240px] pl-[22px]",title:`Workflows: ${$.join(", ")}`,children:$.join(" · ")})})()]})}),a.jsx("td",{className:"px-3 py-2.5",children:(()=>{const Q=Cf(S.entries);return Q.length===0?a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"}):a.jsx("span",{className:"inline-flex items-center gap-1 flex-wrap",children:Q.map(([$,re])=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-[hsl(var(--secondary))] text-[hsl(var(--foreground))] font-mono text-[10px]",title:`${$} — ${re} calls`,children:[vn($),a.jsxs("span",{className:"ml-0.5 text-[hsl(var(--muted-foreground))]",children:["(",re,")"]})]},$))})})()}),a.jsx("td",{className:"px-3 py-2.5 text-[hsl(var(--muted-foreground))]",children:new Date(S.newestTimestamp).toLocaleString()}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:Z}),a.jsx("td",{className:"px-3 py-2.5 text-right",children:a.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md bg-[hsl(var(--secondary))] text-[hsl(var(--muted-foreground))]",children:[a.jsx(vf,{size:10}),S.entries.length," runs"]})}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:J>0?ot(J):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-[hsl(var(--muted-foreground))]",children:ne>0?lt(ne):"-"}),a.jsx("td",{className:"px-3 py-2.5 text-right font-mono font-medium border-l border-[hsl(var(--border))]",children:B.overall?a.jsxs("span",{className:Nt(B.overall.mean),children:[B.overall.mean.toFixed(3),B.overall.std>0&&a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))] font-normal",children:[" ± ",B.overall.std.toFixed(3)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})}),O.map(Q=>{const $=q[Q];return a.jsx("td",{className:"px-3 py-2.5 text-right font-mono",children:$?a.jsxs("span",{className:Nt($.mean),children:[$.mean.toFixed(3),a.jsxs("span",{className:"text-[hsl(var(--muted-foreground))]",children:[" "," ± ",$.std.toFixed(3)]})]}):a.jsx("span",{className:"text-[hsl(var(--muted-foreground))]",children:"-"})},Q)}),f&&a.jsx("td",{className:"px-3 py-2.5"})]}),U&&a.jsxs(a.Fragment,{children:[d&&a.jsx("tr",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--muted))]/50",children:a.jsx("td",{colSpan:K,className:"px-4 py-2.5",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[10px] text-[hsl(var(--muted-foreground))]",children:[S.entries.length," runs in this group"]}),a.jsxs("button",{onClick:Q=>{Q.stopPropagation(),d(S.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",a.jsx(pi,{size:10})]})]})})}),S.entries.map(Q=>N(Q,!0,!1))]})]},S.groupId)}return N(S.entry,!1,D===0)})})]})})})]})}const ef=1,tf=25,K2=5,Zo=s=>Math.max(ef,Math.min(tf,Math.round(s)));function $2({evals:s,selectedEval:r,onSelectEval:i,runCount:u,onRunCountChange:d,captureTraces:f,onCaptureTracesChange:p,running:x,onRun:m}){return a.jsxs("div",{className:W("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:[a.jsx(xi,{items:s,value:r,onSelect:i,getKey:g=>g.name,getLabel:g=>g.name,getDescription:g=>a.jsxs(a.Fragment,{children:[a.jsx("span",{children:g.workflow}),a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsx("span",{children:g.dataset}),a.jsx("span",{className:"opacity-40 mx-1",children:"·"}),a.jsxs("span",{children:[g.scorers.length," scorer",g.scorers.length!==1?"s":""]})]}),searchMatch:(g,y)=>g.name.toLowerCase().includes(y)||g.workflow.toLowerCase().includes(y)||g.dataset.toLowerCase().includes(y),placeholder:"Select eval",searchPlaceholder:"Search evals…",emptyLabel:"No evals registered",shortcut:!0,triggerClassName:"rounded-l-full",ariaLabel:"Select an eval"}),a.jsx(X2,{value:u,onChange:d,disabled:x}),a.jsx("button",{type:"button",role:"switch","aria-checked":f,"aria-label":"Capture per-item trace events",onClick:()=>p(!f),disabled:x,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:W("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:a.jsx(gf,{size:12,strokeWidth:2.5})}),a.jsxs("button",{type:"button",onClick:m,disabled:!r||x,className:W("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:[a.jsx(yf,{size:12,className:W("fill-current",x&&"animate-spin fill-none")}),x?"Running…":"Run"]})]})}function X2({value:s,onChange:r,disabled:i=!1}){const[u,d]=b.useState(!1),[f,p]=b.useState(""),x=b.useRef(null),m=b.useRef(!1),g=b.useCallback((z,K)=>{const N=(K?K2:1)*z;r(Zo(s+N))},[s,r]),y=b.useCallback(()=>{i||(m.current=!1,p(String(s)),d(!0))},[s,i]);b.useEffect(()=>{u||p(String(s))},[s,u]),b.useEffect(()=>{u&&requestAnimationFrame(()=>{var z,K;(z=x.current)==null||z.focus(),(K=x.current)==null||K.select()})},[u]);const v=b.useCallback(()=>{if(m.current){d(!1);return}m.current=!0;const z=parseInt(f,10);Number.isNaN(z)||r(Zo(z)),d(!1)},[f,r]),C=b.useCallback(()=>{m.current=!0,d(!1)},[]),T=b.useCallback(z=>{if(z.key==="Enter")z.preventDefault(),v();else if(z.key==="Escape")z.preventDefault(),C();else if(z.key==="ArrowUp"){z.preventDefault();const K=parseInt(f,10);Number.isNaN(K)||p(String(Zo(K+1)))}else if(z.key==="ArrowDown"){z.preventDefault();const K=parseInt(f,10);Number.isNaN(K)||p(String(Zo(K-1)))}},[v,C,f]),w=b.useCallback(z=>{i||(z.key==="Enter"||z.key===" "?(z.preventDefault(),y()):z.key==="ArrowUp"?(z.preventDefault(),g(1,z.shiftKey)):z.key==="ArrowDown"&&(z.preventDefault(),g(-1,z.shiftKey)))},[i,y,g]),A=s<=ef,O=s>=tf;return a.jsxs("div",{className:"flex items-stretch border-l border-[hsl(var(--input))]",role:"group","aria-label":"Run count",children:[a.jsx("button",{type:"button",onClick:z=>g(-1,z.shiftKey),disabled:i||A,title:"Decrease runs — Shift+click: −5","aria-label":"Decrease run count",className:W("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:a.jsx(kj,{size:12,strokeWidth:2.5})}),u?a.jsx("input",{ref:x,type:"text",inputMode:"numeric",value:f,onChange:z=>p(z.target.value.replace(/[^0-9]/g,"").slice(0,2)),onKeyDown:T,onBlur:v,"aria-label":"Run count",className:W("w-10 text-center text-xs font-semibold tabular-nums bg-transparent","focus:outline-none text-[hsl(var(--foreground))]")}):a.jsxs("button",{type:"button",role:"spinbutton","aria-valuenow":s,"aria-valuemin":ef,"aria-valuemax":tf,"aria-valuetext":`${s} run${s!==1?"s":""}`,onClick:y,onKeyDown:w,disabled:i,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:W("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:[a.jsx("span",{className:"opacity-50 mr-0.5",children:"×"}),s]}),a.jsx("button",{type:"button",onClick:z=>g(1,z.shiftKey),disabled:i||O,title:"Increase runs — Shift+click: +5","aria-label":"Increase run count",className:W("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:a.jsx(e0,{size:12,strokeWidth:2.5})})]})}function V2(){var Ai,vr,Da,us,ea;const s=Ni(),[r,i]=b.useState("run"),[u,d]=b.useState(""),f=p2(),p=f.status==="running",[x,m]=b.useState(null),[g,y]=b.useState(null),[v,C]=b.useState(null),[T,w]=b.useState(1),[A,O]=b.useState(!0),[z,K]=b.useState(-1),[N,S]=b.useState(new Set),[D,U]=b.useState(null),[B,q]=b.useState(0),[Z,J]=b.useState(null),[ne,Q]=b.useState("all"),[$,re]=b.useState(""),[le,_]=b.useState(""),[F,ie]=b.useState("index"),[he,pe]=b.useState("asc"),[E,H]=b.useState("mean"),[I,oe]=b.useState("asc"),[de,ye]=b.useState(""),[ce,we]=b.useState(!1),[ke,ft]=b.useState(null),[Yt,rn]=b.useState(null),[on,Ot]=b.useState(null),[nt,At]=b.useState(null),[Se,Rt]=b.useState(null),[In,An]=b.useState(null),[Bn,bl]=b.useState(null),{data:Kt=[]}=gn({queryKey:["evals"],queryFn:TN}),{data:Xe=[]}=gn({queryKey:["evalHistory"],queryFn:kN}),{data:mr,isLoading:Ci,isError:Ei}=gn({queryKey:["health"],queryFn:iN,staleTime:1/0}),jl=!!(mr!=null&&mr.readOnly),pr=(!Ci||Ei)&&!jl,Ti=b.useRef(null),[ki,Ma]=b.useState(!1),[Ct,$t]=b.useState(null);b.useEffect(()=>{if(!Ct)return;const ee=setTimeout(()=>$t(null),6e3);return()=>clearTimeout(ee)},[Ct]),b.useEffect(()=>{if(g!=="Cancelled")return;const ee=setTimeout(()=>y(null),4e3);return()=>clearTimeout(ee)},[g]);const Xt=b.useCallback(async ee=>{y(null),$t(null),Ma(!0);try{const se=await ee.text();let ue;try{ue=JSON.parse(se)}catch{throw new Error(`${ee.name} is not valid JSON`)}const{id:me}=await RN(ue);await s.invalidateQueries({queryKey:["evalHistory"]}),nt?Se?$t(`Imported ${ee.name} — added to history (both compare slots full)`):(Rt({id:me}),$t(`Imported ${ee.name} — selected as candidate`)):(At({id:me}),$t(`Imported ${ee.name} — selected as baseline`))}catch(se){y(se instanceof Error?se.message:String(se))}finally{Ma(!1)}},[s,nt,Se]);b.useEffect(()=>{var xe;if(nt||Se||Xe.length<2)return;const ee=Xe[0].eval,se=Xe.filter(Ue=>Ue.eval===ee);if(se.length<2)return;const ue=new Set,me=[];for(const Ue of se){const Ce=(xe=Ue.data.metadata)==null?void 0:xe.runGroupId,Ae=Ce??Ue.id;if(!ue.has(Ae)){if(ue.add(Ae),Ce){const Ve=se.filter(et=>{var st;return((st=et.data.metadata)==null?void 0:st.runGroupId)===Ce}).map(et=>et.id);Ve.length>1?me.push({id:Ve[0],groupIds:Ve}):me.push({id:Ve[0]})}else me.push({id:Ue.id});if(me.length>=2)break}}me.length>=2&&(Rt(me[0]),At(me[1]))},[Xe,nt,Se]);const Nl=Kt.find(ee=>ee.name===u),cu=b.useMemo(()=>new Set(Kt.map(ee=>ee.name)),[Kt]),at=x==null?void 0:x._multiRun,Oa=at!=null&&z===-1,Re=at&&z>=0?at.allRuns[z]:x;b.useEffect(()=>{C(null)},[z]);const Aa=b.useRef(f.status);b.useEffect(()=>{if(Aa.current!==f.status)if(Aa.current=f.status,f.status==="done"&&f.done){const{evalResultId:ee,runGroupId:se}=f.done;(async()=>{try{await s.refetchQueries({queryKey:["evalHistory"]});const ue=s.getQueryData(["evalHistory"])??[],me=ue.find(xe=>xe.id===ee);if(!me){y(`Eval completed but result ${ee} was not found in history.`);return}if(se){const Ue=ue.filter(Ae=>{var Ve;return((Ve=Ae.data.metadata)==null?void 0:Ve.runGroupId)===se}).map(Ae=>Ae.data),Ce=Fx(Ue);m(Ce??me.data)}else m(me.data);C(null),K(-1)}catch(ue){y(ue instanceof Error?ue.message:String(ue))}finally{Vx()}})()}else f.status==="error"&&f.error&&(Aa.current!=="done"&&y(f.error),s.invalidateQueries({queryKey:["evalHistory"]}),Vx())},[f.status,f.done,f.error,s]);const Pn=b.useCallback(async()=>{if(u){y(null),m(null),C(null),K(-1);try{await x2(u,T,A)}catch(ee){y(ee instanceof Error?ee.message:String(ee))}}},[u,T,A]),ls=b.useCallback(async()=>{if(!(!nt||!Se)){we(!0),ft(null);try{const ee=Ce=>Ce.groupIds&&Ce.groupIds.length>1?Ce.groupIds:Ce.id,se=ee(nt),ue=ee(Se),me=Ce=>{var wl;const Ae=Xe.find(Et=>Et.id===Ce.id);if(!Ae)return null;const Ve=Ae.data;if(!Ce.groupIds||Ce.groupIds.length<=1)return Ve;const et=Ce.groupIds.map(Et=>{var Tt;return(Tt=Xe.find(Cl=>Cl.id===Et))==null?void 0:Tt.data}).filter(Et=>Et!=null),st=Math.min(...et.map(Et=>Et.items.length)),cs=Object.keys(((wl=Ve.summary)==null?void 0:wl.scorers)??{}),ta=Array.from({length:st},(Et,Tt)=>{const Cl={},Ri={};for(const El of cs){const ds=et.map(kl=>{var _t;return(_t=kl.items[Tt])==null?void 0:_t.scores[El]}).filter(kl=>kl!=null),Tl=ds.length>0?Math.round(ds.reduce((kl,_t)=>kl+_t,0)/ds.length*1e3)/1e3:null;Cl[El]=Tl,Ri[El]={score:Tl}}return{...Ve.items[Tt],scores:Cl,scoreDetails:Ri}});return{...Ve,items:ta}};rn(me(nt)),Ot(me(Se));const xe=Ce=>!Ce.groupIds||Ce.groupIds.length<=1?null:Ce.groupIds.map(Ae=>{var Ve;return(Ve=Xe.find(et=>et.id===Ae))==null?void 0:Ve.data}).filter(Ae=>Ae!=null);An(xe(nt)),bl(xe(Se));const Ue=await AN(se,ue);ft(Ue)}catch(ee){y(ee instanceof Error?ee.message:String(ee))}finally{we(!1)}}},[Xe,nt,Se]),Sl=b.useCallback(async(ee,se)=>{y(null);try{const ue=await ON(ee,se);m(ue),C(null),K(-1),i("run"),s.invalidateQueries({queryKey:["evalHistory"]})}catch(ue){y(ue instanceof Error?ue.message:String(ue))}},[s]),du=b.useCallback(async ee=>{var me;y(null);const se=ee.id.slice(0,8);if(window.confirm(`Delete this eval history entry?
|
|
272
|
+
|
|
273
|
+
${ee.eval} (${se})
|
|
274
|
+
|
|
275
|
+
This cannot be undone.`))try{await _N(ee.id);const xe=Ue=>{var Ce;return Ue?Ue.id===ee.id?!0:!!((Ce=Ue.groupIds)!=null&&Ce.includes(ee.id)):!1};if(xe(nt)&&At(null),xe(Se)&&Rt(null),x){const Ue=x.id===ee.id,Ce=!!((me=x._multiRun)!=null&&me.allRuns.some(Ae=>Ae.id===ee.id));(Ue||Ce)&&(m(null),C(null),K(-1),U(null))}s.invalidateQueries({queryKey:["evalHistory"]})}catch(xe){y(xe instanceof Error?xe.message:String(xe))}},[s,nt,Se,x]),Mi=b.useCallback(ee=>{S(se=>{const ue=new Set(se);return ue.has(ee)?ue.delete(ee):ue.add(ee),ue})},[]),Ra=(Ai=x==null?void 0:x.metadata)==null?void 0:Ai.scorerTypes,Qn=(vr=Re==null?void 0:Re.summary)!=null&&vr.scorers?Object.keys(Re.summary.scorers):[],_a=(Da=Re==null?void 0:Re.summary)!=null&&Da.scorers?Object.entries(Re.summary.scorers):[],ss=_a.length>0?_a.reduce((ee,[,se])=>ee+se.mean,0)/_a.length:0,Gn=at?Object.entries(at.aggregate.scorers):[],rs=Gn.length>0?Gn.reduce((ee,[,se])=>ee+se.mean,0)/Gn.length:0,xr=b.useMemo(()=>{if(!at)return 0;const ee=at.allRuns,se=Object.keys(at.aggregate.scorers);if(se.length===0||ee.length<=1)return 0;const ue=ee.map(xe=>{const Ue=se.map(Ce=>{var Ae,Ve,et;return(et=(Ve=(Ae=xe.summary)==null?void 0:Ae.scorers)==null?void 0:Ve[Ce])==null?void 0:et.mean}).filter(Ce=>Ce!=null);return Ue.length>0?Ue.reduce((Ce,Ae)=>Ce+Ae,0)/Ue.length:0}),me=ue.reduce((xe,Ue)=>xe+Ue,0)/ue.length;return Math.sqrt(ue.reduce((xe,Ue)=>xe+(Ue-me)**2,0)/(ue.length-1))},[at]),is=at?at.allRuns.reduce((ee,se)=>ee+se.duration,0):0,gr=at?at.allRuns.reduce((ee,se)=>ee+se.totalCost,0):0,Oi=b.useMemo(()=>{if(!at)return[];const ee=Object.entries(at.aggregate.scorers);return ee.sort((se,ue)=>{let me,xe;switch(E){case"scorer":return I==="asc"?se[0].localeCompare(ue[0]):ue[0].localeCompare(se[0]);case"mean":me=se[1].mean,xe=ue[1].mean;break;case"std":me=se[1].std,xe=ue[1].std;break;case"min":me=se[1].min,xe=ue[1].min;break;case"max":default:me=se[1].max,xe=ue[1].max;break}return I==="desc"?xe-me:me-xe}),ee},[at,E,I]),Wt=ee=>{E===ee?oe(se=>se==="desc"?"asc":"desc"):(H(ee),oe("asc"))},dt=ee=>E===ee?I==="desc"?" ▼":" ▲":"",Bt=(ee,se)=>{if(se===0)return"text-[hsl(var(--muted-foreground))]";const ue=ee/se;return ue<.02?"text-[hsl(var(--muted-foreground))]":ue<=.05?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"},za=5,os=b.useMemo(()=>{var me;if(!Oa||!x)return[];const ee=x.items,se=Object.keys(((me=x.summary)==null?void 0:me.scorers)??{});if(se.length===0||ee.length===0)return[];const ue=ee.map((xe,Ue)=>{const Ce=se.map(Ve=>xe.scores[Ve]).filter(Ve=>Ve!=null),Ae=Ce.length>0?Ce.reduce((Ve,et)=>Ve+et,0)/Ce.length:1;return{item:xe,index:Ue,avgScore:Ae,scores:xe.scores}});return ue.sort((xe,Ue)=>xe.avgScore-Ue.avgScore),ue.slice(0,za)},[Oa,x]),fu=["run","history","compare","trends"];return a.jsxs("div",{className:"flex flex-col h-screen",children:[a.jsx(iu,{title:"Eval Runner",description:Nl?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:Nl.workflow}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsx("span",{children:Nl.dataset}),a.jsx("span",{className:"opacity-40 mx-1.5",children:"·"}),a.jsxs("span",{children:[Nl.scorers.length," scorer",Nl.scorers.length!==1?"s":""]})]}):Kt.length>0?`${Kt.length} registered eval${Kt.length!==1?"s":""} · select one to run`:"No evals registered",actions:a.jsxs(a.Fragment,{children:[pr&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:Ti,type:"file",accept:"application/json,.json",className:"hidden",onChange:ee=>{var ue;const se=(ue=ee.target.files)==null?void 0:ue[0];se&&Xt(se),ee.target.value=""}}),a.jsxs("button",{type:"button",onClick:()=>{var ee;return(ee=Ti.current)==null?void 0:ee.click()},disabled:ki,className:W("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:[a.jsx(Xj,{size:12}),ki?"Importing…":"Import result"]})]}),Kt.length>0&&pr&&a.jsx($2,{evals:Kt,selectedEval:u,onSelectEval:d,runCount:T,onRunCountChange:w,captureTraces:A,onCaptureTracesChange:O,running:p,onRun:Pn})]})}),a.jsx("div",{role:"tablist","aria-label":"Eval views",className:"shrink-0 flex items-center gap-1 px-6 border-b border-[hsl(var(--border))]",children:fu.map(ee=>a.jsx("button",{type:"button",role:"tab","aria-selected":r===ee,onClick:()=>i(ee),className:W("px-3 py-2.5 text-sm -mb-px border-b-2 transition-colors cursor-pointer",r===ee?"border-[hsl(var(--foreground))] text-[hsl(var(--foreground))] font-medium":"border-transparent text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--foreground))]"),children:ee.charAt(0).toUpperCase()+ee.slice(1)},ee))}),g&&a.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:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("div",{className:"text-sm text-red-700 dark:text-red-300 whitespace-pre-wrap break-words",children:g}),a.jsx("button",{onClick:()=>y(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"})]})}),Ct&&a.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:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("div",{className:"text-xs text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap break-words",children:Ct}),a.jsx("button",{onClick:()=>$t(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"&&a.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:Kt.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center p-6",children:a.jsx(Ft,{icon:a.jsx(ir,{size:32}),title:"No evals registered",description:"Define evals with defineEval() and load them via the evals middleware option or runtime.registerEval()."})}):x?a.jsxs(a.Fragment,{children:[(Z==="history"||Z==="trends")&&a.jsx("div",{className:"shrink-0 px-6 pt-4",children:a.jsxs("button",{onClick:()=>{i(Z),J(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:[a.jsx(ej,{size:14}),"Back to ",Z==="history"?"History":"Trends"]})}),at&&a.jsx("div",{className:"shrink-0 pt-4",children:a.jsx(B2,{currentIndex:z,totalRuns:at.allRuns.length,aggregate:at.aggregate,onIndexChange:K})}),Oa?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"shrink-0 px-6 py-4",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{className:"flex-1 flex flex-wrap items-center gap-x-4 gap-y-1.5",children:[(()=>{const ee=x?Zs(x):[];if(ee.length===0)return null;const se=x?Wd(x):null;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Workflows":"Workflow"}),ee.map(ue=>a.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:se?`${ue} — ${se[ue]} calls`:ue,children:[ue,se&&se[ue]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",se[ue],")"]})]},ue))]})})(),(()=>{const ee=x?ka(x):[];if(ee.length===0)return null;const se=x?vl(x):null;return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Models":"Model"}),ee.map(ue=>a.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:se?`${ue} — ${se[ue]} calls`:ue,children:[vn(ue),se&&se[ue]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",se[ue],")"]})]},ue))]})})()]}),a.jsx("button",{onClick:()=>{var se;const ee=(se=x==null?void 0:x.metadata)==null?void 0:se.runGroupId;if(ee){const ue=Xe.filter(me=>{var xe;return((xe=me.data.metadata)==null?void 0:xe.runGroupId)===ee}).map(me=>me.id);ue.length>0&&Rt({id:ue[0],groupIds:ue})}else if(x){const ue=Xe.find(me=>me.id===x.id);ue&&Rt({id:ue.id})}i("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..."})]}),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[a.jsx(Ke,{label:"Runs",value:String(at.aggregate.runCount),subtitle:"individual runs"}),a.jsx(Ke,{label:"Mean Score",value:Gn.length>0?rs.toFixed(3):"—",accent:Gn.length>0?Nt(rs):void 0,tint:Gn.length>0?Wx(rs):void 0,subtitle:Gn.length>0?`± ${xr.toFixed(3)} across runs`:"across all scorers"}),a.jsx(Ke,{label:"Total Duration",value:is>0?ot(is):"—",subtitle:"all runs combined"}),a.jsx(Ke,{label:"Total Cost",value:gr>0?lt(gr):"—",subtitle:"all runs combined"}),(()=>{const ee=at.allRuns,se={input:0,output:0,reasoning:0};for(const me of ee){const xe=Id(me);se.input+=xe.input,se.output+=xe.output,se.reasoning+=xe.reasoning}const ue=se.input+se.output+se.reasoning;return ue>0?a.jsx(Ke,{label:"Total Tokens",value:On(ue),subtitle:`${On(se.input)} in / ${On(se.output)} out`}):null})()]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 pb-6 space-y-6",children:[a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Per-Scorer Aggregate"})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-[hsl(var(--border))]",children:[a.jsxs("th",{className:"text-left px-4 py-2 font-medium w-48 cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>Wt("scorer"),children:["Scorer",dt("scorer")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>Wt("mean"),children:["Mean",dt("mean")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>Wt("std"),children:["Std",dt("std")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>Wt("min"),children:["Min",dt("min")]}),a.jsxs("th",{className:"text-right px-3 py-2 font-medium cursor-pointer select-none hover:text-[hsl(var(--foreground))]",onClick:()=>Wt("max"),children:["Max",dt("max")]})]})}),a.jsx("tbody",{children:Oi.map(([ee,se])=>a.jsxs("tr",{className:"border-b border-[hsl(var(--border))] last:border-b-0",children:[a.jsxs("td",{className:"px-4 py-2.5 font-mono",children:[ee,(Ra==null?void 0:Ra[ee])==="llm"&&a.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"})]}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono font-medium",Nt(se.mean)),children:se.mean.toFixed(3)}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",Bt(se.std,se.mean)),children:se.std.toFixed(3)}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",Nt(se.min)),children:se.min.toFixed(3)}),a.jsx("td",{className:W("px-3 py-2.5 text-right font-mono",Nt(se.max)),children:se.max.toFixed(3)})]},ee))})]})})]}),os.length>0&&a.jsxs("div",{className:"rounded-xl border border-[hsl(var(--border))] overflow-hidden",children:[a.jsx("div",{className:"px-4 py-2.5 bg-[hsl(var(--muted))] border-b border-[hsl(var(--border))]",children:a.jsx("h3",{className:"text-[11px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Lowest Scoring Items"})}),a.jsx("div",{className:"divide-y divide-[hsl(var(--border))]",children:os.map(({item:ee,index:se,avgScore:ue,scores:me})=>{var Ve;const xe=D===se,Ue=at==null?void 0:at.allRuns,Ce=(Ue==null?void 0:Ue.length)??0,Ae=xe&&Ue?(Ve=Ue[B])==null?void 0:Ve.items[se]:null;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>{U(xe?null:se),q(0)},className:W("w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-[hsl(var(--accent))] transition-colors cursor-pointer",xe&&"bg-[hsl(var(--accent))]"),children:[a.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-[hsl(var(--muted-foreground))] w-6 text-right",children:["#",se+1]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",children:or(ee.input,60)}),a.jsx("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:Object.entries(me).map(([et,st])=>st!=null?a.jsxs("span",{className:W("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",au(st)),title:et,children:[et,": ",st.toFixed(2)]},et):null)})]}),a.jsx("span",{className:W("shrink-0 text-xs font-mono font-medium",Nt(ue)),children:ue.toFixed(3)})]}),xe&&a.jsxs("div",{className:"border-t border-[hsl(var(--border))] bg-[hsl(var(--card))] text-xs",children:[Ce>1&&a.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:"Run"}),a.jsx("div",{className:"flex items-center gap-0.5",children:Array.from({length:Ce},(et,st)=>a.jsx("button",{onClick:()=>q(st),className:W("px-2 py-0.5 rounded text-[10px] font-mono transition-colors cursor-pointer",st===B?"bg-[hsl(var(--foreground))] text-[hsl(var(--background))]":"text-[hsl(var(--muted-foreground))] hover:bg-[hsl(var(--accent))]"),children:st+1},st))})]}),a.jsxs("div",{className:"p-4 space-y-3",children:[Ae&&a.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:Object.entries(Ae.scores).map(([et,st])=>st!=null?a.jsxs("span",{className:W("inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono",au(st)),children:[et,": ",st.toFixed(3)]},et):null)}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:"Output"}),a.jsx(qt,{data:(Ae==null?void 0:Ae.output)??ee.output,collapsed:!0})]}),(Ae==null?void 0:Ae.scoreDetails)&&Object.entries(Ae.scoreDetails).map(([et,st])=>{var ta;const cs=typeof((ta=st==null?void 0:st.metadata)==null?void 0:ta.reasoning)=="string"?st.metadata.reasoning:null;return cs?a.jsxs("div",{children:[a.jsxs("span",{className:"font-medium text-[hsl(var(--muted-foreground))] text-[10px] uppercase tracking-wider block mb-1",children:[et," reasoning"]}),a.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:cs})]},et):null})]})]})]},se)})})]})]})]}):Re?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"shrink-0 px-6 py-4",children:[(()=>{const ee=Zs(Re),se=Wd(Re),ue=ka(Re),me=vl(Re);return ee.length===0&&ue.length===0?null:a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1.5 mb-3",children:[ee.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ee.length>1?"Workflows":"Workflow"}),ee.map(xe=>a.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:se?`${xe} — ${se[xe]} calls`:xe,children:[xe,se&&se[xe]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",se[xe],")"]})]},xe))]}),ue.length>0&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[hsl(var(--muted-foreground))]",children:ue.length>1?"Models":"Model"}),ue.map(xe=>a.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:me?`${xe} — ${me[xe]} calls`:xe,children:[vn(xe),me&&me[xe]!=null&&a.jsxs("span",{className:"ml-1 text-[hsl(var(--muted-foreground))] font-normal",children:["(",me[xe],")"]})]},xe))]})]})})(),a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-3",children:[a.jsx(Ke,{label:"Items",value:String(Re.summary.count),subtitle:Re.summary.failures>0?`${Re.summary.failures} failed`:"all passed",subtitleColor:Re.summary.failures>0?"text-red-600 dark:text-red-400":"text-emerald-600 dark:text-emerald-400"}),a.jsx(Ke,{label:"Mean Score",value:_a.length>0?ss.toFixed(3):"—",accent:_a.length>0?Nt(ss):void 0,tint:_a.length>0?Wx(ss):void 0,subtitle:"across all scorers"}),a.jsx(Ke,{label:"Duration",value:Re.summary.timing?ot(Re.summary.timing.mean):ot(Re.duration),subtitle:Re.summary.timing?`p95 ${ot(Re.summary.timing.p95)}`:"total"}),a.jsx(Ke,{label:"Cost",value:Re.totalCost>0?lt(Re.totalCost):"—",subtitle:"total"}),(()=>{const ee=Id(Re),se=ee.input+ee.output+ee.reasoning;return se>0?a.jsx(Ke,{label:"Tokens",value:On(se),subtitle:`${On(ee.input)} in / ${On(ee.output)} out`}):null})()]})]}),a.jsxs("div",{className:"flex flex-1 min-h-0 border-t border-[hsl(var(--border))]",children:[a.jsx("div",{className:"w-[340px] xl:w-[380px] shrink-0 border-r border-[hsl(var(--border))] bg-[hsl(var(--card))]",children:a.jsx(O2,{items:Re.items,scorerNames:Qn,selectedIndex:v,onSelectItem:C,onDeselectItem:()=>C(null)})}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:v!=null?a.jsx("div",{className:"p-6",children:a.jsx(k2,{item:Re.items[v],itemIndex:v,scorerNames:Qn,onBack:()=>C(null)})}):a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsx(w2,{summary:Re.summary,items:Re.items,totalCost:Re.totalCost,scorerTypes:Ra}),a.jsx(R2,{items:Re.items,scorerNames:Qn}),Re.items.length>0&&a.jsx(C2,{items:Re.items,scorerNames:Qn,onSelectItem:C,errorFilter:ne,onErrorFilterChange:Q,scorerFilter:$,onScorerFilterChange:re,threshold:le,onThresholdChange:_,sortField:F,onSortFieldChange:ie,sortDir:he,onSortDirChange:pe})]})})]})]}):null]}):p?a.jsx(Z2,{exec:f,onCancel:g2}):a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsx(Ft,{icon:a.jsx(ir,{size:32}),title:"No results",description:"Select an eval and run it to see results."})})}),r==="history"&&a.jsx("div",{className:"flex-1 overflow-auto p-6",children:Xe.length===0?a.jsx(Ft,{title:"No eval history",description:"Run evaluations to build history."}):a.jsx(Y2,{history:Xe,evalFilter:de,onEvalFilterChange:ye,onSelect:ee=>{m(ee),C(null),K(-1),J("history"),i("run")},onSelectGroup:ee=>{const se=ee.map(me=>me.data),ue=Fx(se);ue&&(m(ue),C(null),K(-1),J("history"),i("run"))},onRescore:Sl,onDelete:du,registeredEvalNames:cu,readOnly:jl,expandedGroups:N,onToggleGroup:Mi})}),r==="trends"&&a.jsx(j2,{onViewRun:ee=>{const se=Xe.find(ue=>ue.id===ee);se&&(m(se.data),C(null),K(-1),J("trends"),i("run"))}}),r==="compare"&&a.jsx("div",{className:"flex-1 overflow-auto p-6",children:a.jsx("div",{className:"space-y-4",children:Xe.length<2?a.jsx(Ft,{title:"Need at least 2 eval runs",description:"Run evaluations to compare results."}):a.jsxs(a.Fragment,{children:[a.jsx(q2,{history:Xe,baselineSelection:nt,candidateSelection:Se,onBaselineChange:At,onCandidateChange:Rt,onCompare:ls,comparing:ce}),ke&&a.jsx(D2,{compareResult:ke,baseline:Yt,candidate:on,isGroupComparison:(((us=nt==null?void 0:nt.groupIds)==null?void 0:us.length)??0)>1||(((ea=Se==null?void 0:Se.groupIds)==null?void 0:ea.length)??0)>1,baselineRuns:In,candidateRuns:Bn})]})})})]})}function Z2({exec:s,onCancel:r}){const[i,u]=b.useState(0);b.useEffect(()=>{if(!s.startedAt)return;u(Math.floor((Date.now()-s.startedAt)/1e3));const w=setInterval(()=>{u(Math.floor((Date.now()-s.startedAt)/1e3))},1e3);return()=>clearInterval(w)},[s.startedAt]);const d=Math.floor(i/60),f=i%60,p=d>0?`${d}m ${f}s`:`${f}s`,x=s.progress,m=(s.runCount??1)>1,g=(x==null?void 0:x.totalItems)??0,y=(x==null?void 0:x.completedItems)??0,v=(x==null?void 0:x.completedRuns)??0,C=(x==null?void 0:x.totalRuns)??s.runCount??1,T=g>0?Math.round(y/g*100):0;return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-5",children:[a.jsxs("div",{className:"relative",children:[a.jsx(ir,{size:28,className:"text-[hsl(var(--muted-foreground))]"}),a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500 animate-ping"}),a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-emerald-500"})]}),a.jsxs("div",{className:"text-center space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:m?`Run ${v+1} of ${C}`:"Running evaluation…"}),s.evalName&&a.jsxs("p",{className:"text-xs text-[hsl(var(--muted-foreground))]",children:[s.evalName,m?` · ${C} runs`:""]})]}),g>0&&a.jsxs("div",{className:"w-56 space-y-1.5",children:[a.jsx("div",{className:"h-1.5 rounded-full bg-[hsl(var(--muted))] overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all duration-300 ease-out",style:{width:`${T}%`}})}),a.jsxs("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] text-center tabular-nums",children:[y," / ",g," items"]})]}),a.jsx("p",{className:"text-[11px] text-[hsl(var(--muted-foreground))] tabular-nums",children:p}),a.jsxs("button",{onClick:r,className:`inline-flex items-center gap-1.5 px-3 py-1 text-xs rounded-md
|
|
276
|
+
border border-[hsl(var(--border))] text-[hsl(var(--muted-foreground))]
|
|
277
|
+
hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]
|
|
278
|
+
transition-colors cursor-pointer`,children:[a.jsx(Fj,{size:12}),"Cancel"]})]})}function J2(){return a.jsx(H1,{basename:window.__AXL_STUDIO_BASE__||"/",children:a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsx(Pj,{}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsxs(m1,{children:[a.jsx(Vn,{path:"/playground",element:a.jsx(UN,{})}),a.jsx(Vn,{path:"/workflows",element:a.jsx(IN,{})}),a.jsx(Vn,{path:"/traces",element:a.jsx(l2,{})}),a.jsx(Vn,{path:"/costs",element:a.jsx(r2,{})}),a.jsx(Vn,{path:"/memory",element:a.jsx(i2,{})}),a.jsx(Vn,{path:"/sessions",element:a.jsx(c2,{})}),a.jsx(Vn,{path:"/tools",element:a.jsx(d2,{})}),a.jsx(Vn,{path:"/evals",element:a.jsx(V2,{})}),a.jsx(Vn,{path:"*",element:a.jsx(f1,{to:"/playground",replace:!0})})]})})]})})}_y.createRoot(document.getElementById("root")).render(a.jsx(b.StrictMode,{children:a.jsx(lb,{client:xb,children:a.jsx(J2,{})})}));
|