diff --git a/areno/dashboard/dist/assets/index-BeP2LTzY.js b/areno/dashboard/dist/assets/index-BeP2LTzY.js new file mode 100644 index 00000000..95a1dfeb --- /dev/null +++ b/areno/dashboard/dist/assets/index-BeP2LTzY.js @@ -0,0 +1,207 @@ +(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const h of s)if(h.type==="childList")for(const f of h.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function r(s){const h={};return s.integrity&&(h.integrity=s.integrity),s.referrerPolicy&&(h.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?h.credentials="include":s.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(s){if(s.ep)return;s.ep=!0;const h=r(s);fetch(s.href,h)}})();function Xp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vo={exports:{}},Ua={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ym;function S0(){if(Ym)return Ua;Ym=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(u,s,h){var f=null;if(h!==void 0&&(f=""+h),s.key!==void 0&&(f=""+s.key),"key"in s){h={};for(var m in s)m!=="key"&&(h[m]=s[m])}else h=s;return s=h.ref,{$$typeof:n,type:u,key:f,ref:s!==void 0?s:null,props:h}}return Ua.Fragment=a,Ua.jsx=r,Ua.jsxs=r,Ua}var Gm;function k0(){return Gm||(Gm=1,Vo.exports=S0()),Vo.exports}var v=k0(),Qo={exports:{}},ke={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vm;function _0(){if(Vm)return ke;Vm=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function k(T){return T===null||typeof T!="object"?null:(T=S&&T[S]||T["@@iterator"],typeof T=="function"?T:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,Q={};function O(T,Y,_){this.props=T,this.context=Y,this.refs=Q,this.updater=_||C}O.prototype.isReactComponent={},O.prototype.setState=function(T,Y){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,Y,"setState")},O.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function K(){}K.prototype=O.prototype;function Z(T,Y,_){this.props=T,this.context=Y,this.refs=Q,this.updater=_||C}var re=Z.prototype=new K;re.constructor=Z,U(re,O.prototype),re.isPureReactComponent=!0;var te=Array.isArray;function L(){}var J={H:null,A:null,T:null,S:null},me=Object.prototype.hasOwnProperty;function be(T,Y,_){var le=_.ref;return{$$typeof:n,type:T,key:Y,ref:le!==void 0?le:null,props:_}}function R(T,Y){return be(T.type,Y,T.props)}function ne(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function ee(T){var Y={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(_){return Y[_]})}var Te=/\/+/g;function ie(T,Y){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):Y.toString(36)}function W(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(L,L):(T.status="pending",T.then(function(Y){T.status==="pending"&&(T.status="fulfilled",T.value=Y)},function(Y){T.status==="pending"&&(T.status="rejected",T.reason=Y)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function M(T,Y,_,le,se){var ce=typeof T;(ce==="undefined"||ce==="boolean")&&(T=null);var Ce=!1;if(T===null)Ce=!0;else switch(ce){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(T.$$typeof){case n:case a:Ce=!0;break;case x:return Ce=T._init,M(Ce(T._payload),Y,_,le,se)}}if(Ce)return se=se(T),Ce=le===""?"."+ie(T,0):le,te(se)?(_="",Ce!=null&&(_=Ce.replace(Te,"$&/")+"/"),M(se,Y,_,"",function(jt){return jt})):se!=null&&(ne(se)&&(se=R(se,_+(se.key==null||T&&T.key===se.key?"":(""+se.key).replace(Te,"$&/")+"/")+Ce)),Y.push(se)),1;Ce=0;var ze=le===""?".":le+":";if(te(T))for(var Re=0;Re>>1,E=M[Ee];if(0>>1;Ees(_,ae))les(se,_)?(M[Ee]=se,M[le]=ae,Ee=le):(M[Ee]=_,M[Y]=ae,Ee=Y);else if(les(se,ae))M[Ee]=se,M[le]=ae,Ee=le;else break e}}return F}function s(M,F){var ae=M.sortIndex-F.sortIndex;return ae!==0?ae:M.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;n.unstable_now=function(){return h.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var p=[],d=[],x=1,y=null,S=3,k=!1,C=!1,U=!1,Q=!1,O=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function re(M){for(var F=r(d);F!==null;){if(F.callback===null)u(d);else if(F.startTime<=M)u(d),F.sortIndex=F.expirationTime,a(p,F);else break;F=r(d)}}function te(M){if(U=!1,re(M),!C)if(r(p)!==null)C=!0,L||(L=!0,ee());else{var F=r(d);F!==null&&W(te,F.startTime-M)}}var L=!1,J=-1,me=5,be=-1;function R(){return Q?!0:!(n.unstable_now()-beM&&R());){var Ee=y.callback;if(typeof Ee=="function"){y.callback=null,S=y.priorityLevel;var E=Ee(y.expirationTime<=M);if(M=n.unstable_now(),typeof E=="function"){y.callback=E,re(M),F=!0;break t}y===r(p)&&u(p),re(M)}else u(p);y=r(p)}if(y!==null)F=!0;else{var T=r(d);T!==null&&W(te,T.startTime-M),F=!1}}break e}finally{y=null,S=ae,k=!1}F=void 0}}finally{F?ee():L=!1}}}var ee;if(typeof Z=="function")ee=function(){Z(ne)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,ie=Te.port2;Te.port1.onmessage=ne,ee=function(){ie.postMessage(null)}}else ee=function(){O(ne,0)};function W(M,F){J=O(function(){M(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125Ee?(M.sortIndex=ae,a(d,M),r(p)===null&&M===r(d)&&(U?(K(J),J=-1):U=!0,W(te,ae-Ee))):(M.sortIndex=E,a(p,M),C||k||(C=!0,L||(L=!0,ee()))),M},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(M){var F=S;return function(){var ae=S;S=F;try{return M.apply(this,arguments)}finally{S=ae}}}})(Ko)),Ko}var Zm;function A0(){return Zm||(Zm=1,Zo.exports=E0()),Zo.exports}var Fo={exports:{}},zt={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Km;function T0(){if(Km)return zt;Km=1;var n=ws();function a(p){var d="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Fo.exports=T0(),Fo.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jm;function C0(){if(Jm)return Ha;Jm=1;var n=A0(),a=ws(),r=z0();function u(e){var t="https://react.dev/errors/"+e;if(1E||(e.current=Ee[E],Ee[E]=null,E--)}function _(e,t){E++,Ee[E]=e.current,e.current=t}var le=T(null),se=T(null),ce=T(null),Ce=T(null);function ze(e,t){switch(_(ce,t),_(se,e),_(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sm(t),e=fm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(le),_(le,e)}function Re(){Y(le),Y(se),Y(ce)}function jt(e){e.memoizedState!==null&&_(Ce,e);var t=le.current,l=fm(t,e.type);t!==l&&(_(se,e),_(le,l))}function yt(e){se.current===e&&(Y(le),Y(se)),Ce.current===e&&(Y(Ce),ja._currentValue=ae)}var Tl,ei;function xt(e){if(Tl===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Tl=t&&t[1]||"",ei=-1)":-1c||A[i]!==D[c]){var H=` +`+A[i].replace(" at new "," at ");return e.displayName&&H.includes("")&&(H=H.replace("",e.displayName)),H}while(1<=i&&0<=c);break}}}finally{Rt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?xt(l):""}function Le(e,t){switch(e.tag){case 26:case 27:case 5:return xt(e.type);case 16:return xt("Lazy");case 13:return e.child!==t&&t!==null?xt("Suspense Fallback"):xt("Suspense");case 19:return xt("SuspenseList");case 0:case 15:return Jn(e.type,!1);case 11:return Jn(e.type.render,!1);case 1:return Jn(e.type,!0);case 31:return xt("Activity");default:return""}}function In(e){try{var t="",l=null;do t+=Le(e,l),l=e,e=e.return;while(e);return t}catch(i){return` +Error generating stack: `+i.message+` +`+i.stack}}var bn=Object.prototype.hasOwnProperty,$n=n.unstable_scheduleCallback,Wn=n.unstable_cancelCallback,Zi=n.unstable_shouldYield,Ki=n.unstable_requestPaint,bt=n.unstable_now,ti=n.unstable_getCurrentPriorityLevel,G=n.unstable_ImmediatePriority,P=n.unstable_UserBlockingPriority,xe=n.unstable_NormalPriority,we=n.unstable_LowPriority,He=n.unstable_IdlePriority,Nt=n.log,Xt=n.unstable_setDisableYieldValue,ht=null,tt=null;function At(e){if(typeof Nt=="function"&&Xt(e),tt&&typeof tt.setStrictMode=="function")try{tt.setStrictMode(ht,e)}catch{}}var Ve=Math.clz32?Math.clz32:Du,vn=Math.log,Zt=Math.LN2;function Du(e){return e>>>=0,e===0?32:31-(vn(e)/Zt|0)|0}var zl=256,Cl=262144,wl=4194304;function Sn(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 Ml(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var c=0,o=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~o,i!==0?c=Sn(i):(g&=b,g!==0?c=Sn(g):l||(l=b&~e,l!==0&&(c=Sn(l))))):(b=i&~o,b!==0?c=Sn(b):g!==0?c=Sn(g):l||(l=i&~e,l!==0&&(c=Sn(l)))),c===0?0:t!==0&&t!==c&&(t&o)===0&&(o=c&-c,l=t&-t,o>=l||o===32&&(l&4194048)!==0)?t:c}function Pn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $(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 q(){var e=wl;return wl<<=1,(wl&62914560)===0&&(wl=4194304),e}function ve(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function fe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,l,i,c,o){var g=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,A=e.expirationTimes,D=e.hiddenUpdates;for(l=g&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var py=/[\n"\\]/g;function ln(e){return e.replace(py,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lu(e,t,l,i,c,o,g,b){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+nn(t)):e.value!==""+nn(t)&&(e.value=""+nn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Bu(e,g,nn(t)):l!=null?Bu(e,g,nn(l)):i!=null&&e.removeAttribute("value"),c==null&&o!=null&&(e.defaultChecked=!!o),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+nn(b):e.removeAttribute("name")}function lf(e,t,l,i,c,o,g,b){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||l!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Ru(e);return}l=l!=null?""+nn(l):"",t=t!=null?""+nn(t):l,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),Ru(e)}function Bu(e,t,l){t==="number"&&lr(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ui(e,t,l,i){if(e=e.options,t){t={};for(var c=0;c"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(Nn)try{var Wi={};Object.defineProperty(Wi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Wi,Wi),window.removeEventListener("test",Wi,Wi)}catch{Gu=!1}var el=null,Vu=null,ar=null;function ff(){if(ar)return ar;var e,t=Vu,l=t.length,i,c="value"in el?el.value:el.textContent,o=c.length;for(e=0;e=ta),yf=" ",xf=!1;function bf(e,t){switch(e){case"keyup":return Vy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function Xy(e,t){switch(e){case"compositionend":return vf(t);case"keypress":return t.which!==32?null:(xf=!0,yf);case"textInput":return e=t.data,e===yf&&xf?null:e;default:return null}}function Zy(e,t){if(fi)return e==="compositionend"||!Fu&&bf(e,t)?(e=ff(),ar=Vu=el=null,fi=!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)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Cf(l)}}function Mf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=lr(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=lr(e.document)}return t}function $u(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 e1=Nn&&"documentMode"in document&&11>=document.documentMode,hi=null,Wu=null,aa=null,Pu=!1;function Df(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pu||hi==null||hi!==lr(i)||(i=hi,"selectionStart"in i&&$u(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}),aa&&ia(aa,i)||(aa=i,i=Wr(Wu,"onSelect"),0>=g,c-=g,kn=1<<32-Ve(t)+c|l<Ae?(je=oe,oe=null):je=oe.sibling;var Ye=j(w,oe,N[Ae],V);if(Ye===null){oe===null&&(oe=je);break}e&&oe&&Ye.alternate===null&&t(w,oe),z=o(Ye,z,Ae),qe===null?de=Ye:qe.sibling=Ye,qe=Ye,oe=je}if(Ae===N.length)return l(w,oe),Be&&On(w,Ae),de;if(oe===null){for(;AeAe?(je=oe,oe=null):je=oe.sibling;var kl=j(w,oe,Ye.value,V);if(kl===null){oe===null&&(oe=je);break}e&&oe&&kl.alternate===null&&t(w,oe),z=o(kl,z,Ae),qe===null?de=kl:qe.sibling=kl,qe=kl,oe=je}if(Ye.done)return l(w,oe),Be&&On(w,Ae),de;if(oe===null){for(;!Ye.done;Ae++,Ye=N.next())Ye=X(w,Ye.value,V),Ye!==null&&(z=o(Ye,z,Ae),qe===null?de=Ye:qe.sibling=Ye,qe=Ye);return Be&&On(w,Ae),de}for(oe=i(oe);!Ye.done;Ae++,Ye=N.next())Ye=B(oe,w,Ae,Ye.value,V),Ye!==null&&(e&&Ye.alternate!==null&&oe.delete(Ye.key===null?Ae:Ye.key),z=o(Ye,z,Ae),qe===null?de=Ye:qe.sibling=Ye,qe=Ye);return e&&oe.forEach(function(v0){return t(w,v0)}),Be&&On(w,Ae),de}function Fe(w,z,N,V){if(typeof N=="object"&&N!==null&&N.type===U&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case k:e:{for(var de=N.key;z!==null;){if(z.key===de){if(de=N.type,de===U){if(z.tag===7){l(w,z.sibling),V=c(z,N.props.children),V.return=w,w=V;break e}}else if(z.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===me&&Gl(de)===z.type){l(w,z.sibling),V=c(z,N.props),fa(V,N),V.return=w,w=V;break e}l(w,z);break}else t(w,z);z=z.sibling}N.type===U?(V=Bl(N.props.children,w.mode,V,N.key),V.return=w,w=V):(V=pr(N.type,N.key,N.props,null,w.mode,V),fa(V,N),V.return=w,w=V)}return g(w);case C:e:{for(de=N.key;z!==null;){if(z.key===de)if(z.tag===4&&z.stateNode.containerInfo===N.containerInfo&&z.stateNode.implementation===N.implementation){l(w,z.sibling),V=c(z,N.children||[]),V.return=w,w=V;break e}else{l(w,z);break}else t(w,z);z=z.sibling}V=rc(N,w.mode,V),V.return=w,w=V}return g(w);case me:return N=Gl(N),Fe(w,z,N,V)}if(W(N))return ue(w,z,N,V);if(ee(N)){if(de=ee(N),typeof de!="function")throw Error(u(150));return N=de.call(N),ye(w,z,N,V)}if(typeof N.then=="function")return Fe(w,z,kr(N),V);if(N.$$typeof===Z)return Fe(w,z,xr(w,N),V);_r(w,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,z!==null&&z.tag===6?(l(w,z.sibling),V=c(z,N),V.return=w,w=V):(l(w,z),V=ac(N,w.mode,V),V.return=w,w=V),g(w)):l(w,z)}return function(w,z,N,V){try{sa=0;var de=Fe(w,z,N,V);return _i=null,de}catch(oe){if(oe===ki||oe===vr)throw oe;var qe=Ft(29,oe,null,w.mode);return qe.lanes=V,qe.return=w,qe}finally{}}}var Ql=th(!0),nh=th(!1),al=!1;function xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bc(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 rl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ul(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ge&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=mr(e),Hf(e,null,l),t}return dr(e,i,t,l),mr(e)}function ha(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Wa(e,l)}}function vc(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var c=null,o=null;if(l=l.firstBaseUpdate,l!==null){do{var g={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};o===null?c=o=g:o=o.next=g,l=l.next}while(l!==null);o===null?c=o=t:o=o.next=t}else c=o=t;l={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Sc=!1;function da(){if(Sc){var e=Si;if(e!==null)throw e}}function ma(e,t,l,i){Sc=!1;var c=e.updateQueue;al=!1;var o=c.firstBaseUpdate,g=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var A=b,D=A.next;A.next=null,g===null?o=D:g.next=D,g=A;var H=e.alternate;H!==null&&(H=H.updateQueue,b=H.lastBaseUpdate,b!==g&&(b===null?H.firstBaseUpdate=D:b.next=D,H.lastBaseUpdate=A))}if(o!==null){var X=c.baseState;g=0,H=D=A=null,b=o;do{var j=b.lane&-536870913,B=j!==b.lane;if(B?(Oe&j)===j:(i&j)===j){j!==0&&j===vi&&(Sc=!0),H!==null&&(H=H.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ue=e,ye=b;j=t;var Fe=l;switch(ye.tag){case 1:if(ue=ye.payload,typeof ue=="function"){X=ue.call(Fe,X,j);break e}X=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ye.payload,j=typeof ue=="function"?ue.call(Fe,X,j):ue,j==null)break e;X=y({},X,j);break e;case 2:al=!0}}j=b.callback,j!==null&&(e.flags|=64,B&&(e.flags|=8192),B=c.callbacks,B===null?c.callbacks=[j]:B.push(j))}else B={lane:j,tag:b.tag,payload:b.payload,callback:b.callback,next:null},H===null?(D=H=B,A=X):H=H.next=B,g|=j;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;B=b,b=B.next,B.next=null,c.lastBaseUpdate=B,c.shared.pending=null}}while(!0);H===null&&(A=X),c.baseState=A,c.firstBaseUpdate=D,c.lastBaseUpdate=H,o===null&&(c.shared.lanes=0),hl|=g,e.lanes=g,e.memoizedState=X}}function lh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function ih(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eo?o:8;var g=M.T,b={};M.T=b,qc(e,!1,t,l);try{var A=c(),D=M.S;if(D!==null&&D(b,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var H=o1(A,i);ya(e,t,H,Pt(e))}else ya(e,t,i,Pt(e))}catch(X){ya(e,t,{then:function(){},status:"rejected",reason:X},Pt())}finally{F.p=o,g!==null&&b.types!==null&&(g.types=b.types),M.T=g}}function p1(){}function Uc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var c=Lh(e).queue;Rh(e,c,t,ae,l===null?p1:function(){return Bh(e),l(i)})}function Lh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:ae},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bh(e){var t=Lh(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},Pt())}function Hc(){return kt(ja)}function Uh(){return at().memoizedState}function Hh(){return at().memoizedState}function g1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Pt();e=rl(l);var i=ul(t,e,l);i!==null&&(Gt(i,t,l),ha(i,t,l)),t={cache:mc()},e.payload=t;return}t=t.return}}function y1(e,t,l){var i=Pt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Or(e)?Yh(t,l):(l=lc(e,t,l,i),l!==null&&(Gt(l,e,i),Gh(l,t,i)))}function qh(e,t,l){var i=Pt();ya(e,t,l,i)}function ya(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Or(e))Yh(t,c);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var g=t.lastRenderedState,b=o(g,l);if(c.hasEagerState=!0,c.eagerState=b,Kt(b,g))return dr(e,t,c,0),Je===null&&hr(),!1}catch{}finally{}if(l=lc(e,t,c,i),l!==null)return Gt(l,e,i),Gh(l,t,i),!0}return!1}function qc(e,t,l,i){if(i={lane:2,revertLane:bo(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Or(e)){if(t)throw Error(u(479))}else t=lc(e,l,i,2),t!==null&&Gt(t,e,2)}function Or(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Yh(e,t){Ai=Tr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Gh(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Wa(e,l)}}var xa={readContext:kt,use:wr,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};xa.useEffectEvent=nt;var Vh={readContext:kt,use:wr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Th,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Nr(4194308,4,Mh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Nr(4194308,4,e,t)},useInsertionEffect:function(e,t){Nr(4,2,e,t)},useMemo:function(e,t){var l=Dt();t=t===void 0?null:t;var i=e();if(Xl){At(!0);try{e()}finally{At(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=Dt();if(l!==void 0){var c=l(t);if(Xl){At(!0);try{l(t)}finally{At(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=y1.bind(null,_e,e),[i.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Oc(e);var t=e.queue,l=qh.bind(null,_e,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Lc,useDeferredValue:function(e,t){var l=Dt();return Bc(l,e,t)},useTransition:function(){var e=Oc(!1);return e=Rh.bind(null,_e,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=_e,c=Dt();if(Be){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Je===null)throw Error(u(349));(Oe&127)!==0||sh(i,t,l)}c.memoizedState=l;var o={value:l,getSnapshot:t};return c.queue=o,Th(hh.bind(null,i,o,e),[e]),i.flags|=2048,zi(9,{destroy:void 0},fh.bind(null,i,o,l,t),null),l},useId:function(){var e=Dt(),t=Je.identifierPrefix;if(Be){var l=_n,i=kn;l=(i&~(1<<32-Ve(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zr++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof i.is=="string"?g.createElement("select",{is:i.is}):g.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o=typeof i.is=="string"?g.createElement(c,{is:i.is}):g.createElement(c)}}o[vt]=t,o[Lt]=i;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)o.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=o;e:switch(Et(o,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Hn(t)}}return Pe(t),eo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Hn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=ce.current,xi(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,c=St,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[vt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||cm(e.nodeValue,l)),e||ll(t,!0)}else e=Pr(e).createTextNode(i),e[vt]=t,t.stateNode=e}return Pe(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=xi(t),l!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[vt]=t}else Ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else l=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Pe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=xi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(u(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(u(317));c[vt]=t}else Ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),c=!1}else c=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==c&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Ur(t,t.updateQueue),Pe(t),null);case 4:return Re(),e===null&&_o(t.stateNode.containerInfo),Pe(t),null;case 10:return Rn(t.type),Pe(t),null;case 19:if(Y(it),i=t.memoizedState,i===null)return Pe(t),null;if(c=(t.flags&128)!==0,o=i.rendering,o===null)if(c)va(i,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Ar(e),o!==null){for(t.flags|=128,va(i,!1),e=o.updateQueue,t.updateQueue=e,Ur(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)qf(l,e),l=l.sibling;return _(it,it.current&1|2),Be&&On(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&bt()>Vr&&(t.flags|=128,c=!0,va(i,!1),t.lanes=4194304)}else{if(!c)if(e=Ar(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ur(t,e),va(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Be)return Pe(t),null}else 2*bt()-i.renderingStartTime>Vr&&l!==536870912&&(t.flags|=128,c=!0,va(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e!==null?e.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=bt(),e.sibling=null,l=it.current,_(it,c?l&1|2:l&1),Be&&On(t,i.treeForkCount),e):(Pe(t),null);case 22:case 23:return It(t),_c(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),l=t.updateQueue,l!==null&&Ur(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&Y(Yl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Rn(ut),Pe(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function k1(e,t){switch(cc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Rn(ut),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return yt(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(u(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(it),null;case 4:return Re(),null;case 10:return Rn(t.type),null;case 22:case 23:return It(t),_c(),e!==null&&Y(Yl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Rn(ut),null;case 25:return null;default:return null}}function dd(e,t){switch(cc(t),t.tag){case 3:Rn(ut),Re();break;case 26:case 27:case 5:yt(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:Y(it);break;case 10:Rn(t.type);break;case 22:case 23:It(t),_c(),e!==null&&Y(Yl);break;case 24:Rn(ut)}}function Sa(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){i=void 0;var o=l.create,g=l.inst;i=o(),g.destroy=i}l=l.next}while(l!==c)}}catch(b){Xe(t,t.return,b)}}function sl(e,t,l){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var o=c.next;i=o;do{if((i.tag&e)===e){var g=i.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,c=t;var A=l,D=b;try{D()}catch(H){Xe(c,A,H)}}}i=i.next}while(i!==o)}}catch(H){Xe(t,t.return,H)}}function md(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ih(t,l)}catch(i){Xe(e,e.return,i)}}}function pd(e,t,l){l.props=Zl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Xe(e,t,i)}}function ka(e,t){try{var l=e.ref;if(l!==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 l=="function"?e.refCleanup=l(i):l.current=i}}catch(c){Xe(e,t,c)}}function En(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(c){Xe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){Xe(e,t,c)}else l.current=null}function gd(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(c){Xe(e,e.return,c)}}function to(e,t,l){try{var i=e.stateNode;Q1(i,e.type,l,t),i[Lt]=t}catch(c){Xe(e,e.return,c)}}function yd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&yl(e.type)||e.tag===4}function no(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yd(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&&yl(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 lo(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Mn));else if(i!==4&&(i===27&&yl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(lo(e,t,l),e=e.sibling;e!==null;)lo(e,t,l),e=e.sibling}function Hr(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&yl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Hr(e,t,l),e=e.sibling;e!==null;)Hr(e,t,l),e=e.sibling}function xd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Et(t,i,l),t[vt]=e,t[Lt]=l}catch(o){Xe(e,e.return,o)}}var qn=!1,st=!1,io=!1,bd=typeof WeakSet=="function"?WeakSet:Set,gt=null;function _1(e,t){if(e=e.containerInfo,To=ru,e=Nf(e),$u(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var c=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{l.nodeType,o.nodeType}catch{l=null;break e}var g=0,b=-1,A=-1,D=0,H=0,X=e,j=null;t:for(;;){for(var B;X!==l||c!==0&&X.nodeType!==3||(b=g+c),X!==o||i!==0&&X.nodeType!==3||(A=g+i),X.nodeType===3&&(g+=X.nodeValue.length),(B=X.firstChild)!==null;)j=X,X=B;for(;;){if(X===e)break t;if(j===l&&++D===c&&(b=g),j===o&&++H===i&&(A=g),(B=X.nextSibling)!==null)break;X=j,j=X.parentNode}X=B}l=b===-1||A===-1?null:{start:b,end:A}}else l=null}l=l||{start:0,end:0}}else l=null;for(zo={focusedElem:e,selectionRange:l},ru=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Et(o,i,l),o[vt]=e,pt(o),i=o;break e;case"link":var g=Am("link","href",c).get(i+(l.href||""));if(g){for(var b=0;bFe&&(g=Fe,Fe=ye,ye=g);var w=wf(b,ye),z=wf(b,Fe);if(w&&z&&(B.rangeCount!==1||B.anchorNode!==w.node||B.anchorOffset!==w.offset||B.focusNode!==z.node||B.focusOffset!==z.offset)){var N=X.createRange();N.setStart(w.node,w.offset),B.removeAllRanges(),ye>Fe?(B.addRange(N),B.extend(z.node,z.offset)):(N.setEnd(z.node,z.offset),B.addRange(N))}}}}for(X=[],B=b;B=B.parentNode;)B.nodeType===1&&X.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;bl?32:l,M.T=null,l=fo,fo=null;var o=ml,g=Xn;if(dt=0,Di=ml=null,Xn=0,(Ge&6)!==0)throw Error(u(331));var b=Ge;if(Ge|=4,Md(o.current),zd(o,o.current,g,l),Ge=b,Ca(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(ht,o)}catch{}return!0}finally{F.p=c,M.T=i,Fd(e,t)}}function Id(e,t,l){t=rn(l,t),t=Qc(e.stateNode,t,2),e=ul(e,t,2),e!==null&&(fe(e,2),An(e))}function Xe(e,t,l){if(e.tag===3)Id(e,e,l);else for(;t!==null;){if(t.tag===3){Id(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(dl===null||!dl.has(i))){e=rn(l,e),l=$h(2),i=ul(t,l,2),i!==null&&(Wh(l,i,t,e),fe(i,2),An(i));break}}t=t.return}}function go(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new T1;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(l)||(uo=!0,c.add(l),e=N1.bind(null,e,t,l),t.then(e,e))}function N1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Je===e&&(Oe&l)===l&&(lt===4||lt===3&&(Oe&62914560)===Oe&&300>bt()-Gr?(Ge&2)===0&&Oi(e,0):co|=l,Ni===Oe&&(Ni=0)),An(e)}function $d(e,t){t===0&&(t=q()),e=Ll(e,t),e!==null&&(fe(e,t),An(e))}function D1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),$d(e,l)}function O1(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),$d(e,l)}function j1(e,t){return $n(e,t)}var Jr=null,Ri=null,yo=!1,Ir=!1,xo=!1,gl=0;function An(e){e!==Ri&&e.next===null&&(Ri===null?Jr=Ri=e:Ri=Ri.next=e),Ir=!0,yo||(yo=!0,L1())}function Ca(e,t){if(!xo&&Ir){xo=!0;do for(var l=!1,i=Jr;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var o=0;else{var g=i.suspendedLanes,b=i.pingedLanes;o=(1<<31-Ve(42|e)+1)-1,o&=c&~(g&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(l=!0,tm(i,o))}else o=Oe,o=Ml(i,i===Je?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Pn(i,o)||(l=!0,tm(i,o));i=i.next}while(l);xo=!1}}function R1(){Wd()}function Wd(){Ir=yo=!1;var e=0;gl!==0&&Z1()&&(e=gl);for(var t=bt(),l=null,i=Jr;i!==null;){var c=i.next,o=Pd(i,t);o===0?(i.next=null,l===null?Jr=c:l.next=c,c===null&&(Ri=l)):(l=i,(e!==0||(o&3)!==0)&&(Ir=!0)),i=c}dt!==0&&dt!==5||Ca(e),gl!==0&&(gl=0)}function Pd(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var H=A.transferSize,X=A.initiatorType;H&&om(X)&&(A=A.responseEnd,g+=H*(A"u"?null:document;function Sm(e,t,l){var i=Li;if(i&&typeof t=="string"&&t){var c=ln(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),vm.has(c)||(vm.add(c),e={rel:e,crossOrigin:l,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),Et(t,"link",e),pt(t),i.head.appendChild(t)))}}function t0(e){Zn.D(e),Sm("dns-prefetch",e,null)}function n0(e,t){Zn.C(e,t),Sm("preconnect",e,t)}function l0(e,t,l){Zn.L(e,t,l);var i=Li;if(i&&e&&t){var c='link[rel="preload"][as="'+ln(t)+'"]';t==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+ln(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+ln(l.imageSizes)+'"]')):c+='[href="'+ln(e)+'"]';var o=c;switch(t){case"style":o=Bi(e);break;case"script":o=Ui(e)}hn.has(o)||(e=y({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),hn.set(o,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(Da(o))||t==="script"&&i.querySelector(Oa(o))||(t=i.createElement("link"),Et(t,"link",e),pt(t),i.head.appendChild(t)))}}function i0(e,t){Zn.m(e,t);var l=Li;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+ln(i)+'"][href="'+ln(e)+'"]',o=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ui(e)}if(!hn.has(o)&&(e=y({rel:"modulepreload",href:e},t),hn.set(o,e),l.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Oa(o)))return}i=l.createElement("link"),Et(i,"link",e),pt(i),l.head.appendChild(i)}}}function a0(e,t,l){Zn.S(e,t,l);var i=Li;if(i&&e){var c=ai(i).hoistableStyles,o=Bi(e);t=t||"default";var g=c.get(o);if(!g){var b={loading:0,preload:null};if(g=i.querySelector(Da(o)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},l),(l=hn.get(o))&&jo(e,l);var A=g=i.createElement("link");pt(A),Et(A,"link",e),A._p=new Promise(function(D,H){A.onload=D,A.onerror=H}),A.addEventListener("load",function(){b.loading|=1}),A.addEventListener("error",function(){b.loading|=2}),b.loading|=4,tu(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:b},c.set(o,g)}}}function r0(e,t){Zn.X(e,t);var l=Li;if(l&&e){var i=ai(l).hoistableScripts,c=Ui(e),o=i.get(c);o||(o=l.querySelector(Oa(c)),o||(e=y({src:e,async:!0},t),(t=hn.get(c))&&Ro(e,t),o=l.createElement("script"),pt(o),Et(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function u0(e,t){Zn.M(e,t);var l=Li;if(l&&e){var i=ai(l).hoistableScripts,c=Ui(e),o=i.get(c);o||(o=l.querySelector(Oa(c)),o||(e=y({src:e,async:!0,type:"module"},t),(t=hn.get(c))&&Ro(e,t),o=l.createElement("script"),pt(o),Et(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function km(e,t,l,i){var c=(c=ce.current)?eu(c):null;if(!c)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Bi(l.href),l=ai(c).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Bi(l.href);var o=ai(c).hoistableStyles,g=o.get(e);if(g||(c=c.ownerDocument||c,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,g),(o=c.querySelector(Da(e)))&&!o._p&&(g.instance=o,g.state.loading=5),hn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},hn.set(e,l),o||c0(c,e,l,g.state))),t&&i===null)throw Error(u(528,""));return g}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ui(l),l=ai(c).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Bi(e){return'href="'+ln(e)+'"'}function Da(e){return'link[rel="stylesheet"]['+e+"]"}function _m(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function c0(e,t,l,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}),Et(t,"link",l),pt(t),e.head.appendChild(t))}function Ui(e){return'[src="'+ln(e)+'"]'}function Oa(e){return"script[async]"+e}function Em(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ln(l.href)+'"]');if(i)return t.instance=i,pt(i),i;var c=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),pt(i),Et(i,"style",c),tu(i,l.precedence,e),t.instance=i;case"stylesheet":c=Bi(l.href);var o=e.querySelector(Da(c));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;i=_m(l),(c=hn.get(c))&&jo(i,c),o=(e.ownerDocument||e).createElement("link"),pt(o);var g=o;return g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),Et(o,"link",i),t.state.loading|=4,tu(o,l.precedence,e),t.instance=o;case"script":return o=Ui(l.src),(c=e.querySelector(Oa(o)))?(t.instance=c,pt(c),c):(i=l,(c=hn.get(o))&&(i=y({},l),Ro(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),pt(c),Et(c,"link",i),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,tu(i,l.precedence,e));return t.instance}function tu(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,o=c,g=0;g title"):null)}function o0(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function s0(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=Bi(i.href),o=t.querySelector(Da(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,pt(o);return}o=t.ownerDocument||t,i=_m(i),(c=hn.get(c))&&jo(i,c),o=o.createElement("link"),pt(o);var g=o;g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),Et(o,"link",i),l.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=lu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Lo=0;function f0(e,t){return e.stylesheets&&e.count===0&&au(e,e.stylesheets),0Lo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)au(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var iu=null;function au(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,iu=new Map,t.forEach(h0,e),iu=null,lu.call(e))}function h0(e,t){if(!(t.state.loading&4)){var l=iu.get(e);if(l)var i=l.get(null);else{l=new Map,iu.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Xo.exports=C0(),Xo.exports}var M0=w0();function N0(n,a){const r={};return(n[n.length-1]===""?[...n,""]:n).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const D0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j0={};function $m(n,a){return(j0.jsx?O0:D0).test(n)}const R0=/[ \t\n\f\r]/g;function L0(n){return typeof n=="object"?n.type==="text"?Wm(n.value):!1:Wm(n)}function Wm(n){return n.replace(R0,"")===""}class Ja{constructor(a,r,u){this.normal=r,this.property=a,u&&(this.space=u)}}Ja.prototype.normal={};Ja.prototype.property={};Ja.prototype.space=void 0;function Zp(n,a){const r={},u={};for(const s of n)Object.assign(r,s.property),Object.assign(u,s.normal);return new Ja(r,u,a)}function ps(n){return n.toLowerCase()}class Qt{constructor(a,r){this.attribute=r,this.property=a}}Qt.prototype.attribute="";Qt.prototype.booleanish=!1;Qt.prototype.boolean=!1;Qt.prototype.commaOrSpaceSeparated=!1;Qt.prototype.commaSeparated=!1;Qt.prototype.defined=!1;Qt.prototype.mustUseProperty=!1;Qt.prototype.number=!1;Qt.prototype.overloadedBoolean=!1;Qt.prototype.property="";Qt.prototype.spaceSeparated=!1;Qt.prototype.space=void 0;let B0=0;const Se=Pl(),ft=Pl(),gs=Pl(),I=Pl(),Ie=Pl(),$l=Pl(),en=Pl();function Pl(){return 2**++B0}const ys=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:ft,commaOrSpaceSeparated:en,commaSeparated:$l,number:I,overloadedBoolean:gs,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),Jo=Object.keys(ys);class Ms extends Qt{constructor(a,r,u,s){let h=-1;if(super(a,r),Pm(this,"space",s),typeof u=="number")for(;++h4&&r.slice(0,4)==="data"&&G0.test(a)){if(a.charAt(4)==="-"){const h=a.slice(5).replace(ep,X0);u="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=a.slice(4);if(!ep.test(h)){let f=h.replace(Y0,Q0);f.charAt(0)!=="-"&&(f="-"+f),a="data"+f}}s=Ms}return new s(u,a)}function Q0(n){return"-"+n.toLowerCase()}function X0(n){return n.charAt(1).toUpperCase()}const Z0=Zp([Kp,U0,Ip,$p,Wp],"html"),Ns=Zp([Kp,H0,Ip,$p,Wp],"svg");function K0(n){return n.join(" ").trim()}var qi={},Io,tp;function F0(){if(tp)return Io;tp=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,a=/\n/g,r=/^\s*/,u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,m=/^\s+|\s+$/g,p=` +`,d="/",x="*",y="",S="comment",k="declaration";function C(Q,O){if(typeof Q!="string")throw new TypeError("First argument must be a string");if(!Q)return[];O=O||{};var K=1,Z=1;function re(ie){var W=ie.match(a);W&&(K+=W.length);var M=ie.lastIndexOf(p);Z=~M?ie.length-M:Z+ie.length}function te(){var ie={line:K,column:Z};return function(W){return W.position=new L(ie),be(),W}}function L(ie){this.start=ie,this.end={line:K,column:Z},this.source=O.source}L.prototype.content=Q;function J(ie){var W=new Error(O.source+":"+K+":"+Z+": "+ie);if(W.reason=ie,W.filename=O.source,W.line=K,W.column=Z,W.source=Q,!O.silent)throw W}function me(ie){var W=ie.exec(Q);if(W){var M=W[0];return re(M),Q=Q.slice(M.length),W}}function be(){me(r)}function R(ie){var W;for(ie=ie||[];W=ne();)W!==!1&&ie.push(W);return ie}function ne(){var ie=te();if(!(d!=Q.charAt(0)||x!=Q.charAt(1))){for(var W=2;y!=Q.charAt(W)&&(x!=Q.charAt(W)||d!=Q.charAt(W+1));)++W;if(W+=2,y===Q.charAt(W-1))return J("End of comment missing");var M=Q.slice(2,W-2);return Z+=2,re(M),Q=Q.slice(W),Z+=2,ie({type:S,comment:M})}}function ee(){var ie=te(),W=me(u);if(W){if(ne(),!me(s))return J("property missing ':'");var M=me(h),F=ie({type:k,property:U(W[0].replace(n,y)),value:M?U(M[0].replace(n,y)):y});return me(f),F}}function Te(){var ie=[];R(ie);for(var W;W=ee();)W!==!1&&(ie.push(W),R(ie));return ie}return be(),Te()}function U(Q){return Q?Q.replace(m,y):y}return Io=C,Io}var np;function J0(){if(np)return qi;np=1;var n=qi&&qi.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(qi,"__esModule",{value:!0}),qi.default=r;const a=n(F0());function r(u,s){let h=null;if(!u||typeof u!="string")return h;const f=(0,a.default)(u),m=typeof s=="function";return f.forEach(p=>{if(p.type!=="declaration")return;const{property:d,value:x}=p;m?s(d,x,p):x&&(h=h||{},h[d]=x)}),h}return qi}var qa={},lp;function I0(){if(lp)return qa;lp=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,a=/-([a-z])/g,r=/^[^-]+$/,u=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,h=function(d){return!d||r.test(d)||n.test(d)},f=function(d,x){return x.toUpperCase()},m=function(d,x){return"".concat(x,"-")},p=function(d,x){return x===void 0&&(x={}),h(d)?d:(d=d.toLowerCase(),x.reactCompat?d=d.replace(s,m):d=d.replace(u,m),d.replace(a,f))};return qa.camelCase=p,qa}var Ya,ip;function $0(){if(ip)return Ya;ip=1;var n=Ya&&Ya.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=n(J0()),r=I0();function u(s,h){var f={};return!s||typeof s!="string"||(0,a.default)(s,function(m,p){m&&p&&(f[(0,r.camelCase)(m,h)]=p)}),f}return u.default=u,Ya=u,Ya}var W0=$0();const P0=Xp(W0),Pp=eg("end"),Ds=eg("start");function eg(n){return a;function a(r){const u=r&&r.position&&r.position[n]||{};if(typeof u.line=="number"&&u.line>0&&typeof u.column=="number"&&u.column>0)return{line:u.line,column:u.column,offset:typeof u.offset=="number"&&u.offset>-1?u.offset:void 0}}}function ex(n){const a=Ds(n),r=Pp(n);if(a&&r)return{start:a,end:r}}function Qa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ap(n.position):"start"in n||"end"in n?ap(n):"line"in n||"column"in n?xs(n):""}function xs(n){return rp(n&&n.line)+":"+rp(n&&n.column)}function ap(n){return xs(n&&n.start)+"-"+xs(n&&n.end)}function rp(n){return n&&typeof n=="number"?n:1}class Mt extends Error{constructor(a,r,u){super(),typeof r=="string"&&(u=r,r=void 0);let s="",h={},f=!1;if(r&&("line"in r&&"column"in r?h={place:r}:"start"in r&&"end"in r?h={place:r}:"type"in r?h={ancestors:[r],place:r.position}:h={...r}),typeof a=="string"?s=a:!h.cause&&a&&(f=!0,s=a.message,h.cause=a),!h.ruleId&&!h.source&&typeof u=="string"){const p=u.indexOf(":");p===-1?h.ruleId=u:(h.source=u.slice(0,p),h.ruleId=u.slice(p+1))}if(!h.place&&h.ancestors&&h.ancestors){const p=h.ancestors[h.ancestors.length-1];p&&(h.place=p.position)}const m=h.place&&"start"in h.place?h.place.start:h.place;this.ancestors=h.ancestors||void 0,this.cause=h.cause||void 0,this.column=m?m.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=m?m.line:void 0,this.name=Qa(h.place)||"1:1",this.place=h.place||void 0,this.reason=this.message,this.ruleId=h.ruleId||void 0,this.source=h.source||void 0,this.stack=f&&h.cause&&typeof h.cause.stack=="string"?h.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mt.prototype.file="";Mt.prototype.name="";Mt.prototype.reason="";Mt.prototype.message="";Mt.prototype.stack="";Mt.prototype.column=void 0;Mt.prototype.line=void 0;Mt.prototype.ancestors=void 0;Mt.prototype.cause=void 0;Mt.prototype.fatal=void 0;Mt.prototype.place=void 0;Mt.prototype.ruleId=void 0;Mt.prototype.source=void 0;const Os={}.hasOwnProperty,tx=new Map,nx=/[A-Z]/g,lx=new Set(["table","tbody","thead","tfoot","tr"]),ix=new Set(["td","th"]),tg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ax(n,a){if(!a||a.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=a.filePath||void 0;let u;if(a.development){if(typeof a.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");u=dx(r,a.jsxDEV)}else{if(typeof a.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof a.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");u=hx(r,a.jsx,a.jsxs)}const s={Fragment:a.Fragment,ancestors:[],components:a.components||{},create:u,elementAttributeNameCase:a.elementAttributeNameCase||"react",evaluater:a.createEvaluater?a.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:a.ignoreInvalidStyle||!1,passKeys:a.passKeys!==!1,passNode:a.passNode||!1,schema:a.space==="svg"?Ns:Z0,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},h=ng(s,n,void 0);return h&&typeof h!="string"?h:s.create(n,s.Fragment,{children:h||void 0},void 0)}function ng(n,a,r){if(a.type==="element")return rx(n,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return ux(n,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return ox(n,a,r);if(a.type==="mdxjsEsm")return cx(n,a);if(a.type==="root")return sx(n,a,r);if(a.type==="text")return fx(n,a)}function rx(n,a,r){const u=n.schema;let s=u;a.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Ns,n.schema=s),n.ancestors.push(a);const h=ig(n,a.tagName,!1),f=mx(n,a);let m=Rs(n,a);return lx.has(a.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!L0(p):!0})),lg(n,f,h,a),js(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function ux(n,a){if(a.data&&a.data.estree&&n.evaluater){const u=a.data.estree.body[0];return u.type,n.evaluater.evaluateExpression(u.expression)}Ka(n,a.position)}function cx(n,a){if(a.data&&a.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(a.data.estree);Ka(n,a.position)}function ox(n,a,r){const u=n.schema;let s=u;a.name==="svg"&&u.space==="html"&&(s=Ns,n.schema=s),n.ancestors.push(a);const h=a.name===null?n.Fragment:ig(n,a.name,!0),f=px(n,a),m=Rs(n,a);return lg(n,f,h,a),js(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function sx(n,a,r){const u={};return js(u,Rs(n,a)),n.create(a,n.Fragment,u,r)}function fx(n,a){return a.value}function lg(n,a,r,u){typeof r!="string"&&r!==n.Fragment&&n.passNode&&(a.node=u)}function js(n,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(n.children=r)}}function hx(n,a,r){return u;function u(s,h,f,m){const d=Array.isArray(f.children)?r:a;return m?d(h,f,m):d(h,f)}}function dx(n,a){return r;function r(u,s,h,f){const m=Array.isArray(h.children),p=Ds(u);return a(s,h,f,m,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function mx(n,a){const r={};let u,s;for(s in a.properties)if(s!=="children"&&Os.call(a.properties,s)){const h=gx(n,s,a.properties[s]);if(h){const[f,m]=h;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&ix.has(a.tagName)?u=m:r[f]=m}}if(u){const h=r.style||(r.style={});h[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=u}return r}function px(n,a){const r={};for(const u of a.attributes)if(u.type==="mdxJsxExpressionAttribute")if(u.data&&u.data.estree&&n.evaluater){const h=u.data.estree.body[0];h.type;const f=h.expression;f.type;const m=f.properties[0];m.type,Object.assign(r,n.evaluater.evaluateExpression(m.argument))}else Ka(n,a.position);else{const s=u.name;let h;if(u.value&&typeof u.value=="object")if(u.value.data&&u.value.data.estree&&n.evaluater){const m=u.value.data.estree.body[0];m.type,h=n.evaluater.evaluateExpression(m.expression)}else Ka(n,a.position);else h=u.value===null?!0:u.value;r[s]=h}return r}function Rs(n,a){const r=[];let u=-1;const s=n.passKeys?new Map:tx;for(;++us?0:s+a:a=a>s?s:a,r=r>0?r:0,u.length<1e4)f=Array.from(u),f.unshift(a,r),n.splice(...f);else for(r&&n.splice(a,r);h0?(tn(n,n.length,0,a),n):a}const op={}.hasOwnProperty;function rg(n){const a={};let r=-1;for(;++r13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function xn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ot=Al(/[A-Za-z]/),wt=Al(/[\dA-Za-z]/),Ax=Al(/[#-'*+\--9=?A-Z^-~]/);function Su(n){return n!==null&&(n<32||n===127)}const bs=Al(/\d/),Tx=Al(/[\dA-Fa-f]/),zx=Al(/[!-/:-@[-`{-~]/);function ge(n){return n!==null&&n<-2}function $e(n){return n!==null&&(n<0||n===32)}function De(n){return n===-2||n===-1||n===32}const zu=Al(new RegExp("\\p{P}|\\p{S}","u")),Wl=Al(/\s/);function Al(n){return a;function a(r){return r!==null&&r>-1&&n.test(String.fromCharCode(r))}}function Xi(n){const a=[];let r=-1,u=0,s=0;for(;++r55295&&h<57344){const m=n.charCodeAt(r+1);h<56320&&m>56319&&m<57344?(f=String.fromCharCode(h,m),s=1):f="�"}else f=String.fromCharCode(h);f&&(a.push(n.slice(u,r),encodeURIComponent(f)),u=r+s+1,f=""),s&&(r+=s,s=0)}return a.join("")+n.slice(u)}function Ue(n,a,r,u){const s=u?u-1:Number.POSITIVE_INFINITY;let h=0;return f;function f(p){return De(p)?(n.enter(r),m(p)):a(p)}function m(p){return De(p)&&h++f))return;const J=a.events.length;let me=J,be,R;for(;me--;)if(a.events[me][0]==="exit"&&a.events[me][1].type==="chunkFlow"){if(be){R=a.events[me][1].end;break}be=!0}for(O(u),L=J;LZ;){const te=r[re];a.containerState=te[1],te[0].exit.call(a,n)}r.length=Z}function K(){s.write([null]),h=void 0,s=void 0,a.containerState._closeFlow=void 0}}function Dx(n,a,r){return Ue(n,n.attempt(this.parser.constructs.document,a,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Gi(n){if(n===null||$e(n)||Wl(n))return 1;if(zu(n))return 2}function Cu(n,a,r){const u=[];let s=-1;for(;++s1&&n[r][1].end.offset-n[r][1].start.offset>1?2:1;const y={...n[u][1].end},S={...n[r][1].start};fp(y,-p),fp(S,p),f={type:p>1?"strongSequence":"emphasisSequence",start:y,end:{...n[u][1].end}},m={type:p>1?"strongSequence":"emphasisSequence",start:{...n[r][1].start},end:S},h={type:p>1?"strongText":"emphasisText",start:{...n[u][1].end},end:{...n[r][1].start}},s={type:p>1?"strong":"emphasis",start:{...f.start},end:{...m.end}},n[u][1].end={...f.start},n[r][1].start={...m.end},d=[],n[u][1].end.offset-n[u][1].start.offset&&(d=dn(d,[["enter",n[u][1],a],["exit",n[u][1],a]])),d=dn(d,[["enter",s,a],["enter",f,a],["exit",f,a],["enter",h,a]]),d=dn(d,Cu(a.parser.constructs.insideSpan.null,n.slice(u+1,r),a)),d=dn(d,[["exit",h,a],["enter",m,a],["exit",m,a],["exit",s,a]]),n[r][1].end.offset-n[r][1].start.offset?(x=2,d=dn(d,[["enter",n[r][1],a],["exit",n[r][1],a]])):x=0,tn(n,u-1,r-u+3,d),r=u+d.length-x-2;break}}for(r=-1;++r0&&De(L)?Ue(n,K,"linePrefix",h+1)(L):K(L)}function K(L){return L===null||ge(L)?n.check(hp,U,re)(L):(n.enter("codeFlowValue"),Z(L))}function Z(L){return L===null||ge(L)?(n.exit("codeFlowValue"),K(L)):(n.consume(L),Z)}function re(L){return n.exit("codeFenced"),a(L)}function te(L,J,me){let be=0;return R;function R(W){return L.enter("lineEnding"),L.consume(W),L.exit("lineEnding"),ne}function ne(W){return L.enter("codeFencedFence"),De(W)?Ue(L,ee,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):ee(W)}function ee(W){return W===m?(L.enter("codeFencedFenceSequence"),Te(W)):me(W)}function Te(W){return W===m?(be++,L.consume(W),Te):be>=f?(L.exit("codeFencedFenceSequence"),De(W)?Ue(L,ie,"whitespace")(W):ie(W)):me(W)}function ie(W){return W===null||ge(W)?(L.exit("codeFencedFence"),J(W)):me(W)}}}function Qx(n,a,r){const u=this;return s;function s(f){return f===null?r(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),h)}function h(f){return u.parser.lazy[u.now().line]?r(f):a(f)}}const Wo={name:"codeIndented",tokenize:Zx},Xx={partial:!0,tokenize:Kx};function Zx(n,a,r){const u=this;return s;function s(d){return n.enter("codeIndented"),Ue(n,h,"linePrefix",5)(d)}function h(d){const x=u.events[u.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?f(d):r(d)}function f(d){return d===null?p(d):ge(d)?n.attempt(Xx,f,p)(d):(n.enter("codeFlowValue"),m(d))}function m(d){return d===null||ge(d)?(n.exit("codeFlowValue"),f(d)):(n.consume(d),m)}function p(d){return n.exit("codeIndented"),a(d)}}function Kx(n,a,r){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?r(f):ge(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):Ue(n,h,"linePrefix",5)(f)}function h(f){const m=u.events[u.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(f):ge(f)?s(f):r(f)}}const Fx={name:"codeText",previous:Ix,resolve:Jx,tokenize:$x};function Jx(n){let a=n.length-4,r=3,u,s;if((n[r][1].type==="lineEnding"||n[r][1].type==="space")&&(n[a][1].type==="lineEnding"||n[a][1].type==="space")){for(u=r;++u=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return athis.left.length?this.right.slice(this.right.length-u+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-u+this.left.length).reverse())}splice(a,r,u){const s=r||0;this.setCursor(Math.trunc(a));const h=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return u&&Ga(this.left,u),h.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(a){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(a)}pushMany(a){this.setCursor(Number.POSITIVE_INFINITY),Ga(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),Ga(this.right,a.reverse())}setCursor(a){if(!(a===this.left.length||a>this.left.length&&this.right.length===0||a<0&&this.left.length===0))if(a=4?a(f):n.interrupt(u.parser.constructs.flow,r,a)(f)}}function hg(n,a,r,u,s,h,f,m,p){const d=p||Number.POSITIVE_INFINITY;let x=0;return y;function y(O){return O===60?(n.enter(u),n.enter(s),n.enter(h),n.consume(O),n.exit(h),S):O===null||O===32||O===41||Su(O)?r(O):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),U(O))}function S(O){return O===62?(n.enter(h),n.consume(O),n.exit(h),n.exit(s),n.exit(u),a):(n.enter(m),n.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===62?(n.exit("chunkString"),n.exit(m),S(O)):O===null||O===60||ge(O)?r(O):(n.consume(O),O===92?C:k)}function C(O){return O===60||O===62||O===92?(n.consume(O),k):k(O)}function U(O){return!x&&(O===null||O===41||$e(O))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),a(O)):x999||k===null||k===91||k===93&&!p||k===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?r(k):k===93?(n.exit(h),n.enter(s),n.consume(k),n.exit(s),n.exit(u),a):ge(k)?(n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),x):(n.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===null||k===91||k===93||ge(k)||m++>999?(n.exit("chunkString"),x(k)):(n.consume(k),p||(p=!De(k)),k===92?S:y)}function S(k){return k===91||k===92||k===93?(n.consume(k),m++,y):y(k)}}function mg(n,a,r,u,s,h){let f;return m;function m(S){return S===34||S===39||S===40?(n.enter(u),n.enter(s),n.consume(S),n.exit(s),f=S===40?41:S,p):r(S)}function p(S){return S===f?(n.enter(s),n.consume(S),n.exit(s),n.exit(u),a):(n.enter(h),d(S))}function d(S){return S===f?(n.exit(h),p(f)):S===null?r(S):ge(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),Ue(n,d,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===f||S===null||ge(S)?(n.exit("chunkString"),d(S)):(n.consume(S),S===92?y:x)}function y(S){return S===f||S===92?(n.consume(S),x):x(S)}}function Xa(n,a){let r;return u;function u(s){return ge(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),r=!0,u):De(s)?Ue(n,u,r?"linePrefix":"lineSuffix")(s):a(s)}}const ab={name:"definition",tokenize:ub},rb={partial:!0,tokenize:cb};function ub(n,a,r){const u=this;let s;return h;function h(k){return n.enter("definition"),f(k)}function f(k){return dg.call(u,n,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function m(k){return s=xn(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),p):r(k)}function p(k){return $e(k)?Xa(n,d)(k):d(k)}function d(k){return hg(n,x,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function x(k){return n.attempt(rb,y,y)(k)}function y(k){return De(k)?Ue(n,S,"whitespace")(k):S(k)}function S(k){return k===null||ge(k)?(n.exit("definition"),u.parser.defined.push(s),a(k)):r(k)}}function cb(n,a,r){return u;function u(m){return $e(m)?Xa(n,s)(m):r(m)}function s(m){return mg(n,h,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function h(m){return De(m)?Ue(n,f,"whitespace")(m):f(m)}function f(m){return m===null||ge(m)?a(m):r(m)}}const ob={name:"hardBreakEscape",tokenize:sb};function sb(n,a,r){return u;function u(h){return n.enter("hardBreakEscape"),n.consume(h),s}function s(h){return ge(h)?(n.exit("hardBreakEscape"),a(h)):r(h)}}const fb={name:"headingAtx",resolve:hb,tokenize:db};function hb(n,a){let r=n.length-2,u=3,s,h;return n[u][1].type==="whitespace"&&(u+=2),r-2>u&&n[r][1].type==="whitespace"&&(r-=2),n[r][1].type==="atxHeadingSequence"&&(u===r-1||r-4>u&&n[r-2][1].type==="whitespace")&&(r-=u+1===r?2:4),r>u&&(s={type:"atxHeadingText",start:n[u][1].start,end:n[r][1].end},h={type:"chunkText",start:n[u][1].start,end:n[r][1].end,contentType:"text"},tn(n,u,r-u+1,[["enter",s,a],["enter",h,a],["exit",h,a],["exit",s,a]])),n}function db(n,a,r){let u=0;return s;function s(x){return n.enter("atxHeading"),h(x)}function h(x){return n.enter("atxHeadingSequence"),f(x)}function f(x){return x===35&&u++<6?(n.consume(x),f):x===null||$e(x)?(n.exit("atxHeadingSequence"),m(x)):r(x)}function m(x){return x===35?(n.enter("atxHeadingSequence"),p(x)):x===null||ge(x)?(n.exit("atxHeading"),a(x)):De(x)?Ue(n,m,"whitespace")(x):(n.enter("atxHeadingText"),d(x))}function p(x){return x===35?(n.consume(x),p):(n.exit("atxHeadingSequence"),m(x))}function d(x){return x===null||x===35||$e(x)?(n.exit("atxHeadingText"),m(x)):(n.consume(x),d)}}const mb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mp=["pre","script","style","textarea"],pb={concrete:!0,name:"htmlFlow",resolveTo:xb,tokenize:bb},gb={partial:!0,tokenize:Sb},yb={partial:!0,tokenize:vb};function xb(n){let a=n.length;for(;a--&&!(n[a][0]==="enter"&&n[a][1].type==="htmlFlow"););return a>1&&n[a-2][1].type==="linePrefix"&&(n[a][1].start=n[a-2][1].start,n[a+1][1].start=n[a-2][1].start,n.splice(a-2,2)),n}function bb(n,a,r){const u=this;let s,h,f,m,p;return d;function d(_){return x(_)}function x(_){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(_),y}function y(_){return _===33?(n.consume(_),S):_===47?(n.consume(_),h=!0,U):_===63?(n.consume(_),s=3,u.interrupt?a:E):Ot(_)?(n.consume(_),f=String.fromCharCode(_),Q):r(_)}function S(_){return _===45?(n.consume(_),s=2,k):_===91?(n.consume(_),s=5,m=0,C):Ot(_)?(n.consume(_),s=4,u.interrupt?a:E):r(_)}function k(_){return _===45?(n.consume(_),u.interrupt?a:E):r(_)}function C(_){const le="CDATA[";return _===le.charCodeAt(m++)?(n.consume(_),m===le.length?u.interrupt?a:ee:C):r(_)}function U(_){return Ot(_)?(n.consume(_),f=String.fromCharCode(_),Q):r(_)}function Q(_){if(_===null||_===47||_===62||$e(_)){const le=_===47,se=f.toLowerCase();return!le&&!h&&mp.includes(se)?(s=1,u.interrupt?a(_):ee(_)):mb.includes(f.toLowerCase())?(s=6,le?(n.consume(_),O):u.interrupt?a(_):ee(_)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?r(_):h?K(_):Z(_))}return _===45||wt(_)?(n.consume(_),f+=String.fromCharCode(_),Q):r(_)}function O(_){return _===62?(n.consume(_),u.interrupt?a:ee):r(_)}function K(_){return De(_)?(n.consume(_),K):R(_)}function Z(_){return _===47?(n.consume(_),R):_===58||_===95||Ot(_)?(n.consume(_),re):De(_)?(n.consume(_),Z):R(_)}function re(_){return _===45||_===46||_===58||_===95||wt(_)?(n.consume(_),re):te(_)}function te(_){return _===61?(n.consume(_),L):De(_)?(n.consume(_),te):Z(_)}function L(_){return _===null||_===60||_===61||_===62||_===96?r(_):_===34||_===39?(n.consume(_),p=_,J):De(_)?(n.consume(_),L):me(_)}function J(_){return _===p?(n.consume(_),p=null,be):_===null||ge(_)?r(_):(n.consume(_),J)}function me(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||$e(_)?te(_):(n.consume(_),me)}function be(_){return _===47||_===62||De(_)?Z(_):r(_)}function R(_){return _===62?(n.consume(_),ne):r(_)}function ne(_){return _===null||ge(_)?ee(_):De(_)?(n.consume(_),ne):r(_)}function ee(_){return _===45&&s===2?(n.consume(_),M):_===60&&s===1?(n.consume(_),F):_===62&&s===4?(n.consume(_),T):_===63&&s===3?(n.consume(_),E):_===93&&s===5?(n.consume(_),Ee):ge(_)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(gb,Y,Te)(_)):_===null||ge(_)?(n.exit("htmlFlowData"),Te(_)):(n.consume(_),ee)}function Te(_){return n.check(yb,ie,Y)(_)}function ie(_){return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),W}function W(_){return _===null||ge(_)?Te(_):(n.enter("htmlFlowData"),ee(_))}function M(_){return _===45?(n.consume(_),E):ee(_)}function F(_){return _===47?(n.consume(_),f="",ae):ee(_)}function ae(_){if(_===62){const le=f.toLowerCase();return mp.includes(le)?(n.consume(_),T):ee(_)}return Ot(_)&&f.length<8?(n.consume(_),f+=String.fromCharCode(_),ae):ee(_)}function Ee(_){return _===93?(n.consume(_),E):ee(_)}function E(_){return _===62?(n.consume(_),T):_===45&&s===2?(n.consume(_),E):ee(_)}function T(_){return _===null||ge(_)?(n.exit("htmlFlowData"),Y(_)):(n.consume(_),T)}function Y(_){return n.exit("htmlFlow"),a(_)}}function vb(n,a,r){const u=this;return s;function s(f){return ge(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),h):r(f)}function h(f){return u.parser.lazy[u.now().line]?r(f):a(f)}}function Sb(n,a,r){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(Ia,a,r)}}const kb={name:"htmlText",tokenize:_b};function _b(n,a,r){const u=this;let s,h,f;return m;function m(E){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(E),p}function p(E){return E===33?(n.consume(E),d):E===47?(n.consume(E),te):E===63?(n.consume(E),Z):Ot(E)?(n.consume(E),me):r(E)}function d(E){return E===45?(n.consume(E),x):E===91?(n.consume(E),h=0,C):Ot(E)?(n.consume(E),K):r(E)}function x(E){return E===45?(n.consume(E),k):r(E)}function y(E){return E===null?r(E):E===45?(n.consume(E),S):ge(E)?(f=y,F(E)):(n.consume(E),y)}function S(E){return E===45?(n.consume(E),k):y(E)}function k(E){return E===62?M(E):E===45?S(E):y(E)}function C(E){const T="CDATA[";return E===T.charCodeAt(h++)?(n.consume(E),h===T.length?U:C):r(E)}function U(E){return E===null?r(E):E===93?(n.consume(E),Q):ge(E)?(f=U,F(E)):(n.consume(E),U)}function Q(E){return E===93?(n.consume(E),O):U(E)}function O(E){return E===62?M(E):E===93?(n.consume(E),O):U(E)}function K(E){return E===null||E===62?M(E):ge(E)?(f=K,F(E)):(n.consume(E),K)}function Z(E){return E===null?r(E):E===63?(n.consume(E),re):ge(E)?(f=Z,F(E)):(n.consume(E),Z)}function re(E){return E===62?M(E):Z(E)}function te(E){return Ot(E)?(n.consume(E),L):r(E)}function L(E){return E===45||wt(E)?(n.consume(E),L):J(E)}function J(E){return ge(E)?(f=J,F(E)):De(E)?(n.consume(E),J):M(E)}function me(E){return E===45||wt(E)?(n.consume(E),me):E===47||E===62||$e(E)?be(E):r(E)}function be(E){return E===47?(n.consume(E),M):E===58||E===95||Ot(E)?(n.consume(E),R):ge(E)?(f=be,F(E)):De(E)?(n.consume(E),be):M(E)}function R(E){return E===45||E===46||E===58||E===95||wt(E)?(n.consume(E),R):ne(E)}function ne(E){return E===61?(n.consume(E),ee):ge(E)?(f=ne,F(E)):De(E)?(n.consume(E),ne):be(E)}function ee(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(n.consume(E),s=E,Te):ge(E)?(f=ee,F(E)):De(E)?(n.consume(E),ee):(n.consume(E),ie)}function Te(E){return E===s?(n.consume(E),s=void 0,W):E===null?r(E):ge(E)?(f=Te,F(E)):(n.consume(E),Te)}function ie(E){return E===null||E===34||E===39||E===60||E===61||E===96?r(E):E===47||E===62||$e(E)?be(E):(n.consume(E),ie)}function W(E){return E===47||E===62||$e(E)?be(E):r(E)}function M(E){return E===62?(n.consume(E),n.exit("htmlTextData"),n.exit("htmlText"),a):r(E)}function F(E){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(E),n.exit("lineEnding"),ae}function ae(E){return De(E)?Ue(n,Ee,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):Ee(E)}function Ee(E){return n.enter("htmlTextData"),f(E)}}const Us={name:"labelEnd",resolveAll:zb,resolveTo:Cb,tokenize:wb},Eb={tokenize:Mb},Ab={tokenize:Nb},Tb={tokenize:Db};function zb(n){let a=-1;const r=[];for(;++a=3&&(d===null||ge(d))?(n.exit("thematicBreak"),a(d)):r(d)}function p(d){return d===s?(n.consume(d),u++,p):(n.exit("thematicBreakSequence"),De(d)?Ue(n,m,"whitespace")(d):m(d))}}const Vt={continuation:{tokenize:Gb},exit:Qb,name:"list",tokenize:Yb},Hb={partial:!0,tokenize:Xb},qb={partial:!0,tokenize:Vb};function Yb(n,a,r){const u=this,s=u.events[u.events.length-1];let h=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return m;function m(k){const C=u.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!u.containerState.marker||k===u.containerState.marker:bs(k)){if(u.containerState.type||(u.containerState.type=C,n.enter(C,{_container:!0})),C==="listUnordered")return n.enter("listItemPrefix"),k===42||k===45?n.check(bu,r,d)(k):d(k);if(!u.interrupt||k===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(k)}return r(k)}function p(k){return bs(k)&&++f<10?(n.consume(k),p):(!u.interrupt||f<2)&&(u.containerState.marker?k===u.containerState.marker:k===41||k===46)?(n.exit("listItemValue"),d(k)):r(k)}function d(k){return n.enter("listItemMarker"),n.consume(k),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||k,n.check(Ia,u.interrupt?r:x,n.attempt(Hb,S,y))}function x(k){return u.containerState.initialBlankLine=!0,h++,S(k)}function y(k){return De(k)?(n.enter("listItemPrefixWhitespace"),n.consume(k),n.exit("listItemPrefixWhitespace"),S):r(k)}function S(k){return u.containerState.size=h+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,a(k)}}function Gb(n,a,r){const u=this;return u.containerState._closeFlow=void 0,n.check(Ia,s,h);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,Ue(n,a,"listItemIndent",u.containerState.size+1)(m)}function h(m){return u.containerState.furtherBlankLines||!De(m)?(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,f(m)):(u.containerState.furtherBlankLines=void 0,u.containerState.initialBlankLine=void 0,n.attempt(qb,a,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,Ue(n,n.attempt(Vt,a,r),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Vb(n,a,r){const u=this;return Ue(n,s,"listItemIndent",u.containerState.size+1);function s(h){const f=u.events[u.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===u.containerState.size?a(h):r(h)}}function Qb(n){n.exit(this.containerState.type)}function Xb(n,a,r){const u=this;return Ue(n,s,"listItemPrefixWhitespace",u.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(h){const f=u.events[u.events.length-1];return!De(h)&&f&&f[1].type==="listItemPrefixWhitespace"?a(h):r(h)}}const pp={name:"setextUnderline",resolveTo:Zb,tokenize:Kb};function Zb(n,a){let r=n.length,u,s,h;for(;r--;)if(n[r][0]==="enter"){if(n[r][1].type==="content"){u=r;break}n[r][1].type==="paragraph"&&(s=r)}else n[r][1].type==="content"&&n.splice(r,1),!h&&n[r][1].type==="definition"&&(h=r);const f={type:"setextHeading",start:{...n[u][1].start},end:{...n[n.length-1][1].end}};return n[s][1].type="setextHeadingText",h?(n.splice(s,0,["enter",f,a]),n.splice(h+1,0,["exit",n[u][1],a]),n[u][1].end={...n[h][1].end}):n[u][1]=f,n.push(["exit",f,a]),n}function Kb(n,a,r){const u=this;let s;return h;function h(d){let x=u.events.length,y;for(;x--;)if(u.events[x][1].type!=="lineEnding"&&u.events[x][1].type!=="linePrefix"&&u.events[x][1].type!=="content"){y=u.events[x][1].type==="paragraph";break}return!u.parser.lazy[u.now().line]&&(u.interrupt||y)?(n.enter("setextHeadingLine"),s=d,f(d)):r(d)}function f(d){return n.enter("setextHeadingLineSequence"),m(d)}function m(d){return d===s?(n.consume(d),m):(n.exit("setextHeadingLineSequence"),De(d)?Ue(n,p,"lineSuffix")(d):p(d))}function p(d){return d===null||ge(d)?(n.exit("setextHeadingLine"),a(d)):r(d)}}const Fb={tokenize:Jb};function Jb(n){const a=this,r=n.attempt(Ia,u,n.attempt(this.parser.constructs.flowInitial,s,Ue(n,n.attempt(this.parser.constructs.flow,s,n.attempt(eb,s)),"linePrefix")));return r;function u(h){if(h===null){n.consume(h);return}return n.enter("lineEndingBlank"),n.consume(h),n.exit("lineEndingBlank"),a.currentConstruct=void 0,r}function s(h){if(h===null){n.consume(h);return}return n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),a.currentConstruct=void 0,r}}const Ib={resolveAll:gg()},$b=pg("string"),Wb=pg("text");function pg(n){return{resolveAll:gg(n==="text"?Pb:void 0),tokenize:a};function a(r){const u=this,s=this.parser.constructs[n],h=r.attempt(s,f,m);return f;function f(x){return d(x)?h(x):m(x)}function m(x){if(x===null){r.consume(x);return}return r.enter("data"),r.consume(x),p}function p(x){return d(x)?(r.exit("data"),h(x)):(r.consume(x),p)}function d(x){if(x===null)return!0;const y=s[x];let S=-1;if(y)for(;++S-1){const m=f[0];typeof m=="string"?f[0]=m.slice(u):f.shift()}h>0&&f.push(n[s].slice(0,h))}return f}function hv(n,a){let r=-1;const u=[];let s;for(;++r0){const Nt=xe.tokenStack[xe.tokenStack.length-1];(Nt[1]||yp).call(xe,void 0,Nt[0])}for(P.position={start:_l(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:_l(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He0&&(u.className=["language-"+s[0]]);let h={type:"element",tagName:"code",properties:u,children:[{type:"text",value:r}]};return a.meta&&(h.data={meta:a.meta}),n.patch(a,h),h=n.applyData(a,h),h={type:"element",tagName:"pre",properties:{},children:[h]},n.patch(a,h),h}function Tv(n,a){const r={type:"element",tagName:"del",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function zv(n,a){const r={type:"element",tagName:"em",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function Cv(n,a){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(a.identifier).toUpperCase(),s=Xi(u.toLowerCase()),h=n.footnoteOrder.indexOf(u);let f,m=n.footnoteCounts.get(u);m===void 0?(m=0,n.footnoteOrder.push(u),f=n.footnoteOrder.length):f=h+1,m+=1,n.footnoteCounts.set(u,m);const p={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(m>1?"-"+m:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(a,p);const d={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(a,d),n.applyData(a,d)}function wv(n,a){const r={type:"element",tagName:"h"+a.depth,properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function Mv(n,a){if(n.options.allowDangerousHtml){const r={type:"raw",value:a.value};return n.patch(a,r),n.applyData(a,r)}}function bg(n,a){const r=a.referenceType;let u="]";if(r==="collapsed"?u+="[]":r==="full"&&(u+="["+(a.label||a.identifier)+"]"),a.type==="imageReference")return[{type:"text",value:"!["+a.alt+u}];const s=n.all(a),h=s[0];h&&h.type==="text"?h.value="["+h.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=u:s.push({type:"text",value:u}),s}function Nv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return bg(n,a);const s={src:Xi(u.url||""),alt:a.alt};u.title!==null&&u.title!==void 0&&(s.title=u.title);const h={type:"element",tagName:"img",properties:s,children:[]};return n.patch(a,h),n.applyData(a,h)}function Dv(n,a){const r={src:Xi(a.url)};a.alt!==null&&a.alt!==void 0&&(r.alt=a.alt),a.title!==null&&a.title!==void 0&&(r.title=a.title);const u={type:"element",tagName:"img",properties:r,children:[]};return n.patch(a,u),n.applyData(a,u)}function Ov(n,a){const r={type:"text",value:a.value.replace(/\r?\n|\r/g," ")};n.patch(a,r);const u={type:"element",tagName:"code",properties:{},children:[r]};return n.patch(a,u),n.applyData(a,u)}function jv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return bg(n,a);const s={href:Xi(u.url||"")};u.title!==null&&u.title!==void 0&&(s.title=u.title);const h={type:"element",tagName:"a",properties:s,children:n.all(a)};return n.patch(a,h),n.applyData(a,h)}function Rv(n,a){const r={href:Xi(a.url)};a.title!==null&&a.title!==void 0&&(r.title=a.title);const u={type:"element",tagName:"a",properties:r,children:n.all(a)};return n.patch(a,u),n.applyData(a,u)}function Lv(n,a,r){const u=n.all(a),s=r?Bv(r):vg(a),h={},f=[];if(typeof a.checked=="boolean"){const x=u[0];let y;x&&x.type==="element"&&x.tagName==="p"?y=x:(y={type:"element",tagName:"p",properties:{},children:[]},u.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:a.checked,disabled:!0},children:[]}),h.className=["task-list-item"]}let m=-1;for(;++m1}function Uv(n,a){const r={},u=n.all(a);let s=-1;for(typeof a.start=="number"&&a.start!==1&&(r.start=a.start);++s0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(r,!0)},m=Ds(a.children[1]),p=Pp(a.children[a.children.length-1]);m&&p&&(f.position={start:m,end:p}),s.push(f)}const h={type:"element",tagName:"table",properties:{},children:n.wrap(s,!0)};return n.patch(a,h),n.applyData(a,h)}function Vv(n,a,r){const u=r?r.children:void 0,h=(u?u.indexOf(a):1)===0?"th":"td",f=r&&r.type==="table"?r.align:void 0,m=f?f.length:a.children.length;let p=-1;const d=[];for(;++p0,!0),u[0]),s=u.index+u[0].length,u=r.exec(a);return h.push(vp(a.slice(s),s>0,!1)),h.join("")}function vp(n,a,r){let u=0,s=n.length;if(a){let h=n.codePointAt(u);for(;h===xp||h===bp;)u++,h=n.codePointAt(u)}if(r){let h=n.codePointAt(s-1);for(;h===xp||h===bp;)s--,h=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function Zv(n,a){const r={type:"text",value:Xv(String(a.value))};return n.patch(a,r),n.applyData(a,r)}function Kv(n,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(a,r),n.applyData(a,r)}const Fv={blockquote:_v,break:Ev,code:Av,delete:Tv,emphasis:zv,footnoteReference:Cv,heading:wv,html:Mv,imageReference:Nv,image:Dv,inlineCode:Ov,linkReference:jv,link:Rv,listItem:Lv,list:Uv,paragraph:Hv,root:qv,strong:Yv,table:Gv,tableCell:Qv,tableRow:Vv,text:Zv,thematicBreak:Kv,toml:du,yaml:du,definition:du,footnoteDefinition:du};function du(){}const Sg=-1,wu=0,Za=1,ku=2,Hs=3,qs=4,Ys=5,Gs=6,kg=7,_g=8,Eg=typeof self=="object"?self:globalThis,Sp=(n,a)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new Eg[n](a)},Jv=(n,a)=>{const r=(s,h)=>(n.set(h,s),s),u=s=>{if(n.has(s))return n.get(s);const[h,f]=a[s];switch(h){case wu:case Sg:return r(f,s);case Za:{const m=r([],s);for(const p of f)m.push(u(p));return m}case ku:{const m=r({},s);for(const[p,d]of f)m[u(p)]=u(d);return m}case Hs:return r(new Date(f),s);case qs:{const{source:m,flags:p}=f;return r(new RegExp(m,p),s)}case Ys:{const m=r(new Map,s);for(const[p,d]of f)m.set(u(p),u(d));return m}case Gs:{const m=r(new Set,s);for(const p of f)m.add(u(p));return m}case kg:{const{name:m,message:p}=f;return r(typeof Eg[m]=="function"?Sp(m,p):new Error(p),s)}case _g:return r(BigInt(f),s);case"BigInt":return r(Object(BigInt(f)),s);case"ArrayBuffer":return r(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:m}=new Uint8Array(f);return r(new DataView(m),f)}}return r(Sp(h,f),s)};return u},kp=n=>Jv(new Map,n)(0),Il="",{toString:Iv}={},{keys:$v}=Object,Va=n=>{const a=typeof n;if(a!=="object"||!n)return[wu,a];const r=Iv.call(n).slice(8,-1);switch(r){case"Array":return[Za,Il];case"Object":return[ku,Il];case"Date":return[Hs,Il];case"RegExp":return[qs,Il];case"Map":return[Ys,Il];case"Set":return[Gs,Il];case"DataView":return[Za,r]}return r.includes("Array")?[Za,r]:n instanceof Error?[kg,n.name||"Error"]:[ku,r]},mu=([n,a])=>n===wu&&(a==="function"||a==="symbol"),Wv=(n,a,r,u)=>{const s=(f,m)=>{const p=u.push(f)-1;return r.set(m,p),p},h=f=>{if(r.has(f))return r.get(f);let[m,p]=Va(f);switch(m){case wu:{let x=f;switch(p){case"bigint":m=_g,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);x=null;break;case"undefined":return s([Sg],f)}return s([m,x],f)}case Za:{if(p){let S=f;return p==="DataView"?S=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(S=new Uint8Array(f)),s([p,[...S]],f)}const x=[],y=s([m,x],f);for(const S of f)x.push(h(S));return y}case ku:{if(p)switch(p){case"BigInt":return s([p,f.toString()],f);case"Boolean":case"Number":case"String":return s([p,f.valueOf()],f)}if(a&&"toJSON"in f)return h(f.toJSON());const x=[],y=s([m,x],f);for(const S of $v(f))(n||!mu(Va(f[S])))&&x.push([h(S),h(f[S])]);return y}case Hs:return s([m,isNaN(f.getTime())?Il:f.toISOString()],f);case qs:{const{source:x,flags:y}=f;return s([m,{source:x,flags:y}],f)}case Ys:{const x=[],y=s([m,x],f);for(const[S,k]of f)(n||!(mu(Va(S))||mu(Va(k))))&&x.push([h(S),h(k)]);return y}case Gs:{const x=[],y=s([m,x],f);for(const S of f)(n||!mu(Va(S)))&&x.push(h(S));return y}}const{message:d}=f;return s([m,{name:p,message:d}],f)};return h},_p=(n,{json:a,lossy:r}={})=>{const u=[];return Wv(!(a||r),!!a,new Map,u)(n),u},_u=typeof structuredClone=="function"?(n,a)=>a&&("json"in a||"lossy"in a)?kp(_p(n,a)):structuredClone(n):(n,a)=>kp(_p(n,a));function Pv(n,a){const r=[{type:"text",value:"↩"}];return a>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(a)}]}),r}function eS(n,a){return"Back to reference "+(n+1)+(a>1?"-"+a:"")}function tS(n){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=n.options.footnoteBackContent||Pv,u=n.options.footnoteBackLabel||eS,s=n.options.footnoteLabel||"Footnotes",h=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},m=[];let p=-1;for(;++p0&&C.push({type:"text",value:" "});let K=typeof r=="string"?r:r(p,k);typeof K=="string"&&(K={type:"text",value:K}),C.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+S+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,k),className:["data-footnote-backref"]},children:Array.isArray(K)?K:[K]})}const Q=x[x.length-1];if(Q&&Q.type==="element"&&Q.tagName==="p"){const K=Q.children[Q.children.length-1];K&&K.type==="text"?K.value+=" ":Q.children.push({type:"text",value:" "}),Q.children.push(...C)}else x.push(...C);const O={type:"element",tagName:"li",properties:{id:a+"fn-"+S},children:n.wrap(x,!0)};n.patch(d,O),m.push(O)}if(m.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:h,properties:{..._u(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:n.wrap(m,!0)},{type:"text",value:` +`}]}}const Mu=(function(n){if(n==null)return aS;if(typeof n=="function")return Nu(n);if(typeof n=="object")return Array.isArray(n)?nS(n):lS(n);if(typeof n=="string")return iS(n);throw new Error("Expected function, string, or object as test")});function nS(n){const a=[];let r=-1;for(;++r":""))+")"})}return S;function S(){let k=Ag,C,U,Q;if((!a||h(p,d,x[x.length-1]||void 0))&&(k=oS(r(p,x)),k[0]===Ss))return k;if("children"in p&&p.children){const O=p;if(O.children&&k[0]!==cS)for(U=(u?O.children.length:-1)+f,Q=x.concat(O);U>-1&&U0&&r.push({type:"text",value:` +`}),r}function Ep(n){let a=0,r=n.charCodeAt(a);for(;r===9||r===32;)a++,r=n.charCodeAt(a);return n.slice(a)}function Ap(n,a){const r=fS(n,a),u=r.one(n,void 0),s=tS(r),h=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&h.children.push({type:"text",value:` +`},s),h}function gS(n,a){return n&&"run"in n?async function(r,u){const s=Ap(r,{file:u,...a});await n.run(s,u)}:function(r,u){return Ap(r,{file:u,...n||a})}}function Tp(n){if(n)throw n}var es,zp;function yS(){if(zp)return es;zp=1;var n=Object.prototype.hasOwnProperty,a=Object.prototype.toString,r=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):a.call(d)==="[object Array]"},h=function(d){if(!d||a.call(d)!=="[object Object]")return!1;var x=n.call(d,"constructor"),y=d.constructor&&d.constructor.prototype&&n.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!x&&!y)return!1;var S;for(S in d);return typeof S>"u"||n.call(d,S)},f=function(d,x){r&&x.name==="__proto__"?r(d,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):d[x.name]=x.newValue},m=function(d,x){if(x==="__proto__")if(n.call(d,x)){if(u)return u(d,x).value}else return;return d[x]};return es=function p(){var d,x,y,S,k,C,U=arguments[0],Q=1,O=arguments.length,K=!1;for(typeof U=="boolean"&&(K=U,U=arguments[1]||{},Q=2),(U==null||typeof U!="object"&&typeof U!="function")&&(U={});Qf.length;let p;m&&f.push(s);try{p=n.apply(this,f)}catch(d){const x=d;if(m&&r)throw x;return s(x)}m||(p&&p.then&&typeof p.then=="function"?p.then(h,s):p instanceof Error?s(p):h(p))}function s(f,...m){r||(r=!0,a(f,...m))}function h(f){s(null,f)}}const Tn={basename:SS,dirname:kS,extname:_S,join:ES,sep:"/"};function SS(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');$a(n);let r=0,u=-1,s=n.length,h;if(a===void 0||a.length===0||a.length>n.length){for(;s--;)if(n.codePointAt(s)===47){if(h){r=s+1;break}}else u<0&&(h=!0,u=s+1);return u<0?"":n.slice(r,u)}if(a===n)return"";let f=-1,m=a.length-1;for(;s--;)if(n.codePointAt(s)===47){if(h){r=s+1;break}}else f<0&&(h=!0,f=s+1),m>-1&&(n.codePointAt(s)===a.codePointAt(m--)?m<0&&(u=s):(m=-1,u=f));return r===u?u=f:u<0&&(u=n.length),n.slice(r,u)}function kS(n){if($a(n),n.length===0)return".";let a=-1,r=n.length,u;for(;--r;)if(n.codePointAt(r)===47){if(u){a=r;break}}else u||(u=!0);return a<0?n.codePointAt(0)===47?"/":".":a===1&&n.codePointAt(0)===47?"//":n.slice(0,a)}function _S(n){$a(n);let a=n.length,r=-1,u=0,s=-1,h=0,f;for(;a--;){const m=n.codePointAt(a);if(m===47){if(f){u=a+1;break}continue}r<0&&(f=!0,r=a+1),m===46?s<0?s=a:h!==1&&(h=1):s>-1&&(h=-1)}return s<0||r<0||h===0||h===1&&s===r-1&&s===u+1?"":n.slice(s,r)}function ES(...n){let a=-1,r;for(;++a0&&n.codePointAt(n.length-1)===47&&(r+="/"),a?"/"+r:r}function TS(n,a){let r="",u=0,s=-1,h=0,f=-1,m,p;for(;++f<=n.length;){if(f2){if(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",u=0):(r=r.slice(0,p),u=r.length-1-r.lastIndexOf("/")),s=f,h=0;continue}}else if(r.length>0){r="",u=0,s=f,h=0;continue}}a&&(r=r.length>0?r+"/..":"..",u=2)}else r.length>0?r+="/"+n.slice(s+1,f):r=n.slice(s+1,f),u=f-s-1;s=f,h=0}else m===46&&h>-1?h++:h=-1}return r}function $a(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const zS={cwd:CS};function CS(){return"/"}function Es(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function wS(n){if(typeof n=="string")n=new URL(n);else if(!Es(n)){const a=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw a.code="ERR_INVALID_ARG_TYPE",a}if(n.protocol!=="file:"){const a=new TypeError("The URL must be of scheme file");throw a.code="ERR_INVALID_URL_SCHEME",a}return MS(n)}function MS(n){if(n.hostname!==""){const u=new TypeError('File URL host must be "localhost" or empty on darwin');throw u.code="ERR_INVALID_FILE_URL_HOST",u}const a=n.pathname;let r=-1;for(;++r0){let[k,...C]=x;const U=u[S][1];_s(U)&&_s(k)&&(k=ts(!0,U,k)),u[S]=[d,k,...C]}}}}const jS=new Qs().freeze();function as(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function rs(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function us(n,a){if(a)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function wp(n){if(!_s(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Mp(n,a,r){if(!r)throw new Error("`"+n+"` finished async. Use `"+a+"` instead")}function pu(n){return RS(n)?n:new zg(n)}function RS(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function LS(n){return typeof n=="string"||BS(n)}function BS(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const US="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Np=[],Dp={allowDangerousHtml:!0},HS=/^(https?|ircs?|mailto|xmpp)$/i,qS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YS(n){const a=GS(n),r=VS(n);return QS(a.runSync(a.parse(r),r),n)}function GS(n){const a=n.rehypePlugins||Np,r=n.remarkPlugins||Np,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Dp}:Dp;return jS().use(kv).use(r).use(gS,u).use(a)}function VS(n){const a=n.children||"",r=new zg;return typeof a=="string"&&(r.value=a),r}function QS(n,a){const r=a.allowedElements,u=a.allowElement,s=a.components,h=a.disallowedElements,f=a.skipHtml,m=a.unwrapDisallowed,p=a.urlTransform||XS;for(const x of qS)Object.hasOwn(a,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+US+x.id,void 0);return Vs(n,d),ax(n,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(x,y,S){if(x.type==="raw"&&S&&typeof y=="number")return f?S.children.splice(y,1):S.children[y]={type:"text",value:x.value},y;if(x.type==="element"){let k;for(k in $o)if(Object.hasOwn($o,k)&&Object.hasOwn(x.properties,k)){const C=x.properties[k],U=$o[k];(U===null||U.includes(x.tagName))&&(x.properties[k]=p(String(C||""),k,x))}}if(x.type==="element"){let k=r?!r.includes(x.tagName):h?h.includes(x.tagName):!1;if(!k&&u&&typeof y=="number"&&(k=!u(x,y,S)),k&&S&&typeof y=="number")return m&&x.children?S.children.splice(y,1,...x.children):S.children.splice(y,1),y}}}function XS(n){const a=n.indexOf(":"),r=n.indexOf("?"),u=n.indexOf("#"),s=n.indexOf("/");return a===-1||s!==-1&&a>s||r!==-1&&a>r||u!==-1&&a>u||HS.test(n.slice(0,a))?n:""}function Op(n,a){const r=String(n);if(typeof a!="string")throw new TypeError("Expected character");let u=0,s=r.indexOf(a);for(;s!==-1;)u++,s=r.indexOf(a,s+a.length);return u}function ZS(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function KS(n,a,r){const s=Mu((r||{}).ignore||[]),h=FS(a);let f=-1;for(;++f0?{type:"text",value:L}:void 0),L===!1?S.lastIndex=re+1:(C!==re&&K.push({type:"text",value:d.value.slice(C,re)}),Array.isArray(L)?K.push(...L):L&&K.push(L),C=re+Z[0].length,O=!0),!S.global)break;Z=S.exec(d.value)}return O?(C?\]}]+$/.exec(n);if(!a)return[n,void 0];n=n.slice(0,a.index);let r=a[0],u=r.indexOf(")");const s=Op(n,"(");let h=Op(n,")");for(;u!==-1&&s>h;)n+=r.slice(0,u+1),r=r.slice(u+1),u=r.indexOf(")"),h++;return[n,r]}function Cg(n,a){const r=n.input.charCodeAt(n.index-1);return(n.index===0||Wl(r)||zu(r))&&(!a||r!==47)}wg.peek=y2;function o2(){this.buffer()}function s2(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function f2(){this.buffer()}function h2(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function d2(n){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=xn(this.sliceSerialize(n)).toLowerCase(),r.label=a}function m2(n){this.exit(n)}function p2(n){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=xn(this.sliceSerialize(n)).toLowerCase(),r.label=a}function g2(n){this.exit(n)}function y2(){return"["}function wg(n,a,r,u){const s=r.createTracker(u);let h=s.move("[^");const f=r.enter("footnoteReference"),m=r.enter("reference");return h+=s.move(r.safe(r.associationId(n),{after:"]",before:h})),m(),f(),h+=s.move("]"),h}function x2(){return{enter:{gfmFootnoteCallString:o2,gfmFootnoteCall:s2,gfmFootnoteDefinitionLabelString:f2,gfmFootnoteDefinition:h2},exit:{gfmFootnoteCallString:d2,gfmFootnoteCall:m2,gfmFootnoteDefinitionLabelString:p2,gfmFootnoteDefinition:g2}}}function b2(n){let a=!1;return n&&n.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:wg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(u,s,h,f){const m=h.createTracker(f);let p=m.move("[^");const d=h.enter("footnoteDefinition"),x=h.enter("label");return p+=m.move(h.safe(h.associationId(u),{before:p,after:"]"})),x(),p+=m.move("]:"),u.children&&u.children.length>0&&(m.shift(4),p+=m.move((a?` +`:" ")+h.indentLines(h.containerFlow(u,m.current()),a?Mg:v2))),d(),p}}function v2(n,a,r){return a===0?n:Mg(n,a,r)}function Mg(n,a,r){return(r?"":" ")+n}const S2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ng.peek=T2;function k2(){return{canContainEols:["delete"],enter:{strikethrough:E2},exit:{strikethrough:A2}}}function _2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:S2}],handlers:{delete:Ng}}}function E2(n){this.enter({type:"delete",children:[]},n)}function A2(n){this.exit(n)}function Ng(n,a,r,u){const s=r.createTracker(u),h=r.enter("strikethrough");let f=s.move("~~");return f+=r.containerPhrasing(n,{...s.current(),before:f,after:"~"}),f+=s.move("~~"),h(),f}function T2(){return"~"}function z2(n){return n.length}function C2(n,a){const r=a||{},u=(r.align||[]).concat(),s=r.stringLength||z2,h=[],f=[],m=[],p=[];let d=0,x=-1;for(;++xd&&(d=n[x].length);++Op[O])&&(p[O]=Z)}U.push(K)}f[x]=U,m[x]=Q}let y=-1;if(typeof u=="object"&&"length"in u)for(;++yp[y]&&(p[y]=K),k[y]=K),S[y]=Z}f.splice(1,0,S),m.splice(1,0,k),x=-1;const C=[];for(;++x "),h.shift(2);const f=r.indentLines(r.containerFlow(n,h.current()),N2);return s(),f}function N2(n,a,r){return">"+(r?"":" ")+n}function D2(n,a){return Rp(n,a.inConstruct,!0)&&!Rp(n,a.notInConstruct,!1)}function Rp(n,a,r){if(typeof a=="string"&&(a=[a]),!a||a.length===0)return r;let u=-1;for(;++uf&&(f=h):h=1,s=u+a.length,u=r.indexOf(a,s);return f}function j2(n,a){return!!(a.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function R2(n){const a=n.options.fence||"`";if(a!=="`"&&a!=="~")throw new Error("Cannot serialize code with `"+a+"` for `options.fence`, expected `` ` `` or `~`");return a}function L2(n,a,r,u){const s=R2(r),h=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(j2(n,r)){const y=r.enter("codeIndented"),S=r.indentLines(h,B2);return y(),S}const m=r.createTracker(u),p=s.repeat(Math.max(O2(h,s)+1,3)),d=r.enter("codeFenced");let x=m.move(p);if(n.lang){const y=r.enter(`codeFencedLang${f}`);x+=m.move(r.safe(n.lang,{before:x,after:" ",encode:["`"],...m.current()})),y()}if(n.lang&&n.meta){const y=r.enter(`codeFencedMeta${f}`);x+=m.move(" "),x+=m.move(r.safe(n.meta,{before:x,after:` +`,encode:["`"],...m.current()})),y()}return x+=m.move(` +`),h&&(x+=m.move(h+` +`)),x+=m.move(p),d(),x}function B2(n,a,r){return(r?"":" ")+n}function Xs(n){const a=n.options.quote||'"';if(a!=='"'&&a!=="'")throw new Error("Cannot serialize title with `"+a+"` for `options.quote`, expected `\"`, or `'`");return a}function U2(n,a,r,u){const s=Xs(r),h=s==='"'?"Quote":"Apostrophe",f=r.enter("definition");let m=r.enter("label");const p=r.createTracker(u);let d=p.move("[");return d+=p.move(r.safe(r.associationId(n),{before:d,after:"]",...p.current()})),d+=p.move("]: "),m(),!n.url||/[\0- \u007F]/.test(n.url)?(m=r.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(r.safe(n.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(m=r.enter("destinationRaw"),d+=p.move(r.safe(n.url,{before:d,after:n.title?" ":` +`,...p.current()}))),m(),n.title&&(m=r.enter(`title${h}`),d+=p.move(" "+s),d+=p.move(r.safe(n.title,{before:d,after:s,...p.current()})),d+=p.move(s),m()),f(),d}function H2(n){const a=n.options.emphasis||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize emphasis with `"+a+"` for `options.emphasis`, expected `*`, or `_`");return a}function Fa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Eu(n,a,r){const u=Gi(n),s=Gi(a);return u===void 0?s===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:u===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Dg.peek=q2;function Dg(n,a,r,u){const s=H2(r),h=r.enter("emphasis"),f=r.createTracker(u),m=f.move(s);let p=f.move(r.containerPhrasing(n,{after:s,before:m,...f.current()}));const d=p.charCodeAt(0),x=Eu(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Fa(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Eu(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Fa(y));const k=f.move(s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function q2(n,a,r){return r.options.emphasis||"*"}function Y2(n,a){let r=!1;return Vs(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return r=!0,Ss}),!!((!n.depth||n.depth<3)&&Ls(n)&&(a.options.setext||r))}function G2(n,a,r,u){const s=Math.max(Math.min(6,n.depth||1),1),h=r.createTracker(u);if(Y2(n,r)){const x=r.enter("headingSetext"),y=r.enter("phrasing"),S=r.containerPhrasing(n,{...h.current(),before:` +`,after:` +`});return y(),x(),S+` +`+(s===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(` +`))+1))}const f="#".repeat(s),m=r.enter("headingAtx"),p=r.enter("phrasing");h.move(f+" ");let d=r.containerPhrasing(n,{before:"# ",after:` +`,...h.current()});return/^[\t ]/.test(d)&&(d=Fa(d.charCodeAt(0))+d.slice(1)),d=d?f+" "+d:f,r.options.closeAtx&&(d+=" "+f),p(),m(),d}Og.peek=V2;function Og(n){return n.value||""}function V2(){return"<"}jg.peek=Q2;function jg(n,a,r,u){const s=Xs(r),h=s==='"'?"Quote":"Apostrophe",f=r.enter("image");let m=r.enter("label");const p=r.createTracker(u);let d=p.move("![");return d+=p.move(r.safe(n.alt,{before:d,after:"]",...p.current()})),d+=p.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=r.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(r.safe(n.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(m=r.enter("destinationRaw"),d+=p.move(r.safe(n.url,{before:d,after:n.title?" ":")",...p.current()}))),m(),n.title&&(m=r.enter(`title${h}`),d+=p.move(" "+s),d+=p.move(r.safe(n.title,{before:d,after:s,...p.current()})),d+=p.move(s),m()),d+=p.move(")"),f(),d}function Q2(){return"!"}Rg.peek=X2;function Rg(n,a,r,u){const s=n.referenceType,h=r.enter("imageReference");let f=r.enter("label");const m=r.createTracker(u);let p=m.move("![");const d=r.safe(n.alt,{before:p,after:"]",...m.current()});p+=m.move(d+"]["),f();const x=r.stack;r.stack=[],f=r.enter("reference");const y=r.safe(r.associationId(n),{before:p,after:"]",...m.current()});return f(),r.stack=x,h(),s==="full"||!d||d!==y?p+=m.move(y+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function X2(){return"!"}Lg.peek=Z2;function Lg(n,a,r){let u=n.value||"",s="`",h=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(u);)s+="`";for(/[^ \r\n]/.test(u)&&(/^[ \r\n]/.test(u)&&/[ \r\n]$/.test(u)||/^`|`$/.test(u))&&(u=" "+u+" ");++h\u007F]/.test(n.url))}Ug.peek=K2;function Ug(n,a,r,u){const s=Xs(r),h=s==='"'?"Quote":"Apostrophe",f=r.createTracker(u);let m,p;if(Bg(n,r)){const x=r.stack;r.stack=[],m=r.enter("autolink");let y=f.move("<");return y+=f.move(r.containerPhrasing(n,{before:y,after:">",...f.current()})),y+=f.move(">"),m(),r.stack=x,y}m=r.enter("link"),p=r.enter("label");let d=f.move("[");return d+=f.move(r.containerPhrasing(n,{before:d,after:"](",...f.current()})),d+=f.move("]("),p(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(p=r.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(r.safe(n.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(p=r.enter("destinationRaw"),d+=f.move(r.safe(n.url,{before:d,after:n.title?" ":")",...f.current()}))),p(),n.title&&(p=r.enter(`title${h}`),d+=f.move(" "+s),d+=f.move(r.safe(n.title,{before:d,after:s,...f.current()})),d+=f.move(s),p()),d+=f.move(")"),m(),d}function K2(n,a,r){return Bg(n,r)?"<":"["}Hg.peek=F2;function Hg(n,a,r,u){const s=n.referenceType,h=r.enter("linkReference");let f=r.enter("label");const m=r.createTracker(u);let p=m.move("[");const d=r.containerPhrasing(n,{before:p,after:"]",...m.current()});p+=m.move(d+"]["),f();const x=r.stack;r.stack=[],f=r.enter("reference");const y=r.safe(r.associationId(n),{before:p,after:"]",...m.current()});return f(),r.stack=x,h(),s==="full"||!d||d!==y?p+=m.move(y+"]"):s==="shortcut"?p=p.slice(0,-1):p+=m.move("]"),p}function F2(){return"["}function Zs(n){const a=n.options.bullet||"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bullet`, expected `*`, `+`, or `-`");return a}function J2(n){const a=Zs(n),r=n.options.bulletOther;if(!r)return a==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===a)throw new Error("Expected `bullet` (`"+a+"`) and `bulletOther` (`"+r+"`) to be different");return r}function I2(n){const a=n.options.bulletOrdered||".";if(a!=="."&&a!==")")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOrdered`, expected `.` or `)`");return a}function qg(n){const a=n.options.rule||"*";if(a!=="*"&&a!=="-"&&a!=="_")throw new Error("Cannot serialize rules with `"+a+"` for `options.rule`, expected `*`, `-`, or `_`");return a}function $2(n,a,r,u){const s=r.enter("list"),h=r.bulletCurrent;let f=n.ordered?I2(r):Zs(r);const m=n.ordered?f==="."?")":".":J2(r);let p=a&&r.bulletLastUsed?f===r.bulletLastUsed:!1;if(!n.ordered){const x=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&x&&(!x.children||!x.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(p=!0),qg(r)===f&&x){let y=-1;for(;++y-1?a.start:1)+(r.options.incrementListMarker===!1?0:a.children.indexOf(n))+h);let f=h.length+1;(s==="tab"||s==="mixed"&&(a&&a.type==="list"&&a.spread||n.spread))&&(f=Math.ceil(f/4)*4);const m=r.createTracker(u);m.move(h+" ".repeat(f-h.length)),m.shift(f);const p=r.enter("listItem"),d=r.indentLines(r.containerFlow(n,m.current()),x);return p(),d;function x(y,S,k){return S?(k?"":" ".repeat(f))+y:(k?h:h+" ".repeat(f-h.length))+y}}function ek(n,a,r,u){const s=r.enter("paragraph"),h=r.enter("phrasing"),f=r.containerPhrasing(n,u);return h(),s(),f}const tk=Mu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function nk(n,a,r,u){return(n.children.some(function(f){return tk(f)})?r.containerPhrasing:r.containerFlow).call(r,n,u)}function lk(n){const a=n.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}Yg.peek=ik;function Yg(n,a,r,u){const s=lk(r),h=r.enter("strong"),f=r.createTracker(u),m=f.move(s+s);let p=f.move(r.containerPhrasing(n,{after:s,before:m,...f.current()}));const d=p.charCodeAt(0),x=Eu(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Fa(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Eu(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Fa(y));const k=f.move(s+s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function ik(n,a,r){return r.options.strong||"*"}function ak(n,a,r,u){return r.safe(n.value,u)}function rk(n){const a=n.options.ruleRepetition||3;if(a<3)throw new Error("Cannot serialize rules with repetition `"+a+"` for `options.ruleRepetition`, expected `3` or more");return a}function uk(n,a,r){const u=(qg(r)+(r.options.ruleSpaces?" ":"")).repeat(rk(r));return r.options.ruleSpaces?u.slice(0,-1):u}const Gg={blockquote:M2,break:Lp,code:L2,definition:U2,emphasis:Dg,hardBreak:Lp,heading:G2,html:Og,image:jg,imageReference:Rg,inlineCode:Lg,link:Ug,linkReference:Hg,list:$2,listItem:P2,paragraph:ek,root:nk,strong:Yg,text:ak,thematicBreak:uk};function ck(){return{enter:{table:ok,tableData:Bp,tableHeader:Bp,tableRow:fk},exit:{codeText:hk,table:sk,tableData:fs,tableHeader:fs,tableRow:fs}}}function ok(n){const a=n._align;this.enter({type:"table",align:a.map(function(r){return r==="none"?null:r}),children:[]},n),this.data.inTable=!0}function sk(n){this.exit(n),this.data.inTable=void 0}function fk(n){this.enter({type:"tableRow",children:[]},n)}function fs(n){this.exit(n)}function Bp(n){this.enter({type:"tableCell",children:[]},n)}function hk(n){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,dk));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(n)}function dk(n,a){return a==="|"?a:n}function mk(n){const a=n||{},r=a.tableCellPadding,u=a.tablePipeAlign,s=a.stringLength,h=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:p,tableRow:m}};function f(k,C,U,Q){return d(x(k,U,Q),k.align)}function m(k,C,U,Q){const O=y(k,U,Q),K=d([O]);return K.slice(0,K.indexOf(` +`))}function p(k,C,U,Q){const O=U.enter("tableCell"),K=U.enter("phrasing"),Z=U.containerPhrasing(k,{...Q,before:h,after:h});return K(),O(),Z}function d(k,C){return C2(k,{align:C,alignDelimiters:u,padding:r,stringLength:s})}function x(k,C,U){const Q=k.children;let O=-1;const K=[],Z=C.enter("table");for(;++O0&&!r&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const Dk={tokenize:qk,partial:!0};function Ok(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Bk,continuation:{tokenize:Uk},exit:Hk}},text:{91:{name:"gfmFootnoteCall",tokenize:Lk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jk,resolveTo:Rk}}}}function jk(n,a,r){const u=this;let s=u.events.length;const h=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let f;for(;s--;){const p=u.events[s][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return m;function m(p){if(!f||!f._balanced)return r(p);const d=xn(u.sliceSerialize({start:f.end,end:u.now()}));return d.codePointAt(0)!==94||!h.includes(d.slice(1))?r(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),a(p))}}function Rk(n,a){let r=n.length;for(;r--;)if(n[r][1].type==="labelImage"&&n[r][0]==="enter"){n[r][1];break}n[r+1][1].type="data",n[r+3][1].type="gfmFootnoteCallLabelMarker";const u={type:"gfmFootnoteCall",start:Object.assign({},n[r+3][1].start),end:Object.assign({},n[n.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},n[r+3][1].end),end:Object.assign({},n[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const h={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},h.start),end:Object.assign({},h.end)},m=[n[r+1],n[r+2],["enter",u,a],n[r+3],n[r+4],["enter",s,a],["exit",s,a],["enter",h,a],["enter",f,a],["exit",f,a],["exit",h,a],n[n.length-2],n[n.length-1],["exit",u,a]];return n.splice(r,n.length-r+1,...m),n}function Lk(n,a,r){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let h=0,f;return m;function m(y){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(y),n.exit("gfmFootnoteCallLabelMarker"),p}function p(y){return y!==94?r(y):(n.enter("gfmFootnoteCallMarker"),n.consume(y),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",d)}function d(y){if(h>999||y===93&&!f||y===null||y===91||$e(y))return r(y);if(y===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return s.includes(xn(u.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(y),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),a):r(y)}return $e(y)||(f=!0),h++,n.consume(y),y===92?x:d}function x(y){return y===91||y===92||y===93?(n.consume(y),h++,d):d(y)}}function Bk(n,a,r){const u=this,s=u.parser.gfmFootnotes||(u.parser.gfmFootnotes=[]);let h,f=0,m;return p;function p(C){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(C),n.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(C){return C===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(C),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",x):r(C)}function x(C){if(f>999||C===93&&!m||C===null||C===91||$e(C))return r(C);if(C===93){n.exit("chunkString");const U=n.exit("gfmFootnoteDefinitionLabelString");return h=xn(u.sliceSerialize(U)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(C),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return $e(C)||(m=!0),f++,n.consume(C),C===92?y:x}function y(C){return C===91||C===92||C===93?(n.consume(C),f++,x):x(C)}function S(C){return C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),s.includes(h)||s.push(h),Ue(n,k,"gfmFootnoteDefinitionWhitespace")):r(C)}function k(C){return a(C)}}function Uk(n,a,r){return n.check(Ia,a,n.attempt(Dk,a,r))}function Hk(n){n.exit("gfmFootnoteDefinition")}function qk(n,a,r){const u=this;return Ue(n,s,"gfmFootnoteDefinitionIndent",5);function s(h){const f=u.events[u.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?a(h):r(h)}}function Yk(n){let r=(n||{}).singleTilde;const u={name:"strikethrough",tokenize:h,resolveAll:s};return r==null&&(r=!0),{text:{126:u},insideSpan:{null:[u]},attentionMarkers:{null:[126]}};function s(f,m){let p=-1;for(;++p1?p(C):(f.consume(C),y++,k);if(y<2&&!r)return p(C);const Q=f.exit("strikethroughSequenceTemporary"),O=Gi(C);return Q._open=!O||O===2&&!!U,Q._close=!U||U===2&&!!O,m(C)}}}class Gk{constructor(){this.map=[]}add(a,r,u){Vk(this,a,r,u)}consume(a){if(this.map.sort(function(h,f){return h[0]-f[0]}),this.map.length===0)return;let r=this.map.length;const u=[];for(;r>0;)r-=1,u.push(a.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),a.length=this.map[r][0];u.push(a.slice()),a.length=0;let s=u.pop();for(;s;){for(const h of s)a.push(h);s=u.pop()}this.map.length=0}}function Vk(n,a,r,u){let s=0;if(!(r===0&&u.length===0)){for(;s-1;){const ie=u.events[ne][1].type;if(ie==="lineEnding"||ie==="linePrefix")ne--;else break}const ee=ne>-1?u.events[ne][1].type:null,Te=ee==="tableHead"||ee==="tableRow"?L:p;return Te===L&&u.parser.lazy[u.now().line]?r(R):Te(R)}function p(R){return n.enter("tableHead"),n.enter("tableRow"),d(R)}function d(R){return R===124||(f=!0,h+=1),x(R)}function x(R){return R===null?r(R):ge(R)?h>1?(h=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),k):r(R):De(R)?Ue(n,x,"whitespace")(R):(h+=1,f&&(f=!1,s+=1),R===124?(n.enter("tableCellDivider"),n.consume(R),n.exit("tableCellDivider"),f=!0,x):(n.enter("data"),y(R)))}function y(R){return R===null||R===124||$e(R)?(n.exit("data"),x(R)):(n.consume(R),R===92?S:y)}function S(R){return R===92||R===124?(n.consume(R),y):y(R)}function k(R){return u.interrupt=!1,u.parser.lazy[u.now().line]?r(R):(n.enter("tableDelimiterRow"),f=!1,De(R)?Ue(n,C,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):C(R))}function C(R){return R===45||R===58?Q(R):R===124?(f=!0,n.enter("tableCellDivider"),n.consume(R),n.exit("tableCellDivider"),U):te(R)}function U(R){return De(R)?Ue(n,Q,"whitespace")(R):Q(R)}function Q(R){return R===58?(h+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(R),n.exit("tableDelimiterMarker"),O):R===45?(h+=1,O(R)):R===null||ge(R)?re(R):te(R)}function O(R){return R===45?(n.enter("tableDelimiterFiller"),K(R)):te(R)}function K(R){return R===45?(n.consume(R),K):R===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(R),n.exit("tableDelimiterMarker"),Z):(n.exit("tableDelimiterFiller"),Z(R))}function Z(R){return De(R)?Ue(n,re,"whitespace")(R):re(R)}function re(R){return R===124?C(R):R===null||ge(R)?!f||s!==h?te(R):(n.exit("tableDelimiterRow"),n.exit("tableHead"),a(R)):te(R)}function te(R){return r(R)}function L(R){return n.enter("tableRow"),J(R)}function J(R){return R===124?(n.enter("tableCellDivider"),n.consume(R),n.exit("tableCellDivider"),J):R===null||ge(R)?(n.exit("tableRow"),a(R)):De(R)?Ue(n,J,"whitespace")(R):(n.enter("data"),me(R))}function me(R){return R===null||R===124||$e(R)?(n.exit("data"),J(R)):(n.consume(R),R===92?be:me)}function be(R){return R===92||R===124?(n.consume(R),me):me(R)}}function Kk(n,a){let r=-1,u=!0,s=0,h=[0,0,0,0],f=[0,0,0,0],m=!1,p=0,d,x,y;const S=new Gk;for(;++rr[2]+1){const C=r[2]+1,U=r[3]-r[2]-1;n.add(C,U,[])}}n.add(r[3]+1,0,[["exit",y,a]])}return s!==void 0&&(h.end=Object.assign({},Yi(a.events,s)),n.add(s,0,[["exit",h,a]]),h=void 0),h}function Hp(n,a,r,u,s){const h=[],f=Yi(a.events,r);s&&(s.end=Object.assign({},f),h.push(["exit",s,a])),u.end=Object.assign({},f),h.push(["exit",u,a]),n.add(r+1,0,h)}function Yi(n,a){const r=n[a],u=r[0]==="enter"?"start":"end";return r[1][u]}const Fk={name:"tasklistCheck",tokenize:Ik};function Jk(){return{text:{91:Fk}}}function Ik(n,a,r){const u=this;return s;function s(p){return u.previous!==null||!u._gfmTasklistFirstContentOfListItem?r(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),h)}function h(p){return $e(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):r(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),m):r(p)}function m(p){return ge(p)?a(p):De(p)?n.check({tokenize:$k},a,r)(p):r(p)}}function $k(n,a,r){return Ue(n,u,"whitespace");function u(s){return s===null?r(s):a(s)}}function Wk(n){return rg([_k(),Ok(),Yk(n),Xk(),Jk()])}const Pk={};function e_(n){const a=this,r=n||Pk,u=a.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),h=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(Wk(r)),h.push(bk()),f.push(vk(r))}/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t_=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$g=(...n)=>n.filter((a,r,u)=>!!a&&a.trim()!==""&&u.indexOf(a)===r).join(" ").trim();/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var n_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l_=he.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:s="",children:h,iconNode:f,...m},p)=>he.createElement("svg",{ref:p,...n_,width:a,height:a,stroke:n,strokeWidth:u?Number(r)*24/Number(a):r,className:$g("lucide",s),...m},[...f.map(([d,x])=>he.createElement(d,x)),...Array.isArray(h)?h:[h]]));/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rt=(n,a)=>{const r=he.forwardRef(({className:u,...s},h)=>he.createElement(l_,{ref:h,iconNode:a,className:$g(`lucide-${t_(n)}`,u),...s}));return r.displayName=`${n}`,r};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wg=rt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i_=rt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pg=rt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a_=rt("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r_=rt("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ey=rt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u_=rt("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c_=rt("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o_=rt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s_=rt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fs=rt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ty=rt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f_=rt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h_=rt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d_=rt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m_=rt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ts=rt("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ny=rt("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p_=rt("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const g_=rt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y_=rt("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),ly=new URL(".",window.location.href).pathname;async function El(n,a){const r=await fetch(`${ly}${n.replace(/^\//,"")}`,{headers:{"Content-Type":"application/json",...(a==null?void 0:a.headers)||{}},...a}),u=await r.text(),s=u?JSON.parse(u):{};if(!r.ok)throw new Error(s.error||r.statusText);return s}function Ct(...n){return n.filter(Boolean).join(" ")}function hs(n,a=2500,r=[]){const[u,s]=he.useState(null),h=async()=>{try{const f=await n();s(f)}catch{}};return he.useEffect(()=>{h();const f=setInterval(h,a);return()=>clearInterval(f)},r),{data:u,refresh:h}}const Vi=[{role:"assistant",content:"Select a job, then ask about metrics, runtime, logs, or how to start the next AReno task."}],x_="areno-dashboard-agent-chat",iy="areno-dashboard-agent-chat-sessions",qp="areno-dashboard-agent-active-chat",Yp="areno-dashboard-agent-draft";function b_(){try{const n=JSON.parse(localStorage.getItem(x_)||"[]");return Array.isArray(n)&&n.length?n:Vi}catch{return Vi}}function vu(n=Vi,a="New chat"){const r=Date.now();return{id:`chat-${r}-${Math.random().toString(16).slice(2)}`,title:a,createdAt:r,updatedAt:r,messages:n}}function v_(){try{const n=JSON.parse(localStorage.getItem(iy)||"[]");if(Array.isArray(n)&&n.length)return n.map(a=>{var r;return{...a,messages:(r=a.messages)!=null&&r.length?a.messages:Vi}})}catch{}return[vu(b_(),"Default chat")]}function S_(n,a="New chat"){const r=n.find(s=>s.role==="user"&&s.content);if(!r)return a;const u=r.content.replace(/\s+/g," ").trim();return u.length>42?`${u.slice(0,42)}...`:u}const k_={ckpt:"Qwen/Qwen3-0.6B",dataset_path:"yahma/alpaca-cleaned:train",dataset_loader_fn:"examples/sft/alpaca/dataset_loader.py",reward_fn_path:"",ref_ckpt:"",reward_ckpt:"",critic_ckpt:"",agent_fn:"",algo:"sft",model_hub:"modelscope",epochs:10,max_steps:5,world_size:1,tp_size:1,attn_backend:"flash",activation_checkpointing:!0,drop_rollout_state:!1,eager_decode:!1,disable_thinking:!1,batch_size:8,n_samples:8,mini_bs:1,score_micro_bs:8,gradient_accumulation_steps:"",max_prompt_tokens:1024,max_context_len:2048,max_new_tokens:1024,max_running_prompts:"",temperature:1,top_k:-1,top_p:1,greedy:!1,agent_timeout_s:300,train_tool_results:!1,lr:1e-6,min_lr:1e-7,lr_decay_steps:1e3,lr_decay_style:"cosine",adam_beta1:.9,adam_beta2:.999,adam_8bit:!1,weight_decay:.01,grad_clip_norm:1,gspo_clip_eps:3e-4,grpo_clip_eps:.2,dpo_beta:.1,critic_warmup_steps:20,critic_lr:1e-5,use_kl_loss:!0,kl_loss_coef:.001,kl_loss_type:"low_var_kl",clip_eps:.2,clip_ratio_c:3,value_clip_eps:.5,value_loss_coef:.5,gamma:1,lam:.95,tune_params:!1,mem_frac:.9,tune_max_samples:256,save_path:"outputs/dashboard-run",save_interval:100,metrics_dir:"outputs/dashboard-run/metrics",extra_args:""},__={model_path:"Qwen/Qwen3-0.6B",model_hub:"modelscope",host:"0.0.0.0",port:8e3,world_size:1,tp_size:1,max_running_prompts:16,default_max_tokens:1024,decode_progress_interval_s:0,attn_backend:"flash",eager_decode:!1,disable_thinking:!1,extra_args:""},ay=[{value:"newest",label:"Start time (newest)"},{value:"oldest",label:"Start time (oldest)"},{value:"duration_desc",label:"Duration (longest)"},{value:"duration_asc",label:"Duration (shortest)"}],ry=["all","running","succeeded","failed","stopped","exited","unknown"],uy=["all","train","serve"],E_=new Set(ry),A_=new Set(uy),T_=new Set(ay.map(n=>n.value));function Au(n,a){return new URLSearchParams(window.location.search).get(n)||a}function ds(n,a,r){const u=Au(n,a);return r.has(u)?u:a}function z_(n=1){const a=Au("page","");if(!a)return n;const r=Number(a);return!Number.isFinite(r)||r<1?n:Math.floor(r)}function C_(n){const a=new URL(window.location.href);a.search="";for(const[r,u]of Object.entries(n))u&&a.searchParams.set(r,u);window.history.replaceState({},"",a.toString())}function yu(n,a){const r=n[a];return typeof r=="number"?r:typeof r=="string"&&Date.parse(r)||0}function w_(){var zl,Cl,wl,Sn,Ml,Pn;const[n,a]=he.useState(null),[r,u]=he.useState(k_),[s,h]=he.useState(__),[f,m]=he.useState(()=>localStorage.getItem(Yp)||""),[p,d]=he.useState(()=>v_()),[x,y]=he.useState(()=>localStorage.getItem(qp)||""),[S,k]=he.useState("chat"),[C,U]=he.useState(()=>{try{return JSON.parse(localStorage.getItem("areno-dashboard-agent-provider")||"{}")}catch{return{}}}),[Q,O]=he.useState("jobs"),[K,Z]=he.useState("train"),[re,te]=he.useState(()=>localStorage.getItem("areno-dashboard-theme")||"dark"),[L,J]=he.useState(""),[me,be]=he.useState(!1),[R,ne]=he.useState(()=>z_(1)),[ee,Te]=he.useState(()=>Au("q","")),[ie,W]=he.useState(()=>ds("state","all",E_)),[M,F]=he.useState(()=>ds("type","all",A_)),[ae,Ee]=he.useState(()=>Au("algo","all")),[E,T]=he.useState(()=>ds("sort","newest",T_)),[Y,_]=he.useState(0),le=he.useRef(null),se=hs(()=>El("/api/env"),5e3),ce=hs(()=>El("/api/jobs"),2e3),Ce=hs(()=>n?El(`/api/jobs/${n}`):Promise.resolve(null),3e3,[n]),ze=((zl=ce.data)==null?void 0:zl.jobs)||[],Re=10,jt=he.useMemo(()=>["all",...Array.from(new Set(ze.map(q=>q.algo).filter(Boolean))).sort()],[ze]),yt=he.useMemo(()=>{let $=ze;if(ee.trim()){const ve=ee.toLowerCase();$=$.filter(fe=>[fe.id,fe.name,fe.ckpt,fe.dataset_path].some(mt=>String(mt||"").toLowerCase().includes(ve)))}ie!=="all"&&($=$.filter(ve=>ve.status===ie)),M!=="all"&&($=$.filter(ve=>ve.kind===M)),ae!=="all"&&($=$.filter(ve=>ve.algo===ae));const q=[...$];return E==="newest"?q.sort((ve,fe)=>yu(fe,"created_at")-yu(ve,"created_at")):E==="oldest"?q.sort((ve,fe)=>yu(ve,"created_at")-yu(fe,"created_at")):E==="duration_desc"?q.sort((ve,fe)=>(Number(fe.duration_s)||0)-(Number(ve.duration_s)||0)):E==="duration_asc"&&q.sort((ve,fe)=>(Number(ve.duration_s)||0)-(Number(fe.duration_s)||0)),q},[ze,ee,ie,M,ae,E]),Tl=ee||ie!=="all"||M!=="all"||ae!=="all"||E!=="newest";function ei(){Te(""),W("all"),F("all"),Ee("all"),T("newest"),ne(1)}const xt=Math.max(1,Math.ceil(yt.length/Re)),Rt=Math.min(R,xt),Jn=yt.slice((Rt-1)*Re,Rt*Re),Le=((Cl=Ce.data)==null?void 0:Cl.job)||(n?ze.find($=>$.id===n):null)||null,In=he.useMemo(()=>p.find($=>$.id===x)||p[0]||vu(),[p,x]),bn=In.messages||Vi;he.useEffect(()=>{n&&ze.length&&!ze.some($=>$.id===n)&&a(null)},[ze.length,n]),he.useEffect(()=>{ze.length>0&&R>xt&&ne(xt)},[R,xt,ze.length]),he.useEffect(()=>{C_({q:ee,state:ie!=="all"?ie:"",type:M!=="all"?M:"",algo:ae!=="all"?ae:"",sort:E!=="newest"?E:"",page:R>1?String(R):""})},[ee,ie,M,ae,E,R]),he.useEffect(()=>{document.documentElement.dataset.theme=re,localStorage.setItem("areno-dashboard-theme",re)},[re]),he.useEffect(()=>{localStorage.setItem("areno-dashboard-agent-provider",JSON.stringify(C))},[C]),he.useEffect(()=>{localStorage.setItem(iy,JSON.stringify(p.slice(-40)))},[p]),he.useEffect(()=>{if(!p.length){const $=vu();d([$]),y($.id);return}p.some($=>$.id===x)||y(p[0].id)},[p,x]),he.useEffect(()=>{x&&localStorage.setItem(qp,x)},[x]),he.useEffect(()=>{localStorage.setItem(Yp,f)},[f]),he.useEffect(()=>{const $=le.current;$&&($.scrollTop=$.scrollHeight)},[bn,S]);const $n=[{id:"jobs",label:"Jobs",icon:v.jsx(Wg,{size:16})},{id:"runtime",label:"Runtime",icon:v.jsx(Ts,{size:16})},{id:"launcher",label:"Launcher",icon:v.jsx(Fs,{size:16})},{id:"agent",label:"Agent",icon:v.jsx(i_,{size:16})}],Wn={jobs:Le?[Le.name,`${Le.kind} · ${Le.status} · step ${Le.step??0}`]:["Jobs","Open an AReno train or serve task to inspect metrics, samples, config, and logs."],runtime:["Runtime Environment","Review areno check, areno env, dependencies, GPU state, and repository context."],launcher:["Task Launcher","Start low-intrusion AReno train or serve subprocesses from explicit configs."],agent:["Agent Console","Chat with an operations agent using the selected job context."]};async function Zi(){J("Starting train job...");try{const $=await El("/api/jobs/train",{method:"POST",body:JSON.stringify(r)});a($.job.id),await ce.refresh()}finally{J("")}}async function Ki(){J("Starting serve job...");try{const $=await El("/api/jobs/serve",{method:"POST",body:JSON.stringify(s)});a($.job.id),await ce.refresh()}finally{J("")}}async function bt($){J("Stopping job...");try{await El(`/api/jobs/${$}/stop`,{method:"POST",body:"{}"}),await ce.refresh()}finally{J("")}}async function ti(){const $=f.trim();if(!$)return;m("");const q=`assistant-${Date.now()}`;G(ve=>[...ve,{role:"user",content:$},{id:q,role:"assistant",content:"",events:[],streaming:!0}]),J("Agent analyzing...");try{await Nt({prompt:$,job_id:(Le==null?void 0:Le.id)||null,provider:C,history:we(bn),onEvent:ve=>Xt(q,ve)})}catch(ve){Xt(q,{type:"error",content:`Agent request failed: ${ve.message||ve}`})}finally{Xt(q,{type:"done"}),J("")}}function G($){const q=In.id;d(ve=>ve.map(fe=>{if(fe.id!==q)return fe;const mt=fe.messages||Vi,Tt=typeof $=="function"?$(mt):$;return{...fe,messages:Tt,updatedAt:Date.now(),title:S_(Tt,fe.title)}}))}function P(){const $=vu();d(q=>[$,...q]),y($.id),m(""),k("chat")}function xe($){y($),k("chat")}function we($){return $.filter(q=>(q.role==="user"||q.role==="assistant")&&!q.streaming).map(q=>({role:q.role,content:He(q)})).filter(q=>q.content).slice(-10)}function He($){return $.content?$.content:($.events||[]).filter(q=>q.type==="content"||q.type==="reasoning").map(q=>q.text||"").join(` +`).trim()}async function Nt({prompt:$,job_id:q,provider:ve,history:fe,onEvent:mt}){const Tt=await fetch(`${ly}api/agent/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:$,job_id:q,provider:ve,history:fe})});if(!Tt.ok||!Tt.body){const Nl=await Tt.text();throw new Error(Nl||Tt.statusText)}const Wa=Tt.body.getReader(),Pa=new TextDecoder;let Cn="";for(;;){const{value:Nl,done:er}=await Wa.read();if(er)break;Cn+=Pa.decode(Nl,{stream:!0});const Fi=Cn.split(` +`);Cn=Fi.pop()||"";for(const mn of Fi)mn.trim()&&mt(JSON.parse(mn))}Cn.trim()&&mt(JSON.parse(Cn))}function Xt($,q){G(ve=>ve.map(fe=>fe.id!==$?fe:q.type==="content_delta"?ht(fe,"content",q.content||""):q.type==="reasoning_delta"?ht(fe,"reasoning",q.content||""):q.type==="tool_calls"?Ve(fe,q.tool_calls||[]):q.type==="tool_call_delta"?tt(fe,q.tool_call,!0):q.type==="tool_result"?{...fe,events:[...fe.events||[],{type:"tool_result",result:q.tool_result}]}:q.type==="error"?{...ht(fe,"content",q.content||""),streaming:!1}:q.type==="done"?{...fe,streaming:!1}:fe))}function ht($,q,ve){if(!ve)return $;const fe=[...$.events||[]],mt=fe[fe.length-1];(mt==null?void 0:mt.type)===q?fe[fe.length-1]={...mt,text:`${mt.text||""}${ve}`}:fe.push({type:q,text:ve});const Tt=q==="content"?`${$.content||""}${ve}`:$.content;return{...$,content:Tt,events:fe}}function tt($,q,ve=!1){if(!q)return $;const fe=[...$.events||[]],mt=fe.findIndex(Tt=>Tt.type==="tool_call"&&At(Tt.call,q));return mt>=0?fe[mt]={...fe[mt],call:q,live:ve}:fe.push({type:"tool_call",call:q,live:ve}),{...$,events:fe}}function At($,q){return!$||!q?!1:!!($.id&&q.id&&$.id===q.id||$.round!==void 0&&q.round!==void 0&&$.index!==void 0&&q.index!==void 0&&$.round===q.round&&$.index===q.index)}function Ve($,q){let ve=$;for(const fe of q)ve=tt(ve,fe,!1);return ve}function vn(){var $;return Q==="runtime"?v.jsxs("div",{className:"tabGrid",children:[v.jsx(Y_,{env:se.data}),v.jsx(G_,{gpus:(($=se.data)==null?void 0:$.gpus)||[]})]}):Q==="launcher"?v.jsxs("section",{className:"panel launcher",children:[v.jsxs("div",{className:"panelHeader",children:[v.jsxs("div",{children:[v.jsx("h2",{children:"Task Launcher"}),v.jsx("p",{children:"Builds AReno CLI commands without importing training internals."})]}),v.jsxs("div",{className:"tabs",children:[v.jsx("button",{className:Ct(K==="train"&&"active"),onClick:()=>Z("train"),children:"Train"}),v.jsx("button",{className:Ct(K==="serve"&&"active"),onClick:()=>Z("serve"),children:"Serve"})]})]}),K==="train"?v.jsx(aE,{config:r,setConfig:u,onStart:Zi}):v.jsx(uE,{config:s,setConfig:h,onStart:Ki})]}):Q==="agent"?v.jsxs("section",{className:"panel chatPanel",children:[v.jsxs("div",{className:"panelHeader",children:[v.jsxs("div",{children:[v.jsx("h2",{children:"Agent Chat"}),v.jsx("p",{children:Le?`Context: ${Le.name}`:"No job selected. The agent will use runtime context only."})]}),v.jsxs("div",{className:"agentHeaderActions",children:[v.jsxs("button",{className:"secondaryButton",onClick:P,children:[v.jsx(ty,{size:15})," New Chat"]}),v.jsxs("button",{className:"secondaryButton",onClick:()=>be(!0),children:[v.jsx(ny,{size:15})," Settings"]})]})]}),v.jsxs("div",{className:"agentTabs",children:[v.jsxs("button",{className:Ct(S==="chat"&&"active"),onClick:()=>k("chat"),children:[v.jsx(o_,{size:15})," Chat"]}),v.jsxs("button",{className:Ct(S==="history"&&"active"),onClick:()=>k("history"),children:[v.jsx(u_,{size:15})," History"]})]}),S==="history"?v.jsx(N_,{sessions:p,activeId:In.id,onOpen:xe,onNew:P}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"chatMessages",ref:le,children:bn.map((q,ve)=>{var fe;return v.jsxs("div",{className:Ct("chatBubble",q.role),children:[v.jsx("span",{children:q.role}),(fe=q.events)!=null&&fe.length?v.jsx(j_,{events:q.events}):v.jsx(Js,{text:q.content}),q.streaming&&v.jsx("div",{className:"streamingHint",children:"thinking..."})]},`${q.id||q.role}-${ve}`)})}),v.jsxs("div",{className:"chatComposer",children:[v.jsx("textarea",{value:f,onChange:q=>m(q.target.value),onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),ti())}}),v.jsxs("button",{className:"primaryButton",onClick:ti,children:[v.jsx(m_,{size:16})," Send"]})]})]}),me&&v.jsx(D_,{title:"Agent Settings",onClose:()=>be(!1),children:v.jsx(M_,{provider:C,setProvider:U})})]}):Le?v.jsxs("section",{className:"panel detailPanel",children:[v.jsxs("div",{className:"panelHeader",children:[v.jsxs("div",{children:[v.jsx("h2",{children:Le.name}),v.jsxs("p",{children:[Le.kind," · ",Le.status]})]}),v.jsxs("div",{className:"detailActions",children:[v.jsx("button",{className:"secondaryButton",onClick:()=>a(null),children:"Back"}),Le.status==="running"&&v.jsxs("button",{className:"dangerButton",onClick:()=>bt(Le.id),children:[v.jsx(a_,{size:16})," Stop"]})]})]}),v.jsx(V_,{job:Le}),v.jsx(O_,{job:Le,refreshNonce:Y}),v.jsx(P_,{samples:(Le==null?void 0:Le.samples)||[]}),v.jsxs("div",{className:"split",children:[v.jsx(tE,{config:Le==null?void 0:Le.config,launch:Le==null?void 0:Le.launch}),v.jsx(iE,{logs:(Le==null?void 0:Le.logs)||[]})]})]}):v.jsxs("section",{className:"panel jobListPage",children:[v.jsxs("div",{className:"panelHeader",children:[v.jsxs("div",{children:[v.jsx("h2",{children:"Jobs"}),v.jsx("p",{children:"Registered AReno train/serve processes. Select a row to open job details."})]}),v.jsxs("div",{className:"pagerControls",children:[v.jsx("button",{className:"secondaryButton",disabled:Rt<=1,onClick:()=>ne(q=>Math.max(1,q-1)),children:"Prev"}),v.jsxs("span",{children:[Rt," / ",xt]}),v.jsx("button",{className:"secondaryButton",disabled:Rt>=xt,onClick:()=>ne(q=>Math.min(xt,q+1)),children:"Next"})]})]}),ze.length>0&&v.jsxs("div",{className:"jobToolbar",children:[v.jsxs("div",{className:"jobSearch",children:[v.jsx(d_,{size:14}),v.jsx("input",{type:"text",placeholder:"Search by ID, model, or dataset...",value:ee,onChange:q=>{Te(q.target.value),ne(1)}})]}),v.jsxs("div",{className:"jobFilters",children:[v.jsx("select",{value:ie,onChange:q=>{W(q.target.value),ne(1)},children:ry.map(q=>v.jsx("option",{value:q,children:q==="all"?"All states":q},q))}),v.jsx("select",{value:M,onChange:q=>{F(q.target.value),ne(1)},children:uy.map(q=>v.jsx("option",{value:q,children:q==="all"?"All types":q},q))}),v.jsx("select",{value:ae,onChange:q=>{Ee(q.target.value),ne(1)},children:jt.map(q=>v.jsx("option",{value:q,children:q==="all"?"All algorithms":q},q))}),v.jsx("select",{value:E,onChange:q=>T(q.target.value),children:ay.map(q=>v.jsx("option",{value:q.value,children:q.label},q.value))}),v.jsxs("button",{className:"secondaryButton",onClick:ei,disabled:!Tl,children:[v.jsx(h_,{size:14})," Reset"]})]})]}),v.jsxs("div",{className:"jobList",children:[ze.length===0&&v.jsx(Cs,{title:"No jobs yet",text:"Start a train or serve task from the launcher."}),yt.length===0&&ze.length>0&&v.jsx(Cs,{title:"No matching jobs",text:"Try adjusting your search or filters."}),Jn.map(q=>v.jsxs("button",{className:"jobRow large",onClick:()=>a(q.id),children:[v.jsx("div",{className:"jobIcon",children:q.kind==="serve"?v.jsx(Ts,{size:16}):v.jsx(c_,{size:16})}),v.jsxs("div",{className:"jobInfo",children:[v.jsx("div",{className:"jobTitle",children:q.name}),v.jsxs("div",{className:"jobMeta",children:[q.kind," · ",q.status," · step ",q.step??0]})]}),v.jsx("span",{className:Ct("statusDot",q.status)})]},q.id))]}),yt.length>Re&&v.jsxs("div",{className:"listFooter",children:["Showing ",(Rt-1)*Re+1,"-",Math.min(Rt*Re,yt.length)," of ",yt.length," jobs",ze.length>yt.length&&` (filtered from ${ze.length})`]})]})}const[Zt,Du]=Wn[Q]||Wn.jobs;return v.jsxs("div",{className:"shell",children:[v.jsxs("aside",{className:"rail",children:[v.jsxs("div",{className:"brand",children:[v.jsx("div",{className:"brandMark",children:"A"}),v.jsxs("div",{children:[v.jsx("div",{className:"brandName",children:"AReno Ops"}),v.jsx("div",{className:"brandMeta",children:"runtime workbench"})]})]}),v.jsx("nav",{className:"nav",children:$n.map($=>v.jsxs("button",{className:Ct("navItem",Q===$.id&&"active"),onClick:()=>O($.id),children:[$.icon," ",$.label]},$.id))}),v.jsxs("div",{className:"railFooter",children:[v.jsx("div",{className:"tinyLabel",children:"Repo"}),v.jsxs("div",{className:"monoLine",children:[((Sn=(wl=se.data)==null?void 0:wl.repo)==null?void 0:Sn.branch)||"unknown"," · ",((Pn=(Ml=se.data)==null?void 0:Ml.repo)==null?void 0:Pn.commit)||"no git"]})]})]}),v.jsxs("main",{className:"main",children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{children:[v.jsx("h1",{children:Zt}),v.jsx("p",{children:Du})]}),v.jsxs("div",{className:"topActions",children:[v.jsx("button",{className:"iconButton",onClick:()=>te(re==="dark"?"light":"dark"),title:"Toggle theme",children:re==="dark"?v.jsx(g_,{size:16}):v.jsx(s_,{size:16})}),v.jsx("button",{className:"iconButton",onClick:()=>{se.refresh(),ce.refresh(),Ce.refresh(),_($=>$+1)},title:"Refresh",children:v.jsx(f_,{size:16})})]})]}),L&&v.jsx("div",{className:"notice",children:L}),vn()]})]})}function M_({provider:n,setProvider:a}){return v.jsxs("div",{className:"agentConfig modalForm",children:[v.jsx(Tu,{label:"Base URL",value:n.base_url||"",onChange:r=>a({...n,base_url:r}),compact:!0}),v.jsx(Tu,{label:"Model",value:n.model||"",onChange:r=>a({...n,model:r}),compact:!0}),v.jsxs("label",{className:"field compact",children:[v.jsx("span",{children:"API key"}),v.jsx("input",{type:"password",value:n.api_key||"",onChange:r=>a({...n,api_key:r.target.value})})]})]})}function N_({sessions:n,activeId:a,onOpen:r,onNew:u}){return v.jsxs("div",{className:"agentHistory",children:[v.jsxs("div",{className:"agentHistoryHeader",children:[v.jsxs("div",{children:[v.jsx("h3",{children:"Chat History"}),v.jsxs("p",{children:[n.length," saved conversations in this browser."]})]}),v.jsxs("button",{className:"secondaryButton",onClick:u,children:[v.jsx(ty,{size:15})," New Chat"]})]}),v.jsx("div",{className:"agentHistoryList",children:n.map(s=>{const h=[...s.messages||[]].reverse().find(f=>f.role==="user"||f.content);return v.jsxs("button",{className:Ct("agentHistoryItem",s.id===a&&"active"),onClick:()=>r(s.id),children:[v.jsx("strong",{children:s.title||"New chat"}),v.jsx("span",{children:(h==null?void 0:h.content)||"No messages yet."}),v.jsx("small",{children:new Date(s.updatedAt||s.createdAt||Date.now()).toLocaleString()})]},s.id)})})]})}function D_({title:n,children:a,onClose:r}){return v.jsx("div",{className:"modalOverlay",role:"presentation",onMouseDown:r,children:v.jsxs("div",{className:"modalCard",role:"dialog","aria-modal":"true","aria-label":n,onMouseDown:u=>u.stopPropagation(),children:[v.jsxs("div",{className:"modalHeader",children:[v.jsxs("div",{children:[v.jsx("h2",{children:n}),v.jsx("p",{children:"Stored locally in this browser."})]}),v.jsx("button",{className:"iconButton",onClick:r,children:"×"})]}),a]})})}function O_({job:n,refreshNonce:a}){return v.jsxs("div",{className:"jobMetricsGrid",children:[v.jsx("div",{className:"panel insetPanel",children:v.jsx(F_,{jobId:n==null?void 0:n.id,metricsDir:n==null?void 0:n.metrics_dir,refreshNonce:a})}),v.jsx("div",{className:"panel insetPanel",children:v.jsx($_,{rows:(n==null?void 0:n.timeperf)||[]})})]})}function j_({events:n}){return v.jsx("div",{className:"agentEventList",children:n.map((a,r)=>a.type==="reasoning"?v.jsx(R_,{text:a.text},r):a.type==="content"?v.jsx(Js,{text:a.text},r):a.type==="tool_call"?v.jsx(L_,{call:a.call,live:a.live},r):a.type==="tool_result"?v.jsx(H_,{result:a.result},r):null)})}function Js({text:n}){return v.jsx("div",{className:"markdownBlock",children:v.jsx(YS,{remarkPlugins:[e_],children:n||""})})}function R_({text:n}){return v.jsxs("details",{className:"reasoningBlock",children:[v.jsxs("summary",{children:[v.jsx("span",{children:"✓"}),v.jsx("strong",{children:"Completed thinking"})]}),v.jsx(Js,{text:n})]})}function L_({call:n,live:a=!1}){const u=((n==null?void 0:n.function)||{}).name||(n==null?void 0:n.name)||"tool",s=U_(n);return v.jsxs("details",{className:Ct("toolCallCard","toolCallDetails",a&&"live"),children:[v.jsxs("summary",{className:"toolCallHead",children:[v.jsx("span",{children:a?"calling":"tool call"}),v.jsx("b",{children:B_(u,s)}),v.jsx("em",{children:a?"running":""})]}),v.jsx("pre",{children:s})]})}function B_(n,a){const r=cy(a);return!r||r==="{}"?`${n}()`:`${n}(${r})`}function U_(n){return(n.function||{}).arguments||n.arguments||JSON.stringify(n,null,2)}function H_({result:n}){const a=q_(n);return v.jsxs("details",{className:Ct("toolCallCard","toolResultDetails",n.ok?"ok":"failed"),children:[v.jsxs("summary",{children:[v.jsx("span",{children:n.ok?"result":"error"}),v.jsxs("b",{children:[n.name||"unknown"," · ",n.ok?"ok":"failed"]}),v.jsx("em",{children:cy(a)||"No output."})]}),v.jsx("pre",{children:a})]})}function cy(n){return String(n||"").replace(/\s+/g," ").trim()}function q_(n){return n.error?n.error:Array.isArray(n.jobs)?n.jobs.map(a=>`${a.id} · ${a.kind} · ${a.status} · step ${a.step??0} · ${a.name}`).join(` +`)||"No jobs.":n.job?`${n.job.id} · ${n.job.kind} · ${n.job.status} · step ${n.job.step??0} +${n.job.name}`:n.env?`ready=${n.env.ready} · gpu=${n.env.gpu_summary||"n/a"} · cwd=${n.env.cwd||"n/a"}`:JSON.stringify(n,null,2)}function Y_({env:n}){var m,p,d,x;const a=(n==null?void 0:n.checks)||[],r=(n==null?void 0:n.report)||{},u=r.dependencies||{},s=r.torch||{},h=r.platform||{},f=a.slice(0,12);return v.jsxs("section",{className:"runtimeDeck",children:[v.jsxs("div",{className:"runtimeHero",children:[v.jsx("div",{className:Ct("readinessOrb",n!=null&&n.ready?"ready":"blocked"),children:n!=null&&n.ready?"OK":"!"}),v.jsxs("div",{children:[v.jsx("div",{className:"tinyLabel",children:"AReno check"}),v.jsx("h2",{children:n!=null&&n.ready?"Runtime ready for AReno tasks":"Runtime needs attention before heavy jobs"}),v.jsxs("p",{children:[((m=n==null?void 0:n.check_counts)==null?void 0:m.ok)??0," OK · ",((p=n==null?void 0:n.check_counts)==null?void 0:p.warn)??0," WARN · ",((d=n==null?void 0:n.check_counts)==null?void 0:d.fail)??0," FAIL"]})]})]}),v.jsxs("div",{className:"envFacts",children:[v.jsx(xu,{icon:v.jsx(ey,{size:15}),label:"AReno",value:((x=r.areno)==null?void 0:x.version)||"unknown"}),v.jsx(xu,{icon:v.jsx(r_,{size:15}),label:"PyTorch",value:s.version||"missing"}),v.jsx(xu,{icon:v.jsx(Ts,{size:15}),label:"CUDA",value:s.cuda_build||"none"}),v.jsx(xu,{icon:v.jsx(Pg,{size:15}),label:"Platform",value:`${h.system||"unknown"} ${h.machine||""}`})]}),v.jsx("div",{className:"checkMatrix",children:f.map(y=>v.jsxs("div",{className:Ct("checkItem",y.status.toLowerCase()),children:[v.jsx("span",{children:y.status}),v.jsx("strong",{children:y.name}),v.jsx("small",{children:y.detail||y.next_step||"no detail"})]},y.name))}),v.jsx("div",{className:"dependencyStrip",children:Object.entries(u).map(([y,S])=>v.jsxs("div",{className:Ct("depPill",S.imported?"ok":"warn"),children:[y,": ",S.imported?S.version||"imported":"missing"]},y))})]})}function G_({gpus:n}){return n.length?v.jsx("section",{className:"gpuDeck",children:n.map((a,r)=>{const u=Math.min(100,Math.max(0,Number(a.memory_used_mb||0)/Math.max(Number(a.memory_total_mb||1),1)*100)),s=Math.min(100,Math.max(0,Number(a.utilization||0)));return v.jsxs("div",{className:"gpuCard",children:[v.jsxs("div",{className:"gpuHead",children:[v.jsxs("strong",{children:["GPU ",r]}),v.jsx("span",{children:a.name})]}),v.jsxs("div",{className:"gpuMeter",children:[v.jsxs("div",{className:"gpuMeterLabel",children:[v.jsx("span",{children:"Memory"}),v.jsxs("b",{children:[a.memory_used_mb,"/",a.memory_total_mb," MB"]})]}),v.jsx("div",{className:"meterTrack",children:v.jsx("i",{style:{width:`${u}%`}})})]}),v.jsxs("div",{className:"gpuMeter",children:[v.jsxs("div",{className:"gpuMeterLabel",children:[v.jsx("span",{children:"Utilization"}),v.jsxs("b",{children:[s,"%"]})]}),v.jsx("div",{className:"meterTrack util",children:v.jsx("i",{style:{width:`${s}%`}})})]})]},`${a.name}-${r}`)})}):v.jsx("section",{className:"gpuDeck",children:v.jsx("div",{className:"panel",children:v.jsx(Cs,{title:"No GPU detected",text:"nvidia-smi did not return device utilization."})})})}function xu({icon:n,label:a,value:r}){return v.jsxs("div",{className:"envFact",children:[v.jsx("span",{children:n}),v.jsxs("div",{children:[v.jsx("label",{children:a}),v.jsx("strong",{children:r})]})]})}function V_({job:n}){const a=oy(n),r=Q_(n),u=Math.max(0,a.findIndex(s=>zs(s,r,n)));return v.jsx("div",{className:"timeline",children:a.map((s,h)=>v.jsxs("div",{className:Ct("timelineItem",h<=u&&"done",zs(s,r,n)&&"current"),children:[v.jsx("span",{children:h+1}),v.jsx("label",{children:s.label})]},s.id))})}function oy(n){if((n==null?void 0:n.kind)==="serve")return[{id:"created",label:"created"},{id:"load",label:"load",aliases:["registered"]},{id:"serve",label:"serve",aliases:["running"]},{id:"exit",label:"exit",aliases:["exited","failed","succeeded","stopped"]}];const a=X_(n,"algo");return a==="sft"?[{id:"created",label:"created",aliases:["registered","epoch_start"]},{id:"train",label:"train",aliases:["train_start","train_end","train_skip"]},{id:"save",label:"save",aliases:["save_checkpoint_start","save_checkpoint_end"]},{id:"done",label:"done",aliases:["max_steps_reached","epoch_end","exited","failed","succeeded","stopped"]}]:a==="dpo"?[{id:"created",label:"created",aliases:["registered","epoch_start"]},{id:"ref_score",label:"ref score",aliases:["logprob_score_start","logprob_score_end"],roles:["ref"]},{id:"train",label:"train",aliases:["train_start","train_end","train_skip"]},{id:"save",label:"save",aliases:["save_checkpoint_start","save_checkpoint_end"]},{id:"done",label:"done",aliases:["max_steps_reached","epoch_end","exited","failed","succeeded","stopped"]}]:a==="ppo"?[{id:"created",label:"created",aliases:["registered","epoch_start"]},{id:"rollout",label:"rollout",aliases:["rollout_start","rollout_end"],roles:["actor"]},{id:"reward",label:"reward",aliases:["score_start","score_end"],roles:["reward"]},{id:"ref_score",label:"ref score",aliases:["logprob_score_start","logprob_score_end"],roles:["ref"]},{id:"old_logprob",label:"old logprob",aliases:["old_logprob_score_start","old_logprob_score_end"],roles:["actor"]},{id:"critic_value",label:"value",aliases:["value_score_start","value_score_end"],roles:["critic"]},{id:"advantage",label:"advantage",aliases:["advantage_start","advantage_end"],roles:["critic"]},{id:"critic_train",label:"critic train",aliases:["train_start","train_end"],roles:["critic"]},{id:"actor_train",label:"actor train",aliases:["train_start","train_end","train_skip"],roles:["actor"]},{id:"save",label:"save",aliases:["save_checkpoint_start","save_checkpoint_end"]},{id:"done",label:"done",aliases:["max_steps_reached","epoch_end","exited","failed","succeeded","stopped"]}]:[{id:"created",label:"created",aliases:["registered","epoch_start"]},{id:"rollout",label:"rollout",aliases:["rollout_start","rollout_end"]},{id:"score",label:"score",aliases:["score_start","score_end","reward_score_start","reward_score_end","logprob_score_start","logprob_score_end","old_logprob_score_start","old_logprob_score_end","value_score_start","value_score_end"]},{id:"train",label:"train",aliases:["train_start","train_end","train_skip"]},{id:"save",label:"save",aliases:["save_checkpoint_start","save_checkpoint_end"]},{id:"done",label:"done",aliases:["max_steps_reached","epoch_end","exited","failed","succeeded","stopped"]}]}function Q_(n){if(n!=null&&n.status&&["succeeded","failed","stopped","exited"].includes(n.status))return"done";const a=String((n==null?void 0:n.stage)||"created"),u=oy(n).find(s=>zs(s,a,n));return(u==null?void 0:u.id)||a}function zs(n,a,r){var s,h;return n.id===a||((s=n.aliases)==null?void 0:s.includes(a))?(h=n.roles)!=null&&h.length?n.roles.includes(String((r==null?void 0:r.role)||"")):!0:!1}function X_(n,a){const r=n!=null&&n.config&&Object.keys(n.config).length?n.config:(n==null?void 0:n.launch)||{};if(r[a]!==void 0)return r[a];for(const u of r.sections||[]){const s=(u.items||[]).find(h=>h.key===a);if(s)return s.value}}function Z_(n){return(n||[]).map(a=>a.name).sort()}function K_(n,a){return a&&n.includes(a)?a:n[0]||""}function F_({jobId:n,metricsDir:a,refreshNonce:r}){const[u,s]=he.useState(""),[h,f]=he.useState(.6),[m,p]=he.useState([]),[d,x]=he.useState([]),[y,S]=he.useState(!1),[k,C]=he.useState(n);n!==k&&(C(n),s(""),p([]),x([]),S(!1));const U=Z_(m),Q=K_(U,u);he.useEffect(()=>{let te=!1;if(n)return El(`/api/jobs/${n}/metrics`).then(L=>{if(te)return;const J=L.metrics||[];p(J),s(me=>{var be;return me||((be=J[0])==null?void 0:be.name)||""})}).catch(()=>{te||p([])}),()=>{te=!0}},[n,r]),he.useEffect(()=>{let te=!1;if(!n||!Q){x([]),S(!1);return}return S(!0),El(`/api/jobs/${n}/metric?name=${encodeURIComponent(Q)}&limit=500`).then(L=>{te||x((L.points||[]).filter(J=>Number.isFinite(Number(J.value))).map(J=>({...J,step:Number(J.step||0),value:Number(J.value)})))}).catch(()=>{te||x([])}).finally(()=>{te||S(!1)}),()=>{te=!0}},[n,Q,r]);const O=Q,K=d.slice(-240),Z=J_(K,h),re=I_(K,Z);return v.jsxs("div",{className:"chart",children:[v.jsxs("div",{className:"chartHeader",children:[v.jsxs("span",{children:[v.jsx(Wg,{size:14})," TensorBoard scalars"]}),v.jsxs("div",{className:"chartControls",children:[v.jsx("select",{value:O,onChange:te=>s(te.target.value),children:U.length===0?v.jsx("option",{value:"",children:"no metrics"}):U.map(te=>v.jsx("option",{children:te},te))}),v.jsxs("label",{children:["smooth ",h.toFixed(2),v.jsx("input",{type:"range",min:"0",max:"0.99",step:"0.01",value:h,onChange:te=>f(Number(te.target.value))})]})]})]}),K.length===0?v.jsx("div",{className:"plotEmpty",children:y?"Loading selected metric...":"No TensorBoard scalar points loaded yet."}):v.jsxs("svg",{className:"metricPlot",viewBox:"0 0 720 180",role:"img",children:[v.jsx("g",{className:"plotGrid",children:[0,1,2,3].map(te=>v.jsx("line",{x1:"0",x2:"720",y1:30+te*42,y2:30+te*42},te))}),v.jsx("polyline",{className:"rawLine",points:re.raw}),v.jsx("polyline",{className:"smoothLine",points:re.smooth}),K.slice(-24).map((te,L)=>{var J,me;return v.jsx("circle",{cx:((J=re.coords[L+Math.max(0,K.length-24)])==null?void 0:J.x)||0,cy:((me=re.coords[L+Math.max(0,K.length-24)])==null?void 0:me.y)||0,r:"2.2",children:v.jsx("title",{children:`${O} step ${te.step}: ${te.value}`})},`${te.step}-${L}`)})]}),v.jsxs("div",{className:"plotFooter",children:[v.jsxs("span",{children:[O||"metric"," · ",d.length," points"]}),v.jsxs("span",{children:[a||"no metrics dir"," · ",re.minLabel," to ",re.maxLabel]})]})]})}function J_(n,a){if(!n.length)return[];const r=Math.min(Math.max(Number(a)||0,0),.999);let u=n[0].value;return n.map(s=>(u=u*r+s.value*(1-r),{...s,value:u}))}function I_(n,a){if(!n.length)return{raw:"",smooth:"",coords:[],minLabel:"n/a",maxLabel:"n/a"};const r=[...n,...a].map(S=>S.value),u=Math.min(...r),s=Math.max(...r),h=Math.max(s-u,1e-9),f=n[0].step,m=n[n.length-1].step,p=Math.max(m-f,1),d=S=>({x:(S.step-f)/p*700+10,y:168-(S.value-u)/h*146}),x=n.map(d),y=a.map(d);return{raw:x.map(S=>`${S.x.toFixed(1)},${S.y.toFixed(1)}`).join(" "),smooth:y.map(S=>`${S.x.toFixed(1)},${S.y.toFixed(1)}`).join(" "),coords:x,minLabel:Gp(u),maxLabel:Gp(s)}}function Gp(n){return Number.isFinite(n)?Math.abs(n)>=1e3||Math.abs(n)<.001?n.toExponential(2):n.toFixed(4).replace(/0+$/,"").replace(/\.$/,""):"n/a"}function $_({rows:n}){const a=W_(n||[],7).reverse(),r=n!=null&&n.length?n.reduce((h,f)=>h+Number(f.total_s||0),0)/n.length:0,u=Math.max(1,...a.map(h=>Number(h.total_s||0))),s=Array.from(new Set((n||[]).flatMap(h=>(h.segments||[]).map(f=>f.name)))).slice(0,8);return v.jsxs("div",{className:"timePerf",children:[v.jsxs("div",{className:"timePerfHeader",children:[v.jsx("div",{children:v.jsxs("div",{className:"codeTitle inline",children:[v.jsx(y_,{size:14})," Runtime timeperf"]})}),v.jsxs("div",{className:"legend",children:[s.map(h=>v.jsxs("span",{children:[v.jsx("i",{className:Vp(h)})," ",h]},h)),v.jsxs("b",{children:["avg ",r?`${r.toFixed(1)}s`:"n/a"]})]})]}),a.length===0?v.jsx("div",{className:"sampleEmpty",children:"No step timing captured yet."}):v.jsx("div",{className:"timeRows",children:a.map(h=>{var d;const f=Number(h.total_s||0),m=Math.max(10,f/u*100),p=(d=h.segments)!=null&&d.length?h.segments:[];return v.jsxs("div",{className:"timeRow",children:[v.jsxs("label",{children:["step ",h.step]}),v.jsx("div",{className:"timeTrack",children:v.jsx("div",{className:"timeStack",style:{width:`${m}%`},children:p.map(x=>{const y=Number(x.seconds||0),S=y/Math.max(f,1)*100;return v.jsx("span",{className:Vp(x.name),style:{width:`${S}%`},title:`${x.name}: ${y.toFixed(1)}s`,children:S>11?`${y.toFixed(1)}s`:""},x.name)})})}),v.jsxs("strong",{children:[f.toFixed(1),"s"]})]},`${h.step}-${h.time}`)})})]})}function W_(n,a){if(n.length<=a)return n.slice();const r=n.length-1,u=new Set;for(let s=0;ss-h).slice(-a).map(s=>n[s])}function Vp(n){return`seg-${String(n||"other").replace(/[^a-zA-Z0-9]+/g,"-")}`}function P_({samples:n}){const a=he.useMemo(()=>[...n||[]].sort((y,S)=>Number(y.step||0)-Number(S.step||0)||Number(y.prompt_idx||0)-Number(S.prompt_idx||0)||Number(y.sample_idx||0)-Number(S.sample_idx||0)),[n]),r=he.useMemo(()=>Array.from(new Set(a.map(y=>Number(y.step||0)))).sort((y,S)=>S-y),[a]),[u,s]=he.useState(""),[h,f]=he.useState("");he.useEffect(()=>{if(!r.length){s(""),f("");return}(u===""||!r.includes(Number(u)))&&(s(String(r[0])),f(""))},[u,r]);const p=(u===""?[]:a.filter(y=>Number(y.step||0)===Number(u))).map((y,S)=>({key:eE(y,S),label:`prompt ${y.prompt_idx??"?"} · sample ${y.sample_idx??"?"}`,sample:y})),d=p.find(y=>y.key===h)||p[p.length-1]||null,x=(d==null?void 0:d.sample)||null;return v.jsxs("div",{className:"sampleCard",children:[v.jsxs("div",{className:"codeTitle sampleTitle",children:[v.jsxs("span",{children:[v.jsx(ey,{size:14})," Rollout sample"]}),!!a.length&&v.jsxs("div",{className:"sampleControls",children:[v.jsx("select",{value:u,onChange:y=>{s(y.target.value),f("")},children:r.map(y=>v.jsxs("option",{value:y,children:["step ",y]},y))}),v.jsx("select",{value:(d==null?void 0:d.key)||"",onChange:y=>f(y.target.value),children:p.map(y=>v.jsx("option",{value:y.key,children:y.label},y.key))})]})]}),x?v.jsxs("div",{className:"sampleGrid",children:[v.jsxs("div",{children:[v.jsx("span",{children:"Prompt"}),v.jsx("p",{children:x.prompt||"n/a"})]}),v.jsxs("div",{children:[v.jsx("span",{children:"Completion"}),v.jsx("p",{children:x.completion||"n/a"})]})]}):v.jsx("div",{className:"sampleEmpty",children:"No rollout sample captured yet."})]})}function eE(n,a){return`${n.step??"x"}-${n.prompt_idx??"x"}-${n.sample_idx??"x"}-${a}`}function tE({config:n,launch:a}){const r=n&&Object.keys(n).length?n:a||{},u=nE(r);return v.jsxs("div",{className:"codeCard",children:[v.jsxs("div",{className:"codeTitle",children:[v.jsx(ny,{size:14})," Config"]}),u.length>0?v.jsx("div",{className:"configSections",children:u.map(s=>v.jsxs("div",{className:"configSection",children:[v.jsx("h3",{children:s.title}),v.jsx("div",{className:"configGrid",children:s.items.map(({key:h,value:f})=>v.jsxs("div",{className:"configItem",children:[v.jsx("span",{children:h.replace(/_/g," ")}),v.jsx("strong",{children:lE(f)})]},h))})]},s.title))}):v.jsx("pre",{children:"No config captured yet."})]})}function nE(n){if(Array.isArray(n==null?void 0:n.sections))return n.sections.map(r=>({title:r.title||"Config",items:(r.items||[]).filter(({value:u})=>u!=null&&u!=="")})).filter(r=>r.items.length>0);const a=Object.entries(n||{}).filter(([,r])=>r!=null&&r!=="").map(([r,u])=>({key:r,value:u}));return a.length?[{title:"Launch",items:a}]:[]}function lE(n){return Array.isArray(n)?n.join(" "):typeof n=="object"?JSON.stringify(n):String(n)}function iE({logs:n}){const a=he.useRef(null);return he.useEffect(()=>{const r=a.current;r&&(r.scrollTop=r.scrollHeight)},[n.length]),v.jsxs("div",{className:"codeCard",ref:a,children:[v.jsxs("div",{className:"codeTitle",children:[v.jsx(p_,{size:14})," Logs"]}),v.jsx("pre",{children:n.slice(-80).join(` +`)||"No logs yet."})]})}function aE({config:n,setConfig:a,onStart:r}){const u=String(n.algo||"sft").toLowerCase(),s=rE(u),h=(f,m)=>a({...n,[f]:m});return v.jsxs("div",{className:"launcherSections",children:[s.map(f=>v.jsxs("div",{className:"launcherSection",children:[v.jsxs("div",{className:"launcherSectionHeader",children:[v.jsx("strong",{children:f.title}),f.note&&v.jsx("span",{children:f.note})]}),v.jsx("div",{className:"formGrid",children:f.fields.map(m=>v.jsx(Tu,{label:m.label,value:n[m.key],onChange:p=>h(m.key,p),compact:m.compact,type:m.type,options:m.options},m.key))})]},f.title)),v.jsxs("button",{className:"primaryButton launchButton wide",onClick:r,children:[v.jsx(Fs,{size:16})," Start train"]})]})}function rE(n){const a=["gspo","grpo","ppo"].includes(n),r=a,u=n==="dpo",s=n==="ppo",h=n==="gspo",f=n==="grpo",m=[{title:"Basic",note:"model, data, and trainer loop",fields:[ms("algo","Algorithm",["sft","dpo","gspo","grpo","ppo"],!0),pe("ckpt","Checkpoint"),ms("model_hub","Model hub",["modelscope","hf"],!0),pe("dataset_path","Dataset path"),pe("dataset_loader_fn","Dataset loader"),pe("epochs","Epochs",!0),pe("max_steps","Max steps",!0)]},{title:"Runtime",note:"parallelism, memory, and kernels",fields:[pe("world_size","World",!0),pe("tp_size","TP",!0),ms("attn_backend","Attention",["flash","native"],!0),Kn("activation_checkpointing","Activation ckpt"),Kn("drop_rollout_state","Drop rollout state"),Kn("eager_decode","Eager decode"),Kn("disable_thinking","Disable thinking")]},{title:"Batching",note:"controls train and rollout memory",fields:[pe("batch_size","Batch",!0),...a?[pe("n_samples","Samples",!0),pe("max_running_prompts","Running prompts",!0)]:[],pe("mini_bs","Mini BS",!0),pe("score_micro_bs","Score micro BS",!0),pe("gradient_accumulation_steps","Grad accum",!0)]},{title:a?"Rollout":"Sequence",note:a?"generation and sampling":"token limits for supervised data",fields:[pe("max_prompt_tokens","Prompt tokens",!0),pe("max_new_tokens","New tokens",!0),...r?[pe("max_context_len","Context",!0),pe("agent_fn","Agent fn"),pe("agent_timeout_s","Agent timeout",!0),Kn("train_tool_results","Train tool results")]:[],...a?[pe("temperature","Temp",!0),pe("top_k","Top K",!0),pe("top_p","Top P",!0),Kn("greedy","Greedy")]:[]]},{title:"Optimizer",note:"policy optimizer settings",fields:[pe("lr","LR",!0),pe("min_lr","Min LR",!0),pe("lr_decay_steps","Decay steps",!0),pe("lr_decay_style","Decay style",!0),pe("adam_beta1","Adam beta1",!0),pe("adam_beta2","Adam beta2",!0),pe("weight_decay","Weight decay",!0),pe("grad_clip_norm","Grad clip",!0),Kn("adam_8bit","8-bit Adam")]}],p=[];return(u||s)&&p.push(pe("ref_ckpt","Reference ckpt")),a&&p.push(pe("reward_fn_path","Reward fn")),s&&p.push(pe("reward_ckpt","Reward ckpt"),pe("critic_ckpt","Critic ckpt"),pe("critic_lr","Critic LR",!0),pe("critic_warmup_steps","Critic warmup",!0)),h&&p.push(pe("gspo_clip_eps","GSPO clip",!0)),f&&p.push(pe("grpo_clip_eps","GRPO clip",!0)),u&&p.push(pe("dpo_beta","DPO beta",!0)),s&&p.push(Kn("use_kl_loss","Use KL loss"),pe("kl_loss_coef","KL coef",!0),pe("kl_loss_type","KL type",!0),pe("clip_eps","Clip eps",!0),pe("clip_ratio_c","Clip ratio C",!0),pe("value_clip_eps","Value clip",!0),pe("value_loss_coef","Value coef",!0),pe("gamma","Gamma",!0),pe("lam","Lambda",!0)),p.length>0&&m.push({title:"Algorithm",note:`${n.toUpperCase()}-specific roles and loss`,fields:p}),m.push({title:"Probe",note:"optional smoke and auto tune helpers",fields:[Kn("tune_params","Tune params"),pe("mem_frac","Memory frac",!0),pe("tune_max_samples","Tune samples",!0)]},{title:"Output",note:"checkpointing, metrics, and escape hatch",fields:[pe("save_path","Save path"),pe("save_interval","Save interval",!0),pe("metrics_dir","Metrics dir"),pe("extra_args","Extra args")]}),m}function pe(n,a,r=!1){return{key:n,label:a,compact:r}}function ms(n,a,r,u=!1){return{key:n,label:a,compact:u,type:"select",options:r}}function Kn(n,a){return{key:n,label:a,compact:!0,type:"checkbox"}}function uE({config:n,setConfig:a,onStart:r}){return v.jsxs("div",{className:"formGrid",children:[[["model_path","Model path"],["model_hub","Model hub"],["host","Host"],["port","Port"],["world_size","World"],["tp_size","TP"],["max_running_prompts","Running prompts"],["default_max_tokens","Default max tokens"],["decode_progress_interval_s","Progress interval"],["attn_backend","Attention backend"],["eager_decode","Eager decode"],["disable_thinking","Disable thinking"],["extra_args","Extra args"]].map(([u,s])=>v.jsx(Tu,{label:s,value:n[u],onChange:h=>a({...n,[u]:h}),compact:u!=="model_path"},u)),v.jsxs("button",{className:"primaryButton launchButton wide",onClick:r,children:[v.jsx(Fs,{size:16})," Start serve"]})]})}function Tu({label:n,value:a,onChange:r,compact:u,type:s="text",options:h=[]}){return s==="checkbox"?v.jsxs("label",{className:Ct("field","compact","checkField"),children:[v.jsx("input",{type:"checkbox",checked:!!a,onChange:f=>r(f.target.checked)}),v.jsx("span",{children:n})]}):v.jsxs("label",{className:Ct("field",u&&"compact"),children:[v.jsx("span",{children:n}),s==="select"?v.jsx("select",{value:a??"",onChange:f=>r(f.target.value),children:h.map(f=>v.jsx("option",{value:f,children:f},f))}):v.jsx("input",{value:a??"",onChange:f=>r(f.target.value)})]})}function Cs({title:n,text:a}){return v.jsxs("div",{className:"empty",children:[v.jsx(Pg,{size:18}),v.jsx("strong",{children:n}),v.jsx("span",{children:a})]})}const Qp=typeof document<"u"?document.getElementById("root"):null;Qp&&M0.createRoot(Qp).render(v.jsx(w_,{})); diff --git a/areno/dashboard/dist/assets/index-DV7XCEqO.css b/areno/dashboard/dist/assets/index-DV7XCEqO.css new file mode 100644 index 00000000..b6ff5d93 --- /dev/null +++ b/areno/dashboard/dist/assets/index-DV7XCEqO.css @@ -0,0 +1 @@ +:root{color-scheme:dark;--deck-canvas: #0b0f14;--deck-rail: #0f151c;--deck-panel: #121923;--deck-panel-2: #151f2b;--deck-line: rgba(167, 186, 210, .14);--deck-line-strong: rgba(167, 186, 210, .24);--deck-ink: #edf4ff;--deck-text: #b8c6d8;--deck-muted: #728196;--deck-cyan: #38d7ff;--deck-green: #57e39b;--deck-amber: #ffc857;--deck-red: #ff6b7a;--deck-violet: #a993ff;--radius-sm: 7px;--radius-md: 10px;--radius-lg: 14px;--shadow-panel: 0 0 0 1px rgba(167, 186, 210, .08), 0 18px 40px rgba(0, 0, 0, .26);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:var(--deck-canvas);color:var(--deck-ink);-webkit-font-smoothing:antialiased}:root[data-theme=light]{color-scheme:light;--deck-canvas: #f5f7fb;--deck-rail: #ffffff;--deck-panel: #ffffff;--deck-panel-2: #eef4fb;--deck-line: rgba(25, 44, 68, .13);--deck-line-strong: rgba(25, 44, 68, .24);--deck-ink: #142033;--deck-text: #43566f;--deck-muted: #728096;--deck-cyan: #007ea7;--deck-green: #168a57;--deck-amber: #a56a00;--deck-red: #c73446;--deck-violet: #6e56cf;--shadow-panel: 0 0 0 1px rgba(25, 44, 68, .06), 0 16px 36px rgba(34, 56, 83, .1)}*{box-sizing:border-box}body{margin:0;width:100%;overflow-x:hidden;background:var(--deck-canvas)}button,input,select,textarea{font:inherit}button{cursor:pointer}.shell{display:grid;grid-template-columns:272px minmax(0,1fr);min-height:100vh;width:100%}.rail{display:flex;flex-direction:column;border-right:1px solid var(--deck-line);background:var(--deck-rail);padding:18px 14px}.brand{display:flex;align-items:center;gap:12px;padding:8px 8px 20px}.brandMark{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#101f2c;border:1px solid rgba(56,215,255,.3);color:var(--deck-cyan);font-weight:700}.brandName{font-size:14px;font-weight:650;letter-spacing:0}.brandMeta,.tinyLabel{color:var(--deck-muted);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em}.nav{display:grid;gap:5px}.navItem{display:flex;align-items:center;gap:10px;width:100%;height:36px;border:0;padding:0 10px;background:transparent;color:var(--deck-text);border-radius:var(--radius-sm);text-decoration:none;font-size:13px;font-weight:560}.navItem.active,.navItem:hover{background:#38d7ff14;color:var(--deck-ink)}.railFooter{margin-top:auto;border-top:1px solid var(--deck-line);padding:14px 8px 4px}.monoLine{margin-top:6px;color:var(--deck-text);font-family:SFMono-Regular,Roboto Mono,ui-monospace,monospace;font-size:12px;overflow-wrap:anywhere}.main{min-width:0;max-width:100%;overflow-x:hidden;padding:20px}.topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:16px}.topActions{display:inline-flex;gap:8px}h1,h2,p{margin:0}h1{font-size:25px;line-height:1.15;font-weight:680;letter-spacing:0}h2{font-size:15px;line-height:1.3;font-weight:650}p{color:var(--deck-muted);font-size:13px;line-height:1.45;margin-top:5px}.panel{background:var(--deck-panel);border:1px solid var(--deck-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-panel)}.workspace{min-height:560px}.tabGrid{display:grid;gap:12px}.metricsGrid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:12px;align-items:start}.jobMetricsGrid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:12px;margin-bottom:12px}.insetPanel{box-shadow:none;background:#a7bad208}.runtimeDeck{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:12px;margin-bottom:12px}.gpuDeck{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.gpuCard{background:var(--deck-panel);border:1px solid var(--deck-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-panel);padding:14px}.gpuHead{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:14px}.gpuHead strong{color:var(--deck-ink);font-size:13px}.gpuHead span{color:var(--deck-muted);font-size:12px;text-align:right;overflow-wrap:anywhere}.gpuMeter{display:grid;gap:7px;margin-top:10px}.gpuMeterLabel{display:flex;justify-content:space-between;gap:12px;color:var(--deck-muted);font-size:11px;font-weight:700}.gpuMeterLabel b{color:var(--deck-text);font-variant-numeric:tabular-nums}.meterTrack{height:9px;border-radius:999px;background:#a7bad21f;overflow:hidden}.meterTrack i{display:block;height:100%;border-radius:inherit;background:var(--deck-violet)}.meterTrack.util i{background:var(--deck-cyan)}.runtimeHero,.envFacts,.checkMatrix,.dependencyStrip{background:var(--deck-panel);border:1px solid var(--deck-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-panel)}.runtimeHero{display:flex;align-items:center;gap:16px;min-height:116px;padding:16px}.readinessOrb{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;font-weight:800;font-size:17px;border:1px solid var(--deck-line);background:#0b1118}.readinessOrb.ready{color:var(--deck-green);border-color:#57e39b59;box-shadow:inset 0 0 24px #57e39b0f}.readinessOrb.blocked{color:var(--deck-amber);border-color:#ffc85759;box-shadow:inset 0 0 24px #ffc8570f}.envFacts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;overflow:hidden;background:var(--deck-line)}.envFact{display:flex;align-items:center;gap:10px;min-height:57px;padding:12px;background:var(--deck-panel)}.envFact>span{display:grid;place-items:center;width:28px;height:28px;color:var(--deck-cyan);border:1px solid var(--deck-line);border-radius:8px;background:#0b1118}.envFact label{display:block;color:var(--deck-muted);font-size:11px;font-weight:650;margin-bottom:3px}.envFact strong{display:block;color:var(--deck-ink);font-size:13px;font-weight:650;overflow-wrap:anywhere}.checkMatrix{grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;overflow:hidden;background:var(--deck-line)}.checkItem{min-height:76px;padding:11px;background:var(--deck-panel)}.checkItem span{display:inline-flex;align-items:center;height:20px;border-radius:999px;padding:0 7px;font-size:10px;font-weight:800;margin-bottom:8px}.checkItem.ok span{color:var(--deck-green);background:#57e39b1a}.checkItem.warn span{color:var(--deck-amber);background:#ffc8571a}.checkItem.fail span{color:var(--deck-red);background:#ff6b7a1a}.checkItem strong,.checkItem small{display:block}.checkItem strong{color:var(--deck-ink);font-size:12px;font-weight:650}.checkItem small{margin-top:5px;color:var(--deck-muted);font-size:11px;line-height:1.35;overflow-wrap:anywhere}.dependencyStrip{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:8px;padding:10px}.depPill{display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border-radius:999px;border:1px solid var(--deck-line);color:var(--deck-text);background:#0b1118;font-size:12px;font-weight:600}.depPill.ok{border-color:#57e39b40}.depPill.warn{border-color:#ffc85740}.panel{min-width:0;padding:14px}.panelHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px;min-width:0}.panelHeader>div{min-width:0}.jobToolbar{display:grid;gap:10px;margin-bottom:12px}.jobSearch{display:flex;align-items:center;gap:8px;border:1px solid var(--deck-line);border-radius:var(--radius-sm);padding:0 10px;background:var(--deck-panel-2);color:var(--deck-muted)}.jobSearch input{flex:1;border:0;background:transparent;color:var(--deck-ink);font-size:13px;padding:8px 0;outline:none}.jobSearch input::placeholder{color:var(--deck-muted)}.jobFilters{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.jobFilters select{min-height:34px;border-radius:var(--radius-sm);font-size:12px}.jobFilters .secondaryButton:disabled{opacity:.42;cursor:not-allowed}.jobList{display:grid;gap:7px}.jobListPage .jobList{gap:10px}.pagerControls{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}.pagerControls span,.listFooter{color:var(--deck-muted);font-size:12px;font-variant-numeric:tabular-nums}.pagerControls button:disabled{cursor:not-allowed;opacity:.42}.listFooter{margin-top:12px;text-align:right}.jobRow{display:grid;grid-template-columns:34px 1fr 10px;align-items:center;gap:10px;width:100%;min-height:56px;border:1px solid transparent;border-radius:var(--radius-md);background:transparent;color:inherit;padding:7px;text-align:left}.jobRow.large{grid-template-columns:42px 1fr 10px;min-height:72px;padding:11px}.jobRow.large .jobIcon{width:42px;height:42px}.detailActions{display:inline-flex;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;gap:8px}.jobRow:hover,.jobRow.selected{background:var(--deck-panel-2);border-color:var(--deck-line)}.jobIcon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#0b1119;color:var(--deck-cyan);border:1px solid var(--deck-line)}.jobTitle{font-size:13px;font-weight:620}.jobMeta{margin-top:4px;color:var(--deck-muted);font-size:12px}.statusDot{width:8px;height:8px;border-radius:50%;background:var(--deck-muted)}.statusDot.running{background:var(--deck-green);box-shadow:0 0 0 4px #57e39b1a}.statusDot.failed{background:var(--deck-red)}.statusDot.stopped{background:var(--deck-amber)}.timeline{display:flex;gap:8px;margin-bottom:12px;overflow-x:auto;padding-bottom:4px}.timelineItem{flex:0 0 136px;min-width:136px;display:flex;align-items:center;gap:8px;height:38px;padding:0 10px;border-radius:var(--radius-md);background:#0c121a;border:1px solid var(--deck-line);color:var(--deck-muted)}.timelineItem span{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#ffffff0d;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums}.timelineItem.done{color:var(--deck-text)}.timelineItem.current{border-color:#38d7ff73;color:var(--deck-cyan)}.chart{min-height:272px;border:1px solid var(--deck-line);border-radius:var(--radius-lg);background:#0c121a;padding:12px;margin-bottom:12px}.chartControls{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:10px;min-width:0}.chartControls select{height:28px;width:min(230px,100%);min-width:0;border:1px solid var(--deck-line);border-radius:var(--radius-sm);background:#0b1118;color:var(--deck-text);padding:0 8px;outline:none}.chartControls label{display:flex;align-items:center;gap:7px;color:var(--deck-muted);font-size:11px;white-space:nowrap}.chartControls input[type=range]{width:92px;height:4px;accent-color:var(--deck-cyan)}.sampleCard{margin-bottom:12px;border:1px solid var(--deck-line);border-radius:var(--radius-lg);background:#0b1118;overflow:hidden}.sampleGrid{display:grid;grid-template-columns:.9fr 1.1fr;gap:1px;background:var(--deck-line)}.sampleGrid>div,.sampleEmpty{min-height:116px;padding:11px;background:#0b1118}.sampleGrid span{display:block;color:var(--deck-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;margin-bottom:7px}.sampleGrid p,.sampleEmpty{color:var(--deck-text);font-size:12px;line-height:1.5;max-height:150px;overflow:auto;white-space:pre-wrap}.sampleEmpty{color:var(--deck-muted)}.chartHeader{display:flex;align-items:center;justify-content:space-between;color:var(--deck-muted);font-size:12px;margin-bottom:12px}.chartHeader span{display:flex;align-items:center;gap:6px}.metricPlot{display:block;width:100%;height:180px;overflow:visible}.plotGrid line{stroke:#a7bad21a;stroke-width:1}.rawLine,.smoothLine{fill:none;stroke-linejoin:round;stroke-linecap:round}.rawLine{stroke:#728196bf;stroke-width:1.3}.smoothLine{stroke:var(--deck-cyan);stroke-width:2.7;filter:drop-shadow(0 0 8px rgba(56,215,255,.2))}.metricPlot circle{fill:var(--deck-ink);stroke:var(--deck-canvas);stroke-width:1.2}.plotFooter{display:flex;flex-wrap:wrap;gap:6px 12px;justify-content:space-between;margin-top:8px;color:var(--deck-muted);font-size:11px;font-variant-numeric:tabular-nums}.plotEmpty{display:grid;place-items:center;height:180px;color:var(--deck-muted);border:1px dashed var(--deck-line-strong);border-radius:var(--radius-md)}.timePerf{margin-bottom:12px;border:1px solid var(--deck-line);border-radius:var(--radius-lg);background:#0b1118;padding:12px}.timePerfHeader{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.codeTitle.inline{position:static;height:auto;padding:0;border:0;background:transparent}.legend{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:9px 12px;color:var(--deck-muted);font-size:11px}.legend span{display:inline-flex;align-items:center;gap:5px}.legend i{width:8px;height:8px;border-radius:50%}.legend b{color:var(--deck-text);font-weight:700;font-variant-numeric:tabular-nums}.timeRows{display:grid;gap:8px}.timeRow{display:grid;grid-template-columns:64px minmax(0,1fr) 70px;align-items:center;gap:10px}.timeRow label,.timeRow strong{color:var(--deck-text);font-size:12px;font-weight:650;font-variant-numeric:tabular-nums}.timeRow strong{text-align:right}.timeTrack{height:28px;border-radius:6px;background:#141b25;border:1px solid rgba(167,186,210,.1);overflow:hidden}.timeStack{display:flex;height:100%;min-width:18px}.timeStack span{display:flex;align-items:center;justify-content:center;min-width:3px;color:#ffffffeb;font-size:11px;font-weight:800;font-variant-numeric:tabular-nums;overflow:hidden;white-space:nowrap}.seg-rollout,.legend .seg-rollout{background:#20c997}.seg-train,.legend .seg-train{background:#bf2bd9}.seg-other,.legend .seg-other{background:#2851f5}.seg-reward,.legend .seg-reward{background:#d33672}.seg-advantages,.legend .seg-advantages{background:#5a3ee6}.seg-actor-log-probs,.legend .seg-actor-log-probs{background:#e243d2}.seg-ref-log-probs,.legend .seg-ref-log-probs,.seg-old-policy-log-probs,.legend .seg-old-policy-log-probs{background:#c43f66}.seg-value,.legend .seg-value{background:#8b5cf6}.seg-sync-weight,.legend .seg-sync-weight,.seg-save,.legend .seg-save{background:#83b81a}.seg-make-sample,.legend .seg-make-sample{background:#b96a19}.split{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:12px}.codeCard{min-width:0;min-height:250px;max-height:360px;overflow:auto;border:1px solid var(--deck-line);border-radius:var(--radius-lg);background:#0b1118}.codeTitle{position:sticky;top:0;display:flex;align-items:center;gap:7px;height:34px;padding:0 11px;border-bottom:1px solid var(--deck-line);background:#0d131b;color:var(--deck-text);font-size:12px;font-weight:650}.sampleTitle{justify-content:space-between;gap:10px;min-height:34px;height:auto;padding-top:4px;padding-bottom:4px}.sampleTitle>span{display:inline-flex;align-items:center;gap:7px}.sampleControls{display:inline-flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}.sampleControls select{height:26px;max-width:170px;border:1px solid var(--deck-line);border-radius:var(--radius-sm);background:#0b1118;color:var(--deck-text);padding:0 8px;font-size:11px;outline:none}pre{margin:0;padding:11px;color:#d2deee;font-family:SFMono-Regular,Roboto Mono,ui-monospace,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}.configSections{display:grid;gap:12px;padding:11px}.configSection{min-width:0}.configSection h3{margin:0 0 8px;color:var(--deck-text);font-size:12px;font-weight:750;letter-spacing:0}.configGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.configItem{min-width:0;border:1px solid var(--deck-line);border-radius:var(--radius-sm);background:#a7bad20d;padding:9px}.configItem span{display:block;color:var(--deck-muted);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.05em;margin-bottom:5px}.configItem strong{display:block;color:var(--deck-ink);font-size:12px;font-weight:620;line-height:1.35;overflow-wrap:anywhere}.lowerGrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:12px;margin-top:12px}.tabs{display:flex;gap:3px;padding:3px;border-radius:var(--radius-md);border:1px solid var(--deck-line);background:#0c121a}.tabs button{height:28px;border:0;border-radius:7px;background:transparent;color:var(--deck-muted);padding:0 12px;font-size:12px;font-weight:650}.tabs button.active{color:var(--deck-ink);background:var(--deck-panel-2)}.secondaryButton{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:34px;border:1px solid var(--deck-line);border-radius:var(--radius-sm);padding:0 12px;color:var(--deck-text);background:transparent;font-size:12px;font-weight:700}.launcherSections{display:grid;gap:14px}.launcherSection{display:grid;gap:10px;border:1px solid var(--deck-line);border-radius:var(--radius-md);padding:14px;background:var(--deck-panel-2)}.launcherSectionHeader{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.launcherSectionHeader strong{color:var(--deck-ink);font-size:13px;font-weight:760}.launcherSectionHeader span{color:var(--deck-faint);font-size:11px;font-weight:600;text-align:right}.formGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.field{display:grid;gap:6px;grid-column:span 2}.field.compact{grid-column:span 1}.field span{color:var(--deck-muted);font-size:11px;font-weight:650}input,select,textarea{width:100%;border:1px solid var(--deck-line);border-radius:var(--radius-sm);background:#0b1118;color:var(--deck-ink);outline:none}input,select{height:34px;padding:0 10px;font-size:13px}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--deck-muted) 50%),linear-gradient(135deg,var(--deck-muted) 50%,transparent 50%);background-position:calc(100% - 14px) 14px,calc(100% - 9px) 14px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;padding-right:28px}.checkField{display:flex;min-height:34px;align-items:center;gap:9px;align-self:end;border:1px solid var(--deck-line);border-radius:var(--radius-sm);padding:0 10px;background:#0b1118}.checkField input{width:15px;height:15px;padding:0;accent-color:var(--deck-cyan)}.checkField span{color:var(--deck-text);font-size:12px;font-weight:650}textarea{min-height:96px;resize:vertical;padding:10px;line-height:1.45}input:focus,select:focus,textarea:focus{border-color:#38d7ff85;box-shadow:0 0 0 3px #38d7ff1a}.primaryButton,.dangerButton,.iconButton{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;border-radius:var(--radius-sm);border:1px solid var(--deck-line);padding:0 12px;font-weight:650;font-size:13px}.primaryButton{color:#001018;border-color:#38d7ffcc;background:var(--deck-cyan)}.primaryButton.wide{grid-column:1 / -1}.launchButton{min-height:44px;border-radius:var(--radius-md);letter-spacing:0;width:100%}.dangerButton{color:var(--deck-red);background:#ff6b7a1a;border-color:#ff6b7a57}.dangerButton:hover{background:#ff6b7a29;border-color:#ff6b7a7a}.iconButton{width:36px;padding:0;color:var(--deck-text);background:var(--deck-panel)}.notice,.error{min-height:38px;display:flex;align-items:center;border-radius:var(--radius-md);padding:0 12px;margin-bottom:12px;font-size:13px;border:1px solid var(--deck-line)}.notice{color:var(--deck-cyan);background:#38d7ff14}.error{color:#ffd6db;background:#ff6b7a1a}.agentPanel{display:flex;flex-direction:column;gap:12px}.agentConfig{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:10px;align-items:end;margin-bottom:12px}.agentConfig.modalForm{grid-template-columns:1fr;margin-bottom:0}.modalOverlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;display:grid;place-items:center;background:#03080fa8;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:24px}.modalCard{width:min(560px,100%);border:1px solid var(--deck-line);border-radius:16px;background:var(--deck-panel);box-shadow:0 24px 80px #0000006b;padding:16px}.modalHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.chatPanel{display:grid;grid-template-rows:auto auto minmax(360px,1fr) auto;min-height:650px}.agentHeaderActions{display:inline-flex;align-items:center;gap:8px}.agentTabs{display:inline-flex;align-items:center;gap:6px;width:max-content;margin:4px 0 0 clamp(28px,5vw,112px);padding:4px;border:1px solid var(--deck-line);border-radius:999px;background:var(--deck-soft)}.agentTabs button{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:999px;padding:7px 12px;background:transparent;color:var(--deck-muted);font-size:12px;font-weight:750}.agentTabs button.active{background:var(--deck-panel);color:var(--deck-ink);box-shadow:0 8px 22px #00000024}.chatMessages{display:flex;flex-direction:column;gap:24px;min-height:360px;max-height:56vh;overflow:auto;border:0;border-radius:var(--radius-lg);background:transparent;padding:48px clamp(28px,5vw,112px) 18px}.chatBubble{max-width:min(1280px,100%);border:0;border-radius:0;background:transparent;padding:0;color:var(--deck-text)}.chatBubble.user{align-self:flex-end;max-width:min(680px,72%);border-radius:14px;background:#1a86ff;color:#fff;box-shadow:0 12px 28px #1a86ff29;padding:13px 20px}.chatBubble.assistant{align-self:flex-start;width:min(1280px,100%)}.chatBubble>span{display:block;margin-bottom:5px;color:var(--deck-muted);font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.chatBubble.user>span{display:none}.chatBubble.assistant>span{display:none}.chatBubble p{margin:0;white-space:pre-wrap;color:var(--deck-text)}.chatBubble.user p,.chatBubble.user .markdownBlock{color:#fff;font-size:13px;font-weight:650}.reasoningBlock{position:relative;margin:4px 0 18px;padding-left:34px;color:var(--deck-muted);background:transparent}.reasoningBlock:before{content:"";position:absolute;top:28px;bottom:0;left:15px;width:2px;border-radius:999px;background:var(--deck-line)}.reasoningBlock summary{display:inline-flex;align-items:center;gap:9px;cursor:pointer;list-style:none;min-height:28px}.reasoningBlock summary::-webkit-details-marker{display:none}.reasoningBlock summary span{display:inline-grid;place-items:center;width:18px;height:18px;border:1px solid var(--deck-line-strong);border-radius:999px;color:var(--deck-muted);font-size:11px}.reasoningBlock summary strong{color:var(--deck-muted);font-size:12px;font-weight:650}.reasoningBlock summary:after{content:"⌄";color:var(--deck-muted);font-size:15px}.agentEventList{display:grid;gap:16px}.agentEventList>.markdownBlock{width:min(780px,calc(100% - 64px));margin-left:34px}.markdownBlock{color:var(--deck-text);font-size:13px;line-height:1.58;overflow-wrap:anywhere}.markdownBlock>*:first-child{margin-top:0}.markdownBlock>*:last-child{margin-bottom:0}.markdownBlock p,.markdownBlock ul,.markdownBlock ol{margin:0 0 8px}.markdownBlock ul,.markdownBlock ol{padding-left:20px}.markdownBlock code{border:1px solid var(--deck-line);border-radius:5px;padding:1px 4px;background:#38d7ff14;color:var(--deck-ink)}.markdownBlock pre{max-height:220px;overflow:auto;border:1px solid var(--deck-line);border-radius:8px;padding:10px;background:#04080d38}.markdownBlock table{display:block;width:100%;max-width:100%;margin:10px 0;overflow:auto;border-collapse:collapse;border:1px solid var(--deck-line);border-radius:8px}.markdownBlock th,.markdownBlock td{padding:7px 9px;border-bottom:1px solid var(--deck-line);text-align:left;white-space:nowrap}.markdownBlock th{color:var(--deck-ink);background:#38d7ff14;font-size:11px;font-weight:750}.markdownBlock tr:last-child td{border-bottom:0}.reasoningBlock .markdownBlock{width:min(780px,calc(100% - 64px));max-height:160px;overflow:auto;margin-left:34px;padding:14px 0 2px;color:var(--deck-muted)}.toolCallList{display:grid;gap:8px;margin-top:0}.toolCallCard{width:min(780px,calc(100% - 64px));margin-left:34px;border:1px solid rgba(148,163,184,.24);border-radius:11px;background:var(--deck-panel);box-shadow:none;overflow:hidden}.toolCallCard.ok{border-color:var(--deck-line-strong);background:var(--deck-panel)}.toolCallCard.failed{border-color:#ff6b7a47;background:#ff6b7a14}.toolCallCard.live{border-color:#57e39b6b;background:#57e39b12}.toolCallDetails summary,.toolResultDetails summary{display:grid;grid-template-columns:auto minmax(96px,auto) minmax(0,1fr);align-items:center;gap:8px;min-height:36px;padding:0 12px;cursor:pointer;border-bottom:1px solid var(--deck-line);list-style-position:outside}.toolCallDetails:not([open]) summary,.toolResultDetails:not([open]) summary{border-bottom:0}.toolCallDetails summary::marker,.toolResultDetails summary::marker{color:var(--deck-muted)}.toolResultDetails summary span{display:inline-flex;align-items:center;justify-content:center;min-width:58px;height:19px;border:1px solid rgba(87,227,155,.28);border-radius:999px;background:#57e39b1a;color:var(--deck-green);font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.toolCallDetails summary span{position:relative;width:14px;min-width:14px;height:14px;overflow:hidden;color:transparent}.toolCallDetails summary span:before{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border-radius:999px;background:#35c737}.toolResultDetails.ok summary span{border-color:#57e39b38;background:#57e39b17;color:var(--deck-green)}.toolResultDetails.failed summary span{border-color:#ff6b7a47;background:#ff6b7a1a;color:var(--deck-red)}.toolCallDetails summary b,.toolResultDetails summary b{color:var(--deck-ink);font-size:12px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Monaco,Consolas,monospace;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toolCallDetails summary em,.toolResultDetails summary em{min-width:0;overflow:hidden;color:var(--deck-muted);font-size:11px;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.toolCallHead{border-bottom:1px solid var(--deck-line)}.toolCallHead span{margin:0;color:var(--deck-cyan)}.toolCallHead b{color:var(--deck-ink);font-size:11px}.toolCallCard pre{max-height:140px;overflow:auto;background:transparent;border-top:1px solid var(--deck-line);padding:10px 12px;font-size:11px}.toolResultDetails pre{max-height:240px}.streamingHint{margin-top:8px;color:var(--deck-cyan);font-size:11px;font-weight:700}.chatComposer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;margin-top:12px;border:1px solid var(--deck-line);border-radius:var(--radius-lg);background:var(--deck-panel);padding:10px}.chatComposer textarea{min-height:72px;border:0;padding:8px;background:transparent;resize:none;font-size:13px}.agentHistory{min-height:360px;max-height:56vh;overflow:auto;padding:28px clamp(28px,5vw,112px) 18px}.agentHistoryHeader{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.agentHistoryHeader h3{margin:0 0 4px;font-size:16px}.agentHistoryHeader p{margin:0;color:var(--deck-muted);font-size:12px}.agentHistoryList{display:grid;gap:10px}.agentHistoryItem{display:grid;gap:5px;width:min(840px,100%);border:1px solid var(--deck-line);border-radius:13px;background:var(--deck-panel);padding:13px 15px;text-align:left}.agentHistoryItem.active{border-color:#38d7ff7a;box-shadow:0 0 0 1px #38d7ff2e}.agentHistoryItem strong{color:var(--deck-ink);font-size:13px}.agentHistoryItem span{overflow:hidden;color:var(--deck-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.agentHistoryItem small{color:var(--deck-subtle);font-size:11px}.agentOutput{min-height:152px;border-radius:var(--radius-lg);border:1px solid var(--deck-line);background:#0b1118;color:var(--deck-text);padding:12px;font-size:13px;line-height:1.5;white-space:pre-wrap}.empty{display:grid;place-items:center;gap:8px;min-height:180px;color:var(--deck-muted);border:1px dashed var(--deck-line-strong);border-radius:var(--radius-lg);text-align:center;padding:16px}.empty strong{color:var(--deck-text);font-size:13px}.empty span{font-size:12px}:root[data-theme=light] .brandMark,:root[data-theme=light] .readinessOrb,:root[data-theme=light] .envFact,:root[data-theme=light] .envFact>span,:root[data-theme=light] .checkItem,:root[data-theme=light] .depPill,:root[data-theme=light] .timelineItem,:root[data-theme=light] .chart,:root[data-theme=light] .sampleCard,:root[data-theme=light] .sampleGrid>div,:root[data-theme=light] .sampleEmpty,:root[data-theme=light] .timePerf,:root[data-theme=light] .codeCard,:root[data-theme=light] .codeTitle,:root[data-theme=light] input,:root[data-theme=light] textarea,:root[data-theme=light] select,:root[data-theme=light] .checkField,:root[data-theme=light] .agentOutput,:root[data-theme=light] .chatComposer,:root[data-theme=light] .timeTrack,:root[data-theme=light] .tabs{background:var(--deck-panel)}:root[data-theme=light] .chartControls select,:root[data-theme=light] .configItem{background:#fff;color:var(--deck-ink)}:root[data-theme=light] .dangerButton{color:#a51d2d;background:#fff1f3;border-color:#c7344647}:root[data-theme=light] .primaryButton{color:#fff;background:#007ea7;border-color:#007ea7;box-shadow:0 8px 18px #007ea72e}:root[data-theme=light] .launchButton{background:#006d94;border-color:#006d94}:root[data-theme=light] .jobIcon{background:#f3f7fb}:root[data-theme=light] .chatBubble.user{background:#1683ff;color:#fff}:root[data-theme=light] .chatMessages{background:transparent}:root[data-theme=light] .toolCallCard{box-shadow:0 6px 18px #1420330f}:root[data-theme=light] .rawLine{stroke:#55657aa6}:root[data-theme=light] pre{color:#25344a}@media(max-width:980px){.shell{grid-template-columns:1fr}.rail{position:sticky;top:0;z-index:20;border-right:0;border-bottom:1px solid var(--deck-line);padding:10px}.brand,.railFooter{display:none}.nav{display:flex;gap:6px;overflow-x:auto}.navItem{width:auto;flex:0 0 auto}.main{padding:12px}.topbar,.panelHeader,.timePerfHeader{flex-direction:column;align-items:stretch}.runtimeDeck,.jobMetricsGrid,.metricsGrid,.split,.sampleGrid,.formGrid{grid-template-columns:1fr}.field,.field.compact{grid-column:span 1}.checkMatrix,.envFacts{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.checkMatrix,.envFacts{grid-template-columns:1fr}.jobRow.large{grid-template-columns:34px minmax(0,1fr)}.jobRow.large .statusDot{display:none}.timeRow{grid-template-columns:52px minmax(0,1fr)}.timeRow strong{grid-column:2;text-align:left}} diff --git a/areno/dashboard/dist/index.html b/areno/dashboard/dist/index.html index 0fd880a6..f159c9b9 100644 --- a/areno/dashboard/dist/index.html +++ b/areno/dashboard/dist/index.html @@ -4,8 +4,8 @@ AReno Dashboard - - + +
diff --git a/areno/dashboard/server.py b/areno/dashboard/server.py index 18bc31ed..38d308fd 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -66,6 +66,59 @@ def now() -> str: return dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat() +def _parse_time(value: Any) -> float | None: + """Parse an ISO-8601 timestamp or epoch float to epoch seconds.""" + if isinstance(value, (int, float)): + return float(value) + if isinstance(value, str): + try: + return dt.datetime.fromisoformat(value).timestamp() + except ValueError: + return None + return None + + +def _duration_seconds(created_at: Any, updated_at: Any, status: str = "") -> float | None: + """Return the elapsed seconds for a job. + + For running jobs, duration is measured to now() (not updated_at) so it + keeps growing while the job is alive. For terminal jobs, duration is + measured to updated_at (which is set when the job transitions to a + terminal state). This avoids the problem where registry scans update + updated_at every poll cycle even after a job has exited. + """ + start = _parse_time(created_at) + if start is None: + return None + if status == "running": + return max(0.0, _parse_time(now()) - start) + end = _parse_time(updated_at) + if end is None: + return None + return max(0.0, end - start) + + +def _launch_value(launch: Any, key: str, default: Any = "") -> Any: + """Read a value from launch_config, handling both flat dict and sections format.""" + if not isinstance(launch, dict): + return default + if key in launch: + return launch[key] or default + sections = launch.get("sections") + if not isinstance(sections, list): + return default + for section in sections: + if not isinstance(section, dict): + continue + items = section.get("items") + if not isinstance(items, list): + continue + for item in items: + if isinstance(item, dict) and item.get("key") == key: + return item.get("value", default) + return default + + class Job: def __init__( self, @@ -157,6 +210,7 @@ def to_json(self) -> dict[str, Any]: } def to_summary_json(self) -> dict[str, Any]: + launch = self.launch_config or {} return { "id": self.id, "kind": self.kind, @@ -169,9 +223,13 @@ def to_summary_json(self) -> dict[str, Any]: "step": self.step, "created_at": self.created_at, "updated_at": self.updated_at, + "duration_s": _duration_seconds(self.created_at, self.updated_at, self.status), "returncode": self.returncode, "pid": self.pid, "perf": self.perf, + "algo": _launch_value(launch, "algo"), + "ckpt": _launch_value(launch, "ckpt") or _launch_value(launch, "model_path"), + "dataset_path": _launch_value(launch, "dataset_path"), } @@ -464,7 +522,7 @@ def list_jobs(self) -> list[dict[str, Any]]: self._save_state() return [ job.to_summary_json() - for job in sorted(self.jobs.values(), key=lambda item: item.created_at, reverse=True) + for job in sorted(self.jobs.values(), key=lambda item: _parse_time(item.created_at) or 0, reverse=True) ] def _refresh_job_status(self, job: Job) -> None: @@ -564,6 +622,8 @@ def scan_registered_jobs(self) -> None: pid=pid, cwd=str(item.get("cwd") or "") or None, ) + if item.get("created_at"): + job.created_at = item["created_at"] job.launch_config = dict(job.config) job.config = {} job.status = "running" if is_running else "exited" @@ -579,9 +639,15 @@ def scan_registered_jobs(self) -> None: job.config = dict(item.get("config") or {}) if item.get("config") and not job.launch_config: job.launch_config = dict(item.get("config") or {}) + old_status = job.status if job.status != "stopped": job.status = "running" if is_running else "exited" - job.updated_at = now() + # Only update updated_at when transitioning to a terminal + # state or while still running. Do not touch it for jobs + # that were already in a terminal state — otherwise the + # duration keeps growing on every scan. + if is_running or (old_status == "running" and not is_running): + job.updated_at = now() self._save_state() def _load_state(self) -> None: diff --git a/dashboard/src/main.jsx b/dashboard/src/main.jsx index 9a682d19..a0b9357a 100644 --- a/dashboard/src/main.jsx +++ b/dashboard/src/main.jsx @@ -19,6 +19,8 @@ import { Plus, Play, RefreshCw, + RotateCcw, + Search, Send, Server, Settings2, @@ -313,6 +315,53 @@ const defaultServeConfig = { extra_args: "", }; +const SORT_OPTIONS = [ + { value: "newest", label: "Start time (newest)" }, + { value: "oldest", label: "Start time (oldest)" }, + { value: "duration_desc", label: "Duration (longest)" }, + { value: "duration_asc", label: "Duration (shortest)" }, +]; + +const STATE_OPTIONS = ["all", "running", "succeeded", "failed", "stopped", "exited", "unknown"]; +const TYPE_OPTIONS = ["all", "train", "serve"]; +const VALID_STATES = new Set(STATE_OPTIONS); +const VALID_TYPES = new Set(TYPE_OPTIONS); +const VALID_SORTS = new Set(SORT_OPTIONS.map((o) => o.value)); + +function readUrlParam(key, fallback) { + const params = new URLSearchParams(window.location.search); + return params.get(key) || fallback; +} + +function readUrlEnum(key, fallback, valid) { + const raw = readUrlParam(key, fallback); + return valid.has(raw) ? raw : fallback; +} + +function readUrlPage(fallback = 1) { + const raw = readUrlParam("page", ""); + if (!raw) return fallback; + const n = Number(raw); + if (!Number.isFinite(n) || n < 1) return fallback; + return Math.floor(n); +} + +function syncUrlParams(params) { + const url = new URL(window.location.href); + url.search = ""; + for (const [key, value] of Object.entries(params)) { + if (value) url.searchParams.set(key, value); + } + window.history.replaceState({}, "", url.toString()); +} + +function jobTimestamp(job, field) { + const v = job[field]; + if (typeof v === "number") return v; + if (typeof v === "string") return Date.parse(v) || 0; + return 0; +} + function App() { const [selectedJobId, setSelectedJobId] = useState(null); const [trainConfig, setTrainConfig] = useState(defaultTrainConfig); @@ -335,7 +384,12 @@ function App() { const [language, setLanguage] = useState(() => localStorage.getItem(UI_LANGUAGE_STORAGE_KEY) || "en"); const [busy, setBusy] = useState(""); const [agentSettingsOpen, setAgentSettingsOpen] = useState(false); - const [jobPage, setJobPage] = useState(1); + const [jobPage, setJobPage] = useState(() => readUrlPage(1)); + const [searchQuery, setSearchQuery] = useState(() => readUrlParam("q", "")); + const [stateFilter, setStateFilter] = useState(() => readUrlEnum("state", "all", VALID_STATES)); + const [typeFilter, setTypeFilter] = useState(() => readUrlEnum("type", "all", VALID_TYPES)); + const [algoFilter, setAlgoFilter] = useState(() => readUrlParam("algo", "all")); + const [sortKey, setSortKey] = useState(() => readUrlEnum("sort", "newest", VALID_SORTS)); const [jobDetailOpen, setJobDetailOpen] = useState(false); const [refreshNonce, setRefreshNonce] = useState(0); const [followUpsLoading, setFollowUpsLoading] = useState(false); @@ -367,10 +421,52 @@ function App() { [selectedJobId], ); - const jobList = (jobs.data?.jobs || []).filter((job) => job.kind !== "runtime-repair"); +const jobList = (jobs.data?.jobs || []).filter((job) => job.kind !== "runtime-repair"); const runtimeRepairJob = runtimeRepairDetail.data?.job || runtimeRepair?.job || null; - const filteredJobs = jobFilter === "all" ? jobList : jobList.filter((job) => job.status === jobFilter); const jobPageSize = 3; + + const algoOptions = useMemo(() => { + const algos = Array.from(new Set(jobList.map((job) => job.algo).filter(Boolean))).sort(); + return ["all", ...algos]; + }, [jobList]); + + const filteredJobs = useMemo(() => { + let result = jobList; + if (stateFilter !== "all") result = result.filter((job) => job.status === stateFilter); + if (searchQuery.trim()) { + const q = searchQuery.toLowerCase(); + result = result.filter((job) => + [job.id, job.name, job.ckpt, job.dataset_path].some((field) => + String(field || "").toLowerCase().includes(q) + ) + ); + } + if (typeFilter !== "all") result = result.filter((job) => job.kind === typeFilter); + if (algoFilter !== "all") result = result.filter((job) => job.algo === algoFilter); + + const sorted = [...result]; + if (sortKey === "newest") { + sorted.sort((a, b) => jobTimestamp(b, "created_at") - jobTimestamp(a, "created_at")); + } else if (sortKey === "oldest") { + sorted.sort((a, b) => jobTimestamp(a, "created_at") - jobTimestamp(b, "created_at")); + } else if (sortKey === "duration_desc") { + sorted.sort((a, b) => (Number(b.duration_s) || 0) - (Number(a.duration_s) || 0)); + } else if (sortKey === "duration_asc") { + sorted.sort((a, b) => (Number(a.duration_s) || 0) - (Number(b.duration_s) || 0)); + } + return sorted; + }, [jobList, searchQuery, stateFilter, typeFilter, algoFilter, sortKey]); + + const hasActiveFilters = searchQuery || stateFilter !== "all" || typeFilter !== "all" || algoFilter !== "all" || sortKey !== "newest"; + + function resetFilters() { + setSearchQuery(""); + setStateFilter("all"); + setTypeFilter("all"); + setAlgoFilter("all"); + setSortKey("newest"); + setJobPage(1); + } const jobPageCount = Math.max(1, Math.ceil(filteredJobs.length / jobPageSize)); const currentJobPage = Math.min(jobPage, jobPageCount); const pagedJobs = filteredJobs.slice((currentJobPage - 1) * jobPageSize, currentJobPage * jobPageSize); @@ -397,8 +493,21 @@ function App() { }, [jobList.length, selectedJobId]); useEffect(() => { - if (jobPage > jobPageCount) setJobPage(jobPageCount); - }, [jobPage, jobPageCount]); + // Only clamp page after jobs have loaded — otherwise jobPageCount=1 + // on initial render would wipe a restored page=2 before data arrives. + if (jobList.length > 0 && jobPage > jobPageCount) setJobPage(jobPageCount); + }, [jobPage, jobPageCount, jobList.length]); + + useEffect(() => { + syncUrlParams({ + q: searchQuery, + state: stateFilter !== "all" ? stateFilter : "", + type: typeFilter !== "all" ? typeFilter : "", + algo: algoFilter !== "all" ? algoFilter : "", + sort: sortKey !== "newest" ? sortKey : "", + page: jobPage > 1 ? String(jobPage) : "", + }); + }, [searchQuery, stateFilter, typeFilter, algoFilter, sortKey, jobPage]); useEffect(() => { const status = String(runtimeRepairJob?.status || "").toLowerCase(); @@ -997,6 +1106,36 @@ function App() { +{jobList.length > 0 && ( +
+
+ + { setSearchQuery(event.target.value); setJobPage(1); }} + /> +
+
+ + + + + +
+
+ )}
{filteredJobs.length === 0 && } {filteredJobs.length > 0 && @@ -1018,6 +1157,7 @@ function App() { {filteredJobs.length > jobPageSize && (
Showing {(currentJobPage - 1) * jobPageSize + 1}-{Math.min(currentJobPage * jobPageSize, filteredJobs.length)} of {filteredJobs.length} jobs + {jobList.length > filteredJobs.length && ` (filtered from ${jobList.length})`}
)} diff --git a/dashboard/src/styles.css b/dashboard/src/styles.css index 5f8ea3ea..fda6cb1c 100644 --- a/dashboard/src/styles.css +++ b/dashboard/src/styles.css @@ -722,6 +722,55 @@ p { min-width: 0; } +.jobToolbar { + display: grid; + gap: 10px; + margin-bottom: 12px; +} + +.jobSearch { + display: flex; + align-items: center; + gap: 8px; + border: 1px solid var(--deck-line); + border-radius: var(--radius-sm); + padding: 0 10px; + background: var(--deck-panel-2); + color: var(--deck-muted); +} + +.jobSearch input { + flex: 1; + border: 0; + background: transparent; + color: var(--deck-ink); + font-size: 13px; + padding: 8px 0; + outline: none; +} + +.jobSearch input::placeholder { + color: var(--deck-muted); +} + +.jobFilters { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} + +.jobFilters select { + min-height: 34px; + border-radius: var(--radius-sm); + font-size: 12px; +} + +.jobFilters .secondaryButton:disabled { + opacity: 0.42; + cursor: not-allowed; +} + .jobList { display: grid; gap: 7px; diff --git a/docs/cli/dashboard.rst b/docs/cli/dashboard.rst new file mode 100644 index 00000000..8ec84b2c --- /dev/null +++ b/docs/cli/dashboard.rst @@ -0,0 +1,163 @@ +:orphan: + +Dashboard +========= + +AReno ships a local, low-intrusion dashboard for inspecting training and +serving jobs without standing up a separate monitoring service. The dashboard +runs entirely on the host machine, reads from local artifact files, and +requires no external database. + +Starting and stopping +--------------------- + +.. code-block:: bash + + areno dashboard --start --host 0.0.0.0 --port 8765 + areno dashboard --stop + +The dashboard serves a single-page React app and a small JSON API from the +same HTTP server. Open ``http://:`` in a browser to view the +dashboard. + +Run list search, filtering, and sorting +--------------------------------------- + +The Jobs page provides a toolbar above the run list for search, filtering, +sorting, and a reset action. All toolbar state is persisted in URL query +parameters, so refreshing the page or sharing the URL preserves the current +view. + +Search +^^^^^^ + +The search box matches the following fields with a case-insensitive +substring query: + +* Job ID +* Job name +* Model checkpoint (``ckpt`` or ``model_path``) +* Dataset path + +Filters +^^^^^^^ + +Three dropdown filters narrow the run list: + +* **State** — ``all`` (default), ``running``, ``succeeded``, ``failed``, + ``stopped``, ``exited``, ``unknown`` +* **Type** — ``all`` (default), ``train``, ``serve`` +* **Algorithm** — ``all`` (default), then every algorithm present in the + run list (``sft``, ``dpo``, ``gspo``, ``grpo``, ``ppo``, …). The + options are derived dynamically from the data. + +Sort +^^^^ + +The sort dropdown orders runs by: + +* **Start time (newest)** — default, preserves original behavior +* **Start time (oldest)** +* **Duration (longest)** +* **Duration (shortest)** + +Duration is computed from ``created_at`` to ``updated_at`` for each run. + +URL parameters +^^^^^^^^^^^^^^ + +The toolbar state is encoded in the following query parameters: + +.. list-table:: + :header-rows: 1 + :widths: 20 80 + + * - Parameter + - Description + * - ``q`` + - Search query string + * - ``state`` + - State filter (omitted when ``all``) + * - ``type`` + - Type filter (omitted when ``all``) + * - ``algo`` + - Algorithm filter (omitted when ``all``) + * - ``sort`` + - Sort key (omitted when ``newest``) + * - ``page`` + - Current page number (omitted when page 1) + +When all parameters are absent the dashboard behaves exactly as it did +before the feature was added. + +Reset button +^^^^^^^^^^^^ + +The **Reset** button clears all search text, filters, and sort selection, +restoring the default view. It is disabled when no filters are active. + +Testing with synthetic data +--------------------------- + +A seed script is provided for exercising the toolbar with many records +without running real training jobs: + +.. code-block:: bash + + python scripts/seed_dashboard.py --count 50 + areno dashboard --start + +By default the script **merges** synthetic jobs into the existing +``.areno-dashboard-state.json``, preserving any real jobs already +present. Use ``--replace`` to discard existing jobs and write only +synthetic data: + +.. code-block:: bash + + areno dashboard --stop + python scripts/seed_dashboard.py --count 50 --replace + areno dashboard --start + +Half the jobs use the sections-format launch config (matching real +CLI-registered jobs) and half use flat dict format (matching dashboard +launched jobs), so both code paths are exercised. All timestamps are +ISO-8601 strings matching the real dashboard format. + +Minimal example +--------------- + +1. Generate synthetic data and start the dashboard: + + .. code-block:: bash + + python scripts/seed_dashboard.py --count 30 + areno dashboard --start + +2. Open the dashboard URL in a browser. + +3. Type ``gsm8k`` in the search box — only runs with that dataset appear. + +4. Select ``State: failed`` — the list narrows further to failed runs on + gsm8k. + +5. Change the sort to ``Duration (longest)`` — the remaining runs + reorder by elapsed time. + +6. Click **Reset** — all filters clear and the full list returns to the + default newest-first ordering. + +7. Refresh the browser — the URL contains the current filter parameters + and the view is restored automatically. + +Limitations +----------- + +* Filtering and sorting run client-side on the polled run list (up to 200 + registered jobs). This is fast enough for typical single-node usage but + is not designed for multi-node aggregations. +* The dashboard does not persist filter state across sessions beyond URL + parameters. Closing the tab and reopening without the URL loses the + active filters. +* Duration is only available for runs where both ``created_at`` and + ``updated_at`` are present and parseable. Jobs with corrupted + timestamps show ``duration_s: null``. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index eb4ef3f8..b7d7eb7e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,6 +45,7 @@ AReno documentation CLI Reference SDK Reference Supported Models + Dashboard .. toctree:: :hidden: diff --git a/scripts/seed_dashboard.py b/scripts/seed_dashboard.py new file mode 100644 index 00000000..8e86d205 --- /dev/null +++ b/scripts/seed_dashboard.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +"""Seed the AReno dashboard state file with synthetic jobs for testing. + +Usage: + python scripts/seed_dashboard.py [--count 50] [--output ] [--replace] + +The generated jobs cover a mix of states, types, algorithms, models, and +datasets so that search, filtering, and sorting can be exercised without +running real training tasks. + +By default the script **merges** synthetic jobs into the existing state +file, preserving any real jobs already present. Use ``--replace`` to +discard existing jobs and write only synthetic data. +""" + +from __future__ import annotations + +import argparse +import datetime as dt +import json +import random +from pathlib import Path +from uuid import uuid4 + +from areno.dashboard.server import _launch_value + +STATES = ["running", "succeeded", "failed", "stopped", "exited"] +ALGOS = ["sft", "dpo", "gspo", "grpo", "ppo"] +MODELS = [ + "Qwen/Qwen3-0.6B", + "Qwen/Qwen3-1.7B", + "Qwen/Qwen3-4B", + "Qwen/Qwen2.5-0.5B", +] +DATASETS = ["gsm8k:main", "yahma/alpaca-cleaned:train", "openai/gsm8k", "math", "tictactoe.jsonl"] + +DEFAULT_OUTPUT = Path(".areno-dashboard-state.json") + + +def _iso(ts: float) -> str: + """Convert epoch seconds to ISO-8601 string matching dashboard format.""" + return dt.datetime.fromtimestamp(ts, tz=dt.timezone.utc).replace(microsecond=0).isoformat() + + +def _make_sections_launch(launch_items): + """Build a sections-format launch config matching real CLI output.""" + sections = [] + current_title = "Basic" + current_items = [] + for key, value in launch_items: + if key in ("world_size", "tp_size", "attn_backend"): + if current_items: + sections.append({"title": current_title, "items": current_items}) + current_title = "Runtime" + current_items = [] + elif key in ("batch_size", "n_samples", "max_running_prompts", "max_new_tokens"): + if current_items: + sections.append({"title": current_title, "items": current_items}) + current_title = "Rollout" + current_items = [] + current_items.append({"key": key, "value": value}) + if current_items: + sections.append({"title": current_title, "items": current_items}) + return {"sections": sections} + + +def make_job(index: int) -> dict: + kind = random.choice(["train", "serve"]) + algo = random.choice(ALGOS) + model = random.choice(MODELS) + dataset = random.choice(DATASETS) + status = random.choice(STATES) + now_ts = dt.datetime.now(dt.timezone.utc).timestamp() + created_ts = now_ts - random.randint(60, 86400 * 7) + updated_ts = created_ts + random.randint(10, 3600) + step = random.randint(0, 200) + use_sections = random.random() < 0.5 + + if kind == "serve": + if use_sections: + launch = _make_sections_launch([("model_path", model), ("host", "0.0.0.0"), ("port", 8000)]) + else: + launch = {"model_path": model, "host": "0.0.0.0", "port": 8000} + name = f"serve {model}" + else: + if use_sections: + launch = _make_sections_launch( + [ + ("algo", algo), + ("ckpt", model), + ("dataset_path", dataset), + ("model_hub", "modelscope"), + ("world_size", random.choice([1, 2, 4])), + ("tp_size", random.choice([1, 2])), + ("attn_backend", "flash"), + ] + ) + else: + launch = {"algo": algo, "ckpt": model, "dataset_path": dataset, "model_hub": "modelscope"} + name = f"train {algo} {model}" + + return { + "id": uuid4().hex[:12], + "kind": kind, + "name": name, + "command": ["areno", kind, "--ckpt", model], + "config": {}, + "config_text": "", + "launch": launch, + "metrics_dir": f"/tmp/areno/tfevent/run-{index}", + "status": status, + "stage": "registered" if status == "running" else "exited", + "role": "", + "step": step, + "created_at": _iso(created_ts), + "updated_at": _iso(updated_ts), + "returncode": 0 if status == "succeeded" else (1 if status == "failed" else None), + "pid": None, + "logs": [f"registered AReno command: areno {kind}"], + "metrics_count": random.randint(0, 50), + "samples": [], + "timeperf": [], + "perf": {}, + } + + +def main() -> None: + parser = argparse.ArgumentParser(description="Seed dashboard state with synthetic jobs.") + parser.add_argument("--count", type=int, default=50, help="Number of synthetic jobs to generate.") + parser.add_argument("--output", type=Path, default=DEFAULT_OUTPUT, help="Output state file path.") + parser.add_argument("--replace", action="store_true", help="Replace existing jobs instead of merging.") + args = parser.parse_args() + + existing_jobs = [] + if args.output.exists() and not args.replace: + try: + data = json.loads(args.output.read_text(encoding="utf-8")) + existing_jobs = data.get("jobs", []) + if not isinstance(existing_jobs, list): + existing_jobs = [] + except Exception: + existing_jobs = [] + + new_jobs = [make_job(i) for i in range(args.count)] + all_jobs = existing_jobs + new_jobs + + payload = {"jobs": all_jobs} + args.output.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") + action = "Replaced" if args.replace else "Merged" + print(f"{action} {args.count} synthetic jobs into {args.output} ({len(all_jobs)} total)") + print(f"States: {', '.join(sorted(set(j['status'] for j in all_jobs)))}") + algos = sorted(set(filter(None, (_launch_value(j.get("launch", {}), "algo") for j in all_jobs)))) + print(f"Algorithms: {', '.join(algos)}") + print(f"Types: {', '.join(sorted(set(j['kind'] for j in all_jobs)))}") + + +if __name__ == "__main__": + main() diff --git a/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py new file mode 100644 index 00000000..d3a6ecac --- /dev/null +++ b/tests/test_dashboard_runs_cpu.py @@ -0,0 +1,305 @@ +from __future__ import annotations + +import unittest + +from areno.dashboard.server import Job, _duration_seconds, _launch_value, _parse_time + + +class ParseTimeTest(unittest.TestCase): + """_parse_time handles ISO strings, epoch floats, and bad inputs.""" + + def test_parse_iso_timestamp(self): + """An ISO-8601 string with timezone produces a valid epoch float.""" + result = _parse_time("2026-01-01T00:00:00+00:00") + self.assertIsNotNone(result) + self.assertAlmostEqual(result, 1767225600.0, places=1) + + def test_parse_epoch_float(self): + """A raw float is returned as-is.""" + self.assertEqual(_parse_time(1700000000.0), 1700000000.0) + + def test_parse_epoch_int(self): + """An int is also accepted.""" + self.assertEqual(_parse_time(1700000000), 1700000000.0) + + def test_parse_none(self): + self.assertIsNone(_parse_time(None)) + + def test_parse_garbage(self): + self.assertIsNone(_parse_time("not-a-date")) + + +class DurationSecondsTest(unittest.TestCase): + """_duration_seconds computes elapsed time with a non-negative floor.""" + + def test_iso_pair(self): + start = "2026-01-01T00:00:00+00:00" + end = "2026-01-01T00:10:00+00:00" + self.assertAlmostEqual(_duration_seconds(start, end), 600.0, places=1) + + def test_epoch_pair(self): + self.assertAlmostEqual(_duration_seconds(100.0, 125.5), 25.5) + + def test_start_unparseable(self): + self.assertIsNone(_duration_seconds("bad", "2026-01-01T00:00:00+00:00")) + + def test_end_unparseable(self): + self.assertIsNone(_duration_seconds(100.0, None)) + + def test_negative_floored_to_zero(self): + """If updated_at predates created_at the duration is 0, not negative.""" + self.assertEqual(_duration_seconds(200.0, 100.0), 0.0) + + def test_running_uses_now(self): + """Running jobs compute duration to now(), not updated_at.""" + start = "2020-01-01T00:00:00+00:00" + stale_updated = "2020-01-01T00:01:00+00:00" + result = _duration_seconds(start, stale_updated, status="running") + self.assertIsNotNone(result) + self.assertGreater(result, 60.0) + + def test_terminal_uses_updated_at(self): + """Terminal jobs use updated_at, not now().""" + start = "2026-01-01T00:00:00+00:00" + end = "2026-01-01T00:05:00+00:00" + result = _duration_seconds(start, end, status="exited") + self.assertAlmostEqual(result, 300.0, places=1) + + +def _make_job(**overrides): + """Create a minimal Job with sensible defaults for summary tests.""" + defaults = dict( + kind="train", + name="test job", + command=["areno", "train"], + config={"algo": "gspo", "ckpt": "Qwen/Qwen3-0.6B", "dataset_path": "gsm8k:main"}, + metrics_dir="/tmp/areno/metrics", + ) + defaults.update(overrides) + return Job(**defaults) + + +class SummaryJsonTest(unittest.TestCase): + """to_summary_json surfaces fields needed for dashboard search/filter/sort.""" + + def test_new_fields_present(self): + job = _make_job() + summary = job.to_summary_json() + self.assertEqual(summary["algo"], "gspo") + self.assertEqual(summary["ckpt"], "Qwen/Qwen3-0.6B") + self.assertEqual(summary["dataset_path"], "gsm8k:main") + self.assertIn("duration_s", summary) + + def test_existing_fields_unchanged(self): + """All fields that existed before the change are still present.""" + job = _make_job() + summary = job.to_summary_json() + for key in ( + "id", + "kind", + "name", + "metrics_dir", + "status", + "stage", + "role", + "step", + "created_at", + "updated_at", + "returncode", + "pid", + "perf", + ): + self.assertIn(key, summary, f"missing pre-existing field: {key}") + + def test_duration_calculated_from_timestamps(self): + job = _make_job() + job.created_at = "2026-01-01T00:00:00+00:00" + job.updated_at = "2026-01-01T00:05:00+00:00" + summary = job.to_summary_json() + self.assertAlmostEqual(summary["duration_s"], 300.0, places=1) + + def test_duration_none_when_created_at_invalid(self): + """A job with a corrupted created_at yields None, not an exception.""" + job = _make_job() + job.created_at = "garbage" + job.updated_at = "2026-01-01T00:00:00+00:00" + summary = job.to_summary_json() + self.assertIsNone(summary["duration_s"]) + + def test_duration_running_uses_now(self): + """Running jobs compute duration against now(), not stale updated_at.""" + job = _make_job() + job.status = "running" + job.created_at = "2020-01-01T00:00:00+00:00" + job.updated_at = "2020-01-01T00:01:00+00:00" + summary = job.to_summary_json() + self.assertIsNotNone(summary["duration_s"]) + self.assertGreater(summary["duration_s"], 60.0) + + def test_serve_job_uses_model_path(self): + """Serve jobs store the model under model_path, not ckpt.""" + job = _make_job( + kind="serve", + config={"model_path": "Qwen/Qwen3-0.6B"}, + ) + summary = job.to_summary_json() + self.assertEqual(summary["ckpt"], "Qwen/Qwen3-0.6B") + self.assertEqual(summary["algo"], "") + + def test_empty_launch_config(self): + """A job whose launch_config was cleared still returns safe defaults.""" + job = _make_job() + job.launch_config = {} + summary = job.to_summary_json() + self.assertEqual(summary["algo"], "") + self.assertEqual(summary["ckpt"], "") + self.assertEqual(summary["dataset_path"], "") + + def test_none_launch_config(self): + """A job whose launch_config is None returns safe defaults.""" + job = _make_job() + job.launch_config = None # type: ignore[assignment] + summary = job.to_summary_json() + self.assertEqual(summary["algo"], "") + self.assertEqual(summary["ckpt"], "") + + def test_from_json_preserves_launch_fields(self): + """A job restored from JSON retains launch_config for summary fields.""" + original = _make_job() + payload = original.to_json() + restored = Job.from_json(payload) + summary = restored.to_summary_json() + self.assertEqual(summary["algo"], "gspo") + self.assertEqual(summary["ckpt"], "Qwen/Qwen3-0.6B") + self.assertEqual(summary["dataset_path"], "gsm8k:main") + + +class LaunchValueTest(unittest.TestCase): + """_launch_value reads from both flat dict and sections format.""" + + def test_flat_dict(self): + launch = {"algo": "gspo", "ckpt": "Qwen/Qwen3-0.6B"} + self.assertEqual(_launch_value(launch, "algo"), "gspo") + self.assertEqual(_launch_value(launch, "ckpt"), "Qwen/Qwen3-0.6B") + + def test_sections_format(self): + """CLI-registered jobs store launch config as sections arrays.""" + launch = { + "sections": [ + { + "title": "Basic", + "items": [ + {"key": "algo", "value": "gspo"}, + {"key": "ckpt", "value": "Qwen/Qwen3-0.6B"}, + {"key": "dataset_path", "value": "tictactoe.jsonl"}, + ], + }, + { + "title": "Runtime", + "items": [ + {"key": "tp_size", "value": 2}, + ], + }, + ] + } + self.assertEqual(_launch_value(launch, "algo"), "gspo") + self.assertEqual(_launch_value(launch, "ckpt"), "Qwen/Qwen3-0.6B") + self.assertEqual(_launch_value(launch, "dataset_path"), "tictactoe.jsonl") + self.assertEqual(_launch_value(launch, "tp_size"), 2) + + def test_missing_key_returns_default(self): + self.assertEqual(_launch_value({"sections": []}, "algo"), "") + self.assertEqual(_launch_value({}, "algo"), "") + + def test_none_launch(self): + self.assertEqual(_launch_value(None, "algo"), "") + + def test_serve_sections_with_model_path(self): + launch = { + "sections": [ + { + "title": "Basic", + "items": [ + {"key": "model_path", "value": "Qwen/Qwen3-0.6B"}, + ], + }, + ] + } + self.assertEqual(_launch_value(launch, "model_path"), "Qwen/Qwen3-0.6B") + + def test_sections_none(self): + """Malformed launch with sections=None should not crash.""" + self.assertEqual(_launch_value({"sections": None}, "algo"), "") + + def test_items_none(self): + """Malformed section with items=None should not crash.""" + self.assertEqual(_launch_value({"sections": [{"items": None}]}, "algo"), "") + + def test_sections_not_list(self): + """Malformed launch with sections as string should not crash.""" + self.assertEqual(_launch_value({"sections": "garbage"}, "algo"), "") + + +class SummarySectionsFormatTest(unittest.TestCase): + """to_summary_json works with sections-format launch_config (CLI jobs).""" + + def test_sections_format_summary(self): + job = _make_job() + job.launch_config = { + "sections": [ + { + "title": "Basic", + "items": [ + {"key": "algo", "value": "gspo"}, + {"key": "ckpt", "value": "Qwen/Qwen3-0.6B"}, + {"key": "dataset_path", "value": "tictactoe.jsonl"}, + ], + }, + ] + } + summary = job.to_summary_json() + self.assertEqual(summary["algo"], "gspo") + self.assertEqual(summary["ckpt"], "Qwen/Qwen3-0.6B") + self.assertEqual(summary["dataset_path"], "tictactoe.jsonl") + + def test_serve_sections_format_summary(self): + job = _make_job(kind="serve") + job.launch_config = { + "sections": [ + { + "title": "Basic", + "items": [ + {"key": "model_path", "value": "Qwen/Qwen3-0.6B"}, + ], + }, + ] + } + summary = job.to_summary_json() + self.assertEqual(summary["ckpt"], "Qwen/Qwen3-0.6B") + self.assertEqual(summary["algo"], "") + + def test_from_json_with_sections_launch(self): + """A job restored from JSON with sections launch retains summary fields.""" + job = _make_job() + job.launch_config = { + "sections": [ + { + "title": "Basic", + "items": [ + {"key": "algo", "value": "dpo"}, + {"key": "ckpt", "value": "Qwen/Qwen2.5-0.5B"}, + {"key": "dataset_path", "value": "alpaca.jsonl"}, + ], + }, + ] + } + payload = job.to_json() + restored = Job.from_json(payload) + summary = restored.to_summary_json() + self.assertEqual(summary["algo"], "dpo") + self.assertEqual(summary["ckpt"], "Qwen/Qwen2.5-0.5B") + self.assertEqual(summary["dataset_path"], "alpaca.jsonl") + + +if __name__ == "__main__": + unittest.main()