From 7e839a73b5144d485d5536402b49569574d7e52e Mon Sep 17 00:00:00 2001 From: shihuai Date: Tue, 28 Jul 2026 15:24:48 +0800 Subject: [PATCH 1/9] feat(dashboard): add search, filtering, and sorting for runs - Extend Job.to_summary_json() with algo, ckpt, dataset_path, duration_s - Add _parse_time and _duration_seconds helpers for timestamp/duration calc - Add frontend toolbar with search, state/type/algo filters, sort options - Persist filter/sort state in URL query parameters with visible reset - Add CSS styles for toolbar (jobToolbar, jobSearch, jobFilters) - Add CPU tests for new summary fields and edge cases - Rebuild dashboard dist assets Closes #263 --- areno/dashboard/dist/assets/index-ByDSHg-k.js | 207 ++++++++++++++++++ .../dashboard/dist/assets/index-CIfovKBG.css | 1 - areno/dashboard/dist/assets/index-DF61sRZi.js | 197 ----------------- .../dashboard/dist/assets/index-DV7XCEqO.css | 1 + areno/dashboard/dist/index.html | 4 +- areno/dashboard/server.py | 28 +++ dashboard/pnpm-lock.yaml | 2 +- dashboard/src/main.jsx | 137 +++++++++++- dashboard/src/styles.css | 49 +++++ tests/test_dashboard_runs_cpu.py | 142 ++++++++++++ 10 files changed, 562 insertions(+), 206 deletions(-) create mode 100644 areno/dashboard/dist/assets/index-ByDSHg-k.js delete mode 100644 areno/dashboard/dist/assets/index-CIfovKBG.css delete mode 100644 areno/dashboard/dist/assets/index-DF61sRZi.js create mode 100644 areno/dashboard/dist/assets/index-DV7XCEqO.css create mode 100644 tests/test_dashboard_runs_cpu.py diff --git a/areno/dashboard/dist/assets/index-ByDSHg-k.js b/areno/dashboard/dist/assets/index-ByDSHg-k.js new file mode 100644 index 00000000..52ab89be --- /dev/null +++ b/areno/dashboard/dist/assets/index-ByDSHg-k.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 Qp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vo={exports:{}},Ha={};/** + * @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 qm;function y0(){if(qm)return Ha;qm=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 Ha.Fragment=a,Ha.jsx=r,Ha.jsxs=r,Ha}var Ym;function x0(){return Ym||(Ym=1,Vo.exports=y0()),Vo.exports}var v=x0(),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 Gm;function b0(){if(Gm)return ke;Gm=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 ze=!1;if(T===null)ze=!0;else switch(ce){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(T.$$typeof){case n:case a:ze=!0;break;case x:return ze=T._init,M(ze(T._payload),Y,_,le,se)}}if(ze)return se=se(T),ze=le===""?"."+ie(T,0):le,te(se)?(_="",ze!=null&&(_=ze.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,"$&/")+"/")+ze)),Y.push(se)),1;ze=0;var we=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 Xm;function S0(){return Xm||(Xm=1,Zo.exports=v0()),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 Zm;function k0(){if(Zm)return zt;Zm=1;var n=Cs();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=k0(),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 Fm;function E0(){if(Fm)return qa;Fm=1;var n=S0(),a=Cs(),r=_0();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),ze=T(null);function we(e,t){switch(_(ce,t),_(se,e),_(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?om(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=om(t),e=sm(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&&_(ze,e);var t=le.current,l=sm(t,e.type);t!==l&&(_(se,e),_(le,l))}function yt(e){se.current===e&&(Y(le),Y(se)),ze.current===e&&(Y(ze),Ra._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,Ki=n.unstable_shouldYield,Fi=n.unstable_requestPaint,bt=n.unstable_now,ti=n.unstable_getCurrentPriorityLevel,G=n.unstable_ImmediatePriority,P=n.unstable_UserBlockingPriority,xe=n.unstable_NormalPriority,Ce=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 fy=/[\n"\\]/g;function ln(e){return e.replace(fy,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 nf(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"&&ir(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 Pi={};Object.defineProperty(Pi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Gu=!1}var el=null,Vu=null,rr=null;function sf(){if(rr)return rr;var e,t=Vu,l=t.length,i,c="value"in el?el.value:el.textContent,o=c.length;for(e=0;e=na),gf=" ",yf=!1;function xf(e,t){switch(e){case"keyup":return Hy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function Yy(e,t){switch(e){case"compositionend":return bf(t);case"keypress":return t.which!==32?null:(yf=!0,gf);case"textInput":return e=t.data,e===gf&&yf?null:e;default:return null}}function Gy(e,t){if(fi)return e==="compositionend"||!Fu&&xf(e,t)?(e=sf(),rr=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=zf(l)}}function wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ir(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=ir(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 Iy=Nn&&"documentMode"in document&&11>=document.documentMode,hi=null,Wu=null,ra=null,Pu=!1;function Nf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pu||hi==null||hi!==ir(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}),ra&&aa(ra,i)||(ra=i,i=Pr(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(g0){return t(w,g0)}),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),ha(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=gr(N.type,N.key,N.props,null,w.mode,V),ha(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,_r(N),V);if(N.$$typeof===Z)return Fe(w,z,br(w,N),V);Er(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{fa=0;var de=Fe(w,z,N,V);return _i=null,de}catch(oe){if(oe===ki||oe===Sr)throw oe;var qe=Ft(29,oe,null,w.mode);return qe.lanes=V,qe.return=w,qe}finally{}}}var Ql=eh(!0),th=eh(!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=pr(e),Uf(e,null,l),t}return mr(e,i,t,l),pr(e)}function da(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,Pa(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 ma(){if(Sc){var e=Si;if(e!==null)throw e}}function pa(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 nh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function lh(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=a1(A,i);xa(e,t,H,Pt(e))}else xa(e,t,i,Pt(e))}catch(X){xa(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 f1(){}function Uc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var c=Rh(e).queue;jh(e,c,t,ae,l===null?f1:function(){return Lh(e),l(i)})}function Rh(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 Lh(e){var t=Rh(e);t.next===null&&(t=e.alternate.memoizedState),xa(e,t.next.queue,{},Pt())}function Hc(){return kt(Ra)}function Bh(){return at().memoizedState}function Uh(){return at().memoizedState}function h1(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),da(i,t,l)),t={cache:mc()},e.payload=t;return}t=t.return}}function d1(e,t,l){var i=Pt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},jr(e)?qh(t,l):(l=lc(e,t,l,i),l!==null&&(Gt(l,e,i),Yh(l,t,i)))}function Hh(e,t,l){var i=Pt();xa(e,t,l,i)}function xa(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(jr(e))qh(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 mr(e,t,c,0),Je===null&&dr(),!1}catch{}finally{}if(l=lc(e,t,c,i),l!==null)return Gt(l,e,i),Yh(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},jr(e)){if(t)throw Error(u(479))}else t=lc(e,l,i,2),t!==null&&Gt(t,e,2)}function jr(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function qh(e,t){Ai=zr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yh(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Pa(e,l)}}var ba={readContext:kt,use:Mr,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};ba.useEffectEvent=nt;var Gh={readContext:kt,use:Mr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Ah,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Dr(4194308,4,wh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Dr(4194308,4,e,t)},useInsertionEffect:function(e,t){Dr(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=d1.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=Hh.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=jh.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||oh(i,t,l)}c.memoizedState=l;var o={value:l,getSnapshot:t};return c.queue=o,Ah(fh.bind(null,i,o,e),[e]),i.flags|=2048,zi(9,{destroy:void 0},sh.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=Cr++,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||um(e.nodeValue,l)),e||ll(t,!0)}else e=eu(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),Hr(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)Sa(i,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Tr(e),o!==null){for(t.flags|=128,Sa(i,!1),e=o.updateQueue,t.updateQueue=e,Hr(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hf(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()>Qr&&(t.flags|=128,c=!0,Sa(i,!1),t.lanes=4194304)}else{if(!c)if(e=Tr(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Hr(t,e),Sa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Be)return Pe(t),null}else 2*bt()-i.renderingStartTime>Qr&&l!==536870912&&(t.flags|=128,c=!0,Sa(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&&Hr(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 x1(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 hd(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 ka(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 dd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{lh(t,l)}catch(i){Xe(e,e.return,i)}}}function md(e,t,l){l.props=Zl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Xe(e,t,i)}}function _a(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 pd(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 gd(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||gd(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 qr(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(qr(e,t,l),e=e.sibling;e!==null;)qr(e,t,l),e=e.sibling}function yd(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,xd=typeof WeakSet=="function"?WeakSet:Set,gt=null;function b1(e,t){if(e=e.containerInfo,To=uu,e=Mf(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},uu=!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=Em("link","href",c).get(i+(l.href||""));if(g){for(var b=0;bFe&&(g=Fe,Fe=ye,ye=g);var w=Cf(b,ye),z=Cf(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,wd(o.current),Td(o,o.current,g,l),Ge=b,wa(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(ht,o)}catch{}return!0}finally{F.p=c,M.T=i,Kd(e,t)}}function Jd(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)Jd(e,e,l);else for(;t!==null;){if(t.tag===3){Jd(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=Ih(2),i=ul(t,l,2),i!==null&&($h(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 k1;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=z1.bind(null,e,t,l),t.then(e,e))}function z1(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()-Vr?(Ge&2)===0&&Oi(e,0):co|=l,Ni===Oe&&(Ni=0)),An(e)}function Id(e,t){t===0&&(t=q()),e=Ll(e,t),e!==null&&(fe(e,t),An(e))}function C1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Id(e,l)}function w1(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),Id(e,l)}function M1(e,t){return $n(e,t)}var Ir=null,Ri=null,yo=!1,$r=!1,xo=!1,gl=0;function An(e){e!==Ri&&e.next===null&&(Ri===null?Ir=Ri=e:Ri=Ri.next=e),$r=!0,yo||(yo=!0,D1())}function wa(e,t){if(!xo&&$r){xo=!0;do for(var l=!1,i=Ir;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,em(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,em(i,o));i=i.next}while(l);xo=!1}}function N1(){$d()}function $d(){$r=yo=!1;var e=0;gl!==0&&G1()&&(e=gl);for(var t=bt(),l=null,i=Ir;i!==null;){var c=i.next,o=Wd(i,t);o===0?(i.next=null,l===null?Ir=c:l.next=c,c===null&&(Ri=l)):(l=i,(e!==0||(o&3)!==0)&&($r=!0)),i=c}dt!==0&&dt!==5||wa(e),gl!==0&&(gl=0)}function Wd(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&&cm(X)&&(A=A.responseEnd,g+=H*(A"u"?null:document;function vm(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+'"]'),bm.has(c)||(bm.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 $1(e){Zn.D(e),vm("dns-prefetch",e,null)}function W1(e,t){Zn.C(e,t),vm("preconnect",e,t)}function P1(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(Oa(o))||t==="script"&&i.querySelector(ja(o))||(t=i.createElement("link"),Et(t,"link",e),pt(t),i.head.appendChild(t)))}}function e0(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(ja(o)))return}i=l.createElement("link"),Et(i,"link",e),pt(i),l.head.appendChild(i)}}}function t0(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(Oa(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,nu(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:b},c.set(o,g)}}}function n0(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(ja(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 l0(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(ja(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 Sm(e,t,l,i){var c=(c=ce.current)?tu(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(Oa(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||i0(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 Oa(e){return'link[rel="stylesheet"]['+e+"]"}function km(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function i0(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 ja(e){return"script[async]"+e}function _m(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),nu(i,l.precedence,e),t.instance=i;case"stylesheet":c=Bi(l.href);var o=e.querySelector(Oa(c));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;i=km(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,nu(o,l.precedence,e),t.instance=o;case"script":return o=Ui(l.src),(c=e.querySelector(ja(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,nu(i,l.precedence,e));return t.instance}function nu(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 a0(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 Tm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function r0(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(Oa(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=iu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,pt(o);return}o=t.ownerDocument||t,i=km(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=iu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Lo=0;function u0(e,t){return e.stylesheets&&e.count===0&&ru(e,e.stylesheets),0Lo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ru(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var au=null;function ru(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,au=new Map,t.forEach(c0,e),au=null,iu.call(e))}function c0(e,t){if(!(t.state.loading&4)){var l=au.get(e);if(l)var i=l.get(null);else{l=new Map,au.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=E0(),Xo.exports}var T0=A0();function z0(n,a){const r={};return(n[n.length-1]===""?[...n,""]:n).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const C0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M0={};function Im(n,a){return(M0.jsx?w0:C0).test(n)}const N0=/[ \t\n\f\r]/g;function D0(n){return typeof n=="object"?n.type==="text"?$m(n.value):!1:$m(n)}function $m(n){return n.replace(N0,"")===""}class Ia{constructor(a,r,u){this.normal=r,this.property=a,u&&(this.space=u)}}Ia.prototype.normal={};Ia.prototype.property={};Ia.prototype.space=void 0;function Xp(n,a){const r={},u={};for(const s of n)Object.assign(r,s.property),Object.assign(u,s.normal);return new Ia(r,u,a)}function ms(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 O0=0;const Se=Pl(),ft=Pl(),ps=Pl(),I=Pl(),Ie=Pl(),$l=Pl(),en=Pl();function Pl(){return 2**++O0}const gs=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:ft,commaOrSpaceSeparated:en,commaSeparated:$l,number:I,overloadedBoolean:ps,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),Jo=Object.keys(gs);class ws extends Qt{constructor(a,r,u,s){let h=-1;if(super(a,r),Wm(this,"space",s),typeof u=="number")for(;++h4&&r.slice(0,4)==="data"&&U0.test(a)){if(a.charAt(4)==="-"){const h=a.slice(5).replace(Pm,Y0);u="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=a.slice(4);if(!Pm.test(h)){let f=h.replace(B0,q0);f.charAt(0)!=="-"&&(f="-"+f),a="data"+f}}s=ws}return new s(u,a)}function q0(n){return"-"+n.toLowerCase()}function Y0(n){return n.charAt(1).toUpperCase()}const G0=Xp([Zp,j0,Jp,Ip,$p],"html"),Ms=Xp([Zp,R0,Jp,Ip,$p],"svg");function V0(n){return n.join(" ").trim()}var qi={},Io,ep;function Q0(){if(ep)return Io;ep=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 tp;function X0(){if(tp)return qi;tp=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(Q0());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 Ya={},np;function Z0(){if(np)return Ya;np=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.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 Ya.camelCase=p,Ya}var Ga,lp;function K0(){if(lp)return Ga;lp=1;var n=Ga&&Ga.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=n(X0()),r=Z0();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,Ga=u,Ga}var F0=K0();const J0=Qp(F0),Wp=Pp("end"),Ns=Pp("start");function Pp(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 I0(n){const a=Ns(n),r=Wp(n);if(a&&r)return{start:a,end:r}}function Xa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ip(n.position):"start"in n||"end"in n?ip(n):"line"in n||"column"in n?ys(n):""}function ys(n){return ap(n&&n.line)+":"+ap(n&&n.column)}function ip(n){return ys(n&&n.start)+"-"+ys(n&&n.end)}function ap(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=Xa(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 Ds={}.hasOwnProperty,$0=new Map,W0=/[A-Z]/g,P0=new Set(["table","tbody","thead","tfoot","tr"]),ex=new Set(["td","th"]),eg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tx(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=ox(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=cx(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"?Ms:G0,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},h=tg(s,n,void 0);return h&&typeof h!="string"?h:s.create(n,s.Fragment,{children:h||void 0},void 0)}function tg(n,a,r){if(a.type==="element")return nx(n,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return lx(n,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return ax(n,a,r);if(a.type==="mdxjsEsm")return ix(n,a);if(a.type==="root")return rx(n,a,r);if(a.type==="text")return ux(n,a)}function nx(n,a,r){const u=n.schema;let s=u;a.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Ms,n.schema=s),n.ancestors.push(a);const h=lg(n,a.tagName,!1),f=sx(n,a);let m=js(n,a);return P0.has(a.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!D0(p):!0})),ng(n,f,h,a),Os(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function lx(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)}Fa(n,a.position)}function ix(n,a){if(a.data&&a.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(a.data.estree);Fa(n,a.position)}function ax(n,a,r){const u=n.schema;let s=u;a.name==="svg"&&u.space==="html"&&(s=Ms,n.schema=s),n.ancestors.push(a);const h=a.name===null?n.Fragment:lg(n,a.name,!0),f=fx(n,a),m=js(n,a);return ng(n,f,h,a),Os(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function rx(n,a,r){const u={};return Os(u,js(n,a)),n.create(a,n.Fragment,u,r)}function ux(n,a){return a.value}function ng(n,a,r,u){typeof r!="string"&&r!==n.Fragment&&n.passNode&&(a.node=u)}function Os(n,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(n.children=r)}}function cx(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 ox(n,a){return r;function r(u,s,h,f){const m=Array.isArray(h.children),p=Ns(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 sx(n,a){const r={};let u,s;for(s in a.properties)if(s!=="children"&&Ds.call(a.properties,s)){const h=hx(n,s,a.properties[s]);if(h){const[f,m]=h;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&ex.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 fx(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 Fa(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 Fa(n,a.position);else h=u.value===null?!0:u.value;r[s]=h}return r}function js(n,a){const r=[];let u=-1;const s=n.passKeys?new Map:$0;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 cp={}.hasOwnProperty;function ag(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]/),Sx=Al(/[#-'*+\--9=?A-Z^-~]/);function ku(n){return n!==null&&(n<32||n===127)}const xs=Al(/\d/),kx=Al(/[\dA-Fa-f]/),_x=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 Zi(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 Cx(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 Vi(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};sp(y,-p),sp(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(fp,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:Gx},Yx={partial:!0,tokenize:Vx};function Gx(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(Yx,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 Vx(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 Qx={name:"codeText",previous:Zx,resolve:Xx,tokenize:Kx};function Xx(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&&Va(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),Va(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),Va(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 fg(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||ku(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 dg(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 Za(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 tb={name:"definition",tokenize:lb},nb={partial:!0,tokenize:ib};function lb(n,a,r){const u=this;let s;return h;function h(k){return n.enter("definition"),f(k)}function f(k){return hg.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)?Za(n,d)(k):d(k)}function d(k){return fg(n,x,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function x(k){return n.attempt(nb,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 ib(n,a,r){return u;function u(m){return $e(m)?Za(n,s)(m):r(m)}function s(m){return dg(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 ab={name:"hardBreakEscape",tokenize:rb};function rb(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 ub={name:"headingAtx",resolve:cb,tokenize:ob};function cb(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 ob(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 sb=["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"],dp=["pre","script","style","textarea"],fb={concrete:!0,name:"htmlFlow",resolveTo:mb,tokenize:pb},hb={partial:!0,tokenize:yb},db={partial:!0,tokenize:gb};function mb(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 pb(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&&dp.includes(se)?(s=1,u.interrupt?a(_):ee(_)):sb.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(hb,Y,Te)(_)):_===null||ge(_)?(n.exit("htmlFlowData"),Te(_)):(n.consume(_),ee)}function Te(_){return n.check(db,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 dp.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 gb(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 yb(n,a,r){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt($a,a,r)}}const xb={name:"htmlText",tokenize:bb};function bb(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 Bs={name:"labelEnd",resolveAll:_b,resolveTo:Eb,tokenize:Ab},vb={tokenize:Tb},Sb={tokenize:zb},kb={tokenize:Cb};function _b(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:Ub},exit:qb,name:"list",tokenize:Bb},Rb={partial:!0,tokenize:Yb},Lb={partial:!0,tokenize:Hb};function Bb(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:xs(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(vu,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 xs(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($a,u.interrupt?r:x,n.attempt(Rb,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 Ub(n,a,r){const u=this;return u.containerState._closeFlow=void 0,n.check($a,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(Lb,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 Hb(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 Yb(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 mp={name:"setextUnderline",resolveTo:Gb,tokenize:Vb};function Gb(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 Vb(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 Qb={tokenize:Xb};function Xb(n){const a=this,r=n.attempt($a,u,n.attempt(this.parser.constructs.flowInitial,s,Ue(n,n.attempt(this.parser.constructs.flow,s,n.attempt(Ix,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 Zb={resolveAll:pg()},Kb=mg("string"),Fb=mg("text");function mg(n){return{resolveAll:pg(n==="text"?Jb: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 cv(n,a){let r=-1;const u=[];let s;for(;++r0){const Nt=xe.tokenStack[xe.tokenStack.length-1];(Nt[1]||gp).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 kv(n,a){const r={type:"element",tagName:"del",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function _v(n,a){const r={type:"element",tagName:"em",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function Ev(n,a){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(a.identifier).toUpperCase(),s=Zi(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 Av(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 Tv(n,a){if(n.options.allowDangerousHtml){const r={type:"raw",value:a.value};return n.patch(a,r),n.applyData(a,r)}}function xg(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 zv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return xg(n,a);const s={src:Zi(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 Cv(n,a){const r={src:Zi(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 wv(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 Mv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return xg(n,a);const s={href:Zi(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 Nv(n,a){const r={href:Zi(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 Dv(n,a,r){const u=n.all(a),s=r?Ov(r):bg(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 jv(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=Ns(a.children[1]),p=Wp(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 Hv(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(bp(a.slice(s),s>0,!1)),h.join("")}function bp(n,a,r){let u=0,s=n.length;if(a){let h=n.codePointAt(u);for(;h===yp||h===xp;)u++,h=n.codePointAt(u)}if(r){let h=n.codePointAt(s-1);for(;h===yp||h===xp;)s--,h=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function Gv(n,a){const r={type:"text",value:Yv(String(a.value))};return n.patch(a,r),n.applyData(a,r)}function Vv(n,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(a,r),n.applyData(a,r)}const Qv={blockquote:bv,break:vv,code:Sv,delete:kv,emphasis:_v,footnoteReference:Ev,heading:Av,html:Tv,imageReference:zv,image:Cv,inlineCode:wv,linkReference:Mv,link:Nv,listItem:Dv,list:jv,paragraph:Rv,root:Lv,strong:Bv,table:Uv,tableCell:qv,tableRow:Hv,text:Gv,thematicBreak:Vv,toml:mu,yaml:mu,definition:mu,footnoteDefinition:mu};function mu(){}const vg=-1,wu=0,Ka=1,_u=2,Us=3,Hs=4,qs=5,Ys=6,Sg=7,kg=8,_g=typeof self=="object"?self:globalThis,vp=(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 _g[n](a)},Xv=(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 vg:return r(f,s);case Ka:{const m=r([],s);for(const p of f)m.push(u(p));return m}case _u:{const m=r({},s);for(const[p,d]of f)m[u(p)]=u(d);return m}case Us:return r(new Date(f),s);case Hs:{const{source:m,flags:p}=f;return r(new RegExp(m,p),s)}case qs:{const m=r(new Map,s);for(const[p,d]of f)m.set(u(p),u(d));return m}case Ys:{const m=r(new Set,s);for(const p of f)m.add(u(p));return m}case Sg:{const{name:m,message:p}=f;return r(typeof _g[m]=="function"?vp(m,p):new Error(p),s)}case kg: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(vp(h,f),s)};return u},Sp=n=>Xv(new Map,n)(0),Il="",{toString:Zv}={},{keys:Kv}=Object,Qa=n=>{const a=typeof n;if(a!=="object"||!n)return[wu,a];const r=Zv.call(n).slice(8,-1);switch(r){case"Array":return[Ka,Il];case"Object":return[_u,Il];case"Date":return[Us,Il];case"RegExp":return[Hs,Il];case"Map":return[qs,Il];case"Set":return[Ys,Il];case"DataView":return[Ka,r]}return r.includes("Array")?[Ka,r]:n instanceof Error?[Sg,n.name||"Error"]:[_u,r]},pu=([n,a])=>n===wu&&(a==="function"||a==="symbol"),Fv=(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]=Qa(f);switch(m){case wu:{let x=f;switch(p){case"bigint":m=kg,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);x=null;break;case"undefined":return s([vg],f)}return s([m,x],f)}case Ka:{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 _u:{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 Kv(f))(n||!pu(Qa(f[S])))&&x.push([h(S),h(f[S])]);return y}case Us:return s([m,isNaN(f.getTime())?Il:f.toISOString()],f);case Hs:{const{source:x,flags:y}=f;return s([m,{source:x,flags:y}],f)}case qs:{const x=[],y=s([m,x],f);for(const[S,k]of f)(n||!(pu(Qa(S))||pu(Qa(k))))&&x.push([h(S),h(k)]);return y}case Ys:{const x=[],y=s([m,x],f);for(const S of f)(n||!pu(Qa(S)))&&x.push(h(S));return y}}const{message:d}=f;return s([m,{name:p,message:d}],f)};return h},kp=(n,{json:a,lossy:r}={})=>{const u=[];return Fv(!(a||r),!!a,new Map,u)(n),u},Eu=typeof structuredClone=="function"?(n,a)=>a&&("json"in a||"lossy"in a)?Sp(kp(n,a)):structuredClone(n):(n,a)=>Sp(kp(n,a));function Jv(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 Iv(n,a){return"Back to reference "+(n+1)+(a>1?"-"+a:"")}function $v(n){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=n.options.footnoteBackContent||Jv,u=n.options.footnoteBackLabel||Iv,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:{...Eu(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 tS;if(typeof n=="function")return Nu(n);if(typeof n=="object")return Array.isArray(n)?Wv(n):Pv(n);if(typeof n=="string")return eS(n);throw new Error("Expected function, string, or object as test")});function Wv(n){const a=[];let r=-1;for(;++r":""))+")"})}return S;function S(){let k=Eg,C,U,Q;if((!a||h(p,d,x[x.length-1]||void 0))&&(k=aS(r(p,x)),k[0]===vs))return k;if("children"in p&&p.children){const O=p;if(O.children&&k[0]!==iS)for(U=(u?O.children.length:-1)+f,Q=x.concat(O);U>-1&&U0&&r.push({type:"text",value:` +`}),r}function _p(n){let a=0,r=n.charCodeAt(a);for(;r===9||r===32;)a++,r=n.charCodeAt(a);return n.slice(a)}function Ep(n,a){const r=uS(n,a),u=r.one(n,void 0),s=$v(r),h=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&h.children.push({type:"text",value:` +`},s),h}function hS(n,a){return n&&"run"in n?async function(r,u){const s=Ep(r,{file:u,...a});await n.run(s,u)}:function(r,u){return Ep(r,{file:u,...n||a})}}function Ap(n){if(n)throw n}var es,Tp;function dS(){if(Tp)return es;Tp=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:yS,dirname:xS,extname:bS,join:vS,sep:"/"};function yS(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');Wa(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 xS(n){if(Wa(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 bS(n){Wa(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 vS(...n){let a=-1,r;for(;++a0&&n.codePointAt(n.length-1)===47&&(r+="/"),a?"/"+r:r}function kS(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 Wa(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const _S={cwd:ES};function ES(){return"/"}function _s(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function AS(n){if(typeof n=="string")n=new URL(n);else if(!_s(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 TS(n)}function TS(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];ks(U)&&ks(k)&&(k=ts(!0,U,k)),u[S]=[d,k,...C]}}}}const MS=new Vs().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 Cp(n){if(!ks(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function wp(n,a,r){if(!r)throw new Error("`"+n+"` finished async. Use `"+a+"` instead")}function gu(n){return NS(n)?n:new Tg(n)}function NS(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function DS(n){return typeof n=="string"||OS(n)}function OS(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const jS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mp=[],Np={allowDangerousHtml:!0},RS=/^(https?|ircs?|mailto|xmpp)$/i,LS=[{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 BS(n){const a=US(n),r=HS(n);return qS(a.runSync(a.parse(r),r),n)}function US(n){const a=n.rehypePlugins||Mp,r=n.remarkPlugins||Mp,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Np}:Np;return MS().use(xv).use(r).use(hS,u).use(a)}function HS(n){const a=n.children||"",r=new Tg;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||YS;for(const x of LS)Object.hasOwn(a,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+jS+x.id,void 0);return Gs(n,d),tx(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 YS(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||RS.test(n.slice(0,a))?n:""}function Dp(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 GS(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VS(n,a,r){const s=Mu((r||{}).ignore||[]),h=QS(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=Dp(n,"(");let h=Dp(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 zg(n,a){const r=n.input.charCodeAt(n.index-1);return(n.index===0||Wl(r)||zu(r))&&(!a||r!==47)}Cg.peek=d2;function a2(){this.buffer()}function r2(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function u2(){this.buffer()}function c2(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function o2(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 s2(n){this.exit(n)}function f2(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 h2(n){this.exit(n)}function d2(){return"["}function Cg(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 m2(){return{enter:{gfmFootnoteCallString:a2,gfmFootnoteCall:r2,gfmFootnoteDefinitionLabelString:u2,gfmFootnoteDefinition:c2},exit:{gfmFootnoteCallString:o2,gfmFootnoteCall:s2,gfmFootnoteDefinitionLabelString:f2,gfmFootnoteDefinition:h2}}}function p2(n){let a=!1;return n&&n.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:Cg},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?wg:g2))),d(),p}}function g2(n,a,r){return a===0?n:wg(n,a,r)}function wg(n,a,r){return(r?"":" ")+n}const y2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mg.peek=k2;function x2(){return{canContainEols:["delete"],enter:{strikethrough:v2},exit:{strikethrough:S2}}}function b2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:y2}],handlers:{delete:Mg}}}function v2(n){this.enter({type:"delete",children:[]},n)}function S2(n){this.exit(n)}function Mg(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 k2(){return"~"}function _2(n){return n.length}function E2(n,a){const r=a||{},u=(r.align||[]).concat(),s=r.stringLength||_2,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()),z2);return s(),f}function z2(n,a,r){return">"+(r?"":" ")+n}function C2(n,a){return jp(n,a.inConstruct,!0)&&!jp(n,a.notInConstruct,!1)}function jp(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 M2(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 N2(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 D2(n,a,r,u){const s=N2(r),h=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(M2(n,r)){const y=r.enter("codeIndented"),S=r.indentLines(h,O2);return y(),S}const m=r.createTracker(u),p=s.repeat(Math.max(w2(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 O2(n,a,r){return(r?"":" ")+n}function Qs(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 j2(n,a,r,u){const s=Qs(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 R2(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 Ja(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Au(n,a,r){const u=Vi(n),s=Vi(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}}Ng.peek=L2;function Ng(n,a,r,u){const s=R2(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=Au(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Ja(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Au(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Ja(y));const k=f.move(s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function L2(n,a,r){return r.options.emphasis||"*"}function B2(n,a){let r=!1;return Gs(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return r=!0,vs}),!!((!n.depth||n.depth<3)&&Rs(n)&&(a.options.setext||r))}function U2(n,a,r,u){const s=Math.max(Math.min(6,n.depth||1),1),h=r.createTracker(u);if(B2(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=Ja(d.charCodeAt(0))+d.slice(1)),d=d?f+" "+d:f,r.options.closeAtx&&(d+=" "+f),p(),m(),d}Dg.peek=H2;function Dg(n){return n.value||""}function H2(){return"<"}Og.peek=q2;function Og(n,a,r,u){const s=Qs(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"!"}jg.peek=Y2;function jg(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 Y2(){return"!"}Rg.peek=G2;function Rg(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))}Bg.peek=V2;function Bg(n,a,r,u){const s=Qs(r),h=s==='"'?"Quote":"Apostrophe",f=r.createTracker(u);let m,p;if(Lg(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 V2(n,a,r){return Lg(n,r)?"<":"["}Ug.peek=Q2;function Ug(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 Q2(){return"["}function Xs(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 X2(n){const a=Xs(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 Z2(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 Hg(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 K2(n,a,r,u){const s=r.enter("list"),h=r.bulletCurrent;let f=n.ordered?Z2(r):Xs(r);const m=n.ordered?f==="."?")":".":X2(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),Hg(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 I2(n,a,r,u){const s=r.enter("paragraph"),h=r.enter("phrasing"),f=r.containerPhrasing(n,u);return h(),s(),f}const $2=Mu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function W2(n,a,r,u){return(n.children.some(function(f){return $2(f)})?r.containerPhrasing:r.containerFlow).call(r,n,u)}function P2(n){const a=n.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}qg.peek=ek;function qg(n,a,r,u){const s=P2(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=Au(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Ja(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Au(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Ja(y));const k=f.move(s+s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function ek(n,a,r){return r.options.strong||"*"}function tk(n,a,r,u){return r.safe(n.value,u)}function nk(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 lk(n,a,r){const u=(Hg(r)+(r.options.ruleSpaces?" ":"")).repeat(nk(r));return r.options.ruleSpaces?u.slice(0,-1):u}const Yg={blockquote:T2,break:Rp,code:D2,definition:j2,emphasis:Ng,hardBreak:Rp,heading:U2,html:Dg,image:Og,imageReference:jg,inlineCode:Rg,link:Bg,linkReference:Ug,list:K2,listItem:J2,paragraph:I2,root:W2,strong:qg,text:tk,thematicBreak:lk};function ik(){return{enter:{table:ak,tableData:Lp,tableHeader:Lp,tableRow:uk},exit:{codeText:ck,table:rk,tableData:fs,tableHeader:fs,tableRow:fs}}}function ak(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 rk(n){this.exit(n),this.data.inTable=void 0}function uk(n){this.enter({type:"tableRow",children:[]},n)}function fs(n){this.exit(n)}function Lp(n){this.enter({type:"tableCell",children:[]},n)}function ck(n){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,ok));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(n)}function ok(n,a){return a==="|"?a:n}function sk(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 E2(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 Ck={tokenize:Lk,partial:!0};function wk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ok,continuation:{tokenize:jk},exit:Rk}},text:{91:{name:"gfmFootnoteCall",tokenize:Dk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mk,resolveTo:Nk}}}}function Mk(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 Nk(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 Dk(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 Ok(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 jk(n,a,r){return n.check($a,a,n.attempt(Ck,a,r))}function Rk(n){n.exit("gfmFootnoteDefinition")}function Lk(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 Bk(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=Vi(C);return Q._open=!O||O===2&&!!U,Q._close=!U||U===2&&!!O,m(C)}}}class Uk{constructor(){this.map=[]}add(a,r,u){Hk(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 Hk(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 Vk(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 Uk;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({},Gi(a.events,s)),n.add(s,0,[["exit",h,a]]),h=void 0),h}function Up(n,a,r,u,s){const h=[],f=Gi(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 Gi(n,a){const r=n[a],u=r[0]==="enter"?"start":"end";return r[1][u]}const Qk={name:"tasklistCheck",tokenize:Zk};function Xk(){return{text:{91:Qk}}}function Zk(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:Kk},a,r)(p):r(p)}}function Kk(n,a,r){return Ue(n,u,"whitespace");function u(s){return s===null?r(s):a(s)}}function Fk(n){return ag([bk(),wk(),Bk(n),Yk(),Xk()])}const Jk={};function Ik(n){const a=this,r=n||Jk,u=a.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),h=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(Fk(r)),h.push(pk()),f.push(gk(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 $k=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ig=(...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 Wk={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 Pk=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,...Wk,width:a,height:a,stroke:n,strokeWidth:u?Number(r)*24/Number(a):r,className:Ig("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(Pk,{ref:h,iconNode:a,className:Ig(`lucide-${$k(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 $g=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 e_=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 Wg=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 t_=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 n_=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 Pg=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 l_=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 i_=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 a_=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 r_=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 Ks=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 ey=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 u_=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 c_=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 o_=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 s_=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 As=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 ty=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 f_=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 h_=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 d_=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"}]]),ny=new URL(".",window.location.href).pathname;async function El(n,a){const r=await fetch(`${ny}${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 Qi=[{role:"assistant",content:"Select a job, then ask about metrics, runtime, logs, or how to start the next AReno task."}],m_="areno-dashboard-agent-chat",ly="areno-dashboard-agent-chat-sessions",Hp="areno-dashboard-agent-active-chat",qp="areno-dashboard-agent-draft";function p_(){try{const n=JSON.parse(localStorage.getItem(m_)||"[]");return Array.isArray(n)&&n.length?n:Qi}catch{return Qi}}function Su(n=Qi,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 g_(){try{const n=JSON.parse(localStorage.getItem(ly)||"[]");if(Array.isArray(n)&&n.length)return n.map(a=>{var r;return{...a,messages:(r=a.messages)!=null&&r.length?a.messages:Qi}})}catch{}return[Su(p_(),"Default chat")]}function y_(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 x_={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:""},b_={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:""},v_=[{value:"newest",label:"Start time (newest)"},{value:"oldest",label:"Start time (oldest)"},{value:"duration_desc",label:"Duration (longest)"},{value:"duration_asc",label:"Duration (shortest)"}],S_=["all","running","succeeded","failed","stopped","exited","unknown"],k_=["all","train","serve"];function Yi(n,a){return new URLSearchParams(window.location.search).get(n)||a}function __(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 xu(n,a){const r=n[a];return typeof r=="number"?r:typeof r=="string"&&Date.parse(r)||0}function E_(){var zl,Cl,wl,Sn,Ml,Pn;const[n,a]=he.useState(null),[r,u]=he.useState(x_),[s,h]=he.useState(b_),[f,m]=he.useState(()=>localStorage.getItem(qp)||""),[p,d]=he.useState(()=>g_()),[x,y]=he.useState(()=>localStorage.getItem(Hp)||""),[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(()=>Number(Yi("page","1"))||1),[ee,Te]=he.useState(()=>Yi("q","")),[ie,W]=he.useState(()=>Yi("state","all")),[M,F]=he.useState(()=>Yi("type","all")),[ae,Ee]=he.useState(()=>Yi("algo","all")),[E,T]=he.useState(()=>Yi("sort","newest")),[Y,_]=he.useState(0),le=he.useRef(null),se=hs(()=>El("/api/env"),5e3),ce=hs(()=>El("/api/jobs"),2e3),ze=hs(()=>n?El(`/api/jobs/${n}`):Promise.resolve(null),3e3,[n]),we=((zl=ce.data)==null?void 0:zl.jobs)||[],Re=10,jt=he.useMemo(()=>["all",...Array.from(new Set(we.map(q=>q.algo).filter(Boolean))).sort()],[we]),yt=he.useMemo(()=>{let $=we;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)=>xu(fe,"created_at")-xu(ve,"created_at")):E==="oldest"?q.sort((ve,fe)=>xu(ve,"created_at")-xu(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},[we,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=ze.data)==null?void 0:Cl.job)||(n?we.find($=>$.id===n):null)||null,In=he.useMemo(()=>p.find($=>$.id===x)||p[0]||Su(),[p,x]),bn=In.messages||Qi;he.useEffect(()=>{n&&we.length&&!we.some($=>$.id===n)&&a(null)},[we.length,n]),he.useEffect(()=>{R>xt&&ne(xt)},[R,xt]),he.useEffect(()=>{__({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(ly,JSON.stringify(p.slice(-40)))},[p]),he.useEffect(()=>{if(!p.length){const $=Su();d([$]),y($.id);return}p.some($=>$.id===x)||y(p[0].id)},[p,x]),he.useEffect(()=>{x&&localStorage.setItem(Hp,x)},[x]),he.useEffect(()=>{localStorage.setItem(qp,f)},[f]),he.useEffect(()=>{const $=le.current;$&&($.scrollTop=$.scrollHeight)},[bn,S]);const $n=[{id:"jobs",label:"Jobs",icon:v.jsx($g,{size:16})},{id:"runtime",label:"Runtime",icon:v.jsx(As,{size:16})},{id:"launcher",label:"Launcher",icon:v.jsx(Ks,{size:16})},{id:"agent",label:"Agent",icon:v.jsx(e_,{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 Ki(){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 Fi(){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:Ce(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||Qi,Tt=typeof $=="function"?$(mt):$;return{...fe,messages:Tt,updatedAt:Date.now(),title:y_(Tt,fe.title)}}))}function P(){const $=Su();d(q=>[$,...q]),y($.id),m(""),k("chat")}function xe($){y($),k("chat")}function Ce($){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(`${ny}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 Pa=Tt.body.getReader(),er=new TextDecoder;let Cn="";for(;;){const{value:Nl,done:tr}=await Pa.read();if(tr)break;Cn+=er.decode(Nl,{stream:!0});const Ji=Cn.split(` +`);Cn=Ji.pop()||"";for(const mn of Ji)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(L_,{env:se.data}),v.jsx(B_,{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(eE,{config:r,setConfig:u,onStart:Ki}):v.jsx(nE,{config:s,setConfig:h,onStart:Fi})]}):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(ey,{size:15})," New Chat"]}),v.jsxs("button",{className:"secondaryButton",onClick:()=>be(!0),children:[v.jsx(ty,{size:15})," Settings"]})]})]}),v.jsxs("div",{className:"agentTabs",children:[v.jsxs("button",{className:Ct(S==="chat"&&"active"),onClick:()=>k("chat"),children:[v.jsx(a_,{size:15})," Chat"]}),v.jsxs("button",{className:Ct(S==="history"&&"active"),onClick:()=>k("history"),children:[v.jsx(l_,{size:15})," History"]})]}),S==="history"?v.jsx(T_,{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(w_,{events:q.events}):v.jsx(Fs,{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(s_,{size:16})," Send"]})]})]}),me&&v.jsx(z_,{title:"Agent Settings",onClose:()=>be(!1),children:v.jsx(A_,{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(t_,{size:16})," Stop"]})]})]}),v.jsx(U_,{job:Le}),v.jsx(C_,{job:Le,refreshNonce:Y}),v.jsx(F_,{samples:(Le==null?void 0:Le.samples)||[]}),v.jsxs("div",{className:"split",children:[v.jsx(I_,{config:Le==null?void 0:Le.config,launch:Le==null?void 0:Le.launch}),v.jsx(P_,{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"})]})]}),we.length>0&&v.jsxs("div",{className:"jobToolbar",children:[v.jsxs("div",{className:"jobSearch",children:[v.jsx(o_,{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:S_.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:k_.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:v_.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(c_,{size:14})," Reset"]})]})]}),v.jsxs("div",{className:"jobList",children:[we.length===0&&v.jsx(zs,{title:"No jobs yet",text:"Start a train or serve task from the launcher."}),yt.length===0&&we.length>0&&v.jsx(zs,{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(As,{size:16}):v.jsx(i_,{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",we.length>yt.length&&` (filtered from ${we.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(h_,{size:16}):v.jsx(r_,{size:16})}),v.jsx("button",{className:"iconButton",onClick:()=>{se.refresh(),ce.refresh(),ze.refresh(),_($=>$+1)},title:"Refresh",children:v.jsx(u_,{size:16})})]})]}),L&&v.jsx("div",{className:"notice",children:L}),vn()]})]})}function A_({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 T_({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(ey,{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 z_({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 C_({job:n,refreshNonce:a}){return v.jsxs("div",{className:"jobMetricsGrid",children:[v.jsx("div",{className:"panel insetPanel",children:v.jsx(V_,{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(Z_,{rows:(n==null?void 0:n.timeperf)||[]})})]})}function w_({events:n}){return v.jsx("div",{className:"agentEventList",children:n.map((a,r)=>a.type==="reasoning"?v.jsx(M_,{text:a.text},r):a.type==="content"?v.jsx(Fs,{text:a.text},r):a.type==="tool_call"?v.jsx(N_,{call:a.call,live:a.live},r):a.type==="tool_result"?v.jsx(j_,{result:a.result},r):null)})}function Fs({text:n}){return v.jsx("div",{className:"markdownBlock",children:v.jsx(BS,{remarkPlugins:[Ik],children:n||""})})}function M_({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(Fs,{text:n})]})}function N_({call:n,live:a=!1}){const u=((n==null?void 0:n.function)||{}).name||(n==null?void 0:n.name)||"tool",s=O_(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:D_(u,s)}),v.jsx("em",{children:a?"running":""})]}),v.jsx("pre",{children:s})]})}function D_(n,a){const r=iy(a);return!r||r==="{}"?`${n}()`:`${n}(${r})`}function O_(n){return(n.function||{}).arguments||n.arguments||JSON.stringify(n,null,2)}function j_({result:n}){const a=R_(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:iy(a)||"No output."})]}),v.jsx("pre",{children:a})]})}function iy(n){return String(n||"").replace(/\s+/g," ").trim()}function R_(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 L_({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(bu,{icon:v.jsx(Pg,{size:15}),label:"AReno",value:((x=r.areno)==null?void 0:x.version)||"unknown"}),v.jsx(bu,{icon:v.jsx(n_,{size:15}),label:"PyTorch",value:s.version||"missing"}),v.jsx(bu,{icon:v.jsx(As,{size:15}),label:"CUDA",value:s.cuda_build||"none"}),v.jsx(bu,{icon:v.jsx(Wg,{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 B_({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(zs,{title:"No GPU detected",text:"nvidia-smi did not return device utilization."})})})}function bu({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 U_({job:n}){const a=ay(n),r=H_(n),u=Math.max(0,a.findIndex(s=>Ts(s,r,n)));return v.jsx("div",{className:"timeline",children:a.map((s,h)=>v.jsxs("div",{className:Ct("timelineItem",h<=u&&"done",Ts(s,r,n)&&"current"),children:[v.jsx("span",{children:h+1}),v.jsx("label",{children:s.label})]},s.id))})}function ay(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=q_(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 H_(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=ay(n).find(s=>Ts(s,a,n));return(u==null?void 0:u.id)||a}function Ts(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 q_(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 Y_(n){return(n||[]).map(a=>a.name).sort()}function G_(n,a){return a&&n.includes(a)?a:n[0]||""}function V_({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=Y_(m),Q=G_(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=Q_(K,h),re=X_(K,Z);return v.jsxs("div",{className:"chart",children:[v.jsxs("div",{className:"chartHeader",children:[v.jsxs("span",{children:[v.jsx($g,{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 Q_(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 X_(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:Yp(u),maxLabel:Yp(s)}}function Yp(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 Z_({rows:n}){const a=K_(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(d_,{size:14})," Runtime timeperf"]})}),v.jsxs("div",{className:"legend",children:[s.map(h=>v.jsxs("span",{children:[v.jsx("i",{className:Gp(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:Gp(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 K_(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 Gp(n){return`seg-${String(n||"other").replace(/[^a-zA-Z0-9]+/g,"-")}`}function F_({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:J_(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(Pg,{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 J_(n,a){return`${n.step??"x"}-${n.prompt_idx??"x"}-${n.sample_idx??"x"}-${a}`}function I_({config:n,launch:a}){const r=n&&Object.keys(n).length?n:a||{},u=$_(r);return v.jsxs("div",{className:"codeCard",children:[v.jsxs("div",{className:"codeTitle",children:[v.jsx(ty,{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:W_(f)})]},h))})]},s.title))}):v.jsx("pre",{children:"No config captured yet."})]})}function $_(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 W_(n){return Array.isArray(n)?n.join(" "):typeof n=="object"?JSON.stringify(n):String(n)}function P_({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(f_,{size:14})," Logs"]}),v.jsx("pre",{children:n.slice(-80).join(` +`)||"No logs yet."})]})}function eE({config:n,setConfig:a,onStart:r}){const u=String(n.algo||"sft").toLowerCase(),s=tE(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(Ks,{size:16})," Start train"]})]})}function tE(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:[ds("algo","Algorithm",["sft","dpo","gspo","grpo","ppo"],!0),pe("ckpt","Checkpoint"),ds("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),ds("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 ds(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 nE({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(Ks,{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 zs({title:n,text:a}){return v.jsxs("div",{className:"empty",children:[v.jsx(Wg,{size:18}),v.jsx("strong",{children:n}),v.jsx("span",{children:a})]})}const Vp=typeof document<"u"?document.getElementById("root"):null;Vp&&T0.createRoot(Vp).render(v.jsx(E_,{})); diff --git a/areno/dashboard/dist/assets/index-CIfovKBG.css b/areno/dashboard/dist/assets/index-CIfovKBG.css deleted file mode 100644 index 125fbd22..00000000 --- a/areno/dashboard/dist/assets/index-CIfovKBG.css +++ /dev/null @@ -1 +0,0 @@ -: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}.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/assets/index-DF61sRZi.js b/areno/dashboard/dist/assets/index-DF61sRZi.js deleted file mode 100644 index f2cf5a86..00000000 --- a/areno/dashboard/dist/assets/index-DF61sRZi.js +++ /dev/null @@ -1,197 +0,0 @@ -(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 Hp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oo={exports:{}},Ma={};/** - * @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 Rm;function p0(){if(Rm)return Ma;Rm=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 Ma.Fragment=a,Ma.jsx=r,Ma.jsxs=r,Ma}var Lm;function g0(){return Lm||(Lm=1,Oo.exports=p0()),Oo.exports}var k=g0(),jo={exports:{}},_e={};/** - * @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 Bm;function y0(){if(Bm)return _e;Bm=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"),v=Symbol.iterator;function S(T){return T===null||typeof T!="object"?null:(T=v&&T[v]||T["@@iterator"],typeof T=="function"?T:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,V={};function O(T,q,_){this.props=T,this.context=q,this.refs=V,this.updater=_||C}O.prototype.isReactComponent={},O.prototype.setState=function(T,q){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,q,"setState")},O.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function K(){}K.prototype=O.prototype;function X(T,q,_){this.props=T,this.context=q,this.refs=V,this.updater=_||C}var ae=X.prototype=new K;ae.constructor=X,U(ae,O.prototype),ae.isPureReactComponent=!0;var ee=Array.isArray;function L(){}var J={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function xe(T,q,_){var te=_.ref;return{$$typeof:n,type:T,key:q,ref:te!==void 0?te:null,props:_}}function R(T,q){return xe(T.type,q,T.props)}function ne(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function le(T){var q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(_){return q[_]})}var Ce=/\/+/g;function ue(T,q){return typeof T=="object"&&T!==null&&T.key!=null?le(""+T.key):q.toString(36)}function $(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(q){T.status==="pending"&&(T.status="fulfilled",T.value=q)},function(q){T.status==="pending"&&(T.status="rejected",T.reason=q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function D(T,q,_,te,fe){var oe=typeof T;(oe==="undefined"||oe==="boolean")&&(T=null);var we=!1;if(T===null)we=!0;else switch(oe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(T.$$typeof){case n:case a:we=!0;break;case x:return we=T._init,D(we(T._payload),q,_,te,fe)}}if(we)return fe=fe(T),we=te===""?"."+ue(T,0):te,ee(fe)?(_="",we!=null&&(_=we.replace(Ce,"$&/")+"/"),D(fe,q,_,"",function(zt){return zt})):fe!=null&&(ne(fe)&&(fe=R(fe,_+(fe.key==null||T&&T.key===fe.key?"":(""+fe.key).replace(Ce,"$&/")+"/")+we)),q.push(fe)),1;we=0;var Ie=te===""?".":te+":";if(ee(T))for(var Ye=0;Ye>>1,E=D[Se];if(0>>1;Ses(_,ie))tes(fe,_)?(D[Se]=fe,D[te]=ie,Se=te):(D[Se]=_,D[q]=ie,Se=q);else if(tes(fe,ie))D[Se]=fe,D[te]=ie,Se=te;else break e}}return F}function s(D,F){var ie=D.sortIndex-F.sortIndex;return ie!==0?ie:D.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,v=3,S=!1,C=!1,U=!1,V=!1,O=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function ae(D){for(var F=r(d);F!==null;){if(F.callback===null)u(d);else if(F.startTime<=D)u(d),F.sortIndex=F.expirationTime,a(p,F);else break;F=r(d)}}function ee(D){if(U=!1,ae(D),!C)if(r(p)!==null)C=!0,L||(L=!0,le());else{var F=r(d);F!==null&&$(ee,F.startTime-D)}}var L=!1,J=-1,he=5,xe=-1;function R(){return V?!0:!(n.unstable_now()-xeD&&R());){var Se=y.callback;if(typeof Se=="function"){y.callback=null,v=y.priorityLevel;var E=Se(y.expirationTime<=D);if(D=n.unstable_now(),typeof E=="function"){y.callback=E,ae(D),F=!0;break t}y===r(p)&&u(p),ae(D)}else u(p);y=r(p)}if(y!==null)F=!0;else{var T=r(d);T!==null&&$(ee,T.startTime-D),F=!1}}break e}finally{y=null,v=ie,S=!1}F=void 0}}finally{F?le():L=!1}}}var le;if(typeof X=="function")le=function(){X(ne)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,ue=Ce.port2;Ce.port1.onmessage=ne,le=function(){ue.postMessage(null)}}else le=function(){O(ne,0)};function $(D,F){J=O(function(){D(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(D){D.callback=null},n.unstable_forceFrameRate=function(D){0>D||125Se?(D.sortIndex=ie,a(d,D),r(p)===null&&D===r(d)&&(U?(K(J),J=-1):U=!0,$(ee,ie-Se))):(D.sortIndex=E,a(p,D),C||S||(C=!0,L||(L=!0,le()))),D},n.unstable_shouldYield=R,n.unstable_wrapCallback=function(D){var F=v;return function(){var ie=v;v=F;try{return D.apply(this,arguments)}finally{v=ie}}}})(Bo)),Bo}var qm;function b0(){return qm||(qm=1,Lo.exports=x0()),Lo.exports}var Uo={exports:{}},St={};/** - * @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 Ym;function v0(){if(Ym)return St;Ym=1;var n=ys();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(),Uo.exports=v0(),Uo.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 Vm;function k0(){if(Vm)return Na;Vm=1;var n=b0(),a=ys(),r=S0();function u(e){var t="https://react.dev/errors/"+e;if(1E||(e.current=Se[E],Se[E]=null,E--)}function _(e,t){E++,Se[E]=e.current,e.current=t}var te=T(null),fe=T(null),oe=T(null),we=T(null);function Ie(e,t){switch(_(oe,t),_(fe,e),_(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?im(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=im(t),e=am(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(te),_(te,e)}function Ye(){q(te),q(fe),q(oe)}function zt(e){e.memoizedState!==null&&_(we,e);var t=te.current,l=am(t,e.type);t!==l&&(_(fe,e),_(te,l))}function Kt(e){fe.current===e&&(q(te),q(fe)),we.current===e&&(q(we),Ta._currentValue=ie)}var Yn,bl;function rn(e){if(Yn===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Yn=t&&t[1]||"",bl=-1)":-1c||A[i]!==N[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{Gn=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?rn(l):""}function Ql(e,t){switch(e.tag){case 26:case 27:case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return e.child!==t&&t!==null?rn("Suspense Fallback"):rn("Suspense");case 19:return rn("SuspenseList");case 0:case 15:return Vn(e.type,!1);case 11:return Vn(e.type.render,!1);case 1:return Vn(e.type,!0);case 31:return rn("Activity");default:return""}}function Qn(e){try{var t="",l=null;do t+=Ql(e,l),l=e,e=e.return;while(e);return t}catch(i){return` -Error generating stack: `+i.message+` -`+i.stack}}var fn=Object.prototype.hasOwnProperty,vn=n.unstable_scheduleCallback,vl=n.unstable_cancelCallback,Li=n.unstable_shouldYield,Bi=n.unstable_requestPaint,mt=n.unstable_now,Ui=n.unstable_getCurrentPriorityLevel,Y=n.unstable_ImmediatePriority,W=n.unstable_UserBlockingPriority,ge=n.unstable_NormalPriority,ze=n.unstable_LowPriority,Be=n.unstable_IdlePriority,vt=n.log,P=n.unstable_setDisableYieldValue,Z=null,ve=null;function de(e){if(typeof vt=="function"&&P(e),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(Z,e)}catch{}}var Ee=Math.clz32?Math.clz32:bu,et=Math.log,Bt=Math.LN2;function bu(e){return e>>>=0,e===0?32:31-(et(e)/Bt|0)|0}var hn=256,Xn=262144,Xl=4194304;function dn(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 Sl(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=dn(i):(g&=b,g!==0?c=dn(g):l||(l=b&~e,l!==0&&(c=dn(l))))):(b=i&~o,b!==0?c=dn(b):g!==0?c=dn(g):l||(l=i&~e,l!==0&&(c=dn(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 Hi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ny(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 Us(){var e=Xl;return Xl<<=1,(Xl&62914560)===0&&(Xl=4194304),e}function vu(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function qi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ly(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,N=e.hiddenUpdates;for(l=g&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var oy=/[\n"\\]/g;function Jt(e){return e.replace(oy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tu(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=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?zu(e,g,Ft(t)):l!=null?zu(e,g,Ft(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=""+Ft(b):e.removeAttribute("name")}function $s(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)){Au(e);return}l=l!=null?""+Ft(l):"",t=t!=null?""+Ft(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),Au(e)}function zu(e,t,l){t==="number"&&Za(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function $l(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"),Du=!1;if(_n)try{var Qi={};Object.defineProperty(Qi,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Qi,Qi),window.removeEventListener("test",Qi,Qi)}catch{Du=!1}var Kn=null,Ou=null,Fa=null;function af(){if(Fa)return Fa;var e,t=Ou,l=t.length,i,c="value"in Kn?Kn.value:Kn.textContent,o=c.length;for(e=0;e=Ki),ff=" ",hf=!1;function df(e,t){switch(e){case"keyup":return By.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ti=!1;function Hy(e,t){switch(e){case"compositionend":return mf(t);case"keypress":return t.which!==32?null:(hf=!0,ff);case"textInput":return e=t.data,e===ff&&hf?null:e;default:return null}}function qy(e,t){if(ti)return e==="compositionend"||!Uu&&df(e,t)?(e=af(),Fa=Ou=Kn=null,ti=!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=kf(l)}}function Ef(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ef(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Af(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Za(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=Za(e.document)}return t}function Yu(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 Fy=_n&&"documentMode"in document&&11>=document.documentMode,ni=null,Gu=null,$i=null,Vu=!1;function Tf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vu||ni==null||ni!==Za(i)||(i=ni,"selectionStart"in i&&Yu(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}),$i&&Ii($i,i)||($i=i,i=Yr(Gu,"onSelect"),0>=g,c-=g,mn=1<<32-Ee(t)+c|l<Te?(je=ce,ce=null):je=ce.sibling;var He=j(w,ce,M[Te],G);if(He===null){ce===null&&(ce=je);break}e&&ce&&He.alternate===null&&t(w,ce),z=o(He,z,Te),Ue===null?se=He:Ue.sibling=He,Ue=He,ce=je}if(Te===M.length)return l(w,ce),Re&&An(w,Te),se;if(ce===null){for(;TeTe?(je=ce,ce=null):je=ce.sibling;var pl=j(w,ce,He.value,G);if(pl===null){ce===null&&(ce=je);break}e&&ce&&pl.alternate===null&&t(w,ce),z=o(pl,z,Te),Ue===null?se=pl:Ue.sibling=pl,Ue=pl,ce=je}if(He.done)return l(w,ce),Re&&An(w,Te),se;if(ce===null){for(;!He.done;Te++,He=M.next())He=Q(w,He.value,G),He!==null&&(z=o(He,z,Te),Ue===null?se=He:Ue.sibling=He,Ue=He);return Re&&An(w,Te),se}for(ce=i(ce);!He.done;Te++,He=M.next())He=B(ce,w,Te,He.value,G),He!==null&&(e&&He.alternate!==null&&ce.delete(He.key===null?Te:He.key),z=o(He,z,Te),Ue===null?se=He:Ue.sibling=He,Ue=He);return e&&ce.forEach(function(m0){return t(w,m0)}),Re&&An(w,Te),se}function Ze(w,z,M,G){if(typeof M=="object"&&M!==null&&M.type===U&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case S:e:{for(var se=M.key;z!==null;){if(z.key===se){if(se=M.type,se===U){if(z.tag===7){l(w,z.sibling),G=c(z,M.props.children),G.return=w,w=G;break e}}else if(z.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===he&&Dl(se)===z.type){l(w,z.sibling),G=c(z,M.props),la(G,M),G.return=w,w=G;break e}l(w,z);break}else t(w,z);z=z.sibling}M.type===U?(G=zl(M.props.children,w.mode,G,M.key),G.return=w,w=G):(G=ir(M.type,M.key,M.props,null,w.mode,G),la(G,M),G.return=w,w=G)}return g(w);case C:e:{for(se=M.key;z!==null;){if(z.key===se)if(z.tag===4&&z.stateNode.containerInfo===M.containerInfo&&z.stateNode.implementation===M.implementation){l(w,z.sibling),G=c(z,M.children||[]),G.return=w,w=G;break e}else{l(w,z);break}else t(w,z);z=z.sibling}G=Iu(M,w.mode,G),G.return=w,w=G}return g(w);case he:return M=Dl(M),Ze(w,z,M,G)}if($(M))return re(w,z,M,G);if(le(M)){if(se=le(M),typeof se!="function")throw Error(u(150));return M=se.call(M),ye(w,z,M,G)}if(typeof M.then=="function")return Ze(w,z,fr(M),G);if(M.$$typeof===X)return Ze(w,z,ur(w,M),G);hr(w,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,z!==null&&z.tag===6?(l(w,z.sibling),G=c(z,M),G.return=w,w=G):(l(w,z),G=Ju(M,w.mode,G),G.return=w,w=G),g(w)):l(w,z)}return function(w,z,M,G){try{na=0;var se=Ze(w,z,M,G);return di=null,se}catch(ce){if(ce===hi||ce===or)throw ce;var Ue=Ht(29,ce,null,w.mode);return Ue.lanes=G,Ue.return=w,Ue}finally{}}}var jl=Jf(!0),If=Jf(!1),Wn=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oc(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 Pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(qe&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=lr(e),Of(e,null,l),t}return nr(e,i,t,l),lr(e)}function ia(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,qs(e,l)}}function sc(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 fc=!1;function aa(){if(fc){var e=fi;if(e!==null)throw e}}function ra(e,t,l,i){fc=!1;var c=e.updateQueue;Wn=!1;var o=c.firstBaseUpdate,g=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var A=b,N=A.next;A.next=null,g===null?o=N:g.next=N,g=A;var H=e.alternate;H!==null&&(H=H.updateQueue,b=H.lastBaseUpdate,b!==g&&(b===null?H.firstBaseUpdate=N:b.next=N,H.lastBaseUpdate=A))}if(o!==null){var Q=c.baseState;g=0,H=N=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===si&&(fc=!0),H!==null&&(H=H.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var re=e,ye=b;j=t;var Ze=l;switch(ye.tag){case 1:if(re=ye.payload,typeof re=="function"){Q=re.call(Ze,Q,j);break e}Q=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=ye.payload,j=typeof re=="function"?re.call(Ze,Q,j):re,j==null)break e;Q=y({},Q,j);break e;case 2:Wn=!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?(N=H=B,A=Q):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=Q),c.baseState=A,c.firstBaseUpdate=N,c.lastBaseUpdate=H,o===null&&(c.shared.lanes=0),al|=g,e.lanes=g,e.memoizedState=Q}}function $f(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Wf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eo?o:8;var g=D.T,b={};D.T=b,Mc(e,!1,t,l);try{var A=c(),N=D.S;if(N!==null&&N(b,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var H=l1(A,i);oa(e,t,H,Qt(e))}else oa(e,t,i,Qt(e))}catch(Q){oa(e,t,{then:function(){},status:"rejected",reason:Q},Qt())}finally{F.p=o,g!==null&&b.types!==null&&(g.types=b.types),D.T=g}}function o1(){}function Cc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var c=Mh(e).queue;wh(e,c,t,ie,l===null?o1:function(){return Nh(e),l(i)})}function Mh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wn,lastRenderedState:ie},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wn,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Nh(e){var t=Mh(e);t.next===null&&(t=e.alternate.memoizedState),oa(e,t.next.queue,{},Qt())}function wc(){return yt(Ta)}function Dh(){return it().memoizedState}function Oh(){return it().memoizedState}function s1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Qt();e=Pn(l);var i=el(t,e,l);i!==null&&(jt(i,t,l),ia(i,t,l)),t={cache:ic()},e.payload=t;return}t=t.return}}function f1(e,t,l){var i=Qt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},kr(e)?Rh(t,l):(l=Ku(e,t,l,i),l!==null&&(jt(l,e,i),Lh(l,t,i)))}function jh(e,t,l){var i=Qt();oa(e,t,l,i)}function oa(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(kr(e))Rh(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,Ut(b,g))return nr(e,t,c,0),Ke===null&&tr(),!1}catch{}finally{}if(l=Ku(e,t,c,i),l!==null)return jt(l,e,i),Lh(l,t,i),!0}return!1}function Mc(e,t,l,i){if(i={lane:2,revertLane:co(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},kr(e)){if(t)throw Error(u(479))}else t=Ku(e,l,i,2),t!==null&&jt(t,e,2)}function kr(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function Rh(e,t){pi=pr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Lh(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,qs(e,l)}}var sa={readContext:yt,use:xr,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};sa.useEffectEvent=tt;var Bh={readContext:yt,use:xr,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:vh,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,vr(4194308,4,Eh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return vr(4194308,4,e,t)},useInsertionEffect:function(e,t){vr(4,2,e,t)},useMemo:function(e,t){var l=At();t=t===void 0?null:t;var i=e();if(Rl){de(!0);try{e()}finally{de(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=At();if(l!==void 0){var c=l(t);if(Rl){de(!0);try{l(t)}finally{de(!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=f1.bind(null,Ae,e),[i.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:function(e){e=_c(e);var t=e.queue,l=jh.bind(null,Ae,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Tc,useDeferredValue:function(e,t){var l=At();return zc(l,e,t)},useTransition:function(){var e=_c(!1);return e=wh.bind(null,Ae,e.queue,!0,!1),At().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ae,c=At();if(Re){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ke===null)throw Error(u(349));(Oe&127)!==0||ih(i,t,l)}c.memoizedState=l;var o={value:l,getSnapshot:t};return c.queue=o,vh(rh.bind(null,i,o,e),[e]),i.flags|=2048,yi(9,{destroy:void 0},ah.bind(null,i,o,l,t),null),l},useId:function(){var e=At(),t=Ke.identifierPrefix;if(Re){var l=pn,i=mn;l=(i&~(1<<32-Ee(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=gr++,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[pt]=t,o[Ct]=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(bt(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&&Nn(t)}}return We(t),Qc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Nn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=oe.current,ci(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,c=gt,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[pt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||nm(e.nodeValue,l)),e||In(t,!0)}else e=Gr(e).createTextNode(i),e[pt]=t,t.stateNode=e}return We(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=ci(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[pt]=t}else Cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else l=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Yt(t),t):(Yt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return We(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ci(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[pt]=t}else Cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),c=!1}else c=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Yt(t),t):(Yt(t),null)}return Yt(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),zr(t,t.updateQueue),We(t),null);case 4:return Ye(),e===null&&ho(t.stateNode.containerInfo),We(t),null;case 10:return zn(t.type),We(t),null;case 19:if(q(lt),i=t.memoizedState,i===null)return We(t),null;if(c=(t.flags&128)!==0,o=i.rendering,o===null)if(c)ha(i,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=mr(e),o!==null){for(t.flags|=128,ha(i,!1),e=o.updateQueue,t.updateQueue=e,zr(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)jf(l,e),l=l.sibling;return _(lt,lt.current&1|2),Re&&An(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&mt()>Dr&&(t.flags|=128,c=!0,ha(i,!1),t.lanes=4194304)}else{if(!c)if(e=mr(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,zr(t,e),ha(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Re)return We(t),null}else 2*mt()-i.renderingStartTime>Dr&&l!==536870912&&(t.flags|=128,c=!0,ha(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=mt(),e.sibling=null,l=lt.current,_(lt,c?l&1|2:l&1),Re&&An(t,i.treeForkCount),e):(We(t),null);case 22:case 23:return Yt(t),dc(),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&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),l=t.updateQueue,l!==null&&zr(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&&q(Nl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),zn(at),We(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function g1(e,t){switch(Wu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zn(at),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Kt(t),null;case 31:if(t.memoizedState!==null){if(Yt(t),t.alternate===null)throw Error(u(340));Cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Yt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(lt),null;case 4:return Ye(),null;case 10:return zn(t.type),null;case 22:case 23:return Yt(t),dc(),e!==null&&q(Nl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zn(at),null;case 25:return null;default:return null}}function ud(e,t){switch(Wu(t),t.tag){case 3:zn(at),Ye();break;case 26:case 27:case 5:Kt(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Yt(t);break;case 13:Yt(t);break;case 19:q(lt);break;case 10:zn(t.type);break;case 22:case 23:Yt(t),dc(),e!==null&&q(Nl);break;case 24:zn(at)}}function da(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){Ve(t,t.return,b)}}function ll(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,N=b;try{N()}catch(H){Ve(c,A,H)}}}i=i.next}while(i!==o)}}catch(H){Ve(t,t.return,H)}}function cd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Wf(t,l)}catch(i){Ve(e,e.return,i)}}}function od(e,t,l){l.props=Ll(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Ve(e,t,i)}}function ma(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){Ve(e,t,c)}}function gn(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(c){Ve(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){Ve(e,t,c)}else l.current=null}function sd(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){Ve(e,e.return,c)}}function Xc(e,t,l){try{var i=e.stateNode;U1(i,e.type,l,t),i[Ct]=t}catch(c){Ve(e,e.return,c)}}function fd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sl(e.type)||e.tag===4}function Zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fd(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&&sl(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 Kc(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=kn));else if(i!==4&&(i===27&&sl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,l),e=e.sibling;e!==null;)Kc(e,t,l),e=e.sibling}function Cr(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&&sl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Cr(e,t,l),e=e.sibling;e!==null;)Cr(e,t,l),e=e.sibling}function hd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);bt(t,i,l),t[pt]=e,t[Ct]=l}catch(o){Ve(e,e.return,o)}}var Dn=!1,ct=!1,Fc=!1,dd=typeof WeakSet=="function"?WeakSet:Set,dt=null;function y1(e,t){if(e=e.containerInfo,go=Jr,e=Af(e),Yu(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,N=0,H=0,Q=e,j=null;t:for(;;){for(var B;Q!==l||c!==0&&Q.nodeType!==3||(b=g+c),Q!==o||i!==0&&Q.nodeType!==3||(A=g+i),Q.nodeType===3&&(g+=Q.nodeValue.length),(B=Q.firstChild)!==null;)j=Q,Q=B;for(;;){if(Q===e)break t;if(j===l&&++N===c&&(b=g),j===o&&++H===i&&(A=g),(B=Q.nextSibling)!==null)break;Q=j,j=Q.parentNode}Q=B}l=b===-1||A===-1?null:{start:b,end:A}}else l=null}l=l||{start:0,end:0}}else l=null;for(yo={focusedElem:e,selectionRange:l},Jr=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){switch(t=dt,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"))),bt(o,i,l),o[pt]=e,ht(o),i=o;break e;case"link":var g=bm("link","href",c).get(i+(l.href||""));if(g){for(var b=0;bZe&&(g=Ze,Ze=ye,ye=g);var w=_f(b,ye),z=_f(b,Ze);if(w&&z&&(B.rangeCount!==1||B.anchorNode!==w.node||B.anchorOffset!==w.offset||B.focusNode!==z.node||B.focusOffset!==z.offset)){var M=Q.createRange();M.setStart(w.node,w.offset),B.removeAllRanges(),ye>Ze?(B.addRange(M),B.extend(z.node,z.offset)):(M.setEnd(z.node,z.offset),B.addRange(M))}}}}for(Q=[],B=b;B=B.parentNode;)B.nodeType===1&&Q.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;bl?32:l,D.T=null,l=to,to=null;var o=ul,g=Bn;if(st=0,ki=ul=null,Bn=0,(qe&6)!==0)throw Error(u(331));var b=qe;if(qe|=4,Ed(o.current),Sd(o,o.current,g,l),qe=b,va(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(Z,o)}catch{}return!0}finally{F.p=c,D.T=i,Gd(e,t)}}function Qd(e,t,l){t=$t(l,t),t=jc(e.stateNode,t,2),e=el(e,t,2),e!==null&&(qi(e,2),yn(e))}function Ve(e,t,l){if(e.tag===3)Qd(e,e,l);else for(;t!==null;){if(t.tag===3){Qd(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(rl===null||!rl.has(i))){e=$t(l,e),l=Xh(2),i=el(t,l,2),i!==null&&(Zh(l,i,t,e),qi(i,2),yn(i));break}}t=t.return}}function ao(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new v1;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)||($c=!0,c.add(l),e=A1.bind(null,e,t,l),t.then(e,e))}function A1(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ke===e&&(Oe&l)===l&&(nt===4||nt===3&&(Oe&62914560)===Oe&&300>mt()-Nr?(qe&2)===0&&_i(e,0):Wc|=l,Si===Oe&&(Si=0)),yn(e)}function Xd(e,t){t===0&&(t=Us()),e=Tl(e,t),e!==null&&(qi(e,t),yn(e))}function T1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Xd(e,l)}function z1(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),Xd(e,l)}function C1(e,t){return vn(e,t)}var Ur=null,Ai=null,ro=!1,Hr=!1,uo=!1,ol=0;function yn(e){e!==Ai&&e.next===null&&(Ai===null?Ur=Ai=e:Ai=Ai.next=e),Hr=!0,ro||(ro=!0,M1())}function va(e,t){if(!uo&&Hr){uo=!0;do for(var l=!1,i=Ur;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-Ee(42|e)+1)-1,o&=c&~(g&~b),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(l=!0,Jd(i,o))}else o=Oe,o=Sl(i,i===Ke?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(o&3)===0||Hi(i,o)||(l=!0,Jd(i,o));i=i.next}while(l);uo=!1}}function w1(){Zd()}function Zd(){Hr=ro=!1;var e=0;ol!==0&&q1()&&(e=ol);for(var t=mt(),l=null,i=Ur;i!==null;){var c=i.next,o=Kd(i,t);o===0?(i.next=null,l===null?Ur=c:l.next=c,c===null&&(Ai=l)):(l=i,(e!==0||(o&3)!==0)&&(Hr=!0)),i=c}st!==0&&st!==5||va(e),ol!==0&&(ol=0)}function Kd(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,o=e.pendingLanes&-62914561;0b)break;var H=A.transferSize,Q=A.initiatorType;H&&lm(Q)&&(A=A.responseEnd,g+=H*(A"u"?null:document;function pm(e,t,l){var i=Ti;if(i&&typeof t=="string"&&t){var c=Jt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),mm.has(c)||(mm.add(c),e={rel:e,crossOrigin:l,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),bt(t,"link",e),ht(t),i.head.appendChild(t)))}}function J1(e){Un.D(e),pm("dns-prefetch",e,null)}function I1(e,t){Un.C(e,t),pm("preconnect",e,t)}function $1(e,t,l){Un.L(e,t,l);var i=Ti;if(i&&e&&t){var c='link[rel="preload"][as="'+Jt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+Jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+Jt(l.imageSizes)+'"]')):c+='[href="'+Jt(e)+'"]';var o=c;switch(t){case"style":o=zi(e);break;case"script":o=Ci(e)}ln.has(o)||(e=y({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),ln.set(o,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(Ea(o))||t==="script"&&i.querySelector(Aa(o))||(t=i.createElement("link"),bt(t,"link",e),ht(t),i.head.appendChild(t)))}}function W1(e,t){Un.m(e,t);var l=Ti;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Jt(i)+'"][href="'+Jt(e)+'"]',o=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ci(e)}if(!ln.has(o)&&(e=y({rel:"modulepreload",href:e},t),ln.set(o,e),l.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Aa(o)))return}i=l.createElement("link"),bt(i,"link",e),ht(i),l.head.appendChild(i)}}}function P1(e,t,l){Un.S(e,t,l);var i=Ti;if(i&&e){var c=Jl(i).hoistableStyles,o=zi(e);t=t||"default";var g=c.get(o);if(!g){var b={loading:0,preload:null};if(g=i.querySelector(Ea(o)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},l),(l=ln.get(o))&&Eo(e,l);var A=g=i.createElement("link");ht(A),bt(A,"link",e),A._p=new Promise(function(N,H){A.onload=N,A.onerror=H}),A.addEventListener("load",function(){b.loading|=1}),A.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Qr(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:b},c.set(o,g)}}}function e0(e,t){Un.X(e,t);var l=Ti;if(l&&e){var i=Jl(l).hoistableScripts,c=Ci(e),o=i.get(c);o||(o=l.querySelector(Aa(c)),o||(e=y({src:e,async:!0},t),(t=ln.get(c))&&Ao(e,t),o=l.createElement("script"),ht(o),bt(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function t0(e,t){Un.M(e,t);var l=Ti;if(l&&e){var i=Jl(l).hoistableScripts,c=Ci(e),o=i.get(c);o||(o=l.querySelector(Aa(c)),o||(e=y({src:e,async:!0,type:"module"},t),(t=ln.get(c))&&Ao(e,t),o=l.createElement("script"),ht(o),bt(o,"link",e),l.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(c,o))}}function gm(e,t,l,i){var c=(c=oe.current)?Vr(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=zi(l.href),l=Jl(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=zi(l.href);var o=Jl(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(Ea(e)))&&!o._p&&(g.instance=o,g.state.loading=5),ln.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},ln.set(e,l),o||n0(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=Ci(l),l=Jl(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 zi(e){return'href="'+Jt(e)+'"'}function Ea(e){return'link[rel="stylesheet"]['+e+"]"}function ym(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function n0(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}),bt(t,"link",l),ht(t),e.head.appendChild(t))}function Ci(e){return'[src="'+Jt(e)+'"]'}function Aa(e){return"script[async]"+e}function xm(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Jt(l.href)+'"]');if(i)return t.instance=i,ht(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"),ht(i),bt(i,"style",c),Qr(i,l.precedence,e),t.instance=i;case"stylesheet":c=zi(l.href);var o=e.querySelector(Ea(c));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;i=ym(l),(c=ln.get(c))&&Eo(i,c),o=(e.ownerDocument||e).createElement("link"),ht(o);var g=o;return g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),bt(o,"link",i),t.state.loading|=4,Qr(o,l.precedence,e),t.instance=o;case"script":return o=Ci(l.src),(c=e.querySelector(Aa(o)))?(t.instance=c,ht(c),c):(i=l,(c=ln.get(o))&&(i=y({},l),Ao(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),ht(c),bt(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,Qr(i,l.precedence,e));return t.instance}function Qr(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 l0(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 Sm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function i0(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=zi(i.href),o=t.querySelector(Ea(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Zr.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,ht(o);return}o=t.ownerDocument||t,i=ym(i),(c=ln.get(c))&&Eo(i,c),o=o.createElement("link"),ht(o);var g=o;g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),bt(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=Zr.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var To=0;function a0(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0To?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function Zr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Kr=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kr=new Map,t.forEach(r0,e),Kr=null,Zr.call(e))}function r0(e,t){if(!(t.state.loading&4)){var l=Kr.get(e);if(l)var i=l.get(null);else{l=new Map,Kr.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(),Ro.exports=k0(),Ro.exports}var E0=_0();function A0(n,a){const r={};return(n[n.length-1]===""?[...n,""]:n).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const T0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C0={};function Xm(n,a){return(C0.jsx?z0:T0).test(n)}const w0=/[ \t\n\f\r]/g;function M0(n){return typeof n=="object"?n.type==="text"?Zm(n.value):!1:Zm(n)}function Zm(n){return n.replace(w0,"")===""}class Ya{constructor(a,r,u){this.normal=r,this.property=a,u&&(this.space=u)}}Ya.prototype.normal={};Ya.prototype.property={};Ya.prototype.space=void 0;function qp(n,a){const r={},u={};for(const s of n)Object.assign(r,s.property),Object.assign(u,s.normal);return new Ya(r,u,a)}function is(n){return n.toLowerCase()}class Lt{constructor(a,r){this.attribute=r,this.property=a}}Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;let N0=0;const ke=Vl(),ot=Vl(),as=Vl(),I=Vl(),Fe=Vl(),Yl=Vl(),Xt=Vl();function Vl(){return 2**++N0}const rs=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:ot,commaOrSpaceSeparated:Xt,commaSeparated:Yl,number:I,overloadedBoolean:as,spaceSeparated:Fe},Symbol.toStringTag,{value:"Module"})),Ho=Object.keys(rs);class xs extends Lt{constructor(a,r,u,s){let h=-1;if(super(a,r),Km(this,"space",s),typeof u=="number")for(;++h4&&r.slice(0,4)==="data"&&L0.test(a)){if(a.charAt(4)==="-"){const h=a.slice(5).replace(Fm,H0);u="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=a.slice(4);if(!Fm.test(h)){let f=h.replace(R0,U0);f.charAt(0)!=="-"&&(f="-"+f),a="data"+f}}s=xs}return new s(u,a)}function U0(n){return"-"+n.toLowerCase()}function H0(n){return n.charAt(1).toUpperCase()}const q0=qp([Yp,D0,Qp,Xp,Zp],"html"),bs=qp([Yp,O0,Qp,Xp,Zp],"svg");function Y0(n){return n.join(" ").trim()}var Mi={},qo,Jm;function G0(){if(Jm)return qo;Jm=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="",v="comment",S="declaration";function C(V,O){if(typeof V!="string")throw new TypeError("First argument must be a string");if(!V)return[];O=O||{};var K=1,X=1;function ae(ue){var $=ue.match(a);$&&(K+=$.length);var D=ue.lastIndexOf(p);X=~D?ue.length-D:X+ue.length}function ee(){var ue={line:K,column:X};return function($){return $.position=new L(ue),xe(),$}}function L(ue){this.start=ue,this.end={line:K,column:X},this.source=O.source}L.prototype.content=V;function J(ue){var $=new Error(O.source+":"+K+":"+X+": "+ue);if($.reason=ue,$.filename=O.source,$.line=K,$.column=X,$.source=V,!O.silent)throw $}function he(ue){var $=ue.exec(V);if($){var D=$[0];return ae(D),V=V.slice(D.length),$}}function xe(){he(r)}function R(ue){var $;for(ue=ue||[];$=ne();)$!==!1&&ue.push($);return ue}function ne(){var ue=ee();if(!(d!=V.charAt(0)||x!=V.charAt(1))){for(var $=2;y!=V.charAt($)&&(x!=V.charAt($)||d!=V.charAt($+1));)++$;if($+=2,y===V.charAt($-1))return J("End of comment missing");var D=V.slice(2,$-2);return X+=2,ae(D),V=V.slice($),X+=2,ue({type:v,comment:D})}}function le(){var ue=ee(),$=he(u);if($){if(ne(),!he(s))return J("property missing ':'");var D=he(h),F=ue({type:S,property:U($[0].replace(n,y)),value:D?U(D[0].replace(n,y)):y});return he(f),F}}function Ce(){var ue=[];R(ue);for(var $;$=le();)$!==!1&&(ue.push($),R(ue));return ue}return xe(),Ce()}function U(V){return V?V.replace(m,y):y}return qo=C,qo}var Im;function V0(){if(Im)return Mi;Im=1;var n=Mi&&Mi.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.default=r;const a=n(G0());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 Mi}var Da={},$m;function Q0(){if($m)return Da;$m=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.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 Da.camelCase=p,Da}var Oa,Wm;function X0(){if(Wm)return Oa;Wm=1;var n=Oa&&Oa.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=n(V0()),r=Q0();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,Oa=u,Oa}var Z0=X0();const K0=Hp(Z0),Kp=Fp("end"),vs=Fp("start");function Fp(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 F0(n){const a=vs(n),r=Kp(n);if(a&&r)return{start:a,end:r}}function La(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Pm(n.position):"start"in n||"end"in n?Pm(n):"line"in n||"column"in n?us(n):""}function us(n){return ep(n&&n.line)+":"+ep(n&&n.column)}function Pm(n){return us(n&&n.start)+"-"+us(n&&n.end)}function ep(n){return n&&typeof n=="number"?n:1}class Et 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=La(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}}Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0;const Ss={}.hasOwnProperty,J0=new Map,I0=/[A-Z]/g,$0=new Set(["table","tbody","thead","tfoot","tr"]),W0=new Set(["td","th"]),Jp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function P0(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=ux(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=rx(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"?bs:q0,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},h=Ip(s,n,void 0);return h&&typeof h!="string"?h:s.create(n,s.Fragment,{children:h||void 0},void 0)}function Ip(n,a,r){if(a.type==="element")return ex(n,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return tx(n,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return lx(n,a,r);if(a.type==="mdxjsEsm")return nx(n,a);if(a.type==="root")return ix(n,a,r);if(a.type==="text")return ax(n,a)}function ex(n,a,r){const u=n.schema;let s=u;a.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=bs,n.schema=s),n.ancestors.push(a);const h=Wp(n,a.tagName,!1),f=cx(n,a);let m=_s(n,a);return $0.has(a.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!M0(p):!0})),$p(n,f,h,a),ks(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function tx(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)}Ha(n,a.position)}function nx(n,a){if(a.data&&a.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(a.data.estree);Ha(n,a.position)}function lx(n,a,r){const u=n.schema;let s=u;a.name==="svg"&&u.space==="html"&&(s=bs,n.schema=s),n.ancestors.push(a);const h=a.name===null?n.Fragment:Wp(n,a.name,!0),f=ox(n,a),m=_s(n,a);return $p(n,f,h,a),ks(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function ix(n,a,r){const u={};return ks(u,_s(n,a)),n.create(a,n.Fragment,u,r)}function ax(n,a){return a.value}function $p(n,a,r,u){typeof r!="string"&&r!==n.Fragment&&n.passNode&&(a.node=u)}function ks(n,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(n.children=r)}}function rx(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 ux(n,a){return r;function r(u,s,h,f){const m=Array.isArray(h.children),p=vs(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 cx(n,a){const r={};let u,s;for(s in a.properties)if(s!=="children"&&Ss.call(a.properties,s)){const h=sx(n,s,a.properties[s]);if(h){const[f,m]=h;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&W0.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 ox(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 Ha(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 Ha(n,a.position);else h=u.value===null?!0:u.value;r[s]=h}return r}function _s(n,a){const r=[];let u=-1;const s=n.passKeys?new Map:J0;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?(Zt(n,n.length,0,a),n):a}const lp={}.hasOwnProperty;function eg(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 sn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tt=xl(/[A-Za-z]/),_t=xl(/[\dA-Za-z]/),bx=xl(/[#-'*+\--9=?A-Z^-~]/);function ou(n){return n!==null&&(n<32||n===127)}const cs=xl(/\d/),vx=xl(/[\dA-Fa-f]/),Sx=xl(/[!-/:-@[-`{-~]/);function pe(n){return n!==null&&n<-2}function Je(n){return n!==null&&(n<0||n===32)}function De(n){return n===-2||n===-1||n===32}const mu=xl(new RegExp("\\p{P}|\\p{S}","u")),Gl=xl(/\s/);function xl(n){return a;function a(r){return r!==null&&r>-1&&n.test(String.fromCharCode(r))}}function Ri(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 Le(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 he=J,xe,R;for(;he--;)if(a.events[he][0]==="exit"&&a.events[he][1].type==="chunkFlow"){if(xe){R=a.events[he][1].end;break}xe=!0}for(O(u),L=J;LX;){const ee=r[ae];a.containerState=ee[1],ee[0].exit.call(a,n)}r.length=X}function K(){s.write([null]),h=void 0,s=void 0,a.containerState._closeFlow=void 0}}function Tx(n,a,r){return Le(n,n.attempt(this.parser.constructs.document,a,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Di(n){if(n===null||Je(n)||Gl(n))return 1;if(mu(n))return 2}function pu(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},v={...n[r][1].start};ap(y,-p),ap(v,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:v},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=an(d,[["enter",n[u][1],a],["exit",n[u][1],a]])),d=an(d,[["enter",s,a],["enter",f,a],["exit",f,a],["enter",h,a]]),d=an(d,pu(a.parser.constructs.insideSpan.null,n.slice(u+1,r),a)),d=an(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=an(d,[["enter",n[r][1],a],["exit",n[r][1],a]])):x=0,Zt(n,u-1,r-u+3,d),r=u+d.length-x-2;break}}for(r=-1;++r0&&De(L)?Le(n,K,"linePrefix",h+1)(L):K(L)}function K(L){return L===null||pe(L)?n.check(rp,U,ae)(L):(n.enter("codeFlowValue"),X(L))}function X(L){return L===null||pe(L)?(n.exit("codeFlowValue"),K(L)):(n.consume(L),X)}function ae(L){return n.exit("codeFenced"),a(L)}function ee(L,J,he){let xe=0;return R;function R($){return L.enter("lineEnding"),L.consume($),L.exit("lineEnding"),ne}function ne($){return L.enter("codeFencedFence"),De($)?Le(L,le,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):le($)}function le($){return $===m?(L.enter("codeFencedFenceSequence"),Ce($)):he($)}function Ce($){return $===m?(xe++,L.consume($),Ce):xe>=f?(L.exit("codeFencedFenceSequence"),De($)?Le(L,ue,"whitespace")($):ue($)):he($)}function ue($){return $===null||pe($)?(L.exit("codeFencedFence"),J($)):he($)}}}function Ux(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 Go={name:"codeIndented",tokenize:qx},Hx={partial:!0,tokenize:Yx};function qx(n,a,r){const u=this;return s;function s(d){return n.enter("codeIndented"),Le(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):pe(d)?n.attempt(Hx,f,p)(d):(n.enter("codeFlowValue"),m(d))}function m(d){return d===null||pe(d)?(n.exit("codeFlowValue"),f(d)):(n.consume(d),m)}function p(d){return n.exit("codeIndented"),a(d)}}function Yx(n,a,r){const u=this;return s;function s(f){return u.parser.lazy[u.now().line]?r(f):pe(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),s):Le(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):pe(f)?s(f):r(f)}}const Gx={name:"codeText",previous:Qx,resolve:Vx,tokenize:Xx};function Vx(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&&ja(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),ja(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),ja(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 rg(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),v):O===null||O===32||O===41||ou(O)?r(O):(n.enter(u),n.enter(f),n.enter(m),n.enter("chunkString",{contentType:"string"}),U(O))}function v(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"}),S(O))}function S(O){return O===62?(n.exit("chunkString"),n.exit(m),v(O)):O===null||O===60||pe(O)?r(O):(n.consume(O),O===92?C:S)}function C(O){return O===60||O===62||O===92?(n.consume(O),S):S(O)}function U(O){return!x&&(O===null||O===41||Je(O))?(n.exit("chunkString"),n.exit(m),n.exit(f),n.exit(u),a(O)):x999||S===null||S===91||S===93&&!p||S===94&&!m&&"_hiddenFootnoteSupport"in f.parser.constructs?r(S):S===93?(n.exit(h),n.enter(s),n.consume(S),n.exit(s),n.exit(u),a):pe(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),x):(n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===null||S===91||S===93||pe(S)||m++>999?(n.exit("chunkString"),x(S)):(n.consume(S),p||(p=!De(S)),S===92?v:y)}function v(S){return S===91||S===92||S===93?(n.consume(S),m++,y):y(S)}}function cg(n,a,r,u,s,h){let f;return m;function m(v){return v===34||v===39||v===40?(n.enter(u),n.enter(s),n.consume(v),n.exit(s),f=v===40?41:v,p):r(v)}function p(v){return v===f?(n.enter(s),n.consume(v),n.exit(s),n.exit(u),a):(n.enter(h),d(v))}function d(v){return v===f?(n.exit(h),p(f)):v===null?r(v):pe(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),Le(n,d,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),x(v))}function x(v){return v===f||v===null||pe(v)?(n.exit("chunkString"),d(v)):(n.consume(v),v===92?y:x)}function y(v){return v===f||v===92?(n.consume(v),x):x(v)}}function Ba(n,a){let r;return u;function u(s){return pe(s)?(n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),r=!0,u):De(s)?Le(n,u,r?"linePrefix":"lineSuffix")(s):a(s)}}const Px={name:"definition",tokenize:tb},eb={partial:!0,tokenize:nb};function tb(n,a,r){const u=this;let s;return h;function h(S){return n.enter("definition"),f(S)}function f(S){return ug.call(u,n,m,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function m(S){return s=sn(u.sliceSerialize(u.events[u.events.length-1][1]).slice(1,-1)),S===58?(n.enter("definitionMarker"),n.consume(S),n.exit("definitionMarker"),p):r(S)}function p(S){return Je(S)?Ba(n,d)(S):d(S)}function d(S){return rg(n,x,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function x(S){return n.attempt(eb,y,y)(S)}function y(S){return De(S)?Le(n,v,"whitespace")(S):v(S)}function v(S){return S===null||pe(S)?(n.exit("definition"),u.parser.defined.push(s),a(S)):r(S)}}function nb(n,a,r){return u;function u(m){return Je(m)?Ba(n,s)(m):r(m)}function s(m){return cg(n,h,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(m)}function h(m){return De(m)?Le(n,f,"whitespace")(m):f(m)}function f(m){return m===null||pe(m)?a(m):r(m)}}const lb={name:"hardBreakEscape",tokenize:ib};function ib(n,a,r){return u;function u(h){return n.enter("hardBreakEscape"),n.consume(h),s}function s(h){return pe(h)?(n.exit("hardBreakEscape"),a(h)):r(h)}}const ab={name:"headingAtx",resolve:rb,tokenize:ub};function rb(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"},Zt(n,u,r-u+1,[["enter",s,a],["enter",h,a],["exit",h,a],["exit",s,a]])),n}function ub(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||Je(x)?(n.exit("atxHeadingSequence"),m(x)):r(x)}function m(x){return x===35?(n.enter("atxHeadingSequence"),p(x)):x===null||pe(x)?(n.exit("atxHeading"),a(x)):De(x)?Le(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||Je(x)?(n.exit("atxHeadingText"),m(x)):(n.consume(x),d)}}const cb=["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"],cp=["pre","script","style","textarea"],ob={concrete:!0,name:"htmlFlow",resolveTo:hb,tokenize:db},sb={partial:!0,tokenize:pb},fb={partial:!0,tokenize:mb};function hb(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 db(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(_),v):_===47?(n.consume(_),h=!0,U):_===63?(n.consume(_),s=3,u.interrupt?a:E):Tt(_)?(n.consume(_),f=String.fromCharCode(_),V):r(_)}function v(_){return _===45?(n.consume(_),s=2,S):_===91?(n.consume(_),s=5,m=0,C):Tt(_)?(n.consume(_),s=4,u.interrupt?a:E):r(_)}function S(_){return _===45?(n.consume(_),u.interrupt?a:E):r(_)}function C(_){const te="CDATA[";return _===te.charCodeAt(m++)?(n.consume(_),m===te.length?u.interrupt?a:le:C):r(_)}function U(_){return Tt(_)?(n.consume(_),f=String.fromCharCode(_),V):r(_)}function V(_){if(_===null||_===47||_===62||Je(_)){const te=_===47,fe=f.toLowerCase();return!te&&!h&&cp.includes(fe)?(s=1,u.interrupt?a(_):le(_)):cb.includes(f.toLowerCase())?(s=6,te?(n.consume(_),O):u.interrupt?a(_):le(_)):(s=7,u.interrupt&&!u.parser.lazy[u.now().line]?r(_):h?K(_):X(_))}return _===45||_t(_)?(n.consume(_),f+=String.fromCharCode(_),V):r(_)}function O(_){return _===62?(n.consume(_),u.interrupt?a:le):r(_)}function K(_){return De(_)?(n.consume(_),K):R(_)}function X(_){return _===47?(n.consume(_),R):_===58||_===95||Tt(_)?(n.consume(_),ae):De(_)?(n.consume(_),X):R(_)}function ae(_){return _===45||_===46||_===58||_===95||_t(_)?(n.consume(_),ae):ee(_)}function ee(_){return _===61?(n.consume(_),L):De(_)?(n.consume(_),ee):X(_)}function L(_){return _===null||_===60||_===61||_===62||_===96?r(_):_===34||_===39?(n.consume(_),p=_,J):De(_)?(n.consume(_),L):he(_)}function J(_){return _===p?(n.consume(_),p=null,xe):_===null||pe(_)?r(_):(n.consume(_),J)}function he(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||Je(_)?ee(_):(n.consume(_),he)}function xe(_){return _===47||_===62||De(_)?X(_):r(_)}function R(_){return _===62?(n.consume(_),ne):r(_)}function ne(_){return _===null||pe(_)?le(_):De(_)?(n.consume(_),ne):r(_)}function le(_){return _===45&&s===2?(n.consume(_),D):_===60&&s===1?(n.consume(_),F):_===62&&s===4?(n.consume(_),T):_===63&&s===3?(n.consume(_),E):_===93&&s===5?(n.consume(_),Se):pe(_)&&(s===6||s===7)?(n.exit("htmlFlowData"),n.check(sb,q,Ce)(_)):_===null||pe(_)?(n.exit("htmlFlowData"),Ce(_)):(n.consume(_),le)}function Ce(_){return n.check(fb,ue,q)(_)}function ue(_){return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),$}function $(_){return _===null||pe(_)?Ce(_):(n.enter("htmlFlowData"),le(_))}function D(_){return _===45?(n.consume(_),E):le(_)}function F(_){return _===47?(n.consume(_),f="",ie):le(_)}function ie(_){if(_===62){const te=f.toLowerCase();return cp.includes(te)?(n.consume(_),T):le(_)}return Tt(_)&&f.length<8?(n.consume(_),f+=String.fromCharCode(_),ie):le(_)}function Se(_){return _===93?(n.consume(_),E):le(_)}function E(_){return _===62?(n.consume(_),T):_===45&&s===2?(n.consume(_),E):le(_)}function T(_){return _===null||pe(_)?(n.exit("htmlFlowData"),q(_)):(n.consume(_),T)}function q(_){return n.exit("htmlFlow"),a(_)}}function mb(n,a,r){const u=this;return s;function s(f){return pe(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 pb(n,a,r){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt(Ga,a,r)}}const gb={name:"htmlText",tokenize:yb};function yb(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),ee):E===63?(n.consume(E),X):Tt(E)?(n.consume(E),he):r(E)}function d(E){return E===45?(n.consume(E),x):E===91?(n.consume(E),h=0,C):Tt(E)?(n.consume(E),K):r(E)}function x(E){return E===45?(n.consume(E),S):r(E)}function y(E){return E===null?r(E):E===45?(n.consume(E),v):pe(E)?(f=y,F(E)):(n.consume(E),y)}function v(E){return E===45?(n.consume(E),S):y(E)}function S(E){return E===62?D(E):E===45?v(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),V):pe(E)?(f=U,F(E)):(n.consume(E),U)}function V(E){return E===93?(n.consume(E),O):U(E)}function O(E){return E===62?D(E):E===93?(n.consume(E),O):U(E)}function K(E){return E===null||E===62?D(E):pe(E)?(f=K,F(E)):(n.consume(E),K)}function X(E){return E===null?r(E):E===63?(n.consume(E),ae):pe(E)?(f=X,F(E)):(n.consume(E),X)}function ae(E){return E===62?D(E):X(E)}function ee(E){return Tt(E)?(n.consume(E),L):r(E)}function L(E){return E===45||_t(E)?(n.consume(E),L):J(E)}function J(E){return pe(E)?(f=J,F(E)):De(E)?(n.consume(E),J):D(E)}function he(E){return E===45||_t(E)?(n.consume(E),he):E===47||E===62||Je(E)?xe(E):r(E)}function xe(E){return E===47?(n.consume(E),D):E===58||E===95||Tt(E)?(n.consume(E),R):pe(E)?(f=xe,F(E)):De(E)?(n.consume(E),xe):D(E)}function R(E){return E===45||E===46||E===58||E===95||_t(E)?(n.consume(E),R):ne(E)}function ne(E){return E===61?(n.consume(E),le):pe(E)?(f=ne,F(E)):De(E)?(n.consume(E),ne):xe(E)}function le(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(n.consume(E),s=E,Ce):pe(E)?(f=le,F(E)):De(E)?(n.consume(E),le):(n.consume(E),ue)}function Ce(E){return E===s?(n.consume(E),s=void 0,$):E===null?r(E):pe(E)?(f=Ce,F(E)):(n.consume(E),Ce)}function ue(E){return E===null||E===34||E===39||E===60||E===61||E===96?r(E):E===47||E===62||Je(E)?xe(E):(n.consume(E),ue)}function $(E){return E===47||E===62||Je(E)?xe(E):r(E)}function D(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"),ie}function ie(E){return De(E)?Le(n,Se,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):Se(E)}function Se(E){return n.enter("htmlTextData"),f(E)}}const Ts={name:"labelEnd",resolveAll:Sb,resolveTo:kb,tokenize:_b},xb={tokenize:Eb},bb={tokenize:Ab},vb={tokenize:Tb};function Sb(n){let a=-1;const r=[];for(;++a=3&&(d===null||pe(d))?(n.exit("thematicBreak"),a(d)):r(d)}function p(d){return d===s?(n.consume(d),u++,p):(n.exit("thematicBreakSequence"),De(d)?Le(n,m,"whitespace")(d):m(d))}}const Rt={continuation:{tokenize:Lb},exit:Ub,name:"list",tokenize:Rb},Ob={partial:!0,tokenize:Hb},jb={partial:!0,tokenize:Bb};function Rb(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(S){const C=u.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!u.containerState.marker||S===u.containerState.marker:cs(S)){if(u.containerState.type||(u.containerState.type=C,n.enter(C,{_container:!0})),C==="listUnordered")return n.enter("listItemPrefix"),S===42||S===45?n.check(uu,r,d)(S):d(S);if(!u.interrupt||S===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(S)}return r(S)}function p(S){return cs(S)&&++f<10?(n.consume(S),p):(!u.interrupt||f<2)&&(u.containerState.marker?S===u.containerState.marker:S===41||S===46)?(n.exit("listItemValue"),d(S)):r(S)}function d(S){return n.enter("listItemMarker"),n.consume(S),n.exit("listItemMarker"),u.containerState.marker=u.containerState.marker||S,n.check(Ga,u.interrupt?r:x,n.attempt(Ob,v,y))}function x(S){return u.containerState.initialBlankLine=!0,h++,v(S)}function y(S){return De(S)?(n.enter("listItemPrefixWhitespace"),n.consume(S),n.exit("listItemPrefixWhitespace"),v):r(S)}function v(S){return u.containerState.size=h+u.sliceSerialize(n.exit("listItemPrefix"),!0).length,a(S)}}function Lb(n,a,r){const u=this;return u.containerState._closeFlow=void 0,n.check(Ga,s,h);function s(m){return u.containerState.furtherBlankLines=u.containerState.furtherBlankLines||u.containerState.initialBlankLine,Le(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(jb,a,f)(m))}function f(m){return u.containerState._closeFlow=!0,u.interrupt=void 0,Le(n,n.attempt(Rt,a,r),"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m)}}function Bb(n,a,r){const u=this;return Le(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 Ub(n){n.exit(this.containerState.type)}function Hb(n,a,r){const u=this;return Le(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 op={name:"setextUnderline",resolveTo:qb,tokenize:Yb};function qb(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 Yb(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)?Le(n,p,"lineSuffix")(d):p(d))}function p(d){return d===null||pe(d)?(n.exit("setextHeadingLine"),a(d)):r(d)}}const Gb={tokenize:Vb};function Vb(n){const a=this,r=n.attempt(Ga,u,n.attempt(this.parser.constructs.flowInitial,s,Le(n,n.attempt(this.parser.constructs.flow,s,n.attempt(Fx,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 Qb={resolveAll:sg()},Xb=og("string"),Zb=og("text");function og(n){return{resolveAll:sg(n==="text"?Kb: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 v=-1;if(y)for(;++v-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 rv(n,a){let r=-1;const u=[];let s;for(;++r0){const vt=ge.tokenStack[ge.tokenStack.length-1];(vt[1]||fp).call(ge,void 0,vt[0])}for(W.position={start:gl(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:gl(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be0&&(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 vv(n,a){const r={type:"element",tagName:"del",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function Sv(n,a){const r={type:"element",tagName:"em",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function kv(n,a){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(a.identifier).toUpperCase(),s=Ri(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 _v(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 Ev(n,a){if(n.options.allowDangerousHtml){const r={type:"raw",value:a.value};return n.patch(a,r),n.applyData(a,r)}}function dg(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 Av(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return dg(n,a);const s={src:Ri(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 Tv(n,a){const r={src:Ri(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 zv(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 Cv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return dg(n,a);const s={href:Ri(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 wv(n,a){const r={href:Ri(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 Mv(n,a,r){const u=n.all(a),s=r?Nv(r):mg(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 Dv(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=vs(a.children[1]),p=Kp(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 Bv(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(mp(a.slice(s),s>0,!1)),h.join("")}function mp(n,a,r){let u=0,s=n.length;if(a){let h=n.codePointAt(u);for(;h===hp||h===dp;)u++,h=n.codePointAt(u)}if(r){let h=n.codePointAt(s-1);for(;h===hp||h===dp;)s--,h=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function qv(n,a){const r={type:"text",value:Hv(String(a.value))};return n.patch(a,r),n.applyData(a,r)}function Yv(n,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(a,r),n.applyData(a,r)}const Gv={blockquote:yv,break:xv,code:bv,delete:vv,emphasis:Sv,footnoteReference:kv,heading:_v,html:Ev,imageReference:Av,image:Tv,inlineCode:zv,linkReference:Cv,link:wv,listItem:Mv,list:Dv,paragraph:Ov,root:jv,strong:Rv,table:Lv,tableCell:Uv,tableRow:Bv,text:qv,thematicBreak:Yv,toml:nu,yaml:nu,definition:nu,footnoteDefinition:nu};function nu(){}const pg=-1,gu=0,Ua=1,su=2,zs=3,Cs=4,ws=5,Ms=6,gg=7,yg=8,xg=typeof self=="object"?self:globalThis,pp=(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 xg[n](a)},Vv=(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 gu:case pg:return r(f,s);case Ua:{const m=r([],s);for(const p of f)m.push(u(p));return m}case su:{const m=r({},s);for(const[p,d]of f)m[u(p)]=u(d);return m}case zs:return r(new Date(f),s);case Cs:{const{source:m,flags:p}=f;return r(new RegExp(m,p),s)}case ws:{const m=r(new Map,s);for(const[p,d]of f)m.set(u(p),u(d));return m}case Ms:{const m=r(new Set,s);for(const p of f)m.add(u(p));return m}case gg:{const{name:m,message:p}=f;return r(typeof xg[m]=="function"?pp(m,p):new Error(p),s)}case yg: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(pp(h,f),s)};return u},gp=n=>Vv(new Map,n)(0),ql="",{toString:Qv}={},{keys:Xv}=Object,Ra=n=>{const a=typeof n;if(a!=="object"||!n)return[gu,a];const r=Qv.call(n).slice(8,-1);switch(r){case"Array":return[Ua,ql];case"Object":return[su,ql];case"Date":return[zs,ql];case"RegExp":return[Cs,ql];case"Map":return[ws,ql];case"Set":return[Ms,ql];case"DataView":return[Ua,r]}return r.includes("Array")?[Ua,r]:n instanceof Error?[gg,n.name||"Error"]:[su,r]},lu=([n,a])=>n===gu&&(a==="function"||a==="symbol"),Zv=(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]=Ra(f);switch(m){case gu:{let x=f;switch(p){case"bigint":m=yg,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);x=null;break;case"undefined":return s([pg],f)}return s([m,x],f)}case Ua:{if(p){let v=f;return p==="DataView"?v=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(f)),s([p,[...v]],f)}const x=[],y=s([m,x],f);for(const v of f)x.push(h(v));return y}case su:{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 v of Xv(f))(n||!lu(Ra(f[v])))&&x.push([h(v),h(f[v])]);return y}case zs:return s([m,isNaN(f.getTime())?ql:f.toISOString()],f);case Cs:{const{source:x,flags:y}=f;return s([m,{source:x,flags:y}],f)}case ws:{const x=[],y=s([m,x],f);for(const[v,S]of f)(n||!(lu(Ra(v))||lu(Ra(S))))&&x.push([h(v),h(S)]);return y}case Ms:{const x=[],y=s([m,x],f);for(const v of f)(n||!lu(Ra(v)))&&x.push(h(v));return y}}const{message:d}=f;return s([m,{name:p,message:d}],f)};return h},yp=(n,{json:a,lossy:r}={})=>{const u=[];return Zv(!(a||r),!!a,new Map,u)(n),u},fu=typeof structuredClone=="function"?(n,a)=>a&&("json"in a||"lossy"in a)?gp(yp(n,a)):structuredClone(n):(n,a)=>gp(yp(n,a));function Kv(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 Fv(n,a){return"Back to reference "+(n+1)+(a>1?"-"+a:"")}function Jv(n){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=n.options.footnoteBackContent||Kv,u=n.options.footnoteBackLabel||Fv,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,S);typeof K=="string"&&(K={type:"text",value:K}),C.push({type:"element",tagName:"a",properties:{href:"#"+a+"fnref-"+v+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof u=="string"?u:u(p,S),className:["data-footnote-backref"]},children:Array.isArray(K)?K:[K]})}const V=x[x.length-1];if(V&&V.type==="element"&&V.tagName==="p"){const K=V.children[V.children.length-1];K&&K.type==="text"?K.value+=" ":V.children.push({type:"text",value:" "}),V.children.push(...C)}else x.push(...C);const O={type:"element",tagName:"li",properties:{id:a+"fn-"+v},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:{...fu(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 yu=(function(n){if(n==null)return Pv;if(typeof n=="function")return xu(n);if(typeof n=="object")return Array.isArray(n)?Iv(n):$v(n);if(typeof n=="string")return Wv(n);throw new Error("Expected function, string, or object as test")});function Iv(n){const a=[];let r=-1;for(;++r":""))+")"})}return v;function v(){let S=bg,C,U,V;if((!a||h(p,d,x[x.length-1]||void 0))&&(S=lS(r(p,x)),S[0]===ss))return S;if("children"in p&&p.children){const O=p;if(O.children&&S[0]!==nS)for(U=(u?O.children.length:-1)+f,V=x.concat(O);U>-1&&U0&&r.push({type:"text",value:` -`}),r}function xp(n){let a=0,r=n.charCodeAt(a);for(;r===9||r===32;)a++,r=n.charCodeAt(a);return n.slice(a)}function bp(n,a){const r=aS(n,a),u=r.one(n,void 0),s=Jv(r),h=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&h.children.push({type:"text",value:` -`},s),h}function sS(n,a){return n&&"run"in n?async function(r,u){const s=bp(r,{file:u,...a});await n.run(s,u)}:function(r,u){return bp(r,{file:u,...n||a})}}function vp(n){if(n)throw n}var Qo,Sp;function fS(){if(Sp)return Qo;Sp=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 v;for(v in d);return typeof v>"u"||n.call(d,v)},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 Qo=function p(){var d,x,y,v,S,C,U=arguments[0],V=1,O=arguments.length,K=!1;for(typeof U=="boolean"&&(K=U,U=arguments[1]||{},V=2),(U==null||typeof U!="object"&&typeof U!="function")&&(U={});Vf.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 xn={basename:pS,dirname:gS,extname:yS,join:xS,sep:"/"};function pS(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');Va(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 gS(n){if(Va(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 yS(n){Va(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 xS(...n){let a=-1,r;for(;++a0&&n.codePointAt(n.length-1)===47&&(r+="/"),a?"/"+r:r}function vS(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 Va(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const SS={cwd:kS};function kS(){return"/"}function ds(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function _S(n){if(typeof n=="string")n=new URL(n);else if(!ds(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 ES(n)}function ES(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[S,...C]=x;const U=u[v][1];hs(U)&&hs(S)&&(S=Xo(!0,U,S)),u[v]=[d,S,...C]}}}}const CS=new Ds().freeze();function Jo(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Io(n,a){if(typeof a!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function $o(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 _p(n){if(!hs(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Ep(n,a,r){if(!r)throw new Error("`"+n+"` finished async. Use `"+a+"` instead")}function iu(n){return wS(n)?n:new Sg(n)}function wS(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function MS(n){return typeof n=="string"||NS(n)}function NS(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const DS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ap=[],Tp={allowDangerousHtml:!0},OS=/^(https?|ircs?|mailto|xmpp)$/i,jS=[{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 RS(n){const a=LS(n),r=BS(n);return US(a.runSync(a.parse(r),r),n)}function LS(n){const a=n.rehypePlugins||Ap,r=n.remarkPlugins||Ap,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Tp}:Tp;return CS().use(gv).use(r).use(sS,u).use(a)}function BS(n){const a=n.children||"",r=new Sg;return typeof a=="string"&&(r.value=a),r}function US(n,a){const r=a.allowedElements,u=a.allowElement,s=a.components,h=a.disallowedElements,f=a.skipHtml,m=a.unwrapDisallowed,p=a.urlTransform||HS;for(const x of jS)Object.hasOwn(a,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+DS+x.id,void 0);return Ns(n,d),P0(n,{Fragment:k.Fragment,components:s,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function d(x,y,v){if(x.type==="raw"&&v&&typeof y=="number")return f?v.children.splice(y,1):v.children[y]={type:"text",value:x.value},y;if(x.type==="element"){let S;for(S in Yo)if(Object.hasOwn(Yo,S)&&Object.hasOwn(x.properties,S)){const C=x.properties[S],U=Yo[S];(U===null||U.includes(x.tagName))&&(x.properties[S]=p(String(C||""),S,x))}}if(x.type==="element"){let S=r?!r.includes(x.tagName):h?h.includes(x.tagName):!1;if(!S&&u&&typeof y=="number"&&(S=!u(x,y,v)),S&&v&&typeof y=="number")return m&&x.children?v.children.splice(y,1,...x.children):v.children.splice(y,1),y}}}function HS(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||OS.test(n.slice(0,a))?n:""}function zp(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 qS(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function YS(n,a,r){const s=yu((r||{}).ignore||[]),h=GS(a);let f=-1;for(;++f0?{type:"text",value:L}:void 0),L===!1?v.lastIndex=ae+1:(C!==ae&&K.push({type:"text",value:d.value.slice(C,ae)}),Array.isArray(L)?K.push(...L):L&&K.push(L),C=ae+X[0].length,O=!0),!v.global)break;X=v.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=zp(n,"(");let h=zp(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 kg(n,a){const r=n.input.charCodeAt(n.index-1);return(n.index===0||Gl(r)||mu(r))&&(!a||r!==47)}_g.peek=f2;function l2(){this.buffer()}function i2(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function a2(){this.buffer()}function r2(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function u2(n){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=sn(this.sliceSerialize(n)).toLowerCase(),r.label=a}function c2(n){this.exit(n)}function o2(n){const a=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=sn(this.sliceSerialize(n)).toLowerCase(),r.label=a}function s2(n){this.exit(n)}function f2(){return"["}function _g(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 h2(){return{enter:{gfmFootnoteCallString:l2,gfmFootnoteCall:i2,gfmFootnoteDefinitionLabelString:a2,gfmFootnoteDefinition:r2},exit:{gfmFootnoteCallString:u2,gfmFootnoteCall:c2,gfmFootnoteDefinitionLabelString:o2,gfmFootnoteDefinition:s2}}}function d2(n){let a=!1;return n&&n.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:_g},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?Eg:m2))),d(),p}}function m2(n,a,r){return a===0?n:Eg(n,a,r)}function Eg(n,a,r){return(r?"":" ")+n}const p2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ag.peek=v2;function g2(){return{canContainEols:["delete"],enter:{strikethrough:x2},exit:{strikethrough:b2}}}function y2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p2}],handlers:{delete:Ag}}}function x2(n){this.enter({type:"delete",children:[]},n)}function b2(n){this.exit(n)}function Ag(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 v2(){return"~"}function S2(n){return n.length}function k2(n,a){const r=a||{},u=(r.align||[]).concat(),s=r.stringLength||S2,h=[],f=[],m=[],p=[];let d=0,x=-1;for(;++xd&&(d=n[x].length);++Op[O])&&(p[O]=X)}U.push(K)}f[x]=U,m[x]=V}let y=-1;if(typeof u=="object"&&"length"in u)for(;++yp[y]&&(p[y]=K),S[y]=K),v[y]=X}f.splice(1,0,v),m.splice(1,0,S),x=-1;const C=[];for(;++x "),h.shift(2);const f=r.indentLines(r.containerFlow(n,h.current()),A2);return s(),f}function A2(n,a,r){return">"+(r?"":" ")+n}function T2(n,a){return wp(n,a.inConstruct,!0)&&!wp(n,a.notInConstruct,!1)}function wp(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 C2(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 w2(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 M2(n,a,r,u){const s=w2(r),h=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(C2(n,r)){const y=r.enter("codeIndented"),v=r.indentLines(h,N2);return y(),v}const m=r.createTracker(u),p=s.repeat(Math.max(z2(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 N2(n,a,r){return(r?"":" ")+n}function Os(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 D2(n,a,r,u){const s=Os(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 O2(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 qa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function hu(n,a,r){const u=Di(n),s=Di(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}}Tg.peek=j2;function Tg(n,a,r,u){const s=O2(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=hu(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=qa(d)+p.slice(1));const y=p.charCodeAt(p.length-1),v=hu(u.after.charCodeAt(0),y,s);v.inside&&(p=p.slice(0,-1)+qa(y));const S=f.move(s);return h(),r.attentionEncodeSurroundingInfo={after:v.outside,before:x.outside},m+p+S}function j2(n,a,r){return r.options.emphasis||"*"}function R2(n,a){let r=!1;return Ns(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)&&Es(n)&&(a.options.setext||r))}function L2(n,a,r,u){const s=Math.max(Math.min(6,n.depth||1),1),h=r.createTracker(u);if(R2(n,r)){const x=r.enter("headingSetext"),y=r.enter("phrasing"),v=r.containerPhrasing(n,{...h.current(),before:` -`,after:` -`});return y(),x(),v+` -`+(s===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.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=qa(d.charCodeAt(0))+d.slice(1)),d=d?f+" "+d:f,r.options.closeAtx&&(d+=" "+f),p(),m(),d}zg.peek=B2;function zg(n){return n.value||""}function B2(){return"<"}Cg.peek=U2;function Cg(n,a,r,u){const s=Os(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 U2(){return"!"}wg.peek=H2;function wg(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 H2(){return"!"}Mg.peek=q2;function Mg(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))}Dg.peek=Y2;function Dg(n,a,r,u){const s=Os(r),h=s==='"'?"Quote":"Apostrophe",f=r.createTracker(u);let m,p;if(Ng(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 Y2(n,a,r){return Ng(n,r)?"<":"["}Og.peek=G2;function Og(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 G2(){return"["}function js(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 V2(n){const a=js(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 Q2(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 jg(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 X2(n,a,r,u){const s=r.enter("list"),h=r.bulletCurrent;let f=n.ordered?Q2(r):js(r);const m=n.ordered?f==="."?")":".":V2(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),jg(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,v,S){return v?(S?"":" ".repeat(f))+y:(S?h:h+" ".repeat(f-h.length))+y}}function F2(n,a,r,u){const s=r.enter("paragraph"),h=r.enter("phrasing"),f=r.containerPhrasing(n,u);return h(),s(),f}const J2=yu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function I2(n,a,r,u){return(n.children.some(function(f){return J2(f)})?r.containerPhrasing:r.containerFlow).call(r,n,u)}function $2(n){const a=n.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}Rg.peek=W2;function Rg(n,a,r,u){const s=$2(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=hu(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=qa(d)+p.slice(1));const y=p.charCodeAt(p.length-1),v=hu(u.after.charCodeAt(0),y,s);v.inside&&(p=p.slice(0,-1)+qa(y));const S=f.move(s+s);return h(),r.attentionEncodeSurroundingInfo={after:v.outside,before:x.outside},m+p+S}function W2(n,a,r){return r.options.strong||"*"}function P2(n,a,r,u){return r.safe(n.value,u)}function ek(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 tk(n,a,r){const u=(jg(r)+(r.options.ruleSpaces?" ":"")).repeat(ek(r));return r.options.ruleSpaces?u.slice(0,-1):u}const Lg={blockquote:E2,break:Mp,code:M2,definition:D2,emphasis:Tg,hardBreak:Mp,heading:L2,html:zg,image:Cg,imageReference:wg,inlineCode:Mg,link:Dg,linkReference:Og,list:X2,listItem:K2,paragraph:F2,root:I2,strong:Rg,text:P2,thematicBreak:tk};function nk(){return{enter:{table:lk,tableData:Np,tableHeader:Np,tableRow:ak},exit:{codeText:rk,table:ik,tableData:ts,tableHeader:ts,tableRow:ts}}}function lk(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 ik(n){this.exit(n),this.data.inTable=void 0}function ak(n){this.enter({type:"tableRow",children:[]},n)}function ts(n){this.exit(n)}function Np(n){this.enter({type:"tableCell",children:[]},n)}function rk(n){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,uk));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(n)}function uk(n,a){return a==="|"?a:n}function ck(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:v,table:f,tableCell:p,tableRow:m}};function f(S,C,U,V){return d(x(S,U,V),S.align)}function m(S,C,U,V){const O=y(S,U,V),K=d([O]);return K.slice(0,K.indexOf(` -`))}function p(S,C,U,V){const O=U.enter("tableCell"),K=U.enter("phrasing"),X=U.containerPhrasing(S,{...V,before:h,after:h});return K(),O(),X}function d(S,C){return k2(S,{align:C,alignDelimiters:u,padding:r,stringLength:s})}function x(S,C,U){const V=S.children;let O=-1;const K=[],X=C.enter("table");for(;++O0&&!r&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const Tk={tokenize:jk,partial:!0};function zk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nk,continuation:{tokenize:Dk},exit:Ok}},text:{91:{name:"gfmFootnoteCall",tokenize:Mk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ck,resolveTo:wk}}}}function Ck(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=sn(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 wk(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 Mk(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||Je(y))return r(y);if(y===93){n.exit("chunkString");const v=n.exit("gfmFootnoteCallString");return s.includes(sn(u.sliceSerialize(v)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(y),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),a):r(y)}return Je(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 Nk(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||Je(C))return r(C);if(C===93){n.exit("chunkString");const U=n.exit("gfmFootnoteDefinitionLabelString");return h=sn(u.sliceSerialize(U)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(C),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),v}return Je(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 v(C){return C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),s.includes(h)||s.push(h),Le(n,S,"gfmFootnoteDefinitionWhitespace")):r(C)}function S(C){return a(C)}}function Dk(n,a,r){return n.check(Ga,a,n.attempt(Tk,a,r))}function Ok(n){n.exit("gfmFootnoteDefinition")}function jk(n,a,r){const u=this;return Le(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 Rk(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++,S);if(y<2&&!r)return p(C);const V=f.exit("strikethroughSequenceTemporary"),O=Di(C);return V._open=!O||O===2&&!!U,V._close=!U||U===2&&!!O,m(C)}}}class Lk{constructor(){this.map=[]}add(a,r,u){Bk(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 Bk(n,a,r,u){let s=0;if(!(r===0&&u.length===0)){for(;s-1;){const ue=u.events[ne][1].type;if(ue==="lineEnding"||ue==="linePrefix")ne--;else break}const le=ne>-1?u.events[ne][1].type:null,Ce=le==="tableHead"||le==="tableRow"?L:p;return Ce===L&&u.parser.lazy[u.now().line]?r(R):Ce(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):pe(R)?h>1?(h=0,u.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),S):r(R):De(R)?Le(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||Je(R)?(n.exit("data"),x(R)):(n.consume(R),R===92?v:y)}function v(R){return R===92||R===124?(n.consume(R),y):y(R)}function S(R){return u.interrupt=!1,u.parser.lazy[u.now().line]?r(R):(n.enter("tableDelimiterRow"),f=!1,De(R)?Le(n,C,"linePrefix",u.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):C(R))}function C(R){return R===45||R===58?V(R):R===124?(f=!0,n.enter("tableCellDivider"),n.consume(R),n.exit("tableCellDivider"),U):ee(R)}function U(R){return De(R)?Le(n,V,"whitespace")(R):V(R)}function V(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||pe(R)?ae(R):ee(R)}function O(R){return R===45?(n.enter("tableDelimiterFiller"),K(R)):ee(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"),X):(n.exit("tableDelimiterFiller"),X(R))}function X(R){return De(R)?Le(n,ae,"whitespace")(R):ae(R)}function ae(R){return R===124?C(R):R===null||pe(R)?!f||s!==h?ee(R):(n.exit("tableDelimiterRow"),n.exit("tableHead"),a(R)):ee(R)}function ee(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||pe(R)?(n.exit("tableRow"),a(R)):De(R)?Le(n,J,"whitespace")(R):(n.enter("data"),he(R))}function he(R){return R===null||R===124||Je(R)?(n.exit("data"),J(R)):(n.consume(R),R===92?xe:he)}function xe(R){return R===92||R===124?(n.consume(R),he):he(R)}}function Yk(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 v=new Lk;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({},Ni(a.events,s)),n.add(s,0,[["exit",h,a]]),h=void 0),h}function Op(n,a,r,u,s){const h=[],f=Ni(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 Ni(n,a){const r=n[a],u=r[0]==="enter"?"start":"end";return r[1][u]}const Gk={name:"tasklistCheck",tokenize:Qk};function Vk(){return{text:{91:Gk}}}function Qk(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 Je(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 pe(p)?a(p):De(p)?n.check({tokenize:Xk},a,r)(p):r(p)}}function Xk(n,a,r){return Le(n,u,"whitespace");function u(s){return s===null?r(s):a(s)}}function Zk(n){return eg([yk(),zk(),Rk(n),Hk(),Vk()])}const Kk={};function Fk(n){const a=this,r=n||Kk,u=a.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),h=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(Zk(r)),h.push(dk()),f.push(mk(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 Jk=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xg=(...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 Ik={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 $k=be.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:u,className:s="",children:h,iconNode:f,...m},p)=>be.createElement("svg",{ref:p,...Ik,width:a,height:a,stroke:n,strokeWidth:u?Number(r)*24/Number(a):r,className:Xg("lucide",s),...m},[...f.map(([d,x])=>be.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 ft=(n,a)=>{const r=be.forwardRef(({className:u,...s},h)=>be.createElement($k,{ref:h,iconNode:a,className:Xg(`lucide-${Jk(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 Zg=ft("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 Wk=ft("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 Kg=ft("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 Pk=ft("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 e_=ft("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 Fg=ft("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 t_=ft("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 n_=ft("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 l_=ft("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 i_=ft("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 Ls=ft("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 Jg=ft("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 a_=ft("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 r_=ft("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 ps=ft("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 Ig=ft("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 u_=ft("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 c_=ft("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 o_=ft("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"}]]),$g=new URL(".",window.location.href).pathname;async function yl(n,a){const r=await fetch(`${$g}${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 kt(...n){return n.filter(Boolean).join(" ")}function ns(n,a=2500,r=[]){const[u,s]=be.useState(null),h=async()=>{try{const f=await n();s(f)}catch{}};return be.useEffect(()=>{h();const f=setInterval(h,a);return()=>clearInterval(f)},r),{data:u,refresh:h}}const Oi=[{role:"assistant",content:"Select a job, then ask about metrics, runtime, logs, or how to start the next AReno task."}],s_="areno-dashboard-agent-chat",Wg="areno-dashboard-agent-chat-sessions",jp="areno-dashboard-agent-active-chat",Rp="areno-dashboard-agent-draft";function f_(){try{const n=JSON.parse(localStorage.getItem(s_)||"[]");return Array.isArray(n)&&n.length?n:Oi}catch{return Oi}}function cu(n=Oi,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 h_(){try{const n=JSON.parse(localStorage.getItem(Wg)||"[]");if(Array.isArray(n)&&n.length)return n.map(a=>{var r;return{...a,messages:(r=a.messages)!=null&&r.length?a.messages:Oi}})}catch{}return[cu(f_(),"Default chat")]}function d_(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 m_={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:""},p_={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:""};function g_(){var Y,W,ge,ze,Be,vt;const[n,a]=be.useState(null),[r,u]=be.useState(m_),[s,h]=be.useState(p_),[f,m]=be.useState(()=>localStorage.getItem(Rp)||""),[p,d]=be.useState(()=>h_()),[x,y]=be.useState(()=>localStorage.getItem(jp)||""),[v,S]=be.useState("chat"),[C,U]=be.useState(()=>{try{return JSON.parse(localStorage.getItem("areno-dashboard-agent-provider")||"{}")}catch{return{}}}),[V,O]=be.useState("jobs"),[K,X]=be.useState("train"),[ae,ee]=be.useState(()=>localStorage.getItem("areno-dashboard-theme")||"dark"),[L,J]=be.useState(""),[he,xe]=be.useState(!1),[R,ne]=be.useState(1),[le,Ce]=be.useState(0),ue=be.useRef(null),$=ns(()=>yl("/api/env"),5e3),D=ns(()=>yl("/api/jobs"),2e3),F=ns(()=>n?yl(`/api/jobs/${n}`):Promise.resolve(null),3e3,[n]),ie=((Y=D.data)==null?void 0:Y.jobs)||[],Se=10,E=Math.max(1,Math.ceil(ie.length/Se)),T=Math.min(R,E),q=ie.slice((T-1)*Se,T*Se),_=((W=F.data)==null?void 0:W.job)||(n?ie.find(P=>P.id===n):null)||null,te=be.useMemo(()=>p.find(P=>P.id===x)||p[0]||cu(),[p,x]),fe=te.messages||Oi;be.useEffect(()=>{n&&ie.length&&!ie.some(P=>P.id===n)&&a(null)},[ie.length,n]),be.useEffect(()=>{R>E&&ne(E)},[R,E]),be.useEffect(()=>{document.documentElement.dataset.theme=ae,localStorage.setItem("areno-dashboard-theme",ae)},[ae]),be.useEffect(()=>{localStorage.setItem("areno-dashboard-agent-provider",JSON.stringify(C))},[C]),be.useEffect(()=>{localStorage.setItem(Wg,JSON.stringify(p.slice(-40)))},[p]),be.useEffect(()=>{if(!p.length){const P=cu();d([P]),y(P.id);return}p.some(P=>P.id===x)||y(p[0].id)},[p,x]),be.useEffect(()=>{x&&localStorage.setItem(jp,x)},[x]),be.useEffect(()=>{localStorage.setItem(Rp,f)},[f]),be.useEffect(()=>{const P=ue.current;P&&(P.scrollTop=P.scrollHeight)},[fe,v]);const oe=[{id:"jobs",label:"Jobs",icon:k.jsx(Zg,{size:16})},{id:"runtime",label:"Runtime",icon:k.jsx(ps,{size:16})},{id:"launcher",label:"Launcher",icon:k.jsx(Ls,{size:16})},{id:"agent",label:"Agent",icon:k.jsx(Wk,{size:16})}],we={jobs:_?[_.name,`${_.kind} · ${_.status} · step ${_.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 Ie(){J("Starting train job...");try{const P=await yl("/api/jobs/train",{method:"POST",body:JSON.stringify(r)});a(P.job.id),await D.refresh()}finally{J("")}}async function Ye(){J("Starting serve job...");try{const P=await yl("/api/jobs/serve",{method:"POST",body:JSON.stringify(s)});a(P.job.id),await D.refresh()}finally{J("")}}async function zt(P){J("Stopping job...");try{await yl(`/api/jobs/${P}/stop`,{method:"POST",body:"{}"}),await D.refresh()}finally{J("")}}async function Kt(){const P=f.trim();if(!P)return;m("");const Z=`assistant-${Date.now()}`;Yn(ve=>[...ve,{role:"user",content:P},{id:Z,role:"assistant",content:"",events:[],streaming:!0}]),J("Agent analyzing...");try{await Ql({prompt:P,job_id:(_==null?void 0:_.id)||null,provider:C,history:Gn(fe),onEvent:ve=>Qn(Z,ve)})}catch(ve){Qn(Z,{type:"error",content:`Agent request failed: ${ve.message||ve}`})}finally{Qn(Z,{type:"done"}),J("")}}function Yn(P){const Z=te.id;d(ve=>ve.map(de=>{if(de.id!==Z)return de;const Ee=de.messages||Oi,et=typeof P=="function"?P(Ee):P;return{...de,messages:et,updatedAt:Date.now(),title:d_(et,de.title)}}))}function bl(){const P=cu();d(Z=>[P,...Z]),y(P.id),m(""),S("chat")}function rn(P){y(P),S("chat")}function Gn(P){return P.filter(Z=>(Z.role==="user"||Z.role==="assistant")&&!Z.streaming).map(Z=>({role:Z.role,content:Vn(Z)})).filter(Z=>Z.content).slice(-10)}function Vn(P){return P.content?P.content:(P.events||[]).filter(Z=>Z.type==="content"||Z.type==="reasoning").map(Z=>Z.text||"").join(` -`).trim()}async function Ql({prompt:P,job_id:Z,provider:ve,history:de,onEvent:Ee}){const et=await fetch(`${$g}api/agent/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:P,job_id:Z,provider:ve,history:de})});if(!et.ok||!et.body){const Xn=await et.text();throw new Error(Xn||et.statusText)}const Bt=et.body.getReader(),bu=new TextDecoder;let hn="";for(;;){const{value:Xn,done:Xl}=await Bt.read();if(Xl)break;hn+=bu.decode(Xn,{stream:!0});const dn=hn.split(` -`);hn=dn.pop()||"";for(const Sl of dn)Sl.trim()&&Ee(JSON.parse(Sl))}hn.trim()&&Ee(JSON.parse(hn))}function Qn(P,Z){Yn(ve=>ve.map(de=>de.id!==P?de:Z.type==="content_delta"?fn(de,"content",Z.content||""):Z.type==="reasoning_delta"?fn(de,"reasoning",Z.content||""):Z.type==="tool_calls"?Li(de,Z.tool_calls||[]):Z.type==="tool_call_delta"?vn(de,Z.tool_call,!0):Z.type==="tool_result"?{...de,events:[...de.events||[],{type:"tool_result",result:Z.tool_result}]}:Z.type==="error"?{...fn(de,"content",Z.content||""),streaming:!1}:Z.type==="done"?{...de,streaming:!1}:de))}function fn(P,Z,ve){if(!ve)return P;const de=[...P.events||[]],Ee=de[de.length-1];(Ee==null?void 0:Ee.type)===Z?de[de.length-1]={...Ee,text:`${Ee.text||""}${ve}`}:de.push({type:Z,text:ve});const et=Z==="content"?`${P.content||""}${ve}`:P.content;return{...P,content:et,events:de}}function vn(P,Z,ve=!1){if(!Z)return P;const de=[...P.events||[]],Ee=de.findIndex(et=>et.type==="tool_call"&&vl(et.call,Z));return Ee>=0?de[Ee]={...de[Ee],call:Z,live:ve}:de.push({type:"tool_call",call:Z,live:ve}),{...P,events:de}}function vl(P,Z){return!P||!Z?!1:!!(P.id&&Z.id&&P.id===Z.id||P.round!==void 0&&Z.round!==void 0&&P.index!==void 0&&Z.index!==void 0&&P.round===Z.round&&P.index===Z.index)}function Li(P,Z){let ve=P;for(const de of Z)ve=vn(ve,de,!1);return ve}function Bi(){var P;return V==="runtime"?k.jsxs("div",{className:"tabGrid",children:[k.jsx(C_,{env:$.data}),k.jsx(w_,{gpus:((P=$.data)==null?void 0:P.gpus)||[]})]}):V==="launcher"?k.jsxs("section",{className:"panel launcher",children:[k.jsxs("div",{className:"panelHeader",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Task Launcher"}),k.jsx("p",{children:"Builds AReno CLI commands without importing training internals."})]}),k.jsxs("div",{className:"tabs",children:[k.jsx("button",{className:kt(K==="train"&&"active"),onClick:()=>X("train"),children:"Train"}),k.jsx("button",{className:kt(K==="serve"&&"active"),onClick:()=>X("serve"),children:"Serve"})]})]}),K==="train"?k.jsx(Z_,{config:r,setConfig:u,onStart:Ie}):k.jsx(F_,{config:s,setConfig:h,onStart:Ye})]}):V==="agent"?k.jsxs("section",{className:"panel chatPanel",children:[k.jsxs("div",{className:"panelHeader",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Agent Chat"}),k.jsx("p",{children:_?`Context: ${_.name}`:"No job selected. The agent will use runtime context only."})]}),k.jsxs("div",{className:"agentHeaderActions",children:[k.jsxs("button",{className:"secondaryButton",onClick:bl,children:[k.jsx(Jg,{size:15})," New Chat"]}),k.jsxs("button",{className:"secondaryButton",onClick:()=>xe(!0),children:[k.jsx(Ig,{size:15})," Settings"]})]})]}),k.jsxs("div",{className:"agentTabs",children:[k.jsxs("button",{className:kt(v==="chat"&&"active"),onClick:()=>S("chat"),children:[k.jsx(l_,{size:15})," Chat"]}),k.jsxs("button",{className:kt(v==="history"&&"active"),onClick:()=>S("history"),children:[k.jsx(t_,{size:15})," History"]})]}),v==="history"?k.jsx(x_,{sessions:p,activeId:te.id,onOpen:rn,onNew:bl}):k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"chatMessages",ref:ue,children:fe.map((Z,ve)=>{var de;return k.jsxs("div",{className:kt("chatBubble",Z.role),children:[k.jsx("span",{children:Z.role}),(de=Z.events)!=null&&de.length?k.jsx(S_,{events:Z.events}):k.jsx(Bs,{text:Z.content}),Z.streaming&&k.jsx("div",{className:"streamingHint",children:"thinking..."})]},`${Z.id||Z.role}-${ve}`)})}),k.jsxs("div",{className:"chatComposer",children:[k.jsx("textarea",{value:f,onChange:Z=>m(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),Kt())}}),k.jsxs("button",{className:"primaryButton",onClick:Kt,children:[k.jsx(r_,{size:16})," Send"]})]})]}),he&&k.jsx(b_,{title:"Agent Settings",onClose:()=>xe(!1),children:k.jsx(y_,{provider:C,setProvider:U})})]}):_?k.jsxs("section",{className:"panel detailPanel",children:[k.jsxs("div",{className:"panelHeader",children:[k.jsxs("div",{children:[k.jsx("h2",{children:_.name}),k.jsxs("p",{children:[_.kind," · ",_.status]})]}),k.jsxs("div",{className:"detailActions",children:[k.jsx("button",{className:"secondaryButton",onClick:()=>a(null),children:"Back"}),_.status==="running"&&k.jsxs("button",{className:"dangerButton",onClick:()=>zt(_.id),children:[k.jsx(Pk,{size:16})," Stop"]})]})]}),k.jsx(M_,{job:_}),k.jsx(v_,{job:_,refreshNonce:le}),k.jsx(q_,{samples:(_==null?void 0:_.samples)||[]}),k.jsxs("div",{className:"split",children:[k.jsx(G_,{config:_==null?void 0:_.config,launch:_==null?void 0:_.launch}),k.jsx(X_,{logs:(_==null?void 0:_.logs)||[]})]})]}):k.jsxs("section",{className:"panel jobListPage",children:[k.jsxs("div",{className:"panelHeader",children:[k.jsxs("div",{children:[k.jsx("h2",{children:"Jobs"}),k.jsx("p",{children:"Registered AReno train/serve processes. Select a row to open job details."})]}),k.jsxs("div",{className:"pagerControls",children:[k.jsx("button",{className:"secondaryButton",disabled:T<=1,onClick:()=>ne(Z=>Math.max(1,Z-1)),children:"Prev"}),k.jsxs("span",{children:[T," / ",E]}),k.jsx("button",{className:"secondaryButton",disabled:T>=E,onClick:()=>ne(Z=>Math.min(E,Z+1)),children:"Next"})]})]}),k.jsxs("div",{className:"jobList",children:[ie.length===0&&k.jsx(ty,{title:"No jobs yet",text:"Start a train or serve task from the launcher."}),q.map(Z=>k.jsxs("button",{className:"jobRow large",onClick:()=>a(Z.id),children:[k.jsx("div",{className:"jobIcon",children:Z.kind==="serve"?k.jsx(ps,{size:16}):k.jsx(n_,{size:16})}),k.jsxs("div",{className:"jobInfo",children:[k.jsx("div",{className:"jobTitle",children:Z.name}),k.jsxs("div",{className:"jobMeta",children:[Z.kind," · ",Z.status," · step ",Z.step??0]})]}),k.jsx("span",{className:kt("statusDot",Z.status)})]},Z.id))]}),ie.length>Se&&k.jsxs("div",{className:"listFooter",children:["Showing ",(T-1)*Se+1,"-",Math.min(T*Se,ie.length)," of ",ie.length," jobs"]})]})}const[mt,Ui]=we[V]||we.jobs;return k.jsxs("div",{className:"shell",children:[k.jsxs("aside",{className:"rail",children:[k.jsxs("div",{className:"brand",children:[k.jsx("div",{className:"brandMark",children:"A"}),k.jsxs("div",{children:[k.jsx("div",{className:"brandName",children:"AReno Ops"}),k.jsx("div",{className:"brandMeta",children:"runtime workbench"})]})]}),k.jsx("nav",{className:"nav",children:oe.map(P=>k.jsxs("button",{className:kt("navItem",V===P.id&&"active"),onClick:()=>O(P.id),children:[P.icon," ",P.label]},P.id))}),k.jsxs("div",{className:"railFooter",children:[k.jsx("div",{className:"tinyLabel",children:"Repo"}),k.jsxs("div",{className:"monoLine",children:[((ze=(ge=$.data)==null?void 0:ge.repo)==null?void 0:ze.branch)||"unknown"," · ",((vt=(Be=$.data)==null?void 0:Be.repo)==null?void 0:vt.commit)||"no git"]})]})]}),k.jsxs("main",{className:"main",children:[k.jsxs("header",{className:"topbar",children:[k.jsxs("div",{children:[k.jsx("h1",{children:mt}),k.jsx("p",{children:Ui})]}),k.jsxs("div",{className:"topActions",children:[k.jsx("button",{className:"iconButton",onClick:()=>ee(ae==="dark"?"light":"dark"),title:"Toggle theme",children:ae==="dark"?k.jsx(c_,{size:16}):k.jsx(i_,{size:16})}),k.jsx("button",{className:"iconButton",onClick:()=>{$.refresh(),D.refresh(),F.refresh(),Ce(P=>P+1)},title:"Refresh",children:k.jsx(a_,{size:16})})]})]}),L&&k.jsx("div",{className:"notice",children:L}),Bi()]})]})}function y_({provider:n,setProvider:a}){return k.jsxs("div",{className:"agentConfig modalForm",children:[k.jsx(du,{label:"Base URL",value:n.base_url||"",onChange:r=>a({...n,base_url:r}),compact:!0}),k.jsx(du,{label:"Model",value:n.model||"",onChange:r=>a({...n,model:r}),compact:!0}),k.jsxs("label",{className:"field compact",children:[k.jsx("span",{children:"API key"}),k.jsx("input",{type:"password",value:n.api_key||"",onChange:r=>a({...n,api_key:r.target.value})})]})]})}function x_({sessions:n,activeId:a,onOpen:r,onNew:u}){return k.jsxs("div",{className:"agentHistory",children:[k.jsxs("div",{className:"agentHistoryHeader",children:[k.jsxs("div",{children:[k.jsx("h3",{children:"Chat History"}),k.jsxs("p",{children:[n.length," saved conversations in this browser."]})]}),k.jsxs("button",{className:"secondaryButton",onClick:u,children:[k.jsx(Jg,{size:15})," New Chat"]})]}),k.jsx("div",{className:"agentHistoryList",children:n.map(s=>{const h=[...s.messages||[]].reverse().find(f=>f.role==="user"||f.content);return k.jsxs("button",{className:kt("agentHistoryItem",s.id===a&&"active"),onClick:()=>r(s.id),children:[k.jsx("strong",{children:s.title||"New chat"}),k.jsx("span",{children:(h==null?void 0:h.content)||"No messages yet."}),k.jsx("small",{children:new Date(s.updatedAt||s.createdAt||Date.now()).toLocaleString()})]},s.id)})})]})}function b_({title:n,children:a,onClose:r}){return k.jsx("div",{className:"modalOverlay",role:"presentation",onMouseDown:r,children:k.jsxs("div",{className:"modalCard",role:"dialog","aria-modal":"true","aria-label":n,onMouseDown:u=>u.stopPropagation(),children:[k.jsxs("div",{className:"modalHeader",children:[k.jsxs("div",{children:[k.jsx("h2",{children:n}),k.jsx("p",{children:"Stored locally in this browser."})]}),k.jsx("button",{className:"iconButton",onClick:r,children:"×"})]}),a]})})}function v_({job:n,refreshNonce:a}){return k.jsxs("div",{className:"jobMetricsGrid",children:[k.jsx("div",{className:"panel insetPanel",children:k.jsx(R_,{jobId:n==null?void 0:n.id,metricsDir:n==null?void 0:n.metrics_dir,refreshNonce:a})}),k.jsx("div",{className:"panel insetPanel",children:k.jsx(U_,{rows:(n==null?void 0:n.timeperf)||[]})})]})}function S_({events:n}){return k.jsx("div",{className:"agentEventList",children:n.map((a,r)=>a.type==="reasoning"?k.jsx(k_,{text:a.text},r):a.type==="content"?k.jsx(Bs,{text:a.text},r):a.type==="tool_call"?k.jsx(__,{call:a.call,live:a.live},r):a.type==="tool_result"?k.jsx(T_,{result:a.result},r):null)})}function Bs({text:n}){return k.jsx("div",{className:"markdownBlock",children:k.jsx(RS,{remarkPlugins:[Fk],children:n||""})})}function k_({text:n}){return k.jsxs("details",{className:"reasoningBlock",children:[k.jsxs("summary",{children:[k.jsx("span",{children:"✓"}),k.jsx("strong",{children:"Completed thinking"})]}),k.jsx(Bs,{text:n})]})}function __({call:n,live:a=!1}){const u=((n==null?void 0:n.function)||{}).name||(n==null?void 0:n.name)||"tool",s=A_(n);return k.jsxs("details",{className:kt("toolCallCard","toolCallDetails",a&&"live"),children:[k.jsxs("summary",{className:"toolCallHead",children:[k.jsx("span",{children:a?"calling":"tool call"}),k.jsx("b",{children:E_(u,s)}),k.jsx("em",{children:a?"running":""})]}),k.jsx("pre",{children:s})]})}function E_(n,a){const r=Pg(a);return!r||r==="{}"?`${n}()`:`${n}(${r})`}function A_(n){return(n.function||{}).arguments||n.arguments||JSON.stringify(n,null,2)}function T_({result:n}){const a=z_(n);return k.jsxs("details",{className:kt("toolCallCard","toolResultDetails",n.ok?"ok":"failed"),children:[k.jsxs("summary",{children:[k.jsx("span",{children:n.ok?"result":"error"}),k.jsxs("b",{children:[n.name||"unknown"," · ",n.ok?"ok":"failed"]}),k.jsx("em",{children:Pg(a)||"No output."})]}),k.jsx("pre",{children:a})]})}function Pg(n){return String(n||"").replace(/\s+/g," ").trim()}function z_(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 C_({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 k.jsxs("section",{className:"runtimeDeck",children:[k.jsxs("div",{className:"runtimeHero",children:[k.jsx("div",{className:kt("readinessOrb",n!=null&&n.ready?"ready":"blocked"),children:n!=null&&n.ready?"OK":"!"}),k.jsxs("div",{children:[k.jsx("div",{className:"tinyLabel",children:"AReno check"}),k.jsx("h2",{children:n!=null&&n.ready?"Runtime ready for AReno tasks":"Runtime needs attention before heavy jobs"}),k.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"]})]})]}),k.jsxs("div",{className:"envFacts",children:[k.jsx(ru,{icon:k.jsx(Fg,{size:15}),label:"AReno",value:((x=r.areno)==null?void 0:x.version)||"unknown"}),k.jsx(ru,{icon:k.jsx(e_,{size:15}),label:"PyTorch",value:s.version||"missing"}),k.jsx(ru,{icon:k.jsx(ps,{size:15}),label:"CUDA",value:s.cuda_build||"none"}),k.jsx(ru,{icon:k.jsx(Kg,{size:15}),label:"Platform",value:`${h.system||"unknown"} ${h.machine||""}`})]}),k.jsx("div",{className:"checkMatrix",children:f.map(y=>k.jsxs("div",{className:kt("checkItem",y.status.toLowerCase()),children:[k.jsx("span",{children:y.status}),k.jsx("strong",{children:y.name}),k.jsx("small",{children:y.detail||y.next_step||"no detail"})]},y.name))}),k.jsx("div",{className:"dependencyStrip",children:Object.entries(u).map(([y,v])=>k.jsxs("div",{className:kt("depPill",v.imported?"ok":"warn"),children:[y,": ",v.imported?v.version||"imported":"missing"]},y))})]})}function w_({gpus:n}){return n.length?k.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 k.jsxs("div",{className:"gpuCard",children:[k.jsxs("div",{className:"gpuHead",children:[k.jsxs("strong",{children:["GPU ",r]}),k.jsx("span",{children:a.name})]}),k.jsxs("div",{className:"gpuMeter",children:[k.jsxs("div",{className:"gpuMeterLabel",children:[k.jsx("span",{children:"Memory"}),k.jsxs("b",{children:[a.memory_used_mb,"/",a.memory_total_mb," MB"]})]}),k.jsx("div",{className:"meterTrack",children:k.jsx("i",{style:{width:`${u}%`}})})]}),k.jsxs("div",{className:"gpuMeter",children:[k.jsxs("div",{className:"gpuMeterLabel",children:[k.jsx("span",{children:"Utilization"}),k.jsxs("b",{children:[s,"%"]})]}),k.jsx("div",{className:"meterTrack util",children:k.jsx("i",{style:{width:`${s}%`}})})]})]},`${a.name}-${r}`)})}):k.jsx("section",{className:"gpuDeck",children:k.jsx("div",{className:"panel",children:k.jsx(ty,{title:"No GPU detected",text:"nvidia-smi did not return device utilization."})})})}function ru({icon:n,label:a,value:r}){return k.jsxs("div",{className:"envFact",children:[k.jsx("span",{children:n}),k.jsxs("div",{children:[k.jsx("label",{children:a}),k.jsx("strong",{children:r})]})]})}function M_({job:n}){const a=ey(n),r=N_(n),u=Math.max(0,a.findIndex(s=>gs(s,r,n)));return k.jsx("div",{className:"timeline",children:a.map((s,h)=>k.jsxs("div",{className:kt("timelineItem",h<=u&&"done",gs(s,r,n)&&"current"),children:[k.jsx("span",{children:h+1}),k.jsx("label",{children:s.label})]},s.id))})}function ey(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=D_(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 N_(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=ey(n).find(s=>gs(s,a,n));return(u==null?void 0:u.id)||a}function gs(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 D_(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 O_(n){return(n||[]).map(a=>a.name).sort()}function j_(n,a){return a&&n.includes(a)?a:n[0]||""}function R_({jobId:n,metricsDir:a,refreshNonce:r}){const[u,s]=be.useState(""),[h,f]=be.useState(.6),[m,p]=be.useState([]),[d,x]=be.useState([]),[y,v]=be.useState(!1),[S,C]=be.useState(n);n!==S&&(C(n),s(""),p([]),x([]),v(!1));const U=O_(m),V=j_(U,u);be.useEffect(()=>{let ee=!1;if(n)return yl(`/api/jobs/${n}/metrics`).then(L=>{if(ee)return;const J=L.metrics||[];p(J),s(he=>{var xe;return he||((xe=J[0])==null?void 0:xe.name)||""})}).catch(()=>{ee||p([])}),()=>{ee=!0}},[n,r]),be.useEffect(()=>{let ee=!1;if(!n||!V){x([]),v(!1);return}return v(!0),yl(`/api/jobs/${n}/metric?name=${encodeURIComponent(V)}&limit=500`).then(L=>{ee||x((L.points||[]).filter(J=>Number.isFinite(Number(J.value))).map(J=>({...J,step:Number(J.step||0),value:Number(J.value)})))}).catch(()=>{ee||x([])}).finally(()=>{ee||v(!1)}),()=>{ee=!0}},[n,V,r]);const O=V,K=d.slice(-240),X=L_(K,h),ae=B_(K,X);return k.jsxs("div",{className:"chart",children:[k.jsxs("div",{className:"chartHeader",children:[k.jsxs("span",{children:[k.jsx(Zg,{size:14})," TensorBoard scalars"]}),k.jsxs("div",{className:"chartControls",children:[k.jsx("select",{value:O,onChange:ee=>s(ee.target.value),children:U.length===0?k.jsx("option",{value:"",children:"no metrics"}):U.map(ee=>k.jsx("option",{children:ee},ee))}),k.jsxs("label",{children:["smooth ",h.toFixed(2),k.jsx("input",{type:"range",min:"0",max:"0.99",step:"0.01",value:h,onChange:ee=>f(Number(ee.target.value))})]})]})]}),K.length===0?k.jsx("div",{className:"plotEmpty",children:y?"Loading selected metric...":"No TensorBoard scalar points loaded yet."}):k.jsxs("svg",{className:"metricPlot",viewBox:"0 0 720 180",role:"img",children:[k.jsx("g",{className:"plotGrid",children:[0,1,2,3].map(ee=>k.jsx("line",{x1:"0",x2:"720",y1:30+ee*42,y2:30+ee*42},ee))}),k.jsx("polyline",{className:"rawLine",points:ae.raw}),k.jsx("polyline",{className:"smoothLine",points:ae.smooth}),K.slice(-24).map((ee,L)=>{var J,he;return k.jsx("circle",{cx:((J=ae.coords[L+Math.max(0,K.length-24)])==null?void 0:J.x)||0,cy:((he=ae.coords[L+Math.max(0,K.length-24)])==null?void 0:he.y)||0,r:"2.2",children:k.jsx("title",{children:`${O} step ${ee.step}: ${ee.value}`})},`${ee.step}-${L}`)})]}),k.jsxs("div",{className:"plotFooter",children:[k.jsxs("span",{children:[O||"metric"," · ",d.length," points"]}),k.jsxs("span",{children:[a||"no metrics dir"," · ",ae.minLabel," to ",ae.maxLabel]})]})]})}function L_(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 B_(n,a){if(!n.length)return{raw:"",smooth:"",coords:[],minLabel:"n/a",maxLabel:"n/a"};const r=[...n,...a].map(v=>v.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=v=>({x:(v.step-f)/p*700+10,y:168-(v.value-u)/h*146}),x=n.map(d),y=a.map(d);return{raw:x.map(v=>`${v.x.toFixed(1)},${v.y.toFixed(1)}`).join(" "),smooth:y.map(v=>`${v.x.toFixed(1)},${v.y.toFixed(1)}`).join(" "),coords:x,minLabel:Lp(u),maxLabel:Lp(s)}}function Lp(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 U_({rows:n}){const a=H_(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 k.jsxs("div",{className:"timePerf",children:[k.jsxs("div",{className:"timePerfHeader",children:[k.jsx("div",{children:k.jsxs("div",{className:"codeTitle inline",children:[k.jsx(o_,{size:14})," Runtime timeperf"]})}),k.jsxs("div",{className:"legend",children:[s.map(h=>k.jsxs("span",{children:[k.jsx("i",{className:Bp(h)})," ",h]},h)),k.jsxs("b",{children:["avg ",r?`${r.toFixed(1)}s`:"n/a"]})]})]}),a.length===0?k.jsx("div",{className:"sampleEmpty",children:"No step timing captured yet."}):k.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 k.jsxs("div",{className:"timeRow",children:[k.jsxs("label",{children:["step ",h.step]}),k.jsx("div",{className:"timeTrack",children:k.jsx("div",{className:"timeStack",style:{width:`${m}%`},children:p.map(x=>{const y=Number(x.seconds||0),v=y/Math.max(f,1)*100;return k.jsx("span",{className:Bp(x.name),style:{width:`${v}%`},title:`${x.name}: ${y.toFixed(1)}s`,children:v>11?`${y.toFixed(1)}s`:""},x.name)})})}),k.jsxs("strong",{children:[f.toFixed(1),"s"]})]},`${h.step}-${h.time}`)})})]})}function H_(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 Bp(n){return`seg-${String(n||"other").replace(/[^a-zA-Z0-9]+/g,"-")}`}function q_({samples:n}){const a=be.useMemo(()=>[...n||[]].sort((y,v)=>Number(y.step||0)-Number(v.step||0)||Number(y.prompt_idx||0)-Number(v.prompt_idx||0)||Number(y.sample_idx||0)-Number(v.sample_idx||0)),[n]),r=be.useMemo(()=>Array.from(new Set(a.map(y=>Number(y.step||0)))).sort((y,v)=>v-y),[a]),[u,s]=be.useState(""),[h,f]=be.useState("");be.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,v)=>({key:Y_(y,v),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 k.jsxs("div",{className:"sampleCard",children:[k.jsxs("div",{className:"codeTitle sampleTitle",children:[k.jsxs("span",{children:[k.jsx(Fg,{size:14})," Rollout sample"]}),!!a.length&&k.jsxs("div",{className:"sampleControls",children:[k.jsx("select",{value:u,onChange:y=>{s(y.target.value),f("")},children:r.map(y=>k.jsxs("option",{value:y,children:["step ",y]},y))}),k.jsx("select",{value:(d==null?void 0:d.key)||"",onChange:y=>f(y.target.value),children:p.map(y=>k.jsx("option",{value:y.key,children:y.label},y.key))})]})]}),x?k.jsxs("div",{className:"sampleGrid",children:[k.jsxs("div",{children:[k.jsx("span",{children:"Prompt"}),k.jsx("p",{children:x.prompt||"n/a"})]}),k.jsxs("div",{children:[k.jsx("span",{children:"Completion"}),k.jsx("p",{children:x.completion||"n/a"})]})]}):k.jsx("div",{className:"sampleEmpty",children:"No rollout sample captured yet."})]})}function Y_(n,a){return`${n.step??"x"}-${n.prompt_idx??"x"}-${n.sample_idx??"x"}-${a}`}function G_({config:n,launch:a}){const r=n&&Object.keys(n).length?n:a||{},u=V_(r);return k.jsxs("div",{className:"codeCard",children:[k.jsxs("div",{className:"codeTitle",children:[k.jsx(Ig,{size:14})," Config"]}),u.length>0?k.jsx("div",{className:"configSections",children:u.map(s=>k.jsxs("div",{className:"configSection",children:[k.jsx("h3",{children:s.title}),k.jsx("div",{className:"configGrid",children:s.items.map(({key:h,value:f})=>k.jsxs("div",{className:"configItem",children:[k.jsx("span",{children:h.replace(/_/g," ")}),k.jsx("strong",{children:Q_(f)})]},h))})]},s.title))}):k.jsx("pre",{children:"No config captured yet."})]})}function V_(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 Q_(n){return Array.isArray(n)?n.join(" "):typeof n=="object"?JSON.stringify(n):String(n)}function X_({logs:n}){const a=be.useRef(null);return be.useEffect(()=>{const r=a.current;r&&(r.scrollTop=r.scrollHeight)},[n.length]),k.jsxs("div",{className:"codeCard",ref:a,children:[k.jsxs("div",{className:"codeTitle",children:[k.jsx(u_,{size:14})," Logs"]}),k.jsx("pre",{children:n.slice(-80).join(` -`)||"No logs yet."})]})}function Z_({config:n,setConfig:a,onStart:r}){const u=String(n.algo||"sft").toLowerCase(),s=K_(u),h=(f,m)=>a({...n,[f]:m});return k.jsxs("div",{className:"launcherSections",children:[s.map(f=>k.jsxs("div",{className:"launcherSection",children:[k.jsxs("div",{className:"launcherSectionHeader",children:[k.jsx("strong",{children:f.title}),f.note&&k.jsx("span",{children:f.note})]}),k.jsx("div",{className:"formGrid",children:f.fields.map(m=>k.jsx(du,{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)),k.jsxs("button",{className:"primaryButton launchButton wide",onClick:r,children:[k.jsx(Ls,{size:16})," Start train"]})]})}function K_(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:[ls("algo","Algorithm",["sft","dpo","gspo","grpo","ppo"],!0),me("ckpt","Checkpoint"),ls("model_hub","Model hub",["modelscope","hf"],!0),me("dataset_path","Dataset path"),me("dataset_loader_fn","Dataset loader"),me("epochs","Epochs",!0),me("max_steps","Max steps",!0)]},{title:"Runtime",note:"parallelism, memory, and kernels",fields:[me("world_size","World",!0),me("tp_size","TP",!0),ls("attn_backend","Attention",["flash","native"],!0),Hn("activation_checkpointing","Activation ckpt"),Hn("drop_rollout_state","Drop rollout state"),Hn("eager_decode","Eager decode"),Hn("disable_thinking","Disable thinking")]},{title:"Batching",note:"controls train and rollout memory",fields:[me("batch_size","Batch",!0),...a?[me("n_samples","Samples",!0),me("max_running_prompts","Running prompts",!0)]:[],me("mini_bs","Mini BS",!0),me("score_micro_bs","Score micro BS",!0),me("gradient_accumulation_steps","Grad accum",!0)]},{title:a?"Rollout":"Sequence",note:a?"generation and sampling":"token limits for supervised data",fields:[me("max_prompt_tokens","Prompt tokens",!0),me("max_new_tokens","New tokens",!0),...r?[me("max_context_len","Context",!0),me("agent_fn","Agent fn"),me("agent_timeout_s","Agent timeout",!0),Hn("train_tool_results","Train tool results")]:[],...a?[me("temperature","Temp",!0),me("top_k","Top K",!0),me("top_p","Top P",!0),Hn("greedy","Greedy")]:[]]},{title:"Optimizer",note:"policy optimizer settings",fields:[me("lr","LR",!0),me("min_lr","Min LR",!0),me("lr_decay_steps","Decay steps",!0),me("lr_decay_style","Decay style",!0),me("adam_beta1","Adam beta1",!0),me("adam_beta2","Adam beta2",!0),me("weight_decay","Weight decay",!0),me("grad_clip_norm","Grad clip",!0),Hn("adam_8bit","8-bit Adam")]}],p=[];return(u||s)&&p.push(me("ref_ckpt","Reference ckpt")),a&&p.push(me("reward_fn_path","Reward fn")),s&&p.push(me("reward_ckpt","Reward ckpt"),me("critic_ckpt","Critic ckpt"),me("critic_lr","Critic LR",!0),me("critic_warmup_steps","Critic warmup",!0)),h&&p.push(me("gspo_clip_eps","GSPO clip",!0)),f&&p.push(me("grpo_clip_eps","GRPO clip",!0)),u&&p.push(me("dpo_beta","DPO beta",!0)),s&&p.push(Hn("use_kl_loss","Use KL loss"),me("kl_loss_coef","KL coef",!0),me("kl_loss_type","KL type",!0),me("clip_eps","Clip eps",!0),me("clip_ratio_c","Clip ratio C",!0),me("value_clip_eps","Value clip",!0),me("value_loss_coef","Value coef",!0),me("gamma","Gamma",!0),me("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:[Hn("tune_params","Tune params"),me("mem_frac","Memory frac",!0),me("tune_max_samples","Tune samples",!0)]},{title:"Output",note:"checkpointing, metrics, and escape hatch",fields:[me("save_path","Save path"),me("save_interval","Save interval",!0),me("metrics_dir","Metrics dir"),me("extra_args","Extra args")]}),m}function me(n,a,r=!1){return{key:n,label:a,compact:r}}function ls(n,a,r,u=!1){return{key:n,label:a,compact:u,type:"select",options:r}}function Hn(n,a){return{key:n,label:a,compact:!0,type:"checkbox"}}function F_({config:n,setConfig:a,onStart:r}){return k.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])=>k.jsx(du,{label:s,value:n[u],onChange:h=>a({...n,[u]:h}),compact:u!=="model_path"},u)),k.jsxs("button",{className:"primaryButton launchButton wide",onClick:r,children:[k.jsx(Ls,{size:16})," Start serve"]})]})}function du({label:n,value:a,onChange:r,compact:u,type:s="text",options:h=[]}){return s==="checkbox"?k.jsxs("label",{className:kt("field","compact","checkField"),children:[k.jsx("input",{type:"checkbox",checked:!!a,onChange:f=>r(f.target.checked)}),k.jsx("span",{children:n})]}):k.jsxs("label",{className:kt("field",u&&"compact"),children:[k.jsx("span",{children:n}),s==="select"?k.jsx("select",{value:a??"",onChange:f=>r(f.target.value),children:h.map(f=>k.jsx("option",{value:f,children:f},f))}):k.jsx("input",{value:a??"",onChange:f=>r(f.target.value)})]})}function ty({title:n,text:a}){return k.jsxs("div",{className:"empty",children:[k.jsx(Kg,{size:18}),k.jsx("strong",{children:n}),k.jsx("span",{children:a})]})}const Up=typeof document<"u"?document.getElementById("root"):null;Up&&E0.createRoot(Up).render(k.jsx(g_,{})); 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 b3a17010..967236a9 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 9bb8b4d4..14e6fe71 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -57,6 +57,29 @@ 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) -> float | None: + """Return the elapsed seconds between two timestamps, or None if unparseable.""" + start = _parse_time(created_at) + if start is None: + return None + end = _parse_time(updated_at) + if end is None: + return None + return max(0.0, end - start) + + class Job: def __init__( self, @@ -144,6 +167,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, @@ -155,9 +179,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), "returncode": self.returncode, "pid": self.pid, "perf": self.perf, + "algo": launch.get("algo", ""), + "ckpt": launch.get("ckpt") or launch.get("model_path", ""), + "dataset_path": launch.get("dataset_path", ""), } diff --git a/dashboard/pnpm-lock.yaml b/dashboard/pnpm-lock.yaml index 1faf6f7b..2852c709 100644 --- a/dashboard/pnpm-lock.yaml +++ b/dashboard/pnpm-lock.yaml @@ -520,7 +520,7 @@ packages: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + resolution: {integrity: sha512-HAJOBmBAjgCWu9EqgW+JPwK/ANredks5yoaznWqopccruDm6Q/1XI5b3vhse2teaM7lNK9PYPhOBhv+vF8yY8Q==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' diff --git a/dashboard/src/main.jsx b/dashboard/src/main.jsx index e5c110fd..708b1867 100644 --- a/dashboard/src/main.jsx +++ b/dashboard/src/main.jsx @@ -16,6 +16,8 @@ import { Plus, Play, RefreshCw, + RotateCcw, + Search, Send, Server, Settings2, @@ -194,6 +196,37 @@ 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"]; + +function readUrlParam(key, fallback) { + const params = new URLSearchParams(window.location.search); + return params.get(key) || fallback; +} + +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); @@ -214,7 +247,12 @@ function App() { const [theme, setTheme] = useState(() => localStorage.getItem("areno-dashboard-theme") || "dark"); const [busy, setBusy] = useState(""); const [agentSettingsOpen, setAgentSettingsOpen] = useState(false); - const [jobPage, setJobPage] = useState(1); + const [jobPage, setJobPage] = useState(() => Number(readUrlParam("page", "1")) || 1); + const [searchQuery, setSearchQuery] = useState(() => readUrlParam("q", "")); + const [stateFilter, setStateFilter] = useState(() => readUrlParam("state", "all")); + const [typeFilter, setTypeFilter] = useState(() => readUrlParam("type", "all")); + const [algoFilter, setAlgoFilter] = useState(() => readUrlParam("algo", "all")); + const [sortKey, setSortKey] = useState(() => readUrlParam("sort", "newest")); const [refreshNonce, setRefreshNonce] = useState(0); const chatMessagesRef = useRef(null); const env = usePolling(() => api("/api/env"), 5000); @@ -223,9 +261,53 @@ function App() { const jobList = jobs.data?.jobs || []; const jobPageSize = 10; - const jobPageCount = Math.max(1, Math.ceil(jobList.length / jobPageSize)); + + 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 (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 (stateFilter !== "all") result = result.filter((job) => job.status === stateFilter); + 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 = jobList.slice((currentJobPage - 1) * jobPageSize, currentJobPage * jobPageSize); + const pagedJobs = filteredJobs.slice((currentJobPage - 1) * jobPageSize, currentJobPage * jobPageSize); const selectedJob = jobDetail.data?.job || (selectedJobId ? jobList.find((job) => job.id === selectedJobId) : null) || null; const activeAgentSession = useMemo(() => { return agentSessions.find((session) => session.id === activeAgentSessionId) || agentSessions[0] || createAgentSession(); @@ -242,6 +324,17 @@ function App() { if (jobPage > jobPageCount) setJobPage(jobPageCount); }, [jobPage, jobPageCount]); + 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(() => { document.documentElement.dataset.theme = theme; localStorage.setItem("areno-dashboard-theme", theme); @@ -612,8 +705,41 @@ function App() { + {jobList.length > 0 && ( +
+
+ + { setSearchQuery(event.target.value); setJobPage(1); }} + /> +
+
+ + + + + +
+
+ )}
{jobList.length === 0 && } + {filteredJobs.length === 0 && jobList.length > 0 && ( + + )} {pagedJobs.map((job) => ( ))}
- {jobList.length > jobPageSize && ( + {filteredJobs.length > jobPageSize && (
- Showing {(currentJobPage - 1) * jobPageSize + 1}-{Math.min(currentJobPage * jobPageSize, jobList.length)} of {jobList.length} jobs + 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 6511695d..7237a0a7 100644 --- a/dashboard/src/styles.css +++ b/dashboard/src/styles.css @@ -509,6 +509,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/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py new file mode 100644 index 00000000..10416026 --- /dev/null +++ b/tests/test_dashboard_runs_cpu.py @@ -0,0 +1,142 @@ +from __future__ import annotations + +import unittest + +from areno.dashboard.server import Job, _parse_time, _duration_seconds + + +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 _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_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") + + +if __name__ == "__main__": + unittest.main() \ No newline at end of file From 6c11409a82556bddbd3e258efa3b5a6610b01d9c Mon Sep 17 00:00:00 2001 From: shihuai Date: Tue, 28 Jul 2026 16:14:40 +0800 Subject: [PATCH 2/9] docs(dashboard): add user documentation and seed script - Add docs/cli/dashboard.rst with search/filter/sort guide and minimal example - Add scripts/seed_dashboard.py for testing with synthetic run data - Update docs/index.rst to include dashboard doc in toctree --- docs/cli/dashboard.rst | 151 ++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + scripts/seed_dashboard.py | 95 ++++++++++++++++++++++++ 3 files changed, 247 insertions(+) create mode 100644 docs/cli/dashboard.rst create mode 100644 scripts/seed_dashboard.py diff --git a/docs/cli/dashboard.rst b/docs/cli/dashboard.rst new file mode 100644 index 00000000..bbed096d --- /dev/null +++ b/docs/cli/dashboard.rst @@ -0,0 +1,151 @@ +: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 + +This writes 50 synthetic jobs with mixed states, algorithms, types, and +timestamps to ``.areno-dashboard-state.json`` in the current directory. +The dashboard reads this file on startup and on each polling cycle. + +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..65f0770a --- /dev/null +++ b/scripts/seed_dashboard.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +"""Seed the AReno dashboard state file with synthetic jobs for testing. + +Usage: + python scripts/seed_dashboard.py [--count 50] [--output .areno-dashboard-state.json] + +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. +""" + +from __future__ import annotations + +import argparse +import json +import random +import time +from pathlib import Path +from uuid import uuid4 + + +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"] + +DEFAULT_OUTPUT = Path(".areno-dashboard-state.json") + + +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 = time.time() + created_ts = now_ts - random.randint(60, 86400 * 7) + updated_ts = created_ts + random.randint(10, 3600) + step = random.randint(0, 200) + + if kind == "serve": + launch = {"model_path": model, "host": "0.0.0.0", "port": 8000} + name = f"serve {model}" + else: + launch = {"algo": algo, "ckpt": model, "dataset_path": dataset} + 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": created_ts, + "updated_at": 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.") + args = parser.parse_args() + + jobs = [make_job(i) for i in range(args.count)] + payload = {"jobs": jobs} + + args.output.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") + print(f"Wrote {args.count} synthetic jobs to {args.output}") + print(f"States: {', '.join(sorted(set(j['status'] for j in jobs)))}") + print(f"Algorithms: {', '.join(sorted(set(j['launch'].get('algo', '') for j in jobs if j['launch'].get('algo'))))}") + print(f"Types: {', '.join(sorted(set(j['kind'] for j in jobs)))}") + + +if __name__ == "__main__": + main() \ No newline at end of file From 2d5f80508b4b7a5a11af8db55e06eaaa49411634 Mon Sep 17 00:00:00 2001 From: shihuai Date: Tue, 28 Jul 2026 16:30:46 +0800 Subject: [PATCH 3/9] fix(dashboard): handle sections-format launch_config in to_summary_json CLI-registered jobs store launch config as sections arrays, not flat dicts. Add _launch_value helper to read from both formats. Update seed script to generate mixed-format synthetic data. --- areno/dashboard/server.py | 21 ++++++- scripts/seed_dashboard.py | 47 +++++++++++++-- tests/test_dashboard_runs_cpu.py | 99 +++++++++++++++++++++++++++++++- 3 files changed, 159 insertions(+), 8 deletions(-) diff --git a/areno/dashboard/server.py b/areno/dashboard/server.py index 14e6fe71..d454a68f 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -80,6 +80,21 @@ def _duration_seconds(created_at: Any, updated_at: Any) -> float | 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 + for section in launch.get("sections", []): + if not isinstance(section, dict): + continue + for item in section.get("items", []): + if isinstance(item, dict) and item.get("key") == key: + return item.get("value", default) + return default + + class Job: def __init__( self, @@ -183,9 +198,9 @@ def to_summary_json(self) -> dict[str, Any]: "returncode": self.returncode, "pid": self.pid, "perf": self.perf, - "algo": launch.get("algo", ""), - "ckpt": launch.get("ckpt") or launch.get("model_path", ""), - "dataset_path": launch.get("dataset_path", ""), + "algo": _launch_value(launch, "algo"), + "ckpt": _launch_value(launch, "ckpt") or _launch_value(launch, "model_path"), + "dataset_path": _launch_value(launch, "dataset_path"), } diff --git a/scripts/seed_dashboard.py b/scripts/seed_dashboard.py index 65f0770a..38ce4208 100644 --- a/scripts/seed_dashboard.py +++ b/scripts/seed_dashboard.py @@ -18,6 +18,8 @@ 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"] @@ -27,11 +29,33 @@ "Qwen/Qwen3-4B", "Qwen/Qwen2.5-0.5B", ] -DATASETS = ["gsm8k:main", "yahma/alpaca-cleaned:train", "openai/gsm8k", "math"] +DATASETS = ["gsm8k:main", "yahma/alpaca-cleaned:train", "openai/gsm8k", "math", "tictactoe.jsonl"] DEFAULT_OUTPUT = Path(".areno-dashboard-state.json") +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) @@ -42,12 +66,26 @@ def make_job(index: int) -> dict: created_ts = now_ts - random.randint(60, 86400 * 7) updated_ts = created_ts + random.randint(10, 3600) step = random.randint(0, 200) + # Half the jobs use sections format (like real CLI), half use flat dict (like dashboard launcher) + use_sections = random.random() < 0.5 if kind == "serve": - launch = {"model_path": model, "host": "0.0.0.0", "port": 8000} + 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: - launch = {"algo": algo, "ckpt": model, "dataset_path": dataset} + 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 { @@ -87,7 +125,8 @@ def main() -> None: args.output.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") print(f"Wrote {args.count} synthetic jobs to {args.output}") print(f"States: {', '.join(sorted(set(j['status'] for j in jobs)))}") - print(f"Algorithms: {', '.join(sorted(set(j['launch'].get('algo', '') for j in jobs if j['launch'].get('algo'))))}") + algos = sorted(set(filter(None, (_launch_value(j['launch'], 'algo') for j in jobs)))) + print(f"Algorithms: {', '.join(algos)}") print(f"Types: {', '.join(sorted(set(j['kind'] for j in jobs)))}") diff --git a/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py index 10416026..27771b42 100644 --- a/tests/test_dashboard_runs_cpu.py +++ b/tests/test_dashboard_runs_cpu.py @@ -2,7 +2,7 @@ import unittest -from areno.dashboard.server import Job, _parse_time, _duration_seconds +from areno.dashboard.server import Job, _parse_time, _duration_seconds, _launch_value class ParseTimeTest(unittest.TestCase): @@ -138,5 +138,102 @@ def test_from_json_preserves_launch_fields(self): 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") + + +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() \ No newline at end of file From 75cda70680ea36e6214ba255b930c18e134700f7 Mon Sep 17 00:00:00 2001 From: shihuai Date: Tue, 28 Jul 2026 17:01:14 +0800 Subject: [PATCH 4/9] docs(dashboard): clarify seed script format and restart steps --- docs/cli/dashboard.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/cli/dashboard.rst b/docs/cli/dashboard.rst index bbed096d..5dd1d106 100644 --- a/docs/cli/dashboard.rst +++ b/docs/cli/dashboard.rst @@ -109,7 +109,17 @@ without running real training jobs: This writes 50 synthetic jobs with mixed states, algorithms, types, and timestamps to ``.areno-dashboard-state.json`` in the current directory. -The dashboard reads this file on startup and on each polling cycle. +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. The dashboard reads +this file on startup and on each polling cycle, so a restart is needed +after generating fresh data: + +.. code-block:: bash + + areno dashboard --stop + python scripts/seed_dashboard.py --count 50 + areno dashboard --start Minimal example --------------- From e5c2e456268731cdb6902d67d81bbbe3bd541084 Mon Sep 17 00:00:00 2001 From: shihuai Date: Thu, 30 Jul 2026 14:50:27 +0800 Subject: [PATCH 5/9] fix(dashboard): restore original pnpm-lock.yaml integrity hashes The lockfile was corrupted by a local pnpm install --update-checksums that replaced debug@4.4.3's integrity hash with a value from a different registry mirror. Restore the original hash from main. --- dashboard/pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/pnpm-lock.yaml b/dashboard/pnpm-lock.yaml index 2852c709..1faf6f7b 100644 --- a/dashboard/pnpm-lock.yaml +++ b/dashboard/pnpm-lock.yaml @@ -520,7 +520,7 @@ packages: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} debug@4.4.3: - resolution: {integrity: sha512-HAJOBmBAjgCWu9EqgW+JPwK/ANredks5yoaznWqopccruDm6Q/1XI5b3vhse2teaM7lNK9PYPhOBhv+vF8yY8Q==} + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' From 4123ecd92323dd7e42db81faac9836bd6f1d144b Mon Sep 17 00:00:00 2001 From: shihuai Date: Thu, 30 Jul 2026 15:01:02 +0800 Subject: [PATCH 6/9] fix(dashboard): compute duration by status, preserve registry created_at - _duration_seconds now takes status: running jobs use now() - created_at (keeps growing), terminal jobs use updated_at - created_at (fixed at completion). Fixes incorrect duration from registry scans updating updated_at on every poll for exited jobs. - scan_registered_jobs preserves created_at from the registry item instead of using dashboard discovery time. - scan_registered_jobs only updates updated_at for running jobs or status transitions, not for already-terminal jobs. - Add tests for running vs terminal duration calculation. --- areno/dashboard/server.py | 25 +++++++++++++++++++++---- tests/test_dashboard_runs_cpu.py | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/areno/dashboard/server.py b/areno/dashboard/server.py index d454a68f..c6117d68 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -69,11 +69,20 @@ def _parse_time(value: Any) -> float | None: return None -def _duration_seconds(created_at: Any, updated_at: Any) -> float | None: - """Return the elapsed seconds between two timestamps, or None if unparseable.""" +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 @@ -194,7 +203,7 @@ 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), + "duration_s": _duration_seconds(self.created_at, self.updated_at, self.status), "returncode": self.returncode, "pid": self.pid, "perf": self.perf, @@ -589,6 +598,8 @@ def scan_registered_jobs(self) -> None: or DEFAULT_METRICS_LOG_DIR, pid=pid, ) + 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" @@ -603,9 +614,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/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py index 27771b42..1aac927c 100644 --- a/tests/test_dashboard_runs_cpu.py +++ b/tests/test_dashboard_runs_cpu.py @@ -50,6 +50,21 @@ 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.""" @@ -100,6 +115,16 @@ def test_duration_none_when_created_at_invalid(self): 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( From 330c634c00c1f0d45a6950519ea62c4b8790abb5 Mon Sep 17 00:00:00 2001 From: shihuai Date: Thu, 30 Jul 2026 15:26:18 +0800 Subject: [PATCH 7/9] fix(dashboard): safe seed script and sort-safe mixed timestamps - Seed script merges synthetic jobs into existing state by default, preserving real jobs. Use --replace to discard existing data. - Seed emits ISO-8601 timestamps instead of epoch floats, avoiding TypeError in list_jobs sort when mixed with real jobs. - list_jobs sorts by _parse_time(created_at) instead of raw value to handle any str/float mixture safely. - Update docs to reflect merge mode and --replace flag. --- areno/dashboard/server.py | 2 +- docs/cli/dashboard.rst | 18 +++++++++------- scripts/seed_dashboard.py | 45 ++++++++++++++++++++++++++++----------- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/areno/dashboard/server.py b/areno/dashboard/server.py index c6117d68..8660f877 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -499,7 +499,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: diff --git a/docs/cli/dashboard.rst b/docs/cli/dashboard.rst index 5dd1d106..8ec84b2c 100644 --- a/docs/cli/dashboard.rst +++ b/docs/cli/dashboard.rst @@ -107,20 +107,22 @@ without running real training jobs: python scripts/seed_dashboard.py --count 50 areno dashboard --start -This writes 50 synthetic jobs with mixed states, algorithms, types, and -timestamps to ``.areno-dashboard-state.json`` in the current directory. -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. The dashboard reads -this file on startup and on each polling cycle, so a restart is needed -after generating fresh data: +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 + 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 --------------- diff --git a/scripts/seed_dashboard.py b/scripts/seed_dashboard.py index 38ce4208..53decdec 100644 --- a/scripts/seed_dashboard.py +++ b/scripts/seed_dashboard.py @@ -2,19 +2,23 @@ """Seed the AReno dashboard state file with synthetic jobs for testing. Usage: - python scripts/seed_dashboard.py [--count 50] [--output .areno-dashboard-state.json] + 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 -import time from pathlib import Path from uuid import uuid4 @@ -34,6 +38,11 @@ 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 = [] @@ -62,11 +71,10 @@ def make_job(index: int) -> dict: model = random.choice(MODELS) dataset = random.choice(DATASETS) status = random.choice(STATES) - now_ts = time.time() + 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) - # Half the jobs use sections format (like real CLI), half use flat dict (like dashboard launcher) use_sections = random.random() < 0.5 if kind == "serve": @@ -101,8 +109,8 @@ def make_job(index: int) -> dict: "stage": "registered" if status == "running" else "exited", "role": "", "step": step, - "created_at": created_ts, - "updated_at": updated_ts, + "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}"], @@ -117,17 +125,30 @@ 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() - jobs = [make_job(i) for i in range(args.count)] - payload = {"jobs": jobs} + 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") - print(f"Wrote {args.count} synthetic jobs to {args.output}") - print(f"States: {', '.join(sorted(set(j['status'] for j in jobs)))}") - algos = sorted(set(filter(None, (_launch_value(j['launch'], 'algo') for j in jobs)))) + 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 jobs)))}") + print(f"Types: {', '.join(sorted(set(j['kind'] for j in all_jobs)))}") if __name__ == "__main__": From dfd69ad43d7f8f7650439eaf11e7cd56644d0c6a Mon Sep 17 00:00:00 2001 From: shihuai Date: Thu, 30 Jul 2026 15:37:09 +0800 Subject: [PATCH 8/9] fix(dashboard): validate URL params, guard malformed sections, fix page clamp - _launch_value now guards against sections=None and items=None instead of raising TypeError on malformed nested structures - URL enum params (state/type/sort) validated against known values, invalid values fall back to defaults instead of producing empty results or broken sort - URL page param validated: rejects negative, Infinity, NaN, non-numeric - Page clamp effect now waits for jobList to load before clamping, preventing restored page=2 from being wiped to 1 on initial render - Add 3 tests for malformed sections (sections=None, items=None, sections as non-list) - Rebuild dashboard dist --- .../{index-ByDSHg-k.js => index-BeP2LTzY.js} | 106 +++++++++--------- areno/dashboard/dist/index.html | 2 +- areno/dashboard/server.py | 10 +- dashboard/src/main.jsx | 30 ++++- tests/test_dashboard_runs_cpu.py | 12 ++ 5 files changed, 98 insertions(+), 62 deletions(-) rename areno/dashboard/dist/assets/{index-ByDSHg-k.js => index-BeP2LTzY.js} (69%) diff --git a/areno/dashboard/dist/assets/index-ByDSHg-k.js b/areno/dashboard/dist/assets/index-BeP2LTzY.js similarity index 69% rename from areno/dashboard/dist/assets/index-ByDSHg-k.js rename to areno/dashboard/dist/assets/index-BeP2LTzY.js index 52ab89be..95a1dfeb 100644 --- a/areno/dashboard/dist/assets/index-ByDSHg-k.js +++ b/areno/dashboard/dist/assets/index-BeP2LTzY.js @@ -1,4 +1,4 @@ -(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 Qp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vo={exports:{}},Ha={};/** +(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 * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qm;function y0(){if(qm)return Ha;qm=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 Ha.Fragment=a,Ha.jsx=r,Ha.jsxs=r,Ha}var Ym;function x0(){return Ym||(Ym=1,Vo.exports=y0()),Vo.exports}var v=x0(),Qo={exports:{}},ke={};/** + */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 * @@ -14,7 +14,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Gm;function b0(){if(Gm)return ke;Gm=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 ze=!1;if(T===null)ze=!0;else switch(ce){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(T.$$typeof){case n:case a:ze=!0;break;case x:return ze=T._init,M(ze(T._payload),Y,_,le,se)}}if(ze)return se=se(T),ze=le===""?"."+ie(T,0):le,te(se)?(_="",ze!=null&&(_=ze.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,"$&/")+"/")+ze)),Y.push(se)),1;ze=0;var we=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 Xm;function S0(){return Xm||(Xm=1,Zo.exports=v0()),Zo.exports}var Fo={exports:{}},zt={};/** + */var Xm;function E0(){return Xm||(Xm=1,(function(n){function a(M,F){var ae=M.length;M.push(F);e:for(;0>>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 * @@ -30,7 +30,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Zm;function k0(){if(Zm)return zt;Zm=1;var n=Cs();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=k0(),Fo.exports}/** + */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 * @@ -38,170 +38,170 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Fm;function E0(){if(Fm)return qa;Fm=1;var n=S0(),a=Cs(),r=_0();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),ze=T(null);function we(e,t){switch(_(ce,t),_(se,e),_(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?om(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=om(t),e=sm(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&&_(ze,e);var t=le.current,l=sm(t,e.type);t!==l&&(_(se,e),_(le,l))}function yt(e){se.current===e&&(Y(le),Y(se)),ze.current===e&&(Y(ze),Ra._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=-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,Ki=n.unstable_shouldYield,Fi=n.unstable_requestPaint,bt=n.unstable_now,ti=n.unstable_getCurrentPriorityLevel,G=n.unstable_ImmediatePriority,P=n.unstable_UserBlockingPriority,xe=n.unstable_NormalPriority,Ce=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 fy=/[\n"\\]/g;function ln(e){return e.replace(fy,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 nf(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"&&ir(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 Pi={};Object.defineProperty(Pi,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Gu=!1}var el=null,Vu=null,rr=null;function sf(){if(rr)return rr;var e,t=Vu,l=t.length,i,c="value"in el?el.value:el.textContent,o=c.length;for(e=0;e=na),gf=" ",yf=!1;function xf(e,t){switch(e){case"keyup":return Hy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fi=!1;function Yy(e,t){switch(e){case"compositionend":return bf(t);case"keypress":return t.which!==32?null:(yf=!0,gf);case"textInput":return e=t.data,e===gf&&yf?null:e;default:return null}}function Gy(e,t){if(fi)return e==="compositionend"||!Fu&&xf(e,t)?(e=sf(),rr=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=zf(l)}}function wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ir(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=ir(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 Iy=Nn&&"documentMode"in document&&11>=document.documentMode,hi=null,Wu=null,ra=null,Pu=!1;function Nf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pu||hi==null||hi!==ir(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}),ra&&aa(ra,i)||(ra=i,i=Pr(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(g0){return t(w,g0)}),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),ha(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=gr(N.type,N.key,N.props,null,w.mode,V),ha(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,_r(N),V);if(N.$$typeof===Z)return Fe(w,z,br(w,N),V);Er(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{fa=0;var de=Fe(w,z,N,V);return _i=null,de}catch(oe){if(oe===ki||oe===Sr)throw oe;var qe=Ft(29,oe,null,w.mode);return qe.lanes=V,qe.return=w,qe}finally{}}}var Ql=eh(!0),th=eh(!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=pr(e),Uf(e,null,l),t}return mr(e,i,t,l),pr(e)}function da(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,Pa(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 ma(){if(Sc){var e=Si;if(e!==null)throw e}}function pa(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 nh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function lh(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=a1(A,i);xa(e,t,H,Pt(e))}else xa(e,t,i,Pt(e))}catch(X){xa(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 f1(){}function Uc(e,t,l,i){if(e.tag!==5)throw Error(u(476));var c=Rh(e).queue;jh(e,c,t,ae,l===null?f1:function(){return Lh(e),l(i)})}function Rh(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 Lh(e){var t=Rh(e);t.next===null&&(t=e.alternate.memoizedState),xa(e,t.next.queue,{},Pt())}function Hc(){return kt(Ra)}function Bh(){return at().memoizedState}function Uh(){return at().memoizedState}function h1(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),da(i,t,l)),t={cache:mc()},e.payload=t;return}t=t.return}}function d1(e,t,l){var i=Pt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},jr(e)?qh(t,l):(l=lc(e,t,l,i),l!==null&&(Gt(l,e,i),Yh(l,t,i)))}function Hh(e,t,l){var i=Pt();xa(e,t,l,i)}function xa(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(jr(e))qh(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 mr(e,t,c,0),Je===null&&dr(),!1}catch{}finally{}if(l=lc(e,t,c,i),l!==null)return Gt(l,e,i),Yh(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},jr(e)){if(t)throw Error(u(479))}else t=lc(e,l,i,2),t!==null&&Gt(t,e,2)}function jr(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function qh(e,t){Ai=zr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yh(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Pa(e,l)}}var ba={readContext:kt,use:Mr,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};ba.useEffectEvent=nt;var Gh={readContext:kt,use:Mr,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Ah,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Dr(4194308,4,wh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Dr(4194308,4,e,t)},useInsertionEffect:function(e,t){Dr(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=d1.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=Hh.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=jh.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||oh(i,t,l)}c.memoizedState=l;var o={value:l,getSnapshot:t};return c.queue=o,Ah(fh.bind(null,i,o,e),[e]),i.flags|=2048,zi(9,{destroy:void 0},sh.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=Cr++,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||um(e.nodeValue,l)),e||ll(t,!0)}else e=eu(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),Hr(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)Sa(i,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Tr(e),o!==null){for(t.flags|=128,Sa(i,!1),e=o.updateQueue,t.updateQueue=e,Hr(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hf(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()>Qr&&(t.flags|=128,c=!0,Sa(i,!1),t.lanes=4194304)}else{if(!c)if(e=Tr(o),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Hr(t,e),Sa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Be)return Pe(t),null}else 2*bt()-i.renderingStartTime>Qr&&l!==536870912&&(t.flags|=128,c=!0,Sa(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&&Hr(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 x1(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 hd(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 ka(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 dd(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{lh(t,l)}catch(i){Xe(e,e.return,i)}}}function md(e,t,l){l.props=Zl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Xe(e,t,i)}}function _a(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 pd(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 gd(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||gd(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 qr(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(qr(e,t,l),e=e.sibling;e!==null;)qr(e,t,l),e=e.sibling}function yd(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,xd=typeof WeakSet=="function"?WeakSet:Set,gt=null;function b1(e,t){if(e=e.containerInfo,To=uu,e=Mf(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},uu=!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=Em("link","href",c).get(i+(l.href||""));if(g){for(var b=0;bFe&&(g=Fe,Fe=ye,ye=g);var w=Cf(b,ye),z=Cf(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,wd(o.current),Td(o,o.current,g,l),Ge=b,wa(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(ht,o)}catch{}return!0}finally{F.p=c,M.T=i,Kd(e,t)}}function Jd(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)Jd(e,e,l);else for(;t!==null;){if(t.tag===3){Jd(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=Ih(2),i=ul(t,l,2),i!==null&&($h(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 k1;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=z1.bind(null,e,t,l),t.then(e,e))}function z1(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()-Vr?(Ge&2)===0&&Oi(e,0):co|=l,Ni===Oe&&(Ni=0)),An(e)}function Id(e,t){t===0&&(t=q()),e=Ll(e,t),e!==null&&(fe(e,t),An(e))}function C1(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Id(e,l)}function w1(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),Id(e,l)}function M1(e,t){return $n(e,t)}var Ir=null,Ri=null,yo=!1,$r=!1,xo=!1,gl=0;function An(e){e!==Ri&&e.next===null&&(Ri===null?Ir=Ri=e:Ri=Ri.next=e),$r=!0,yo||(yo=!0,D1())}function wa(e,t){if(!xo&&$r){xo=!0;do for(var l=!1,i=Ir;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,em(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,em(i,o));i=i.next}while(l);xo=!1}}function N1(){$d()}function $d(){$r=yo=!1;var e=0;gl!==0&&G1()&&(e=gl);for(var t=bt(),l=null,i=Ir;i!==null;){var c=i.next,o=Wd(i,t);o===0?(i.next=null,l===null?Ir=c:l.next=c,c===null&&(Ri=l)):(l=i,(e!==0||(o&3)!==0)&&($r=!0)),i=c}dt!==0&&dt!==5||wa(e),gl!==0&&(gl=0)}function Wd(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&&cm(X)&&(A=A.responseEnd,g+=H*(A"u"?null:document;function vm(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+'"]'),bm.has(c)||(bm.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 $1(e){Zn.D(e),vm("dns-prefetch",e,null)}function W1(e,t){Zn.C(e,t),vm("preconnect",e,t)}function P1(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(Oa(o))||t==="script"&&i.querySelector(ja(o))||(t=i.createElement("link"),Et(t,"link",e),pt(t),i.head.appendChild(t)))}}function e0(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(ja(o)))return}i=l.createElement("link"),Et(i,"link",e),pt(i),l.head.appendChild(i)}}}function t0(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(Oa(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,nu(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:b},c.set(o,g)}}}function n0(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(ja(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 l0(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(ja(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 Sm(e,t,l,i){var c=(c=ce.current)?tu(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(Oa(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||i0(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 Oa(e){return'link[rel="stylesheet"]['+e+"]"}function km(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function i0(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 ja(e){return"script[async]"+e}function _m(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),nu(i,l.precedence,e),t.instance=i;case"stylesheet":c=Bi(l.href);var o=e.querySelector(Oa(c));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;i=km(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,nu(o,l.precedence,e),t.instance=o;case"script":return o=Ui(l.src),(c=e.querySelector(ja(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,nu(i,l.precedence,e));return t.instance}function nu(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 a0(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 Tm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function r0(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(Oa(c));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=iu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=o,pt(o);return}o=t.ownerDocument||t,i=km(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=iu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Lo=0;function u0(e,t){return e.stylesheets&&e.count===0&&ru(e,e.stylesheets),0Lo?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ru(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var au=null;function ru(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,au=new Map,t.forEach(c0,e),au=null,iu.call(e))}function c0(e,t){if(!(t.state.loading&4)){var l=au.get(e);if(l)var i=l.get(null);else{l=new Map,au.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=E0(),Xo.exports}var T0=A0();function z0(n,a){const r={};return(n[n.length-1]===""?[...n,""]:n).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const C0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M0={};function Im(n,a){return(M0.jsx?w0:C0).test(n)}const N0=/[ \t\n\f\r]/g;function D0(n){return typeof n=="object"?n.type==="text"?$m(n.value):!1:$m(n)}function $m(n){return n.replace(N0,"")===""}class Ia{constructor(a,r,u){this.normal=r,this.property=a,u&&(this.space=u)}}Ia.prototype.normal={};Ia.prototype.property={};Ia.prototype.space=void 0;function Xp(n,a){const r={},u={};for(const s of n)Object.assign(r,s.property),Object.assign(u,s.normal);return new Ia(r,u,a)}function ms(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 O0=0;const Se=Pl(),ft=Pl(),ps=Pl(),I=Pl(),Ie=Pl(),$l=Pl(),en=Pl();function Pl(){return 2**++O0}const gs=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:ft,commaOrSpaceSeparated:en,commaSeparated:$l,number:I,overloadedBoolean:ps,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),Jo=Object.keys(gs);class ws extends Qt{constructor(a,r,u,s){let h=-1;if(super(a,r),Wm(this,"space",s),typeof u=="number")for(;++h4&&r.slice(0,4)==="data"&&U0.test(a)){if(a.charAt(4)==="-"){const h=a.slice(5).replace(Pm,Y0);u="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=a.slice(4);if(!Pm.test(h)){let f=h.replace(B0,q0);f.charAt(0)!=="-"&&(f="-"+f),a="data"+f}}s=ws}return new s(u,a)}function q0(n){return"-"+n.toLowerCase()}function Y0(n){return n.charAt(1).toUpperCase()}const G0=Xp([Zp,j0,Jp,Ip,$p],"html"),Ms=Xp([Zp,R0,Jp,Ip,$p],"svg");function V0(n){return n.join(" ").trim()}var qi={},Io,ep;function Q0(){if(ep)return Io;ep=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 tp;function X0(){if(tp)return qi;tp=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(Q0());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 Ya={},np;function Z0(){if(np)return Ya;np=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.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 Ya.camelCase=p,Ya}var Ga,lp;function K0(){if(lp)return Ga;lp=1;var n=Ga&&Ga.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},a=n(X0()),r=Z0();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,Ga=u,Ga}var F0=K0();const J0=Qp(F0),Wp=Pp("end"),Ns=Pp("start");function Pp(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 I0(n){const a=Ns(n),r=Wp(n);if(a&&r)return{start:a,end:r}}function Xa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ip(n.position):"start"in n||"end"in n?ip(n):"line"in n||"column"in n?ys(n):""}function ys(n){return ap(n&&n.line)+":"+ap(n&&n.column)}function ip(n){return ys(n&&n.start)+"-"+ys(n&&n.end)}function ap(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=Xa(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 Ds={}.hasOwnProperty,$0=new Map,W0=/[A-Z]/g,P0=new Set(["table","tbody","thead","tfoot","tr"]),ex=new Set(["td","th"]),eg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tx(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=ox(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=cx(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"?Ms:G0,stylePropertyNameCase:a.stylePropertyNameCase||"dom",tableCellAlignToStyle:a.tableCellAlignToStyle!==!1},h=tg(s,n,void 0);return h&&typeof h!="string"?h:s.create(n,s.Fragment,{children:h||void 0},void 0)}function tg(n,a,r){if(a.type==="element")return nx(n,a,r);if(a.type==="mdxFlowExpression"||a.type==="mdxTextExpression")return lx(n,a);if(a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement")return ax(n,a,r);if(a.type==="mdxjsEsm")return ix(n,a);if(a.type==="root")return rx(n,a,r);if(a.type==="text")return ux(n,a)}function nx(n,a,r){const u=n.schema;let s=u;a.tagName.toLowerCase()==="svg"&&u.space==="html"&&(s=Ms,n.schema=s),n.ancestors.push(a);const h=lg(n,a.tagName,!1),f=sx(n,a);let m=js(n,a);return P0.has(a.tagName)&&(m=m.filter(function(p){return typeof p=="string"?!D0(p):!0})),ng(n,f,h,a),Os(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function lx(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)}Fa(n,a.position)}function ix(n,a){if(a.data&&a.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(a.data.estree);Fa(n,a.position)}function ax(n,a,r){const u=n.schema;let s=u;a.name==="svg"&&u.space==="html"&&(s=Ms,n.schema=s),n.ancestors.push(a);const h=a.name===null?n.Fragment:lg(n,a.name,!0),f=fx(n,a),m=js(n,a);return ng(n,f,h,a),Os(f,m),n.ancestors.pop(),n.schema=u,n.create(a,h,f,r)}function rx(n,a,r){const u={};return Os(u,js(n,a)),n.create(a,n.Fragment,u,r)}function ux(n,a){return a.value}function ng(n,a,r,u){typeof r!="string"&&r!==n.Fragment&&n.passNode&&(a.node=u)}function Os(n,a){if(a.length>0){const r=a.length>1?a:a[0];r&&(n.children=r)}}function cx(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 ox(n,a){return r;function r(u,s,h,f){const m=Array.isArray(h.children),p=Ns(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 sx(n,a){const r={};let u,s;for(s in a.properties)if(s!=="children"&&Ds.call(a.properties,s)){const h=hx(n,s,a.properties[s]);if(h){const[f,m]=h;n.tableCellAlignToStyle&&f==="align"&&typeof m=="string"&&ex.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 fx(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 Fa(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 Fa(n,a.position);else h=u.value===null?!0:u.value;r[s]=h}return r}function js(n,a){const r=[];let u=-1;const s=n.passKeys?new Map:$0;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 cp={}.hasOwnProperty;function ag(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]/),Sx=Al(/[#-'*+\--9=?A-Z^-~]/);function ku(n){return n!==null&&(n<32||n===127)}const xs=Al(/\d/),kx=Al(/[\dA-Fa-f]/),_x=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 Zi(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 Cx(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 Vi(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};sp(y,-p),sp(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(fp,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:Gx},Yx={partial:!0,tokenize:Vx};function Gx(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(Yx,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 Vx(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 Qx={name:"codeText",previous:Zx,resolve:Xx,tokenize:Kx};function Xx(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&&Va(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),Va(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),Va(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 fg(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||ku(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 dg(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 Za(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 tb={name:"definition",tokenize:lb},nb={partial:!0,tokenize:ib};function lb(n,a,r){const u=this;let s;return h;function h(k){return n.enter("definition"),f(k)}function f(k){return hg.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)?Za(n,d)(k):d(k)}function d(k){return fg(n,x,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function x(k){return n.attempt(nb,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 ib(n,a,r){return u;function u(m){return $e(m)?Za(n,s)(m):r(m)}function s(m){return dg(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 ab={name:"hardBreakEscape",tokenize:rb};function rb(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 ub={name:"headingAtx",resolve:cb,tokenize:ob};function cb(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 ob(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 sb=["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"],dp=["pre","script","style","textarea"],fb={concrete:!0,name:"htmlFlow",resolveTo:mb,tokenize:pb},hb={partial:!0,tokenize:yb},db={partial:!0,tokenize:gb};function mb(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 pb(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&&dp.includes(se)?(s=1,u.interrupt?a(_):ee(_)):sb.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(hb,Y,Te)(_)):_===null||ge(_)?(n.exit("htmlFlowData"),Te(_)):(n.consume(_),ee)}function Te(_){return n.check(db,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 dp.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 gb(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 yb(n,a,r){return u;function u(s){return n.enter("lineEnding"),n.consume(s),n.exit("lineEnding"),n.attempt($a,a,r)}}const xb={name:"htmlText",tokenize:bb};function bb(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 Bs={name:"labelEnd",resolveAll:_b,resolveTo:Eb,tokenize:Ab},vb={tokenize:Tb},Sb={tokenize:zb},kb={tokenize:Cb};function _b(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:Ub},exit:qb,name:"list",tokenize:Bb},Rb={partial:!0,tokenize:Yb},Lb={partial:!0,tokenize:Hb};function Bb(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:xs(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(vu,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 xs(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($a,u.interrupt?r:x,n.attempt(Rb,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 Ub(n,a,r){const u=this;return u.containerState._closeFlow=void 0,n.check($a,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(Lb,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 Hb(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 Yb(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 mp={name:"setextUnderline",resolveTo:Gb,tokenize:Vb};function Gb(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 Vb(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 Qb={tokenize:Xb};function Xb(n){const a=this,r=n.attempt($a,u,n.attempt(this.parser.constructs.flowInitial,s,Ue(n,n.attempt(this.parser.constructs.flow,s,n.attempt(Ix,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 Zb={resolveAll:pg()},Kb=mg("string"),Fb=mg("text");function mg(n){return{resolveAll:pg(n==="text"?Jb: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 cv(n,a){let r=-1;const u=[];let s;for(;++r>>=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]||gp).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 kv(n,a){const r={type:"element",tagName:"del",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function _v(n,a){const r={type:"element",tagName:"em",properties:{},children:n.all(a)};return n.patch(a,r),n.applyData(a,r)}function Ev(n,a){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",u=String(a.identifier).toUpperCase(),s=Zi(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 Av(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 Tv(n,a){if(n.options.allowDangerousHtml){const r={type:"raw",value:a.value};return n.patch(a,r),n.applyData(a,r)}}function xg(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 zv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return xg(n,a);const s={src:Zi(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 Cv(n,a){const r={src:Zi(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 wv(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 Mv(n,a){const r=String(a.identifier).toUpperCase(),u=n.definitionById.get(r);if(!u)return xg(n,a);const s={href:Zi(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 Nv(n,a){const r={href:Zi(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 Dv(n,a,r){const u=n.all(a),s=r?Ov(r):bg(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(;++m0){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 jv(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=Ns(a.children[1]),p=Wp(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 Hv(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(bp(a.slice(s),s>0,!1)),h.join("")}function bp(n,a,r){let u=0,s=n.length;if(a){let h=n.codePointAt(u);for(;h===yp||h===xp;)u++,h=n.codePointAt(u)}if(r){let h=n.codePointAt(s-1);for(;h===yp||h===xp;)s--,h=n.codePointAt(s-1)}return s>u?n.slice(u,s):""}function Gv(n,a){const r={type:"text",value:Yv(String(a.value))};return n.patch(a,r),n.applyData(a,r)}function Vv(n,a){const r={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(a,r),n.applyData(a,r)}const Qv={blockquote:bv,break:vv,code:Sv,delete:kv,emphasis:_v,footnoteReference:Ev,heading:Av,html:Tv,imageReference:zv,image:Cv,inlineCode:wv,linkReference:Mv,link:Nv,listItem:Dv,list:jv,paragraph:Rv,root:Lv,strong:Bv,table:Uv,tableCell:qv,tableRow:Hv,text:Gv,thematicBreak:Vv,toml:mu,yaml:mu,definition:mu,footnoteDefinition:mu};function mu(){}const vg=-1,wu=0,Ka=1,_u=2,Us=3,Hs=4,qs=5,Ys=6,Sg=7,kg=8,_g=typeof self=="object"?self:globalThis,vp=(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 _g[n](a)},Xv=(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 vg:return r(f,s);case Ka:{const m=r([],s);for(const p of f)m.push(u(p));return m}case _u:{const m=r({},s);for(const[p,d]of f)m[u(p)]=u(d);return m}case Us:return r(new Date(f),s);case Hs:{const{source:m,flags:p}=f;return r(new RegExp(m,p),s)}case qs:{const m=r(new Map,s);for(const[p,d]of f)m.set(u(p),u(d));return m}case Ys:{const m=r(new Set,s);for(const p of f)m.add(u(p));return m}case Sg:{const{name:m,message:p}=f;return r(typeof _g[m]=="function"?vp(m,p):new Error(p),s)}case kg: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(vp(h,f),s)};return u},Sp=n=>Xv(new Map,n)(0),Il="",{toString:Zv}={},{keys:Kv}=Object,Qa=n=>{const a=typeof n;if(a!=="object"||!n)return[wu,a];const r=Zv.call(n).slice(8,-1);switch(r){case"Array":return[Ka,Il];case"Object":return[_u,Il];case"Date":return[Us,Il];case"RegExp":return[Hs,Il];case"Map":return[qs,Il];case"Set":return[Ys,Il];case"DataView":return[Ka,r]}return r.includes("Array")?[Ka,r]:n instanceof Error?[Sg,n.name||"Error"]:[_u,r]},pu=([n,a])=>n===wu&&(a==="function"||a==="symbol"),Fv=(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]=Qa(f);switch(m){case wu:{let x=f;switch(p){case"bigint":m=kg,x=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);x=null;break;case"undefined":return s([vg],f)}return s([m,x],f)}case Ka:{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 _u:{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 Kv(f))(n||!pu(Qa(f[S])))&&x.push([h(S),h(f[S])]);return y}case Us:return s([m,isNaN(f.getTime())?Il:f.toISOString()],f);case Hs:{const{source:x,flags:y}=f;return s([m,{source:x,flags:y}],f)}case qs:{const x=[],y=s([m,x],f);for(const[S,k]of f)(n||!(pu(Qa(S))||pu(Qa(k))))&&x.push([h(S),h(k)]);return y}case Ys:{const x=[],y=s([m,x],f);for(const S of f)(n||!pu(Qa(S)))&&x.push(h(S));return y}}const{message:d}=f;return s([m,{name:p,message:d}],f)};return h},kp=(n,{json:a,lossy:r}={})=>{const u=[];return Fv(!(a||r),!!a,new Map,u)(n),u},Eu=typeof structuredClone=="function"?(n,a)=>a&&("json"in a||"lossy"in a)?Sp(kp(n,a)):structuredClone(n):(n,a)=>Sp(kp(n,a));function Jv(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 Iv(n,a){return"Back to reference "+(n+1)+(a>1?"-"+a:"")}function $v(n){const a=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",r=n.options.footnoteBackContent||Jv,u=n.options.footnoteBackLabel||Iv,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:{...Eu(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`});const d={type:"element",tagName:"li",properties:h,children:f};return n.patch(a,d),n.applyData(a,d)}function Bv(n){let a=!1;if(n.type==="list"){a=n.spread||!1;const r=n.children;let u=-1;for(;!a&&++u1}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 tS;if(typeof n=="function")return Nu(n);if(typeof n=="object")return Array.isArray(n)?Wv(n):Pv(n);if(typeof n=="string")return eS(n);throw new Error("Expected function, string, or object as test")});function Wv(n){const a=[];let r=-1;for(;++r":""))+")"})}return S;function S(){let k=Eg,C,U,Q;if((!a||h(p,d,x[x.length-1]||void 0))&&(k=aS(r(p,x)),k[0]===vs))return k;if("children"in p&&p.children){const O=p;if(O.children&&k[0]!==iS)for(U=(u?O.children.length:-1)+f,Q=x.concat(O);U>-1&&U":""))+")"})}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 _p(n){let a=0,r=n.charCodeAt(a);for(;r===9||r===32;)a++,r=n.charCodeAt(a);return n.slice(a)}function Ep(n,a){const r=uS(n,a),u=r.one(n,void 0),s=$v(r),h=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return s&&h.children.push({type:"text",value:` -`},s),h}function hS(n,a){return n&&"run"in n?async function(r,u){const s=Ep(r,{file:u,...a});await n.run(s,u)}:function(r,u){return Ep(r,{file:u,...n||a})}}function Ap(n){if(n)throw n}var es,Tp;function dS(){if(Tp)return es;Tp=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:yS,dirname:xS,extname:bS,join:vS,sep:"/"};function yS(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');Wa(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 xS(n){if(Wa(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 bS(n){Wa(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 vS(...n){let a=-1,r;for(;++a0&&n.codePointAt(n.length-1)===47&&(r+="/"),a?"/"+r:r}function kS(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 Wa(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const _S={cwd:ES};function ES(){return"/"}function _s(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function AS(n){if(typeof n=="string")n=new URL(n);else if(!_s(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 TS(n)}function TS(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];ks(U)&&ks(k)&&(k=ts(!0,U,k)),u[S]=[d,k,...C]}}}}const MS=new Vs().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 Cp(n){if(!ks(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function wp(n,a,r){if(!r)throw new Error("`"+n+"` finished async. Use `"+a+"` instead")}function gu(n){return NS(n)?n:new Tg(n)}function NS(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function DS(n){return typeof n=="string"||OS(n)}function OS(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const jS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mp=[],Np={allowDangerousHtml:!0},RS=/^(https?|ircs?|mailto|xmpp)$/i,LS=[{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 BS(n){const a=US(n),r=HS(n);return qS(a.runSync(a.parse(r),r),n)}function US(n){const a=n.rehypePlugins||Mp,r=n.remarkPlugins||Mp,u=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Np}:Np;return MS().use(xv).use(r).use(hS,u).use(a)}function HS(n){const a=n.children||"",r=new Tg;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||YS;for(const x of LS)Object.hasOwn(a,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+jS+x.id,void 0);return Gs(n,d),tx(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 YS(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||RS.test(n.slice(0,a))?n:""}function Dp(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 GS(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function VS(n,a,r){const s=Mu((r||{}).ignore||[]),h=QS(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=Dp(n,"(");let h=Dp(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 zg(n,a){const r=n.input.charCodeAt(n.index-1);return(n.index===0||Wl(r)||zu(r))&&(!a||r!==47)}Cg.peek=d2;function a2(){this.buffer()}function r2(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function u2(){this.buffer()}function c2(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function o2(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 s2(n){this.exit(n)}function f2(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 h2(n){this.exit(n)}function d2(){return"["}function Cg(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 m2(){return{enter:{gfmFootnoteCallString:a2,gfmFootnoteCall:r2,gfmFootnoteDefinitionLabelString:u2,gfmFootnoteDefinition:c2},exit:{gfmFootnoteCallString:o2,gfmFootnoteCall:s2,gfmFootnoteDefinitionLabelString:f2,gfmFootnoteDefinition:h2}}}function p2(n){let a=!1;return n&&n.firstLineBlank&&(a=!0),{handlers:{footnoteDefinition:r,footnoteReference:Cg},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?wg:g2))),d(),p}}function g2(n,a,r){return a===0?n:wg(n,a,r)}function wg(n,a,r){return(r?"":" ")+n}const y2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mg.peek=k2;function x2(){return{canContainEols:["delete"],enter:{strikethrough:v2},exit:{strikethrough:S2}}}function b2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:y2}],handlers:{delete:Mg}}}function v2(n){this.enter({type:"delete",children:[]},n)}function S2(n){this.exit(n)}function Mg(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 k2(){return"~"}function _2(n){return n.length}function E2(n,a){const r=a||{},u=(r.align||[]).concat(),s=r.stringLength||_2,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()),z2);return s(),f}function z2(n,a,r){return">"+(r?"":" ")+n}function C2(n,a){return jp(n,a.inConstruct,!0)&&!jp(n,a.notInConstruct,!1)}function jp(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 M2(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 N2(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 D2(n,a,r,u){const s=N2(r),h=n.value||"",f=s==="`"?"GraveAccent":"Tilde";if(M2(n,r)){const y=r.enter("codeIndented"),S=r.indentLines(h,O2);return y(),S}const m=r.createTracker(u),p=s.repeat(Math.max(w2(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:` +`}),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 O2(n,a,r){return(r?"":" ")+n}function Qs(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 j2(n,a,r,u){const s=Qs(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 R2(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 Ja(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Au(n,a,r){const u=Vi(n),s=Vi(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}}Ng.peek=L2;function Ng(n,a,r,u){const s=R2(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=Au(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Ja(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Au(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Ja(y));const k=f.move(s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function L2(n,a,r){return r.options.emphasis||"*"}function B2(n,a){let r=!1;return Gs(n,function(u){if("value"in u&&/\r?\n|\r/.test(u.value)||u.type==="break")return r=!0,vs}),!!((!n.depth||n.depth<3)&&Rs(n)&&(a.options.setext||r))}function U2(n,a,r,u){const s=Math.max(Math.min(6,n.depth||1),1),h=r.createTracker(u);if(B2(n,r)){const x=r.enter("headingSetext"),y=r.enter("phrasing"),S=r.containerPhrasing(n,{...h.current(),before:` +`)),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=Ja(d.charCodeAt(0))+d.slice(1)),d=d?f+" "+d:f,r.options.closeAtx&&(d+=" "+f),p(),m(),d}Dg.peek=H2;function Dg(n){return n.value||""}function H2(){return"<"}Og.peek=q2;function Og(n,a,r,u){const s=Qs(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"!"}jg.peek=Y2;function jg(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 Y2(){return"!"}Rg.peek=G2;function Rg(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))}Bg.peek=V2;function Bg(n,a,r,u){const s=Qs(r),h=s==='"'?"Quote":"Apostrophe",f=r.createTracker(u);let m,p;if(Lg(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 V2(n,a,r){return Lg(n,r)?"<":"["}Ug.peek=Q2;function Ug(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 Q2(){return"["}function Xs(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 X2(n){const a=Xs(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 Z2(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 Hg(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 K2(n,a,r,u){const s=r.enter("list"),h=r.bulletCurrent;let f=n.ordered?Z2(r):Xs(r);const m=n.ordered?f==="."?")":".":X2(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),Hg(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 I2(n,a,r,u){const s=r.enter("paragraph"),h=r.enter("phrasing"),f=r.containerPhrasing(n,u);return h(),s(),f}const $2=Mu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function W2(n,a,r,u){return(n.children.some(function(f){return $2(f)})?r.containerPhrasing:r.containerFlow).call(r,n,u)}function P2(n){const a=n.options.strong||"*";if(a!=="*"&&a!=="_")throw new Error("Cannot serialize strong with `"+a+"` for `options.strong`, expected `*`, or `_`");return a}qg.peek=ek;function qg(n,a,r,u){const s=P2(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=Au(u.before.charCodeAt(u.before.length-1),d,s);x.inside&&(p=Ja(d)+p.slice(1));const y=p.charCodeAt(p.length-1),S=Au(u.after.charCodeAt(0),y,s);S.inside&&(p=p.slice(0,-1)+Ja(y));const k=f.move(s+s);return h(),r.attentionEncodeSurroundingInfo={after:S.outside,before:x.outside},m+p+k}function ek(n,a,r){return r.options.strong||"*"}function tk(n,a,r,u){return r.safe(n.value,u)}function nk(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 lk(n,a,r){const u=(Hg(r)+(r.options.ruleSpaces?" ":"")).repeat(nk(r));return r.options.ruleSpaces?u.slice(0,-1):u}const Yg={blockquote:T2,break:Rp,code:D2,definition:j2,emphasis:Ng,hardBreak:Rp,heading:U2,html:Dg,image:Og,imageReference:jg,inlineCode:Rg,link:Bg,linkReference:Ug,list:K2,listItem:J2,paragraph:I2,root:W2,strong:qg,text:tk,thematicBreak:lk};function ik(){return{enter:{table:ak,tableData:Lp,tableHeader:Lp,tableRow:uk},exit:{codeText:ck,table:rk,tableData:fs,tableHeader:fs,tableRow:fs}}}function ak(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 rk(n){this.exit(n),this.data.inTable=void 0}function uk(n){this.enter({type:"tableRow",children:[]},n)}function fs(n){this.exit(n)}function Lp(n){this.enter({type:"tableCell",children:[]},n)}function ck(n){let a=this.resume();this.data.inTable&&(a=a.replace(/\\([\\|])/g,ok));const r=this.stack[this.stack.length-1];r.type,r.value=a,this.exit(n)}function ok(n,a){return a==="|"?a:n}function sk(n){const a=n||{},r=a.tableCellPadding,u=a.tablePipeAlign,s=a.stringLength,h=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...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 E2(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 Ck={tokenize:Lk,partial:!0};function wk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ok,continuation:{tokenize:jk},exit:Rk}},text:{91:{name:"gfmFootnoteCall",tokenize:Dk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mk,resolveTo:Nk}}}}function Mk(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 Nk(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 Dk(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 Ok(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 jk(n,a,r){return n.check($a,a,n.attempt(Ck,a,r))}function Rk(n){n.exit("gfmFootnoteDefinition")}function Lk(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 Bk(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=Vi(C);return Q._open=!O||O===2&&!!U,Q._close=!U||U===2&&!!O,m(C)}}}class Uk{constructor(){this.map=[]}add(a,r,u){Hk(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 Hk(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 Vk(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 Uk;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({},Gi(a.events,s)),n.add(s,0,[["exit",h,a]]),h=void 0),h}function Up(n,a,r,u,s){const h=[],f=Gi(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 Gi(n,a){const r=n[a],u=r[0]==="enter"?"start":"end";return r[1][u]}const Qk={name:"tasklistCheck",tokenize:Zk};function Xk(){return{text:{91:Qk}}}function Zk(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:Kk},a,r)(p):r(p)}}function Kk(n,a,r){return Ue(n,u,"whitespace");function u(s){return s===null?r(s):a(s)}}function Fk(n){return ag([bk(),wk(),Bk(n),Yk(),Xk()])}const Jk={};function Ik(n){const a=this,r=n||Jk,u=a.data(),s=u.micromarkExtensions||(u.micromarkExtensions=[]),h=u.fromMarkdownExtensions||(u.fromMarkdownExtensions=[]),f=u.toMarkdownExtensions||(u.toMarkdownExtensions=[]);s.push(Fk(r)),h.push(pk()),f.push(gk(r))}/** +`))}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 $k=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ig=(...n)=>n.filter((a,r,u)=>!!a&&a.trim()!==""&&u.indexOf(a)===r).join(" ").trim();/** + */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 Wk={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"};/** + */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 Pk=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,...Wk,width:a,height:a,stroke:n,strokeWidth:u?Number(r)*24/Number(a):r,className:Ig("lucide",s),...m},[...f.map(([d,x])=>he.createElement(d,x)),...Array.isArray(h)?h:[h]]));/** + */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(Pk,{ref:h,iconNode:a,className:Ig(`lucide-${$k(n)}`,u),...s}));return r.displayName=`${n}`,r};/** + */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 $g=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"}]]);/** + */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 e_=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"}]]);/** + */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 Wg=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"}]]);/** + */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 t_=rt("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/** + */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 n_=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"}]]);/** + */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 Pg=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"}]]);/** + */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 l_=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"}]]);/** + */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 i_=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"}]]);/** + */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 a_=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"}]]);/** + */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 r_=rt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */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 Ks=rt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */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 ey=rt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */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 u_=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"}]]);/** + */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 c_=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"}]]);/** + */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 o_=rt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */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 s_=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"}]]);/** + */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 As=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"}]]);/** + */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 ty=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"}]]);/** + */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 f_=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"}]]);/** + */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 h_=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"}]]);/** + */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 d_=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"}]]),ny=new URL(".",window.location.href).pathname;async function El(n,a){const r=await fetch(`${ny}${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 Qi=[{role:"assistant",content:"Select a job, then ask about metrics, runtime, logs, or how to start the next AReno task."}],m_="areno-dashboard-agent-chat",ly="areno-dashboard-agent-chat-sessions",Hp="areno-dashboard-agent-active-chat",qp="areno-dashboard-agent-draft";function p_(){try{const n=JSON.parse(localStorage.getItem(m_)||"[]");return Array.isArray(n)&&n.length?n:Qi}catch{return Qi}}function Su(n=Qi,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 g_(){try{const n=JSON.parse(localStorage.getItem(ly)||"[]");if(Array.isArray(n)&&n.length)return n.map(a=>{var r;return{...a,messages:(r=a.messages)!=null&&r.length?a.messages:Qi}})}catch{}return[Su(p_(),"Default chat")]}function y_(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 x_={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:""},b_={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:""},v_=[{value:"newest",label:"Start time (newest)"},{value:"oldest",label:"Start time (oldest)"},{value:"duration_desc",label:"Duration (longest)"},{value:"duration_asc",label:"Duration (shortest)"}],S_=["all","running","succeeded","failed","stopped","exited","unknown"],k_=["all","train","serve"];function Yi(n,a){return new URLSearchParams(window.location.search).get(n)||a}function __(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 xu(n,a){const r=n[a];return typeof r=="number"?r:typeof r=="string"&&Date.parse(r)||0}function E_(){var zl,Cl,wl,Sn,Ml,Pn;const[n,a]=he.useState(null),[r,u]=he.useState(x_),[s,h]=he.useState(b_),[f,m]=he.useState(()=>localStorage.getItem(qp)||""),[p,d]=he.useState(()=>g_()),[x,y]=he.useState(()=>localStorage.getItem(Hp)||""),[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(()=>Number(Yi("page","1"))||1),[ee,Te]=he.useState(()=>Yi("q","")),[ie,W]=he.useState(()=>Yi("state","all")),[M,F]=he.useState(()=>Yi("type","all")),[ae,Ee]=he.useState(()=>Yi("algo","all")),[E,T]=he.useState(()=>Yi("sort","newest")),[Y,_]=he.useState(0),le=he.useRef(null),se=hs(()=>El("/api/env"),5e3),ce=hs(()=>El("/api/jobs"),2e3),ze=hs(()=>n?El(`/api/jobs/${n}`):Promise.resolve(null),3e3,[n]),we=((zl=ce.data)==null?void 0:zl.jobs)||[],Re=10,jt=he.useMemo(()=>["all",...Array.from(new Set(we.map(q=>q.algo).filter(Boolean))).sort()],[we]),yt=he.useMemo(()=>{let $=we;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)=>xu(fe,"created_at")-xu(ve,"created_at")):E==="oldest"?q.sort((ve,fe)=>xu(ve,"created_at")-xu(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},[we,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=ze.data)==null?void 0:Cl.job)||(n?we.find($=>$.id===n):null)||null,In=he.useMemo(()=>p.find($=>$.id===x)||p[0]||Su(),[p,x]),bn=In.messages||Qi;he.useEffect(()=>{n&&we.length&&!we.some($=>$.id===n)&&a(null)},[we.length,n]),he.useEffect(()=>{R>xt&&ne(xt)},[R,xt]),he.useEffect(()=>{__({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(ly,JSON.stringify(p.slice(-40)))},[p]),he.useEffect(()=>{if(!p.length){const $=Su();d([$]),y($.id);return}p.some($=>$.id===x)||y(p[0].id)},[p,x]),he.useEffect(()=>{x&&localStorage.setItem(Hp,x)},[x]),he.useEffect(()=>{localStorage.setItem(qp,f)},[f]),he.useEffect(()=>{const $=le.current;$&&($.scrollTop=$.scrollHeight)},[bn,S]);const $n=[{id:"jobs",label:"Jobs",icon:v.jsx($g,{size:16})},{id:"runtime",label:"Runtime",icon:v.jsx(As,{size:16})},{id:"launcher",label:"Launcher",icon:v.jsx(Ks,{size:16})},{id:"agent",label:"Agent",icon:v.jsx(e_,{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 Ki(){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 Fi(){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:Ce(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||Qi,Tt=typeof $=="function"?$(mt):$;return{...fe,messages:Tt,updatedAt:Date.now(),title:y_(Tt,fe.title)}}))}function P(){const $=Su();d(q=>[$,...q]),y($.id),m(""),k("chat")}function xe($){y($),k("chat")}function Ce($){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(`${ny}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 Pa=Tt.body.getReader(),er=new TextDecoder;let Cn="";for(;;){const{value:Nl,done:tr}=await Pa.read();if(tr)break;Cn+=er.decode(Nl,{stream:!0});const Ji=Cn.split(` -`);Cn=Ji.pop()||"";for(const mn of Ji)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(L_,{env:se.data}),v.jsx(B_,{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(eE,{config:r,setConfig:u,onStart:Ki}):v.jsx(nE,{config:s,setConfig:h,onStart:Fi})]}):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(ey,{size:15})," New Chat"]}),v.jsxs("button",{className:"secondaryButton",onClick:()=>be(!0),children:[v.jsx(ty,{size:15})," Settings"]})]})]}),v.jsxs("div",{className:"agentTabs",children:[v.jsxs("button",{className:Ct(S==="chat"&&"active"),onClick:()=>k("chat"),children:[v.jsx(a_,{size:15})," Chat"]}),v.jsxs("button",{className:Ct(S==="history"&&"active"),onClick:()=>k("history"),children:[v.jsx(l_,{size:15})," History"]})]}),S==="history"?v.jsx(T_,{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(w_,{events:q.events}):v.jsx(Fs,{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(s_,{size:16})," Send"]})]})]}),me&&v.jsx(z_,{title:"Agent Settings",onClose:()=>be(!1),children:v.jsx(A_,{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(t_,{size:16})," Stop"]})]})]}),v.jsx(U_,{job:Le}),v.jsx(C_,{job:Le,refreshNonce:Y}),v.jsx(F_,{samples:(Le==null?void 0:Le.samples)||[]}),v.jsxs("div",{className:"split",children:[v.jsx(I_,{config:Le==null?void 0:Le.config,launch:Le==null?void 0:Le.launch}),v.jsx(P_,{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"})]})]}),we.length>0&&v.jsxs("div",{className:"jobToolbar",children:[v.jsxs("div",{className:"jobSearch",children:[v.jsx(o_,{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:S_.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:k_.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:v_.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(c_,{size:14})," Reset"]})]})]}),v.jsxs("div",{className:"jobList",children:[we.length===0&&v.jsx(zs,{title:"No jobs yet",text:"Start a train or serve task from the launcher."}),yt.length===0&&we.length>0&&v.jsx(zs,{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(As,{size:16}):v.jsx(i_,{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",we.length>yt.length&&` (filtered from ${we.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(h_,{size:16}):v.jsx(r_,{size:16})}),v.jsx("button",{className:"iconButton",onClick:()=>{se.refresh(),ce.refresh(),ze.refresh(),_($=>$+1)},title:"Refresh",children:v.jsx(u_,{size:16})})]})]}),L&&v.jsx("div",{className:"notice",children:L}),vn()]})]})}function A_({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 T_({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(ey,{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 z_({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 C_({job:n,refreshNonce:a}){return v.jsxs("div",{className:"jobMetricsGrid",children:[v.jsx("div",{className:"panel insetPanel",children:v.jsx(V_,{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(Z_,{rows:(n==null?void 0:n.timeperf)||[]})})]})}function w_({events:n}){return v.jsx("div",{className:"agentEventList",children:n.map((a,r)=>a.type==="reasoning"?v.jsx(M_,{text:a.text},r):a.type==="content"?v.jsx(Fs,{text:a.text},r):a.type==="tool_call"?v.jsx(N_,{call:a.call,live:a.live},r):a.type==="tool_result"?v.jsx(j_,{result:a.result},r):null)})}function Fs({text:n}){return v.jsx("div",{className:"markdownBlock",children:v.jsx(BS,{remarkPlugins:[Ik],children:n||""})})}function M_({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(Fs,{text:n})]})}function N_({call:n,live:a=!1}){const u=((n==null?void 0:n.function)||{}).name||(n==null?void 0:n.name)||"tool",s=O_(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:D_(u,s)}),v.jsx("em",{children:a?"running":""})]}),v.jsx("pre",{children:s})]})}function D_(n,a){const r=iy(a);return!r||r==="{}"?`${n}()`:`${n}(${r})`}function O_(n){return(n.function||{}).arguments||n.arguments||JSON.stringify(n,null,2)}function j_({result:n}){const a=R_(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:iy(a)||"No output."})]}),v.jsx("pre",{children:a})]})}function iy(n){return String(n||"").replace(/\s+/g," ").trim()}function R_(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(` + */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 L_({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(bu,{icon:v.jsx(Pg,{size:15}),label:"AReno",value:((x=r.areno)==null?void 0:x.version)||"unknown"}),v.jsx(bu,{icon:v.jsx(n_,{size:15}),label:"PyTorch",value:s.version||"missing"}),v.jsx(bu,{icon:v.jsx(As,{size:15}),label:"CUDA",value:s.cuda_build||"none"}),v.jsx(bu,{icon:v.jsx(Wg,{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 B_({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(zs,{title:"No GPU detected",text:"nvidia-smi did not return device utilization."})})})}function bu({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 U_({job:n}){const a=ay(n),r=H_(n),u=Math.max(0,a.findIndex(s=>Ts(s,r,n)));return v.jsx("div",{className:"timeline",children:a.map((s,h)=>v.jsxs("div",{className:Ct("timelineItem",h<=u&&"done",Ts(s,r,n)&&"current"),children:[v.jsx("span",{children:h+1}),v.jsx("label",{children:s.label})]},s.id))})}function ay(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=q_(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 H_(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=ay(n).find(s=>Ts(s,a,n));return(u==null?void 0:u.id)||a}function Ts(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 q_(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 Y_(n){return(n||[]).map(a=>a.name).sort()}function G_(n,a){return a&&n.includes(a)?a:n[0]||""}function V_({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=Y_(m),Q=G_(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=Q_(K,h),re=X_(K,Z);return v.jsxs("div",{className:"chart",children:[v.jsxs("div",{className:"chartHeader",children:[v.jsxs("span",{children:[v.jsx($g,{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 Q_(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 X_(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:Yp(u),maxLabel:Yp(s)}}function Yp(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 Z_({rows:n}){const a=K_(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(d_,{size:14})," Runtime timeperf"]})}),v.jsxs("div",{className:"legend",children:[s.map(h=>v.jsxs("span",{children:[v.jsx("i",{className:Gp(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:Gp(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 K_(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 Gp(n){return`seg-${String(n||"other").replace(/[^a-zA-Z0-9]+/g,"-")}`}function F_({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:J_(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(Pg,{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 J_(n,a){return`${n.step??"x"}-${n.prompt_idx??"x"}-${n.sample_idx??"x"}-${a}`}function I_({config:n,launch:a}){const r=n&&Object.keys(n).length?n:a||{},u=$_(r);return v.jsxs("div",{className:"codeCard",children:[v.jsxs("div",{className:"codeTitle",children:[v.jsx(ty,{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:W_(f)})]},h))})]},s.title))}):v.jsx("pre",{children:"No config captured yet."})]})}function $_(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 W_(n){return Array.isArray(n)?n.join(" "):typeof n=="object"?JSON.stringify(n):String(n)}function P_({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(f_,{size:14})," Logs"]}),v.jsx("pre",{children:n.slice(-80).join(` -`)||"No logs yet."})]})}function eE({config:n,setConfig:a,onStart:r}){const u=String(n.algo||"sft").toLowerCase(),s=tE(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(Ks,{size:16})," Start train"]})]})}function tE(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:[ds("algo","Algorithm",["sft","dpo","gspo","grpo","ppo"],!0),pe("ckpt","Checkpoint"),ds("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),ds("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 ds(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 nE({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(Ks,{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 zs({title:n,text:a}){return v.jsxs("div",{className:"empty",children:[v.jsx(Wg,{size:18}),v.jsx("strong",{children:n}),v.jsx("span",{children:a})]})}const Vp=typeof document<"u"?document.getElementById("root"):null;Vp&&T0.createRoot(Vp).render(v.jsx(E_,{})); +${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/index.html b/areno/dashboard/dist/index.html index 967236a9..f159c9b9 100644 --- a/areno/dashboard/dist/index.html +++ b/areno/dashboard/dist/index.html @@ -4,7 +4,7 @@ AReno Dashboard - + diff --git a/areno/dashboard/server.py b/areno/dashboard/server.py index 8660f877..1c90404f 100644 --- a/areno/dashboard/server.py +++ b/areno/dashboard/server.py @@ -95,10 +95,16 @@ def _launch_value(launch: Any, key: str, default: Any = "") -> Any: return default if key in launch: return launch[key] or default - for section in launch.get("sections", []): + sections = launch.get("sections") + if not isinstance(sections, list): + return default + for section in sections: if not isinstance(section, dict): continue - for item in section.get("items", []): + 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 diff --git a/dashboard/src/main.jsx b/dashboard/src/main.jsx index 708b1867..b67e8f5d 100644 --- a/dashboard/src/main.jsx +++ b/dashboard/src/main.jsx @@ -205,12 +205,28 @@ const SORT_OPTIONS = [ 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 = ""; @@ -247,12 +263,12 @@ function App() { const [theme, setTheme] = useState(() => localStorage.getItem("areno-dashboard-theme") || "dark"); const [busy, setBusy] = useState(""); const [agentSettingsOpen, setAgentSettingsOpen] = useState(false); - const [jobPage, setJobPage] = useState(() => Number(readUrlParam("page", "1")) || 1); + const [jobPage, setJobPage] = useState(() => readUrlPage(1)); const [searchQuery, setSearchQuery] = useState(() => readUrlParam("q", "")); - const [stateFilter, setStateFilter] = useState(() => readUrlParam("state", "all")); - const [typeFilter, setTypeFilter] = useState(() => readUrlParam("type", "all")); + 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(() => readUrlParam("sort", "newest")); + const [sortKey, setSortKey] = useState(() => readUrlEnum("sort", "newest", VALID_SORTS)); const [refreshNonce, setRefreshNonce] = useState(0); const chatMessagesRef = useRef(null); const env = usePolling(() => api("/api/env"), 5000); @@ -321,8 +337,10 @@ 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({ diff --git a/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py index 1aac927c..18b73262 100644 --- a/tests/test_dashboard_runs_cpu.py +++ b/tests/test_dashboard_runs_cpu.py @@ -207,6 +207,18 @@ def test_serve_sections_with_model_path(self): } 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).""" From e0ccecf632fdf6c296aa8e8b9a67086e9086e7ba Mon Sep 17 00:00:00 2001 From: shihuai Date: Mon, 17 Aug 2026 09:53:37 +0800 Subject: [PATCH 9/9] fix(dashboard): pass pre-commit hooks (ruff format, eof, import sort) - Sort imports alphabetically in test file - Expand multi-line dict/list to satisfy ruff-format - Use double quotes consistently in seed script - Add trailing newline to both files - Remove extra blank line after import in seed script --- scripts/seed_dashboard.py | 23 +++++---- tests/test_dashboard_runs_cpu.py | 85 +++++++++++++++++++++----------- 2 files changed, 70 insertions(+), 38 deletions(-) diff --git a/scripts/seed_dashboard.py b/scripts/seed_dashboard.py index 53decdec..8e86d205 100644 --- a/scripts/seed_dashboard.py +++ b/scripts/seed_dashboard.py @@ -24,7 +24,6 @@ from areno.dashboard.server import _launch_value - STATES = ["running", "succeeded", "failed", "stopped", "exited"] ALGOS = ["sft", "dpo", "gspo", "grpo", "ppo"] MODELS = [ @@ -85,13 +84,17 @@ def make_job(index: int) -> dict: 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"), - ]) + 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}" @@ -146,10 +149,10 @@ def main() -> None: 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)))) + 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() \ No newline at end of file + main() diff --git a/tests/test_dashboard_runs_cpu.py b/tests/test_dashboard_runs_cpu.py index 18b73262..d3a6ecac 100644 --- a/tests/test_dashboard_runs_cpu.py +++ b/tests/test_dashboard_runs_cpu.py @@ -2,7 +2,7 @@ import unittest -from areno.dashboard.server import Job, _parse_time, _duration_seconds, _launch_value +from areno.dashboard.server import Job, _duration_seconds, _launch_value, _parse_time class ParseTimeTest(unittest.TestCase): @@ -95,8 +95,19 @@ def test_existing_fields_unchanged(self): 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", + "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}") @@ -175,14 +186,20 @@ 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}, - ]}, + { + "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") @@ -200,9 +217,12 @@ def test_none_launch(self): def test_serve_sections_with_model_path(self): launch = { "sections": [ - {"title": "Basic", "items": [ - {"key": "model_path", "value": "Qwen/Qwen3-0.6B"}, - ]}, + { + "title": "Basic", + "items": [ + {"key": "model_path", "value": "Qwen/Qwen3-0.6B"}, + ], + }, ] } self.assertEqual(_launch_value(launch, "model_path"), "Qwen/Qwen3-0.6B") @@ -227,11 +247,14 @@ 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"}, - ]}, + { + "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() @@ -243,9 +266,12 @@ 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"}, - ]}, + { + "title": "Basic", + "items": [ + {"key": "model_path", "value": "Qwen/Qwen3-0.6B"}, + ], + }, ] } summary = job.to_summary_json() @@ -257,11 +283,14 @@ def test_from_json_with_sections_launch(self): 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"}, - ]}, + { + "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() @@ -273,4 +302,4 @@ def test_from_json_with_sections_launch(self): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main()