@exellix/jobs-ui 2.0.2 → 2.0.3

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.
@@ -0,0 +1,61 @@
1
+ var yb=Object.defineProperty;var Cy=l=>{throw TypeError(l)};var gb=(l,s,r)=>s in l?yb(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Ey=(l,s,r)=>gb(l,typeof s!="symbol"?s+"":s,r),dd=(l,s,r)=>s.has(l)||Cy("Cannot "+r);var R=(l,s,r)=>(dd(l,s,"read from private field"),r?r.call(l):s.get(l)),fe=(l,s,r)=>s.has(l)?Cy("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),le=(l,s,r,c)=>(dd(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),Te=(l,s,r)=>(dd(l,s,"access private method"),r);var Tc=(l,s,r,c)=>({set _(o){le(l,s,o,r)},get _(){return R(l,s,c)}});(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(o){if(o.ep)return;o.ep=!0;const f=r(o);fetch(o.href,f)}})();var fd={exports:{}},Hi={};/**
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 Ty;function vb(){if(Ty)return Hi;Ty=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,o,f){var h=null;if(f!==void 0&&(h=""+f),o.key!==void 0&&(h=""+o.key),"key"in o){f={};for(var m in o)m!=="key"&&(f[m]=o[m])}else f=o;return o=f.ref,{$$typeof:l,type:c,key:h,ref:o!==void 0?o:null,props:f}}return Hi.Fragment=s,Hi.jsx=r,Hi.jsxs=r,Hi}var Ry;function xb(){return Ry||(Ry=1,fd.exports=vb()),fd.exports}var a=xb(),hd={exports:{}},Ne={};/**
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 Ay;function jb(){if(Ay)return Ne;Ay=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),N=Symbol.iterator;function b(E){return E===null||typeof E!="object"?null:(E=N&&E[N]||E["@@iterator"],typeof E=="function"?E:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,z={};function D(E,H,J){this.props=E,this.context=H,this.refs=z,this.updater=J||C}D.prototype.isReactComponent={},D.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")},D.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function F(){}F.prototype=D.prototype;function $(E,H,J){this.props=E,this.context=H,this.refs=z,this.updater=J||C}var U=$.prototype=new F;U.constructor=$,A(U,D.prototype),U.isPureReactComponent=!0;var Z=Array.isArray;function W(){}var V={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function te(E,H,J){var ie=J.ref;return{$$typeof:l,type:E,key:H,ref:ie!==void 0?ie:null,props:J}}function xe(E,H){return te(E.type,H,E.props)}function pe(E){return typeof E=="object"&&E!==null&&E.$$typeof===l}function se(E){var H={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(J){return H[J]})}var ce=/\/+/g;function Se(E,H){return typeof E=="object"&&E!==null&&E.key!=null?se(""+E.key):H.toString(36)}function ue(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(W,W):(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 k(E,H,J,ie,L){var O=typeof E;(O==="undefined"||O==="boolean")&&(E=null);var ae=!1;if(E===null)ae=!0;else switch(O){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(E.$$typeof){case l:case s:ae=!0;break;case x:return ae=E._init,k(ae(E._payload),H,J,ie,L)}}if(ae)return L=L(E),ae=ie===""?"."+Se(E,0):ie,Z(L)?(J="",ae!=null&&(J=ae.replace(ce,"$&/")+"/"),k(L,H,J,"",function(qt){return qt})):L!=null&&(pe(L)&&(L=xe(L,J+(L.key==null||E&&E.key===L.key?"":(""+L.key).replace(ce,"$&/")+"/")+ae)),H.push(L)),1;ae=0;var be=ie===""?".":ie+":";if(Z(E))for(var Ae=0;Ae<E.length;Ae++)ie=E[Ae],O=be+Se(ie,Ae),ae+=k(ie,H,J,O,L);else if(Ae=b(E),typeof Ae=="function")for(E=Ae.call(E),Ae=0;!(ie=E.next()).done;)ie=ie.value,O=be+Se(ie,Ae++),ae+=k(ie,H,J,O,L);else if(O==="object"){if(typeof E.then=="function")return k(ue(E),H,J,ie,L);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 ae}function X(E,H,J){if(E==null)return E;var ie=[],L=0;return k(E,ie,"","",function(O){return H.call(J,O,L++)}),ie}function re(E){if(E._status===-1){var H=E._result;H=H(),H.then(function(J){(E._status===0||E._status===-1)&&(E._status=1,E._result=J)},function(J){(E._status===0||E._status===-1)&&(E._status=2,E._result=J)}),E._status===-1&&(E._status=0,E._result=H)}if(E._status===1)return E._result.default;throw E._result}var je=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)},I={map:X,forEach:function(E,H,J){X(E,function(){H.apply(this,arguments)},J)},count:function(E){var H=0;return X(E,function(){H++}),H},toArray:function(E){return X(E,function(H){return H})||[]},only:function(E){if(!pe(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Ne.Activity=v,Ne.Children=I,Ne.Component=D,Ne.Fragment=r,Ne.Profiler=o,Ne.PureComponent=$,Ne.StrictMode=c,Ne.Suspense=p,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(E){return V.H.useMemoCache(E)}},Ne.cache=function(E){return function(){return E.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(E,H,J){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ie=A({},E.props),L=E.key;if(H!=null)for(O in H.key!==void 0&&(L=""+H.key),H)!G.call(H,O)||O==="key"||O==="__self"||O==="__source"||O==="ref"&&H.ref===void 0||(ie[O]=H[O]);var O=arguments.length-2;if(O===1)ie.children=J;else if(1<O){for(var ae=Array(O),be=0;be<O;be++)ae[be]=arguments[be+2];ie.children=ae}return te(E.type,L,ie)},Ne.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},Ne.createElement=function(E,H,J){var ie,L={},O=null;if(H!=null)for(ie in H.key!==void 0&&(O=""+H.key),H)G.call(H,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(L[ie]=H[ie]);var ae=arguments.length-2;if(ae===1)L.children=J;else if(1<ae){for(var be=Array(ae),Ae=0;Ae<ae;Ae++)be[Ae]=arguments[Ae+2];L.children=be}if(E&&E.defaultProps)for(ie in ae=E.defaultProps,ae)L[ie]===void 0&&(L[ie]=ae[ie]);return te(E,O,L)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(E){return{$$typeof:m,render:E}},Ne.isValidElement=pe,Ne.lazy=function(E){return{$$typeof:x,_payload:{_status:-1,_result:E},_init:re}},Ne.memo=function(E,H){return{$$typeof:g,type:E,compare:H===void 0?null:H}},Ne.startTransition=function(E){var H=V.T,J={};V.T=J;try{var ie=E(),L=V.S;L!==null&&L(J,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(W,je)}catch(O){je(O)}finally{H!==null&&J.types!==null&&(H.types=J.types),V.T=H}},Ne.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Ne.use=function(E){return V.H.use(E)},Ne.useActionState=function(E,H,J){return V.H.useActionState(E,H,J)},Ne.useCallback=function(E,H){return V.H.useCallback(E,H)},Ne.useContext=function(E){return V.H.useContext(E)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(E,H){return V.H.useDeferredValue(E,H)},Ne.useEffect=function(E,H){return V.H.useEffect(E,H)},Ne.useEffectEvent=function(E){return V.H.useEffectEvent(E)},Ne.useId=function(){return V.H.useId()},Ne.useImperativeHandle=function(E,H,J){return V.H.useImperativeHandle(E,H,J)},Ne.useInsertionEffect=function(E,H){return V.H.useInsertionEffect(E,H)},Ne.useLayoutEffect=function(E,H){return V.H.useLayoutEffect(E,H)},Ne.useMemo=function(E,H){return V.H.useMemo(E,H)},Ne.useOptimistic=function(E,H){return V.H.useOptimistic(E,H)},Ne.useReducer=function(E,H,J){return V.H.useReducer(E,H,J)},Ne.useRef=function(E){return V.H.useRef(E)},Ne.useState=function(E){return V.H.useState(E)},Ne.useSyncExternalStore=function(E,H,J){return V.H.useSyncExternalStore(E,H,J)},Ne.useTransition=function(){return V.H.useTransition()},Ne.version="19.2.7",Ne}var wy;function tf(){return wy||(wy=1,hd.exports=jb()),hd.exports}var S=tf(),md={exports:{}},$i={},pd={exports:{}},yd={};/**
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 Oy;function bb(){return Oy||(Oy=1,(function(l){function s(k,X){var re=k.length;k.push(X);e:for(;0<re;){var je=re-1>>>1,I=k[je];if(0<o(I,X))k[je]=X,k[re]=I,re=je;else break e}}function r(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var X=k[0],re=k.pop();if(re!==X){k[0]=re;e:for(var je=0,I=k.length,E=I>>>1;je<E;){var H=2*(je+1)-1,J=k[H],ie=H+1,L=k[ie];if(0>o(J,re))ie<I&&0>o(L,J)?(k[je]=L,k[ie]=re,je=ie):(k[je]=J,k[H]=re,je=H);else if(ie<I&&0>o(L,re))k[je]=L,k[ie]=re,je=ie;else break e}}return X}function o(k,X){var re=k.sortIndex-X.sortIndex;return re!==0?re:k.id-X.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;l.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var p=[],g=[],x=1,v=null,N=3,b=!1,C=!1,A=!1,z=!1,D=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function U(k){for(var X=r(g);X!==null;){if(X.callback===null)c(g);else if(X.startTime<=k)c(g),X.sortIndex=X.expirationTime,s(p,X);else break;X=r(g)}}function Z(k){if(A=!1,U(k),!C)if(r(p)!==null)C=!0,W||(W=!0,se());else{var X=r(g);X!==null&&ue(Z,X.startTime-k)}}var W=!1,V=-1,G=5,te=-1;function xe(){return z?!0:!(l.unstable_now()-te<G)}function pe(){if(z=!1,W){var k=l.unstable_now();te=k;var X=!0;try{e:{C=!1,A&&(A=!1,F(V),V=-1),b=!0;var re=N;try{t:{for(U(k),v=r(p);v!==null&&!(v.expirationTime>k&&xe());){var je=v.callback;if(typeof je=="function"){v.callback=null,N=v.priorityLevel;var I=je(v.expirationTime<=k);if(k=l.unstable_now(),typeof I=="function"){v.callback=I,U(k),X=!0;break t}v===r(p)&&c(p),U(k)}else c(p);v=r(p)}if(v!==null)X=!0;else{var E=r(g);E!==null&&ue(Z,E.startTime-k),X=!1}}break e}finally{v=null,N=re,b=!1}X=void 0}}finally{X?se():W=!1}}}var se;if(typeof $=="function")se=function(){$(pe)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Se=ce.port2;ce.port1.onmessage=pe,se=function(){Se.postMessage(null)}}else se=function(){D(pe,0)};function ue(k,X){V=D(function(){k(l.unstable_now())},X)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(k){k.callback=null},l.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<k?Math.floor(1e3/k):5},l.unstable_getCurrentPriorityLevel=function(){return N},l.unstable_next=function(k){switch(N){case 1:case 2:case 3:var X=3;break;default:X=N}var re=N;N=X;try{return k()}finally{N=re}},l.unstable_requestPaint=function(){z=!0},l.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var re=N;N=k;try{return X()}finally{N=re}},l.unstable_scheduleCallback=function(k,X,re){var je=l.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?je+re:je):re=je,k){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=re+I,k={id:x++,callback:X,priorityLevel:k,startTime:re,expirationTime:I,sortIndex:-1},re>je?(k.sortIndex=re,s(g,k),r(p)===null&&k===r(g)&&(A?(F(V),V=-1):A=!0,ue(Z,re-je))):(k.sortIndex=I,s(p,k),C||b||(C=!0,W||(W=!0,se()))),k},l.unstable_shouldYield=xe,l.unstable_wrapCallback=function(k){var X=N;return function(){var re=N;N=X;try{return k.apply(this,arguments)}finally{N=re}}}})(yd)),yd}var My;function Sb(){return My||(My=1,pd.exports=bb()),pd.exports}var gd={exports:{}},Ct={};/**
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 zy;function Nb(){if(zy)return Ct;zy=1;var l=tf();function s(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(p,g,x){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:p,containerInfo:g,implementation:x}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Ct.createPortal=function(p,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(s(299));return f(p,g,null,x)},Ct.flushSync=function(p){var g=h.T,x=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=g,c.p=x,c.d.f()}},Ct.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,c.d.C(p,g))},Ct.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},Ct.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,v=m(x,g.crossOrigin),N=typeof g.integrity=="string"?g.integrity:void 0,b=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?c.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:N,fetchPriority:b}):x==="script"&&c.d.X(p,{crossOrigin:v,integrity:N,fetchPriority:b,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ct.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=m(g.as,g.crossOrigin);c.d.M(p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&c.d.M(p)},Ct.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,v=m(x,g.crossOrigin);c.d.L(p,x,{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})}},Ct.preloadModule=function(p,g){if(typeof p=="string")if(g){var x=m(g.as,g.crossOrigin);c.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else c.d.m(p)},Ct.requestFormReset=function(p){c.d.r(p)},Ct.unstable_batchedUpdates=function(p,g){return p(g)},Ct.useFormState=function(p,g,x){return h.H.useFormState(p,g,x)},Ct.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ct.version="19.2.7",Ct}var Dy;function Cb(){if(Dy)return gd.exports;Dy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),gd.exports=Nb(),gd.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 ky;function Eb(){if(ky)return $i;ky=1;var l=Sb(),s=tf(),r=Cb();function c(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 o(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 h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,i=t;;){var u=n.return;if(u===null)break;var d=u.alternate;if(d===null){if(i=u.return,i!==null){n=i;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===n)return p(u),e;if(d===i)return p(u),t;d=d.sibling}throw Error(c(188))}if(n.return!==i.return)n=u,i=d;else{for(var y=!1,j=u.child;j;){if(j===n){y=!0,n=u,i=d;break}if(j===i){y=!0,i=u,n=d;break}j=j.sibling}if(!y){for(j=d.child;j;){if(j===n){y=!0,n=d,i=u;break}if(j===i){y=!0,i=d,n=u;break}j=j.sibling}if(!y)throw Error(c(189))}}if(n.alternate!==i)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,N=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),$=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),xe=Symbol.for("react.memo_cache_sentinel"),pe=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=pe&&e[pe]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case D:return"Profiler";case z:return"StrictMode";case Z:return"Suspense";case W:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case $:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case G:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var ue=Array.isArray,k=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},je=[],I=-1;function E(e){return{current:e}}function H(e){0>I||(e.current=je[I],je[I]=null,I--)}function J(e,t){I++,je[I]=e.current,e.current=t}var ie=E(null),L=E(null),O=E(null),ae=E(null);function be(e,t){switch(J(O,t),J(L,e),J(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xp(t),e=Fp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ie),J(ie,e)}function Ae(){H(ie),H(L),H(O)}function qt(e){e.memoizedState!==null&&J(ae,e);var t=ie.current,n=Fp(t,e.type);t!==n&&(J(L,e),J(ie,n))}function rn(e){L.current===e&&(H(ie),H(L)),ae.current===e&&(H(ae),Bi._currentValue=re)}var _t,wt;function kn(e){if(_t===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_t=t&&t[1]||"",wt=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_t+e+wt}var ql=!1;function Fs(e,t){if(!e||ql)return"";ql=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(Q){var B=Q}Reflect.construct(e,[],P)}else{try{P.call()}catch(Q){B=Q}e.call(P.prototype)}}else{try{throw Error()}catch(Q){B=Q}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(Q){if(Q&&B&&typeof Q.stack=="string")return[Q.stack,B.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=i.DetermineComponentFrameRoot(),y=d[0],j=d[1];if(y&&j){var T=y.split(`
44
+ `),_=j.split(`
45
+ `);for(u=i=0;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;for(;u<_.length&&!_[u].includes("DetermineComponentFrameRoot");)u++;if(i===T.length||u===_.length)for(i=T.length-1,u=_.length-1;1<=i&&0<=u&&T[i]!==_[u];)u--;for(;1<=i&&0<=u;i--,u--)if(T[i]!==_[u]){if(i!==1||u!==1)do if(i--,u--,0>u||T[i]!==_[u]){var K=`
46
+ `+T[i].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=i&&0<=u);break}}}finally{ql=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?kn(n):""}function _l(e,t){switch(e.tag){case 26:case 27:case 5:return kn(e.type);case 16:return kn("Lazy");case 13:return e.child!==t&&t!==null?kn("Suspense Fallback"):kn("Suspense");case 19:return kn("SuspenseList");case 0:case 15:return Fs(e.type,!1);case 11:return Fs(e.type.render,!1);case 1:return Fs(e.type,!0);case 31:return kn("Activity");default:return""}}function cr(e){try{var t="",n=null;do t+=_l(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var Bl=Object.prototype.hasOwnProperty,ee=l.unstable_scheduleCallback,qe=l.unstable_cancelCallback,Ot=l.unstable_shouldYield,Pv=l.unstable_requestPaint,Yt=l.unstable_now,Vv=l.unstable_getCurrentPriorityLevel,Ef=l.unstable_ImmediatePriority,Tf=l.unstable_UserBlockingPriority,ur=l.unstable_NormalPriority,Zv=l.unstable_LowPriority,Rf=l.unstable_IdlePriority,Jv=l.log,Wv=l.unstable_setDisableYieldValue,Ps=null,Xt=null;function va(e){if(typeof Jv=="function"&&Wv(e),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(Ps,e)}catch{}}var Ft=Math.clz32?Math.clz32:nx,ex=Math.log,tx=Math.LN2;function nx(e){return e>>>=0,e===0?32:31-(ex(e)/tx|0)|0}var or=256,dr=262144,fr=4194304;function sl(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 hr(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var u=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var j=i&134217727;return j!==0?(i=j&~d,i!==0?u=sl(i):(y&=j,y!==0?u=sl(y):n||(n=j&~e,n!==0&&(u=sl(n))))):(j=i&~d,j!==0?u=sl(j):y!==0?u=sl(y):n||(n=i&~e,n!==0&&(u=sl(n)))),u===0?0:t!==0&&t!==u&&(t&d)===0&&(d=u&-u,n=t&-t,d>=n||d===32&&(n&4194048)!==0)?t:u}function Vs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ax(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 Af(){var e=fr;return fr<<=1,(fr&62914560)===0&&(fr=4194304),e}function Jc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Zs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function lx(e,t,n,i,u,d){var y=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,T=e.expirationTimes,_=e.hiddenUpdates;for(n=y&~n;0<n;){var K=31-Ft(n),P=1<<K;j[K]=0,T[K]=-1;var B=_[K];if(B!==null)for(_[K]=null,K=0;K<B.length;K++){var Q=B[K];Q!==null&&(Q.lane&=-536870913)}n&=~P}i!==0&&wf(e,i,0),d!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function wf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Ft(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function Of(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Ft(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function Mf(e,t){var n=t&-t;return n=(n&42)!==0?1:Wc(n),(n&(e.suspendedLanes|t))!==0?0:n}function Wc(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 eu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zf(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:gy(e.type))}function Df(e,t){var n=X.p;try{return X.p=e,t()}finally{X.p=n}}var xa=Math.random().toString(36).slice(2),vt="__reactFiber$"+xa,Bt="__reactProps$"+xa,Ll="__reactContainer$"+xa,tu="__reactEvents$"+xa,sx="__reactListeners$"+xa,ix="__reactHandles$"+xa,kf="__reactResources$"+xa,Js="__reactMarker$"+xa;function nu(e){delete e[vt],delete e[Bt],delete e[tu],delete e[sx],delete e[ix]}function Ul(e){var t=e[vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ll]||n[vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ty(e);e!==null;){if(n=e[vt])return n;e=ty(e)}return t}e=n,n=e.parentNode}return null}function Ql(e){if(e=e[vt]||e[Ll]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ws(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Hl(e){var t=e[kf];return t||(t=e[kf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[Js]=!0}var qf=new Set,_f={};function il(e,t){$l(e,t),$l(e+"Capture",t)}function $l(e,t){for(_f[e]=t,e=0;e<t.length;e++)qf.add(t[e])}var rx=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]*$"),Bf={},Lf={};function cx(e){return Bl.call(Lf,e)?!0:Bl.call(Bf,e)?!1:rx.test(e)?Lf[e]=!0:(Bf[e]=!0,!1)}function mr(e,t,n){if(cx(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function pr(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 $n(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ux(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){n=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(y){n=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function au(e){if(!e._valueTracker){var t=Uf(e)?"checked":"value";e._valueTracker=ux(e,t,""+e[t])}}function Qf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Uf(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function yr(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 ox=/[\n"\\]/g;function un(e){return e.replace(ox,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function lu(e,t,n,i,u,d,y,j){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?su(e,y,cn(t)):n!=null?su(e,y,cn(n)):i!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+cn(j):e.removeAttribute("name")}function Hf(e,t,n,i,u,d,y,j){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||n!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){au(e);return}n=n!=null?""+cn(n):"",t=t!=null?""+cn(t):n,j||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=j?e.checked:!!i,e.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),au(e)}function su(e,t,n){t==="number"&&yr(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Gl(e,t,n,i){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&i&&(e[n].defaultSelected=!0)}else{for(n=""+cn(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function $f(e,t,n){if(t!=null&&(t=""+cn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+cn(n):""}function Gf(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(ue(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=cn(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),au(e)}function Kl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dx=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 Kf(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||dx.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function If(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&n[u]!==i&&Kf(e,u,i)}else for(var d in t)t.hasOwnProperty(d)&&Kf(e,d,t[d])}function iu(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 fx=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"]]),hx=/^[\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 gr(e){return hx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Gn(){}var ru=null;function cu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Il=null,Yl=null;function Yf(e){var t=Ql(e);if(t&&(e=t.stateNode)){var n=e[Bt]||null;e:switch(e=t.stateNode,t.type){case"input":if(lu(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="'+un(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var u=i[Bt]||null;if(!u)throw Error(c(90));lu(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&Qf(i)}break e;case"textarea":$f(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Gl(e,!!n.multiple,t,!1)}}}var uu=!1;function Xf(e,t,n){if(uu)return e(t,n);uu=!0;try{var i=e(t);return i}finally{if(uu=!1,(Il!==null||Yl!==null)&&(lc(),Il&&(t=Il,e=Yl,Yl=Il=null,Yf(t),e)))for(t=0;t<e.length;t++)Yf(e[t])}}function ei(e,t){var n=e.stateNode;if(n===null)return null;var i=n[Bt]||null;if(i===null)return null;n=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ou=!1;if(Kn)try{var ti={};Object.defineProperty(ti,"passive",{get:function(){ou=!0}}),window.addEventListener("test",ti,ti),window.removeEventListener("test",ti,ti)}catch{ou=!1}var ja=null,du=null,vr=null;function Ff(){if(vr)return vr;var e,t=du,n=t.length,i,u="value"in ja?ja.value:ja.textContent,d=u.length;for(e=0;e<n&&t[e]===u[e];e++);var y=n-e;for(i=1;i<=y&&t[n-i]===u[d-i];i++);return vr=u.slice(e,1<i?1-i:void 0)}function xr(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 jr(){return!0}function Pf(){return!1}function Lt(e){function t(n,i,u,d,y){this._reactName=n,this._targetInst=u,this.type=i,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(n=e[j],this[j]=n?n(d):d[j]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?jr:Pf,this.isPropagationStopped=Pf,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=jr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=jr)},persist:function(){},isPersistent:jr}),t}var rl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},br=Lt(rl),ni=v({},rl,{view:0,detail:0}),mx=Lt(ni),fu,hu,ai,Sr=v({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,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!==ai&&(ai&&e.type==="mousemove"?(fu=e.screenX-ai.screenX,hu=e.screenY-ai.screenY):hu=fu=0,ai=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:hu}}),Vf=Lt(Sr),px=v({},Sr,{dataTransfer:0}),yx=Lt(px),gx=v({},ni,{relatedTarget:0}),mu=Lt(gx),vx=v({},rl,{animationName:0,elapsedTime:0,pseudoElement:0}),xx=Lt(vx),jx=v({},rl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bx=Lt(jx),Sx=v({},rl,{data:0}),Zf=Lt(Sx),Nx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cx={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"},Ex={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ex[e])?!!t[e]:!1}function pu(){return Tx}var Rx=v({},ni,{key:function(e){if(e.key){var t=Nx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?xr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ax=Lt(Rx),wx=v({},Sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jf=Lt(wx),Ox=v({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),Mx=Lt(Ox),zx=v({},rl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Dx=Lt(zx),kx=v({},Sr,{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}),qx=Lt(kx),_x=v({},rl,{newState:0,oldState:0}),Bx=Lt(_x),Lx=[9,13,27,32],yu=Kn&&"CompositionEvent"in window,li=null;Kn&&"documentMode"in document&&(li=document.documentMode);var Ux=Kn&&"TextEvent"in window&&!li,Wf=Kn&&(!yu||li&&8<li&&11>=li),eh=" ",th=!1;function nh(e,t){switch(e){case"keyup":return Lx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ah(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xl=!1;function Qx(e,t){switch(e){case"compositionend":return ah(t);case"keypress":return t.which!==32?null:(th=!0,eh);case"textInput":return e=t.data,e===eh&&th?null:e;default:return null}}function Hx(e,t){if(Xl)return e==="compositionend"||!yu&&nh(e,t)?(e=Ff(),vr=du=ja=null,Xl=!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 Wf&&t.locale!=="ko"?null:t.data;default:return null}}var $x={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 lh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$x[e.type]:t==="textarea"}function sh(e,t,n,i){Il?Yl?Yl.push(i):Yl=[i]:Il=i,t=dc(t,"onChange"),0<t.length&&(n=new br("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var si=null,ii=null;function Gx(e){Hp(e,0)}function Nr(e){var t=Ws(e);if(Qf(t))return e}function ih(e,t){if(e==="change")return t}var rh=!1;if(Kn){var gu;if(Kn){var vu="oninput"in document;if(!vu){var ch=document.createElement("div");ch.setAttribute("oninput","return;"),vu=typeof ch.oninput=="function"}gu=vu}else gu=!1;rh=gu&&(!document.documentMode||9<document.documentMode)}function uh(){si&&(si.detachEvent("onpropertychange",oh),ii=si=null)}function oh(e){if(e.propertyName==="value"&&Nr(ii)){var t=[];sh(t,ii,e,cu(e)),Xf(Gx,t)}}function Kx(e,t,n){e==="focusin"?(uh(),si=t,ii=n,si.attachEvent("onpropertychange",oh)):e==="focusout"&&uh()}function Ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nr(ii)}function Yx(e,t){if(e==="click")return Nr(t)}function Xx(e,t){if(e==="input"||e==="change")return Nr(t)}function Fx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Fx;function ri(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var u=n[i];if(!Bl.call(t,u)||!Pt(e[u],t[u]))return!1}return!0}function dh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fh(e,t){var n=dh(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dh(n)}}function hh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=yr(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=yr(e.document)}return t}function xu(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 Px=Kn&&"documentMode"in document&&11>=document.documentMode,Fl=null,ju=null,ci=null,bu=!1;function ph(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bu||Fl==null||Fl!==yr(i)||(i=Fl,"selectionStart"in i&&xu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ci&&ri(ci,i)||(ci=i,i=dc(ju,"onSelect"),0<i.length&&(t=new br("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Fl)))}function cl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pl={animationend:cl("Animation","AnimationEnd"),animationiteration:cl("Animation","AnimationIteration"),animationstart:cl("Animation","AnimationStart"),transitionrun:cl("Transition","TransitionRun"),transitionstart:cl("Transition","TransitionStart"),transitioncancel:cl("Transition","TransitionCancel"),transitionend:cl("Transition","TransitionEnd")},Su={},yh={};Kn&&(yh=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function ul(e){if(Su[e])return Su[e];if(!Pl[e])return e;var t=Pl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yh)return Su[e]=t[n];return e}var gh=ul("animationend"),vh=ul("animationiteration"),xh=ul("animationstart"),Vx=ul("transitionrun"),Zx=ul("transitionstart"),Jx=ul("transitioncancel"),jh=ul("transitionend"),bh=new Map,Nu="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(" ");Nu.push("scrollEnd");function Tn(e,t){bh.set(e,t),il(t,[e])}var Cr=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)},on=[],Vl=0,Cu=0;function Er(){for(var e=Vl,t=Cu=Vl=0;t<e;){var n=on[t];on[t++]=null;var i=on[t];on[t++]=null;var u=on[t];on[t++]=null;var d=on[t];if(on[t++]=null,i!==null&&u!==null){var y=i.pending;y===null?u.next=u:(u.next=y.next,y.next=u),i.pending=u}d!==0&&Sh(n,u,d)}}function Tr(e,t,n,i){on[Vl++]=e,on[Vl++]=t,on[Vl++]=n,on[Vl++]=i,Cu|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Eu(e,t,n,i){return Tr(e,t,n,i),Rr(e)}function ol(e,t){return Tr(e,null,null,t),Rr(e)}function Sh(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var u=!1,d=e.return;d!==null;)d.childLanes|=n,i=d.alternate,i!==null&&(i.childLanes|=n),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(u=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,u&&t!==null&&(u=31-Ft(n),e=d.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),d):null}function Rr(e){if(50<Oi)throw Oi=0,qo=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zl={};function Wx(e,t,n,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,n,i){return new Wx(e,t,n,i)}function Tu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function In(e,t){var n=e.alternate;return n===null?(n=Vt(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 Nh(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 Ar(e,t,n,i,u,d){var y=0;if(i=e,typeof e=="function")Tu(e)&&(y=1);else if(typeof e=="string")y=lb(e,n,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Vt(31,n,t,u),e.elementType=te,e.lanes=d,e;case A:return dl(n.children,u,d,t);case z:y=8,u|=24;break;case D:return e=Vt(12,n,t,u|2),e.elementType=D,e.lanes=d,e;case Z:return e=Vt(13,n,t,u),e.elementType=Z,e.lanes=d,e;case W:return e=Vt(19,n,t,u),e.elementType=W,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:y=10;break e;case F:y=9;break e;case U:y=11;break e;case V:y=14;break e;case G:y=16,i=null;break e}y=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=Vt(y,n,t,u),t.elementType=e,t.type=i,t.lanes=d,t}function dl(e,t,n,i){return e=Vt(7,e,i,t),e.lanes=n,e}function Ru(e,t,n){return e=Vt(6,e,null,t),e.lanes=n,e}function Ch(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function Au(e,t,n){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Eh=new WeakMap;function dn(e,t){if(typeof e=="object"&&e!==null){var n=Eh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:cr(t)},Eh.set(e,t),t)}return{value:e,source:t,stack:cr(t)}}var Jl=[],Wl=0,wr=null,ui=0,fn=[],hn=0,ba=null,qn=1,_n="";function Yn(e,t){Jl[Wl++]=ui,Jl[Wl++]=wr,wr=e,ui=t}function Th(e,t,n){fn[hn++]=qn,fn[hn++]=_n,fn[hn++]=ba,ba=e;var i=qn;e=_n;var u=32-Ft(i)-1;i&=~(1<<u),n+=1;var d=32-Ft(t)+u;if(30<d){var y=u-u%5;d=(i&(1<<y)-1).toString(32),i>>=y,u-=y,qn=1<<32-Ft(t)+u|n<<u|i,_n=d+e}else qn=1<<d|n<<u|i,_n=e}function wu(e){e.return!==null&&(Yn(e,1),Th(e,1,0))}function Ou(e){for(;e===wr;)wr=Jl[--Wl],Jl[Wl]=null,ui=Jl[--Wl],Jl[Wl]=null;for(;e===ba;)ba=fn[--hn],fn[hn]=null,_n=fn[--hn],fn[hn]=null,qn=fn[--hn],fn[hn]=null}function Rh(e,t){fn[hn++]=qn,fn[hn++]=_n,fn[hn++]=ba,qn=t.id,_n=t.overflow,ba=e}var xt=null,Fe=null,De=!1,Sa=null,mn=!1,Mu=Error(c(519));function Na(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oi(dn(t,e)),Mu}function Ah(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[vt]=e,t[Bt]=i,n){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(n=0;n<zi.length;n++)Oe(zi[n],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),Hf(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),Gf(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Ip(t.textContent,n)?(i.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),i.onScroll!=null&&Oe("scroll",t),i.onScrollEnd!=null&&Oe("scrollend",t),i.onClick!=null&&(t.onclick=Gn),t=!0):t=!1,t||Na(e,!0)}function wh(e){for(xt=e.return;xt;)switch(xt.tag){case 5:case 31:case 13:mn=!1;return;case 27:case 3:mn=!0;return;default:xt=xt.return}}function es(e){if(e!==xt)return!1;if(!De)return wh(e),De=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Vo(e.type,e.memoizedProps)),n=!n),n&&Fe&&Na(e),wh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Fe=ey(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Fe=ey(e)}else t===27?(t=Fe,Ba(e.type)?(e=td,td=null,Fe=e):Fe=t):Fe=xt?yn(e.stateNode.nextSibling):null;return!0}function fl(){Fe=xt=null,De=!1}function zu(){var e=Sa;return e!==null&&($t===null?$t=e:$t.push.apply($t,e),Sa=null),e}function oi(e){Sa===null?Sa=[e]:Sa.push(e)}var Du=E(null),hl=null,Xn=null;function Ca(e,t,n){J(Du,t._currentValue),t._currentValue=n}function Fn(e){e._currentValue=Du.current,H(Du)}function ku(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function qu(e,t,n,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var d=u.dependencies;if(d!==null){var y=u.child;d=d.firstContext;e:for(;d!==null;){var j=d;d=u;for(var T=0;T<t.length;T++)if(j.context===t[T]){d.lanes|=n,j=d.alternate,j!==null&&(j.lanes|=n),ku(d.return,n,e),i||(y=null);break e}d=j.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(c(341));y.lanes|=n,d=y.alternate,d!==null&&(d.lanes|=n),ku(y,n,e),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===e){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function ts(e,t,n,i){e=null;for(var u=t,d=!1;u!==null;){if(!d){if((u.flags&524288)!==0)d=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(c(387));if(y=y.memoizedProps,y!==null){var j=u.type;Pt(u.pendingProps.value,y.value)||(e!==null?e.push(j):e=[j])}}else if(u===ae.current){if(y=u.alternate,y===null)throw Error(c(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Bi):e=[Bi])}u=u.return}e!==null&&qu(t,e,n,i),t.flags|=262144}function Or(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ml(e){hl=e,Xn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function jt(e){return Oh(hl,e)}function Mr(e,t){return hl===null&&ml(e),Oh(e,t)}function Oh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xn===null){if(e===null)throw Error(c(308));Xn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xn=Xn.next=t;return n}var ej=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},tj=l.unstable_scheduleCallback,nj=l.unstable_NormalPriority,it={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _u(){return{controller:new ej,data:new Map,refCount:0}}function di(e){e.refCount--,e.refCount===0&&tj(nj,function(){e.controller.abort()})}var fi=null,Bu=0,ns=0,as=null;function aj(e,t){if(fi===null){var n=fi=[];Bu=0,ns=Ho(),as={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Bu++,t.then(Mh,Mh),t}function Mh(){if(--Bu===0&&fi!==null){as!==null&&(as.status="fulfilled");var e=fi;fi=null,ns=0,as=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function lj(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),i}var zh=k.S;k.S=function(e,t){pp=Yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&aj(e,t),zh!==null&&zh(e,t)};var pl=E(null);function Lu(){var e=pl.current;return e!==null?e:Ye.pooledCache}function zr(e,t){t===null?J(pl,pl.current):J(pl,t.pool)}function Dh(){var e=Lu();return e===null?null:{parent:it._currentValue,pool:e}}var ls=Error(c(460)),Uu=Error(c(474)),Dr=Error(c(542)),kr={then:function(){}};function kh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Gn,Gn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bh(e),e;default:if(typeof t.status=="string")t.then(Gn,Gn);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bh(e),e}throw gl=t,ls}}function yl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(gl=n,ls):n}}var gl=null;function _h(){if(gl===null)throw Error(c(459));var e=gl;return gl=null,e}function Bh(e){if(e===ls||e===Dr)throw Error(c(483))}var ss=null,hi=0;function qr(e){var t=hi;return hi+=1,ss===null&&(ss=[]),qh(ss,e,t)}function mi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _r(e,t){throw t.$$typeof===N?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Lh(e){function t(M,w){if(e){var q=M.deletions;q===null?(M.deletions=[w],M.flags|=16):q.push(w)}}function n(M,w){if(!e)return null;for(;w!==null;)t(M,w),w=w.sibling;return null}function i(M){for(var w=new Map;M!==null;)M.key!==null?w.set(M.key,M):w.set(M.index,M),M=M.sibling;return w}function u(M,w){return M=In(M,w),M.index=0,M.sibling=null,M}function d(M,w,q){return M.index=q,e?(q=M.alternate,q!==null?(q=q.index,q<w?(M.flags|=67108866,w):q):(M.flags|=67108866,w)):(M.flags|=1048576,w)}function y(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function j(M,w,q,Y){return w===null||w.tag!==6?(w=Ru(q,M.mode,Y),w.return=M,w):(w=u(w,q),w.return=M,w)}function T(M,w,q,Y){var he=q.type;return he===A?K(M,w,q.props.children,Y,q.key):w!==null&&(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===G&&yl(he)===w.type)?(w=u(w,q.props),mi(w,q),w.return=M,w):(w=Ar(q.type,q.key,q.props,null,M.mode,Y),mi(w,q),w.return=M,w)}function _(M,w,q,Y){return w===null||w.tag!==4||w.stateNode.containerInfo!==q.containerInfo||w.stateNode.implementation!==q.implementation?(w=Au(q,M.mode,Y),w.return=M,w):(w=u(w,q.children||[]),w.return=M,w)}function K(M,w,q,Y,he){return w===null||w.tag!==7?(w=dl(q,M.mode,Y,he),w.return=M,w):(w=u(w,q),w.return=M,w)}function P(M,w,q){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=Ru(""+w,M.mode,q),w.return=M,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case b:return q=Ar(w.type,w.key,w.props,null,M.mode,q),mi(q,w),q.return=M,q;case C:return w=Au(w,M.mode,q),w.return=M,w;case G:return w=yl(w),P(M,w,q)}if(ue(w)||se(w))return w=dl(w,M.mode,q,null),w.return=M,w;if(typeof w.then=="function")return P(M,qr(w),q);if(w.$$typeof===$)return P(M,Mr(M,w),q);_r(M,w)}return null}function B(M,w,q,Y){var he=w!==null?w.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return he!==null?null:j(M,w,""+q,Y);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return q.key===he?T(M,w,q,Y):null;case C:return q.key===he?_(M,w,q,Y):null;case G:return q=yl(q),B(M,w,q,Y)}if(ue(q)||se(q))return he!==null?null:K(M,w,q,Y,null);if(typeof q.then=="function")return B(M,w,qr(q),Y);if(q.$$typeof===$)return B(M,w,Mr(M,q),Y);_r(M,q)}return null}function Q(M,w,q,Y,he){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return M=M.get(q)||null,j(w,M,""+Y,he);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return M=M.get(Y.key===null?q:Y.key)||null,T(w,M,Y,he);case C:return M=M.get(Y.key===null?q:Y.key)||null,_(w,M,Y,he);case G:return Y=yl(Y),Q(M,w,q,Y,he)}if(ue(Y)||se(Y))return M=M.get(q)||null,K(w,M,Y,he,null);if(typeof Y.then=="function")return Q(M,w,q,qr(Y),he);if(Y.$$typeof===$)return Q(M,w,q,Mr(w,Y),he);_r(w,Y)}return null}function oe(M,w,q,Y){for(var he=null,_e=null,de=w,Ee=w=0,ze=null;de!==null&&Ee<q.length;Ee++){de.index>Ee?(ze=de,de=null):ze=de.sibling;var Be=B(M,de,q[Ee],Y);if(Be===null){de===null&&(de=ze);break}e&&de&&Be.alternate===null&&t(M,de),w=d(Be,w,Ee),_e===null?he=Be:_e.sibling=Be,_e=Be,de=ze}if(Ee===q.length)return n(M,de),De&&Yn(M,Ee),he;if(de===null){for(;Ee<q.length;Ee++)de=P(M,q[Ee],Y),de!==null&&(w=d(de,w,Ee),_e===null?he=de:_e.sibling=de,_e=de);return De&&Yn(M,Ee),he}for(de=i(de);Ee<q.length;Ee++)ze=Q(de,M,Ee,q[Ee],Y),ze!==null&&(e&&ze.alternate!==null&&de.delete(ze.key===null?Ee:ze.key),w=d(ze,w,Ee),_e===null?he=ze:_e.sibling=ze,_e=ze);return e&&de.forEach(function($a){return t(M,$a)}),De&&Yn(M,Ee),he}function ye(M,w,q,Y){if(q==null)throw Error(c(151));for(var he=null,_e=null,de=w,Ee=w=0,ze=null,Be=q.next();de!==null&&!Be.done;Ee++,Be=q.next()){de.index>Ee?(ze=de,de=null):ze=de.sibling;var $a=B(M,de,Be.value,Y);if($a===null){de===null&&(de=ze);break}e&&de&&$a.alternate===null&&t(M,de),w=d($a,w,Ee),_e===null?he=$a:_e.sibling=$a,_e=$a,de=ze}if(Be.done)return n(M,de),De&&Yn(M,Ee),he;if(de===null){for(;!Be.done;Ee++,Be=q.next())Be=P(M,Be.value,Y),Be!==null&&(w=d(Be,w,Ee),_e===null?he=Be:_e.sibling=Be,_e=Be);return De&&Yn(M,Ee),he}for(de=i(de);!Be.done;Ee++,Be=q.next())Be=Q(de,M,Ee,Be.value,Y),Be!==null&&(e&&Be.alternate!==null&&de.delete(Be.key===null?Ee:Be.key),w=d(Be,w,Ee),_e===null?he=Be:_e.sibling=Be,_e=Be);return e&&de.forEach(function(pb){return t(M,pb)}),De&&Yn(M,Ee),he}function Ie(M,w,q,Y){if(typeof q=="object"&&q!==null&&q.type===A&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case b:e:{for(var he=q.key;w!==null;){if(w.key===he){if(he=q.type,he===A){if(w.tag===7){n(M,w.sibling),Y=u(w,q.props.children),Y.return=M,M=Y;break e}}else if(w.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===G&&yl(he)===w.type){n(M,w.sibling),Y=u(w,q.props),mi(Y,q),Y.return=M,M=Y;break e}n(M,w);break}else t(M,w);w=w.sibling}q.type===A?(Y=dl(q.props.children,M.mode,Y,q.key),Y.return=M,M=Y):(Y=Ar(q.type,q.key,q.props,null,M.mode,Y),mi(Y,q),Y.return=M,M=Y)}return y(M);case C:e:{for(he=q.key;w!==null;){if(w.key===he)if(w.tag===4&&w.stateNode.containerInfo===q.containerInfo&&w.stateNode.implementation===q.implementation){n(M,w.sibling),Y=u(w,q.children||[]),Y.return=M,M=Y;break e}else{n(M,w);break}else t(M,w);w=w.sibling}Y=Au(q,M.mode,Y),Y.return=M,M=Y}return y(M);case G:return q=yl(q),Ie(M,w,q,Y)}if(ue(q))return oe(M,w,q,Y);if(se(q)){if(he=se(q),typeof he!="function")throw Error(c(150));return q=he.call(q),ye(M,w,q,Y)}if(typeof q.then=="function")return Ie(M,w,qr(q),Y);if(q.$$typeof===$)return Ie(M,w,Mr(M,q),Y);_r(M,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,w!==null&&w.tag===6?(n(M,w.sibling),Y=u(w,q),Y.return=M,M=Y):(n(M,w),Y=Ru(q,M.mode,Y),Y.return=M,M=Y),y(M)):n(M,w)}return function(M,w,q,Y){try{hi=0;var he=Ie(M,w,q,Y);return ss=null,he}catch(de){if(de===ls||de===Dr)throw de;var _e=Vt(29,de,null,M.mode);return _e.lanes=Y,_e.return=M,_e}finally{}}}var vl=Lh(!0),Uh=Lh(!1),Ea=!1;function Qu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hu(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 Ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Le&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=Rr(e),Sh(e,null,n),t}return Tr(e,i,t,n),Rr(e)}function pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Of(e,n)}}function $u(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var y={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};d===null?u=d=y:d=d.next=y,n=n.next}while(n!==null);d===null?u=d=t:d=d.next=t}else u=d=t;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Gu=!1;function yi(){if(Gu){var e=as;if(e!==null)throw e}}function gi(e,t,n,i){Gu=!1;var u=e.updateQueue;Ea=!1;var d=u.firstBaseUpdate,y=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var T=j,_=T.next;T.next=null,y===null?d=_:y.next=_,y=T;var K=e.alternate;K!==null&&(K=K.updateQueue,j=K.lastBaseUpdate,j!==y&&(j===null?K.firstBaseUpdate=_:j.next=_,K.lastBaseUpdate=T))}if(d!==null){var P=u.baseState;y=0,K=_=T=null,j=d;do{var B=j.lane&-536870913,Q=B!==j.lane;if(Q?(Me&B)===B:(i&B)===B){B!==0&&B===ns&&(Gu=!0),K!==null&&(K=K.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var oe=e,ye=j;B=t;var Ie=n;switch(ye.tag){case 1:if(oe=ye.payload,typeof oe=="function"){P=oe.call(Ie,P,B);break e}P=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=ye.payload,B=typeof oe=="function"?oe.call(Ie,P,B):oe,B==null)break e;P=v({},P,B);break e;case 2:Ea=!0}}B=j.callback,B!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=u.callbacks,Q===null?u.callbacks=[B]:Q.push(B))}else Q={lane:B,tag:j.tag,payload:j.payload,callback:j.callback,next:null},K===null?(_=K=Q,T=P):K=K.next=Q,y|=B;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;Q=j,j=Q.next,Q.next=null,u.lastBaseUpdate=Q,u.shared.pending=null}}while(!0);K===null&&(T=P),u.baseState=T,u.firstBaseUpdate=_,u.lastBaseUpdate=K,d===null&&(u.shared.lanes=0),za|=y,e.lanes=y,e.memoizedState=P}}function Qh(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Hh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qh(n[e],t)}var is=E(null),Br=E(0);function $h(e,t){e=aa,J(Br,e),J(is,t),aa=e|t.baseLanes}function Ku(){J(Br,aa),J(is,is.current)}function Iu(){aa=Br.current,H(is),H(Br)}var Zt=E(null),pn=null;function Aa(e){var t=e.alternate;J(at,at.current&1),J(Zt,e),pn===null&&(t===null||is.current!==null||t.memoizedState!==null)&&(pn=e)}function Yu(e){J(at,at.current),J(Zt,e),pn===null&&(pn=e)}function Gh(e){e.tag===22?(J(at,at.current),J(Zt,e),pn===null&&(pn=e)):wa()}function wa(){J(at,at.current),J(Zt,Zt.current)}function Jt(e){H(Zt),pn===e&&(pn=null),H(at)}var at=E(0);function Lr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Wo(n)||ed(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 Pn=0,Ce=null,Ge=null,rt=null,Ur=!1,rs=!1,xl=!1,Qr=0,vi=0,cs=null,sj=0;function et(){throw Error(c(321))}function Xu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function Fu(e,t,n,i,u,d){return Pn=d,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Tm:uo,xl=!1,d=n(i,u),xl=!1,rs&&(d=Ih(t,n,i,u)),Kh(e),d}function Kh(e){k.H=bi;var t=Ge!==null&&Ge.next!==null;if(Pn=0,rt=Ge=Ce=null,Ur=!1,vi=0,cs=null,t)throw Error(c(300));e===null||ct||(e=e.dependencies,e!==null&&Or(e)&&(ct=!0))}function Ih(e,t,n,i){Ce=e;var u=0;do{if(rs&&(cs=null),vi=0,rs=!1,25<=u)throw Error(c(301));if(u+=1,rt=Ge=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}k.H=Rm,d=t(n,i)}while(rs);return d}function ij(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?xi(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Ce.flags|=1024),t}function Pu(){var e=Qr!==0;return Qr=0,e}function Vu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Zu(e){if(Ur){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ur=!1}Pn=0,rt=Ge=Ce=null,rs=!1,vi=Qr=0,cs=null}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ce.memoizedState=rt=e:rt=rt.next=e,rt}function lt(){if(Ge===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=rt===null?Ce.memoizedState:rt.next;if(t!==null)rt=t,Ge=e;else{if(e===null)throw Ce.alternate===null?Error(c(467)):Error(c(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},rt===null?Ce.memoizedState=rt=e:rt=rt.next=e}return rt}function Hr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xi(e){var t=vi;return vi+=1,cs===null&&(cs=[]),e=qh(cs,e,t),t=Ce,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Tm:uo),e}function $r(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xi(e);if(e.$$typeof===$)return jt(e)}throw Error(c(438,String(e)))}function Ju(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=Ce.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Hr(),Ce.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=xe;return t.index++,n}function Vn(e,t){return typeof t=="function"?t(e):t}function Gr(e){var t=lt();return Wu(t,Ge,e)}function Wu(e,t,n){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=n;var u=e.baseQueue,d=i.pending;if(d!==null){if(u!==null){var y=u.next;u.next=d.next,d.next=y}t.baseQueue=u=d,i.pending=null}if(d=e.baseState,u===null)e.memoizedState=d;else{t=u.next;var j=y=null,T=null,_=t,K=!1;do{var P=_.lane&-536870913;if(P!==_.lane?(Me&P)===P:(Pn&P)===P){var B=_.revertLane;if(B===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),P===ns&&(K=!0);else if((Pn&B)===B){_=_.next,B===ns&&(K=!0);continue}else P={lane:0,revertLane:_.revertLane,gesture:null,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},T===null?(j=T=P,y=d):T=T.next=P,Ce.lanes|=B,za|=B;P=_.action,xl&&n(d,P),d=_.hasEagerState?_.eagerState:n(d,P)}else B={lane:P,revertLane:_.revertLane,gesture:_.gesture,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null},T===null?(j=T=B,y=d):T=T.next=B,Ce.lanes|=P,za|=P;_=_.next}while(_!==null&&_!==t);if(T===null?y=d:T.next=j,!Pt(d,e.memoizedState)&&(ct=!0,K&&(n=as,n!==null)))throw n;e.memoizedState=d,e.baseState=y,e.baseQueue=T,i.lastRenderedState=d}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function eo(e){var t=lt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var i=n.dispatch,u=n.pending,d=t.memoizedState;if(u!==null){n.pending=null;var y=u=u.next;do d=e(d,y.action),y=y.next;while(y!==u);Pt(d,t.memoizedState)||(ct=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,i]}function Yh(e,t,n){var i=Ce,u=lt(),d=De;if(d){if(n===void 0)throw Error(c(407));n=n()}else n=t();var y=!Pt((Ge||u).memoizedState,n);if(y&&(u.memoizedState=n,ct=!0),u=u.queue,ao(Ph.bind(null,i,u,e),[e]),u.getSnapshot!==t||y||rt!==null&&rt.memoizedState.tag&1){if(i.flags|=2048,us(9,{destroy:void 0},Fh.bind(null,i,u,n,t),null),Ye===null)throw Error(c(349));d||(Pn&127)!==0||Xh(i,t,n)}return n}function Xh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=Hr(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Fh(e,t,n,i){t.value=n,t.getSnapshot=i,Vh(t)&&Zh(e)}function Ph(e,t,n){return n(function(){Vh(t)&&Zh(e)})}function Vh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function Zh(e){var t=ol(e,2);t!==null&&Gt(t,e,2)}function to(e){var t=Mt();if(typeof e=="function"){var n=e;if(e=n(),xl){va(!0);try{n()}finally{va(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:e},t}function Jh(e,t,n,i){return e.baseState=n,Wu(e,Ge,typeof i=="function"?i:Vn)}function rj(e,t,n,i,u){if(Yr(e))throw Error(c(485));if(e=t.action,e!==null){var d={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};k.T!==null?n(!0):d.isTransition=!1,i(d),n=t.pending,n===null?(d.next=t.pending=d,Wh(t,d)):(d.next=n.next,t.pending=n.next=d)}}function Wh(e,t){var n=t.action,i=t.payload,u=e.state;if(t.isTransition){var d=k.T,y={};k.T=y;try{var j=n(u,i),T=k.S;T!==null&&T(y,j),em(e,t,j)}catch(_){no(e,t,_)}finally{d!==null&&y.types!==null&&(d.types=y.types),k.T=d}}else try{d=n(u,i),em(e,t,d)}catch(_){no(e,t,_)}}function em(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){tm(e,t,i)},function(i){return no(e,t,i)}):tm(e,t,n)}function tm(e,t,n){t.status="fulfilled",t.value=n,nm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wh(e,n)))}function no(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,nm(t),t=t.next;while(t!==i)}e.action=null}function nm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function am(e,t){return t}function lm(e,t){if(De){var n=Ye.formState;if(n!==null){e:{var i=Ce;if(De){if(Fe){t:{for(var u=Fe,d=mn;u.nodeType!==8;){if(!d){u=null;break t}if(u=yn(u.nextSibling),u===null){u=null;break t}}d=u.data,u=d==="F!"||d==="F"?u:null}if(u){Fe=yn(u.nextSibling),i=u.data==="F!";break e}}Na(i)}i=!1}i&&(t=n[0])}}return n=Mt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:am,lastRenderedState:t},n.queue=i,n=Nm.bind(null,Ce,i),i.dispatch=n,i=to(!1),d=co.bind(null,Ce,!1,i.queue),i=Mt(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=rj.bind(null,Ce,u,d,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function sm(e){var t=lt();return im(t,Ge,e)}function im(e,t,n){if(t=Wu(e,t,am)[0],e=Gr(Vn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=xi(t)}catch(y){throw y===ls?Dr:y}else i=t;t=lt();var u=t.queue,d=u.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,us(9,{destroy:void 0},cj.bind(null,u,n),null)),[i,d,e]}function cj(e,t){e.action=t}function rm(e){var t=lt(),n=Ge;if(n!==null)return im(t,n,e);lt(),t=t.memoizedState,n=lt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function us(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=Hr(),Ce.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function cm(){return lt().memoizedState}function Kr(e,t,n,i){var u=Mt();Ce.flags|=e,u.memoizedState=us(1|t,{destroy:void 0},n,i===void 0?null:i)}function Ir(e,t,n,i){var u=lt();i=i===void 0?null:i;var d=u.memoizedState.inst;Ge!==null&&i!==null&&Xu(i,Ge.memoizedState.deps)?u.memoizedState=us(t,d,n,i):(Ce.flags|=e,u.memoizedState=us(1|t,d,n,i))}function um(e,t){Kr(8390656,8,e,t)}function ao(e,t){Ir(2048,8,e,t)}function uj(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=Hr(),Ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function om(e){var t=lt().memoizedState;return uj({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function dm(e,t){return Ir(4,2,e,t)}function fm(e,t){return Ir(4,4,e,t)}function hm(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 mm(e,t,n){n=n!=null?n.concat([e]):null,Ir(4,4,hm.bind(null,t,e),n)}function lo(){}function pm(e,t){var n=lt();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Xu(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function ym(e,t){var n=lt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Xu(t,i[1]))return i[0];if(i=e(),xl){va(!0);try{e()}finally{va(!1)}}return n.memoizedState=[i,t],i}function so(e,t,n){return n===void 0||(Pn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=gp(),Ce.lanes|=e,za|=e,n)}function gm(e,t,n,i){return Pt(n,t)?n:is.current!==null?(e=so(e,n,i),Pt(e,t)||(ct=!0),e):(Pn&42)===0||(Pn&1073741824)!==0&&(Me&261930)===0?(ct=!0,e.memoizedState=n):(e=gp(),Ce.lanes|=e,za|=e,t)}function vm(e,t,n,i,u){var d=X.p;X.p=d!==0&&8>d?d:8;var y=k.T,j={};k.T=j,co(e,!1,t,n);try{var T=u(),_=k.S;if(_!==null&&_(j,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var K=lj(T,i);ji(e,t,K,tn(e))}else ji(e,t,i,tn(e))}catch(P){ji(e,t,{then:function(){},status:"rejected",reason:P},tn())}finally{X.p=d,y!==null&&j.types!==null&&(y.types=j.types),k.T=y}}function oj(){}function io(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=xm(e).queue;vm(e,u,t,re,n===null?oj:function(){return jm(e),n(i)})}function xm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jm(e){var t=xm(e);t.next===null&&(t=e.alternate.memoizedState),ji(e,t.next.queue,{},tn())}function ro(){return jt(Bi)}function bm(){return lt().memoizedState}function Sm(){return lt().memoizedState}function dj(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=tn();e=Ta(n);var i=Ra(t,e,n);i!==null&&(Gt(i,t,n),pi(i,t,n)),t={cache:_u()},e.payload=t;return}t=t.return}}function fj(e,t,n){var i=tn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Yr(e)?Cm(t,n):(n=Eu(e,t,n,i),n!==null&&(Gt(n,e,i),Em(n,t,i)))}function Nm(e,t,n){var i=tn();ji(e,t,n,i)}function ji(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yr(e))Cm(t,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,j=d(y,n);if(u.hasEagerState=!0,u.eagerState=j,Pt(j,y))return Tr(e,t,u,0),Ye===null&&Er(),!1}catch{}finally{}if(n=Eu(e,t,u,i),n!==null)return Gt(n,e,i),Em(n,t,i),!0}return!1}function co(e,t,n,i){if(i={lane:2,revertLane:Ho(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Yr(e)){if(t)throw Error(c(479))}else t=Eu(e,n,i,2),t!==null&&Gt(t,e,2)}function Yr(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Cm(e,t){rs=Ur=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Em(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Of(e,n)}}var bi={readContext:jt,use:$r,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};bi.useEffectEvent=et;var Tm={readContext:jt,use:$r,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:um,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Kr(4194308,4,hm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kr(4194308,4,e,t)},useInsertionEffect:function(e,t){Kr(4,2,e,t)},useMemo:function(e,t){var n=Mt();t=t===void 0?null:t;var i=e();if(xl){va(!0);try{e()}finally{va(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Mt();if(n!==void 0){var u=n(t);if(xl){va(!0);try{n(t)}finally{va(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=fj.bind(null,Ce,e),[i.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:function(e){e=to(e);var t=e.queue,n=Nm.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:lo,useDeferredValue:function(e,t){var n=Mt();return so(n,e,t)},useTransition:function(){var e=to(!1);return e=vm.bind(null,Ce,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ce,u=Mt();if(De){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Ye===null)throw Error(c(349));(Me&127)!==0||Xh(i,t,n)}u.memoizedState=n;var d={value:n,getSnapshot:t};return u.queue=d,um(Ph.bind(null,i,d,e),[e]),i.flags|=2048,us(9,{destroy:void 0},Fh.bind(null,i,d,n,t),null),n},useId:function(){var e=Mt(),t=Ye.identifierPrefix;if(De){var n=_n,i=qn;n=(i&~(1<<32-Ft(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Qr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=sj++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ro,useFormState:lm,useActionState:lm,useOptimistic:function(e){var t=Mt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=co.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ju,useCacheRefresh:function(){return Mt().memoizedState=dj.bind(null,Ce)},useEffectEvent:function(e){var t=Mt(),n={impl:e};return t.memoizedState=n,function(){if((Le&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},uo={readContext:jt,use:$r,useCallback:pm,useContext:jt,useEffect:ao,useImperativeHandle:mm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:ym,useReducer:Gr,useRef:cm,useState:function(){return Gr(Vn)},useDebugValue:lo,useDeferredValue:function(e,t){var n=lt();return gm(n,Ge.memoizedState,e,t)},useTransition:function(){var e=Gr(Vn)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:xi(e),t]},useSyncExternalStore:Yh,useId:bm,useHostTransitionStatus:ro,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=lt();return Jh(n,Ge,e,t)},useMemoCache:Ju,useCacheRefresh:Sm};uo.useEffectEvent=om;var Rm={readContext:jt,use:$r,useCallback:pm,useContext:jt,useEffect:ao,useImperativeHandle:mm,useInsertionEffect:dm,useLayoutEffect:fm,useMemo:ym,useReducer:eo,useRef:cm,useState:function(){return eo(Vn)},useDebugValue:lo,useDeferredValue:function(e,t){var n=lt();return Ge===null?so(n,e,t):gm(n,Ge.memoizedState,e,t)},useTransition:function(){var e=eo(Vn)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:xi(e),t]},useSyncExternalStore:Yh,useId:bm,useHostTransitionStatus:ro,useFormState:rm,useActionState:rm,useOptimistic:function(e,t){var n=lt();return Ge!==null?Jh(n,Ge,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ju,useCacheRefresh:Sm};Rm.useEffectEvent=om;function oo(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fo={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=tn(),u=Ta(i);u.payload=t,n!=null&&(u.callback=n),t=Ra(e,u,i),t!==null&&(Gt(t,e,i),pi(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=tn(),u=Ta(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Ra(e,u,i),t!==null&&(Gt(t,e,i),pi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tn(),i=Ta(n);i.tag=2,t!=null&&(i.callback=t),t=Ra(e,i,n),t!==null&&(Gt(t,e,n),pi(t,e,n))}};function Am(e,t,n,i,u,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,y):t.prototype&&t.prototype.isPureReactComponent?!ri(n,i)||!ri(u,d):!0}function wm(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&fo.enqueueReplaceState(t,t.state,null)}function jl(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Om(e){Cr(e)}function Mm(e){console.error(e)}function zm(e){Cr(e)}function Xr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Dm(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function ho(e,t,n){return n=Ta(n),n.tag=3,n.payload={element:null},n.callback=function(){Xr(e,t)},n}function km(e){return e=Ta(e),e.tag=3,e}function qm(e,t,n,i){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var d=i.value;e.payload=function(){return u(d)},e.callback=function(){Dm(t,n,i)}}var y=n.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Dm(t,n,i),typeof u!="function"&&(Da===null?Da=new Set([this]):Da.add(this));var j=i.stack;this.componentDidCatch(i.value,{componentStack:j!==null?j:""})})}function hj(e,t,n,i,u){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ts(t,n,u,!0),n=Zt.current,n!==null){switch(n.tag){case 31:case 13:return pn===null?sc():n.alternate===null&&tt===0&&(tt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===kr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Lo(e,i,u)),!1;case 22:return n.flags|=65536,i===kr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Lo(e,i,u)),!1}throw Error(c(435,n.tag))}return Lo(e,i,u),sc(),!1}if(De)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Mu&&(e=Error(c(422),{cause:i}),oi(dn(e,n)))):(i!==Mu&&(t=Error(c(423),{cause:i}),oi(dn(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=dn(i,n),u=ho(e.stateNode,i,u),$u(e,u),tt!==4&&(tt=2)),!1;var d=Error(c(520),{cause:i});if(d=dn(d,n),wi===null?wi=[d]:wi.push(d),tt!==4&&(tt=2),t===null)return!0;i=dn(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=ho(n.stateNode,i,e),$u(n,e),!1;case 1:if(t=n.type,d=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Da===null||!Da.has(d))))return n.flags|=65536,u&=-u,n.lanes|=u,u=km(u),qm(u,e,n,i),$u(n,u),!1}n=n.return}while(n!==null);return!1}var mo=Error(c(461)),ct=!1;function bt(e,t,n,i){t.child=e===null?Uh(t,null,n,i):vl(t,e.child,n,i)}function _m(e,t,n,i,u){n=n.render;var d=t.ref;if("ref"in i){var y={};for(var j in i)j!=="ref"&&(y[j]=i[j])}else y=i;return ml(t),i=Fu(e,t,n,y,d,u),j=Pu(),e!==null&&!ct?(Vu(e,t,u),Zn(e,t,u)):(De&&j&&wu(t),t.flags|=1,bt(e,t,i,u),t.child)}function Bm(e,t,n,i,u){if(e===null){var d=n.type;return typeof d=="function"&&!Tu(d)&&d.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=d,Lm(e,t,d,i,u)):(e=Ar(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!So(e,u)){var y=d.memoizedProps;if(n=n.compare,n=n!==null?n:ri,n(y,i)&&e.ref===t.ref)return Zn(e,t,u)}return t.flags|=1,e=In(d,i),e.ref=t.ref,e.return=t,t.child=e}function Lm(e,t,n,i,u){if(e!==null){var d=e.memoizedProps;if(ri(d,i)&&e.ref===t.ref)if(ct=!1,t.pendingProps=i=d,So(e,u))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Zn(e,t,u)}return po(e,t,n,i,u)}function Um(e,t,n,i){var u=i.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|n:n,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~d}else i=0,t.child=null;return Qm(e,t,d,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&zr(t,d!==null?d.cachePool:null),d!==null?$h(t,d):Ku(),Gh(t);else return i=t.lanes=536870912,Qm(e,t,d!==null?d.baseLanes|n:n,n,i)}else d!==null?(zr(t,d.cachePool),$h(t,d),wa(),t.memoizedState=null):(e!==null&&zr(t,null),Ku(),wa());return bt(e,t,u,n),t.child}function Si(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Qm(e,t,n,i,u){var d=Lu();return d=d===null?null:{parent:it._currentValue,pool:d},t.memoizedState={baseLanes:n,cachePool:d},e!==null&&zr(t,null),Ku(),Gh(t),e!==null&&ts(e,t,i,!0),t.childLanes=u,null}function Fr(e,t){return t=Vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hm(e,t,n){return vl(t,e.child,null,n),e=Fr(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function mj(e,t,n){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(i.mode==="hidden")return e=Fr(t,i),t.lanes=536870912,Si(null,e);if(Yu(t),(e=Fe)?(e=Wp(e,mn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:qn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},n=Ch(e),n.return=t,t.child=n,xt=t,Fe=null)):e=null,e===null)throw Na(t);return t.lanes=536870912,null}return Fr(t,i)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(Yu(t),u)if(t.flags&256)t.flags&=-257,t=Hm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(ct||ts(e,t,n,!1),u=(n&e.childLanes)!==0,ct||u){if(i=Ye,i!==null&&(y=Mf(i,n),y!==0&&y!==d.retryLane))throw d.retryLane=y,ol(e,y),Gt(i,e,y),mo;sc(),t=Hm(e,t,n)}else e=d.treeContext,Fe=yn(y.nextSibling),xt=t,De=!0,Sa=null,mn=!1,e!==null&&Rh(t,e),t=Fr(t,i),t.flags|=4096;return t}return e=In(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pr(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(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function po(e,t,n,i,u){return ml(t),n=Fu(e,t,n,i,void 0,u),i=Pu(),e!==null&&!ct?(Vu(e,t,u),Zn(e,t,u)):(De&&i&&wu(t),t.flags|=1,bt(e,t,n,u),t.child)}function $m(e,t,n,i,u,d){return ml(t),t.updateQueue=null,n=Ih(t,i,n,u),Kh(e),i=Pu(),e!==null&&!ct?(Vu(e,t,d),Zn(e,t,d)):(De&&i&&wu(t),t.flags|=1,bt(e,t,n,d),t.child)}function Gm(e,t,n,i,u){if(ml(t),t.stateNode===null){var d=Zl,y=n.contextType;typeof y=="object"&&y!==null&&(d=jt(y)),d=new n(i,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=fo,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=i,d.state=t.memoizedState,d.refs={},Qu(t),y=n.contextType,d.context=typeof y=="object"&&y!==null?jt(y):Zl,d.state=t.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(oo(t,n,y,i),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&fo.enqueueReplaceState(d,d.state,null),gi(t,i,d,u),yi(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){d=t.stateNode;var j=t.memoizedProps,T=jl(n,j);d.props=T;var _=d.context,K=n.contextType;y=Zl,typeof K=="object"&&K!==null&&(y=jt(K));var P=n.getDerivedStateFromProps;K=typeof P=="function"||typeof d.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(j||_!==y)&&wm(t,d,i,y),Ea=!1;var B=t.memoizedState;d.state=B,gi(t,i,d,u),yi(),_=t.memoizedState,j||B!==_||Ea?(typeof P=="function"&&(oo(t,n,P,i),_=t.memoizedState),(T=Ea||Am(t,n,T,i,B,_,y))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=_),d.props=i,d.state=_,d.context=y,i=T):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{d=t.stateNode,Hu(e,t),y=t.memoizedProps,K=jl(n,y),d.props=K,P=t.pendingProps,B=d.context,_=n.contextType,T=Zl,typeof _=="object"&&_!==null&&(T=jt(_)),j=n.getDerivedStateFromProps,(_=typeof j=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==P||B!==T)&&wm(t,d,i,T),Ea=!1,B=t.memoizedState,d.state=B,gi(t,i,d,u),yi();var Q=t.memoizedState;y!==P||B!==Q||Ea||e!==null&&e.dependencies!==null&&Or(e.dependencies)?(typeof j=="function"&&(oo(t,n,j,i),Q=t.memoizedState),(K=Ea||Am(t,n,K,i,B,Q,T)||e!==null&&e.dependencies!==null&&Or(e.dependencies))?(_||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(i,Q,T),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(i,Q,T)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Q),d.props=i,d.state=Q,d.context=T,i=K):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),i=!1)}return d=i,Pr(e,t),i=(t.flags&128)!==0,d||i?(d=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&i?(t.child=vl(t,e.child,null,u),t.child=vl(t,null,n,u)):bt(e,t,n,u),t.memoizedState=d.state,e=t.child):e=Zn(e,t,u),e}function Km(e,t,n,i){return fl(),t.flags|=256,bt(e,t,n,i),t.child}var yo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function go(e){return{baseLanes:e,cachePool:Dh()}}function vo(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=en),e}function Im(e,t,n){var i=t.pendingProps,u=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(at.current&2)!==0),y&&(u=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?Aa(t):wa(),(e=Fe)?(e=Wp(e,mn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ba!==null?{id:qn,overflow:_n}:null,retryLane:536870912,hydrationErrors:null},n=Ch(e),n.return=t,t.child=n,xt=t,Fe=null)):e=null,e===null)throw Na(t);return ed(e)?t.lanes=32:t.lanes=536870912,null}var j=i.children;return i=i.fallback,u?(wa(),u=t.mode,j=Vr({mode:"hidden",children:j},u),i=dl(i,u,n,null),j.return=t,i.return=t,j.sibling=i,t.child=j,i=t.child,i.memoizedState=go(n),i.childLanes=vo(e,y,n),t.memoizedState=yo,Si(null,i)):(Aa(t),xo(t,j))}var T=e.memoizedState;if(T!==null&&(j=T.dehydrated,j!==null)){if(d)t.flags&256?(Aa(t),t.flags&=-257,t=jo(e,t,n)):t.memoizedState!==null?(wa(),t.child=e.child,t.flags|=128,t=null):(wa(),j=i.fallback,u=t.mode,i=Vr({mode:"visible",children:i.children},u),j=dl(j,u,n,null),j.flags|=2,i.return=t,j.return=t,i.sibling=j,t.child=i,vl(t,e.child,null,n),i=t.child,i.memoizedState=go(n),i.childLanes=vo(e,y,n),t.memoizedState=yo,t=Si(null,i));else if(Aa(t),ed(j)){if(y=j.nextSibling&&j.nextSibling.dataset,y)var _=y.dgst;y=_,i=Error(c(419)),i.stack="",i.digest=y,oi({value:i,source:null,stack:null}),t=jo(e,t,n)}else if(ct||ts(e,t,n,!1),y=(n&e.childLanes)!==0,ct||y){if(y=Ye,y!==null&&(i=Mf(y,n),i!==0&&i!==T.retryLane))throw T.retryLane=i,ol(e,i),Gt(y,e,i),mo;Wo(j)||sc(),t=jo(e,t,n)}else Wo(j)?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Fe=yn(j.nextSibling),xt=t,De=!0,Sa=null,mn=!1,e!==null&&Rh(t,e),t=xo(t,i.children),t.flags|=4096);return t}return u?(wa(),j=i.fallback,u=t.mode,T=e.child,_=T.sibling,i=In(T,{mode:"hidden",children:i.children}),i.subtreeFlags=T.subtreeFlags&65011712,_!==null?j=In(_,j):(j=dl(j,u,n,null),j.flags|=2),j.return=t,i.return=t,i.sibling=j,t.child=i,Si(null,i),i=t.child,j=e.child.memoizedState,j===null?j=go(n):(u=j.cachePool,u!==null?(T=it._currentValue,u=u.parent!==T?{parent:T,pool:T}:u):u=Dh(),j={baseLanes:j.baseLanes|n,cachePool:u}),i.memoizedState=j,i.childLanes=vo(e,y,n),t.memoizedState=yo,Si(e.child,i)):(Aa(t),n=e.child,e=n.sibling,n=In(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=n,t.memoizedState=null,n)}function xo(e,t){return t=Vr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vr(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function jo(e,t,n){return vl(t,e.child,null,n),e=xo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ym(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ku(e.return,t,n)}function bo(e,t,n,i,u,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:u,treeForkCount:d}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=i,y.tail=n,y.tailMode=u,y.treeForkCount=d)}function Xm(e,t,n){var i=t.pendingProps,u=i.revealOrder,d=i.tail;i=i.children;var y=at.current,j=(y&2)!==0;if(j?(y=y&1|2,t.flags|=128):y&=1,J(at,y),bt(e,t,i,n),i=De?ui:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ym(e,n,t);else if(e.tag===19)Ym(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(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&Lr(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),bo(t,!1,u,n,d,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Lr(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}bo(t,!0,n,null,d,i);break;case"together":bo(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Zn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),za|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ts(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=In(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=In(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function So(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Or(e)))}function pj(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),Ca(t,it,e.memoizedState.cache),fl();break;case 27:case 5:qt(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:Ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yu(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Aa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Im(e,t,n):(Aa(t),e=Zn(e,t,n),e!==null?e.sibling:null);Aa(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ts(e,t,n,!1),i=(n&t.childLanes)!==0),u){if(i)return Xm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),J(at,at.current),i)break;return null;case 22:return t.lanes=0,Um(e,t,n,t.pendingProps);case 24:Ca(t,it,e.memoizedState.cache)}return Zn(e,t,n)}function Fm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!So(e,n)&&(t.flags&128)===0)return ct=!1,pj(e,t,n);ct=(e.flags&131072)!==0}else ct=!1,De&&(t.flags&1048576)!==0&&Th(t,ui,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=yl(t.elementType),t.type=e,typeof e=="function")Tu(e)?(i=jl(e,i),t.tag=1,t=Gm(null,t,e,i,n)):(t.tag=0,t=po(null,t,e,i,n));else{if(e!=null){var u=e.$$typeof;if(u===U){t.tag=11,t=_m(null,t,e,i,n);break e}else if(u===V){t.tag=14,t=Bm(null,t,e,i,n);break e}}throw t=Se(e)||e,Error(c(306,t,""))}}return t;case 0:return po(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=jl(i,t.pendingProps),Gm(e,t,i,u,n);case 3:e:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var d=t.memoizedState;u=d.element,Hu(e,t),gi(t,i,null,n);var y=t.memoizedState;if(i=y.cache,Ca(t,it,i),i!==d.cache&&qu(t,[it],n,!0),yi(),i=y.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Km(e,t,i,n);break e}else if(i!==u){u=dn(Error(c(424)),t),oi(u),t=Km(e,t,i,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(Fe=yn(e.firstChild),xt=t,De=!0,Sa=null,mn=!0,n=Uh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(fl(),i===u){t=Zn(e,t,n);break e}bt(e,t,i,n)}t=t.child}return t;case 26:return Pr(e,t),e===null?(n=sy(t.type,null,t.pendingProps,null))?t.memoizedState=n:De||(n=t.type,e=t.pendingProps,i=fc(O.current).createElement(n),i[vt]=t,i[Bt]=e,St(i,n,e),ht(i),t.stateNode=i):t.memoizedState=sy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&De&&(i=t.stateNode=ny(t.type,t.pendingProps,O.current),xt=t,mn=!0,u=Fe,Ba(t.type)?(td=u,Fe=yn(i.firstChild)):Fe=u),bt(e,t,t.pendingProps.children,n),Pr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=i=Fe)&&(i=Ij(i,t.type,t.pendingProps,mn),i!==null?(t.stateNode=i,xt=t,Fe=yn(i.firstChild),mn=!1,u=!0):u=!1),u||Na(t)),qt(t),u=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,i=d.children,Vo(u,d)?i=null:y!==null&&Vo(u,y)&&(t.flags|=32),t.memoizedState!==null&&(u=Fu(e,t,ij,null,null,n),Bi._currentValue=u),Pr(e,t),bt(e,t,i,n),t.child;case 6:return e===null&&De&&((e=n=Fe)&&(n=Yj(n,t.pendingProps,mn),n!==null?(t.stateNode=n,xt=t,Fe=null,e=!0):e=!1),e||Na(t)),null;case 13:return Im(e,t,n);case 4:return be(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=vl(t,null,i,n):bt(e,t,i,n),t.child;case 11:return _m(e,t,t.type,t.pendingProps,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Ca(t,t.type,i.value),bt(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,ml(t),u=jt(u),i=i(u),t.flags|=1,bt(e,t,i,n),t.child;case 14:return Bm(e,t,t.type,t.pendingProps,n);case 15:return Lm(e,t,t.type,t.pendingProps,n);case 19:return Xm(e,t,n);case 31:return mj(e,t,n);case 22:return Um(e,t,n,t.pendingProps);case 24:return ml(t),i=jt(it),e===null?(u=Lu(),u===null&&(u=Ye,d=_u(),u.pooledCache=d,d.refCount++,d!==null&&(u.pooledCacheLanes|=n),u=d),t.memoizedState={parent:i,cache:u},Qu(t),Ca(t,it,u)):((e.lanes&n)!==0&&(Hu(e,t),gi(t,null,null,n),yi()),u=e.memoizedState,d=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ca(t,it,i)):(i=d.cache,Ca(t,it,i),i!==u.cache&&qu(t,[it],n,!0))),bt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Jn(e){e.flags|=4}function No(e,t,n,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(bp())e.flags|=8192;else throw gl=kr,Uu}else e.flags&=-16777217}function Pm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!oy(t))if(bp())e.flags|=8192;else throw gl=kr,Uu}function Zr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Af():536870912,e.lanes|=t,hs|=t)}function Ni(e,t){if(!De)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function yj(e,t,n){var i=t.pendingProps;switch(Ou(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Fn(it),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(es(t)?Jn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,zu())),Pe(t),null;case 26:var u=t.type,d=t.memoizedState;return e===null?(Jn(t),d!==null?(Pe(t),Pm(t,d)):(Pe(t),No(t,u,null,i,n))):d?d!==e.memoizedState?(Jn(t),Pe(t),Pm(t,d)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Jn(t),Pe(t),No(t,u,e,i,n)),null;case 27:if(rn(t),n=O.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Jn(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}e=ie.current,es(t)?Ah(t):(e=ny(u,i,n),t.stateNode=e,Jn(t))}return Pe(t),null;case 5:if(rn(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Jn(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}if(d=ie.current,es(t))Ah(t);else{var y=fc(O.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof i.is=="string"?y.createElement("select",{is:i.is}):y.createElement("select"),i.multiple?d.multiple=!0:i.size&&(d.size=i.size);break;default:d=typeof i.is=="string"?y.createElement(u,{is:i.is}):y.createElement(u)}}d[vt]=t,d[Bt]=i;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=d;e:switch(St(d,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Jn(t)}}return Pe(t),No(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Jn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=O.current,es(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,u=xt,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[vt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Ip(e.nodeValue,n)),e||Na(t,!0)}else e=fc(e).createTextNode(i),e[vt]=t,t.stateNode=e}return Pe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=es(t),n!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[vt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else n=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Pe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=es(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[vt]=t}else fl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),u=!1}else u=zu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==u&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Zr(t,t.updateQueue),Pe(t),null);case 4:return Ae(),e===null&&Io(t.stateNode.containerInfo),Pe(t),null;case 10:return Fn(t.type),Pe(t),null;case 19:if(H(at),i=t.memoizedState,i===null)return Pe(t),null;if(u=(t.flags&128)!==0,d=i.rendering,d===null)if(u)Ni(i,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Lr(e),d!==null){for(t.flags|=128,Ni(i,!1),e=d.updateQueue,t.updateQueue=e,Zr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Nh(n,e),n=n.sibling;return J(at,at.current&1|2),De&&Yn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Yt()>nc&&(t.flags|=128,u=!0,Ni(i,!1),t.lanes=4194304)}else{if(!u)if(e=Lr(d),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Zr(t,e),Ni(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!De)return Pe(t),null}else 2*Yt()-i.renderingStartTime>nc&&n!==536870912&&(t.flags|=128,u=!0,Ni(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(e=i.last,e!==null?e.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Yt(),e.sibling=null,n=at.current,J(at,u?n&1|2:n&1),De&&Yn(t,i.treeForkCount),e):(Pe(t),null);case 22:case 23:return Jt(t),Iu(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),n=t.updateQueue,n!==null&&Zr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&H(pl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fn(it),Pe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function gj(e,t){switch(Ou(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(it),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return rn(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(c(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));fl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(at),null;case 4:return Ae(),null;case 10:return Fn(t.type),null;case 22:case 23:return Jt(t),Iu(),e!==null&&H(pl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(it),null;case 25:return null;default:return null}}function Vm(e,t){switch(Ou(t),t.tag){case 3:Fn(it),Ae();break;case 26:case 27:case 5:rn(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:H(at);break;case 10:Fn(t.type);break;case 22:case 23:Jt(t),Iu(),e!==null&&H(pl);break;case 24:Fn(it)}}function Ci(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&e)===e){i=void 0;var d=n.create,y=n.inst;i=d(),y.destroy=i}n=n.next}while(n!==u)}}catch(j){He(t,t.return,j)}}function Oa(e,t,n){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var d=u.next;i=d;do{if((i.tag&e)===e){var y=i.inst,j=y.destroy;if(j!==void 0){y.destroy=void 0,u=t;var T=n,_=j;try{_()}catch(K){He(u,T,K)}}}i=i.next}while(i!==d)}}catch(K){He(t,t.return,K)}}function Zm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Hh(t,n)}catch(i){He(e,e.return,i)}}}function Jm(e,t,n){n.props=jl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){He(e,t,i)}}function Ei(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(u){He(e,t,u)}}function Bn(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(u){He(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){He(e,t,u)}else n.current=null}function Wm(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(u){He(e,e.return,u)}}function Co(e,t,n){try{var i=e.stateNode;Uj(i,e.type,n,t),i[Bt]=t}catch(u){He(e,e.return,u)}}function ep(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ba(e.type)||e.tag===4}function Eo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ep(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&&Ba(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 To(e,t,n){var i=e.tag;if(i===5||i===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=Gn));else if(i!==4&&(i===27&&Ba(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(To(e,t,n),e=e.sibling;e!==null;)To(e,t,n),e=e.sibling}function Jr(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Ba(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jr(e,t,n),e=e.sibling;e!==null;)Jr(e,t,n),e=e.sibling}function tp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);St(t,i,n),t[vt]=e,t[Bt]=n}catch(d){He(e,e.return,d)}}var Wn=!1,ut=!1,Ro=!1,np=typeof WeakSet=="function"?WeakSet:Set,mt=null;function vj(e,t){if(e=e.containerInfo,Fo=xc,e=mh(e),xu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var y=0,j=-1,T=-1,_=0,K=0,P=e,B=null;t:for(;;){for(var Q;P!==n||u!==0&&P.nodeType!==3||(j=y+u),P!==d||i!==0&&P.nodeType!==3||(T=y+i),P.nodeType===3&&(y+=P.nodeValue.length),(Q=P.firstChild)!==null;)B=P,P=Q;for(;;){if(P===e)break t;if(B===n&&++_===u&&(j=y),B===d&&++K===i&&(T=y),(Q=P.nextSibling)!==null)break;P=B,B=P.parentNode}P=Q}n=j===-1||T===-1?null:{start:j,end:T}}else n=null}n=n||{start:0,end:0}}else n=null;for(Po={focusedElem:e,selectionRange:n},xc=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,d=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++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,n=t,u=d.memoizedProps,d=d.memoizedState,i=n.stateNode;try{var oe=jl(n.type,u);e=i.getSnapshotBeforeUpdate(oe,d),i.__reactInternalSnapshotBeforeUpdate=e}catch(ye){He(n,n.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Jo(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Jo(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function ap(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ta(e,n),i&4&&Ci(5,n);break;case 1:if(ta(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(y){He(n,n.return,y)}else{var u=jl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){He(n,n.return,y)}}i&64&&Zm(n),i&512&&Ei(n,n.return);break;case 3:if(ta(e,n),i&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{Hh(e,t)}catch(y){He(n,n.return,y)}}break;case 27:t===null&&i&4&&tp(n);case 26:case 5:ta(e,n),t===null&&i&4&&Wm(n),i&512&&Ei(n,n.return);break;case 12:ta(e,n);break;case 31:ta(e,n),i&4&&ip(e,n);break;case 13:ta(e,n),i&4&&rp(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Rj.bind(null,n),Xj(e,n))));break;case 22:if(i=n.memoizedState!==null||Wn,!i){t=t!==null&&t.memoizedState!==null||ut,u=Wn;var d=ut;Wn=i,(ut=t)&&!d?na(e,n,(n.subtreeFlags&8772)!==0):ta(e,n),Wn=u,ut=d}break;case 30:break;default:ta(e,n)}}function lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nu(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 Ze=null,Ut=!1;function ea(e,t,n){for(n=n.child;n!==null;)sp(e,t,n),n=n.sibling}function sp(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(Ps,n)}catch{}switch(n.tag){case 26:ut||Bn(n,t),ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ut||Bn(n,t);var i=Ze,u=Ut;Ba(n.type)&&(Ze=n.stateNode,Ut=!1),ea(e,t,n),ki(n.stateNode),Ze=i,Ut=u;break;case 5:ut||Bn(n,t);case 6:if(i=Ze,u=Ut,Ze=null,ea(e,t,n),Ze=i,Ut=u,Ze!==null)if(Ut)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(n.stateNode)}catch(d){He(n,t,d)}else try{Ze.removeChild(n.stateNode)}catch(d){He(n,t,d)}break;case 18:Ze!==null&&(Ut?(e=Ze,Zp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),bs(e)):Zp(Ze,n.stateNode));break;case 4:i=Ze,u=Ut,Ze=n.stateNode.containerInfo,Ut=!0,ea(e,t,n),Ze=i,Ut=u;break;case 0:case 11:case 14:case 15:Oa(2,n,t),ut||Oa(4,n,t),ea(e,t,n);break;case 1:ut||(Bn(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Jm(n,t,i)),ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:ut=(i=ut)||n.memoizedState!==null,ea(e,t,n),ut=i;break;default:ea(e,t,n)}}function ip(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bs(e)}catch(n){He(t,t.return,n)}}}function rp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bs(e)}catch(n){He(t,t.return,n)}}function xj(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new np),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new np),t;default:throw Error(c(435,e.tag))}}function Wr(e,t){var n=xj(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var u=Aj.bind(null,e,i);i.then(u,u)}})}function Qt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var u=n[i],d=e,y=t,j=y;e:for(;j!==null;){switch(j.tag){case 27:if(Ba(j.type)){Ze=j.stateNode,Ut=!1;break e}break;case 5:Ze=j.stateNode,Ut=!1;break e;case 3:case 4:Ze=j.stateNode.containerInfo,Ut=!0;break e}j=j.return}if(Ze===null)throw Error(c(160));sp(d,y,u),Ze=null,Ut=!1,d=u.alternate,d!==null&&(d.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cp(t,e),t=t.sibling}var Rn=null;function cp(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Ht(e),i&4&&(Oa(3,e,e.return),Ci(3,e),Oa(5,e,e.return));break;case 1:Qt(t,e),Ht(e),i&512&&(ut||n===null||Bn(n,n.return)),i&64&&Wn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var u=Rn;if(Qt(t,e),Ht(e),i&512&&(ut||n===null||Bn(n,n.return)),i&4){var d=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":d=u.getElementsByTagName("title")[0],(!d||d[Js]||d[vt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=u.createElement(i),u.head.insertBefore(d,u.querySelector("head > title"))),St(d,i,n),d[vt]=e,ht(d),i=d;break e;case"link":var y=cy("link","href",u).get(i+(n.href||""));if(y){for(var j=0;j<y.length;j++)if(d=y[j],d.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&d.getAttribute("rel")===(n.rel==null?null:n.rel)&&d.getAttribute("title")===(n.title==null?null:n.title)&&d.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){y.splice(j,1);break t}}d=u.createElement(i),St(d,i,n),u.head.appendChild(d);break;case"meta":if(y=cy("meta","content",u).get(i+(n.content||""))){for(j=0;j<y.length;j++)if(d=y[j],d.getAttribute("content")===(n.content==null?null:""+n.content)&&d.getAttribute("name")===(n.name==null?null:n.name)&&d.getAttribute("property")===(n.property==null?null:n.property)&&d.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&d.getAttribute("charset")===(n.charSet==null?null:n.charSet)){y.splice(j,1);break t}}d=u.createElement(i),St(d,i,n),u.head.appendChild(d);break;default:throw Error(c(468,i))}d[vt]=e,ht(d),i=d}e.stateNode=i}else uy(u,e.type,e.stateNode);else e.stateNode=ry(u,i,e.memoizedProps);else d!==i?(d===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):d.count--,i===null?uy(u,e.type,e.stateNode):ry(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Co(e,e.memoizedProps,n.memoizedProps)}break;case 27:Qt(t,e),Ht(e),i&512&&(ut||n===null||Bn(n,n.return)),n!==null&&i&4&&Co(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Qt(t,e),Ht(e),i&512&&(ut||n===null||Bn(n,n.return)),e.flags&32){u=e.stateNode;try{Kl(u,"")}catch(oe){He(e,e.return,oe)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Co(e,u,n!==null?n.memoizedProps:u)),i&1024&&(Ro=!0);break;case 6:if(Qt(t,e),Ht(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(oe){He(e,e.return,oe)}}break;case 3:if(pc=null,u=Rn,Rn=hc(t.containerInfo),Qt(t,e),Rn=u,Ht(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{bs(t.containerInfo)}catch(oe){He(e,e.return,oe)}Ro&&(Ro=!1,up(e));break;case 4:i=Rn,Rn=hc(e.stateNode.containerInfo),Qt(t,e),Ht(e),Rn=i;break;case 12:Qt(t,e),Ht(e);break;case 31:Qt(t,e),Ht(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Wr(e,i)));break;case 13:Qt(t,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tc=Yt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Wr(e,i)));break;case 22:u=e.memoizedState!==null;var T=n!==null&&n.memoizedState!==null,_=Wn,K=ut;if(Wn=_||u,ut=K||T,Qt(t,e),ut=K,Wn=_,Ht(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||T||Wn||ut||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){T=n=t;try{if(d=T.stateNode,u)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{j=T.stateNode;var P=T.memoizedProps.style,B=P!=null&&P.hasOwnProperty("display")?P.display:null;j.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(oe){He(T,T.return,oe)}}}else if(t.tag===6){if(n===null){T=t;try{T.stateNode.nodeValue=u?"":T.memoizedProps}catch(oe){He(T,T.return,oe)}}}else if(t.tag===18){if(n===null){T=t;try{var Q=T.stateNode;u?Jp(Q,!0):Jp(T.stateNode,!1)}catch(oe){He(T,T.return,oe)}}}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}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Wr(e,n))));break;case 19:Qt(t,e),Ht(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Wr(e,i)));break;case 30:break;case 21:break;default:Qt(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(ep(i)){n=i;break}i=i.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,d=Eo(e);Jr(e,d,u);break;case 5:var y=n.stateNode;n.flags&32&&(Kl(y,""),n.flags&=-33);var j=Eo(e);Jr(e,j,y);break;case 3:case 4:var T=n.stateNode.containerInfo,_=Eo(e);To(e,_,T);break;default:throw Error(c(161))}}catch(K){He(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function up(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;up(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ap(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),bl(t);break;case 1:Bn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Jm(t,t.return,n),bl(t);break;case 27:ki(t.stateNode);case 26:case 5:Bn(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:na(u,d,n),Ci(4,d);break;case 1:if(na(u,d,n),i=d,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(_){He(i,i.return,_)}if(i=d,u=i.updateQueue,u!==null){var j=i.stateNode;try{var T=u.shared.hiddenCallbacks;if(T!==null)for(u.shared.hiddenCallbacks=null,u=0;u<T.length;u++)Qh(T[u],j)}catch(_){He(i,i.return,_)}}n&&y&64&&Zm(d),Ei(d,d.return);break;case 27:tp(d);case 26:case 5:na(u,d,n),n&&i===null&&y&4&&Wm(d),Ei(d,d.return);break;case 12:na(u,d,n);break;case 31:na(u,d,n),n&&y&4&&ip(u,d);break;case 13:na(u,d,n),n&&y&4&&rp(u,d);break;case 22:d.memoizedState===null&&na(u,d,n),Ei(d,d.return);break;case 30:break;default:na(u,d,n)}t=t.sibling}}function Ao(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&&di(n))}function wo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e))}function An(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)op(e,t,n,i),t=t.sibling}function op(e,t,n,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,n,i),u&2048&&Ci(9,t);break;case 1:An(e,t,n,i);break;case 3:An(e,t,n,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&di(e)));break;case 12:if(u&2048){An(e,t,n,i),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,j=d.onPostCommit;typeof j=="function"&&j(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){He(t,t.return,T)}}else An(e,t,n,i);break;case 31:An(e,t,n,i);break;case 13:An(e,t,n,i);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?An(e,t,n,i):Ti(e,t):d._visibility&2?An(e,t,n,i):(d._visibility|=2,os(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Ao(y,t);break;case 24:An(e,t,n,i),u&2048&&wo(t.alternate,t);break;default:An(e,t,n,i)}}function os(e,t,n,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,y=t,j=n,T=i,_=y.flags;switch(y.tag){case 0:case 11:case 15:os(d,y,j,T,u),Ci(8,y);break;case 23:break;case 22:var K=y.stateNode;y.memoizedState!==null?K._visibility&2?os(d,y,j,T,u):Ti(d,y):(K._visibility|=2,os(d,y,j,T,u)),u&&_&2048&&Ao(y.alternate,y);break;case 24:os(d,y,j,T,u),u&&_&2048&&wo(y.alternate,y);break;default:os(d,y,j,T,u)}t=t.sibling}}function Ti(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,u=i.flags;switch(i.tag){case 22:Ti(n,i),u&2048&&Ao(i.alternate,i);break;case 24:Ti(n,i),u&2048&&wo(i.alternate,i);break;default:Ti(n,i)}t=t.sibling}}var Ri=8192;function ds(e,t,n){if(e.subtreeFlags&Ri)for(e=e.child;e!==null;)dp(e,t,n),e=e.sibling}function dp(e,t,n){switch(e.tag){case 26:ds(e,t,n),e.flags&Ri&&e.memoizedState!==null&&sb(n,Rn,e.memoizedState,e.memoizedProps);break;case 5:ds(e,t,n);break;case 3:case 4:var i=Rn;Rn=hc(e.stateNode.containerInfo),ds(e,t,n),Rn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Ri,Ri=16777216,ds(e,t,n),Ri=i):ds(e,t,n));break;default:ds(e,t,n)}}function fp(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 Ai(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];mt=i,mp(i,e)}fp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)hp(e),e=e.sibling}function hp(e){switch(e.tag){case 0:case 11:case 15:Ai(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:Ai(e);break;case 12:Ai(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ec(e)):Ai(e);break;default:Ai(e)}}function ec(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];mt=i,mp(i,e)}fp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),ec(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ec(t));break;default:ec(t)}e=e.sibling}}function mp(e,t){for(;mt!==null;){var n=mt;switch(n.tag){case 0:case 11:case 15:Oa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:di(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,mt=i;else e:for(n=e;mt!==null;){i=mt;var u=i.sibling,d=i.return;if(lp(i),i===n){mt=null;break e}if(u!==null){u.return=d,mt=u;break e}mt=d}}}var jj={getCacheForType:function(e){var t=jt(it),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return jt(it).controller.signal}},bj=typeof WeakMap=="function"?WeakMap:Map,Le=0,Ye=null,we=null,Me=0,Qe=0,Wt=null,Ma=!1,fs=!1,Oo=!1,aa=0,tt=0,za=0,Sl=0,Mo=0,en=0,hs=0,wi=null,$t=null,zo=!1,tc=0,pp=0,nc=1/0,ac=null,Da=null,ot=0,ka=null,ms=null,la=0,Do=0,ko=null,yp=null,Oi=0,qo=null;function tn(){return(Le&2)!==0&&Me!==0?Me&-Me:k.T!==null?Ho():zf()}function gp(){if(en===0)if((Me&536870912)===0||De){var e=dr;dr<<=1,(dr&3932160)===0&&(dr=262144),en=e}else en=536870912;return e=Zt.current,e!==null&&(e.flags|=32),en}function Gt(e,t,n){(e===Ye&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(ps(e,0),qa(e,Me,en,!1)),Zs(e,n),((Le&2)===0||e!==Ye)&&(e===Ye&&((Le&2)===0&&(Sl|=n),tt===4&&qa(e,Me,en,!1)),Ln(e))}function vp(e,t,n){if((Le&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Vs(e,t),u=i?Cj(e,t):Bo(e,t,!0),d=i;do{if(u===0){fs&&!i&&qa(e,t,0,!1);break}else{if(n=e.current.alternate,d&&!Sj(n)){u=Bo(e,t,!1),d=!1;continue}if(u===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var j=e;u=wi;var T=j.current.memoizedState.isDehydrated;if(T&&(ps(j,y).flags|=256),y=Bo(j,y,!1),y!==2){if(Oo&&!T){j.errorRecoveryDisabledLanes|=d,Sl|=d,u=4;break e}d=$t,$t=u,d!==null&&($t===null?$t=d:$t.push.apply($t,d))}u=y}if(d=!1,u!==2)continue}}if(u===1){ps(e,0),qa(e,t,0,!0);break}e:{switch(i=e,d=u,d){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:qa(i,t,en,!Ma);break e;case 2:$t=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=tc+300-Yt(),10<u)){if(qa(i,t,en,!Ma),hr(i,0,!0)!==0)break e;la=t,i.timeoutHandle=Pp(xp.bind(null,i,n,$t,ac,zo,t,en,Sl,hs,Ma,d,"Throttled",-0,0),u);break e}xp(i,n,$t,ac,zo,t,en,Sl,hs,Ma,d,null,-0,0)}}break}while(!0);Ln(e)}function xp(e,t,n,i,u,d,y,j,T,_,K,P,B,Q){if(e.timeoutHandle=-1,P=t.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gn},dp(t,d,P);var oe=(d&62914560)===d?tc-Yt():(d&4194048)===d?pp-Yt():0;if(oe=ib(P,oe),oe!==null){la=d,e.cancelPendingCommit=oe(Rp.bind(null,e,t,d,n,i,u,y,j,T,K,P,null,B,Q)),qa(e,d,y,!_);return}}Rp(e,t,d,n,i,u,y,j,T)}function Sj(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 i=0;i<n.length;i++){var u=n[i],d=u.getSnapshot;u=u.value;try{if(!Pt(d(),u))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 qa(e,t,n,i){t&=~Mo,t&=~Sl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var d=31-Ft(u),y=1<<d;i[d]=-1,u&=~y}n!==0&&wf(e,n,t)}function lc(){return(Le&6)===0?(Mi(0),!1):!0}function _o(){if(we!==null){if(Qe===0)var e=we.return;else e=we,Xn=hl=null,Zu(e),ss=null,hi=0,e=we;for(;e!==null;)Vm(e.alternate,e),e=e.return;we=null}}function ps(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$j(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),la=0,_o(),Ye=e,we=n=In(e.current,null),Me=t,Qe=0,Wt=null,Ma=!1,fs=Vs(e,t),Oo=!1,hs=en=Mo=Sl=za=tt=0,$t=wi=null,zo=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-Ft(i),d=1<<u;t|=e[u],i&=~d}return aa=t,Er(),n}function jp(e,t){Ce=null,k.H=bi,t===ls||t===Dr?(t=_h(),Qe=3):t===Uu?(t=_h(),Qe=4):Qe=t===mo?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wt=t,we===null&&(tt=1,Xr(e,dn(t,e.current)))}function bp(){var e=Zt.current;return e===null?!0:(Me&4194048)===Me?pn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===pn:!1}function Sp(){var e=k.H;return k.H=bi,e===null?bi:e}function Np(){var e=k.A;return k.A=jj,e}function sc(){tt=4,Ma||(Me&4194048)!==Me&&Zt.current!==null||(fs=!0),(za&134217727)===0&&(Sl&134217727)===0||Ye===null||qa(Ye,Me,en,!1)}function Bo(e,t,n){var i=Le;Le|=2;var u=Sp(),d=Np();(Ye!==e||Me!==t)&&(ac=null,ps(e,t)),t=!1;var y=tt;e:do try{if(Qe!==0&&we!==null){var j=we,T=Wt;switch(Qe){case 8:_o(),y=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var _=Qe;if(Qe=0,Wt=null,ys(e,j,T,_),n&&fs){y=0;break e}break;default:_=Qe,Qe=0,Wt=null,ys(e,j,T,_)}}Nj(),y=tt;break}catch(K){jp(e,K)}while(!0);return t&&e.shellSuspendCounter++,Xn=hl=null,Le=i,k.H=u,k.A=d,we===null&&(Ye=null,Me=0,Er()),y}function Nj(){for(;we!==null;)Cp(we)}function Cj(e,t){var n=Le;Le|=2;var i=Sp(),u=Np();Ye!==e||Me!==t?(ac=null,nc=Yt()+500,ps(e,t)):fs=Vs(e,t);e:do try{if(Qe!==0&&we!==null){t=we;var d=Wt;t:switch(Qe){case 1:Qe=0,Wt=null,ys(e,t,d,1);break;case 2:case 9:if(kh(d)){Qe=0,Wt=null,Ep(t);break}t=function(){Qe!==2&&Qe!==9||Ye!==e||(Qe=7),Ln(e)},d.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:kh(d)?(Qe=0,Wt=null,Ep(t)):(Qe=0,Wt=null,ys(e,t,d,7));break;case 5:var y=null;switch(we.tag){case 26:y=we.memoizedState;case 5:case 27:var j=we;if(y?oy(y):j.stateNode.complete){Qe=0,Wt=null;var T=j.sibling;if(T!==null)we=T;else{var _=j.return;_!==null?(we=_,ic(_)):we=null}break t}}Qe=0,Wt=null,ys(e,t,d,5);break;case 6:Qe=0,Wt=null,ys(e,t,d,6);break;case 8:_o(),tt=6;break e;default:throw Error(c(462))}}Ej();break}catch(K){jp(e,K)}while(!0);return Xn=hl=null,k.H=i,k.A=u,Le=n,we!==null?0:(Ye=null,Me=0,Er(),tt)}function Ej(){for(;we!==null&&!Ot();)Cp(we)}function Cp(e){var t=Fm(e.alternate,e,aa);e.memoizedProps=e.pendingProps,t===null?ic(e):we=t}function Ep(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$m(n,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=$m(n,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Zu(t);default:Vm(n,t),t=we=Nh(t,aa),t=Fm(n,t,aa)}e.memoizedProps=e.pendingProps,t===null?ic(e):we=t}function ys(e,t,n,i){Xn=hl=null,Zu(t),ss=null,hi=0;var u=t.return;try{if(hj(e,u,t,n,Me)){tt=1,Xr(e,dn(n,e.current)),we=null;return}}catch(d){if(u!==null)throw we=u,d;tt=1,Xr(e,dn(n,e.current)),we=null;return}t.flags&32768?(De||i===1?e=!0:fs||(Me&536870912)!==0?e=!1:(Ma=e=!0,(i===2||i===9||i===3||i===6)&&(i=Zt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Tp(t,e)):ic(t)}function ic(e){var t=e;do{if((t.flags&32768)!==0){Tp(t,Ma);return}e=t.return;var n=yj(t.alternate,t,aa);if(n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);tt===0&&(tt=5)}function Tp(e,t){do{var n=gj(e.alternate,e);if(n!==null){n.flags&=32767,we=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=n}while(e!==null);tt=6,we=null}function Rp(e,t,n,i,u,d,y,j,T){e.cancelPendingCommit=null;do rc();while(ot!==0);if((Le&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(d=t.lanes|t.childLanes,d|=Cu,lx(e,n,d,y,j,T),e===Ye&&(we=Ye=null,Me=0),ms=t,ka=e,la=n,Do=d,ko=u,yp=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,wj(ur,function(){return zp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,u=X.p,X.p=2,y=Le,Le|=4;try{vj(e,t,n)}finally{Le=y,X.p=u,k.T=i}}ot=1,Ap(),wp(),Op()}}function Ap(){if(ot===1){ot=0;var e=ka,t=ms,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null;var i=X.p;X.p=2;var u=Le;Le|=4;try{cp(t,e);var d=Po,y=mh(e.containerInfo),j=d.focusedElem,T=d.selectionRange;if(y!==j&&j&&j.ownerDocument&&hh(j.ownerDocument.documentElement,j)){if(T!==null&&xu(j)){var _=T.start,K=T.end;if(K===void 0&&(K=_),"selectionStart"in j)j.selectionStart=_,j.selectionEnd=Math.min(K,j.value.length);else{var P=j.ownerDocument||document,B=P&&P.defaultView||window;if(B.getSelection){var Q=B.getSelection(),oe=j.textContent.length,ye=Math.min(T.start,oe),Ie=T.end===void 0?ye:Math.min(T.end,oe);!Q.extend&&ye>Ie&&(y=Ie,Ie=ye,ye=y);var M=fh(j,ye),w=fh(j,Ie);if(M&&w&&(Q.rangeCount!==1||Q.anchorNode!==M.node||Q.anchorOffset!==M.offset||Q.focusNode!==w.node||Q.focusOffset!==w.offset)){var q=P.createRange();q.setStart(M.node,M.offset),Q.removeAllRanges(),ye>Ie?(Q.addRange(q),Q.extend(w.node,w.offset)):(q.setEnd(w.node,w.offset),Q.addRange(q))}}}}for(P=[],Q=j;Q=Q.parentNode;)Q.nodeType===1&&P.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<P.length;j++){var Y=P[j];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}xc=!!Fo,Po=Fo=null}finally{Le=u,X.p=i,k.T=n}}e.current=t,ot=2}}function wp(){if(ot===2){ot=0;var e=ka,t=ms,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=k.T,k.T=null;var i=X.p;X.p=2;var u=Le;Le|=4;try{ap(e,t.alternate,t)}finally{Le=u,X.p=i,k.T=n}}ot=3}}function Op(){if(ot===4||ot===3){ot=0,Pv();var e=ka,t=ms,n=la,i=yp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ot=5:(ot=0,ms=ka=null,Mp(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Da=null),eu(n),t=t.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(Ps,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,u=X.p,X.p=2,k.T=null;try{for(var d=e.onRecoverableError,y=0;y<i.length;y++){var j=i[y];d(j.value,{componentStack:j.stack})}}finally{k.T=t,X.p=u}}(la&3)!==0&&rc(),Ln(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===qo?Oi++:(Oi=0,qo=e):Oi=0,Mi(0)}}function Mp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,di(t)))}function rc(){return Ap(),wp(),Op(),zp()}function zp(){if(ot!==5)return!1;var e=ka,t=Do;Do=0;var n=eu(la),i=k.T,u=X.p;try{X.p=32>n?32:n,k.T=null,n=ko,ko=null;var d=ka,y=la;if(ot=0,ms=ka=null,la=0,(Le&6)!==0)throw Error(c(331));var j=Le;if(Le|=4,hp(d.current),op(d,d.current,y,n),Le=j,Mi(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(Ps,d)}catch{}return!0}finally{X.p=u,k.T=i,Mp(e,t)}}function Dp(e,t,n){t=dn(n,t),t=ho(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Zs(e,2),Ln(e))}function He(e,t,n){if(e.tag===3)Dp(e,e,n);else for(;t!==null;){if(t.tag===3){Dp(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Da===null||!Da.has(i))){e=dn(n,e),n=km(2),i=Ra(t,n,2),i!==null&&(qm(n,i,t,e),Zs(i,2),Ln(i));break}}t=t.return}}function Lo(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new bj;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(n)||(Oo=!0,u.add(n),e=Tj.bind(null,e,t,n),t.then(e,e))}function Tj(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ye===e&&(Me&n)===n&&(tt===4||tt===3&&(Me&62914560)===Me&&300>Yt()-tc?(Le&2)===0&&ps(e,0):Mo|=n,hs===Me&&(hs=0)),Ln(e)}function kp(e,t){t===0&&(t=Af()),e=ol(e,t),e!==null&&(Zs(e,t),Ln(e))}function Rj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kp(e,n)}function Aj(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(c(314))}i!==null&&i.delete(t),kp(e,n)}function wj(e,t){return ee(e,t)}var cc=null,gs=null,Uo=!1,uc=!1,Qo=!1,_a=0;function Ln(e){e!==gs&&e.next===null&&(gs===null?cc=gs=e:gs=gs.next=e),uc=!0,Uo||(Uo=!0,Mj())}function Mi(e,t){if(!Qo&&uc){Qo=!0;do for(var n=!1,i=cc;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var d=0;else{var y=i.suspendedLanes,j=i.pingedLanes;d=(1<<31-Ft(42|e)+1)-1,d&=u&~(y&~j),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(n=!0,Lp(i,d))}else d=Me,d=hr(i,i===Ye?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(d&3)===0||Vs(i,d)||(n=!0,Lp(i,d));i=i.next}while(n);Qo=!1}}function Oj(){qp()}function qp(){uc=Uo=!1;var e=0;_a!==0&&Hj()&&(e=_a);for(var t=Yt(),n=null,i=cc;i!==null;){var u=i.next,d=_p(i,t);d===0?(i.next=null,n===null?cc=u:n.next=u,u===null&&(gs=n)):(n=i,(e!==0||(d&3)!==0)&&(uc=!0)),i=u}ot!==0&&ot!==5||Mi(e),_a!==0&&(_a=0)}function _p(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-Ft(d),j=1<<y,T=u[y];T===-1?((j&n)===0||(j&i)!==0)&&(u[y]=ax(j,t)):T<=t&&(e.expiredLanes|=j),d&=~j}if(t=Ye,n=Me,n=hr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&qe(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Vs(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&qe(i),eu(n)){case 2:case 8:n=Tf;break;case 32:n=ur;break;case 268435456:n=Rf;break;default:n=ur}return i=Bp.bind(null,e),n=ee(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&qe(i),e.callbackPriority=2,e.callbackNode=null,2}function Bp(e,t){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(rc()&&e.callbackNode!==n)return null;var i=Me;return i=hr(e,e===Ye?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(vp(e,i,t),_p(e,Yt()),e.callbackNode!=null&&e.callbackNode===n?Bp.bind(null,e):null)}function Lp(e,t){if(rc())return null;vp(e,t,!0)}function Mj(){Gj(function(){(Le&6)!==0?ee(Ef,Oj):qp()})}function Ho(){if(_a===0){var e=ns;e===0&&(e=or,or<<=1,(or&261888)===0&&(or=256)),_a=e}return _a}function Up(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gr(""+e)}function Qp(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 zj(e,t,n,i,u){if(t==="submit"&&n&&n.stateNode===u){var d=Up((u[Bt]||null).action),y=i.submitter;y&&(t=(t=y[Bt]||null)?Up(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var j=new br("action","action",null,i,u);e.push({event:j,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(_a!==0){var T=y?Qp(u,y):new FormData(u);io(n,{pending:!0,data:T,method:u.method,action:d},null,T)}}else typeof d=="function"&&(j.preventDefault(),T=y?Qp(u,y):new FormData(u),io(n,{pending:!0,data:T,method:u.method,action:d},d,T))},currentTarget:u}]})}}for(var $o=0;$o<Nu.length;$o++){var Go=Nu[$o],Dj=Go.toLowerCase(),kj=Go[0].toUpperCase()+Go.slice(1);Tn(Dj,"on"+kj)}Tn(gh,"onAnimationEnd"),Tn(vh,"onAnimationIteration"),Tn(xh,"onAnimationStart"),Tn("dblclick","onDoubleClick"),Tn("focusin","onFocus"),Tn("focusout","onBlur"),Tn(Vx,"onTransitionRun"),Tn(Zx,"onTransitionStart"),Tn(Jx,"onTransitionCancel"),Tn(jh,"onTransitionEnd"),$l("onMouseEnter",["mouseout","mouseover"]),$l("onMouseLeave",["mouseout","mouseover"]),$l("onPointerEnter",["pointerout","pointerover"]),$l("onPointerLeave",["pointerout","pointerover"]),il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),il("onBeforeInput",["compositionend","keypress","textInput","paste"]),il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),qj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(zi));function Hp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],u=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var y=i.length-1;0<=y;y--){var j=i[y],T=j.instance,_=j.currentTarget;if(j=j.listener,T!==d&&u.isPropagationStopped())break e;d=j,u.currentTarget=_;try{d(u)}catch(K){Cr(K)}u.currentTarget=null,d=T}else for(y=0;y<i.length;y++){if(j=i[y],T=j.instance,_=j.currentTarget,j=j.listener,T!==d&&u.isPropagationStopped())break e;d=j,u.currentTarget=_;try{d(u)}catch(K){Cr(K)}u.currentTarget=null,d=T}}}}function Oe(e,t){var n=t[tu];n===void 0&&(n=t[tu]=new Set);var i=e+"__bubble";n.has(i)||($p(t,e,2,!1),n.add(i))}function Ko(e,t,n){var i=0;t&&(i|=4),$p(n,e,i,t)}var oc="_reactListening"+Math.random().toString(36).slice(2);function Io(e){if(!e[oc]){e[oc]=!0,qf.forEach(function(n){n!=="selectionchange"&&(qj.has(n)||Ko(n,!1,e),Ko(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oc]||(t[oc]=!0,Ko("selectionchange",!1,t))}}function $p(e,t,n,i){switch(gy(t)){case 2:var u=ub;break;case 8:u=ob;break;default:u=id}n=u.bind(null,t,n,e),u=void 0,!ou||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function Yo(e,t,n,i,u){var d=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var y=i.tag;if(y===3||y===4){var j=i.stateNode.containerInfo;if(j===u)break;if(y===4)for(y=i.return;y!==null;){var T=y.tag;if((T===3||T===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;j!==null;){if(y=Ul(j),y===null)return;if(T=y.tag,T===5||T===6||T===26||T===27){i=d=y;continue e}j=j.parentNode}}i=i.return}Xf(function(){var _=d,K=cu(n),P=[];e:{var B=bh.get(e);if(B!==void 0){var Q=br,oe=e;switch(e){case"keypress":if(xr(n)===0)break e;case"keydown":case"keyup":Q=Ax;break;case"focusin":oe="focus",Q=mu;break;case"focusout":oe="blur",Q=mu;break;case"beforeblur":case"afterblur":Q=mu;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":Q=Vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=yx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Mx;break;case gh:case vh:case xh:Q=xx;break;case jh:Q=Dx;break;case"scroll":case"scrollend":Q=mx;break;case"wheel":Q=qx;break;case"copy":case"cut":case"paste":Q=bx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Jf;break;case"toggle":case"beforetoggle":Q=Bx}var ye=(t&4)!==0,Ie=!ye&&(e==="scroll"||e==="scrollend"),M=ye?B!==null?B+"Capture":null:B;ye=[];for(var w=_,q;w!==null;){var Y=w;if(q=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||q===null||M===null||(Y=ei(w,M),Y!=null&&ye.push(Di(w,Y,q))),Ie)break;w=w.return}0<ye.length&&(B=new Q(B,oe,null,n,K),P.push({event:B,listeners:ye}))}}if((t&7)===0){e:{if(B=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",B&&n!==ru&&(oe=n.relatedTarget||n.fromElement)&&(Ul(oe)||oe[Ll]))break e;if((Q||B)&&(B=K.window===K?K:(B=K.ownerDocument)?B.defaultView||B.parentWindow:window,Q?(oe=n.relatedTarget||n.toElement,Q=_,oe=oe?Ul(oe):null,oe!==null&&(Ie=f(oe),ye=oe.tag,oe!==Ie||ye!==5&&ye!==27&&ye!==6)&&(oe=null)):(Q=null,oe=_),Q!==oe)){if(ye=Vf,Y="onMouseLeave",M="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Jf,Y="onPointerLeave",M="onPointerEnter",w="pointer"),Ie=Q==null?B:Ws(Q),q=oe==null?B:Ws(oe),B=new ye(Y,w+"leave",Q,n,K),B.target=Ie,B.relatedTarget=q,Y=null,Ul(K)===_&&(ye=new ye(M,w+"enter",oe,n,K),ye.target=q,ye.relatedTarget=Ie,Y=ye),Ie=Y,Q&&oe)t:{for(ye=_j,M=Q,w=oe,q=0,Y=M;Y;Y=ye(Y))q++;Y=0;for(var he=w;he;he=ye(he))Y++;for(;0<q-Y;)M=ye(M),q--;for(;0<Y-q;)w=ye(w),Y--;for(;q--;){if(M===w||w!==null&&M===w.alternate){ye=M;break t}M=ye(M),w=ye(w)}ye=null}else ye=null;Q!==null&&Gp(P,B,Q,ye,!1),oe!==null&&Ie!==null&&Gp(P,Ie,oe,ye,!0)}}e:{if(B=_?Ws(_):window,Q=B.nodeName&&B.nodeName.toLowerCase(),Q==="select"||Q==="input"&&B.type==="file")var _e=ih;else if(lh(B))if(rh)_e=Xx;else{_e=Ix;var de=Kx}else Q=B.nodeName,!Q||Q.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?_&&iu(_.elementType)&&(_e=ih):_e=Yx;if(_e&&(_e=_e(e,_))){sh(P,_e,n,K);break e}de&&de(e,B,_),e==="focusout"&&_&&B.type==="number"&&_.memoizedProps.value!=null&&su(B,"number",B.value)}switch(de=_?Ws(_):window,e){case"focusin":(lh(de)||de.contentEditable==="true")&&(Fl=de,ju=_,ci=null);break;case"focusout":ci=ju=Fl=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,ph(P,n,K);break;case"selectionchange":if(Px)break;case"keydown":case"keyup":ph(P,n,K)}var Ee;if(yu)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Xl?nh(e,n)&&(ze="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ze="onCompositionStart");ze&&(Wf&&n.locale!=="ko"&&(Xl||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Xl&&(Ee=Ff()):(ja=K,du="value"in ja?ja.value:ja.textContent,Xl=!0)),de=dc(_,ze),0<de.length&&(ze=new Zf(ze,e,null,n,K),P.push({event:ze,listeners:de}),Ee?ze.data=Ee:(Ee=ah(n),Ee!==null&&(ze.data=Ee)))),(Ee=Ux?Qx(e,n):Hx(e,n))&&(ze=dc(_,"onBeforeInput"),0<ze.length&&(de=new Zf("onBeforeInput","beforeinput",null,n,K),P.push({event:de,listeners:ze}),de.data=Ee)),zj(P,e,_,n,K)}Hp(P,t)})}function Di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function dc(e,t){for(var n=t+"Capture",i=[];e!==null;){var u=e,d=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||d===null||(u=ei(e,n),u!=null&&i.unshift(Di(e,u,d)),u=ei(e,t),u!=null&&i.push(Di(e,u,d))),e.tag===3)return i;e=e.return}return[]}function _j(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gp(e,t,n,i,u){for(var d=t._reactName,y=[];n!==null&&n!==i;){var j=n,T=j.alternate,_=j.stateNode;if(j=j.tag,T!==null&&T===i)break;j!==5&&j!==26&&j!==27||_===null||(T=_,u?(_=ei(n,d),_!=null&&y.unshift(Di(n,_,T))):u||(_=ei(n,d),_!=null&&y.push(Di(n,_,T)))),n=n.return}y.length!==0&&e.push({event:t,listeners:y})}var Bj=/\r\n?/g,Lj=/\u0000|\uFFFD/g;function Kp(e){return(typeof e=="string"?e:""+e).replace(Bj,`
49
+ `).replace(Lj,"")}function Ip(e,t){return t=Kp(t),Kp(e)===t}function Ke(e,t,n,i,u,d){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Kl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Kl(e,""+i);break;case"className":pr(e,"class",i);break;case"tabIndex":pr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":pr(e,n,i);break;case"style":If(e,i,d);break;case"data":if(t!=="object"){pr(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=gr(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="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 d=="function"&&(n==="formAction"?(t!=="input"&&Ke(e,t,"name",u.name,u,null),Ke(e,t,"formEncType",u.formEncType,u,null),Ke(e,t,"formMethod",u.formMethod,u,null),Ke(e,t,"formTarget",u.formTarget,u,null)):(Ke(e,t,"encType",u.encType,u,null),Ke(e,t,"method",u.method,u,null),Ke(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=gr(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=Gn);break;case"onScroll":i!=null&&Oe("scroll",e);break;case"onScrollEnd":i!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=gr(""+i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),mr(e,"popover",i);break;case"xlinkActuate":$n(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":$n(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":$n(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":$n(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":$n(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":$n(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":$n(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":$n(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":$n(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":mr(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=fx.get(n)||n,mr(e,n,i))}}function Xo(e,t,n,i,u,d){switch(n){case"style":If(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Kl(e,i):(typeof i=="number"||typeof i=="bigint")&&Kl(e,""+i);break;case"onScroll":i!=null&&Oe("scroll",e);break;case"onScrollEnd":i!=null&&Oe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_f.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),d=e[Bt]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,u),typeof i=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,u);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):mr(e,n,i)}}}function St(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var i=!1,u=!1,d;for(d in n)if(n.hasOwnProperty(d)){var y=n[d];if(y!=null)switch(d){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ke(e,t,d,y,n,null)}}u&&Ke(e,t,"srcSet",n.srcSet,n,null),i&&Ke(e,t,"src",n.src,n,null);return;case"input":Oe("invalid",e);var j=d=y=u=null,T=null,_=null;for(i in n)if(n.hasOwnProperty(i)){var K=n[i];if(K!=null)switch(i){case"name":u=K;break;case"type":y=K;break;case"checked":T=K;break;case"defaultChecked":_=K;break;case"value":d=K;break;case"defaultValue":j=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(c(137,t));break;default:Ke(e,t,i,K,n,null)}}Hf(e,d,j,T,_,y,u,!1);return;case"select":Oe("invalid",e),i=y=d=null;for(u in n)if(n.hasOwnProperty(u)&&(j=n[u],j!=null))switch(u){case"value":d=j;break;case"defaultValue":y=j;break;case"multiple":i=j;default:Ke(e,t,u,j,n,null)}t=d,n=y,e.multiple=!!i,t!=null?Gl(e,!!i,t,!1):n!=null&&Gl(e,!!i,n,!0);return;case"textarea":Oe("invalid",e),d=u=i=null;for(y in n)if(n.hasOwnProperty(y)&&(j=n[y],j!=null))switch(y){case"value":i=j;break;case"defaultValue":u=j;break;case"children":d=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(c(91));break;default:Ke(e,t,y,j,n,null)}Gf(e,i,u,d);return;case"option":for(T in n)if(n.hasOwnProperty(T)&&(i=n[T],i!=null))switch(T){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ke(e,t,T,i,n,null)}return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(i=0;i<zi.length;i++)Oe(zi[i],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(_ in n)if(n.hasOwnProperty(_)&&(i=n[_],i!=null))switch(_){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ke(e,t,_,i,n,null)}return;default:if(iu(t)){for(K in n)n.hasOwnProperty(K)&&(i=n[K],i!==void 0&&Xo(e,t,K,i,n,void 0));return}}for(j in n)n.hasOwnProperty(j)&&(i=n[j],i!=null&&Ke(e,t,j,i,n,null))}function Uj(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,d=null,y=null,j=null,T=null,_=null,K=null;for(Q in n){var P=n[Q];if(n.hasOwnProperty(Q)&&P!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":T=P;default:i.hasOwnProperty(Q)||Ke(e,t,Q,null,i,P)}}for(var B in i){var Q=i[B];if(P=n[B],i.hasOwnProperty(B)&&(Q!=null||P!=null))switch(B){case"type":d=Q;break;case"name":u=Q;break;case"checked":_=Q;break;case"defaultChecked":K=Q;break;case"value":y=Q;break;case"defaultValue":j=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:Q!==P&&Ke(e,t,B,Q,i,P)}}lu(e,y,j,T,_,K,d,u);return;case"select":Q=y=j=B=null;for(d in n)if(T=n[d],n.hasOwnProperty(d)&&T!=null)switch(d){case"value":break;case"multiple":Q=T;default:i.hasOwnProperty(d)||Ke(e,t,d,null,i,T)}for(u in i)if(d=i[u],T=n[u],i.hasOwnProperty(u)&&(d!=null||T!=null))switch(u){case"value":B=d;break;case"defaultValue":j=d;break;case"multiple":y=d;default:d!==T&&Ke(e,t,u,d,i,T)}t=j,n=y,i=Q,B!=null?Gl(e,!!n,B,!1):!!i!=!!n&&(t!=null?Gl(e,!!n,t,!0):Gl(e,!!n,n?[]:"",!1));return;case"textarea":Q=B=null;for(j in n)if(u=n[j],n.hasOwnProperty(j)&&u!=null&&!i.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ke(e,t,j,null,i,u)}for(y in i)if(u=i[y],d=n[y],i.hasOwnProperty(y)&&(u!=null||d!=null))switch(y){case"value":B=u;break;case"defaultValue":Q=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==d&&Ke(e,t,y,u,i,d)}$f(e,B,Q);return;case"option":for(var oe in n)if(B=n[oe],n.hasOwnProperty(oe)&&B!=null&&!i.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:Ke(e,t,oe,null,i,B)}for(T in i)if(B=i[T],Q=n[T],i.hasOwnProperty(T)&&B!==Q&&(B!=null||Q!=null))switch(T){case"selected":e.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Ke(e,t,T,B,i,Q)}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 ye in n)B=n[ye],n.hasOwnProperty(ye)&&B!=null&&!i.hasOwnProperty(ye)&&Ke(e,t,ye,null,i,B);for(_ in i)if(B=i[_],Q=n[_],i.hasOwnProperty(_)&&B!==Q&&(B!=null||Q!=null))switch(_){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:Ke(e,t,_,B,i,Q)}return;default:if(iu(t)){for(var Ie in n)B=n[Ie],n.hasOwnProperty(Ie)&&B!==void 0&&!i.hasOwnProperty(Ie)&&Xo(e,t,Ie,void 0,i,B);for(K in i)B=i[K],Q=n[K],!i.hasOwnProperty(K)||B===Q||B===void 0&&Q===void 0||Xo(e,t,K,B,i,Q);return}}for(var M in n)B=n[M],n.hasOwnProperty(M)&&B!=null&&!i.hasOwnProperty(M)&&Ke(e,t,M,null,i,B);for(P in i)B=i[P],Q=n[P],!i.hasOwnProperty(P)||B===Q||B==null&&Q==null||Ke(e,t,P,B,i,Q)}function Yp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var u=n[i],d=u.transferSize,y=u.initiatorType,j=u.duration;if(d&&j&&Yp(y)){for(y=0,j=u.responseEnd,i+=1;i<n.length;i++){var T=n[i],_=T.startTime;if(_>j)break;var K=T.transferSize,P=T.initiatorType;K&&Yp(P)&&(T=T.responseEnd,y+=K*(T<j?1:(j-_)/(T-_)))}if(--i,t+=8*(d+y)/(u.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 Fo=null,Po=null;function fc(e){return e.nodeType===9?e:e.ownerDocument}function Xp(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 Fp(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 Vo(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 Zo=null;function Hj(){var e=window.event;return e&&e.type==="popstate"?e===Zo?!1:(Zo=e,!0):(Zo=null,!1)}var Pp=typeof setTimeout=="function"?setTimeout:void 0,$j=typeof clearTimeout=="function"?clearTimeout:void 0,Vp=typeof Promise=="function"?Promise:void 0,Gj=typeof queueMicrotask=="function"?queueMicrotask:typeof Vp<"u"?function(e){return Vp.resolve(null).then(e).catch(Kj)}:Pp;function Kj(e){setTimeout(function(){throw e})}function Ba(e){return e==="head"}function Zp(e,t){var n=t,i=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(u),bs(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")ki(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ki(n);for(var d=n.firstChild;d;){var y=d.nextSibling,j=d.nodeName;d[Js]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=y}}else n==="body"&&ki(e.ownerDocument.body);n=u}while(n);bs(t)}function Jp(e,t){var n=e;e=0;do{var i=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||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Jo(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":Jo(n),nu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ij(e,t,n,i){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Js])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=yn(e.nextSibling),e===null)break}return null}function Yj(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=yn(e.nextSibling),e===null))return null;return e}function Wp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=yn(e.nextSibling),e===null))return null;return e}function Wo(e){return e.data==="$?"||e.data==="$~"}function ed(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Xj(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function yn(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 td=null;function ey(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return yn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function ty(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 ny(e,t,n){switch(t=fc(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nu(e)}var gn=new Map,ay=new Set;function hc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var sa=X.d;X.d={f:Fj,r:Pj,D:Vj,C:Zj,L:Jj,m:Wj,X:tb,S:eb,M:nb};function Fj(){var e=sa.f(),t=lc();return e||t}function Pj(e){var t=Ql(e);t!==null&&t.tag===5&&t.type==="form"?jm(t):sa.r(e)}var vs=typeof document>"u"?null:document;function ly(e,t,n){var i=vs;if(i&&typeof t=="string"&&t){var u=un(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),ay.has(u)||(ay.add(u),e={rel:e,crossOrigin:n,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),St(t,"link",e),ht(t),i.head.appendChild(t)))}}function Vj(e){sa.D(e),ly("dns-prefetch",e,null)}function Zj(e,t){sa.C(e,t),ly("preconnect",e,t)}function Jj(e,t,n){sa.L(e,t,n);var i=vs;if(i&&e&&t){var u='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+un(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+un(n.imageSizes)+'"]')):u+='[href="'+un(e)+'"]';var d=u;switch(t){case"style":d=xs(e);break;case"script":d=js(e)}gn.has(d)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),gn.set(d,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(qi(d))||t==="script"&&i.querySelector(_i(d))||(t=i.createElement("link"),St(t,"link",e),ht(t),i.head.appendChild(t)))}}function Wj(e,t){sa.m(e,t);var n=vs;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+un(i)+'"][href="'+un(e)+'"]',d=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=js(e)}if(!gn.has(d)&&(e=v({rel:"modulepreload",href:e},t),gn.set(d,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(_i(d)))return}i=n.createElement("link"),St(i,"link",e),ht(i),n.head.appendChild(i)}}}function eb(e,t,n){sa.S(e,t,n);var i=vs;if(i&&e){var u=Hl(i).hoistableStyles,d=xs(e);t=t||"default";var y=u.get(d);if(!y){var j={loading:0,preload:null};if(y=i.querySelector(qi(d)))j.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=gn.get(d))&&nd(e,n);var T=y=i.createElement("link");ht(T),St(T,"link",e),T._p=new Promise(function(_,K){T.onload=_,T.onerror=K}),T.addEventListener("load",function(){j.loading|=1}),T.addEventListener("error",function(){j.loading|=2}),j.loading|=4,mc(y,t,i)}y={type:"stylesheet",instance:y,count:1,state:j},u.set(d,y)}}}function tb(e,t){sa.X(e,t);var n=vs;if(n&&e){var i=Hl(n).hoistableScripts,u=js(e),d=i.get(u);d||(d=n.querySelector(_i(u)),d||(e=v({src:e,async:!0},t),(t=gn.get(u))&&ad(e,t),d=n.createElement("script"),ht(d),St(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(u,d))}}function nb(e,t){sa.M(e,t);var n=vs;if(n&&e){var i=Hl(n).hoistableScripts,u=js(e),d=i.get(u);d||(d=n.querySelector(_i(u)),d||(e=v({src:e,async:!0,type:"module"},t),(t=gn.get(u))&&ad(e,t),d=n.createElement("script"),ht(d),St(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(u,d))}}function sy(e,t,n,i){var u=(u=O.current)?hc(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=xs(n.href),n=Hl(u).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=xs(n.href);var d=Hl(u).hoistableStyles,y=d.get(e);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=u.querySelector(qi(e)))&&!d._p&&(y.instance=d,y.state.loading=5),gn.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},gn.set(e,n),d||ab(u,e,n,y.state))),t&&i===null)throw Error(c(528,""));return y}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=js(n),n=Hl(u).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function xs(e){return'href="'+un(e)+'"'}function qi(e){return'link[rel="stylesheet"]['+e+"]"}function iy(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function ab(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),St(t,"link",n),ht(t),e.head.appendChild(t))}function js(e){return'[src="'+un(e)+'"]'}function _i(e){return"script[async]"+e}function ry(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+un(n.href)+'"]');if(i)return t.instance=i,ht(i),i;var u=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),ht(i),St(i,"style",u),mc(i,n.precedence,e),t.instance=i;case"stylesheet":u=xs(n.href);var d=e.querySelector(qi(u));if(d)return t.state.loading|=4,t.instance=d,ht(d),d;i=iy(n),(u=gn.get(u))&&nd(i,u),d=(e.ownerDocument||e).createElement("link"),ht(d);var y=d;return y._p=new Promise(function(j,T){y.onload=j,y.onerror=T}),St(d,"link",i),t.state.loading|=4,mc(d,n.precedence,e),t.instance=d;case"script":return d=js(n.src),(u=e.querySelector(_i(d)))?(t.instance=u,ht(u),u):(i=n,(u=gn.get(d))&&(i=v({},n),ad(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),ht(u),St(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,mc(i,n.precedence,e));return t.instance}function mc(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,d=u,y=0;y<i.length;y++){var j=i[y];if(j.dataset.precedence===t)d=j;else if(d!==u)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ad(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var pc=null;function cy(e,t,n){if(pc===null){var i=new Map,u=pc=new Map;u.set(n,i)}else u=pc,i=u.get(n),i||(i=new Map,u.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var d=n[u];if(!(d[Js]||d[vt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var j=i.get(y);j?j.push(d):i.set(y,[d])}}return i}function uy(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function lb(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 oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function sb(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=xs(i.href),d=t.querySelector(qi(u));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yc.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,ht(d);return}d=t.ownerDocument||t,i=iy(i),(u=gn.get(u))&&nd(i,u),d=d.createElement("link"),ht(d);var y=d;y._p=new Promise(function(j,T){y.onload=j,y.onerror=T}),St(d,"link",i),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=yc.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var ld=0;function ib(e,t){return e.stylesheets&&e.count===0&&vc(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&vc(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&ld===0&&(ld=62500*Qj());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vc(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>ld?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var gc=null;function vc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,gc=new Map,t.forEach(rb,e),gc=null,yc.call(e))}function rb(e,t){if(!(t.state.loading&4)){var n=gc.get(e);if(n)var i=n.get(null);else{n=new Map,gc.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<u.length;d++){var y=u[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(n.set(y.dataset.precedence,y),i=y)}i&&n.set(null,i)}u=t.instance,y=u.getAttribute("data-precedence"),d=n.get(y)||i,d===i&&n.set(null,u),n.set(y,u),this.count++,i=yc.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),d?d.parentNode.insertBefore(u,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Bi={$$typeof:$,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function cb(e,t,n,i,u,d,y,j,T){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=Jc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jc(0),this.hiddenUpdates=Jc(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function dy(e,t,n,i,u,d,y,j,T,_,K,P){return e=new cb(e,t,n,y,T,_,K,P,j),t=1,d===!0&&(t|=24),d=Vt(3,null,null,t),e.current=d,d.stateNode=e,t=_u(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:i,isDehydrated:n,cache:t},Qu(d),e}function fy(e){return e?(e=Zl,e):Zl}function hy(e,t,n,i,u,d){u=fy(u),i.context===null?i.context=u:i.pendingContext=u,i=Ta(t),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=Ra(e,i,t),n!==null&&(Gt(n,e,t),pi(n,e,t))}function my(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sd(e,t){my(e,t),(e=e.alternate)&&my(e,t)}function py(e){if(e.tag===13||e.tag===31){var t=ol(e,67108864);t!==null&&Gt(t,e,67108864),sd(e,67108864)}}function yy(e){if(e.tag===13||e.tag===31){var t=tn();t=Wc(t);var n=ol(e,t);n!==null&&Gt(n,e,t),sd(e,t)}}var xc=!0;function ub(e,t,n,i){var u=k.T;k.T=null;var d=X.p;try{X.p=2,id(e,t,n,i)}finally{X.p=d,k.T=u}}function ob(e,t,n,i){var u=k.T;k.T=null;var d=X.p;try{X.p=8,id(e,t,n,i)}finally{X.p=d,k.T=u}}function id(e,t,n,i){if(xc){var u=rd(i);if(u===null)Yo(e,t,i,jc,n),vy(e,i);else if(fb(u,e,t,n,i))i.stopPropagation();else if(vy(e,i),t&4&&-1<db.indexOf(e)){for(;u!==null;){var d=Ql(u);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=sl(d.pendingLanes);if(y!==0){var j=d;for(j.pendingLanes|=2,j.entangledLanes|=2;y;){var T=1<<31-Ft(y);j.entanglements[1]|=T,y&=~T}Ln(d),(Le&6)===0&&(nc=Yt()+500,Mi(0))}}break;case 31:case 13:j=ol(d,2),j!==null&&Gt(j,d,2),lc(),sd(d,2)}if(d=rd(i),d===null&&Yo(e,t,i,jc,n),d===u)break;u=d}u!==null&&i.stopPropagation()}else Yo(e,t,i,null,n)}}function rd(e){return e=cu(e),cd(e)}var jc=null;function cd(e){if(jc=null,e=Ul(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(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 jc=e,null}function gy(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(Vv()){case Ef:return 2;case Tf:return 8;case ur:case Zv:return 32;case Rf:return 268435456;default:return 32}default:return 32}}var ud=!1,La=null,Ua=null,Qa=null,Li=new Map,Ui=new Map,Ha=[],db="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 vy(e,t){switch(e){case"focusin":case"focusout":La=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":Li.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ui.delete(t.pointerId)}}function Qi(e,t,n,i,u,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:d,targetContainers:[u]},t!==null&&(t=Ql(t),t!==null&&py(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function fb(e,t,n,i,u){switch(t){case"focusin":return La=Qi(La,e,t,n,i,u),!0;case"dragenter":return Ua=Qi(Ua,e,t,n,i,u),!0;case"mouseover":return Qa=Qi(Qa,e,t,n,i,u),!0;case"pointerover":var d=u.pointerId;return Li.set(d,Qi(Li.get(d)||null,e,t,n,i,u)),!0;case"gotpointercapture":return d=u.pointerId,Ui.set(d,Qi(Ui.get(d)||null,e,t,n,i,u)),!0}return!1}function xy(e){var t=Ul(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Df(e.priority,function(){yy(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Df(e.priority,function(){yy(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 bc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=rd(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);ru=i,n.target.dispatchEvent(i),ru=null}else return t=Ql(n),t!==null&&py(t),e.blockedOn=n,!1;t.shift()}return!0}function jy(e,t,n){bc(e)&&n.delete(t)}function hb(){ud=!1,La!==null&&bc(La)&&(La=null),Ua!==null&&bc(Ua)&&(Ua=null),Qa!==null&&bc(Qa)&&(Qa=null),Li.forEach(jy),Ui.forEach(jy)}function Sc(e,t){e.blockedOn===t&&(e.blockedOn=null,ud||(ud=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,hb)))}var Nc=null;function by(e){Nc!==e&&(Nc=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Nc===e&&(Nc=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(cd(i||n)===null)continue;break}var d=Ql(n);d!==null&&(e.splice(t,3),t-=3,io(d,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function bs(e){function t(T){return Sc(T,e)}La!==null&&Sc(La,e),Ua!==null&&Sc(Ua,e),Qa!==null&&Sc(Qa,e),Li.forEach(t),Ui.forEach(t);for(var n=0;n<Ha.length;n++){var i=Ha[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ha.length&&(n=Ha[0],n.blockedOn===null);)xy(n),n.blockedOn===null&&Ha.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var u=n[i],d=n[i+1],y=u[Bt]||null;if(typeof d=="function")y||by(n);else if(y){var j=null;if(d&&d.hasAttribute("formAction")){if(u=d,y=d[Bt]||null)j=y.formAction;else if(cd(u)!==null)continue}else j=y.action;typeof j=="function"?n[i+1]=j:(n.splice(i,3),i-=3),by(n)}}}function Sy(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function od(e){this._internalRoot=e}Cc.prototype.render=od.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=tn();hy(n,i,e,t,null,null)},Cc.prototype.unmount=od.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hy(e.current,2,null,e,null,null),lc(),t[Ll]=null}};function Cc(e){this._internalRoot=e}Cc.prototype.unstable_scheduleHydration=function(e){if(e){var t=zf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ha.length&&t!==0&&t<Ha[n].priority;n++);Ha.splice(n,0,e),n===0&&xy(e)}};var Ny=s.version;if(Ny!=="19.2.7")throw Error(c(527,Ny,"19.2.7"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var mb={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ec.isDisabled&&Ec.supportsFiber)try{Ps=Ec.inject(mb),Xt=Ec}catch{}}return $i.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,i="",u=Om,d=Mm,y=zm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=dy(e,1,!1,null,null,n,i,null,u,d,y,Sy),e[Ll]=t.current,Io(e),new od(t)},$i.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",d=Om,y=Mm,j=zm,T=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(j=n.onRecoverableError),n.formState!==void 0&&(T=n.formState)),t=dy(e,1,!0,t,n??null,i,u,T,d,y,j,Sy),t.context=fy(null),n=t.current,i=tn(),i=Wc(i),u=Ta(i),u.callback=null,Ra(n,u,i),n=i,t.current.lanes=n,Zs(t,n),Ln(t),e[Ll]=t.current,Io(e),new Cc(t)},$i.version="19.2.7",$i}var qy;function Tb(){if(qy)return md.exports;qy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),md.exports=Eb(),md.exports}var Rb=Tb(),$s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(l){return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Cl,Ya,As,jg,Ab=(jg=class extends $s{constructor(){super();fe(this,Cl);fe(this,Ya);fe(this,As);le(this,As,s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){R(this,Ya)||this.setEventListener(R(this,As))}onUnsubscribe(){var s;this.hasListeners()||((s=R(this,Ya))==null||s.call(this),le(this,Ya,void 0))}setEventListener(s){var r;le(this,As,s),(r=R(this,Ya))==null||r.call(this),le(this,Ya,s(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(s){R(this,Cl)!==s&&(le(this,Cl,s),this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(r=>{r(s)})}isFocused(){var s;return typeof R(this,Cl)=="boolean"?R(this,Cl):((s=globalThis.document)==null?void 0:s.visibilityState)!=="hidden"}},Cl=new WeakMap,Ya=new WeakMap,As=new WeakMap,jg),nf=new Ab,wb={setTimeout:(l,s)=>setTimeout(l,s),clearTimeout:l=>clearTimeout(l),setInterval:(l,s)=>setInterval(l,s),clearInterval:l=>clearInterval(l)},Xa,ef,bg,Ob=(bg=class{constructor(){fe(this,Xa,wb);fe(this,ef,!1)}setTimeoutProvider(l){le(this,Xa,l)}setTimeout(l,s){return R(this,Xa).setTimeout(l,s)}clearTimeout(l){R(this,Xa).clearTimeout(l)}setInterval(l,s){return R(this,Xa).setInterval(l,s)}clearInterval(l){R(this,Xa).clearInterval(l)}},Xa=new WeakMap,ef=new WeakMap,bg),Nl=new Ob;function Mb(l){setTimeout(l,0)}var zb=typeof window>"u"||"Deno"in globalThis;function Dt(){}function Db(l,s){return typeof l=="function"?l(s):l}function Od(l){return typeof l=="number"&&l>=0&&l!==1/0}function Mg(l,s){return Math.max(l+(s||0)-Date.now(),0)}function nl(l,s){return typeof l=="function"?l(s):l}function an(l,s){return typeof l=="function"?l(s):l}function _y(l,s){const{type:r="all",exact:c,fetchStatus:o,predicate:f,queryKey:h,stale:m}=l;if(h){if(c){if(s.queryHash!==af(h,s.options))return!1}else if(!Fi(s.queryKey,h))return!1}if(r!=="all"){const p=s.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof m=="boolean"&&s.isStale()!==m||o&&o!==s.state.fetchStatus||f&&!f(s))}function By(l,s){const{exact:r,status:c,predicate:o,mutationKey:f}=l;if(f){if(!s.options.mutationKey)return!1;if(r){if(kl(s.options.mutationKey)!==kl(f))return!1}else if(!Fi(s.options.mutationKey,f))return!1}return!(c&&s.state.status!==c||o&&!o(s))}function af(l,s){return((s==null?void 0:s.queryKeyHashFn)||kl)(l)}function kl(l){return JSON.stringify(l,(s,r)=>Md(r)?Object.keys(r).sort().reduce((c,o)=>(c[o]=r[o],c),{}):r)}function Fi(l,s){return l===s?!0:typeof l!=typeof s?!1:l&&s&&typeof l=="object"&&typeof s=="object"?Object.keys(s).every(r=>Fi(l[r],s[r])):!1}var kb=Object.prototype.hasOwnProperty;function zg(l,s,r=0){if(l===s)return l;if(r>500)return s;const c=Ly(l)&&Ly(s);if(!c&&!(Md(l)&&Md(s)))return s;const f=(c?l:Object.keys(l)).length,h=c?s:Object.keys(s),m=h.length,p=c?new Array(m):{};let g=0;for(let x=0;x<m;x++){const v=c?x:h[x],N=l[v],b=s[v];if(N===b){p[v]=N,(c?x<f:kb.call(l,v))&&g++;continue}if(N===null||b===null||typeof N!="object"||typeof b!="object"){p[v]=b;continue}const C=zg(N,b,r+1);p[v]=C,C===N&&g++}return f===m&&g===f?l:p}function kc(l,s){if(!s||Object.keys(l).length!==Object.keys(s).length)return!1;for(const r in l)if(l[r]!==s[r])return!1;return!0}function Ly(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function Md(l){if(!Uy(l))return!1;const s=l.constructor;if(s===void 0)return!0;const r=s.prototype;return!(!Uy(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(l)!==Object.prototype)}function Uy(l){return Object.prototype.toString.call(l)==="[object Object]"}function qb(l){return new Promise(s=>{Nl.setTimeout(s,l)})}function zd(l,s,r){return typeof r.structuralSharing=="function"?r.structuralSharing(l,s):r.structuralSharing!==!1?zg(l,s):s}function _b(l,s,r=0){const c=[...l,s];return r&&c.length>r?c.slice(1):c}function Bb(l,s,r=0){const c=[s,...l];return r&&c.length>r?c.slice(0,-1):c}var lf=Symbol();function Dg(l,s){return!l.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!l.queryFn||l.queryFn===lf?()=>Promise.reject(new Error(`Missing queryFn: '${l.queryHash}'`)):l.queryFn}function sf(l,s){return typeof l=="function"?l(...s):!!l}function Lb(l,s,r){let c=!1,o;return Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o??(o=s()),c||(c=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),l}var Pi=(()=>{let l=()=>zb;return{isServer(){return l()},setIsServer(s){l=s}}})();function Dd(){let l,s;const r=new Promise((o,f)=>{l=o,s=f});r.status="pending",r.catch(()=>{});function c(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{c({status:"fulfilled",value:o}),l(o)},r.reject=o=>{c({status:"rejected",reason:o}),s(o)},r}var Ub=Mb;function Qb(){let l=[],s=0,r=m=>{m()},c=m=>{m()},o=Ub;const f=m=>{s?l.push(m):o(()=>{r(m)})},h=()=>{const m=l;l=[],m.length&&o(()=>{c(()=>{m.forEach(p=>{r(p)})})})};return{batch:m=>{let p;s++;try{p=m()}finally{s--,s||h()}return p},batchCalls:m=>(...p)=>{f(()=>{m(...p)})},schedule:f,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{c=m},setScheduler:m=>{o=m}}}var ft=Qb(),ws,Fa,Os,Sg,Hb=(Sg=class extends $s{constructor(){super();fe(this,ws,!0);fe(this,Fa);fe(this,Os);le(this,Os,s=>{if(typeof window<"u"&&window.addEventListener){const r=()=>s(!0),c=()=>s(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",c)}}})}onSubscribe(){R(this,Fa)||this.setEventListener(R(this,Os))}onUnsubscribe(){var s;this.hasListeners()||((s=R(this,Fa))==null||s.call(this),le(this,Fa,void 0))}setEventListener(s){var r;le(this,Os,s),(r=R(this,Fa))==null||r.call(this),le(this,Fa,s(this.setOnline.bind(this)))}setOnline(s){R(this,ws)!==s&&(le(this,ws,s),this.listeners.forEach(c=>{c(s)}))}isOnline(){return R(this,ws)}},ws=new WeakMap,Fa=new WeakMap,Os=new WeakMap,Sg),qc=new Hb;function $b(l){return Math.min(1e3*2**l,3e4)}function kg(l){return(l??"online")==="online"?qc.isOnline():!0}var kd=class extends Error{constructor(l){super("CancelledError"),this.revert=l==null?void 0:l.revert,this.silent=l==null?void 0:l.silent}};function qg(l){let s=!1,r=0,c;const o=Dd(),f=()=>o.status!=="pending",h=A=>{var z;if(!f()){const D=new kd(A);N(D),(z=l.onCancel)==null||z.call(l,D)}},m=()=>{s=!0},p=()=>{s=!1},g=()=>nf.isFocused()&&(l.networkMode==="always"||qc.isOnline())&&l.canRun(),x=()=>kg(l.networkMode)&&l.canRun(),v=A=>{f()||(c==null||c(),o.resolve(A))},N=A=>{f()||(c==null||c(),o.reject(A))},b=()=>new Promise(A=>{var z;c=D=>{(f()||g())&&A(D)},(z=l.onPause)==null||z.call(l)}).then(()=>{var A;c=void 0,f()||(A=l.onContinue)==null||A.call(l)}),C=()=>{if(f())return;let A;const z=r===0?l.initialPromise:void 0;try{A=z??l.fn()}catch(D){A=Promise.reject(D)}Promise.resolve(A).then(v).catch(D=>{var W;if(f())return;const F=l.retry??(Pi.isServer()?0:3),$=l.retryDelay??$b,U=typeof $=="function"?$(r,D):$,Z=F===!0||typeof F=="number"&&r<F||typeof F=="function"&&F(r,D);if(s||!Z){N(D);return}r++,(W=l.onFail)==null||W.call(l,r,D),qb(U).then(()=>g()?void 0:b()).then(()=>{s?N(D):C()})})};return{promise:o,status:()=>o.status,cancel:h,continue:()=>(c==null||c(),o),cancelRetry:m,continueRetry:p,canStart:x,start:()=>(x()?C():b().then(C),o)}}var El,Ng,_g=(Ng=class{constructor(){fe(this,El)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Od(this.gcTime)&&le(this,El,Nl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(l){this.gcTime=Math.max(this.gcTime||0,l??(Pi.isServer()?1/0:300*1e3))}clearGcTimeout(){R(this,El)!==void 0&&(Nl.clearTimeout(R(this,El)),le(this,El,void 0))}},El=new WeakMap,Ng);function Gb(l){return{onFetch:(s,r)=>{var x,v,N,b,C;const c=s.options,o=(N=(v=(x=s.fetchOptions)==null?void 0:x.meta)==null?void 0:v.fetchMore)==null?void 0:N.direction,f=((b=s.state.data)==null?void 0:b.pages)||[],h=((C=s.state.data)==null?void 0:C.pageParams)||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let A=!1;const z=$=>{Lb($,()=>s.signal,()=>A=!0)},D=Dg(s.options,s.fetchOptions),F=async($,U,Z)=>{if(A)return Promise.reject(s.signal.reason);if(U==null&&$.pages.length)return Promise.resolve($);const V=(()=>{const pe={client:s.client,queryKey:s.queryKey,pageParam:U,direction:Z?"backward":"forward",meta:s.options.meta};return z(pe),pe})(),G=await D(V),{maxPages:te}=s.options,xe=Z?Bb:_b;return{pages:xe($.pages,G,te),pageParams:xe($.pageParams,U,te)}};if(o&&f.length){const $=o==="backward",U=$?Bg:qd,Z={pages:f,pageParams:h},W=U(c,Z);m=await F(Z,W,$)}else{const $=l??f.length;do{const U=p===0?h[0]??c.initialPageParam:qd(c,m);if(p>0&&U==null)break;m=await F(m,U),p++}while(p<$)}return m};s.options.persister?s.fetchFn=()=>{var A,z;return(z=(A=s.options).persister)==null?void 0:z.call(A,g,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},r)}:s.fetchFn=g}}}function qd(l,{pages:s,pageParams:r}){const c=s.length-1;return s.length>0?l.getNextPageParam(s[c],s,r[c],r):void 0}function Bg(l,{pages:s,pageParams:r}){var c;return s.length>0?(c=l.getPreviousPageParam)==null?void 0:c.call(l,s[0],s,r[0],r):void 0}function Kb(l,s){return s?qd(l,s)!=null:!1}function Ib(l,s){return!s||!l.getPreviousPageParam?!1:Bg(l,s)!=null}var Ms,Tl,zs,vn,Rl,yt,Wi,Al,nn,Lg,ua,Cg,Yb=(Cg=class extends _g{constructor(s){super();fe(this,nn);fe(this,Ms);fe(this,Tl);fe(this,zs);fe(this,vn);fe(this,Rl);fe(this,yt);fe(this,Wi);fe(this,Al);le(this,Al,!1),le(this,Wi,s.defaultOptions),this.setOptions(s.options),this.observers=[],le(this,Rl,s.client),le(this,vn,R(this,Rl).getQueryCache()),this.queryKey=s.queryKey,this.queryHash=s.queryHash,le(this,Tl,Hy(this.options)),this.state=s.state??R(this,Tl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return R(this,Ms)}get promise(){var s;return(s=R(this,yt))==null?void 0:s.promise}setOptions(s){if(this.options={...R(this,Wi),...s},s!=null&&s._type&&le(this,Ms,s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Hy(this.options);r.data!==void 0&&(this.setState(Qy(r.data,r.dataUpdatedAt)),le(this,Tl,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,vn).remove(this)}setData(s,r){const c=zd(this.state.data,s,this.options);return Te(this,nn,ua).call(this,{data:c,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),c}setState(s){Te(this,nn,ua).call(this,{type:"setState",state:s})}cancel(s){var c,o;const r=(c=R(this,yt))==null?void 0:c.promise;return(o=R(this,yt))==null||o.cancel(s),r?r.then(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return R(this,Tl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>an(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>nl(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!Mg(this.state.dataUpdatedAt,s)}onFocus(){var r;const s=this.observers.find(c=>c.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(r=R(this,yt))==null||r.continue()}onOnline(){var r;const s=this.observers.find(c=>c.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(r=R(this,yt))==null||r.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),R(this,vn).notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(r=>r!==s),this.observers.length||(R(this,yt)&&(R(this,Al)||Te(this,nn,Lg).call(this)?R(this,yt).cancel({revert:!0}):R(this,yt).cancelRetry()),this.scheduleGc()),R(this,vn).notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,nn,ua).call(this,{type:"invalidate"})}async fetch(s,r){var g,x,v,N,b,C,A,z,D,F,$;if(this.state.fetchStatus!=="idle"&&((g=R(this,yt))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(R(this,yt))return R(this,yt).continueRetry(),R(this,yt).promise}if(s&&this.setOptions(s),!this.options.queryFn){const U=this.observers.find(Z=>Z.options.queryFn);U&&this.setOptions(U.options)}const c=new AbortController,o=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(le(this,Al,!0),c.signal)})},f=()=>{const U=Dg(this.options,r),W=(()=>{const V={client:R(this,Rl),queryKey:this.queryKey,meta:this.meta};return o(V),V})();return le(this,Al,!1),this.options.persister?this.options.persister(U,W,this):U(W)},m=(()=>{const U={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:R(this,Rl),state:this.state,fetchFn:f};return o(U),U})(),p=R(this,Ms)==="infinite"?Gb(this.options.pages):this.options.behavior;p==null||p.onFetch(m,this),le(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=m.fetchOptions)==null?void 0:x.meta))&&Te(this,nn,ua).call(this,{type:"fetch",meta:(v=m.fetchOptions)==null?void 0:v.meta}),le(this,yt,qg({initialPromise:r==null?void 0:r.initialPromise,fn:m.fetchFn,onCancel:U=>{U instanceof kd&&U.revert&&this.setState({...R(this,zs),fetchStatus:"idle"}),c.abort()},onFail:(U,Z)=>{Te(this,nn,ua).call(this,{type:"failed",failureCount:U,error:Z})},onPause:()=>{Te(this,nn,ua).call(this,{type:"pause"})},onContinue:()=>{Te(this,nn,ua).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const U=await R(this,yt).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(b=(N=R(this,vn).config).onSuccess)==null||b.call(N,U,this),(A=(C=R(this,vn).config).onSettled)==null||A.call(C,U,this.state.error,this),U}catch(U){if(U instanceof kd){if(U.silent)return R(this,yt).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Te(this,nn,ua).call(this,{type:"error",error:U}),(D=(z=R(this,vn).config).onError)==null||D.call(z,U,this),($=(F=R(this,vn).config).onSettled)==null||$.call(F,this.state.data,U,this),U}finally{this.scheduleGc()}}},Ms=new WeakMap,Tl=new WeakMap,zs=new WeakMap,vn=new WeakMap,Rl=new WeakMap,yt=new WeakMap,Wi=new WeakMap,Al=new WeakMap,nn=new WeakSet,Lg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ua=function(s){const r=c=>{switch(s.type){case"failed":return{...c,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...Ug(c.data,this.options),fetchMeta:s.meta??null};case"success":const o={...c,...Qy(s.data,s.dataUpdatedAt),dataUpdateCount:c.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return le(this,zs,s.manual?o:void 0),o;case"error":const f=s.error;return{...c,error:f,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...s.state}}};this.state=r(this.state),ft.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),R(this,vn).notify({query:this,type:"updated",action:s})})},Cg);function Ug(l,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kg(s.networkMode)?"fetching":"paused",...l===void 0&&{error:null,status:"pending"}}}function Qy(l,s){return{data:l,dataUpdatedAt:s??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hy(l){const s=typeof l.initialData=="function"?l.initialData():l.initialData,r=s!==void 0,c=r?typeof l.initialDataUpdatedAt=="function"?l.initialDataUpdatedAt():l.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:r?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Kt,ke,er,zt,wl,Ds,da,Pa,tr,ks,qs,Ol,Ml,Va,_s,Ue,Ii,_d,Bd,Ld,Ud,Qd,Hd,$d,Hg,Eg,Qg=(Eg=class extends $s{constructor(s,r){super();fe(this,Ue);fe(this,Kt);fe(this,ke);fe(this,er);fe(this,zt);fe(this,wl);fe(this,Ds);fe(this,da);fe(this,Pa);fe(this,tr);fe(this,ks);fe(this,qs);fe(this,Ol);fe(this,Ml);fe(this,Va);fe(this,_s,new Set);this.options=r,le(this,Kt,s),le(this,Pa,null),le(this,da,Dd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,ke).addObserver(this),$y(R(this,ke),this.options)?Te(this,Ue,Ii).call(this):this.updateResult(),Te(this,Ue,Ud).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gd(R(this,ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gd(R(this,ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ue,Qd).call(this),Te(this,Ue,Hd).call(this),R(this,ke).removeObserver(this)}setOptions(s){const r=this.options,c=R(this,ke);if(this.options=R(this,Kt).defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof an(this.options.enabled,R(this,ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ue,$d).call(this),R(this,ke).setOptions(this.options),r._defaulted&&!kc(this.options,r)&&R(this,Kt).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,ke),observer:this});const o=this.hasListeners();o&&Gy(R(this,ke),c,this.options,r)&&Te(this,Ue,Ii).call(this),this.updateResult(),o&&(R(this,ke)!==c||an(this.options.enabled,R(this,ke))!==an(r.enabled,R(this,ke))||nl(this.options.staleTime,R(this,ke))!==nl(r.staleTime,R(this,ke)))&&Te(this,Ue,_d).call(this);const f=Te(this,Ue,Bd).call(this);o&&(R(this,ke)!==c||an(this.options.enabled,R(this,ke))!==an(r.enabled,R(this,ke))||f!==R(this,Va))&&Te(this,Ue,Ld).call(this,f)}getOptimisticResult(s){const r=R(this,Kt).getQueryCache().build(R(this,Kt),s),c=this.createResult(r,s);return Fb(this,c)&&(le(this,zt,c),le(this,Ds,this.options),le(this,wl,R(this,ke).state)),c}getCurrentResult(){return R(this,zt)}trackResult(s,r){return new Proxy(s,{get:(c,o)=>(this.trackProp(o),r==null||r(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&R(this,da).status==="pending"&&R(this,da).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(c,o))})}trackProp(s){R(this,_s).add(s)}getCurrentQuery(){return R(this,ke)}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const r=R(this,Kt).defaultQueryOptions(s),c=R(this,Kt).getQueryCache().build(R(this,Kt),r);return c.fetch().then(()=>this.createResult(c,r))}fetch(s){return Te(this,Ue,Ii).call(this,{...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,zt)))}createResult(s,r){var te;const c=R(this,ke),o=this.options,f=R(this,zt),h=R(this,wl),m=R(this,Ds),g=s!==c?s.state:R(this,er),{state:x}=s;let v={...x},N=!1,b;if(r._optimisticResults){const xe=this.hasListeners(),pe=!xe&&$y(s,r),se=xe&&Gy(s,c,r,o);(pe||se)&&(v={...v,...Ug(x.data,s.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:C,errorUpdatedAt:A,status:z}=v;b=v.data;let D=!1;if(r.placeholderData!==void 0&&b===void 0&&z==="pending"){let xe;f!=null&&f.isPlaceholderData&&r.placeholderData===(m==null?void 0:m.placeholderData)?(xe=f.data,D=!0):xe=typeof r.placeholderData=="function"?r.placeholderData((te=R(this,qs))==null?void 0:te.state.data,R(this,qs)):r.placeholderData,xe!==void 0&&(z="success",b=zd(f==null?void 0:f.data,xe,r),N=!0)}if(r.select&&b!==void 0&&!D)if(f&&b===(h==null?void 0:h.data)&&r.select===R(this,tr))b=R(this,ks);else try{le(this,tr,r.select),b=r.select(b),b=zd(f==null?void 0:f.data,b,r),le(this,ks,b),le(this,Pa,null)}catch(xe){le(this,Pa,xe)}R(this,Pa)&&(C=R(this,Pa),b=R(this,ks),A=Date.now(),z="error");const F=v.fetchStatus==="fetching",$=z==="pending",U=z==="error",Z=$&&F,W=b!==void 0,G={status:z,fetchStatus:v.fetchStatus,isPending:$,isSuccess:z==="success",isError:U,isInitialLoading:Z,isLoading:Z,data:b,dataUpdatedAt:v.dataUpdatedAt,error:C,errorUpdatedAt:A,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:F,isRefetching:F&&!$,isLoadingError:U&&!W,isPaused:v.fetchStatus==="paused",isPlaceholderData:N,isRefetchError:U&&W,isStale:rf(s,r),refetch:this.refetch,promise:R(this,da),isEnabled:an(r.enabled,s)!==!1};if(this.options.experimental_prefetchInRender){const xe=G.data!==void 0,pe=G.status==="error"&&!xe,se=ue=>{pe?ue.reject(G.error):xe&&ue.resolve(G.data)},ce=()=>{const ue=le(this,da,G.promise=Dd());se(ue)},Se=R(this,da);switch(Se.status){case"pending":s.queryHash===c.queryHash&&se(Se);break;case"fulfilled":(pe||G.data!==Se.value)&&ce();break;case"rejected":(!pe||G.error!==Se.reason)&&ce();break}}return G}updateResult(){const s=R(this,zt),r=this.createResult(R(this,ke),this.options);if(le(this,wl,R(this,ke).state),le(this,Ds,this.options),R(this,wl).data!==void 0&&le(this,qs,R(this,ke)),kc(r,s))return;le(this,zt,r);const c=()=>{if(!s)return!0;const{notifyOnChangeProps:o}=this.options,f=typeof o=="function"?o():o;if(f==="all"||!f&&!R(this,_s).size)return!0;const h=new Set(f??R(this,_s));return this.options.throwOnError&&h.add("error"),Object.keys(R(this,zt)).some(m=>{const p=m;return R(this,zt)[p]!==s[p]&&h.has(p)})};Te(this,Ue,Hg).call(this,{listeners:c()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ue,Ud).call(this)}},Kt=new WeakMap,ke=new WeakMap,er=new WeakMap,zt=new WeakMap,wl=new WeakMap,Ds=new WeakMap,da=new WeakMap,Pa=new WeakMap,tr=new WeakMap,ks=new WeakMap,qs=new WeakMap,Ol=new WeakMap,Ml=new WeakMap,Va=new WeakMap,_s=new WeakMap,Ue=new WeakSet,Ii=function(s){Te(this,Ue,$d).call(this);let r=R(this,ke).fetch(this.options,s);return s!=null&&s.throwOnError||(r=r.catch(Dt)),r},_d=function(){Te(this,Ue,Qd).call(this);const s=nl(this.options.staleTime,R(this,ke));if(Pi.isServer()||R(this,zt).isStale||!Od(s))return;const c=Mg(R(this,zt).dataUpdatedAt,s)+1;le(this,Ol,Nl.setTimeout(()=>{R(this,zt).isStale||this.updateResult()},c))},Bd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,ke)):this.options.refetchInterval)??!1},Ld=function(s){Te(this,Ue,Hd).call(this),le(this,Va,s),!(Pi.isServer()||an(this.options.enabled,R(this,ke))===!1||!Od(R(this,Va))||R(this,Va)===0)&&le(this,Ml,Nl.setInterval(()=>{(this.options.refetchIntervalInBackground||nf.isFocused())&&Te(this,Ue,Ii).call(this)},R(this,Va)))},Ud=function(){Te(this,Ue,_d).call(this),Te(this,Ue,Ld).call(this,Te(this,Ue,Bd).call(this))},Qd=function(){R(this,Ol)!==void 0&&(Nl.clearTimeout(R(this,Ol)),le(this,Ol,void 0))},Hd=function(){R(this,Ml)!==void 0&&(Nl.clearInterval(R(this,Ml)),le(this,Ml,void 0))},$d=function(){const s=R(this,Kt).getQueryCache().build(R(this,Kt),this.options);if(s===R(this,ke))return;const r=R(this,ke);le(this,ke,s),le(this,er,s.state),this.hasListeners()&&(r==null||r.removeObserver(this),s.addObserver(this))},Hg=function(s){ft.batch(()=>{s.listeners&&this.listeners.forEach(r=>{r(R(this,zt))}),R(this,Kt).getQueryCache().notify({query:R(this,ke),type:"observerResultsUpdated"})})},Eg);function Xb(l,s){return an(s.enabled,l)!==!1&&l.state.data===void 0&&!(l.state.status==="error"&&an(s.retryOnMount,l)===!1)}function $y(l,s){return Xb(l,s)||l.state.data!==void 0&&Gd(l,s,s.refetchOnMount)}function Gd(l,s,r){if(an(s.enabled,l)!==!1&&nl(s.staleTime,l)!=="static"){const c=typeof r=="function"?r(l):r;return c==="always"||c!==!1&&rf(l,s)}return!1}function Gy(l,s,r,c){return(l!==s||an(c.enabled,l)===!1)&&(!r.suspense||l.state.status!=="error")&&rf(l,r)}function rf(l,s){return an(s.enabled,l)!==!1&&l.isStaleByTime(nl(s.staleTime,l))}function Fb(l,s){return!kc(l.getCurrentResult(),s)}var Pb=class extends Qg{constructor(l,s){super(l,s)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(l){l._type="infinite",super.setOptions(l)}getOptimisticResult(l){return l._type="infinite",super.getOptimisticResult(l)}fetchNextPage(l){return this.fetch({...l,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(l){return this.fetch({...l,meta:{fetchMore:{direction:"backward"}}})}createResult(l,s){var C,A;const{state:r}=l,c=super.createResult(l,s),{isFetching:o,isRefetching:f,isError:h,isRefetchError:m}=c,p=(A=(C=r.fetchMeta)==null?void 0:C.fetchMore)==null?void 0:A.direction,g=h&&p==="forward",x=o&&p==="forward",v=h&&p==="backward",N=o&&p==="backward";return{...c,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Kb(s,r.data),hasPreviousPage:Ib(s,r.data),isFetchNextPageError:g,isFetchingNextPage:x,isFetchPreviousPageError:v,isFetchingPreviousPage:N,isRefetchError:m&&!g&&!v,isRefetching:f&&!x&&!N}}},nr,Un,Et,zl,Qn,Ia,Tg,Vb=(Tg=class extends _g{constructor(s){super();fe(this,Qn);fe(this,nr);fe(this,Un);fe(this,Et);fe(this,zl);le(this,nr,s.client),this.mutationId=s.mutationId,le(this,Et,s.mutationCache),le(this,Un,[]),this.state=s.state||$g(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){R(this,Un).includes(s)||(R(this,Un).push(s),this.clearGcTimeout(),R(this,Et).notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){le(this,Un,R(this,Un).filter(r=>r!==s)),this.scheduleGc(),R(this,Et).notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){R(this,Un).length||(this.state.status==="pending"?this.scheduleGc():R(this,Et).remove(this))}continue(){var s;return((s=R(this,zl))==null?void 0:s.continue())??this.execute(this.state.variables)}async execute(s){var h,m,p,g,x,v,N,b,C,A,z,D,F,$,U,Z,W,V;const r=()=>{Te(this,Qn,Ia).call(this,{type:"continue"})},c={client:R(this,nr),meta:this.options.meta,mutationKey:this.options.mutationKey};le(this,zl,qg({fn:()=>this.options.mutationFn?this.options.mutationFn(s,c):Promise.reject(new Error("No mutationFn found")),onFail:(G,te)=>{Te(this,Qn,Ia).call(this,{type:"failed",failureCount:G,error:te})},onPause:()=>{Te(this,Qn,Ia).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,Et).canRun(this)}));const o=this.state.status==="pending",f=!R(this,zl).canStart();try{if(o)r();else{Te(this,Qn,Ia).call(this,{type:"pending",variables:s,isPaused:f}),R(this,Et).config.onMutate&&await R(this,Et).config.onMutate(s,this,c);const te=await((m=(h=this.options).onMutate)==null?void 0:m.call(h,s,c));te!==this.state.context&&Te(this,Qn,Ia).call(this,{type:"pending",context:te,variables:s,isPaused:f})}const G=await R(this,zl).start();return await((g=(p=R(this,Et).config).onSuccess)==null?void 0:g.call(p,G,s,this.state.context,this,c)),await((v=(x=this.options).onSuccess)==null?void 0:v.call(x,G,s,this.state.context,c)),await((b=(N=R(this,Et).config).onSettled)==null?void 0:b.call(N,G,null,this.state.variables,this.state.context,this,c)),await((A=(C=this.options).onSettled)==null?void 0:A.call(C,G,null,s,this.state.context,c)),Te(this,Qn,Ia).call(this,{type:"success",data:G}),G}catch(G){try{await((D=(z=R(this,Et).config).onError)==null?void 0:D.call(z,G,s,this.state.context,this,c))}catch(te){Promise.reject(te)}try{await(($=(F=this.options).onError)==null?void 0:$.call(F,G,s,this.state.context,c))}catch(te){Promise.reject(te)}try{await((Z=(U=R(this,Et).config).onSettled)==null?void 0:Z.call(U,void 0,G,this.state.variables,this.state.context,this,c))}catch(te){Promise.reject(te)}try{await((V=(W=this.options).onSettled)==null?void 0:V.call(W,void 0,G,s,this.state.context,c))}catch(te){Promise.reject(te)}throw Te(this,Qn,Ia).call(this,{type:"error",error:G}),G}finally{R(this,Et).runNext(this)}}},nr=new WeakMap,Un=new WeakMap,Et=new WeakMap,zl=new WeakMap,Qn=new WeakSet,Ia=function(s){const r=c=>{switch(s.type){case"failed":return{...c,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...c,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:s.error,failureCount:c.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ft.batch(()=>{R(this,Un).forEach(c=>{c.onMutationUpdate(s)}),R(this,Et).notify({mutation:this,type:"updated",action:s})})},Tg);function $g(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fa,On,ar,Rg,Zb=(Rg=class extends $s{constructor(s={}){super();fe(this,fa);fe(this,On);fe(this,ar);this.config=s,le(this,fa,new Set),le(this,On,new Map),le(this,ar,0)}build(s,r,c){const o=new Vb({client:s,mutationCache:this,mutationId:++Tc(this,ar)._,options:s.defaultMutationOptions(r),state:c});return this.add(o),o}add(s){R(this,fa).add(s);const r=Rc(s);if(typeof r=="string"){const c=R(this,On).get(r);c?c.push(s):R(this,On).set(r,[s])}this.notify({type:"added",mutation:s})}remove(s){if(R(this,fa).delete(s)){const r=Rc(s);if(typeof r=="string"){const c=R(this,On).get(r);if(c)if(c.length>1){const o=c.indexOf(s);o!==-1&&c.splice(o,1)}else c[0]===s&&R(this,On).delete(r)}}this.notify({type:"removed",mutation:s})}canRun(s){const r=Rc(s);if(typeof r=="string"){const c=R(this,On).get(r),o=c==null?void 0:c.find(f=>f.state.status==="pending");return!o||o===s}else return!0}runNext(s){var c;const r=Rc(s);if(typeof r=="string"){const o=(c=R(this,On).get(r))==null?void 0:c.find(f=>f!==s&&f.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ft.batch(()=>{R(this,fa).forEach(s=>{this.notify({type:"removed",mutation:s})}),R(this,fa).clear(),R(this,On).clear()})}getAll(){return Array.from(R(this,fa))}find(s){const r={exact:!0,...s};return this.getAll().find(c=>By(r,c))}findAll(s={}){return this.getAll().filter(r=>By(s,r))}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}resumePausedMutations(){const s=this.getAll().filter(r=>r.state.isPaused);return ft.batch(()=>Promise.all(s.map(r=>r.continue().catch(Dt))))}},fa=new WeakMap,On=new WeakMap,ar=new WeakMap,Rg);function Rc(l){var s;return(s=l.options.scope)==null?void 0:s.id}var ha,Za,It,ma,ya,Mc,Kd,Ag,Jb=(Ag=class extends $s{constructor(r,c){super();fe(this,ya);fe(this,ha);fe(this,Za);fe(this,It);fe(this,ma);le(this,ha,r),this.setOptions(c),this.bindMethods(),Te(this,ya,Mc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var o;const c=this.options;this.options=R(this,ha).defaultMutationOptions(r),kc(this.options,c)||R(this,ha).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,It),observer:this}),c!=null&&c.mutationKey&&this.options.mutationKey&&kl(c.mutationKey)!==kl(this.options.mutationKey)?this.reset():((o=R(this,It))==null?void 0:o.state.status)==="pending"&&R(this,It).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=R(this,It))==null||r.removeObserver(this)}onMutationUpdate(r){Te(this,ya,Mc).call(this),Te(this,ya,Kd).call(this,r)}getCurrentResult(){return R(this,Za)}reset(){var r;(r=R(this,It))==null||r.removeObserver(this),le(this,It,void 0),Te(this,ya,Mc).call(this),Te(this,ya,Kd).call(this)}mutate(r,c){var o;return le(this,ma,c),(o=R(this,It))==null||o.removeObserver(this),le(this,It,R(this,ha).getMutationCache().build(R(this,ha),this.options)),R(this,It).addObserver(this),R(this,It).execute(r)}},ha=new WeakMap,Za=new WeakMap,It=new WeakMap,ma=new WeakMap,ya=new WeakSet,Mc=function(){var c;const r=((c=R(this,It))==null?void 0:c.state)??$g();le(this,Za,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Kd=function(r){ft.batch(()=>{var c,o,f,h,m,p,g,x;if(R(this,ma)&&this.hasListeners()){const v=R(this,Za).variables,N=R(this,Za).context,b={client:R(this,ha),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(o=(c=R(this,ma)).onSuccess)==null||o.call(c,r.data,v,N,b)}catch(C){Promise.reject(C)}try{(h=(f=R(this,ma)).onSettled)==null||h.call(f,r.data,null,v,N,b)}catch(C){Promise.reject(C)}}else if((r==null?void 0:r.type)==="error"){try{(p=(m=R(this,ma)).onError)==null||p.call(m,r.error,v,N,b)}catch(C){Promise.reject(C)}try{(x=(g=R(this,ma)).onSettled)==null||x.call(g,void 0,r.error,v,N,b)}catch(C){Promise.reject(C)}}}this.listeners.forEach(v=>{v(R(this,Za))})})},Ag),Hn,wg,Wb=(wg=class extends $s{constructor(s={}){super();fe(this,Hn);this.config=s,le(this,Hn,new Map)}build(s,r,c){const o=r.queryKey,f=r.queryHash??af(o,r);let h=this.get(f);return h||(h=new Yb({client:s,queryKey:o,queryHash:f,options:s.defaultQueryOptions(r),state:c,defaultOptions:s.getQueryDefaults(o)}),this.add(h)),h}add(s){R(this,Hn).has(s.queryHash)||(R(this,Hn).set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const r=R(this,Hn).get(s.queryHash);r&&(s.destroy(),r===s&&R(this,Hn).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){ft.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return R(this,Hn).get(s)}getAll(){return[...R(this,Hn).values()]}find(s){const r={exact:!0,...s};return this.getAll().find(c=>_y(r,c))}findAll(s={}){const r=this.getAll();return Object.keys(s).length>0?r.filter(c=>_y(s,c)):r}notify(s){ft.batch(()=>{this.listeners.forEach(r=>{r(s)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},Hn=new WeakMap,wg),nt,Ja,Wa,Bs,Ls,el,Us,Qs,Og,e0=(Og=class{constructor(l={}){fe(this,nt);fe(this,Ja);fe(this,Wa);fe(this,Bs);fe(this,Ls);fe(this,el);fe(this,Us);fe(this,Qs);le(this,nt,l.queryCache||new Wb),le(this,Ja,l.mutationCache||new Zb),le(this,Wa,l.defaultOptions||{}),le(this,Bs,new Map),le(this,Ls,new Map),le(this,el,0)}mount(){Tc(this,el)._++,R(this,el)===1&&(le(this,Us,nf.subscribe(async l=>{l&&(await this.resumePausedMutations(),R(this,nt).onFocus())})),le(this,Qs,qc.subscribe(async l=>{l&&(await this.resumePausedMutations(),R(this,nt).onOnline())})))}unmount(){var l,s;Tc(this,el)._--,R(this,el)===0&&((l=R(this,Us))==null||l.call(this),le(this,Us,void 0),(s=R(this,Qs))==null||s.call(this),le(this,Qs,void 0))}isFetching(l){return R(this,nt).findAll({...l,fetchStatus:"fetching"}).length}isMutating(l){return R(this,Ja).findAll({...l,status:"pending"}).length}getQueryData(l){var r;const s=this.defaultQueryOptions({queryKey:l});return(r=R(this,nt).get(s.queryHash))==null?void 0:r.state.data}ensureQueryData(l){const s=this.defaultQueryOptions(l),r=R(this,nt).build(this,s),c=r.state.data;return c===void 0?this.fetchQuery(l):(l.revalidateIfStale&&r.isStaleByTime(nl(s.staleTime,r))&&this.prefetchQuery(s),Promise.resolve(c))}getQueriesData(l){return R(this,nt).findAll(l).map(({queryKey:s,state:r})=>{const c=r.data;return[s,c]})}setQueryData(l,s,r){const c=this.defaultQueryOptions({queryKey:l}),o=R(this,nt).get(c.queryHash),f=o==null?void 0:o.state.data,h=Db(s,f);if(h!==void 0)return R(this,nt).build(this,c).setData(h,{...r,manual:!0})}setQueriesData(l,s,r){return ft.batch(()=>R(this,nt).findAll(l).map(({queryKey:c})=>[c,this.setQueryData(c,s,r)]))}getQueryState(l){var r;const s=this.defaultQueryOptions({queryKey:l});return(r=R(this,nt).get(s.queryHash))==null?void 0:r.state}removeQueries(l){const s=R(this,nt);ft.batch(()=>{s.findAll(l).forEach(r=>{s.remove(r)})})}resetQueries(l,s){const r=R(this,nt);return ft.batch(()=>(r.findAll(l).forEach(c=>{c.reset()}),this.refetchQueries({type:"active",...l},s)))}cancelQueries(l,s={}){const r={revert:!0,...s},c=ft.batch(()=>R(this,nt).findAll(l).map(o=>o.cancel(r)));return Promise.all(c).then(Dt).catch(Dt)}invalidateQueries(l,s={}){return ft.batch(()=>(R(this,nt).findAll(l).forEach(r=>{r.invalidate()}),(l==null?void 0:l.refetchType)==="none"?Promise.resolve():this.refetchQueries({...l,type:(l==null?void 0:l.refetchType)??(l==null?void 0:l.type)??"active"},s)))}refetchQueries(l,s={}){const r={...s,cancelRefetch:s.cancelRefetch??!0},c=ft.batch(()=>R(this,nt).findAll(l).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let f=o.fetch(void 0,r);return r.throwOnError||(f=f.catch(Dt)),o.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(c).then(Dt)}fetchQuery(l){const s=this.defaultQueryOptions(l);s.retry===void 0&&(s.retry=!1);const r=R(this,nt).build(this,s);return r.isStaleByTime(nl(s.staleTime,r))?r.fetch(s):Promise.resolve(r.state.data)}prefetchQuery(l){return this.fetchQuery(l).then(Dt).catch(Dt)}fetchInfiniteQuery(l){return l._type="infinite",this.fetchQuery(l)}prefetchInfiniteQuery(l){return this.fetchInfiniteQuery(l).then(Dt).catch(Dt)}ensureInfiniteQueryData(l){return l._type="infinite",this.ensureQueryData(l)}resumePausedMutations(){return qc.isOnline()?R(this,Ja).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,nt)}getMutationCache(){return R(this,Ja)}getDefaultOptions(){return R(this,Wa)}setDefaultOptions(l){le(this,Wa,l)}setQueryDefaults(l,s){R(this,Bs).set(kl(l),{queryKey:l,defaultOptions:s})}getQueryDefaults(l){const s=[...R(this,Bs).values()],r={};return s.forEach(c=>{Fi(l,c.queryKey)&&Object.assign(r,c.defaultOptions)}),r}setMutationDefaults(l,s){R(this,Ls).set(kl(l),{mutationKey:l,defaultOptions:s})}getMutationDefaults(l){const s=[...R(this,Ls).values()],r={};return s.forEach(c=>{Fi(l,c.mutationKey)&&Object.assign(r,c.defaultOptions)}),r}defaultQueryOptions(l){if(l._defaulted)return l;const s={...R(this,Wa).queries,...this.getQueryDefaults(l.queryKey),...l,_defaulted:!0};return s.queryHash||(s.queryHash=af(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===lf&&(s.enabled=!1),s}defaultMutationOptions(l){return l!=null&&l._defaulted?l:{...R(this,Wa).mutations,...(l==null?void 0:l.mutationKey)&&this.getMutationDefaults(l.mutationKey),...l,_defaulted:!0}}clear(){R(this,nt).clear(),R(this,Ja).clear()}},nt=new WeakMap,Ja=new WeakMap,Wa=new WeakMap,Bs=new WeakMap,Ls=new WeakMap,el=new WeakMap,Us=new WeakMap,Qs=new WeakMap,Og),Gg=S.createContext(void 0),zn=l=>{const s=S.useContext(Gg);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},t0=({client:l,children:s})=>(S.useEffect(()=>(l.mount(),()=>{l.unmount()}),[l]),a.jsx(Gg.Provider,{value:l,children:s})),Kg=S.createContext(!1),n0=()=>S.useContext(Kg);Kg.Provider;function a0(){let l=!1;return{clearReset:()=>{l=!1},reset:()=>{l=!0},isReset:()=>l}}var l0=S.createContext(a0()),s0=()=>S.useContext(l0),i0=(l,s,r)=>{const c=r!=null&&r.state.error&&typeof l.throwOnError=="function"?sf(l.throwOnError,[r.state.error,r]):l.throwOnError;(l.suspense||l.experimental_prefetchInRender||c)&&(s.isReset()||(l.retryOnMount=!1))},r0=l=>{S.useEffect(()=>{l.clearReset()},[l])},c0=({result:l,errorResetBoundary:s,throwOnError:r,query:c,suspense:o})=>l.isError&&!s.isReset()&&!l.isFetching&&c&&(o&&l.data===void 0||sf(r,[l.error,c])),u0=l=>{if(l.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),c=l.staleTime;l.staleTime=typeof c=="function"?(...o)=>r(c(...o)):r(c),typeof l.gcTime=="number"&&(l.gcTime=Math.max(l.gcTime,1e3))}},o0=(l,s)=>l.isLoading&&l.isFetching&&!s,d0=(l,s)=>(l==null?void 0:l.suspense)&&s.isPending,Ky=(l,s,r)=>s.fetchOptimistic(l).catch(()=>{r.clearReset()});function Ig(l,s,r){var b,C,A,z;const c=n0(),o=s0(),f=zn(),h=f.defaultQueryOptions(l);(C=(b=f.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||C.call(b,h);const m=f.getQueryCache().get(h.queryHash),p=l.subscribed!==!1;h._optimisticResults=c?"isRestoring":p?"optimistic":void 0,u0(h),i0(h,o,m),r0(o);const g=!f.getQueryCache().get(h.queryHash),[x]=S.useState(()=>new s(f,h)),v=x.getOptimisticResult(h),N=!c&&p;if(S.useSyncExternalStore(S.useCallback(D=>{const F=N?x.subscribe(ft.batchCalls(D)):Dt;return x.updateResult(),F},[x,N]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),S.useEffect(()=>{x.setOptions(h)},[h,x]),d0(h,v))throw Ky(h,x,o);if(c0({result:v,errorResetBoundary:o,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw v.error;if((z=(A=f.getDefaultOptions().queries)==null?void 0:A._experimental_afterQuery)==null||z.call(A,h,v),h.experimental_prefetchInRender&&!Pi.isServer()&&o0(v,c)){const D=g?Ky(h,x,o):m==null?void 0:m.promise;D==null||D.catch(Dt).finally(()=>{x.updateResult()})}return h.notifyOnChangeProps?v:x.trackResult(v)}function ve(l,s){return Ig(l,Qg)}function st(l,s){const r=zn(),[c]=S.useState(()=>new Jb(r,l));S.useEffect(()=>{c.setOptions(l)},[c,l]);const o=S.useSyncExternalStore(S.useCallback(h=>c.subscribe(ft.batchCalls(h)),[c]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),f=S.useCallback((h,m)=>{c.mutate(h,m).catch(Dt)},[c]);if(o.error&&sf(c.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:f,mutateAsync:o.mutate}}function Yg(l,s){return Ig(l,Pb)}const f0="exellix-memorix-agents.selected-agent",Xg=S.createContext({agentId:"",setAgentId:()=>{},agentQueryParam:void 0});function h0({children:l,storageKey:s=f0}){const[r,c]=S.useState(()=>localStorage.getItem(s)??""),o=h=>{c(h),h?localStorage.setItem(s,h):localStorage.removeItem(s)},f=S.useMemo(()=>({agentId:r,setAgentId:o,agentQueryParam:r||void 0}),[r]);return a.jsx(Xg.Provider,{value:f,children:l})}function Cn(){return S.useContext(Xg)}const m0="/api/memorix-agents";async function ia(l,s,r){const c=`${l.replace(/\/$/,"")}${s}`,o=await fetch(c,r);if(!o.ok){const f=await o.json().catch(()=>({}));throw new Error(String(f.error??`${o.status} ${o.statusText}`))}return o.json()}function p0(l){return{listAgents:()=>ia(l,""),getAgent:s=>ia(l,`/${encodeURIComponent(s)}`),createAgent:s=>ia(l,"",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),updateAgent:(s,r)=>ia(l,`/${encodeURIComponent(s)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),deleteAgent:s=>ia(l,`/${encodeURIComponent(s)}`,{method:"DELETE"}),listObjectTypeScopes:()=>ia(l,"/object-types"),bindObjectTypeToAgent:(s,r)=>ia(l,`/${encodeURIComponent(s)}/bind/${encodeURIComponent(r)}`,{method:"POST"}),unbindObjectTypeFromAgent:(s,r)=>ia(l,`/${encodeURIComponent(s)}/bind/${encodeURIComponent(r)}`,{method:"DELETE"}),setObjectTypeScopeAgents:(s,r)=>ia(l,`/object-types/${encodeURIComponent(s)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:r})})}}const Iy=new Map;function Fg(l=m0){const s=l.replace(/\/$/,""),r=Iy.get(s);if(r)return r;const c=p0(s);return Iy.set(s,c),c}Fg();function y0({client:l,apiBase:s,className:r}){const c=S.useMemo(()=>l??Fg(s),[l,s]),{agentId:o,setAgentId:f}=Cn(),[h,m]=S.useState([]),[p,g]=S.useState(!0),x=S.useCallback(async()=>{g(!0);try{m(await c.listAgents())}catch{m([])}finally{g(!1)}},[c]);S.useEffect(()=>{x()},[x]);const v=h.find(b=>b.id===o),N=o&&(h.length===0||v)?o:"";return a.jsxs("div",{className:`memorix-agents-scope${o?" scoped":""}${r?` ${r}`:""}`,title:"Filter views to one agent, or leave unscoped for all agents",children:[a.jsx("span",{className:"memorix-agents-scope-label",children:"Agent"}),a.jsxs("div",{className:"memorix-agents-scope-control",children:[a.jsxs("select",{className:`memorix-agents-scope-select${o?" scoped":""}`,value:N,onChange:b=>f(b.target.value),"aria-label":"Agent context filter",children:[a.jsx("option",{value:"",children:p?"Loading…":"Any agent"}),h.map(b=>a.jsx("option",{value:b.id,children:b.name===b.id?b.id:`${b.name} (${b.id})`},b.id)),o&&!v&&!p&&a.jsx("option",{value:o,children:o})]}),a.jsx("span",{className:"memorix-agents-scope-chevron","aria-hidden":"true",children:"▾"})]}),o&&a.jsx("button",{type:"button",className:"memorix-agents-scope-clear",onClick:()=>f(""),"aria-label":"Show all agents (clear scope)",title:"Any agent",children:"×"})]})}/**
50
+ * react-router v7.18.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 cf=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pg=/^[\\/]{2}/;function g0(l,s){return s+l.replace(/\\/g,"/")}var Yy="popstate";function Xy(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function v0(l={}){function s(c,o){var g;let f=(g=o.state)==null?void 0:g.masked,{pathname:h,search:m,hash:p}=f||c.location;return Id("",{pathname:h,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",f?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function r(c,o){return typeof o=="string"?o:Vi(o)}return j0(s,r,null,l)}function Je(l,s){if(l===!1||l===null||typeof l>"u")throw new Error(s)}function Nn(l,s){if(!l){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function x0(){return Math.random().toString(36).substring(2,10)}function Fy(l,s){return{usr:l.state,key:l.key,idx:s,masked:l.mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function Id(l,s,r=null,c,o){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof s=="string"?Gs(s):s,state:r,key:s&&s.key||c||x0(),mask:o}}function Vi({pathname:l="/",search:s="",hash:r=""}){return s&&s!=="?"&&(l+=s.charAt(0)==="?"?s:"?"+s),r&&r!=="#"&&(l+=r.charAt(0)==="#"?r:"#"+r),l}function Gs(l){let s={};if(l){let r=l.indexOf("#");r>=0&&(s.hash=l.substring(r),l=l.substring(0,r));let c=l.indexOf("?");c>=0&&(s.search=l.substring(c),l=l.substring(0,c)),l&&(s.pathname=l)}return s}function j0(l,s,r,c={}){let{window:o=document.defaultView,v5Compat:f=!1}=c,h=o.history,m="POP",p=null,g=x();g==null&&(g=0,h.replaceState({...h.state,idx:g},""));function x(){return(h.state||{idx:null}).idx}function v(){m="POP";let z=x(),D=z==null?null:z-g;g=z,p&&p({action:m,location:A.location,delta:D})}function N(z,D){m="PUSH";let F=Xy(z)?z:Id(A.location,z,D);g=x()+1;let $=Fy(F,g),U=A.createHref(F.mask||F);try{h.pushState($,"",U)}catch(Z){if(Z instanceof DOMException&&Z.name==="DataCloneError")throw Z;o.location.assign(U)}f&&p&&p({action:m,location:A.location,delta:1})}function b(z,D){m="REPLACE";let F=Xy(z)?z:Id(A.location,z,D);g=x();let $=Fy(F,g),U=A.createHref(F.mask||F);h.replaceState($,"",U),f&&p&&p({action:m,location:A.location,delta:0})}function C(z){return b0(o,z)}let A={get action(){return m},get location(){return l(o,h)},listen(z){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Yy,v),p=z,()=>{o.removeEventListener(Yy,v),p=null}},createHref(z){return s(o,z)},createURL:C,encodeLocation(z){let D=C(z);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:N,replace:b,go(z){return h.go(z)}};return A}function b0(l,s,r=!1){let c="http://localhost";l&&(c=l.location.origin!=="null"?l.location.origin:l.location.href),Je(c,"No window.location.(origin|href) available to create URL");let o=typeof s=="string"?s:Vi(s);return o=o.replace(/ $/,"%20"),!r&&Pg.test(o)&&(o=c+o),new URL(o,c)}function Vg(l,s,r="/"){return S0(l,s,r,!1)}function S0(l,s,r,c,o){let f=typeof s=="string"?Gs(s):s,h=ga(f.pathname||"/",r);if(h==null)return null;let m=N0(l),p=null,g=k0(h);for(let x=0;p==null&&x<m.length;++x)p=D0(m[x],g,c);return p}function N0(l){let s=Zg(l);return C0(s),s}function Zg(l,s=[],r=[],c="",o=!1){let f=(h,m,p=o,g)=>{let x={relativePath:g===void 0?h.path||"":g,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(c)&&p)return;Je(x.relativePath.startsWith(c),`Absolute route path "${x.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(c.length)}let v=Mn([c,x.relativePath]),N=r.concat(x);h.children&&h.children.length>0&&(Je(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Zg(h.children,s,N,v,p)),!(h.path==null&&!h.index)&&s.push({path:v,score:M0(v,h.index),routesMeta:N.map((b,C)=>{let[A,z]=ev(b.relativePath,b.caseSensitive,C===N.length-1);return{...b,matcher:A,compiledParams:z}})})};return l.forEach((h,m)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))f(h,m);else for(let g of Jg(h.path))f(h,m,!0,g)}),s}function Jg(l){let s=l.split("/");if(s.length===0)return[];let[r,...c]=s,o=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return o?[f,""]:[f];let h=Jg(c.join("/")),m=[];return m.push(...h.map(p=>p===""?f:[f,p].join("/"))),o&&m.push(...h),m.map(p=>l.startsWith("/")&&p===""?"/":p)}function C0(l){l.sort((s,r)=>s.score!==r.score?r.score-s.score:z0(s.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var E0=/^:[\w-]+$/,T0=3,R0=2,A0=1,w0=10,O0=-2,Py=l=>l==="*";function M0(l,s){let r=l.split("/"),c=r.length;return r.some(Py)&&(c+=O0),s&&(c+=R0),r.filter(o=>!Py(o)).reduce((o,f)=>o+(E0.test(f)?T0:f===""?A0:w0),c)}function z0(l,s){return l.length===s.length&&l.slice(0,-1).every((c,o)=>c===s[o])?l[l.length-1]-s[s.length-1]:0}function D0(l,s,r=!1){let{routesMeta:c}=l,o={},f="/",h=[];for(let m=0;m<c.length;++m){let p=c[m],g=m===c.length-1,x=f==="/"?s:s.slice(f.length)||"/",v={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},N=p.matcher&&p.compiledParams?Wg(v,x,p.matcher,p.compiledParams):_c(v,x),b=p.route;if(!N&&g&&r&&!c[c.length-1].route.index&&(N=_c({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!N)return null;Object.assign(o,N.params),h.push({params:o,pathname:Mn([f,N.pathname]),pathnameBase:B0(Mn([f,N.pathnameBase])),route:b}),N.pathnameBase!=="/"&&(f=Mn([f,N.pathnameBase]))}return h}function _c(l,s){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[r,c]=ev(l.path,l.caseSensitive,l.end);return Wg(l,s,r,c)}function Wg(l,s,r,c){let o=s.match(r);if(!o)return null;let f=o[0],h=f.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:c.reduce((g,{paramName:x,isOptional:v},N)=>{if(x==="*"){let C=m[N]||"";h=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const b=m[N];return v&&!b?g[x]=void 0:g[x]=(b||"").replace(/%2F/g,"/"),g},{}),pathname:f,pathnameBase:h,pattern:l}}function ev(l,s=!1,r=!0){Nn(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let c=[],o="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p,g,x)=>{if(c.push({paramName:m,isOptional:p!=null}),p){let v=x.charAt(g+h.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(c.push({paramName:"*"}),o+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":l!==""&&l!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,s?void 0:"i"),c]}function k0(l){try{return l.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Nn(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),l}}function ga(l,s){if(s==="/")return l;if(!l.toLowerCase().startsWith(s.toLowerCase()))return null;let r=s.endsWith("/")?s.length-1:s.length,c=l.charAt(r);return c&&c!=="/"?null:l.slice(r)||"/"}function q0(l,s="/"){let{pathname:r,search:c="",hash:o=""}=typeof l=="string"?Gs(l):l,f;return r?(r=tv(r),r.startsWith("/")?f=Vy(r.substring(1),"/"):f=Vy(r,s)):f=s,{pathname:f,search:L0(c),hash:U0(o)}}function Vy(l,s){let r=Bc(s).split("/");return l.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function vd(l,s,r,c){return`Cannot include a '${l}' character in a manually specified \`to.${s}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _0(l){return l.filter((s,r)=>r===0||s.route.path&&s.route.path.length>0)}function uf(l){let s=_0(l);return s.map((r,c)=>c===s.length-1?r.pathname:r.pathnameBase)}function $c(l,s,r,c=!1){let o;typeof l=="string"?o=Gs(l):(o={...l},Je(!o.pathname||!o.pathname.includes("?"),vd("?","pathname","search",o)),Je(!o.pathname||!o.pathname.includes("#"),vd("#","pathname","hash",o)),Je(!o.search||!o.search.includes("#"),vd("#","search","hash",o)));let f=l===""||o.pathname==="",h=f?"/":o.pathname,m;if(h==null)m=r;else{let v=s.length-1;if(!c&&h.startsWith("..")){let N=h.split("/");for(;N[0]==="..";)N.shift(),v-=1;o.pathname=N.join("/")}m=v>=0?s[v]:"/"}let p=q0(o,m),g=h&&h!=="/"&&h.endsWith("/"),x=(f||h===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var tv=l=>l.replace(/[\\/]{2,}/g,"/"),Mn=l=>tv(l.join("/")),Bc=l=>l.replace(/\/+$/,""),B0=l=>Bc(l).replace(/^\/*/,"/"),L0=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,U0=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,Q0=class{constructor(l,s,r,c=!1){this.status=l,this.statusText=s||"",this.internal=c,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function H0(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function $0(l){let s=l.map(r=>r.route.path).filter(Boolean);return Mn(s)||"/"}var nv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function av(l,s){let r=l;if(typeof r!="string"||!cf.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let c=r,o=!1;if(nv)try{let f=new URL(window.location.href),h=Pg.test(r)?new URL(g0(r,f.protocol)):new URL(r),m=ga(h.pathname,s);h.origin===f.origin&&m!=null?r=m+h.search+h.hash:o=!0}catch{Nn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var lv=["POST","PUT","PATCH","DELETE"];new Set(lv);var G0=["GET",...lv];new Set(G0);var K0=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function I0(l){try{return K0.includes(new URL(l).protocol)}catch{return!1}}var Ks=S.createContext(null);Ks.displayName="DataRouter";var Gc=S.createContext(null);Gc.displayName="DataRouterState";var sv=S.createContext(!1);function Y0(){return S.useContext(sv)}var iv=S.createContext({isTransitioning:!1});iv.displayName="ViewTransition";var X0=S.createContext(new Map);X0.displayName="Fetchers";var F0=S.createContext(null);F0.displayName="Await";var ln=S.createContext(null);ln.displayName="Navigation";var lr=S.createContext(null);lr.displayName="Location";var Dn=S.createContext({outlet:null,matches:[],isDataRoute:!1});Dn.displayName="Route";var of=S.createContext(null);of.displayName="RouteError";var rv="REACT_ROUTER_ERROR",P0="REDIRECT",V0="ROUTE_ERROR_RESPONSE";function Z0(l){if(l.startsWith(`${rv}:${P0}:{`))try{let s=JSON.parse(l.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function J0(l){if(l.startsWith(`${rv}:${V0}:{`))try{let s=JSON.parse(l.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new Q0(s.status,s.statusText,s.data)}catch{}}function W0(l,{relative:s}={}){Je(Is(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=S.useContext(ln),{hash:o,pathname:f,search:h}=sr(l,{relative:s}),m=f;return r!=="/"&&(m=f==="/"?r:Mn([r,f])),c.createHref({pathname:m,search:h,hash:o})}function Is(){return S.useContext(lr)!=null}function sn(){return Je(Is(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(lr).location}var cv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uv(l){S.useContext(ln).static||S.useLayoutEffect(l)}function En(){let{isDataRoute:l}=S.useContext(Dn);return l?fS():eS()}function eS(){Je(Is(),"useNavigate() may be used only in the context of a <Router> component.");let l=S.useContext(Ks),{basename:s,navigator:r}=S.useContext(ln),{matches:c}=S.useContext(Dn),{pathname:o}=sn(),f=JSON.stringify(uf(c)),h=S.useRef(!1);return uv(()=>{h.current=!0}),S.useCallback((p,g={})=>{if(Nn(h.current,cv),!h.current)return;if(typeof p=="number"){r.go(p);return}let x=$c(p,JSON.parse(f),o,g.relative==="path");l==null&&s!=="/"&&(x.pathname=x.pathname==="/"?s:Mn([s,x.pathname])),(g.replace?r.replace:r.push)(x,g.state,g)},[s,r,f,o,l])}S.createContext(null);function Ys(){let{matches:l}=S.useContext(Dn),s=l[l.length-1];return(s==null?void 0:s.params)??{}}function sr(l,{relative:s}={}){let{matches:r}=S.useContext(Dn),{pathname:c}=sn(),o=JSON.stringify(uf(r));return S.useMemo(()=>$c(l,JSON.parse(o),c,s==="path"),[l,o,c,s])}function tS(l,s){return ov(l,s)}function ov(l,s,r){var z;Je(Is(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=S.useContext(ln),{matches:o}=S.useContext(Dn),f=o[o.length-1],h=f?f.params:{},m=f?f.pathname:"/",p=f?f.pathnameBase:"/",g=f&&f.route;{let D=g&&g.path||"";fv(m,!g||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${D}">) 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="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let x=sn(),v;if(s){let D=typeof s=="string"?Gs(s):s;Je(p==="/"||((z=D.pathname)==null?void 0:z.startsWith(p)),`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 "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),v=D}else v=x;let N=v.pathname||"/",b=N;if(p!=="/"){let D=p.replace(/^\//,"").split("/");b="/"+N.replace(/^\//,"").split("/").slice(D.length).join("/")}let C=r&&r.state.matches.length?r.state.matches.map(D=>Object.assign(D,{route:r.manifest[D.route.id]||D.route})):Vg(l,{pathname:b});Nn(g||C!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Nn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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 A=iS(C&&C.map(D=>Object.assign({},D,{params:Object.assign({},h,D.params),pathname:Mn([p,c.encodeLocation?c.encodeLocation(D.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:Mn([p,c.encodeLocation?c.encodeLocation(D.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),o,r);return s&&A?S.createElement(lr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...v},navigationType:"POP"}},A):A}function nS(){let l=dS(),s=H0(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),r=l instanceof Error?l.stack:null,c="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},h=null;return console.error("Error handled by React Router default ErrorBoundary:",l),h=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:f},"ErrorBoundary")," or"," ",S.createElement("code",{style:f},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},s),r?S.createElement("pre",{style:o},r):null,h)}var aS=S.createElement(nS,null),dv=class extends S.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,s){return s.location!==l.location||s.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:s.error,location:s.location,revalidation:l.revalidation||s.revalidation}}componentDidCatch(l,s){this.props.onError?this.props.onError(l,s):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const r=J0(l.digest);r&&(l=r)}let s=l!==void 0?S.createElement(Dn.Provider,{value:this.props.routeContext},S.createElement(of.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?S.createElement(lS,{error:l},s):s}};dv.contextType=sv;var xd=new WeakMap;function lS({children:l,error:s}){let{basename:r}=S.useContext(ln);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let c=Z0(s.digest);if(c){let o=xd.get(s);if(o)throw o;let f=av(c.location,r),h=f.absoluteURL||f.to;if(I0(h))throw new Error("Invalid redirect location");if(nv&&!xd.get(s))if(f.isExternal||c.reloadDocument)window.location.href=h;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:c.replace}));throw xd.set(s,m),m}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return l}function sS({routeContext:l,match:s,children:r}){let c=S.useContext(Ks);return c&&c.static&&c.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=s.route.id),S.createElement(Dn.Provider,{value:l},r)}function iS(l,s=[],r){let c=r==null?void 0:r.state;if(l==null){if(!c)return null;if(c.errors)l=c.matches;else if(s.length===0&&!c.initialized&&c.matches.length>0)l=c.matches;else return null}let o=l,f=c==null?void 0:c.errors;if(f!=null){let x=o.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);Je(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let h=!1,m=-1;if(r&&c){h=c.renderFallback;for(let x=0;x<o.length;x++){let v=o[x];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(m=x),v.route.id){let{loaderData:N,errors:b}=c,C=v.route.loader&&!N.hasOwnProperty(v.route.id)&&(!b||b[v.route.id]===void 0);if(v.route.lazy||C){r.isStatic&&(h=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=r==null?void 0:r.onError,g=c&&p?(x,v)=>{var N,b;p(x,{location:c.location,params:((b=(N=c.matches)==null?void 0:N[0])==null?void 0:b.params)??{},pattern:$0(c.matches),errorInfo:v})}:void 0;return o.reduceRight((x,v,N)=>{let b,C=!1,A=null,z=null;c&&(b=f&&v.route.id?f[v.route.id]:void 0,A=v.route.errorElement||aS,h&&(m<0&&N===0?(fv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,z=null):m===N&&(C=!0,z=v.route.hydrateFallbackElement||null)));let D=s.concat(o.slice(0,N+1)),F=()=>{let $;return b?$=A:C?$=z:v.route.Component?$=S.createElement(v.route.Component,null):v.route.element?$=v.route.element:$=x,S.createElement(sS,{match:v,routeContext:{outlet:x,matches:D,isDataRoute:c!=null},children:$})};return c&&(v.route.ErrorBoundary||v.route.errorElement||N===0)?S.createElement(dv,{location:c.location,revalidation:c.revalidation,component:A,error:b,children:F(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:g}):F()},null)}function df(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rS(l){let s=S.useContext(Ks);return Je(s,df(l)),s}function cS(l){let s=S.useContext(Gc);return Je(s,df(l)),s}function uS(l){let s=S.useContext(Dn);return Je(s,df(l)),s}function ff(l){let s=uS(l),r=s.matches[s.matches.length-1];return Je(r.route.id,`${l} can only be used on routes that contain a unique "id"`),r.route.id}function oS(){return ff("useRouteId")}function dS(){var c;let l=S.useContext(of),s=cS("useRouteError"),r=ff("useRouteError");return l!==void 0?l:(c=s.errors)==null?void 0:c[r]}function fS(){let{router:l}=rS("useNavigate"),s=ff("useNavigate"),r=S.useRef(!1);return uv(()=>{r.current=!0}),S.useCallback(async(o,f={})=>{Nn(r.current,cv),r.current&&(typeof o=="number"?await l.navigate(o):await l.navigate(o,{fromRouteId:s,...f}))},[l,s])}var Zy={};function fv(l,s,r){!s&&!Zy[l]&&(Zy[l]=!0,Nn(!1,r))}S.memo(hS);function hS({routes:l,manifest:s,future:r,state:c,isStatic:o,onError:f}){return ov(l,void 0,{manifest:s,state:c,isStatic:o,onError:f})}function ra({to:l,replace:s,state:r,relative:c}){Je(Is(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=S.useContext(ln);Nn(!o,"<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}=S.useContext(Dn),{pathname:h}=sn(),m=En(),p=$c(l,uf(f),h,c==="path"),g=JSON.stringify(p);return S.useEffect(()=>{m(JSON.parse(g),{replace:s,state:r,relative:c})},[m,g,c,s,r]),null}function $e(l){Je(!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 mS({basename:l="/",children:s=null,location:r,navigationType:c="POP",navigator:o,static:f=!1,useTransitions:h}){Je(!Is(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=l.replace(/^\/*/,"/"),p=S.useMemo(()=>({basename:m,navigator:o,static:f,useTransitions:h,future:{}}),[m,o,f,h]);typeof r=="string"&&(r=Gs(r));let{pathname:g="/",search:x="",hash:v="",state:N=null,key:b="default",mask:C}=r,A=S.useMemo(()=>{let z=ga(g,m);return z==null?null:{location:{pathname:z,search:x,hash:v,state:N,key:b,mask:C},navigationType:c}},[m,g,x,v,N,b,c,C]);return Nn(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${v}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:S.createElement(ln.Provider,{value:p},S.createElement(lr.Provider,{children:s,value:A}))}function pS({children:l,location:s}){return tS(Yd(l),s)}function Yd(l,s=[]){let r=[];return S.Children.forEach(l,(c,o)=>{if(!S.isValidElement(c))return;let f=[...s,o];if(c.type===S.Fragment){r.push.apply(r,Yd(c.props.children,f));return}Je(c.type===$e,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Je(!c.props.index||!c.props.children,"An index route cannot have child routes.");let h={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(h.children=Yd(c.props.children,f)),r.push(h)}),r}var zc="get",Dc="application/x-www-form-urlencoded";function Kc(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function yS(l){return Kc(l)&&l.tagName.toLowerCase()==="button"}function gS(l){return Kc(l)&&l.tagName.toLowerCase()==="form"}function vS(l){return Kc(l)&&l.tagName.toLowerCase()==="input"}function xS(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function jS(l,s){return l.button===0&&(!s||s==="_self")&&!xS(l)}function Xd(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((s,r)=>{let c=l[r];return s.concat(Array.isArray(c)?c.map(o=>[r,o]):[[r,c]])},[]))}function bS(l,s){let r=Xd(l);return s&&s.forEach((c,o)=>{r.has(o)||s.getAll(o).forEach(f=>{r.append(o,f)})}),r}var Ac=null;function SS(){if(Ac===null)try{new FormData(document.createElement("form"),0),Ac=!1}catch{Ac=!0}return Ac}var NS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function jd(l){return l!=null&&!NS.has(l)?(Nn(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dc}"`),null):l}function CS(l,s){let r,c,o,f,h;if(gS(l)){let m=l.getAttribute("action");c=m?ga(m,s):null,r=l.getAttribute("method")||zc,o=jd(l.getAttribute("enctype"))||Dc,f=new FormData(l)}else if(yS(l)||vS(l)&&(l.type==="submit"||l.type==="image")){let m=l.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=l.getAttribute("formaction")||m.getAttribute("action");if(c=p?ga(p,s):null,r=l.getAttribute("formmethod")||m.getAttribute("method")||zc,o=jd(l.getAttribute("formenctype"))||jd(m.getAttribute("enctype"))||Dc,f=new FormData(m,l),!SS()){let{name:g,type:x,value:v}=l;if(x==="image"){let N=g?`${g}.`:"";f.append(`${N}x`,"0"),f.append(`${N}y`,"0")}else g&&f.append(g,v)}}else{if(Kc(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=zc,c=null,o=Dc,h=l}return f&&o==="text/plain"&&(h=f,f=void 0),{action:c,method:r.toLowerCase(),encType:o,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function hf(l,s){if(l===!1||l===null||typeof l>"u")throw new Error(s)}function hv(l,s,r,c){let o=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${c}`:o.pathname=`${o.pathname}.${c}`:o.pathname==="/"?o.pathname=`_root.${c}`:s&&ga(o.pathname,s)==="/"?o.pathname=`${Bc(s)}/_root.${c}`:o.pathname=`${Bc(o.pathname)}.${c}`,o}async function ES(l,s){if(l.id in s)return s[l.id];try{let r=await import(l.module);return s[l.id]=r,r}catch(r){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function TS(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function RS(l,s,r){let c=await Promise.all(l.map(async o=>{let f=s.routes[o.route.id];if(f){let h=await ES(f,r);return h.links?h.links():[]}return[]}));return MS(c.flat(1).filter(TS).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Jy(l,s,r,c,o,f){let h=(p,g)=>r[g]?p.route.id!==r[g].route.id:!0,m=(p,g)=>{var x;return r[g].pathname!==p.pathname||((x=r[g].route.path)==null?void 0:x.endsWith("*"))&&r[g].params["*"]!==p.params["*"]};return f==="assets"?s.filter((p,g)=>h(p,g)||m(p,g)):f==="data"?s.filter((p,g)=>{var v;let x=c.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(h(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let N=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(l,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function AS(l,s,{includeHydrateFallback:r}={}){return wS(l.map(c=>{let o=s.routes[c.route.id];if(!o)return[];let f=[o.module];return o.clientActionModule&&(f=f.concat(o.clientActionModule)),o.clientLoaderModule&&(f=f.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(f=f.concat(o.hydrateFallbackModule)),o.imports&&(f=f.concat(o.imports)),f}).flat(1))}function wS(l){return[...new Set(l)]}function OS(l){let s={},r=Object.keys(l).sort();for(let c of r)s[c]=l[c];return s}function MS(l,s){let r=new Set;return new Set(s),l.reduce((c,o)=>{let f=JSON.stringify(OS(o));return r.has(f)||(r.add(f),c.push({key:f,link:o})),c},[])}function mf(){let l=S.useContext(Ks);return hf(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function zS(){let l=S.useContext(Gc);return hf(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var pf=S.createContext(void 0);pf.displayName="FrameworkContext";function Ic(){let l=S.useContext(pf);return hf(l,"You must render this element inside a <HydratedRouter> element"),l}function DS(l,s){let r=S.useContext(pf),[c,o]=S.useState(!1),[f,h]=S.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:v}=s,N=S.useRef(null);S.useEffect(()=>{if(l==="render"&&h(!0),l==="viewport"){let A=D=>{D.forEach(F=>{h(F.isIntersecting)})},z=new IntersectionObserver(A,{threshold:.5});return N.current&&z.observe(N.current),()=>{z.disconnect()}}},[l]),S.useEffect(()=>{if(c){let A=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(A)}}},[c]);let b=()=>{o(!0)},C=()=>{o(!1),h(!1)};return r?l!=="intent"?[f,N,{}]:[f,N,{onFocus:Gi(m,b),onBlur:Gi(p,C),onMouseEnter:Gi(g,b),onMouseLeave:Gi(x,C),onTouchStart:Gi(v,b)}]:[!1,N,{}]}function Gi(l,s){return r=>{l&&l(r),r.defaultPrevented||s(r)}}function kS({page:l,...s}){let r=Y0(),{nonce:c}=Ic(),{router:o}=mf(),f=S.useMemo(()=>Vg(o.routes,l,o.basename),[o.routes,l,o.basename]);return f?(s.nonce==null&&c&&(s={...s,nonce:c}),r?S.createElement(_S,{page:l,matches:f,...s}):S.createElement(BS,{page:l,matches:f,...s})):null}function qS(l){let{manifest:s,routeModules:r}=Ic(),[c,o]=S.useState([]);return S.useEffect(()=>{let f=!1;return RS(l,s,r).then(h=>{f||o(h)}),()=>{f=!0}},[l,s,r]),c}function _S({page:l,matches:s,...r}){let c=sn(),{future:o}=Ic(),{basename:f}=mf(),h=S.useMemo(()=>{if(l===c.pathname+c.search+c.hash)return[];let m=hv(l,f,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let x of s)typeof x.route.shouldRevalidate=="function"?p=!0:g.push(x.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[f,o.v8_trailingSlashAwareDataRequests,l,c,s]);return S.createElement(S.Fragment,null,h.map(m=>S.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})))}function BS({page:l,matches:s,...r}){let c=sn(),{future:o,manifest:f,routeModules:h}=Ic(),{basename:m}=mf(),{loaderData:p,matches:g}=zS(),x=S.useMemo(()=>Jy(l,s,g,f,c,"data"),[l,s,g,f,c]),v=S.useMemo(()=>Jy(l,s,g,f,c,"assets"),[l,s,g,f,c]),N=S.useMemo(()=>{if(l===c.pathname+c.search+c.hash)return[];let A=new Set,z=!1;if(s.forEach(F=>{var U;let $=f.routes[F.route.id];!$||!$.hasLoader||(!x.some(Z=>Z.route.id===F.route.id)&&F.route.id in p&&((U=h[F.route.id])!=null&&U.shouldRevalidate)||$.hasClientLoader?z=!0:A.add(F.route.id))}),A.size===0)return[];let D=hv(l,m,o.v8_trailingSlashAwareDataRequests,"data");return z&&A.size>0&&D.searchParams.set("_routes",s.filter(F=>A.has(F.route.id)).map(F=>F.route.id).join(",")),[D.pathname+D.search]},[m,o.v8_trailingSlashAwareDataRequests,p,c,f,x,s,l,h]),b=S.useMemo(()=>AS(v,f),[v,f]),C=qS(v);return S.createElement(S.Fragment,null,N.map(A=>S.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...r})),b.map(A=>S.createElement("link",{key:A,rel:"modulepreload",href:A,...r})),C.map(({key:A,link:z})=>S.createElement("link",{key:A,nonce:r.nonce,...z,crossOrigin:z.crossOrigin??r.crossOrigin})))}function LS(...l){return s=>{l.forEach(r=>{typeof r=="function"?r(s):r!=null&&(r.current=s)})}}var US=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{US&&(window.__reactRouterVersion="7.18.0")}catch{}function QS({basename:l,children:s,useTransitions:r,window:c}){let o=S.useRef();o.current==null&&(o.current=v0({window:c,v5Compat:!0}));let f=o.current,[h,m]=S.useState({action:f.action,location:f.location}),p=S.useCallback(g=>{r===!1?m(g):S.startTransition(()=>m(g))},[r]);return S.useLayoutEffect(()=>f.listen(p),[f,p]),S.createElement(mS,{basename:l,children:s,location:h.location,navigationType:h.action,navigator:f,useTransitions:r})}var me=S.forwardRef(function({onClick:s,discover:r="render",prefetch:c="none",relative:o,reloadDocument:f,replace:h,mask:m,state:p,target:g,to:x,preventScrollReset:v,viewTransition:N,defaultShouldRevalidate:b,...C},A){let{basename:z,navigator:D,useTransitions:F}=S.useContext(ln),$=typeof x=="string"&&cf.test(x),U=av(x,z);x=U.to;let Z=W0(x,{relative:o}),W=sn(),V=null;if(m){let ue=$c(m,[],W.mask?W.mask.pathname:"/",!0);z!=="/"&&(ue.pathname=ue.pathname==="/"?z:Mn([z,ue.pathname])),V=D.createHref(ue)}let[G,te,xe]=DS(c,C),pe=GS(x,{replace:h,mask:m,state:p,target:g,preventScrollReset:v,relative:o,viewTransition:N,defaultShouldRevalidate:b,useTransitions:F});function se(ue){s&&s(ue),ue.defaultPrevented||pe(ue)}let ce=!(U.isExternal||f),Se=S.createElement("a",{...C,...xe,href:(ce?V:void 0)||U.absoluteURL||Z,onClick:ce?se:s,ref:LS(A,te),target:g,"data-discover":!$&&r==="render"?"true":void 0});return G&&!$?S.createElement(S.Fragment,null,Se,S.createElement(kS,{page:Z})):Se});me.displayName="Link";var oa=S.forwardRef(function({"aria-current":s="page",caseSensitive:r=!1,className:c="",end:o=!1,style:f,to:h,viewTransition:m,children:p,...g},x){let v=sr(h,{relative:g.relative}),N=sn(),b=S.useContext(Gc),{navigator:C,basename:A}=S.useContext(ln),z=b!=null&&FS(v)&&m===!0,D=C.encodeLocation?C.encodeLocation(v).pathname:v.pathname,F=N.pathname,$=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(F=F.toLowerCase(),$=$?$.toLowerCase():null,D=D.toLowerCase()),$&&A&&($=ga($,A)||$);const U=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let Z=F===D||!o&&F.startsWith(D)&&F.charAt(U)==="/",W=$!=null&&($===D||!o&&$.startsWith(D)&&$.charAt(D.length)==="/"),V={isActive:Z,isPending:W,isTransitioning:z},G=Z?s:void 0,te;typeof c=="function"?te=c(V):te=[c,Z?"active":null,W?"pending":null,z?"transitioning":null].filter(Boolean).join(" ");let xe=typeof f=="function"?f(V):f;return S.createElement(me,{...g,"aria-current":G,className:te,ref:x,style:xe,to:h,viewTransition:m},typeof p=="function"?p(V):p)});oa.displayName="NavLink";var HS=S.forwardRef(({discover:l="render",fetcherKey:s,navigate:r,reloadDocument:c,replace:o,state:f,method:h=zc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:v,defaultShouldRevalidate:N,...b},C)=>{let{useTransitions:A}=S.useContext(ln),z=YS(),D=XS(m,{relative:g}),F=h.toLowerCase()==="get"?"get":"post",$=typeof m=="string"&&cf.test(m),U=Z=>{if(p&&p(Z),Z.defaultPrevented)return;Z.preventDefault();let W=Z.nativeEvent.submitter,V=(W==null?void 0:W.getAttribute("formmethod"))||h,G=()=>z(W||Z.currentTarget,{fetcherKey:s,method:V,navigate:r,replace:o,state:f,relative:g,preventScrollReset:x,viewTransition:v,defaultShouldRevalidate:N});A&&r!==!1?S.startTransition(()=>G()):G()};return S.createElement("form",{ref:C,method:F,action:D,onSubmit:c?p:U,...b,"data-discover":!$&&l==="render"?"true":void 0})});HS.displayName="Form";function $S(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mv(l){let s=S.useContext(Ks);return Je(s,$S(l)),s}function GS(l,{target:s,replace:r,mask:c,state:o,preventScrollReset:f,relative:h,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=En(),v=sn(),N=sr(l,{relative:h});return S.useCallback(b=>{if(jS(b,s)){b.preventDefault();let C=r!==void 0?r:Vi(v)===Vi(N),A=()=>x(l,{replace:C,mask:c,state:o,preventScrollReset:f,relative:h,viewTransition:m,defaultShouldRevalidate:p});g?S.startTransition(()=>A()):A()}},[v,x,N,r,c,o,s,l,f,h,m,p,g])}function Xs(l){Nn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let s=S.useRef(Xd(l)),r=S.useRef(!1),c=sn(),o=S.useMemo(()=>bS(c.search,r.current?null:s.current),[c.search]),f=En(),h=S.useCallback((m,p)=>{const g=Xd(typeof m=="function"?m(new URLSearchParams(o)):m);r.current=!0,f("?"+g,p)},[f,o]);return[o,h]}var KS=0,IS=()=>`__${String(++KS)}__`;function YS(){let{router:l}=mv("useSubmit"),{basename:s}=S.useContext(ln),r=oS(),c=l.fetch,o=l.navigate;return S.useCallback(async(f,h={})=>{let{action:m,method:p,encType:g,formData:x,body:v}=CS(f,s);if(h.navigate===!1){let N=h.fetcherKey||IS();await c(N,r,h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:v,formMethod:h.method||p,formEncType:h.encType||g,flushSync:h.flushSync})}else await o(h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:v,formMethod:h.method||p,formEncType:h.encType||g,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[c,o,s,r])}function XS(l,{relative:s}={}){let{basename:r}=S.useContext(ln),c=S.useContext(Dn);Je(c,"useFormAction must be used inside a RouteContext");let[o]=c.matches.slice(-1),f={...sr(l||".",{relative:s})},h=sn();if(l==null){f.search=h.search;let m=new URLSearchParams(f.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(v=>v).forEach(v=>m.append("index",v));let x=m.toString();f.search=x?`?${x}`:""}}return(!l||l===".")&&o.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Mn([r,f.pathname])),Vi(f)}function FS(l,{relative:s}={}){let r=S.useContext(iv);Je(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=mv("useViewTransitionState"),o=sr(l,{relative:s});if(!r.isTransitioning)return!1;let f=ga(r.currentLocation.pathname,c)||r.currentLocation.pathname,h=ga(r.nextLocation.pathname,c)||r.nextLocation.pathname;return _c(o.pathname,h)!=null||_c(o.pathname,f)!=null}const PS="/api";async function Dl(l,s,r){var h;const c=typeof window<"u"&&((h=window.location)!=null&&h.origin)&&window.location.origin!=="null"?window.location.origin:"http://localhost",o=new URL(PS+l,c);if(r)for(const[m,p]of Object.entries(r))p!==void 0&&p!==""&&o.searchParams.set(m,String(p));const f=await fetch(o.toString(),s);if(!f.ok){const m=await f.json().catch(()=>({}));throw new Error(String(m.error??`${f.status} ${f.statusText}`))}return f.json()}const Re=(l,s)=>Dl(l,void 0,s),pt=(l,s)=>Dl(l,{method:"POST",headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0}),Wy=(l,s)=>Dl(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),VS=l=>Dl(l,{method:"DELETE"}),ZS={health:()=>Re("/health"),ready:()=>Re("/ready"),config:()=>Re("/config"),queueSettings:()=>Re("/settings"),saveQueueSettings:l=>Wy("/settings",l),pushQueue:l=>pt("/queue/push",l),executeRun:(l,s)=>pt(`/factory-runs/${encodeURIComponent(l)}/execute`,s===void 0?{}:{force:s}),queueRunNext:l=>pt(`/factory-runs/${encodeURIComponent(l)}/queue-next`),statsByStatus:l=>Re("/stats/by-status",{jobDefId:l}),throughput:l=>Re("/stats/throughput",l),stuck:l=>Re("/stats/stuck",l),runs:l=>Re("/runs",l),recentFailures:l=>Re("/runs/recent-failures",l),run:l=>Re(`/runs/${l}`),runEvents:l=>Re(`/runs/${l}/events`),runActivities:(l,s)=>Re(`/factory-runs/${encodeURIComponent(l)}/activities`,s?{limit:s}:void 0),retryRun:l=>pt(`/factory-runs/${l}/retry`),cancelRun:l=>pt(`/factory-runs/${l}/cancel`),cancelRuns:l=>pt("/factory-runs/cancel",{runIds:l}),itemRuns:l=>Re(`/items/${l}/runs`),itemGraph:l=>Re(`/items/${l}/graph`),filters:()=>Re("/meta/filters"),compatibleGraphs:l=>Re("/meta/graphs",l),descriptors:()=>Re("/descriptors"),entitySources:l=>Re(`/entities/${encodeURIComponent(l)}/sources`),entityRelations:l=>Re(`/entities/${encodeURIComponent(l)}/relations`),entityRecordSamples:(l,s)=>Re(`/entities/${encodeURIComponent(l)}/record-samples`,{...s,random:s.random?"1":void 0}),jobDefs:()=>Re("/job-defs"),jobDef:l=>Re(`/job-defs/${l}`),saveJobDef:l=>pt("/job-defs",l),updateJobDef:(l,s)=>Wy(`/job-defs/${l}`,s),deleteJobDef:l=>VS(`/job-defs/${l}`),enqueue:l=>pt("/jobs/enqueue",l),previewContext:l=>pt("/context/preview",l),executeGraph:l=>pt("/graphs/execute",l),records:l=>Re("/records",l),recordStats:l=>Re("/records/stats",l),recordGraphRuns:(l,s)=>Re(`/records/${encodeURIComponent(l)}/graph-runs`,s),listEntities:l=>Re("/entities/summary",l?{agent:l}:void 0),entitySummary:l=>Re(`/entities/${encodeURIComponent(l)}/summary`),listNarratives:l=>Re("/narratives",l?{entity:l}:void 0),graphsForEntity:l=>Re("/graphs",{entity:l}),coreRecords:l=>{var s;return Re("/core-records",{entity:l.entity,collection:l.collection,narratives:(s=l.narratives)==null?void 0:s.join(","),processingGraphId:l.processingGraphId,processingCondition:l.processingCondition,search:l.search,page:l.page,pageSize:l.pageSize})},coreRecord:(l,s,r,c)=>Re(`/core-records/${encodeURIComponent(l)}/${encodeURIComponent(s)}`,{collection:r,includeDoc:c?"1":void 0}),deleteCoreRecord:(l,s,r)=>Dl(`/core-records/${encodeURIComponent(l)}/${encodeURIComponent(s)}`,{method:"DELETE"},{collection:r}),clearCoreRecords:l=>pt("/core-records/clear",l),resetGraphRun:(l,s)=>pt(`/records/${encodeURIComponent(l)}/reset-graph-run`,s),previewMatching:l=>pt("/selection/preview",l),listWork:l=>Re("/work",l?{agent:l}:void 0),work:l=>Re(`/work/${l}`),createWork:l=>pt("/work",l),setWorkStatus:(l,s)=>Dl(`/work/${l}/status`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:s})}),updateWork:(l,s)=>Dl(`/work/${l}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),runEvaluation:l=>pt(`/work/${l}/evaluate`),workEvaluations:l=>Re(`/work/${l}/evaluations`),listBatches:()=>Re("/batches"),batch:l=>Re(`/batches/${l}`),queueBatch:l=>pt("/batches",l),queueSingle:l=>pt("/on-demand/single",l),assemblerProperties:l=>Re("/assembler/properties",l),assemblerPreview:l=>pt("/assembler/preview",l),factoryRuns:l=>Re("/factory-runs",l),factoryRun:l=>Re(`/factory-runs/${l}`),runStatusCounts:(l,s)=>Re("/factory-runs/status-counts",{scope:l,agent:s})},ne=ZS,pv={configured:{label:"Configured",tone:"pending"},evaluating:{label:"Evaluating",tone:"running"},matched:{label:"Matched",tone:"pending"},queued:{label:"Queued",tone:"pending"},pending:{label:"Pending",tone:"pending"},running:{label:"Running",tone:"running"},succeeded:{label:"Succeeded",tone:"done"},done:{label:"Done",tone:"done"},failed:{label:"Failed",tone:"failed"},cancelled:{label:"Cancelled",tone:"cancelled"},skipped:{label:"Skipped",tone:"cancelled"},excluded:{label:"Excluded",tone:"blocked"},blocked:{label:"Blocked",tone:"blocked"},active:{label:"Active",tone:"running"},inactive:{label:"Inactive",tone:"cancelled"},completed:{label:"Completed",tone:"done"},partial:{label:"Partial",tone:"blocked"},"not-processed":{label:"Not processed",tone:"pending"},in_progress:{label:"In progress",tone:"running"},never:{label:"Never",tone:"pending"},unknown:{label:"Unknown",tone:"cancelled"}};function JS(l){var s;return((s=pv[l])==null?void 0:s.label)??l.replace(/[-_]/g," ")}function WS(l){var s;return((s=pv[l])==null?void 0:s.tone)??"pending"}function At({status:l}){return a.jsx("span",{className:`badge badge-${WS(l)}`,children:JS(l)})}const eN=[{label:"5s",ms:5e3},{label:"15s",ms:15e3},{label:"30s",ms:3e4},{label:"Off",ms:0}];function yv({onRefresh:l,intervalMs:s=5e3,lastRefreshed:r}){const[c,o]=S.useState(s),[f,h]=S.useState(!1),m=S.useRef(null);return S.useEffect(()=>{if(!(f||c===0))return m.current=setTimeout(()=>l(),c),()=>{m.current&&clearTimeout(m.current)}},[l,c,f,r]),a.jsxs("div",{className:"refresh-control",children:[a.jsx("span",{className:`refresh-dot${f||c===0?" paused":""}`}),r&&a.jsx("span",{children:r.toLocaleTimeString()}),a.jsx("select",{value:c,onChange:p=>{const g=Number(p.target.value);o(g),h(g===0)},style:{minWidth:"unset",width:60},children:eN.map(({label:p,ms:g})=>a.jsx("option",{value:g,children:p},g))}),a.jsx("button",{onClick:()=>{h(p=>!p)},title:f?"Resume auto-refresh":"Pause auto-refresh",style:{padding:"3px 8px"},children:f?"▶":"⏸"}),a.jsx("button",{onClick:l,title:"Refresh now",style:{padding:"3px 8px"},children:"↻"})]})}function tN({buckets:l}){if(!l.length)return a.jsx("div",{className:"text-dim",style:{fontSize:12,padding:"8px 0"},children:"No throughput data"});const s=new Map;for(const o of l)s.set(o.bucket,(s.get(o.bucket)??0)+o.count);const r=[...s.entries()].sort((o,f)=>o[0].localeCompare(f[0])),c=Math.max(...r.map(([,o])=>o),1);return a.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:48,marginTop:8},children:r.map(([o,f])=>a.jsx("div",{title:`${new Date(o).toLocaleString()}: ${f}`,style:{flex:1,minWidth:4,height:`${Math.max(8,f/c*100)}%`,background:"var(--color-accent)",borderRadius:2,opacity:.85}},o))})}function al(l){if(!l)return"—";const s=Date.now()-new Date(l).getTime(),r=Math.abs(s),c=s<0,o=Math.round(r/6e4);if(o<1)return c?"in <1m":"just now";if(o<60)return c?`in ${o}m`:`${o}m ago`;const f=Math.round(o/60);if(f<24)return c?`in ${f}h`:`${f}h ago`;const h=Math.round(f/24);return c?`in ${h}d`:`${h}d ago`}function Rt(l){return l?new Date(l).toLocaleString():"—"}function Zi(l){return l%1440===0?`every ${l/1440} day${l===1440?"":"s"}`:l%60===0?`every ${l/60} hour${l===60?"":"s"}`:`every ${l} min`}const ll="inferences",tl={continuous:"Ongoing Work","on-demand-single":"On-Demand Single","on-demand-batch":"On-Demand Batch"},nN={entity:"Entities",event:"Events",knowledge:"Knowledge"},aN={"already-processed":"Already processed by this graph","already-queued":"Already queued for this graph","already-running":"Currently running for this graph","missing-narrative":"Missing a required narrative","incompatible-graph":"Graph not compatible with this item","missing-data":"Item is missing required data","metadata-unavailable":"Metadata unavailable","changed-since-eligible":"Changed or became ineligible since preview","prerequisite-graph-not-met":"Required prior processing not completed","cross-entity-prerequisite-not-met":"Linked entity information not yet processed"},gv={ttl:"Re-run if older than… (default)",skip:"Skip — never re-run already-processed information","failed-only":"Failed only — re-run information where last attempt failed",all:"All — force re-run of every already-processed item","before-date":"Before date — re-run information processed before…","after-date":"After date — re-run information processed after…",condition:"Condition — re-run only if item matches a filter"},lN=["blocked","pending","running","done","failed","cancelled"],eg={blocked:"var(--status-blocked)",pending:"var(--status-pending)",running:"var(--status-running)",done:"var(--status-done)",failed:"var(--status-failed)",cancelled:"var(--status-cancelled)"},sN=["continuous","on-demand-single","on-demand-batch"];function iN(){const l=En(),{agentQueryParam:s,agentId:r}=Cn(),[c,o]=S.useState(""),[f,h]=S.useState(""),[m,p]=S.useState(""),[g,x]=S.useState(new Date),v=ve({queryKey:["queue-settings"],queryFn:()=>ne.queueSettings()}),N=ve({queryKey:["overview-runs",s??"all",c,f,m],queryFn:()=>ne.factoryRuns({agent:s,sourceType:c||void 0,workId:f||void 0,entity:m||void 0,pageSize:1e3})}),b=ve({queryKey:["throughput"],queryFn:()=>ne.throughput({hours:24,bucket:"hour"})}),C=ve({queryKey:["entities",s??"all"],queryFn:()=>ne.listEntities(s)}),A=ve({queryKey:["work",s??"all"],queryFn:()=>ne.listWork(s)}),z=S.useMemo(()=>{var G;return((G=N.data)==null?void 0:G.runs)??[]},[N.data]),D=S.useMemo(()=>{const G={blocked:0,pending:0,running:0,done:0,failed:0,cancelled:0};for(const te of z)G[te.status]+=1;return G},[z]),F=z.filter(G=>G.status==="running").slice(0,8),$=[...z.filter(G=>G.status==="pending")].sort((G,te)=>+new Date(G.availableAt)-+new Date(te.availableAt)).slice(0,8),U=z.filter(G=>G.status==="failed").slice(0,8),Z=S.useCallback(()=>{N.refetch(),x(new Date)},[N]),W=zn(),V=st({mutationFn:G=>ne.cancelRun(G),onSuccess:()=>{W.invalidateQueries({queryKey:["overview-runs"]}),W.invalidateQueries({queryKey:["factory-runs"]}),W.invalidateQueries({queryKey:["run-status-counts"]})}});return a.jsxs("div",{children:[a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"Overview"}),a.jsxs("span",{className:"page-subtitle",children:["Factory health and queue monitoring.",r?a.jsxs(a.Fragment,{children:[" Agent scope: ",a.jsx("span",{className:"mono",children:r})," ·"]}):null,v.data&&a.jsxs(a.Fragment,{children:[" ","Manager: ",a.jsx("strong",{children:v.data.queueMode==="running"?"Running":"Paused"})," · ",v.data.runningCount??0," running / ",v.data.maxConcurrentJobs," capacity"]})]})]}),a.jsx(yv,{onRefresh:Z,lastRefreshed:g??void 0})]}),a.jsxs("div",{className:"filters",children:[a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Source type"}),a.jsxs("select",{value:c,onChange:G=>o(G.target.value),children:[a.jsx("option",{value:"",children:"All"}),sN.map(G=>a.jsx("option",{value:G,children:tl[G]},G))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Ongoing work"}),a.jsxs("select",{value:f,onChange:G=>h(G.target.value),children:[a.jsx("option",{value:"",children:"All"}),(A.data??[]).map(G=>a.jsx("option",{value:G.id,children:G.name},G.id))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Entity"}),a.jsxs("select",{value:m,onChange:G=>p(G.target.value),children:[a.jsx("option",{value:"",children:"All"}),(C.data??[]).map(G=>a.jsx("option",{value:G.name,children:G.label},G.name))]})]})]}),a.jsx("div",{className:"status-cards",style:{gridTemplateColumns:"repeat(6, 1fr)"},children:lN.map(G=>a.jsxs("div",{className:"status-card",onClick:()=>l(`/journal?status=${G}`),children:[a.jsx("div",{className:"status-card-label",style:{color:eg[G]},children:G}),a.jsx("div",{className:"status-card-count",style:{color:eg[G]},children:D[G].toLocaleString()})]},G))}),a.jsxs("div",{className:"card",style:{marginBottom:20},children:[a.jsx("div",{className:"card-title",children:"Throughput (24h)"}),b.isLoading&&a.jsx("span",{className:"spinner"}),b.data&&a.jsx(tN,{buckets:b.data})]}),a.jsxs("div",{className:"overview-cols",children:[a.jsx(bd,{title:"Recent failed",runs:U,emptyMsg:"No failed runs"}),a.jsx(bd,{title:"Currently running",runs:F,emptyMsg:"No running runs"}),a.jsx(bd,{title:"Oldest pending",runs:$,emptyMsg:"No pending runs",onCancel:G=>V.mutate(G)})]})]})}function bd({title:l,runs:s,emptyMsg:r,onCancel:c}){return a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:l}),s.length===0&&a.jsx("div",{className:"empty-state",style:{padding:"24px 0"},children:r}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.map(o=>{var f;return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(me,{to:`/journal/${o.id}`,style:{display:"block",textDecoration:"none"},children:a.jsxs("div",{style:{padding:"8px 10px",background:"var(--color-surface-raised)",borderRadius:"var(--radius)",border:"1px solid var(--color-border)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[a.jsxs("span",{children:[a.jsx(At,{status:o.status}),o.status==="pending"&&((f=o.queueOptions)==null?void 0:f.admissionHeld)&&a.jsx("span",{className:"chip",style:{marginLeft:6,fontSize:10},children:"held"})]}),a.jsx("span",{className:"text-dim mono",style:{fontSize:11},children:al(o.updatedAt)})]}),a.jsxs("div",{className:"mono",style:{color:"var(--color-text-muted)",fontSize:11},children:[tl[o.sourceType]," · ",o.entity,"/",o.recordLabel??o.recordId]}),o.error&&a.jsx("div",{style:{color:"var(--status-failed)",fontSize:11},children:o.error.message})]})}),c&&(o.status==="pending"||o.status==="blocked")&&a.jsx("button",{className:"btn btn-sm",style:{position:"absolute",top:8,right:8,fontSize:10,color:"var(--status-cancelled)"},onClick:h=>{h.preventDefault(),window.confirm("Cancel this pending run?")&&c(o.id)},children:"Cancel"})]},o.id)})})]})}function Nt({title:l,message:s,detail:r,onRetry:c,safeActionLabel:o,onSafeAction:f}){const[h,m]=S.useState(!1),p=r===void 0?"":typeof r=="string"?r:String((r==null?void 0:r.message)??JSON.stringify(r,null,2));return a.jsxs("div",{className:"error-state",style:{color:"var(--color-text)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{style:{color:"var(--status-failed)",fontSize:16},children:"⚠"}),a.jsx("strong",{style:{color:"var(--status-failed)"},children:l})]}),s&&a.jsx("div",{style:{marginTop:6,lineHeight:1.5},children:s}),a.jsxs("div",{style:{display:"flex",gap:8,marginTop:12,flexWrap:"wrap"},children:[c&&a.jsx("button",{type:"button",onClick:c,children:"Retry"}),o&&a.jsx("button",{type:"button",onClick:f,children:o}),p&&a.jsx("button",{type:"button",onClick:()=>m(g=>!g),children:h?"Hide technical details":"Show technical details"})]}),h&&p&&a.jsx("pre",{style:{marginTop:10,fontSize:11,whiteSpace:"pre-wrap",opacity:.8,fontFamily:"var(--font-mono)"},children:p})]})}function vv({variant:l="compact"}){const s=zn(),r=ve({queryKey:["queue-settings"],queryFn:()=>ne.queueSettings(),refetchInterval:1e4}),c=st({mutationFn:g=>ne.saveQueueSettings({queueMode:g}),onSuccess:()=>{s.invalidateQueries({queryKey:["queue-settings"]}),s.invalidateQueries({queryKey:["overview-runs"]}),s.invalidateQueries({queryKey:["factory-runs"]})}}),o=r.data,h=((o==null?void 0:o.queueMode)??"running")==="running",m=r.isLoading||c.isPending;function p(){c.mutate(h?"paused":"running")}return l==="card"?a.jsxs("div",{className:`queue-manager-card${h?" is-running":" is-paused"}`,children:[a.jsxs("div",{className:"queue-manager-card-head",children:[a.jsxs("div",{children:[a.jsx("div",{className:"queue-manager-title",children:"Job manager"}),a.jsx("div",{className:"queue-manager-subtitle",children:h?"Pending jobs are picked up and executed automatically.":"Queue is paused — jobs stay pending until you resume."})]}),a.jsx("span",{className:`queue-manager-badge${h?" running":" paused"}`,children:h?"Running":"Paused"})]}),o&&a.jsxs("div",{className:"queue-manager-stats",children:[a.jsxs("span",{children:[o.runningCount??0," running"]}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:[o.pendingCount??0," pending"]}),(o.heldCount??0)>0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{children:[o.heldCount," held at capacity"]})]})]}),a.jsx("div",{style:{marginTop:16},children:a.jsx("button",{type:"button",className:h?"":"primary",disabled:m,onClick:p,children:m?"Updating…":h?"Pause job manager":"Resume job manager"})})]}):a.jsxs("button",{type:"button",className:`queue-manager-toggle${h?" running":" paused"}`,disabled:m,onClick:p,title:h?`Job manager running — ${(o==null?void 0:o.runningCount)??0} active, ${(o==null?void 0:o.pendingCount)??0} pending. Click to pause.`:`Job manager paused — ${(o==null?void 0:o.pendingCount)??0} pending. Click to resume.`,children:[a.jsx("span",{className:`queue-manager-dot${h?" running":" paused"}`}),a.jsx("span",{className:"queue-manager-label",children:h?"Running":"Paused"}),o&&a.jsxs("span",{className:"queue-manager-counts",children:[o.runningCount??0,"/",o.pendingCount??0]})]})}const rN=[{ms:15e3,label:"15 seconds"},{ms:3e4,label:"30 seconds"},{ms:6e4,label:"1 minute"},{ms:12e4,label:"2 minutes"}];function cN(){const l=zn(),[s,r]=S.useState(""),[c,o]=S.useState(""),[f,h]=S.useState(!1),m=ve({queryKey:["queue-settings"],queryFn:()=>ne.queueSettings()});S.useEffect(()=>{m.data&&(r(m.data.maxConcurrentJobs),o(m.data.queueAdmissionIntervalMs),h(!1))},[m.data]);const p=st({mutationFn:()=>ne.saveQueueSettings({maxConcurrentJobs:Number(s),queueAdmissionIntervalMs:Number(c)}),onSuccess:()=>{h(!0),l.invalidateQueries({queryKey:["queue-settings"]})}});return a.jsxs("div",{children:[a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"Settings"}),a.jsx("span",{className:"page-subtitle",children:"App-wide jobs factory configuration."})]})}),a.jsx("div",{className:"card",style:{maxWidth:640,marginBottom:20},children:a.jsx(vv,{variant:"card"})}),a.jsxs("div",{className:"card",style:{maxWidth:640},children:[a.jsx("div",{className:"card-title",children:"Queue execution"}),a.jsx("p",{className:"text-muted",style:{fontSize:13,marginBottom:16},children:"Capacity limits apply while the job manager is running. When capacity frees up, waiting jobs are promoted on the check interval below."}),m.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}),m.isError&&a.jsx(Nt,{title:"Failed to load settings",detail:m.error}),m.data&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Max concurrent jobs"}),a.jsx("input",{type:"number",min:1,value:s,onChange:g=>{r(Number(g.target.value)),h(!1)}})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Admission check interval"}),a.jsx("select",{value:c,onChange:g=>{o(Number(g.target.value)),h(!1)},children:rN.map(g=>a.jsx("option",{value:g.ms,children:g.label},g.ms))}),a.jsx("span",{className:"hint",children:"How often the factory checks for free capacity and promotes waiting jobs."})]})]}),a.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",marginTop:16},children:[a.jsx("button",{type:"button",className:"primary",disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?"Saving…":"Save settings"}),f&&!p.isPending&&a.jsx("span",{className:"text-muted",style:{fontSize:13},children:"Saved"})]}),p.isError&&a.jsx("div",{style:{marginTop:12},children:a.jsx(Nt,{title:"Failed to save settings",detail:p.error})})]})]})]})}function ir({loaded:l,total:s,hasMore:r,isFetchingNextPage:c,onLoadMore:o}){const f=S.useRef(null);return S.useEffect(()=>{if(!r||c)return;const h=f.current;if(!h)return;const m=new IntersectionObserver(p=>{var g;(g=p[0])!=null&&g.isIntersecting&&o()},{rootMargin:"400px"});return m.observe(h),()=>m.disconnect()},[r,c,o]),a.jsxs("div",{className:"infinite-scroll-footer",children:[a.jsxs("span",{children:[l.toLocaleString()," of ",s.toLocaleString()]}),c&&a.jsxs("span",{className:"infinite-scroll-loading",children:[a.jsx("span",{className:"spinner"})," Loading more…"]}),!r&&l>0&&a.jsx("span",{className:"text-dim",children:"End of list"}),r&&a.jsx("div",{ref:f,className:"infinite-scroll-sentinel","aria-hidden":!0})]})}function kt({title:l,message:s,actionLabel:r,actionTo:c,onAction:o,icon:f="○"}){return a.jsxs("div",{className:"empty-state",style:{padding:"40px 24px"},children:[a.jsx("div",{style:{fontSize:28,opacity:.5,marginBottom:10},children:f}),a.jsx("div",{style:{fontSize:15,fontWeight:600,color:"var(--color-text)",marginBottom:6},children:l}),s&&a.jsx("div",{style:{maxWidth:480,margin:"0 auto",lineHeight:1.55},children:s}),r&&a.jsx("div",{style:{marginTop:16},children:c?a.jsx(me,{to:c,children:a.jsx("button",{type:"button",className:"primary",children:r})}):a.jsx("button",{type:"button",className:"primary",onClick:o,children:r})})]})}const xv=100;function jv(l){if(!(l.page*l.pageSize>=l.total))return l.page+1}function rr(l){var s;return((s=l==null?void 0:l[0])==null?void 0:s.total)??0}function Yc(l,s,r){return Yg({queryKey:[...l,s],queryFn:({pageParam:c})=>ne.factoryRuns({...s,page:c,pageSize:xv}),initialPageParam:1,getNextPageParam:jv,enabled:!0})}function uN(l,s,r){return Yg({queryKey:[...l,s],queryFn:({pageParam:c})=>ne.coreRecords({...s,page:c,pageSize:xv}),initialPageParam:1,getNextPageParam:jv,enabled:(r==null?void 0:r.enabled)??!0})}const tg=["blocked","pending","running","done","failed","cancelled"],oN=["continuous","on-demand-single","on-demand-batch"],dN=["blocked","pending","running"],Sd={blocked:"var(--status-blocked)",pending:"var(--status-pending)",running:"var(--status-running)",done:"var(--status-done)",failed:"var(--status-failed)",cancelled:"var(--status-cancelled)"},ng=[{key:"total",label:"Total"},{key:"today",label:"Today"},{key:"this-week",label:"This week"},{key:"this-month",label:"This month"}];function Nd(l){return dN.includes(l.status)}function fN({run:l}){var s;return l.status!=="pending"||!((s=l.queueOptions)!=null&&s.admissionHeld)?null:a.jsx("span",{className:"chip",style:{marginLeft:6,fontSize:10},title:"Waiting for admission capacity",children:"held"})}function hN(){var ie,L;const[l,s]=Xs(),r=En(),c=zn(),{agentQueryParam:o,agentId:f}=Cn(),[h,m]=S.useState(new Date),p=l.get("scope"),g=ng.some(O=>O.key===p)?p:"total",[x,v]=S.useState(new Set),N=l.get("status")??"",b=l.get("sourceType")??"",C=l.get("workId")??"",A=l.get("batchId")??"",z=l.get("graphId")??"",D=l.get("entity")??"",F=l.get("recordId")??"",$=N==="pending"||N==="blocked",U=S.useMemo(()=>({agent:o,scope:g==="total"?void 0:g,status:N||void 0,sourceType:b||void 0,workId:C||void 0,batchId:A||void 0,graphId:z||void 0,entity:D||void 0,recordId:F||void 0}),[o,g,N,b,C,A,z,D,F]),Z=(O,ae)=>{s(be=>{const Ae=new URLSearchParams(be);return ae?Ae.set(O,ae):Ae.delete(O),Ae}),v(new Set)},W=O=>{s(ae=>{const be=new URLSearchParams(ae);return O==="total"?be.delete("scope"):be.set("scope",O),be}),v(new Set)},V=Yc(["factory-runs",o??"all",g,N,b,C,A,z,D,F],U),G=ve({queryKey:["run-status-counts",g,o??"all"],queryFn:()=>ne.runStatusCounts(g,o)}),te=ve({queryKey:["meta-filters"],queryFn:()=>ne.filters()}),xe=ve({queryKey:["entities",o??"all"],queryFn:()=>ne.listEntities(o)}),pe=ve({queryKey:["work",o??"all"],queryFn:()=>ne.listWork(o)}),se=st({mutationFn:O=>ne.cancelRuns(O),onSuccess:()=>{v(new Set),c.invalidateQueries({queryKey:["factory-runs"]}),c.invalidateQueries({queryKey:["run-status-counts"]}),c.invalidateQueries({queryKey:["overview-runs"]})}}),ce=S.useCallback(()=>{V.refetch(),m(new Date)},[V]),Se=G.data,ue=S.useMemo(()=>{var O;return((O=V.data)==null?void 0:O.pages.flatMap(ae=>ae.runs))??[]},[V.data]),k=rr((ie=V.data)==null?void 0:ie.pages),X=ue.length<k,re=S.useMemo(()=>ue.filter(Nd),[ue]),je=re.length>0&&re.every(O=>x.has(O.id));function I(O){v(ae=>{const be=new Set(ae);return be.has(O)?be.delete(O):be.add(O),be})}function E(){v(je?new Set:new Set(re.map(O=>O.id)))}function H(O){if(O.length===0)return;const ae=O.length===1?"Cancel this run? It will be marked cancelled in the journal.":`Cancel ${O.length} runs? They will be marked cancelled in the journal.`;window.confirm(ae)&&se.mutate(O)}const J=S.useCallback(()=>{X&&!V.isFetchingNextPage&&V.fetchNextPage()},[X,V]);return a.jsxs("div",{children:[a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"Journal"}),!V.isLoading&&a.jsxs("span",{className:"page-subtitle",children:[f?a.jsxs(a.Fragment,{children:["Agent scope: ",a.jsx("span",{className:"mono",children:f})," · "]}):null,k.toLocaleString()," total job executions"]})]}),a.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[$&&x.size>0&&a.jsx("button",{disabled:se.isPending,onClick:()=>H([...x]),style:{color:"var(--status-cancelled)"},children:se.isPending?"Cancelling…":`Cancel selected (${x.size})`}),a.jsx(yv,{onRefresh:ce,lastRefreshed:h??void 0})]})]}),a.jsxs("div",{style:{marginBottom:20},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:10},children:ng.map(({key:O,label:ae})=>a.jsx("button",{className:`btn btn-sm${g===O?" active":""}`,onClick:()=>W(O),children:ae},O))}),a.jsx("div",{className:"status-cards",style:{gridTemplateColumns:"repeat(6, 1fr)"},children:tg.map(O=>a.jsxs("div",{className:`status-card${N===O?" selected":""}`,style:N===O?{outline:`2px solid ${Sd[O]}`}:void 0,onClick:()=>Z("status",N===O?"":O),title:`Filter by ${O}`,children:[a.jsx("div",{className:"status-card-label",style:{color:Sd[O]},children:O}),a.jsx("div",{className:"status-card-count",style:{color:Sd[O]},children:Se?Se[O].toLocaleString():"—"})]},O))})]}),a.jsxs("div",{className:"filters",children:[a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Status"}),a.jsxs("select",{value:N,onChange:O=>Z("status",O.target.value),children:[a.jsx("option",{value:"",children:"All"}),tg.map(O=>a.jsx("option",{value:O,children:O},O))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Source type"}),a.jsxs("select",{value:b,onChange:O=>Z("sourceType",O.target.value),children:[a.jsx("option",{value:"",children:"All"}),oN.map(O=>a.jsx("option",{value:O,children:tl[O]},O))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Ongoing work"}),a.jsxs("select",{value:C,onChange:O=>Z("workId",O.target.value),children:[a.jsx("option",{value:"",children:"All"}),(pe.data??[]).map(O=>a.jsx("option",{value:O.id,children:O.name},O.id))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Pipeline"}),a.jsxs("select",{value:z,onChange:O=>Z("graphId",O.target.value),children:[a.jsx("option",{value:"",children:"All"}),(((L=te.data)==null?void 0:L.graphIds)??[]).map(O=>a.jsx("option",{value:O,children:O},O))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Entity"}),a.jsxs("select",{value:D,onChange:O=>Z("entity",O.target.value),children:[a.jsx("option",{value:"",children:"All"}),(xe.data??[]).map(O=>a.jsx("option",{value:O.name,children:O.label},O.name))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Item id"}),a.jsx("input",{type:"text",value:F,placeholder:"item id",onChange:O=>Z("recordId",O.target.value),style:{width:160}})]})]}),V.isError&&a.jsx(Nt,{title:"Failed to load journal",detail:V.error,onRetry:ce}),V.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading journal…"]}),!V.isLoading&&ue.length===0&&a.jsx(kt,{title:"No journal entries",message:"No executions match the current filters."}),ue.length>0&&a.jsxs("div",{className:"table-wrap",children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[$&&a.jsx("th",{style:{width:36},children:a.jsx("input",{type:"checkbox",checked:je,onChange:E,title:"Select all cancellable (loaded)"})}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Source type"}),a.jsx("th",{children:"Source"}),a.jsx("th",{children:"Entity"}),a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Attempts"}),a.jsx("th",{children:"Priority"}),a.jsx("th",{children:"Created"}),a.jsx("th",{children:"Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:ue.map(O=>a.jsxs("tr",{onClick:()=>r(`/journal/${O.id}`),children:[$&&a.jsx("td",{onClick:ae=>ae.stopPropagation(),children:Nd(O)&&a.jsx("input",{type:"checkbox",checked:x.has(O.id),onChange:()=>I(O.id)})}),a.jsxs("td",{children:[a.jsx(At,{status:O.status}),a.jsx(fN,{run:O})]}),a.jsx("td",{children:a.jsx("span",{className:"chip",children:tl[O.sourceType]})}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:O.sourceName??"—"}),a.jsx("td",{className:"td-mono",children:O.entity}),a.jsx("td",{className:"td-mono",children:O.recordLabel??O.recordId}),a.jsx("td",{className:"td-mono",onClick:ae=>ae.stopPropagation(),children:a.jsx(me,{to:`/pipelines/${encodeURIComponent(O.graphId)}`,children:O.graphName??O.graphId})}),a.jsxs("td",{className:"td-mono",children:[O.attempts,"/",O.maxAttempts]}),a.jsx("td",{className:"td-mono",children:O.priority}),a.jsx("td",{className:"td-mono",children:Rt(O.createdAt)}),a.jsx("td",{className:"td-mono",children:Rt(O.updatedAt)}),a.jsx("td",{onClick:ae=>ae.stopPropagation(),children:Nd(O)&&a.jsx("button",{className:"btn btn-sm",style:{color:"var(--status-cancelled)",fontSize:11},disabled:se.isPending,onClick:()=>H([O.id]),children:"Cancel"})})]},O.id))})]}),a.jsx(ir,{loaded:ue.length,total:k,hasMore:X,isFetchingNextPage:V.isFetchingNextPage,onLoadMore:J})]})]})}function Tt({label:l,value:s,defaultOpen:r=!1}){const[c,o]=S.useState(r);if(s==null)return null;const f=JSON.stringify(s,null,2);return a.jsxs("div",{className:"json-section",children:[a.jsxs("div",{className:`json-section-header${c?" open":""}`,onClick:()=>o(h=>!h),role:"button",tabIndex:0,onKeyDown:h=>h.key==="Enter"&&o(m=>!m),children:[a.jsx("span",{className:`json-chevron${c?" open":""}`,children:"▶"}),l,a.jsx("span",{className:"text-dim",style:{marginLeft:"auto",fontWeight:400,textTransform:"none",fontSize:"11px"},children:c?"collapse":`${f.split(`
61
+ `).length} lines`})]}),c&&a.jsx("div",{className:"json-body",children:a.jsx("pre",{children:f})})]})}const mN={enqueued:"muted",claimed:"start",done:"done",failed:"fail",retry:"info",lease_expired:"fail",cancelled:"muted"},pN={info:"var(--color-text)",start:"var(--status-running)",done:"var(--status-done)",fail:"var(--status-failed)",muted:"var(--color-text-muted)"};function pa(l){if(typeof l=="number")return l>1e12?l:l*1e3;if(typeof l=="string"){const s=new Date(l).getTime();return Number.isNaN(s)?void 0:s}}function bv(l){return new Date(l).toLocaleTimeString(void 0,{hour12:!1})}function Fd(l){return l&&typeof l=="object"&&!Array.isArray(l)?l:void 0}function ag(l){const s=(l??"").toLowerCase();return s.includes("fail")||s.includes("error")?"fail":s.includes("complete")||s.includes("done")||s.includes("success")||s.includes("ended")?"done":s.includes("start")||s.includes("running")||s.includes("progress")?"start":"info"}function yN(l){return l==="fail"?"✕":l==="done"?"✓":l==="start"?"▶":"·"}function gN(l){if(l)return typeof l=="string"?l:typeof l=="object"&&l&&"message"in l?String(l.message):JSON.stringify(l)}function Sv(l,s=120){return l.length<=s?l:`${l.slice(0,s-1)}…`}function vN(l){const s=Fd(l.runContext);return{...l,nodeId:l.nodeId??(s==null?void 0:s.nodeId),graphId:l.graphId??(s==null?void 0:s.graphId),skillKey:l.skillKey??(s==null?void 0:s.skillKey)}}function xN(l){const s=l.nodeId??l.skillKey??"node",r=l.skillKey&&l.skillKey!==l.nodeId?` · ${l.skillKey}`:"";return`${s}${r}`}function Nv(l,s,r){if(typeof l.durationMs=="number")return l.durationMs;if(typeof l.duration=="number")return l.duration;if(s!=null&&r!=null)return Math.max(0,Math.round(r-s))}function jN(l){const s=[],r=Fd(l.runContext),c=Fd(l.outer),o=pa(l.startTime)??pa(l.createdAt),f=pa(l.endTime)??pa(l.updatedAt),h=Nv(l,o,f);s.push({label:"Summary",value:{activityId:l.activityId,status:l.status,phase:l.phase,nodeId:l.nodeId??(r==null?void 0:r.nodeId),graphId:l.graphId??(r==null?void 0:r.graphId),skillKey:l.skillKey??(r==null?void 0:r.skillKey),kind:l.kind,startTime:o!=null?new Date(o).toISOString():l.startTime,endTime:f!=null?new Date(f).toISOString():l.endTime,durationMs:h}}),l.inputVariableKeys&&s.push({label:"Input variable keys",value:l.inputVariableKeys}),l.executionKeys&&s.push({label:"Execution keys",value:l.executionKeys}),(c==null?void 0:c.input)!=null&&s.push({label:"Input",value:c.input}),(c==null?void 0:c.output)!=null&&s.push({label:"Output",value:c.output}),(c==null?void 0:c.metadata)!=null&&s.push({label:"Metadata",value:c.metadata}),(c==null?void 0:c.memory)!=null&&s.push({label:"Memory",value:c.memory}),l.outputSummary!=null&&s.push({label:"Output summary",value:l.outputSummary}),l.narrixSummary!=null&&s.push({label:"Narrix",value:l.narrixSummary}),l.error!=null&&s.push({label:"Error",value:l.error}),Array.isArray(l.inner)&&l.inner.length>0&&s.push({label:"Inner steps",value:l.inner});const m={},p=new Set(["activityId","status","phase","nodeId","graphId","skillKey","kind","startTime","endTime","createdAt","updatedAt","durationMs","duration","runContext","outer","inner","error","inputVariableKeys","executionKeys","outputSummary","narrixSummary"]);for(const[g,x]of Object.entries(l))p.has(g)||x==null||(m[g]=x);return Object.keys(m).length>0&&s.push({label:"Record fields",value:m}),s}function bN(l){return l.map((s,r)=>{const c=pa(s.at)??0,o=s.meta&&Object.keys(s.meta).length?s.meta:void 0;return{id:`event-${r}-${s.kind}-${c}`,ts:c,time:bv(c),level:mN[s.kind]??"info",label:s.kind.replace(/_/g," "),summary:o?Sv(JSON.stringify(o)):void 0,sections:o?[{label:"Event meta",value:o}]:void 0}})}function SN(l){return l.map((s,r)=>{const c=vN(s),o=pa(c.startTime)??pa(c.createdAt)??0,f=pa(c.endTime)??(ag(c.status)!=="start"?pa(c.updatedAt):void 0),h=ag(c.status),m=Nv(c,o,f),p=gN(c.error),g=jN(c);return{id:`activity-${c.activityId??c.nodeId??r}-${o}`,ts:o,time:bv(o),level:h,label:`${yN(h)} ${xN(c)}`,summary:p?Sv(p):m!=null?`${m}ms`:void 0,sections:g.length>0?g:void 0}})}function NN({entry:l}){var o;const[s,r]=S.useState(!1),c=(((o=l.sections)==null?void 0:o.length)??0)>0;return a.jsxs("div",{className:`live-console-entry${s?" open":""}`,children:[a.jsxs("div",{className:`live-console-line${c?" expandable":""}`,onClick:c?()=>r(f=>!f):void 0,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?f=>f.key==="Enter"&&r(h=>!h):void 0,children:[c&&a.jsx("span",{className:`live-console-chevron${s?" open":""}`,children:"▶"}),a.jsx("span",{className:"live-console-time",children:l.time}),a.jsx("span",{style:{color:pN[l.level]},children:l.label}),l.summary&&a.jsx("span",{className:"live-console-detail",children:l.summary})]}),s&&l.sections&&a.jsx("div",{className:"live-console-expand",children:l.sections.map(f=>a.jsx(Tt,{label:f.label,value:f.value},f.label))})]})}function CN({runId:l,live:s}){var N;const r=s?1200:!1,c=ve({queryKey:["run-events",l],queryFn:()=>ne.runEvents(l),refetchInterval:r}),o=ve({queryKey:["run-activities",l],queryFn:()=>ne.runActivities(l),refetchInterval:r}),f=S.useMemo(()=>{var C,A;const b=[...bN(((C=c.data)==null?void 0:C.events)??[]),...SN(((A=o.data)==null?void 0:A.activities)??[])];return b.sort((z,D)=>z.ts-D.ts),b},[c.data,o.data]),h=S.useRef(null),m=S.useRef(!0),p=()=>{const b=h.current;b&&(m.current=b.scrollHeight-b.scrollTop-b.clientHeight<40)};S.useEffect(()=>{m.current&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[f.length]);const g=((N=o.data)==null?void 0:N.available)??!0,x=f.length===0,v=f.filter(b=>{var C;return(((C=b.sections)==null?void 0:C.length)??0)>0}).length;return a.jsxs("div",{className:"live-console",children:[a.jsxs("div",{className:"live-console-head",children:[a.jsxs("span",{className:"live-console-title",children:[a.jsx("span",{className:`live-dot${s?" live":""}`}),"Live Console"]}),a.jsxs("span",{className:"live-console-meta mono",children:[s?"streaming…":"idle"," · ",f.length," entr",f.length===1?"y":"ies",v>0?` · ${v} expandable`:""]})]}),a.jsxs("div",{className:"live-console-body",ref:h,onScroll:p,children:[x&&a.jsx("div",{className:"live-console-line muted",children:s?"Waiting for execution events…":"No execution activity recorded yet."}),f.map(b=>a.jsx(NN,{entry:b},b.id))]}),!g&&a.jsx("div",{className:"live-console-foot",children:"Per-node activity tracking is unavailable — showing run lifecycle events only."})]})}function bn({title:l,children:s,summary:r,defaultOpen:c=!0,className:o,style:f,id:h}){const[m,p]=S.useState(c);return a.jsxs("div",{id:h,className:`card collapsible-card${m?" open":""}${o?` ${o}`:""}`,style:f,children:[a.jsxs("button",{type:"button",className:"collapsible-card-head",onClick:()=>p(g=>!g),"aria-expanded":m,children:[a.jsx("span",{className:`collapsible-chevron${m?" open":""}`,"aria-hidden":!0,children:"▶"}),a.jsx("span",{className:"collapsible-card-title",children:l}),!m&&r!=null&&r!==""&&a.jsx("span",{className:"collapsible-card-summary",children:r})]}),m&&a.jsx("div",{className:"collapsible-card-body",children:s})]})}function ge(l){return l&&typeof l=="object"&&!Array.isArray(l)?l:void 0}function Xe(l){return typeof l=="number"&&Number.isFinite(l)?l:void 0}function Lc(l){if(l!=null)try{return new TextEncoder().encode(JSON.stringify(l)).length}catch{return}}function Sn(l){return l==null||!Number.isFinite(l)?"—":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(2)} MB`}function Uc(l){return l==null||!Number.isFinite(l)?"—":l===0?"$0.00":l<.01?`$${l.toFixed(4)}`:l<1?`$${l.toFixed(3)}`:`$${l.toFixed(2)}`}function Ve(l){if(l==null||!Number.isFinite(l))return"—";if(l<1e3)return`${Math.round(l)} ms`;if(l<6e4)return`${(l/1e3).toFixed(2)} s`;const s=Math.floor(l/6e4),r=(l%6e4/1e3).toFixed(1);return`${s}m ${r}s`}function lg(l){return l.skillKey==="finalizer"||l.nodeId.includes(":finalizer")}function yf(l,s){const r=lg(l),c=lg(s);if(r!==c)return r?1:-1;const o=l.startedAt??0,f=s.startedAt??0;return o!==f?o-f:l.nodeId.localeCompare(s.nodeId)}function Yi(l){if(!l)return"—";const s=l.total??(l.prompt!=null||l.completion!=null?(l.prompt??0)+(l.completion??0):void 0);if(s==null&&l.prompt==null&&l.completion==null)return"—";const r=[];return l.prompt!=null&&r.push(`${l.prompt} in`),l.completion!=null&&r.push(`${l.completion} out`),s!=null&&r.push(`${s} total`),r.join(" · ")}function gf(...l){for(const s of l){if(!s)continue;const r=Xe(s.costUsd)??Xe(s.cost);if(r!=null)return r;const c=ge(s.cost),o=Xe(c==null?void 0:c.costUsd);if(o!=null)return o;const f=ge(s.usage),h=Xe(f==null?void 0:f.costUsd);if(h!=null)return h;const m=ge(s.timing),p=Xe(m==null?void 0:m.costUsd);if(p!=null)return p}}function Cv(l){return gf(l,ge(l.cost),ge(l.usage))}function sg(l,s){let r=0,c=!1;for(const o of l){if(String(o.nodeId??"")!==s||o.status!=null&&o.status!=="completed")continue;const f=Cv(o);f!=null&&(r+=f,c=!0)}return c?r:void 0}function EN(l,s){var h;const r=ge((h=ge(l))==null?void 0:h.trace);if(!r)return;const c=Object.values(ge(r.unitExecutions)??{}).filter(m=>!!m&&typeof m=="object"),o=sg(c,s);if(o!=null)return o;const f=Object.values(ge(r.modelInvocations)??{}).filter(m=>!!m&&typeof m=="object");return sg(f,s)}function TN(l,s){var f;const r=(f=ge(l))==null?void 0:f.runLog;if(!Array.isArray(r))return;let c=0,o=!1;for(const h of r){const m=ge(h);if(!m||m.nodeId!==s)continue;const p=ge(m.data),g=gf(m,p,ge(p==null?void 0:p.usage),ge(p==null?void 0:p.timing));g!=null&&(c+=g,o=!0)}return o?c:void 0}function RN(l,s){var r,c;return l.costUsd??((r=l.metrics)==null?void 0:r.costUsd)??EN(s,l.nodeId)??gf(l.summary,l.metrics,(c=ge(l.summary))==null?void 0:c.usage)??(s!=null?TN(s,l.nodeId):void 0)}function AN(...l){for(const s of l){if(!s)continue;const r=ge(s.usage)??ge(s.tokenUsage)??ge(s.tokens),c=Xe(s.promptTokens)??Xe(s.prompt_tokens)??Xe(r==null?void 0:r.prompt_tokens)??Xe(r==null?void 0:r.promptTokens)??Xe(r==null?void 0:r.input_tokens)??Xe(r==null?void 0:r.inputTokens),o=Xe(s.completionTokens)??Xe(s.completion_tokens)??Xe(r==null?void 0:r.completion_tokens)??Xe(r==null?void 0:r.completionTokens)??Xe(r==null?void 0:r.output_tokens)??Xe(r==null?void 0:r.outputTokens),f=Xe(s.totalTokens)??Xe(s.total_tokens)??Xe(r==null?void 0:r.total_tokens)??Xe(r==null?void 0:r.totalTokens);if(c!=null||o!=null||f!=null)return{...c!=null?{prompt:c}:{},...o!=null?{completion:o}:{},...f!=null?{total:f}:{}}}}function Ev(l,s){const r=l.summary,c=l.metrics,o=l.inputBytes??(c==null?void 0:c.inputBytes),f=l.outputBytes??(c==null?void 0:c.outputBytes),h=(c==null?void 0:c.tokens)??AN(r),m=RN(l,s);return{...o!=null?{inputBytes:o}:{},...f!=null?{outputBytes:f}:{},...h?{tokens:h}:{},...m!=null?{costUsd:m}:{}}}const Tv={webScope:"Web search",synthesis:"Pre-synthesis",inputSynthesis:"Input synthesis",audit:"Post audit",polish:"Post polish",planner:"Planner",optimizer:"Optimizer"},Cd={"synthesized-context":"Pre-synthesis",webScope:"Web search",audit:"Post audit",polish:"Post polish"};function ig(l,s){if(s){const r=Tv[s];if(r)return r}switch(l){case"externalPreUtility":return s?`Pre (${s})`:"Pre-action";case"pipelinePhase":return s?`Pipeline (${s})`:"Pipeline phase";case"mainSkill":return"Main skill";case"externalPostUtility":return s?`Post (${s})`:"Post-action";case"narrativePreprocessor":return"Narrix preprocess";case"narrativeHandler":return"Narrix handler";case"mapping":return"Write-back mapping";case"localSkill":return"Local skill";case"finalizer":return"Finalizer";case"validation":return"Validation";default:return l??"Step"}}function rg(l){if(typeof l=="string")return Cd[l]??l;const s=ge(l);if(!s)return"Step";const r=typeof s.type=="string"?s.type:void 0,c=typeof s.phase=="string"?s.phase:void 0;return r&&Cd[r]?Cd[r]:c&&r?`${c}: ${r}`:r||"Step"}function wN(l){const s=ge(l.usage);if(!s)return;const r=Xe(s.inputTokens),c=Xe(s.outputTokens),o=Xe(s.totalTokens);if(!(r==null&&c==null&&o==null))return{...r!=null?{prompt:r}:{},...c!=null?{completion:c}:{},...o!=null?{total:o}:{}}}function ON(l){var c,o,f,h,m,p;const s=((c=ge(l.input))==null?void 0:c.preview)??((f=ge((o=ge(l.input))==null?void 0:o.valueRef))==null?void 0:f.preview),r=((h=ge(l.output))==null?void 0:h.preview)??((p=ge((m=ge(l.output))==null?void 0:m.valueRef))==null?void 0:p.preview);return{inputBytes:Lc(s),outputBytes:Lc(r)}}function MN(l,s){var m;const r=ge(l),c=ge(r==null?void 0:r.trace);if(!c)return[];const o=ge(c.unitExecutions);if(o)return Object.values(o).filter(p=>!p||typeof p!="object"?!1:String(p.nodeId??"")===s);const f=ge((m=ge(c.nodeExecutions))==null?void 0:m[s]),h=ge(f==null?void 0:f.units);return h?Object.values(h).filter(p=>!!p&&typeof p=="object"):[]}function zN(l){const s=[];for(const r of l){const c=typeof r.unitKind=="string"?r.unitKind:void 0;if(c==="mapping")continue;const o=typeof r.strategyKey=="string"?r.strategyKey:typeof r.actionKey=="string"?r.actionKey:void 0,f=Xe(r.durationMs),h=typeof r.status=="string"?r.status:void 0,m=h==="pending"||h==="queued"||h==="created",p=ON(r),g=wN(r),x=Cv(r),v=f!=null||p.inputBytes!=null||p.outputBytes!=null||g!=null||x!=null;if(m&&!v){s.push({stepKey:String(r.unitId??`${c??"unit"}:${s.length}`),label:ig(c,o),planned:!0});continue}s.push({stepKey:String(r.unitId??`${c??"unit"}:${s.length}`),label:ig(c,o),...f!=null?{durationMs:f}:{},...p.inputBytes!=null?{inputBytes:p.inputBytes}:{},...p.outputBytes!=null?{outputBytes:p.outputBytes}:{},...g?{tokens:g}:{},...x!=null?{costUsd:x}:{},...h!=null?{ok:h==="completed"}:{}})}return s.sort((r,c)=>{const o=f=>f.includes("pre")||f.includes("web")||f.includes("narrix")?0:f.includes("main")||f.includes("skill")?1:f.includes("post")||f.includes("audit")||f.includes("polish")?2:3;return o(r.stepKey)-o(c.stepKey)||r.label.localeCompare(c.label)})}function DN(l){var o,f;const s=(o=l.metrics)==null?void 0:o.effectiveExecutionPipeline,r=(f=l.summary)==null?void 0:f.effectiveExecutionPipeline,c=Array.isArray(s)?s:Array.isArray(r)?r:[];return c.length===0?[]:c.map((h,m)=>({stepKey:`pipeline:${m}:${rg(h)}`,label:rg(h),planned:!0}))}function kN(l){if(!l)return[];const s=[],r=ge(l.postSteps);if(r)for(const[c,o]of Object.entries(r)){const f=ge(o);if(!f)continue;const h=Xe(f.durationMs);s.push({stepKey:`post:${c}`,label:Tv[c]??`Post ${c}`,...h!=null?{durationMs:h}:{},ok:f.error==null})}return s}function qN(l,s){const r=new Map,c=f=>{const h=r.get(f.stepKey);if(!h){r.set(f.stepKey,f);return}h.planned&&!f.planned&&r.set(f.stepKey,{...f,label:h.label})};for(const f of zN(MN(s,l.nodeId)))c(f);for(const f of kN(l.summary))c(f);if(![...r.values()].some(f=>f.durationMs!=null&&!f.planned))for(const f of DN(l))c(f);return[...r.values()].sort((f,h)=>{const m=p=>p.label.includes("Web")||p.label.includes("Pre")||p.label.includes("Narrix")?0:p.label.includes("Main")?1:p.label.includes("Post")||p.label.includes("Audit")||p.label.includes("Polish")?2:3;return m(f)-m(h)||f.label.localeCompare(h.label)})}function Rv(l,s){const r=Ev(l,s),c=qN(l,s);return{...l,...r.inputBytes!=null?{inputBytes:r.inputBytes}:{},...r.outputBytes!=null?{outputBytes:r.outputBytes}:{},...r.tokens?{metrics:{...l.metrics,tokens:r.tokens}}:{},...r.costUsd!=null?{costUsd:r.costUsd}:{},...c.length>0?{subSteps:c}:{}}}function Av(l){const s=ge(l),r=ge(s==null?void 0:s.analysis);return!r||typeof r.jobId!="string"||typeof r.graphId!="string"||typeof r.startedAt!="number"||typeof r.endedAt!="number"||!Array.isArray(r.nodes)?null:r}function _N(l,s){return!Array.isArray(l.nodes)||l.nodes.length===0?[]:[...l.nodes].sort(yf).map(r=>Rv(r,s))}function wv(l){const s=ge(l);if(!s)return{};const r=ge(s.execution)??s,c=ge(r._trace),o=ge(c==null?void 0:c.nodes);if(!o)return{};const f={};for(const[h,m]of Object.entries(o)){const p=ge(m);if(!p)continue;const g=p.startedAt,x=p.endedAt;if(typeof g!="number"||typeof x!="number")continue;const v=Array.isArray(p.attempts)?p.attempts.filter(N=>!!N&&typeof N=="object").map(N=>({index:typeof N.index=="number"?N.index:0,ok:N.ok!==!1,durationMs:typeof N.durationMs=="number"?N.durationMs:0})):void 0;f[h]={startedAt:g,endedAt:x,skillKey:typeof p.skillKey=="string"?p.skillKey:"",ok:p.ok!==!1,durationMs:typeof p.durationMs=="number"&&Number.isFinite(p.durationMs)?p.durationMs:Math.max(0,x-g),...typeof p.activityId=="string"?{activityId:p.activityId}:{},...ge(p.metrics)?{metrics:p.metrics}:{},...ge(p.summary)?{summary:p.summary}:{},...ge(p.error)?{error:{message:String(p.error.message??"failed"),...typeof p.error.code=="string"?{code:p.error.code}:{}}}:{},...v!=null&&v.length?{attempts:v}:{}}}return f}function BN(l){const s=ge(l),r=s==null?void 0:s.runLog;if(!Array.isArray(r))return[];const c=[];for(const o of r){const f=ge(o);if(!f)continue;const h=typeof f.scope=="string"?f.scope:void 0;if(h!=="pipeline"&&h!=="task"&&h!=="narrix"&&h!=="logxer")continue;const m=typeof f.ts=="number"?f.ts:Date.now();c.push({ts:m,scope:h,nodeId:typeof f.nodeId=="string"?f.nodeId:void 0,skillKey:typeof f.skillKey=="string"?f.skillKey:void 0,message:typeof f.message=="string"?f.message:String(f.message??""),..."data"in f?{data:f.data}:{}})}return c.sort((o,f)=>o.ts-f.ts)}function Ov(l){const s=ge(l.runContext),r=l.nodeId??(s==null?void 0:s.nodeId);return typeof r=="string"&&r.length>0?r:void 0}function LN(l){const s=ge(l.outer);return{inputBytes:Lc(s==null?void 0:s.input),outputBytes:Lc(s==null?void 0:s.output)}}function UN(l,s){return l.startedAt<s.endedAt&&s.startedAt<l.endedAt}function QN(l,s,r){return r.filter(c=>c.nodeId!==l&&UN(s,c)).map(c=>c.nodeId).sort()}function wc(l){if(typeof l=="number"&&Number.isFinite(l))return l>1e12?l:l*1e3;if(typeof l=="string"&&l.length>0){const s=Date.parse(l);return Number.isNaN(s)?void 0:s}}function HN(l){const s=String(l.status??"").toLowerCase();return s.includes("fail")||s.includes("error")}function $N(l){var r;const s={};for(const c of l){const o=Ov(c);if(!o)continue;const f=((r=ge(c.outer))==null?void 0:r.metadata)??ge(c.metadata);if(((f==null?void 0:f.kind)??c.kind)==="exellix-graph-run")continue;const m=wc(c.startTime)??wc(c.createdAt);if(m==null)continue;const p=String(c.status??"").toLowerCase(),g=!p.includes("complete")&&!p.includes("done")&&!p.includes("success")&&!p.includes("fail"),x=wc(c.endTime)??wc(c.updatedAt)??(g?Date.now():m),v=typeof c.durationMs=="number"?c.durationMs:Math.max(0,x-m),N=ge(c.runContext),b=typeof c.skillKey=="string"&&c.skillKey||(typeof(N==null?void 0:N.skillKey)=="string"?N.skillKey:"");s[o]={startedAt:m,endedAt:Math.max(m,x),skillKey:b,ok:!HN(c),durationMs:v}}return s}function Mv(l,s,r){var f;const c=r!=null?Av(r):null;if((f=c==null?void 0:c.nodes)!=null&&f.length)return _N(c,r);const o=Object.keys(l).length>0?l:$N(s);return GN(o,s).map(h=>Rv(h,r))}function GN(l,s){const r=new Map;for(const f of s){const h=Ov(f);h&&r.set(h,f)}const c=Object.entries(l).map(([f,h])=>{var x;const m=r.get(f),p=m?LN(m):{},g=h.metrics;return{nodeId:f,skillKey:h.skillKey,startedAt:h.startedAt,endedAt:h.endedAt,durationMs:h.durationMs,ok:h.ok,inputBytes:p.inputBytes??(g==null?void 0:g.inputBytes),outputBytes:p.outputBytes??(g==null?void 0:g.outputBytes),concurrentWith:[],...h.metrics?{metrics:h.metrics}:{},...h.summary?{summary:h.summary}:{},...(x=h.attempts)!=null&&x.length?{attempts:h.attempts,retryAttempts:h.attempts.length}:{},...h.error?{error:h.error}:{}}}),o=c.map(f=>({nodeId:f.nodeId,startedAt:f.startedAt,endedAt:f.endedAt}));return c.map(f=>({...f,concurrentWith:QN(f.nodeId,f,o)})).sort(yf)}function Xc(l){if(l.length===0)return null;const s=Math.min(...l.map(h=>h.startedAt)),r=Math.max(...l.map(h=>h.endedAt));let c=0;for(const h of l)c+=h.concurrentWith.length;const o=l.map(h=>h.inputBytes).filter(h=>h!=null),f=l.map(h=>h.outputBytes).filter(h=>h!=null);return{nodeCount:l.length,totalDurationMs:Math.max(0,r-s),runStartedAt:s,runEndedAt:r,parallelPairCount:c/2,failedCount:l.filter(h=>!h.ok).length,...o.length?{totalInputBytes:o.reduce((h,m)=>h+m,0)}:{},...f.length?{totalOutputBytes:f.reduce((h,m)=>h+m,0)}:{}}}function zv(l,s){const r=Math.max(1,s.runEndedAt-s.runStartedAt);return l.map(c=>{const o=(c.startedAt-s.runStartedAt)/r*100,f=Math.max(.4,(c.endedAt-c.startedAt)/r*100);return{nodeId:c.nodeId,leftPct:o,widthPct:Math.min(100-o,f),ok:c.ok,concurrent:c.concurrentWith.length>0}})}function KN(l){if(l.length===0)return[];const s=[...l].sort((o,f)=>o.startedAt-f.startedAt||o.nodeId.localeCompare(f.nodeId)),r=new Set,c=[];for(;r.size<s.length;){const o=s.find(g=>!r.has(g.nodeId));if(!o)break;let f=o.endedAt;const h=[o];r.add(o.nodeId);let m=!0;for(;m;){m=!1;for(const g of s)r.has(g.nodeId)||g.startedAt<f&&(h.push(g),r.add(g.nodeId),f=Math.max(f,g.endedAt),m=!0)}const p=Math.min(...h.map(g=>g.startedAt));c.push({waveIndex:c.length,startedAt:p,endedAt:f,durationMs:Math.max(0,f-p),mode:h.length>1?"parallel":"sequential",nodes:h.sort((g,x)=>g.startedAt-x.startedAt||g.nodeId.localeCompare(x.nodeId))})}return c}function IN(l){const s=[...l].sort((o,f)=>o.startedAt-f.startedAt||o.nodeId.localeCompare(f.nodeId)),r=[],c=[];for(const o of s){let f=!1;for(let h=0;h<r.length;h++)if(r[h]<=o.startedAt){c[h].push(o),r[h]=o.endedAt,f=!0;break}f||(r.push(o.endedAt),c.push([o]))}return c.map((o,f)=>({laneIndex:f,nodes:o}))}function YN(l,s){return l.filter(r=>r.nodeId===s)}function XN(l){if(l.concurrentWith.length===0)return"Sequential window (no overlap with other nodes)";const s=l.concurrentWith.length;return`Parallel with ${s} other node${s===1?"":"s"}: ${l.concurrentWith.join(", ")}`}function Pd(l){return l.replace(/^node:/,"")}function FN({rows:l,summary:s}){const r=S.useMemo(()=>IN(l),[l]),c=S.useMemo(()=>zv(l,s),[l,s]),o=new Map(c.map(f=>[f.nodeId,f]));return a.jsxs("div",{className:"pipeline-swimlanes",children:[a.jsxs("div",{className:"pipeline-gantt-axis",children:[a.jsx("span",{children:new Date(s.runStartedAt).toLocaleTimeString(void 0,{hour12:!1})}),a.jsxs("span",{children:[r.length," lane",r.length===1?"":"s"," · max ",r.length," concurrent"]}),a.jsx("span",{children:new Date(s.runEndedAt).toLocaleTimeString(void 0,{hour12:!1})})]}),r.map(f=>a.jsxs("div",{className:"pipeline-swimlane-row",children:[a.jsxs("div",{className:"pipeline-swimlane-label",children:["Lane ",f.laneIndex+1]}),a.jsx("div",{className:"pipeline-gantt-track pipeline-swimlane-track",children:f.nodes.map(h=>{const m=o.get(h.nodeId);return m?a.jsxs("div",{className:`pipeline-swimlane-node${m.ok?"":" failed"}${m.concurrent?" concurrent":""}`,style:{left:`${m.leftPct}%`,width:`${m.widthPct}%`},title:`${h.nodeId} · ${h.skillKey} · ${Ve(h.durationMs)}`,children:[a.jsx("span",{className:"pipeline-swimlane-node-id",children:Pd(h.nodeId)}),a.jsx("span",{className:"pipeline-swimlane-node-dur",children:Ve(h.durationMs)})]},h.nodeId):null})})]},f.laneIndex)),a.jsx("p",{className:"pipeline-gantt-legend text-dim",children:"Each lane is one concurrent execution track. Nodes on different lanes at the same horizontal position ran in parallel."})]})}function PN({rows:l}){const s=S.useMemo(()=>KN(l),[l]);return a.jsx("div",{className:"pipeline-flow",children:s.map((r,c)=>a.jsxs("div",{className:"pipeline-flow-wave",children:[c>0&&a.jsxs("div",{className:"pipeline-flow-connector","aria-hidden":!0,children:[a.jsx("span",{className:"pipeline-flow-arrow",children:"↓"}),a.jsx("span",{className:"pipeline-flow-connector-label text-dim",children:"then"})]}),a.jsxs("div",{className:`pipeline-flow-wave-head${r.mode==="parallel"?" parallel":" sequential"}`,children:[a.jsx("span",{className:"pipeline-flow-wave-badge",children:r.mode==="parallel"?"Parallel batch":"Sequential step"}),a.jsxs("span",{className:"text-dim",style:{fontSize:12},children:[r.nodes.length," node",r.nodes.length===1?"":"s"," ·"," ",Ve(r.durationMs)," wall"]})]}),a.jsx("div",{className:`pipeline-flow-nodes${r.nodes.length>1?" is-parallel":""}`,children:r.nodes.map(o=>a.jsxs("div",{className:`pipeline-flow-node${o.ok?"":" failed"}${o.concurrentWith.length>0?" concurrent":""}`,children:[a.jsx("div",{className:"pipeline-flow-node-id mono",children:Pd(o.nodeId)}),a.jsx("div",{className:"pipeline-flow-node-skill text-dim",children:o.skillKey||"—"}),a.jsx("div",{className:"pipeline-flow-node-dur",children:Ve(o.durationMs)}),o.concurrentWith.length>0&&a.jsxs("div",{className:"pipeline-flow-node-peers text-dim",children:["overlaps ",o.concurrentWith.map(Pd).join(", ")]}),!o.ok&&o.error&&a.jsx("div",{className:"pipeline-flow-node-error",children:o.error.message})]},o.nodeId))})]},r.waveIndex))})}function Dv({rows:l,title:s="Execution diagram"}){const[r,c]=S.useState("flow"),o=S.useMemo(()=>Xc(l),[l]);return!o||l.length===0?null:a.jsxs("div",{className:"pipeline-diagram",children:[a.jsxs("div",{className:"pipeline-diagram-head",children:[a.jsx("div",{className:"section-title",style:{fontSize:13,margin:0},children:s}),a.jsxs("div",{className:"pipeline-diagram-tabs",children:[a.jsx("button",{type:"button",className:r==="flow"?"active":"",onClick:()=>c("flow"),children:"Flow (waves)"}),a.jsx("button",{type:"button",className:r==="swimlanes"?"active":"",onClick:()=>c("swimlanes"),children:"Swimlanes"})]})]}),r==="flow"?a.jsx(PN,{rows:l}):a.jsx(FN,{rows:l,summary:o})]})}function VN(l){return l.replace(/^node:/,"")}function ZN(l,s){for(const r of l){const c=r.runContext;if((r.nodeId??(c==null?void 0:c.nodeId))===s)return r}}function JN({row:l,runLogRows:s,activities:r}){var h,m,p,g;const c=YN(s,l.nodeId),o=ZN(r,l.nodeId),f=o==null?void 0:o.outer;return a.jsxs("div",{className:"pipeline-node-detail",children:[a.jsxs("div",{className:"pipeline-node-detail-grid",children:[a.jsxs("div",{children:[a.jsx("span",{className:"detail-key",children:"Execution"}),a.jsx("span",{className:"detail-val",style:{fontSize:12},children:XN(l)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"detail-key",children:"Started"}),a.jsx("span",{className:"detail-val mono",style:{fontSize:11},children:new Date(l.startedAt).toLocaleTimeString(void 0,{hour12:!1,fractionalSecondDigits:3})})]}),a.jsxs("div",{children:[a.jsx("span",{className:"detail-key",children:"Ended"}),a.jsx("span",{className:"detail-val mono",style:{fontSize:11},children:new Date(l.endedAt).toLocaleTimeString(void 0,{hour12:!1,fractionalSecondDigits:3})})]}),a.jsxs("div",{children:[a.jsx("span",{className:"detail-key",children:"Payload"}),a.jsxs("span",{className:"detail-val text-dim",style:{fontSize:12},children:[Sn(l.inputBytes)," in · ",Sn(l.outputBytes)," out",((m=(h=l.metrics)==null?void 0:h.tokens)==null?void 0:m.total)!=null&&` · ${l.metrics.tokens.total} tokens`]})]}),((p=l.metrics)==null?void 0:p.model)&&a.jsxs("div",{children:[a.jsx("span",{className:"detail-key",children:"Model"}),a.jsx("span",{className:"detail-val mono",style:{fontSize:11},children:l.metrics.model})]})]}),l.attempts&&l.attempts.length>0&&a.jsxs("div",{style:{marginTop:10},children:[a.jsx("div",{className:"pipeline-node-detail-subtitle",children:"Engine retries"}),a.jsx("div",{className:"pipeline-attempts",children:l.attempts.map(x=>a.jsxs("span",{className:`pipeline-attempt-chip${x.ok?"":" failed"}`,children:["#",x.index+1," ",x.ok?"ok":"fail"," · ",Ve(x.durationMs)]},x.index))})]}),c.length>0&&a.jsxs("div",{style:{marginTop:10},children:[a.jsxs("div",{className:"pipeline-node-detail-subtitle",children:["Inside this node (",c.length,")"]}),a.jsx("div",{className:"pipeline-runlog pipeline-node-runlog",children:c.map((x,v)=>a.jsxs("div",{className:"pipeline-runlog-line",children:[a.jsx("span",{className:"mono text-dim",style:{fontSize:11},children:new Date(x.ts).toLocaleTimeString(void 0,{hour12:!1})}),x.scope&&a.jsx("span",{className:"chip",style:{fontSize:10},children:x.scope}),a.jsx("span",{children:x.message})]},`${x.ts}-${v}`))})]}),l.summary&&Object.keys(l.summary).length>0&&a.jsx("div",{style:{marginTop:10},children:a.jsx(Tt,{label:"Trace summary",value:l.summary})}),(f==null?void 0:f.output)!=null&&a.jsx("div",{style:{marginTop:10},children:a.jsx(Tt,{label:"Activix output",value:f.output})}),(o==null?void 0:o.narrixSummary)!=null&&a.jsx("div",{style:{marginTop:10},children:a.jsx(Tt,{label:"Narrix",value:o.narrixSummary})}),l.error&&a.jsx("div",{className:"run-io-warning",style:{marginTop:10,fontSize:12},children:l.error.message}),c.length===0&&!l.summary&&!o&&!((g=l.attempts)!=null&&g.length)&&a.jsxs("p",{className:"text-dim",style:{fontSize:12,margin:"10px 0 0"},children:["No inner pipeline log for this node — only wall timing from ",a.jsx("span",{className:"mono",children:"execution._trace"}),". Per-stage detail (pre-action, synthesis, main skill) needs backend instrumentation."]})]})}function WN({rows:l,runLogRows:s,activities:r}){var f;const[c,o]=S.useState(((f=l[0])==null?void 0:f.nodeId)??null);return a.jsxs("div",{className:"pipeline-node-inspector",children:[a.jsx("div",{className:"section-title",style:{fontSize:13,marginBottom:8},children:"Per-node detail"}),l.map(h=>{const m=c===h.nodeId;return a.jsxs("div",{className:`pipeline-node-inspector-item${m?" open":""}`,children:[a.jsxs("button",{type:"button",className:"pipeline-node-inspector-head",onClick:()=>o(m?null:h.nodeId),"aria-expanded":m,children:[a.jsx("span",{className:"pipeline-node-inspector-chevron",children:m?"▾":"▸"}),a.jsx("span",{className:"mono pipeline-node-inspector-id",children:VN(h.nodeId)}),a.jsx("span",{className:"text-dim",style:{fontSize:12},children:h.skillKey}),a.jsx("span",{className:"pipeline-node-inspector-dur",children:Ve(h.durationMs)}),h.concurrentWith.length>0&&a.jsx("span",{className:"chip parallel",style:{fontSize:10},children:"parallel"}),a.jsx("span",{className:"pipeline-node-inspector-status",style:{color:h.ok?"var(--status-done)":"var(--status-failed)"},children:h.ok?"ok":"failed"})]}),m&&a.jsx(JN,{row:h,runLogRows:s,activities:r})]},h.nodeId)})]})}function Fc({graphId:l,entity:s,variant:r="compact"}){const c=l!=null&&l.length>0?`/pipelines/${encodeURIComponent(l)}`:"/pipelines",o=s!=null&&s.length>0?`/pipelines/entity/${encodeURIComponent(s)}`:"/pipelines?view=entity";return r==="compact"?a.jsxs("div",{className:"pipeline-guide pipeline-guide-compact",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Per-run view"})," — Gantt timeline of each graph node: duration, parallel overlap, and Activix payload sizes. ",a.jsx("strong",{children:"Pipeline analytics"})," — averages by pipeline (graph) or by entity type across completed runs."]}),l&&a.jsx("p",{style:{marginTop:8},children:a.jsx(me,{to:c,children:"Open pipeline analytics for this graph →"})})]}):a.jsxs("div",{className:"pipeline-guide",children:[a.jsx("h3",{className:"pipeline-guide-title",children:"How to read pipeline performance"}),a.jsxs("div",{className:"pipeline-guide-grid",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"Wall time"}),a.jsx("p",{className:"text-dim",children:"First node start → last node end for this run. Slower than the sum of node durations when nodes run in parallel waves or the graph waits between waves."})]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Node duration"}),a.jsxs("p",{className:"text-dim",children:["One graph node boundary (local skill or single ai-tasks ",a.jsx("span",{className:"mono",children:"runTask"}),"). Inner steps (web search, pre-synthesis, main skill, post audit) appear as indented sub-rows when execution trace or analysis metadata is on the run."]})]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Parallel overlap"}),a.jsx("p",{className:"text-dim",children:"Highlighted bars overlapped in time with another node — evidence the engine ran them concurrently (same wave). No overlap means sequential execution or incomplete trace."})]}),a.jsxs("div",{children:[a.jsx("strong",{children:"Input / output size"}),a.jsxs("p",{className:"text-dim",children:["Approximate JSON byte size of Activix activity payloads (",a.jsx("span",{className:"mono",children:"outer.input"})," /",a.jsx("span",{className:"mono",children:"outer.output"}),"). Requires Activix; timing works from"," ",a.jsx("span",{className:"mono",children:"execution._trace"})," alone."]})]})]}),a.jsxs("p",{className:"text-dim",style:{fontSize:12,marginTop:12},children:["Navigate: top bar ",a.jsx(me,{to:"/pipelines",children:"Pipeline analytics"})," ","· ",a.jsx(me,{to:"/pipelines?view=entity",children:"by entity"}),l?a.jsxs(a.Fragment,{children:[" ","· ",a.jsx(me,{to:c,children:"this pipeline"})]}):null,s?a.jsxs(a.Fragment,{children:[" ","· ",a.jsx(me,{to:o,children:"this entity"})]}):null," ","· Journal → open a completed run → ",a.jsx("em",{children:"Pipeline performance"})," card below Live Console."]})]})}function e1({status:l,graphId:s,entity:r}){const c=s!=null&&s.length>0?`/pipelines/${encodeURIComponent(s)}`:"/pipelines",o=r!=null&&r.length>0?`/pipelines/entity/${encodeURIComponent(r)}`:"/pipelines?view=entity";return l==="pending"?a.jsx("div",{className:"pipeline-empty",children:a.jsxs("p",{children:["This run is still ",a.jsx("strong",{children:"queued"}),". Performance data appears after you ",a.jsx("strong",{children:"Execute now"})," and nodes finish."]})}):l==="running"?a.jsx("div",{className:"pipeline-empty",children:a.jsxs("p",{children:["Graph is ",a.jsx("strong",{children:"running"}),". Node bars appear here as Activix activities and"," ",a.jsx("span",{className:"mono",children:"execution._trace"})," are written — this page refreshes automatically."]})}):l==="failed"||l==="cancelled"?a.jsx("div",{className:"pipeline-empty",children:a.jsxs("p",{children:["No performance trace on this run. Failed or cancelled runs may not persist"," ",a.jsx("span",{className:"mono",children:"execution._trace"}),". Try a successful run, or open"," ",a.jsx(me,{to:c,children:"pipeline analytics"}),r?a.jsxs(a.Fragment,{children:[" ","or ",a.jsx(me,{to:o,children:"entity analytics"})]}):null,"."]})}):a.jsx("div",{className:"pipeline-empty",children:a.jsxs("p",{children:["No ",a.jsx("span",{className:"mono",children:"execution._trace"})," on this result. Run the graph again via On-Demand or Journal, or view aggregates at ",a.jsx(me,{to:c,children:"pipeline analytics"}),"."]})})}function ca({label:l,value:s}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:l}),a.jsx("span",{className:"detail-val",children:s})]})}function t1({rows:l,runStartedAt:s,runEndedAt:r}){const c=Xc(l);if(!c)return null;const o=zv(l,c),f=new Map(o.map(h=>[h.nodeId,h]));return a.jsxs("div",{className:"pipeline-gantt",children:[a.jsxs("div",{className:"pipeline-gantt-axis",children:[a.jsx("span",{children:new Date(s).toLocaleTimeString(void 0,{hour12:!1})}),a.jsxs("span",{children:[Ve(c.totalDurationMs)," wall"]}),a.jsx("span",{children:new Date(r).toLocaleTimeString(void 0,{hour12:!1})})]}),l.map(h=>{const m=f.get(h.nodeId);return m?a.jsxs("div",{className:"pipeline-gantt-row",children:[a.jsx("div",{className:"pipeline-gantt-label",title:h.skillKey,children:a.jsx("span",{className:"mono",children:h.nodeId})}),a.jsx("div",{className:"pipeline-gantt-track",children:a.jsx("div",{className:`pipeline-gantt-bar${m.ok?"":" failed"}${m.concurrent?" concurrent":""}`,style:{left:`${m.leftPct}%`,width:`${m.widthPct}%`},title:`${h.skillKey} · ${Ve(h.durationMs)}${h.concurrentWith.length?` · parallel with ${h.concurrentWith.join(", ")}`:""}`})}),a.jsx("div",{className:"pipeline-gantt-dur text-dim",children:Ve(h.durationMs)})]},h.nodeId):null}),a.jsxs("p",{className:"pipeline-gantt-legend text-dim",children:[a.jsx("span",{className:"pipeline-gantt-swatch"})," node duration",a.jsx("span",{className:"pipeline-gantt-swatch concurrent"})," overlapped with another node (true parallel window)"]})]})}function n1({rows:l}){const s=l.some(r=>{var c;return(((c=r.subSteps)==null?void 0:c.length)??0)>0});return a.jsx("div",{className:"table-wrap",style:{marginTop:12},children:a.jsxs("table",{className:"data-table pipeline-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:s?"Node / step":"Node"}),a.jsx("th",{children:"Skill"}),a.jsx("th",{children:"Duration"}),a.jsx("th",{children:"Input"}),a.jsx("th",{children:"Output"}),a.jsx("th",{children:"Tokens"}),a.jsx("th",{children:"Cost"}),a.jsx("th",{children:"Parallel"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:l.flatMap(r=>{var o;const c=[a.jsxs("tr",{children:[a.jsx("td",{className:"mono",children:r.nodeId}),a.jsx("td",{className:"mono text-dim",style:{fontSize:12},children:r.skillKey||"—"}),a.jsx("td",{children:Ve(r.durationMs)}),a.jsx("td",{className:"text-dim",children:Sn(r.inputBytes)}),a.jsx("td",{className:"text-dim",children:Sn(r.outputBytes)}),a.jsx("td",{className:"text-dim",style:{fontSize:11},children:Yi((o=r.metrics)==null?void 0:o.tokens)}),a.jsx("td",{className:"text-dim",children:Uc(r.costUsd)}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:r.concurrentWith.length>0?r.concurrentWith.join(", "):"—"}),a.jsxs("td",{children:[a.jsx("span",{style:{color:r.ok?"var(--status-done)":"var(--status-failed)"},children:r.ok?"ok":"failed"}),r.retryAttempts!=null&&r.retryAttempts>1&&a.jsxs("span",{className:"text-dim",style:{marginLeft:6,fontSize:11},children:["(",r.retryAttempts," attempts)"]})]})]},r.nodeId)];for(const f of r.subSteps??[])c.push(a.jsxs("tr",{className:"pipeline-substep-row",children:[a.jsxs("td",{className:"mono pipeline-substep-label",children:[a.jsx("span",{className:"pipeline-substep-marker",children:"↳"}),f.label,f.planned&&a.jsx("span",{className:"chip text-dim",style:{marginLeft:6,fontSize:10},children:"planned"})]}),a.jsx("td",{className:"text-dim",children:"—"}),a.jsx("td",{children:f.durationMs!=null?Ve(f.durationMs):"—"}),a.jsx("td",{className:"text-dim",children:Sn(f.inputBytes)}),a.jsx("td",{className:"text-dim",children:Sn(f.outputBytes)}),a.jsx("td",{className:"text-dim",style:{fontSize:11},children:Yi(f.tokens)}),a.jsx("td",{className:"text-dim",children:Uc(f.costUsd)}),a.jsx("td",{className:"text-dim",children:"—"}),a.jsx("td",{className:"text-dim",children:"—"})]},`${r.nodeId}:${f.stepKey}`));return c})})]})})}function a1(l,s,r){if(!l)return"No trace yet";const c=[`${l.nodeCount} node${l.nodeCount===1?"":"s"}`,Ve(l.totalDurationMs)];return l.parallelPairCount>0&&c.push(`${l.parallelPairCount} parallel pair${l.parallelPairCount===1?"":"s"}`),l.failedCount>0&&c.push(`${l.failedCount} failed`),r||c.push("sizes from trace only"),s&&c.push("pipeline log"),c.join(" · ")}function kv({runId:l,status:s,result:r,live:c,graphId:o,entity:f}){var D,F,$;const h=ve({queryKey:["run-activities",l],queryFn:()=>ne.runActivities(l),refetchInterval:c?1200:!1}),m=S.useMemo(()=>wv(r),[r]),p=S.useMemo(()=>BN(r),[r]),g=((D=h.data)==null?void 0:D.activities)??[],x=S.useMemo(()=>Mv(m,g,r),[m,g,r]),v=S.useMemo(()=>Av(r),[r]),N=S.useMemo(()=>Xc(x),[x]),b=x.length>0||p.length>0,C=s==="running"||s==="pending",A=((F=h.data)==null?void 0:F.available)!==!1,z=a1(N,p.length>0,A);return a.jsxs(bn,{id:"pipeline-performance",title:"Pipeline performance",summary:b?z:C?"Waiting for trace…":"No trace on this run",defaultOpen:b||C,style:{marginBottom:16},children:[a.jsx(Fc,{graphId:o,entity:f,variant:"compact"}),!b&&!h.isLoading&&a.jsx(e1,{status:s,graphId:o,entity:f}),(h.isLoading||C&&x.length===0)&&b===!1&&a.jsxs("div",{className:"loading-row",style:{padding:"8px 0"},children:[a.jsx("span",{className:"spinner"}),C?"Waiting for node trace…":"Loading activity payloads…"]}),!A&&x.length>0&&a.jsx("div",{className:"run-io-warning",style:{marginBottom:12},children:"Activix is unavailable — timing comes from the run result; input/output sizes need activity records."}),N&&a.jsxs("div",{className:"pipeline-stats",children:[v&&a.jsxs(a.Fragment,{children:[a.jsx(ca,{label:"Job run",value:a.jsx("span",{className:"mono",style:{fontSize:11},children:v.jobId})}),a.jsx(ca,{label:"Graph",value:a.jsx("span",{className:"mono",style:{fontSize:11},children:v.graphId})}),a.jsx(ca,{label:"Run window",value:a.jsxs("span",{className:"mono",style:{fontSize:11},children:[new Date(v.startedAt).toLocaleString()," → ",new Date(v.endedAt).toLocaleString()]})}),v.planHash&&a.jsx(ca,{label:"Plan hash",value:a.jsx("span",{className:"mono",style:{fontSize:11},children:v.planHash})}),(($=v.totals)==null?void 0:$.totalTokens)!=null&&a.jsx(ca,{label:"Tokens (sum)",value:`${v.totals.promptTokens??"—"} prompt · ${v.totals.completionTokens??"—"} completion · ${v.totals.totalTokens} total`})]}),a.jsx(ca,{label:"Wall time",value:Ve(N.totalDurationMs)}),a.jsx(ca,{label:"Nodes",value:N.nodeCount}),a.jsx(ca,{label:"Parallel overlap",value:N.parallelPairCount>0?`${N.parallelPairCount} pair${N.parallelPairCount===1?"":"s"} (intervals overlapped)`:"None detected — nodes ran sequentially or traces are incomplete"}),(N.totalInputBytes!=null||N.totalOutputBytes!=null)&&a.jsx(ca,{label:"Activix payloads (sum)",value:`${Sn(N.totalInputBytes)} in · ${Sn(N.totalOutputBytes)} out`})]}),N&&x.length>0&&a.jsx(Dv,{rows:x,title:"Execution diagram"}),N&&x.length>0&&a.jsx(t1,{rows:x,runStartedAt:N.runStartedAt,runEndedAt:N.runEndedAt}),x.length>0&&a.jsx(n1,{rows:x}),x.length>0&&a.jsx(WN,{rows:x,runLogRows:p,activities:g}),x.some(U=>U.summary&&Object.keys(U.summary).length>0)&&a.jsxs("div",{style:{marginTop:16},children:[a.jsx("div",{className:"section-title",style:{fontSize:13,marginBottom:8},children:"Per-node metadata"}),x.filter(U=>U.summary&&Object.keys(U.summary).length>0).map(U=>a.jsx(Tt,{label:`${U.nodeId} summary`,value:U.summary},U.nodeId))]}),p.length>0&&a.jsxs("div",{style:{marginTop:16},children:[a.jsxs("div",{className:"section-title",style:{fontSize:13,marginBottom:8},children:["Pipeline / task log (",p.length,")"]}),a.jsx("div",{className:"pipeline-runlog",children:p.map((U,Z)=>a.jsxs("div",{className:"pipeline-runlog-line",children:[a.jsx("span",{className:"mono text-dim",style:{fontSize:11},children:new Date(U.ts).toLocaleTimeString(void 0,{hour12:!1})}),U.scope&&a.jsx("span",{className:"chip",style:{fontSize:10},children:U.scope}),U.nodeId&&a.jsx("span",{className:"mono",style:{fontSize:11},children:U.nodeId}),a.jsx("span",{children:U.message})]},`${U.ts}-${Z}`))})]}),!b&&C&&!h.isLoading&&a.jsx("p",{className:"text-muted",style:{fontSize:13,marginTop:8},children:"Trace appears after nodes complete. Refresh is automatic while the run is live."})]})}function Rs(l){return l&&typeof l=="object"&&!Array.isArray(l)?l:void 0}function cg(l){if(!l)return{payload:void 0,memorixRef:void 0};const{_memorixRef:s,...r}=l;return{payload:Object.keys(r).length>0?r:void 0,memorixRef:s}}function l1(l){try{return JSON.stringify(l)}catch{return""}}function Oc(l){if(!l)return!1;const s=Object.keys(l);return s.length===1&&s[0]==="recordId"}function ug(l){const s=Rs(l);return!!(s&&typeof s.objectType=="string"&&Array.isArray(s.contentTypes))}function s1(l){const s=Rs(l);if(!s)return{};const r=Rs(s.outer),c=Rs(r==null?void 0:r.output);return{runtimeInput:r==null?void 0:r.input,runtimeOutput:(c==null?void 0:c.response)??(c&&!c.data?c:void 0),runtimeData:c==null?void 0:c.data,status:s.status,nodesExecuted:s.nodesExecuted,completedAt:s.completedAt,error:s.error??(c==null?void 0:c.error)}}function i1({runId:l,status:s,input:r,recordId:c,result:o,assemblySelection:f,savedResult:h,processingUpdate:m,live:p}){var X,re,je;const g=ve({queryKey:["run-activities",l],queryFn:()=>ne.runActivities(l),refetchInterval:p?1200:!1}),x=c??String((r==null?void 0:r.recordId)??""),v=ve({queryKey:["assembler-preview",x,l1(f)],queryFn:()=>ne.assemblerPreview({selection:f,recordId:x}),enabled:!!(x&&ug(f)),staleTime:6e4}),N=S.useMemo(()=>{var I;return s1((I=g.data)==null?void 0:I.graphRun)},[(X=g.data)==null?void 0:X.graphRun]),b=cg(r),C=cg(Rs(N.runtimeInput)),A=o??N.runtimeOutput,z=C.payload??(N.runtimeInput!=null&&s!=="pending"?N.runtimeInput:void 0),D=z!=null&&!Oc(Rs(z)),F=D?z:((re=v.data)==null?void 0:re.assembled)??(Oc(b.payload)?void 0:b.payload),$=D?"runtime":(je=v.data)!=null&&je.assembled?"preview":F?"queued":void 0,U=ug(f),Z=A!=null,W=N.runtimeData!=null,V=b.memorixRef!=null||C.memorixRef!=null,G=N.status!=null||N.nodesExecuted!=null||N.error!=null,te=b.payload!=null&&!Oc(b.payload),xe=Oc(b.payload)&&!U&&!D,pe=(m==null?void 0:m.status)==="skipped",se=(m==null?void 0:m.status)==="pending"&&!h&&s!=="failed"&&s!=="running"&&!p,ce=((m==null?void 0:m.status)==="in_progress"||(m==null?void 0:m.status)==="pending"&&(p||s==="running"))&&!h&&s!=="failed",Se=(m==null?void 0:m.status)==="failed";if(!r&&!U&&F==null&&!Z&&!W&&!V&&!G&&!h&&!m&&!g.isLoading&&!v.isLoading)return a.jsxs("div",{className:"card",style:{marginBottom:16},children:[a.jsx("div",{className:"card-title",children:"Request & response"}),a.jsx("span",{className:"text-muted",style:{fontSize:13},children:"No input or output recorded for this run yet."})]});const k=$==="runtime"?"Graph input (recorded at execution)":$==="preview"?"Graph input (resolved from Memorix)":"Graph input";return a.jsxs("div",{className:"card run-io-panel",style:{marginBottom:16},children:[a.jsx("div",{className:"card-title",children:"Request & response"}),a.jsxs("p",{className:"run-io-hint",children:["The graph receives assembled Memorix record data as ",a.jsx("span",{className:"mono",children:"runtime.input"})," ","— not the internal job reference. After execution, the recorded runtime snapshot is shown when available."]}),xe&&a.jsx("div",{className:"run-io-warning",children:"This run has no assembly selection — the graph will receive only the record id unless input is expanded elsewhere."}),v.isError&&!F&&a.jsxs("div",{className:"run-io-warning",children:["Could not resolve Memorix record data for preview: ",String(v.error)]}),v.isLoading&&!F&&U&&a.jsx("div",{className:"run-io-pending",children:"Resolving graph input from Memorix…"}),F!=null&&a.jsx(Tt,{label:k,value:F,defaultOpen:!0}),U&&a.jsx(Tt,{label:"Assembly selection",value:f}),te&&a.jsx(Tt,{label:"Additional queued fields",value:b.payload}),V&&a.jsx(Tt,{label:"Memorix reference",value:C.memorixRef??b.memorixRef}),Z?a.jsx(Tt,{label:"Response",value:A,defaultOpen:!0}):a.jsx("div",{className:"run-io-pending",children:p||s==="running"?"Response will appear when the graph finishes.":s==="failed"?"No response — run failed before producing output.":"No response recorded yet."}),h&&a.jsxs("div",{className:"run-io-writeback",children:[a.jsx("div",{className:"run-io-writeback-title",children:"Saved to Memorix"}),a.jsxs("div",{className:"detail-row",style:{margin:0},children:[a.jsx("span",{className:"detail-key",children:"Collection"}),a.jsx("span",{className:"detail-val mono",style:{fontSize:12},children:h.collection})]}),a.jsxs("div",{className:"detail-row",style:{margin:0},children:[a.jsx("span",{className:"detail-key",children:"Record"}),a.jsx("span",{className:"detail-val",children:a.jsx(me,{to:`/information/${encodeURIComponent(h.recordId)}?entity=${encodeURIComponent(h.entityName)}&collection=${encodeURIComponent(h.contentType)}`,className:"mono",style:{fontSize:12},children:h.recordId})})]}),a.jsx(Tt,{label:"Writeback reference",value:h})]}),pe&&!h&&a.jsx("div",{className:"run-io-pending",children:(m==null?void 0:m.detail)??"Results were not written to Memorix."}),ce&&a.jsx("div",{className:"run-io-pending",children:"Graph is running — result writeback will appear here when persistency is enabled."}),se&&a.jsx("div",{className:"run-io-pending",children:"Result writeback will appear here when the run finishes and persistency is enabled."}),Se&&a.jsx("div",{className:"run-io-warning",children:(m==null?void 0:m.detail)??"Result writeback failed."}),W&&a.jsx(Tt,{label:"Execution diagnostics",value:N.runtimeData}),N.error!=null&&a.jsx(Tt,{label:"Graph error",value:N.error,defaultOpen:!0}),G&&a.jsx(Tt,{label:"Run telemetry",value:{status:N.status,nodesExecuted:N.nodesExecuted,completedAt:N.completedAt}})]})}const r1=["Overview","Console","Pipeline","Input & Output","Details"];function We({label:l,value:s}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:l}),a.jsx("span",{className:"detail-val",children:s})]})}function c1(l){if(l.sourceType==="continuous"&&l.sourceRef)return`/work/${l.sourceRef}`;if(l.sourceType==="on-demand-batch"&&l.sourceRef)return`/on-demand/batch/${l.sourceRef}`}function u1(l){const s=l.queueOptions;return l.status!=="pending"?Rt(l.availableAt):s!=null&&s.admissionHeld?s.slotsAvailable>0?"Waiting for capacity — a slot is available; you can execute now":`Waiting for capacity (${s.admittedCount}/${s.maxConcurrentJobs} slots in use)`:s&&s.slotsAvailable<=0?`Queued (${s.admittedCount}/${s.maxConcurrentJobs} slots in use) — waiting for worker or execute now`:"Queued — ready to execute"}const qv=12e4;function o1(l){return l.status!=="running"?!1:Date.now()-new Date(l.updatedAt).getTime()>qv}function d1(l){const s=l&&typeof l=="object"&&!Array.isArray(l)?l:void 0;return!!(s&&typeof s.objectType=="string"&&Array.isArray(s.contentTypes))}function og(l,s){return l.status==="updated"?"succeeded":l.status==="failed"?"failed":l.status==="in_progress"||l.status==="pending"&&s==="running"?"running":l.status==="skipped"?"skipped":"pending"}function f1(l,s,r){if(l.status==="updated"&&!r)return`This item was marked as processed by "${l.graphId}".`;if(l.status==="updated"&&r)return`Graph output was written to ${r.collection}.`;if(l.status==="failed")return l.detail??"Processing metadata update failed.";if(l.status==="in_progress"||l.status==="pending"&&s==="running")return"Graph is running — Memorix writeback will update when the run completes.";if(l.status==="pending")return"The item will be marked as processed when the run succeeds and results are written.";if(l.status==="skipped")return l.detail??"Processing metadata update was skipped (simulation or graph without persistence)."}function h1(l){return l.status==="running"||l.status==="pending"&&l.attempts>0?"Console":(l.status==="failed","Overview")}function m1(l){var s;return{entity:l.entity,collection:l.collection,recordId:l.recordId,graphId:l.graphId,priority:l.priority,...(s=l.relatedRecords)!=null&&s.length?{relatedRecords:l.relatedRecords}:{},...d1(l.assemblySelection)?{assemblySelection:l.assemblySelection}:{}}}function dg({run:l,pu:s}){return a.jsxs(bn,{title:"Processing result",summary:s?og(s,l.status):"none",defaultOpen:!!s,style:{marginBottom:0,borderColor:(s==null?void 0:s.status)==="updated"?"var(--status-done)":(s==null?void 0:s.status)==="failed"?"var(--status-failed)":void 0},children:[!s&&a.jsx("span",{className:"text-muted",style:{fontSize:13},children:"No processing result recorded."}),s&&a.jsxs(a.Fragment,{children:[a.jsx(We,{label:"Status",value:a.jsx(At,{status:og(s,l.status)})}),a.jsx(We,{label:"Graph",value:s.graphId}),l.savedResult&&a.jsx(We,{label:"Saved to",value:a.jsxs(me,{to:`/information/${encodeURIComponent(l.savedResult.recordId)}?entity=${encodeURIComponent(l.savedResult.entityName)}&collection=${encodeURIComponent(l.savedResult.contentType)}`,className:"mono",style:{fontSize:12},children:[l.savedResult.collection," / ",l.savedResult.recordId]})}),a.jsx("div",{style:{fontSize:13,marginTop:8,color:s.status==="failed"?"var(--status-failed)":"var(--color-text-muted)"},children:f1(s,l.status,l.savedResult)})]})]})}function p1(){var pe;const{id:l}=Ys(),s=En(),r=zn(),[c,o]=S.useState("Overview"),[f,h]=S.useState(!1),m=ve({queryKey:["factory-run",l],queryFn:()=>ne.factoryRun(l),enabled:!!l,refetchInterval:se=>{var ce;return((ce=se.state.data)==null?void 0:ce.status)==="running"?1500:!1}}),p=st({mutationFn:()=>ne.retryRun(l),onSuccess:()=>{r.invalidateQueries({queryKey:["factory-run",l]}),r.invalidateQueries({queryKey:["factory-runs"]})}}),g=st({mutationFn:()=>ne.cancelRun(l),onSuccess:()=>{r.invalidateQueries({queryKey:["factory-run",l]}),r.invalidateQueries({queryKey:["factory-runs"]})}}),x=st({mutationFn:()=>ne.executeRun(l),onSuccess:()=>{r.invalidateQueries({queryKey:["factory-run",l]}),o("Console")}}),v=st({mutationFn:()=>ne.queueRunNext(l),onSuccess:()=>r.invalidateQueries({queryKey:["factory-run",l]})}),N=st({mutationFn:se=>ne.queueSingle(m1(se)),onSuccess:({run:se})=>{r.invalidateQueries({queryKey:["factory-runs"]}),r.invalidateQueries({queryKey:["run-status-counts"]}),s(`/journal/${se.id}`)}}),b=m.data;if(S.useEffect(()=>{!b||f||(o(h1(b)),h(!0))},[b,f]),S.useEffect(()=>{h(!1)},[l]),m.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]});if(m.isError||!b)return a.jsx(Nt,{title:"Journal entry not found",detail:m.error});const C=b.queueOptions,A=b.status==="failed"||b.status==="cancelled",z=b.status==="done"||b.status==="failed"||b.status==="cancelled",D=b.status==="blocked"||b.status==="pending"||b.status==="running",F=b.status==="pending"&&((C==null?void 0:C.canExecuteNow)??!0),$=b.status==="pending"&&((C==null?void 0:C.admissionHeld)||((C==null?void 0:C.slotsAvailable)??1)<=0),U=c1(b),Z=b.processingUpdate,W=x.isPending||b.status==="running",V=o1(b),G=b.status!=="pending"||b.attempts>0,te=r1.filter(se=>se!=="Console"||W||G);function xe(){const se=`Queue a new run for ${b.recordLabel??b.recordId} through ${b.graphName??b.graphId}? This creates a new journal entry.`;window.confirm(se)&&N.mutate(b)}return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/journal",children:"Journal"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),a.jsx("span",{className:"mono",children:b.id})]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",marginBottom:4},children:[a.jsx("h1",{className:"page-title",style:{margin:0},children:b.recordLabel??b.recordId}),a.jsx(At,{status:b.status}),b.status==="pending"&&(C==null?void 0:C.admissionHeld)&&a.jsx("span",{className:"chip",title:"Waiting for admission capacity",children:"capacity held"})]}),a.jsxs("span",{className:"page-subtitle mono",children:[b.entity," ·"," ",a.jsx(me,{to:`/information/${encodeURIComponent(b.recordId)}?entity=${b.entity}`,children:b.recordId})," · ",a.jsx(me,{to:`/pipelines/${encodeURIComponent(b.graphId)}`,children:b.graphName??b.graphId})]})]}),a.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",justifyContent:"flex-end"},children:[z&&a.jsx("button",{className:"primary",disabled:N.isPending,onClick:xe,children:N.isPending?"Queuing…":"Re-run"}),F&&a.jsx("button",{className:z?"":"primary",disabled:x.isPending,onClick:()=>x.mutate(),children:x.isPending?"Executing…":"Execute now"}),$&&a.jsx("button",{disabled:v.isPending,onClick:()=>v.mutate(),children:v.isPending?"Updating…":"Run next when slot available"}),A&&a.jsx("button",{disabled:p.isPending,onClick:()=>p.mutate(),children:p.isPending?"Retrying…":"Retry same entry"}),D&&a.jsx("button",{disabled:g.isPending,onClick:()=>g.mutate(),style:{color:"var(--status-cancelled)"},children:g.isPending?"Cancelling…":"Cancel"})]})]}),a.jsx("div",{className:"tabs",children:te.map(se=>a.jsxs("button",{type:"button",className:`tab${c===se?" active":""}`,onClick:()=>o(se),children:[se,se==="Console"&&W&&a.jsx("span",{className:"live-dot live",style:{marginLeft:8}})]},se))}),c==="Overview"&&a.jsxs(a.Fragment,{children:[V&&a.jsxs("div",{className:"run-io-warning",style:{marginBottom:16},children:["This run has been ",a.jsx("strong",{children:"running"})," for over ",Math.round(qv/6e4)," minutes with no update — the API likely stopped mid-execute. Use ",a.jsx("strong",{children:"Cancel"}),", then ",a.jsx("strong",{children:"Re-run"})," or ",a.jsx("strong",{children:"Retry same entry"})," and ",a.jsx("strong",{children:"Execute now"})," again."]}),b.status==="pending"&&C&&a.jsxs("div",{className:"memorix-panel",style:{marginBottom:16,fontSize:13},children:[C.admissionHeld&&a.jsx("div",{style:{marginBottom:6,color:"var(--status-pending)"},children:"Waiting for capacity — this run is held until a slot opens or you execute it manually."}),C.slotsAvailable>0?`${C.slotsAvailable} execution slot${C.slotsAvailable===1?"":"s"} available (${C.admittedCount}/${C.maxConcurrentJobs} in use).`:`All ${C.maxConcurrentJobs} execution slots are in use.`,$&&" Use “Run next when slot available” to move this job to the front of the waiting queue."]}),a.jsxs("div",{className:"detail-grid",style:{marginBottom:16},children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Summary"}),a.jsx(We,{label:"Status",value:a.jsx(At,{status:b.status})}),a.jsx(We,{label:"Source",value:U?a.jsx(me,{to:U,children:b.sourceName??tl[b.sourceType]}):b.sourceName??tl[b.sourceType]}),a.jsx(We,{label:"Item",value:a.jsx(me,{to:`/information/${encodeURIComponent(b.recordId)}?entity=${b.entity}`,children:b.recordLabel??b.recordId})}),a.jsx(We,{label:"Pipeline",value:b.graphName??b.graphId}),a.jsx(We,{label:"Attempts",value:`${b.attempts} / ${b.maxAttempts}`}),a.jsx(We,{label:"Updated",value:Rt(b.updatedAt)})]}),a.jsx(dg,{run:b,pu:Z})]}),x.isError&&a.jsxs("div",{className:"error-state",style:{marginBottom:16},children:["Execute failed: ",String(x.error)]}),N.isError&&a.jsxs("div",{className:"error-state",style:{marginBottom:16},children:["Re-run failed: ",String(N.error)]}),b.error&&a.jsxs("div",{className:"error-state",style:{marginBottom:16},children:[a.jsxs("div",{style:{color:"var(--status-failed)",fontWeight:600},children:["Error: ",b.error.message]}),b.error.code&&a.jsxs("div",{className:"mono text-muted",style:{fontSize:12,marginTop:4},children:["code: ",b.error.code]})]})]}),c==="Console"&&(W||G?a.jsx(CN,{runId:b.id,live:W}):a.jsx("div",{className:"card",children:a.jsx("span",{className:"text-muted",style:{fontSize:13},children:"No console output yet."})})),c==="Pipeline"&&a.jsx(kv,{runId:b.id,status:b.status,result:b.result,live:W,graphId:b.graphId,entity:b.entity}),c==="Input & Output"&&a.jsx(i1,{runId:b.id,status:b.status,input:b.input,recordId:b.recordId,result:b.result,assemblySelection:b.assemblySelection,savedResult:b.savedResult,processingUpdate:b.processingUpdate,live:W}),c==="Details"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"detail-grid",style:{marginBottom:16},children:[a.jsxs(bn,{title:"Source",summary:tl[b.sourceType],defaultOpen:!0,children:[a.jsx(We,{label:"Source type",value:tl[b.sourceType]}),a.jsx(We,{label:"Source name",value:U?a.jsx(me,{to:U,children:b.sourceName}):b.sourceName??"—"}),a.jsx(We,{label:"Source ref",value:b.sourceRef??"—"})]}),a.jsxs(bn,{title:"Target",summary:`${b.entity} · ${b.recordLabel??b.recordId}`,defaultOpen:!0,children:[a.jsx(We,{label:"Entity",value:`${b.entity} · ${b.collection}`}),a.jsx(We,{label:"Item",value:a.jsx(me,{to:`/information/${encodeURIComponent(b.recordId)}?entity=${b.entity}`,children:b.recordLabel??b.recordId})}),a.jsx(We,{label:"Graph",value:b.graphName??b.graphId}),a.jsx(We,{label:"Context",value:(pe=b.relatedRecords)!=null&&pe.length?b.relatedRecords.join(", "):"—"}),a.jsx(We,{label:"Output collection",value:b.outputCollection??"—"})]}),a.jsxs(bn,{title:"Execution",summary:`${b.attempts} / ${b.maxAttempts} attempts`,defaultOpen:!0,children:[a.jsx(We,{label:"Attempts",value:`${b.attempts} / ${b.maxAttempts}`}),a.jsx(We,{label:"Priority",value:b.priority}),a.jsx(We,{label:"Claimed by",value:b.claimedBy??a.jsx("span",{className:"text-dim",children:"unclaimed"})}),a.jsx(We,{label:"Queue state",value:u1(b)})]}),a.jsxs(bn,{title:"Timestamps",summary:Rt(b.updatedAt),defaultOpen:!0,children:[a.jsx(We,{label:"Created",value:Rt(b.createdAt)}),a.jsx(We,{label:"Updated",value:Rt(b.updatedAt)})]})]}),a.jsx(dg,{run:b,pu:Z})]})]})}function y1(l){const s=new Map,r=new Map(l.nodes.map(o=>[o.id,o]));function c(o,f=new Set){if(s.has(o))return s.get(o);if(f.has(o))return 0;f.add(o);const h=r.get(o);if(!h||!h.dependsOn.length)return s.set(o,0),0;const m=Math.max(...h.dependsOn.map(p=>c(p,f)))+1;return s.set(o,m),m}for(const o of l.nodes)c(o.id);return s}function g1({graph:l}){if(!l.nodes.length)return a.jsx("div",{className:"empty-state",children:"No graph data"});const s=y1(l),r=Math.max(...s.values(),0),c=Array.from({length:r+1},()=>[]);for(const o of l.nodes)c[s.get(o.id)??0].push(o);return a.jsxs("div",{className:"card",style:{marginBottom:20,overflow:"auto"},children:[a.jsx("div",{className:"card-title",children:"Dependency Graph"}),a.jsx("div",{style:{display:"flex",gap:24,padding:"12px 0",minWidth:"max-content"},children:c.map((o,f)=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,minWidth:160},children:[a.jsxs("div",{className:"text-dim",style:{fontSize:11,textAlign:"center"},children:["Layer ",f]}),o.map(h=>a.jsxs(me,{to:`/journal/${h.id}`,style:{display:"block",padding:"10px 12px",background:"var(--color-surface-raised)",border:"1px solid var(--color-border)",borderLeft:`3px solid var(--status-${h.status})`,borderRadius:"var(--radius)",textDecoration:"none"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:8,marginBottom:4},children:[a.jsx("span",{className:"mono",style:{fontSize:12},children:h.graphId}),a.jsx(At,{status:h.status})]}),a.jsx("div",{className:"mono text-dim",style:{fontSize:10},children:h.id})]},h.id))]},f))}),l.edges.length>0&&a.jsxs("div",{className:"text-dim",style:{fontSize:11,marginTop:8},children:[l.edges.length," dependency edge",l.edges.length===1?"":"s"]})]})}function v1({run:l,allRuns:s}){var o;const r=(o=l.input)==null?void 0:o.upstream;if(!r||typeof r!="object"||Array.isArray(r))return null;const c=Object.entries(r);return c.length?a.jsxs("div",{className:"card",style:{marginBottom:16},children:[a.jsx("div",{className:"card-title",children:"Received from Upstream"}),c.map(([f,h])=>{const m=s==null?void 0:s.find(p=>p.graphId===f&&p.status==="done");return a.jsxs("div",{style:{marginBottom:10},children:[a.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",marginBottom:4},children:[a.jsx("span",{className:"mono",style:{fontSize:12},children:f}),m&&a.jsx(me,{to:`/journal/${m.id}`,style:{fontSize:11},children:"view in journal"})]}),a.jsx("pre",{style:{fontSize:11,overflow:"auto",maxHeight:120,padding:8,background:"var(--color-bg)",borderRadius:"var(--radius)"},children:JSON.stringify(h,null,2)})]},f)})]}):null}function x1({run:l,allRuns:s}){var c;if(((c=l.error)==null?void 0:c.code)!=="DEP_FAILED"||!l.dependsOn.length)return null;const r=(s==null?void 0:s.find(o=>l.dependsOn.includes(o.id)&&o.status==="failed"))??(s==null?void 0:s.find(o=>l.dependsOn.includes(o.id)));return a.jsxs("div",{style:{fontSize:12,marginTop:6},children:["Root cause:"," ",r?a.jsxs(me,{to:`/journal/${r.id}`,style:{color:"var(--status-failed)"},children:[r.graphId," (",r.id,")"]}):a.jsx("span",{className:"mono",children:l.dependsOn[0]})]})}function j1(l){return new Date(l).toLocaleString()}function b1({run:l,allRuns:s}){if(l.status!=="blocked"||l.dependsOn.length===0)return null;const r=l.dependsOn.map(f=>s.find(h=>h.id===f)).filter(f=>f!=null),c=r.filter(f=>f.status==="failed"||f.status==="cancelled"),o=r.filter(f=>f.status==="pending"||f.status==="running");return c.length===0&&o.length===0?null:a.jsxs("div",{style:{padding:"10px 14px",background:"var(--status-blocked-bg)",border:"1px solid var(--status-blocked)",borderRadius:"var(--radius)",marginBottom:8,fontSize:13},children:[a.jsx("strong",{style:{color:"var(--status-blocked)"},children:"Blocked"}),c.length>0&&a.jsxs("div",{style:{marginTop:6},children:["Upstream failures:"," ",c.map(f=>a.jsx(me,{to:`/journal/${f.id}`,style:{marginRight:8,color:"var(--status-failed)"},children:f.graphId},f.id))]}),o.length>0&&a.jsxs("div",{style:{marginTop:6},children:["Waiting on:"," ",o.map(f=>a.jsx(me,{to:`/journal/${f.id}`,style:{marginRight:8,color:"var(--status-pending)"},children:f.graphId},f.id))]})]})}function S1(){const{itemId:l}=Ys(),s=ve({queryKey:["item-runs",l],queryFn:()=>ne.itemRuns(l),enabled:!!l}),r=ve({queryKey:["item-graph",l],queryFn:()=>ne.itemGraph(l),enabled:!!l}),c=s.data??[];if(s.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading timeline…"]});if(s.isError)return a.jsxs("div",{className:"error-state",children:["Error: ",String(s.error)]});const o=[...new Set(c.map(f=>f.graphId))];return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/journal",children:"Journal"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),a.jsx(me,{to:`/journal?itemId=${l}`,children:"Item journal"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),a.jsx("span",{className:"mono",children:l})]}),a.jsxs("div",{className:"page-header",children:[a.jsx("h1",{className:"page-title",children:"Run timeline"}),a.jsx("span",{className:"page-subtitle mono",children:l})]}),c.length===0&&a.jsx("div",{className:"empty-state",children:"No job runs found for this item."}),c.length>0&&a.jsxs(a.Fragment,{children:[r.data&&a.jsx(g1,{graph:r.data}),a.jsxs("div",{className:"card",style:{marginBottom:20},children:[a.jsx("div",{className:"card-title",children:"Pipeline status"}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10,marginTop:8},children:o.map(f=>{const h=c.filter(p=>p.graphId===f),m=h[h.length-1];return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 12px",background:"var(--color-surface-raised)",borderRadius:"var(--radius)",border:"1px solid var(--color-border)"},children:[a.jsx("span",{className:"mono",style:{fontSize:12},children:f}),m&&a.jsx(At,{status:m.status}),a.jsxs("span",{className:"text-dim",style:{fontSize:11},children:[h.length,"×"]})]},f)})})]}),a.jsx("div",{className:"timeline",children:c.map(f=>a.jsxs("div",{className:"timeline-item",children:[a.jsx("div",{className:`timeline-dot timeline-dot-${f.status}`}),a.jsxs("div",{className:"card",style:{borderLeft:`3px solid var(--status-${f.status})`},children:[a.jsx(b1,{run:f,allRuns:c}),a.jsx(v1,{run:f,allRuns:c}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[a.jsx(At,{status:f.status}),a.jsx("span",{className:"mono",style:{fontSize:13},children:f.graphId})]}),a.jsx(me,{to:`/journal/${f.id}`,className:"mono text-muted",style:{fontSize:11},children:f.id})]}),a.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px 24px",fontSize:12,color:"var(--color-text-muted)"},children:[a.jsxs("span",{children:["Job: ",a.jsx("span",{className:"mono",children:f.jobDefId})]}),a.jsxs("span",{children:["Attempts: ",a.jsxs("span",{className:"mono",children:[f.attempts,"/",f.maxAttempts]})]}),a.jsxs("span",{children:["Created: ",a.jsx("span",{className:"mono",children:j1(f.createdAt)})]})]}),f.error&&a.jsxs("div",{style:{marginTop:10,padding:"8px 10px",background:"var(--status-failed-bg)",borderRadius:"var(--radius)",fontSize:12,color:"var(--status-failed)"},children:[f.error.message,a.jsx(x1,{run:f,allRuns:c})]}),f.dependsOn.length>0&&a.jsx("div",{style:{marginTop:10},children:a.jsx(Tt,{label:`Depends On (${f.dependsOn.length})`,value:f.dependsOn})})]})]},f.id))})]})]})}function N1(){const l=En(),s=zn(),{agentQueryParam:r,agentId:c}=Cn(),o=ve({queryKey:["work",r??"all"],queryFn:()=>ne.listWork(r)}),f=st({mutationFn:p=>ne.runEvaluation(p),onSuccess:()=>s.invalidateQueries({queryKey:["work"]})}),h=st({mutationFn:({id:p,status:g})=>ne.setWorkStatus(p,g),onSuccess:()=>s.invalidateQueries({queryKey:["work"]})}),m=o.data??[];return a.jsxs("div",{children:[a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"Ongoing Work"}),a.jsx("span",{className:"page-subtitle",children:c?a.jsxs(a.Fragment,{children:["Ongoing work for object types in agent scope ",a.jsx("span",{className:"mono",children:c}),"."]}):"Ongoing work evaluates information on a schedule and queues jobs automatically."})]}),a.jsx(me,{to:"/work/new",children:a.jsx("button",{className:"primary",children:"+ New ongoing work"})})]}),o.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}),o.isError&&a.jsx(Nt,{title:"Failed to load ongoing work",detail:o.error,onRetry:()=>o.refetch()}),m.length===0&&!o.isLoading&&!o.isError&&a.jsx(kt,{title:"No ongoing work yet",message:"Ongoing work evaluates information on a schedule and queues jobs for items that match your narratives and processing rules.",actionLabel:"New ongoing work",actionTo:"/work/new"}),m.length>0&&a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Name"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Entity"}),a.jsx("th",{children:"Narratives"}),a.jsx("th",{children:"Reprocessing"}),a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Re-scan interval"}),a.jsx("th",{children:"Last scanned"}),a.jsx("th",{children:"Jobs created"}),a.jsx("th",{children:"Last result"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:m.map(p=>{var g;return a.jsxs("tr",{onClick:()=>l(`/work/${p.id}`),children:[a.jsx("td",{children:a.jsx("strong",{children:p.name})}),a.jsx("td",{children:a.jsx(At,{status:p.status})}),a.jsx("td",{className:"mono",children:p.entity}),a.jsx("td",{children:a.jsx("span",{className:"chip-row",children:p.narratives.map(x=>a.jsx("span",{className:"chip narrative",children:x},x))})}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:(g=p.processing)!=null&&g.reprocessingMode&&p.processing.reprocessingMode!=="skip"?p.processing.reprocessingMode:"skip (default)"}),a.jsx("td",{className:"mono",style:{fontSize:12},children:p.graphName??p.graphId}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:Zi(p.policy.rescanIntervalMinutes)}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:al(p.lastEvaluatedAt)}),a.jsx("td",{className:"mono",children:p.jobsCreated}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:p.lastResult}),a.jsx("td",{onClick:x=>x.stopPropagation(),children:a.jsxs("div",{style:{display:"flex",gap:6},children:[a.jsx("button",{type:"button",style:{fontSize:12},disabled:f.isPending,onClick:()=>f.mutate(p.id),title:"Run evaluation now",children:"Evaluate"}),a.jsx("button",{type:"button",style:{fontSize:12},disabled:h.isPending,onClick:()=>h.mutate({id:p.id,status:p.status==="active"?"inactive":"active"}),children:p.status==="active"?"Deactivate":"Activate"})]})})]},p.id)})})]})})]})}function vf({steps:l,current:s,isComplete:r,canGoTo:c,onGoTo:o,maxWidth:f}){return a.jsx("div",{className:"wizard-steps",style:f?{maxWidth:f}:void 0,children:l.map((h,m)=>{const p=s===m,g=(r==null?void 0:r(m))??m<s,x=(c==null?void 0:c(m))??m<=s;return a.jsxs("button",{type:"button",className:`wizard-step${p?" is-active":""}${g?" is-done":""}${x?" is-clickable":""}`,onClick:()=>x&&o(m),disabled:!x&&!p,children:[a.jsx("span",{className:"wizard-step-num",children:g&&!p?"✓":m+1}),a.jsxs("span",{className:"wizard-step-label",children:[a.jsx("span",{className:"wizard-step-title",children:h.title}),h.summary&&a.jsx("span",{className:"wizard-step-summary",children:h.summary})]})]},h.id)})})}function gt({onBack:l,backLabel:s="Back",onNext:r,nextLabel:c="Next",nextDisabled:o,children:f}){return a.jsxs("div",{className:"wizard-nav",children:[l?a.jsx("button",{type:"button",onClick:l,children:s}):a.jsx("span",{}),a.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[f,r&&a.jsx("button",{type:"button",className:"primary",disabled:o,onClick:r,children:c})]})]})}function Pc({entity:l,selected:s,onChange:r,requireSelection:c=!0}){const o=ve({queryKey:["narratives",l],queryFn:()=>ne.listNarratives(l),enabled:!!l}),f=o.data??[];function h(v){r(s.includes(v)?s.filter(N=>N!==v):[...s,v])}if(o.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading narratives…"]});if(f.length===0)return a.jsx(kt,{title:"No narratives available",message:c?"No narrative filters defined for this object type. You can continue — all information will be included.":"No narrative filters are available for this object type."});const m=s.length===f.length,p=f.map(v=>v.key);function g(){r(p)}function x(){r([])}return a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10,gap:12,flexWrap:"wrap"},children:[a.jsxs("span",{style:{fontWeight:600,color:"var(--color-text)",fontSize:13},children:[s.length," of ",f.length," selected"]}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsx("button",{type:"button",className:"btn-ghost btn-xs",disabled:m,onClick:g,children:"Select all"}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",disabled:s.length===0,onClick:x,children:"Clear"})]})]}),s.length>0&&a.jsxs("div",{className:"selector-summary",children:[s.map(v=>{const N=f.find(b=>b.key===v);return a.jsx("span",{className:"chip narrative",children:(N==null?void 0:N.label)??v},v)}),a.jsx("span",{style:{color:"var(--color-text-dim)"},children:"·"}),a.jsx("span",{style:{color:"var(--color-text-dim)",fontSize:11},children:"information must match ALL (AND)"})]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:f.map(v=>{const N=s.includes(v.key);return a.jsxs("div",{role:"checkbox","aria-checked":N,tabIndex:0,className:`selector-card${N?" selected":""}`,onClick:()=>h(v.key),onKeyDown:b=>(b.key===" "||b.key==="Enter")&&h(v.key),children:[a.jsx("div",{className:"selector-card-check-indicator"}),a.jsxs("div",{className:"selector-card-body",children:[a.jsxs("div",{className:"selector-card-meta",children:[a.jsx("span",{className:"selector-card-title",children:v.label}),a.jsx("span",{className:"selector-card-id",children:v.key})]}),v.description&&a.jsx("div",{className:"selector-card-desc",children:v.description})]}),v.activeRecords!==void 0&&a.jsxs("div",{className:"selector-card-count",children:[a.jsx("div",{className:"selector-card-count-num",children:v.activeRecords.toLocaleString()}),a.jsx("div",{className:"selector-card-count-label",children:"items"})]})]},v.key)})}),c&&s.length===0&&a.jsx("p",{className:"text-dim",style:{fontSize:12,marginTop:12},children:"Select at least one narrative to continue."}),!c&&s.length===0&&a.jsxs("p",{className:"text-dim",style:{fontSize:12,marginTop:12},children:["Information must match ",a.jsx("strong",{style:{color:"var(--color-text-muted)"},children:"all"})," selected narratives (AND). For OR logic, create another ongoing work or batch."]})]})}const C1={core:"Core",snapshot:"Snapshot",scoped:"Scoped",lens:"Lens",enrichment:"Enrichment","processing-output":"Inferences",unknown:""};function Qc(l){const s=C1[l.role];return s||l.key.charAt(0).toUpperCase()+l.key.slice(1)}function xf({options:l,selected:s,onChange:r}){function c(o){if(s.includes(o)){if(s.length===1)return;r(s.filter(f=>f!==o))}else r([...s,o])}return l.length===0?null:l.length===1?a.jsx("span",{className:"mono",style:{fontSize:13},children:Qc(l[0])}):a.jsx("div",{className:"chip-row",children:l.map(o=>a.jsxs("button",{type:"button",className:`chip selectable${s.includes(o.key)?" selected":""}`,onClick:()=>c(o.key),children:[Qc(o),o.count>0&&a.jsx("span",{style:{opacity:.65,marginLeft:5,fontSize:11},children:o.count.toLocaleString()})]},o.key))})}const _v="jobs-ui-recent-graphs",E1=20;function Bv(){try{const l=localStorage.getItem(_v);if(!l)return[];const s=JSON.parse(l);return Array.isArray(s)?s:[]}catch{return[]}}function T1(l){localStorage.setItem(_v,JSON.stringify(l.slice(0,E1)))}function R1(l){if(!l)return;const s=Date.now(),r=[{graphId:l,usedAt:s},...Bv().filter(c=>c.graphId!==l)];T1(r)}function A1(){return Bv().sort((l,s)=>s.usedAt-l.usedAt).map(l=>l.graphId)}function Hc(l){var s;return(s=l.name)!=null&&s.trim()?l.name.trim():l.graphId.replace(/[-_]+/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function w1(l,s){const r=s.trim().toLowerCase();return r?[l.graphId,l.name,l.description,l.version,...l.entityCompatible].filter(Boolean).join(" ").toLowerCase().includes(r):!0}function fg(l,s){var o,f;if(!s)return 0;const r=s.toLowerCase();let c=0;l.graphId.toLowerCase()===r&&(c+=100),l.graphId.toLowerCase().includes(r)&&(c+=40);for(const h of l.entityCompatible){const m=h.toLowerCase();m===r?c+=80:(m.includes(r)||r.includes(m))&&(c+=30)}return(o=l.name)!=null&&o.toLowerCase().includes(r)&&(c+=20),(f=l.description)!=null&&f.toLowerCase().includes(r)&&(c+=10),c}function O1(l,s,r,c){const o=l.filter(f=>w1(f,c));if(s==="recent"){const f=new Map(o.map(m=>[m.graphId,m])),h=[];for(const m of A1()){const p=f.get(m);p&&h.push(p)}for(const m of o)h.some(p=>p.graphId===m.graphId)||h.push(m);return h}return[...o].sort((f,h)=>{const m=fg(h,r)-fg(f,r);return m!==0?m:Hc(f).localeCompare(Hc(h))})}const M1=52,z1=5;function Vc({entity:l,value:s,onChange:r}){const[c,o]=S.useState("recent"),[f,h]=S.useState(""),m=ve({queryKey:["graphs",l],queryFn:()=>ne.graphsForEntity(l),enabled:!!l}),p=m.data??[],g=S.useMemo(()=>O1(p,c,l,f),[p,c,l,f]);function x(v){R1(v.graphId),r(v.graphId,v)}return m.isLoading?a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading graphs…"]}):m.isError?a.jsx(kt,{title:"Could not load graphs",message:m.error instanceof Error?m.error.message:"The graph list failed to load."}):p.length===0?a.jsx(kt,{title:"No graphs found",message:`No pipelines are available for "${l}". Choose a different object type or add a graph for this type in Graphs Studio.`}):a.jsxs("div",{className:"graph-picker",children:[a.jsxs("div",{className:"graph-picker-toolbar",children:[a.jsxs("div",{className:"chip-row",children:[a.jsx("button",{type:"button",className:`chip selectable${c==="recent"?" selected":""}`,onClick:()=>o("recent"),children:"Recent"}),a.jsx("button",{type:"button",className:`chip selectable${c==="relevant"?" selected":""}`,onClick:()=>o("relevant"),children:"Relevant"})]}),a.jsx("input",{type:"search",className:"graph-picker-search",placeholder:"Search graphs…",value:f,onChange:v=>h(v.target.value)})]}),a.jsx("div",{className:"graph-picker-list",style:{maxHeight:M1*z1},role:"listbox","aria-label":"Graphs",children:g.length===0?a.jsx("div",{className:"graph-picker-empty",children:"No graphs match your search."}):g.map(v=>{const N=s===v.graphId,b=Hc(v);return a.jsxs("button",{type:"button",role:"option","aria-selected":N,className:`graph-picker-row${N?" selected":""}`,onClick:()=>x(v),children:[a.jsxs("div",{className:"graph-picker-row-main",children:[a.jsx("span",{className:"graph-picker-row-title",children:b}),v.version&&a.jsx("span",{className:"chip",style:{fontSize:10},children:v.version})]}),a.jsx("span",{className:"graph-picker-row-id mono",children:v.graphId}),v.description&&a.jsx("span",{className:"graph-picker-row-desc",children:v.description})]},v.graphId)})})]})}function jf({value:l,entities:s,loading:r,error:c,onChange:o,style:f}){if(c){const h=c instanceof Error?c.message:String(c);return a.jsxs("div",{className:"memorix-panel",style:{borderColor:"var(--status-failed)",background:"var(--status-failed-bg)"},children:[a.jsx("div",{className:"memorix-panel-title",style:{color:"var(--status-failed)"},children:"Could not load object types"}),a.jsx("p",{style:{fontSize:13,margin:"4px 0 0"},children:h||"The API is unavailable. Use http://localhost:3099 or start the API before the Vite dev server (5190)."})]})}return a.jsxs("select",{value:l,disabled:r,onChange:h=>o(h.target.value),style:f??{maxWidth:320},children:[a.jsx("option",{value:"",children:r?"Loading object types…":"— select object type —"}),!r&&["entity","event","knowledge"].map(h=>{const m=s.filter(p=>p.target===h);return m.length?a.jsx("optgroup",{label:nN[h],children:m.map(p=>a.jsx("option",{value:p.name,children:p.label},p.name))},h):null})]})}function bf({included:l,excluded:s,includedLabel:r="Matching information"}){const c=s.reduce((o,f)=>o+f.count,0);return a.jsxs("div",{className:"card",style:{padding:14},children:[a.jsxs("div",{style:{display:"flex",gap:24,marginBottom:s.length?12:0},children:[a.jsxs("div",{children:[a.jsx("div",{className:"status-card-count",style:{fontSize:24,color:"var(--status-done)"},children:l.toLocaleString()}),a.jsx("div",{className:"text-muted",style:{fontSize:12},children:r})]}),a.jsxs("div",{children:[a.jsx("div",{className:"status-card-count",style:{fontSize:24,color:c?"var(--status-blocked)":"var(--color-text-dim)"},children:c.toLocaleString()}),a.jsx("div",{className:"text-muted",style:{fontSize:12},children:"Excluded"})]})]}),s.length>0&&a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:s.map(o=>a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,padding:"4px 0",borderTop:"1px solid var(--color-border)"},children:[a.jsx("span",{className:"text-muted",children:aN[o.reason]}),a.jsx("span",{className:"mono",style:{color:"var(--status-blocked)"},children:o.count})]},o.reason))})]})}function Hs({entity:l,collection:s,narratives:r,processing:c,graphId:o}){const f=ve({queryKey:["matching",l,s,r,c,o],queryFn:()=>ne.previewMatching({entity:l,collection:s,narratives:r,processing:c,graphId:o}),enabled:!!l});if(f.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Evaluating matching information…"]});if(!f.data)return null;const{matched:h,total:m,excluded:p,sample:g}=f.data;return a.jsxs("div",{children:[a.jsx(bf,{included:h,excluded:p}),a.jsxs("p",{className:"text-dim",style:{fontSize:12,margin:"10px 0"},children:[h.toLocaleString()," of ",m.toLocaleString()," ",l," items match the current selection."]}),g.length>0&&a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Label"}),a.jsx("th",{children:"Narratives"}),a.jsx("th",{children:"Updated"})]})}),a.jsx("tbody",{children:g.map(x=>a.jsxs("tr",{style:{cursor:"default"},children:[a.jsx("td",{className:"mono",style:{fontSize:12},children:x.id}),a.jsx("td",{children:x.label}),a.jsx("td",{children:a.jsx("span",{className:"chip-row",children:Object.keys(x.narratives).map(v=>a.jsx("span",{className:"chip narrative",children:v},v))})}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:new Date(x.updatedAt).toLocaleString()})]},x.id))})]})})]})}const D1=["ttl","failed-only","condition","all","skip"],k1=["skip","failed-only","before-date","after-date","condition","all"],hg={value:7,unit:"days"};function Sf({context:l="recurring",entity:s,targetGraphId:r,targetJobTypeId:c,hasContextLinks:o=!1,value:f,onChange:h}){const{agentQueryParam:m}=Cn(),p=ve({queryKey:["graphs",s],queryFn:()=>ne.graphsForEntity(s),enabled:!!s}),g=ve({queryKey:["entities",m??"all"],queryFn:()=>ne.listEntities(m)}),x=ve({queryKey:["entity-relations",s],queryFn:()=>ne.entityRelations(s),enabled:!!s}),v=p.data??[],N=v.filter(I=>I.graphId!==r),b=(g.data??[]).filter(I=>I.name!==s),C=x.data??[],A=l==="recurring"?D1:k1,z=l==="recurring"?"ttl":"skip",D=f.reprocessingMode??z,F=f.reprocessingTtl??hg,$=f.requiredGraphs??[],U=f.crossEntityPrerequisites??[];function Z(I){h({...f,excludeInFlight:!0,...I})}function W(I){Z({reprocessingMode:I,reprocessingTtl:I==="ttl"?hg:void 0,reprocessingDate:void 0,reprocessingCondition:void 0})}function V(I){const E=v.find(H=>H.graphId===I);!E||$.some(H=>H.graphId===I)||Z({requiredGraphs:[...$,{graphId:I,graphName:E.name}]})}function G(I){Z({requiredGraphs:$.filter(E=>E.graphId!==I)})}const[te,xe]=S.useState(""),[pe,se]=S.useState(""),[ce,Se]=S.useState(""),k=ve({queryKey:["graphs",te],queryFn:()=>ne.graphsForEntity(te),enabled:!!te}).data??[],X=C.filter(I=>I.sourceEntity===s&&I.targetEntity===te);function re(){if(!te||!ce||!pe)return;const I=X.find(H=>H.relationKey===pe),E=k.find(H=>H.graphId===ce);U.some(H=>H.entity===te&&H.relationshipKey===pe&&H.graphId===ce)||(Z({crossEntityPrerequisites:[...U,{entity:te,relationshipKey:pe,relationshipLabel:I==null?void 0:I.relationKey,graphId:ce,graphName:E==null?void 0:E.name}]}),xe(""),se(""),Se(""))}function je(I){Z({crossEntityPrerequisites:U.filter((E,H)=>H!==I)})}return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[a.jsxs("div",{className:"prereq-section",children:[a.jsxs("div",{className:"prereq-section-header",children:[a.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Reprocessing"}),D!==z&&a.jsx("span",{className:"chip",style:{background:"var(--color-warning-subtle, #2a2000)",borderColor:"var(--color-warning-border, #5a4000)",color:"var(--color-warning, #e6c200)"},children:"custom"})]}),a.jsxs("div",{className:"prereq-section-body",style:{display:"flex",flexDirection:"column",gap:10},children:[a.jsx("select",{value:D,onChange:I=>W(I.target.value),style:{width:"100%"},children:A.map(I=>a.jsx("option",{value:I,children:I==="skip"&&c?`Skip already processed for job type "${c}"`:gv[I]},I))}),D==="skip"&&c&&a.jsxs("p",{style:{fontSize:12,color:"var(--color-text-muted)",margin:0},children:["Eligibility keys off logical job type ",a.jsx("code",{children:c}),", not the graph implementation id."]}),D==="ttl"&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{style:{fontSize:12,color:"var(--color-text-muted)",whiteSpace:"nowrap"},children:"Only if older than"}),a.jsx("input",{type:"number",min:1,value:F.value,onChange:I=>Z({reprocessingTtl:{...F,value:Math.max(1,Number(I.target.value))}}),style:{width:70}}),a.jsxs("select",{value:F.unit,onChange:I=>Z({reprocessingTtl:{...F,unit:I.target.value}}),style:{width:90},children:[a.jsx("option",{value:"hours",children:"hours"}),a.jsx("option",{value:"days",children:"days"}),a.jsx("option",{value:"weeks",children:"weeks"})]})]}),(D==="before-date"||D==="after-date")&&a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{style:{fontSize:12,color:"var(--color-text-muted)",whiteSpace:"nowrap"},children:D==="before-date"?"Before":"After"}),a.jsx("input",{type:"date",value:f.reprocessingDate??"",onChange:I=>Z({reprocessingDate:I.target.value||void 0}),style:{flex:1}})]}),D==="condition"&&a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[a.jsx("textarea",{rows:3,value:f.reprocessingCondition??"",onChange:I=>Z({reprocessingCondition:I.target.value||void 0}),placeholder:'{ "fields.criticality": "high" }',style:{fontFamily:"var(--font-mono)",fontSize:12}}),a.jsx("span",{style:{fontSize:11,color:"var(--color-text-dim)"},children:"Information matching this JSON condition will be re-run even if already processed."})]}),D!=="skip"&&a.jsx("p",{style:{fontSize:11,color:"var(--color-text-dim)",lineHeight:1.5},children:"Information currently queued or running is always excluded to prevent overlapping work."})]})]}),a.jsxs("div",{className:"prereq-section",children:[a.jsxs("div",{className:"prereq-section-header",children:[a.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Required prior processing"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{className:"text-dim",style:{fontSize:12},children:"same entity"}),$.length>0&&a.jsx("span",{className:"chip",style:{background:"var(--color-accent-subtle)",borderColor:"var(--color-accent-border)",color:"var(--color-accent)"},children:$.length})]})]}),a.jsxs("div",{className:"prereq-section-body",children:[a.jsx("p",{style:{fontSize:12,color:"var(--color-text-muted)",marginBottom:12,lineHeight:1.5},children:"This item must have been successfully processed by these graphs before it becomes eligible."}),N.length>0?a.jsxs("select",{value:"",onChange:I=>{I.target.value&&V(I.target.value)},style:{width:"100%",marginBottom:$.length?10:0},children:[a.jsx("option",{value:"",children:"+ Add required graph…"}),N.filter(I=>!$.some(E=>E.graphId===I.graphId)).map(I=>a.jsxs("option",{value:I.graphId,children:[I.name,I.version?` (${I.version})`:""]},I.graphId))]}):a.jsxs("p",{className:"text-dim",style:{fontSize:12,marginBottom:8},children:['No other graphs compatible with "',s,'".']}),$.length>0&&a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:$.map(I=>a.jsxs("span",{className:"prereq-tag",children:[a.jsx("span",{className:"mono",style:{fontSize:12},children:I.graphName??I.graphId}),a.jsx("button",{className:"prereq-tag-remove",onClick:()=>G(I.graphId),title:"Remove",children:"×"})]},I.graphId))})]})]}),o?a.jsxs("div",{className:"prereq-section",children:[a.jsxs("div",{className:"prereq-section-header",children:[a.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Cross-entity prerequisites"}),U.length>0&&a.jsx("span",{className:"chip",style:{background:"var(--color-accent-subtle)",borderColor:"var(--color-accent-border)",color:"var(--color-accent)"},children:U.length})]}),a.jsxs("div",{className:"prereq-section-body",children:[a.jsx("p",{style:{fontSize:12,color:"var(--color-text-muted)",marginBottom:12,lineHeight:1.5},children:"Information from a linked entity must have been processed first — e.g. process child records only after their linked parent records have been enriched."}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr auto",gap:8,alignItems:"center",marginBottom:10},children:[a.jsxs("select",{value:te,onChange:I=>{xe(I.target.value),se(""),Se("")},children:[a.jsx("option",{value:"",children:"Linked entity…"}),b.map(I=>a.jsx("option",{value:I.name,children:I.label},I.name))]}),a.jsxs("select",{value:pe,onChange:I=>se(I.target.value),disabled:!te,children:[a.jsx("option",{value:"",children:"Relationship…"}),X.map(I=>a.jsx("option",{value:I.relationKey,children:I.relationKey},I.relationKey))]}),a.jsxs("select",{value:ce,onChange:I=>Se(I.target.value),disabled:!te,children:[a.jsx("option",{value:"",children:"Processed by…"}),k.map(I=>a.jsx("option",{value:I.graphId,children:I.name},I.graphId))]}),a.jsx("button",{type:"button",className:"btn btn-sm",disabled:!te||!pe||!ce,onClick:re,children:"Add"})]}),U.length>0&&a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:U.map((I,E)=>a.jsxs("span",{className:"prereq-tag",style:{justifyContent:"space-between"},children:[a.jsxs("span",{style:{fontSize:12},children:[a.jsx("span",{className:"mono",children:I.entity}),I.relationshipKey&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-dim",children:" via "}),a.jsx("span",{className:"mono",children:I.relationshipKey})]}),a.jsx("span",{className:"text-dim",children:" → processed by "}),a.jsx("span",{className:"mono",children:I.graphName??I.graphId})]}),a.jsx("button",{className:"prereq-tag-remove",onClick:()=>je(E),title:"Remove",children:"×"})]},E))})]})]}):a.jsxs("div",{className:"prereq-section",children:[a.jsx("div",{className:"prereq-section-header",children:a.jsx("span",{style:{fontSize:13,fontWeight:600},children:"Cross-entity prerequisites"})}),a.jsx("div",{className:"prereq-section-body",children:a.jsx("p",{style:{fontSize:12,color:"var(--color-text-muted)",margin:0,lineHeight:1.5},children:"Configure context links on the selected graph (or on this work definition) before adding cross-entity prerequisites."})})]})]})}const q1={success:{icon:"✓",color:"var(--status-done)",bg:"var(--status-done-bg)",label:"Success"},partial:{icon:"◐",color:"var(--status-blocked)",bg:"var(--status-blocked-bg)",label:"Partially completed"},failed:{icon:"✕",color:"var(--status-failed)",bg:"var(--status-failed-bg)",label:"Failed"},"created-inactive":{icon:"◌",color:"var(--status-pending)",bg:"var(--status-pending-bg)",label:"Created (inactive)"}},_1={good:"var(--status-done)",warn:"var(--status-blocked)",bad:"var(--status-failed)",default:"var(--color-text)"};function Zc({result:l}){const s=q1[l.status];return a.jsxs("div",{className:"card",style:{maxWidth:640,margin:"0 auto",borderColor:s.color},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:4},children:[a.jsx("span",{style:{width:40,height:40,borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:s.bg,color:s.color,fontSize:20,fontWeight:700},children:s.icon}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:17,fontWeight:600},children:l.title}),l.summary&&a.jsx("div",{className:"text-muted",style:{fontSize:13},children:l.summary})]})]}),l.stats&&l.stats.length>0&&a.jsx("div",{className:"review-grid",style:{marginTop:16},children:l.stats.map(r=>a.jsxs("div",{className:"review-row",children:[a.jsx("span",{className:"review-label",children:r.label}),a.jsx("span",{style:{color:_1[r.tone??"default"],fontWeight:r.tone&&r.tone!=="default"?600:400},children:String(r.value)})]},r.label))}),l.errors&&l.errors.length>0&&a.jsxs("div",{className:"error-state",style:{marginTop:16,fontSize:12},children:[a.jsxs("strong",{children:[l.errors.length," issue",l.errors.length===1?"":"s",":"]}),a.jsx("ul",{style:{margin:"6px 0 0 18px"},children:l.errors.map((r,c)=>a.jsx("li",{children:r},c))})]}),l.actions&&l.actions.length>0&&a.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:20,paddingTop:16,borderTop:"1px solid var(--color-border)"},children:l.actions.map(r=>r.to?a.jsx(me,{to:r.to,children:a.jsx("button",{type:"button",className:r.primary?"primary":"",children:r.label})},r.label):a.jsx("button",{type:"button",className:r.primary?"primary":"",children:r.label},r.label))})]})}function Vd({name:l,newRecord:s,onChange:r}){return a.jsxs("div",{className:"writeback-existing",children:[a.jsx("div",{className:"writeback-existing-title",children:"Output row per item"}),a.jsx("p",{className:"hint",style:{marginBottom:10},children:"How results are stored in the output collection for each processed item."}),a.jsxs("div",{className:"writeback-modes",children:[a.jsxs("label",{className:`writeback-mode${s?" selected":""}`,children:[a.jsx("input",{type:"radio",name:l,checked:s,onChange:()=>r(!0)}),a.jsxs("span",{children:[a.jsx("strong",{children:"Add new record"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:"Each successful run appends another row (linked to this item)."})]})]}),a.jsxs("label",{className:`writeback-mode${s?"":" selected"}`,children:[a.jsx("input",{type:"radio",name:l,checked:!s,onChange:()=>r(!1)}),a.jsxs("span",{children:[a.jsx("strong",{children:"Replace existing"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:"One row per item: update it when output already exists, or create it on the first successful run."})]})]})]})]})}const mg={entityId:"same-as-input",contentType:ll,newRecord:!0};function B1(l){if(!l)return"not declared on graph";const s=l.entityId==="same-as-input"?"same as input":l.entityId,r=l.newRecord===!1?"update or create one row per item":"always new record";return`${s} · ${l.contentType} · ${r}`}function Lv({enabled:l,value:s,sourceEntity:r,graphPersistency:c,onEnabledChange:o,onChange:f}){const h=s??mg,m=h.entityId==="same-as-input"?"same-as-input":"custom";function p(g){f({...h,...g})}return a.jsxs("div",{className:"persistency-override",children:[a.jsxs("label",{className:"checkbox-row",style:{display:"flex",gap:8,alignItems:"flex-start",marginBottom:12},children:[a.jsx("input",{type:"checkbox",checked:l,onChange:g=>{const x=g.target.checked;o(x),x&&!s&&f({...mg}),x||f(void 0)}}),a.jsxs("span",{children:[a.jsx("strong",{children:"Override result persistence"}),a.jsxs("span",{className:"hint",style:{display:"block",marginTop:4},children:["Graph default: ",B1(c),l?" — work-level settings below merge over the graph at job completion.":" — enable to specify or override where graph results are written."]})]})]}),l&&a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Target object type"}),a.jsxs("select",{value:m,onChange:g=>{g.target.value==="same-as-input"?p({entityId:"same-as-input"}):p({entityId:r??""})},children:[a.jsxs("option",{value:"same-as-input",children:["Same as input",r?` (${r})`:""]}),a.jsx("option",{value:"custom",children:"Other object type…"})]})]}),m==="custom"&&a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Object type name"}),a.jsx("input",{value:h.entityId==="same-as-input"?"":h.entityId,onChange:g=>p({entityId:g.target.value||"same-as-input"}),placeholder:"e.g. vulnerabilities"})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Content type"}),a.jsx("input",{value:h.contentType,onChange:g=>p({contentType:g.target.value||ll}),placeholder:ll})]}),a.jsx("div",{className:"writeback-existing-grid-span",children:a.jsx(Vd,{name:"persistency-existing-record-mode",newRecord:h.newRecord!==!1,onChange:g=>p({newRecord:g})})})]})]})}const L1=[{id:"basic",title:"Basic info",summary:"Name & entity"},{id:"narratives",title:"Narratives",summary:"Select information"},{id:"prereqs",title:"Prerequisites",summary:"Processing rules"},{id:"graph",title:"Graph",summary:"Pipeline to run"},{id:"policy",title:"Execution policy",summary:"Interval & concurrency"},{id:"review",title:"Review",summary:"Create"},{id:"result",title:"Created",summary:"Result"}],U1=[5,15,30,60,240,1440];function Q1(){var ie;const{agentQueryParam:l}=Cn(),[s,r]=S.useState(0),[c,o]=S.useState(""),[f,h]=S.useState(""),[m,p]=S.useState(""),[g,x]=S.useState(["core"]),[v,N]=S.useState([]),[b,C]=S.useState(""),[A,z]=S.useState(),[D,F]=S.useState([]),[$,U]=S.useState(!1),[Z,W]=S.useState(),[V,G]=S.useState({reprocessingMode:"ttl",reprocessingTtl:{value:7,unit:"days"},excludeInFlight:!0,requiredGraphs:[],crossEntityPrerequisites:[]}),[te,xe]=S.useState({rescanIntervalMinutes:15,priority:100}),[pe,se]=S.useState(null),ce=ve({queryKey:["entities",l??"all"],queryFn:()=>ne.listEntities(l),retry:2}),Se=ce.data??[];S.useEffect(()=>{if(!m||!ce.isSuccess)return;Se.map(O=>O.name).includes(m)||p("")},[ce.isSuccess,Se,m]);const ue=Se.find(L=>L.name===m),k=st({mutationFn:L=>ne.createWork({name:c,description:f,entity:m,collection:g[0]??"core",narratives:v,processing:V,graphId:b,contextLinks:D.length?D:void 0,policy:te,activate:L,...$?{persistency:Z}:{}}),onSuccess:({result:L})=>{se(L),r(6)}}),X=!!(c.trim()&&m),re=!!b,I=!(((ue==null?void 0:ue.narratives.length)??0)>0)||v.length>0;function E(L){if(L<=s)return r(L);L>=1&&!X||L>=2&&!I||L>=4&&!re||r(L)}const H=(()=>{var be,Ae;const L=V.reprocessingMode??"ttl";let O;if(L==="ttl"){const qt=V.reprocessingTtl??{value:7,unit:"days"};O=`re-run if older than ${qt.value} ${qt.unit}`}else O=gv[L].split(" — ")[0];const ae=[O];return(((be=V.requiredGraphs)==null?void 0:be.length)??0)>0&&ae.push(`${V.requiredGraphs.length} prior graph(s) required`),(((Ae=V.crossEntityPrerequisites)==null?void 0:Ae.length)??0)>0&&ae.push(`${V.crossEntityPrerequisites.length} cross-entity prerequisite(s)`),ae.join(" · ")})(),J=g.map(L=>{const O=ue==null?void 0:ue.collections.find(ae=>ae.key===L);return O?Qc(O):L}).join(", ");return a.jsxs("div",{children:[a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"New ongoing work"}),a.jsx("span",{className:"page-subtitle",children:"Ongoing work evaluates matching information on a schedule and queues jobs automatically."})]})}),a.jsx(vf,{steps:L1,current:s,canGoTo:L=>L<=s||L<=5&&X,onGoTo:E,maxWidth:980}),a.jsxs("div",{style:{maxWidth:720},children:[s===0&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"1. Basic info"}),a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Name *"}),a.jsx("input",{value:c,onChange:L=>o(L.target.value),placeholder:"e.g. Process selected records"})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Object type *"}),a.jsx(jf,{value:m,entities:Se,loading:ce.isLoading,error:ce.error,onChange:L=>{var O,ae;p(L),N([]),C(""),z(void 0),x([((ae=(O=Se.find(be=>be.name===L))==null?void 0:O.collections[0])==null?void 0:ae.key)??"core"])}})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Data sources"}),a.jsx(xf,{options:(ue==null?void 0:ue.collections)??[],selected:g,onChange:x}),a.jsx("span",{className:"hint",children:"Select which data sources are passed to the graph as input."})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Description"}),a.jsx("textarea",{value:f,onChange:L=>h(L.target.value),placeholder:"Optional — describe what this ongoing work does",rows:3})]})]}),a.jsx(gt,{onNext:()=>E(1),nextLabel:"Next: narratives",nextDisabled:!X})]}),s===1&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"2. Select information by narratives"}),a.jsx(Pc,{entity:m,selected:v,onChange:N}),m&&a.jsx("div",{style:{marginTop:16},children:a.jsx(Hs,{entity:m,collection:g[0]??"core",narratives:v})}),a.jsx(gt,{onBack:()=>E(0),onNext:()=>E(2),nextLabel:"Next: prerequisites",nextDisabled:!I})]}),s===2&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"3. Processing prerequisites"}),a.jsx("p",{className:"wizard-lead",children:"Control which information is eligible. By default, items processed within the last 7 days are skipped — keeping results fresh without re-running everything on every scan."}),a.jsx(Sf,{context:"recurring",entity:m,targetGraphId:b||void 0,targetJobTypeId:A==null?void 0:A.jobTypeId,hasContextLinks:D.length>0||(((ie=A==null?void 0:A.contextLinks)==null?void 0:ie.length)??0)>0,value:V,onChange:G}),a.jsx(gt,{onBack:()=>E(1),onNext:()=>E(3),nextLabel:"Next: graph"})]}),s===3&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"4. Choose graph / pipeline"}),a.jsxs("p",{className:"wizard-lead",children:['Only graphs compatible with "',m,'" are shown. This graph is also used for reprocessing checks.']}),a.jsx(Vc,{entity:m,value:b,onChange:(L,O)=>{var ae,be,Ae,qt;if(C(L),z(O),(ae=O==null?void 0:O.contextLinks)!=null&&ae.length&&F(O.contextLinks),(Ae=(be=O==null?void 0:O.jobPipeline)==null?void 0:be.reprocessing)!=null&&Ae.mode&&G(rn=>({...rn,reprocessingMode:O.jobPipeline.reprocessing.mode,...O.jobPipeline.reprocessing.ttl?{reprocessingTtl:O.jobPipeline.reprocessing.ttl}:{}})),(qt=O==null?void 0:O.upstream)!=null&&qt.length){const rn=O.upstream.filter(_t=>_t.entity&&_t.relationshipKey).map(_t=>({entity:_t.entity,relationshipKey:_t.relationshipKey,graphId:L,graphName:O.name}));rn.length&&G(_t=>({..._t,crossEntityPrerequisites:rn}))}}}),a.jsx("div",{className:"section-title",style:{marginTop:20},children:"Result persistence"}),a.jsx(Lv,{enabled:$,value:Z,sourceEntity:m,graphPersistency:A==null?void 0:A.persistency,onEnabledChange:U,onChange:W}),a.jsx(gt,{onBack:()=>E(2),onNext:()=>E(4),nextLabel:"Next: execution policy",nextDisabled:!re})]}),s===4&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"5. Execution policy"}),a.jsx("p",{className:"wizard-lead",children:"Running jobs are never interrupted — this policy controls how often new eligible information is discovered. How many jobs run in parallel is configured app-wide in Settings."}),a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Re-scan for new eligible information"}),a.jsx("select",{value:te.rescanIntervalMinutes,onChange:L=>xe({...te,rescanIntervalMinutes:Number(L.target.value)}),children:U1.map(L=>a.jsx("option",{value:L,children:Zi(L)},L))}),a.jsx("span",{className:"hint",children:"Every X minutes, information that has become newly eligible (new or changed data matching your narratives) is discovered and queued. Running jobs are not affected."})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Priority"}),a.jsx("input",{type:"number",value:te.priority,onChange:L=>xe({...te,priority:Number(L.target.value)})}),a.jsx("span",{className:"hint",children:"Higher priority jobs are picked up before lower priority ones when the queue is contested."})]})]}),a.jsx(gt,{onBack:()=>E(3),onNext:()=>E(5),nextLabel:"Next: review"})]}),s===5&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"6. Review & create"}),a.jsxs("div",{className:"review-grid",style:{marginBottom:20},children:[a.jsx(Ga,{label:"Object type",value:m}),a.jsx(Ga,{label:"Data sources",value:J||"—"}),a.jsx(Ga,{label:"Narratives (AND)",value:v.join(", ")||"none"}),a.jsx(Ga,{label:"Prerequisites",value:H}),a.jsx(Ga,{label:"Graph / pipeline",value:(A==null?void 0:A.name)??b}),$&&a.jsx(Ga,{label:"Result persistence",value:`${(Z==null?void 0:Z.entityId)??"same-as-input"} · ${(Z==null?void 0:Z.contentType)??"inferences"}`}),a.jsx(Ga,{label:"Re-scan interval",value:Zi(te.rescanIntervalMinutes)}),a.jsx(Ga,{label:"Priority",value:String(te.priority)})]}),a.jsx("div",{className:"section-title",children:"Estimated matching information"}),a.jsx(Hs,{entity:m,collection:g[0]??"core",narratives:v,processing:V,graphId:b}),k.isError&&a.jsx(Nt,{title:"Failed to create ongoing work",detail:k.error}),a.jsxs(gt,{onBack:()=>E(4),children:[a.jsx("button",{type:"button",disabled:k.isPending,onClick:()=>k.mutate(!1),children:"Create inactive"}),a.jsx("button",{type:"button",className:"primary",disabled:k.isPending,onClick:()=>k.mutate(!0),children:k.isPending?"Creating…":"Create and activate"})]})]}),s===6&&pe&&a.jsx(Zc,{result:pe})]})]})}function Ga({label:l,value:s}){return a.jsxs("div",{className:"review-row",children:[a.jsx("span",{className:"review-label",children:l}),a.jsx("span",{children:s})]})}const H1=[5,15,30,60,240,1440];function $1({work:l,onSaved:s}){var xe,pe,se;const[r,c]=S.useState(l.name),[o,f]=S.useState(l.description??""),[h,m]=S.useState(l.narratives),[p,g]=S.useState(l.graphId),[x,v]=S.useState(l.processing??{reprocessingMode:"ttl",reprocessingTtl:{value:7,unit:"days"},excludeInFlight:!0,requiredGraphs:[],crossEntityPrerequisites:[]}),[N,b]=S.useState(l.policy),[C,A]=S.useState(l.persistency!==void 0),[z,D]=S.useState(l.persistency),[F,$]=S.useState(!1);S.useEffect(()=>{c(l.name),f(l.description??""),m(l.narratives),g(l.graphId),v(l.processing??{reprocessingMode:"ttl",reprocessingTtl:{value:7,unit:"days"},excludeInFlight:!0,requiredGraphs:[],crossEntityPrerequisites:[]}),b(l.policy),A(l.persistency!==void 0),D(l.persistency),$(!1)},[l]);const Z=(((xe=ve({queryKey:["narratives",l.entity],queryFn:()=>ne.listNarratives(l.entity)}).data)==null?void 0:xe.length)??0)>0,V=(se=(pe=ve({queryKey:["graphs",l.entity],queryFn:()=>ne.graphsForEntity(l.entity)}).data)==null?void 0:pe.find(ce=>ce.graphId===p))==null?void 0:se.persistency,G=st({mutationFn:()=>ne.updateWork(l.id,{name:r.trim(),description:o.trim()||void 0,narratives:h,processing:x,graphId:p,policy:N,persistency:C?z:null}),onSuccess:()=>{$(!0),s()}}),te=!!(r.trim()&&p&&(!Z||h.length>0));return a.jsxs("div",{className:"card",style:{maxWidth:720},children:[a.jsx("div",{className:"card-title",children:"Configuration"}),a.jsx("p",{className:"text-muted",style:{fontSize:13,marginBottom:16},children:"Edit selection, prerequisites, graph, and schedule for this ongoing work. Parallel execution is configured app-wide in Settings."}),a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Name"}),a.jsx("input",{value:r,onChange:ce=>{c(ce.target.value),$(!1)}})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Description"}),a.jsx("textarea",{value:o,onChange:ce=>{f(ce.target.value),$(!1)},rows:2,placeholder:"Optional"})]})]}),a.jsx("div",{className:"section-title",style:{marginTop:20},children:"Information selection"}),a.jsxs("p",{className:"text-dim",style:{fontSize:12,marginBottom:10},children:["Object type: ",a.jsx("strong",{style:{color:"var(--color-text-muted)"},children:l.entity})," · ","Data source: ",a.jsx("strong",{style:{color:"var(--color-text-muted)"},children:l.collection})]}),a.jsx(Pc,{entity:l.entity,selected:h,onChange:ce=>{m(ce),$(!1)}}),a.jsx("div",{className:"section-title",style:{marginTop:24},children:"Processing prerequisites"}),a.jsx(Sf,{context:"recurring",entity:l.entity,targetGraphId:p||void 0,value:x,onChange:ce=>{v(ce),$(!1)}}),a.jsx("div",{className:"section-title",style:{marginTop:24},children:"Graph / pipeline"}),a.jsx(Vc,{entity:l.entity,value:p,onChange:ce=>{g(ce),$(!1)}}),a.jsx("div",{className:"section-title",style:{marginTop:24},children:"Result persistence"}),a.jsx(Lv,{enabled:C,value:z,sourceEntity:l.entity,graphPersistency:V,onEnabledChange:ce=>{A(ce),$(!1)},onChange:ce=>{D(ce),$(!1)}}),a.jsx("div",{className:"section-title",style:{marginTop:24},children:"Execution policy"}),a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Re-scan for new eligible information"}),a.jsx("select",{value:N.rescanIntervalMinutes,onChange:ce=>{b({...N,rescanIntervalMinutes:Number(ce.target.value)}),$(!1)},children:H1.map(ce=>a.jsx("option",{value:ce,children:Zi(ce)},ce))})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Priority"}),a.jsx("input",{type:"number",value:N.priority,onChange:ce=>{b({...N,priority:Number(ce.target.value)}),$(!1)}})]})]}),a.jsx("div",{className:"section-title",style:{marginTop:24},children:"Matching preview"}),a.jsx(Hs,{entity:l.entity,collection:l.collection,narratives:h,processing:x,graphId:p}),G.isError&&a.jsx("div",{style:{marginTop:16},children:a.jsx(Nt,{title:"Failed to save",detail:G.error})}),a.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center",marginTop:20},children:[a.jsx("button",{type:"button",className:"primary",disabled:!te||G.isPending,onClick:()=>G.mutate(),children:G.isPending?"Saving…":"Save configuration"}),F&&!G.isPending&&a.jsx("span",{className:"text-muted",style:{fontSize:13},children:"Saved"})]})]})}const G1=["Overview","Evaluations","Matching Information","Runs","Settings"];function K1(){var v;const{id:l=""}=Ys(),s=zn(),[r,c]=S.useState("Overview"),[o,f]=S.useState(null),h=ve({queryKey:["work",l],queryFn:()=>ne.work(l)}),m=h.data,p=ve({queryKey:["work-evals",l],queryFn:()=>ne.workEvaluations(l),enabled:!!m}),g=st({mutationFn:()=>ne.runEvaluation(l),onSuccess:({result:N})=>{f(N),s.invalidateQueries({queryKey:["work",l]}),s.invalidateQueries({queryKey:["work-evals",l]})}}),x=st({mutationFn:()=>ne.setWorkStatus(l,m.status==="active"?"inactive":"active"),onSuccess:()=>s.invalidateQueries({queryKey:["work",l]})});return h.isLoading?a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}):h.isError||!m?a.jsx(Nt,{title:"Ongoing work not found",detail:h.error}):a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/work",children:"Work"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),m.name]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[a.jsx("h1",{className:"page-title",children:m.name}),a.jsx(At,{status:m.status})]}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsx("button",{disabled:g.isPending,onClick:()=>g.mutate(),children:"Run evaluation now"}),a.jsx("button",{disabled:x.isPending,onClick:()=>x.mutate(),children:m.status==="active"?"Deactivate":"Activate"})]})]}),o&&a.jsx("div",{style:{marginBottom:16},children:a.jsx(Zc,{result:o})}),a.jsx("div",{className:"tabs",children:G1.map(N=>a.jsx("button",{className:`tab${r===N?" active":""}`,onClick:()=>c(N),children:N},N))}),r==="Overview"&&a.jsxs("div",{className:"detail-grid",children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Configuration"}),a.jsx(wn,{k:"Entity",v:`${m.entity} · ${m.collection}`}),a.jsx(wn,{k:"Narratives",v:m.narratives.join(", ")||"none"}),a.jsx(wn,{k:"Processing rule",v:(v=m.processing)!=null&&v.overrideDuplicatePrevention?"reprocess (override)":"skip already processed / queued / running"}),a.jsx(wn,{k:"Graph",v:m.graphName??m.graphId}),a.jsx(wn,{k:"Description",v:m.description??"—"})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Schedule & results"}),a.jsx(wn,{k:"Re-scan interval",v:Zi(m.policy.rescanIntervalMinutes)}),a.jsx(wn,{k:"Last scanned",v:`${al(m.lastEvaluatedAt)} (${Rt(m.lastEvaluatedAt)})`}),a.jsx(wn,{k:"Next scan",v:m.status==="active"?al(m.nextEvaluationAt):"paused (inactive)"}),a.jsx(wn,{k:"Jobs created",v:String(m.jobsCreated)}),a.jsx(wn,{k:"Estimated matching",v:String(m.estimatedMatching??"—")}),a.jsx(wn,{k:"Priority",v:String(m.policy.priority)})]})]}),r==="Evaluations"&&a.jsx(I1,{id:l,evalsQuery:p}),r==="Matching Information"&&a.jsx(Hs,{entity:m.entity,collection:m.collection,narratives:m.narratives,processing:m.processing,graphId:m.graphId}),r==="Runs"&&a.jsx(Y1,{workId:l}),r==="Settings"&&a.jsx($1,{work:m,onSaved:()=>s.invalidateQueries({queryKey:["work",l]})})]})}function I1({evalsQuery:l}){const s=l.data??[];return l.isLoading?a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}):s.length===0?a.jsx(kt,{title:"No evaluations yet",message:"When this work is active (or you run an evaluation now), each cycle is recorded here with what it matched, created, and excluded."}):a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:s.map(r=>a.jsxs("div",{className:"card",children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[a.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[a.jsx(At,{status:r.status}),a.jsx("span",{className:"text-muted",style:{fontSize:12},children:Rt(r.at)})]}),a.jsxs("span",{className:"text-dim",style:{fontSize:12},children:[r.durationMs," ms"]})]}),r.error&&a.jsx("div",{className:"error-state",style:{fontSize:12,marginBottom:8},children:r.error}),r.zeroReason&&a.jsxs("div",{className:"text-muted",style:{fontSize:12,marginBottom:8},children:["Zero jobs: ",r.zeroReason]}),a.jsxs("div",{style:{display:"flex",gap:24,fontSize:13},children:[a.jsxs("span",{children:[a.jsx("strong",{children:r.matched})," ",a.jsx("span",{className:"text-muted",children:"matched"})]}),a.jsxs("span",{children:[a.jsx("strong",{style:{color:"var(--status-done)"},children:r.created})," ",a.jsx("span",{className:"text-muted",children:"created"})]}),a.jsxs("span",{children:[a.jsx("strong",{style:{color:"var(--status-blocked)"},children:r.excluded})," ",a.jsx("span",{className:"text-muted",children:"excluded"})]})]}),r.exclusionReasons.length>0&&a.jsx("div",{style:{marginTop:10},children:a.jsx(bf,{included:r.created,excluded:r.exclusionReasons,includedLabel:"Jobs created"})})]},r.id))})}function Y1({workId:l}){var h;const s=Yc(["work-runs",l],{workId:l}),r=S.useMemo(()=>{var m;return((m=s.data)==null?void 0:m.pages.flatMap(p=>p.runs))??[]},[s.data]),c=rr((h=s.data)==null?void 0:h.pages),o=r.length<c,f=S.useCallback(()=>{o&&!s.isFetchingNextPage&&s.fetchNextPage()},[o,s]);return s.isLoading?a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}):r.length===0?a.jsx(kt,{title:"No runs yet",message:"Jobs created by this ongoing work will appear here."}):a.jsxs("div",{className:"table-wrap",children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Updated"})]})}),a.jsx("tbody",{children:r.map(m=>a.jsxs("tr",{onClick:()=>{window.location.href=`/journal/${m.id}`},children:[a.jsx("td",{children:a.jsx(At,{status:m.status})}),a.jsx("td",{className:"mono",style:{fontSize:12},children:m.recordLabel??m.recordId}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:m.graphName??m.graphId}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:al(m.updatedAt)})]},m.id))})]}),a.jsx(ir,{loaded:r.length,total:c,hasMore:o,isFetchingNextPage:s.isFetchingNextPage,onLoadMore:f})]})}function wn({k:l,v:s}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:l}),a.jsx("span",{className:"detail-val",style:{fontFamily:"inherit"},children:s})]})}function X1(){const l=En();return a.jsxs("div",{children:[a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"On-Demand"}),a.jsx("span",{className:"page-subtitle",children:"Run processing now — pick a single item or a batch selected by narratives."})]})}),a.jsxs("div",{className:"mode-cards",children:[a.jsxs("button",{type:"button",className:"mode-card",onClick:()=>l("/on-demand/single"),children:[a.jsx("div",{className:"mode-card-icon",children:"▶"}),a.jsxs("div",{children:[a.jsx("div",{className:"mode-card-title",children:"Single item"}),a.jsx("div",{className:"mode-card-desc",children:"Run a graph on one item you select manually or at random. Optionally include context."})]}),a.jsx("div",{className:"mode-card-arrow",children:"→"})]}),a.jsxs("button",{type:"button",className:"mode-card",onClick:()=>l("/on-demand/batch"),children:[a.jsx("div",{className:"mode-card-icon",children:"⊞"}),a.jsxs("div",{children:[a.jsx("div",{className:"mode-card-title",children:"Batch"}),a.jsx("div",{className:"mode-card-desc",children:"Run a graph on multiple items that match selected narratives. One job per matching item."})]}),a.jsx("div",{className:"mode-card-arrow",children:"→"})]})]})]})}const F1=new Set(["core","snapshots"]);function Zd(l){return F1.has(l)}function Uv({node:l,prefix:s,selected:r,onToggle:c}){var x,v,N;const o=s?`${s}.${l.path}`:l.path,f=((x=l.children)==null?void 0:x.map(b=>`${o}.${b.path}`))??[],h=f.length===0||f.every(b=>r.has(b)),m=!((v=l.children)!=null&&v.length),p=m?r.has(o):h;function g(b){if(m)c(o,b.target.checked);else{const C=Qv(l,s);for(const A of C)c(A,b.target.checked)}}return a.jsxs("div",{style:{paddingLeft:s?16:0},children:[a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:13,paddingBottom:2},children:[a.jsx("input",{type:"checkbox",checked:p,onChange:g}),a.jsx("span",{className:"mono",style:{color:"var(--color-text)"},children:l.path}),l.inferredType&&a.jsx("span",{style:{color:"var(--color-text-dim)",fontSize:11},children:l.inferredType})]}),(N=l.children)==null?void 0:N.map(b=>a.jsx(Uv,{node:b,prefix:o,selected:r,onToggle:c},b.path))]})}function Qv(l,s){var c;const r=s?`${s}.${l.path}`:l.path;return(c=l.children)!=null&&c.length?l.children.flatMap(o=>Qv(o,r)):[r]}function P1({order:l,onChange:s}){function r(c,o){const f=[...l],h=c+o;h<0||h>=f.length||([f[c],f[h]]=[f[h],f[c]],s(f))}return a.jsxs("div",{style:{marginBottom:12},children:[a.jsx("label",{style:{display:"block",marginBottom:4,fontSize:12,color:"var(--color-text-dim)"},children:"Merge priority (top wins on key collision)"}),l.map((c,o)=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[a.jsxs("span",{style:{fontSize:11,color:"var(--color-text-dim)",width:16,textAlign:"right"},children:[o+1,"."]}),a.jsx("span",{className:"mono",style:{fontSize:13,flex:1},children:c}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",disabled:o===0,onClick:()=>r(o,-1),children:"↑"}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",disabled:o===l.length-1,onClick:()=>r(o,1),children:"↓"})]},c))]})}function V1({objectType:l,contentTypeKey:s,target:r,selectedPaths:c,onPathsChange:o}){var A,z;const f=ve({queryKey:["assembler-props",l,s,r],queryFn:()=>ne.assemblerProperties({objectType:l,contentType:s,target:r}),staleTime:6e4}),h=((A=f.data)==null?void 0:A.flatPaths)??[],m=((z=f.data)==null?void 0:z.properties)??[],p=new Set(c??h);function g(D,F){const $=new Set(p);F?$.add(D):$.delete(D);const U=h.filter(Z=>$.has(Z));o(U.length===h.length?void 0:U)}function x(){o(void 0)}function v(){o([])}const N=c===void 0?h.length:c.length,b=Zd(s)?"1:1":"1:n",C={fontSize:10,padding:"1px 5px",borderRadius:3,background:Zd(s)?"var(--color-accent-dim, #1a3a5c)":"var(--color-bg-3, #2a2a2a)",color:"var(--color-text-dim)",marginLeft:6};return a.jsxs("div",{style:{border:"1px solid var(--color-border)",borderRadius:6,marginBottom:12,overflow:"hidden"},children:[a.jsxs("div",{style:{padding:"8px 12px",background:"var(--color-bg-2)",display:"flex",alignItems:"center",gap:8},children:[a.jsx("span",{className:"mono",style:{fontWeight:600,fontSize:13},children:s}),a.jsx("span",{style:C,children:b}),a.jsx("span",{style:{marginLeft:"auto",fontSize:11,color:"var(--color-text-dim)"},children:f.isLoading?"Loading…":`${N} / ${h.length} properties`}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",onClick:x,children:"All"}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",onClick:v,children:"None"})]}),!f.isLoading&&m.length===0&&a.jsx("div",{style:{padding:"10px 12px",fontSize:12,color:"var(--color-text-dim)"},children:"No properties sampled (collection may be empty)."}),m.length>0&&a.jsx("div",{style:{padding:"10px 12px",maxHeight:240,overflowY:"auto"},children:m.map(D=>a.jsx(Uv,{node:D,prefix:"",selected:p,onToggle:g},D.path))})]})}function Z1({objectType:l,target:s,collections:r,value:c,onChange:o}){const f=r.filter(Zd),h=r.map(x=>{const v=c==null?void 0:c.contentTypes.find(N=>N.key===x);return{key:x,selectedProperties:v==null?void 0:v.selectedProperties}}),m=(()=>{const x=(c==null?void 0:c.priority)??[],v=f,N=v.filter(b=>!x.includes(b));return[...x.filter(b=>v.includes(b)),...N]})();function p(x,v){const N=h.map(b=>b.key===x?{key:x,selectedProperties:v}:b);o({objectType:l,target:s,contentTypes:N,priority:m})}function g(x){o({objectType:l,target:s,contentTypes:h,priority:x})}return a.jsxs("div",{children:[f.length>1&&a.jsx(P1,{order:m,onChange:g}),r.map(x=>{var v;return a.jsx(V1,{objectType:l,contentTypeKey:x,target:s,selectedPaths:(v=h.find(N=>N.key===x))==null?void 0:v.selectedProperties,onPathsChange:N=>p(x,N)},x)})]})}const Ji={entityId:"same-as-input",contentType:ll,newRecord:!0};function J1(l=!0){return{...Ji,newRecord:l}}function Jd(l){if(!l)return"not declared on graph";const s=l.entityId==="same-as-input"?"same as input":l.entityId,r=l.newRecord===!1?"update or create one row per item":"add new record each run";return`${s} · ${l.contentType} · ${r}`}function Hv(l,s=!0){return`Same object type · ${l?`${l}-${ll}`:`${ll} collection`} · ${s?"new record per run":"one row per item (update or create)"}`}function W1(l,s,r,c,o=!0){if(l==="simulation")return{label:"Simulation",detail:"Graph runs normally; results are not written to Memorix.",simulation:!0};if(l==="same-entity-inferences")return{label:"Write results",detail:Hv(c,o),simulation:!1};if(l==="custom")return{label:"Write results",detail:Jd(r??Ji),simulation:!1};if(!s)return{label:"Simulation",detail:"Graph has no result persistence — choose Inferences or Custom to write results.",simulation:!0};const f=o!==(s.newRecord!==!1)?{...s,newRecord:o}:s;return{label:"Write results",detail:`Graph default: ${Jd(f)}`,simulation:!1}}function eC(l,s){return s?"Simulation — the source item is not marked as processed when the run completes.":`On success, marks "${l}" as processed on this item (visible on the item's Processing tab).`}function tC(l,s,r){const c=o=>(r==null?void 0:r.newRecord)===void 0?o:{...o,newRecord:r.newRecord};if(l==="simulation")return null;if(l==="same-entity-inferences")return c(J1((r==null?void 0:r.newRecord)!==!1));if(l==="custom")return s??Ji;if(r!=null&&r.graphPersistency)return c(r.graphPersistency)}function nC({mode:l,customValue:s,newRecord:r,sourceEntity:c,graphPersistency:o,onModeChange:f,onCustomChange:h,onNewRecordChange:m}){const p=s??Ji,g=p.entityId==="same-as-input"?"same-as-input":"custom";function x(v){h({...p,...v})}return a.jsxs("div",{className:"result-writeback",children:[a.jsx("div",{className:"section-title",children:"Result writeback"}),a.jsx("p",{className:"hint",style:{marginBottom:12},children:"Choose whether this run persists graph output to Memorix or runs as a simulation only."}),a.jsxs("div",{className:"writeback-modes",children:[a.jsxs("label",{className:`writeback-mode${l==="simulation"?" selected":""}`,children:[a.jsx("input",{type:"radio",name:"writeback-mode",checked:l==="simulation",onChange:()=>f("simulation")}),a.jsxs("span",{children:[a.jsx("strong",{children:"Simulation"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:"Run the graph without writing results."})]})]}),a.jsxs("label",{className:`writeback-mode${l==="same-entity-inferences"?" selected":""}`,children:[a.jsx("input",{type:"radio",name:"writeback-mode",checked:l==="same-entity-inferences",onChange:()=>f("same-entity-inferences")}),a.jsxs("span",{children:[a.jsx("strong",{children:"Save to Inferences"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:Hv(c,r)})]})]}),o&&a.jsxs("label",{className:`writeback-mode${l==="graph-default"?" selected":""}`,children:[a.jsx("input",{type:"radio",name:"writeback-mode",checked:l==="graph-default",onChange:()=>f("graph-default")}),a.jsxs("span",{children:[a.jsx("strong",{children:"Use graph default"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:Jd(o)})]})]}),a.jsxs("label",{className:`writeback-mode${l==="custom"?" selected":""}`,children:[a.jsx("input",{type:"radio",name:"writeback-mode",checked:l==="custom",onChange:()=>{f("custom"),s||h({...Ji})}}),a.jsxs("span",{children:[a.jsx("strong",{children:"Custom destination"}),a.jsx("span",{className:"hint",style:{display:"block",marginTop:4},children:"Override object type or content type."})]})]})]}),l!=="simulation"&&l!=="custom"&&a.jsx(Vd,{name:"existing-record-mode",newRecord:r,onChange:m}),l==="custom"&&a.jsxs("div",{className:"form-grid",style:{marginTop:12},children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Target object type"}),a.jsxs("select",{value:g,onChange:v=>{v.target.value==="same-as-input"?x({entityId:"same-as-input"}):x({entityId:c??""})},children:[a.jsxs("option",{value:"same-as-input",children:["Same as input",c?` (${c})`:""]}),a.jsx("option",{value:"custom",children:"Other object type…"})]})]}),g==="custom"&&a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Object type name"}),a.jsx("input",{value:p.entityId==="same-as-input"?"":p.entityId,onChange:v=>x({entityId:v.target.value||"same-as-input"}),placeholder:"e.g. vulnerabilities"})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Content type"}),a.jsx("input",{value:p.contentType,onChange:v=>x({contentType:v.target.value||ll}),placeholder:ll})]}),a.jsx("div",{className:"writeback-existing-grid-span",children:a.jsx(Vd,{name:"custom-existing-record-mode",newRecord:p.newRecord!==!1,onChange:v=>x({newRecord:v})})})]})]})}function aC(l){const s=l.find(r=>r.key==="snapshots"||r.role==="snapshot");return s==null?void 0:s.key}function Ed(l){const s=aC(l);return s?[s]:[]}function lC(l){return l[0]}const $v=[{id:"record",title:"Choose item",summary:"What to process"},{id:"related",title:"Context",summary:"Optional linked data"},{id:"graph",title:"Choose graph",summary:"Pipeline to run"},{id:"writeback",title:"Result writeback",summary:"Where to save"},{id:"properties",title:"Properties",summary:"Data to include"},{id:"review",title:"Review & run",summary:"Confirm"},{id:"result",title:"Done",summary:"Result"}],Td=$v.length-1,Ki=3,Rd=4,pg=5;function sC(){var Bl;const{agentQueryParam:l}=Cn(),[s]=Xs(),[r,c]=S.useState(0),[o,f]=S.useState(""),[h,m]=S.useState([]),[p,g]=S.useState([]),[x,v]=S.useState(!1),[N,b]=S.useState(""),[C,A]=S.useState(""),[z,D]=S.useState(),[F,$]=S.useState(100),[U,Z]=S.useState(),[W,V]=S.useState("simulation"),[G,te]=S.useState(),[xe,pe]=S.useState(!0),[se,ce]=S.useState(null);S.useEffect(()=>{var qe;const ee=(qe=s.get("entity"))==null?void 0:qe.trim();ee&&f(Ot=>Ot||ee)},[s]),S.useEffect(()=>{z&&!z.persistency&&W==="graph-default"&&V("same-entity-inferences")},[z,W]);const Se=ve({queryKey:["entities",l??"all"],queryFn:()=>ne.listEntities(l),retry:2}),ue=Se.data??[];S.useEffect(()=>{if(!o||!Se.isSuccess)return;ue.map(qe=>qe.name).includes(o)||f("")},[Se.isSuccess,ue,o]);const k=ue.find(ee=>ee.name===o),X=(k==null?void 0:k.target)==="event"?"event":"entity",re=S.useCallback(()=>{c(0),ce(null),b(""),A(""),D(void 0),Z(void 0),V("simulation"),te(void 0),m(k?Ed(k.collections):[])},[k]);S.useEffect(()=>{k&&m(ee=>ee.length>0?ee:Ed(k.collections))},[k]);const je=lC(h),I=ve({queryKey:["core-records",o,h,p],queryFn:()=>ne.coreRecords({entity:o,collection:je,narratives:p,pageSize:100}),enabled:!!(o&&je)}),E=((Bl=I.data)==null?void 0:Bl.records)??[],H=E.find(ee=>ee.id===N);function J(ee){m(ee),b(""),Z(void 0)}function ie(ee){g(ee),b("")}function L(){E.length&&b(E[Math.floor(Math.random()*E.length)].id)}function O(){if(U)return U;const ee=h.filter(qe=>qe==="core"||qe==="snapshots");return{objectType:o,target:X,contentTypes:h.map(qe=>({key:qe})),priority:ee}}function ae(){const ee=tC(W,G,{newRecord:xe,graphPersistency:z==null?void 0:z.persistency});return{entity:o,collection:je,recordId:N,graphId:C,priority:F,assemblySelection:O(),...ee!==void 0?{persistency:ee}:{}}}const be=st({mutationFn:()=>ne.queueSingle(ae()),onSuccess:({result:ee,run:qe})=>{ce({...ee,actions:[{label:"View in journal",to:`/journal/${qe.id}`,primary:!0}]}),c(Td)}}),Ae=st({mutationFn:async()=>{const{run:ee}=await ne.queueSingle(ae()),{run:qe}=await ne.executeRun(ee.id,!0);return qe},onSuccess:ee=>{var Ot;const qe=ee.status==="failed"?"failed":ee.status==="done"?"success":"partial";ce({status:qe,title:ee.status==="failed"?"Job failed":ee.status==="done"?"Job completed":"Job started",summary:((Ot=ee.error)==null?void 0:Ot.message)??`Status: ${ee.status}`,stats:[{label:"Run ID",value:ee.id},{label:"Graph",value:ee.graphName??ee.graphId},{label:"Status",value:ee.status,tone:ee.status==="failed"?"bad":ee.status==="done"?"good":"default"}],errors:ee.error?[ee.error.message]:void 0,actions:[{label:"View in journal",to:`/journal/${ee.id}`,primary:!0}]}),c(Td)}}),qt=be.error??Ae.error,rn=!!(o&&N&&h.length>0),_t=!!C;function wt(ee){if(ee<=r)return c(ee);ee>=1&&!rn||ee>=Ki&&!_t||c(ee)}const kn=(k==null?void 0:k.collections)??[],ql=h.map(ee=>{const qe=kn.find(Ot=>Ot.key===ee);return qe?Qc(qe):ee}).join(", "),Fs=U?(U.contentTypes.reduce((ee,qe)=>{var Ot;return ee+(((Ot=qe.selectedProperties)==null?void 0:Ot.length)??999)},0),`${U.contentTypes.length} content type${U.contentTypes.length!==1?"s":""} selected`):"All properties (default)",_l=W1(W,z==null?void 0:z.persistency,G,o,xe),cr=eC((z==null?void 0:z.name)??C,_l.simulation);return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx("a",{href:"/on-demand",children:"On-Demand"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),"Single item"]}),a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"On-Demand: single item"}),a.jsx("span",{className:"page-subtitle",children:"Process one item through a graph."})]})}),a.jsx(vf,{steps:$v,current:r,canGoTo:ee=>ee<=r,onGoTo:wt,maxWidth:980}),a.jsxs("div",{style:{maxWidth:720},children:[r===0&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"1. Choose item"}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Object type"}),a.jsx(jf,{value:o,entities:ue,loading:Se.isLoading,error:Se.error,onChange:ee=>{const qe=ue.find(Ot=>Ot.name===ee);f(ee),m(Ed((qe==null?void 0:qe.collections)??[])),g([]),v(!1),b(""),A(""),D(void 0),Z(void 0),V("simulation"),te(void 0)}})]}),o&&a.jsxs("div",{className:"field",style:{marginBottom:12},children:[a.jsx("label",{children:"Data sources"}),a.jsx(xf,{options:kn,selected:h,onChange:J}),h.length===0&&a.jsx("span",{className:"hint",style:{color:"var(--status-blocked)",display:"block",marginTop:6},children:"Select at least one data source. Snapshots is selected automatically when available."}),a.jsx("span",{className:"hint",children:"Select which content types are merged and sent to the graph."})]}),o&&a.jsxs("div",{className:"field",style:{marginBottom:12},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[a.jsxs("label",{style:{marginBottom:0},children:["Narratives",a.jsx("span",{style:{fontWeight:400,color:"var(--color-text-dim)",marginLeft:6},children:"— optional filter"})]}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",onClick:()=>v(ee=>!ee),children:x?"Hide":p.length>0?`${p.length} active ▾`:"Filter ▾"})]}),p.length>0&&!x&&a.jsx("div",{className:"chip-row",style:{marginBottom:6},children:p.map(ee=>{const qe=k==null?void 0:k.narratives.find(Ot=>Ot.key===ee);return a.jsx("span",{className:"chip narrative",children:(qe==null?void 0:qe.label)??ee},ee)})}),x&&a.jsx("div",{style:{marginTop:8},children:a.jsx(Pc,{entity:o,selected:p,onChange:ie,requireSelection:!1})})]}),o&&a.jsxs("div",{className:"field",style:{marginBottom:12},children:[a.jsx("label",{children:"Item *"}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsxs("select",{value:N,onChange:ee=>b(ee.target.value),style:{flex:1},children:[a.jsx("option",{value:"",children:I.isLoading?"Loading…":E.length?"Select an item…":"No information"}),E.map(ee=>a.jsxs("option",{value:ee.id,children:[ee.label," (",ee.id,")"]},ee.id))]}),a.jsx("button",{type:"button",onClick:L,disabled:!E.length,children:"Random"})]}),a.jsxs("span",{className:"hint",children:[E.length," items loaded",p.length>0?` (filtered by ${p.length} narrative${p.length>1?"s":""})`:""," · ",a.jsx("a",{href:`/information?entity=${o}`,children:"Browse all information"})]})]}),a.jsx(gt,{onNext:()=>wt(1),nextLabel:"Next: context",nextDisabled:!rn})]}),r===1&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"2. Context (optional)"}),H&&a.jsxs("div",{className:"memorix-panel",children:[a.jsx("div",{className:"memorix-panel-title",children:"Starting item"}),a.jsxs("span",{className:"mono",children:[o," / ",ql," / ",H.label]})]}),a.jsx("div",{className:"empty-state",style:{padding:24},children:"Context is not applicable — there are no relations linked to related entities. You can skip this step and continue."}),a.jsx(gt,{onBack:()=>wt(0),onNext:()=>wt(2),nextLabel:"Skip — no context"})]}),r===2&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"3. Choose graph"}),a.jsx(Vc,{entity:o,value:C,onChange:(ee,qe)=>{A(ee),D(qe)}}),a.jsx(gt,{onBack:()=>wt(1),onNext:()=>wt(Ki),nextLabel:"Next: result writeback",nextDisabled:!_t})]}),r===Ki&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"4. Result writeback"}),z&&a.jsxs("div",{className:"memorix-panel",style:{marginBottom:12},children:[a.jsx("div",{className:"memorix-panel-title",children:"Selected graph"}),a.jsx("span",{className:"mono",children:z.name??C})]}),a.jsx(nC,{mode:W,customValue:G,newRecord:xe,sourceEntity:o,graphPersistency:z==null?void 0:z.persistency,onModeChange:V,onCustomChange:te,onNewRecordChange:pe}),a.jsx(gt,{onBack:()=>wt(2),onNext:()=>wt(Rd),nextLabel:"Next: properties"})]}),r===Rd&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"5. Properties to include"}),a.jsxs("div",{style:{marginBottom:12,color:"var(--color-text-dim)",fontSize:13},children:["Choose which properties are sent to the graph as input. Only domain data is sent — system fields are always excluded.",a.jsxs("ul",{style:{margin:"8px 0 0 16px",lineHeight:1.8,fontSize:12},children:[a.jsxs("li",{children:[a.jsx("strong",{children:"1:1 types"})," (core, snapshots): one record per item, merged at the root. Higher priority wins on duplicate keys."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"1:n types"}),": all matching records, placed as an array under the content-type name."]})]})]}),o&&h.length>0&&a.jsx(Z1,{objectType:o,target:X,collections:h,value:U,onChange:Z}),a.jsx(gt,{onBack:()=>wt(Ki),onNext:()=>wt(pg),nextLabel:"Next: review"})]}),r===pg&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"6. Review & run"}),a.jsxs("div",{className:"review-grid",style:{marginBottom:16},children:[a.jsx(Ss,{label:"Object type",value:o}),a.jsx(Ss,{label:"Data sources",value:ql}),a.jsx(Ss,{label:"Properties",value:Fs}),a.jsx(Ss,{label:"Item",value:(H==null?void 0:H.label)??N}),a.jsx(Ss,{label:"Graph",value:(z==null?void 0:z.name)??C}),a.jsxs("div",{className:"review-row",children:[a.jsx("span",{className:"review-label",children:"Result writeback"}),a.jsxs("div",{className:"writeback-summary",children:[a.jsx("span",{className:`writeback-badge ${_l.simulation?"simulation":"write"}`,children:_l.label}),a.jsx("span",{className:"mono",style:{fontSize:12},children:_l.detail}),a.jsx("button",{type:"button",className:"btn-ghost btn-xs",style:{marginLeft:8},onClick:()=>wt(Ki),children:"Change"})]})]}),a.jsx(Ss,{label:"Source item tracking",value:cr})]}),a.jsx("div",{className:"form-grid",children:a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Queue priority"}),a.jsx("input",{type:"number",value:F,onChange:ee=>$(Number(ee.target.value))}),a.jsx("span",{className:"hint",children:"Used when sending to the queue. Higher priority is picked up first when the queue is contested."})]})}),a.jsx("p",{className:"text-muted",style:{fontSize:13,marginBottom:12},children:"Send to queue to run in the background at the priority above, or execute now to run immediately in this session."}),qt&&a.jsx(Nt,{title:"Failed to start job",detail:qt}),a.jsxs(gt,{onBack:()=>wt(Rd),children:[a.jsx("button",{type:"button",className:"primary",disabled:be.isPending||Ae.isPending,onClick:()=>be.mutate(),children:be.isPending?"Sending to queue…":"Send to queue"}),a.jsx("button",{type:"button",disabled:be.isPending||Ae.isPending,onClick:()=>Ae.mutate(),children:Ae.isPending?"Executing…":"Execute now"})]})]}),r===Td&&se&&a.jsxs(a.Fragment,{children:[a.jsx(Zc,{result:se}),a.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:16},children:a.jsx("button",{type:"button",className:"primary",onClick:re,children:"Run another item"})})]})]})]})}function Ss({label:l,value:s}){return a.jsxs("div",{className:"review-row",children:[a.jsx("span",{className:"review-label",children:l}),a.jsx("span",{className:"mono",style:{fontSize:12},children:s})]})}const iC=[{id:"entity",title:"Entity",summary:"Choose entity"},{id:"narratives",title:"Narratives",summary:"Select information"},{id:"processing",title:"Processing",summary:"Filters"},{id:"graph",title:"Graph",summary:"Pipeline"},{id:"review",title:"Review",summary:"Matching information"},{id:"queue",title:"Queue policy",summary:"Concurrency"},{id:"result",title:"Queued",summary:"Result"}];function rC(){var k;const{agentQueryParam:l}=Cn(),[s]=Xs(),[r,c]=S.useState(0),[o,f]=S.useState(s.get("entity")??""),[h,m]=S.useState(["core"]),[p,g]=S.useState([]),[x,v]=S.useState(""),[N,b]=S.useState(),[C,A]=S.useState({reprocessingMode:"skip",excludeInFlight:!0}),[z,D]=S.useState(""),[F,$]=S.useState({priority:100}),[U,Z]=S.useState(null),W=ve({queryKey:["entities",l??"all"],queryFn:()=>ne.listEntities(l),retry:2}),V=W.data??[];S.useEffect(()=>{if(!o||!W.isSuccess)return;V.map(re=>re.name).includes(o)||f("")},[W.isSuccess,V,o]);const G=V.find(X=>X.name===o),xe=((k=ve({queryKey:["matching",o,h,p,C,x,"count"],queryFn:()=>ne.previewMatching({entity:o,collection:h[0]??"core",narratives:p,processing:C,graphId:x}),enabled:!!(o&&x)}).data)==null?void 0:k.matched)??0,pe=st({mutationFn:()=>ne.queueBatch({name:z||`${o} batch`,entity:o,collections:h,narratives:p,processing:C,graphId:x,policy:F}),onSuccess:({result:X})=>{Z(X),c(6)}}),se=!!x,Se=!(((G==null?void 0:G.narratives.length)??0)>0)||p.length>0;function ue(X){if(X<=r)return c(X);X>=1&&!o||X>=2&&!Se||X>=4&&!se||c(X)}return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx("a",{href:"/on-demand",children:"On-Demand"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),"Batch"]}),a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"On-Demand: batch"}),a.jsx("span",{className:"page-subtitle",children:"Run one graph on many items that match your selected narratives."})]})}),a.jsx(vf,{steps:iC,current:r,canGoTo:X=>X<=r,onGoTo:ue,maxWidth:980}),a.jsxs("div",{style:{maxWidth:720},children:[r===0&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"1. Choose entity"}),a.jsx("div",{className:"form-grid",children:a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Object type"}),a.jsx(jf,{value:o,entities:V,loading:W.isLoading,error:W.error,onChange:X=>{var je;const re=V.find(I=>I.name===X);f(X),m([((je=re==null?void 0:re.collections[0])==null?void 0:je.key)??"core"]),g([]),v(""),b(void 0)}})]})}),G&&a.jsxs("div",{className:"field",style:{marginTop:12},children:[a.jsx("label",{children:"Data sources"}),a.jsx(xf,{options:G.collections,selected:h,onChange:m}),a.jsx("span",{className:"hint",children:"Select which data sources are passed to the graph as input."})]}),G&&a.jsxs("p",{className:"text-dim",style:{fontSize:12},children:[G.coreCount," core information · ",G.narratives.length," narratives · ",G.graphs.length," compatible graphs"]}),a.jsx(gt,{onNext:()=>ue(1),nextLabel:"Next: narratives",nextDisabled:!o})]}),r===1&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"2. Select narratives"}),a.jsx(Pc,{entity:o,selected:p,onChange:g}),a.jsx("div",{style:{marginTop:16},children:a.jsx(Hs,{entity:o,collection:h[0]??"core",narratives:p})}),a.jsx(gt,{onBack:()=>ue(0),onNext:()=>ue(2),nextLabel:"Next: processing",nextDisabled:!Se})]}),r===2&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"3. Processing prerequisites"}),a.jsx("p",{className:"wizard-lead",children:"Control which information is eligible. Skip already-processed items by default, and optionally require other graphs to have run first."}),a.jsx(Sf,{context:"batch",entity:o,targetGraphId:x||void 0,value:C,onChange:A}),a.jsx(gt,{onBack:()=>ue(1),onNext:()=>ue(3),nextLabel:"Next: graph"})]}),r===3&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"4. Choose graph / pipeline"}),a.jsx(Vc,{entity:o,value:x,onChange:(X,re)=>{v(X),b(re)}}),a.jsx(gt,{onBack:()=>ue(2),onNext:()=>ue(4),nextLabel:"Next: review",nextDisabled:!se})]}),r===4&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"5. Review matching information"}),a.jsx(Hs,{entity:o,collection:h[0]??"core",narratives:p,processing:C,graphId:x}),a.jsx(gt,{onBack:()=>ue(3),onNext:()=>ue(5),nextLabel:"Next: queue policy"})]}),r===5&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"6. Queue policy"}),a.jsxs("div",{className:"form-grid",children:[a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Batch name"}),a.jsx("input",{value:z,onChange:X=>D(X.target.value),placeholder:`${o} batch`})]}),a.jsxs("div",{className:"field",children:[a.jsx("label",{children:"Priority"}),a.jsx("input",{type:"number",value:F.priority,onChange:X=>$({...F,priority:Number(X.target.value)})}),a.jsx("span",{className:"hint",children:"Higher priority is picked up first when the queue is contested. Parallel execution is configured app-wide in Settings."})]})]}),a.jsx("div",{className:"memorix-panel",children:a.jsxs("div",{style:{fontSize:13},children:["This will create ",a.jsx("strong",{children:xe.toLocaleString()})," jobs — one per matching item. The app queue settings control how many run in parallel."]})}),pe.isError&&a.jsx(Nt,{title:"Failed to queue batch",detail:pe.error}),a.jsx(gt,{onBack:()=>ue(4),children:a.jsx("button",{type:"button",className:"primary",disabled:pe.isPending,onClick:()=>pe.mutate(),children:pe.isPending?"Queueing…":"Queue batch"})})]}),r===6&&U&&a.jsx(Zc,{result:U})]})]})}function cC(){var g,x;const{id:l=""}=Ys(),s=ve({queryKey:["batch",l],queryFn:()=>ne.batch(l)}),r=Yc(["batch-runs",l],{batchId:l}),c=s.data,o=S.useMemo(()=>{var v;return((v=r.data)==null?void 0:v.pages.flatMap(N=>N.runs))??[]},[r.data]),f=rr((g=r.data)==null?void 0:g.pages),h=o.length<f,m=S.useCallback(()=>{h&&!r.isFetchingNextPage&&r.fetchNextPage()},[h,r]);if(s.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]});if(s.isError||!c)return a.jsx(Nt,{title:"Batch not found",detail:s.error});const p=c.counts;return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/on-demand/batch",children:"Batch"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),c.name]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[a.jsx("h1",{className:"page-title",children:c.name}),a.jsx(At,{status:c.status})]}),a.jsxs("span",{className:"text-dim",style:{fontSize:12},children:["created ",al(c.createdAt)]})]}),a.jsx("div",{className:"status-cards",style:{gridTemplateColumns:"repeat(6, 1fr)"},children:[["Total",p.total],["Pending",p.pending],["Running",p.running],["Done",p.done],["Failed",p.failed],["Cancelled",p.cancelled]].map(([v,N])=>a.jsxs("div",{className:"status-card",style:{cursor:"default"},children:[a.jsx("div",{className:"status-card-label",children:v}),a.jsx("div",{className:"status-card-count",children:N})]},v))}),a.jsxs("div",{className:"detail-grid",children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Selection summary"}),a.jsx(Ns,{k:"Entity",v:`${c.entity} · ${c.collection}`}),a.jsx(Ns,{k:"Narratives",v:c.narratives.join(", ")||"none"}),a.jsx(Ns,{k:"Reprocessing",v:(x=c.processing)!=null&&x.reprocessingMode&&c.processing.reprocessingMode!=="skip"?c.processing.reprocessingMode:"skip (default)"}),a.jsx(Ns,{k:"Graph",v:c.graphName??c.graphId}),a.jsx(Ns,{k:"Priority",v:String(c.policy.priority)}),a.jsx(Ns,{k:"Created",v:Rt(c.createdAt)})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Excluded information"}),c.excluded.length?a.jsx(bf,{included:p.total,excluded:c.excluded,includedLabel:"Queued"}):a.jsx("p",{className:"text-muted",style:{fontSize:13},children:"No information was excluded."})]})]}),a.jsxs("div",{className:"section",children:[a.jsxs("div",{className:"section-title",style:{display:"flex",justifyContent:"space-between"},children:[a.jsx("span",{children:"Runs"}),p.failed>0&&a.jsxs("button",{type:"button",disabled:!0,title:"Backend TODO",children:["Retry failed (",p.failed,")"]})]}),r.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}),!r.isLoading&&o.length===0&&a.jsx(kt,{title:"No runs for this batch yet"}),o.length>0&&a.jsxs("div",{className:"table-wrap",children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Attempts"}),a.jsx("th",{children:"Updated"})]})}),a.jsx("tbody",{children:o.map(v=>a.jsxs("tr",{onClick:()=>{window.location.href=`/journal/${v.id}`},children:[a.jsx("td",{children:a.jsx(At,{status:v.status})}),a.jsx("td",{className:"mono",style:{fontSize:12},children:v.recordLabel??v.recordId}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:v.graphName??v.graphId}),a.jsxs("td",{className:"mono",children:[v.attempts,"/",v.maxAttempts]}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:al(v.updatedAt)})]},v.id))})]}),a.jsx(ir,{loaded:o.length,total:f,hasMore:h,isFetchingNextPage:r.isFetchingNextPage,onLoadMore:m})]})]})]})}function Ns({k:l,v:s}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:l}),a.jsx("span",{className:"detail-val",style:{fontFamily:"inherit"},children:s})]})}function uC(l){const s=Object.values(l.processing.graphs);if(s.length===0)return"not processed";const r=s.filter(o=>o.lastStatus==="succeeded").length,c=s.filter(o=>o.lastStatus==="failed").length;return`${r} done${c?`, ${c} failed`:""}`}function oC(l){const s=l.role==="processing-output"?` (output · ${l.count})`:l.key==="core"?` (${l.count})`:` · ${l.count}`;return l.role==="processing-output"?`${l.key}${s}`:`${l.key}${l.key!=="core"?s:` (${l.count})`}`}function yg(){var E,H,J,ie;const l=En(),s=sn(),r=zn(),{agentQueryParam:c,agentId:o}=Cn(),[f,h]=Xs(),m=f.get("view")==="outputs"||s.pathname==="/outputs",p=f.get("entity")??"",g=f.get("collection")??"",x=f.get("graphId")??"",v=f.get("processing")??"",N=(f.get("narratives")??"").split(",").filter(Boolean),[b,C]=S.useState("");function A(L){const O=new URLSearchParams(f);for(const[ae,be]of Object.entries(L))be?O.set(ae,be):O.delete(ae);h(O)}const z=ve({queryKey:["entities",c??"all"],queryFn:()=>ne.listEntities(c)}),D=z.data??[],F=D.find(L=>L.name===p),$=S.useMemo(()=>((F==null?void 0:F.collections)??[]).filter(L=>L.role==="processing-output"),[F]),U=m?((E=$.find(L=>L.key===g))==null?void 0:E.key)??((H=$[0])==null?void 0:H.key)??"":g||"core",Z=F==null?void 0:F.collections.find(L=>L.key===U),W=(Z==null?void 0:Z.role)==="processing-output",V=$.length>0,G=!!(p&&U&&(!m||W));S.useEffect(()=>{if(!(!m||!F)){if(!V){g&&A({collection:void 0});return}$.some(L=>L.key===g)||A({collection:$[0].key})}},[m,F,V,$,g,p]);const te=ve({queryKey:["narratives",p],queryFn:()=>ne.listNarratives(p),enabled:!!p&&!m}),xe=ve({queryKey:["graphs",p],queryFn:()=>ne.graphsForEntity(p),enabled:!!p&&!m}),pe=S.useMemo(()=>({entity:p,collection:U,narratives:N.length?N:void 0,processingGraphId:x||void 0,processingCondition:v||void 0}),[p,U,N,x,v]),se=uN(["core-records",p,U,N,x,v],pe,{enabled:G}),ce=S.useMemo(()=>{var L;return((L=se.data)==null?void 0:L.pages.flatMap(O=>O.records))??[]},[se.data]),Se=rr((J=se.data)==null?void 0:J.pages),ue=ce.length<Se,k=S.useCallback(()=>{ue&&!se.isFetchingNextPage&&se.fetchNextPage()},[ue,se]),X=st({mutationFn:()=>ne.clearCoreRecords({entity:p,collection:U,confirm:!0}),onSuccess:()=>{C(""),r.invalidateQueries({queryKey:["core-records"]}),z.refetch()}});function re(L){const O=N.includes(L)?N.filter(ae=>ae!==L):[...N,L];A({narratives:O.join(",")||void 0})}const je=S.useMemo(()=>{const L=ce[0];if(!L)return[];const O=new Set(["recordId","entityId","eventId","knowledgeId","displayName","data","_memorix"]);return Object.keys(L.fields).filter(ae=>!O.has(ae)&&!ae.startsWith("_")).filter(ae=>{const be=L.fields[ae];return be===null||["string","number","boolean"].includes(typeof be)}).slice(0,3)},[ce]),I=m?$:(F==null?void 0:F.collections)??[{key:"core",role:"core",count:0}];return a.jsxs("div",{children:[a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:m?"Outputs":"Information"}),a.jsxs("span",{className:"page-subtitle",children:[o?a.jsxs(a.Fragment,{children:["Object types in agent scope ",a.jsx("span",{className:"mono",children:o}),". · "]}):null,m?"Browse graph output containers and inspect saved results.":"Browse processed items, their narratives, and processing state."]})]}),p&&!m&&a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsx(me,{to:`/on-demand/single?entity=${p}`,children:a.jsx("button",{children:"Run on-demand"})}),a.jsx(me,{to:`/on-demand/batch?entity=${p}`,children:a.jsx("button",{className:"primary",children:"Create batch from filter"})})]}),p&&W&&a.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[a.jsx("input",{type:"text",placeholder:`type ${p}-${U} to confirm`,value:b,onChange:L=>C(L.target.value),style:{width:220,fontSize:12}}),a.jsx("button",{disabled:X.isPending||b!==`${p}-${U}`,style:{color:"var(--status-failed)"},onClick:()=>{window.confirm(`Delete all records in ${p}-${U}? This cannot be undone.`)&&X.mutate()},children:X.isPending?"Clearing…":"Clear collection"})]})]}),a.jsxs("div",{className:"filters",children:[a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Entity"}),a.jsxs("select",{value:p,onChange:L=>A({entity:L.target.value||void 0,collection:void 0,narratives:void 0,graphId:void 0,processing:void 0}),children:[a.jsx("option",{value:"",children:"— select —"}),D.map(L=>a.jsx("option",{value:L.name,children:L.label},L.name))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:m?"Output collection":"Collection type"}),a.jsx("select",{value:U,onChange:L=>A({collection:L.target.value}),disabled:!F||m&&!V,children:I.length===0?a.jsx("option",{value:"",children:"— none —"}):I.map(L=>a.jsx("option",{value:L.key,children:oC(L)},L.key))})]}),!m&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"filter-divider"}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"Processed by"}),a.jsxs("select",{value:x,onChange:L=>A({graphId:L.target.value||void 0,processing:void 0}),disabled:!p,children:[a.jsx("option",{value:"",children:"any graph"}),(xe.data??[]).map(L=>a.jsx("option",{value:L.graphId,children:L.name},L.graphId))]})]}),a.jsxs("div",{className:"filter-group",children:[a.jsx("label",{children:"with status"}),a.jsxs("select",{value:v,onChange:L=>A({processing:L.target.value||void 0}),disabled:!x,title:x?void 0:"Select a graph first",children:[a.jsx("option",{value:"",children:"any status"}),a.jsx("option",{value:"succeeded",children:"succeeded"}),a.jsx("option",{value:"failed",children:"failed"}),a.jsx("option",{value:"running",children:"running"}),a.jsx("option",{value:"queued",children:"queued"}),a.jsx("option",{value:"not-processed",children:"not processed"}),a.jsx("option",{value:"unknown",children:"unknown"})]})]})]})]}),p&&!m&&(((ie=te.data)==null?void 0:ie.length)??0)>0&&a.jsx("div",{className:"chip-row",style:{marginBottom:16},children:(te.data??[]).map(L=>a.jsx("span",{className:`chip selectable${N.includes(L.key)?" selected":""}`,onClick:()=>re(L.key),title:L.description,children:L.label},L.key))}),!p&&a.jsx(kt,{title:"Select an entity",message:m?"Choose an entity to browse its output collections.":"Choose an entity to browse its items, narratives, and processing state.",icon:"◇"}),p&&m&&F&&!V&&a.jsx(kt,{title:"No output collections",message:"This entity has no graph output containers yet. Run a graph with result writeback to populate an output collection."}),p&&G&&se.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}),p&&G&&se.isError&&a.jsx(Nt,{title:"Failed to load records",detail:se.error,onRetry:()=>se.refetch()}),p&&G&&!se.isLoading&&!se.isError&&ce.length===0&&a.jsx(kt,{title:"No matching items",message:m?"This output collection is empty.":"No items match the current filters. Try removing a narrative or changing the processing filter."}),ce.length>0&&a.jsxs("div",{className:"table-wrap",children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"ID"}),a.jsx("th",{children:"Label"}),je.map(L=>a.jsx("th",{children:L},L)),!m&&a.jsx("th",{children:"Narratives"}),!m&&a.jsx("th",{children:"Processing"}),a.jsx("th",{children:"Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:ce.map(L=>a.jsxs("tr",{onClick:()=>l(`${m?"/outputs":"/information"}/${encodeURIComponent(L.id)}?entity=${p}&collection=${U}`),children:[a.jsx("td",{className:"mono",style:{fontSize:12},children:L.id}),a.jsx("td",{children:L.label}),je.map(O=>a.jsx("td",{className:"text-muted",style:{fontSize:12},children:String(L.fields[O]??"—")},O)),!m&&a.jsx("td",{children:a.jsx("span",{className:"chip-row",children:Object.keys(L.narratives).map(O=>a.jsx("span",{className:"chip narrative",children:O},O))})}),!m&&a.jsx("td",{className:"text-muted",style:{fontSize:12},children:uC(L)}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:new Date(L.updatedAt).toLocaleString()}),a.jsx("td",{onClick:O=>O.stopPropagation(),children:!m&&a.jsx(me,{to:`/on-demand/single?entity=${p}`,style:{fontSize:12},children:"Run"})})]},L.id))})]}),a.jsx(ir,{loaded:ce.length,total:Se,hasMore:ue,isFetchingNextPage:se.isFetchingNextPage,onLoadMore:k})]})]})}const dC=["Core","Narratives","Processing","Snapshots","Journal"],fC=["Output","Journal"];function gg(){const{recordId:l}=Ys(),s=decodeURIComponent(l??""),[r]=Xs(),c=r.get("entity")??"",o=r.get("collection")??"core",f=o!=="core",[h,m]=S.useState(f?"Output":"Core"),p=zn();S.useEffect(()=>{m(f?"Output":"Core")},[o,f]);const g=ve({queryKey:["core-record",c,o,s],queryFn:()=>ne.coreRecord(c,s,o,f),enabled:!!(c&&s)}),x=g.data,v=f?`/outputs?entity=${encodeURIComponent(c)}&collection=${encodeURIComponent(o)}`:`/information?entity=${encodeURIComponent(c)}`,N=st({mutationFn:()=>ne.deleteCoreRecord(c,s,o),onSuccess:()=>{p.invalidateQueries({queryKey:["core-records"]}),window.location.href=v}});if(g.isLoading)return a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]});if(g.isError||!x)return a.jsx(Nt,{title:"Failed to load",detail:g.error});const b=f?fC:dC;return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:v,children:f?"Outputs":"Information"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),x.label]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between"},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:x.label}),a.jsxs("span",{className:"page-subtitle mono",children:[c," · ",o," · ",x.id]})]}),!f&&a.jsx(me,{to:`/on-demand/single?entity=${c}`,children:a.jsx("button",{className:"primary",children:"Run on-demand"})}),f&&a.jsx("button",{style:{color:"var(--status-failed)"},disabled:N.isPending,onClick:()=>{window.confirm("Delete this output record? Linked processing stamps will be marked failed.")&&N.mutate()},children:N.isPending?"Deleting…":"Delete output"})]}),a.jsx("div",{className:"tabs",children:b.map(C=>a.jsx("button",{className:`tab${h===C?" active":""}`,onClick:()=>m(C),children:C},C))}),h==="Core"&&a.jsxs("div",{className:"card",style:{maxWidth:560},children:[a.jsx("div",{className:"card-title",children:"Core fields"}),a.jsx(Cs,{k:"Item id",v:x.id}),a.jsx(Cs,{k:"Entity",v:x.entity}),a.jsx(Cs,{k:"Label",v:x.label}),Object.entries(x.fields).map(([C,A])=>a.jsx(Cs,{k:C,v:String(A)},C)),a.jsx(Cs,{k:"Created",v:Rt(x.createdAt)}),a.jsx(Cs,{k:"Updated",v:Rt(x.updatedAt)})]}),h==="Output"&&a.jsxs("div",{className:"card run-io-panel",children:[a.jsx("div",{className:"card-title",children:"Output document"}),a.jsxs("p",{className:"run-io-hint",children:["Full contents of this record in the ",a.jsx("span",{className:"mono",children:o})," collection."]}),a.jsx(Tt,{label:"Document JSON",value:x.doc??x.fields,defaultOpen:!0})]}),h==="Narratives"&&(Object.keys(x.narratives).length===0?a.jsx(kt,{title:"No narratives on this item",message:"This item has no narratives assigned."}):a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Narrative"}),a.jsx("th",{children:"Added"}),a.jsx("th",{children:"Detected by"})]})}),a.jsx("tbody",{children:Object.entries(x.narratives).map(([C,A])=>a.jsxs("tr",{style:{cursor:"default"},children:[a.jsx("td",{children:a.jsx("span",{className:"chip narrative",children:C})}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:Rt(A.addedAt)}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:A.detectedBy??"—"})]},C))})]})})),h==="Processing"&&a.jsx(mC,{entity:c,recordId:s,contentType:"core",graphs:x.processing.graphs}),h==="Snapshots"&&a.jsx(kt,{title:"Snapshots view",message:"Snapshot perspectives for this item live in the Memorix UI. Core is the operational perspective shown here.",icon:"▤"}),h==="Journal"&&a.jsx(hC,{entity:c,recordId:s})]})}function hC({entity:l,recordId:s}){var m;const r=Yc(["record-runs",l,s],{entity:l,recordId:s}),c=S.useMemo(()=>{var p;return((p=r.data)==null?void 0:p.pages.flatMap(g=>g.runs))??[]},[r.data]),o=rr((m=r.data)==null?void 0:m.pages),f=c.length<o,h=S.useCallback(()=>{f&&!r.isFetchingNextPage&&r.fetchNextPage()},[f,r]);return r.isLoading?a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading…"]}):c.length===0?a.jsx(kt,{title:"No journal entries for this item"}):a.jsxs("div",{className:"table-wrap",children:[a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Source"}),a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Updated"})]})}),a.jsx("tbody",{children:c.map(p=>a.jsxs("tr",{onClick:()=>{window.location.href=`/journal/${p.id}`},children:[a.jsx("td",{children:a.jsx(At,{status:p.status})}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:p.sourceName}),a.jsx("td",{className:"text-muted",style:{fontSize:12},children:p.graphName??p.graphId}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:al(p.updatedAt)})]},p.id))})]}),a.jsx(ir,{loaded:c.length,total:o,hasMore:f,isFetchingNextPage:r.isFetchingNextPage,onLoadMore:h})]})}function mC({entity:l,recordId:s,contentType:r,graphs:c}){const o=Object.values(c);return o.length===0?a.jsx(kt,{title:"No processing yet",message:"This item has not been processed by any graph."}):a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Graph"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Version"}),a.jsx("th",{children:"Run"}),a.jsx("th",{children:"Processed at"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:o.map(f=>a.jsx(pC,{entity:l,recordId:s,contentType:r,graph:f},f.graphId))})]})})}function pC({entity:l,recordId:s,contentType:r,graph:c}){const o=ve({queryKey:["journal-run-status",c.lastRunId],queryFn:()=>ne.factoryRun(c.lastRunId),enabled:!!c.lastRunId&&c.lastStatus==="running"}),f=o.data&&["pending","running","blocked"].includes(o.data.status),h=c.lastStatus==="running"&&c.lastRunId&&!f&&!o.isLoading,m=st({mutationFn:()=>ne.resetGraphRun(l,s,c.graphId,r),onSuccess:()=>{window.location.reload()}});return a.jsxs("tr",{style:{cursor:"default"},children:[a.jsx("td",{className:"mono",style:{fontSize:12},children:c.graphName??c.graphId}),a.jsx("td",{children:a.jsx(At,{status:c.lastStatus})}),a.jsx("td",{className:"text-muted",children:c.graphVersion??"—"}),a.jsx("td",{children:c.lastRunId?a.jsx(me,{to:`/journal/${c.lastRunId}`,className:"mono",style:{fontSize:12},children:c.lastRunId}):"—"}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:Rt(c.processedAt)}),a.jsx("td",{children:h&&a.jsx("button",{className:"btn btn-sm",disabled:m.isPending,onClick:()=>{window.confirm("Reset stuck processing stamp on this item?")&&m.mutate()},children:m.isPending?"Resetting…":"Reset stuck"})})]})}function Cs({k:l,v:s}){return a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:l}),a.jsx("span",{className:"detail-val",children:s})]})}function yC(l){return{stepKey:l.stepKey,label:l.label,durations:[],inputBytes:[],outputBytes:[],promptTokens:[],completionTokens:[],totalTokens:[],costUsd:[],plannedSamples:0,measuredSamples:0}}function gC(l,s){var r,c,o;if(s.planned&&s.durationMs==null){l.plannedSamples+=1;return}l.measuredSamples+=1,s.durationMs!=null&&l.durations.push(s.durationMs),s.inputBytes!=null&&l.inputBytes.push(s.inputBytes),s.outputBytes!=null&&l.outputBytes.push(s.outputBytes),((r=s.tokens)==null?void 0:r.prompt)!=null&&l.promptTokens.push(s.tokens.prompt),((c=s.tokens)==null?void 0:c.completion)!=null&&l.completionTokens.push(s.tokens.completion),((o=s.tokens)==null?void 0:o.total)!=null&&l.totalTokens.push(s.tokens.total),s.costUsd!=null&&l.costUsd.push(s.costUsd)}function Nf(l){if(l.length!==0)return l.reduce((s,r)=>s+r,0)/l.length}function xn(l){return l.length===0?{}:{avg:Nf(l),min:Math.min(...l),max:Math.max(...l)}}function jn(l,s){const r={};return s.avg!=null&&(r[`avg${l}`]=s.avg),s.min!=null&&(r[`min${l}`]=s.min),s.max!=null&&(r[`max${l}`]=s.max),r}function vC(l){return l&&typeof l=="object"&&!Array.isArray(l)?l:void 0}function xC(l){if(l.status!=="done")return!1;const s=vC(l.result);return(s==null?void 0:s.status)!=="failed"}function vg(l){return l.includes("Web")||l.includes("Pre")||l.includes("Narrix")?0:l.includes("Main")?1:l.includes("Post")||l.includes("Audit")||l.includes("Polish")?2:3}function jC(l){return[...l.values()].map(s=>{const r=s.durations.length,c=s.measuredSamples===0&&s.plannedSamples>0,o=xn(s.inputBytes),f=xn(s.outputBytes),h=xn(s.promptTokens),m=xn(s.completionTokens),p=xn(s.totalTokens),g=xn(s.costUsd);return{stepKey:s.stepKey,label:s.label,sampleCount:Math.max(s.measuredSamples,s.plannedSamples),...r>0?{avgDurationMs:Nf(s.durations),minDurationMs:Math.min(...s.durations),maxDurationMs:Math.max(...s.durations)}:{},...jn("InputBytes",o),...jn("OutputBytes",f),...jn("PromptTokens",h),...jn("CompletionTokens",m),...jn("TotalTokens",p),...jn("CostUsd",g),plannedOnly:c}}).sort((s,r)=>vg(s.label)-vg(r.label)||s.label.localeCompare(r.label))}function bC(l){const s=wv(l.result);if(Object.keys(s).length===0)return null;const r=Mv(s,[],l.result),c=Xc(r);return c?{runId:l.id,graphId:l.graphId,completedAt:l.updatedAt,entity:l.entity,recordLabel:l.recordLabel,wallDurationMs:c.totalDurationMs,nodeCount:c.nodeCount,parallelPairCount:c.parallelPairCount,rows:r}:null}function Gv(l,s){var p,g,x;const r=new Map,c=[];let o=0,f=0,h=0;for(const v of s){if(!xC(v))continue;const N=bC(v);if(N){o+=1,f+=N.wallDurationMs,h+=N.parallelPairCount,c.length<8&&c.push(N);for(const b of N.rows){let C=r.get(b.nodeId);if(C||(C={nodeId:b.nodeId,skillKey:b.skillKey,durations:[],startedAtSamples:[],failCount:0,parallelSampleCount:0,inputBytes:[],outputBytes:[],promptTokens:[],completionTokens:[],totalTokens:[],costUsd:[],subSteps:new Map},r.set(b.nodeId,C)),b.skillKey&&!C.skillKey&&(C.skillKey=b.skillKey),!b.ok){C.failCount+=1;continue}C.durations.push(b.durationMs),C.startedAtSamples.push(b.startedAt),b.concurrentWith.length>0&&(C.parallelSampleCount+=1);const A=Ev(b,v.result);A.inputBytes!=null&&C.inputBytes.push(A.inputBytes),A.outputBytes!=null&&C.outputBytes.push(A.outputBytes),((p=A.tokens)==null?void 0:p.prompt)!=null&&C.promptTokens.push(A.tokens.prompt),((g=A.tokens)==null?void 0:g.completion)!=null&&C.completionTokens.push(A.tokens.completion),((x=A.tokens)==null?void 0:x.total)!=null&&C.totalTokens.push(A.tokens.total),A.costUsd!=null&&C.costUsd.push(A.costUsd);for(const z of b.subSteps??[]){let D=C.subSteps.get(z.stepKey);D||(D=yC(z),C.subSteps.set(z.stepKey,D)),gC(D,z)}}}}const m=[...r.values()].map(v=>{const N=v.durations.reduce((W,V)=>W+V,0),b=v.durations.length,C=xn(v.inputBytes),A=xn(v.outputBytes),z=xn(v.promptTokens),D=xn(v.completionTokens),F=xn(v.totalTokens),$=xn(v.costUsd),U=jC(v.subSteps),Z=Nf(v.startedAtSamples)??0;return{nodeId:v.nodeId,skillKey:v.skillKey,sampleCount:b,avgDurationMs:b>0?N/b:0,minDurationMs:b>0?Math.min(...v.durations):0,maxDurationMs:b>0?Math.max(...v.durations):0,failCount:v.failCount,parallelSampleCount:v.parallelSampleCount,avgStartedAt:b>0?Z:Number.POSITIVE_INFINITY,...jn("InputBytes",C),...jn("OutputBytes",A),...jn("PromptTokens",z),...jn("CompletionTokens",D),...jn("TotalTokens",F),...jn("CostUsd",$),...U.length>0?{subSteps:U}:{}}}).sort((v,N)=>yf({nodeId:v.nodeId,skillKey:v.skillKey,startedAt:v.avgStartedAt},{nodeId:N.nodeId,skillKey:N.skillKey,startedAt:N.avgStartedAt})).map(({avgStartedAt:v,...N})=>N);return{graphId:l,runsSampled:s.length,runsWithTrace:o,nodes:m,recentSamples:c,totals:{...o>0?{avgWallDurationMs:f/o}:{},...o>0?{avgParallelPairsPerRun:h/o}:{}}}}function SC(l,s,r){const c=new Map;for(const g of s){const x=c.get(g.graphId)??[];x.push(g),c.set(g.graphId,x)}const o=[],f=[];let h=0,m=0,p=0;for(const[g,x]of c){const v=Gv(g,x);h+=v.runsWithTrace,v.totals.avgWallDurationMs!=null&&(m+=v.totals.avgWallDurationMs*v.runsWithTrace),v.totals.avgParallelPairsPerRun!=null&&(p+=v.totals.avgParallelPairsPerRun*v.runsWithTrace),f.push(...v.recentSamples),o.push({graphId:g,graphName:r==null?void 0:r[g],runsSampled:v.runsSampled,runsWithTrace:v.runsWithTrace,totals:v.totals,nodes:v.nodes,recentSamples:v.recentSamples})}return o.sort((g,x)=>{const v=(g.graphName??g.graphId).toLowerCase(),N=(x.graphName??x.graphId).toLowerCase();return v.localeCompare(N)}),f.sort((g,x)=>x.completedAt.localeCompare(g.completedAt)),{entity:l,runsSampled:s.length,runsWithTrace:h,graphCount:o.length,graphs:o,recentSamples:f.slice(0,12),totals:{...h>0?{avgWallDurationMs:m/h}:{},...h>0?{avgParallelPairsPerRun:p/h}:{}}}}function Xi(l,s){return s!=null&&s.trim()?s.trim():Hc({graphId:l,name:s})}function Wd(l){return`/pipelines/${encodeURIComponent(l)}`}function Kv(l){return`/pipelines/entity/${encodeURIComponent(l)}`}function Cf({mode:l}){return a.jsxs("div",{className:"pipeline-diagram-tabs",style:{marginBottom:16},children:[a.jsx(me,{to:"/pipelines",className:l==="graph"?"active":"",style:{textDecoration:"none"},children:"By pipeline"}),a.jsx(me,{to:"/pipelines?view=entity",className:l==="entity"?"active":"",style:{textDecoration:"none"},children:"By entity"})]})}function Es(l,s,r){return{...l!=null?{avg:l}:{},...s!=null?{min:s}:{},...r!=null?{max:r}:{}}}function Ts({stats:l,format:s}){return l.avg==null&&l.min==null&&l.max==null?a.jsx("span",{className:"text-dim",children:"—"}):a.jsxs("div",{className:"pipeline-stat-cell",children:[l.avg!=null&&a.jsx("div",{children:s(l.avg)}),l.min!=null&&l.max!=null&&a.jsxs("div",{className:"pipeline-stat-range text-dim",children:[s(l.min)," – ",s(l.max)]})]})}function Ad(l,s){const r=s==="avg"?"avg":s==="min"?"min":"max",c=l[`${r}PromptTokens`],o=l[`${r}CompletionTokens`],f=l[`${r}TotalTokens`];if(!(typeof c!="number"&&typeof o!="number"&&typeof f!="number"))return{...typeof c=="number"?{prompt:Math.round(c)}:{},...typeof o=="number"?{completion:Math.round(o)}:{},...typeof f=="number"?{total:Math.round(f)}:{}}}function xg({row:l}){const s=Ad(l,"avg"),r=Ad(l,"min"),c=Ad(l,"max");return!s&&!r&&!c?a.jsx("span",{className:"text-dim",children:"—"}):a.jsxs("div",{className:"pipeline-stat-cell",children:[s&&a.jsx("div",{style:{fontSize:11},children:Yi(s)}),r&&c&&a.jsxs("div",{className:"pipeline-stat-range text-dim",style:{fontSize:10},children:[Yi(r)," – ",Yi(c)]})]})}function Iv({nodes:l,runsWithTrace:s}){if(l.length===0)return null;const r=l.some(c=>{var o;return(((o=c.subSteps)==null?void 0:o.length)??0)>0});return a.jsxs("div",{className:"table-wrap",style:{marginTop:12},children:[a.jsxs("table",{className:"data-table pipeline-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:r?"Node / step":"Node"}),a.jsx("th",{children:"Skill"}),a.jsx("th",{children:"Samples"}),a.jsx("th",{children:"Avg duration"}),a.jsx("th",{children:"Min duration"}),a.jsx("th",{children:"Max duration"}),a.jsx("th",{children:"Input"}),a.jsx("th",{children:"Output"}),a.jsx("th",{children:"Tokens"}),a.jsx("th",{children:"Cost"}),a.jsx("th",{children:"Parallel runs"}),a.jsx("th",{children:"Failures"})]})}),a.jsx("tbody",{children:l.flatMap(c=>{const o=[a.jsxs("tr",{children:[a.jsx("td",{className:"mono",children:c.nodeId}),a.jsx("td",{className:"mono text-dim",style:{fontSize:12},children:c.skillKey||"—"}),a.jsx("td",{children:c.sampleCount>0?c.sampleCount:"—"}),a.jsx("td",{children:c.sampleCount>0?Ve(c.avgDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:c.sampleCount>0?Ve(c.minDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:c.sampleCount>0?Ve(c.maxDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(c.avgInputBytes,c.minInputBytes,c.maxInputBytes),format:Sn})}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(c.avgOutputBytes,c.minOutputBytes,c.maxOutputBytes),format:Sn})}),a.jsx("td",{className:"text-dim",children:a.jsx(xg,{row:c})}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(c.avgCostUsd,c.minCostUsd,c.maxCostUsd),format:Uc})}),a.jsx("td",{className:"text-dim",children:c.parallelSampleCount>0?c.parallelSampleCount:"—"}),a.jsx("td",{style:{color:c.failCount>0?"var(--status-failed)":void 0},children:c.failCount>0?c.failCount:"—"})]},c.nodeId)];for(const f of c.subSteps??[])o.push(a.jsxs("tr",{className:"pipeline-substep-row",children:[a.jsxs("td",{className:"mono pipeline-substep-label",children:[a.jsx("span",{className:"pipeline-substep-marker",children:"↳"}),f.label,f.plannedOnly&&a.jsx("span",{className:"chip text-dim",style:{marginLeft:6,fontSize:10},children:"planned"})]}),a.jsx("td",{className:"text-dim",children:"—"}),a.jsx("td",{children:f.sampleCount}),a.jsx("td",{children:f.avgDurationMs!=null?Ve(f.avgDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:f.minDurationMs!=null?Ve(f.minDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:f.maxDurationMs!=null?Ve(f.maxDurationMs):"—"}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(f.avgInputBytes,f.minInputBytes,f.maxInputBytes),format:Sn})}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(f.avgOutputBytes,f.minOutputBytes,f.maxOutputBytes),format:Sn})}),a.jsx("td",{className:"text-dim",children:a.jsx(xg,{row:f})}),a.jsx("td",{className:"text-dim",children:a.jsx(Ts,{stats:Es(f.avgCostUsd,f.minCostUsd,f.maxCostUsd),format:Uc})}),a.jsx("td",{className:"text-dim",children:"—"}),a.jsx("td",{className:"text-dim",children:"—"})]},`${c.nodeId}:${f.stepKey}`));return o})})]}),a.jsxs("p",{className:"text-dim",style:{fontSize:11,marginTop:8},children:["Based on ",s," successful traced run",s===1?"":"s"," for this pipeline. Averages and min–max ranges use successful node executions only; failed runs and failed nodes are excluded.",r&&a.jsxs(a.Fragment,{children:[" ","Sub-steps come from execution trace units and ai-tasks pipeline metadata when persisted on runs."]})]})]})}function NC(){var p,g;const l=En(),[s]=Xs(),r=s.get("view")==="entity"?"entity":"graph",{agentQueryParam:c}=Cn(),o=ve({queryKey:["entities",c??"all"],queryFn:()=>ne.listEntities(c)}),f=ve({queryKey:["meta-graphs"],queryFn:()=>ne.compatibleGraphs()}),h=((p=f.data)==null?void 0:p.graphs)??[],m=((g=f.data)==null?void 0:g.cataloxAuthoritative)===!1?"Catalox unavailable — showing legacy registry graphs only.":"Pipelines listed from Graphs Studio (Catalox).";return a.jsxs("div",{children:[a.jsx("div",{className:"page-header",children:a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:"Pipeline analytics"}),a.jsx("span",{className:"page-subtitle",children:"Aggregated timing and parallelism — browse by pipeline (graph) or by entity type."})]})}),a.jsx(Cf,{mode:r}),r==="graph"?a.jsxs(a.Fragment,{children:[f.isError&&a.jsx(Nt,{title:"Failed to load pipelines",detail:f.error}),f.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading pipelines from Catalox…"]}),!f.isLoading&&h.length===0&&a.jsx("p",{className:"text-muted",style:{fontSize:13},children:"No pipelines in Catalox yet. Author graphs in Graphs Studio, then return here."}),a.jsxs("div",{className:"card",style:{marginTop:16},children:[a.jsx("div",{className:"card-title",children:"Choose a pipeline"}),a.jsx("p",{className:"text-dim",style:{fontSize:12,marginBottom:12},children:m}),a.jsx("div",{className:"pipeline-graph-picker",children:h.map(x=>a.jsxs("button",{type:"button",className:"pipeline-graph-pick",onClick:()=>l(Wd(x.graphId)),children:[a.jsx("span",{style:{fontSize:13},children:Xi(x.graphId,x.name)}),a.jsx("span",{className:"text-dim mono",style:{fontSize:11},children:x.graphId})]},x.graphId))})]})]}):a.jsxs(a.Fragment,{children:[o.isError&&a.jsx(Nt,{title:"Failed to load entities",detail:o.error}),o.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading entity types…"]}),!o.isLoading&&(o.data??[]).length===0&&a.jsx("p",{className:"text-muted",style:{fontSize:13},children:"No entity types configured."}),a.jsxs("div",{className:"card",style:{marginTop:16},children:[a.jsx("div",{className:"card-title",children:"Choose an entity type"}),a.jsx("p",{className:"text-dim",style:{fontSize:12,marginBottom:12},children:"Aggregates completed runs across all pipelines for that object type."}),a.jsx("div",{className:"pipeline-graph-picker",children:(o.data??[]).map(x=>a.jsxs("button",{type:"button",className:"pipeline-graph-pick",onClick:()=>l(Kv(x.name)),children:[a.jsx("span",{style:{fontSize:13},children:x.label}),a.jsx("span",{className:"text-dim mono",style:{fontSize:11},children:x.name})]},x.name))})]})]}),a.jsx(Fc,{variant:"full"})]})}function CC({graphId:l}){var N,b,C;const s=En(),{agentQueryParam:r}=Cn(),o=(N=ve({queryKey:["meta-graphs"],queryFn:()=>ne.compatibleGraphs()}).data)==null?void 0:N.graphs.find(A=>A.graphId===l),f=Xi(l,o==null?void 0:o.name),h=ve({queryKey:["pipeline-insights-runs",l,r??"all"],queryFn:()=>ne.factoryRuns({agent:r,graphId:l,status:"done",pageSize:100}),enabled:!!l}),m=S.useMemo(()=>{var A;return(A=h.data)!=null&&A.runs?Gv(l,h.data.runs):null},[l,(b=h.data)==null?void 0:b.runs]),p=(C=h.data)==null?void 0:C.runs.find(A=>A.result!=null),[g,x]=S.useState(null),v=S.useMemo(()=>m!=null&&m.recentSamples.length?g?m.recentSamples.find(A=>A.runId===g)??m.recentSamples[0]:m.recentSamples[0]:null,[m==null?void 0:m.recentSamples,g]);return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/pipelines",children:"Pipeline analytics"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),a.jsx("span",{children:f})]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:f}),a.jsx("span",{className:"page-subtitle mono",children:l})]}),a.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[a.jsx(me,{className:"btn",to:`/journal?graphId=${encodeURIComponent(l)}`,children:"Journal entries"}),a.jsx("button",{type:"button",className:"btn",onClick:()=>s("/pipelines"),children:"Change pipeline"})]})]}),a.jsx(Cf,{mode:"graph"}),a.jsx(Fc,{graphId:l,variant:"full"}),h.isError&&a.jsx(Nt,{title:"Failed to load runs",detail:h.error}),h.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading completed runs…"]}),m&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"detail-grid",style:{marginBottom:16},children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Sample"}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Completed runs"}),a.jsx("span",{className:"detail-val",children:m.runsSampled})]}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"With trace data"}),a.jsx("span",{className:"detail-val",children:m.runsWithTrace})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Averages"}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Wall time / run"}),a.jsx("span",{className:"detail-val",children:Ve(m.totals.avgWallDurationMs)})]}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Parallel pairs / run"}),a.jsx("span",{className:"detail-val",children:m.totals.avgParallelPairsPerRun!=null?m.totals.avgParallelPairsPerRun.toFixed(1):"—"})]})]})]}),m.runsWithTrace===0&&a.jsxs("div",{className:"run-io-warning",style:{marginBottom:16},children:["No completed runs in this sample include ",a.jsx("span",{className:"mono",children:"execution._trace"}),"."]}),v&&v.rows.length>0&&a.jsxs(bn,{title:"Typical execution pattern",summary:`From run ${v.runId.slice(0,8)}… · ${v.parallelPairCount>0?"parallel batches":"sequential"}`,defaultOpen:!0,style:{marginBottom:16},children:[a.jsxs("div",{className:"filter-group",style:{marginBottom:12,maxWidth:360},children:[a.jsx("label",{children:"Example run for diagram"}),a.jsx("select",{value:v.runId,onChange:A=>x(A.target.value),children:m.recentSamples.map(A=>a.jsxs("option",{value:A.runId,children:[A.runId.slice(0,8),"… · ",A.recordLabel??A.entity," · ",Ve(A.wallDurationMs)]},A.runId))})]}),a.jsx(Dv,{rows:v.rows,title:"How nodes ran"}),a.jsxs("p",{className:"text-dim",style:{fontSize:12,marginTop:12},children:[a.jsx(me,{to:`/journal/${v.runId}`,children:"Open full run detail"})," for per-node logs and payloads."]})]}),m.nodes.length>0&&a.jsx(bn,{title:"Per-node aggregates",summary:`${m.nodes.length} nodes · last ${m.runsWithTrace} traced runs`,defaultOpen:!0,style:{marginBottom:16},children:a.jsx(Iv,{nodes:m.nodes,runsWithTrace:m.runsWithTrace})}),m.recentSamples.length>0&&a.jsx(bn,{title:"Recent runs",summary:`${m.recentSamples.length} with trace`,defaultOpen:!1,style:{marginBottom:16},children:a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{className:"data-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Run"}),a.jsx("th",{children:"Entity"}),a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Wall"}),a.jsx("th",{children:"Nodes"}),a.jsx("th",{children:"Parallel pairs"}),a.jsx("th",{children:"Completed"})]})}),a.jsx("tbody",{children:m.recentSamples.map(A=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsxs(me,{to:`/journal/${A.runId}`,className:"mono",style:{fontSize:12},children:[A.runId.slice(0,8),"…"]})}),a.jsx("td",{className:"mono",children:a.jsx(me,{to:Kv(A.entity),children:A.entity})}),a.jsx("td",{className:"mono text-dim",children:A.recordLabel??"—"}),a.jsx("td",{children:Ve(A.wallDurationMs)}),a.jsx("td",{children:A.nodeCount}),a.jsx("td",{children:A.parallelPairCount>0?A.parallelPairCount:"—"}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:Rt(A.completedAt)})]},A.runId))})]})})})]}),p&&a.jsx(bn,{title:"Latest run detail",summary:p.recordLabel??p.recordId,defaultOpen:(m==null?void 0:m.runsWithTrace)===0,style:{marginBottom:16},children:a.jsx(kv,{runId:p.id,status:p.status,result:p.result})})]})}function EC({entityName:l}){var N,b;const s=En(),{agentQueryParam:r}=Cn(),o=(ve({queryKey:["entities",r??"all"],queryFn:()=>ne.listEntities(r)}).data??[]).find(C=>C.name===l),f=(o==null?void 0:o.label)??l,h=ve({queryKey:["meta-graphs"],queryFn:()=>ne.compatibleGraphs()}),m=S.useMemo(()=>{var A;const C={};for(const z of((A=h.data)==null?void 0:A.graphs)??[])C[z.graphId]=Xi(z.graphId,z.name);return C},[(N=h.data)==null?void 0:N.graphs]),p=ve({queryKey:["pipeline-insights-entity-runs",l,r??"all"],queryFn:()=>ne.factoryRuns({agent:r,entity:l,status:"done",pageSize:100}),enabled:!!l}),g=S.useMemo(()=>{var C;return(C=p.data)!=null&&C.runs?SC(l,p.data.runs,m):null},[l,(b=p.data)==null?void 0:b.runs,m]),[x,v]=S.useState(null);return a.jsxs("div",{children:[a.jsxs("div",{className:"breadcrumb",children:[a.jsx(me,{to:"/pipelines?view=entity",children:"Pipeline analytics"}),a.jsx("span",{className:"breadcrumb-sep",children:"/"}),a.jsx("span",{children:f})]}),a.jsxs("div",{className:"page-header",style:{justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[a.jsxs("div",{children:[a.jsx("h1",{className:"page-title",children:f}),a.jsx("span",{className:"page-subtitle mono",children:l})]}),a.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[a.jsx(me,{className:"btn",to:`/journal?entity=${encodeURIComponent(l)}`,children:"Journal entries"}),a.jsx("button",{type:"button",className:"btn",onClick:()=>s("/pipelines?view=entity"),children:"Change entity"})]})]}),a.jsx(Cf,{mode:"entity"}),a.jsx(Fc,{variant:"full"}),p.isError&&a.jsx(Nt,{title:"Failed to load runs",detail:p.error}),p.isLoading&&a.jsxs("div",{className:"loading-row",children:[a.jsx("span",{className:"spinner"})," Loading completed runs…"]}),g&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"detail-grid",style:{marginBottom:16},children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Sample"}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Completed runs"}),a.jsx("span",{className:"detail-val",children:g.runsSampled})]}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"With trace data"}),a.jsx("span",{className:"detail-val",children:g.runsWithTrace})]}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Pipelines used"}),a.jsx("span",{className:"detail-val",children:g.graphCount})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"card-title",children:"Averages (all pipelines)"}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Wall time / run"}),a.jsx("span",{className:"detail-val",children:Ve(g.totals.avgWallDurationMs)})]}),a.jsxs("div",{className:"detail-row",children:[a.jsx("span",{className:"detail-key",children:"Parallel pairs / run"}),a.jsx("span",{className:"detail-val",children:g.totals.avgParallelPairsPerRun!=null?g.totals.avgParallelPairsPerRun.toFixed(1):"—"})]})]})]}),g.graphCount>0&&a.jsxs(bn,{title:"By pipeline",summary:`${g.graphCount} pipeline${g.graphCount===1?"":"s"} · ${g.runsWithTrace} traced runs`,defaultOpen:!0,style:{marginBottom:16},children:[a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{className:"data-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Pipeline"}),a.jsx("th",{children:"Runs"}),a.jsx("th",{children:"Traced"}),a.jsx("th",{children:"Avg wall"}),a.jsx("th",{children:"Parallel pairs"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:g.graphs.map(C=>a.jsxs("tr",{children:[a.jsxs("td",{children:[a.jsx("div",{children:C.graphName??Xi(C.graphId)}),a.jsx("div",{className:"mono text-dim",style:{fontSize:11},children:C.graphId})]}),a.jsx("td",{children:C.runsSampled}),a.jsx("td",{children:C.runsWithTrace}),a.jsx("td",{children:Ve(C.totals.avgWallDurationMs)}),a.jsx("td",{children:C.totals.avgParallelPairsPerRun!=null?C.totals.avgParallelPairsPerRun.toFixed(1):"—"}),a.jsx("td",{children:a.jsx(me,{to:Wd(C.graphId),style:{fontSize:12},children:"Pipeline detail →"})})]},C.graphId))})]})}),g.graphs.some(C=>C.nodes.length>0)&&a.jsxs("div",{style:{marginTop:16},children:[a.jsx("div",{className:"section-title",style:{fontSize:13,marginBottom:8},children:"Per-pipeline node breakdown"}),g.graphs.filter(C=>C.nodes.length>0).map(C=>{const A=x===C.graphId;return a.jsxs("div",{className:`pipeline-node-inspector-item${A?" open":""}`,style:{marginBottom:6},children:[a.jsxs("button",{type:"button",className:"pipeline-node-inspector-head",onClick:()=>v(A?null:C.graphId),"aria-expanded":A,children:[a.jsx("span",{className:"pipeline-node-inspector-chevron",children:A?"▾":"▸"}),a.jsx("span",{children:C.graphName??Xi(C.graphId)}),a.jsx("span",{className:"text-dim mono",style:{fontSize:11},children:C.graphId}),a.jsxs("span",{className:"text-dim",style:{fontSize:12},children:[C.nodes.length," nodes · ",C.runsWithTrace," traced"]})]}),A&&a.jsx(Iv,{nodes:C.nodes,runsWithTrace:C.runsWithTrace})]},C.graphId)})]})]}),g.recentSamples.length>0&&a.jsx(bn,{title:"Recent runs",summary:`${g.recentSamples.length} with trace`,defaultOpen:!1,style:{marginBottom:16},children:a.jsx("div",{className:"table-wrap",children:a.jsxs("table",{className:"data-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Run"}),a.jsx("th",{children:"Pipeline"}),a.jsx("th",{children:"Item"}),a.jsx("th",{children:"Wall"}),a.jsx("th",{children:"Nodes"}),a.jsx("th",{children:"Completed"})]})}),a.jsx("tbody",{children:g.recentSamples.map(C=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsxs(me,{to:`/journal/${C.runId}`,className:"mono",style:{fontSize:12},children:[C.runId.slice(0,8),"…"]})}),a.jsx("td",{children:a.jsx(me,{to:Wd(C.graphId),style:{fontSize:12},children:m[C.graphId]??C.graphId})}),a.jsx("td",{className:"mono text-dim",children:C.recordLabel??"—"}),a.jsx("td",{children:Ve(C.wallDurationMs)}),a.jsx("td",{children:C.nodeCount}),a.jsx("td",{className:"text-dim",style:{fontSize:12},children:Rt(C.completedAt)})]},C.runId))})]})})})]})]})}function wd(){const{graphId:l,entityName:s}=Ys();return s?a.jsx(EC,{entityName:s}):l?a.jsx(CC,{graphId:l}):a.jsx(NC,{})}const Yv=S.createContext("Exellix"),Xv=S.createContext(null);function TC(){return S.useContext(Yv)}function RC(){return S.useContext(Xv)}function AC({children:l}){const{data:s}=ve({queryKey:["config"],queryFn:ne.config,staleTime:1/0}),r=(s==null?void 0:s.name)||"Exellix";return S.useEffect(()=>{document.title=`${r} Jobs`},[r]),a.jsx(Xv.Provider,{value:s??null,children:a.jsx(Yv.Provider,{value:r,children:l})})}const Ka={overview:"Overview",work:"Work",onDemand:"On-Demand",information:"Information",outputs:"Outputs",journal:"Journal",pipelines:"Pipeline analytics",settings:"Settings"},wC="2.0.3",OC="/api/agents";class MC extends S.Component{constructor(){super(...arguments);Ey(this,"state",{error:null,componentStack:null})}static getDerivedStateFromError(r){return{error:r,componentStack:null}}componentDidCatch(r,c){console.error("UI error:",r,c),this.setState({componentStack:c.componentStack??null})}render(){return this.state.error?a.jsxs("div",{style:{padding:32},children:[a.jsxs("div",{className:"error-state",children:[a.jsx("strong",{children:"Something went wrong on this page."}),a.jsx("pre",{style:{marginTop:8,fontSize:11,whiteSpace:"pre-wrap"},children:this.state.error.message}),this.state.componentStack&&a.jsx("pre",{style:{marginTop:8,fontSize:10,whiteSpace:"pre-wrap",opacity:.75},children:this.state.componentStack})]}),a.jsx("button",{style:{marginTop:12},onClick:()=>this.setState({error:null,componentStack:null}),children:"Try again"})]}):this.props.children}}function zC(){const l=sn(),s=TC(),r=RC(),c=o=>o==="/"?l.pathname==="/":o==="/information"?l.pathname.startsWith("/information"):o==="/outputs"?l.pathname.startsWith("/outputs")||l.search.includes("view=outputs"):o==="/journal"?l.pathname.startsWith("/journal"):o==="/pipelines"?l.pathname.startsWith("/pipelines"):l.pathname.startsWith(o);return a.jsxs("header",{className:"topbar",children:[a.jsxs("div",{className:"topbar-brand",children:[a.jsx("span",{className:"topbar-brand-icon",children:"⚙"}),a.jsxs("span",{children:[a.jsx("span",{style:{color:"var(--color-text)"},children:s})," ",a.jsx("span",{children:"Jobs"})]}),a.jsxs("span",{className:"app-pkg-version",children:["v",wC]})]}),a.jsxs("nav",{className:"topbar-nav",children:[a.jsx(oa,{to:"/",className:c("/")?"active":"",children:Ka.overview}),a.jsx(oa,{to:"/work",className:c("/work")?"active":"",children:Ka.work}),a.jsx(oa,{to:"/on-demand",className:c("/on-demand")?"active":"",children:Ka.onDemand}),a.jsx(oa,{to:"/information",className:c("/information")?"active":"",children:Ka.information}),a.jsx(oa,{to:"/outputs",className:c("/outputs")?"active":"",children:Ka.outputs}),a.jsx(oa,{to:"/journal",className:c("/journal")?"active":"",children:Ka.journal}),a.jsx(oa,{to:"/pipelines",className:c("/pipelines")?"active":"",children:Ka.pipelines}),a.jsx(oa,{to:"/settings",className:c("/settings")?"active":"",children:Ka.settings})]}),a.jsxs("div",{className:"topbar-meta",children:[a.jsxs("div",{className:"topbar-meta-controls",children:[a.jsx(vv,{}),a.jsx(y0,{apiBase:OC,className:"topbar-agent-scope"})]}),r&&a.jsxs("span",{className:"topbar-meta-host mono",title:`${r.runtimeDb} @ ${r.mongoHost}`,children:[r.runtimeDb," @ ",r.mongoHost]})]})]})}const dt=l=>a.jsx(MC,{children:l});function DC(){return a.jsx(QS,{children:a.jsxs("div",{className:"layout",children:[a.jsx(zC,{}),a.jsx("main",{className:"page",children:a.jsxs(pS,{children:[a.jsx($e,{path:"/",element:dt(a.jsx(iN,{}))}),a.jsx($e,{path:"/settings",element:dt(a.jsx(cN,{}))}),a.jsx($e,{path:"/work",element:dt(a.jsx(N1,{}))}),a.jsx($e,{path:"/work/new",element:dt(a.jsx(Q1,{}))}),a.jsx($e,{path:"/work/:id",element:dt(a.jsx(K1,{}))}),a.jsx($e,{path:"/on-demand",element:dt(a.jsx(X1,{}))}),a.jsx($e,{path:"/on-demand/single",element:dt(a.jsx(sC,{}))}),a.jsx($e,{path:"/on-demand/batch",element:dt(a.jsx(rC,{}))}),a.jsx($e,{path:"/on-demand/batch/:id",element:dt(a.jsx(cC,{}))}),a.jsx($e,{path:"/information",element:dt(a.jsx(yg,{}))}),a.jsx($e,{path:"/information/:recordId",element:dt(a.jsx(gg,{}))}),a.jsx($e,{path:"/outputs",element:dt(a.jsx(yg,{}))}),a.jsx($e,{path:"/outputs/:recordId",element:dt(a.jsx(gg,{}))}),a.jsx($e,{path:"/journal",element:dt(a.jsx(hN,{}))}),a.jsx($e,{path:"/journal/:id",element:dt(a.jsx(p1,{}))}),a.jsx($e,{path:"/pipelines",element:dt(a.jsx(wd,{}))}),a.jsx($e,{path:"/pipelines/entity/:entityName",element:dt(a.jsx(wd,{}))}),a.jsx($e,{path:"/pipelines/:graphId",element:dt(a.jsx(wd,{}))}),a.jsx($e,{path:"/items/:itemId",element:dt(a.jsx(S1,{}))}),a.jsx($e,{path:"/records",element:a.jsx(ra,{to:"/information",replace:!0})}),a.jsx($e,{path:"/records/:recordId",element:a.jsx(ra,{to:"/information",replace:!0})}),a.jsx($e,{path:"/runs",element:a.jsx(ra,{to:"/journal",replace:!0})}),a.jsx($e,{path:"/runs/:id",element:a.jsx(ra,{to:"/journal",replace:!0})}),a.jsx($e,{path:"/sources",element:a.jsx(ra,{to:"/information",replace:!0})}),a.jsx($e,{path:"/job-defs",element:a.jsx(ra,{to:"/work",replace:!0})}),a.jsx($e,{path:"/job-defs/:id",element:a.jsx(ra,{to:"/work",replace:!0})}),a.jsx($e,{path:"/jobs/new",element:a.jsx(ra,{to:"/on-demand",replace:!0})}),a.jsx($e,{path:"*",element:a.jsx(ra,{to:"/",replace:!0})})]})})]})})}const kC=new e0({defaultOptions:{queries:{retry:1,staleTime:2e3}}}),Fv=document.getElementById("root");if(!Fv)throw new Error("No #root element");Rb.createRoot(Fv).render(a.jsx(S.StrictMode,{children:a.jsx(t0,{client:kC,children:a.jsx(AC,{children:a.jsx(h0,{storageKey:"exellix-memorix-ui.selected-agent",children:a.jsx(DC,{})})})})}));