taskmeld 0.1.1 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +176 -172
  3. package/README.zh-CN.md +176 -172
  4. package/dist/src/app/app-context-env.js +1 -1
  5. package/dist/src/app/create-app-context.js +3 -3
  6. package/dist/src/app/data-dir.js +13 -3
  7. package/dist/src/app/pipeline-config.js +4 -4
  8. package/dist/src/app/pipeline-registry.js +11 -11
  9. package/dist/src/app/pipeline-runtime.js +6 -9
  10. package/dist/src/app/runtime-store.js +3 -3
  11. package/dist/src/artifacts/artifact-cleanup.js +17 -17
  12. package/dist/src/artifacts/artifact-index.js +14 -14
  13. package/dist/src/artifacts/artifact-rebuilder.js +3 -3
  14. package/dist/src/artifacts/storage-service.js +18 -18
  15. package/dist/src/cli/bootstrap.js +7 -7
  16. package/dist/src/cli/commands/agent.js +12 -11
  17. package/dist/src/cli/commands/artifact.js +31 -30
  18. package/dist/src/cli/commands/init.js +49 -47
  19. package/dist/src/cli/commands/pipeline/result.js +9 -8
  20. package/dist/src/cli/commands/pipeline/selector.js +1 -1
  21. package/dist/src/cli/commands/pipeline/watch.js +2 -2
  22. package/dist/src/cli/commands/pipeline.js +54 -53
  23. package/dist/src/cli/commands/scheduler.js +9 -8
  24. package/dist/src/cli/commands/server.js +12 -11
  25. package/dist/src/cli/commands/system.js +4 -3
  26. package/dist/src/cli/errors.js +2 -2
  27. package/dist/src/cli/help.js +18 -17
  28. package/dist/src/cli/i18n.js +46 -0
  29. package/dist/src/cli/locales/en.json +244 -0
  30. package/dist/src/cli/locales/zh.json +244 -0
  31. package/dist/src/cli/output.js +3 -3
  32. package/dist/src/cli/renderers/engine/markdown.js +1 -1
  33. package/dist/src/cli/renderers/specs/index.js +1 -1
  34. package/dist/src/cli/router.js +1 -1
  35. package/dist/src/cli/server-runtime-client.js +54 -95
  36. package/dist/src/cli/ui-prompts.js +96 -0
  37. package/dist/src/cli/ws-runtime-client.js +51 -0
  38. package/dist/src/gateway/gateway-client.js +4 -4
  39. package/dist/src/index.js +28 -2
  40. package/dist/src/logs/run-log-reader.js +1 -1
  41. package/dist/src/pipeline/agent-activity.js +2 -2
  42. package/dist/src/pipeline/artifact-storage.js +11 -11
  43. package/dist/src/pipeline/diagnostics/dependency-diagnostic.js +11 -11
  44. package/dist/src/pipeline/dispatch/pipeline-inbound-queue.js +2 -2
  45. package/dist/src/pipeline/execution/group-item-executor.js +1 -1
  46. package/dist/src/pipeline/execution/node-item-executor.js +3 -3
  47. package/dist/src/pipeline/execution/node-runner.js +7 -7
  48. package/dist/src/pipeline/execution/readiness-state.js +1 -1
  49. package/dist/src/pipeline/execution/reject-handler.js +5 -5
  50. package/dist/src/pipeline/execution/rejected-artifact-archiver.js +1 -1
  51. package/dist/src/pipeline/execution/route-item-manager.js +4 -4
  52. package/dist/src/pipeline/execution/run-abort-controller.js +5 -5
  53. package/dist/src/pipeline/execution/run-state-helpers.js +2 -2
  54. package/dist/src/pipeline/execution/service.js +4 -4
  55. package/dist/src/pipeline/execution/structured-node-runner.js +24 -24
  56. package/dist/src/pipeline/execution-timeout.js +3 -3
  57. package/dist/src/pipeline/identity/index.js +3 -3
  58. package/dist/src/pipeline/item-batch-controller.js +6 -6
  59. package/dist/src/pipeline/scheduler/dependency-state.js +5 -5
  60. package/dist/src/pipeline/scheduler-service.js +24 -24
  61. package/dist/src/pipeline/state-machine.js +2 -2
  62. package/dist/src/pipeline/structured-output/contract.js +4 -4
  63. package/dist/src/pipeline/structured-output/index.js +2 -2
  64. package/dist/src/pipeline/structured-output/parser.js +5 -5
  65. package/dist/src/pipeline/structured-output/prompt.js +38 -38
  66. package/dist/src/pipeline/structured-output/waiter.js +6 -6
  67. package/dist/src/pipeline/template.js +5 -5
  68. package/dist/src/pipeline/timeline-log-store.js +5 -5
  69. package/dist/src/pipeline/tool-activity.js +3 -3
  70. package/dist/src/pipeline/types/pipeline-output.js +1 -1
  71. package/dist/src/pipeline/workflow/branch-rules.js +19 -19
  72. package/dist/src/pipeline/workflow/io.js +1 -1
  73. package/dist/src/pipeline/workflow/normalize.js +18 -18
  74. package/dist/src/pipeline/workflow/template-mapper.js +3 -3
  75. package/dist/src/pipeline/workflow/validate.js +39 -39
  76. package/dist/src/pipeline/workflow-graph.js +10 -10
  77. package/dist/src/server/http-handler.js +74 -0
  78. package/dist/src/services/agent-service.js +2 -2
  79. package/dist/src/services/gateway-read-helpers.js +1 -1
  80. package/dist/src/services/pipeline-service.js +19 -19
  81. package/dist/src/services/pipeline-status.js +4 -4
  82. package/dist/src/services/read-services.js +1 -1
  83. package/dist/src/services/session-service.js +6 -6
  84. package/dist/src/services/system-service.js +1 -1
  85. package/dist/src/transport/ws-broker.js +12 -1
  86. package/dist/src/transport/ws-handler.js +60 -0
  87. package/dist/src/transport/ws-methods/agents.js +144 -0
  88. package/dist/src/transport/ws-methods/artifacts.js +171 -0
  89. package/dist/src/transport/ws-methods/gateway.js +16 -0
  90. package/dist/src/transport/ws-methods/logs.js +43 -0
  91. package/dist/src/transport/ws-methods/pipeline-batch.js +68 -0
  92. package/dist/src/transport/ws-methods/pipeline-links.js +100 -0
  93. package/dist/src/transport/ws-methods/pipeline-queue.js +51 -0
  94. package/dist/src/transport/ws-methods/pipeline-runtime.js +151 -0
  95. package/dist/src/transport/ws-methods/pipeline-scheduler.js +48 -0
  96. package/dist/src/transport/ws-methods/pipeline-workflow.js +127 -0
  97. package/dist/src/transport/ws-methods/pipelines.js +56 -0
  98. package/dist/src/transport/ws-methods/register-all.js +32 -0
  99. package/dist/src/transport/ws-methods/sessions.js +154 -0
  100. package/dist/src/transport/ws-methods/timeline.js +10 -0
  101. package/dist/src/{server/routes/pipeline-identity.js → transport/ws-methods/utils.js} +14 -9
  102. package/dist/src/version.js +1 -1
  103. package/package.json +16 -7
  104. package/web/dist/assets/agent-DP6TMcLj.js +1 -0
  105. package/web/dist/assets/agent-DmJHzLyj.js +1 -0
  106. package/web/dist/assets/artifact-BqnoZy2M.js +1 -0
  107. package/web/dist/assets/artifact-DfDkgkno.js +1 -0
  108. package/web/dist/assets/common-DRMTVwE9.js +1 -0
  109. package/web/dist/assets/common-DeXccbr2.js +1 -0
  110. package/web/dist/assets/dispatch-CBskGCQI.js +1 -0
  111. package/web/dist/assets/dispatch-sk4Wp30e.js +1 -0
  112. package/web/dist/assets/index-C8wTjZvH.css +1 -0
  113. package/web/dist/assets/index-DYDQZRLk.js +58 -0
  114. package/web/dist/assets/log-DN8cjb0w.js +1 -0
  115. package/web/dist/assets/log-HSeA_dYy.js +1 -0
  116. package/web/dist/assets/modal-BdNai9jf.js +1 -0
  117. package/web/dist/assets/modal-D9_KDpFD.js +1 -0
  118. package/web/dist/assets/nav-BmF7oAKg.js +1 -0
  119. package/web/dist/assets/nav-IjC2xqXQ.js +1 -0
  120. package/web/dist/assets/node-detail-CENRXcrh.js +1 -0
  121. package/web/dist/assets/node-detail-bndPr0IM.js +1 -0
  122. package/web/dist/assets/overview-B87zWAxq.js +1 -0
  123. package/web/dist/assets/overview-gQvk-NOK.js +1 -0
  124. package/web/dist/assets/pipeline-D4dSJRDz.js +1 -0
  125. package/web/dist/assets/pipeline-DZzyOqQa.js +1 -0
  126. package/web/dist/assets/session-CUWvU14v.js +5 -0
  127. package/web/dist/assets/session-DQ6UuCaJ.js +5 -0
  128. package/web/dist/assets/timeline-8y_2_0Em.js +1 -0
  129. package/web/dist/assets/timeline-CAPsXUTC.js +1 -0
  130. package/web/dist/index.html +3 -3
  131. package/dist/src/app/pipeline-plugin-config.js +0 -2
  132. package/dist/src/server/api-handler.js +0 -163
  133. package/dist/src/server/http-utils.js +0 -34
  134. package/dist/src/server/middleware.js +0 -61
  135. package/dist/src/server/router.js +0 -105
  136. package/dist/src/server/routes/agents.js +0 -189
  137. package/dist/src/server/routes/artifacts.js +0 -163
  138. package/dist/src/server/routes/gateway.js +0 -18
  139. package/dist/src/server/routes/health.js +0 -16
  140. package/dist/src/server/routes/logs.js +0 -73
  141. package/dist/src/server/routes/pipeline-batch.js +0 -163
  142. package/dist/src/server/routes/pipeline-diagnostics.js +0 -33
  143. package/dist/src/server/routes/pipeline-links.js +0 -117
  144. package/dist/src/server/routes/pipeline-outputs.js +0 -27
  145. package/dist/src/server/routes/pipeline-queue.js +0 -62
  146. package/dist/src/server/routes/pipeline-runtime.js +0 -162
  147. package/dist/src/server/routes/pipeline-scheduler.js +0 -69
  148. package/dist/src/server/routes/pipeline-workflow.js +0 -180
  149. package/dist/src/server/routes/pipelines.js +0 -96
  150. package/dist/src/server/routes/sessions.js +0 -244
  151. package/dist/src/server/routes/timeline.js +0 -14
  152. package/dist/src/server/serve-static.js +0 -42
  153. package/web/dist/assets/index-CWnfhkn-.js +0 -65
  154. package/web/dist/assets/index-gZ0xOfSO.css +0 -1
  155. /package/dist/src/{server → transport/ws-methods}/types.js +0 -0
@@ -0,0 +1,58 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&r(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=a(s);fetch(s.href,o)}})();function Nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var th={exports:{}},Ps={};var c0;function fN(){if(c0)return Ps;c0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,s,o){var f=null;if(o!==void 0&&(f=""+o),s.key!==void 0&&(f=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:f,ref:s!==void 0?s:null,props:o}}return Ps.Fragment=i,Ps.jsx=a,Ps.jsxs=a,Ps}var f0;function dN(){return f0||(f0=1,th.exports=fN()),th.exports}var x=dN(),nh={exports:{}},Ye={};var d0;function hN(){if(d0)return Ye;d0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=y&&B[y]||B["@@iterator"],typeof B=="function"?B:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,D={};function k(B,Z,w){this.props=B,this.context=Z,this.refs=D,this.updater=w||N}k.prototype.isReactComponent={},k.prototype.setState=function(B,Z){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,Z,"setState")},k.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function U(){}U.prototype=k.prototype;function T(B,Z,w){this.props=B,this.context=Z,this.refs=D,this.updater=w||N}var Q=T.prototype=new U;Q.constructor=T,M(Q,k.prototype),Q.isPureReactComponent=!0;var ee=Array.isArray;function R(){}var F={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function K(B,Z,w){var he=w.ref;return{$$typeof:e,type:B,key:Z,ref:he!==void 0?he:null,props:w}}function j(B,Z){return K(B.type,Z,B.props)}function P(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function q(B){var Z={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(w){return Z[w]})}var W=/\/+/g;function H(B,Z){return typeof B=="object"&&B!==null&&B.key!=null?q(""+B.key):Z.toString(36)}function ae(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(R,R):(B.status="pending",B.then(function(Z){B.status==="pending"&&(B.status="fulfilled",B.value=Z)},function(Z){B.status==="pending"&&(B.status="rejected",B.reason=Z)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function E(B,Z,w,he,Ce){var Se=typeof B;(Se==="undefined"||Se==="boolean")&&(B=null);var ze=!1;if(B===null)ze=!0;else switch(Se){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(B.$$typeof){case e:case i:ze=!0;break;case g:return ze=B._init,E(ze(B._payload),Z,w,he,Ce)}}if(ze)return Ce=Ce(B),ze=he===""?"."+H(B,0):he,ee(Ce)?(w="",ze!=null&&(w=ze.replace(W,"$&/")+"/"),E(Ce,Z,w,"",function(Dt){return Dt})):Ce!=null&&(P(Ce)&&(Ce=j(Ce,w+(Ce.key==null||B&&B.key===Ce.key?"":(""+Ce.key).replace(W,"$&/")+"/")+ze)),Z.push(Ce)),1;ze=0;var Ve=he===""?".":he+":";if(ee(B))for(var Ue=0;Ue<B.length;Ue++)he=B[Ue],Se=Ve+H(he,Ue),ze+=E(he,Z,w,Se,Ce);else if(Ue=v(B),typeof Ue=="function")for(B=Ue.call(B),Ue=0;!(he=B.next()).done;)he=he.value,Se=Ve+H(he,Ue++),ze+=E(he,Z,w,Se,Ce);else if(Se==="object"){if(typeof B.then=="function")return E(ae(B),Z,w,he,Ce);throw Z=String(B),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return ze}function _(B,Z,w){if(B==null)return B;var he=[],Ce=0;return E(B,he,"","",function(Se){return Z.call(w,Se,Ce++)}),he}function Y(B){if(B._status===-1){var Z=B._result;Z=Z(),Z.then(function(w){(B._status===0||B._status===-1)&&(B._status=1,B._result=w)},function(w){(B._status===0||B._status===-1)&&(B._status=2,B._result=w)}),B._status===-1&&(B._status=0,B._result=Z)}if(B._status===1)return B._result.default;throw B._result}var oe=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},O={map:_,forEach:function(B,Z,w){_(B,function(){Z.apply(this,arguments)},w)},count:function(B){var Z=0;return _(B,function(){Z++}),Z},toArray:function(B){return _(B,function(Z){return Z})||[]},only:function(B){if(!P(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ye.Activity=m,Ye.Children=O,Ye.Component=k,Ye.Fragment=a,Ye.Profiler=s,Ye.PureComponent=T,Ye.StrictMode=r,Ye.Suspense=p,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(B){return F.H.useMemoCache(B)}},Ye.cache=function(B){return function(){return B.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(B,Z,w){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var he=M({},B.props),Ce=B.key;if(Z!=null)for(Se in Z.key!==void 0&&(Ce=""+Z.key),Z)!I.call(Z,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&Z.ref===void 0||(he[Se]=Z[Se]);var Se=arguments.length-2;if(Se===1)he.children=w;else if(1<Se){for(var ze=Array(Se),Ve=0;Ve<Se;Ve++)ze[Ve]=arguments[Ve+2];he.children=ze}return K(B.type,Ce,he)},Ye.createContext=function(B){return B={$$typeof:f,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},Ye.createElement=function(B,Z,w){var he,Ce={},Se=null;if(Z!=null)for(he in Z.key!==void 0&&(Se=""+Z.key),Z)I.call(Z,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ce[he]=Z[he]);var ze=arguments.length-2;if(ze===1)Ce.children=w;else if(1<ze){for(var Ve=Array(ze),Ue=0;Ue<ze;Ue++)Ve[Ue]=arguments[Ue+2];Ce.children=Ve}if(B&&B.defaultProps)for(he in ze=B.defaultProps,ze)Ce[he]===void 0&&(Ce[he]=ze[he]);return K(B,Se,Ce)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(B){return{$$typeof:c,render:B}},Ye.isValidElement=P,Ye.lazy=function(B){return{$$typeof:g,_payload:{_status:-1,_result:B},_init:Y}},Ye.memo=function(B,Z){return{$$typeof:d,type:B,compare:Z===void 0?null:Z}},Ye.startTransition=function(B){var Z=F.T,w={};F.T=w;try{var he=B(),Ce=F.S;Ce!==null&&Ce(w,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(R,oe)}catch(Se){oe(Se)}finally{Z!==null&&w.types!==null&&(Z.types=w.types),F.T=Z}},Ye.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Ye.use=function(B){return F.H.use(B)},Ye.useActionState=function(B,Z,w){return F.H.useActionState(B,Z,w)},Ye.useCallback=function(B,Z){return F.H.useCallback(B,Z)},Ye.useContext=function(B){return F.H.useContext(B)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(B,Z){return F.H.useDeferredValue(B,Z)},Ye.useEffect=function(B,Z){return F.H.useEffect(B,Z)},Ye.useEffectEvent=function(B){return F.H.useEffectEvent(B)},Ye.useId=function(){return F.H.useId()},Ye.useImperativeHandle=function(B,Z,w){return F.H.useImperativeHandle(B,Z,w)},Ye.useInsertionEffect=function(B,Z){return F.H.useInsertionEffect(B,Z)},Ye.useLayoutEffect=function(B,Z){return F.H.useLayoutEffect(B,Z)},Ye.useMemo=function(B,Z){return F.H.useMemo(B,Z)},Ye.useOptimistic=function(B,Z){return F.H.useOptimistic(B,Z)},Ye.useReducer=function(B,Z,w){return F.H.useReducer(B,Z,w)},Ye.useRef=function(B){return F.H.useRef(B)},Ye.useState=function(B){return F.H.useState(B)},Ye.useSyncExternalStore=function(B,Z,w){return F.H.useSyncExternalStore(B,Z,w)},Ye.useTransition=function(){return F.H.useTransition()},Ye.version="19.2.6",Ye}var h0;function wc(){return h0||(h0=1,nh.exports=hN()),nh.exports}var C=wc();const Xb=Nc(C);var ih={exports:{}},qs={},ah={exports:{}},rh={};var p0;function pN(){return p0||(p0=1,(function(e){function i(E,_){var Y=E.length;E.push(_);e:for(;0<Y;){var oe=Y-1>>>1,O=E[oe];if(0<s(O,_))E[oe]=_,E[Y]=O,Y=oe;else break e}}function a(E){return E.length===0?null:E[0]}function r(E){if(E.length===0)return null;var _=E[0],Y=E.pop();if(Y!==_){E[0]=Y;e:for(var oe=0,O=E.length,B=O>>>1;oe<B;){var Z=2*(oe+1)-1,w=E[Z],he=Z+1,Ce=E[he];if(0>s(w,Y))he<O&&0>s(Ce,w)?(E[oe]=Ce,E[he]=Y,oe=he):(E[oe]=w,E[Z]=Y,oe=Z);else if(he<O&&0>s(Ce,Y))E[oe]=Ce,E[he]=Y,oe=he;else break e}}return _}function s(E,_){var Y=E.sortIndex-_.sortIndex;return Y!==0?Y:E.id-_.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var f=Date,c=f.now();e.unstable_now=function(){return f.now()-c}}var p=[],d=[],g=1,m=null,y=3,v=!1,N=!1,M=!1,D=!1,k=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function Q(E){for(var _=a(d);_!==null;){if(_.callback===null)r(d);else if(_.startTime<=E)r(d),_.sortIndex=_.expirationTime,i(p,_);else break;_=a(d)}}function ee(E){if(M=!1,Q(E),!N)if(a(p)!==null)N=!0,R||(R=!0,q());else{var _=a(d);_!==null&&ae(ee,_.startTime-E)}}var R=!1,F=-1,I=5,K=-1;function j(){return D?!0:!(e.unstable_now()-K<I)}function P(){if(D=!1,R){var E=e.unstable_now();K=E;var _=!0;try{e:{N=!1,M&&(M=!1,U(F),F=-1),v=!0;var Y=y;try{t:{for(Q(E),m=a(p);m!==null&&!(m.expirationTime>E&&j());){var oe=m.callback;if(typeof oe=="function"){m.callback=null,y=m.priorityLevel;var O=oe(m.expirationTime<=E);if(E=e.unstable_now(),typeof O=="function"){m.callback=O,Q(E),_=!0;break t}m===a(p)&&r(p),Q(E)}else r(p);m=a(p)}if(m!==null)_=!0;else{var B=a(d);B!==null&&ae(ee,B.startTime-E),_=!1}}break e}finally{m=null,y=Y,v=!1}_=void 0}}finally{_?q():R=!1}}}var q;if(typeof T=="function")q=function(){T(P)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,H=W.port2;W.port1.onmessage=P,q=function(){H.postMessage(null)}}else q=function(){k(P,0)};function ae(E,_){F=k(function(){E(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(E){switch(y){case 1:case 2:case 3:var _=3;break;default:_=y}var Y=y;y=_;try{return E()}finally{y=Y}},e.unstable_requestPaint=function(){D=!0},e.unstable_runWithPriority=function(E,_){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var Y=y;y=E;try{return _()}finally{y=Y}},e.unstable_scheduleCallback=function(E,_,Y){var oe=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?oe+Y:oe):Y=oe,E){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=Y+O,E={id:g++,callback:_,priorityLevel:E,startTime:Y,expirationTime:O,sortIndex:-1},Y>oe?(E.sortIndex=Y,i(d,E),a(p)===null&&E===a(d)&&(M?(U(F),F=-1):M=!0,ae(ee,Y-oe))):(E.sortIndex=O,i(p,E),N||v||(N=!0,R||(R=!0,q()))),E},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(E){var _=y;return function(){var Y=y;y=_;try{return E.apply(this,arguments)}finally{y=Y}}}})(rh)),rh}var m0;function mN(){return m0||(m0=1,ah.exports=pN()),ah.exports}var lh={exports:{}},En={};var g0;function gN(){if(g0)return En;g0=1;var e=wc();function i(p){var d="https://react.dev/errors/"+p;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(p,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:p,containerInfo:d,implementation:g}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(p,d){if(p==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,En.createPortal=function(p,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(i(299));return o(p,d,null,g)},En.flushSync=function(p){var d=f.T,g=r.p;try{if(f.T=null,r.p=2,p)return p()}finally{f.T=d,r.p=g,r.d.f()}},En.preconnect=function(p,d){typeof p=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(p,d))},En.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},En.preinit=function(p,d){if(typeof p=="string"&&d&&typeof d.as=="string"){var g=d.as,m=c(g,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(p,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):g==="script"&&r.d.X(p,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},En.preinitModule=function(p,d){if(typeof p=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=c(d.as,d.crossOrigin);r.d.M(p,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(p)},En.preload=function(p,d){if(typeof p=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=c(g,d.crossOrigin);r.d.L(p,g,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},En.preloadModule=function(p,d){if(typeof p=="string")if(d){var g=c(d.as,d.crossOrigin);r.d.m(p,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(p)},En.requestFormReset=function(p){r.d.r(p)},En.unstable_batchedUpdates=function(p,d){return p(d)},En.useFormState=function(p,d,g){return f.H.useFormState(p,d,g)},En.useFormStatus=function(){return f.H.useHostTransitionStatus()},En.version="19.2.6",En}var x0;function xN(){if(x0)return lh.exports;x0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),lh.exports=gN(),lh.exports}var b0;function bN(){if(b0)return qs;b0=1;var e=mN(),i=wc(),a=xN();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function f(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function c(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(o(t)!==t)throw Error(r(188))}function d(t){var n=t.alternate;if(!n){if(n=o(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,u=n;;){var h=l.return;if(h===null)break;var b=h.alternate;if(b===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===b.child){for(b=h.child;b;){if(b===l)return p(h),t;if(b===u)return p(h),n;b=b.sibling}throw Error(r(188))}if(l.return!==u.return)l=h,u=b;else{for(var S=!1,A=h.child;A;){if(A===l){S=!0,l=h,u=b;break}if(A===u){S=!0,u=h,l=b;break}A=A.sibling}if(!S){for(A=b.child;A;){if(A===l){S=!0,l=b,u=h;break}if(A===u){S=!0,u=b,l=h;break}A=A.sibling}if(!S)throw Error(r(189))}}if(l.alternate!==u)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function g(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=g(t),n!==null)return n;t=t.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),T=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function H(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case k:return"Profiler";case D:return"StrictMode";case ee:return"Suspense";case R:return"SuspenseList";case K:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case N:return"Portal";case T:return t.displayName||"Context";case U:return(t._context.displayName||"Context")+".Consumer";case Q:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case F:return n=t.displayName||null,n!==null?n:H(t.type)||"Memo";case I:n=t._payload,t=t._init;try{return H(t(n))}catch{}}return null}var ae=Array.isArray,E=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},oe=[],O=-1;function B(t){return{current:t}}function Z(t){0>O||(t.current=oe[O],oe[O]=null,O--)}function w(t,n){O++,oe[O]=t.current,t.current=n}var he=B(null),Ce=B(null),Se=B(null),ze=B(null);function Ve(t,n){switch(w(Se,n),w(Ce,t),w(he,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?_x(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=_x(n),t=Fx(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Z(he),w(he,t)}function Ue(){Z(he),Z(Ce),Z(Se)}function Dt(t){t.memoizedState!==null&&w(ze,t);var n=he.current,l=Fx(n,t.type);n!==l&&(w(Ce,t),w(he,l))}function Ht(t){Ce.current===t&&(Z(he),Z(Ce)),ze.current===t&&(Z(ze),Is._currentValue=Y)}var Jt,Rt;function de(t){if(Jt===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Jt=n&&n[1]||"",Rt=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Jt+t+Rt}var Ke=!1;function Ot(t,n){if(!t||Ke)return"";Ke=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(se){var re=se}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(se){re=se}t.call(fe.prototype)}}else{try{throw Error()}catch(se){re=se}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(se){if(se&&re&&typeof se.stack=="string")return[se.stack,re.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=u.DetermineComponentFrameRoot(),S=b[0],A=b[1];if(S&&A){var $=S.split(`
4
+ `),ie=A.split(`
5
+ `);for(h=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;h<ie.length&&!ie[h].includes("DetermineComponentFrameRoot");)h++;if(u===$.length||h===ie.length)for(u=$.length-1,h=ie.length-1;1<=u&&0<=h&&$[u]!==ie[h];)h--;for(;1<=u&&0<=h;u--,h--)if($[u]!==ie[h]){if(u!==1||h!==1)do if(u--,h--,0>h||$[u]!==ie[h]){var ue=`
6
+ `+$[u].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=u&&0<=h);break}}}finally{Ke=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?de(l):""}function pe(t,n){switch(t.tag){case 26:case 27:case 5:return de(t.type);case 16:return de("Lazy");case 13:return t.child!==n&&n!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return Ot(t.type,!1);case 11:return Ot(t.type.render,!1);case 1:return Ot(t.type,!0);case 31:return de("Activity");default:return""}}function Me(t){try{var n="",l=null;do n+=pe(t,l),l=t,t=t.return;while(t);return n}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var Xe=Object.prototype.hasOwnProperty,et=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,Nt=e.unstable_shouldYield,_e=e.unstable_requestPaint,Pe=e.unstable_now,Kt=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,z=e.unstable_NormalPriority,me=e.unstable_LowPriority,we=e.unstable_IdlePriority,qe=e.log,je=e.unstable_setDisableYieldValue,Re=null,Fe=null;function pt(t){if(typeof qe=="function"&&je(t),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(Re,t)}catch{}}var at=Math.clz32?Math.clz32:Sn,Lt=Math.log,hn=Math.LN2;function Sn(t){return t>>>=0,t===0?32:31-(Lt(t)/hn|0)|0}var Xt=256,be=262144,ki=4194304;function nn(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Vn(t,n,l){var u=t.pendingLanes;if(u===0)return 0;var h=0,b=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var A=u&134217727;return A!==0?(u=A&~b,u!==0?h=nn(u):(S&=A,S!==0?h=nn(S):l||(l=A&~t,l!==0&&(h=nn(l))))):(A=u&~b,A!==0?h=nn(A):S!==0?h=nn(S):l||(l=u&~t,l!==0&&(h=nn(l)))),h===0?0:n!==0&&n!==h&&(n&b)===0&&(b=h&-h,l=n&-n,b>=l||b===32&&(l&4194048)!==0)?n:h}function ai(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function nr(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ai(){var t=ki;return ki<<=1,(ki&62914560)===0&&(ki=4194304),t}function ke(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function tt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ct(t,n,l,u,h,b){var S=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var A=t.entanglements,$=t.expirationTimes,ie=t.hiddenUpdates;for(l=S&~l;0<l;){var ue=31-at(l),fe=1<<ue;A[ue]=0,$[ue]=-1;var re=ie[ue];if(re!==null)for(ie[ue]=null,ue=0;ue<re.length;ue++){var se=re[ue];se!==null&&(se.lane&=-536870913)}l&=~fe}u!==0&&Rn(t,u,0),b!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=b&~(S&~n))}function Rn(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var u=31-at(n);t.entangledLanes|=n,t.entanglements[u]=t.entanglements[u]|1073741824|l&261930}function He(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var u=31-at(l),h=1<<u;h&n|t[u]&n&&(t[u]|=n),l&=~h}}function Dn(t,n){var l=n&-n;return l=(l&42)!==0?1:ct(l),(l&(t.suspendedLanes|n))!==0?0:l}function ct(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function cn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Nn(){var t=_.p;return t!==0?t:(t=window.event,t===void 0?32:i0(t.type))}function Zt(t,n){var l=_.p;try{return _.p=t,n()}finally{_.p=l}}var xt=Math.random().toString(36).slice(2),lt="__reactFiber$"+xt,At="__reactProps$"+xt,zt="__reactContainer$"+xt,wn="__reactEvents$"+xt,ir="__reactListeners$"+xt,Bc="__reactHandles$"+xt,ya="__reactResources$"+xt,ar="__reactMarker$"+xt;function Pi(t){delete t[lt],delete t[At],delete t[wn],delete t[ir],delete t[Bc]}function va(t){var n=t[lt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[zt]||l[lt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Hx(t);t!==null;){if(l=t[lt])return l;t=Hx(t)}return n}t=l,l=t.parentNode}return null}function ri(t){if(t=t[lt]||t[zt]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function rr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function bi(t){var n=t[ya];return n||(n=t[ya]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function an(t){t[ar]=!0}var qr=new Set,No={};function yi(t,n){Sa(t,n),Sa(t+"Capture",n)}function Sa(t,n){for(No[t]=n,t=0;t<n.length;t++)qr.add(n[t])}var Vl=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wo={},Gr={};function Rc(t){return Xe.call(Gr,t)?!0:Xe.call(wo,t)?!1:Vl.test(t)?Gr[t]=!0:(wo[t]=!0,!1)}function Na(t,n,l){if(Rc(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function Vr(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function Kn(t,n,l,u){if(u===null)t.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+u)}}function Ln(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function lr(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Lc(t,n,l){var u=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,b=u.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(S){l=""+S,b.call(this,S)}}),Object.defineProperty(t,n,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Kl(t){if(!t._valueTracker){var n=lr(t)?"checked":"value";t._valueTracker=Lc(t,n,""+t[n])}}function Yl(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),u="";return t&&(u=lr(t)?t.checked?"true":"false":t.value),t=u,t!==l?(n.setValue(t),!0):!1}function sr(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Co=/[\n"\\]/g;function On(t){return t.replace(Co,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Kr(t,n,l,u,h,b,S,A){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),n!=null?S==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Ln(n)):t.value!==""+Ln(n)&&(t.value=""+Ln(n)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),n!=null?qi(t,S,Ln(n)):l!=null?qi(t,S,Ln(l)):u!=null&&t.removeAttribute("value"),h==null&&b!=null&&(t.defaultChecked=!!b),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+Ln(A):t.removeAttribute("name")}function Ql(t,n,l,u,h,b,S,A){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.type=b),n!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||n!=null)){Kl(t);return}l=l!=null?""+Ln(l):"",n=n!=null?""+Ln(n):l,A||n===t.value||(t.value=n),t.defaultValue=n}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=A?t.checked:!!u,t.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),Kl(t)}function qi(t,n,l){n==="number"&&sr(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Gi(t,n,l,u){if(t=t.options,n){n={};for(var h=0;h<l.length;h++)n["$"+l[h]]=!0;for(l=0;l<t.length;l++)h=n.hasOwnProperty("$"+t[l].value),t[l].selected!==h&&(t[l].selected=h),h&&u&&(t[l].defaultSelected=!0)}else{for(l=""+Ln(l),n=null,h=0;h<t.length;h++){if(t[h].value===l){t[h].selected=!0,u&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function Jl(t,n,l){if(n!=null&&(n=""+Ln(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Ln(l):""}function Xl(t,n,l,u){if(n==null){if(u!=null){if(l!=null)throw Error(r(92));if(ae(u)){if(1<u.length)throw Error(r(93));u=u[0]}l=u}l==null&&(l=""),n=l}l=Ln(n),t.defaultValue=l,u=t.textContent,u===l&&u!==""&&u!==null&&(t.value=u),Kl(t)}function Vi(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Eo=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zl(t,n,l){var u=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":u?t.setProperty(n,l):typeof l!="number"||l===0||Eo.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function or(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?t.setProperty(u,""):u==="float"?t.cssFloat="":t[u]="");for(var h in n)u=n[h],n.hasOwnProperty(h)&&l[h]!==u&&Zl(t,h,u)}else for(var b in n)n.hasOwnProperty(b)&&Zl(t,b,n[b])}function Yr(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ko=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ao=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ur(t){return Ao.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function li(){}var Qr=null;function Jr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ut=null,wa=null;function Mo(t){var n=ri(t);if(n&&(t=n.stateNode)){var l=t[At]||null;e:switch(t=n.stateNode,n.type){case"input":if(Kr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+On(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var u=l[n];if(u!==t&&u.form===t.form){var h=u[At]||null;if(!h)throw Error(r(90));Kr(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<l.length;n++)u=l[n],u.form===t.form&&Yl(u)}break e;case"textarea":Jl(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Gi(t,!!l.multiple,n,!1)}}}var Wl=!1;function jo(t,n,l){if(Wl)return t(n,l);Wl=!0;try{var u=t(n);return u}finally{if(Wl=!1,(Ut!==null||wa!==null)&&(xu(),Ut&&(n=Ut,t=wa,wa=Ut=null,Mo(n),t)))for(n=0;n<t.length;n++)Mo(t[n])}}function cr(t,n){var l=t.stateNode;if(l===null)return null;var u=l[At]||null;if(u===null)return null;l=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(t=t.type,u=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!u;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),es=!1;if(si)try{var fr={};Object.defineProperty(fr,"passive",{get:function(){es=!0}}),window.addEventListener("test",fr,fr),window.removeEventListener("test",fr,fr)}catch{es=!1}var Mi=null,ts=null,ji=null;function To(){if(ji)return ji;var t,n=ts,l=n.length,u,h="value"in Mi?Mi.value:Mi.textContent,b=h.length;for(t=0;t<l&&n[t]===h[t];t++);var S=l-t;for(u=1;u<=S&&n[l-u]===h[b-u];u++);return ji=h.slice(t,1<u?1-u:void 0)}function Xr(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function dr(){return!0}function Zr(){return!1}function Cn(t){function n(l,u,h,b,S){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=b,this.target=S,this.currentTarget=null;for(var A in t)t.hasOwnProperty(A)&&(l=t[A],this[A]=l?l(b):b[A]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?dr:Zr,this.isPropagationStopped=Zr,this}return m(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=dr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=dr)},persist:function(){},isPersistent:dr}),n}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bt=Cn(Ti),Ki=m({},Ti,{view:0,detail:0}),ns=Cn(Ki),is,as,hr,Wr=m({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ls,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==hr&&(hr&&t.type==="mousemove"?(is=t.screenX-hr.screenX,as=t.screenY-hr.screenY):as=is=0,hr=t),is)},movementY:function(t){return"movementY"in t?t.movementY:as}}),Do=Cn(Wr),zc=m({},Wr,{dataTransfer:0}),Ic=Cn(zc),$c=m({},Ki,{relatedTarget:0}),rs=Cn($c),Hc=m({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),Uc=Cn(Hc),Pc=m({},Ti,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),qc=Cn(Pc),Gc=m({},Ti,{data:0}),Oo=Cn(Gc),_o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vc={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Kc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yc(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Kc[t])?!!n[t]:!1}function ls(){return Yc}var Qc=m({},Ki,{key:function(t){if(t.key){var n=_o[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Xr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Vc[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ls,charCode:function(t){return t.type==="keypress"?Xr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Jc=Cn(Qc),Xc=m({},Wr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fo=Cn(Xc),Zc=m({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ls}),Wc=Cn(Zc),ef=m({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),tf=Cn(ef),Bo=m({},Wr,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),ss=Cn(Bo),nf=m({},Ti,{newState:0,oldState:0}),Ro=Cn(nf),af=[9,13,27,32],os=si&&"CompositionEvent"in window,Yi=null;si&&"documentMode"in document&&(Yi=document.documentMode);var Qp=si&&"TextEvent"in window&&!Yi,rf=si&&(!os||Yi&&8<Yi&&11>=Yi),lf=" ",sf=!1;function of(t,n){switch(t){case"keyup":return af.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var pr=!1;function Jp(t,n){switch(t){case"compositionend":return uf(n);case"keypress":return n.which!==32?null:(sf=!0,lf);case"textInput":return t=n.data,t===lf&&sf?null:t;default:return null}}function L(t,n){if(pr)return t==="compositionend"||!os&&of(t,n)?(t=To(),ji=ts=Mi=null,pr=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return rf&&n.locale!=="ko"?null:n.data;default:return null}}var G={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function X(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!G[t.type]:n==="textarea"}function ge(t,n,l,u){Ut?wa?wa.push(u):wa=[u]:Ut=u,n=Cu(n,"onChange"),0<n.length&&(l=new bt("onChange","change",null,l,u),t.push({event:l,listeners:n}))}var ne=null,Ee=null;function nt(t){Ax(t,0)}function Ne(t){var n=rr(t);if(Yl(n))return t}function it(t,n){if(t==="change")return n}var De=!1;if(si){var yt;if(si){var Qe="oninput"in document;if(!Qe){var ve=document.createElement("div");ve.setAttribute("oninput","return;"),Qe=typeof ve.oninput=="function"}yt=Qe}else yt=!1;De=yt&&(!document.documentMode||9<document.documentMode)}function Wt(){ne&&(ne.detachEvent("onpropertychange",rt),Ee=ne=null)}function rt(t){if(t.propertyName==="value"&&Ne(Ee)){var n=[];ge(n,Ee,t,Jr(t)),jo(nt,n)}}function fn(t,n,l){t==="focusin"?(Wt(),ne=n,Ee=l,ne.attachEvent("onpropertychange",rt)):t==="focusout"&&Wt()}function _n(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ne(Ee)}function mr(t,n){if(t==="click")return Ne(n)}function Di(t,n){if(t==="input"||t==="change")return Ne(n)}function Pv(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Yn=typeof Object.is=="function"?Object.is:Pv;function us(t,n){if(Yn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),u=Object.keys(n);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!Xe.call(n,h)||!Yn(t[h],n[h]))return!1}return!0}function Xp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zp(t,n){var l=Xp(t);t=0;for(var u;l;){if(l.nodeType===3){if(u=t+l.textContent.length,t<=n&&u>=n)return{node:l,offset:n-t};t=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xp(l)}}function Wp(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Wp(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function em(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=sr(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=sr(t.document)}return n}function cf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var qv=si&&"documentMode"in document&&11>=document.documentMode,el=null,ff=null,cs=null,df=!1;function tm(t,n,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;df||el==null||el!==sr(u)||(u=el,"selectionStart"in u&&cf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),cs&&us(cs,u)||(cs=u,u=Cu(ff,"onSelect"),0<u.length&&(n=new bt("onSelect","select",null,n,l),t.push({event:n,listeners:u}),n.target=el)))}function gr(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var tl={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionrun:gr("Transition","TransitionRun"),transitionstart:gr("Transition","TransitionStart"),transitioncancel:gr("Transition","TransitionCancel"),transitionend:gr("Transition","TransitionEnd")},hf={},nm={};si&&(nm=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function xr(t){if(hf[t])return hf[t];if(!tl[t])return t;var n=tl[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in nm)return hf[t]=n[l];return t}var im=xr("animationend"),am=xr("animationiteration"),rm=xr("animationstart"),Gv=xr("transitionrun"),Vv=xr("transitionstart"),Kv=xr("transitioncancel"),lm=xr("transitionend"),sm=new Map,pf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");pf.push("scrollEnd");function vi(t,n){sm.set(t,n),yi(n,[t])}var Lo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},oi=[],nl=0,mf=0;function zo(){for(var t=nl,n=mf=nl=0;n<t;){var l=oi[n];oi[n++]=null;var u=oi[n];oi[n++]=null;var h=oi[n];oi[n++]=null;var b=oi[n];if(oi[n++]=null,u!==null&&h!==null){var S=u.pending;S===null?h.next=h:(h.next=S.next,S.next=h),u.pending=h}b!==0&&om(l,h,b)}}function Io(t,n,l,u){oi[nl++]=t,oi[nl++]=n,oi[nl++]=l,oi[nl++]=u,mf|=u,t.lanes|=u,t=t.alternate,t!==null&&(t.lanes|=u)}function gf(t,n,l,u){return Io(t,n,l,u),$o(t)}function br(t,n){return Io(t,null,null,n),$o(t)}function om(t,n,l){t.lanes|=l;var u=t.alternate;u!==null&&(u.lanes|=l);for(var h=!1,b=t.return;b!==null;)b.childLanes|=l,u=b.alternate,u!==null&&(u.childLanes|=l),b.tag===22&&(t=b.stateNode,t===null||t._visibility&1||(h=!0)),t=b,b=b.return;return t.tag===3?(b=t.stateNode,h&&n!==null&&(h=31-at(l),t=b.hiddenUpdates,u=t[h],u===null?t[h]=[n]:u.push(n),n.lane=l|536870912),b):null}function $o(t){if(50<Os)throw Os=0,Ed=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var il={};function Yv(t,n,l,u){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(t,n,l,u){return new Yv(t,n,l,u)}function xf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Qi(t,n){var l=t.alternate;return l===null?(l=Qn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function um(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Ho(t,n,l,u,h,b){var S=0;if(u=t,typeof t=="function")xf(t)&&(S=1);else if(typeof t=="string")S=WS(t,l,he.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case K:return t=Qn(31,l,n,h),t.elementType=K,t.lanes=b,t;case M:return yr(l.children,h,b,n);case D:S=8,h|=24;break;case k:return t=Qn(12,l,n,h|2),t.elementType=k,t.lanes=b,t;case ee:return t=Qn(13,l,n,h),t.elementType=ee,t.lanes=b,t;case R:return t=Qn(19,l,n,h),t.elementType=R,t.lanes=b,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case T:S=10;break e;case U:S=9;break e;case Q:S=11;break e;case F:S=14;break e;case I:S=16,u=null;break e}S=29,l=Error(r(130,t===null?"null":typeof t,"")),u=null}return n=Qn(S,l,n,h),n.elementType=t,n.type=u,n.lanes=b,n}function yr(t,n,l,u){return t=Qn(7,t,u,n),t.lanes=l,t}function bf(t,n,l){return t=Qn(6,t,null,n),t.lanes=l,t}function cm(t){var n=Qn(18,null,null,0);return n.stateNode=t,n}function yf(t,n,l){return n=Qn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var fm=new WeakMap;function ui(t,n){if(typeof t=="object"&&t!==null){var l=fm.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Me(n)},fm.set(t,n),n)}return{value:t,source:n,stack:Me(n)}}var al=[],rl=0,Uo=null,fs=0,ci=[],fi=0,Ca=null,Oi=1,_i="";function Ji(t,n){al[rl++]=fs,al[rl++]=Uo,Uo=t,fs=n}function dm(t,n,l){ci[fi++]=Oi,ci[fi++]=_i,ci[fi++]=Ca,Ca=t;var u=Oi;t=_i;var h=32-at(u)-1;u&=~(1<<h),l+=1;var b=32-at(n)+h;if(30<b){var S=h-h%5;b=(u&(1<<S)-1).toString(32),u>>=S,h-=S,Oi=1<<32-at(n)+h|l<<h|u,_i=b+t}else Oi=1<<b|l<<h|u,_i=t}function vf(t){t.return!==null&&(Ji(t,1),dm(t,1,0))}function Sf(t){for(;t===Uo;)Uo=al[--rl],al[rl]=null,fs=al[--rl],al[rl]=null;for(;t===Ca;)Ca=ci[--fi],ci[fi]=null,_i=ci[--fi],ci[fi]=null,Oi=ci[--fi],ci[fi]=null}function hm(t,n){ci[fi++]=Oi,ci[fi++]=_i,ci[fi++]=Ca,Oi=n.id,_i=n.overflow,Ca=t}var xn=null,It=null,mt=!1,Ea=null,di=!1,Nf=Error(r(519));function ka(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ds(ui(n,t)),Nf}function pm(t){var n=t.stateNode,l=t.type,u=t.memoizedProps;switch(n[lt]=t,n[At]=u,l){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(l=0;l<Fs.length;l++)ot(Fs[l],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":ot("invalid",n),Ql(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":ot("invalid",n);break;case"textarea":ot("invalid",n),Xl(n,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||u.suppressHydrationWarning===!0||Dx(n.textContent,l)?(u.popover!=null&&(ot("beforetoggle",n),ot("toggle",n)),u.onScroll!=null&&ot("scroll",n),u.onScrollEnd!=null&&ot("scrollend",n),u.onClick!=null&&(n.onclick=li),n=!0):n=!1,n||ka(t,!0)}function mm(t){for(xn=t.return;xn;)switch(xn.tag){case 5:case 31:case 13:di=!1;return;case 27:case 3:di=!0;return;default:xn=xn.return}}function ll(t){if(t!==xn)return!1;if(!mt)return mm(t),mt=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||$d(t.type,t.memoizedProps)),l=!l),l&&It&&ka(t),mm(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=$x(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));It=$x(t)}else n===27?(n=It,$a(t.type)?(t=Gd,Gd=null,It=t):It=n):It=xn?pi(t.stateNode.nextSibling):null;return!0}function vr(){It=xn=null,mt=!1}function wf(){var t=Ea;return t!==null&&(Hn===null?Hn=t:Hn.push.apply(Hn,t),Ea=null),t}function ds(t){Ea===null?Ea=[t]:Ea.push(t)}var Cf=B(null),Sr=null,Xi=null;function Aa(t,n,l){w(Cf,n._currentValue),n._currentValue=l}function Zi(t){t._currentValue=Cf.current,Z(Cf)}function Ef(t,n,l){for(;t!==null;){var u=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),t===l)break;t=t.return}}function kf(t,n,l,u){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var b=h.dependencies;if(b!==null){var S=h.child;b=b.firstContext;e:for(;b!==null;){var A=b;b=h;for(var $=0;$<n.length;$++)if(A.context===n[$]){b.lanes|=l,A=b.alternate,A!==null&&(A.lanes|=l),Ef(b.return,l,t),u||(S=null);break e}b=A.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(r(341));S.lanes|=l,b=S.alternate,b!==null&&(b.lanes|=l),Ef(S,l,t),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===t){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function sl(t,n,l,u){t=null;for(var h=n,b=!1;h!==null;){if(!b){if((h.flags&524288)!==0)b=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var A=h.type;Yn(h.pendingProps.value,S.value)||(t!==null?t.push(A):t=[A])}}else if(h===ze.current){if(S=h.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Is):t=[Is])}h=h.return}t!==null&&kf(n,t,l,u),n.flags|=262144}function Po(t){for(t=t.firstContext;t!==null;){if(!Yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Nr(t){Sr=t,Xi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function bn(t){return gm(Sr,t)}function qo(t,n){return Sr===null&&Nr(t),gm(t,n)}function gm(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Xi===null){if(t===null)throw Error(r(308));Xi=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Xi=Xi.next=n;return l}var Qv=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,u){t.push(u)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},Jv=e.unstable_scheduleCallback,Xv=e.unstable_NormalPriority,rn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Af(){return{controller:new Qv,data:new Map,refCount:0}}function hs(t){t.refCount--,t.refCount===0&&Jv(Xv,function(){t.controller.abort()})}var ps=null,Mf=0,ol=0,ul=null;function Zv(t,n){if(ps===null){var l=ps=[];Mf=0,ol=Dd(),ul={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Mf++,n.then(xm,xm),n}function xm(){if(--Mf===0&&ps!==null){ul!==null&&(ul.status="fulfilled");var t=ps;ps=null,ol=0,ul=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Wv(t,n){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return t.then(function(){u.status="fulfilled",u.value=n;for(var h=0;h<l.length;h++)(0,l[h])(n)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var bm=E.S;E.S=function(t,n){tx=Pe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Zv(t,n),bm!==null&&bm(t,n)};var wr=B(null);function jf(){var t=wr.current;return t!==null?t:_t.pooledCache}function Go(t,n){n===null?w(wr,wr.current):w(wr,n.pool)}function ym(){var t=jf();return t===null?null:{parent:rn._currentValue,pool:t}}var cl=Error(r(460)),Tf=Error(r(474)),Vo=Error(r(542)),Ko={then:function(){}};function vm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Sm(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(li,li),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,wm(t),t;default:if(typeof n.status=="string")n.then(li,li);else{if(t=_t,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(u){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=u}},function(u){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,wm(t),t}throw Er=n,cl}}function Cr(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Er=l,cl):l}}var Er=null;function Nm(){if(Er===null)throw Error(r(459));var t=Er;return Er=null,t}function wm(t){if(t===cl||t===Vo)throw Error(r(483))}var fl=null,ms=0;function Yo(t){var n=ms;return ms+=1,fl===null&&(fl=[]),Sm(fl,t,n)}function gs(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Qo(t,n){throw n.$$typeof===y?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Cm(t){function n(J,V){if(t){var te=J.deletions;te===null?(J.deletions=[V],J.flags|=16):te.push(V)}}function l(J,V){if(!t)return null;for(;V!==null;)n(J,V),V=V.sibling;return null}function u(J){for(var V=new Map;J!==null;)J.key!==null?V.set(J.key,J):V.set(J.index,J),J=J.sibling;return V}function h(J,V){return J=Qi(J,V),J.index=0,J.sibling=null,J}function b(J,V,te){return J.index=te,t?(te=J.alternate,te!==null?(te=te.index,te<V?(J.flags|=67108866,V):te):(J.flags|=67108866,V)):(J.flags|=1048576,V)}function S(J){return t&&J.alternate===null&&(J.flags|=67108866),J}function A(J,V,te,ce){return V===null||V.tag!==6?(V=bf(te,J.mode,ce),V.return=J,V):(V=h(V,te),V.return=J,V)}function $(J,V,te,ce){var Le=te.type;return Le===M?ue(J,V,te.props.children,ce,te.key):V!==null&&(V.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===I&&Cr(Le)===V.type)?(V=h(V,te.props),gs(V,te),V.return=J,V):(V=Ho(te.type,te.key,te.props,null,J.mode,ce),gs(V,te),V.return=J,V)}function ie(J,V,te,ce){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=yf(te,J.mode,ce),V.return=J,V):(V=h(V,te.children||[]),V.return=J,V)}function ue(J,V,te,ce,Le){return V===null||V.tag!==7?(V=yr(te,J.mode,ce,Le),V.return=J,V):(V=h(V,te),V.return=J,V)}function fe(J,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=bf(""+V,J.mode,te),V.return=J,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case v:return te=Ho(V.type,V.key,V.props,null,J.mode,te),gs(te,V),te.return=J,te;case N:return V=yf(V,J.mode,te),V.return=J,V;case I:return V=Cr(V),fe(J,V,te)}if(ae(V)||q(V))return V=yr(V,J.mode,te,null),V.return=J,V;if(typeof V.then=="function")return fe(J,Yo(V),te);if(V.$$typeof===T)return fe(J,qo(J,V),te);Qo(J,V)}return null}function re(J,V,te,ce){var Le=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Le!==null?null:A(J,V,""+te,ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===Le?$(J,V,te,ce):null;case N:return te.key===Le?ie(J,V,te,ce):null;case I:return te=Cr(te),re(J,V,te,ce)}if(ae(te)||q(te))return Le!==null?null:ue(J,V,te,ce,null);if(typeof te.then=="function")return re(J,V,Yo(te),ce);if(te.$$typeof===T)return re(J,V,qo(J,te),ce);Qo(J,te)}return null}function se(J,V,te,ce,Le){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return J=J.get(te)||null,A(V,J,""+ce,Le);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case v:return J=J.get(ce.key===null?te:ce.key)||null,$(V,J,ce,Le);case N:return J=J.get(ce.key===null?te:ce.key)||null,ie(V,J,ce,Le);case I:return ce=Cr(ce),se(J,V,te,ce,Le)}if(ae(ce)||q(ce))return J=J.get(te)||null,ue(V,J,ce,Le,null);if(typeof ce.then=="function")return se(J,V,te,Yo(ce),Le);if(ce.$$typeof===T)return se(J,V,te,qo(V,ce),Le);Qo(V,ce)}return null}function Te(J,V,te,ce){for(var Le=null,vt=null,Oe=V,Ze=V=0,dt=null;Oe!==null&&Ze<te.length;Ze++){Oe.index>Ze?(dt=Oe,Oe=null):dt=Oe.sibling;var St=re(J,Oe,te[Ze],ce);if(St===null){Oe===null&&(Oe=dt);break}t&&Oe&&St.alternate===null&&n(J,Oe),V=b(St,V,Ze),vt===null?Le=St:vt.sibling=St,vt=St,Oe=dt}if(Ze===te.length)return l(J,Oe),mt&&Ji(J,Ze),Le;if(Oe===null){for(;Ze<te.length;Ze++)Oe=fe(J,te[Ze],ce),Oe!==null&&(V=b(Oe,V,Ze),vt===null?Le=Oe:vt.sibling=Oe,vt=Oe);return mt&&Ji(J,Ze),Le}for(Oe=u(Oe);Ze<te.length;Ze++)dt=se(Oe,J,Ze,te[Ze],ce),dt!==null&&(t&&dt.alternate!==null&&Oe.delete(dt.key===null?Ze:dt.key),V=b(dt,V,Ze),vt===null?Le=dt:vt.sibling=dt,vt=dt);return t&&Oe.forEach(function(Ga){return n(J,Ga)}),mt&&Ji(J,Ze),Le}function $e(J,V,te,ce){if(te==null)throw Error(r(151));for(var Le=null,vt=null,Oe=V,Ze=V=0,dt=null,St=te.next();Oe!==null&&!St.done;Ze++,St=te.next()){Oe.index>Ze?(dt=Oe,Oe=null):dt=Oe.sibling;var Ga=re(J,Oe,St.value,ce);if(Ga===null){Oe===null&&(Oe=dt);break}t&&Oe&&Ga.alternate===null&&n(J,Oe),V=b(Ga,V,Ze),vt===null?Le=Ga:vt.sibling=Ga,vt=Ga,Oe=dt}if(St.done)return l(J,Oe),mt&&Ji(J,Ze),Le;if(Oe===null){for(;!St.done;Ze++,St=te.next())St=fe(J,St.value,ce),St!==null&&(V=b(St,V,Ze),vt===null?Le=St:vt.sibling=St,vt=St);return mt&&Ji(J,Ze),Le}for(Oe=u(Oe);!St.done;Ze++,St=te.next())St=se(Oe,J,Ze,St.value,ce),St!==null&&(t&&St.alternate!==null&&Oe.delete(St.key===null?Ze:St.key),V=b(St,V,Ze),vt===null?Le=St:vt.sibling=St,vt=St);return t&&Oe.forEach(function(cN){return n(J,cN)}),mt&&Ji(J,Ze),Le}function Tt(J,V,te,ce){if(typeof te=="object"&&te!==null&&te.type===M&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var Le=te.key;V!==null;){if(V.key===Le){if(Le=te.type,Le===M){if(V.tag===7){l(J,V.sibling),ce=h(V,te.props.children),ce.return=J,J=ce;break e}}else if(V.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===I&&Cr(Le)===V.type){l(J,V.sibling),ce=h(V,te.props),gs(ce,te),ce.return=J,J=ce;break e}l(J,V);break}else n(J,V);V=V.sibling}te.type===M?(ce=yr(te.props.children,J.mode,ce,te.key),ce.return=J,J=ce):(ce=Ho(te.type,te.key,te.props,null,J.mode,ce),gs(ce,te),ce.return=J,J=ce)}return S(J);case N:e:{for(Le=te.key;V!==null;){if(V.key===Le)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){l(J,V.sibling),ce=h(V,te.children||[]),ce.return=J,J=ce;break e}else{l(J,V);break}else n(J,V);V=V.sibling}ce=yf(te,J.mode,ce),ce.return=J,J=ce}return S(J);case I:return te=Cr(te),Tt(J,V,te,ce)}if(ae(te))return Te(J,V,te,ce);if(q(te)){if(Le=q(te),typeof Le!="function")throw Error(r(150));return te=Le.call(te),$e(J,V,te,ce)}if(typeof te.then=="function")return Tt(J,V,Yo(te),ce);if(te.$$typeof===T)return Tt(J,V,qo(J,te),ce);Qo(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(l(J,V.sibling),ce=h(V,te),ce.return=J,J=ce):(l(J,V),ce=bf(te,J.mode,ce),ce.return=J,J=ce),S(J)):l(J,V)}return function(J,V,te,ce){try{ms=0;var Le=Tt(J,V,te,ce);return fl=null,Le}catch(Oe){if(Oe===cl||Oe===Vo)throw Oe;var vt=Qn(29,Oe,null,J.mode);return vt.lanes=ce,vt.return=J,vt}}}var kr=Cm(!0),Em=Cm(!1),Ma=!1;function Df(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Of(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ja(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ta(t,n,l){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,(wt&2)!==0){var h=u.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),u.pending=n,n=$o(t),om(t,null,l),n}return Io(t,u,n,l),$o(t)}function xs(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var u=n.lanes;u&=t.pendingLanes,l|=u,n.lanes=l,He(t,l)}}function _f(t,n){var l=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?h=b=S:b=b.next=S,l=l.next}while(l!==null);b===null?h=b=n:b=b.next=n}else h=b=n;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Ff=!1;function bs(){if(Ff){var t=ul;if(t!==null)throw t}}function ys(t,n,l,u){Ff=!1;var h=t.updateQueue;Ma=!1;var b=h.firstBaseUpdate,S=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var $=A,ie=$.next;$.next=null,S===null?b=ie:S.next=ie,S=$;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,A=ue.lastBaseUpdate,A!==S&&(A===null?ue.firstBaseUpdate=ie:A.next=ie,ue.lastBaseUpdate=$))}if(b!==null){var fe=h.baseState;S=0,ue=ie=$=null,A=b;do{var re=A.lane&-536870913,se=re!==A.lane;if(se?(ft&re)===re:(u&re)===re){re!==0&&re===ol&&(Ff=!0),ue!==null&&(ue=ue.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Te=t,$e=A;re=n;var Tt=l;switch($e.tag){case 1:if(Te=$e.payload,typeof Te=="function"){fe=Te.call(Tt,fe,re);break e}fe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=$e.payload,re=typeof Te=="function"?Te.call(Tt,fe,re):Te,re==null)break e;fe=m({},fe,re);break e;case 2:Ma=!0}}re=A.callback,re!==null&&(t.flags|=64,se&&(t.flags|=8192),se=h.callbacks,se===null?h.callbacks=[re]:se.push(re))}else se={lane:re,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ue===null?(ie=ue=se,$=fe):ue=ue.next=se,S|=re;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;se=A,A=se.next,se.next=null,h.lastBaseUpdate=se,h.shared.pending=null}}while(!0);ue===null&&($=fe),h.baseState=$,h.firstBaseUpdate=ie,h.lastBaseUpdate=ue,b===null&&(h.shared.lanes=0),Ba|=S,t.lanes=S,t.memoizedState=fe}}function km(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Am(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)km(l[t],n)}var dl=B(null),Jo=B(0);function Mm(t,n){t=sa,w(Jo,t),w(dl,n),sa=t|n.baseLanes}function Bf(){w(Jo,sa),w(dl,dl.current)}function Rf(){sa=Jo.current,Z(dl),Z(Jo)}var Jn=B(null),hi=null;function Da(t){var n=t.alternate;w(en,en.current&1),w(Jn,t),hi===null&&(n===null||dl.current!==null||n.memoizedState!==null)&&(hi=t)}function Lf(t){w(en,en.current),w(Jn,t),hi===null&&(hi=t)}function jm(t){t.tag===22?(w(en,en.current),w(Jn,t),hi===null&&(hi=t)):Oa()}function Oa(){w(en,en.current),w(Jn,Jn.current)}function Xn(t){Z(Jn),hi===t&&(hi=null),Z(en)}var en=B(0);function Xo(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Pd(l)||qd(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Wi=0,Je=null,Mt=null,ln=null,Zo=!1,hl=!1,Ar=!1,Wo=0,vs=0,pl=null,eS=0;function Yt(){throw Error(r(321))}function zf(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!Yn(t[l],n[l]))return!1;return!0}function If(t,n,l,u,h,b){return Wi=b,Je=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,E.H=t===null||t.memoizedState===null?dg:ed,Ar=!1,b=l(u,h),Ar=!1,hl&&(b=Dm(n,l,u,h)),Tm(t),b}function Tm(t){E.H=ws;var n=Mt!==null&&Mt.next!==null;if(Wi=0,ln=Mt=Je=null,Zo=!1,vs=0,pl=null,n)throw Error(r(300));t===null||sn||(t=t.dependencies,t!==null&&Po(t)&&(sn=!0))}function Dm(t,n,l,u){Je=t;var h=0;do{if(hl&&(pl=null),vs=0,hl=!1,25<=h)throw Error(r(301));if(h+=1,ln=Mt=null,t.updateQueue!=null){var b=t.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}E.H=hg,b=n(l,u)}while(hl);return b}function tS(){var t=E.H,n=t.useState()[0];return n=typeof n.then=="function"?Ss(n):n,t=t.useState()[0],(Mt!==null?Mt.memoizedState:null)!==t&&(Je.flags|=1024),n}function $f(){var t=Wo!==0;return Wo=0,t}function Hf(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Uf(t){if(Zo){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Zo=!1}Wi=0,ln=Mt=Je=null,hl=!1,vs=Wo=0,pl=null}function Fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?Je.memoizedState=ln=t:ln=ln.next=t,ln}function tn(){if(Mt===null){var t=Je.alternate;t=t!==null?t.memoizedState:null}else t=Mt.next;var n=ln===null?Je.memoizedState:ln.next;if(n!==null)ln=n,Mt=t;else{if(t===null)throw Je.alternate===null?Error(r(467)):Error(r(310));Mt=t,t={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},ln===null?Je.memoizedState=ln=t:ln=ln.next=t}return ln}function eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ss(t){var n=vs;return vs+=1,pl===null&&(pl=[]),t=Sm(pl,t,n),n=Je,(ln===null?n.memoizedState:ln.next)===null&&(n=n.alternate,E.H=n===null||n.memoizedState===null?dg:ed),t}function tu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ss(t);if(t.$$typeof===T)return bn(t)}throw Error(r(438,String(t)))}function Pf(t){var n=null,l=Je.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var u=Je.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=eu(),Je.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),u=0;u<t;u++)l[u]=j;return n.index++,l}function ea(t,n){return typeof n=="function"?n(t):n}function nu(t){var n=tn();return qf(n,Mt,t)}function qf(t,n,l){var u=t.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=l;var h=t.baseQueue,b=u.pending;if(b!==null){if(h!==null){var S=h.next;h.next=b.next,b.next=S}n.baseQueue=h=b,u.pending=null}if(b=t.baseState,h===null)t.memoizedState=b;else{n=h.next;var A=S=null,$=null,ie=n,ue=!1;do{var fe=ie.lane&-536870913;if(fe!==ie.lane?(ft&fe)===fe:(Wi&fe)===fe){var re=ie.revertLane;if(re===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),fe===ol&&(ue=!0);else if((Wi&re)===re){ie=ie.next,re===ol&&(ue=!0);continue}else fe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},$===null?(A=$=fe,S=b):$=$.next=fe,Je.lanes|=re,Ba|=re;fe=ie.action,Ar&&l(b,fe),b=ie.hasEagerState?ie.eagerState:l(b,fe)}else re={lane:fe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},$===null?(A=$=re,S=b):$=$.next=re,Je.lanes|=fe,Ba|=fe;ie=ie.next}while(ie!==null&&ie!==n);if($===null?S=b:$.next=A,!Yn(b,t.memoizedState)&&(sn=!0,ue&&(l=ul,l!==null)))throw l;t.memoizedState=b,t.baseState=S,t.baseQueue=$,u.lastRenderedState=b}return h===null&&(u.lanes=0),[t.memoizedState,u.dispatch]}function Gf(t){var n=tn(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var u=l.dispatch,h=l.pending,b=n.memoizedState;if(h!==null){l.pending=null;var S=h=h.next;do b=t(b,S.action),S=S.next;while(S!==h);Yn(b,n.memoizedState)||(sn=!0),n.memoizedState=b,n.baseQueue===null&&(n.baseState=b),l.lastRenderedState=b}return[b,u]}function Om(t,n,l){var u=Je,h=tn(),b=mt;if(b){if(l===void 0)throw Error(r(407));l=l()}else l=n();var S=!Yn((Mt||h).memoizedState,l);if(S&&(h.memoizedState=l,sn=!0),h=h.queue,Yf(Bm.bind(null,u,h,t),[t]),h.getSnapshot!==n||S||ln!==null&&ln.memoizedState.tag&1){if(u.flags|=2048,ml(9,{destroy:void 0},Fm.bind(null,u,h,l,n),null),_t===null)throw Error(r(349));b||(Wi&127)!==0||_m(u,n,l)}return l}function _m(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=Je.updateQueue,n===null?(n=eu(),Je.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Fm(t,n,l,u){n.value=l,n.getSnapshot=u,Rm(n)&&Lm(t)}function Bm(t,n,l){return l(function(){Rm(n)&&Lm(t)})}function Rm(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Yn(t,l)}catch{return!0}}function Lm(t){var n=br(t,2);n!==null&&Un(n,t,2)}function Vf(t){var n=Fn();if(typeof t=="function"){var l=t;if(t=l(),Ar){pt(!0);try{l()}finally{pt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:t},n}function zm(t,n,l,u){return t.baseState=l,qf(t,Mt,typeof u=="function"?u:ea)}function nS(t,n,l,u,h){if(ru(t))throw Error(r(485));if(t=n.action,t!==null){var b={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){b.listeners.push(S)}};E.T!==null?l(!0):b.isTransition=!1,u(b),l=n.pending,l===null?(b.next=n.pending=b,Im(n,b)):(b.next=l.next,n.pending=l.next=b)}}function Im(t,n){var l=n.action,u=n.payload,h=t.state;if(n.isTransition){var b=E.T,S={};E.T=S;try{var A=l(h,u),$=E.S;$!==null&&$(S,A),$m(t,n,A)}catch(ie){Kf(t,n,ie)}finally{b!==null&&S.types!==null&&(b.types=S.types),E.T=b}}else try{b=l(h,u),$m(t,n,b)}catch(ie){Kf(t,n,ie)}}function $m(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Hm(t,n,u)},function(u){return Kf(t,n,u)}):Hm(t,n,l)}function Hm(t,n,l){n.status="fulfilled",n.value=l,Um(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Im(t,l)))}function Kf(t,n,l){var u=t.pending;if(t.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=l,Um(n),n=n.next;while(n!==u)}t.action=null}function Um(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Pm(t,n){return n}function qm(t,n){if(mt){var l=_t.formState;if(l!==null){e:{var u=Je;if(mt){if(It){t:{for(var h=It,b=di;h.nodeType!==8;){if(!b){h=null;break t}if(h=pi(h.nextSibling),h===null){h=null;break t}}b=h.data,h=b==="F!"||b==="F"?h:null}if(h){It=pi(h.nextSibling),u=h.data==="F!";break e}}ka(u)}u=!1}u&&(n=l[0])}}return l=Fn(),l.memoizedState=l.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pm,lastRenderedState:n},l.queue=u,l=ug.bind(null,Je,u),u.dispatch=l,u=Vf(!1),b=Wf.bind(null,Je,!1,u.queue),u=Fn(),h={state:n,dispatch:null,action:t,pending:null},u.queue=h,l=nS.bind(null,Je,h,b,l),h.dispatch=l,u.memoizedState=t,[n,l,!1]}function Gm(t){var n=tn();return Vm(n,Mt,t)}function Vm(t,n,l){if(n=qf(t,n,Pm)[0],t=nu(ea)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=Ss(n)}catch(S){throw S===cl?Vo:S}else u=n;n=tn();var h=n.queue,b=h.dispatch;return l!==n.memoizedState&&(Je.flags|=2048,ml(9,{destroy:void 0},iS.bind(null,h,l),null)),[u,b,t]}function iS(t,n){t.action=n}function Km(t){var n=tn(),l=Mt;if(l!==null)return Vm(n,l,t);tn(),n=n.memoizedState,l=tn();var u=l.queue.dispatch;return l.memoizedState=t,[n,u,!1]}function ml(t,n,l,u){return t={tag:t,create:l,deps:u,inst:n,next:null},n=Je.updateQueue,n===null&&(n=eu(),Je.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(u=l.next,l.next=t,t.next=u,n.lastEffect=t),t}function Ym(){return tn().memoizedState}function iu(t,n,l,u){var h=Fn();Je.flags|=t,h.memoizedState=ml(1|n,{destroy:void 0},l,u===void 0?null:u)}function au(t,n,l,u){var h=tn();u=u===void 0?null:u;var b=h.memoizedState.inst;Mt!==null&&u!==null&&zf(u,Mt.memoizedState.deps)?h.memoizedState=ml(n,b,l,u):(Je.flags|=t,h.memoizedState=ml(1|n,b,l,u))}function Qm(t,n){iu(8390656,8,t,n)}function Yf(t,n){au(2048,8,t,n)}function aS(t){Je.flags|=4;var n=Je.updateQueue;if(n===null)n=eu(),Je.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function Jm(t){var n=tn().memoizedState;return aS({ref:n,nextImpl:t}),function(){if((wt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function Xm(t,n){return au(4,2,t,n)}function Zm(t,n){return au(4,4,t,n)}function Wm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function eg(t,n,l){l=l!=null?l.concat([t]):null,au(4,4,Wm.bind(null,n,t),l)}function Qf(){}function tg(t,n){var l=tn();n=n===void 0?null:n;var u=l.memoizedState;return n!==null&&zf(n,u[1])?u[0]:(l.memoizedState=[t,n],t)}function ng(t,n){var l=tn();n=n===void 0?null:n;var u=l.memoizedState;if(n!==null&&zf(n,u[1]))return u[0];if(u=t(),Ar){pt(!0);try{t()}finally{pt(!1)}}return l.memoizedState=[u,n],u}function Jf(t,n,l){return l===void 0||(Wi&1073741824)!==0&&(ft&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=ix(),Je.lanes|=t,Ba|=t,l)}function ig(t,n,l,u){return Yn(l,n)?l:dl.current!==null?(t=Jf(t,l,u),Yn(t,n)||(sn=!0),t):(Wi&42)===0||(Wi&1073741824)!==0&&(ft&261930)===0?(sn=!0,t.memoizedState=l):(t=ix(),Je.lanes|=t,Ba|=t,n)}function ag(t,n,l,u,h){var b=_.p;_.p=b!==0&&8>b?b:8;var S=E.T,A={};E.T=A,Wf(t,!1,n,l);try{var $=h(),ie=E.S;if(ie!==null&&ie(A,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ue=Wv($,u);Ns(t,n,ue,ei(t))}else Ns(t,n,u,ei(t))}catch(fe){Ns(t,n,{then:function(){},status:"rejected",reason:fe},ei())}finally{_.p=b,S!==null&&A.types!==null&&(S.types=A.types),E.T=S}}function rS(){}function Xf(t,n,l,u){if(t.tag!==5)throw Error(r(476));var h=rg(t).queue;ag(t,h,n,Y,l===null?rS:function(){return lg(t),l(u)})}function rg(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:Y},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function lg(t){var n=rg(t);n.next===null&&(n=t.alternate.memoizedState),Ns(t,n.next.queue,{},ei())}function Zf(){return bn(Is)}function sg(){return tn().memoizedState}function og(){return tn().memoizedState}function lS(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=ei();t=ja(l);var u=Ta(n,t,l);u!==null&&(Un(u,n,l),xs(u,n,l)),n={cache:Af()},t.payload=n;return}n=n.return}}function sS(t,n,l){var u=ei();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ru(t)?cg(n,l):(l=gf(t,n,l,u),l!==null&&(Un(l,t,u),fg(l,n,u)))}function ug(t,n,l){var u=ei();Ns(t,n,l,u)}function Ns(t,n,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ru(t))cg(n,h);else{var b=t.alternate;if(t.lanes===0&&(b===null||b.lanes===0)&&(b=n.lastRenderedReducer,b!==null))try{var S=n.lastRenderedState,A=b(S,l);if(h.hasEagerState=!0,h.eagerState=A,Yn(A,S))return Io(t,n,h,0),_t===null&&zo(),!1}catch{}if(l=gf(t,n,h,u),l!==null)return Un(l,t,u),fg(l,n,u),!0}return!1}function Wf(t,n,l,u){if(u={lane:2,revertLane:Dd(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ru(t)){if(n)throw Error(r(479))}else n=gf(t,l,u,2),n!==null&&Un(n,t,2)}function ru(t){var n=t.alternate;return t===Je||n!==null&&n===Je}function cg(t,n){hl=Zo=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function fg(t,n,l){if((l&4194048)!==0){var u=n.lanes;u&=t.pendingLanes,l|=u,n.lanes=l,He(t,l)}}var ws={readContext:bn,use:tu,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};ws.useEffectEvent=Yt;var dg={readContext:bn,use:tu,useCallback:function(t,n){return Fn().memoizedState=[t,n===void 0?null:n],t},useContext:bn,useEffect:Qm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,iu(4194308,4,Wm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return iu(4194308,4,t,n)},useInsertionEffect:function(t,n){iu(4,2,t,n)},useMemo:function(t,n){var l=Fn();n=n===void 0?null:n;var u=t();if(Ar){pt(!0);try{t()}finally{pt(!1)}}return l.memoizedState=[u,n],u},useReducer:function(t,n,l){var u=Fn();if(l!==void 0){var h=l(n);if(Ar){pt(!0);try{l(n)}finally{pt(!1)}}}else h=n;return u.memoizedState=u.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},u.queue=t,t=t.dispatch=sS.bind(null,Je,t),[u.memoizedState,t]},useRef:function(t){var n=Fn();return t={current:t},n.memoizedState=t},useState:function(t){t=Vf(t);var n=t.queue,l=ug.bind(null,Je,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Qf,useDeferredValue:function(t,n){var l=Fn();return Jf(l,t,n)},useTransition:function(){var t=Vf(!1);return t=ag.bind(null,Je,t.queue,!0,!1),Fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var u=Je,h=Fn();if(mt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),_t===null)throw Error(r(349));(ft&127)!==0||_m(u,n,l)}h.memoizedState=l;var b={value:l,getSnapshot:n};return h.queue=b,Qm(Bm.bind(null,u,b,t),[t]),u.flags|=2048,ml(9,{destroy:void 0},Fm.bind(null,u,b,l,n),null),l},useId:function(){var t=Fn(),n=_t.identifierPrefix;if(mt){var l=_i,u=Oi;l=(u&~(1<<32-at(u)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Wo++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=eS++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Zf,useFormState:qm,useActionState:qm,useOptimistic:function(t){var n=Fn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Wf.bind(null,Je,!0,l),l.dispatch=n,[t,n]},useMemoCache:Pf,useCacheRefresh:function(){return Fn().memoizedState=lS.bind(null,Je)},useEffectEvent:function(t){var n=Fn(),l={impl:t};return n.memoizedState=l,function(){if((wt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},ed={readContext:bn,use:tu,useCallback:tg,useContext:bn,useEffect:Yf,useImperativeHandle:eg,useInsertionEffect:Xm,useLayoutEffect:Zm,useMemo:ng,useReducer:nu,useRef:Ym,useState:function(){return nu(ea)},useDebugValue:Qf,useDeferredValue:function(t,n){var l=tn();return ig(l,Mt.memoizedState,t,n)},useTransition:function(){var t=nu(ea)[0],n=tn().memoizedState;return[typeof t=="boolean"?t:Ss(t),n]},useSyncExternalStore:Om,useId:sg,useHostTransitionStatus:Zf,useFormState:Gm,useActionState:Gm,useOptimistic:function(t,n){var l=tn();return zm(l,Mt,t,n)},useMemoCache:Pf,useCacheRefresh:og};ed.useEffectEvent=Jm;var hg={readContext:bn,use:tu,useCallback:tg,useContext:bn,useEffect:Yf,useImperativeHandle:eg,useInsertionEffect:Xm,useLayoutEffect:Zm,useMemo:ng,useReducer:Gf,useRef:Ym,useState:function(){return Gf(ea)},useDebugValue:Qf,useDeferredValue:function(t,n){var l=tn();return Mt===null?Jf(l,t,n):ig(l,Mt.memoizedState,t,n)},useTransition:function(){var t=Gf(ea)[0],n=tn().memoizedState;return[typeof t=="boolean"?t:Ss(t),n]},useSyncExternalStore:Om,useId:sg,useHostTransitionStatus:Zf,useFormState:Km,useActionState:Km,useOptimistic:function(t,n){var l=tn();return Mt!==null?zm(l,Mt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Pf,useCacheRefresh:og};hg.useEffectEvent=Jm;function td(t,n,l,u){n=t.memoizedState,l=l(u,n),l=l==null?n:m({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var nd={enqueueSetState:function(t,n,l){t=t._reactInternals;var u=ei(),h=ja(u);h.payload=n,l!=null&&(h.callback=l),n=Ta(t,h,u),n!==null&&(Un(n,t,u),xs(n,t,u))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var u=ei(),h=ja(u);h.tag=1,h.payload=n,l!=null&&(h.callback=l),n=Ta(t,h,u),n!==null&&(Un(n,t,u),xs(n,t,u))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=ei(),u=ja(l);u.tag=2,n!=null&&(u.callback=n),n=Ta(t,u,l),n!==null&&(Un(n,t,l),xs(n,t,l))}};function pg(t,n,l,u,h,b,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(u,b,S):n.prototype&&n.prototype.isPureReactComponent?!us(l,u)||!us(h,b):!0}function mg(t,n,l,u){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,u),n.state!==t&&nd.enqueueReplaceState(n,n.state,null)}function Mr(t,n){var l=n;if("ref"in n){l={};for(var u in n)u!=="ref"&&(l[u]=n[u])}if(t=t.defaultProps){l===n&&(l=m({},l));for(var h in t)l[h]===void 0&&(l[h]=t[h])}return l}function gg(t){Lo(t)}function xg(t){console.error(t)}function bg(t){Lo(t)}function lu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function yg(t,n,l){try{var u=t.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function id(t,n,l){return l=ja(l),l.tag=3,l.payload={element:null},l.callback=function(){lu(t,n)},l}function vg(t){return t=ja(t),t.tag=3,t}function Sg(t,n,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var b=u.value;t.payload=function(){return h(b)},t.callback=function(){yg(n,l,u)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){yg(n,l,u),typeof h!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var A=u.stack;this.componentDidCatch(u.value,{componentStack:A!==null?A:""})})}function oS(t,n,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=l.alternate,n!==null&&sl(n,l,h,!0),l=Jn.current,l!==null){switch(l.tag){case 31:case 13:return hi===null?bu():l.alternate===null&&Qt===0&&(Qt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===Ko?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([u]):n.add(u),Md(t,u,h)),!1;case 22:return l.flags|=65536,u===Ko?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([u]):l.add(u)),Md(t,u,h)),!1}throw Error(r(435,l.tag))}return Md(t,u,h),bu(),!1}if(mt)return n=Jn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,u!==Nf&&(t=Error(r(422),{cause:u}),ds(ui(t,l)))):(u!==Nf&&(n=Error(r(423),{cause:u}),ds(ui(n,l))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,u=ui(u,l),h=id(t.stateNode,u,h),_f(t,h),Qt!==4&&(Qt=2)),!1;var b=Error(r(520),{cause:u});if(b=ui(b,l),Ds===null?Ds=[b]:Ds.push(b),Qt!==4&&(Qt=2),n===null)return!0;u=ui(u,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=h&-h,l.lanes|=t,t=id(l.stateNode,u,t),_f(l,t),!1;case 1:if(n=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ra===null||!Ra.has(b))))return l.flags|=65536,h&=-h,l.lanes|=h,h=vg(h),Sg(h,t,l,u),_f(l,h),!1}l=l.return}while(l!==null);return!1}var ad=Error(r(461)),sn=!1;function yn(t,n,l,u){n.child=t===null?Em(n,null,l,u):kr(n,t.child,l,u)}function Ng(t,n,l,u,h){l=l.render;var b=n.ref;if("ref"in u){var S={};for(var A in u)A!=="ref"&&(S[A]=u[A])}else S=u;return Nr(n),u=If(t,n,l,S,b,h),A=$f(),t!==null&&!sn?(Hf(t,n,h),ta(t,n,h)):(mt&&A&&vf(n),n.flags|=1,yn(t,n,u,h),n.child)}function wg(t,n,l,u,h){if(t===null){var b=l.type;return typeof b=="function"&&!xf(b)&&b.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=b,Cg(t,n,b,u,h)):(t=Ho(l.type,null,u,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(b=t.child,!dd(t,h)){var S=b.memoizedProps;if(l=l.compare,l=l!==null?l:us,l(S,u)&&t.ref===n.ref)return ta(t,n,h)}return n.flags|=1,t=Qi(b,u),t.ref=n.ref,t.return=n,n.child=t}function Cg(t,n,l,u,h){if(t!==null){var b=t.memoizedProps;if(us(b,u)&&t.ref===n.ref)if(sn=!1,n.pendingProps=u=b,dd(t,h))(t.flags&131072)!==0&&(sn=!0);else return n.lanes=t.lanes,ta(t,n,h)}return rd(t,n,l,u,h)}function Eg(t,n,l,u){var h=u.children,b=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(b=b!==null?b.baseLanes|l:l,t!==null){for(u=n.child=t.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~b}else u=0,n.child=null;return kg(t,n,b,l,u)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Go(n,b!==null?b.cachePool:null),b!==null?Mm(n,b):Bf(),jm(n);else return u=n.lanes=536870912,kg(t,n,b!==null?b.baseLanes|l:l,l,u)}else b!==null?(Go(n,b.cachePool),Mm(n,b),Oa(),n.memoizedState=null):(t!==null&&Go(n,null),Bf(),Oa());return yn(t,n,h,l),n.child}function Cs(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function kg(t,n,l,u,h){var b=jf();return b=b===null?null:{parent:rn._currentValue,pool:b},n.memoizedState={baseLanes:l,cachePool:b},t!==null&&Go(n,null),Bf(),jm(n),t!==null&&sl(t,n,u,!0),n.childLanes=h,null}function su(t,n){return n=uu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Ag(t,n,l){return kr(n,t.child,null,l),t=su(n,n.pendingProps),t.flags|=2,Xn(n),n.memoizedState=null,t}function uS(t,n,l){var u=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(mt){if(u.mode==="hidden")return t=su(n,u),n.lanes=536870912,Cs(null,t);if(Lf(n),(t=It)?(t=Ix(t,di),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ca!==null?{id:Oi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},l=cm(t),l.return=n,n.child=l,xn=n,It=null)):t=null,t===null)throw ka(n);return n.lanes=536870912,null}return su(n,u)}var b=t.memoizedState;if(b!==null){var S=b.dehydrated;if(Lf(n),h)if(n.flags&256)n.flags&=-257,n=Ag(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(sn||sl(t,n,l,!1),h=(l&t.childLanes)!==0,sn||h){if(u=_t,u!==null&&(S=Dn(u,l),S!==0&&S!==b.retryLane))throw b.retryLane=S,br(t,S),Un(u,t,S),ad;bu(),n=Ag(t,n,l)}else t=b.treeContext,It=pi(S.nextSibling),xn=n,mt=!0,Ea=null,di=!1,t!==null&&hm(n,t),n=su(n,u),n.flags|=4096;return n}return t=Qi(t.child,{mode:u.mode,children:u.children}),t.ref=n.ref,n.child=t,t.return=n,t}function ou(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function rd(t,n,l,u,h){return Nr(n),l=If(t,n,l,u,void 0,h),u=$f(),t!==null&&!sn?(Hf(t,n,h),ta(t,n,h)):(mt&&u&&vf(n),n.flags|=1,yn(t,n,l,h),n.child)}function Mg(t,n,l,u,h,b){return Nr(n),n.updateQueue=null,l=Dm(n,u,l,h),Tm(t),u=$f(),t!==null&&!sn?(Hf(t,n,b),ta(t,n,b)):(mt&&u&&vf(n),n.flags|=1,yn(t,n,l,b),n.child)}function jg(t,n,l,u,h){if(Nr(n),n.stateNode===null){var b=il,S=l.contextType;typeof S=="object"&&S!==null&&(b=bn(S)),b=new l(u,b),n.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=nd,n.stateNode=b,b._reactInternals=n,b=n.stateNode,b.props=u,b.state=n.memoizedState,b.refs={},Df(n),S=l.contextType,b.context=typeof S=="object"&&S!==null?bn(S):il,b.state=n.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(td(n,l,S,u),b.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(S=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),S!==b.state&&nd.enqueueReplaceState(b,b.state,null),ys(n,u,b,h),bs(),b.state=n.memoizedState),typeof b.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(t===null){b=n.stateNode;var A=n.memoizedProps,$=Mr(l,A);b.props=$;var ie=b.context,ue=l.contextType;S=il,typeof ue=="object"&&ue!==null&&(S=bn(ue));var fe=l.getDerivedStateFromProps;ue=typeof fe=="function"||typeof b.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ue||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(A||ie!==S)&&mg(n,b,u,S),Ma=!1;var re=n.memoizedState;b.state=re,ys(n,u,b,h),bs(),ie=n.memoizedState,A||re!==ie||Ma?(typeof fe=="function"&&(td(n,l,fe,u),ie=n.memoizedState),($=Ma||pg(n,l,$,u,re,ie,S))?(ue||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(n.flags|=4194308)):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=ie),b.props=u,b.state=ie,b.context=S,u=$):(typeof b.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{b=n.stateNode,Of(t,n),S=n.memoizedProps,ue=Mr(l,S),b.props=ue,fe=n.pendingProps,re=b.context,ie=l.contextType,$=il,typeof ie=="object"&&ie!==null&&($=bn(ie)),A=l.getDerivedStateFromProps,(ie=typeof A=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(S!==fe||re!==$)&&mg(n,b,u,$),Ma=!1,re=n.memoizedState,b.state=re,ys(n,u,b,h),bs();var se=n.memoizedState;S!==fe||re!==se||Ma||t!==null&&t.dependencies!==null&&Po(t.dependencies)?(typeof A=="function"&&(td(n,l,A,u),se=n.memoizedState),(ue=Ma||pg(n,l,ue,u,re,se,$)||t!==null&&t.dependencies!==null&&Po(t.dependencies))?(ie||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(u,se,$),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(u,se,$)),typeof b.componentDidUpdate=="function"&&(n.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof b.componentDidUpdate!="function"||S===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=se),b.props=u,b.state=se,b.context=$,u=ue):(typeof b.componentDidUpdate!="function"||S===t.memoizedProps&&re===t.memoizedState||(n.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&re===t.memoizedState||(n.flags|=1024),u=!1)}return b=u,ou(t,n),u=(n.flags&128)!==0,b||u?(b=n.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:b.render(),n.flags|=1,t!==null&&u?(n.child=kr(n,t.child,null,h),n.child=kr(n,null,l,h)):yn(t,n,l,h),n.memoizedState=b.state,t=n.child):t=ta(t,n,h),t}function Tg(t,n,l,u){return vr(),n.flags|=256,yn(t,n,l,u),n.child}var ld={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sd(t){return{baseLanes:t,cachePool:ym()}}function od(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Wn),t}function Dg(t,n,l){var u=n.pendingProps,h=!1,b=(n.flags&128)!==0,S;if((S=b)||(S=t!==null&&t.memoizedState===null?!1:(en.current&2)!==0),S&&(h=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,t===null){if(mt){if(h?Da(n):Oa(),(t=It)?(t=Ix(t,di),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ca!==null?{id:Oi,overflow:_i}:null,retryLane:536870912,hydrationErrors:null},l=cm(t),l.return=n,n.child=l,xn=n,It=null)):t=null,t===null)throw ka(n);return qd(t)?n.lanes=32:n.lanes=536870912,null}var A=u.children;return u=u.fallback,h?(Oa(),h=n.mode,A=uu({mode:"hidden",children:A},h),u=yr(u,h,l,null),A.return=n,u.return=n,A.sibling=u,n.child=A,u=n.child,u.memoizedState=sd(l),u.childLanes=od(t,S,l),n.memoizedState=ld,Cs(null,u)):(Da(n),ud(n,A))}var $=t.memoizedState;if($!==null&&(A=$.dehydrated,A!==null)){if(b)n.flags&256?(Da(n),n.flags&=-257,n=cd(t,n,l)):n.memoizedState!==null?(Oa(),n.child=t.child,n.flags|=128,n=null):(Oa(),A=u.fallback,h=n.mode,u=uu({mode:"visible",children:u.children},h),A=yr(A,h,l,null),A.flags|=2,u.return=n,A.return=n,u.sibling=A,n.child=u,kr(n,t.child,null,l),u=n.child,u.memoizedState=sd(l),u.childLanes=od(t,S,l),n.memoizedState=ld,n=Cs(null,u));else if(Da(n),qd(A)){if(S=A.nextSibling&&A.nextSibling.dataset,S)var ie=S.dgst;S=ie,u=Error(r(419)),u.stack="",u.digest=S,ds({value:u,source:null,stack:null}),n=cd(t,n,l)}else if(sn||sl(t,n,l,!1),S=(l&t.childLanes)!==0,sn||S){if(S=_t,S!==null&&(u=Dn(S,l),u!==0&&u!==$.retryLane))throw $.retryLane=u,br(t,u),Un(S,t,u),ad;Pd(A)||bu(),n=cd(t,n,l)}else Pd(A)?(n.flags|=192,n.child=t.child,n=null):(t=$.treeContext,It=pi(A.nextSibling),xn=n,mt=!0,Ea=null,di=!1,t!==null&&hm(n,t),n=ud(n,u.children),n.flags|=4096);return n}return h?(Oa(),A=u.fallback,h=n.mode,$=t.child,ie=$.sibling,u=Qi($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,ie!==null?A=Qi(ie,A):(A=yr(A,h,l,null),A.flags|=2),A.return=n,u.return=n,u.sibling=A,n.child=u,Cs(null,u),u=n.child,A=t.child.memoizedState,A===null?A=sd(l):(h=A.cachePool,h!==null?($=rn._currentValue,h=h.parent!==$?{parent:$,pool:$}:h):h=ym(),A={baseLanes:A.baseLanes|l,cachePool:h}),u.memoizedState=A,u.childLanes=od(t,S,l),n.memoizedState=ld,Cs(t.child,u)):(Da(n),l=t.child,t=l.sibling,l=Qi(l,{mode:"visible",children:u.children}),l.return=n,l.sibling=null,t!==null&&(S=n.deletions,S===null?(n.deletions=[t],n.flags|=16):S.push(t)),n.child=l,n.memoizedState=null,l)}function ud(t,n){return n=uu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function uu(t,n){return t=Qn(22,t,null,n),t.lanes=0,t}function cd(t,n,l){return kr(n,t.child,null,l),t=ud(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Og(t,n,l){t.lanes|=n;var u=t.alternate;u!==null&&(u.lanes|=n),Ef(t.return,n,l)}function fd(t,n,l,u,h,b){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:b}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=u,S.tail=l,S.tailMode=h,S.treeForkCount=b)}function _g(t,n,l){var u=n.pendingProps,h=u.revealOrder,b=u.tail;u=u.children;var S=en.current,A=(S&2)!==0;if(A?(S=S&1|2,n.flags|=128):S&=1,w(en,S),yn(t,n,u,l),u=mt?fs:0,!A&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Og(t,l,n);else if(t.tag===19)Og(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(l=n.child,h=null;l!==null;)t=l.alternate,t!==null&&Xo(t)===null&&(h=l),l=l.sibling;l=h,l===null?(h=n.child,n.child=null):(h=l.sibling,l.sibling=null),fd(n,!1,h,l,b,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&Xo(t)===null){n.child=h;break}t=h.sibling,h.sibling=l,l=h,h=t}fd(n,!0,l,null,b,u);break;case"together":fd(n,!1,null,null,void 0,u);break;default:n.memoizedState=null}return n.child}function ta(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),Ba|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(sl(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=Qi(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=Qi(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function dd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Po(t)))}function cS(t,n,l){switch(n.tag){case 3:Ve(n,n.stateNode.containerInfo),Aa(n,rn,t.memoizedState.cache),vr();break;case 27:case 5:Dt(n);break;case 4:Ve(n,n.stateNode.containerInfo);break;case 10:Aa(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Lf(n),null;break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(Da(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Dg(t,n,l):(Da(n),t=ta(t,n,l),t!==null?t.sibling:null);Da(n);break;case 19:var h=(t.flags&128)!==0;if(u=(l&n.childLanes)!==0,u||(sl(t,n,l,!1),u=(l&n.childLanes)!==0),h){if(u)return _g(t,n,l);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),w(en,en.current),u)break;return null;case 22:return n.lanes=0,Eg(t,n,l,n.pendingProps);case 24:Aa(n,rn,t.memoizedState.cache)}return ta(t,n,l)}function Fg(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)sn=!0;else{if(!dd(t,l)&&(n.flags&128)===0)return sn=!1,cS(t,n,l);sn=(t.flags&131072)!==0}else sn=!1,mt&&(n.flags&1048576)!==0&&dm(n,fs,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(t=Cr(n.elementType),n.type=t,typeof t=="function")xf(t)?(u=Mr(t,u),n.tag=1,n=jg(null,n,t,u,l)):(n.tag=0,n=rd(null,n,t,u,l));else{if(t!=null){var h=t.$$typeof;if(h===Q){n.tag=11,n=Ng(null,n,t,u,l);break e}else if(h===F){n.tag=14,n=wg(null,n,t,u,l);break e}}throw n=H(t)||t,Error(r(306,n,""))}}return n;case 0:return rd(t,n,n.type,n.pendingProps,l);case 1:return u=n.type,h=Mr(u,n.pendingProps),jg(t,n,u,h,l);case 3:e:{if(Ve(n,n.stateNode.containerInfo),t===null)throw Error(r(387));u=n.pendingProps;var b=n.memoizedState;h=b.element,Of(t,n),ys(n,u,null,l);var S=n.memoizedState;if(u=S.cache,Aa(n,rn,u),u!==b.cache&&kf(n,[rn],l,!0),bs(),u=S.element,b.isDehydrated)if(b={element:u,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=b,n.memoizedState=b,n.flags&256){n=Tg(t,n,u,l);break e}else if(u!==h){h=ui(Error(r(424)),n),ds(h),n=Tg(t,n,u,l);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,It=pi(t.firstChild),xn=n,mt=!0,Ea=null,di=!0,l=Em(n,null,u,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(vr(),u===h){n=ta(t,n,l);break e}yn(t,n,u,l)}n=n.child}return n;case 26:return ou(t,n),t===null?(l=Gx(n.type,null,n.pendingProps,null))?n.memoizedState=l:mt||(l=n.type,t=n.pendingProps,u=Eu(Se.current).createElement(l),u[lt]=n,u[At]=t,vn(u,l,t),an(u),n.stateNode=u):n.memoizedState=Gx(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Dt(n),t===null&&mt&&(u=n.stateNode=Ux(n.type,n.pendingProps,Se.current),xn=n,di=!0,h=It,$a(n.type)?(Gd=h,It=pi(u.firstChild)):It=h),yn(t,n,n.pendingProps.children,l),ou(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&mt&&((h=u=It)&&(u=$S(u,n.type,n.pendingProps,di),u!==null?(n.stateNode=u,xn=n,It=pi(u.firstChild),di=!1,h=!0):h=!1),h||ka(n)),Dt(n),h=n.type,b=n.pendingProps,S=t!==null?t.memoizedProps:null,u=b.children,$d(h,b)?u=null:S!==null&&$d(h,S)&&(n.flags|=32),n.memoizedState!==null&&(h=If(t,n,tS,null,null,l),Is._currentValue=h),ou(t,n),yn(t,n,u,l),n.child;case 6:return t===null&&mt&&((t=l=It)&&(l=HS(l,n.pendingProps,di),l!==null?(n.stateNode=l,xn=n,It=null,t=!0):t=!1),t||ka(n)),null;case 13:return Dg(t,n,l);case 4:return Ve(n,n.stateNode.containerInfo),u=n.pendingProps,t===null?n.child=kr(n,null,u,l):yn(t,n,u,l),n.child;case 11:return Ng(t,n,n.type,n.pendingProps,l);case 7:return yn(t,n,n.pendingProps,l),n.child;case 8:return yn(t,n,n.pendingProps.children,l),n.child;case 12:return yn(t,n,n.pendingProps.children,l),n.child;case 10:return u=n.pendingProps,Aa(n,n.type,u.value),yn(t,n,u.children,l),n.child;case 9:return h=n.type._context,u=n.pendingProps.children,Nr(n),h=bn(h),u=u(h),n.flags|=1,yn(t,n,u,l),n.child;case 14:return wg(t,n,n.type,n.pendingProps,l);case 15:return Cg(t,n,n.type,n.pendingProps,l);case 19:return _g(t,n,l);case 31:return uS(t,n,l);case 22:return Eg(t,n,l,n.pendingProps);case 24:return Nr(n),u=bn(rn),t===null?(h=jf(),h===null&&(h=_t,b=Af(),h.pooledCache=b,b.refCount++,b!==null&&(h.pooledCacheLanes|=l),h=b),n.memoizedState={parent:u,cache:h},Df(n),Aa(n,rn,h)):((t.lanes&l)!==0&&(Of(t,n),ys(n,null,null,l),bs()),h=t.memoizedState,b=n.memoizedState,h.parent!==u?(h={parent:u,cache:u},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Aa(n,rn,u)):(u=b.cache,Aa(n,rn,u),u!==h.cache&&kf(n,[rn],l,!0))),yn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function na(t){t.flags|=4}function hd(t,n,l,u,h){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(sx())t.flags|=8192;else throw Er=Ko,Tf}else t.flags&=-16777217}function Bg(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Jx(n))if(sx())t.flags|=8192;else throw Er=Ko,Tf}function cu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ai():536870912,t.lanes|=n,yl|=n)}function Es(t,n){if(!mt)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:u.sibling=null}}function $t(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,u=0;if(n)for(var h=t.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=u,t.childLanes=l,n}function fS(t,n,l){var u=n.pendingProps;switch(Sf(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(n),null;case 1:return $t(n),null;case 3:return l=n.stateNode,u=null,t!==null&&(u=t.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),Zi(rn),Ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ll(n)?na(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,wf())),$t(n),null;case 26:var h=n.type,b=n.memoizedState;return t===null?(na(n),b!==null?($t(n),Bg(n,b)):($t(n),hd(n,h,null,u,l))):b?b!==t.memoizedState?(na(n),$t(n),Bg(n,b)):($t(n),n.flags&=-16777217):(t=t.memoizedProps,t!==u&&na(n),$t(n),hd(n,h,t,u,l)),null;case 27:if(Ht(n),l=Se.current,h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&na(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return $t(n),null}t=he.current,ll(n)?pm(n):(t=Ux(h,u,l),n.stateNode=t,na(n))}return $t(n),null;case 5:if(Ht(n),h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==u&&na(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return $t(n),null}if(b=he.current,ll(n))pm(n);else{var S=Eu(Se.current);switch(b){case 1:b=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:b=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":b=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":b=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":b=S.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?S.createElement(h,{is:u.is}):S.createElement(h)}}b[lt]=n,b[At]=u;e:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)b.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break e;for(;S.sibling===null;){if(S.return===null||S.return===n)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=b;e:switch(vn(b,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&na(n)}}return $t(n),hd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==u&&na(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(r(166));if(t=Se.current,ll(n)){if(t=n.stateNode,l=n.memoizedProps,u=null,h=xn,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}t[lt]=n,t=!!(t.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Dx(t.nodeValue,l)),t||ka(n,!0)}else t=Eu(t).createTextNode(u),t[lt]=n,n.stateNode=t}return $t(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(u=ll(n),l!==null){if(t===null){if(!u)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[lt]=n}else vr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;$t(n),t=!1}else l=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Xn(n),n):(Xn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return $t(n),null;case 13:if(u=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=ll(n),u!==null&&u.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[lt]=n}else vr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;$t(n),h=!1}else h=wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(Xn(n),n):(Xn(n),null)}return Xn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=u!==null,t=t!==null&&t.memoizedState!==null,l&&(u=n.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==h&&(u.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),cu(n,n.updateQueue),$t(n),null);case 4:return Ue(),t===null&&Bd(n.stateNode.containerInfo),$t(n),null;case 10:return Zi(n.type),$t(n),null;case 19:if(Z(en),u=n.memoizedState,u===null)return $t(n),null;if(h=(n.flags&128)!==0,b=u.rendering,b===null)if(h)Es(u,!1);else{if(Qt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(b=Xo(t),b!==null){for(n.flags|=128,Es(u,!1),t=b.updateQueue,n.updateQueue=t,cu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)um(l,t),l=l.sibling;return w(en,en.current&1|2),mt&&Ji(n,u.treeForkCount),n.child}t=t.sibling}u.tail!==null&&Pe()>mu&&(n.flags|=128,h=!0,Es(u,!1),n.lanes=4194304)}else{if(!h)if(t=Xo(b),t!==null){if(n.flags|=128,h=!0,t=t.updateQueue,n.updateQueue=t,cu(n,t),Es(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!mt)return $t(n),null}else 2*Pe()-u.renderingStartTime>mu&&l!==536870912&&(n.flags|=128,h=!0,Es(u,!1),n.lanes=4194304);u.isBackwards?(b.sibling=n.child,n.child=b):(t=u.last,t!==null?t.sibling=b:n.child=b,u.last=b)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Pe(),t.sibling=null,l=en.current,w(en,h?l&1|2:l&1),mt&&Ji(n,u.treeForkCount),t):($t(n),null);case 22:case 23:return Xn(n),Rf(),u=n.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(l&536870912)!==0&&(n.flags&128)===0&&($t(n),n.subtreeFlags&6&&(n.flags|=8192)):$t(n),l=n.updateQueue,l!==null&&cu(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==l&&(n.flags|=2048),t!==null&&Z(wr),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Zi(rn),$t(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function dS(t,n){switch(Sf(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Zi(rn),Ue(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Ht(n),null;case 31:if(n.memoizedState!==null){if(Xn(n),n.alternate===null)throw Error(r(340));vr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Xn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));vr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Z(en),null;case 4:return Ue(),null;case 10:return Zi(n.type),null;case 22:case 23:return Xn(n),Rf(),t!==null&&Z(wr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Zi(rn),null;case 25:return null;default:return null}}function Rg(t,n){switch(Sf(n),n.tag){case 3:Zi(rn),Ue();break;case 26:case 27:case 5:Ht(n);break;case 4:Ue();break;case 31:n.memoizedState!==null&&Xn(n);break;case 13:Xn(n);break;case 19:Z(en);break;case 10:Zi(n.type);break;case 22:case 23:Xn(n),Rf(),t!==null&&Z(wr);break;case 24:Zi(rn)}}function ks(t,n){try{var l=n.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&t)===t){u=void 0;var b=l.create,S=l.inst;u=b(),S.destroy=u}l=l.next}while(l!==h)}}catch(A){kt(n,n.return,A)}}function _a(t,n,l){try{var u=n.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var b=h.next;u=b;do{if((u.tag&t)===t){var S=u.inst,A=S.destroy;if(A!==void 0){S.destroy=void 0,h=n;var $=l,ie=A;try{ie()}catch(ue){kt(h,$,ue)}}}u=u.next}while(u!==b)}}catch(ue){kt(n,n.return,ue)}}function Lg(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Am(n,l)}catch(u){kt(t,t.return,u)}}}function zg(t,n,l){l.props=Mr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(u){kt(t,n,u)}}function As(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof l=="function"?t.refCleanup=l(u):l.current=u}}catch(h){kt(t,n,h)}}function Fi(t,n){var l=t.ref,u=t.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){kt(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){kt(t,n,h)}else l.current=null}function Ig(t){var n=t.type,l=t.memoizedProps,u=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){kt(t,t.return,h)}}function pd(t,n,l){try{var u=t.stateNode;FS(u,t.type,l,n),u[At]=n}catch(h){kt(t,t.return,h)}}function $g(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&$a(t.type)||t.tag===4}function md(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||$g(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&$a(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function gd(t,n,l){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=li));else if(u!==4&&(u===27&&$a(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(gd(t,n,l),t=t.sibling;t!==null;)gd(t,n,l),t=t.sibling}function fu(t,n,l){var u=t.tag;if(u===5||u===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(u!==4&&(u===27&&$a(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(fu(t,n,l),t=t.sibling;t!==null;)fu(t,n,l),t=t.sibling}function Hg(t){var n=t.stateNode,l=t.memoizedProps;try{for(var u=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);vn(n,u,l),n[lt]=t,n[At]=l}catch(b){kt(t,t.return,b)}}var ia=!1,on=!1,xd=!1,Ug=typeof WeakSet=="function"?WeakSet:Set,pn=null;function hS(t,n){if(t=t.containerInfo,zd=Ou,t=em(t),cf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var S=0,A=-1,$=-1,ie=0,ue=0,fe=t,re=null;t:for(;;){for(var se;fe!==l||h!==0&&fe.nodeType!==3||(A=S+h),fe!==b||u!==0&&fe.nodeType!==3||($=S+u),fe.nodeType===3&&(S+=fe.nodeValue.length),(se=fe.firstChild)!==null;)re=fe,fe=se;for(;;){if(fe===t)break t;if(re===l&&++ie===h&&(A=S),re===b&&++ue===u&&($=S),(se=fe.nextSibling)!==null)break;fe=re,re=fe.parentNode}fe=se}l=A===-1||$===-1?null:{start:A,end:$}}else l=null}l=l||{start:0,end:0}}else l=null;for(Id={focusedElem:t,selectionRange:l},Ou=!1,pn=n;pn!==null;)if(n=pn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,pn=t;else for(;pn!==null;){switch(n=pn,b=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)h=t[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&b!==null){t=void 0,l=n,h=b.memoizedProps,b=b.memoizedState,u=l.stateNode;try{var Te=Mr(l.type,h);t=u.getSnapshotBeforeUpdate(Te,b),u.__reactInternalSnapshotBeforeUpdate=t}catch($e){kt(l,l.return,$e)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Ud(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ud(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,pn=t;break}pn=n.return}}function Pg(t,n,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:ra(t,l),u&4&&ks(5,l);break;case 1:if(ra(t,l),u&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(S){kt(l,l.return,S)}else{var h=Mr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(S){kt(l,l.return,S)}}u&64&&Lg(l),u&512&&As(l,l.return);break;case 3:if(ra(t,l),u&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Am(t,n)}catch(S){kt(l,l.return,S)}}break;case 27:n===null&&u&4&&Hg(l);case 26:case 5:ra(t,l),n===null&&u&4&&Ig(l),u&512&&As(l,l.return);break;case 12:ra(t,l);break;case 31:ra(t,l),u&4&&Vg(t,l);break;case 13:ra(t,l),u&4&&Kg(t,l),u&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=NS.bind(null,l),US(t,l))));break;case 22:if(u=l.memoizedState!==null||ia,!u){n=n!==null&&n.memoizedState!==null||on,h=ia;var b=on;ia=u,(on=n)&&!b?la(t,l,(l.subtreeFlags&8772)!==0):ra(t,l),ia=h,on=b}break;case 30:break;default:ra(t,l)}}function qg(t){var n=t.alternate;n!==null&&(t.alternate=null,qg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Pi(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Pt=null,zn=!1;function aa(t,n,l){for(l=l.child;l!==null;)Gg(t,n,l),l=l.sibling}function Gg(t,n,l){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(Re,l)}catch{}switch(l.tag){case 26:on||Fi(l,n),aa(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:on||Fi(l,n);var u=Pt,h=zn;$a(l.type)&&(Pt=l.stateNode,zn=!1),aa(t,n,l),Rs(l.stateNode),Pt=u,zn=h;break;case 5:on||Fi(l,n);case 6:if(u=Pt,h=zn,Pt=null,aa(t,n,l),Pt=u,zn=h,Pt!==null)if(zn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(l.stateNode)}catch(b){kt(l,n,b)}else try{Pt.removeChild(l.stateNode)}catch(b){kt(l,n,b)}break;case 18:Pt!==null&&(zn?(t=Pt,Lx(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Al(t)):Lx(Pt,l.stateNode));break;case 4:u=Pt,h=zn,Pt=l.stateNode.containerInfo,zn=!0,aa(t,n,l),Pt=u,zn=h;break;case 0:case 11:case 14:case 15:_a(2,l,n),on||_a(4,l,n),aa(t,n,l);break;case 1:on||(Fi(l,n),u=l.stateNode,typeof u.componentWillUnmount=="function"&&zg(l,n,u)),aa(t,n,l);break;case 21:aa(t,n,l);break;case 22:on=(u=on)||l.memoizedState!==null,aa(t,n,l),on=u;break;default:aa(t,n,l)}}function Vg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Al(t)}catch(l){kt(n,n.return,l)}}}function Kg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Al(t)}catch(l){kt(n,n.return,l)}}function pS(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Ug),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Ug),n;default:throw Error(r(435,t.tag))}}function du(t,n){var l=pS(t);n.forEach(function(u){if(!l.has(u)){l.add(u);var h=wS.bind(null,t,u);u.then(h,h)}})}function In(t,n){var l=n.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],b=t,S=n,A=S;e:for(;A!==null;){switch(A.tag){case 27:if($a(A.type)){Pt=A.stateNode,zn=!1;break e}break;case 5:Pt=A.stateNode,zn=!1;break e;case 3:case 4:Pt=A.stateNode.containerInfo,zn=!0;break e}A=A.return}if(Pt===null)throw Error(r(160));Gg(b,S,h),Pt=null,zn=!1,b=h.alternate,b!==null&&(b.return=null),h.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Yg(n,t),n=n.sibling}var Si=null;function Yg(t,n){var l=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:In(n,t),$n(t),u&4&&(_a(3,t,t.return),ks(3,t),_a(5,t,t.return));break;case 1:In(n,t),$n(t),u&512&&(on||l===null||Fi(l,l.return)),u&64&&ia&&(t=t.updateQueue,t!==null&&(u=t.callbacks,u!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=Si;if(In(n,t),$n(t),u&512&&(on||l===null||Fi(l,l.return)),u&4){var b=l!==null?l.memoizedState:null;if(u=t.memoizedState,l===null)if(u===null)if(t.stateNode===null){e:{u=t.type,l=t.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":b=h.getElementsByTagName("title")[0],(!b||b[ar]||b[lt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=h.createElement(u),h.head.insertBefore(b,h.querySelector("head > title"))),vn(b,u,l),b[lt]=t,an(b),u=b;break e;case"link":var S=Yx("link","href",h).get(u+(l.href||""));if(S){for(var A=0;A<S.length;A++)if(b=S[A],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){S.splice(A,1);break t}}b=h.createElement(u),vn(b,u,l),h.head.appendChild(b);break;case"meta":if(S=Yx("meta","content",h).get(u+(l.content||""))){for(A=0;A<S.length;A++)if(b=S[A],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){S.splice(A,1);break t}}b=h.createElement(u),vn(b,u,l),h.head.appendChild(b);break;default:throw Error(r(468,u))}b[lt]=t,an(b),u=b}t.stateNode=u}else Qx(h,t.type,t.stateNode);else t.stateNode=Kx(h,u,t.memoizedProps);else b!==u?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,u===null?Qx(h,t.type,t.stateNode):Kx(h,u,t.memoizedProps)):u===null&&t.stateNode!==null&&pd(t,t.memoizedProps,l.memoizedProps)}break;case 27:In(n,t),$n(t),u&512&&(on||l===null||Fi(l,l.return)),l!==null&&u&4&&pd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(In(n,t),$n(t),u&512&&(on||l===null||Fi(l,l.return)),t.flags&32){h=t.stateNode;try{Vi(h,"")}catch(Te){kt(t,t.return,Te)}}u&4&&t.stateNode!=null&&(h=t.memoizedProps,pd(t,h,l!==null?l.memoizedProps:h)),u&1024&&(xd=!0);break;case 6:if(In(n,t),$n(t),u&4){if(t.stateNode===null)throw Error(r(162));u=t.memoizedProps,l=t.stateNode;try{l.nodeValue=u}catch(Te){kt(t,t.return,Te)}}break;case 3:if(Mu=null,h=Si,Si=ku(n.containerInfo),In(n,t),Si=h,$n(t),u&4&&l!==null&&l.memoizedState.isDehydrated)try{Al(n.containerInfo)}catch(Te){kt(t,t.return,Te)}xd&&(xd=!1,Qg(t));break;case 4:u=Si,Si=ku(t.stateNode.containerInfo),In(n,t),$n(t),Si=u;break;case 12:In(n,t),$n(t);break;case 31:In(n,t),$n(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,du(t,u)));break;case 13:In(n,t),$n(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(pu=Pe()),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,du(t,u)));break;case 22:h=t.memoizedState!==null;var $=l!==null&&l.memoizedState!==null,ie=ia,ue=on;if(ia=ie||h,on=ue||$,In(n,t),on=ue,ia=ie,$n(t),u&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(l===null||$||ia||on||jr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){$=l=n;try{if(b=$.stateNode,h)S=b.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{A=$.stateNode;var fe=$.memoizedProps.style,re=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;A.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Te){kt($,$.return,Te)}}}else if(n.tag===6){if(l===null){$=n;try{$.stateNode.nodeValue=h?"":$.memoizedProps}catch(Te){kt($,$.return,Te)}}}else if(n.tag===18){if(l===null){$=n;try{var se=$.stateNode;h?zx(se,!0):zx($.stateNode,!1)}catch(Te){kt($,$.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=t.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,du(t,l))));break;case 19:In(n,t),$n(t),u&4&&(u=t.updateQueue,u!==null&&(t.updateQueue=null,du(t,u)));break;case 30:break;case 21:break;default:In(n,t),$n(t)}}function $n(t){var n=t.flags;if(n&2){try{for(var l,u=t.return;u!==null;){if($g(u)){l=u;break}u=u.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,b=md(t);fu(t,b,h);break;case 5:var S=l.stateNode;l.flags&32&&(Vi(S,""),l.flags&=-33);var A=md(t);fu(t,A,S);break;case 3:case 4:var $=l.stateNode.containerInfo,ie=md(t);gd(t,ie,$);break;default:throw Error(r(161))}}catch(ue){kt(t,t.return,ue)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Qg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Qg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function ra(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Pg(t,n.alternate,n),n=n.sibling}function jr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:_a(4,n,n.return),jr(n);break;case 1:Fi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&zg(n,n.return,l),jr(n);break;case 27:Rs(n.stateNode);case 26:case 5:Fi(n,n.return),jr(n);break;case 22:n.memoizedState===null&&jr(n);break;case 30:jr(n);break;default:jr(n)}t=t.sibling}}function la(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,h=t,b=n,S=b.flags;switch(b.tag){case 0:case 11:case 15:la(h,b,l),ks(4,b);break;case 1:if(la(h,b,l),u=b,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ie){kt(u,u.return,ie)}if(u=b,h=u.updateQueue,h!==null){var A=u.stateNode;try{var $=h.shared.hiddenCallbacks;if($!==null)for(h.shared.hiddenCallbacks=null,h=0;h<$.length;h++)km($[h],A)}catch(ie){kt(u,u.return,ie)}}l&&S&64&&Lg(b),As(b,b.return);break;case 27:Hg(b);case 26:case 5:la(h,b,l),l&&u===null&&S&4&&Ig(b),As(b,b.return);break;case 12:la(h,b,l);break;case 31:la(h,b,l),l&&S&4&&Vg(h,b);break;case 13:la(h,b,l),l&&S&4&&Kg(h,b);break;case 22:b.memoizedState===null&&la(h,b,l),As(b,b.return);break;case 30:break;default:la(h,b,l)}n=n.sibling}}function bd(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&hs(l))}function yd(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hs(t))}function Ni(t,n,l,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Jg(t,n,l,u),n=n.sibling}function Jg(t,n,l,u){var h=n.flags;switch(n.tag){case 0:case 11:case 15:Ni(t,n,l,u),h&2048&&ks(9,n);break;case 1:Ni(t,n,l,u);break;case 3:Ni(t,n,l,u),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hs(t)));break;case 12:if(h&2048){Ni(t,n,l,u),t=n.stateNode;try{var b=n.memoizedProps,S=b.id,A=b.onPostCommit;typeof A=="function"&&A(S,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch($){kt(n,n.return,$)}}else Ni(t,n,l,u);break;case 31:Ni(t,n,l,u);break;case 13:Ni(t,n,l,u);break;case 23:break;case 22:b=n.stateNode,S=n.alternate,n.memoizedState!==null?b._visibility&2?Ni(t,n,l,u):Ms(t,n):b._visibility&2?Ni(t,n,l,u):(b._visibility|=2,gl(t,n,l,u,(n.subtreeFlags&10256)!==0||!1)),h&2048&&bd(S,n);break;case 24:Ni(t,n,l,u),h&2048&&yd(n.alternate,n);break;default:Ni(t,n,l,u)}}function gl(t,n,l,u,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var b=t,S=n,A=l,$=u,ie=S.flags;switch(S.tag){case 0:case 11:case 15:gl(b,S,A,$,h),ks(8,S);break;case 23:break;case 22:var ue=S.stateNode;S.memoizedState!==null?ue._visibility&2?gl(b,S,A,$,h):Ms(b,S):(ue._visibility|=2,gl(b,S,A,$,h)),h&&ie&2048&&bd(S.alternate,S);break;case 24:gl(b,S,A,$,h),h&&ie&2048&&yd(S.alternate,S);break;default:gl(b,S,A,$,h)}n=n.sibling}}function Ms(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,u=n,h=u.flags;switch(u.tag){case 22:Ms(l,u),h&2048&&bd(u.alternate,u);break;case 24:Ms(l,u),h&2048&&yd(u.alternate,u);break;default:Ms(l,u)}n=n.sibling}}var js=8192;function xl(t,n,l){if(t.subtreeFlags&js)for(t=t.child;t!==null;)Xg(t,n,l),t=t.sibling}function Xg(t,n,l){switch(t.tag){case 26:xl(t,n,l),t.flags&js&&t.memoizedState!==null&&eN(l,Si,t.memoizedState,t.memoizedProps);break;case 5:xl(t,n,l);break;case 3:case 4:var u=Si;Si=ku(t.stateNode.containerInfo),xl(t,n,l),Si=u;break;case 22:t.memoizedState===null&&(u=t.alternate,u!==null&&u.memoizedState!==null?(u=js,js=16777216,xl(t,n,l),js=u):xl(t,n,l));break;default:xl(t,n,l)}}function Zg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ts(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var u=n[l];pn=u,ex(u,t)}Zg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wg(t),t=t.sibling}function Wg(t){switch(t.tag){case 0:case 11:case 15:Ts(t),t.flags&2048&&_a(9,t,t.return);break;case 3:Ts(t);break;case 12:Ts(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,hu(t)):Ts(t);break;default:Ts(t)}}function hu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var u=n[l];pn=u,ex(u,t)}Zg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:_a(8,n,n.return),hu(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,hu(n));break;default:hu(n)}t=t.sibling}}function ex(t,n){for(;pn!==null;){var l=pn;switch(l.tag){case 0:case 11:case 15:_a(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:hs(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,pn=u;else e:for(l=t;pn!==null;){u=pn;var h=u.sibling,b=u.return;if(qg(u),u===l){pn=null;break e}if(h!==null){h.return=b,pn=h;break e}pn=b}}}var mS={getCacheForType:function(t){var n=bn(rn),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return bn(rn).controller.signal}},gS=typeof WeakMap=="function"?WeakMap:Map,wt=0,_t=null,st=null,ft=0,Et=0,Zn=null,Fa=!1,bl=!1,vd=!1,sa=0,Qt=0,Ba=0,Tr=0,Sd=0,Wn=0,yl=0,Ds=null,Hn=null,Nd=!1,pu=0,tx=0,mu=1/0,gu=null,Ra=null,dn=0,La=null,vl=null,oa=0,wd=0,Cd=null,nx=null,Os=0,Ed=null;function ei(){return(wt&2)!==0&&ft!==0?ft&-ft:E.T!==null?Dd():Nn()}function ix(){if(Wn===0)if((ft&536870912)===0||mt){var t=be;be<<=1,(be&3932160)===0&&(be=262144),Wn=t}else Wn=536870912;return t=Jn.current,t!==null&&(t.flags|=32),Wn}function Un(t,n,l){(t===_t&&(Et===2||Et===9)||t.cancelPendingCommit!==null)&&(Sl(t,0),za(t,ft,Wn,!1)),tt(t,l),((wt&2)===0||t!==_t)&&(t===_t&&((wt&2)===0&&(Tr|=l),Qt===4&&za(t,ft,Wn,!1)),Bi(t))}function ax(t,n,l){if((wt&6)!==0)throw Error(r(327));var u=!l&&(n&127)===0&&(n&t.expiredLanes)===0||ai(t,n),h=u?yS(t,n):Ad(t,n,!0),b=u;do{if(h===0){bl&&!u&&za(t,n,0,!1);break}else{if(l=t.current.alternate,b&&!xS(l)){h=Ad(t,n,!1),b=!1;continue}if(h===2){if(b=n,t.errorRecoveryDisabledLanes&b)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;e:{var A=t;h=Ds;var $=A.current.memoizedState.isDehydrated;if($&&(Sl(A,S).flags|=256),S=Ad(A,S,!1),S!==2){if(vd&&!$){A.errorRecoveryDisabledLanes|=b,Tr|=b,h=4;break e}b=Hn,Hn=h,b!==null&&(Hn===null?Hn=b:Hn.push.apply(Hn,b))}h=S}if(b=!1,h!==2)continue}}if(h===1){Sl(t,0),za(t,n,0,!0);break}e:{switch(u=t,b=h,b){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:za(u,n,Wn,!Fa);break e;case 2:Hn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(h=pu+300-Pe(),10<h)){if(za(u,n,Wn,!Fa),Vn(u,0,!0)!==0)break e;oa=n,u.timeoutHandle=Bx(rx.bind(null,u,l,Hn,gu,Nd,n,Wn,Tr,yl,Fa,b,"Throttled",-0,0),h);break e}rx(u,l,Hn,gu,Nd,n,Wn,Tr,yl,Fa,b,null,-0,0)}}break}while(!0);Bi(t)}function rx(t,n,l,u,h,b,S,A,$,ie,ue,fe,re,se){if(t.timeoutHandle=-1,fe=n.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:li},Xg(n,b,fe);var Te=(b&62914560)===b?pu-Pe():(b&4194048)===b?tx-Pe():0;if(Te=tN(fe,Te),Te!==null){oa=b,t.cancelPendingCommit=Te(hx.bind(null,t,n,b,l,u,h,S,A,$,ue,fe,null,re,se)),za(t,b,S,!ie);return}}hx(t,n,b,l,u,h,S,A,$)}function xS(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],b=h.getSnapshot;h=h.value;try{if(!Yn(b(),h))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function za(t,n,l,u){n&=~Sd,n&=~Tr,t.suspendedLanes|=n,t.pingedLanes&=~n,u&&(t.warmLanes|=n),u=t.expirationTimes;for(var h=n;0<h;){var b=31-at(h),S=1<<b;u[b]=-1,h&=~S}l!==0&&Rn(t,l,n)}function xu(){return(wt&6)===0?(_s(0),!1):!0}function kd(){if(st!==null){if(Et===0)var t=st.return;else t=st,Xi=Sr=null,Uf(t),fl=null,ms=0,t=st;for(;t!==null;)Rg(t.alternate,t),t=t.return;st=null}}function Sl(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,LS(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),oa=0,kd(),_t=t,st=l=Qi(t.current,null),ft=n,Et=0,Zn=null,Fa=!1,bl=ai(t,n),vd=!1,yl=Wn=Sd=Tr=Ba=Qt=0,Hn=Ds=null,Nd=!1,(n&8)!==0&&(n|=n&32);var u=t.entangledLanes;if(u!==0)for(t=t.entanglements,u&=n;0<u;){var h=31-at(u),b=1<<h;n|=t[h],u&=~b}return sa=n,zo(),l}function lx(t,n){Je=null,E.H=ws,n===cl||n===Vo?(n=Nm(),Et=3):n===Tf?(n=Nm(),Et=4):Et=n===ad?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Zn=n,st===null&&(Qt=1,lu(t,ui(n,t.current)))}function sx(){var t=Jn.current;return t===null?!0:(ft&4194048)===ft?hi===null:(ft&62914560)===ft||(ft&536870912)!==0?t===hi:!1}function ox(){var t=E.H;return E.H=ws,t===null?ws:t}function ux(){var t=E.A;return E.A=mS,t}function bu(){Qt=4,Fa||(ft&4194048)!==ft&&Jn.current!==null||(bl=!0),(Ba&134217727)===0&&(Tr&134217727)===0||_t===null||za(_t,ft,Wn,!1)}function Ad(t,n,l){var u=wt;wt|=2;var h=ox(),b=ux();(_t!==t||ft!==n)&&(gu=null,Sl(t,n)),n=!1;var S=Qt;e:do try{if(Et!==0&&st!==null){var A=st,$=Zn;switch(Et){case 8:kd(),S=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(n=!0);var ie=Et;if(Et=0,Zn=null,Nl(t,A,$,ie),l&&bl){S=0;break e}break;default:ie=Et,Et=0,Zn=null,Nl(t,A,$,ie)}}bS(),S=Qt;break}catch(ue){lx(t,ue)}while(!0);return n&&t.shellSuspendCounter++,Xi=Sr=null,wt=u,E.H=h,E.A=b,st===null&&(_t=null,ft=0,zo()),S}function bS(){for(;st!==null;)cx(st)}function yS(t,n){var l=wt;wt|=2;var u=ox(),h=ux();_t!==t||ft!==n?(gu=null,mu=Pe()+500,Sl(t,n)):bl=ai(t,n);e:do try{if(Et!==0&&st!==null){n=st;var b=Zn;t:switch(Et){case 1:Et=0,Zn=null,Nl(t,n,b,1);break;case 2:case 9:if(vm(b)){Et=0,Zn=null,fx(n);break}n=function(){Et!==2&&Et!==9||_t!==t||(Et=7),Bi(t)},b.then(n,n);break e;case 3:Et=7;break e;case 4:Et=5;break e;case 7:vm(b)?(Et=0,Zn=null,fx(n)):(Et=0,Zn=null,Nl(t,n,b,7));break;case 5:var S=null;switch(st.tag){case 26:S=st.memoizedState;case 5:case 27:var A=st;if(S?Jx(S):A.stateNode.complete){Et=0,Zn=null;var $=A.sibling;if($!==null)st=$;else{var ie=A.return;ie!==null?(st=ie,yu(ie)):st=null}break t}}Et=0,Zn=null,Nl(t,n,b,5);break;case 6:Et=0,Zn=null,Nl(t,n,b,6);break;case 8:kd(),Qt=6;break e;default:throw Error(r(462))}}vS();break}catch(ue){lx(t,ue)}while(!0);return Xi=Sr=null,E.H=u,E.A=h,wt=l,st!==null?0:(_t=null,ft=0,zo(),Qt)}function vS(){for(;st!==null&&!Nt();)cx(st)}function cx(t){var n=Fg(t.alternate,t,sa);t.memoizedProps=t.pendingProps,n===null?yu(t):st=n}function fx(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Mg(l,n,n.pendingProps,n.type,void 0,ft);break;case 11:n=Mg(l,n,n.pendingProps,n.type.render,n.ref,ft);break;case 5:Uf(n);default:Rg(l,n),n=st=um(n,sa),n=Fg(l,n,sa)}t.memoizedProps=t.pendingProps,n===null?yu(t):st=n}function Nl(t,n,l,u){Xi=Sr=null,Uf(n),fl=null,ms=0;var h=n.return;try{if(oS(t,h,n,l,ft)){Qt=1,lu(t,ui(l,t.current)),st=null;return}}catch(b){if(h!==null)throw st=h,b;Qt=1,lu(t,ui(l,t.current)),st=null;return}n.flags&32768?(mt||u===1?t=!0:bl||(ft&536870912)!==0?t=!1:(Fa=t=!0,(u===2||u===9||u===3||u===6)&&(u=Jn.current,u!==null&&u.tag===13&&(u.flags|=16384))),dx(n,t)):yu(n)}function yu(t){var n=t;do{if((n.flags&32768)!==0){dx(n,Fa);return}t=n.return;var l=fS(n.alternate,n,sa);if(l!==null){st=l;return}if(n=n.sibling,n!==null){st=n;return}st=n=t}while(n!==null);Qt===0&&(Qt=5)}function dx(t,n){do{var l=dS(t.alternate,t);if(l!==null){l.flags&=32767,st=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){st=t;return}st=t=l}while(t!==null);Qt=6,st=null}function hx(t,n,l,u,h,b,S,A,$){t.cancelPendingCommit=null;do vu();while(dn!==0);if((wt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(b=n.lanes|n.childLanes,b|=mf,Ct(t,l,b,S,A,$),t===_t&&(st=_t=null,ft=0),vl=n,La=t,oa=l,wd=b,Cd=h,nx=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,CS(z,function(){return bx(),null})):(t.callbackNode=null,t.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=E.T,E.T=null,h=_.p,_.p=2,S=wt,wt|=4;try{hS(t,n,l)}finally{wt=S,_.p=h,E.T=u}}dn=1,px(),mx(),gx()}}function px(){if(dn===1){dn=0;var t=La,n=vl,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=E.T,E.T=null;var u=_.p;_.p=2;var h=wt;wt|=4;try{Yg(n,t);var b=Id,S=em(t.containerInfo),A=b.focusedElem,$=b.selectionRange;if(S!==A&&A&&A.ownerDocument&&Wp(A.ownerDocument.documentElement,A)){if($!==null&&cf(A)){var ie=$.start,ue=$.end;if(ue===void 0&&(ue=ie),"selectionStart"in A)A.selectionStart=ie,A.selectionEnd=Math.min(ue,A.value.length);else{var fe=A.ownerDocument||document,re=fe&&fe.defaultView||window;if(re.getSelection){var se=re.getSelection(),Te=A.textContent.length,$e=Math.min($.start,Te),Tt=$.end===void 0?$e:Math.min($.end,Te);!se.extend&&$e>Tt&&(S=Tt,Tt=$e,$e=S);var J=Zp(A,$e),V=Zp(A,Tt);if(J&&V&&(se.rangeCount!==1||se.anchorNode!==J.node||se.anchorOffset!==J.offset||se.focusNode!==V.node||se.focusOffset!==V.offset)){var te=fe.createRange();te.setStart(J.node,J.offset),se.removeAllRanges(),$e>Tt?(se.addRange(te),se.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),se.addRange(te))}}}}for(fe=[],se=A;se=se.parentNode;)se.nodeType===1&&fe.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<fe.length;A++){var ce=fe[A];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ou=!!zd,Id=zd=null}finally{wt=h,_.p=u,E.T=l}}t.current=n,dn=2}}function mx(){if(dn===2){dn=0;var t=La,n=vl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=E.T,E.T=null;var u=_.p;_.p=2;var h=wt;wt|=4;try{Pg(t,n.alternate,n)}finally{wt=h,_.p=u,E.T=l}}dn=3}}function gx(){if(dn===4||dn===3){dn=0,_e();var t=La,n=vl,l=oa,u=nx;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?dn=5:(dn=0,vl=La=null,xx(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(Ra=null),cn(l),n=n.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(Re,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=E.T,h=_.p,_.p=2,E.T=null;try{for(var b=t.onRecoverableError,S=0;S<u.length;S++){var A=u[S];b(A.value,{componentStack:A.stack})}}finally{E.T=n,_.p=h}}(oa&3)!==0&&vu(),Bi(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===Ed?Os++:(Os=0,Ed=t):Os=0,_s(0)}}function xx(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,hs(n)))}function vu(){return px(),mx(),gx(),bx()}function bx(){if(dn!==5)return!1;var t=La,n=wd;wd=0;var l=cn(oa),u=E.T,h=_.p;try{_.p=32>l?32:l,E.T=null,l=Cd,Cd=null;var b=La,S=oa;if(dn=0,vl=La=null,oa=0,(wt&6)!==0)throw Error(r(331));var A=wt;if(wt|=4,Wg(b.current),Jg(b,b.current,S,l),wt=A,_s(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(Re,b)}catch{}return!0}finally{_.p=h,E.T=u,xx(t,n)}}function yx(t,n,l){n=ui(l,n),n=id(t.stateNode,n,2),t=Ta(t,n,2),t!==null&&(tt(t,2),Bi(t))}function kt(t,n,l){if(t.tag===3)yx(t,t,l);else for(;n!==null;){if(n.tag===3){yx(n,t,l);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ra===null||!Ra.has(u))){t=ui(l,t),l=vg(2),u=Ta(n,l,2),u!==null&&(Sg(l,u,n,t),tt(u,2),Bi(u));break}}n=n.return}}function Md(t,n,l){var u=t.pingCache;if(u===null){u=t.pingCache=new gS;var h=new Set;u.set(n,h)}else h=u.get(n),h===void 0&&(h=new Set,u.set(n,h));h.has(l)||(vd=!0,h.add(l),t=SS.bind(null,t,n,l),n.then(t,t))}function SS(t,n,l){var u=t.pingCache;u!==null&&u.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,_t===t&&(ft&l)===l&&(Qt===4||Qt===3&&(ft&62914560)===ft&&300>Pe()-pu?(wt&2)===0&&Sl(t,0):Sd|=l,yl===ft&&(yl=0)),Bi(t)}function vx(t,n){n===0&&(n=Ai()),t=br(t,n),t!==null&&(tt(t,n),Bi(t))}function NS(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),vx(t,l)}function wS(t,n){var l=0;switch(t.tag){case 31:case 13:var u=t.stateNode,h=t.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(n),vx(t,l)}function CS(t,n){return et(t,n)}var Su=null,wl=null,jd=!1,Nu=!1,Td=!1,Ia=0;function Bi(t){t!==wl&&t.next===null&&(wl===null?Su=wl=t:wl=wl.next=t),Nu=!0,jd||(jd=!0,kS())}function _s(t,n){if(!Td&&Nu){Td=!0;do for(var l=!1,u=Su;u!==null;){if(t!==0){var h=u.pendingLanes;if(h===0)var b=0;else{var S=u.suspendedLanes,A=u.pingedLanes;b=(1<<31-at(42|t)+1)-1,b&=h&~(S&~A),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,Cx(u,b))}else b=ft,b=Vn(u,u===_t?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ai(u,b)||(l=!0,Cx(u,b));u=u.next}while(l);Td=!1}}function ES(){Sx()}function Sx(){Nu=jd=!1;var t=0;Ia!==0&&RS()&&(t=Ia);for(var n=Pe(),l=null,u=Su;u!==null;){var h=u.next,b=Nx(u,n);b===0?(u.next=null,l===null?Su=h:l.next=h,h===null&&(wl=l)):(l=u,(t!==0||(b&3)!==0)&&(Nu=!0)),u=h}dn!==0&&dn!==5||_s(t),Ia!==0&&(Ia=0)}function Nx(t,n){for(var l=t.suspendedLanes,u=t.pingedLanes,h=t.expirationTimes,b=t.pendingLanes&-62914561;0<b;){var S=31-at(b),A=1<<S,$=h[S];$===-1?((A&l)===0||(A&u)!==0)&&(h[S]=nr(A,n)):$<=n&&(t.expiredLanes|=A),b&=~A}if(n=_t,l=ft,l=Vn(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u=t.callbackNode,l===0||t===n&&(Et===2||Et===9)||t.cancelPendingCommit!==null)return u!==null&&u!==null&&Ae(u),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ai(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(u!==null&&Ae(u),cn(l)){case 2:case 8:l=xe;break;case 32:l=z;break;case 268435456:l=we;break;default:l=z}return u=wx.bind(null,t),l=et(l,u),t.callbackPriority=n,t.callbackNode=l,n}return u!==null&&u!==null&&Ae(u),t.callbackPriority=2,t.callbackNode=null,2}function wx(t,n){if(dn!==0&&dn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(vu()&&t.callbackNode!==l)return null;var u=ft;return u=Vn(t,t===_t?u:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),u===0?null:(ax(t,u,n),Nx(t,Pe()),t.callbackNode!=null&&t.callbackNode===l?wx.bind(null,t):null)}function Cx(t,n){if(vu())return null;ax(t,n,!0)}function kS(){zS(function(){(wt&6)!==0?et(le,ES):Sx()})}function Dd(){if(Ia===0){var t=ol;t===0&&(t=Xt,Xt<<=1,(Xt&261888)===0&&(Xt=256)),Ia=t}return Ia}function Ex(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ur(""+t)}function kx(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function AS(t,n,l,u,h){if(n==="submit"&&l&&l.stateNode===h){var b=Ex((h[At]||null).action),S=u.submitter;S&&(n=(n=S[At]||null)?Ex(n.formAction):S.getAttribute("formAction"),n!==null&&(b=n,S=null));var A=new bt("action","action",null,u,h);t.push({event:A,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ia!==0){var $=S?kx(h,S):new FormData(h);Xf(l,{pending:!0,data:$,method:h.method,action:b},null,$)}}else typeof b=="function"&&(A.preventDefault(),$=S?kx(h,S):new FormData(h),Xf(l,{pending:!0,data:$,method:h.method,action:b},b,$))},currentTarget:h}]})}}for(var Od=0;Od<pf.length;Od++){var _d=pf[Od],MS=_d.toLowerCase(),jS=_d[0].toUpperCase()+_d.slice(1);vi(MS,"on"+jS)}vi(im,"onAnimationEnd"),vi(am,"onAnimationIteration"),vi(rm,"onAnimationStart"),vi("dblclick","onDoubleClick"),vi("focusin","onFocus"),vi("focusout","onBlur"),vi(Gv,"onTransitionRun"),vi(Vv,"onTransitionStart"),vi(Kv,"onTransitionCancel"),vi(lm,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yi("onBeforeInput",["compositionend","keypress","textInput","paste"]),yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),TS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fs));function Ax(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var u=t[l],h=u.event;u=u.listeners;e:{var b=void 0;if(n)for(var S=u.length-1;0<=S;S--){var A=u[S],$=A.instance,ie=A.currentTarget;if(A=A.listener,$!==b&&h.isPropagationStopped())break e;b=A,h.currentTarget=ie;try{b(h)}catch(ue){Lo(ue)}h.currentTarget=null,b=$}else for(S=0;S<u.length;S++){if(A=u[S],$=A.instance,ie=A.currentTarget,A=A.listener,$!==b&&h.isPropagationStopped())break e;b=A,h.currentTarget=ie;try{b(h)}catch(ue){Lo(ue)}h.currentTarget=null,b=$}}}}function ot(t,n){var l=n[wn];l===void 0&&(l=n[wn]=new Set);var u=t+"__bubble";l.has(u)||(Mx(n,t,2,!1),l.add(u))}function Fd(t,n,l){var u=0;n&&(u|=4),Mx(l,t,u,n)}var wu="_reactListening"+Math.random().toString(36).slice(2);function Bd(t){if(!t[wu]){t[wu]=!0,qr.forEach(function(l){l!=="selectionchange"&&(TS.has(l)||Fd(l,!1,t),Fd(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[wu]||(n[wu]=!0,Fd("selectionchange",!1,n))}}function Mx(t,n,l,u){switch(i0(n)){case 2:var h=aN;break;case 8:h=rN;break;default:h=Jd}l=h.bind(null,n,l,t),h=void 0,!es||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),u?h!==void 0?t.addEventListener(n,l,{capture:!0,passive:h}):t.addEventListener(n,l,!0):h!==void 0?t.addEventListener(n,l,{passive:h}):t.addEventListener(n,l,!1)}function Rd(t,n,l,u,h){var b=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var S=u.tag;if(S===3||S===4){var A=u.stateNode.containerInfo;if(A===h)break;if(S===4)for(S=u.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;A!==null;){if(S=va(A),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){u=b=S;continue e}A=A.parentNode}}u=u.return}jo(function(){var ie=b,ue=Jr(l),fe=[];e:{var re=sm.get(t);if(re!==void 0){var se=bt,Te=t;switch(t){case"keypress":if(Xr(l)===0)break e;case"keydown":case"keyup":se=Jc;break;case"focusin":Te="focus",se=rs;break;case"focusout":Te="blur",se=rs;break;case"beforeblur":case"afterblur":se=rs;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Do;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=Ic;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=Wc;break;case im:case am:case rm:se=Uc;break;case lm:se=tf;break;case"scroll":case"scrollend":se=ns;break;case"wheel":se=ss;break;case"copy":case"cut":case"paste":se=qc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Fo;break;case"toggle":case"beforetoggle":se=Ro}var $e=(n&4)!==0,Tt=!$e&&(t==="scroll"||t==="scrollend"),J=$e?re!==null?re+"Capture":null:re;$e=[];for(var V=ie,te;V!==null;){var ce=V;if(te=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||te===null||J===null||(ce=cr(V,J),ce!=null&&$e.push(Bs(V,ce,te))),Tt)break;V=V.return}0<$e.length&&(re=new se(re,Te,null,l,ue),fe.push({event:re,listeners:$e}))}}if((n&7)===0){e:{if(re=t==="mouseover"||t==="pointerover",se=t==="mouseout"||t==="pointerout",re&&l!==Qr&&(Te=l.relatedTarget||l.fromElement)&&(va(Te)||Te[zt]))break e;if((se||re)&&(re=ue.window===ue?ue:(re=ue.ownerDocument)?re.defaultView||re.parentWindow:window,se?(Te=l.relatedTarget||l.toElement,se=ie,Te=Te?va(Te):null,Te!==null&&(Tt=o(Te),$e=Te.tag,Te!==Tt||$e!==5&&$e!==27&&$e!==6)&&(Te=null)):(se=null,Te=ie),se!==Te)){if($e=Do,ce="onMouseLeave",J="onMouseEnter",V="mouse",(t==="pointerout"||t==="pointerover")&&($e=Fo,ce="onPointerLeave",J="onPointerEnter",V="pointer"),Tt=se==null?re:rr(se),te=Te==null?re:rr(Te),re=new $e(ce,V+"leave",se,l,ue),re.target=Tt,re.relatedTarget=te,ce=null,va(ue)===ie&&($e=new $e(J,V+"enter",Te,l,ue),$e.target=te,$e.relatedTarget=Tt,ce=$e),Tt=ce,se&&Te)t:{for($e=DS,J=se,V=Te,te=0,ce=J;ce;ce=$e(ce))te++;ce=0;for(var Le=V;Le;Le=$e(Le))ce++;for(;0<te-ce;)J=$e(J),te--;for(;0<ce-te;)V=$e(V),ce--;for(;te--;){if(J===V||V!==null&&J===V.alternate){$e=J;break t}J=$e(J),V=$e(V)}$e=null}else $e=null;se!==null&&jx(fe,re,se,$e,!1),Te!==null&&Tt!==null&&jx(fe,Tt,Te,$e,!0)}}e:{if(re=ie?rr(ie):window,se=re.nodeName&&re.nodeName.toLowerCase(),se==="select"||se==="input"&&re.type==="file")var vt=it;else if(X(re))if(De)vt=Di;else{vt=_n;var Oe=fn}else se=re.nodeName,!se||se.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&Yr(ie.elementType)&&(vt=it):vt=mr;if(vt&&(vt=vt(t,ie))){ge(fe,vt,l,ue);break e}Oe&&Oe(t,re,ie),t==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&qi(re,"number",re.value)}switch(Oe=ie?rr(ie):window,t){case"focusin":(X(Oe)||Oe.contentEditable==="true")&&(el=Oe,ff=ie,cs=null);break;case"focusout":cs=ff=el=null;break;case"mousedown":df=!0;break;case"contextmenu":case"mouseup":case"dragend":df=!1,tm(fe,l,ue);break;case"selectionchange":if(qv)break;case"keydown":case"keyup":tm(fe,l,ue)}var Ze;if(os)e:{switch(t){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else pr?of(t,l)&&(dt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(dt="onCompositionStart");dt&&(rf&&l.locale!=="ko"&&(pr||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&pr&&(Ze=To()):(Mi=ue,ts="value"in Mi?Mi.value:Mi.textContent,pr=!0)),Oe=Cu(ie,dt),0<Oe.length&&(dt=new Oo(dt,t,null,l,ue),fe.push({event:dt,listeners:Oe}),Ze?dt.data=Ze:(Ze=uf(l),Ze!==null&&(dt.data=Ze)))),(Ze=Qp?Jp(t,l):L(t,l))&&(dt=Cu(ie,"onBeforeInput"),0<dt.length&&(Oe=new Oo("onBeforeInput","beforeinput",null,l,ue),fe.push({event:Oe,listeners:dt}),Oe.data=Ze)),AS(fe,t,ie,l,ue)}Ax(fe,n)})}function Bs(t,n,l){return{instance:t,listener:n,currentTarget:l}}function Cu(t,n){for(var l=n+"Capture",u=[];t!==null;){var h=t,b=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||b===null||(h=cr(t,l),h!=null&&u.unshift(Bs(t,h,b)),h=cr(t,n),h!=null&&u.push(Bs(t,h,b))),t.tag===3)return u;t=t.return}return[]}function DS(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function jx(t,n,l,u,h){for(var b=n._reactName,S=[];l!==null&&l!==u;){var A=l,$=A.alternate,ie=A.stateNode;if(A=A.tag,$!==null&&$===u)break;A!==5&&A!==26&&A!==27||ie===null||($=ie,h?(ie=cr(l,b),ie!=null&&S.unshift(Bs(l,ie,$))):h||(ie=cr(l,b),ie!=null&&S.push(Bs(l,ie,$)))),l=l.return}S.length!==0&&t.push({event:n,listeners:S})}var OS=/\r\n?/g,_S=/\u0000|\uFFFD/g;function Tx(t){return(typeof t=="string"?t:""+t).replace(OS,`
9
+ `).replace(_S,"")}function Dx(t,n){return n=Tx(n),Tx(t)===n}function jt(t,n,l,u,h,b){switch(l){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||Vi(t,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&Vi(t,""+u);break;case"className":Vr(t,"class",u);break;case"tabIndex":Vr(t,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Vr(t,l,u);break;case"style":or(t,u,b);break;case"data":if(n!=="object"){Vr(t,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=ur(""+u),t.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(l==="formAction"?(n!=="input"&&jt(t,n,"name",h.name,h,null),jt(t,n,"formEncType",h.formEncType,h,null),jt(t,n,"formMethod",h.formMethod,h,null),jt(t,n,"formTarget",h.formTarget,h,null)):(jt(t,n,"encType",h.encType,h,null),jt(t,n,"method",h.method,h,null),jt(t,n,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){t.removeAttribute(l);break}u=ur(""+u),t.setAttribute(l,u);break;case"onClick":u!=null&&(t.onclick=li);break;case"onScroll":u!=null&&ot("scroll",t);break;case"onScrollEnd":u!=null&&ot("scrollend",t);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":t.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){t.removeAttribute("xlink:href");break}l=ur(""+u),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,""+u):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":u===!0?t.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?t.setAttribute(l,u):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?t.setAttribute(l,u):t.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?t.removeAttribute(l):t.setAttribute(l,u);break;case"popover":ot("beforetoggle",t),ot("toggle",t),Na(t,"popover",u);break;case"xlinkActuate":Kn(t,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Kn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Kn(t,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Kn(t,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Kn(t,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Kn(t,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Kn(t,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Kn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Kn(t,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Na(t,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ko.get(l)||l,Na(t,l,u))}}function Ld(t,n,l,u,h,b){switch(l){case"style":or(t,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof u=="string"?Vi(t,u):(typeof u=="number"||typeof u=="bigint")&&Vi(t,""+u);break;case"onScroll":u!=null&&ot("scroll",t);break;case"onScrollEnd":u!=null&&ot("scrollend",t);break;case"onClick":u!=null&&(t.onclick=li);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!No.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),n=l.slice(2,h?l.length-7:void 0),b=t[At]||null,b=b!=null?b[l]:null,typeof b=="function"&&t.removeEventListener(n,b,h),typeof u=="function")){typeof b!="function"&&b!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,u,h);break e}l in t?t[l]=u:u===!0?t.setAttribute(l,""):Na(t,l,u)}}}function vn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",t),ot("load",t);var u=!1,h=!1,b;for(b in l)if(l.hasOwnProperty(b)){var S=l[b];if(S!=null)switch(b){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:jt(t,n,b,S,l,null)}}h&&jt(t,n,"srcSet",l.srcSet,l,null),u&&jt(t,n,"src",l.src,l,null);return;case"input":ot("invalid",t);var A=b=S=h=null,$=null,ie=null;for(u in l)if(l.hasOwnProperty(u)){var ue=l[u];if(ue!=null)switch(u){case"name":h=ue;break;case"type":S=ue;break;case"checked":$=ue;break;case"defaultChecked":ie=ue;break;case"value":b=ue;break;case"defaultValue":A=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,n));break;default:jt(t,n,u,ue,l,null)}}Ql(t,b,A,$,ie,S,h,!1);return;case"select":ot("invalid",t),u=S=b=null;for(h in l)if(l.hasOwnProperty(h)&&(A=l[h],A!=null))switch(h){case"value":b=A;break;case"defaultValue":S=A;break;case"multiple":u=A;default:jt(t,n,h,A,l,null)}n=b,l=S,t.multiple=!!u,n!=null?Gi(t,!!u,n,!1):l!=null&&Gi(t,!!u,l,!0);return;case"textarea":ot("invalid",t),b=h=u=null;for(S in l)if(l.hasOwnProperty(S)&&(A=l[S],A!=null))switch(S){case"value":u=A;break;case"defaultValue":h=A;break;case"children":b=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:jt(t,n,S,A,l,null)}Xl(t,u,h,b);return;case"option":for($ in l)l.hasOwnProperty($)&&(u=l[$],u!=null)&&($==="selected"?t.selected=u&&typeof u!="function"&&typeof u!="symbol":jt(t,n,$,u,l,null));return;case"dialog":ot("beforetoggle",t),ot("toggle",t),ot("cancel",t),ot("close",t);break;case"iframe":case"object":ot("load",t);break;case"video":case"audio":for(u=0;u<Fs.length;u++)ot(Fs[u],t);break;case"image":ot("error",t),ot("load",t);break;case"details":ot("toggle",t);break;case"embed":case"source":case"link":ot("error",t),ot("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in l)if(l.hasOwnProperty(ie)&&(u=l[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:jt(t,n,ie,u,l,null)}return;default:if(Yr(n)){for(ue in l)l.hasOwnProperty(ue)&&(u=l[ue],u!==void 0&&Ld(t,n,ue,u,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(u=l[A],u!=null&&jt(t,n,A,u,l,null))}function FS(t,n,l,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,b=null,S=null,A=null,$=null,ie=null,ue=null;for(se in l){var fe=l[se];if(l.hasOwnProperty(se)&&fe!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":$=fe;default:u.hasOwnProperty(se)||jt(t,n,se,null,u,fe)}}for(var re in u){var se=u[re];if(fe=l[re],u.hasOwnProperty(re)&&(se!=null||fe!=null))switch(re){case"type":b=se;break;case"name":h=se;break;case"checked":ie=se;break;case"defaultChecked":ue=se;break;case"value":S=se;break;case"defaultValue":A=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,n));break;default:se!==fe&&jt(t,n,re,se,u,fe)}}Kr(t,S,A,$,ie,ue,b,h);return;case"select":se=S=A=re=null;for(b in l)if($=l[b],l.hasOwnProperty(b)&&$!=null)switch(b){case"value":break;case"multiple":se=$;default:u.hasOwnProperty(b)||jt(t,n,b,null,u,$)}for(h in u)if(b=u[h],$=l[h],u.hasOwnProperty(h)&&(b!=null||$!=null))switch(h){case"value":re=b;break;case"defaultValue":A=b;break;case"multiple":S=b;default:b!==$&&jt(t,n,h,b,u,$)}n=A,l=S,u=se,re!=null?Gi(t,!!l,re,!1):!!u!=!!l&&(n!=null?Gi(t,!!l,n,!0):Gi(t,!!l,l?[]:"",!1));return;case"textarea":se=re=null;for(A in l)if(h=l[A],l.hasOwnProperty(A)&&h!=null&&!u.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:jt(t,n,A,null,u,h)}for(S in u)if(h=u[S],b=l[S],u.hasOwnProperty(S)&&(h!=null||b!=null))switch(S){case"value":re=h;break;case"defaultValue":se=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==b&&jt(t,n,S,h,u,b)}Jl(t,re,se);return;case"option":for(var Te in l)re=l[Te],l.hasOwnProperty(Te)&&re!=null&&!u.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:jt(t,n,Te,null,u,re));for($ in u)re=u[$],se=l[$],u.hasOwnProperty($)&&re!==se&&(re!=null||se!=null)&&($==="selected"?t.selected=re&&typeof re!="function"&&typeof re!="symbol":jt(t,n,$,re,u,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in l)re=l[$e],l.hasOwnProperty($e)&&re!=null&&!u.hasOwnProperty($e)&&jt(t,n,$e,null,u,re);for(ie in u)if(re=u[ie],se=l[ie],u.hasOwnProperty(ie)&&re!==se&&(re!=null||se!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,n));break;default:jt(t,n,ie,re,u,se)}return;default:if(Yr(n)){for(var Tt in l)re=l[Tt],l.hasOwnProperty(Tt)&&re!==void 0&&!u.hasOwnProperty(Tt)&&Ld(t,n,Tt,void 0,u,re);for(ue in u)re=u[ue],se=l[ue],!u.hasOwnProperty(ue)||re===se||re===void 0&&se===void 0||Ld(t,n,ue,re,u,se);return}}for(var J in l)re=l[J],l.hasOwnProperty(J)&&re!=null&&!u.hasOwnProperty(J)&&jt(t,n,J,null,u,re);for(fe in u)re=u[fe],se=l[fe],!u.hasOwnProperty(fe)||re===se||re==null&&se==null||jt(t,n,fe,re,u,se)}function Ox(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],b=h.transferSize,S=h.initiatorType,A=h.duration;if(b&&A&&Ox(S)){for(S=0,A=h.responseEnd,u+=1;u<l.length;u++){var $=l[u],ie=$.startTime;if(ie>A)break;var ue=$.transferSize,fe=$.initiatorType;ue&&Ox(fe)&&($=$.responseEnd,S+=ue*($<A?1:(A-ie)/($-ie)))}if(--u,n+=8*(b+S)/(h.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var zd=null,Id=null;function Eu(t){return t.nodeType===9?t:t.ownerDocument}function _x(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Fx(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function $d(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Hd=null;function RS(){var t=window.event;return t&&t.type==="popstate"?t===Hd?!1:(Hd=t,!0):(Hd=null,!1)}var Bx=typeof setTimeout=="function"?setTimeout:void 0,LS=typeof clearTimeout=="function"?clearTimeout:void 0,Rx=typeof Promise=="function"?Promise:void 0,zS=typeof queueMicrotask=="function"?queueMicrotask:typeof Rx<"u"?function(t){return Rx.resolve(null).then(t).catch(IS)}:Bx;function IS(t){setTimeout(function(){throw t})}function $a(t){return t==="head"}function Lx(t,n){var l=n,u=0;do{var h=l.nextSibling;if(t.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){t.removeChild(h),Al(n);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Rs(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Rs(l);for(var b=l.firstChild;b;){var S=b.nextSibling,A=b.nodeName;b[ar]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=S}}else l==="body"&&Rs(t.ownerDocument.body);l=h}while(l);Al(n)}function zx(t,n){var l=t;t=0;do{var u=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=u}while(l)}function Ud(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ud(l),Pi(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function $S(t,n,l,u){for(;t.nodeType===1;){var h=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(u){if(!t[ar])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(b=t.getAttribute("rel"),b==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(b!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(b=t.getAttribute("src"),(b!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&b&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var b=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===b)return t}else return t;if(t=pi(t.nextSibling),t===null)break}return null}function HS(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=pi(t.nextSibling),t===null))return null;return t}function Ix(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=pi(t.nextSibling),t===null))return null;return t}function Pd(t){return t.data==="$?"||t.data==="$~"}function qd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function US(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var u=function(){n(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),t._reactRetry=u}}function pi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Gd=null;function $x(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return pi(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Hx(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function Ux(t,n,l){switch(n=Eu(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Rs(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Pi(t)}var mi=new Map,Px=new Set;function ku(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ua=_.d;_.d={f:PS,r:qS,D:GS,C:VS,L:KS,m:YS,X:JS,S:QS,M:XS};function PS(){var t=ua.f(),n=xu();return t||n}function qS(t){var n=ri(t);n!==null&&n.tag===5&&n.type==="form"?lg(n):ua.r(t)}var Cl=typeof document>"u"?null:document;function qx(t,n,l){var u=Cl;if(u&&typeof n=="string"&&n){var h=On(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),Px.has(h)||(Px.add(h),t={rel:t,crossOrigin:l,href:n},u.querySelector(h)===null&&(n=u.createElement("link"),vn(n,"link",t),an(n),u.head.appendChild(n)))}}function GS(t){ua.D(t),qx("dns-prefetch",t,null)}function VS(t,n){ua.C(t,n),qx("preconnect",t,n)}function KS(t,n,l){ua.L(t,n,l);var u=Cl;if(u&&t&&n){var h='link[rel="preload"][as="'+On(n)+'"]';n==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+On(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+On(l.imageSizes)+'"]')):h+='[href="'+On(t)+'"]';var b=h;switch(n){case"style":b=El(t);break;case"script":b=kl(t)}mi.has(b)||(t=m({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),mi.set(b,t),u.querySelector(h)!==null||n==="style"&&u.querySelector(Ls(b))||n==="script"&&u.querySelector(zs(b))||(n=u.createElement("link"),vn(n,"link",t),an(n),u.head.appendChild(n)))}}function YS(t,n){ua.m(t,n);var l=Cl;if(l&&t){var u=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+On(u)+'"][href="'+On(t)+'"]',b=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=kl(t)}if(!mi.has(b)&&(t=m({rel:"modulepreload",href:t},n),mi.set(b,t),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(zs(b)))return}u=l.createElement("link"),vn(u,"link",t),an(u),l.head.appendChild(u)}}}function QS(t,n,l){ua.S(t,n,l);var u=Cl;if(u&&t){var h=bi(u).hoistableStyles,b=El(t);n=n||"default";var S=h.get(b);if(!S){var A={loading:0,preload:null};if(S=u.querySelector(Ls(b)))A.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":n},l),(l=mi.get(b))&&Vd(t,l);var $=S=u.createElement("link");an($),vn($,"link",t),$._p=new Promise(function(ie,ue){$.onload=ie,$.onerror=ue}),$.addEventListener("load",function(){A.loading|=1}),$.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Au(S,n,u)}S={type:"stylesheet",instance:S,count:1,state:A},h.set(b,S)}}}function JS(t,n){ua.X(t,n);var l=Cl;if(l&&t){var u=bi(l).hoistableScripts,h=kl(t),b=u.get(h);b||(b=l.querySelector(zs(h)),b||(t=m({src:t,async:!0},n),(n=mi.get(h))&&Kd(t,n),b=l.createElement("script"),an(b),vn(b,"link",t),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(h,b))}}function XS(t,n){ua.M(t,n);var l=Cl;if(l&&t){var u=bi(l).hoistableScripts,h=kl(t),b=u.get(h);b||(b=l.querySelector(zs(h)),b||(t=m({src:t,async:!0,type:"module"},n),(n=mi.get(h))&&Kd(t,n),b=l.createElement("script"),an(b),vn(b,"link",t),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(h,b))}}function Gx(t,n,l,u){var h=(h=Se.current)?ku(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=El(l.href),l=bi(h).hoistableStyles,u=l.get(n),u||(u={type:"style",instance:null,count:0,state:null},l.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=El(l.href);var b=bi(h).hoistableStyles,S=b.get(t);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(t,S),(b=h.querySelector(Ls(t)))&&!b._p&&(S.instance=b,S.state.loading=5),mi.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},mi.set(t,l),b||ZS(h,t,l,S.state))),n&&u===null)throw Error(r(528,""));return S}if(n&&u!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=kl(l),l=bi(h).hoistableScripts,u=l.get(n),u||(u={type:"script",instance:null,count:0,state:null},l.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function El(t){return'href="'+On(t)+'"'}function Ls(t){return'link[rel="stylesheet"]['+t+"]"}function Vx(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function ZS(t,n,l,u){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=t.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),vn(n,"link",l),an(n),t.head.appendChild(n))}function kl(t){return'[src="'+On(t)+'"]'}function zs(t){return"script[async]"+t}function Kx(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var u=t.querySelector('style[data-href~="'+On(l.href)+'"]');if(u)return n.instance=u,an(u),u;var h=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),an(u),vn(u,"style",h),Au(u,l.precedence,t),n.instance=u;case"stylesheet":h=El(l.href);var b=t.querySelector(Ls(h));if(b)return n.state.loading|=4,n.instance=b,an(b),b;u=Vx(l),(h=mi.get(h))&&Vd(u,h),b=(t.ownerDocument||t).createElement("link"),an(b);var S=b;return S._p=new Promise(function(A,$){S.onload=A,S.onerror=$}),vn(b,"link",u),n.state.loading|=4,Au(b,l.precedence,t),n.instance=b;case"script":return b=kl(l.src),(h=t.querySelector(zs(b)))?(n.instance=h,an(h),h):(u=l,(h=mi.get(b))&&(u=m({},l),Kd(u,h)),t=t.ownerDocument||t,h=t.createElement("script"),an(h),vn(h,"link",u),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,Au(u,l.precedence,t));return n.instance}function Au(t,n,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,b=h,S=0;S<u.length;S++){var A=u[S];if(A.dataset.precedence===n)b=A;else if(b!==h)break}b?b.parentNode.insertBefore(t,b.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Vd(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Kd(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Mu=null;function Yx(t,n,l){if(Mu===null){var u=new Map,h=Mu=new Map;h.set(l,u)}else h=Mu,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(t))return u;for(u.set(t,null),l=l.getElementsByTagName(t),h=0;h<l.length;h++){var b=l[h];if(!(b[ar]||b[lt]||t==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var S=b.getAttribute(n)||"";S=t+S;var A=u.get(S);A?A.push(b):u.set(S,[b])}}return u}function Qx(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function WS(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Jx(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function eN(t,n,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=El(u.href),b=n.querySelector(Ls(h));if(b){n=b._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ju.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=b,an(b);return}b=n.ownerDocument||n,u=Vx(u),(h=mi.get(h))&&Vd(u,h),b=b.createElement("link"),an(b);var S=b;S._p=new Promise(function(A,$){S.onload=A,S.onerror=$}),vn(b,"link",u),l.instance=b}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=ju.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Yd=0;function tN(t,n){return t.stylesheets&&t.count===0&&Du(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var u=setTimeout(function(){if(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend){var b=t.unsuspend;t.unsuspend=null,b()}},6e4+n);0<t.imgBytes&&Yd===0&&(Yd=62500*BS());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Du(t,t.stylesheets),t.unsuspend)){var b=t.unsuspend;t.unsuspend=null,b()}},(t.imgBytes>Yd?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Tu=null;function Du(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Tu=new Map,n.forEach(nN,t),Tu=null,ju.call(t))}function nN(t,n){if(!(n.state.loading&4)){var l=Tu.get(t);if(l)var u=l.get(null);else{l=new Map,Tu.set(t,l);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<h.length;b++){var S=h[b];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),u=S)}u&&l.set(null,u)}h=n.instance,S=h.getAttribute("data-precedence"),b=l.get(S)||u,b===u&&l.set(null,h),l.set(S,h),this.count++,u=ju.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),b?b.parentNode.insertBefore(h,b.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var Is={$$typeof:T,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function iN(t,n,l,u,h,b,S,A,$){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ke(0),this.hiddenUpdates=ke(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=b,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function Xx(t,n,l,u,h,b,S,A,$,ie,ue,fe){return t=new iN(t,n,l,S,$,ie,ue,fe,A),n=1,b===!0&&(n|=24),b=Qn(3,null,null,n),t.current=b,b.stateNode=t,n=Af(),n.refCount++,t.pooledCache=n,n.refCount++,b.memoizedState={element:u,isDehydrated:l,cache:n},Df(b),t}function Zx(t){return t?(t=il,t):il}function Wx(t,n,l,u,h,b){h=Zx(h),u.context===null?u.context=h:u.pendingContext=h,u=ja(n),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=Ta(t,u,n),l!==null&&(Un(l,t,n),xs(l,t,n))}function e0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Qd(t,n){e0(t,n),(t=t.alternate)&&e0(t,n)}function t0(t){if(t.tag===13||t.tag===31){var n=br(t,67108864);n!==null&&Un(n,t,67108864),Qd(t,67108864)}}function n0(t){if(t.tag===13||t.tag===31){var n=ei();n=ct(n);var l=br(t,n);l!==null&&Un(l,t,n),Qd(t,n)}}var Ou=!0;function aN(t,n,l,u){var h=E.T;E.T=null;var b=_.p;try{_.p=2,Jd(t,n,l,u)}finally{_.p=b,E.T=h}}function rN(t,n,l,u){var h=E.T;E.T=null;var b=_.p;try{_.p=8,Jd(t,n,l,u)}finally{_.p=b,E.T=h}}function Jd(t,n,l,u){if(Ou){var h=Xd(u);if(h===null)Rd(t,n,u,_u,l),a0(t,u);else if(sN(h,t,n,l,u))u.stopPropagation();else if(a0(t,u),n&4&&-1<lN.indexOf(t)){for(;h!==null;){var b=ri(h);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var S=nn(b.pendingLanes);if(S!==0){var A=b;for(A.pendingLanes|=2,A.entangledLanes|=2;S;){var $=1<<31-at(S);A.entanglements[1]|=$,S&=~$}Bi(b),(wt&6)===0&&(mu=Pe()+500,_s(0))}}break;case 31:case 13:A=br(b,2),A!==null&&Un(A,b,2),xu(),Qd(b,2)}if(b=Xd(u),b===null&&Rd(t,n,u,_u,l),b===h)break;h=b}h!==null&&u.stopPropagation()}else Rd(t,n,u,null,l)}}function Xd(t){return t=Jr(t),Zd(t)}var _u=null;function Zd(t){if(_u=null,t=va(t),t!==null){var n=o(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=f(n),t!==null)return t;t=null}else if(l===31){if(t=c(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return _u=t,null}function i0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Kt()){case le:return 2;case xe:return 8;case z:case me:return 32;case we:return 268435456;default:return 32}default:return 32}}var Wd=!1,Ha=null,Ua=null,Pa=null,$s=new Map,Hs=new Map,qa=[],lN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function a0(t,n){switch(t){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":$s.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hs.delete(n.pointerId)}}function Us(t,n,l,u,h,b){return t===null||t.nativeEvent!==b?(t={blockedOn:n,domEventName:l,eventSystemFlags:u,nativeEvent:b,targetContainers:[h]},n!==null&&(n=ri(n),n!==null&&t0(n)),t):(t.eventSystemFlags|=u,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function sN(t,n,l,u,h){switch(n){case"focusin":return Ha=Us(Ha,t,n,l,u,h),!0;case"dragenter":return Ua=Us(Ua,t,n,l,u,h),!0;case"mouseover":return Pa=Us(Pa,t,n,l,u,h),!0;case"pointerover":var b=h.pointerId;return $s.set(b,Us($s.get(b)||null,t,n,l,u,h)),!0;case"gotpointercapture":return b=h.pointerId,Hs.set(b,Us(Hs.get(b)||null,t,n,l,u,h)),!0}return!1}function r0(t){var n=va(t.target);if(n!==null){var l=o(n);if(l!==null){if(n=l.tag,n===13){if(n=f(l),n!==null){t.blockedOn=n,Zt(t.priority,function(){n0(l)});return}}else if(n===31){if(n=c(l),n!==null){t.blockedOn=n,Zt(t.priority,function(){n0(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fu(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Xd(t.nativeEvent);if(l===null){l=t.nativeEvent;var u=new l.constructor(l.type,l);Qr=u,l.target.dispatchEvent(u),Qr=null}else return n=ri(l),n!==null&&t0(n),t.blockedOn=l,!1;n.shift()}return!0}function l0(t,n,l){Fu(t)&&l.delete(n)}function oN(){Wd=!1,Ha!==null&&Fu(Ha)&&(Ha=null),Ua!==null&&Fu(Ua)&&(Ua=null),Pa!==null&&Fu(Pa)&&(Pa=null),$s.forEach(l0),Hs.forEach(l0)}function Bu(t,n){t.blockedOn===n&&(t.blockedOn=null,Wd||(Wd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,oN)))}var Ru=null;function s0(t){Ru!==t&&(Ru=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ru===t&&(Ru=null);for(var n=0;n<t.length;n+=3){var l=t[n],u=t[n+1],h=t[n+2];if(typeof u!="function"){if(Zd(u||l)===null)continue;break}var b=ri(l);b!==null&&(t.splice(n,3),n-=3,Xf(b,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function Al(t){function n($){return Bu($,t)}Ha!==null&&Bu(Ha,t),Ua!==null&&Bu(Ua,t),Pa!==null&&Bu(Pa,t),$s.forEach(n),Hs.forEach(n);for(var l=0;l<qa.length;l++){var u=qa[l];u.blockedOn===t&&(u.blockedOn=null)}for(;0<qa.length&&(l=qa[0],l.blockedOn===null);)r0(l),l.blockedOn===null&&qa.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],b=l[u+1],S=h[At]||null;if(typeof b=="function")S||s0(l);else if(S){var A=null;if(b&&b.hasAttribute("formAction")){if(h=b,S=b[At]||null)A=S.formAction;else if(Zd(h)!==null)continue}else A=S.action;typeof A=="function"?l[u+1]=A:(l.splice(u,3),u-=3),s0(l)}}}function o0(){function t(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function eh(t){this._internalRoot=t}Lu.prototype.render=eh.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,u=ei();Wx(l,u,t,n,null,null)},Lu.prototype.unmount=eh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Wx(t.current,2,null,t,null,null),xu(),n[zt]=null}};function Lu(t){this._internalRoot=t}Lu.prototype.unstable_scheduleHydration=function(t){if(t){var n=Nn();t={blockedOn:null,target:t,priority:n};for(var l=0;l<qa.length&&n!==0&&n<qa[l].priority;l++);qa.splice(l,0,t),l===0&&r0(t)}};var u0=i.version;if(u0!=="19.2.6")throw Error(r(527,u0,"19.2.6"));_.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=d(n),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var uN={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{Re=zu.inject(uN),Fe=zu}catch{}}return qs.createRoot=function(t,n){if(!s(t))throw Error(r(299));var l=!1,u="",h=gg,b=xg,S=bg;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),n=Xx(t,1,!1,null,null,l,u,null,h,b,S,o0),t[zt]=n.current,Bd(t),new eh(n)},qs.hydrateRoot=function(t,n,l){if(!s(t))throw Error(r(299));var u=!1,h="",b=gg,S=xg,A=bg,$=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&($=l.formState)),n=Xx(t,1,!0,n,l??null,u,h,$,b,S,A,o0),n.context=Zx(null),l=n.current,u=ei(),u=ct(u),h=ja(u),h.callback=null,Ta(l,h,u),l=u,n.current.lanes=l,tt(n,l),Bi(n),t[zt]=n.current,Bd(t),new Lu(n)},qs.version="19.2.6",qs}var y0;function yN(){if(y0)return ih.exports;y0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),ih.exports=bN(),ih.exports}var vN=yN();const SN=Nc(vN),Ge=e=>typeof e=="string",Gs=()=>{let e,i;const a=new Promise((r,s)=>{e=r,i=s});return a.resolve=e,a.reject=i,a},v0=e=>e==null?"":String(e),NN=(e,i,a)=>{e.forEach(r=>{i[r]&&(a[r]=i[r])})},wN=/###/g,S0=e=>e&&e.includes("###")?e.replace(wN,"."):e,N0=e=>!e||Ge(e),to=(e,i,a)=>{const r=Ge(i)?i.split("."):i;let s=0;for(;s<r.length-1;){if(N0(e))return{};const o=S0(r[s]);!e[o]&&a&&(e[o]=new a),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return N0(e)?{}:{obj:e,k:S0(r[s])}},w0=(e,i,a)=>{const{obj:r,k:s}=to(e,i,Object);if(r!==void 0||i.length===1){r[s]=a;return}let o=i[i.length-1],f=i.slice(0,i.length-1),c=to(e,f,Object);for(;c.obj===void 0&&f.length;)o=`${f[f.length-1]}.${o}`,f=f.slice(0,f.length-1),c=to(e,f,Object),c?.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=a},CN=(e,i,a,r)=>{const{obj:s,k:o}=to(e,i,Object);s[o]=s[o]||[],s[o].push(a)},ic=(e,i)=>{const{obj:a,k:r}=to(e,i);if(a&&Object.prototype.hasOwnProperty.call(a,r))return a[r]},EN=(e,i,a)=>{const r=ic(e,a);return r!==void 0?r:ic(i,a)},Zb=(e,i,a)=>{for(const r in i)r!=="__proto__"&&r!=="constructor"&&(r in e?Ge(e[r])||e[r]instanceof String||Ge(i[r])||i[r]instanceof String?a&&(e[r]=i[r]):Zb(e[r],i[r],a):e[r]=i[r]);return e},ca=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),kN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},AN=e=>Ge(e)?e.replace(/[&<>"'\/]/g,i=>kN[i]):e;class MN{constructor(i){this.capacity=i,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(i){const a=this.regExpMap.get(i);if(a!==void 0)return a;const r=new RegExp(i);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(i,r),this.regExpQueue.push(i),r}}const jN=[" ",",","?","!",";"],TN=new MN(20),DN=(e,i,a)=>{i=i||"",a=a||"";const r=jN.filter(f=>!i.includes(f)&&!a.includes(f));if(r.length===0)return!0;const s=TN.getRegExp(`(${r.map(f=>f==="?"?"\\?":f).join("|")})`);let o=!s.test(e);if(!o){const f=e.indexOf(a);f>0&&!s.test(e.substring(0,f))&&(o=!0)}return o},Xh=(e,i,a=".")=>{if(!e)return;if(e[i])return Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0;const r=i.split(a);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let f,c="";for(let p=o;p<r.length;++p)if(p!==o&&(c+=a),c+=r[p],f=s[c],f!==void 0){if(["string","number","boolean"].includes(typeof f)&&p<r.length-1)continue;o+=p-o+1;break}s=f}return s},po=e=>e?.replace(/_/g,"-"),ON={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,i){console?.[e]?.apply?.(console,i)}};class ac{constructor(i,a={}){this.init(i,a)}init(i,a={}){this.prefix=a.prefix||"i18next:",this.logger=i||ON,this.options=a,this.debug=a.debug}log(...i){return this.forward(i,"log","",!0)}warn(...i){return this.forward(i,"warn","",!0)}error(...i){return this.forward(i,"error","")}deprecate(...i){return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(i,a,r,s){return s&&!this.debug?null:(i=i.map(o=>Ge(o)?o.replace(/[\r\n\x00-\x1F\x7F]/g," "):o),Ge(i[0])&&(i[0]=`${r}${this.prefix} ${i[0]}`),this.logger[a](i))}create(i){return new ac(this.logger,{prefix:`${this.prefix}:${i}:`,...this.options})}clone(i){return i=i||this.options,i.prefix=i.prefix||this.prefix,new ac(this.logger,i)}}var Hi=new ac;class Cc{constructor(){this.observers={}}on(i,a){return i.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(a)||0;this.observers[r].set(a,s+1)}),this}off(i,a){if(this.observers[i]){if(!a){delete this.observers[i];return}this.observers[i].delete(a)}}once(i,a){const r=(...s)=>{a(...s),this.off(i,r)};return this.on(i,r),this}emit(i,...a){this.observers[i]&&Array.from(this.observers[i].entries()).forEach(([s,o])=>{for(let f=0;f<o;f++)s(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,o])=>{for(let f=0;f<o;f++)s(i,...a)})}}class C0 extends Cc{constructor(i,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=i||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(i){this.options.ns.includes(i)||this.options.ns.push(i)}removeNamespaces(i){const a=this.options.ns.indexOf(i);a>-1&&this.options.ns.splice(a,1)}getResource(i,a,r,s={}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,f=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;i.includes(".")?c=i.split("."):(c=[i,a],r&&(Array.isArray(r)?c.push(...r):Ge(r)&&o?c.push(...r.split(o)):c.push(r)));const p=ic(this.data,c);return!p&&!a&&!r&&i.includes(".")&&(i=c[0],a=c[1],r=c.slice(2).join(".")),p||!f||!Ge(r)?p:Xh(this.data?.[i]?.[a],r,o)}addResource(i,a,r,s,o={silent:!1}){const f=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[i,a];r&&(c=c.concat(f?r.split(f):r)),i.includes(".")&&(c=i.split("."),s=a,a=c[1]),this.addNamespaces(a),w0(this.data,c,s),o.silent||this.emit("added",i,a,r,s)}addResources(i,a,r,s={silent:!1}){for(const o in r)(Ge(r[o])||Array.isArray(r[o]))&&this.addResource(i,a,o,r[o],{silent:!0});s.silent||this.emit("added",i,a,r)}addResourceBundle(i,a,r,s,o,f={silent:!1,skipCopy:!1}){let c=[i,a];i.includes(".")&&(c=i.split("."),s=r,r=a,a=c[1]),this.addNamespaces(a);let p=ic(this.data,c)||{};f.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?Zb(p,r,o):p={...p,...r},w0(this.data,c,p),f.silent||this.emit("added",i,a,r)}removeResourceBundle(i,a){this.hasResourceBundle(i,a)&&delete this.data[i][a],this.removeNamespaces(a),this.emit("removed",i,a)}hasResourceBundle(i,a){return this.getResource(i,a)!==void 0}getResourceBundle(i,a){return a||(a=this.options.defaultNS),this.getResource(i,a)}getDataByLanguage(i){return this.data[i]}hasLanguageSomeTranslations(i){const a=this.getDataByLanguage(i);return!!(a&&Object.keys(a)||[]).find(s=>a[s]&&Object.keys(a[s]).length>0)}toJSON(){return this.data}}var Wb={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,i,a,r,s){return e.forEach(o=>{i=this.processors[o]?.process(i,a,r,s)??i}),i}};const ey=Symbol("i18next/PATH_KEY");function _N(){const e=[],i=Object.create(null);let a;return i.get=(r,s)=>(a?.revoke?.(),s===ey?e:(e.push(s),a=Proxy.revocable(r,i),a.proxy)),Proxy.revocable(Object.create(null),i).proxy}function Hl(e,i){const{[ey]:a}=e(_N()),r=i?.keySeparator??".",s=i?.nsSeparator??":",o=i?.enableSelector==="strict";if(a.length>1&&s){const f=i?.ns,c=o?Array.isArray(f)?f:f?[f]:null:Array.isArray(f)?f:null;if(c&&(o?c:c.length>1?c.slice(1):[]).includes(a[0]))return`${a[0]}${s}${a.slice(1).join(r)}`}return a.join(r)}const sh=e=>!Ge(e)&&typeof e!="boolean"&&typeof e!="number";class rc extends Cc{constructor(i,a={}){super(),NN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hi.create("translator"),this.checkedLoadedFor={}}changeLanguage(i){i&&(this.language=i)}exists(i,a={interpolation:{}}){const r={...a};if(i==null)return!1;const s=this.resolve(i,r);if(s?.res===void 0)return!1;const o=sh(s.res);return!(r.returnObjects===!1&&o)}extractFromKey(i,a){let r=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=a.ns||this.options.defaultNS||[];const f=r&&i.includes(r),c=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!DN(i,r,s);if(f&&!c){const p=i.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:i,namespaces:Ge(o)?[o]:o};const d=i.split(r);(r!==s||r===s&&this.options.ns.includes(d[0]))&&(o=d.shift()),i=d.join(s)}return{key:i,namespaces:Ge(o)?[o]:o}}translate(i,a,r){let s=typeof a=="object"?{...a}:a;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),i==null)return"";typeof i=="function"&&(i=Hl(i,{...this.options,...s})),Array.isArray(i)||(i=[String(i)]),i=i.map(W=>typeof W=="function"?Hl(W,{...this.options,...s}):String(W));const o=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,f=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:c,namespaces:p}=this.extractFromKey(i[i.length-1],s),d=p[p.length-1];let g=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const m=s.lng||this.language,y=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m?.toLowerCase()==="cimode")return y?o?{res:`${d}${g}${c}`,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(s)}:`${d}${g}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:m,usedNS:d,usedParams:this.getUsedParamsDetails(s)}:c;const v=this.resolve(i,s);let N=v?.res;const M=v?.usedKey||c,D=v?.exactUsedKey||c,k=["[object Number]","[object Function]","[object RegExp]"],U=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,Q=s.count!==void 0&&!Ge(s.count),ee=rc.hasDefaultValue(s),R=Q?this.pluralResolver.getSuffix(m,s.count,s):"",F=s.ordinal&&Q?this.pluralResolver.getSuffix(m,s.count,{ordinal:!1}):"",I=Q&&!s.ordinal&&s.count===0,K=I&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${R}`]||s[`defaultValue${F}`]||s.defaultValue;let j=N;T&&!N&&ee&&(j=K);const P=sh(j),q=Object.prototype.toString.apply(j);if(T&&j&&P&&!k.includes(q)&&!(Ge(U)&&Array.isArray(j))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(M,j,{...s,ns:p}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(v.res=W,v.usedParams=this.getUsedParamsDetails(s),v):W}if(f){const W=Array.isArray(j),H=W?[]:{},ae=W?D:M;for(const E in j)if(Object.prototype.hasOwnProperty.call(j,E)){const _=`${ae}${f}${E}`;ee&&!N?H[E]=this.translate(_,{...s,defaultValue:sh(K)?K[E]:void 0,joinArrays:!1,ns:p}):H[E]=this.translate(_,{...s,joinArrays:!1,ns:p}),H[E]===_&&(H[E]=j[E])}N=H}}else if(T&&Ge(U)&&Array.isArray(N))N=N.join(U),N&&(N=this.extendTranslation(N,i,s,r));else{let W=!1,H=!1;!this.isValidLookup(N)&&ee&&(W=!0,N=K),this.isValidLookup(N)||(H=!0,N=c);const E=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:N,_=ee&&K!==N&&this.options.updateMissing;if(H||W||_){if(this.logger.log(_?"updateKey":"missingKey",m,d,Q&&!_?`${c}${this.pluralResolver.getSuffix(m,s.count,s)}`:c,_?K:N),f){const B=this.resolve(c,{...s,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Y=[];const oe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&oe&&oe[0])for(let B=0;B<oe.length;B++)Y.push(oe[B]);else this.options.saveMissingTo==="all"?Y=this.languageUtils.toResolveHierarchy(s.lng||this.language):Y.push(s.lng||this.language);const O=(B,Z,w)=>{const he=ee&&w!==N?w:E;this.options.missingKeyHandler?this.options.missingKeyHandler(B,d,Z,he,_,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(B,d,Z,he,_,s),this.emit("missingKey",B,d,Z,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Q?Y.forEach(B=>{const Z=this.pluralResolver.getSuffixes(B,s);I&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!Z.includes(`${this.options.pluralSeparator}zero`)&&Z.push(`${this.options.pluralSeparator}zero`),Z.forEach(w=>{O([B],c+w,s[`defaultValue${w}`]||K)})}):O(Y,c,K))}N=this.extendTranslation(N,i,s,v,r),H&&N===c&&this.options.appendNamespaceToMissingKey&&(N=`${d}${g}${c}`),(H||W)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${g}${c}`:c,W?N:void 0,s))}return o?(v.res=N,v.usedParams=this.getUsedParamsDetails(s),v):N}extendTranslation(i,a,r,s,o){if(this.i18nFormat?.parse)i=this.i18nFormat.parse(i,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const p=Ge(i)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(p){const m=i.match(this.interpolator.nestingRegexp);d=m&&m.length}let g=r.replace&&!Ge(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),i=this.interpolator.interpolate(i,g,r.lng||this.language||s.usedLng,r),p){const m=i.match(this.interpolator.nestingRegexp),y=m&&m.length;d<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(i=this.interpolator.nest(i,(...m)=>o?.[0]===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${a[0]}`),null):this.translate(...m,a),r)),r.interpolation&&this.interpolator.reset()}const f=r.postProcess||this.options.postProcess,c=Ge(f)?[f]:f;return i!=null&&c?.length&&r.applyPostProcessor!==!1&&(i=Wb.handle(c,i,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),i}resolve(i,a={}){let r,s,o,f,c;return Ge(i)&&(i=[i]),Array.isArray(i)&&(i=i.map(p=>typeof p=="function"?Hl(p,{...this.options,...a}):p)),i.forEach(p=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(p,a),g=d.key;s=g;let m=d.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const y=a.count!==void 0&&!Ge(a.count),v=y&&!a.ordinal&&a.count===0,N=a.context!==void 0&&(Ge(a.context)||typeof a.context=="number")&&a.context!=="",M=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);m.forEach(D=>{this.isValidLookup(r)||(c=D,!this.checkedLoadedFor[`${M[0]}-${D}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(this.checkedLoadedFor[`${M[0]}-${D}`]=!0,this.logger.warn(`key "${s}" for languages "${M.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),M.forEach(k=>{if(this.isValidLookup(r))return;f=k;const U=[g];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(U,g,k,D,a);else{let Q;y&&(Q=this.pluralResolver.getSuffix(k,a.count,a));const ee=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(a.ordinal&&Q.startsWith(R)&&U.push(g+Q.replace(R,this.options.pluralSeparator)),U.push(g+Q),v&&U.push(g+ee)),N){const F=`${g}${this.options.contextSeparator||"_"}${a.context}`;U.push(F),y&&(a.ordinal&&Q.startsWith(R)&&U.push(F+Q.replace(R,this.options.pluralSeparator)),U.push(F+Q),v&&U.push(F+ee))}}let T;for(;T=U.pop();)this.isValidLookup(r)||(o=T,r=this.getResource(k,D,T,a))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:f,usedNS:c}}isValidLookup(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}getResource(i,a,r,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(i,a,r,s):this.resourceStore.getResource(i,a,r,s)}getUsedParamsDetails(i={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=i.replace&&!Ge(i.replace);let s=r?i.replace:i;if(r&&typeof i.count<"u"&&(s.count=i.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of a)delete s[o]}return s}static hasDefaultValue(i){const a="defaultValue";for(const r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&r.startsWith(a)&&i[r]!==void 0)return!0;return!1}}class E0{constructor(i){this.options=i,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hi.create("languageUtils")}getScriptPartFromCode(i){if(i=po(i),!i||!i.includes("-"))return null;const a=i.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(i){if(i=po(i),!i||!i.includes("-"))return i;const a=i.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(i){if(Ge(i)&&i.includes("-")){let a;try{a=Intl.getCanonicalLocales(i)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?i.toLowerCase():i)}return this.options.cleanCode||this.options.lowerCaseLng?i.toLowerCase():i}isSupportedCode(i){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(i=this.getLanguagePartFromCode(i)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(i)}getBestMatchFromCodes(i){if(!i)return null;let a;return i.forEach(r=>{if(a)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(a=s)}),!a&&this.options.supportedLngs&&i.forEach(r=>{if(a)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return a=s;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return a=o;a=this.options.supportedLngs.find(f=>f===o?!0:!f.includes("-")&&!o.includes("-")?!1:!!(f.includes("-")&&!o.includes("-")&&f.slice(0,f.indexOf("-"))===o||f.startsWith(o)&&o.length>1))}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(i,a){if(!i)return[];if(typeof i=="function"&&(i=i(a)),Ge(i)&&(i=[i]),Array.isArray(i))return i;if(!a)return i.default||[];let r=i[a];return r||(r=i[this.getScriptPartFromCode(a)]),r||(r=i[this.formatLanguageCode(a)]),r||(r=i[this.getLanguagePartFromCode(a)]),r||(r=i.default),r||[]}toResolveHierarchy(i,a){const r=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],i),s=[],o=f=>{f&&(this.isSupportedCode(f)?s.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return Ge(i)&&(i.includes("-")||i.includes("_"))?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(i)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(i)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(i))):Ge(i)&&o(this.formatLanguageCode(i)),r.forEach(f=>{s.includes(f)||o(this.formatLanguageCode(f))}),s}}const k0={zero:0,one:1,two:2,few:3,many:4,other:5},A0={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class FN{constructor(i,a={}){this.languageUtils=i,this.options=a,this.logger=Hi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(i,a={}){const r=po(i==="dev"?"en":i),s=a.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let f;try{f=new Intl.PluralRules(r,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),A0;if(!i.match(/-|_/))return A0;const p=this.languageUtils.getLanguagePartFromCode(i);f=this.getRule(p,a)}return this.pluralRulesCache[o]=f,f}needsPlural(i,a={}){let r=this.getRule(i,a);return r||(r=this.getRule("dev",a)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(i,a,r={}){return this.getSuffixes(i,r).map(s=>`${a}${s}`)}getSuffixes(i,a={}){let r=this.getRule(i,a);return r||(r=this.getRule("dev",a)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>k0[s]-k0[o]).map(s=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(i,a,r={}){const s=this.getRule(i,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(a)}`:(this.logger.warn(`no plural rule found for: ${i}`),this.getSuffix("dev",a,r))}}const M0=(e,i,a,r=".",s=!0)=>{let o=EN(e,i,a);return!o&&s&&Ge(a)&&(o=Xh(e,a,r),o===void 0&&(o=Xh(i,a,r))),o},oh=e=>e.replace(/\$/g,"$$$$");class j0{constructor(i={}){this.logger=Hi.create("interpolator"),this.options=i,this.format=i?.interpolation?.format||(a=>a),this.init(i)}init(i={}){i.interpolation||(i.interpolation={escapeValue:!0});const{escape:a,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:f,suffix:c,suffixEscaped:p,formatSeparator:d,unescapeSuffix:g,unescapePrefix:m,nestingPrefix:y,nestingPrefixEscaped:v,nestingSuffix:N,nestingSuffixEscaped:M,nestingOptionsSeparator:D,maxReplaces:k,alwaysFormat:U}=i.interpolation;this.escape=a!==void 0?a:AN,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?ca(o):f||"{{",this.suffix=c?ca(c):p||"}}",this.formatSeparator=d||",",this.unescapePrefix=g?"":m?ca(m):"-",this.unescapeSuffix=this.unescapePrefix?"":g?ca(g):"",this.nestingPrefix=y?ca(y):v||ca("$t("),this.nestingSuffix=N?ca(N):M||ca(")"),this.nestingOptionsSeparator=D||",",this.maxReplaces=k||1e3,this.alwaysFormat=U!==void 0?U:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const i=(a,r)=>a?.source===r?(a.lastIndex=0,a):new RegExp(r,"g");this.regexp=i(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=i(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=i(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(i,a,r,s){let o,f,c;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=v=>{if(!v.includes(this.formatSeparator)){const k=M0(a,p,v,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...s,...a,interpolationkey:v}):k}const N=v.split(this.formatSeparator),M=N.shift().trim(),D=N.join(this.formatSeparator).trim();return this.format(M0(a,p,M,this.options.keySeparator,this.options.ignoreJSONStructure),D,r,{...s,...a,interpolationkey:M})};this.resetRegExp(),!this.escapeValue&&typeof i=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(i)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const g=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,m=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:v=>oh(v)},{regex:this.regexp,safeValue:v=>this.escapeValue?oh(this.escape(v)):oh(v)}].forEach(v=>{for(c=0;o=v.regex.exec(i);){const N=o[1].trim();if(f=d(N),f===void 0)if(typeof g=="function"){const D=g(i,o,s);f=Ge(D)?D:""}else if(s&&Object.prototype.hasOwnProperty.call(s,N))f="";else if(m){f=o[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${i}`),f="";else!Ge(f)&&!this.useRawValueToEscape&&(f=v0(f));const M=v.safeValue(f);if(i=i.replace(o[0],M),m?(v.regex.lastIndex+=f.length,v.regex.lastIndex-=o[0].length):v.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),i}nest(i,a,r={}){let s,o,f;const c=(p,d)=>{const g=this.nestingOptionsSeparator;if(!p.includes(g))return p;const m=p.split(new RegExp(`${ca(g)}[ ]*{`));let y=`{${m[1]}`;p=m[0],y=this.interpolate(y,f);const v=y.match(/'/g),N=y.match(/"/g);((v?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{f=JSON.parse(y),d&&(f={...d,...f})}catch(M){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,M),`${p}${g}${y}`}return f.defaultValue&&f.defaultValue.includes(this.prefix)&&delete f.defaultValue,p};for(;s=this.nestingRegexp.exec(i);){let p=[];f={...r},f=f.replace&&!Ge(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const d=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(d!==-1&&(p=s[1].slice(d).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),s[1]=s[1].slice(0,d)),o=a(c.call(this,s[1].trim(),f),f),o&&s[0]===i&&!Ge(o))return o;Ge(o)||(o=v0(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${i}`),o=""),p.length&&(o=p.reduce((g,m)=>this.format(g,m,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),i=i.replace(s[0],o),this.regexp.lastIndex=0}return i}}const BN=e=>{let i=e.toLowerCase().trim();const a={};if(e.includes("(")){const r=e.split("(");i=r[0].toLowerCase().trim();const s=r[1].slice(0,-1);i==="currency"&&!s.includes(":")?a.currency||(a.currency=s.trim()):i==="relativetime"&&!s.includes(":")?a.range||(a.range=s.trim()):s.split(";").forEach(f=>{if(f){const[c,...p]=f.split(":"),d=p.join(":").trim().replace(/^'+|'+$/g,""),g=c.trim();a[g]||(a[g]=d),d==="false"&&(a[g]=!1),d==="true"&&(a[g]=!0),isNaN(d)||(a[g]=parseInt(d,10))}})}return{formatName:i,formatOptions:a}},T0=e=>{const i={};return(a,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const f=r+JSON.stringify(o);let c=i[f];return c||(c=e(po(r),s),i[f]=c),c(a)}},RN=e=>(i,a,r)=>e(po(a),r)(i);class LN{constructor(i={}){this.logger=Hi.create("formatter"),this.options=i,this.init(i)}init(i,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const r=a.cacheInBuiltFormats?T0:RN;this.formats={number:r((s,o)=>{const f=new Intl.NumberFormat(s,{...o});return c=>f.format(c)}),currency:r((s,o)=>{const f=new Intl.NumberFormat(s,{...o,style:"currency"});return c=>f.format(c)}),datetime:r((s,o)=>{const f=new Intl.DateTimeFormat(s,{...o});return c=>f.format(c)}),relativetime:r((s,o)=>{const f=new Intl.RelativeTimeFormat(s,{...o});return c=>f.format(c,o.range||"day")}),list:r((s,o)=>{const f=new Intl.ListFormat(s,{...o});return c=>f.format(c)})}}add(i,a){this.formats[i.toLowerCase().trim()]=a}addCached(i,a){this.formats[i.toLowerCase().trim()]=T0(a)}format(i,a,r,s={}){if(!a||i==null)return i;const o=a.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&!o[0].includes(")")&&o.find(c=>c.includes(")"))){const c=o.findIndex(p=>p.includes(")"));o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,p)=>{const{formatName:d,formatOptions:g}=BN(p);if(this.formats[d]){let m=c;try{const y=s?.formatParams?.[s.interpolationkey]||{},v=y.locale||y.lng||s.locale||s.lng||r;m=this.formats[d](c,v,{...g,...s,...y})}catch(y){this.logger.warn(y)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},i)}}const zN=(e,i)=>{e.pending[i]!==void 0&&(delete e.pending[i],e.pendingCount--)};class IN extends Cc{constructor(i,a,r,s={}){super(),this.backend=i,this.store=a,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Hi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(i,a,r,s){const o={},f={},c={},p={};return i.forEach(d=>{let g=!0;a.forEach(m=>{const y=`${d}|${m}`;!r.reload&&this.store.hasResourceBundle(d,m)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?f[y]===void 0&&(f[y]=!0):(this.state[y]=1,g=!1,f[y]===void 0&&(f[y]=!0),o[y]===void 0&&(o[y]=!0),p[m]===void 0&&(p[m]=!0)))}),g||(c[d]=!0)}),(Object.keys(o).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(f),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(p)}}loaded(i,a,r){const s=i.split("|"),o=s[0],f=s[1];a&&this.emit("failedLoading",o,f,a),!a&&r&&this.store.addResourceBundle(o,f,r,void 0,void 0,{skipCopy:!0}),this.state[i]=a?-1:2,a&&r&&(this.state[i]=0);const c={};this.queue.forEach(p=>{CN(p.loaded,[o],f),zN(p,i),a&&p.errors.push(a),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(d=>{c[d]||(c[d]={});const g=p.loaded[d];g.length&&g.forEach(m=>{c[d][m]===void 0&&(c[d][m]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(p=>!p.done)}read(i,a,r,s=0,o=this.retryTimeout,f){if(!i.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:a,fcName:r,tried:s,wait:o,callback:f});return}this.readingCalls++;const c=(d,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(d&&g&&s<this.maxRetries){setTimeout(()=>{this.read(i,a,r,s+1,o*2,f)},o);return}f(d,g)},p=this.backend[r].bind(this.backend);if(p.length===2){try{const d=p(i,a);d&&typeof d.then=="function"?d.then(g=>c(null,g)).catch(c):c(null,d)}catch(d){c(d)}return}return p(i,a,c)}prepareLoading(i,a,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Ge(i)&&(i=this.languageUtils.toResolveHierarchy(i)),Ge(a)&&(a=[a]);const o=this.queueLoad(i,a,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(f=>{this.loadOne(f)})}load(i,a,r){this.prepareLoading(i,a,{},r)}reload(i,a,r){this.prepareLoading(i,a,{reload:!0},r)}loadOne(i,a=""){const r=i.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(f,c)=>{f&&this.logger.warn(`${a}loading namespace ${o} for language ${s} failed`,f),!f&&c&&this.logger.log(`${a}loaded namespace ${o} for language ${s}`,c),this.loaded(i,f,c)})}saveMissing(i,a,r,s,o,f={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(a)){this.logger.warn(`did not save key "${r}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const p={...f,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let g;d.length===5?g=d(i,a,r,s,p):g=d(i,a,r,s),g&&typeof g.then=="function"?g.then(m=>c(null,m)).catch(c):c(null,g)}catch(g){c(g)}else d(i,a,r,s,c,p)}!i||!i[0]||this.store.addResource(i[0],a,r,s)}}}const uh=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let i={};if(typeof e[1]=="object"&&(i=e[1]),Ge(e[1])&&(i.defaultValue=e[1]),Ge(e[2])&&(i.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(r=>{i[r]=a[r]})}return i},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),D0=e=>(Ge(e.ns)&&(e.ns=[e.ns]),Ge(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ge(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Iu=()=>{},$N=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class no extends Cc{constructor(i={},a){if(super(),this.options=D0(i),this.services={},this.logger=Hi,this.modules={external:[]},$N(this),a&&!this.isInitialized&&!i.isClone){if(!this.options.initAsync)return this.init(i,a),this;setTimeout(()=>{this.init(i,a)},0)}}init(i={},a){this.isInitializing=!0,typeof i=="function"&&(a=i,i={}),i.defaultNS==null&&i.ns&&(Ge(i.ns)?i.defaultNS=i.ns:i.ns.includes("translation")||(i.defaultNS=i.ns[0]));const r=uh();this.options={...r,...this.options,...D0(i)},this.options.interpolation={...r.interpolation,...this.options.interpolation},i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const s=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Hi.init(s(this.modules.logger),this.options):Hi.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=LN;const g=new E0(this.options);this.store=new C0(this.options.resources,this.options);const m=this.services;m.logger=Hi,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new FN(g,{prepend:this.options.pluralSeparator}),d&&(m.formatter=s(d),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new j0(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new IN(s(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(y,...v)=>{this.emit(y,...v)}),this.modules.languageDetector&&(m.languageDetector=s(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=s(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new rc(this.services,this.options),this.translator.on("*",(y,...v)=>{this.emit(y,...v)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Iu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...g)=>this.store[d](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...g)=>(this.store[d](...g),this)});const c=Gs(),p=()=>{const d=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),a(g,m)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),c}loadResources(i,a=Iu){let r=a;const s=Ge(i)?i:this.language;if(typeof i=="function"&&(r=i),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],f=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(d=>{d!=="cimode"&&(o.includes(d)||o.push(d))})};s?f(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>f(p)),this.options.preload?.forEach?.(c=>f(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(i,a,r){const s=Gs();return typeof i=="function"&&(r=i,i=void 0),typeof a=="function"&&(r=a,a=void 0),i||(i=this.languages),a||(a=this.options.ns),r||(r=Iu),this.services.backendConnector.reload(i,a,o=>{s.resolve(),r(o)}),s}use(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Wb.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}setResolvedLanguage(i){if(!(!i||!this.languages)&&!["cimode","dev"].includes(i)){for(let a=0;a<this.languages.length;a++){const r=this.languages[a];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(i)&&this.store.hasLanguageSomeTranslations(i)&&(this.resolvedLanguage=i,this.languages.unshift(i))}}changeLanguage(i,a){this.isLanguageChangingTo=i;const r=Gs();this.emit("languageChanging",i);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,p)=>{p?this.isLanguageChangingTo===i&&(s(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),a&&a(c,(...d)=>this.t(...d))},f=c=>{!i&&!c&&this.services.languageDetector&&(c=[]);const p=Ge(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Ge(c)?[c]:c);d&&(this.language||s(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,g=>{o(g,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(i),r}getFixedT(i,a,r,s){const o=s?.scopeNs,f=(c,p,...d)=>{let g;typeof p!="object"?g=this.options.overloadTranslationOptionHandler([c,p].concat(d)):g={...p},g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs;const m=g.ns!==void 0&&g.ns!==null;g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||r||f.keyPrefix);const y={...this.options,...g};Array.isArray(o)&&!m&&(y.ns=o),typeof g.keyPrefix=="function"&&(g.keyPrefix=Hl(g.keyPrefix,y));const v=this.options.keySeparator||".";let N;return g.keyPrefix&&Array.isArray(c)?N=c.map(M=>(typeof M=="function"&&(M=Hl(M,y)),`${g.keyPrefix}${v}${M}`)):(typeof c=="function"&&(c=Hl(c,y)),N=g.keyPrefix?`${g.keyPrefix}${v}${c}`:c),this.t(N,g)};return Ge(i)?f.lng=i:f.lngs=i,f.ns=a,f.keyPrefix=r,f}t(...i){return this.translator?.translate(...i)}exists(...i){return this.translator?.exists(...i)}setDefaultNamespace(i){this.options.defaultNS=i}hasLoadedNamespace(i,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=a.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const f=(c,p)=>{const d=this.services.backendConnector.state[`${c}|${p}`];return d===-1||d===0||d===2};if(a.precheck){const c=a.precheck(this,f);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(r,i)&&(!s||f(o,i)))}loadNamespaces(i,a){const r=Gs();return this.options.ns?(Ge(i)&&(i=[i]),i.forEach(s=>{this.options.ns.includes(s)||this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),a&&a(s)}),r):(a&&a(),Promise.resolve())}loadLanguages(i,a){const r=Gs();Ge(i)&&(i=[i]);const s=this.options.preload||[],o=i.filter(f=>!s.includes(f)&&this.services.languageUtils.isSupportedCode(f));return o.length?(this.options.preload=s.concat(o),this.loadResources(f=>{r.resolve(),a&&a(f)}),r):(a&&a(),Promise.resolve())}dir(i){if(i||(i=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!i)return"rtl";try{const s=new Intl.Locale(i);if(s&&s.getTextInfo){const o=s.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new E0(uh());return i.toLowerCase().indexOf("-latn")>1?"ltr":a.includes(r.getLanguagePartFromCode(i))||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(i={},a){const r=new no(i,a);return r.createInstance=no.createInstance,r}cloneInstance(i={},a=Iu){const r=i.forkResourceStore;r&&delete i.forkResourceStore;const s={...this.options,...i,isClone:!0},o=new no(s);if((i.debug!==void 0||i.prefix!==void 0)&&(o.logger=o.logger.clone(i)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const c=Object.keys(this.store.data).reduce((p,d)=>(p[d]={...this.store.data[d]},p[d]=Object.keys(p[d]).reduce((g,m)=>(g[m]={...p[d][m]},g),p[d]),p),{});o.store=new C0(c,s),o.services.resourceStore=o.store}if(i.interpolation){const p={...uh().interpolation,...this.options.interpolation,...i.interpolation},d={...s,interpolation:p};o.services.interpolator=new j0(d)}return o.translator=new rc(o.services,s),o.translator.on("*",(c,...p)=>{o.emit(c,...p)}),o.init(s,a),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Be=no.createInstance();Be.createInstance;Be.dir;Be.init;Be.loadResources;Be.reloadResources;Be.use;Be.changeLanguage;Be.getFixedT;Be.t;Be.exists;Be.setDefaultNamespace;Be.hasLoadedNamespace;Be.loadNamespaces;Be.loadLanguages;const HN=(e,i,a,r)=>{const s=[a,{code:i,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);$r(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...s):console?.warn&&console.warn(...s)},O0={},Zh=(e,i,a,r)=>{$r(a)&&O0[a]||($r(a)&&(O0[a]=new Date),HN(e,i,a,r))},ty=(e,i)=>()=>{if(e.isInitialized)i();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),i()};e.on("initialized",a)}},Wh=(e,i,a)=>{e.loadNamespaces(i,ty(e,a))},_0=(e,i,a,r)=>{if($r(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(i)>-1)return Wh(e,a,r);a.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(i,ty(e,r))},UN=(e,i,a={})=>!i.languages||!i.languages.length?(Zh(i,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:i.languages}),!0):i.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,s)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),$r=e=>typeof e=="string",PN=e=>typeof e=="object"&&e!==null,qN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,GN={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},VN=e=>GN[e],KN=e=>e.replace(qN,VN);let ep={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:KN,transDefaultProps:void 0};const YN=(e={})=>{ep={...ep,...e}},QN=()=>ep;let ny;const JN=e=>{ny=e},XN=()=>ny,ZN={type:"3rdParty",init(e){YN(e.options.react),JN(e)}},WN=C.createContext();class e2{constructor(){this.usedNamespaces={}}addUsedNamespaces(i){i.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ch={exports:{}},fh={};var F0;function t2(){if(F0)return fh;F0=1;var e=wc();function i(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var a=typeof Object.is=="function"?Object.is:i,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,f=e.useDebugValue;function c(m,y){var v=y(),N=r({inst:{value:v,getSnapshot:y}}),M=N[0].inst,D=N[1];return o(function(){M.value=v,M.getSnapshot=y,p(M)&&D({inst:M})},[m,v,y]),s(function(){return p(M)&&D({inst:M}),m(function(){p(M)&&D({inst:M})})},[m]),f(v),v}function p(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!a(m,v)}catch{return!0}}function d(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,fh}var B0;function n2(){return B0||(B0=1,ch.exports=t2()),ch.exports}var i2=n2();const a2=(e,i)=>{if($r(i))return i;if(PN(i)&&$r(i.defaultValue))return i.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const a=e[e.length-1];return typeof a=="function"?"":a}return e},r2={t:a2,ready:!1},l2=()=>()=>{},Gt=(e,i={})=>{const{i18n:a}=i,{i18n:r,defaultNS:s}=C.useContext(WN)||{},o=a||r||XN();o&&!o.reportNamespaces&&(o.reportNamespaces=new e2),o||Zh(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const f=C.useMemo(()=>({...QN(),...o?.options?.react,...i}),[o,i]),{useSuspense:c,keyPrefix:p}=f,d=e||s||o?.options?.defaultNS,g=$r(d)?[d]:d||["translation"],m=C.useMemo(()=>g,g);o?.reportNamespaces?.addUsedNamespaces?.(m);const y=C.useRef(0),v=C.useCallback(K=>{if(!o)return l2;const{bindI18n:j,bindI18nStore:P}=f,q=()=>{y.current+=1,K()};return j&&o.on(j,q),P&&o.store.on(P,q),()=>{j&&j.split(" ").forEach(W=>o.off(W,q)),P&&P.split(" ").forEach(W=>o.store.off(W,q))}},[o,f]),N=C.useRef(),M=C.useCallback(()=>{if(!o)return r2;const K=!!(o.isInitialized||o.initializedStoreOnce)&&m.every(ae=>UN(ae,o,f)),j=i.lng||o.language,P=y.current,q=N.current;if(q&&q.ready===K&&q.lng===j&&q.keyPrefix===p&&q.revision===P)return q;const H={t:o.getFixedT(j,f.nsMode==="fallback"?m:m[0],p,{scopeNs:m}),ready:K,lng:j,keyPrefix:p,revision:P};return N.current=H,H},[o,m,p,f,i.lng]),[D,k]=C.useState(0),{t:U,ready:T}=i2.useSyncExternalStore(v,M,M);C.useEffect(()=>{if(o&&!T&&!c){const K=()=>k(j=>j+1);i.lng?_0(o,i.lng,m,K):Wh(o,m,K)}},[o,i.lng,m,T,c,D]);const Q=o||{},ee=C.useRef(null),R=C.useRef(),F=K=>{const j=Object.getOwnPropertyDescriptors(K);j.__original&&delete j.__original;const P=Object.create(Object.getPrototypeOf(K),j);if(!Object.prototype.hasOwnProperty.call(P,"__original"))try{Object.defineProperty(P,"__original",{value:K,writable:!1,enumerable:!1,configurable:!1})}catch{}return P},I=C.useMemo(()=>{const K=Q,j=K?.language;let P=K;K&&(ee.current&&ee.current.__original===K?R.current!==j?(P=F(K),ee.current=P,R.current=j):P=ee.current:(P=F(K),ee.current=P,R.current=j));const q=!T&&!c?(...H)=>(Zh(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),U(...H)):U,W=[q,P,T];return W.t=q,W.i18n=P,W.ready=T,W},[U,Q,T,Q.resolvedLanguage,Q.language,Q.languages]);if(o&&c&&!T)throw new Promise(K=>{const j=()=>K();i.lng?_0(o,i.lng,m,j):Wh(o,m,j)});return I},s2=/\sid="(\S+)"/g,R0=new Map;function o2(e){e=e.replace(/[0-9]+$/,"")||"a";const i=R0.get(e)||0;return R0.set(e,i+1),i?`${e}${i}`:e}function u2(e){const i=[];let a;for(;a=s2.exec(e);)i.push(a[1]);if(!i.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return i.forEach(s=>{const o=o2(s),f=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+f+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const c2=Object.freeze({left:0,top:0,width:16,height:16}),lc=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),iy=Object.freeze({...c2,...lc}),f2=Object.freeze({...iy,body:"",hidden:!1}),d2=/(-?[0-9.]*[0-9]+[0-9.]*)/g,h2=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function sc(e,i,a){if(i===1)return e;if(a=a||100,typeof e=="number")return Math.ceil(e*i*a)/a;if(typeof e!="string")return e;const r=e.split(d2);if(r===null||!r.length)return e;const s=[];let o=r.shift(),f=h2.test(o);for(;;){if(f){const c=parseFloat(o);isNaN(c)?s.push(o):s.push(Math.ceil(c*i*a)/a)}else s.push(o);if(o=r.shift(),o===void 0)return s.join("");f=!f}}const p2=Object.freeze({width:null,height:null}),m2=Object.freeze({...p2,...lc});function g2(e,i="defs"){let a="";const r=e.indexOf("<"+i);for(;r>=0;){const s=e.indexOf(">",r),o=e.indexOf("</"+i);if(s===-1||o===-1)break;const f=e.indexOf(">",o);if(f===-1)break;a+=e.slice(s+1,o).trim(),e=e.slice(0,r).trim()+e.slice(f+1)}return{defs:a,content:e}}function x2(e,i){return e?"<defs>"+e+"</defs>"+i:i}function b2(e,i,a){const r=g2(e);return x2(r.defs,i+r.content+a)}const y2=e=>e==="unset"||e==="undefined"||e==="none";function v2(e,i){const a={...iy,...e},r={...m2,...i},s={left:a.left,top:a.top,width:a.width,height:a.height};let o=a.body;[a,r].forEach(M=>{const D=[],k=M.hFlip,U=M.vFlip;let T=M.rotate;k?U?T+=2:(D.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),D.push("scale(-1 1)"),s.top=s.left=0):U&&(D.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),D.push("scale(1 -1)"),s.top=s.left=0);let Q;switch(T<0&&(T-=Math.floor(T/4)*4),T=T%4,T){case 1:Q=s.height/2+s.top,D.unshift("rotate(90 "+Q.toString()+" "+Q.toString()+")");break;case 2:D.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:Q=s.width/2+s.left,D.unshift("rotate(-90 "+Q.toString()+" "+Q.toString()+")");break}T%2===1&&(s.left!==s.top&&(Q=s.left,s.left=s.top,s.top=Q),s.width!==s.height&&(Q=s.width,s.width=s.height,s.height=Q)),D.length&&(o=b2(o,'<g transform="'+D.join(" ")+'">',"</g>"))});const f=r.width,c=r.height,p=s.width,d=s.height;let g,m;f===null?(m=c===null?"1em":c==="auto"?d:c,g=sc(m,p/d)):(g=f==="auto"?p:f,m=c===null?sc(g,d/p):c==="auto"?d:c);const y={},v=(M,D)=>{y2(D)||(y[M]=D.toString())};v("width",g),v("height",m);const N=[s.left,s.top,p,d];return y.viewBox=N.join(" "),{attributes:y,viewBox:N,body:o}}function L0(e){return u2(typeof e=="string"?e:v2(e).body)}let io;function S2(){try{io=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{io=null}}function N2(e){return io===void 0&&S2(),io?io.createHTML(e):e}function w2(e){return`${e.left??0} ${e.top??0} ${e.width} ${e.height}`}function C2(e,i,a){const r=typeof a=="object"?w2(a):void 0,s=typeof a=="number"?a:a.width/a.height;return e&&i?{width:e,height:i,viewBox:r}:i?{width:sc(i,s),height:i,viewBox:r}:e?{width:e,height:sc(e,1/s),viewBox:r}:{viewBox:r}}const tp=Object.create(null),E2=Object.create(null);function k2(e,i){tp[e]=i}function A2(e,i){return e?tp[e]:E2[i]||tp[""]}const dh=new Set;let hh=!1;function z0(e){try{const i=e();i instanceof Promise&&i.catch(a=>{console.error(a)})}catch(i){console.error(i)}}function ay(e,i=!1){if(i){z0(e);return}dh.add(e),hh||(hh=!0,setTimeout(()=>{hh=!1;const a=Array.from(dh);dh.clear(),a.forEach(z0)}))}function M2(){const e=new Set;let i=!1;const a=Object.create(null),r=new Set,s=new Set,o=[];function f(c,p){if(s.delete(c),p){if(a[c]===p)return;a[c]=p,r.delete(c)}else{if(r.has(c))return;delete a[c],r.add(c)}e.add(c),i||(i=!0,setTimeout(()=>{i=!1,o.forEach(d=>{for(const g of d.names)if(g==="*"||e.has(g)){ay(d.callback);return}}),e.clear()}))}return{icons:a,missing:r,pending:s,subscribers:o,update:f}}const I0=Object.create(null);function Sp(e,i){const a=I0[e]||(I0[e]=Object.create(null));return a[i]||(a[i]=M2())}function j2(e,i){const a={};!e.hFlip!=!i.hFlip&&(a.hFlip=!0),!e.vFlip!=!i.vFlip&&(a.vFlip=!0);const r=((e.rotate||0)+(i.rotate||0))%4;return r&&(a.rotate=r),a}function $0(e,i){const a=j2(e,i);for(const r in f2)r in lc?r in e&&!(r in a)&&(a[r]=lc[r]):r in i?a[r]=i[r]:r in e&&(a[r]=e[r]);return a}function T2(e,i){const a=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function o(f){if(a[f])return s[f]=[];if(!(f in s)){s[f]=null;const c=r[f]&&r[f].parent,p=c&&o(c);p&&(s[f]=[c].concat(p))}return s[f]}return Object.keys(a).concat(Object.keys(r)).forEach(o),s}function D2(e,i,a){const r=e.icons,s=e.aliases||Object.create(null);let o={};function f(c){o=$0(r[c]||s[c],o)}return f(i),a.forEach(f),$0(e,o)}function O2(e,i){const a=[];if(typeof e!="object"||typeof e.icons!="object")return a;e.not_found instanceof Array&&e.not_found.forEach(s=>{i(s,null),a.push(s)});const r=T2(e);for(const s in r){const o=r[s];o&&(i(s,D2(e,s,o)),a.push(s))}return a}function _2(e,i=""){const a=new Set,r=Sp(i,e.prefix);return O2(e,(s,o)=>{r.update(s,o),a.add(s)}),a}const ry=/^[a-z0-9]+(-[a-z0-9]+)*$/,ly=(e,i,a,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const c=s.pop(),p=s.pop();return{provider:s.length>0?s[0]:r,prefix:p,name:c}}const f=s[0].split("-");return f.length>1?{provider:r,prefix:f.shift(),name:f.join("-")}:null},H0=new Map,F2=750;let B2=fetch;function R2(e,i,a,r){const s=e.join(","),o=H0.get(s)||0,f=e.length;r=r||new AbortController,a=a||{},a.signal=r.signal;const c=[];for(let p=0;p<f;p++){const d=p,g=(o+d)%f,m=`${e[g]}${i}`,y=async()=>{for(let M=0;M<d;M++)if(await new Promise(D=>setTimeout(D,F2)),r.signal.aborted)throw new Error("Fetch aborted");const v=await B2(m,a);if(!v.ok)throw new Error(`HTTP error! status: ${v.status}`);const N=await v.json();return H0.set(s,g),r.abort(),N};c.push(y())}return Promise.any(c)}function L2(e,i,a=!0){const r=Array.isArray(e)?e:[e],s=a&&(typeof window>"u"||!window.document);return{maxCount:32,maxLength:480,validateNames:!0,hosts:r,loadIcons:async(o,f)=>s||!ry.test(f)?{prefix:f,icons:Object.create(null),not_found:o}:await R2(r,`/${f}.json?icons=${o.join(",")}`,i)}}function z2(e,i){for(const a in i){const r=i[a],s=e[a]||(e[a]=Object.create(null));for(const o in r){const f=r[o];s[o]?.length?s[o]=Array.from(new Set([...f,...s[o]])):s[o]=f.slice(0)}}}function I2(e,i){const a=Object.create(null);for(const r of e){const s=typeof r=="string"?ly(r):r;if(s){const o=a[s.provider]||(a[s.provider]=Object.create(null)),f=o[s.prefix]||(o[s.prefix]=[]);f.includes(s.name)||f.push(s.name)}}return a}function $2(e,i){const{maxCount:a,maxLength:r}=i;e.sort((c,p)=>c.localeCompare(p));const s=[];let o=[],f=0;for(const c of e){const p=c.length+1;f&&(r&&f+p>r||a&&o.length>=a)&&(s.push(o),o=[],f=0),f+=p,o.push(c)}return o.length>0&&s.push(o),s}let np=Object.create(null);function H2(){const e=np;np=Object.create(null);for(const i in e){const a=e[i];for(const r in a){const s=a[r];if(s.length){const o=Sp(i,r),f=A2(i,r),c=f?.allowReload??!1,p=f?.validateNames??!0,d=[];if(s.forEach(g=>{if(!o.pending.has(g)&&!((o.icons[g]||o.missing.has(g))&&!c)){if(!f||p&&!ry.test(g)){o.update(g,null);return}d.push(g),o.pending.add(g)}}),f&&d.length){const g=[];if("loadIcon"in f)for(const m of d)g.push(new Promise(y=>{f.loadIcon(m,i,r).then(v=>{o.update(m,v),y()}).catch(()=>{o.update(m,null),y()})}));else{const m=$2(d,f);for(const y of m){const v=N=>{const M=N?_2(N,i):new Set;for(const D of y)M.has(D)||o.update(D,null)};g.push(new Promise(N=>{f.loadIcons(y,r,i).then(M=>{v(M),N()}).catch(()=>{v(),N()})}))}}Promise.all(g).catch(console.error)}}}}}function U2(e,i=!1){const a=Array.isArray(e)?I2(e):e;z2(np,a),ay(H2,i)}function ip(e,i){const a=e.subscribers.findIndex(r=>r.key===i);a!==-1&&e.subscribers.splice(a,1)}function P2(e,i,a,r){r&&ip(e,r),r=r||Symbol();const s={key:r,names:new Set(i),callback:a};return e.subscribers.push(s),r}function q2(e,i){const a=Symbol();let r=!1,s=!1,o=null,f=null,c;const p=()=>{if(!f||!o){c!==null&&(c=null,s&&i(null));return}const g=o.name,m=f.icons[g]||(f.missing.has(g)?null:void 0);m===void 0&&!f.pending.has(g)&&U2({[o.provider]:{[o.prefix]:[g]}}),c!==m&&(c=m,s&&i(c))},d=g=>{if(r)return;f&&ip(f,a);const m=typeof g=="string"?ly(g):{...g};if(m&&"body"in m){o=null,c=m,f=null;return}o=m,o?(f=Sp(o.provider,o.prefix),P2(f,[o.name],p),p()):(f=null,p())};return d(e),s=!0,{unsubscribe:()=>{r=!0,f&&ip(f,a)},change:d,data:c}}function G2(){try{return window.CSS.supports('d: path("M0 0")')}catch{return!0}}const V2=G2();k2("",L2(["https://api.iconify.design","https://api.simplesvg.com","https://api.unisvg.com"]));function Vt({content:e,fallback:i,width:a,height:r,viewBox:s,...o}){const[f,c]=C.useState(null),[p,d]=C.useState(null),g=C.useMemo(()=>L0(e||""),[e]),m=C.useMemo(()=>V2&&e?"":i||"",[e,i]);C.useEffect(()=>{const M=q2(m,c);return c(M.data),d(M),M.unsubscribe},[]),C.useEffect(()=>{p?.change(m)},[m]);const y=C.useMemo(()=>f?L0(f):"",[f]),v=C.useMemo(()=>C2(a,r,s),[a,r,s]),N=C.useMemo(()=>({__html:N2(y||g)}),[y,g]);return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",...v,...o,dangerouslySetInnerHTML:N})}const K2={width:24,height:24};function Y2({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:K2,content:'<g class="nrj6p8qat"><rect class="gufd03s5p"/><rect class="y2ls4efbx"/><rect class="td4pmbm2c"/><rect class="velahuttd"/></g>',fallback:"lucide:layout-grid"})}const Q2={width:24,height:24};function J2({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Q2,content:'<path class="e07hgxwrx"/>',fallback:"lucide:list"})}const Mn="block w-full min-w-0 max-w-full overflow-auto border border-[#29414f] bg-[rgba(18,31,38,0.9)] px-2 py-2 text-[var(--text)] shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(24,39,47,0.92)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",gn="block w-full min-w-0 max-w-full overflow-auto border border-[#29414f] bg-[rgba(18,31,38,0.9)] px-2 py-2 text-[var(--text)] font-[JetBrains_Mono,monospace] shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(24,39,47,0.92)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",Ws="block w-full min-w-0 max-w-full overflow-auto border border-[#29414f] bg-[rgba(12,21,27,0.96)] px-2 py-2 text-[var(--text)] font-[JetBrains_Mono,monospace] shadow-[inset_0_1px_0_rgba(255,255,255,0.025)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(16,27,34,0.98)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",ph="block w-full min-w-0 max-w-full overflow-hidden border border-[#29414f] bg-[rgba(18,31,38,0.9)] px-2 py-2 text-ellipsis whitespace-nowrap text-[var(--text)] shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(24,39,47,0.92)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",ap="block w-full min-w-0 max-w-full overflow-hidden border border-[#29414f] bg-[rgba(18,31,38,0.9)] px-2 py-2 text-ellipsis whitespace-nowrap text-[var(--text)] font-[JetBrains_Mono,monospace] shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(24,39,47,0.92)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",oc="block w-full min-w-full max-w-full resize-y overflow-auto overflow-wrap-anywhere break-words border border-[#29414f] bg-[rgba(18,31,38,0.9)] px-2 py-2 text-[var(--text)] font-[JetBrains_Mono,monospace] shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] outline-none transition-[border-color,background-color,box-shadow] focus-visible:border-[#3b5868] focus-visible:bg-[rgba(24,39,47,0.92)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",ao="fixed inset-0 z-[var(--z-modal-mask)] bg-[rgba(5,10,14,0.62)] transition-opacity duration-200",ro="pointer-events-auto opacity-100",Zu="pointer-events-none opacity-0",lo="fixed inset-0 z-[var(--z-modal)] grid place-items-center transition-opacity duration-200",so="pointer-events-auto opacity-100",Wu="pointer-events-none opacity-0",Ec="overflow-auto border border-[var(--line)] bg-[linear-gradient(180deg,var(--panel)_0%,var(--panel-2)_100%)] ",ni="inline-flex h-8 w-8 appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0 text-[var(--text)] shadow-none outline-none transition-[background-color,color] hover:bg-[rgba(142,163,179,0.08)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",Li="m-0 mx-3 mb-[10px] text-xs text-[var(--muted)]",X2=e=>e.trim().toLowerCase();function Z2(e,i){const a=X2(i);return a?e.filter(r=>[r.id,r.role,r.outputPreview,r.eventPreview].join(" ").toLowerCase().includes(a)):e}const fa="font-[JetBrains_Mono,monospace]",U0="inline-flex w-fit items-center rounded-none px-2 py-[2px] text-[12px] uppercase",P0={busy:"bg-[rgba(255,184,77,0.16)] text-[var(--warn)]",idle:"bg-[rgba(50,215,186,0.15)] text-[var(--live)]"},q0="mt-0 inline-flex h-8 items-center justify-center border border-(--line) bg-[rgba(15,23,29,0.6)] px-3 text-xs text-(--text) hover:bg-[rgba(19,34,43,0.82)]",G0="mt-0 inline-flex h-8 items-center justify-center border border-(--live-25) bg-[rgba(50,215,186,0.1)] px-3 text-xs font-semibold text-(--live) hover:bg-[rgba(50,215,186,0.18)]",W2="mt-0 inline-flex h-8 w-8 items-center justify-center border border-(--line) bg-[rgba(15,23,29,0.6)] text-(--text) hover:bg-[rgba(19,34,43,0.82)]",ew="inline-flex h-8 items-stretch overflow-hidden border border-(--line) bg-[rgba(15,23,29,0.6)]",mh="mt-0 inline-flex h-full appearance-none items-center justify-center border-0 border-r border-(--line) bg-transparent px-3 text-xs text-(--text) last:border-r-0 hover:bg-[rgba(19,34,43,0.82)]",gh="!bg-[rgba(50,215,186,0.2)] !text-(--live) font-semibold shadow-[inset_0_0_0_1px_rgba(50,215,186,0.45)]",$u="bg-[rgba(9,15,21,0.1)] [background-image:repeating-linear-gradient(-45deg,rgba(150,170,190,0.07)_0,rgba(150,170,190,0.07)_2px,transparent_2px,transparent_8px)]";function tw({agents:e,onOpenAgentSession:i,onOpenAgentOutput:a}){const[r,s]=C.useState(""),[o,f]=C.useState("all"),[c,p]=C.useState("card"),{t:d}=Gt("agent"),g=C.useMemo(()=>{const m=Z2(e,r);return o==="all"?m:m.filter(y=>y.workStatus===o)},[e,r,o]);return x.jsxs("section",{"data-center-card":!0,"data-agent-card":!0,className:"grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[x.jsx("div",{className:`flex h-[66px] items-center border-b border-(--line) ${$u}`,children:x.jsxs("div",{className:"flex w-full items-center gap-0 overflow-hidden px-8",children:[x.jsx("input",{className:`${Mn} m-0 h-8 min-w-[260px] flex-[1_1_420px] py-0 leading-none`,value:r,onChange:m=>s(m.target.value),placeholder:d("searchPlaceholder"),"aria-label":d("searchLabel")}),x.jsx("span",{className:`${$u} h-8 w-4 shrink-0`,"aria-hidden":"true"}),x.jsxs("div",{className:ew,role:"group","aria-label":d("statusFilter"),children:[x.jsx("button",{type:"button",className:`${mh} ${o==="all"?gh:""}`,onClick:()=>f("all"),children:d("all")}),x.jsx("button",{type:"button",className:`${mh} ${o==="busy"?gh:""}`,onClick:()=>f("busy"),children:d("busy")}),x.jsx("button",{type:"button",className:`${mh} ${o==="idle"?gh:""}`,onClick:()=>f("idle"),children:d("idle")})]}),x.jsx("span",{className:`${$u} h-8 w-4 shrink-0`,"aria-hidden":"true"}),x.jsx("button",{type:"button",className:W2,onClick:()=>p(m=>m==="card"?"list":"card"),"aria-label":d(c==="card"?"switchToList":"switchToCard"),title:d(c==="card"?"switchToList":"switchToCard"),children:c==="card"?x.jsx(J2,{className:"h-4 w-4"}):x.jsx(Y2,{className:"h-4 w-4"})}),x.jsx("span",{className:`${$u} h-8 w-4 shrink-0`,"aria-hidden":"true"}),x.jsxs("span",{className:`${fa} ml-auto text-xs text-(--muted)`,children:[g.length,"/",e.length]})]})}),x.jsx("div",{className:"min-h-0 overflow-y-auto",children:g.length&&c==="card"?x.jsx("ul",{className:"m-0 grid list-none grid-cols-[repeat(auto-fill,minmax(310px,1fr))] gap-3 p-3",children:g.map(m=>x.jsx("li",{className:"m-0 min-w-0",children:x.jsxs("div",{className:"grid min-h-[238px] grid-rows-[auto_auto_1fr_auto] gap-2 border border-[#29414f] bg-[linear-gradient(180deg,rgba(18,31,38,0.92)_0%,rgba(14,24,30,0.92)_100%)] p-3 text-left text-(--text)",role:"button",tabIndex:0,onClick:()=>i(m.id),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i(m.id))},children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsx("strong",{className:"truncate text-sm",children:m.id}),x.jsx("span",{className:`${U0} ${P0[m.workStatus==="busy"?"busy":"idle"]}`,children:m.workStatus==="busy"?d("busy"):d("idle")})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[x.jsxs("div",{className:"border border-(--line) bg-[rgba(10,18,24,0.65)] px-2 py-1.5",children:[x.jsx("p",{className:"m-0 text-[10px] text-(--muted)",children:d("role")}),x.jsx("p",{className:`${fa} m-0 mt-0.5 truncate text-xs text-(--text)`,children:m.role})]}),x.jsxs("div",{className:"border border-(--line) bg-[rgba(10,18,24,0.65)] px-2 py-1.5",children:[x.jsx("p",{className:"m-0 text-[10px] text-(--muted)",children:d("recentNode")}),x.jsx("p",{className:`${fa} m-0 mt-0.5 truncate text-xs text-(--text)`,children:m.lastExecution?.nodeId??"-"})]})]}),x.jsxs("div",{className:"grid content-start gap-1 border border-(--line) bg-[rgba(10,18,24,0.65)] p-2",children:[x.jsx("small",{className:`${fa} text-xs text-(--muted)`,children:d("outputPreview")}),x.jsx("p",{className:"m-0 min-h-[calc(1.35em*2)] overflow-hidden text-xs leading-[1.35] text-[var(--muted)] [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] break-words",children:m.outputPreview||d("noOutput")}),x.jsx("small",{className:`${fa} text-xs text-(--muted)`,children:d("eventPreview")}),x.jsx("p",{className:"m-0 min-h-[calc(1.35em*2)] overflow-hidden text-xs leading-[1.35] text-[var(--muted)] [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2] break-words",children:m.eventPreview||d("noEvent")})]}),x.jsxs("div",{className:"mt-auto grid gap-2 border-t border-(--line) pt-2",children:[x.jsx("small",{className:`${fa} self-end text-xs leading-[1.2] text-[var(--muted)]`,children:m.lastActiveAt?new Date(m.lastActiveAt).toLocaleString(void 0,{hour12:!1}):"-"}),x.jsxs("div",{className:"flex items-center justify-end gap-2",children:[x.jsx("button",{className:q0,type:"button",onClick:y=>{y.stopPropagation(),a(m.id)},children:d("viewOutput")}),x.jsx("button",{className:G0,type:"button",onClick:y=>{y.stopPropagation(),i(m.id)},children:d("openSession")})]})]})]})},m.id))}):g.length&&c==="list"?x.jsx("div",{className:"px-0 py-0",children:x.jsx("ul",{className:"m-0 list-none p-0",children:g.map(m=>x.jsxs("li",{className:"grid cursor-pointer grid-cols-[minmax(140px,220px)_96px_minmax(160px,1fr)_minmax(120px,1fr)_170px_auto] items-center gap-2 border-b border-(--line) px-2.5 py-2 text-sm text-(--text) transition-colors hover:bg-[rgba(19,34,43,0.55)] last:border-b-0",role:"button",tabIndex:0,onClick:()=>i(m.id),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i(m.id))},children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:"m-0 truncate font-semibold",children:m.id}),x.jsx("p",{className:`${fa} m-0 mt-0.5 truncate text-xs text-(--muted)`,children:m.role})]}),x.jsx("span",{className:`${U0} ${P0[m.workStatus==="busy"?"busy":"idle"]}`,children:m.workStatus==="busy"?d("busy"):d("idle")}),x.jsx("p",{className:"m-0 truncate text-xs text-(--muted)",children:m.outputPreview||d("noOutput")}),x.jsx("p",{className:"m-0 truncate text-xs text-(--muted)",children:m.eventPreview||d("noEvent")}),x.jsx("p",{className:`${fa} m-0 text-xs text-(--muted)`,children:m.lastActiveAt?new Date(m.lastActiveAt).toLocaleString(void 0,{hour12:!1}):"-"}),x.jsxs("div",{className:"flex items-center justify-end gap-2",children:[x.jsx("button",{className:q0,type:"button",onClick:y=>{y.stopPropagation(),a(m.id)},children:d("viewOutput")}),x.jsx("button",{className:G0,type:"button",onClick:y=>{y.stopPropagation(),i(m.id)},children:d("openSession")})]})]},m.id))})}):x.jsx("p",{className:`${fa} m-0 px-3 pt-3 pb-2 text-[var(--muted)]`,children:d("noMatch")})})]})}function nw(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const iw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rw={};function V0(e,i){return(rw.jsx?aw:iw).test(e)}const lw=/[ \t\n\f\r]/g;function sw(e){return typeof e=="object"?e.type==="text"?K0(e.value):!1:K0(e)}function K0(e){return e.replace(lw,"")===""}class bo{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}bo.prototype.normal={};bo.prototype.property={};bo.prototype.space=void 0;function sy(e,i){const a={},r={};for(const s of e)Object.assign(a,s.property),Object.assign(r,s.normal);return new bo(a,r,i)}function rp(e){return e.toLowerCase()}class Gn{constructor(i,a){this.attribute=a,this.property=i}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let ow=0;const We=Pr(),un=Pr(),lp=Pr(),ye=Pr(),Bt=Pr(),Ul=Pr(),ti=Pr();function Pr(){return 2**++ow}const sp=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:un,commaOrSpaceSeparated:ti,commaSeparated:Ul,number:ye,overloadedBoolean:lp,spaceSeparated:Bt},Symbol.toStringTag,{value:"Module"})),xh=Object.keys(sp);class Np extends Gn{constructor(i,a,r,s){let o=-1;if(super(i,a),Y0(this,"space",s),typeof r=="number")for(;++o<xh.length;){const f=xh[o];Y0(this,xh[o],(r&sp[f])===sp[f])}}}Np.prototype.defined=!0;function Y0(e,i,a){a&&(e[i]=a)}function ql(e){const i={},a={};for(const[r,s]of Object.entries(e.properties)){const o=new Np(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),i[r]=o,a[rp(r)]=r,a[rp(o.attribute)]=r}return new bo(i,a,e.space)}const oy=ql({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:Bt,ariaCurrent:null,ariaDescribedBy:Bt,ariaDetails:null,ariaDisabled:un,ariaDropEffect:Bt,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:Bt,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Bt,ariaLevel:ye,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:Bt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:Bt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:un,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function uy(e,i){return i in e?e[i]:i}function cy(e,i){return uy(e,i.toLowerCase())}const uw=ql({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ul,acceptCharset:Bt,accessKey:Bt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:Bt,autoFocus:We,autoPlay:We,blocking:Bt,capture:null,charSet:null,checked:We,cite:null,className:Bt,cols:ye,colSpan:null,content:null,contentEditable:un,controls:We,controlsList:Bt,coords:ye|Ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:lp,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:Bt,height:ye,hidden:lp,high:ye,href:null,hrefLang:null,htmlFor:Bt,httpEquiv:Bt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:Bt,itemRef:Bt,itemScope:We,itemType:Bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:We,optimum:ye,pattern:null,ping:Bt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:Bt,required:We,reversed:We,rows:ye,rowSpan:ye,sandbox:Bt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:un,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Bt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:cy}),cw=ql({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ti,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:Bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ul,g2:Ul,glyphName:Ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:uy}),fy=ql({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),dy=ql({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:cy}),hy=ql({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),fw={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},dw=/[A-Z]/g,Q0=/-[a-z]/g,hw=/^data[-\w.:]+$/i;function pw(e,i){const a=rp(i);let r=i,s=Gn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&hw.test(i)){if(i.charAt(4)==="-"){const o=i.slice(5).replace(Q0,gw);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=i.slice(4);if(!Q0.test(o)){let f=o.replace(dw,mw);f.charAt(0)!=="-"&&(f="-"+f),i="data"+f}}s=Np}return new s(r,i)}function mw(e){return"-"+e.toLowerCase()}function gw(e){return e.charAt(1).toUpperCase()}const xw=sy([oy,uw,fy,dy,hy],"html"),wp=sy([oy,cw,fy,dy,hy],"svg");function bw(e){return e.join(" ").trim()}var Ml={},bh,J0;function yw(){if(J0)return bh;J0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,c=/^\s+|\s+$/g,p=`
10
+ `,d="/",g="*",m="",y="comment",v="declaration";function N(D,k){if(typeof D!="string")throw new TypeError("First argument must be a string");if(!D)return[];k=k||{};var U=1,T=1;function Q(H){var ae=H.match(i);ae&&(U+=ae.length);var E=H.lastIndexOf(p);T=~E?H.length-E:T+H.length}function ee(){var H={line:U,column:T};return function(ae){return ae.position=new R(H),K(),ae}}function R(H){this.start=H,this.end={line:U,column:T},this.source=k.source}R.prototype.content=D;function F(H){var ae=new Error(k.source+":"+U+":"+T+": "+H);if(ae.reason=H,ae.filename=k.source,ae.line=U,ae.column=T,ae.source=D,!k.silent)throw ae}function I(H){var ae=H.exec(D);if(ae){var E=ae[0];return Q(E),D=D.slice(E.length),ae}}function K(){I(a)}function j(H){var ae;for(H=H||[];ae=P();)ae!==!1&&H.push(ae);return H}function P(){var H=ee();if(!(d!=D.charAt(0)||g!=D.charAt(1))){for(var ae=2;m!=D.charAt(ae)&&(g!=D.charAt(ae)||d!=D.charAt(ae+1));)++ae;if(ae+=2,m===D.charAt(ae-1))return F("End of comment missing");var E=D.slice(2,ae-2);return T+=2,Q(E),D=D.slice(ae),T+=2,H({type:y,comment:E})}}function q(){var H=ee(),ae=I(r);if(ae){if(P(),!I(s))return F("property missing ':'");var E=I(o),_=H({type:v,property:M(ae[0].replace(e,m)),value:E?M(E[0].replace(e,m)):m});return I(f),_}}function W(){var H=[];j(H);for(var ae;ae=q();)ae!==!1&&(H.push(ae),j(H));return H}return K(),W()}function M(D){return D?D.replace(c,m):m}return bh=N,bh}var X0;function vw(){if(X0)return Ml;X0=1;var e=Ml&&Ml.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ml,"__esModule",{value:!0}),Ml.default=a;const i=e(yw());function a(r,s){let o=null;if(!r||typeof r!="string")return o;const f=(0,i.default)(r),c=typeof s=="function";return f.forEach(p=>{if(p.type!=="declaration")return;const{property:d,value:g}=p;c?s(d,g,p):g&&(o=o||{},o[d]=g)}),o}return Ml}var Vs={},Z0;function Sw(){if(Z0)return Vs;Z0=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(d){return!d||a.test(d)||e.test(d)},f=function(d,g){return g.toUpperCase()},c=function(d,g){return"".concat(g,"-")},p=function(d,g){return g===void 0&&(g={}),o(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(s,c):d=d.replace(r,c),d.replace(i,f))};return Vs.camelCase=p,Vs}var Ks,W0;function Nw(){if(W0)return Ks;W0=1;var e=Ks&&Ks.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},i=e(vw()),a=Sw();function r(s,o){var f={};return!s||typeof s!="string"||(0,i.default)(s,function(c,p){c&&p&&(f[(0,a.camelCase)(c,o)]=p)}),f}return r.default=r,Ks=r,Ks}var ww=Nw();const Cw=Nc(ww),py=my("end"),Cp=my("start");function my(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gy(e){const i=Cp(e),a=py(e);if(i&&a)return{start:i,end:a}}function oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?e1(e.position):"start"in e||"end"in e?e1(e):"line"in e||"column"in e?op(e):""}function op(e){return t1(e&&e.line)+":"+t1(e&&e.column)}function e1(e){return op(e&&e.start)+"-"+op(e&&e.end)}function t1(e){return e&&typeof e=="number"?e:1}class Tn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let s="",o={},f=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof i=="string"?s=i:!o.cause&&i&&(f=!0,s=i.message,o.cause=i),!o.ruleId&&!o.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?o.ruleId=r:(o.source=r.slice(0,p),o.ruleId=r.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=oo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=f&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tn.prototype.file="";Tn.prototype.name="";Tn.prototype.reason="";Tn.prototype.message="";Tn.prototype.stack="";Tn.prototype.column=void 0;Tn.prototype.line=void 0;Tn.prototype.ancestors=void 0;Tn.prototype.cause=void 0;Tn.prototype.fatal=void 0;Tn.prototype.place=void 0;Tn.prototype.ruleId=void 0;Tn.prototype.source=void 0;const Ep={}.hasOwnProperty,Ew=new Map,kw=/[A-Z]/g,Aw=new Set(["table","tbody","thead","tfoot","tr"]),Mw=new Set(["td","th"]),xy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jw(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Lw(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Rw(a,i.jsx,i.jsxs)}const s={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?wp:xw,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},o=by(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function by(e,i,a){if(i.type==="element")return Tw(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Dw(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return _w(e,i,a);if(i.type==="mdxjsEsm")return Ow(e,i);if(i.type==="root")return Fw(e,i,a);if(i.type==="text")return Bw(e,i)}function Tw(e,i,a){const r=e.schema;let s=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=wp,e.schema=s),e.ancestors.push(i);const o=vy(e,i.tagName,!1),f=zw(e,i);let c=Ap(e,i);return Aw.has(i.tagName)&&(c=c.filter(function(p){return typeof p=="string"?!sw(p):!0})),yy(e,f,o,i),kp(f,c),e.ancestors.pop(),e.schema=r,e.create(i,o,f,a)}function Dw(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}mo(e,i.position)}function Ow(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);mo(e,i.position)}function _w(e,i,a){const r=e.schema;let s=r;i.name==="svg"&&r.space==="html"&&(s=wp,e.schema=s),e.ancestors.push(i);const o=i.name===null?e.Fragment:vy(e,i.name,!0),f=Iw(e,i),c=Ap(e,i);return yy(e,f,o,i),kp(f,c),e.ancestors.pop(),e.schema=r,e.create(i,o,f,a)}function Fw(e,i,a){const r={};return kp(r,Ap(e,i)),e.create(i,e.Fragment,r,a)}function Bw(e,i){return i.value}function yy(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function kp(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function Rw(e,i,a){return r;function r(s,o,f,c){const d=Array.isArray(f.children)?a:i;return c?d(o,f,c):d(o,f)}}function Lw(e,i){return a;function a(r,s,o,f){const c=Array.isArray(o.children),p=Cp(r);return i(s,o,f,c,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function zw(e,i){const a={};let r,s;for(s in i.properties)if(s!=="children"&&Ep.call(i.properties,s)){const o=$w(e,s,i.properties[s]);if(o){const[f,c]=o;e.tableCellAlignToStyle&&f==="align"&&typeof c=="string"&&Mw.has(i.tagName)?r=c:a[f]=c}}if(r){const o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Iw(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const f=o.expression;f.type;const c=f.properties[0];c.type,Object.assign(a,e.evaluater.evaluateExpression(c.argument))}else mo(e,i.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else mo(e,i.position);else o=r.value===null?!0:r.value;a[s]=o}return a}function Ap(e,i){const a=[];let r=-1;const s=e.passKeys?new Map:Ew;for(;++r<i.children.length;){const o=i.children[r];let f;if(e.passKeys){const p=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(p){const d=s.get(p)||0;f=p+"-"+d,s.set(p,d+1)}}const c=by(e,o,f);c!==void 0&&a.push(c)}return a}function $w(e,i,a){const r=pw(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?nw(a):bw(a)),r.property==="style"){let s=typeof a=="object"?a:Hw(e,String(a));return e.stylePropertyNameCase==="css"&&(s=Uw(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?fw[r.property]||r.property:r.attribute,a]}}function Hw(e,i){try{return Cw(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,s=new Tn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=xy+"#cannot-parse-style-attribute",s}}function vy(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const s=i.split(".");let o=-1,f;for(;++o<s.length;){const c=V0(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};f=f?{type:"MemberExpression",object:f,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=f}else r=V0(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const s=r.value;return Ep.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);mo(e)}function mo(e,i){const a=new Tn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=xy+"#cannot-handle-mdx-estrees-without-createevaluater",a}function Uw(e){const i={};let a;for(a in e)Ep.call(e,a)&&(i[Pw(a)]=e[a]);return i}function Pw(e){let i=e.replace(kw,qw);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function qw(e){return"-"+e.toLowerCase()}const yh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Gw={};function Mp(e,i){const a=Gw,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,s=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Sy(e,r,s)}function Sy(e,i,a){if(Vw(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return n1(e.children,i,a)}return Array.isArray(e)?n1(e,i,a):""}function n1(e,i,a){const r=[];let s=-1;for(;++s<e.length;)r[s]=Sy(e[s],i,a);return r.join("")}function Vw(e){return!!(e&&typeof e=="object")}const i1=document.createElement("i");function jp(e){const i="&"+e+";";i1.innerHTML=i;const a=i1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function ii(e,i,a,r){const s=e.length;let o=0,f;if(i<0?i=-i>s?0:s+i:i=i>s?s:i,a=a>0?a:0,r.length<1e4)f=Array.from(r),f.unshift(i,a),e.splice(...f);else for(a&&e.splice(i,a);o<r.length;)f=r.slice(o,o+1e4),f.unshift(i,0),e.splice(...f),o+=1e4,i+=1e4}function gi(e,i){return e.length>0?(ii(e,e.length,0,i),e):i}const a1={}.hasOwnProperty;function Ny(e){const i={};let a=-1;for(;++a<e.length;)Kw(i,e[a]);return i}function Kw(e,i){let a;for(a in i){const s=(a1.call(e,a)?e[a]:void 0)||(e[a]={}),o=i[a];let f;if(o)for(f in o){a1.call(s,f)||(s[f]=[]);const c=o[f];Yw(s[f],Array.isArray(c)?c:c?[c]:[])}}}function Yw(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);ii(e,0,0,r)}function wy(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ei(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=tr(/[A-Za-z]/),jn=tr(/[\dA-Za-z]/),Qw=tr(/[#-'*+\--9=?A-Z^-~]/);function uc(e){return e!==null&&(e<32||e===127)}const up=tr(/\d/),Jw=tr(/[\dA-Fa-f]/),Xw=tr(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function Ft(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const kc=tr(new RegExp("\\p{P}|\\p{S}","u")),Hr=tr(/\s/);function tr(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Gl(e){const i=[];let a=-1,r=0,s=0;for(;++a<e.length;){const o=e.charCodeAt(a);let f="";if(o===37&&jn(e.charCodeAt(a+1))&&jn(e.charCodeAt(a+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(f=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(a+1);o<56320&&c>56319&&c<57344?(f=String.fromCharCode(o,c),s=1):f="�"}else f=String.fromCharCode(o);f&&(i.push(e.slice(r,a),encodeURIComponent(f)),r=a+s+1,f=""),s&&(a+=s,s=0)}return i.join("")+e.slice(r)}function gt(e,i,a,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return f;function f(p){return ut(p)?(e.enter(a),c(p)):i(p)}function c(p){return ut(p)&&o++<s?(e.consume(p),c):(e.exit(a),i(p))}}const Zw={tokenize:Ww};function Ww(e){const i=e.attempt(this.parser.constructs.contentInitial,r,s);let a;return i;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),gt(e,i,"linePrefix")}function s(c){return e.enter("paragraph"),o(c)}function o(c){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,f(c)}function f(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ie(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),f)}}const eC={tokenize:tC},r1={tokenize:nC};function tC(e){const i=this,a=[];let r=0,s,o,f;return c;function c(T){if(r<a.length){const Q=a[r];return i.containerState=Q[1],e.attempt(Q[0].continuation,p,d)(T)}return d(T)}function p(T){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,s&&U();const Q=i.events.length;let ee=Q,R;for(;ee--;)if(i.events[ee][0]==="exit"&&i.events[ee][1].type==="chunkFlow"){R=i.events[ee][1].end;break}k(r);let F=Q;for(;F<i.events.length;)i.events[F][1].end={...R},F++;return ii(i.events,ee+1,0,i.events.slice(Q)),i.events.length=F,d(T)}return c(T)}function d(T){if(r===a.length){if(!s)return y(T);if(s.currentConstruct&&s.currentConstruct.concrete)return N(T);i.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(r1,g,m)(T)}function g(T){return s&&U(),k(r),y(T)}function m(T){return i.parser.lazy[i.now().line]=r!==a.length,f=i.now().offset,N(T)}function y(T){return i.containerState={},e.attempt(r1,v,N)(T)}function v(T){return r++,a.push([i.currentConstruct,i.containerState]),y(T)}function N(T){if(T===null){s&&U(),k(0),e.consume(T);return}return s=s||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),M(T)}function M(T){if(T===null){D(e.exit("chunkFlow"),!0),k(0),e.consume(T);return}return Ie(T)?(e.consume(T),D(e.exit("chunkFlow")),r=0,i.interrupt=void 0,c):(e.consume(T),M)}function D(T,Q){const ee=i.sliceStream(T);if(Q&&ee.push(null),T.previous=o,o&&(o.next=T),o=T,s.defineSkip(T.start),s.write(ee),i.parser.lazy[T.start.line]){let R=s.events.length;for(;R--;)if(s.events[R][1].start.offset<f&&(!s.events[R][1].end||s.events[R][1].end.offset>f))return;const F=i.events.length;let I=F,K,j;for(;I--;)if(i.events[I][0]==="exit"&&i.events[I][1].type==="chunkFlow"){if(K){j=i.events[I][1].end;break}K=!0}for(k(r),R=F;R<i.events.length;)i.events[R][1].end={...j},R++;ii(i.events,I+1,0,i.events.slice(F)),i.events.length=R}}function k(T){let Q=a.length;for(;Q-- >T;){const ee=a[Q];i.containerState=ee[1],ee[0].exit.call(i,e)}a.length=T}function U(){s.write([null]),o=void 0,s=void 0,i.containerState._closeFlow=void 0}}function nC(e,i,a){return gt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pl(e){if(e===null||Ft(e)||Hr(e))return 1;if(kc(e))return 2}function Ac(e,i,a){const r=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!r.includes(o)&&(i=o(i,a),r.push(o))}return i}const cp={name:"attention",resolveAll:iC,tokenize:aC};function iC(e,i){let a=-1,r,s,o,f,c,p,d,g;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[a][1].start};l1(m,-p),l1(y,p),f={type:p>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},o={type:p>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},s={type:p>1?"strong":"emphasis",start:{...f.start},end:{...c.end}},e[r][1].end={...f.start},e[a][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=gi(d,[["enter",e[r][1],i],["exit",e[r][1],i]])),d=gi(d,[["enter",s,i],["enter",f,i],["exit",f,i],["enter",o,i]]),d=gi(d,Ac(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),d=gi(d,[["exit",o,i],["enter",c,i],["exit",c,i],["exit",s,i]]),e[a][1].end.offset-e[a][1].start.offset?(g=2,d=gi(d,[["enter",e[a][1],i],["exit",e[a][1],i]])):g=0,ii(e,r-1,a-r+3,d),a=r+d.length-g-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function aC(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Pl(r);let o;return f;function f(p){return o=p,e.enter("attentionSequence"),c(p)}function c(p){if(p===o)return e.consume(p),c;const d=e.exit("attentionSequence"),g=Pl(p),m=!g||g===2&&s||a.includes(p),y=!s||s===2&&g||a.includes(r);return d._open=!!(o===42?m:m&&(s||!y)),d._close=!!(o===42?y:y&&(g||!m)),i(p)}}function l1(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const rC={name:"autolink",tokenize:lC};function lC(e,i,a){let r=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Bn(v)?(e.consume(v),f):v===64?a(v):d(v)}function f(v){return v===43||v===45||v===46||jn(v)?(r=1,c(v)):d(v)}function c(v){return v===58?(e.consume(v),r=0,p):(v===43||v===45||v===46||jn(v))&&r++<32?(e.consume(v),c):(r=0,d(v))}function p(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),i):v===null||v===32||v===60||uc(v)?a(v):(e.consume(v),p)}function d(v){return v===64?(e.consume(v),g):Qw(v)?(e.consume(v),d):a(v)}function g(v){return jn(v)?m(v):a(v)}function m(v){return v===46?(e.consume(v),r=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),i):y(v)}function y(v){if((v===45||jn(v))&&r++<63){const N=v===45?y:m;return e.consume(v),N}return a(v)}}const yo={partial:!0,tokenize:sC};function sC(e,i,a){return r;function r(o){return ut(o)?gt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Ie(o)?i(o):a(o)}}const Cy={continuation:{tokenize:uC},exit:cC,name:"blockQuote",tokenize:oC};function oC(e,i,a){const r=this;return s;function s(f){if(f===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(f),e.exit("blockQuoteMarker"),o}return a(f)}function o(f){return ut(f)?(e.enter("blockQuotePrefixWhitespace"),e.consume(f),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(f))}}function uC(e,i,a){const r=this;return s;function s(f){return ut(f)?gt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):o(f)}function o(f){return e.attempt(Cy,i,a)(f)}}function cC(e){e.exit("blockQuote")}const Ey={name:"characterEscape",tokenize:fC};function fC(e,i,a){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return Xw(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(o)}}const ky={name:"characterReference",tokenize:dC};function dC(e,i,a){const r=this;let s=0,o,f;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),p}function p(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,f=jn,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,f=Jw,g):(e.enter("characterReferenceValue"),o=7,f=up,g(m))}function g(m){if(m===59&&s){const y=e.exit("characterReferenceValue");return f===jn&&!jp(r.sliceSerialize(y))?a(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return f(m)&&s++<o?(e.consume(m),g):a(m)}}const s1={partial:!0,tokenize:pC},o1={concrete:!0,name:"codeFenced",tokenize:hC};function hC(e,i,a){const r=this,s={partial:!0,tokenize:ee};let o=0,f=0,c;return p;function p(R){return d(R)}function d(R){const F=r.events[r.events.length-1];return o=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,c=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===c?(f++,e.consume(R),g):f<3?a(R):(e.exit("codeFencedFenceSequence"),ut(R)?gt(e,m,"whitespace")(R):m(R))}function m(R){return R===null||Ie(R)?(e.exit("codeFencedFence"),r.interrupt?i(R):e.check(s1,M,Q)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Ie(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(R)):ut(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,v,"whitespace")(R)):R===96&&R===c?a(R):(e.consume(R),y)}function v(R){return R===null||Ie(R)?m(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),N(R))}function N(R){return R===null||Ie(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(R)):R===96&&R===c?a(R):(e.consume(R),N)}function M(R){return e.attempt(s,Q,D)(R)}function D(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),k}function k(R){return o>0&&ut(R)?gt(e,U,"linePrefix",o+1)(R):U(R)}function U(R){return R===null||Ie(R)?e.check(s1,M,Q)(R):(e.enter("codeFlowValue"),T(R))}function T(R){return R===null||Ie(R)?(e.exit("codeFlowValue"),U(R)):(e.consume(R),T)}function Q(R){return e.exit("codeFenced"),i(R)}function ee(R,F,I){let K=0;return j;function j(ae){return R.enter("lineEnding"),R.consume(ae),R.exit("lineEnding"),P}function P(ae){return R.enter("codeFencedFence"),ut(ae)?gt(R,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):q(ae)}function q(ae){return ae===c?(R.enter("codeFencedFenceSequence"),W(ae)):I(ae)}function W(ae){return ae===c?(K++,R.consume(ae),W):K>=f?(R.exit("codeFencedFenceSequence"),ut(ae)?gt(R,H,"whitespace")(ae):H(ae)):I(ae)}function H(ae){return ae===null||Ie(ae)?(R.exit("codeFencedFence"),F(ae)):I(ae)}}}function pC(e,i,a){const r=this;return s;function s(f){return f===null?a(f):(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),o)}function o(f){return r.parser.lazy[r.now().line]?a(f):i(f)}}const vh={name:"codeIndented",tokenize:gC},mC={partial:!0,tokenize:xC};function gC(e,i,a){const r=this;return s;function s(d){return e.enter("codeIndented"),gt(e,o,"linePrefix",5)(d)}function o(d){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(d):a(d)}function f(d){return d===null?p(d):Ie(d)?e.attempt(mC,f,p)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||Ie(d)?(e.exit("codeFlowValue"),f(d)):(e.consume(d),c)}function p(d){return e.exit("codeIndented"),i(d)}}function xC(e,i,a){const r=this;return s;function s(f){return r.parser.lazy[r.now().line]?a(f):Ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):gt(e,o,"linePrefix",5)(f)}function o(f){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(f):Ie(f)?s(f):a(f)}}const bC={name:"codeText",previous:vC,resolve:yC,tokenize:SC};function yC(e){let i=e.length-4,a=3,r,s;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)s===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(s=r):(r===i||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),i-=r-s-2,r=s+2),s=void 0);return e}function vC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SC(e,i,a){let r=0,s,o;return f;function f(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),p(m))}function p(m){return m===null?a(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),p):m===96?(o=e.enter("codeTextSequence"),s=0,g(m)):Ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Ie(m)?(e.exit("codeTextData"),p(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),s++,g):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(m)):(o.type="codeTextData",d(m))}}class NC{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const s=a||0;this.setCursor(Math.trunc(i));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ys(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),Ys(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Ys(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);Ys(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Ys(this.left,a.reverse())}}}function Ys(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Ay(e){const i={};let a=-1,r,s,o,f,c,p,d;const g=new NC(e);for(;++a<g.length;){for(;a in i;)a=i[a];if(r=g.get(a),a&&r[1].type==="chunkFlow"&&g.get(a-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,wC(g,a)),a=i[a],d=!0);else if(r[1]._container){for(o=a,s=void 0;o--;)if(f=g.get(o),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),f[1].type="lineEnding",s=o);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;s&&(r[1].end={...g.get(s)[1].start},c=g.slice(s,a),c.unshift(r),g.splice(s,a-s+1,c))}}return ii(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function wC(e,i){const a=e.get(i)[1],r=e.get(i)[2];let s=i-1;const o=[];let f=a._tokenizer;f||(f=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const c=f.events,p=[],d={};let g,m,y=-1,v=a,N=0,M=0;const D=[M];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(g=r.sliceStream(v),v.next||g.push(null),m&&f.defineSkip(v.start),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),v._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=a;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(M=y+1,D.push(M),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(f.events=[],v?(v._tokenizer=void 0,v.previous=void 0):D.pop(),y=D.length;y--;){const k=c.slice(D[y],D[y+1]),U=o.pop();p.push([U,U+k.length-1]),e.splice(U,2,k)}for(p.reverse(),y=-1;++y<p.length;)d[N+p[y][0]]=N+p[y][1],N+=p[y][1]-p[y][0]-1;return d}const CC={resolve:kC,tokenize:AC},EC={partial:!0,tokenize:MC};function kC(e){return Ay(e),e}function AC(e,i){let a;return r;function r(c){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?o(c):Ie(c)?e.check(EC,f,o)(c):(e.consume(c),s)}function o(c){return e.exit("chunkContent"),e.exit("content"),i(c)}function f(c){return e.consume(c),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,s}}function MC(e,i,a){const r=this;return s;function s(f){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),gt(e,o,"linePrefix")}function o(f){if(f===null||Ie(f))return a(f);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?i(f):e.interrupt(r.parser.constructs.flow,a,i)(f)}}function My(e,i,a,r,s,o,f,c,p){const d=p||Number.POSITIVE_INFINITY;let g=0;return m;function m(k){return k===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(k),e.exit(o),y):k===null||k===32||k===41||uc(k)?a(k):(e.enter(r),e.enter(f),e.enter(c),e.enter("chunkString",{contentType:"string"}),M(k))}function y(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(s),e.exit(r),i):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),y(k)):k===null||k===60||Ie(k)?a(k):(e.consume(k),k===92?N:v)}function N(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function M(k){return!g&&(k===null||k===41||Ft(k))?(e.exit("chunkString"),e.exit(c),e.exit(f),e.exit(r),i(k)):g<d&&k===40?(e.consume(k),g++,M):k===41?(e.consume(k),g--,M):k===null||k===32||k===40||uc(k)?a(k):(e.consume(k),k===92?D:M)}function D(k){return k===40||k===41||k===92?(e.consume(k),M):M(k)}}function jy(e,i,a,r,s,o){const f=this;let c=0,p;return d;function d(v){return e.enter(r),e.enter(s),e.consume(v),e.exit(s),e.enter(o),g}function g(v){return c>999||v===null||v===91||v===93&&!p||v===94&&!c&&"_hiddenFootnoteSupport"in f.parser.constructs?a(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(r),i):Ie(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ie(v)||c++>999?(e.exit("chunkString"),g(v)):(e.consume(v),p||(p=!ut(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function Ty(e,i,a,r,s,o){let f;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(s),e.consume(y),e.exit(s),f=y===40?41:y,p):a(y)}function p(y){return y===f?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),i):(e.enter(o),d(y))}function d(y){return y===f?(e.exit(o),p(f)):y===null?a(y):Ie(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),gt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===f||y===null||Ie(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?m:g)}function m(y){return y===f||y===92?(e.consume(y),g):g(y)}}function uo(e,i){let a;return r;function r(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a=!0,r):ut(s)?gt(e,r,a?"linePrefix":"lineSuffix")(s):i(s)}}const jC={name:"definition",tokenize:DC},TC={partial:!0,tokenize:OC};function DC(e,i,a){const r=this;let s;return o;function o(v){return e.enter("definition"),f(v)}function f(v){return jy.call(r,e,c,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return s=Ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),p):a(v)}function p(v){return Ft(v)?uo(e,d)(v):d(v)}function d(v){return My(e,g,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(TC,m,m)(v)}function m(v){return ut(v)?gt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ie(v)?(e.exit("definition"),r.parser.defined.push(s),i(v)):a(v)}}function OC(e,i,a){return r;function r(c){return Ft(c)?uo(e,s)(c):a(c)}function s(c){return Ty(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return ut(c)?gt(e,f,"whitespace")(c):f(c)}function f(c){return c===null||Ie(c)?i(c):a(c)}}const _C={name:"hardBreakEscape",tokenize:FC};function FC(e,i,a){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Ie(o)?(e.exit("hardBreakEscape"),i(o)):a(o)}}const BC={name:"headingAtx",resolve:RC,tokenize:LC};function RC(e,i){let a=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},o={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},ii(e,r,a-r+1,[["enter",s,i],["enter",o,i],["exit",o,i],["exit",s,i]])),e}function LC(e,i,a){let r=0;return s;function s(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&r++<6?(e.consume(g),f):g===null||Ft(g)?(e.exit("atxHeadingSequence"),c(g)):a(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||Ie(g)?(e.exit("atxHeading"),i(g)):ut(g)?gt(e,c,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),c(g))}function d(g){return g===null||g===35||Ft(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),d)}}const zC=["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"],u1=["pre","script","style","textarea"],IC={concrete:!0,name:"htmlFlow",resolveTo:UC,tokenize:PC},$C={partial:!0,tokenize:GC},HC={partial:!0,tokenize:qC};function UC(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function PC(e,i,a){const r=this;let s,o,f,c,p;return d;function d(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),m}function m(w){return w===33?(e.consume(w),y):w===47?(e.consume(w),o=!0,M):w===63?(e.consume(w),s=3,r.interrupt?i:O):Bn(w)?(e.consume(w),f=String.fromCharCode(w),D):a(w)}function y(w){return w===45?(e.consume(w),s=2,v):w===91?(e.consume(w),s=5,c=0,N):Bn(w)?(e.consume(w),s=4,r.interrupt?i:O):a(w)}function v(w){return w===45?(e.consume(w),r.interrupt?i:O):a(w)}function N(w){const he="CDATA[";return w===he.charCodeAt(c++)?(e.consume(w),c===he.length?r.interrupt?i:q:N):a(w)}function M(w){return Bn(w)?(e.consume(w),f=String.fromCharCode(w),D):a(w)}function D(w){if(w===null||w===47||w===62||Ft(w)){const he=w===47,Ce=f.toLowerCase();return!he&&!o&&u1.includes(Ce)?(s=1,r.interrupt?i(w):q(w)):zC.includes(f.toLowerCase())?(s=6,he?(e.consume(w),k):r.interrupt?i(w):q(w)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(w):o?U(w):T(w))}return w===45||jn(w)?(e.consume(w),f+=String.fromCharCode(w),D):a(w)}function k(w){return w===62?(e.consume(w),r.interrupt?i:q):a(w)}function U(w){return ut(w)?(e.consume(w),U):j(w)}function T(w){return w===47?(e.consume(w),j):w===58||w===95||Bn(w)?(e.consume(w),Q):ut(w)?(e.consume(w),T):j(w)}function Q(w){return w===45||w===46||w===58||w===95||jn(w)?(e.consume(w),Q):ee(w)}function ee(w){return w===61?(e.consume(w),R):ut(w)?(e.consume(w),ee):T(w)}function R(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(e.consume(w),p=w,F):ut(w)?(e.consume(w),R):I(w)}function F(w){return w===p?(e.consume(w),p=null,K):w===null||Ie(w)?a(w):(e.consume(w),F)}function I(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Ft(w)?ee(w):(e.consume(w),I)}function K(w){return w===47||w===62||ut(w)?T(w):a(w)}function j(w){return w===62?(e.consume(w),P):a(w)}function P(w){return w===null||Ie(w)?q(w):ut(w)?(e.consume(w),P):a(w)}function q(w){return w===45&&s===2?(e.consume(w),E):w===60&&s===1?(e.consume(w),_):w===62&&s===4?(e.consume(w),B):w===63&&s===3?(e.consume(w),O):w===93&&s===5?(e.consume(w),oe):Ie(w)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check($C,Z,W)(w)):w===null||Ie(w)?(e.exit("htmlFlowData"),W(w)):(e.consume(w),q)}function W(w){return e.check(HC,H,Z)(w)}function H(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),ae}function ae(w){return w===null||Ie(w)?W(w):(e.enter("htmlFlowData"),q(w))}function E(w){return w===45?(e.consume(w),O):q(w)}function _(w){return w===47?(e.consume(w),f="",Y):q(w)}function Y(w){if(w===62){const he=f.toLowerCase();return u1.includes(he)?(e.consume(w),B):q(w)}return Bn(w)&&f.length<8?(e.consume(w),f+=String.fromCharCode(w),Y):q(w)}function oe(w){return w===93?(e.consume(w),O):q(w)}function O(w){return w===62?(e.consume(w),B):w===45&&s===2?(e.consume(w),O):q(w)}function B(w){return w===null||Ie(w)?(e.exit("htmlFlowData"),Z(w)):(e.consume(w),B)}function Z(w){return e.exit("htmlFlow"),i(w)}}function qC(e,i,a){const r=this;return s;function s(f){return Ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),o):a(f)}function o(f){return r.parser.lazy[r.now().line]?a(f):i(f)}}function GC(e,i,a){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yo,i,a)}}const VC={name:"htmlText",tokenize:KC};function KC(e,i,a){const r=this;let s,o,f;return c;function c(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),d):O===47?(e.consume(O),ee):O===63?(e.consume(O),T):Bn(O)?(e.consume(O),I):a(O)}function d(O){return O===45?(e.consume(O),g):O===91?(e.consume(O),o=0,N):Bn(O)?(e.consume(O),U):a(O)}function g(O){return O===45?(e.consume(O),v):a(O)}function m(O){return O===null?a(O):O===45?(e.consume(O),y):Ie(O)?(f=m,_(O)):(e.consume(O),m)}function y(O){return O===45?(e.consume(O),v):m(O)}function v(O){return O===62?E(O):O===45?y(O):m(O)}function N(O){const B="CDATA[";return O===B.charCodeAt(o++)?(e.consume(O),o===B.length?M:N):a(O)}function M(O){return O===null?a(O):O===93?(e.consume(O),D):Ie(O)?(f=M,_(O)):(e.consume(O),M)}function D(O){return O===93?(e.consume(O),k):M(O)}function k(O){return O===62?E(O):O===93?(e.consume(O),k):M(O)}function U(O){return O===null||O===62?E(O):Ie(O)?(f=U,_(O)):(e.consume(O),U)}function T(O){return O===null?a(O):O===63?(e.consume(O),Q):Ie(O)?(f=T,_(O)):(e.consume(O),T)}function Q(O){return O===62?E(O):T(O)}function ee(O){return Bn(O)?(e.consume(O),R):a(O)}function R(O){return O===45||jn(O)?(e.consume(O),R):F(O)}function F(O){return Ie(O)?(f=F,_(O)):ut(O)?(e.consume(O),F):E(O)}function I(O){return O===45||jn(O)?(e.consume(O),I):O===47||O===62||Ft(O)?K(O):a(O)}function K(O){return O===47?(e.consume(O),E):O===58||O===95||Bn(O)?(e.consume(O),j):Ie(O)?(f=K,_(O)):ut(O)?(e.consume(O),K):E(O)}function j(O){return O===45||O===46||O===58||O===95||jn(O)?(e.consume(O),j):P(O)}function P(O){return O===61?(e.consume(O),q):Ie(O)?(f=P,_(O)):ut(O)?(e.consume(O),P):K(O)}function q(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),s=O,W):Ie(O)?(f=q,_(O)):ut(O)?(e.consume(O),q):(e.consume(O),H)}function W(O){return O===s?(e.consume(O),s=void 0,ae):O===null?a(O):Ie(O)?(f=W,_(O)):(e.consume(O),W)}function H(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||Ft(O)?K(O):(e.consume(O),H)}function ae(O){return O===47||O===62||Ft(O)?K(O):a(O)}function E(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function _(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return ut(O)?gt(e,oe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):oe(O)}function oe(O){return e.enter("htmlTextData"),f(O)}}const Tp={name:"labelEnd",resolveAll:XC,resolveTo:ZC,tokenize:WC},YC={tokenize:eE},QC={tokenize:tE},JC={tokenize:nE};function XC(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",i+=s}}return e.length!==a.length&&ii(e,0,e.length,a),e}function ZC(e,i){let a=e.length,r=0,s,o,f,c;for(;a--;)if(s=e[a][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[a][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(f){if(e[a][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=a,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(f=a);const p={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[f][1].end}},g={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[f-2][1].start}};return c=[["enter",p,i],["enter",d,i]],c=gi(c,e.slice(o+1,o+r+3)),c=gi(c,[["enter",g,i]]),c=gi(c,Ac(i.parser.constructs.insideSpan.null,e.slice(o+r+4,f-3),i)),c=gi(c,[["exit",g,i],e[f-2],e[f-1],["exit",d,i]]),c=gi(c,e.slice(f+1)),c=gi(c,[["exit",p,i]]),ii(e,o,e.length,c),e}function WC(e,i,a){const r=this;let s=r.events.length,o,f;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return c;function c(y){return o?o._inactive?m(y):(f=r.parser.defined.includes(Ei(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),p):a(y)}function p(y){return y===40?e.attempt(YC,g,f?g:m)(y):y===91?e.attempt(QC,g,f?d:m)(y):f?g(y):m(y)}function d(y){return e.attempt(JC,g,m)(y)}function g(y){return i(y)}function m(y){return o._balanced=!0,a(y)}}function eE(e,i,a){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return Ft(m)?uo(e,o)(m):o(m)}function o(m){return m===41?g(m):My(e,f,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function f(m){return Ft(m)?uo(e,p)(m):g(m)}function c(m){return a(m)}function p(m){return m===34||m===39||m===40?Ty(e,d,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return Ft(m)?uo(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),i):a(m)}}function tE(e,i,a){const r=this;return s;function s(c){return jy.call(r,e,o,f,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(Ei(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(c):a(c)}function f(c){return a(c)}}function nE(e,i,a){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),i):a(o)}}const iE={name:"labelStartImage",resolveAll:Tp.resolveAll,tokenize:aE};function aE(e,i,a){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),f):a(c)}function f(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(c):i(c)}}const rE={name:"labelStartLink",resolveAll:Tp.resolveAll,tokenize:lE};function lE(e,i,a){const r=this;return s;function s(f){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelLink"),o}function o(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(f):i(f)}}const Sh={name:"lineEnding",tokenize:sE};function sE(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),gt(e,i,"linePrefix")}}const ec={name:"thematicBreak",tokenize:oE};function oE(e,i,a){let r=0,s;return o;function o(d){return e.enter("thematicBreak"),f(d)}function f(d){return s=d,c(d)}function c(d){return d===s?(e.enter("thematicBreakSequence"),p(d)):r>=3&&(d===null||Ie(d))?(e.exit("thematicBreak"),i(d)):a(d)}function p(d){return d===s?(e.consume(d),r++,p):(e.exit("thematicBreakSequence"),ut(d)?gt(e,c,"whitespace")(d):c(d))}}const Pn={continuation:{tokenize:dE},exit:pE,name:"list",tokenize:fE},uE={partial:!0,tokenize:mE},cE={partial:!0,tokenize:hE};function fE(e,i,a){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,f=0;return c;function c(v){const N=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:up(v)){if(r.containerState.type||(r.containerState.type=N,e.enter(N,{_container:!0})),N==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(ec,a,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(v)}return a(v)}function p(v){return up(v)&&++f<10?(e.consume(v),p):(!r.interrupt||f<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):a(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(yo,r.interrupt?a:g,e.attempt(uE,y,m))}function g(v){return r.containerState.initialBlankLine=!0,o++,y(v)}function m(v){return ut(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):a(v)}function y(v){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(v)}}function dE(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(yo,s,o);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,gt(e,i,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!ut(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,f(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cE,i,f)(c))}function f(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,gt(e,e.attempt(Pn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function hE(e,i,a){const r=this;return gt(e,s,"listItemIndent",r.containerState.size+1);function s(o){const f=r.events[r.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===r.containerState.size?i(o):a(o)}}function pE(e){e.exit(this.containerState.type)}function mE(e,i,a){const r=this;return gt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const f=r.events[r.events.length-1];return!ut(o)&&f&&f[1].type==="listItemPrefixWhitespace"?i(o):a(o)}}const c1={name:"setextUnderline",resolveTo:gE,tokenize:xE};function gE(e,i){let a=e.length,r,s,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(s=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);const f={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",f,i]),e.splice(o+1,0,["exit",e[r][1],i]),e[r][1].end={...e[o][1].end}):e[r][1]=f,e.push(["exit",f,i]),e}function xE(e,i,a){const r=this;let s;return o;function o(d){let g=r.events.length,m;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){m=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),s=d,f(d)):a(d)}function f(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===s?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),ut(d)?gt(e,p,"lineSuffix")(d):p(d))}function p(d){return d===null||Ie(d)?(e.exit("setextHeadingLine"),i(d)):a(d)}}const bE={tokenize:yE};function yE(e){const i=this,a=e.attempt(yo,r,e.attempt(this.parser.constructs.flowInitial,s,gt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(CC,s)),"linePrefix")));return a;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const vE={resolveAll:Oy()},SE=Dy("string"),NE=Dy("text");function Dy(e){return{resolveAll:Oy(e==="text"?wE:void 0),tokenize:i};function i(a){const r=this,s=this.parser.constructs[e],o=a.attempt(s,f,c);return f;function f(g){return d(g)?o(g):c(g)}function c(g){if(g===null){a.consume(g);return}return a.enter("data"),a.consume(g),p}function p(g){return d(g)?(a.exit("data"),o(g)):(a.consume(g),p)}function d(g){if(g===null)return!0;const m=s[g];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Oy(e){return i;function i(a,r){let s=-1,o;for(;++s<=a.length;)o===void 0?a[s]&&a[s][1].type==="data"&&(o=s,s++):(!a[s]||a[s][1].type!=="data")&&(s!==o+2&&(a[o][1].end=a[s-1][1].end,a.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(a,r):a}}function wE(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],s=i.sliceStream(r);let o=s.length,f=-1,c=0,p;for(;o--;){const d=s[o];if(typeof d=="string"){for(f=d.length;d.charCodeAt(f-1)===32;)c++,f--;if(f)break;f=-1}else if(d===-2)p=!0,c++;else if(d!==-1){o++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(c=0),c){const d={type:a===e.length||p||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?f:r.start._bufferIndex+f,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(a,0,["enter",d,i],["exit",d,i]),a+=2)}a++}return e}const CE={42:Pn,43:Pn,45:Pn,48:Pn,49:Pn,50:Pn,51:Pn,52:Pn,53:Pn,54:Pn,55:Pn,56:Pn,57:Pn,62:Cy},EE={91:jC},kE={[-2]:vh,[-1]:vh,32:vh},AE={35:BC,42:ec,45:[c1,ec],60:IC,61:c1,95:ec,96:o1,126:o1},ME={38:ky,92:Ey},jE={[-5]:Sh,[-4]:Sh,[-3]:Sh,33:iE,38:ky,42:cp,60:[rC,VC],91:rE,92:[_C,Ey],93:Tp,95:cp,96:bC},TE={null:[cp,vE]},DE={null:[42,95]},OE={null:[]},_E=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:DE,contentInitial:EE,disable:OE,document:CE,flow:AE,flowInitial:kE,insideSpan:TE,string:ME,text:jE},Symbol.toStringTag,{value:"Module"}));function FE(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const s={},o=[];let f=[],c=[];const p={attempt:F(ee),check:F(R),consume:U,enter:T,exit:Q,interrupt:F(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:M,events:[],now:N,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let g=i.tokenize.call(d,p);return i.resolveAll&&o.push(i),d;function m(P){return f=gi(f,P),D(),f[f.length-1]!==null?[]:(I(i,0),d.events=Ac(o,d.events,d),d.events)}function y(P,q){return RE(v(P),q)}function v(P){return BE(f,P)}function N(){const{_bufferIndex:P,_index:q,line:W,column:H,offset:ae}=r;return{_bufferIndex:P,_index:q,line:W,column:H,offset:ae}}function M(P){s[P.line]=P.column,j()}function D(){let P;for(;r._index<f.length;){const q=f[r._index];if(typeof q=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<q.length;)k(q.charCodeAt(r._bufferIndex));else k(q)}}function k(P){g=g(P)}function U(P){Ie(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,j()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===f[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=P}function T(P,q){const W=q||{};return W.type=P,W.start=N(),d.events.push(["enter",W,d]),c.push(W),W}function Q(P){const q=c.pop();return q.end=N(),d.events.push(["exit",q,d]),q}function ee(P,q){I(P,q.from)}function R(P,q){q.restore()}function F(P,q){return W;function W(H,ae,E){let _,Y,oe,O;return Array.isArray(H)?Z(H):"tokenize"in H?Z([H]):B(H);function B(Se){return ze;function ze(Ve){const Ue=Ve!==null&&Se[Ve],Dt=Ve!==null&&Se.null,Ht=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return Z(Ht)(Ve)}}function Z(Se){return _=Se,Y=0,Se.length===0?E:w(Se[Y])}function w(Se){return ze;function ze(Ve){return O=K(),oe=Se,Se.partial||(d.currentConstruct=Se),Se.name&&d.parser.constructs.disable.null.includes(Se.name)?Ce():Se.tokenize.call(q?Object.assign(Object.create(d),q):d,p,he,Ce)(Ve)}}function he(Se){return P(oe,O),ae}function Ce(Se){return O.restore(),++Y<_.length?w(_[Y]):E}}}function I(P,q){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&ii(d.events,q,d.events.length-q,P.resolve(d.events.slice(q),d)),P.resolveTo&&(d.events=P.resolveTo(d.events,d))}function K(){const P=N(),q=d.previous,W=d.currentConstruct,H=d.events.length,ae=Array.from(c);return{from:H,restore:E};function E(){r=P,d.previous=q,d.currentConstruct=W,d.events.length=H,c=ae,j()}}function j(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function BE(e,i){const a=i.start._index,r=i.start._bufferIndex,s=i.end._index,o=i.end._bufferIndex;let f;if(a===s)f=[e[a].slice(r,o)];else{if(f=e.slice(a,s),r>-1){const c=f[0];typeof c=="string"?f[0]=c.slice(r):f.shift()}o>0&&f.push(e[s].slice(0,o))}return f}function RE(e,i){let a=-1;const r=[];let s;for(;++a<e.length;){const o=e[a];let f;if(typeof o=="string")f=o;else switch(o){case-5:{f="\r";break}case-4:{f=`
11
+ `;break}case-3:{f=`\r
12
+ `;break}case-2:{f=i?" ":" ";break}case-1:{if(!i&&s)continue;f=" ";break}default:f=String.fromCharCode(o)}s=o===-2,r.push(f)}return r.join("")}function LE(e){const r={constructs:Ny([_E,...(e||{}).extensions||[]]),content:s(Zw),defined:[],document:s(eC),flow:s(bE),lazy:{},string:s(SE),text:s(NE)};return r;function s(o){return f;function f(c){return FE(r,o,c)}}}function zE(e){for(;!Ay(e););return e}const f1=/[\0\t\n\r]/g;function IE(){let e=1,i="",a=!0,r;return s;function s(o,f,c){const p=[];let d,g,m,y,v;for(o=i+(typeof o=="string"?o.toString():new TextDecoder(f||void 0).decode(o)),m=0,i="",a&&(o.charCodeAt(0)===65279&&m++,a=void 0);m<o.length;){if(f1.lastIndex=m,d=f1.exec(o),y=d&&d.index!==void 0?d.index:o.length,v=o.charCodeAt(y),!d){i=o.slice(m);break}if(v===10&&m===y&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),m<y&&(p.push(o.slice(m,y)),e+=y-m),v){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&p.push(-5),i&&p.push(i),p.push(null)),p}}const $E=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function HE(e){return e.replace($E,UE)}function UE(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const s=a.charCodeAt(1),o=s===120||s===88;return wy(a.slice(o?2:1),o?16:10)}return jp(a)||e}const _y={}.hasOwnProperty;function PE(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),qE(a)(zE(LE(a).document().write(IE()(e,i,!0))))}function qE(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Xe),autolinkProtocol:K,autolinkEmail:K,atxHeading:o(Ke),blockQuote:o(Dt),characterEscape:K,characterReference:K,codeFenced:o(Ht),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:o(Ht,f),codeText:o(Jt,f),codeTextData:K,data:K,codeFlowValue:K,definition:o(Rt),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:o(de),hardBreakEscape:o(Ot),hardBreakTrailing:o(Ot),htmlFlow:o(pe,f),htmlFlowData:K,htmlText:o(pe,f),htmlTextData:K,image:o(Me),label:f,link:o(Xe),listItem:o(Ae),listItemValue:y,listOrdered:o(et,m),listUnordered:o(et),paragraph:o(Nt),reference:w,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:o(Ke),strong:o(_e),thematicBreak:o(Kt)},exit:{atxHeading:p(),atxHeadingSequence:ee,autolink:p(),autolinkEmail:Ue,autolinkProtocol:Ve,blockQuote:p(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:Se,characterReference:ze,codeFenced:p(D),codeFencedFence:M,codeFencedFenceInfo:v,codeFencedFenceMeta:N,codeFlowValue:j,codeIndented:p(k),codeText:p(ae),codeTextData:j,data:j,definition:p(),definitionDestinationString:Q,definitionLabelString:U,definitionTitleString:T,emphasis:p(),hardBreakEscape:p(q),hardBreakTrailing:p(q),htmlFlow:p(W),htmlFlowData:j,htmlText:p(H),htmlTextData:j,image:p(_),label:oe,labelText:Y,lineEnding:P,link:p(E),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:he,resourceDestinationString:O,resourceTitleString:B,resource:Z,setextHeading:p(I),setextHeadingLineSequence:F,setextHeadingText:R,strong:p(),thematicBreak:p()}};Fy(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(le){let xe={type:"root",children:[]};const z={stack:[xe],tokenStack:[],config:i,enter:c,exit:d,buffer:f,resume:g,data:a},me=[];let we=-1;for(;++we<le.length;)if(le[we][1].type==="listOrdered"||le[we][1].type==="listUnordered")if(le[we][0]==="enter")me.push(we);else{const qe=me.pop();we=s(le,qe,we)}for(we=-1;++we<le.length;){const qe=i[le[we][0]];_y.call(qe,le[we][1].type)&&qe[le[we][1].type].call(Object.assign({sliceSerialize:le[we][2].sliceSerialize},z),le[we][1])}if(z.tokenStack.length>0){const qe=z.tokenStack[z.tokenStack.length-1];(qe[1]||d1).call(z,void 0,qe[0])}for(xe.position={start:Va(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Va(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<i.transforms.length;)xe=i.transforms[we](xe)||xe;return xe}function s(le,xe,z){let me=xe-1,we=-1,qe=!1,je,Re,Fe,pt;for(;++me<=z;){const at=le[me];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?we++:we--,pt=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(je&&!pt&&!we&&!Fe&&(Fe=me),pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pt=void 0}if(!we&&at[0]==="enter"&&at[1].type==="listItemPrefix"||we===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(je){let Lt=me;for(Re=void 0;Lt--;){const hn=le[Lt];if(hn[1].type==="lineEnding"||hn[1].type==="lineEndingBlank"){if(hn[0]==="exit")continue;Re&&(le[Re][1].type="lineEndingBlank",qe=!0),hn[1].type="lineEnding",Re=Lt}else if(!(hn[1].type==="linePrefix"||hn[1].type==="blockQuotePrefix"||hn[1].type==="blockQuotePrefixWhitespace"||hn[1].type==="blockQuoteMarker"||hn[1].type==="listItemIndent"))break}Fe&&(!Re||Fe<Re)&&(je._spread=!0),je.end=Object.assign({},Re?le[Re][1].start:at[1].end),le.splice(Re||me,0,["exit",je,at[2]]),me++,z++}if(at[1].type==="listItemPrefix"){const Lt={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};je=Lt,le.splice(me,0,["enter",Lt,at[2]]),me++,z++,Fe=void 0,pt=!0}}}return le[xe][1]._spread=qe,z}function o(le,xe){return z;function z(me){c.call(this,le(me),me),xe&&xe.call(this,me)}}function f(){this.stack.push({type:"fragment",children:[]})}function c(le,xe,z){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([xe,z||void 0]),le.position={start:Va(xe.start),end:void 0}}function p(le){return xe;function xe(z){le&&le.call(this,z),d.call(this,z)}}function d(le,xe){const z=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==le.type&&(xe?xe.call(this,le,me[0]):(me[1]||d1).call(this,le,me[0]));else throw new Error("Cannot close `"+le.type+"` ("+oo({start:le.start,end:le.end})+"): it’s not open");z.position.end=Va(le.end)}function g(){return Mp(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(le){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function v(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=le}function N(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=le}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function D(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.value=le.replace(/(\r?\n|\r)$/g,"")}function U(le){const xe=this.resume(),z=this.stack[this.stack.length-1];z.label=xe,z.identifier=Ei(this.sliceSerialize(le)).toLowerCase()}function T(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.title=le}function Q(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.url=le}function ee(le){const xe=this.stack[this.stack.length-1];if(!xe.depth){const z=this.sliceSerialize(le).length;xe.depth=z}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function F(le){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function K(le){const z=this.stack[this.stack.length-1].children;let me=z[z.length-1];(!me||me.type!=="text")&&(me=Pe(),me.position={start:Va(le.start),end:void 0},z.push(me)),this.stack.push(me)}function j(le){const xe=this.stack.pop();xe.value+=this.sliceSerialize(le),xe.position.end=Va(le.end)}function P(le){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const z=xe.children[xe.children.length-1];z.position.end=Va(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(xe.type)&&(K.call(this,le),j.call(this,le))}function q(){this.data.atHardBreak=!0}function W(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.value=le}function H(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.value=le}function ae(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.value=le}function E(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=xe,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function _(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=xe,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function Y(le){const xe=this.sliceSerialize(le),z=this.stack[this.stack.length-2];z.label=HE(xe),z.identifier=Ei(xe).toLowerCase()}function oe(){const le=this.stack[this.stack.length-1],xe=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){const me=le.children;z.children=me}else z.alt=xe}function O(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.url=le}function B(){const le=this.resume(),xe=this.stack[this.stack.length-1];xe.title=le}function Z(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function he(le){const xe=this.resume(),z=this.stack[this.stack.length-1];z.label=xe,z.identifier=Ei(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function Ce(le){this.data.characterReferenceType=le.type}function Se(le){const xe=this.sliceSerialize(le),z=this.data.characterReferenceType;let me;z?(me=wy(xe,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=jp(xe);const we=this.stack[this.stack.length-1];we.value+=me}function ze(le){const xe=this.stack.pop();xe.position.end=Va(le.end)}function Ve(le){j.call(this,le);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(le)}function Ue(le){j.call(this,le);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(le)}function Dt(){return{type:"blockquote",children:[]}}function Ht(){return{type:"code",lang:null,meta:null,value:""}}function Jt(){return{type:"inlineCode",value:""}}function Rt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function Ot(){return{type:"break"}}function pe(){return{type:"html",value:""}}function Me(){return{type:"image",title:null,url:"",alt:null}}function Xe(){return{type:"link",title:null,url:"",children:[]}}function et(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Ae(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function Nt(){return{type:"paragraph",children:[]}}function _e(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function Kt(){return{type:"thematicBreak"}}}function Va(e){return{line:e.line,column:e.column,offset:e.offset}}function Fy(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Fy(e,r):GE(e,r)}}function GE(e,i){let a;for(a in i)if(_y.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function d1(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+oo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+oo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+oo({start:i.start,end:i.end})+") is still open")}function VE(e){const i=this;i.parser=a;function a(r){return PE(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function KE(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function YE(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
13
+ `}]}function QE(e,i){const a=i.value?i.value+`
14
+ `:"",r={},s=i.lang?i.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o=e.applyData(i,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(i,o),o}function JE(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function XE(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function ZE(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),s=Gl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let f,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),f=e.footnoteOrder.length):f=o+1,c+=1,e.footnoteCounts.set(r,c);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+s,id:a+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};e.patch(i,p);const d={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(i,d),e.applyData(i,d)}function WE(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function ek(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function By(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const s=e.all(i),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const f=s[s.length-1];return f&&f.type==="text"?f.value+=r:s.push({type:"text",value:r}),s}function tk(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return By(e,i);const s={src:Gl(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(i,o),e.applyData(i,o)}function nk(e,i){const a={src:Gl(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function ik(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function ak(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return By(e,i);const s={href:Gl(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)}function rk(e,i){const a={href:Gl(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function lk(e,i,a){const r=e.all(i),s=a?sk(a):Ry(i),o={},f=[];if(typeof i.checked=="boolean"){const g=r[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const g=r[c];(s||c!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
15
+ `}),g.type==="element"&&g.tagName==="p"&&!s?f.push(...g.children):f.push(g)}const p=r[r.length-1];p&&(s||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
16
+ `});const d={type:"element",tagName:"li",properties:o,children:f};return e.patch(i,d),e.applyData(i,d)}function sk(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Ry(a[r])}return i}function Ry(e){const i=e.spread;return i??e.children.length>1}function ok(e,i){const a={},r=e.all(i);let s=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++s<r.length;){const f=r[s];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,o),e.applyData(i,o)}function uk(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function ck(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function fk(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function dk(e,i){const a=e.all(i),r=a.shift(),s=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],f),s.push(f)}if(a.length>0){const f={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},c=Cp(i.children[1]),p=py(i.children[i.children.length-1]);c&&p&&(f.position={start:c,end:p}),s.push(f)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)}function hk(e,i,a){const r=a?a.children:void 0,o=(r?r.indexOf(i):1)===0?"th":"td",f=a&&a.type==="table"?a.align:void 0,c=f?f.length:i.children.length;let p=-1;const d=[];for(;++p<c;){const m=i.children[p],y={},v=f?f[p]:void 0;v&&(y.align=v);let N={type:"element",tagName:o,properties:y,children:[]};m&&(N.children=e.all(m),e.patch(m,N),N=e.applyData(m,N)),d.push(N)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(i,g),e.applyData(i,g)}function pk(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const h1=9,p1=32;function mk(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),s=0;const o=[];for(;r;)o.push(m1(i.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=a.exec(i);return o.push(m1(i.slice(s),s>0,!1)),o.join("")}function m1(e,i,a){let r=0,s=e.length;if(i){let o=e.codePointAt(r);for(;o===h1||o===p1;)r++,o=e.codePointAt(r)}if(a){let o=e.codePointAt(s-1);for(;o===h1||o===p1;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function gk(e,i){const a={type:"text",value:mk(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function xk(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const bk={blockquote:KE,break:YE,code:QE,delete:JE,emphasis:XE,footnoteReference:ZE,heading:WE,html:ek,imageReference:tk,image:nk,inlineCode:ik,linkReference:ak,link:rk,listItem:lk,list:ok,paragraph:uk,root:ck,strong:fk,table:dk,tableCell:pk,tableRow:hk,text:gk,thematicBreak:xk,toml:Hu,yaml:Hu,definition:Hu,footnoteDefinition:Hu};function Hu(){}const Ly=-1,Mc=0,co=1,cc=2,Dp=3,Op=4,_p=5,Fp=6,zy=7,Iy=8,yk=typeof self=="object"?self:globalThis,g1=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new yk[e](i)},vk=(e,i)=>{const a=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,f]=i[s];switch(o){case Mc:case Ly:return a(f,s);case co:{const c=a([],s);for(const p of f)c.push(r(p));return c}case cc:{const c=a({},s);for(const[p,d]of f)c[r(p)]=r(d);return c}case Dp:return a(new Date(f),s);case Op:{const{source:c,flags:p}=f;return a(new RegExp(c,p),s)}case _p:{const c=a(new Map,s);for(const[p,d]of f)c.set(r(p),r(d));return c}case Fp:{const c=a(new Set,s);for(const p of f)c.add(r(p));return c}case zy:{const{name:c,message:p}=f;return a(g1(c,p),s)}case Iy:return a(BigInt(f),s);case"BigInt":return a(Object(BigInt(f)),s);case"ArrayBuffer":return a(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:c}=new Uint8Array(f);return a(new DataView(c),f)}}return a(g1(o,f),s)};return r},x1=e=>vk(new Map,e)(0),jl="",{toString:Sk}={},{keys:Nk}=Object,Qs=e=>{const i=typeof e;if(i!=="object"||!e)return[Mc,i];const a=Sk.call(e).slice(8,-1);switch(a){case"Array":return[co,jl];case"Object":return[cc,jl];case"Date":return[Dp,jl];case"RegExp":return[Op,jl];case"Map":return[_p,jl];case"Set":return[Fp,jl];case"DataView":return[co,a]}return a.includes("Array")?[co,a]:a.includes("Error")?[zy,a]:[cc,a]},Uu=([e,i])=>e===Mc&&(i==="function"||i==="symbol"),wk=(e,i,a,r)=>{const s=(f,c)=>{const p=r.push(f)-1;return a.set(c,p),p},o=f=>{if(a.has(f))return a.get(f);let[c,p]=Qs(f);switch(c){case Mc:{let g=f;switch(p){case"bigint":c=Iy,g=f.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return s([Ly],f)}return s([c,g],f)}case co:{if(p){let y=f;return p==="DataView"?y=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(y=new Uint8Array(f)),s([p,[...y]],f)}const g=[],m=s([c,g],f);for(const y of f)g.push(o(y));return m}case cc:{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(i&&"toJSON"in f)return o(f.toJSON());const g=[],m=s([c,g],f);for(const y of Nk(f))(e||!Uu(Qs(f[y])))&&g.push([o(y),o(f[y])]);return m}case Dp:return s([c,f.toISOString()],f);case Op:{const{source:g,flags:m}=f;return s([c,{source:g,flags:m}],f)}case _p:{const g=[],m=s([c,g],f);for(const[y,v]of f)(e||!(Uu(Qs(y))||Uu(Qs(v))))&&g.push([o(y),o(v)]);return m}case Fp:{const g=[],m=s([c,g],f);for(const y of f)(e||!Uu(Qs(y)))&&g.push(o(y));return m}}const{message:d}=f;return s([c,{name:p,message:d}],f)};return o},b1=(e,{json:i,lossy:a}={})=>{const r=[];return wk(!(i||a),!!i,new Map,r)(e),r},go=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?x1(b1(e,i)):structuredClone(e):(e,i)=>x1(b1(e,i));function Ck(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function Ek(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function kk(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||Ck,r=e.options.footnoteBackLabel||Ek,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",f=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let p=-1;for(;++p<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[p]);if(!d)continue;const g=e.all(d),m=String(d.identifier).toUpperCase(),y=Gl(m.toLowerCase());let v=0;const N=[],M=e.footnoteCounts.get(m);for(;M!==void 0&&++v<=M;){N.length>0&&N.push({type:"text",value:" "});let U=typeof a=="string"?a:a(p,v);typeof U=="string"&&(U={type:"text",value:U}),N.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,v),className:["data-footnote-backref"]},children:Array.isArray(U)?U:[U]})}const D=g[g.length-1];if(D&&D.type==="element"&&D.tagName==="p"){const U=D.children[D.children.length-1];U&&U.type==="text"?U.value+=" ":D.children.push({type:"text",value:" "}),D.children.push(...N)}else g.push(...N);const k={type:"element",tagName:"li",properties:{id:i+"fn-"+y},children:e.wrap(g,!0)};e.patch(d,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...go(f),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
17
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
18
+ `}]}}const jc=(function(e){if(e==null)return Tk;if(typeof e=="function")return Tc(e);if(typeof e=="object")return Array.isArray(e)?Ak(e):Mk(e);if(typeof e=="string")return jk(e);throw new Error("Expected function, string, or object as test")});function Ak(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=jc(e[a]);return Tc(r);function r(...s){let o=-1;for(;++o<i.length;)if(i[o].apply(this,s))return!0;return!1}}function Mk(e){const i=e;return Tc(a);function a(r){const s=r;let o;for(o in e)if(s[o]!==i[o])return!1;return!0}}function jk(e){return Tc(i);function i(a){return a&&a.type===e}}function Tc(e){return i;function i(a,r,s){return!!(Dk(a)&&e.call(this,a,typeof r=="number"?r:void 0,s||void 0))}}function Tk(){return!0}function Dk(e){return e!==null&&typeof e=="object"&&"type"in e}const $y=[],Ok=!0,fp=!1,_k="skip";function Hy(e,i,a,r){let s;typeof i=="function"&&typeof a!="function"?(r=a,a=i):s=i;const o=jc(s),f=r?-1:1;c(e,void 0,[])();function c(p,d,g){const m=p&&typeof p=="object"?p:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(p.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=$y,N,M,D;if((!i||o(p,d,g[g.length-1]||void 0))&&(v=Fk(a(p,g)),v[0]===fp))return v;if("children"in p&&p.children){const k=p;if(k.children&&v[0]!==_k)for(M=(r?k.children.length:-1)+f,D=g.concat(k);M>-1&&M<k.children.length;){const U=k.children[M];if(N=c(U,M,D)(),N[0]===fp)return N;M=typeof N[1]=="number"?N[1]:M+f}}return v}}}function Fk(e){return Array.isArray(e)?e:typeof e=="number"?[Ok,e]:e==null?$y:[e]}function Bp(e,i,a,r){let s,o,f;typeof i=="function"&&typeof a!="function"?(o=void 0,f=i,s=a):(o=i,f=a,s=r),Hy(e,o,c,s);function c(p,d){const g=d[d.length-1],m=g?g.children.indexOf(p):void 0;return f(p,m,g)}}const dp={}.hasOwnProperty,Bk={};function Rk(e,i){const a=i||Bk,r=new Map,s=new Map,o=new Map,f={...bk,...a.handlers},c={all:d,applyData:zk,definitionById:r,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:f,one:p,options:a,patch:Lk,wrap:$k};return Bp(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?r:s,y=String(g.identifier).toUpperCase();m.has(y)||m.set(y,g)}}),c;function p(g,m){const y=g.type,v=c.handlers[y];if(dp.call(c.handlers,y)&&v)return v(c,g,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in g){const{children:M,...D}=g,k=go(D);return k.children=c.all(g),k}return go(g)}return(c.options.unknownHandler||Ik)(c,g,m)}function d(g){const m=[];if("children"in g){const y=g.children;let v=-1;for(;++v<y.length;){const N=c.one(y[v],g);if(N){if(v&&y[v-1].type==="break"&&(!Array.isArray(N)&&N.type==="text"&&(N.value=y1(N.value)),!Array.isArray(N)&&N.type==="element")){const M=N.children[0];M&&M.type==="text"&&(M.value=y1(M.value))}Array.isArray(N)?m.push(...N):m.push(N)}}}return m}}function Lk(e,i){e.position&&(i.position=gy(e))}function zk(e,i){let a=i;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const f="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:f}}a.type==="element"&&o&&Object.assign(a.properties,go(o)),"children"in a&&a.children&&s!==null&&s!==void 0&&(a.children=s)}return a}function Ik(e,i){const a=i.data||{},r="value"in i&&!(dp.call(a,"hProperties")||dp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function $k(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
19
+ `});++r<e.length;)r&&a.push({type:"text",value:`
20
+ `}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
21
+ `}),a}function y1(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function v1(e,i){const a=Rk(e,i),r=a.one(e,void 0),s=kk(a),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
22
+ `},s),o}function Hk(e,i){return e&&"run"in e?async function(a,r){const s=v1(a,{file:r,...i});await e.run(s,r)}:function(a,r){return v1(a,{file:r,...e||i})}}function S1(e){if(e)throw e}var Nh,N1;function Uk(){if(N1)return Nh;N1=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):i.call(d)==="[object Array]"},o=function(d){if(!d||i.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},f=function(d,g){a&&g.name==="__proto__"?a(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},c=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(r)return r(d,g).value}else return;return d[g]};return Nh=function p(){var d,g,m,y,v,N,M=arguments[0],D=1,k=arguments.length,U=!1;for(typeof M=="boolean"&&(U=M,M=arguments[1]||{},D=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});D<k;++D)if(d=arguments[D],d!=null)for(g in d)m=c(M,g),y=c(d,g),M!==y&&(U&&y&&(o(y)||(v=s(y)))?(v?(v=!1,N=m&&s(m)?m:[]):N=m&&o(m)?m:{},f(M,{name:g,newValue:p(U,N,y)})):typeof y<"u"&&f(M,{name:g,newValue:y}));return M},Nh}var Pk=Uk();const wh=Nc(Pk);function hp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qk(){const e=[],i={run:a,use:r};return i;function a(...s){let o=-1;const f=s.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);c(null,...s);function c(p,...d){const g=e[++o];let m=-1;if(p){f(p);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,g?Gk(g,c)(...d):f(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),i}}function Gk(e,i){let a;return r;function r(...f){const c=e.length>f.length;let p;c&&f.push(s);try{p=e.apply(this,f)}catch(d){const g=d;if(c&&a)throw g;return s(g)}c||(p&&p.then&&typeof p.then=="function"?p.then(o,s):p instanceof Error?s(p):o(p))}function s(f,...c){a||(a=!0,i(f,...c))}function o(f){s(null,f)}}const zi={basename:Vk,dirname:Kk,extname:Yk,join:Qk,sep:"/"};function Vk(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');vo(e);let a=0,r=-1,s=e.length,o;if(i===void 0||i.length===0||i.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let f=-1,c=i.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){a=s+1;break}}else f<0&&(o=!0,f=s+1),c>-1&&(e.codePointAt(s)===i.codePointAt(c--)?c<0&&(r=s):(c=-1,r=f));return a===r?r=f:r<0&&(r=e.length),e.slice(a,r)}function Kk(e){if(vo(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function Yk(e){vo(e);let i=e.length,a=-1,r=0,s=-1,o=0,f;for(;i--;){const c=e.codePointAt(i);if(c===47){if(f){r=i+1;break}continue}a<0&&(f=!0,a=i+1),c===46?s<0?s=i:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||a<0||o===0||o===1&&s===a-1&&s===r+1?"":e.slice(s,a)}function Qk(...e){let i=-1,a;for(;++i<e.length;)vo(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":Jk(a)}function Jk(e){vo(e);const i=e.codePointAt(0)===47;let a=Xk(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function Xk(e,i){let a="",r=0,s=-1,o=0,f=-1,c,p;for(;++f<=e.length;){if(f<e.length)c=e.codePointAt(f);else{if(c===47)break;c=47}if(c===47){if(!(s===f-1||o===1))if(s!==f-1&&o===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",r=0):(a=a.slice(0,p),r=a.length-1-a.lastIndexOf("/")),s=f,o=0;continue}}else if(a.length>0){a="",r=0,s=f,o=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(s+1,f):a=e.slice(s+1,f),r=f-s-1;s=f,o=0}else c===46&&o>-1?o++:o=-1}return a}function vo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Zk={cwd:Wk};function Wk(){return"/"}function pp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eA(e){if(typeof e=="string")e=new URL(e);else if(!pp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return tA(e)}function tA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(i)}const Ch=["history","path","basename","stem","extname","dirname"];class Uy{constructor(i){let a;i?pp(i)?a={path:i}:typeof i=="string"||nA(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":Zk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ch.length;){const o=Ch[r];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let s;for(s in a)Ch.includes(s)||(this[s]=a[s])}get basename(){return typeof this.path=="string"?zi.basename(this.path):void 0}set basename(i){kh(i,"basename"),Eh(i,"basename"),this.path=zi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?zi.dirname(this.path):void 0}set dirname(i){w1(this.basename,"dirname"),this.path=zi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?zi.extname(this.path):void 0}set extname(i){if(Eh(i,"extname"),w1(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){pp(i)&&(i=eA(i)),kh(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?zi.basename(this.path,this.extname):void 0}set stem(i){kh(i,"stem"),Eh(i,"stem"),this.path=zi.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const s=this.message(i,a,r);throw s.fatal=!0,s}info(i,a,r){const s=this.message(i,a,r);return s.fatal=void 0,s}message(i,a,r){const s=new Tn(i,a,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Eh(e,i){if(e&&e.includes(zi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+zi.sep+"`")}function kh(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function w1(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function nA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iA=(function(e){const r=this.constructor.prototype,s=r[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),aA={}.hasOwnProperty;class Rp extends iA{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=qk()}copy(){const i=new Rp;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(wh(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(jh("data",this.frozen),this.namespace[i]=a,this):aA.call(this.namespace,i)&&this.namespace[i]||void 0:i?(jh("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=a.call(i,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=Pu(i),r=this.parser||this.Parser;return Ah("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),Ah("process",this.parser||this.Parser),Mh("process",this.compiler||this.Compiler),a?s(void 0,a):new Promise(s);function s(o,f){const c=Pu(i),p=r.parse(c);r.run(p,c,function(g,m,y){if(g||!m||!y)return d(g);const v=m,N=r.stringify(v,y);sA(N)?y.value=N:y.result=N,d(g,y)});function d(g,m){g||!m?f(g):o?o(m):a(void 0,m)}}}processSync(i){let a=!1,r;return this.freeze(),Ah("processSync",this.parser||this.Parser),Mh("processSync",this.compiler||this.Compiler),this.process(i,s),E1("processSync","process",a),r;function s(o,f){a=!0,S1(o),r=f}}run(i,a,r){C1(i),this.freeze();const s=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?o(void 0,r):new Promise(o);function o(f,c){const p=Pu(a);s.run(i,p,d);function d(g,m,y){const v=m||i;g?c(g):f?f(v):r(void 0,v,y)}}}runSync(i,a){let r=!1,s;return this.run(i,a,o),E1("runSync","run",r),s;function o(f,c){S1(f),s=c,r=!0}}stringify(i,a){this.freeze();const r=Pu(a),s=this.compiler||this.Compiler;return Mh("stringify",s),C1(i),s(i,r)}use(i,...a){const r=this.attachers,s=this.namespace;if(jh("use",this.frozen),i!=null)if(typeof i=="function")p(i,a);else if(typeof i=="object")Array.isArray(i)?c(i):f(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function o(d){if(typeof d=="function")p(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;p(g,m)}else f(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function f(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(s.settings=wh(!0,s.settings,d.settings))}function c(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function p(d,g){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===d){y=m;break}if(y===-1)r.push([d,...g]);else if(g.length>0){let[v,...N]=g;const M=r[y][1];hp(M)&&hp(v)&&(v=wh(!0,M,v)),r[y]=[d,v,...N]}}}}const rA=new Rp().freeze();function Ah(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mh(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jh(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function C1(e){if(!hp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function E1(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Pu(e){return lA(e)?e:new Uy(e)}function lA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sA(e){return typeof e=="string"||oA(e)}function oA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",k1=[],A1={allowDangerousHtml:!0},cA=/^(https?|ircs?|mailto|xmpp)$/i,fA=[{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 dA(e){const i=hA(e),a=pA(e);return mA(i.runSync(i.parse(a),a),e)}function hA(e){const i=e.rehypePlugins||k1,a=e.remarkPlugins||k1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...A1}:A1;return rA().use(VE).use(a).use(Hk,r).use(i)}function pA(e){const i=e.children||"",a=new Uy;return typeof i=="string"&&(a.value=i),a}function mA(e,i){const a=i.allowedElements,r=i.allowElement,s=i.components,o=i.disallowedElements,f=i.skipHtml,c=i.unwrapDisallowed,p=i.urlTransform||gA;for(const g of fA)Object.hasOwn(i,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+uA+g.id,void 0);return Bp(e,d),jw(e,{Fragment:x.Fragment,components:s,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function d(g,m,y){if(g.type==="raw"&&y&&typeof m=="number")return f?y.children.splice(m,1):y.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let v;for(v in yh)if(Object.hasOwn(yh,v)&&Object.hasOwn(g.properties,v)){const N=g.properties[v],M=yh[v];(M===null||M.includes(g.tagName))&&(g.properties[v]=p(String(N||""),v,g))}}if(g.type==="element"){let v=a?!a.includes(g.tagName):o?o.includes(g.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(g,m,y)),v&&y&&typeof m=="number")return c&&g.children?y.children.splice(m,1,...g.children):y.children.splice(m,1),m}}}function gA(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return i===-1||s!==-1&&i>s||a!==-1&&i>a||r!==-1&&i>r||cA.test(e.slice(0,i))?e:""}const Dr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],M1={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Dr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Dr],h2:[["className","sr-only"]],img:[...Dr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Dr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Dr],table:[...Dr],ul:[...Dr,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Xa={}.hasOwnProperty;function xA(e,i){let a={type:"root",children:[]};const r={schema:i?{...M1,...i}:M1,stack:[]},s=Py(r,e);return s&&(Array.isArray(s)?s.length===1?a=s[0]:a.children=s:a=s),a}function Py(e,i){if(i&&typeof i=="object"){const a=i;switch(typeof a.type=="string"?a.type:""){case"comment":return bA(e,a);case"doctype":return yA(e,a);case"element":return vA(e,a);case"root":return SA(e,a);case"text":return NA(e,a)}}}function bA(e,i){if(e.schema.allowComments){const a=typeof i.value=="string"?i.value:"",r=a.indexOf("-->"),o={type:"comment",value:r<0?a:a.slice(0,r)};return So(o,i),o}}function yA(e,i){if(e.schema.allowDoctypes){const a={type:"doctype"};return So(a,i),a}}function vA(e,i){const a=typeof i.tagName=="string"?i.tagName:"";e.stack.push(a);const r=qy(e,i.children),s=wA(e,i.properties);e.stack.pop();let o=!1;if(a&&a!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(a))&&(o=!0,e.schema.ancestors&&Xa.call(e.schema.ancestors,a))){const c=e.schema.ancestors[a];let p=-1;for(o=!1;++p<c.length;)e.stack.includes(c[p])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(a)?r:void 0;const f={type:"element",tagName:a,properties:s,children:r};return So(f,i),f}function SA(e,i){const r={type:"root",children:qy(e,i.children)};return So(r,i),r}function NA(e,i){const r={type:"text",value:typeof i.value=="string"?i.value:""};return So(r,i),r}function qy(e,i){const a=[];if(Array.isArray(i)){const r=i;let s=-1;for(;++s<r.length;){const o=Py(e,r[s]);o&&(Array.isArray(o)?a.push(...o):a.push(o))}}return a}function wA(e,i){const a=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,o=r&&Xa.call(r,a)?r[a]:void 0,f=r&&Xa.call(r,"*")?r["*"]:void 0,c=i&&typeof i=="object"?i:{},p={};let d;for(d in c)if(Xa.call(c,d)){const g=c[d];let m=j1(e,T1(o,d),d,g);m==null&&(m=j1(e,T1(f,d),d,g)),m!=null&&(p[d]=m)}if(s&&Xa.call(s,a)){const g=s[a];for(d in g)Xa.call(g,d)&&!Xa.call(p,d)&&(p[d]=g[d])}return p}function j1(e,i,a,r){return i?Array.isArray(r)?CA(e,i,a,r):Gy(e,i,a,r):void 0}function CA(e,i,a,r){let s=-1;const o=[];for(;++s<r.length;){const f=Gy(e,i,a,r[s]);(typeof f=="number"||typeof f=="string")&&o.push(f)}return o}function Gy(e,i,a,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&EA(e,a,r)){if(typeof i=="object"&&i.length>1){let s=!1,o=0;for(;++o<i.length;){const f=i[o];if(f&&typeof f=="object"&&"flags"in f){if(f.test(String(r))){s=!0;break}}else if(f===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(a)?e.schema.clobberPrefix+r:r}}function EA(e,i,a){const r=e.schema.protocols&&Xa.call(e.schema.protocols,i)?e.schema.protocols[i]:void 0;if(!r||r.length===0)return!0;const s=String(a),o=s.indexOf(":"),f=s.indexOf("?"),c=s.indexOf("#"),p=s.indexOf("/");if(o<0||p>-1&&o>p||f>-1&&o>f||c>-1&&o>c)return!0;let d=-1;for(;++d<r.length;){const g=r[d];if(o===g.length&&s.slice(0,g.length)===g)return!0}return!1}function So(e,i){const a=gy(i);i.data&&(e.data=go(i.data)),a&&(e.position=a)}function T1(e,i){let a,r=-1;if(e)for(;++r<e.length;){const s=e[r],o=typeof s=="string"?s:s[0];if(o===i)return s;o==="data*"&&(a=s)}if(i.length>4&&i.slice(0,4).toLowerCase()==="data")return a}function kA(e){return function(i){return xA(i,e)}}function D1(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,s=a.indexOf(i);for(;s!==-1;)r++,s=a.indexOf(i,s+i.length);return r}function AA(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function MA(e,i,a){const s=jc((a||{}).ignore||[]),o=jA(i);let f=-1;for(;++f<o.length;)Hy(e,"text",c);function c(d,g){let m=-1,y;for(;++m<g.length;){const v=g[m],N=y?y.children:void 0;if(s(v,N?N.indexOf(v):void 0,y))return;y=v}if(y)return p(d,g)}function p(d,g){const m=g[g.length-1],y=o[f][0],v=o[f][1];let N=0;const D=m.children.indexOf(d);let k=!1,U=[];y.lastIndex=0;let T=y.exec(d.value);for(;T;){const Q=T.index,ee={index:T.index,input:T.input,stack:[...g,d]};let R=v(...T,ee);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?y.lastIndex=Q+1:(N!==Q&&U.push({type:"text",value:d.value.slice(N,Q)}),Array.isArray(R)?U.push(...R):R&&U.push(R),N=Q+T[0].length,k=!0),!y.global)break;T=y.exec(d.value)}return k?(N<d.value.length&&U.push({type:"text",value:d.value.slice(N)}),m.children.splice(D,1,...U)):U=[d],D+U.length}}function jA(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const s=a[r];i.push([TA(s[0]),DA(s[1])])}return i}function TA(e){return typeof e=="string"?new RegExp(AA(e),"g"):e}function DA(e){return typeof e=="function"?e:function(){return e}}const Th="phrasing",Dh=["autolink","link","image","label"];function OA(){return{transforms:[IA],enter:{literalAutolink:FA,literalAutolinkEmail:Oh,literalAutolinkHttp:Oh,literalAutolinkWww:Oh},exit:{literalAutolink:zA,literalAutolinkEmail:LA,literalAutolinkHttp:BA,literalAutolinkWww:RA}}}function _A(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Th,notInConstruct:Dh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Th,notInConstruct:Dh},{character:":",before:"[ps]",after:"\\/",inConstruct:Th,notInConstruct:Dh}]}}function FA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Oh(e){this.config.enter.autolinkProtocol.call(this,e)}function BA(e){this.config.exit.autolinkProtocol.call(this,e)}function RA(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function LA(e){this.config.exit.autolinkEmail.call(this,e)}function zA(e){this.exit(e)}function IA(e){MA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$A],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),HA]],{ignore:["link","linkReference"]})}function $A(e,i,a,r,s){let o="";if(!Vy(s)||(/^w/i.test(i)&&(a=i+a,i="",o="http://"),!UA(a)))return!1;const f=PA(a+r);if(!f[0])return!1;const c={type:"link",title:null,url:o+i+f[0],children:[{type:"text",value:i+f[0]}]};return f[1]?[c,{type:"text",value:f[1]}]:c}function HA(e,i,a,r){return!Vy(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function UA(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function PA(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const s=D1(e,"(");let o=D1(e,")");for(;r!==-1&&s>o;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),o++;return[e,a]}function Vy(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Hr(a)||kc(a))&&(!i||a!==47)}Ky.peek=ZA;function qA(){this.buffer()}function GA(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function VA(){this.buffer()}function KA(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function YA(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ei(this.sliceSerialize(e)).toLowerCase(),a.label=i}function QA(e){this.exit(e)}function JA(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ei(this.sliceSerialize(e)).toLowerCase(),a.label=i}function XA(e){this.exit(e)}function ZA(){return"["}function Ky(e,i,a,r){const s=a.createTracker(r);let o=s.move("[^");const f=a.enter("footnoteReference"),c=a.enter("reference");return o+=s.move(a.safe(a.associationId(e),{after:"]",before:o})),c(),f(),o+=s.move("]"),o}function WA(){return{enter:{gfmFootnoteCallString:qA,gfmFootnoteCall:GA,gfmFootnoteDefinitionLabelString:VA,gfmFootnoteDefinition:KA},exit:{gfmFootnoteCallString:YA,gfmFootnoteCall:QA,gfmFootnoteDefinitionLabelString:JA,gfmFootnoteDefinition:XA}}}function e3(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Ky},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,s,o,f){const c=o.createTracker(f);let p=c.move("[^");const d=o.enter("footnoteDefinition"),g=o.enter("label");return p+=c.move(o.safe(o.associationId(r),{before:p,after:"]"})),g(),p+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),p+=c.move((i?`
23
+ `:" ")+o.indentLines(o.containerFlow(r,c.current()),i?Yy:t3))),d(),p}}function t3(e,i,a){return i===0?e:Yy(e,i,a)}function Yy(e,i,a){return(a?"":" ")+e}const n3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qy.peek=s3;function i3(){return{canContainEols:["delete"],enter:{strikethrough:r3},exit:{strikethrough:l3}}}function a3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:n3}],handlers:{delete:Qy}}}function r3(e){this.enter({type:"delete",children:[]},e)}function l3(e){this.exit(e)}function Qy(e,i,a,r){const s=a.createTracker(r),o=a.enter("strikethrough");let f=s.move("~~");return f+=a.containerPhrasing(e,{...s.current(),before:f,after:"~"}),f+=s.move("~~"),o(),f}function s3(){return"~"}function o3(e){return e.length}function u3(e,i){const a=i||{},r=(a.align||[]).concat(),s=a.stringLength||o3,o=[],f=[],c=[],p=[];let d=0,g=-1;for(;++g<e.length;){const M=[],D=[];let k=-1;for(e[g].length>d&&(d=e[g].length);++k<e[g].length;){const U=c3(e[g][k]);if(a.alignDelimiters!==!1){const T=s(U);D[k]=T,(p[k]===void 0||T>p[k])&&(p[k]=T)}M.push(U)}f[g]=M,c[g]=D}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)o[m]=O1(r[m]);else{const M=O1(r);for(;++m<d;)o[m]=M}m=-1;const y=[],v=[];for(;++m<d;){const M=o[m];let D="",k="";M===99?(D=":",k=":"):M===108?D=":":M===114&&(k=":");let U=a.alignDelimiters===!1?1:Math.max(1,p[m]-D.length-k.length);const T=D+"-".repeat(U)+k;a.alignDelimiters!==!1&&(U=D.length+U+k.length,U>p[m]&&(p[m]=U),v[m]=U),y[m]=T}f.splice(1,0,y),c.splice(1,0,v),g=-1;const N=[];for(;++g<f.length;){const M=f[g],D=c[g];m=-1;const k=[];for(;++m<d;){const U=M[m]||"";let T="",Q="";if(a.alignDelimiters!==!1){const ee=p[m]-(D[m]||0),R=o[m];R===114?T=" ".repeat(ee):R===99?ee%2?(T=" ".repeat(ee/2+.5),Q=" ".repeat(ee/2-.5)):(T=" ".repeat(ee/2),Q=T):Q=" ".repeat(ee)}a.delimiterStart!==!1&&!m&&k.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&U==="")&&(a.delimiterStart!==!1||m)&&k.push(" "),a.alignDelimiters!==!1&&k.push(T),k.push(U),a.alignDelimiters!==!1&&k.push(Q),a.padding!==!1&&k.push(" "),(a.delimiterEnd!==!1||m!==d-1)&&k.push("|")}N.push(a.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return N.join(`
24
+ `)}function c3(e){return e==null?"":String(e)}function O1(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function f3(e,i,a,r){const s=a.enter("blockquote"),o=a.createTracker(r);o.move("> "),o.shift(2);const f=a.indentLines(a.containerFlow(e,o.current()),d3);return s(),f}function d3(e,i,a){return">"+(a?"":" ")+e}function h3(e,i){return _1(e,i.inConstruct,!0)&&!_1(e,i.notInConstruct,!1)}function _1(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function F1(e,i,a,r){let s=-1;for(;++s<a.unsafe.length;)if(a.unsafe[s].character===`
25
+ `&&h3(a.stack,a.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
26
+ `}function p3(e,i){const a=String(e);let r=a.indexOf(i),s=r,o=0,f=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>f&&(f=o):o=1,s=r+i.length,r=a.indexOf(i,s);return f}function m3(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function g3(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function x3(e,i,a,r){const s=g3(a),o=e.value||"",f=s==="`"?"GraveAccent":"Tilde";if(m3(e,a)){const m=a.enter("codeIndented"),y=a.indentLines(o,b3);return m(),y}const c=a.createTracker(r),p=s.repeat(Math.max(p3(o,s)+1,3)),d=a.enter("codeFenced");let g=c.move(p);if(e.lang){const m=a.enter(`codeFencedLang${f}`);g+=c.move(a.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),m()}if(e.lang&&e.meta){const m=a.enter(`codeFencedMeta${f}`);g+=c.move(" "),g+=c.move(a.safe(e.meta,{before:g,after:`
27
+ `,encode:["`"],...c.current()})),m()}return g+=c.move(`
28
+ `),o&&(g+=c.move(o+`
29
+ `)),g+=c.move(p),d(),g}function b3(e,i,a){return(a?"":" ")+e}function Lp(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function y3(e,i,a,r){const s=Lp(a),o=s==='"'?"Quote":"Apostrophe",f=a.enter("definition");let c=a.enter("label");const p=a.createTracker(r);let d=p.move("[");return d+=p.move(a.safe(a.associationId(e),{before:d,after:"]",...p.current()})),d+=p.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=a.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(a.safe(e.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(c=a.enter("destinationRaw"),d+=p.move(a.safe(e.url,{before:d,after:e.title?" ":`
30
+ `,...p.current()}))),c(),e.title&&(c=a.enter(`title${o}`),d+=p.move(" "+s),d+=p.move(a.safe(e.title,{before:d,after:s,...p.current()})),d+=p.move(s),c()),f(),d}function v3(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function xo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fc(e,i,a){const r=Pl(e),s=Pl(i);return r===void 0?s===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}Jy.peek=S3;function Jy(e,i,a,r){const s=v3(a),o=a.enter("emphasis"),f=a.createTracker(r),c=f.move(s);let p=f.move(a.containerPhrasing(e,{after:s,before:c,...f.current()}));const d=p.charCodeAt(0),g=fc(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(p=xo(d)+p.slice(1));const m=p.charCodeAt(p.length-1),y=fc(r.after.charCodeAt(0),m,s);y.inside&&(p=p.slice(0,-1)+xo(m));const v=f.move(s);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},c+p+v}function S3(e,i,a){return a.options.emphasis||"*"}function N3(e,i){let a=!1;return Bp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,fp}),!!((!e.depth||e.depth<3)&&Mp(e)&&(i.options.setext||a))}function w3(e,i,a,r){const s=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(r);if(N3(e,a)){const g=a.enter("headingSetext"),m=a.enter("phrasing"),y=a.containerPhrasing(e,{...o.current(),before:`
31
+ `,after:`
32
+ `});return m(),g(),y+`
33
+ `+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
34
+ `))+1))}const f="#".repeat(s),c=a.enter("headingAtx"),p=a.enter("phrasing");o.move(f+" ");let d=a.containerPhrasing(e,{before:"# ",after:`
35
+ `,...o.current()});return/^[\t ]/.test(d)&&(d=xo(d.charCodeAt(0))+d.slice(1)),d=d?f+" "+d:f,a.options.closeAtx&&(d+=" "+f),p(),c(),d}Xy.peek=C3;function Xy(e){return e.value||""}function C3(){return"<"}Zy.peek=E3;function Zy(e,i,a,r){const s=Lp(a),o=s==='"'?"Quote":"Apostrophe",f=a.enter("image");let c=a.enter("label");const p=a.createTracker(r);let d=p.move("![");return d+=p.move(a.safe(e.alt,{before:d,after:"]",...p.current()})),d+=p.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=a.enter("destinationLiteral"),d+=p.move("<"),d+=p.move(a.safe(e.url,{before:d,after:">",...p.current()})),d+=p.move(">")):(c=a.enter("destinationRaw"),d+=p.move(a.safe(e.url,{before:d,after:e.title?" ":")",...p.current()}))),c(),e.title&&(c=a.enter(`title${o}`),d+=p.move(" "+s),d+=p.move(a.safe(e.title,{before:d,after:s,...p.current()})),d+=p.move(s),c()),d+=p.move(")"),f(),d}function E3(){return"!"}Wy.peek=k3;function Wy(e,i,a,r){const s=e.referenceType,o=a.enter("imageReference");let f=a.enter("label");const c=a.createTracker(r);let p=c.move("![");const d=a.safe(e.alt,{before:p,after:"]",...c.current()});p+=c.move(d+"]["),f();const g=a.stack;a.stack=[],f=a.enter("reference");const m=a.safe(a.associationId(e),{before:p,after:"]",...c.current()});return f(),a.stack=g,o(),s==="full"||!d||d!==m?p+=c.move(m+"]"):s==="shortcut"?p=p.slice(0,-1):p+=c.move("]"),p}function k3(){return"!"}ev.peek=A3;function ev(e,i,a){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<a.unsafe.length;){const f=a.unsafe[o],c=a.compilePattern(f);let p;if(f.atBreak)for(;p=c.exec(r);){let d=p.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(p.index+1)}}return s+r+s}function A3(){return"`"}function tv(e,i){const a=Mp(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nv.peek=M3;function nv(e,i,a,r){const s=Lp(a),o=s==='"'?"Quote":"Apostrophe",f=a.createTracker(r);let c,p;if(tv(e,a)){const g=a.stack;a.stack=[],c=a.enter("autolink");let m=f.move("<");return m+=f.move(a.containerPhrasing(e,{before:m,after:">",...f.current()})),m+=f.move(">"),c(),a.stack=g,m}c=a.enter("link"),p=a.enter("label");let d=f.move("[");return d+=f.move(a.containerPhrasing(e,{before:d,after:"](",...f.current()})),d+=f.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(a.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(p=a.enter("destinationRaw"),d+=f.move(a.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),p(),e.title&&(p=a.enter(`title${o}`),d+=f.move(" "+s),d+=f.move(a.safe(e.title,{before:d,after:s,...f.current()})),d+=f.move(s),p()),d+=f.move(")"),c(),d}function M3(e,i,a){return tv(e,a)?"<":"["}iv.peek=j3;function iv(e,i,a,r){const s=e.referenceType,o=a.enter("linkReference");let f=a.enter("label");const c=a.createTracker(r);let p=c.move("[");const d=a.containerPhrasing(e,{before:p,after:"]",...c.current()});p+=c.move(d+"]["),f();const g=a.stack;a.stack=[],f=a.enter("reference");const m=a.safe(a.associationId(e),{before:p,after:"]",...c.current()});return f(),a.stack=g,o(),s==="full"||!d||d!==m?p+=c.move(m+"]"):s==="shortcut"?p=p.slice(0,-1):p+=c.move("]"),p}function j3(){return"["}function zp(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function T3(e){const i=zp(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function D3(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function av(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function O3(e,i,a,r){const s=a.enter("list"),o=a.bulletCurrent;let f=e.ordered?D3(a):zp(a);const c=e.ordered?f==="."?")":".":T3(a);let p=i&&a.bulletLastUsed?f===a.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),av(a)===f&&g){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=c),a.bulletCurrent=f;const d=a.containerFlow(e,r);return a.bulletLastUsed=f,a.bulletCurrent=o,s(),d}function _3(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function F3(e,i,a,r){const s=_3(a);let o=a.bulletCurrent||zp(a);i&&i.type==="list"&&i.ordered&&(o=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+o);let f=o.length+1;(s==="tab"||s==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(f=Math.ceil(f/4)*4);const c=a.createTracker(r);c.move(o+" ".repeat(f-o.length)),c.shift(f);const p=a.enter("listItem"),d=a.indentLines(a.containerFlow(e,c.current()),g);return p(),d;function g(m,y,v){return y?(v?"":" ".repeat(f))+m:(v?o:o+" ".repeat(f-o.length))+m}}function B3(e,i,a,r){const s=a.enter("paragraph"),o=a.enter("phrasing"),f=a.containerPhrasing(e,r);return o(),s(),f}const R3=jc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function L3(e,i,a,r){return(e.children.some(function(f){return R3(f)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function z3(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}rv.peek=I3;function rv(e,i,a,r){const s=z3(a),o=a.enter("strong"),f=a.createTracker(r),c=f.move(s+s);let p=f.move(a.containerPhrasing(e,{after:s,before:c,...f.current()}));const d=p.charCodeAt(0),g=fc(r.before.charCodeAt(r.before.length-1),d,s);g.inside&&(p=xo(d)+p.slice(1));const m=p.charCodeAt(p.length-1),y=fc(r.after.charCodeAt(0),m,s);y.inside&&(p=p.slice(0,-1)+xo(m));const v=f.move(s+s);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},c+p+v}function I3(e,i,a){return a.options.strong||"*"}function $3(e,i,a,r){return a.safe(e.value,r)}function H3(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function U3(e,i,a){const r=(av(a)+(a.options.ruleSpaces?" ":"")).repeat(H3(a));return a.options.ruleSpaces?r.slice(0,-1):r}const lv={blockquote:f3,break:F1,code:x3,definition:y3,emphasis:Jy,hardBreak:F1,heading:w3,html:Xy,image:Zy,imageReference:Wy,inlineCode:ev,link:nv,linkReference:iv,list:O3,listItem:F3,paragraph:B3,root:L3,strong:rv,text:$3,thematicBreak:U3};function P3(){return{enter:{table:q3,tableData:B1,tableHeader:B1,tableRow:V3},exit:{codeText:K3,table:G3,tableData:_h,tableHeader:_h,tableRow:_h}}}function q3(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function G3(e){this.exit(e),this.data.inTable=void 0}function V3(e){this.enter({type:"tableRow",children:[]},e)}function _h(e){this.exit(e)}function B1(e){this.enter({type:"tableCell",children:[]},e)}function K3(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,Y3));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function Y3(e,i){return i==="|"?i:e}function Q3(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,s=i.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
36
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:f,tableCell:p,tableRow:c}};function f(v,N,M,D){return d(g(v,M,D),v.align)}function c(v,N,M,D){const k=m(v,M,D),U=d([k]);return U.slice(0,U.indexOf(`
37
+ `))}function p(v,N,M,D){const k=M.enter("tableCell"),U=M.enter("phrasing"),T=M.containerPhrasing(v,{...D,before:o,after:o});return U(),k(),T}function d(v,N){return u3(v,{align:N,alignDelimiters:r,padding:a,stringLength:s})}function g(v,N,M){const D=v.children;let k=-1;const U=[],T=N.enter("table");for(;++k<D.length;)U[k]=m(D[k],N,M);return T(),U}function m(v,N,M){const D=v.children;let k=-1;const U=[],T=N.enter("tableRow");for(;++k<D.length;)U[k]=p(D[k],v,N,M);return T(),U}function y(v,N,M){let D=lv.inlineCode(v,N,M);return M.stack.includes("tableCell")&&(D=D.replace(/\|/g,"\\$&")),D}}function J3(){return{exit:{taskListCheckValueChecked:R1,taskListCheckValueUnchecked:R1,paragraph:Z3}}}function X3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:W3}}}function R1(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function Z3(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const s=i.children;let o=-1,f;for(;++o<s.length;){const c=s[o];if(c.type==="paragraph"){f=c;break}}f===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function W3(e,i,a,r){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",f="["+(e.checked?"x":" ")+"] ",c=a.createTracker(r);o&&c.move(f);let p=lv.listItem(e,i,a,{...r,...c.current()});return o&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),p;function d(g){return g+f}}function eM(){return[OA(),WA(),i3(),P3(),J3()]}function tM(e){return{extensions:[_A(),e3(e),a3(),Q3(e),X3()]}}const nM={tokenize:oM,partial:!0},sv={tokenize:uM,partial:!0},ov={tokenize:cM,partial:!0},uv={tokenize:fM,partial:!0},iM={tokenize:dM,partial:!0},cv={name:"wwwAutolink",tokenize:lM,previous:dv},fv={name:"protocolAutolink",tokenize:sM,previous:hv},ba={name:"emailAutolink",tokenize:rM,previous:pv},Ui={};function aM(){return{text:Ui}}let Or=48;for(;Or<123;)Ui[Or]=ba,Or++,Or===58?Or=65:Or===91&&(Or=97);Ui[43]=ba;Ui[45]=ba;Ui[46]=ba;Ui[95]=ba;Ui[72]=[ba,fv];Ui[104]=[ba,fv];Ui[87]=[ba,cv];Ui[119]=[ba,cv];function rM(e,i,a){const r=this;let s,o;return f;function f(m){return!mp(m)||!pv.call(r,r.previous)||Ip(r.events)?a(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(m))}function c(m){return mp(m)?(e.consume(m),c):m===64?(e.consume(m),p):a(m)}function p(m){return m===46?e.check(iM,g,d)(m):m===45||m===95||jn(m)?(o=!0,e.consume(m),p):g(m)}function d(m){return e.consume(m),s=!0,p}function g(m){return o&&s&&Bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(m)):a(m)}}function lM(e,i,a){const r=this;return s;function s(f){return f!==87&&f!==119||!dv.call(r,r.previous)||Ip(r.events)?a(f):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nM,e.attempt(sv,e.attempt(ov,o),a),a)(f))}function o(f){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(f)}}function sM(e,i,a){const r=this;let s="",o=!1;return f;function f(m){return(m===72||m===104)&&hv.call(r,r.previous)&&!Ip(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),c):a(m)}function c(m){if(Bn(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),c;if(m===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(m),p}return a(m)}function p(m){return m===47?(e.consume(m),o?d:(o=!0,p)):a(m)}function d(m){return m===null||uc(m)||Ft(m)||Hr(m)||kc(m)?a(m):e.attempt(sv,e.attempt(ov,g),a)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(m)}}function oM(e,i,a){let r=0;return s;function s(f){return(f===87||f===119)&&r<3?(r++,e.consume(f),s):f===46&&r===3?(e.consume(f),o):a(f)}function o(f){return f===null?a(f):i(f)}}function uM(e,i,a){let r,s,o;return f;function f(d){return d===46||d===95?e.check(uv,p,c)(d):d===null||Ft(d)||Hr(d)||d!==45&&kc(d)?p(d):(o=!0,e.consume(d),f)}function c(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),f}function p(d){return s||r||!o?a(d):i(d)}}function cM(e,i){let a=0,r=0;return s;function s(f){return f===40?(a++,e.consume(f),s):f===41&&r<a?o(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?e.check(uv,i,o)(f):f===null||Ft(f)||Hr(f)?i(f):(e.consume(f),s)}function o(f){return f===41&&r++,e.consume(f),s}}function fM(e,i,a){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),s):c===60||c===null||Ft(c)||Hr(c)?i(c):a(c)}function s(c){return c===null||c===40||c===91||Ft(c)||Hr(c)?i(c):r(c)}function o(c){return Bn(c)?f(c):a(c)}function f(c){return c===59?(e.consume(c),r):Bn(c)?(e.consume(c),f):a(c)}}function dM(e,i,a){return r;function r(o){return e.consume(o),s}function s(o){return jn(o)?a(o):i(o)}}function dv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ft(e)}function hv(e){return!Bn(e)}function pv(e){return!(e===47||mp(e))}function mp(e){return e===43||e===45||e===46||e===95||jn(e)}function Ip(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const hM={tokenize:SM,partial:!0};function pM(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:bM,continuation:{tokenize:yM},exit:vM}},text:{91:{name:"gfmFootnoteCall",tokenize:xM},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:mM,resolveTo:gM}}}}function mM(e,i,a){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let f;for(;s--;){const p=r.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 c;function c(p){if(!f||!f._balanced)return a(p);const d=Ei(r.sliceSerialize({start:f.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),i(p))}}function gM(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",s,i],["exit",s,i],["enter",o,i],["enter",f,i],["exit",f,i],["exit",o,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...c),e}function xM(e,i,a){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,f;return c;function c(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?a(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!f||m===null||m===91||Ft(m))return a(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Ei(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(m)}return Ft(m)||(f=!0),o++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function bM(e,i,a){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,f=0,c;return p;function p(N){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(N){return N===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):a(N)}function g(N){if(f>999||N===93&&!c||N===null||N===91||Ft(N))return a(N);if(N===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return o=Ei(r.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ft(N)||(c=!0),f++,e.consume(N),N===92?m:g}function m(N){return N===91||N===92||N===93?(e.consume(N),f++,g):g(N)}function y(N){return N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),s.includes(o)||s.push(o),gt(e,v,"gfmFootnoteDefinitionWhitespace")):a(N)}function v(N){return i(N)}}function yM(e,i,a){return e.check(yo,i,e.attempt(hM,i,a))}function vM(e){e.exit("gfmFootnoteDefinition")}function SM(e,i,a){const r=this;return gt(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const f=r.events[r.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?i(o):a(o)}}function NM(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(f,c){let p=-1;for(;++p<f.length;)if(f[p][0]==="enter"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._close){let d=p;for(;d--;)if(f[d][0]==="exit"&&f[d][1].type==="strikethroughSequenceTemporary"&&f[d][1]._open&&f[p][1].end.offset-f[p][1].start.offset===f[d][1].end.offset-f[d][1].start.offset){f[p][1].type="strikethroughSequence",f[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},f[d][1].start),end:Object.assign({},f[p][1].end)},m={type:"strikethroughText",start:Object.assign({},f[d][1].end),end:Object.assign({},f[p][1].start)},y=[["enter",g,c],["enter",f[d][1],c],["exit",f[d][1],c],["enter",m,c]],v=c.parser.constructs.insideSpan.null;v&&ii(y,y.length,0,Ac(v,f.slice(d+1,p),c)),ii(y,y.length,0,[["exit",m,c],["enter",f[p][1],c],["exit",f[p][1],c],["exit",g,c]]),ii(f,d-1,p-d+3,y),p=d+y.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function o(f,c,p){const d=this.previous,g=this.events;let m=0;return y;function y(N){return d===126&&g[g.length-1][1].type!=="characterEscape"?p(N):(f.enter("strikethroughSequenceTemporary"),v(N))}function v(N){const M=Pl(d);if(N===126)return m>1?p(N):(f.consume(N),m++,v);if(m<2&&!a)return p(N);const D=f.exit("strikethroughSequenceTemporary"),k=Pl(N);return D._open=!k||k===2&&!!M,D._close=!M||M===2&&!!k,c(N)}}}class wM{constructor(){this.map=[]}add(i,a,r){CM(this,i,a,r)}consume(i){if(this.map.sort(function(o,f){return o[0]-f[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let s=r.pop();for(;s;){for(const o of s)i.push(o);s=r.pop()}this.map.length=0}}function CM(e,i,a,r){let s=0;if(!(a===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===i){e.map[s][1]+=a,e.map[s][2].push(...r);return}s+=1}e.map.push([i,a,r])}}function EM(e,i){let a=!1;const r=[];for(;i<e.length;){const s=e[i];if(a){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function kM(){return{flow:{null:{name:"table",tokenize:AM,resolveAll:MM}}}}function AM(e,i,a){const r=this;let s=0,o=0,f;return c;function c(j){let P=r.events.length-1;for(;P>-1;){const H=r.events[P][1].type;if(H==="lineEnding"||H==="linePrefix")P--;else break}const q=P>-1?r.events[P][1].type:null,W=q==="tableHead"||q==="tableRow"?R:p;return W===R&&r.parser.lazy[r.now().line]?a(j):W(j)}function p(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(f=!0,o+=1),g(j)}function g(j){return j===null?a(j):Ie(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),v):a(j):ut(j)?gt(e,g,"whitespace")(j):(o+=1,f&&(f=!1,s+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),f=!0,g):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Ft(j)?(e.exit("data"),g(j)):(e.consume(j),j===92?y:m)}function y(j){return j===92||j===124?(e.consume(j),m):m(j)}function v(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(j):(e.enter("tableDelimiterRow"),f=!1,ut(j)?gt(e,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):N(j))}function N(j){return j===45||j===58?D(j):j===124?(f=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),M):ee(j)}function M(j){return ut(j)?gt(e,D,"whitespace")(j):D(j)}function D(j){return j===58?(o+=1,f=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),k):j===45?(o+=1,k(j)):j===null||Ie(j)?Q(j):ee(j)}function k(j){return j===45?(e.enter("tableDelimiterFiller"),U(j)):ee(j)}function U(j){return j===45?(e.consume(j),U):j===58?(f=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?gt(e,Q,"whitespace")(j):Q(j)}function Q(j){return j===124?N(j):j===null||Ie(j)?!f||s!==o?ee(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(j)):ee(j)}function ee(j){return a(j)}function R(j){return e.enter("tableRow"),F(j)}function F(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),F):j===null||Ie(j)?(e.exit("tableRow"),i(j)):ut(j)?gt(e,F,"whitespace")(j):(e.enter("data"),I(j))}function I(j){return j===null||j===124||Ft(j)?(e.exit("data"),F(j)):(e.consume(j),j===92?K:I)}function K(j){return j===92||j===124?(e.consume(j),I):I(j)}}function MM(e,i){let a=-1,r=!0,s=0,o=[0,0,0,0],f=[0,0,0,0],c=!1,p=0,d,g,m;const y=new wM;for(;++a<e.length;){const v=e[a],N=v[1];v[0]==="enter"?N.type==="tableHead"?(c=!1,p!==0&&(L1(y,i,p,d,g),g=void 0,p=0),d={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",d,i]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],f=[0,a+1,0,0],c&&(c=!1,g={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",g,i]])),s=N.type==="tableDelimiterRow"?2:g?3:1):s&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(r=!1,f[2]===0&&(o[1]!==0&&(f[0]=f[1],m=qu(y,i,o,s,void 0,m),o=[0,0,0,0]),f[2]=a)):N.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(f[0]=f[1],m=qu(y,i,o,s,void 0,m)),o=f,f=[o[1],a,0,0])):N.type==="tableHead"?(c=!0,p=a):N.type==="tableRow"||N.type==="tableDelimiterRow"?(p=a,o[1]!==0?(f[0]=f[1],m=qu(y,i,o,s,a,m)):f[1]!==0&&(m=qu(y,i,f,s,a,m)),s=0):s&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(f[3]=a)}for(p!==0&&L1(y,i,p,d,g),y.consume(i.events),a=-1;++a<i.events.length;){const v=i.events[a];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=EM(i.events,a))}return e}function qu(e,i,a,r,s,o){const f=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";a[0]!==0&&(o.end=Object.assign({},Il(i.events,a[0])),e.add(a[0],0,[["exit",o,i]]));const p=Il(i.events,a[1]);if(o={type:f,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",o,i]]),a[2]!==0){const d=Il(i.events,a[2]),g=Il(i.events,a[3]),m={type:c,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(a[2],0,[["enter",m,i]]),r!==2){const y=i.events[a[2]],v=i.events[a[3]];if(y[1].end=Object.assign({},v[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const N=a[2]+1,M=a[3]-a[2]-1;e.add(N,M,[])}}e.add(a[3]+1,0,[["exit",m,i]])}return s!==void 0&&(o.end=Object.assign({},Il(i.events,s)),e.add(s,0,[["exit",o,i]]),o=void 0),o}function L1(e,i,a,r,s){const o=[],f=Il(i.events,a);s&&(s.end=Object.assign({},f),o.push(["exit",s,i])),r.end=Object.assign({},f),o.push(["exit",r,i]),e.add(a+1,0,o)}function Il(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const jM={name:"tasklistCheck",tokenize:DM};function TM(){return{text:{91:jM}}}function DM(e,i,a){const r=this;return s;function s(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),o)}function o(p){return Ft(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),f):a(p)}function f(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):a(p)}function c(p){return Ie(p)?i(p):ut(p)?e.check({tokenize:OM},i,a)(p):a(p)}}function OM(e,i,a){return gt(e,r,"whitespace");function r(s){return s===null?a(s):i(s)}}function _M(e){return Ny([aM(),pM(),NM(e),kM(),TM()])}const FM={};function BM(e){const i=this,a=e||FM,r=i.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),f=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(_M(a)),o.push(eM()),f.push(tM(a))}const RM="modulepreload",LM=function(e){return"/"+e},z1={},qt=function(i,a,r){let s=Promise.resolve();if(a&&a.length>0){let d=function(g){return Promise.all(g.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};var f=d;document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),p=c?.nonce||c?.getAttribute("nonce");s=d(a.map(g=>{if(g=LM(g),g in z1)return;z1[g]=!0;const m=g.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${y}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":RM,m||(v.as="script"),v.crossOrigin="",v.href=g,p&&v.setAttribute("nonce",p),document.head.appendChild(v),m)return new Promise((N,M)=>{v.addEventListener("load",N),v.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${g}`)))})}))}function o(c){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=c,window.dispatchEvent(p),!p.defaultPrevented)throw c}return s.then(c=>{for(const p of c||[])p.status==="rejected"&&o(p.reason);return i().catch(o)})},{slice:zM,forEach:IM}=[];function $M(e){return IM.call(zM.call(arguments,1),i=>{if(i)for(const a in i)e[a]===void 0&&(e[a]=i[a])}),e}function HM(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(a=>a.test(e))}const I1=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,UM=function(e,i){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(i);let o=`${e}=${s}`;if(r.maxAge>0){const f=r.maxAge-0;if(Number.isNaN(f))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(f)}`}if(r.domain){if(!I1.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!I1.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},$1={create(e,i,a,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+a*60*1e3)),r&&(s.domain=r),document.cookie=UM(e,i,s)},read(e){const i=`${e}=`,a=document.cookie.split(";");for(let r=0;r<a.length;r++){let s=a[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(i)===0)return s.substring(i.length,s.length)}return null},remove(e,i){this.create(e,"",-1,i)}};var PM={name:"cookie",lookup(e){let{lookupCookie:i}=e;if(i&&typeof document<"u")return $1.read(i)||void 0},cacheUserLanguage(e,i){let{lookupCookie:a,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=i;a&&typeof document<"u"&&$1.create(a,e,r,s,o)}},qM={name:"querystring",lookup(e){let{lookupQuerystring:i}=e,a;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let f=0;f<o.length;f++){const c=o[f].indexOf("=");c>0&&o[f].substring(0,c)===i&&(a=o[f].substring(c+1))}}return a}},GM={name:"hash",lookup(e){let{lookupHash:i,lookupFromHashIndex:a}=e,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(i){const f=o.split("&");for(let c=0;c<f.length;c++){const p=f[c].indexOf("=");p>0&&f[c].substring(0,p)===i&&(r=f[c].substring(p+1))}}if(r)return r;if(!r&&a>-1){const f=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?f[typeof a=="number"?a:0]?.replace("/",""):void 0}}}return r}};let Tl=null;const H1=()=>{if(Tl!==null)return Tl;try{if(Tl=typeof window<"u"&&window.localStorage!==null,!Tl)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Tl=!1}return Tl};var VM={name:"localStorage",lookup(e){let{lookupLocalStorage:i}=e;if(i&&H1())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(e,i){let{lookupLocalStorage:a}=i;a&&H1()&&window.localStorage.setItem(a,e)}};let Dl=null;const U1=()=>{if(Dl!==null)return Dl;try{if(Dl=typeof window<"u"&&window.sessionStorage!==null,!Dl)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Dl=!1}return Dl};var KM={name:"sessionStorage",lookup(e){let{lookupSessionStorage:i}=e;if(i&&U1())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(e,i){let{lookupSessionStorage:a}=i;a&&U1()&&window.sessionStorage.setItem(a,e)}},YM={name:"navigator",lookup(e){const i=[];if(typeof navigator<"u"){const{languages:a,userLanguage:r,language:s}=navigator;if(a)for(let o=0;o<a.length;o++)i.push(a[o]);r&&i.push(r),s&&i.push(s)}return i.length>0?i:void 0}},QM={name:"htmlTag",lookup(e){let{htmlTag:i}=e,a;const r=i||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(a=r.getAttribute("lang")),a}},JM={name:"path",lookup(e){let{lookupFromPathIndex:i}=e;if(typeof window>"u")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof i=="number"?i:0]?.replace("/",""):void 0}},XM={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:i}=e;const a=typeof i=="number"?i+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[a]}};let mv=!1;try{document.cookie,mv=!0}catch{}const gv=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];mv||gv.splice(1,1);const ZM=()=>({order:gv,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class xv{constructor(i){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(i,a)}init(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i,this.options=$M(a,this.options||{},ZM()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(PM),this.addDetector(qM),this.addDetector(VM),this.addDetector(KM),this.addDetector(YM),this.addDetector(QM),this.addDetector(JM),this.addDetector(XM),this.addDetector(GM)}addDetector(i){return this.detectors[i.name]=i,this}detect(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return i.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(a=a.concat(s))}}),a=a.filter(r=>r!=null&&!HM(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(i){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||a.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(i,this.options)}))}}xv.type="languageDetector";const bv="en",dc=["zh","en"],$p=["common","nav","overview","agent","timeline","log","artifact","session","node-detail","dispatch","modal","pipeline"],WM=Object.assign({"./locales/en/agent.json":()=>qt(()=>import("./agent-DP6TMcLj.js"),[]),"./locales/en/artifact.json":()=>qt(()=>import("./artifact-DfDkgkno.js"),[]),"./locales/en/common.json":()=>qt(()=>import("./common-DRMTVwE9.js"),[]),"./locales/en/dispatch.json":()=>qt(()=>import("./dispatch-sk4Wp30e.js"),[]),"./locales/en/log.json":()=>qt(()=>import("./log-DN8cjb0w.js"),[]),"./locales/en/modal.json":()=>qt(()=>import("./modal-BdNai9jf.js"),[]),"./locales/en/nav.json":()=>qt(()=>import("./nav-BmF7oAKg.js"),[]),"./locales/en/node-detail.json":()=>qt(()=>import("./node-detail-CENRXcrh.js"),[]),"./locales/en/overview.json":()=>qt(()=>import("./overview-gQvk-NOK.js"),[]),"./locales/en/pipeline.json":()=>qt(()=>import("./pipeline-D4dSJRDz.js"),[]),"./locales/en/session.json":()=>qt(()=>import("./session-CUWvU14v.js"),[]),"./locales/en/timeline.json":()=>qt(()=>import("./timeline-8y_2_0Em.js"),[]),"./locales/zh/agent.json":()=>qt(()=>import("./agent-DmJHzLyj.js"),[]),"./locales/zh/artifact.json":()=>qt(()=>import("./artifact-BqnoZy2M.js"),[]),"./locales/zh/common.json":()=>qt(()=>import("./common-DeXccbr2.js"),[]),"./locales/zh/dispatch.json":()=>qt(()=>import("./dispatch-CBskGCQI.js"),[]),"./locales/zh/log.json":()=>qt(()=>import("./log-HSeA_dYy.js"),[]),"./locales/zh/modal.json":()=>qt(()=>import("./modal-D9_KDpFD.js"),[]),"./locales/zh/nav.json":()=>qt(()=>import("./nav-IjC2xqXQ.js"),[]),"./locales/zh/node-detail.json":()=>qt(()=>import("./node-detail-bndPr0IM.js"),[]),"./locales/zh/overview.json":()=>qt(()=>import("./overview-B87zWAxq.js"),[]),"./locales/zh/pipeline.json":()=>qt(()=>import("./pipeline-DZzyOqQa.js"),[]),"./locales/zh/session.json":()=>qt(()=>import("./session-DQ6UuCaJ.js"),[]),"./locales/zh/timeline.json":()=>qt(()=>import("./timeline-CAPsXUTC.js"),[])}),yv=async e=>{const i={};return await Promise.all($p.map(async a=>{const r=`./locales/${e}/${a}.json`,s=WM[r];s&&(i[a]=await s())})),i},ej=()=>{const e=new URLSearchParams(window.location.search).get("lng");if(e&&dc.includes(e))return e;const i=localStorage.getItem("taskmeld-locale");return i&&dc.includes(i)?i:navigator.language.startsWith("zh")?"zh":bv},Hp=ej(),tj=yv(Hp);Be.use(xv).use(ZN).init({resources:{},defaultNS:"common",fallbackLng:bv,lng:Hp,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator"],lookupQuerystring:"lng",lookupLocalStorage:"taskmeld-locale",caches:["localStorage"]}});const nj=tj.then(e=>{for(const i of $p)Be.addResourceBundle(Hp,i,e[i],!0,!0)}).catch(e=>{console.error("Failed to load initial locale resources:",e)});Be.on("languageChanged",async e=>{if(dc.includes(e)&&!Be.hasResourceBundle(e,"common"))try{const i=await yv(e);for(const a of $p)Be.addResourceBundle(e,a,i[a],!0,!0);Be.emit("loaded")}catch(i){console.error(`Failed to load locale resources for "${e}":`,i)}});const ij="block min-w-0 max-w-full text-[13px] leading-[1.45] text-[var(--text)] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_h1]:mt-3 [&_h1]:mb-1 [&_h1]:text-[1.6em] [&_h1]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1 [&_h2]:text-[1.35em] [&_h2]:font-semibold [&_h3]:mt-3 [&_h3]:mb-1 [&_h3]:text-[1.18em] [&_h3]:font-semibold [&_h4]:mt-3 [&_h4]:mb-1 [&_h4]:font-semibold [&_h5]:mt-3 [&_h5]:mb-1 [&_h5]:font-semibold [&_h6]:mt-3 [&_h6]:mb-1 [&_h6]:font-semibold [&_p]:my-2 [&_ul]:my-2 [&_ul]:pl-5 [&_ul]:list-disc [&_ol]:my-2 [&_ol]:pl-5 [&_ol]:list-decimal [&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-[var(--line)] [&_blockquote]:bg-[rgba(255,255,255,0.02)] [&_blockquote]:px-3 [&_blockquote]:py-2 [&_a]:text-[var(--live)] [&_a]:underline [&_table]:w-full [&_table]:border-collapse [&_table]:overflow-hidden [&_table]:text-sm [&_th]:border [&_th]:border-[rgba(142,163,179,0.18)] [&_th]:bg-[rgba(255,255,255,0.03)] [&_th]:px-2 [&_th]:py-1.5 [&_th]:text-left [&_td]:border [&_td]:border-[rgba(142,163,179,0.14)] [&_td]:px-2 [&_td]:py-1.5 [&_code]:rounded-none [&_code]:bg-[rgba(255,255,255,0.06)] [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-[JetBrains_Mono,monospace] [&_code]:text-[12px] [&_hr]:my-3 [&_hr]:border-0 [&_hr]:border-t [&_hr]:border-[var(--line)]";function aj({blockKey:e,className:i,children:a,collapsed:r,onToggleCollapsed:s}){const[o,f]=C.useState(!1),c=C.useMemo(()=>(String(i??"").match(/language-([\w-]+)/i)?.[1]??"text").toLowerCase(),[i]),p=C.useMemo(()=>String(a??"").replace(/\n$/,""),[a]),d=async()=>{try{await navigator.clipboard.writeText(p),f(!0),setTimeout(()=>f(!1),1200)}catch{f(!1)}},g=()=>{s(e)};return x.jsxs("div",{className:"my-2 block min-w-0 max-w-full overflow-hidden border border-[rgba(142,163,179,0.14)] bg-[rgba(255,255,255,0.01)]",children:[x.jsxs("div",{className:"flex cursor-pointer items-center justify-between gap-2 border-b border-[rgba(142,163,179,0.12)] bg-[rgba(255,255,255,0.03)] px-2.5 py-1.75",role:"button",tabIndex:0,onClick:g,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),g())},"aria-label":r?Be.t("common:common.expandCodeBlock"):Be.t("common:common.collapseCodeBlock"),children:[x.jsx("span",{className:"font-[JetBrains_Mono,monospace] text-xs text-[#8ba0b0]",children:c}),x.jsx("div",{className:"flex items-center gap-2",children:x.jsx("button",{className:"cursor-pointer border border-(--line) bg-transparent px-2 py-1 text-xs text-(--muted) transition-[border-color,background-color,color] hover:border-[#2a3c4b] hover:bg-[rgba(142,163,179,0.08)]",type:"button",onClick:m=>{m.stopPropagation(),d()},children:o?"Copied":"Copy"})})]}),r?null:x.jsx("pre",{className:"m-0 block min-w-0 w-full max-w-full overflow-hidden bg-transparent p-0 whitespace-pre-wrap break-all wrap-anywhere",children:x.jsx("code",{className:`${i??""} block min-w-0 w-full max-w-full whitespace-pre-wrap break-all rounded-none bg-transparent px-0 py-0 font-[JetBrains_Mono,monospace] text-[13px] leading-[1.45] text-inherit wrap-anywhere`,children:p})})]})}function vv({content:e,className:i=""}){const[a,r]=C.useState({}),s=o=>{r(f=>({...f,[o]:!(f[o]??!0)}))};return x.jsx("div",{className:`${ij} ${i}`.trim(),children:x.jsx(dA,{remarkPlugins:[BM],rehypePlugins:[kA],components:{pre({node:o,children:f}){const c=C.Children.toArray(f)[0];if(!C.isValidElement(c))return x.jsx("pre",{children:f});const p=c.props.className,d=c.props.children,g=String(d??"").replace(/\n$/,""),m=String(p??"").toLowerCase(),y=o?.position?.start?.offset,v=typeof y=="number"?String(y):g.slice(0,64),N=`${m}::${v}`;return x.jsx(aj,{blockKey:N,className:p,collapsed:a[N]??!0,onToggleCollapsed:s,children:d})}},children:e})})}function qn({value:e,options:i,onChange:a,disabled:r=!1,ariaLabel:s,triggerClassName:o=Mn,onClose:f}){const[c,p]=C.useState(!1),d=C.useRef(null),g=C.useRef(f);C.useEffect(()=>{g.current=f},[f]);const m=()=>{setTimeout(()=>{g.current?.()},0)};C.useEffect(()=>{if(!c)return;const v=N=>{d.current&&!d.current.contains(N.target)&&(p(!1),m())};return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[c,f]),C.useEffect(()=>{r&&c&&p(!1)},[r,c]);const y=C.useMemo(()=>{const v=i.find(N=>N.value===e);return v?v.label:i[0]?.label??"-"},[i,e]);return x.jsxs("div",{className:"relative min-w-0",ref:d,children:[x.jsxs("button",{type:"button",className:`${o} relative block w-full text-left leading-[1.2] outline-none transition-[border-color,background-color,color] ${c?"border-[#3b5868] bg-[rgba(24,39,47,0.92)]":"hover:border-[#36505f] hover:bg-[rgba(22,36,44,0.94)]"} disabled:cursor-not-allowed disabled:opacity-55`,onClick:()=>{r||p(v=>{const N=!v;return v&&!N&&m(),N})},onKeyDown:v=>{v.key==="Escape"&&(p(!1),m())},disabled:r,"aria-label":s,children:[x.jsx("span",{className:"block min-w-0 overflow-hidden pr-5 text-left text-ellipsis whitespace-nowrap",children:y}),x.jsx("span",{className:`pointer-events-none absolute top-1/2 right-2 inline-flex -translate-y-1/2 items-center justify-center leading-none ${c?"text-[#62cfc0]":"text-[var(--muted)]"}`,"aria-hidden":"true",children:x.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",focusable:"false",children:x.jsx("path",{d:"M4 6.5 8 10l4-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),c?x.jsx("div",{className:"absolute inset-x-0 top-[calc(100%+4px)] z-[8] max-h-[220px] overflow-x-hidden overflow-y-auto border border-[#29414f] bg-[rgba(18,31,38,0.98)] p-0 overscroll-contain shadow-[inset_0_1px_0_rgba(255,255,255,0.03)]",children:i.map(v=>x.jsx("button",{type:"button",className:`block w-full border-0 border-l-2 px-2 py-1.5 text-left text-xs leading-[1.2] font-normal ${v.value===e?"border-l-[#62cfc0] bg-[rgba(50,215,186,0.12)] text-[#dffaf5]":"border-l-transparent bg-transparent text-[var(--text)] hover:bg-[rgba(22,36,44,0.9)]"}`,onClick:()=>{a(v.value),p(!1),m()},children:v.label},v.value))}):null]})}const rj={width:24,height:24};function Sv({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:rj,content:'<path class="sty1tsbbo"/>',fallback:"lucide:x"})}function Ii({size:e=14}){return x.jsx(Sv,{width:String(e),height:String(e)})}const lj={width:24,height:24};function Up({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:lj,content:'<path class="vxmqaru-n"/>',fallback:"lucide:plus"})}function sj({size:e=14}){return x.jsx(Up,{width:String(e),height:String(e)})}function oj({className:e}){return x.jsxs("svg",{viewBox:"0 0 76.05 83.85","aria-hidden":"true",className:e,fill:"currentColor",children:[x.jsx("path",{d:"M12.29,64.28c-1.12,0-2.24-.47-3.03-1.38C3.29,56,0,47.17,0,38.03,0,17.06,17.06,0,38.03,0c5.29,0,10.41,1.07,15.21,3.17,2.02.88,2.95,3.24,2.06,5.27-.89,2.03-3.24,2.95-5.27,2.06-3.79-1.66-7.83-2.5-12.01-2.5-16.56,0-30.03,13.47-30.03,30.03,0,7.22,2.6,14.19,7.31,19.64,1.45,1.67,1.26,4.2-.41,5.64-.76.66-1.69.98-2.62.98Z"}),x.jsx("path",{d:"M63.76,64.29c-.93,0-1.86-.32-2.62-.98-1.67-1.45-1.85-3.97-.41-5.64,4.72-5.45,7.31-12.42,7.31-19.64,0-2.86-.4-5.69-1.19-8.4-.62-2.12.6-4.34,2.72-4.96,2.12-.62,4.34.6,4.96,2.72,1,3.44,1.51,7.02,1.51,10.64,0,9.14-3.29,17.97-9.26,24.88-.79.91-1.91,1.38-3.03,1.38Z"}),x.jsx("path",{d:"M42.14,69.28c0,1.54-.85,2.89-2.11,3.59v8.98c0,1.1-.9,2-2,2s-2-.9-2-2v-8.98c-1.26-.7-2.11-2.05-2.11-3.59s.85-2.89,2.11-3.59v-9.13c0-1.1.9-2,2-2s2,.9,2,2v9.13c1.26.7,2.11,2.05,2.11,3.59Z"}),x.jsx("path",{d:"M54.61,66.83c0,1.54-.85,2.89-2.11,3.59v4.87c0,1.11-.89,2-2,2s-2-.89-2-2v-4.88c-1.25-.7-2.1-2.04-2.1-3.58s.85-2.88,2.1-3.58v-9.77c0-1.11.9-2,2-2s2,.89,2,2v9.76c1.26.7,2.11,2.05,2.11,3.59Z"}),x.jsx("path",{d:"M28.61,66.83c0,1.54-.85,2.89-2.11,3.59v4.87c0,1.11-.9,2-2,2s-2-.89-2-2v-4.87c-1.26-.7-2.11-2.05-2.11-3.59s.85-2.89,2.11-3.59v-9.76c0-1.11.9-2,2-2s2,.89,2,2v9.76c1.26.7,2.11,2.05,2.11,3.59Z"}),x.jsx("circle",{cx:"64.46",cy:"15.07",r:"5.46"}),x.jsx("path",{d:"M48.51,23.51h-20.96c-3.11,0-5.92,1.26-7.96,3.3-2.04,2.03-3.3,4.84-3.3,7.95,0,6.22,5.04,11.26,11.26,11.26h20.96c3.1,0,5.92-1.26,7.95-3.3,2.04-2.03,3.3-4.85,3.3-7.96,0-6.21-5.04-11.25-11.25-11.25ZM27.82,39.56c-2.65,0-4.79-2.15-4.79-4.8s2.14-4.79,4.79-4.79,4.79,2.15,4.79,4.79-2.14,4.8-4.79,4.8ZM48.84,39.56c-2.65,0-4.8-2.15-4.8-4.8s2.15-4.79,4.8-4.79,4.79,2.15,4.79,4.79-2.15,4.8-4.79,4.8Z"})]})}function P1({navItems:e,active:i,onChangeActive:a,onNavigateHome:r,collapsed:s=!1,onCloseDrawer:o,variant:f="inline"}){const{t:c}=Gt("nav"),p=f==="overlay",d=p?!0:!s,g=p?!1:s,m=p?`fixed left-0 top-0 bottom-0 z-50 w-52 bg-[var(--bg)] border-r border-[var(--line)] transition-transform duration-300 ease-in-out flex min-h-0 flex-col overflow-auto ${s?"-translate-x-full":"translate-x-0"}`:"flex min-h-0 flex-col overflow-auto border-r border-[var(--line)]";return x.jsxs("aside",{className:m,children:[x.jsxs("button",{className:`m-0 flex w-full cursor-pointer items-center border-0 border-b border-(--line) bg-transparent px-3 py-2.5 min-h-[60px] text-left font-inherit text-inherit leading-inherit transition-[background-color] hover:bg-[rgba(142,163,179,0.06)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--live)] focus-visible:outline-offset-[-2px] ${g?"justify-center":"gap-2"}`,type:"button",onClick:()=>{r?r():a("overview"),o?.()},"aria-label":c("backToHome"),title:c("backToHome"),children:[x.jsx(oj,{className:"h-7 w-7 shrink-0 text-(--live)"}),d?x.jsx("strong",{className:"truncate text-[18px] leading-[1.1] font-bold text-(--live)",children:"TaskMeld"}):null]}),e.map(({key:y,label:v,icon:N})=>x.jsx("div",{children:x.jsx("button",{className:`w-full cursor-pointer border-0 py-2.5 min-h-[44px] font-medium transition-[background-color,color,box-shadow] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--live)] focus-visible:outline-offset-[-2px] ${g?"px-0 text-center":"px-3 text-left"} ${i===y?"bg-[rgba(50,215,186,0.12)] text-(--live) shadow-[inset_3px_0_0_0_var(--live)]":"bg-transparent text-(--muted) hover:bg-[rgba(142,163,179,0.08)] hover:text-(--text)"}`,onClick:()=>{a(y),o?.()},children:x.jsxs("span",{className:`flex items-center ${g?"justify-center":"gap-2.5"}`,children:[x.jsx(N,{width:"20",height:"20",className:"shrink-0"}),d?x.jsx("span",{children:c(v)}):null]})})},y))]})}const Ci="mb-2 flex items-center justify-between gap-2 px-3 pt-3",Wa="flex w-full min-w-0 flex-wrap gap-2 p-3 pt-0 mt-2 ",Fh="h-full min-h-0 min-w-0 overflow-hidden",Nv="detail-panel grid h-full min-h-0 content-start gap-[10px] overflow-x-hidden overflow-y-auto p-3",wv=Ci,Cv="shrink whitespace-nowrap",uj="detail-head-status ml-auto flex min-w-0 flex-nowrap items-center justify-end gap-2",cj=Wa,fj="mb-1.5 flex items-center justify-between gap-2",dj="relative min-w-0",hj="border-[#3b5868] bg-[rgba(24,39,47,0.92)]",pj="absolute inset-x-0 top-[calc(100%+4px)] z-[4] grid max-h-[180px] overflow-y-auto overflow-x-hidden border border-[#29414f] bg-[rgba(18,31,38,0.98)] px-0 py-0 text-[var(--text)] shadow-none",mj="grid min-w-0 cursor-pointer grid-cols-[10px_minmax(0,1fr)] items-center gap-x-3 px-2 py-1.5 text-xs leading-[1.2] text-[var(--text)] transition-[background-color,color] hover:bg-[rgba(22,36,44,0.9)]",gj="bg-[rgba(50,215,186,0.12)]",xj="m-0 h-[10px] w-[10px] cursor-pointer appearance-none border border-[var(--line)] bg-transparent transition-[border-color,background-color] hover:border-[#2a3c4b] checked:border-[var(--live)] checked:bg-[var(--live)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",bj="mx-2 my-1.5 text-xs text-[var(--muted)]",yj="grid gap-2 overflow-hidden border border-[#29414f] bg-[rgba(18,31,38,0.9)] p-[10px]",vj="mb-1.5 flex min-w-0 items-center justify-between gap-2",Sj="flex min-h-8 flex-wrap content-start gap-2",Nj="inline-flex items-center gap-2 border border-[#29414f] bg-[rgba(24,39,47,0.92)] px-2 py-1 whitespace-nowrap",wj="cursor-pointer border-0 bg-transparent p-0 leading-none text-[var(--muted)] hover:text-[var(--bad)]",Cj="grid items-stretch gap-2 border-t border-[rgba(142,163,179,0.12)] pt-2 grid-cols-[minmax(0,1fr)_auto]",Ej="grid gap-1.5 border border-[#29414f] bg-[rgba(24,39,47,0.72)] p-2",kj="relative h-6 w-[54px] shrink-0 cursor-pointer border border-[#29414f] bg-[rgba(24,39,47,0.92)] p-0 transition-[background-color,border-color] disabled:cursor-not-allowed disabled:opacity-50",Aj="border-[var(--live-25)] bg-[rgba(50,215,186,0.14)]",Mj="absolute top-1/2 flex h-5 w-[24px] -translate-y-1/2 items-center justify-center border border-[var(--line)] bg-[rgba(18,31,38,0.98)] text-center text-[10px] leading-[20px] font-semibold text-[var(--muted)] transition-[left,right,color,border-color,background-color]",jj="left-[2px] right-auto",Tj="right-[2px] left-auto border-[var(--live-25)] bg-[rgba(50,215,186,0.22)] text-[var(--live)]",Ka="yes",da="no",q1="grid min-w-0 items-center gap-x-2 gap-y-0 grid-cols-[40px_minmax(0,1fr)] max-[760px]:grid-cols-1 max-[760px]:gap-y-1.5",Dj="grid min-w-0 gap-1.5",G1="font-[JetBrains_Mono,monospace]",Ya="min-w-0",Ol="mb-1.5 block text-xs text-[var(--muted)]",Oj="block overflow-wrap-anywhere text-xs whitespace-pre-line break-words border border-[#29414f] bg-[rgba(18,31,38,0.9)] p-[10px] overflow-wrap-anywhere whitespace-pre-line break-words border border-[#29414f] bg-[rgba(18,31,38,0.9)] p-[10px]",V1="inline-flex w-fit items-center rounded-none px-2 py-[2px] text-xs uppercase",K1={good:"bg-[rgba(50,215,186,0.15)] text-[var(--live)]",live:"bg-[rgba(50,215,186,0.15)] text-[var(--live)]",warn:"bg-[rgba(255,184,77,0.16)] text-[var(--warn)]",bad:"bg-[rgba(255,107,107,0.16)] text-[var(--bad)]",muted:"bg-[rgba(142,163,179,0.2)] text-[#a5b9c8]"},Y1="mt-0 cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]";function _j({selectedNode:e,selectedWorkflowNode:i,agentOptions:a,dependencyOptions:r,routeTargetOptions:s,draftTitle:o,draftAgentId:f,draftExecutorSessionId:c,draftInstruction:p,draftDependsOn:d,draftAllowReject:g,draftMaxRejectCount:m,draftWorkflowLane:y,draftWorkflowRouteAllowed:v,draftWorkflowRouteTargets:N,isSavingWorkflowConfig:M,savingConfig:D,hasPipelineExecution:k,onChangeDraftTitle:U,onChangeDraftAgentId:T,onChangeDraftExecutorSessionId:Q,onChangeDraftInstruction:ee,sessionOptions:R,onChangeDraftDependsOn:F,onChangeDraftAllowReject:I,onChangeDraftMaxRejectCount:K,onChangeDraftWorkflowLane:j,onChangeDraftWorkflowRouteAllowed:P,onChangeDraftWorkflowRouteTarget:q,onBlurSave:W,onRetry:H,statusTone:ae,statusLabel:E}){const{t:_}=Gt("node-detail"),[Y,oe]=C.useState(!1),O=C.useRef(null),B=Array.from(new Set(v.split(",").map(de=>de.trim()).filter(Boolean))),Z=B.length>0?Array.from(new Set([Ka,da,...B])).slice(0,5):[],w=Z.filter(de=>de!==Ka),[he,Ce]=C.useState(""),Se=D||M;C.useEffect(()=>{if(!Y)return;const de=Ke=>{O.current&&!O.current.contains(Ke.target)&&(oe(!1),W())};return document.addEventListener("mousedown",de),()=>{document.removeEventListener("mousedown",de)}},[Y,W]),C.useEffect(()=>{oe(!1)},[e?.id]),C.useEffect(()=>{Ce("")},[e?.id]);const ze=(de,Ke)=>{if(!de)return;const Ot=Ke?Array.from(new Set([...d,de])):d.filter(pe=>pe!==de);F(Ot)},Ve=e&&!k&&(e.status==="queued"||e.status==="blocked")?"ready":e?.status??"queued",Ue=de=>{const Ke=de.map(pe=>pe.trim()).filter(pe=>pe&&pe!==Ka&&pe!==da),Ot=Ke.length>0||de.includes(da)?Array.from(new Set([Ka,da,...Ke])).slice(0,5):[];P(Ot.join(","))},Dt=()=>{const de=he.trim();!de||de===Ka||de===da||Z.includes(de)||Z.length>=5||(Ue([...Z,de]),Ce(""))},Ht=de=>{de===Ka||de===da||(Ue(Z.filter(Ke=>Ke!==de)),q(de,""))},Jt=()=>{Ue([da])},Rt=()=>{for(const de of Z)q(de,"");Ue([])};return x.jsxs("aside",{className:Nv,children:[x.jsxs("div",{className:wv,children:[x.jsx("h2",{className:Cv,children:_("nodeDetail")}),x.jsxs("div",{className:uj,children:[Se?x.jsx("span",{className:`${V1} ${K1.live}`,children:_("saving")}):null,x.jsx("span",{className:`${V1} ${K1[ae[Ve]??"muted"]}`,children:e?E[Ve]:"-"})]})]}),x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("nodeTitle")}),x.jsx("input",{className:Mn,value:o,onChange:de=>U(de.target.value),onBlur:W,disabled:!e})]}),x.jsxs("div",{className:q1,children:[x.jsx("label",{className:"block text-xs text-(--muted)",children:"Agent"}),x.jsx(qn,{value:f,options:(a.length?a:[f||"-"]).map(de=>({value:de,label:de})),onChange:de=>{T(de),W()},onClose:W,triggerClassName:Mn,disabled:!e,ariaLabel:"Agent"})]}),x.jsxs("div",{className:q1,children:[x.jsx("label",{className:"block text-xs text-(--muted)",children:_("session")}),x.jsx(qn,{value:c,options:(R.length?R:[{id:c||"-",title:c||"-"}]).map(de=>({value:de.id,label:de.id})),onChange:de=>{Q(de),W()},onClose:W,triggerClassName:Mn,disabled:!e,ariaLabel:_("session")})]}),x.jsxs("div",{className:Dj,children:[x.jsx("label",{className:"block text-xs text-(--muted)",children:_("agentInstruction")}),x.jsx("textarea",{className:oc,value:p,onChange:de=>ee(de.target.value),onBlur:W,disabled:!e,rows:5})]}),x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("lane")}),x.jsx(qn,{value:y,options:[{value:"main",label:"main"},{value:"branch",label:"branch"}],onChange:de=>j(de==="branch"?"branch":"main"),triggerClassName:Mn,disabled:!e,ariaLabel:_("lane")})]}),x.jsxs("div",{className:Ya,children:[x.jsxs("div",{className:vj,children:[x.jsx("label",{className:"block text-xs text-[var(--muted)]",children:_("routeAllowed")}),x.jsx("button",{type:"button",className:`${kj} ${Z.length>0?Aj:""}`,onClick:Z.length>0?Rt:Jt,disabled:!e,"aria-pressed":Z.length>0,"aria-label":_("toggleRoute"),title:_("toggleRoute"),children:x.jsx("span",{className:`${Mj} ${Z.length>0?Tj:jj}`,children:Z.length>0?_("routeOn"):_("routeOff")})})]}),Z.length>0?x.jsxs("div",{className:yj,children:[x.jsx("div",{className:Sj,children:Z.length?Z.map(de=>x.jsxs("span",{className:`${Nj} ${G1}`,children:[x.jsx("span",{children:de}),x.jsx("button",{type:"button",className:wj,onClick:()=>Ht(de),disabled:!e||de===Ka||de===da,"aria-label":_("deleteRoute",{route:de}),children:"x"})]},de)):x.jsx("span",{className:`${G1} text-xs text-(--muted)`,children:_("noRoute")})}),x.jsxs("div",{className:Cj,children:[x.jsx("input",{className:`${gn} min-h-9 box-border`,value:he,onChange:de=>Ce(de.target.value),onKeyDown:de=>{de.key==="Enter"&&(de.preventDefault(),Dt())},disabled:!e||Z.length>=5,placeholder:_("routePlaceholder")}),x.jsx("button",{type:"button",className:`${Y1} inline-grid h-9 w-9 min-w-9 place-items-center self-stretch p-0`,onClick:Dt,disabled:!e||!he.trim()||he.trim()===Ka||he.trim()===da||Z.length>=5,"aria-label":_("addRoute"),title:_("addRoute"),children:x.jsx(sj,{})})]})]}):null]}),w.length>0?x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("routeTargets")}),w.map(de=>x.jsxs("div",{className:Ej,children:[x.jsx("label",{className:"mb-0 text-(--text)",children:de}),x.jsx(qn,{value:N[de]??"",options:[{value:"",label:_("notConfigured")},...s.map(Ke=>({value:Ke.id,label:`${Ke.id} - ${Ke.title}`}))],onChange:Ke=>q(de,Ke),triggerClassName:Mn,disabled:!e,ariaLabel:_("selectRouteTarget",{route:de})})]},de))]}):null,x.jsxs("div",{className:Ya,children:[x.jsx("div",{className:fj,children:x.jsx("label",{className:"block text-xs text-(--muted)",children:_("dependsOn")})}),x.jsxs("div",{className:dj,ref:O,children:[x.jsx("div",{className:`${Mn} ${Y?hj:""}`,title:d.join(","),role:"button",tabIndex:e?0:-1,onClick:()=>{e&&oe(de=>{const Ke=!de;return de&&!Ke&&W(),Ke})},onKeyDown:de=>{e&&(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),oe(Ke=>{const Ot=!Ke;return Ke&&!Ot&&W(),Ot}))},"aria-label":_("editDepends"),children:d.length?d.join(","):"-"}),Y?x.jsx("div",{className:pj,children:r.length?r.map(de=>x.jsxs("label",{className:`${mj} ${d.includes(de.id)?gj:""}`,children:[x.jsx("input",{type:"checkbox",className:xj,checked:d.includes(de.id),onChange:Ke=>ze(de.id,Ke.target.checked)}),x.jsxs("span",{className:"block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:`${de.id} - ${de.title}`,children:[de.id," - ",de.title]})]},de.id)):x.jsx("p",{className:bj,children:_("noDepends")})}):null]})]}),x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("allowReject")}),x.jsx(qn,{value:g?"yes":"no",options:[{value:"no",label:_("rejectNo")},{value:"yes",label:_("rejectYes")}],onChange:de=>{I(de==="yes"),W()},onClose:W,triggerClassName:Mn,disabled:!e,ariaLabel:_("selectReject")})]}),g?x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("maxRejectCount")}),x.jsx("input",{className:Mn,type:"number",min:0,max:10,step:1,value:Number.isFinite(m)?m:0,onChange:de=>K(Number(de.target.value)),onBlur:W,disabled:!e})]}):null,x.jsxs("div",{className:Ya,children:[x.jsx("label",{className:Ol,children:_("artifacts")}),x.jsx("code",{className:Oj,children:e&&e.artifacts.length?e.artifacts.map(de=>`${de.type}@v${de.schemaVersion} ${de.path} (${de.hash})`).join(`
38
+ `):"-"})]}),x.jsx("button",{className:Y1,onClick:H,children:_("retryNode")})]})}const Q1=`${gn} static max-h-[180px] overflow-y-auto overflow-x-hidden p-0`,J1="grid min-w-0 cursor-pointer grid-cols-[10px_minmax(0,1fr)] items-center gap-x-3 px-2 py-1.5 text-xs leading-[1.2] text-[var(--text)] transition-[background-color,color] hover:bg-[rgba(142,163,179,0.08)]",X1="bg-[rgba(50,215,186,0.2)]",Z1="m-0 h-[10px] w-[10px] cursor-pointer appearance-none border border-[var(--line)] bg-transparent transition-[border-color,background-color] hover:border-[#2a3c4b] checked:border-[var(--live)] checked:bg-[var(--live)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",W1="mx-2 my-1.5 text-xs text-[var(--muted)]",eb="font-[JetBrains_Mono,monospace]",ha="min-w-0",pa="mb-1.5 block text-xs text-[var(--muted)]",Js="block overflow-wrap-anywhere text-xs whitespace-pre-line break-words border border-[var(--line)] bg-[#0f171d] p-[10px]",Fj="inline-flex w-fit items-center rounded-none px-2 py-[2px] text-xs uppercase",Bj={good:"bg-[rgba(50,215,186,0.15)] text-[var(--live)]",live:"bg-[rgba(50,215,186,0.15)] text-[var(--live)]",warn:"bg-[rgba(255,184,77,0.16)] text-[var(--warn)]",bad:"bg-[rgba(255,107,107,0.16)] text-[var(--bad)]",muted:"bg-[rgba(142,163,179,0.2)] text-[#a5b9c8]"},Rj="mt-0 cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]",Lj="mt-0 cursor-pointer border border-[var(--bad)] bg-transparent px-[10px] py-2 font-semibold text-[var(--bad)] hover:bg-[rgba(255,107,107,0.1)]";function zj({selectedGroup:e,groupMemberOptions:i,groupUpstreamOptions:a,draftGroupId:r,draftGroupMembers:s,draftGroupUpstreams:o,draftGroupJoinPolicy:f,isSaving:c,isDeleting:p=!1,statusTone:d,statusLabel:g,onChangeDraftGroupId:m,onChangeDraftGroupMembers:y,onChangeDraftGroupUpstreams:v,onChangeDraftGroupJoinPolicy:N,onSave:M,onDelete:D}){const{t:k}=Gt("node-detail"),U=(T,Q,ee,R)=>{const F=ee?[...new Set([...T,Q])]:T.filter(I=>I!==Q);R(F)};return x.jsxs("aside",{className:Nv,children:[x.jsxs("div",{className:wv,children:[x.jsx("h2",{className:Cv,children:k("groupDetail")}),x.jsx("span",{className:`${Fj} ${Bj[e?d[e.status]??"muted":"muted"]}`,children:e?g[e.status]??e.status:k("common:empty")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("runtime")}),x.jsx("code",{className:Js,children:e?`${e.startedAt??k("common:empty")} -> ${e.finishedAt??k("common:empty")}`:k("common:empty")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("groupId")}),x.jsx("input",{className:gn,value:r,onChange:T=>m(T.target.value),disabled:!e,placeholder:k("groupIdPlaceholder")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("members")}),x.jsx("div",{className:Q1,children:i.length?i.map(T=>x.jsxs("label",{className:`${J1} ${s.includes(T.id)?X1:""}`,children:[x.jsx("input",{className:Z1,type:"checkbox",checked:s.includes(T.id),onChange:Q=>U(s,T.id,Q.target.checked,y),disabled:!e}),x.jsxs("span",{className:"block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:`${T.id} - ${T.title}`,children:[T.id," - ",T.title]})]},T.id)):x.jsx("p",{className:W1,children:k("noMembers")})}),x.jsx("small",{className:`${eb} mt-1.5 block text-xs text-(--muted)`,children:k("selectMembers")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("commonUpstream")}),x.jsx("div",{className:Q1,children:a.length?a.map(T=>x.jsxs("label",{className:`${J1} ${o.includes(T.id)?X1:""}`,children:[x.jsx("input",{className:Z1,type:"checkbox",checked:o.includes(T.id),onChange:Q=>U(o,T.id,Q.target.checked,v),disabled:!e}),x.jsxs("span",{className:"block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",title:`${T.id} - ${T.title}`,children:[T.id," - ",T.title]})]},T.id)):x.jsx("p",{className:W1,children:k("noUpstream")})})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("joinPolicy")}),x.jsx(qn,{value:f,options:[{value:"all",label:"all"},{value:"any",label:"any"},{value:"quorum",label:"quorum"}],onChange:T=>N(T),triggerClassName:Mn,disabled:!e,ariaLabel:k("selectJoinPolicy")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("memberRunStates")}),x.jsx("code",{className:Js,children:e?.memberRuns.length?e.memberRuns.map(T=>`${T.id} | ${T.title} | ${g[T.status]??T.status} | agent:${T.executor.agentId} | artifacts=${T.artifacts.length}`).join(`
39
+ `):k("common:empty")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("groupItemRun")}),x.jsx("code",{className:Js,children:e?.itemRuns.length?e.itemRuns.map(T=>`${T.itemKey} | ${g[T.status]??T.status} | attempt=${T.attempt} | ${T.startedAt??k("common:empty")} -> ${T.finishedAt??k("common:empty")}${T.lastError?` | error=${T.lastError}`:""}`).join(`
40
+ `):k("common:empty")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("groupArtifacts")}),x.jsx("code",{className:Js,children:e?.artifacts.length?e.artifacts.map(T=>`${T.type}@v${T.schemaVersion} ${T.path} (${T.hash})`).join(`
41
+ `):k("common:empty")})]}),x.jsxs("div",{className:ha,children:[x.jsx("label",{className:pa,children:k("lastError")}),x.jsx("code",{className:Js,children:e?.lastError||k("common:empty")})]}),x.jsx("small",{className:`${eb} block text-xs text-(--muted)`,children:k(c?"groupSaving":"groupSaveHint")}),x.jsxs("div",{className:cj,children:[x.jsx("button",{className:Rj,type:"button",onClick:M,disabled:!e||c||p,children:k("saveGroupConfig")}),x.jsx("button",{className:Lj,type:"button",onClick:D,disabled:!e||c||p,children:k(p?"deleting":"deleteGroup")})]})]})}const Ij={width:24,height:24};function $j({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Ij,content:'<path class="o4qrpmb9t"/>',fallback:"lucide:arrow-down"})}const Hj={width:24,height:24};function Uj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Hj,content:'<path class="xc2dpbbgc"/>',fallback:"lucide:arrow-up"})}const Pj={width:24,height:24};function qj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Pj,content:'<path class="acmnv-6wx"/>',fallback:"lucide:braces"})}const Gj={width:24,height:24};function Vj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Gj,content:'<path class="iqbry7bab"/>',fallback:"lucide:chevron-down"})}const Kj={width:24,height:24};function Ev({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Kj,content:'<path class="zvgwoyb4l"/>',fallback:"lucide:chevron-right"})}const Yj={width:24,height:24};function Qj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Yj,content:'<path class="hy0q690mc"/>',fallback:"lucide:pencil"})}const Jj={width:24,height:24};function Xj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Jj,content:'<path class="luedrwb0i"/>',fallback:"lucide:play"})}const Zj={width:24,height:24};function Wj({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:Zj,content:'<path class="toh88ac3w"/>',fallback:"lucide:plug"})}const eT={width:24,height:24};function tT({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:eT,content:'<g class="nrj6p8qat"><path class="m_zjykfeh"/><path class="pj05ulbnh"/></g>',fallback:"lucide:save"})}const nT={width:24,height:24};function iT({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:nT,content:'<path class="rs7v3hkcx"/>',fallback:"lucide:loader-circle"})}const aT={width:24,height:24};function rT({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:aT,content:'<rect class="rz71kybyz"/>',fallback:"lucide:square"})}const lT={width:24,height:24};function gp({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:lT,content:'<path class="kqvvusbak"/>',fallback:"lucide:trash-2"})}const sT="font-[JetBrains_Mono,monospace]";function oT({title:e,statusText:i,startBatch:a,isOperating:r,onChangeStartBatch:s}){const{t:o}=Gt("pipeline");return x.jsxs("div",{className:"mb-3 grid p-3 pt-0 gap-2 border-b border-(--line) bg-transparent",children:[x.jsx("div",{className:`${sT} text-xs text-(--muted)`,children:e}),x.jsx("code",{className:"block max-h-30 overflow-auto whitespace-pre-wrap wrap-break-word border border-(--line) bg-[#0f171d] p-2.5 text-xs",children:i}),x.jsxs("div",{className:"grid grid-cols-[180px_minmax(0,1fr)] items-end gap-2.5 max-[760px]:grid-cols-1",children:[x.jsx("input",{className:`${Ws} min-w-0 text-[13px]`,value:a,onChange:f=>s(f.target.value),placeholder:o("startBatchPlaceholder"),inputMode:"numeric",disabled:r}),x.jsx("div",{"aria-hidden":"true"})]})]})}const uT="font-[JetBrains_Mono,monospace]",Bh="mt-0 w-full cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]";function cT({pipelineId:e,schedulerMode:i,schedulerEnabled:a,onToggleScheduler:r,onSwitchSchedulerMode:s,onManualTick:o,embedded:f=!1}){const{t:c}=Gt("common"),p=f?"border-b border-(--line) bg-[rgba(15,23,29,0.42)] mb-3":"";return x.jsxs("section",{"data-center-card":!f,className:p,children:[x.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 px-3 pt-0",children:[x.jsx("div",{className:"font-[JetBrains_Mono,monospace] text-xs text-(--muted)",children:c("scheduler.schedulerConfig",{pipelineId:e})}),x.jsx("span",{className:uT,children:`mode=${i}`})]}),x.jsxs("div",{className:`${Wa} mb-0.5 grid grid-cols-3 max-[980px]:grid-cols-2 max-[640px]:grid-cols-1`,children:[x.jsx("button",{className:Bh,type:"button",onClick:r,children:c(a?"scheduler.disableScheduler":"scheduler.enableScheduler")}),x.jsx("button",{className:Bh,type:"button",onClick:s,children:c("scheduler.switchToMode",{mode:c(i==="manual"?"scheduler.auto":"scheduler.manual")})}),x.jsx("button",{className:Bh,type:"button",onClick:o,children:c("scheduler.manualStep")})]})]})}const tb="mb-3 overflow-hidden bg-[rgba(9,15,21,0.1)] px-3 [background-image:repeating-linear-gradient(-45deg,rgba(150,170,190,0.07)_0,rgba(150,170,190,0.07)_2px,transparent_2px,transparent_8px)]",nb="grid max-h-[calc(96px*2+8px+2px)] grid-flow-row auto-rows-[minmax(96px,auto)] grid-cols-[repeat(auto-fill,minmax(230px,1fr))] content-start gap-3 overflow-x-hidden overflow-y-auto pb-0",Gu="bg-[rgba(9,15,21,0.1)] [background-image:repeating-linear-gradient(-45deg,rgba(150,170,190,0.07)_0,rgba(150,170,190,0.07)_2px,transparent_2px,transparent_8px)]",ib="border-x border-[#29414f]",ab=" border-y border-[#29414f]",rb="px-3",lb="min-w-0",Rh="inline-flex h-5 w-5 items-center justify-center border border-(--line) bg-transparent p-0.5 text-(--muted) leading-none hover:border-[#3b5568] hover:bg-[rgba(142,163,179,0.08)] hover:text-(--text) disabled:cursor-not-allowed disabled:opacity-50",fT="inline-flex h-5 w-5 items-center justify-center border border-[rgba(255,107,107,0.2)] bg-transparent p-0.5 text-(--bad) leading-none hover:bg-[rgba(255,107,107,0.1)] disabled:cursor-not-allowed disabled:opacity-50",dT="relative grid h-full min-h-0 w-full min-w-0 grid-rows-[minmax(0,1fr)_auto] content-start gap-1.25 overflow-hidden border border-[color:rgb(from_var(--live)_r_g_b_/_0.06)] bg-[linear-gradient(180deg,rgb(from_var(--live)_r_g_b_/_0.22)_0%,rgba(15,25,31,0.8)_100%)] backdrop-blur-[8px] px-3 py-2 text-left text-[var(--text)] shadow-[inset_0_1px_0_rgba(255,255,255,0.06),0_16px_32px_rgba(4,10,14,0.16)] transition-[border-color,background-color,box-shadow] before:pointer-events-none before:absolute before:inset-0 before:border before:border-transparent before:content-[''] before:[border-image:linear-gradient(180deg,rgba(120,255,230,0.38)_0%,rgba(88,214,192,0.18)_34%,rgba(50,215,186,0.06)_62%,rgba(50,215,186,0)_100%)_1] hover:border-[color:rgb(from_var(--live)_r_g_b_/_0.1)] hover:bg-[linear-gradient(180deg,rgb(from_var(--live)_r_g_b_/_0.3)_0%,rgba(18,29,35,0.86)_100%)] hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.08),0_18px_34px_rgba(4,10,14,0.2)] hover:before:[border-image:linear-gradient(180deg,rgba(140,255,235,0.48)_0%,rgba(92,224,200,0.24)_34%,rgba(50,215,186,0.1)_62%,rgba(50,215,186,0)_100%)_1]",hT="grid cursor-pointer gap-2 border border-[color:rgb(from_var(--live)_r_g_b_/_0.16)] bg-[linear-gradient(180deg,rgb(from_var(--live)_r_g_b_/_0.14)_0%,rgba(10,17,23,0.72)_100%)] backdrop-blur-[6px] p-2",pT="border border-[#29414f] bg-[linear-gradient(180deg,rgba(18,31,38,0.92)_0%,rgba(14,24,30,0.92)_100%)] [background-image:repeating-linear-gradient(-45deg,rgba(150,170,190,0.07)_0,rgba(150,170,190,0.07)_2px,transparent_2px,transparent_8px)] shadow-[inset_0_1px_0_rgba(255,255,255,0.03),0_12px_28px_rgba(2,6,10,0.14)]",Qa="font-[JetBrains_Mono,monospace]",mT="inline-flex h-5 w-fit items-center justify-center px-1.5 text-[12px] leading-none uppercase",gT={good:"bg-[rgba(50,215,186,0.15)] text-(--live)",live:"bg-[rgba(50,215,186,0.15)] text-(--live)",warn:"bg-[rgba(255,184,77,0.16)] text-(--warn)",bad:"bg-[rgba(255,107,107,0.16)] text-(--bad)",muted:"bg-[rgba(142,163,179,0.2)] text-(--muted)"},_r="mt-0 inline-flex h-8 w-8 items-center justify-center border border-(--live-25) bg-transparent p-0 text-(--live) hover:bg-[rgba(50,215,186,0.1)]",sb="relative grid h-full min-h-0 w-full min-w-0 content-center justify-items-center gap-1 border border-dashed border-[rgba(50,215,186,0.18)] bg-[rgba(18,31,38,0.7)] p-2.5 text-center text-(--text) shadow-[inset_0_1px_0_rgba(255,255,255,0.03)] hover:border-[rgba(50,215,186,0.3)] hover:bg-[rgba(23,39,47,0.84)]",xT=(e,i)=>{const a=e.trim();return a?a.startsWith("@")?a:`@${a}`:i("notConfiguredAgent")};function bT({sections:e,selectedNodeId:i,selectedGroupId:a,activePipelineId:r,onSelectNode:s,onSelectGroup:o,onRun:f,onStop:c,deletingEntity:p,deletingPipeline:d,savingNodeOrder:g,onToggleEditing:m,onOpenWorkflowJson:y,onOpenPlugins:v,onRenamePipeline:N,onRequestDeletePipeline:M,onRequestDeleteNode:D,onRequestDeleteGroup:k,onRequestCreateNode:U,onMoveNode:T,onReorderNode:Q,onChangeBatchStartBatch:ee,onStartRemoteKeywordBatchRun:R,onToggleScheduler:F,onSwitchSchedulerMode:I,onManualTick:K,statusTone:j,statusLabel:P}){const{t:q}=Gt("pipeline"),[W,H]=C.useState(""),[ae,E]=C.useState(""),[_,Y]=C.useState("before"),[oe,O]=C.useState({}),[B,Z]=C.useState(null),[w,he]=C.useState(""),Ce=()=>{H(""),E(""),Y("before")},Se=(pe,Me)=>{const Xe=pe?document.querySelector(`[data-pipeline-node-id="${pe}"]`):null;return Xe&&(Me.compareDocumentPosition(Xe)&Node.DOCUMENT_POSITION_PRECEDING)!==0?"after":"before"},ze=(pe,Me,Xe,et)=>{if(!Xe||g)return;const Ae=`${Me}:${et}`;H(Ae),pe.dataTransfer.effectAllowed="move",pe.dataTransfer.setData("text/plain",Ae)},Ve=(pe,Me,Xe,et)=>{const Ae=`${Me}:${et}`;if(!Xe||g||!W||W===Ae)return;pe.preventDefault(),pe.dataTransfer.dropEffect="move";const[,Nt]=W.split(":"),_e=Se(Nt??"",pe.currentTarget);ae!==et&&E(et),_!==_e&&Y(_e)},Ue=(pe,Me,Xe,et)=>{if(!Xe||g)return;pe.preventDefault();const Ae=pe.dataTransfer.getData("text/plain")||W;if(Ce(),!Ae||Ae===et)return;const[Nt,_e]=Ae.split(":");if(Nt!==Me||!_e||_e===et)return;const Pe=Se(_e,pe.currentTarget);Q(Me,_e,et,Pe)},Dt=(pe,Me,Xe,et)=>{const Ae=Ht(Me.status,et),Nt=[dT,i===Me.id&&r===pe?"border-[#32d7ba]":"",Xe?"cursor-grab active:cursor-grabbing":"",g?"cursor-wait opacity-70":"",ae===Me.id?`border-[#32d7ba] bg-[linear-gradient(180deg,rgb(from_var(--live)_r_g_b_/_0.38)_0%,rgba(18,33,40,0.94)_100%)] ${_==="before"?"shadow-[inset_0_2px_0_#32d7ba]":"shadow-[inset_0_-2px_0_#32d7ba]"}`:""].join(" ");return x.jsxs("div",{className:Nt,"data-pipeline-node-id":Me.id,onClick:_e=>{_e.stopPropagation(),s(pe,Me.id)},onKeyDown:_e=>Jt(_e,pe,Me.id),onDragStart:_e=>ze(_e,pe,Xe,Me.id),onDragOver:_e=>Ve(_e,pe,Xe,Me.id),onDragLeave:()=>{ae===Me.id&&E("")},onDrop:_e=>Ue(_e,pe,Xe,Me.id),onDragEnd:Ce,role:"button",tabIndex:0,draggable:Xe&&!g,children:[x.jsxs("div",{className:"min-w-0 space-y-1",children:[x.jsx("strong",{className:"block overflow-hidden text-ellipsis whitespace-nowrap text-base leading-tight font-medium",children:Me.title}),x.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs leading-none text-(--muted)",children:[x.jsxs("small",{className:`${Qa} inline-block max-w-[45%] overflow-hidden text-ellipsis whitespace-nowrap text-xs`,title:Me.id,children:["#",Me.id]}),x.jsx("small",{className:`${Qa} inline-block flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-right text-xs`,title:Me.executor.agentId,children:xT(Me.executor.agentId,q)})]})]}),x.jsxs("div",{className:"flex items-end justify-between gap-2",children:[x.jsx("small",{className:`${mT} ${gT[j[Ae]??"muted"]}`,children:P[Ae]}),Xe?x.jsxs("div",{className:"flex items-center gap-1.5 self-end",children:[x.jsx("button",{className:Rh,type:"button",onClick:_e=>{_e.stopPropagation(),T(pe,Me.id,"up")},disabled:p||g,"aria-label":q("moveUp"),title:q("moveUp"),children:x.jsx(Uj,{className:"h-full w-full"})}),x.jsx("button",{className:Rh,type:"button",onClick:_e=>{_e.stopPropagation(),T(pe,Me.id,"down")},disabled:p||g,"aria-label":q("moveDown"),title:q("moveDown"),children:x.jsx($j,{className:"h-full w-full"})}),x.jsx("button",{className:fT,type:"button",onClick:_e=>{_e.stopPropagation(),D(pe,Me.id)},disabled:p||g,"aria-label":q("deleteNode"),title:q("deleteNode"),children:x.jsx(gp,{className:"h-full w-full"})})]}):null]})]},Me.id)},Ht=(pe,Me)=>!Me&&(pe==="queued"||pe==="blocked")?"ready":pe,Jt=(pe,Me,Xe)=>{pe.key!=="Enter"&&pe.key!==" "||(pe.preventDefault(),s(Me,Xe))},Rt=(pe,Me)=>x.jsx("div",{className:`${rb} ${Me?.wrapperClassName??""}`.trim(),children:x.jsx("div",{className:`${lb} ${Me?.contentClassName??""}`.trim(),children:pe})}),de=(pe,Me)=>Rt(pe,{wrapperClassName:Me?.wrapperClassName,contentClassName:[`${Qa} border border-dashed border-[#2b3e4d] text-xs text-[#6f8798]`,Me?.padded===!1?"":"p-3",Me?.contentClassName??""].filter(Boolean).join(" ")}),Ke=(pe,Me,Xe,et,Ae,Nt,_e,Pe)=>{if(Me.length===0)return null;const Kt=new Map(Me.map(je=>[je.id,je])),le=new Map(et.map(je=>[je.id,je])),xe=new Map;for(const je of et)for(const Re of je.members)xe.set(Re,je.id);const z=new Map(Xe.map((je,Re)=>[je,Re])),me=[...Me].sort((je,Re)=>{const Fe=z.get(je.id)??Number.MAX_SAFE_INTEGER,pt=z.get(Re.id)??Number.MAX_SAFE_INTEGER;return Fe!==pt?Fe-pt:je.id.localeCompare(Re.id)}),we=[],qe=new Set;for(const je of me){const Re=xe.get(je.id)?.trim();if(!Re){we.push({type:"node",node:je});continue}if(qe.has(Re))continue;if((le.get(Re)?.members??[]).map(pt=>Kt.get(pt)).filter(pt=>!!pt).length<2){we.push({type:"node",node:je});continue}qe.add(Re),we.push({type:"group",groupId:Re})}return x.jsx("div",{className:tb,children:x.jsxs("div",{className:`${nb} ${Ae}`,children:[we.map(je=>je.type==="node"?Dt(pe,je.node,Nt,_e):x.jsxs("div",{className:`${hT} ${a===je.groupId&&r===pe?"border-[#32d7ba]":""}`,"data-pipeline-group-id":je.groupId,onClick:()=>o(pe,je.groupId),onKeyDown:Re=>{Re.key!=="Enter"&&Re.key!==" "||(Re.preventDefault(),o(pe,je.groupId))},role:"button",tabIndex:0,children:[Nt?x.jsx("button",{className:`${Rh}`,type:"button",onClick:Re=>{Re.stopPropagation(),k(pe,je.groupId)},disabled:p,children:q("deleteGroup")}):null,x.jsx("div",{className:`${Qa} text-xs text-[#95b4c8]`,children:q("parallelGroup",{groupId:je.groupId})}),x.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(210px,1fr))] gap-3",children:(le.get(je.groupId)?.members??[]).map(Re=>Kt.get(Re)).filter(Re=>!!Re).map(Re=>Dt(pe,Re,Nt,_e))})]},je.groupId)),Pe?x.jsxs("button",{className:sb,type:"button",onClick:U,children:[x.jsx("span",{className:`${Qa} text-[18px]`,children:"+"}),x.jsx("strong",{children:q("addObject")}),x.jsx("small",{children:q("addObjectHint")})]}):null]})})},Ot=({pipelineId:pe,title:Me,canDelete:Xe,nodes:et,workflowNodeOrder:Ae,parallelGroups:Nt,branchNodes:_e,pluginState:Pe,schedulerPluginEnabled:Kt,schedulerMode:le,schedulerEnabled:xe,batchStartBatch:z,isBatchOperating:me,batchRunStatus:we,batchRunProcessedItems:qe,batchRunTotalItems:je,batchRunProcessedBatches:Re,batchRunTotalBatches:Fe,batchRunBatchSize:pt,batchRunError:at,isRunning:Lt,hasPipelineExecution:hn,isEditing:Sn,tone:Xt="default",showActions:be,emptyMessage:ki,showTopBand:nn=!0,showBottomBand:Vn=!0,collapsed:ai=!1})=>{const nr=Xt==="primary"||Xt==="secondary"?"border-[#29414f]":"",Ai=we!==void 0?`status=${we} | ${qe??0}/${je??0} | batch ${Re??0}/${Fe??0} | size=${we==="idle"?5:pt??0}${at?` | error=${at}`:""}`:q("noBatchStatus"),ke=Pe.enabled,tt=[...et,..._e??[]].some(xt=>xt.status==="running"),Ct=!!(Lt||we==="running"||tt),Rn=ke?!!me||we==="running":Ct,He=`grid grid-cols-[32px_minmax(0,1fr)_32px] ${nn&&Vn?"grid-rows-[32px_auto_32px]":nn?"grid-rows-[32px_auto]":Vn?"grid-rows-[auto_32px]":"grid-rows-[auto]"}`,Dn=nn?"row-start-2":"row-start-1",ct=nn?"row-start-3":"row-start-2",cn=ai===!0,Nn=B===pe,Zt=async()=>{const xt=w.trim();if(!xt){he(Me),Z(null);return}if(xt===Me.trim()){Z(null);return}(await N(pe,xt)).ok&&Z(null)};return x.jsxs("div",{className:`${He} scroll-mt-16`,"data-pipeline-section-id":pe,children:[nn?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:Gu,"aria-hidden":"true"}),x.jsx("div",{className:ib,"aria-hidden":"true"}),x.jsx("div",{className:Gu,"aria-hidden":"true"})]}):null,x.jsx("div",{className:`${ab} ${Dn}`,"aria-hidden":"true"}),x.jsxs("section",{className:`${pT} ${nr} ${Dn}`.trim(),children:[x.jsx("div",{className:`${rb} ${cn?"border-b-0 mb-0":"border-b border-(--line) mb-3"} bg-transparent`,children:x.jsxs("div",{className:`${lb} flex items-center justify-between gap-3 max-[760px]:flex-col`,children:[x.jsx("div",{children:Nn?x.jsx("input",{className:`${Qa} h-8 w-[min(420px,58vw)] border border-(--line) bg-[rgba(15,23,29,0.82)] px-2 text-sm italic text-(--text) outline-none focus:border-(--live)`,value:w,onChange:xt=>he(xt.target.value),onBlur:()=>{Zt()},onKeyDown:xt=>{if(xt.key==="Enter"){xt.preventDefault(),Zt();return}xt.key==="Escape"&&(xt.preventDefault(),he(Me),Z(null))},autoFocus:!0}):x.jsx("p",{className:"m-0 cursor-text whitespace-nowrap text-base font-medium italic leading-none",title:q("doubleClickTitle"),onDoubleClick:()=>{Z(pe),he(Me)},children:Me})}),x.jsxs("div",{className:"flex w-full min-w-0 flex-wrap gap-2 ml-auto justify-end",children:[x.jsx("button",{className:_r,onClick:()=>O(xt=>({...xt,[pe]:!cn})),"aria-label":q(cn?"expandPipeline":"collapsePipeline"),title:q(cn?"expandPipeline":"collapsePipeline"),children:cn?x.jsx(Ev,{className:"h-4 w-4"}):x.jsx(Vj,{className:"h-4 w-4"})}),x.jsx("button",{className:`${_r} ${Ct?"border-[rgba(255,107,107,0.35)] text-(--bad) hover:bg-[rgba(255,107,107,0.1)]":"border-(--line) text-(--muted)"}`,onClick:()=>c(pe),disabled:!Ct||!!me,"aria-label":q(Ct?"stopPipeline":"pipelineNotRunning"),title:q(Ct?"stopPipeline":"pipelineNotRunning"),children:x.jsx(rT,{className:"h-3.5 w-3.5"})}),x.jsx("button",{className:_r,onClick:()=>{if(ke){R(pe);return}f(pe)},disabled:Rn,"aria-label":q(ke?Rn?"remoteBatchRunning":"startRemoteBatch":Lt?"runStarting":"startRun"),title:q(ke?Rn?"remoteBatchRunning":"startRemoteBatch":Lt?"runStarting":"startRun"),children:Rn?x.jsx(iT,{className:"h-4 w-4 animate-spin"}):x.jsx(Xj,{className:"h-4 w-4"})}),x.jsx("button",{className:_r,onClick:()=>v(pe),"aria-label":q("pluginConfig"),title:q("pluginConfig"),children:x.jsx(Wj,{className:"h-4 w-4"})}),x.jsx("button",{className:_r,onClick:()=>y(pe),"aria-label":q("viewWorkflowJson"),title:q("viewWorkflowJson"),children:x.jsx(qj,{className:"h-4 w-4"})}),x.jsx("button",{className:`${_r} ${Sn?"border-(--warn) text-(--warn) hover:bg-[rgba(255,184,77,0.12)]":""}`,onClick:()=>m(pe,!Sn),"aria-label":q(Sn?"saveEdit":"enterEdit"),title:q(Sn?"saveEdit":"enterEdit"),children:Sn?x.jsx(tT,{className:"h-4 w-4"}):x.jsx(Qj,{className:"h-4 w-4"})}),x.jsx("button",{className:_r,onClick:()=>M(pe),disabled:!Xe||d,"aria-label":q("deletePipeline"),title:q(Xe?"deletePipeline":"keepAtLeastOne"),children:x.jsx(gp,{className:"h-4 w-4"})})]})]})}),!cn&&Kt?x.jsx(cT,{pipelineId:pe,schedulerMode:le,schedulerEnabled:xe,onToggleScheduler:()=>F(pe,!xe),onSwitchSchedulerMode:()=>I(pe,le==="manual"?"auto":"manual"),onManualTick:()=>K(pe),embedded:!0}):null,!cn&&Pe.enabled?x.jsx(oT,{title:q("remoteBatchTitle",{pipelineId:pe}),statusText:Ai,startBatch:z??"1",isOperating:!!me,onChangeStartBatch:xt=>ee(pe,xt)}):null,!cn&&et.length>0?Ke(pe,et,Ae,Nt,"max-h-none",Sn,hn,Sn):cn?null:x.jsx("div",{className:tb,children:x.jsxs("div",{className:`${nb} max-h-none`,children:[de(ki??q("noNodes"),{wrapperClassName:"px-0"}),Sn?x.jsxs("button",{className:sb,type:"button",onClick:U,children:[x.jsx("span",{className:`${Qa} text-[18px]`,children:"+"}),x.jsx("strong",{children:q("addObject")}),x.jsx("small",{children:q("addObjectHint")})]}):null]})}),!cn&&_e?x.jsxs("div",{children:[Rt(q("branchNodes"),{contentClassName:`${Qa} mb-2 text-xs text-[#8da2b3]`}),_e.length>0?Ke(pe,_e,Ae,Nt,"max-h-none",Sn,hn,!1):de(q("noBranchNodes"),{wrapperClassName:"mb-3",contentClassName:"p-2.5"})]}):null]}),x.jsx("div",{className:`${ab} ${Dn}`,"aria-hidden":"true"}),Vn?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:`${Gu} ${ct}`,"aria-hidden":"true"}),x.jsx("div",{className:`${ib} ${ct}`,"aria-hidden":"true"}),x.jsx("div",{className:`${Gu} ${ct}`,"aria-hidden":"true"})]}):null]},pe)};return x.jsx("section",{"data-center-card":!0,"data-pipeline-card":!0,className:"min-w-0",children:e.map((pe,Me)=>{const Xe=oe[pe.pipelineId]===!0,et=pe.pipeline.filter(_e=>_e.lane!=="branch"),Ae=pe.pipeline.filter(_e=>_e.lane==="branch"),Nt=Ot({pipelineId:pe.pipelineId,title:pe.title,canDelete:pe.canDelete,nodes:et,workflowNodeOrder:pe.workflowNodeOrder,parallelGroups:pe.parallelGroups,branchNodes:Ae,pluginState:pe.pluginState,schedulerPluginEnabled:pe.schedulerPluginEnabled,schedulerMode:pe.schedulerMode,schedulerEnabled:pe.schedulerEnabled,batchStartBatch:pe.batchStartBatch,isBatchOperating:pe.isBatchOperating,batchRunStatus:pe.batchRunStatus,batchRunProcessedItems:pe.batchRunProcessedItems,batchRunTotalItems:pe.batchRunTotalItems,batchRunProcessedBatches:pe.batchRunProcessedBatches,batchRunTotalBatches:pe.batchRunTotalBatches,batchRunBatchSize:pe.batchRunBatchSize,batchRunError:pe.batchRunError,isRunning:pe.isRunning,hasPipelineExecution:pe.hasPipelineExecution,isEditing:pe.isEditing,tone:Me===0?"primary":"secondary",showActions:!0,emptyMessage:q("currentPipelineNoNodes",{pipelineId:pe.pipelineId}),showTopBand:Me===0,showBottomBand:!0,collapsed:Xe});return Me===0?Nt:x.jsx(C.Fragment,{children:Nt},`pipeline-block-${pe.pipelineId}`)})})}const Vu="font-[JetBrains_Mono,monospace]",ob="h-4 w-4 rounded-none border border-(--line) bg-[#0f171d] text-(--live) accent-(--live)",Ku="min-w-0",Yu="mb-1.5 block text-xs text-(--muted)",yT="mt-0 cursor-pointer border border-(--live-25) bg-transparent px-2 py-2 font-semibold text-(--live) hover:bg-[rgba(50,215,186,0.1)]";function vT({pipelineId:e,pluginState:i,onClose:a,onSave:r}){const{t:s}=Gt(["pipeline","modal"]),[o,f]=C.useState(i);return x.jsxs("div",{children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:s("pluginConfigTitle",{pipelineId:e})}),x.jsx("button",{className:ni,type:"button",onClick:a,"aria-label":s("modal:close"),children:x.jsx(Ii,{})})]}),x.jsx("p",{className:`${Li} ${Vu}`,children:s("pluginSharedNote")}),x.jsxs("label",{className:"flex items-center justify-between gap-3 border-y border-(--line) bg-transparent p-3 text-sm text-(--text)",children:[x.jsxs("div",{className:"grid gap-1",children:[x.jsx("strong",{children:s("remoteBatchPlugin")}),x.jsx("span",{className:`${Vu} text-xs text-(--muted)`,children:s("remoteBatchPluginHint",{pipelineId:e})})]}),x.jsx("input",{className:ob,type:"checkbox",checked:o.remoteBatch.enabled,onChange:c=>f(p=>({...p,remoteBatch:{...p.remoteBatch,enabled:c.target.checked}}))})]}),o.remoteBatch.enabled?x.jsxs("div",{className:"grid gap-3 border-b border-(--line) bg-transparent p-3",children:[x.jsxs("div",{className:Ku,children:[x.jsx("label",{className:Yu,children:s("remoteUrl")}),x.jsx("input",{className:Ws,value:o.remoteBatch.url,onChange:c=>f(p=>({...p,remoteBatch:{...p.remoteBatch,url:c.target.value}})),placeholder:"http://host/path",spellCheck:!1})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-3 max-[760px]:grid-cols-1",children:[x.jsxs("div",{className:Ku,children:[x.jsx("label",{className:Yu,children:s("batchSize")}),x.jsx("input",{className:Ws,value:String(o.remoteBatch.batchSize),onChange:c=>f(p=>({...p,remoteBatch:{...p.remoteBatch,batchSize:Math.max(1,Math.trunc(Number(c.target.value)||1))}})),placeholder:"5",inputMode:"numeric"})]}),x.jsxs("div",{className:Ku,children:[x.jsx("label",{className:Yu,children:s("startBatch")}),x.jsx("input",{className:Ws,value:String(o.remoteBatch.startBatch),onChange:c=>f(p=>({...p,remoteBatch:{...p.remoteBatch,startBatch:Math.max(1,Math.trunc(Number(c.target.value)||1))}})),placeholder:"1",inputMode:"numeric"})]})]}),x.jsxs("div",{className:Ku,children:[x.jsx("label",{className:Yu,children:s("sourceField")}),x.jsx("input",{className:Ws,value:o.remoteBatch.sourceField,onChange:c=>f(p=>({...p,remoteBatch:{...p.remoteBatch,sourceField:c.target.value}})),placeholder:s("sourceFieldPlaceholder"),spellCheck:!1}),x.jsx("small",{className:`${Vu} mt-1.5 block text-xs text-(--muted)`,children:s("sourceFieldHint")})]})]}):null,x.jsxs("label",{className:"mt-3 flex items-center justify-between gap-3 border-y border-(--line) bg-transparent p-3 text-sm text-(--text)",children:[x.jsxs("div",{className:"grid gap-1",children:[x.jsx("strong",{children:s("schedulerPlugin")}),x.jsx("span",{className:`${Vu} text-xs text-(--muted)`,children:s("schedulerPluginHint")})]}),x.jsx("input",{className:ob,type:"checkbox",checked:o.scheduler.enabled,onChange:c=>f(p=>({...p,scheduler:{enabled:c.target.checked}}))})]}),x.jsx("div",{className:`${Wa} mt-3`,children:x.jsx("button",{className:yT,type:"button",onClick:()=>r(o),children:s("savePluginConfig")})})]})}function ST(e){try{const i=JSON.parse(e);return typeof i?.type!="string"?null:{type:i.type,payload:i.payload}}catch{return null}}function kv(e,i){switch(e.type){case"bootstrap":i.bootstrap?.(e.payload);return;case"gateway.status":i.gatewayStatus?.(e.payload);return;case"gateway.ready":i.gatewayReady?.(e.payload);return;case"gateway.frame":i.gatewayFrame?.(e.payload);return;case"pipeline.updated":i.pipelineUpdated?.(e.payload);return;case"timeline.updated":i.timelineUpdated?.(e.payload);return;default:i.unknown?.(e)}}const Av="",NT=Av.replace(/^http/i,"ws");class Pp extends Error{status;body;constructor(i,a,r){super(i),this.name="ApiError",this.status=a,this.body=r}}const wT=15e3;let CT=0;const fo=new Map,xp=new Set;let Lr=null,Ja=null,_l=null;const Mv=()=>{if(Lr?.readyState===WebSocket.OPEN)return Promise.resolve();if(Ja){if(_l){Ja=null;const e=_l;return _l=null,Promise.reject(e)}return Ja}return Ja=new Promise((e,i)=>{Lr=new WebSocket(`${NT}/api/ws`),Lr.onopen=()=>{Ja=null,_l=null,e()},Lr.onerror=()=>{Ja=null,_l=new Error("ws_connect_failed"),i(_l)},Lr.onmessage=a=>{let r;try{r=JSON.parse(a.data)}catch{return}if(r.type==="res"&&r.id&&fo.has(r.id)){const o=fo.get(r.id);clearTimeout(o.timer),fo.delete(r.id),r.ok?o.resolve(r.payload):o.reject(new Pp(String(r.error??"request_failed"),500,r.error));return}const s=ST(a.data);if(s)for(const o of xp)o(s)},Lr.onclose=()=>{Ja=null,setTimeout(()=>{Mv().catch(()=>{})},1e3)}}),Ja},ht=async(e,i={})=>{await Mv();const a=`req-${++CT}`;return new Promise((r,s)=>{const o=setTimeout(()=>{fo.delete(a),s(new Error(`request_timeout:${e}`))},wT);fo.set(a,{resolve:r,reject:s,timer:o}),Lr.send(JSON.stringify({type:"req",id:a,method:e,params:i}))})},jv=e=>(xp.add(e),()=>{xp.delete(e)});async function ub(){const e=await ht("pipeline.list");return Array.isArray(e.items)?e.items:[]}async function ET(e){return ht("pipeline.create",e)}async function kT(e){return ht("pipeline.delete",{pipelineId:e})}async function AT(e,i){return ht("pipeline.rename",{pipelineId:e,title:i})}async function MT(e){return(await ht("pipeline.workflow.get",{pipelineId:e})).workflow??null}async function wi(e,i){return ht("pipeline.workflow.save",{pipelineId:e,workflow:i})}async function jT(e,i){return ht("pipeline.scheduler.toggle",{pipelineId:e,enabled:i})}async function TT(e,i){return ht("pipeline.scheduler.mode",{pipelineId:e,mode:i})}async function DT(e){return ht("pipeline.tick",{pipelineId:e})}async function OT(e,i,a){return ht("pipeline.node.retry",{pipelineId:e,nodeId:i})}async function _T(e){return ht("pipeline.run",{pipelineId:e})}async function FT(e){return ht("pipeline.stop",{pipelineId:e})}async function BT(e,i){return ht("pipeline.batchRun.startRemote",{pipelineId:e,...i})}async function RT(e){return ht("pipeline.batchRun.stop",{pipelineId:e})}async function LT(e){const i=await ht("pipeline.output.list",{pipelineId:e});return Array.isArray(i.items)?i.items:[]}async function zT(){const e=await ht("pipeline.link.list");return Array.isArray(e.items)?e.items:[]}async function IT(e){return ht("pipeline.link.create",e)}async function $T(e,i){return ht("pipeline.link.update",{linkId:e,...i})}async function HT(e){return ht("pipeline.link.delete",{linkId:e})}async function UT(e){const i=await ht("pipeline.queue.list",{pipelineId:e});return Array.isArray(i.items)?i.items:[]}async function PT(e,i){return ht("pipeline.queue.retry",{pipelineId:e,jobId:i})}async function qT(e,i,a){return ht("pipeline.queue.cancel",{pipelineId:e,jobId:i,reason:"canceled_by_user"})}async function GT(e){return ht("pipeline.queue.drain",{pipelineId:e})}const VT={width:24,height:24};function KT({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:VT,content:'<g class="nrj6p8qat"><path class="oqp-zlo1c"/><path class="eslg_bc-y"/><path class="vxr-ddbnw"/></g>',fallback:"lucide:refresh-cw"})}const Lh="px-3 py-1.5 text-xs font-semibold border border-[var(--line)] cursor-pointer bg-transparent",zh="bg-[var(--live-15)] text-[var(--live)] border-[var(--live-35)]",YT={pending:"warn",running:"live",success:"good",failed:"bad",canceled:"muted"};function QT({pipelines:e}){const{t:i}=Gt("dispatch"),[a,r]=C.useState([]),[s,o]=C.useState(!0),[f,c]=C.useState(""),[p,d]=C.useState(!1),[g,m]=C.useState(""),[y,v]=C.useState(""),[N,M]=C.useState("continue"),[D,k]=C.useState(100),[U,T]=C.useState(!1),[Q,ee]=C.useState(""),[R,F]=C.useState([]),[I,K]=C.useState([]),[j,P]=C.useState(""),[q,W]=C.useState("links"),H=C.useCallback(async()=>{try{const w=await zT();r(w)}catch{}o(!1)},[]),ae=C.useCallback(async w=>{if(w)try{const he=await UT(w);F(he)}catch{F([])}},[]),E=C.useCallback(async w=>{if(w)try{const he=await LT(w);K(he)}catch{K([])}},[]);C.useEffect(()=>{H()},[H]),C.useEffect(()=>{q==="queue"&&Q&&ae(Q)},[q,Q,ae]),C.useEffect(()=>{q==="outputs"&&j&&E(j)},[q,j,E]);const _=async()=>{if(!(!g||!y)){T(!0),c("");try{const w=await IT({fromPipelineId:g,toPipelineId:y,onJobFailed:N,maxPendingJobs:D});w.ok?(d(!1),m(""),v(""),await H()):c(w.error??i("createFailed"))}catch(w){c(String(w))}T(!1)}},Y=async w=>{await $T(w.id,{enabled:!w.enabled}),await H()},oe=async w=>{await HT(w),await H()},O=async(w,he)=>{await PT(w,he),await ae(w)},B=async(w,he)=>{await qT(w,he),await ae(w)},Z=async w=>{await GT(w),await ae(w)};return s?x.jsx("div",{className:"p-4 text-xs text-[var(--muted)]",children:i("loading")}):x.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[x.jsxs("div",{className:"flex items-center gap-1 px-3 py-2 border-b border-[var(--line)]",children:[x.jsx("button",{className:`${Lh} ${q==="links"?zh:""}`,onClick:()=>W("links"),children:i("links")}),x.jsx("button",{className:`${Lh} ${q==="queue"?zh:""}`,onClick:()=>W("queue"),children:i("queue")}),x.jsx("button",{className:`${Lh} ${q==="outputs"?zh:""}`,onClick:()=>W("outputs"),children:i("outputs")})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[q==="links"&&x.jsxs("div",{className:"p-3",children:[x.jsxs("div",{className:"flex items-center justify-between mb-2",children:[x.jsx("span",{className:"text-xs font-semibold text-[var(--text)]",children:i("linkCount",{count:a.length})}),x.jsxs("button",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs border border-[var(--live-25)] text-[var(--live)] cursor-pointer bg-transparent hover:bg-[var(--live-10)]",onClick:()=>{d(!p),c(""),g||m(e[0]?.id??""),y||v(e[1]?.id??e[0]?.id??"")},children:[x.jsx(Up,{className:"w-3 h-3"}),i("createLink")]})]}),f&&x.jsx("p",{className:`${Li} mb-2 text-[var(--bad)]`,children:f}),p&&x.jsxs("div",{className:"mb-3 p-3 border border-[var(--line)] bg-[var(--surface-5)]",children:[x.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-2",children:[x.jsxs("div",{children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("upstreamPipeline")}),x.jsx("select",{className:gn,value:g,onChange:w=>m(w.target.value),children:e.map(w=>x.jsxs("option",{value:w.id,children:[w.id," | ",w.title]},w.id))})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("downstreamPipeline")}),x.jsx("select",{className:gn,value:y,onChange:w=>v(w.target.value),children:e.map(w=>x.jsxs("option",{value:w.id,children:[w.id," | ",w.title]},w.id))})]})]}),x.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-2",children:[x.jsxs("div",{children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("failPolicy")}),x.jsxs("select",{className:gn,value:N,onChange:w=>M(w.target.value),children:[x.jsx("option",{value:"continue",children:i("continueOption")}),x.jsx("option",{value:"pause",children:i("pauseOption")})]})]}),x.jsxs("div",{children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("maxQueue")}),x.jsx("input",{className:ap,type:"number",min:1,max:1e4,value:D,onChange:w=>k(Number(w.target.value)||100)})]})]}),x.jsxs("div",{className:Wa,children:[x.jsx("button",{className:"px-3 py-1 text-xs border border-[var(--live-25)] bg-transparent text-[var(--live)] cursor-pointer",onClick:_,disabled:U||!g||!y||g===y,children:i(U?"creating":"confirmCreate")}),x.jsx("button",{className:"px-3 py-1 text-xs border border-[var(--line)] bg-transparent text-[var(--muted)] cursor-pointer",onClick:()=>d(!1),children:i("cancel")})]})]}),a.length===0?x.jsx("p",{className:"text-xs text-[var(--muted)]",children:i("noLinks")}):x.jsx("div",{className:"space-y-1",children:a.map(w=>x.jsxs("div",{className:"flex items-center gap-2 p-2 border border-[var(--line)] bg-[var(--surface-3)] text-xs",children:[x.jsx("span",{className:"text-[var(--live)] font-mono text-[11px]",children:w.id}),x.jsx("span",{className:"font-mono text-[var(--text)]",children:w.fromPipelineId}),x.jsx("span",{className:"text-[var(--muted)]",children:"→"}),x.jsx("span",{className:"font-mono text-[var(--text)]",children:w.toPipelineId}),w.inputContract?.requireType&&x.jsxs("span",{className:"text-[var(--muted)] text-[10px]",children:["type:",w.inputContract.requireType]}),x.jsx("span",{className:`ml-auto px-1.5 py-0.5 text-[10px] font-semibold ${w.enabled?"text-[var(--good)]":"text-[var(--muted)]"}`,children:w.enabled?i("common:common.enabled"):i("common:common.disabled")}),x.jsxs("span",{className:"text-[10px] text-[var(--muted)]",children:["onFailed:",w.onJobFailed," | max:",w.maxPendingJobs]}),x.jsx("button",{className:"px-1.5 py-0.5 text-[10px] border border-[var(--line)] bg-transparent text-[var(--text)] cursor-pointer",onClick:()=>Y(w),children:w.enabled?i("disable"):i("enable")}),x.jsx("button",{className:"px-1.5 py-0.5 text-[10px] border border-[var(--bad-25)] bg-transparent text-[var(--bad)] cursor-pointer",onClick:()=>oe(w.id),children:x.jsx(gp,{className:"w-3 h-3"})})]},w.id))})]}),q==="queue"&&x.jsxs("div",{className:"p-3",children:[x.jsxs("div",{className:"mb-2",children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("selectPipeline")}),x.jsxs("select",{className:gn,value:Q,onChange:w=>ee(w.target.value),children:[x.jsx("option",{value:"",children:i("selectPipelinePlaceholder")}),e.map(w=>x.jsxs("option",{value:w.id,children:[w.id," | ",w.title]},w.id))]})]}),Q?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"flex items-center justify-between mb-2",children:[x.jsx("span",{className:"text-[11px] text-[var(--muted)]",children:R.length===0?i("queueEmpty"):i("queueCount",{count:R.length})}),x.jsx("button",{className:"px-2 py-0.5 text-[10px] border border-[var(--live-25)] bg-transparent text-[var(--live)] cursor-pointer",onClick:()=>Z(Q),children:i("drainQueue")})]}),R.length>0&&x.jsx("div",{className:"space-y-1",children:R.map(w=>x.jsxs("div",{className:"flex items-center gap-2 p-2 border border-[var(--line)] bg-[var(--surface-3)] text-xs",children:[x.jsx("span",{className:"font-mono text-[11px] text-[var(--text)] truncate max-w-[180px]",children:w.jobId}),x.jsx("span",{className:"text-[var(--muted)]",children:"←"}),x.jsx("span",{className:"font-mono text-[var(--text)]",children:w.fromPipelineId}),x.jsx("span",{className:`px-1 py-0.5 text-[10px] font-semibold text-[var(--${YT[w.status]??"muted"})]`,children:i(`common:status.${w.status}`)}),w.targetRunId&&x.jsxs("span",{className:"text-[10px] text-[var(--muted)]",children:["run:",w.targetRunId]}),x.jsx("span",{className:"text-[10px] text-[var(--muted)] ml-auto",children:new Date(w.createdAt).toLocaleString()}),(w.status==="failed"||w.status==="canceled")&&x.jsx("button",{className:"px-1.5 py-0.5 text-[10px] border border-[var(--live-25)] bg-transparent text-[var(--live)] cursor-pointer",onClick:()=>O(Q,w.jobId),children:x.jsx(KT,{className:"w-3 h-3"})}),w.status==="pending"&&x.jsx("button",{className:"px-1.5 py-0.5 text-[10px] border border-[var(--bad-25)] bg-transparent text-[var(--bad)] cursor-pointer",onClick:()=>B(Q,w.jobId),children:x.jsx(Sv,{className:"w-3 h-3"})})]},w.jobId))})]}):x.jsx("p",{className:"text-xs text-[var(--muted)]",children:i("selectToViewQueue")})]}),q==="outputs"&&x.jsxs("div",{className:"p-3",children:[x.jsxs("div",{className:"mb-2",children:[x.jsx("label",{className:"block mb-1 text-[11px] text-[var(--muted)]",children:i("selectPipeline")}),x.jsxs("select",{className:gn,value:j,onChange:w=>P(w.target.value),children:[x.jsx("option",{value:"",children:i("selectPipelinePlaceholder")}),e.map(w=>x.jsxs("option",{value:w.id,children:[w.id," | ",w.title]},w.id))]})]}),j?I.length===0?x.jsx("p",{className:"text-xs text-[var(--muted)]",children:i("noOutputs")}):x.jsx("div",{className:"space-y-1",children:I.map(w=>x.jsxs("div",{className:"flex items-center gap-2 p-2 border border-[var(--line)] bg-[var(--surface-3)] text-xs",children:[x.jsx("span",{className:"font-mono text-[11px] text-[var(--text)]",children:w.outputId}),x.jsxs("span",{className:"text-[var(--muted)]",children:["node:",w.outputNodeId]}),x.jsxs("span",{className:"text-[10px] text-[var(--muted)]",children:["type:",w.artifactRef.type]}),x.jsx("span",{className:"text-[10px] text-[var(--muted)] ml-auto",children:new Date(w.producedAt).toLocaleString()}),x.jsxs("span",{className:"text-[10px] text-[var(--muted)]",children:["run:",w.runId]})]},w.outputId))}):x.jsx("p",{className:"text-xs text-[var(--muted)]",children:i("selectToViewOutputs")})]})]})]})}function JT(e){if(!Array.isArray(e))return[];const i=a=>{if(typeof a=="number"&&Number.isFinite(a))return a;if(typeof a=="string"&&a.trim()){const r=Number(a);if(Number.isFinite(r))return r;const s=Date.parse(a);if(Number.isFinite(s))return s}return null};return e.map((a,r)=>{const s=a??{},o=String(s.id??s.name??s.key??`agent-${r}`),f=String(s.role??"agent"),c=String(s.status??s.state??""),p=!!(s.online??s.enabled??(c?c==="online"||c==="ready"||c==="active":!0)),d=i(s.lastActiveAtMs??s.lastActiveAt??s.updatedAt??s.lastSeenAt??s.endedAt)??null,g=d?new Date(d).toISOString():null;return{id:o,role:f,online:p,lastActiveAt:g,lastActiveAtMs:d}}).sort((a,r)=>{const s=a.lastActiveAtMs??-1,o=r.lastActiveAtMs??-1;return s!==o?o-s:a.id.localeCompare(r.id)})}async function cb(){const e=await ht("agent.list");return JT(e.items)}const XT=e=>{if(Array.isArray(e.items)&&e.items.length>0)return e.items;const i=e.raw??{};return Array.isArray(i.files)?i.files:Array.isArray(e.items)?e.items:[]},ZT=e=>{const i=e??{},a=String(i.name??i.fileName??i.path??"").trim();if(!a)return null;const r=i.size,s=i.updatedAt??i.modifiedAt??i.mtime,o=i.updatedAtMs,f=typeof s=="string"?s:typeof o=="number"&&Number.isFinite(o)?new Date(o).toISOString():null;return{name:a,size:typeof r=="number"&&Number.isFinite(r)?r:null,updatedAt:f}},Tv=(e,i)=>{const a=e.item??{},s=a.file??null??a,o=String(s.name??s.fileName??i).trim()||i,f=s.content??s.text??s.body??s.value??"",c=typeof f=="string"?f:f==null?"":JSON.stringify(f,null,2);return{name:o,content:c}};async function WT(e){const i=await ht("agent.files.list",{agentId:e});return XT(i).map(ZT).filter(a=>!!a)}async function eD(e,i){const a=await ht("agent.files.get",{agentId:e,name:i});return Tv(a,i)}async function tD(e){const i=await ht("agent.files.set",{agentId:e.agentId,name:e.name,content:e.content});return Tv(i,e.name)}function nD(e){return Array.isArray(e)?e.map(i=>{const a=i??{},r=String(a.sessionKey??a.key??a.sessionId??a.id??"").trim();if(!r)return null;const s=String(a.title??a.name??r);return{id:r,title:s}}).filter(i=>!!i):[]}async function fb(){const e=await ht("session.list");return nD(e.items)}async function iD(e){return ht("session.create",e)}async function aD(e){return ht("session.send",{sessionId:e.sessionId,message:e.message,mode:e.mode})}const rD=e=>e.flatMap((i,a)=>{const r=i??{},s=String(r.role??r.senderRole??r.authorRole??r.sender?.role??"unknown").toLowerCase(),o=s==="user"||s==="assistant"||s==="system"?s:s==="toolresult"||s==="tool_result"||s==="tool"?"tool":"unknown",f=r.ts??r.time??r.createdAt??r.timestamp;let c=null;typeof f=="string"&&f.trim()?c=f:typeof f=="number"&&Number.isFinite(f)&&(c=new Date(f).toISOString());const p=typeof r.model=="string"&&r.model.trim()?r.model.trim():void 0,d=r.modelProvider??r.provider,g=typeof d=="string"&&d.trim()?d.trim():void 0,m=typeof r.api=="string"&&r.api.trim()?r.api.trim():void 0,y=F=>{const I={...F};return p&&(I.model=p),g&&(I.modelProvider=g),m&&(I.api=m),I},v=Array.isArray(r.content)?r.content.map(F=>F??{}):null;if(s==="assistant"&&v&&v.length>0){const F=v.filter(K=>String(K.type??"").toLowerCase()==="text").map(K=>typeof K.text=="string"?K.text:"").filter(K=>K.trim()),I=v.filter(K=>String(K.type??"").toLowerCase()==="toolcall");if(I.length>0){const K=[],j=String(r.id??r.eventId??r.seq??`${a}`);return F.length>0&&K.push(y({id:`${j}:assistant`,role:"assistant",text:F.join(`
42
+ `),ts:c})),I.forEach((P,q)=>{const W=String(P.name??P.toolName??"tool").trim()||"tool",H=P.id??P.toolCallId??P.tool_call_id??r.toolCallId??r.tool_call_id,ae=typeof H=="string"&&H.trim()?H.trim():void 0,E=P.arguments,_=typeof E=="string"?E:E&&typeof E=="object"?JSON.stringify(E,null,2):"";K.push({id:`${j}:toolcall:${q}`,role:"tool",text:_?`[toolCall] ${W}
43
+ ${_}`:`[toolCall] ${W}`,ts:c,toolName:W,toolCallId:ae,toolEventType:"call",toolArgs:typeof E=="string"||E&&typeof E=="object"?E:void 0})}),K}}const N=(()=>{const F=r.content;if(typeof F=="string"&&F.trim())return F;if(Array.isArray(F)){const j=F.some(q=>{const W=q??{};return String(W.type??"").toLowerCase()==="text"&&typeof W.text=="string"&&W.text.trim()}),P=F.map(q=>{const W=q??{},H=String(W.type??"").toLowerCase();if(H==="text"){const ae=W.text;return typeof ae=="string"?ae:""}if(H==="toolcall"){const ae=String(W.name??"tool"),E=W.arguments,_=E&&typeof E=="object"?JSON.stringify(E,null,2):typeof E=="string"?E:"";return j?_?`[toolCall] ${ae}
44
+ ${_}`:`[toolCall] ${ae}`:_?`[toolCall] ${ae}
45
+ ${_}`:`[toolCall] ${ae}`}if(H==="toolresult"){const ae=String(W.toolName??"tool"),E=typeof W.text=="string"?W.text:"";return E?`[toolResult:${ae}] ${E}`:`[toolResult:${ae}]`}return""}).filter(Boolean);if(P.length>0)return P.join(`
46
+ `)}const K=[r.text,r.message,r.delta?.text,r.payload?.text].find(j=>typeof j=="string"&&String(j).trim().length>0);return typeof K=="string"?K:""})();if(!N.trim())return[];const M=s==="assistant"&&Array.isArray(r.content)&&r.content.length>0&&r.content.every(F=>String((F??{}).type??"").toLowerCase()==="toolcall"),D=M?"tool":o,k=s==="toolresult"||s==="tool_result",U=(()=>{if(D!=="tool")return;if(typeof r.toolName=="string"&&r.toolName.trim())return r.toolName.trim();if(Array.isArray(r.content)){const K=r.content[0]??{},j=K.name??K.toolName;if(typeof j=="string"&&j.trim())return j.trim()}const F=N.match(/^\[toolCall\]\s+([^\n]+)/i);if(F?.[1])return F[1].trim();const I=N.match(/^\[toolResult:([^\]]+)\]/i);if(I?.[1])return I[1].trim()})(),T=(()=>{if(D!=="tool")return;const F=r.toolCallId??r.tool_call_id;return typeof F=="string"&&F.trim()?F.trim():void 0})(),Q=M?"call":k?"result":void 0,ee=(()=>{if(M&&Array.isArray(r.content)&&r.content.length>0){const I=(r.content[0]??{}).arguments;if(typeof I=="string"||I&&typeof I=="object")return I}})(),R={id:String(r.id??r.eventId??r.seq??`${a}`),role:D,text:N,ts:c};return U&&(R.toolName=U),T&&(R.toolCallId=T),Q&&(R.toolEventType=Q),ee&&(R.toolArgs=ee),[y(R)]});async function lD(e){const i={sessionId:e.sessionId};i.limit=Math.max(1,Math.floor(e.limit));const a=await ht("session.history",i),r=Array.isArray(a.items)?a.items:[];return rD(r)}const sD=e=>{const i=new Set,a=[];for(let r=0;r<e.length;r+=1){if(i.has(r))continue;const s=e[r];if(s.role!=="tool"){a.push({kind:"message",item:s});continue}if(s.toolEventType==="call"){let o=-1;for(let f=r+1;f<e.length;f+=1){if(i.has(f))continue;const c=e[f];if(c.role!=="tool"||c.toolEventType!=="result")continue;const p=s.toolCallId&&c.toolCallId&&s.toolCallId===c.toolCallId,d=s.toolName&&c.toolName&&s.toolName===c.toolName;if(p||d){o=f;break}}if(o>=0){const f=e[o];i.add(o),i.add(r);const c=(()=>{const p=s.toolArgs;if(typeof p=="string"&&p.trim())return p.trim();if(p&&typeof p=="object"){const d=p;return typeof d.command=="string"&&d.command.trim()?d.command.trim():typeof d.path=="string"&&d.path.trim()?d.path.trim():JSON.stringify(d)}return"-"})();a.push({kind:"tool",key:s.toolCallId??`${s.id}-${s.ts??""}`,toolName:s.toolName??f.toolName??"tool",commandText:c,outputText:f.text,ts:f.ts??s.ts})}continue}(s.toolEventType==="result"||!s.toolEventType)&&(i.add(r),a.push({kind:"tool",key:s.toolCallId??`${s.id}-${s.ts??""}`,toolName:s.toolName??"tool",commandText:"-",outputText:s.text,ts:s.ts}))}return a},oD=(e,i)=>{if(e.type!=="event")return null;const a=e.payload??{},r=String(a.sessionKey??a.sessionId??a.key??"").trim();if(!r||r!==i)return null;const s=String(a.stream??"").toLowerCase(),o=a.data??{};if(s==="lifecycle"){const g=String(o.phase??"").toLowerCase();if(g==="start")return{kind:"lifecycle-start"};if(g==="end")return{kind:"lifecycle-end"}}if(s==="assistant"){const g=typeof o.text=="string"?o.text:"";if(g.trim())return{kind:"assistant-text",text:g}}const f=a.delta??{},c=String(a.role??o.role??f.role??"").toLowerCase(),d=[f.text,a.text,o.text].find(g=>typeof g=="string"&&String(g).trim());return c==="assistant"&&typeof d=="string"?{kind:"assistant-text",text:d}:null},uD=(e,i)=>e?i?i.startsWith(e)?i:e.endsWith(i)?e:`${e}${i}`:e:i,cD=(e,i)=>{if(e.type!=="event"||e.event!=="agent"&&e.event!=="session.tool")return null;const a=e.payload??{},r=String(a.sessionKey??a.sessionId??a.key??"").trim();if(!r||r!==i)return null;const s=String(a.stream??"").toLowerCase();if(s!=="tool"&&s!=="command_output")return null;const o=a.data??{},f=String(o.phase??"").toLowerCase(),c=String(o.name??o.toolName??"tool").trim()||"tool",p=String(o.toolCallId??o.itemId??`${c}:${Date.now()}`).trim(),d=new Date().toISOString(),g=(()=>{const v=[o.arguments,o.args,o.input,o.command,o.path,o.title].find(N=>typeof N=="string"||N&&typeof N=="object");return typeof v=="string"&&v.trim()?v.trim():v&&typeof v=="object"?JSON.stringify(v):"-"})(),m=(()=>{const v=[o.output,o.text,o.result,o.message,o.meta,o.stdout,o.stderr].find(N=>typeof N=="string"||N&&typeof N=="object");return typeof v=="string"&&v.trim()?v.trim():v&&typeof v=="object"?JSON.stringify(v):""})();return s==="command_output"?f==="delta"||f==="update"?{kind:"tool-output",key:p,toolName:c,outputText:m,ts:d}:f==="end"||f==="result"?{kind:"tool-end",key:p,toolName:c,outputText:m,ts:d}:m?{kind:"tool-output",key:p,toolName:c,outputText:m,ts:d}:null:f==="start"?{kind:"tool-start",key:p,toolName:c,commandText:g,ts:d}:f==="result"?{kind:"tool-output",key:p,toolName:c,outputText:m,ts:d}:f==="update"?m?{kind:"tool-output",key:p,toolName:c,outputText:m,ts:d}:null:f==="end"?{kind:"tool-end",key:p,toolName:c,outputText:m,ts:d}:null},fD=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],db=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function dD(e){if(e<=255)return fD[e];let i=0,a=db.length-1;for(;i<=a;){const r=i+a>>1,s=db[r];if(e<s[0]){a=r-1;continue}if(e>s[1]){i=r+1;continue}return s[2]}return"L"}function hD(e){const i=e.length;if(i===0)return null;const a=new Array(i);let r=!1;for(let d=0;d<i;){const g=e.charCodeAt(d);let m=g,y=1;if(g>=55296&&g<=56319&&d+1<i){const N=e.charCodeAt(d+1);N>=56320&&N<=57343&&(m=(g-55296<<10)+(N-56320)+65536,y=2)}const v=dD(m);(v==="R"||v==="AL"||v==="AN")&&(r=!0);for(let N=0;N<y;N++)a[d+N]=v;d+=y}if(!r)return null;let s=0;for(let d=0;d<i;d++){const g=a[d];if(g==="L"){s=0;break}if(g==="R"||g==="AL"){s=1;break}}const o=new Int8Array(i);for(let d=0;d<i;d++)o[d]=s;const f=s&1?"R":"L",c=f;let p=c;for(let d=0;d<i;d++)a[d]==="NSM"?a[d]=p:p=a[d];p=c;for(let d=0;d<i;d++){const g=a[d];g==="EN"?a[d]=p==="AL"?"AN":"EN":(g==="R"||g==="L"||g==="AL")&&(p=g)}for(let d=0;d<i;d++)a[d]==="AL"&&(a[d]="R");for(let d=1;d<i-1;d++)a[d]==="ES"&&a[d-1]==="EN"&&a[d+1]==="EN"&&(a[d]="EN"),a[d]==="CS"&&(a[d-1]==="EN"||a[d-1]==="AN")&&a[d+1]===a[d-1]&&(a[d]=a[d-1]);for(let d=0;d<i;d++){if(a[d]!=="EN")continue;let g;for(g=d-1;g>=0&&a[g]==="ET";g--)a[g]="EN";for(g=d+1;g<i&&a[g]==="ET";g++)a[g]="EN"}for(let d=0;d<i;d++){const g=a[d];(g==="WS"||g==="ES"||g==="ET"||g==="CS")&&(a[d]="ON")}p=c;for(let d=0;d<i;d++){const g=a[d];g==="EN"?a[d]=p==="L"?"L":"EN":(g==="R"||g==="L")&&(p=g)}for(let d=0;d<i;d++){if(a[d]!=="ON")continue;let g=d+1;for(;g<i&&a[g]==="ON";)g++;const m=d>0?a[d-1]:c,y=g<i?a[g]:c,v=m!=="L"?"R":"L";if(v===(y!=="L"?"R":"L"))for(let M=d;M<g;M++)a[M]=v;d=g-1}for(let d=0;d<i;d++)a[d]==="ON"&&(a[d]=f);for(let d=0;d<i;d++){const g=a[d];(o[d]&1)===0?g==="R"?o[d]++:(g==="AN"||g==="EN")&&(o[d]+=2):(g==="L"||g==="AN"||g==="EN")&&o[d]++}return o}function pD(e,i){const a=hD(e);if(a===null)return null;const r=new Int8Array(i.length);for(let s=0;s<i.length;s++)r[s]=a[i[s]];return r}const mD=/[ \t\n\r\f]+/g,gD=/[\t\n\r\f]| {2,}|^ | $/;function xD(e){const i=e??"normal";return i==="pre-wrap"?{mode:i,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:i,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function bD(e){if(!gD.test(e))return e;let i=e.replace(mD," ");return i.charCodeAt(0)===32&&(i=i.slice(1)),i.length>0&&i.charCodeAt(i.length-1)===32&&(i=i.slice(0,-1)),i}function yD(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
47
+ `).replace(/[\r\f]/g,`
48
+ `):e.replace(/\r\n/g,`
49
+ `)}let Ih=null,vD;function SD(){return Ih===null&&(Ih=new Intl.Segmenter(vD,{granularity:"word"})),Ih}const ND=new RegExp("\\p{Script=Arabic}","u"),Dc=new RegExp("\\p{M}","u"),Dv=new RegExp("\\p{Nd}","u");function hb(e){return ND.test(e)}function pb(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function xa(e){for(let i=0;i<e.length;i++){const a=e.charCodeAt(i);if(!(a<12288)){if(a>=55296&&a<=56319&&i+1<e.length){const r=e.charCodeAt(i+1);if(r>=56320&&r<=57343){const s=(a-55296<<10)+(r-56320)+65536;if(pb(s))return!0;i++;continue}}if(pb(a))return!0}}return!1}function wD(e){const i=_c(e);return i!==null&&(qp.has(i)||Ur.has(i))}const CD=new Set([" "," ","⁠","\uFEFF"]);function ED(e){return xa(e)}function kD(e){const i=_c(e);return i!==null&&CD.has(i)}function bp(e){return!wD(e)&&!kD(e)}const qp=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Oc=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Gp=new Set(["'","’"]),Ur=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),AD=new Set([":",".","،","؛"]),MD=new Set(["၏"]),jD=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function TD(e){if(Vp(e))return!0;let i=!1;for(const a of e){if(Ur.has(a)){i=!0;continue}if(!(i&&Dc.test(a)))return!1}return i}function DD(e){for(const i of e)if(!qp.has(i)&&!Ur.has(i))return!1;return e.length>0}function OD(e){if(Vp(e))return!0;for(const i of e)if(!Oc.has(i)&&!Gp.has(i)&&!Dc.test(i))return!1;return e.length>0}function Vp(e){let i=!1;for(const a of e)if(!(a==="\\"||Dc.test(a))){if(Oc.has(a)||Ur.has(a)||Gp.has(a)){i=!0;continue}return!1}return i}function Ov(e,i){const a=i-1;if(a<=0)return Math.max(a,0);const r=e.charCodeAt(a);if(r<56320||r>57343)return a;const s=a-1;if(s<0)return a;const o=e.charCodeAt(s);return o>=55296&&o<=56319?s:a}function _c(e){if(e.length===0)return null;const i=Ov(e,e.length);return e.slice(i)}function _D(e){const i=Array.from(e);let a=i.length;for(;a>0;){const r=i[a-1];if(Dc.test(r)){a--;continue}if(Oc.has(r)||Gp.has(r)){a--;continue}break}return a<=0||a===i.length?null:{head:i.slice(0,a).join(""),tail:i.slice(a).join("")}}function FD(e,i,a){return a==="text"&&!i&&e.length===1&&e!=="-"&&e!=="—"?e:null}function mb(e,i,a,r){const s=i[r],o=e[r];if(s==null)return o;const f=a[r];if(o.length===f)return o;const c=s.repeat(f);return e[r]=c,c}function gb(e,i){return e&&i!==null&&AD.has(i)}function BD(e){const i=_c(e);return i!==null&&MD.has(i)}function RD(e){if(e.length<2||e[0]!==" ")return null;const i=e.slice(1);return new RegExp("^\\p{M}+$","u").test(i)?{space:" ",marks:i}:null}function yp(e){let i=e.length;for(;i>0;){const a=Ov(e,i),r=e.slice(a,i);if(jD.has(r))return!0;if(!Ur.has(r))return!1;i=a}return!1}function LD(e,i){if(i.preserveOrdinarySpaces||i.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(i.preserveHardBreaks&&e===`
50
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const zD=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function xi(e){return e.length===1?e[0]:e.join("")}function ID(e,i){const a=[];for(let r=e.length-1;r>=0;r--)a.push(e[r]);return a.push(i),xi(a)}function $D(e,i,a,r){if(!zD.test(e))return[{text:e,isWordLike:i,kind:"text",start:a}];const s=[];let o=null,f=[],c=a,p=!1,d=0;for(const g of e){const m=LD(g,r),y=m==="text"&&i;if(o!==null&&m===o&&y===p){f.push(g),d+=g.length;continue}o!==null&&s.push({text:xi(f),isWordLike:p,kind:o,start:c}),o=m,f=[g],c=a+d,p=y,d+=g.length}return o!==null&&s.push({text:xi(f),isWordLike:p,kind:o,start:c}),s}function vp(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const HD=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function UD(e,i){const a=e.texts[i];return a.startsWith("www.")?!0:HD.test(a)&&i+1<e.len&&e.kinds[i+1]==="text"&&e.texts[i+1]==="//"}function PD(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function qD(e){const i=e.texts.slice(),a=e.isWordLike.slice(),r=e.kinds.slice(),s=e.starts.slice();for(let f=0;f<e.len;f++){if(r[f]!=="text"||!UD(e,f))continue;const c=[i[f]];let p=f+1;for(;p<e.len&&!vp(r[p]);){c.push(i[p]),a[f]=!0;const d=i[p].includes("?");if(r[p]="text",i[p]="",p++,d)break}i[f]=xi(c)}let o=0;for(let f=0;f<i.length;f++){const c=i[f];c.length!==0&&(o!==f&&(i[o]=c,a[o]=a[f],r[o]=r[f],s[o]=s[f]),o++)}return i.length=o,a.length=o,r.length=o,s.length=o,{len:o,texts:i,isWordLike:a,kinds:r,starts:s}}function GD(e){const i=[],a=[],r=[],s=[];for(let o=0;o<e.len;o++){const f=e.texts[o];if(i.push(f),a.push(e.isWordLike[o]),r.push(e.kinds[o]),s.push(e.starts[o]),!PD(f))continue;const c=o+1;if(c>=e.len||vp(e.kinds[c]))continue;const p=[],d=e.starts[c];let g=c;for(;g<e.len&&!vp(e.kinds[g]);)p.push(e.texts[g]),g++;p.length>0&&(i.push(xi(p)),a.push(!0),r.push("text"),s.push(d),o=g-1)}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}const VD=new Set([":","-","/","×",",",".","+","–","—"]),xb=/^[A-Za-z0-9_]+[,:;]*$/,bb=/[,:;]+$/;function _v(e){for(const i of e)if(Dv.test(i))return!0;return!1}function hc(e){if(e.length===0)return!1;for(const i of e)if(!(Dv.test(i)||VD.has(i)))return!1;return!0}function KD(e){const i=[],a=[],r=[],s=[];for(let o=0;o<e.len;o++){const f=e.texts[o],c=e.kinds[o];if(c==="text"&&hc(f)&&_v(f)){const p=[f];let d=o+1;for(;d<e.len&&e.kinds[d]==="text"&&hc(e.texts[d]);)p.push(e.texts[d]),d++;i.push(xi(p)),a.push(!0),r.push("text"),s.push(e.starts[o]),o=d-1;continue}i.push(f),a.push(e.isWordLike[o]),r.push(c),s.push(e.starts[o])}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function YD(e){const i=[],a=[],r=[],s=[];for(let o=0;o<e.len;o++){const f=e.texts[o],c=e.kinds[o],p=e.isWordLike[o];if(c==="text"&&p&&xb.test(f)){const d=[f];let g=bb.test(f),m=o+1;for(;g&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&xb.test(e.texts[m]);){const y=e.texts[m];d.push(y),g=bb.test(y),m++}i.push(xi(d)),a.push(!0),r.push("text"),s.push(e.starts[o]),o=m-1;continue}i.push(f),a.push(p),r.push(c),s.push(e.starts[o])}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function QD(e){const i=[],a=[],r=[],s=[];for(let o=0;o<e.len;o++){const f=e.texts[o];if(e.kinds[o]==="text"&&f.includes("-")){const c=f.split("-");let p=c.length>1;for(let d=0;d<c.length;d++){const g=c[d];if(!p)break;(g.length===0||!_v(g)||!hc(g))&&(p=!1)}if(p){let d=0;for(let g=0;g<c.length;g++){const m=c[g],y=g<c.length-1?`${m}-`:m;i.push(y),a.push(!0),r.push("text"),s.push(e.starts[o]+d),d+=y.length}continue}}i.push(f),a.push(e.isWordLike[o]),r.push(e.kinds[o]),s.push(e.starts[o])}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function JD(e){const i=[],a=[],r=[],s=[];let o=0;for(;o<e.len;){const f=[e.texts[o]];let c=e.isWordLike[o],p=e.kinds[o],d=e.starts[o];if(p==="glue"){const g=[f[0]],m=d;for(o++;o<e.len&&e.kinds[o]==="glue";)g.push(e.texts[o]),o++;const y=xi(g);if(o<e.len&&e.kinds[o]==="text")f[0]=y,f.push(e.texts[o]),c=e.isWordLike[o],p="text",d=m,o++;else{i.push(y),a.push(!1),r.push("glue"),s.push(m);continue}}else o++;if(p==="text")for(;o<e.len&&e.kinds[o]==="glue";){const g=[];for(;o<e.len&&e.kinds[o]==="glue";)g.push(e.texts[o]),o++;const m=xi(g);if(o<e.len&&e.kinds[o]==="text"){f.push(m,e.texts[o]),c=c||e.isWordLike[o],o++;continue}f.push(m)}i.push(xi(f)),a.push(c),r.push(p),s.push(d)}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function XD(e){const i=e.texts.slice(),a=e.isWordLike.slice(),r=e.kinds.slice(),s=e.starts.slice();for(let o=0;o<i.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!xa(i[o])||!xa(i[o+1]))continue;const f=_D(i[o]);f!==null&&(i[o]=f.head,i[o+1]=f.tail+i[o+1],s[o+1]=s[o]+f.head.length)}return{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function yb(e,i,a){const r=SD();let s=0;const o=[],f=[],c=[],p=[],d=[],g=[],m=[],y=[],v=[],N=[],M=[],D=[];for(const F of r.segment(e))for(const I of $D(F.segment,F.isWordLike??!1,F.index,a)){let _=function(){g[E]!==null&&(f[E]=[mb(o,g,m,E)],g[E]=null),f[E].push(I.text),c[E]=c[E]||I.isWordLike,y[E]=y[E]||P,v[E]=v[E]||q,N[E]=H,M[E]=ae,D[E]=gb(v[E],W)};var R=_;const K=I.kind==="text",j=FD(I.text,I.isWordLike,I.kind),P=xa(I.text),q=hb(I.text),W=_c(I.text),H=yp(I.text),ae=BD(I.text),E=s-1;i.carryCJKAfterClosingQuote&&K&&s>0&&p[E]==="text"&&P&&y[E]&&N[E]||K&&s>0&&p[E]==="text"&&DD(I.text)&&y[E]||K&&s>0&&p[E]==="text"&&M[E]?_():K&&s>0&&p[E]==="text"&&I.isWordLike&&q&&D[E]?(_(),c[E]=!0):j!==null&&s>0&&p[E]==="text"&&g[E]===j?m[E]=(m[E]??1)+1:K&&!I.isWordLike&&s>0&&p[E]==="text"&&(TD(I.text)||I.text==="-"&&c[E])?_():(o[s]=I.text,f[s]=[I.text],c[s]=I.isWordLike,p[s]=I.kind,d[s]=I.start,g[s]=j,m[s]=j===null?0:1,y[s]=P,v[s]=q,N[s]=H,M[s]=ae,D[s]=gb(q,W),s++)}for(let F=0;F<s;F++){if(g[F]!==null){o[F]=mb(o,g,m,F);continue}o[F]=xi(f[F])}for(let F=1;F<s;F++)p[F]==="text"&&!c[F]&&Vp(o[F])&&p[F-1]==="text"&&(o[F-1]+=o[F],c[F-1]=c[F-1]||c[F],o[F]="");const k=Array.from({length:s},()=>null);let U=-1;for(let F=s-1;F>=0;F--){const I=o[F];if(I.length!==0){if(p[F]==="text"&&!c[F]&&OD(I)&&U>=0&&p[U]==="text"){const K=k[U]??[];K.push(I),k[U]=K,d[U]=d[F],o[F]="";continue}U=F}}for(let F=0;F<s;F++){const I=k[F];I!=null&&(o[F]=ID(I,o[F]))}let T=0;for(let F=0;F<s;F++){const I=o[F];I.length!==0&&(T!==F&&(o[T]=I,c[T]=c[F],p[T]=p[F],d[T]=d[F]),T++)}o.length=T,c.length=T,p.length=T,d.length=T;const Q=JD({len:T,texts:o,isWordLike:c,kinds:p,starts:d}),ee=XD(YD(QD(KD(GD(qD(Q))))));for(let F=0;F<ee.len-1;F++){const I=RD(ee.texts[F]);I!==null&&(ee.kinds[F]!=="space"&&ee.kinds[F]!=="preserved-space"||ee.kinds[F+1]!=="text"||!hb(ee.texts[F+1])||(ee.texts[F]=I.space,ee.isWordLike[F]=!1,ee.kinds[F]=ee.kinds[F]==="preserved-space"?"preserved-space":"space",ee.texts[F+1]=I.marks+ee.texts[F+1],ee.starts[F+1]=ee.starts[F]+I.space.length))}return ee}function ZD(e,i){if(e.len===0)return[];if(!i.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const a=[];let r=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(a.push({startSegmentIndex:r,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),r=s+1);return r<e.len&&a.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),a}function WD(e){if(e.len<=1)return e;const i=[],a=[],r=[],s=[];let o=null,f=!1,c=0,p=!1,d=!1;function g(){o!==null&&(i.push(xi(o)),a.push(f),r.push("text"),s.push(c),o=null)}for(let m=0;m<e.len;m++){const y=e.texts[m],v=e.kinds[m],N=e.isWordLike[m],M=e.starts[m];if(v==="text"){const D=ED(y),k=bp(y);if(o!==null&&p&&d){o.push(y),f=f||N,p=p||D,d=k;continue}g(),o=[y],f=N,c=M,p=D,d=k;continue}g(),i.push(y),a.push(N),r.push(v),s.push(M)}return g(),{len:i.length,texts:i,isWordLike:a,kinds:r,starts:s}}function e5(e,i,a="normal",r="normal"){const s=xD(a),o=s.mode==="pre-wrap"?yD(e):bD(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const f=r==="keep-all"?WD(yb(o,i,s)):yb(o,i,s);return{normalized:o,chunks:ZD(f,s),...f}}let Fl=null;const vb=new Map;let Bl=null;const t5=96,n5=new RegExp("\\p{Emoji_Presentation}","u"),i5=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let $h=null;const Sb=new Map;function Kp(){if(Fl!==null)return Fl;if(typeof OffscreenCanvas<"u")return Fl=new OffscreenCanvas(1,1).getContext("2d"),Fl;if(typeof document<"u")return Fl=document.createElement("canvas").getContext("2d"),Fl;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function a5(e){let i=vb.get(e);return i||(i=new Map,vb.set(e,i)),i}function er(e,i){let a=i.get(e);return a===void 0&&(a={width:Kp().measureText(e).width,containsCJK:xa(e)},i.set(e,a)),a}function Fc(){if(Bl!==null)return Bl;if(typeof navigator>"u")return Bl={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Bl;const e=navigator.userAgent,a=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Bl={lineFitEpsilon:a?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:a,preferEarlySoftHyphenBreak:a},Bl}function r5(e){const i=e.match(/(\d+(?:\.\d+)?)\s*px/);return i?parseFloat(i[1]):16}function Fv(){return $h===null&&($h=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$h}function l5(e){return n5.test(e)||e.includes("️")}function s5(e){return i5.test(e)}function o5(e,i){let a=Sb.get(e);if(a!==void 0)return a;const r=Kp();r.font=e;const s=r.measureText("😀").width;if(a=0,s>i+.5&&typeof document<"u"&&document.body!==null){const o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="😀",document.body.appendChild(o);const f=o.getBoundingClientRect().width;document.body.removeChild(o),s-f>.5&&(a=s-f)}return Sb.set(e,a),a}function u5(e){let i=0;const a=Fv();for(const r of a.segment(e))l5(r.segment)&&i++;return i}function c5(e,i){return i.emojiCount===void 0&&(i.emojiCount=u5(e)),i.emojiCount}function Ir(e,i,a){return a===0?i.width:i.width-c5(e,i)*a}function f5(e,i,a,r,s){if(i.breakableFitAdvances!==void 0)return i.breakableFitAdvances;const o=Fv(),f=[];for(const g of o.segment(e))f.push(g.segment);if(f.length<=1)return i.breakableFitAdvances=null,i.breakableFitAdvances;if(s==="sum-graphemes"){const g=[];for(const m of f){const y=er(m,a);g.push(Ir(m,y,r))}return i.breakableFitAdvances=g,i.breakableFitAdvances}if(s==="pair-context"||f.length>t5){const g=[];let m=null,y=0;for(const v of f){const N=er(v,a),M=Ir(v,N,r);if(m===null)g.push(M);else{const D=m+v,k=er(D,a);g.push(Ir(D,k,r)-y)}m=v,y=M}return i.breakableFitAdvances=g,i.breakableFitAdvances}const c=[];let p="",d=0;for(const g of f){p+=g;const m=er(p,a),y=Ir(p,m,r);c.push(y-d),d=y}return i.breakableFitAdvances=c,i.breakableFitAdvances}function d5(e,i){const a=Kp();a.font=e;const r=a5(e),s=r5(e),o=i?o5(e,s):0;return{cache:r,fontSize:s,emojiCorrection:o}}function h5(e,i){for(;i<e.widths.length;){const a=e.kinds[i];if(a!=="space"&&a!=="zero-width-break"&&a!=="soft-hyphen")break;i++}return i}function p5(e,i){if(i<=0)return 0;const a=e%i;return Math.abs(a)<=1e-6?i:i-a}function m5(e,i,a,r,s){let o=0,f=i;for(;o<e.length;){const c=f+e[o];if((o+1<e.length?c+s:c)>a+r)break;f=c,o++}return{fitCount:o,fittedWidth:f}}function g5(e,i){return e.simpleLineWalkFastPath?Bv(e,i):x5(e,i)}function Bv(e,i,a){const{widths:r,kinds:s,breakableFitAdvances:o}=e;if(r.length===0)return 0;const c=Fc().lineFitEpsilon,p=i+c;let d=0,g=0,m=!1,y=0,v=0,N=-1,M=0;function D(){N=-1,M=0}function k(F=y,I=v,K=g){d++,g=0,m=!1,D()}function U(F,I){m=!0,y=F+1,v=0,g=I}function T(F,I,K){m=!0,y=F,v=I+1,g=K}function Q(F,I){if(!m){U(F,I);return}g+=I,y=F+1,v=0}function ee(F,I){const K=o[F];for(let j=I;j<K.length;j++){const P=K[j];m?g+P>p?(k(),T(F,j,P)):(g+=P,y=F,v=j+1):T(F,j,P)}m&&y===F&&v===K.length&&(y=F+1,v=0)}let R=0;for(;R<r.length&&!(!m&&(R=h5(e,R),R>=r.length));){const F=r[R],I=s[R],K=I==="space"||I==="preserved-space"||I==="tab"||I==="zero-width-break"||I==="soft-hyphen";if(!m){F>i&&o[R]!==null?ee(R,0):U(R,F),K&&(N=R+1,M=g-F),R++;continue}if(g+F>p){if(K){Q(R,F),k(R+1,0,g-F),R++;continue}if(N>=0){if(y>N||y===N&&v>0){k();continue}k(N,0,M);continue}if(F>i&&o[R]!==null){k(),ee(R,0),R++;continue}k();continue}Q(R,F),K&&(N=R+1,M=g-F),R++}return m&&k(),d}function x5(e,i,a){if(e.simpleLineWalkFastPath)return Bv(e,i);const{widths:r,lineEndFitAdvances:s,lineEndPaintAdvances:o,kinds:f,breakableFitAdvances:c,discretionaryHyphenWidth:p,tabStopAdvance:d,chunks:g}=e;if(r.length===0||g.length===0)return 0;const m=Fc(),y=m.lineFitEpsilon,v=i+y;let N=0,M=0,D=!1,k=0,U=0,T=-1,Q=0,ee=0,R=null;function F(){T=-1,Q=0,ee=0,R=null}function I(E=k,_=U,Y=M){N++,M=0,D=!1,F()}function K(E,_){D=!0,k=E+1,U=0,M=_}function j(E,_,Y){D=!0,k=E,U=_+1,M=Y}function P(E,_){if(!D){K(E,_);return}M+=_,k=E+1,U=0}function q(E,_,Y,oe){if(!_)return;const O=E==="tab"?0:s[Y],B=E==="tab"?oe:o[Y];T=Y+1,Q=M-oe+O,ee=M-oe+B,R=E}function W(E,_){const Y=c[E];for(let oe=_;oe<Y.length;oe++){const O=Y[oe];D?M+O>v?(I(),j(E,oe,O)):(M+=O,k=E,U=oe+1):j(E,oe,O)}D&&k===E&&U===Y.length&&(k=E+1,U=0)}function H(E){if(R!=="soft-hyphen")return!1;const _=c[E];if(_==null)return!1;const{fitCount:Y,fittedWidth:oe}=m5(_,M,i,y,p);return Y===0?!1:(M=oe,k=E,U=Y,F(),Y===_.length?(k=E+1,U=0,!0):(I(E,Y,oe+p),W(E,Y),!0))}function ae(E){N++,F()}for(let E=0;E<g.length;E++){const _=g[E];if(_.startSegmentIndex===_.endSegmentIndex){ae();continue}D=!1,M=0,_.startSegmentIndex,k=_.startSegmentIndex,U=0,F();let Y=_.startSegmentIndex;for(;Y<_.endSegmentIndex;){const oe=f[Y],O=oe==="space"||oe==="preserved-space"||oe==="tab"||oe==="zero-width-break"||oe==="soft-hyphen",B=oe==="tab"?p5(M,d):r[Y];if(oe==="soft-hyphen"){D&&(k=Y+1,U=0,T=Y+1,Q=M+p,ee=M+p,R=oe),Y++;continue}if(!D){B>i&&c[Y]!==null?W(Y,0):K(Y,B),q(oe,O,Y,B),Y++;continue}if(M+B>v){const w=M+(oe==="tab"?0:s[Y]),he=M+(oe==="tab"?B:o[Y]);if(R==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&Q<=v){I(T,0,ee);continue}if(R==="soft-hyphen"&&H(Y)){Y++;continue}if(O&&w<=v){P(Y,B),I(Y+1,0,he),Y++;continue}if(T>=0&&Q<=v){if(k>T||k===T&&U>0){I();continue}const Ce=T;I(Ce,0,ee),Y=Ce;continue}if(B>i&&c[Y]!==null){I(),W(Y,0),Y++;continue}I();continue}P(Y,B),q(oe,O,Y,B),Y++}if(D){const oe=T===_.consumedEndSegmentIndex?ee:M;I(_.consumedEndSegmentIndex,0,oe)}}return N}let Hh=null;function b5(){return Hh===null&&(Hh=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Hh}function y5(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function v5(e,i){const a=[];let r=[],s=0,o=!1,f=!1,c=!1;function p(){r.length!==0&&(a.push({text:r.length===1?r[0]:r.join(""),start:s}),r=[],o=!1,f=!1,c=!1)}function d(m,y,v){r=[m],s=y,o=v,f=yp(m),c=Oc.has(m)}function g(m,y){r.push(m),o=o||y;const v=yp(m);m.length===1&&Ur.has(m)?f=f||v:f=v,c=!1}for(const m of b5().segment(e)){const y=m.segment,v=xa(y);if(r.length===0){d(y,m.index,v);continue}if(c||qp.has(y)||Ur.has(y)||i.carryCJKAfterClosingQuote&&v&&f){g(y,v);continue}if(!o&&!v){g(y,v);continue}p(),d(y,m.index,v)}return p(),a}function S5(e){if(e.length<=1)return e;const i=[];let a=[e[0].text],r=e[0].start,s=xa(e[0].text),o=bp(e[0].text);function f(){i.push({text:a.length===1?a[0]:a.join(""),start:r})}for(let c=1;c<e.length;c++){const p=e[c],d=xa(p.text),g=bp(p.text);if(s&&o){a.push(p.text),s=s||d,o=g;continue}f(),a=[p.text],r=p.start,s=d,o=g}return f(),i}function N5(e,i,a,r){const s=Fc(),{cache:o,emojiCorrection:f}=d5(i,s5(e.normalized)),c=Ir("-",er("-",o),f),d=Ir(" ",er(" ",o),f)*8;if(e.len===0)return y5();const g=[],m=[],y=[],v=[];let N=e.chunks.length<=1;const M=null,D=[],k=a?[]:null,U=Array.from({length:e.len});function T(F,I,K,j,P,q,W){P!=="text"&&P!=="space"&&P!=="zero-width-break"&&(N=!1),g.push(I),m.push(K),y.push(j),v.push(P),D.push(W),k!==null&&k.push(F)}function Q(F,I,K,j,P){const q=er(F,o),W=Ir(F,q,f),H=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:W,ae=I==="space"||I==="zero-width-break"?0:W;if(P&&j&&F.length>1){let E="sum-graphemes";hc(F)?E="pair-context":s.preferPrefixWidthsForBreakableRuns&&(E="segment-prefixes");const _=f5(F,q,o,f,E);T(F,W,H,ae,I,K,_);return}T(F,W,H,ae,I,K,null)}for(let F=0;F<e.len;F++){U[F]=g.length;const I=e.texts[F],K=e.isWordLike[F],j=e.kinds[F],P=e.starts[F];if(j==="soft-hyphen"){T(I,0,c,c,j,P,null);continue}if(j==="hard-break"){T(I,0,0,0,j,P,null);continue}if(j==="tab"){T(I,0,0,0,j,P,null);continue}const q=er(I,o);if(j==="text"&&q.containsCJK){const W=v5(I,s),H=r==="keep-all"?S5(W):W;for(let ae=0;ae<H.length;ae++){const E=H[ae];Q(E.text,"text",P+E.start,K,r==="keep-all"||!xa(E.text))}continue}Q(I,j,P,K,!0)}const ee=w5(e.chunks,U,g.length),R=M===null?null:pD(e.normalized,M);return k!==null?{widths:g,lineEndFitAdvances:m,lineEndPaintAdvances:y,kinds:v,simpleLineWalkFastPath:N,segLevels:R,breakableFitAdvances:D,discretionaryHyphenWidth:c,tabStopAdvance:d,chunks:ee,segments:k}:{widths:g,lineEndFitAdvances:m,lineEndPaintAdvances:y,kinds:v,simpleLineWalkFastPath:N,segLevels:R,breakableFitAdvances:D,discretionaryHyphenWidth:c,tabStopAdvance:d,chunks:ee}}function w5(e,i,a){const r=[];for(let s=0;s<e.length;s++){const o=e[s],f=o.startSegmentIndex<i.length?i[o.startSegmentIndex]:a,c=o.endSegmentIndex<i.length?i[o.endSegmentIndex]:a,p=o.consumedEndSegmentIndex<i.length?i[o.consumedEndSegmentIndex]:a;r.push({startSegmentIndex:f,endSegmentIndex:c,consumedEndSegmentIndex:p})}return r}function C5(e,i,a,r){const s=r?.wordBreak??"normal",o=e5(e,Fc(),r?.whiteSpace,s);return N5(o,i,a,s)}function pc(e,i,a){return C5(e,i,!1,a)}function mc(e,i,a){const r=g5(e,i);return{lineCount:r,height:r*a}}const E5='13px "Space Grotesk", sans-serif',Qu=19,Nb='12.5px "JetBrains Mono", monospace',Ju=18,k5=240,Rv=780,Lv=.92,A5=22,Uh=36,M5=180,wb=34,j5=34,T5=18,D5=18,O5=2,_5=220,F5=260,Ph=new Map,Cb=new Map,Xs=(e,i)=>{let a=0;for(const r of e.matchAll(i))a+=1;return a},B5=e=>e.replace(/```[\s\S]*?```/g,`
51
+ [code block]
52
+ `).replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^\s{0,3}(#{1,6})\s+/gm,"").replace(/^\s{0,3}>\s?/gm,"").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm,"").replace(/\*\*|__|\*|_|~~/g,"").replace(/\n{3,}/g,`
53
+
54
+ `).trim(),R5=({viewportWidth:e})=>{const i=Math.min(Rv,Math.max(k5,Math.floor(e*Lv)));return Math.max(120,i-A5)},L5=({viewportWidth:e})=>Math.max(M5,Math.min(Rv,Math.floor(e*Lv))),z5=e=>Math.max(120,L5(e)-20),I5=e=>{const i=Xs(e,/^\s{0,3}#{1,6}\s+/gm),a=Xs(e,/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm),r=Xs(e,/^\s{0,3}>\s?/gm),s=Xs(e,/```[\s\S]*?```/g),o=Xs(e,/\n{2,}/g);return i*8+a*4+r*6+s*12+o*3},$5=(e,i)=>{const a=B5(e),r=R5(i),s=`${r}::${a}`,o=Ph.get(s);if(o!==void 0)return o;if(!a){const m=Uh+Qu;return Ph.set(s,m),m}const f=pc(a,E5,{whiteSpace:"pre-wrap"}),{lineCount:c}=mc(f,r,Qu),p=Math.max(1,c)*Qu,d=Uh+p+I5(e),g=Math.max(Uh+Qu,d);return Ph.set(s,g),g},Eb=({viewportWidth:e,commandText:i,outputText:a,toolCollapsed:r,toolOutputCollapsed:s})=>{if(r)return wb;const o=z5({viewportWidth:e}),f=[o,r?"1":"0",s?"1":"0",i,a].join("::"),c=Cb.get(f);if(c!==void 0)return c;const p=i.trim()||"-",d=pc(p,Nb,{whiteSpace:"pre-wrap"}),g=Math.max(1,mc(d,o,Ju).lineCount),m=Math.min(_5,g*Ju+T5);let y=wb+m+j5+O5;if(!s){const v=a.trim()||"...",N=pc(v,Nb,{whiteSpace:"pre-wrap"}),M=Math.max(1,mc(N,o,Ju).lineCount),D=Math.min(F5,M*Ju+D5);y+=D}return Cb.set(f,y),y},kb=10,Ab=560,H5=640,U5=88,P5=26,tc="font-[JetBrains_Mono,monospace]",q5=e=>`${e.id}-${e.ts??""}`,G5=e=>36+Math.max(1,e.split(/\n+/).length)*20;function Mb(e,i,a,r,s,o){return x.jsxs("article",{className:`${a?"w-fit min-w-[180px] max-w-[min(72%,640px)]":"w-[min(92%,780px)]"} max-w-full min-w-0 justify-self-start border border-[rgba(142,163,179,0.14)] bg-[rgba(255,255,255,0.01)]`,children:[x.jsxs("button",{className:"flex w-full items-center justify-between gap-[10px] border-0 border-b border-[rgba(142,163,179,0.12)] bg-transparent px-[10px] py-2 text-left text-xs text-[#93a6b5] hover:bg-[rgba(142,163,179,0.04)]",type:"button",onClick:()=>s(e),children:[x.jsxs("span",{children:["tool ",i.toolName]}),x.jsx("span",{className:"inline-flex items-center justify-center leading-none text-[#7890a1]","aria-hidden":"true",children:x.jsx("svg",{viewBox:"0 0 12 12",width:"12",height:"12",focusable:"false",className:a?"":"rotate-90",children:x.jsx("path",{d:"M4 2.5L7.5 6L4 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),a?null:x.jsxs(x.Fragment,{children:[x.jsx("div",{className:`${tc} max-h-[220px] overflow-auto border-b border-[rgba(142,163,179,0.12)] bg-[rgba(7,12,16,0.5)] px-[10px] py-2 text-[12.5px] leading-[1.45] whitespace-pre-wrap break-words text-[#d1dbe3]`,title:i.commandText,children:i.commandText}),x.jsxs("button",{className:"flex w-full items-center justify-between gap-[10px] border-0 border-b border-[rgba(142,163,179,0.12)] bg-transparent px-[10px] py-2 text-left text-xs text-[#93a6b5] hover:bg-[rgba(142,163,179,0.04)]",type:"button",onClick:()=>o(e),children:[x.jsxs("span",{children:["Tool output ",i.toolName]}),x.jsx("span",{className:"inline-flex items-center justify-center leading-none text-[#7890a1]","aria-hidden":"true",children:x.jsx("svg",{viewBox:"0 0 12 12",width:"12",height:"12",focusable:"false",className:r?"":"rotate-90",children:x.jsx("path",{d:"M4 2.5L7.5 6L4 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),r?null:x.jsx("div",{className:"max-h-[260px] overflow-auto bg-[rgba(7,12,16,0.5)] px-[10px] py-2",children:x.jsx("p",{className:"m-0 whitespace-pre-wrap break-words font-[JetBrains_Mono,monospace] text-[12.5px] leading-[1.45] text-[#b4c3cf]",children:i.outputText||"..."})})]})]})}const V5=C.memo(function({historyStatusText:i,historyViewportWidth:a,historyViewportHeight:r,historyScrollTop:s,mergedHistory:o,liveTools:f,isThinking:c,liveAssistantId:p,collapsedToolMap:d,collapsedToolOutputMap:g,onToggleToolCollapsed:m,onToggleToolOutputCollapsed:y,onVirtualStatsChange:v}){const{t:N}=Gt("session"),M=C.useRef(new Map),D=C.useRef(null),k=C.useRef(null),[U,T]=C.useState(0);C.useEffect(()=>{if(!(typeof ResizeObserver>"u"))return D.current=new ResizeObserver(I=>{let K=!1;const j=M.current;for(let P=0;P<I.length;P+=1){const q=I[P],W=q.target.dataset.rowKey;if(!W)continue;const H=Math.max(1,Math.ceil(q.contentRect.height));j.get(W)!==H&&(j.set(W,H),K=!0)}K&&T(P=>P+1)}),()=>{D.current?.disconnect(),D.current=null}},[]);const Q=C.useMemo(()=>{if(i)return[{key:"status",estimatedHeight:P5,render:()=>x.jsx("p",{className:`${tc} m-0 text-xs text-[var(--muted)]`,children:i})}];const I=[];for(let K=0;K<o.length;K+=1){const j=o[K];if(j.kind==="tool"){const _=j.key,Y=d[_]??!0,oe=g[_]??!0;I.push({key:`history-tool:${_}`,estimatedHeight:a>0?Eb({viewportWidth:a,commandText:j.commandText,outputText:j.outputText,toolCollapsed:Y,toolOutputCollapsed:oe}):42,render:()=>Mb(_,j,Y,oe,m,y)});continue}const P=j.item,q=q5(P),W=P.role==="assistant"&&P.id===p,H=P.role==="assistant"||P.role==="user",ae=P.role==="assistant"&&P.model?P.modelProvider?`${P.modelProvider}/${P.model}`:P.model:"",E=a>0&&H?$5(P.text,{viewportWidth:a}):G5(P.text);I.push({key:`history-msg:${q}`,estimatedHeight:E,render:()=>x.jsxs("article",{className:`${P.role==="user"?"justify-self-end border-[rgba(50,215,186,0.15)] bg-[rgba(50,215,186,0.08)]":P.role==="assistant"?"justify-self-start border-[var(--line)]":P.role==="tool"?"justify-self-stretch w-full border-[rgba(142,163,179,0.24)] bg-[linear-gradient(180deg,rgba(255,255,255,0.05)_0%,rgba(255,255,255,0.02)_100%)]":"justify-self-start border-[var(--line)] border-dashed opacity-90"} min-w-0 max-w-full w-[min(92%,780px)] border bg-[#0f171d] px-[10px] py-2`,children:[x.jsxs("header",{className:`${tc} mb-1.5 flex items-center justify-between gap-[10px] text-xs text-[var(--muted)] ${P.role==="tool"?"-mx-[10px] -mt-2 mb-2 border-b border-[rgba(142,163,179,0.22)] bg-[rgba(255,255,255,0.03)] px-[10px] py-[7px]":""}`,children:[x.jsx("span",{children:P.role}),x.jsxs("div",{className:"inline-flex items-center gap-2",children:[ae?x.jsx("span",{children:ae}):null,x.jsx("span",{children:P.ts?new Date(P.ts).toLocaleString(void 0,{hour12:!1}):"-"})]})]}),H?x.jsx("div",{className:"min-w-0 max-w-full overflow-hidden",children:x.jsx(vv,{content:P.text})}):x.jsxs("p",{className:P.role==="tool"?"m-0 whitespace-pre-wrap break-words font-[JetBrains_Mono,monospace] text-[12.5px] text-[#c6d2dd]":"m-0 whitespace-pre-wrap break-words text-[13px] leading-[1.45]",children:[P.text,W?x.jsx("span",{className:"ml-0.5 inline-block h-[1em] w-[6px] animate-pulse align-[-0.12em] bg-[var(--live)]","aria-hidden":"true"}):null]})]})})}for(let K=0;K<f.length;K+=1){const j=f[K],P=`live-tool:${j.key}`,q=d[P]??!0,W=g[P]??!0;I.push({key:P,estimatedHeight:a>0?Eb({viewportWidth:a,commandText:j.commandText,outputText:j.outputText,toolCollapsed:q,toolOutputCollapsed:W}):42,render:()=>Mb(P,j,q,W,m,y)})}return c&&I.push({key:"live-thinking",estimatedHeight:U5,render:()=>x.jsxs("article",{className:"justify-self-start min-w-0 max-w-full w-[min(92%,780px)] border border-[var(--line)] bg-[#0f171d] px-[10px] py-2 opacity-92",children:[x.jsxs("header",{className:`${tc} mb-1.5 flex items-center justify-between gap-[10px] text-xs text-[var(--muted)]`,children:[x.jsx("span",{children:"assistant"}),x.jsx("div",{className:"inline-flex items-center gap-2",children:x.jsx("span",{children:N("thinking")})})]}),x.jsxs("p",{className:"m-0 whitespace-pre-wrap break-words text-[13px] leading-[1.45] text-[var(--muted)]",children:[N("thinking"),x.jsx("span",{className:"inline-block w-[0.6ch] animate-pulse text-center",children:"."}),x.jsx("span",{className:"inline-block w-[0.6ch] animate-pulse text-center [animation-delay:0.2s]",children:"."}),x.jsx("span",{className:"inline-block w-[0.6ch] animate-pulse text-center [animation-delay:0.4s]",children:"."})]})]})}),I},[N,i,o,f,c,p,d,g,m,y,a]),{totalHeight:ee,visibleRows:R}=C.useMemo(()=>{const I=M.current,K=r>0?r:H5,j=Math.max(0,s-Ab),P=s+K+Ab;let q=0;const W=new Array(Q.length),H=new Array(Q.length);for(let oe=0;oe<Q.length;oe+=1){const O=Q[oe];W[oe]=q;const B=I.get(O.key)??O.estimatedHeight;H[oe]=B,q+=B+kb}const ae=q>0?q-kb:0;if(Q.length===0)return{totalHeight:0,visibleRows:[]};let E=0;for(;E<Q.length;){const oe=W[E],O=H[E];if(oe+O>=j)break;E+=1}let _=E;for(;_<Q.length&&!(W[_]>P);)_+=1;const Y=[];for(let oe=E;oe<_;oe+=1){const O=Q[oe];Y.push({key:O.key,render:O.render,top:W[oe]})}return{totalHeight:ae,visibleRows:Y}},[Q,U,s,r]),F=C.useMemo(()=>R.map(I=>I.key).join("|"),[R]);return C.useLayoutEffect(()=>{const I=k.current,K=D.current;if(!I||!K)return;K.disconnect(),I.querySelectorAll("[data-virtual-history-row][data-row-key]").forEach(P=>K.observe(P))},[F]),C.useEffect(()=>{v?.({rendered:R.length,total:Q.length})},[v,R.length,Q.length]),Q.length===0?null:x.jsx("div",{ref:k,className:"relative w-full",style:{height:`${Math.max(ee,0)}px`},children:R.map(I=>x.jsx("div",{className:"absolute inset-x-0 grid content-start","data-virtual-history-row":"true","data-row-key":I.key,style:{transform:`translateY(${Math.round(I.top)}px)`},children:I.render()},I.key))})}),qh="font-[JetBrains_Mono,monospace]";function K5({selectedAgentId:e,selectedFileName:i,updatedAtText:a,isEditingFile:r,isSavingFile:s,fileSaveError:o,fileEditDraft:f,onChangeDraft:c,onBeginEdit:p,onCancelEdit:d,onSave:g,canEditCurrentFile:m,canRenderMarkdown:y,filePaneText:v}){const{t:N}=Gt("session");return x.jsxs("div",{className:"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] gap-2",children:[x.jsxs("div",{className:"flex items-center justify-between gap-[10px] bg-transparent px-0 py-[6px] pb-2 text-xs text-[var(--muted)]",children:[x.jsxs("div",{className:`${qh} flex min-w-0 gap-3`,children:[x.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:["agent: ",e||"-"]}),x.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:["file: ",i||"-"]}),x.jsxs("span",{className:"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:["updated: ",a]})]}),x.jsx("div",{className:"flex shrink-0 items-center gap-1.5",children:r?x.jsxs(x.Fragment,{children:[x.jsx("button",{className:`${ni} h-auto w-auto px-[9px] py-1 text-xs`,type:"button",onClick:d,disabled:s,children:N("cancel")}),x.jsx("button",{className:`${ni} h-auto w-auto border-[var(--live)] px-[9px] py-1 text-xs text-[var(--live)] hover:bg-[rgba(50,215,186,0.12)]`,type:"button",onClick:g,disabled:s,children:N(s?"saving":"save")})]}):x.jsx("button",{className:`${ni} h-auto w-auto px-[9px] py-1 text-xs`,type:"button",onClick:p,disabled:!m,children:N("edit")})})]}),o?x.jsx("p",{className:`${qh} m-0 text-xs text-[var(--bad)]`,children:N("saveFailed",{error:o})}):null,x.jsx("div",{className:`${r?"overflow-hidden px-3 pt-0":"overflow-auto px-3 pt-2"} min-h-0`,children:r?x.jsx("textarea",{className:`${qh} block h-full min-h-0 w-full resize-none overflow-auto border border-[var(--line)] bg-[#0f171d] p-[10px] text-[13px] leading-[1.45] text-[var(--text)]`,value:f,onChange:M=>c(M.target.value),spellCheck:!1}):y?x.jsx(vv,{content:v}):x.jsx("pre",{className:"m-0 whitespace-pre-wrap break-words p-0 font-[JetBrains_Mono,monospace] text-[13px] leading-[1.45] text-[var(--text)]",children:v})})]})}const Y5=({selectedAgentId:e,selectedFileName:i,fileContent:a,canEditCurrentFile:r,onSaved:s})=>{const[o,f]=C.useState(!1),[c,p]=C.useState(""),[d,g]=C.useState(""),[m,y]=C.useState(!1);C.useEffect(()=>{f(!1),p(""),g(""),y(!1)},[e,i]);const v=C.useCallback(()=>{r&&(g(""),p(a),f(!0))},[r,a]),N=C.useCallback(()=>{g(""),p(a),f(!1)},[a]),M=C.useCallback(async()=>{if(!(!e||!i)){y(!0),g("");try{const D=await tD({agentId:e,name:i,content:c});s(D.content),f(!1)}catch(D){g(D instanceof Error?D.message:String(D))}finally{y(!1)}}},[e,i,c,s]);return{isEditingFile:o,fileEditDraft:c,setFileEditDraft:p,fileSaveError:d,isSavingFile:m,beginFileEdit:v,cancelFileEdit:N,saveFileEdit:M}},Q5=({open:e,activePanel:i,selectedSessionId:a,historySignature:r,liveTools:s,isThinking:o})=>{const[f,c]=C.useState(!1),[p,d]=C.useState(0),[g,m]=C.useState(0),[y,v]=C.useState(0),N=C.useRef(null),M=C.useRef(null),D=C.useRef(""),k=C.useRef(!0),U=C.useRef(!1),T=C.useRef(!1),Q=C.useRef(0),ee=C.useRef("session"),R=C.useRef(""),F=C.useRef(null),I=C.useRef(null),K=C.useRef(null),j=C.useCallback(()=>{const E=N.current;if(!E){T.current=!0;return}E.scrollTop=E.scrollHeight,Q.current=E.scrollTop,k.current=!0,U.current=!1,c(!1),T.current=!1},[]),P=C.useCallback(()=>{k.current=!0,U.current=!1,D.current="",c(!1)},[]);C.useEffect(()=>()=>{F.current!==null&&cancelAnimationFrame(F.current),I.current!==null&&cancelAnimationFrame(I.current),K.current!==null&&clearTimeout(K.current),M.current?.disconnect(),M.current=null},[]),C.useLayoutEffect(()=>{!e||i!=="session"||j()},[e,i,a,j]),C.useEffect(()=>{if(!e)return;const E=ee.current!=="session"&&i==="session",_=i==="session"&&a&&a!==R.current;if(ee.current=i,a&&(R.current=a),!E&&!_)return;F.current!==null&&cancelAnimationFrame(F.current),I.current!==null&&cancelAnimationFrame(I.current),K.current!==null&&clearTimeout(K.current);const Y=()=>{if(U.current)return;const oe=N.current;if(!oe){T.current=!0;return}oe.scrollTop=oe.scrollHeight,Q.current=oe.scrollTop,k.current=!0,c(!1)};Y(),F.current=requestAnimationFrame(()=>{Y(),I.current=requestAnimationFrame(()=>{Y()})}),K.current=setTimeout(()=>{Y()},90)},[e,i,a]),C.useEffect(()=>{if(i!=="session")return;const E=[r,s.map(_=>`${_.key}:${_.outputText.length}`).join("|"),o?"thinking":""].join("::");E!==D.current&&(D.current=E,k.current&&j())},[r,s,o,i,j]);const q=C.useCallback((E="smooth")=>{const _=N.current;_&&(_.scrollTo({top:_.scrollHeight,behavior:E}),Q.current=_.scrollHeight,k.current=!0,U.current=!1,c(!1))},[]),W=C.useCallback(E=>{if(M.current?.disconnect(),M.current=null,N.current=E,!E){d(0),m(0),v(0);return}if(d(E.clientWidth),m(E.clientHeight),v(E.scrollTop),typeof ResizeObserver<"u"){const _=new ResizeObserver(Y=>{const oe=Y[0];oe&&(d(Math.round(oe.contentRect.width)),m(Math.round(oe.contentRect.height)))});_.observe(E),M.current=_}Q.current=E.scrollTop,T.current&&(E.scrollTop=E.scrollHeight,Q.current=E.scrollTop,k.current=!0,U.current=!1,c(!1),T.current=!1,requestAnimationFrame(()=>{N.current===E&&(E.scrollTop=E.scrollHeight,Q.current=E.scrollTop)}))},[]),H=C.useCallback(()=>{const E=N.current;if(!E)return;const _=Q.current,Y=E.scrollTop;v(Y),m(E.clientHeight);const oe=E.scrollHeight-E.scrollTop-E.clientHeight,O=oe<=4,B=Y<_;if(O){k.current=!0,c(!1),Q.current=Y;return}if(!U.current){Q.current=Y;return}(B||oe>4)&&(k.current=!1,c(!0)),Q.current=Y},[]),ae=C.useCallback(()=>{U.current=!0},[]);return{showScrollToBottom:f,historyViewportWidth:p,historyViewportHeight:g,historyScrollTop:y,setHistoryScrollerNode:W,handleHistoryScroll:H,markHistoryUserInteracted:ae,scrollHistoryToBottom:q,resetHistoryScrollTracking:P}};function J5({open:e,selectedAgentId:i,selectedSessionId:a,sessions:r,sendMode:s,sessionMessage:o,onClose:f,onChangeSelectedSessionId:c,onChangeSendMode:p,onChangeMessage:d,onSendMessage:g}){const{t:m}=Gt("session"),y="cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]",[v,N]=C.useState("session"),[M,D]=C.useState([]),[k,U]=C.useState(!1),[T,Q]=C.useState(""),[ee,R]=C.useState(""),[F,I]=C.useState(""),[K,j]=C.useState(!1),[P,q]=C.useState(""),[W,H]=C.useState([]),[ae,E]=C.useState(!1),[_,Y]=C.useState(""),[oe,O]=C.useState({}),[B,Z]=C.useState({}),[w,he]=C.useState(""),[Ce,Se]=C.useState([]),[ze,Ve]=C.useState(!1),[Ue,Dt]=C.useState({rendered:0,total:0}),Ht=C.useRef(null),Jt=C.useRef(null),Rt=C.useRef(""),de=C.useRef(null),Ke=r.length>0,Ot=e&&!!i.trim(),pe=C.useMemo(()=>W.map(ke=>`${ke.id}:${ke.ts??""}`).join("|"),[W]),{showScrollToBottom:Me,historyViewportWidth:Xe,historyViewportHeight:et,historyScrollTop:Ae,setHistoryScrollerNode:Nt,handleHistoryScroll:_e,markHistoryUserInteracted:Pe,scrollHistoryToBottom:Kt,resetHistoryScrollTracking:le}=Q5({open:e,activePanel:v,selectedSessionId:a,historySignature:pe,liveTools:Ce,isThinking:ze});C.useEffect(()=>{e&&N("session")},[e]),C.useEffect(()=>{if(!e)return;const ke=tt=>{tt.key==="Escape"&&f()};return window.addEventListener("keydown",ke),()=>window.removeEventListener("keydown",ke)},[e,f]),C.useEffect(()=>{if(e)return;const ke=document.activeElement;ke&&Jt.current?.contains(ke)&&ke.blur()},[e]),C.useEffect(()=>{if(!e||v!=="session")return;if(le(),!a){H([]),Y("");return}let ke=!1;const tt=async(Rn=!1)=>{Rn&&E(!0);try{const He=await lD({sessionId:a,limit:200});if(ke)return;Rt.current="",he(""),Se([]),Ve(!1),H(He),Y("")}catch(He){if(ke)return;Y(He instanceof Error?He.message:String(He))}finally{if(ke)return;Rn&&E(!1)}};tt(!0);const Ct=jv(Rn=>{kv(Rn,{gatewayFrame:He=>{if(!He||He.type!=="event")return;const Dn=oD(He,a),ct=cD(He,a);if(ct&&(Ve(!1),Se(Nn=>{const Zt=Nn.findIndex(zt=>zt.key===ct.key),xt=(zt,wn)=>wn?!zt||wn.startsWith(zt)?wn:zt.endsWith(wn)?zt:`${zt}
55
+ ${wn}`:zt;if(Zt<0)return ct.kind==="tool-start"?[...Nn,{key:ct.key,toolName:ct.toolName,commandText:ct.commandText||"-",outputText:"",ts:ct.ts}]:[...Nn,{key:ct.key,toolName:ct.toolName,commandText:"-",outputText:ct.outputText,ts:ct.ts}];const lt=[...Nn],At=lt[Zt];return ct.kind==="tool-start"?(lt[Zt]={...At,toolName:ct.toolName||At.toolName,commandText:ct.commandText||At.commandText,ts:ct.ts??At.ts},lt):(lt[Zt]={...At,toolName:ct.toolName||At.toolName,outputText:xt(At.outputText,ct.outputText),ts:ct.ts??At.ts},lt)})),!Dn)return;if(Dn.kind==="lifecycle-start"){Rt.current=`live-assistant:${a}:${Date.now()}`,he(Rt.current);return}if(Dn.kind==="lifecycle-end"){Rt.current="",he(""),Ve(!1),tt(!1);return}Ve(!1);const cn=new Date().toISOString();H(Nn=>{const Zt=Rt.current||`live-assistant:${a}:${Date.now()}`;Rt.current||(Rt.current=Zt,he(Zt));const xt=Nn.findIndex(wn=>wn.id===Zt);if(xt<0)return[...Nn,{id:Zt,role:"assistant",text:Dn.text,ts:cn}];const lt=Nn[xt],At=uD(lt.text,Dn.text),zt=[...Nn];return zt[xt]={...lt,text:At,ts:cn},zt})}})});return()=>{ke=!0,Ct(),de.current&&(clearTimeout(de.current),de.current=null)}},[e,v,a,le]),C.useEffect(()=>{if(!Ot)return;let ke=!1;return U(!0),Q(""),WT(i).then(tt=>{ke||D(tt)}).catch(tt=>{ke||(Q(tt instanceof Error?tt.message:String(tt)),D([]))}).finally(()=>{ke||U(!1)}),()=>{ke=!0}},[Ot,i]),C.useEffect(()=>{if(M.length===0){R("");return}M.some(tt=>tt.name===ee)||R(M[0].name)},[M,ee]),C.useEffect(()=>{if(!Ot||!ee){I(""),q("");return}let ke=!1;return j(!0),q(""),eD(i,ee).then(tt=>{ke||I(tt.content??"")}).catch(tt=>{ke||(I(""),q(tt instanceof Error?tt.message:String(tt)))}).finally(()=>{ke||j(!1)}),()=>{ke=!0}},[Ot,i,ee]);const xe=C.useMemo(()=>i?k?m("coreFilesLoading"):T?m("coreFilesLoadFailed",{error:T}):M.length===0?m("noCoreFiles"):ee?K?m("fileContentLoading"):P?m("fileLoadFailed",{error:P}):F||m("fileEmpty"):m("selectFile"):m("noAgentSelected"),[m,i,k,T,M.length,ee,K,P,F]),z=v==="files"&&!!i&&!!ee&&!K&&!P,me=C.useCallback(ke=>{I(ke),D(tt=>tt.map(Ct=>Ct.name===ee?{...Ct,size:ke.length,updatedAt:new Date().toISOString()}:Ct))},[ee]),{isEditingFile:we,fileEditDraft:qe,setFileEditDraft:je,fileSaveError:Re,isSavingFile:Fe,beginFileEdit:pt,cancelFileEdit:at,saveFileEdit:Lt}=Y5({selectedAgentId:i,selectedFileName:ee,fileContent:F,canEditCurrentFile:z,onSaved:me}),hn=!!i&&!k&&!T&&M.length>0&&!!ee&&!we&&!K&&!P,Sn=C.useMemo(()=>a?ae?m("sessionLoading"):_?m("sessionLoadFailed",{error:_}):W.length===0?m("noMessages"):"":m("selectSession"),[m,a,ae,_,W.length]),Xt=C.useMemo(()=>sD(W),[W]),be=M.find(ke=>ke.name===ee)??null,ki=be?.updatedAt?new Date(be.updatedAt).toLocaleString(void 0,{hour12:!1}):"-",nn=C.useCallback(ke=>{O(tt=>({...tt,[ke]:!(tt[ke]??!0)}))},[]),Vn=C.useCallback(ke=>{Z(tt=>({...tt,[ke]:!(tt[ke]??!0)}))},[]),ai=C.useCallback(ke=>{Dt(ke)},[]),nr=ke=>{ke.preventDefault();const tt=o.trim();!a||!tt||(H(Ct=>[...Ct,{id:`local-user:${a}:${Date.now()}`,role:"user",text:tt,ts:new Date().toISOString()}]),Ve(!0),de.current&&(clearTimeout(de.current),de.current=null),de.current=setTimeout(()=>{Ve(!1),de.current=null},3e4),g(ke))},Ai=C.useCallback(ke=>{ke.key==="Enter"&&(ke.shiftKey||ke.nativeEvent.isComposing||(ke.preventDefault(),Ht.current?.requestSubmit()))},[]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:`${ao} ${e?ro:Zu}`,onClick:f,"aria-hidden":!e}),x.jsx("aside",{ref:Jt,className:`${lo} ${e?so:Wu}`,"aria-hidden":!e,onClick:f,children:x.jsxs("div",{className:`${Ec} grid h-[min(88vh,calc(100vh-24px))] max-h-[88vh] w-[min(1320px,98vw)] grid-rows-[auto_minmax(0,1fr)] overflow-hidden p-0 max-[760px]:h-screen max-[760px]:max-h-screen max-[760px]:w-screen`,onClick:ke=>ke.stopPropagation(),children:[x.jsxs("div",{className:`${Ci} px-3 pt-3`,children:[x.jsx("h2",{children:m("sessionTools")}),x.jsx("button",{className:ni,type:"button",onClick:f,"aria-label":m("closeSessionModal"),title:m("cancel"),children:x.jsx(Ii,{})})]}),x.jsxs("div",{className:"m-0 grid h-full min-h-0 grid-cols-[220px_minmax(0,1fr)] border-t border-[var(--line)] overflow-hidden bg-[rgba(15,23,29,0.45)] max-[760px]:grid-cols-1",children:[x.jsxs("nav",{className:"grid min-h-0 content-start gap-2 overflow-hidden border-r border-[var(--line)] bg-transparent p-[10px] max-[760px]:max-h-[42vh] max-[760px]:border-r-0 max-[760px]:border-b",children:[x.jsx("button",{type:"button",className:`w-full border px-2 py-[7px] text-left transition-[border-color,background-color,color] ${v==="session"?"border-[var(--live)] bg-[rgba(50,215,186,0.08)] text-[var(--live)]":"border-[var(--line)] bg-transparent text-[var(--text)] hover:border-[#2a3c4b] hover:bg-[rgba(142,163,179,0.08)]"}`,onClick:()=>N("session"),children:m("session")}),x.jsx("div",{className:"mt-1 px-0.5 py-1 text-xs text-[var(--muted)]",children:m("coreFiles")}),x.jsxs("div",{className:"mt-0.5 grid gap-1.5 pt-2",children:[k?x.jsx("p",{children:m("loading")}):null,!k&&M.length===0?x.jsx("p",{children:m("noFiles")}):null,M.map(ke=>x.jsx("button",{type:"button",className:`break-all border px-2 py-1.5 text-left font-[JetBrains_Mono,monospace] text-xs transition-[border-color,background-color,color] ${v==="files"&&ee===ke.name?"active":""} ${v==="files"&&ee===ke.name?"border-[var(--live)] bg-[#0f171d] text-[var(--live)]":"border-[var(--line)] bg-[#0f171d] text-[var(--text)] hover:border-[#2a3c4b] hover:bg-[rgba(142,163,179,0.08)]"}`,onClick:()=>{R(ke.name),N("files")},children:ke.name},ke.name))]})]}),x.jsx("div",{className:"h-full min-h-0 overflow-hidden bg-transparent px-0 pt-[10px] pb-3",children:v==="session"?x.jsxs("form",{ref:Ht,onSubmit:nr,className:"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)_auto]",children:[x.jsx("div",{className:"px-3 pb-2",children:x.jsxs("div",{className:"grid gap-[10px] grid-cols-[minmax(0,1fr)_minmax(220px,34%)] max-[760px]:grid-cols-1",children:[x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("label",{className:"block text-xs text-[var(--muted)]",children:m("sessionId")}),x.jsx(qn,{value:a,options:Ke?r.map(ke=>({value:ke.id,label:ke.id})):[{value:"",label:m("noSessions")}],onChange:c,triggerClassName:gn,disabled:!Ke,ariaLabel:m("sessionId")})]}),x.jsxs("div",{className:"grid gap-1.5",children:[x.jsx("label",{className:"block text-xs text-[var(--muted)]",children:m("sendMode")}),x.jsx(qn,{value:s,options:[{value:"auto",label:m("auto")},{value:"chat",label:m("chatOnly")},{value:"sessions",label:m("sessionsOnly")}],onChange:ke=>p(ke),triggerClassName:gn,ariaLabel:m("sendMode")})]})]})}),x.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[null,x.jsx("div",{className:"block h-full min-h-0 overflow-auto overflow-x-hidden px-3 pr-1 pb-8",ref:Nt,onScroll:_e,onWheel:Pe,onTouchStart:Pe,onPointerDown:Pe,children:x.jsx(V5,{historyStatusText:Sn,historyViewportWidth:Xe,historyViewportHeight:et,historyScrollTop:Ae,mergedHistory:Xt,liveTools:Ce,isThinking:ze,liveAssistantId:w,collapsedToolMap:oe,collapsedToolOutputMap:B,onToggleToolCollapsed:nn,onToggleToolOutputCollapsed:Vn,onVirtualStatsChange:ai})}),!Sn&&Me?x.jsx("button",{className:"absolute bottom-3 left-1/2 z-[2] -translate-x-1/2 cursor-pointer border border-[var(--line)] bg-[rgba(15,23,29,0.92)] px-[10px] py-1 text-xs text-[var(--text)] hover:border-[var(--live)] hover:text-[var(--live)]",type:"button",onClick:()=>Kt("smooth"),children:m("scrollToBottom")}):null]}),x.jsx("div",{className:"min-w-0 px-3 pt-2",children:x.jsxs("div",{className:"relative w-full min-w-0 overflow-hidden",children:[x.jsx("textarea",{value:o,onChange:ke=>d(ke.target.value),onKeyDown:Ai,rows:3,placeholder:m(Ke?"inputPlaceholder":"inputPlaceholderNoSession"),className:`${oc} block min-h-[86px] max-h-[220px] resize-none pb-8 pr-11`}),x.jsxs("button",{className:`${y} absolute right-[10px] bottom-[10px] m-0 inline-flex h-7 w-7 min-w-7 items-center justify-center p-0`,type:"submit",disabled:!Ke||!a,children:[x.jsx("span",{className:"absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [-webkit-clip-path:inset(50%)] [clip:rect(0,0,0,0)]",children:m("sendMessage")}),x.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",focusable:"false",children:x.jsx("path",{d:"M4 12h12m0 0-4-4m4 4-4 4M4 5v6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})})]}):x.jsx(K5,{selectedAgentId:i,selectedFileName:ee,updatedAtText:ki,isEditingFile:we,isSavingFile:Fe,fileSaveError:Re,fileEditDraft:qe,onChangeDraft:je,onBeginEdit:pt,onCancelEdit:at,onSave:()=>{Lt()},canEditCurrentFile:z,canRenderMarkdown:hn,filePaneText:xe})})]})]})})]})}async function jb(e){const i={runId:e.runId};return typeof e.offset=="number"&&(i.offset=e.offset),typeof e.limit=="number"&&(i.limit=e.limit),e.levels&&e.levels.length>0&&(i.levels=e.levels),e.keyword?.trim()&&(i.keyword=e.keyword.trim()),e.order&&(i.order=e.order),ht("log.timeline",i)}async function X5(){const e=await ht("log.runs.list");return Array.isArray(e.items)?e.items:[]}const Z5=e=>`${Av}/api/logs/runs/${encodeURIComponent(e)}/timeline/raw`,W5=(e,i)=>{const[a,r]=C.useState([]),[s,o]=C.useState(0),[f,c]=C.useState(0),[p,d]=C.useState(!1),[g,m]=C.useState(""),[y,v]=C.useState(""),[N,M]=C.useState(""),[D,k]=C.useState("desc"),[U,T]=C.useState([]),[Q,ee]=C.useState(""),[R,F]=C.useState(null),[I,K]=C.useState(!1),j=E=>{r([]),o(0),c(0),F(null),K(!1),ee(""),E?.keepError||m("")};C.useEffect(()=>{if(!i.trim()){j(),d(!1);return}let E=!1;return j(),d(!0),jb({runId:i,keyword:N,levels:U,order:D}).then(_=>{E||(r(_.items),o(_.total),c(_.parseErrorCount),F(_.nextOffset),ee(_.items[0]?.id??""))}).catch(_=>{E||(m(_ instanceof Error?_.message:String(_)),j({keepError:!0}))}).finally(()=>{E||d(!1)}),()=>{E=!0,j(),d(!1)}},[e,i,N,D,U]),C.useEffect(()=>{v(N)},[e,N]);const P=C.useMemo(()=>a.find(E=>E.id===Q)??a[0]??null,[a,Q]),q=()=>{M(y.trim())},W=async()=>{if(!(R===null||I)){K(!0);try{const E=await jb({runId:i,keyword:N,levels:U,order:D,offset:R});r(_=>[..._,...E.items]),o(E.total),c(E.parseErrorCount),F(E.nextOffset)}catch(E){m(E instanceof Error?E.message:String(E))}finally{K(!1)}}};return{items:a,total:s,parseErrorCount:f,loading:p,error:g,keywordDraft:y,setKeywordDraft:v,keyword:N,order:D,setOrder:k,selectedLevels:U,selectedItem:P,setSelectedId:ee,applyFilters:q,toggleLevel:(E,_)=>{T(Y=>_?[...new Set([...Y,E])]:Y.filter(oe=>oe!==E))},resetFilters:()=>{v(""),M(""),T([]),k("desc")},rawUrl:Z5(i),hasMore:R!==null,loadingMore:I,loadMore:W}},e4='13px "JetBrains Mono", monospace',Yp=19,t4=54,n4=96,i4=72,a4=420,Tb=new Map,Db=new Map,r4=e=>e.replace(/\t/g," ").trim()||"-",zv=(e,i)=>{const a=pc(r4(e),e4,{whiteSpace:"pre-wrap"});return Math.max(1,mc(a,Math.max(120,i),Yp).lineCount)},l4=(e,i)=>{const a=`${i}::${e}`,r=Tb.get(a);if(r!==void 0)return r;const s=Math.max(i4,t4+zv(e,i)*Yp);return Tb.set(a,s),s},Iv=e=>{if(e===void 0)return Be.t("log:noDetail");if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},s4=(e,i)=>{const a=Iv(e),r=`${i}::${a}`,s=Db.get(r);if(s!==void 0)return s;const o=Math.min(a4,n4+zv(a,i)*Yp);return Db.set(r,o),o},Ob={info:"levelInfo",warn:"levelWarn",error:"levelError"},_b=10,Fb=480,o4=640,u4="flex flex-wrap gap-2",Bb="inline-flex cursor-pointer items-center gap-1.5 rounded-none px-2 py-[2px] text-xs uppercase",Rb={info:"bg-[rgba(142,163,179,0.2)] text-[#a5b9c8]",warn:"bg-[rgba(255,184,77,0.16)] text-[var(--warn)]",error:"bg-[rgba(255,107,107,0.16)] text-[var(--bad)]"},c4="grid w-full gap-2 border border-[var(--line)] bg-[linear-gradient(180deg,rgba(15,23,29,0.92)_0%,rgba(11,17,22,0.92)_100%)] px-3 py-2.5 text-left text-[var(--text)]",Lb="m-0 flex items-center justify-between border-b border-[var(--line)] bg-[rgba(15,23,29,0.9)] p-3",f4="cursor-pointer border px-[10px] text-(--muted) py-[10px] text-left border-transparent bg-transparent hover:border-[var(--line)] hover:bg-[#15212a]",ma="font-[JetBrains_Mono,monospace]",zb="mt-0 cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]";function d4({currentRunId:e}){const{t:i}=Gt("log"),[a,r]=C.useState([]),[s,o]=C.useState(e),[f,c]=C.useState(520),[p,d]=C.useState(420),[g,m]=C.useState(0),[y,v]=C.useState(0),N=C.useRef(new Map),M=C.useRef(null),D=C.useRef(null),[k,U]=C.useState(0),T=W5(!0,s);C.useEffect(()=>{o(j=>j||e)},[e]),C.useEffect(()=>{let j=!0;return X5().then(P=>{j&&(r(P),!s&&P.length>0&&o(P[0]))}).catch(()=>{}),()=>{j=!1}},[s]);const Q=Iv(T.selectedItem?.detail),ee=s4(T.selectedItem?.detail,p);C.useEffect(()=>{if(!(typeof ResizeObserver>"u"))return M.current=new ResizeObserver(j=>{let P=!1;const q=N.current;for(let W=0;W<j.length;W+=1){const H=j[W],ae=H.target.dataset.rowKey;if(!ae)continue;const E=Math.max(1,Math.ceil(H.contentRect.height));q.get(ae)!==E&&(q.set(ae,E),P=!0)}P&&U(W=>W+1)}),()=>{M.current?.disconnect(),M.current=null}},[]);const R=C.useMemo(()=>T.items.map(P=>({key:P.id,estimatedHeight:l4(P.text,f),render:()=>x.jsxs("button",{type:"button",className:`${c4} ${T.selectedItem?.id===P.id?"border-(--live) shadow-[inset_0_0_0_1px_rgba(138,180,255,0.18)]":""}`,onClick:()=>T.setSelectedId(P.id),children:[x.jsxs("div",{className:`${ma} flex items-center justify-between gap-3 text-xs text-(--muted)`,children:[x.jsx("span",{children:new Date(P.ts).toLocaleString(void 0,{hour12:!1})}),x.jsx("span",{className:`${Bb} ${Rb[P.level]}`,children:i(Ob[P.level])})]}),x.jsx("p",{className:"m-0 wrap-break-word whitespace-pre-wrap font-[JetBrains_Mono,monospace] text-[13px] leading-normal",children:P.text})]})})),[T.items,T.selectedItem?.id,T.setSelectedId,f]),{totalHeight:F,visibleRows:I}=C.useMemo(()=>{const j=N.current,P=y>0?y:o4,q=Math.max(0,g-Fb),W=g+P+Fb;let H=0;const ae=new Array(R.length),E=new Array(R.length);for(let B=0;B<R.length;B+=1){const Z=R[B];ae[B]=H;const w=j.get(Z.key)??Z.estimatedHeight;E[B]=w,H+=w+_b}const _=H>0?H-_b:0;let Y=0;for(;Y<R.length;){const B=ae[Y],Z=E[Y];if(B+Z>=q)break;Y+=1}let oe=Y;for(;oe<R.length&&!(ae[oe]>W);)oe+=1;const O=[];for(let B=Y;B<oe;B+=1){const Z=R[B];O.push({key:Z.key,top:ae[B],render:Z.render})}return{totalHeight:_,visibleRows:O}},[R,k,g,y]),K=C.useMemo(()=>I.map(j=>j.key).join("|"),[I]);return C.useLayoutEffect(()=>{const j=D.current,P=M.current;if(!j||!P)return;P.disconnect(),j.querySelectorAll("[data-virtual-run-log-row][data-row-key]").forEach(W=>P.observe(W))},[K]),x.jsxs("section",{"data-center-card":!0,"data-run-log-page":!0,className:"grid h-full min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-3 overflow-hidden",children:[x.jsxs("div",{className:Ci,children:[x.jsx("div",{children:x.jsx("h2",{children:i("logCenter")})}),x.jsx("a",{className:zb,href:T.rawUrl,target:"_blank",rel:"noreferrer",children:i("rawNdjson")})]}),x.jsxs("div",{className:"grid h-full min-h-0 gap-3 min-[1181px]:grid-cols-[minmax(220px,260px)_minmax(420px,1.15fr)_minmax(360px,0.95fr)] max-[1180px]:grid-cols-1",children:[x.jsx("aside",{className:"h-full min-h-0 overflow-hidden",children:x.jsxs("section",{className:"grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden border border-(--line) bg-[rgba(15,23,29,0.72)]",children:[x.jsxs("div",{className:Lb,children:[x.jsx("h2",{children:i("runList")}),x.jsx("span",{className:ma,children:a.length})]}),x.jsx("div",{className:"grid min-h-0 gap-2 overflow-auto p-2.5",children:(a.length>0?a:[e]).map(j=>x.jsx("button",{type:"button",className:`${f4} ${s===j?"border-(--live) bg-[rgba(50,215,186,0.12)] text-(--text) shadow-[inset_3px_0_0_0_var(--live)]":""}`,onClick:()=>o(j),children:j},j))})]})}),x.jsxs("section",{className:"grid h-full min-h-0 grid-rows-[auto_auto_minmax(0,1fr)] overflow-hidden border border-(--line) bg-[rgba(15,23,29,0.72)]",ref:j=>{j&&c(Math.max(260,j.clientWidth-34))},children:[x.jsxs("div",{className:Lb,children:[x.jsx("h2",{children:i("logList")}),x.jsx("span",{className:ma,children:T.total})]}),x.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 border-b border-(--line) bg-[rgba(15,23,29,0.82)] p-3",children:[x.jsx("input",{className:`${gn} min-w-0 flex-[1_1_240px]`,value:T.keywordDraft,onChange:j=>T.setKeywordDraft(j.target.value),onKeyDown:j=>{j.key==="Enter"&&T.applyFilters()},placeholder:i("keywordSearch")}),x.jsx("div",{className:u4,children:["info","warn","error"].map(j=>x.jsxs("label",{className:`${Bb} ${Rb[j]}`,children:[x.jsx("input",{type:"checkbox",checked:T.selectedLevels.includes(j),onChange:P=>T.toggleLevel(j,P.target.checked)}),x.jsx("span",{children:i(Ob[j])})]},j))}),x.jsx("button",{className:zb,type:"button",onClick:()=>T.setOrder(T.order==="desc"?"asc":"desc"),children:T.order==="desc"?i("sortNewestFirst"):i("sortOldestFirst")})]}),x.jsxs("div",{className:"relative min-h-0 overflow-auto p-3",onScroll:j=>m(j.currentTarget.scrollTop),ref:j=>{j&&(v(j.clientHeight),m(j.scrollTop),c(Math.max(260,j.clientWidth-34)))},children:[T.error?x.jsx("div",{className:`${ma} grid min-h-45 place-items-center p-6 text-center text-xs text-(--muted)`,children:i("loadFailed",{error:T.error})}):null,!T.error&&T.items.length===0&&!T.loading?x.jsx("div",{className:`${ma} grid min-h-45 place-items-center p-6 text-center text-xs text-(--muted)`,children:i("noMatch")}):null,!T.error&&T.items.length>0?x.jsx("div",{ref:D,className:"relative w-full",style:{height:`${Math.max(F,0)}px`},children:I.map(j=>x.jsx("div",{className:"absolute inset-x-0 grid content-start","data-virtual-run-log-row":"true","data-row-key":j.key,style:{transform:`translateY(${Math.round(j.top)}px)`},children:j.render()},j.key))}):null,T.error||T.items.length===0&&!T.loading?null:x.jsxs("div",{className:"sticky right-0 bottom-0 mt-2 flex items-center justify-end gap-2",children:[T.hasMore?x.jsx("button",{type:"button",disabled:T.loadingMore,onClick:()=>{T.loadMore()},className:`${ma} cursor-pointer border border-[var(--live-25)] bg-[rgba(7,12,16,0.84)] px-2 py-0.75 text-xs leading-[1.2] text-[var(--live)] hover:bg-[rgba(50,215,186,0.12)] disabled:opacity-50 disabled:cursor-wait`,children:T.loadingMore?i("loadingMore"):i("loadMore")}):null,x.jsx("div",{className:`${ma} w-fit border border-[rgba(142,163,179,0.28)] bg-[rgba(7,12,16,0.84)] px-1.5 py-0.75 text-xs leading-[1.2] text-[#9ab1c2]`,children:i("renderedStatus",{rendered:I.length,loaded:R.length,total:T.total})})]})]})]}),x.jsx("aside",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] border border-(--line) bg-[rgba(15,23,29,0.72)]",ref:j=>{j&&d(Math.max(220,j.clientWidth-30))},children:T.selectedItem?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"border-b border-(--line) p-3",children:x.jsxs("div",{className:"grid gap-2",children:[x.jsx("strong",{className:"text-sm leading-normal",children:T.selectedItem.text}),x.jsxs("div",{className:`${ma} flex flex-wrap gap-2.5 text-xs text-(--muted)`,children:[x.jsx("span",{children:T.selectedItem.ts}),x.jsx("span",{children:T.selectedItem.level}),x.jsx("span",{children:T.selectedItem.runId})]})]})}),x.jsx("div",{className:"min-h-0 overflow-auto",style:{minHeight:`${ee}px`},children:x.jsx("pre",{className:"m-0 p-3 font-[JetBrains_Mono,monospace] text-[13px] leading-normal wrap-break-word whitespace-pre-wrap text-(--text)",children:Q})})]}):x.jsx("div",{className:`${ma} grid min-h-45 place-items-center p-6 text-center text-xs text-(--muted)`,children:i("selectToViewDetailCenter")})})]})]})}function h4({navCollapsed:e,onToggleNav:i,routeText:a}){const{t:r}=Gt("nav"),s=(o,f)=>x.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:[x.jsx("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),x.jsx("rect",{x:"2.5",y:"2.5",width:"4.5",height:"11",rx:"1",fill:f?"none":"currentColor",stroke:"currentColor",strokeWidth:"1"})]});return x.jsx("header",{className:"flex items-center justify-start gap-2.5 border-b border-r border-(--line) px-3 py-2 h-[60px]",children:x.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[x.jsx("div",{className:"inline-flex items-center gap-1.5",children:x.jsx("button",{className:`mt-0 inline-flex min-h-[32px] min-w-[32px] items-center justify-center border border-(--line) bg-[rgba(15,23,29,0.55)] p-2 text-(--muted) transition-[background-color,color] hover:bg-[#15212a] hover:text-(--text) focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--live)] focus-visible:outline-offset-[-2px] ${e?"bg-[rgba(15,23,29,0.8)] text-(--text)":""}`,type:"button",onClick:i,"aria-label":r(e?"expandNav":"collapseNav"),title:r(e?"expandNav":"collapseNav"),children:s("left",e)})}),x.jsxs("div",{className:"min-w-0 text-sm text-(--muted)",children:[x.jsx("span",{children:r("home")}),x.jsx("span",{className:"inline-flex px-1.5 align-middle text-(--muted)",children:x.jsx(Ev,{className:"h-3.5 w-3.5"})}),x.jsx("span",{className:"text-(--text)",children:a})]})]})})}const p4=e=>{try{return JSON.parse(e)}catch{return null}},m4=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),gc=e=>{const i=String(e??"").trim();if(!i)return null;if(i.includes("contract_violation:")||i.includes("openclaw_send_failed:")||i.includes("request_id_mismatch")||i.includes("result_envelope_missing"))return{kind:"structured",label:Be.t("overview:structured"),code:"structured_contract_or_transport",message:i.replace(/^Error:\s*/i,""),raw:i};const a=p4(i);if(m4(a)){const r=typeof a.code=="string"?a.code.trim():"",s=typeof a.message=="string"?a.message.trim():"";if(r||s)return{kind:"node_return",label:Be.t("overview:nodeReturn"),code:r||"node_error",message:s||r||i,raw:i}}return{kind:"unknown",label:Be.t("common:common.error"),code:"unknown_error",message:i.replace(/^Error:\s*/i,""),raw:i}},g4=e=>{if(e.status!=="failed")return!1;const i=gc(e.lastError);return i?i.kind==="structured"||i.kind==="unknown":!1},x4=e=>e.status!=="failed"?!1:gc(e.lastError)?.kind==="node_return",Ri="font-[JetBrains_Mono,monospace]",b4="grid min-h-[220px] grid-rows-[auto_auto_1fr_auto] gap-3 border border-[#29414f] bg-[linear-gradient(180deg,rgba(18,31,38,0.92)_0%,rgba(14,24,30,0.92)_100%)] p-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.03),0_12px_28px_rgba(2,6,10,0.14)]",y4=e=>e.some(i=>i.status==="running")?"running":e.some(i=>i.status==="failed")?"failed":e.some(i=>i.status==="stopped")?"stopped":e.some(i=>i.status==="blocked")?"blocked":e.some(i=>i.status==="waiting")?"waiting":e.some(i=>i.status==="success")?"success":"idle",v4=e=>e==="running"?"bg-[rgba(50,215,186,0.15)] text-(--live)":e==="failed"?"bg-[rgba(255,107,107,0.16)] text-(--bad)":e==="blocked"||e==="waiting"?"bg-[rgba(255,184,77,0.16)] text-(--warn)":e==="success"?"bg-[rgba(50,215,186,0.15)] text-(--live)":"bg-[rgba(142,163,179,0.2)] text-(--muted)",S4=(e,i)=>i(`common:status.${e}`),N4=e=>e.find(i=>i.status==="running")??null,w4=e=>{const i=e.flatMap(a=>a.artifacts??[]);return i.length===0?null:[...i].sort((a,r)=>{const s=Date.parse(a.createdAt||"")||0;return(Date.parse(r.createdAt||"")||0)-s})[0]??null},Ib=e=>{if(!e)return"-";const i=new Date(e);if(Number.isNaN(i.getTime()))return"-";const a=i.getFullYear(),r=String(i.getMonth()+1).padStart(2,"0"),s=String(i.getDate()).padStart(2,"0"),o=String(i.getHours()).padStart(2,"0"),f=String(i.getMinutes()).padStart(2,"0");return`${a}-${r}-${s} ${o}:${f}`};function C4({pipelines:e,onStartPipeline:i,onNavigatePipeline:a,onOpenAgentSession:r}){const[s,o]=Xb.useState(""),{t:f}=Gt("overview");return x.jsxs("section",{"data-center-card":!0,className:"min-h-0 min-w-0",children:[x.jsx("div",{className:"px-3 pt-3",children:x.jsxs("div",{className:"border border-(--line) bg-[rgba(13,22,28,0.82)] px-3 py-2",children:[x.jsx("p",{className:"m-0 text-sm font-semibold text-(--text)",children:f("title")}),x.jsx("p",{className:"m-0 mt-1 text-xs text-(--muted)",children:f("subtitle")})]})}),x.jsx("div",{className:"p-3",children:x.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(310px,1fr))] gap-3",children:e.map(c=>{const p=y4(c.nodes),d=N4(c.nodes),g=c.nodes.find(I=>I.status==="failed")??null,m=c.nodes.find(I=>g4(I))??null,y=c.nodes.find(I=>x4(I))??null,v=y??m??g,N=v?.executor.agentId?.trim()??"",M=w4(c.nodes),D=c.nodes.filter(I=>I.status==="success").length,k=c.nodes.filter(I=>I.status==="failed").length,U=c.nodes.filter(I=>I.status==="blocked").length,T=c.nodes.filter(I=>["success","failed","skipped","stopped"].includes(I.status)).length,Q=c.nodes.length,ee=d?.startedAt??M?.createdAt??c.nodes.find(I=>I.finishedAt)?.finishedAt??null,F=s===c.id||c.isRunning===!0;return x.jsxs("article",{className:b4,children:[x.jsxs("div",{className:"flex items-start justify-between gap-2",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:"m-0 truncate text-base font-semibold text-(--text)",children:c.title}),x.jsxs("p",{className:`${Ri} m-0 mt-1 text-xs text-(--muted)`,children:["DAG-",c.id]})]}),x.jsx("span",{className:`inline-flex h-5 items-center px-2 text-xs ${v4(p)}`,children:S4(p,f)})]}),x.jsxs("div",{className:"border border-(--line) bg-[rgba(10,18,24,0.7)] px-2.5 py-2",children:[x.jsx("p",{className:"m-0 text-xs text-(--muted)",children:f("currentRunningNode")}),x.jsx("p",{className:`${Ri} m-0 mt-1 truncate text-sm text-(--text)`,children:d?`${d.id} · ${d.title}`:f("noRunningNode")})]}),x.jsxs("div",{className:"grid content-start gap-1",children:[x.jsx("p",{className:"m-0 text-xs text-(--muted)",children:f("latestArtifact")}),x.jsx("p",{className:`${Ri} m-0 truncate text-sm text-(--text)`,children:M?.name??f("noArtifact")}),x.jsx("p",{className:`${Ri} m-0 text-xs text-(--muted)`,children:M?f("generateTime",{time:Ib(M.createdAt)}):"-"})]}),x.jsxs("div",{className:"grid grid-cols-3 gap-2 border border-(--line) bg-[rgba(10,18,24,0.55)] px-2.5 py-2",children:[x.jsxs("div",{children:[x.jsx("p",{className:"m-0 text-[10px] text-(--muted)",children:f("successCount")}),x.jsx("p",{className:`${Ri} m-0 mt-0.5 text-sm text-(--live)`,children:D})]}),x.jsxs("div",{children:[x.jsx("p",{className:"m-0 text-[10px] text-(--muted)",children:f("failedCount")}),x.jsx("p",{className:`${Ri} m-0 mt-0.5 text-sm text-(--bad)`,children:k})]}),x.jsxs("div",{children:[x.jsx("p",{className:"m-0 text-[10px] text-(--muted)",children:f("blockedCount")}),x.jsx("p",{className:`${Ri} m-0 mt-0.5 text-sm text-(--warn)`,children:U})]})]}),x.jsxs("div",{className:"grid gap-1.5 border border-[rgba(255,107,107,0.35)] bg-[linear-gradient(180deg,rgba(58,22,22,0.45)_0%,rgba(25,13,13,0.38)_100%)] px-2.5 py-2",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsx("p",{className:"m-0 text-xs text-(--muted)",children:f("abnormalNodes")}),x.jsx("button",{className:"inline-flex h-6 items-center justify-center border border-[rgba(255,107,107,0.45)] bg-[rgba(255,107,107,0.08)] px-2 text-xs font-semibold text-(--bad) hover:bg-[rgba(255,107,107,0.16)] disabled:cursor-not-allowed disabled:opacity-50",type:"button",disabled:!N,onClick:()=>{N&&r(N)},children:f("openSession")})]}),x.jsx("p",{className:`${Ri} m-0 truncate text-xs text-(--text)`,children:v?`${v.id} · ${v.title}`:f("noFailedNode")}),x.jsxs("p",{className:`${Ri} m-0 truncate text-xs text-(--muted)`,children:[m?`${f("structured")}: ${m.id} · ${gc(m.lastError)?.message??"-"}`:`${f("structured")}: -`," ","|"," ",y?`${f("nodeReturn")}: ${y.id} · ${gc(y.lastError)?.message??"-"}`:`${f("nodeReturn")}: -`]}),x.jsx("p",{className:`${Ri} m-0 truncate text-xs text-(--muted)`,children:N?`Agent: ${N}`:"Agent: -"})]}),x.jsxs("div",{className:"flex items-center justify-between border-t border-(--line) pt-2 text-xs text-(--muted)",children:[x.jsx("span",{children:f("progress",{finished:T,total:Q})}),x.jsx("span",{children:f("updateTime",{time:Ib(ee)})})]}),x.jsxs("div",{className:"flex justify-end gap-2",children:[x.jsx("button",{className:"inline-flex h-8 items-center justify-center border border-(--line) bg-[rgba(15,23,29,0.6)] px-3 text-xs text-(--text) hover:bg-[rgba(19,34,43,0.82)]",type:"button",onClick:()=>a(c.id),children:f("enterPipeline")}),x.jsx("button",{className:"inline-flex h-8 items-center justify-center border border-(--live-25) bg-[rgba(50,215,186,0.1)] px-3 text-xs font-semibold text-(--live) hover:bg-[rgba(50,215,186,0.18)] disabled:cursor-not-allowed disabled:opacity-60",type:"button",onClick:async()=>{o(c.id);try{await i(c.id)}finally{o(I=>I===c.id?"":I)}},disabled:F,children:f(F?"working":"startWork")})]})]},c.id)})})})]})}const E4="font-[JetBrains_Mono,monospace]",k4="inline-flex h-7 items-center justify-center border px-2 text-xs transition-[background-color,color,border-color]",A4="border-[var(--live-25)] bg-[rgba(50,215,186,0.16)] text-[var(--live)]",M4="border-[var(--line)] bg-[rgba(15,23,29,0.55)] text-[var(--muted)] hover:bg-[rgba(24,39,47,0.72)] hover:text-[var(--text)]",Zs=`${Mn} h-8 px-2 py-1 text-xs`,Xu="inline-flex h-8 items-center justify-center border border-[var(--line)] bg-[rgba(15,23,29,0.62)] px-3 text-xs text-[var(--text)] hover:bg-[rgba(19,34,43,0.82)] disabled:cursor-not-allowed disabled:opacity-50",j4="relative min-w-0",T4=`${gn} h-8 cursor-pointer overflow-hidden px-2 py-1 text-ellipsis whitespace-nowrap text-xs`,D4="border-[#3b5868] bg-[rgba(24,39,47,0.92)]",O4="absolute inset-x-0 top-[calc(100%+4px)] z-[4] grid max-h-[180px] overflow-y-auto overflow-x-hidden border border-[#29414f] bg-[rgba(18,31,38,0.98)] px-0 py-0 text-[var(--text)] shadow-none",$b="grid min-w-0 cursor-pointer grid-cols-[10px_minmax(0,1fr)] items-center gap-x-3 px-2 py-1.5 text-xs leading-[1.2] text-[var(--text)] transition-[background-color,color] hover:bg-[rgba(22,36,44,0.9)]",Hb="bg-[rgba(50,215,186,0.12)]",Ub="m-0 h-[10px] w-[10px] cursor-pointer appearance-none border border-[var(--line)] bg-transparent transition-[border-color,background-color] hover:border-[#2a3c4b] checked:border-[var(--live)] checked:bg-[var(--live)] focus-visible:outline focus-visible:outline-1 focus-visible:outline-[var(--live)] focus-visible:outline-offset-1",_4="mx-2 my-1.5 text-xs text-[var(--muted)]";function F4({filters:e,pipelineOptions:i,nodeOptions:a,loading:r,exporting:s,onChangeFilters:o,onApply:f,onReset:c,onRefresh:p,onExport:d}){const{t:g}=Gt("artifact"),[m,y]=C.useState(!1),v=C.useRef(null);C.useEffect(()=>{if(!m)return;const D=k=>{v.current&&!v.current.contains(k.target)&&y(!1)};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[m]);const N=e.nodeIds.length===0?g("common:common.all"):e.nodeIds.length<=3?e.nodeIds.join(", "):`${e.nodeIds.slice(0,3).join(", ")} ${g("nodeSummary",{count:e.nodeIds.length})}`,M=(D,k)=>{D.trim()&&o(U=>{const T=k?Array.from(new Set([...U.nodeIds,D])):U.nodeIds.filter(Q=>Q!==D);return{...U,nodeIds:T}})};return x.jsxs("section",{className:"grid gap-2 border border-(--line) bg-[rgba(13,22,28,0.82)] px-3 py-2",children:[x.jsxs("div",{className:"grid gap-2 lg:grid-cols-[auto_minmax(0,1fr)_auto] lg:items-start",children:[x.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:[{key:"today",label:g("common:time.today")},{key:"7d",label:g("common:time.last7d")},{key:"30d",label:g("common:time.last30d")},{key:"custom",label:g("common:time.custom")}].map(D=>x.jsx("button",{type:"button",className:`${k4} ${e.preset===D.key?A4:M4}`,onClick:()=>{o(k=>({...k,preset:D.key}))},disabled:r,children:D.label},D.key))}),x.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)]",children:[x.jsx("input",{className:Zs,type:"date",value:e.customFrom,onChange:D=>{const k=D.target.value;o(U=>({...U,customFrom:k,preset:"custom"}))},disabled:r}),x.jsx("input",{className:Zs,type:"date",value:e.customTo,onChange:D=>{const k=D.target.value;o(U=>({...U,customTo:k,preset:"custom"}))},disabled:r}),x.jsxs("select",{className:Zs,value:e.pipelineId,onChange:D=>{const k=D.target.value;o(U=>({...U,pipelineId:k}))},disabled:r,children:[x.jsx("option",{value:"",children:g("allPipelines")}),i.map(D=>x.jsxs("option",{value:D.id,children:[D.id," - ",D.title]},D.id))]}),x.jsxs("select",{className:Zs,value:e.statuses.join(","),onChange:D=>{const k=D.target.value;o(U=>({...U,statuses:k?k.split(","):[]}))},disabled:r,children:[x.jsx("option",{value:"",children:g("allStatus")}),x.jsx("option",{value:"success",children:"success"}),x.jsx("option",{value:"failed",children:"failed"}),x.jsx("option",{value:"rejected",children:"rejected"}),x.jsx("option",{value:"success,failed",children:"success + failed"})]}),x.jsxs("select",{className:Zs,value:e.kinds.join(","),onChange:D=>{const k=D.target.value;o(U=>({...U,kinds:k?k.split(","):[]}))},disabled:r,children:[x.jsx("option",{value:"",children:g("allTypes")}),x.jsx("option",{value:"artifact",children:"artifact"}),x.jsx("option",{value:"envelope",children:"envelope"}),x.jsx("option",{value:"adapter",children:"adapter"}),x.jsx("option",{value:"group",children:"group"})]}),x.jsxs("div",{className:j4,ref:v,children:[x.jsx("div",{className:`${T4} ${m?D4:""}`,title:N,role:"button",tabIndex:r?-1:0,onClick:()=>{r||y(D=>!D)},onKeyDown:D=>{r||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),y(k=>!k))},"aria-label":g("editNodeFilter"),children:N}),m?x.jsxs("div",{className:O4,children:[x.jsxs("label",{className:`${$b} ${e.nodeIds.length===0?Hb:""}`,children:[x.jsx("input",{type:"checkbox",className:Ub,checked:e.nodeIds.length===0,onChange:()=>{o(D=>({...D,nodeIds:[]}))}}),x.jsx("span",{className:"block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:g("allNodes")})]}),a.length?a.map(D=>x.jsxs("label",{className:`${$b} ${e.nodeIds.includes(D.id)?Hb:""}`,children:[x.jsx("input",{type:"checkbox",className:Ub,checked:e.nodeIds.includes(D.id),onChange:k=>M(D.id,k.target.checked)}),x.jsx("span",{className:"block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:D.id})]},D.id)):x.jsx("p",{className:_4,children:g("noNodesAvailable")})]}):null]})]}),x.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1.5 lg:justify-end",children:[x.jsx("button",{type:"button",className:Xu,onClick:f,disabled:r,children:g("applyFilters")}),x.jsx("button",{type:"button",className:Xu,onClick:c,disabled:r,children:g("reset")}),x.jsx("button",{type:"button",className:Xu,onClick:p,disabled:r,children:g("refresh")}),x.jsx("button",{type:"button",className:Xu,onClick:d,disabled:r||s,children:g(s?"exporting":"export")})]})]}),x.jsxs("p",{className:`${E4} m-0 text-xs text-(--muted)`,children:[g("timeRange"),":",e.preset==="today"?g("common:time.today"):e.preset==="7d"?g("recentDays",{count:7}):e.preset==="30d"?g("recentDays",{count:30}):g("common:time.custom")," |",g("pipeline"),":",e.pipelineId||g("common:common.all")," | ",g("node"),":",N]})]})}const ga="font-[JetBrains_Mono,monospace]",B4=e=>{if(!e)return"";const i=e.content;if(i&&(Array.isArray(i.contents)||Array.isArray(i.logs))){const a=[];if(Array.isArray(i.contents)&&i.contents.length>0){a.push(Be.t("artifact:contentLabel"));for(const r of i.contents)a.push(typeof r=="string"?r:JSON.stringify(r,null,2))}if(Array.isArray(i.logs)&&i.logs.length>0){a.push(Be.t("artifact:logLabel"));for(const r of i.logs)a.push(typeof r=="string"?r:JSON.stringify(r))}if(a.length>0)return a.join(`
56
+
57
+ `)}if(typeof e.content=="string")return e.content;try{return JSON.stringify(e.content,null,2)}catch{return e.rawText}};function R4({item:e,content:i,loadingKey:a,contentError:r}){const{t:s}=Gt("artifact"),o=e?`${e.pipelineId}:${e.relativePath}`:"",f=!!e&&a===o,c=B4(i);return x.jsxs("section",{className:"grid min-h-0 grid-rows-[auto_auto_minmax(0,1fr)] border border-(--line) bg-[rgba(12,21,27,0.85)]",children:[x.jsx("div",{className:"border-b border-(--line) px-2 py-1.5 text-xs text-(--muted)",children:s("artifactDetail")}),x.jsxs("div",{className:"grid gap-1 border-b border-(--line) px-2 py-2 text-xs text-(--muted)",children:[x.jsxs("div",{className:ga,children:["pipeline: ",e?.pipelineId??"-"]}),x.jsxs("div",{className:ga,children:["runId: ",e?.runId??"-"]}),x.jsxs("div",{className:ga,children:["status: ",e?.status??"-"]}),x.jsxs("div",{className:ga,children:["nodeId: ",e?.nodeId??"-"]}),x.jsxs("div",{className:ga,children:["size: ",e?.sizeBytes!=null?`${(e.sizeBytes/1024).toFixed(1)} KB`:"-"]}),x.jsxs("div",{className:ga,children:["path: ",e?.relativePath??"-"]})]}),x.jsxs("div",{className:"min-h-0 overflow-auto p-2",children:[e?null:x.jsx("p",{className:`${ga} m-0 text-xs text-(--muted)`,children:s("selectFile")}),e&&f?x.jsx("p",{className:`${ga} m-0 text-xs text-(--muted)`,children:s("contentLoading")}):null,e&&!f&&r?x.jsx("p",{className:`${ga} m-0 text-xs text-(--bad)`,children:s("contentLoadFailed",{error:r})}):null,e&&!f?x.jsx("code",{className:"block min-h-full whitespace-pre-wrap break-words border border-[rgba(142,163,179,0.18)] bg-[rgba(6,12,16,0.86)] p-2 text-xs text-(--text)",children:c||s("contentEmpty")}):null]})]})}const Fr="font-[JetBrains_Mono,monospace]",L4=e=>{const i=Date.parse(e);if(!Number.isFinite(i))return"-";const a=new Date(i),r=String(a.getHours()).padStart(2,"0"),s=String(a.getMinutes()).padStart(2,"0"),o=String(a.getSeconds()).padStart(2,"0");return`${r}:${s}:${o}`};function z4({groups:e,selectedItemKey:i,loading:a,error:r,onSelect:s}){const{t:o}=Gt("artifact");return x.jsxs("section",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] border border-(--line) bg-[rgba(12,21,27,0.85)]",children:[x.jsx("div",{className:"border-b border-(--line) px-2 py-1.5 text-xs text-(--muted)",children:o("artifactDirectory")}),x.jsxs("div",{className:"min-h-0 overflow-auto px-2 py-1.5",children:[a?x.jsx("p",{className:`${Fr} m-0 text-xs text-(--muted)`,children:o("loading")}):null,!a&&r?x.jsx("p",{className:`${Fr} m-0 text-xs text-(--bad)`,children:o("loadFailed",{error:r})}):null,!a&&!r&&e.length===0?x.jsx("p",{className:`${Fr} m-0 text-xs text-(--muted)`,children:o("noArtifacts")}):null,!r&&e.map(f=>x.jsxs("details",{open:!0,className:"group",children:[x.jsxs("summary",{className:`${Fr} flex cursor-pointer items-center gap-1 px-1 py-0.5 text-xs text-(--text) marker:text-(--muted) hover:bg-[rgba(142,163,179,0.08)]`,children:[x.jsx("span",{className:"truncate",children:f.dateKey}),x.jsxs("span",{className:"text-(--muted)",children:["(",f.total,")"]})]}),x.jsx("div",{className:"ml-3 border-l border-[rgba(142,163,179,0.2)] pl-2",children:f.pipelines.map(c=>x.jsxs("details",{open:!0,className:"group mt-0.5",children:[x.jsxs("summary",{className:`${Fr} flex cursor-pointer items-center gap-1 px-1 py-0.5 text-xs text-(--text) marker:text-(--muted) hover:bg-[rgba(142,163,179,0.08)]`,children:[x.jsxs("span",{className:"truncate",children:[c.pipelineId," - ",c.pipelineTitle]}),x.jsxs("span",{className:"text-(--muted)",children:["(",c.total,")"]})]}),x.jsx("div",{className:"ml-3 border-l border-[rgba(142,163,179,0.18)] pl-2",children:c.runs.map(p=>x.jsxs("details",{open:!0,className:"group mt-0.5",children:[x.jsxs("summary",{className:`${Fr} flex cursor-pointer items-center gap-1 px-1 py-0.5 text-xs text-(--text) marker:text-(--muted) hover:bg-[rgba(142,163,179,0.08)]`,children:[x.jsx("span",{className:"truncate",children:p.runId}),x.jsxs("span",{className:"text-[rgba(142,163,179,0.78)]",children:["(",p.items.length,")"]})]}),x.jsx("div",{className:"ml-3 border-l border-[rgba(142,163,179,0.16)] pl-2",children:p.items.map(d=>{const g=`${d.pipelineId}:${d.relativePath}`,m=g===i;return x.jsxs("button",{type:"button",className:`${Fr} mt-0.5 grid w-full cursor-pointer appearance-none grid-cols-[auto_1fr] items-center gap-x-2 border-0 bg-transparent px-1.5 py-0.5 text-left text-xs shadow-none outline-none ${m?"bg-[rgba(50,215,186,0.16)] text-(--text)":"text-(--muted) hover:bg-[rgba(142,163,179,0.1)] hover:text-(--text)"}`,onClick:()=>{s(d)},children:[x.jsx("span",{className:"text-[rgba(142,163,179,0.88)]",children:L4(d.updatedAt)}),x.jsx("span",{className:"truncate",children:d.fileName})]},g)})})]},`${c.pipelineId}:${p.runId}`))})]},`${f.dateKey}:${c.pipelineId}`))})]},f.dateKey))]})]})}const $v=e=>{const i={};return e?.pipelineId&&(i.pipelineId=e.pipelineId),e?.nodeId&&(i.nodeId=e.nodeId),e?.dateFrom&&(i.dateFrom=e.dateFrom),e?.dateTo&&(i.dateTo=e.dateTo),typeof e?.limit=="number"&&(i.limit=e.limit),e?.status&&(i.status=e.status),e?.kind&&(i.kind=e.kind),e?.cursor&&(i.cursor=e.cursor),e?.batchRunId&&(i.batchRunId=e.batchRunId),e?.runId&&(i.runId=e.runId),i};async function I4(e){const i=await ht("artifact.list",$v(e));return Array.isArray(i.items)?i.items:[]}async function $4(e){return(await ht("artifact.content.get",{pipelineId:e.pipelineId,relativePath:e.relativePath})).content??null}async function H4(e){return(await ht("artifact.export",$v(e))).data??{}}const Pb=1440*60*1e3,qb=e=>String(e).padStart(2,"0"),nc=e=>`${e.getFullYear()}-${qb(e.getMonth()+1)}-${qb(e.getDate())}`,U4=(e,i=new Date)=>{const a=new Date(i);a.setHours(0,0,0,0);const r=nc(a);if(e==="today")return{dateFrom:r,dateTo:r};if(e==="7d"){const s=new Date(a.getTime()-Pb*6);return{dateFrom:nc(s),dateTo:r}}if(e==="30d"){const s=new Date(a.getTime()-Pb*29);return{dateFrom:nc(s),dateTo:r}}return{dateFrom:r,dateTo:r}},Gb=e=>{const i=e.nodeIds.length>0?e.nodeIds.join(","):"";return e.preset==="custom"?!e.customFrom||!e.customTo||e.customFrom>e.customTo?null:{dateFrom:e.customFrom,dateTo:e.customTo,...e.pipelineId?{pipelineId:e.pipelineId}:{},...i?{nodeId:i}:{}}:{...U4(e.preset),...e.pipelineId?{pipelineId:e.pipelineId}:{},...i?{nodeId:i}:{}}},Gh=e=>{const i=Date.parse(e);return Number.isFinite(i)?i:0},P4=e=>[...e].sort((i,a)=>a.latestUpdatedAtMs-i.latestUpdatedAtMs),q4=e=>[...e].sort((i,a)=>a.latestUpdatedAtMs-i.latestUpdatedAtMs),G4=e=>[...e].sort((i,a)=>a.latestUpdatedAtMs-i.latestUpdatedAtMs),V4=e=>{const i=new Map;for(const r of e){const s=r.dateBucket||"unknown",o=i.get(s)??new Map,f=o.get(r.pipelineId)??new Map,c=r.runId?.trim()||"unknown",p=f.get(c)??{runId:c,items:[],latestUpdatedAtMs:0};p.items.push(r),p.latestUpdatedAtMs=Math.max(p.latestUpdatedAtMs,Gh(r.updatedAt)),f.set(c,p),o.set(r.pipelineId,f),i.set(s,o)}const a=[];for(const[r,s]of i.entries()){const o=[];for(const[c,p]of s.entries()){const d=P4([...p.values()].map(v=>({...v,items:[...v.items].sort((N,M)=>Gh(M.updatedAt)-Gh(N.updatedAt))}))),g=d.reduce((v,N)=>v+N.items.length,0),m=d[0]?.latestUpdatedAtMs??0,y=d[0]?.items[0]?.pipelineTitle??c;o.push({pipelineId:c,pipelineTitle:y,runs:d,total:g,latestUpdatedAtMs:m})}const f=q4(o);a.push({dateKey:r,pipelines:f,total:f.reduce((c,p)=>c+p.total,0),latestUpdatedAtMs:f[0]?.latestUpdatedAtMs??0})}return G4(a)},Vh=()=>{const e=nc(new Date);return{preset:"today",pipelineId:"",nodeIds:[],statuses:[],kinds:[],customFrom:e,customTo:e}},K4=e=>{const i=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),f=String(e.getSeconds()).padStart(2,"0");return`${i}${a}${r}-${s}${o}${f}`},Y4=e=>{const[i,a]=C.useState(Vh),[r,s]=C.useState(Vh),[o,f]=C.useState([]),[c,p]=C.useState(!1),[d,g]=C.useState(!1),[m,y]=C.useState(""),[v,N]=C.useState(""),[M,D]=C.useState(""),[k,U]=C.useState(""),[T,Q]=C.useState({}),ee=C.useMemo(()=>V4(o),[o]),R=v?T[v]??null:null,F=async E=>{const _=Gb(E);if(!_){y(Be.t("artifact:dateRangeInvalid"));return}p(!0),y("");try{const Y=await I4({pipelineId:_.pipelineId,nodeId:_.nodeId,dateFrom:_.dateFrom,dateTo:_.dateTo,status:E.statuses.length>0?E.statuses.join(","):void 0,kind:E.kinds.length>0?E.kinds.join(","):void 0,limit:2e4});f(Y),N(""),U("")}catch(Y){y(Y instanceof Error?Y.message:String(Y)),f([])}finally{p(!1)}},I=async()=>{s(i),await F(i)},K=async()=>{const E=Vh();a(E),s(E),await F(E)},j=async()=>{await F(r)},P=async()=>{const E=Gb(r);if(!E){y(Be.t("artifact:exportFailed"));return}g(!0),y("");try{const _=await H4({pipelineId:E.pipelineId,nodeId:E.nodeId,status:r.statuses.length>0?r.statuses.join(","):void 0,kind:r.kinds.length>0?r.kinds.join(","):void 0,batchRunId:r.batchRunId||void 0,dateFrom:E.dateFrom,dateTo:E.dateTo,limit:2e4}),Y=JSON.stringify(_,null,2),oe=new Blob([Y],{type:"application/json;charset=utf-8"}),O=URL.createObjectURL(oe),B=document.createElement("a");B.href=O,B.download=`artifacts-export-${K4(new Date)}.json`,document.body.appendChild(B),B.click(),B.remove(),URL.revokeObjectURL(O)}catch(_){y(_ instanceof Error?_.message:String(_))}finally{g(!1)}},q=async E=>{const _=`${E.pipelineId}:${E.relativePath}`;if(N(_),U(""),!Object.prototype.hasOwnProperty.call(T,_)){D(_);try{const Y=await $4({pipelineId:E.pipelineId,relativePath:E.relativePath});Q(oe=>({...oe,[_]:Y}))}catch(Y){Q(oe=>({...oe,[_]:null})),U(Y instanceof Error?Y.message:String(Y))}finally{D("")}}},W=v?o.find(E=>`${E.pipelineId}:${E.relativePath}`===v):void 0,H=C.useMemo(()=>{const E=new Map;for(const _ of e)_.id.trim()&&E.set(_.id,_);for(const _ of o)_.pipelineId.trim()&&(E.has(_.pipelineId)||E.set(_.pipelineId,{id:_.pipelineId,title:_.pipelineTitle||_.pipelineId}));return[...E.values()].sort((_,Y)=>_.title.localeCompare(Y.title))},[e,o]),ae=C.useMemo(()=>{const E=new Set;for(const _ of o){const Y=_.nodeId?.trim();Y&&E.add(Y)}return[...E].sort((_,Y)=>_.localeCompare(Y)).map(_=>({id:_}))},[o]);return{draftFilters:i,setDraftFilters:a,appliedFilters:r,items:o,groups:ee,loading:c,error:m,selectedItemKey:v,selectedItem:W,selectedContent:R,contentLoadingKey:M,contentError:k,mergedPipelineOptions:H,mergedNodeOptions:ae,exporting:d,applyFilters:I,resetFilters:K,refresh:j,exportFilteredArtifacts:P,selectItem:q}};function Q4({pipelines:e,onNavigatePipeline:i}){const a=Y4(e);return C.useEffect(()=>{a.applyFilters()},[]),x.jsxs("section",{"data-center-card":!0,className:"grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[x.jsx("div",{className:"p-3",children:x.jsx(F4,{filters:a.draftFilters,pipelineOptions:a.mergedPipelineOptions,nodeOptions:a.mergedNodeOptions,loading:a.loading,exporting:a.exporting,onChangeFilters:r=>{a.setDraftFilters(s=>r(s))},onApply:()=>{a.applyFilters()},onReset:()=>{a.resetFilters()},onRefresh:()=>{a.refresh()},onExport:()=>{a.exportFilteredArtifacts()}})}),x.jsxs("div",{className:"grid min-h-0 min-w-0 gap-3 overflow-hidden px-3 pb-3 lg:grid-cols-[minmax(340px,42%)_minmax(0,1fr)]",children:[x.jsx(z4,{groups:a.groups,selectedItemKey:a.selectedItemKey,loading:a.loading,error:a.error,onSelect:r=>{a.selectItem(r)}}),x.jsx(R4,{item:a.selectedItem,content:a.selectedContent,loadingKey:a.contentLoadingKey,contentError:a.contentError})]})]})}const J4="mb-1.5 block text-xs text-[var(--muted)]";function X4(){const{t:e,i18n:i}=Gt("common"),a=dc.map(s=>({value:s,label:e(`settings.language.${s}`)})),r=s=>{i.changeLanguage(s),localStorage.setItem("taskmeld-locale",s)};return x.jsxs("section",{"data-center-card":!0,className:"min-h-0 min-w-0 p-3",children:[x.jsx("h2",{className:"mb-3 text-lg font-semibold text-[var(--text)]",children:e("settings.title")}),x.jsxs("div",{className:"max-w-[400px]",children:[x.jsx("label",{className:J4,children:e("settings.language.label")}),x.jsx(qn,{value:i.language,options:a,onChange:r,triggerClassName:Mn,ariaLabel:e("settings.language.label")})]})]})}function Z4(e){const[i,a]=C.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return C.useEffect(()=>{const r=window.matchMedia(e),s=o=>a(o.matches);return a(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),i}const W4={width:24,height:24};function eO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:W4,content:'<g class="nrj6p8qat"><path class="w7_vazn9d"/><rect class="wh0tzmd6d"/><path class="jefb58bpl"/></g>',fallback:"lucide:bot"})}const tO={width:24,height:24};function nO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:tO,content:'<g class="nrj6p8qat"><path class="faeb4ph9u"/><path class="qggg1kbck"/></g>',fallback:"lucide:boxes"})}const iO={width:24,height:24};function aO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:iO,content:'<g class="nrj6p8qat"><path class="oge_lhbou"/><path class="ht7qx0byx"/></g>',fallback:"lucide:file-text"})}const rO={width:24,height:24};function lO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:rO,content:'<g class="nrj6p8qat"><path class="mfojsy6pj"/><path class="a7iy2kw9d"/></g>',fallback:"lucide:history"})}const sO={width:24,height:24};function oO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:sO,content:'<g class="nrj6p8qat"><rect class="aoxhq7npe"/><rect class="ilpqg2l0q"/><rect class="ovvq_obta"/><rect class="ll6_4rblg"/></g>',fallback:"lucide:layout-dashboard"})}const uO={width:24,height:24};function cO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:uO,content:'<g class="nrj6p8qat"><path class="gac0kygtr"/><circle class="gp0egaclj"/></g>',fallback:"lucide:settings"})}const fO={width:24,height:24};function dO({width:e,height:i,...a}){return C.createElement(Vt,{...a,width:e,height:i,viewBox:fO,content:'<g class="nrj6p8qat"><rect class="j4kl21b2v"/><path class="ce22cyb5j"/><rect class="sqw8o7bkk"/></g>',fallback:"lucide:workflow"})}const Vb=[{key:"overview",label:"nav:overview",icon:oO},{key:"agents",label:"nav:agents",icon:eO},{key:"pipeline",label:"nav:pipeline",icon:dO},{key:"pipelineRuns",label:"nav:pipelineRuns",icon:lO},{key:"artifacts",label:"nav:artifacts",icon:nO},{key:"logs",label:"nav:logs",icon:aO},{key:"settings",label:"nav:settings",icon:cO}];function hO(){return{retryNode:async(i,a)=>{a&&await OT(i,a)}}}function pO({reload:e}){const{t:i}=Gt("session"),[a,r]=C.useState("{}");return{sessionCreatePayload:a,setSessionCreatePayload:r,createSession:async o=>{o.preventDefault();try{const f=JSON.parse(a);await iD(f),await e()}catch(f){if(f instanceof Pp){alert(i("createSessionFailed",{status:f.status}));return}alert(i("invalidJson"))}}}}function mO({reload:e}){const{t:i}=Gt("session"),[a,r]=C.useState(""),[s,o]=C.useState(""),[f,c]=C.useState("auto"),[p,d]=C.useState(""),g=N=>{N.length!==0&&r(M=>M||N[0].id)},m=(N,M)=>{const D=N.trim(),k=M.trim();return!D||!k?!1:D===k||D.startsWith(`agent:${k}:`)};return{selectedSessionId:a,setSelectedSessionId:r,sessionMessage:s,setSessionMessage:o,sendMode:f,setSendMode:c,lastSendInfo:p,ensureDefaultSession:g,selectPreferredSessionForAgent:(N,M)=>{const D=M.find(k=>k.id===`agent:${N}:main`)??M.find(k=>m(k.id,N));if(D){r(D.id);return}r(`agent:${N}:main`)},sendSessionMessage:async N=>{if(N.preventDefault(),!(!a||!s.trim()))try{const M=await aD({sessionId:a,message:s,mode:f}),D=M?.model?`${M.modelProvider?`${M.modelProvider}/`:""}${M.model}`:"-";d(i("sendSuccess",{method:M?.usedMethod??"-",model:D,params:JSON.stringify(M?.usedParams??{},null,2)})),o(""),await e()}catch(M){if(M instanceof Pp){const k=M.body,U=k?.attempts?.slice(0,3).join(`
58
+ `)??k?.error??`HTTP ${M.status}`;d(i("sendFailed",{detail:U})),alert(i("sendFailed",{detail:U}));return}const D=M instanceof Error?M.message:"unknown error";d(i("sendFailed",{detail:D})),alert(i("sendFailed",{detail:D}))}}}}const Kh="yes",gO="no",eo=e=>{const i=new Set,a=[];for(const r of e){const s=`${r.from}|${r.to}|${r.when??""}`;i.has(s)||(i.add(s),a.push(r))}return a},xO=(e,i)=>e.edges.filter(a=>a.to===i&&a.when===null).map(a=>a.from),bO=(e,i)=>e.nodes.filter(a=>(a.parallelGroupId??"").trim()===i).map(a=>a.id),$i=e=>{const i=new Map(e.groups.map(r=>[r.id,r]));return Array.from(new Set(e.nodes.map(r=>(r.parallelGroupId??"").trim()).filter(Boolean))).map(r=>{const s=bO(e,r);if(s.length<2)return null;const o=i.get(r)??null;return o?{id:o.id,members:s,joinPolicy:o.joinPolicy}:{id:r,members:s,joinPolicy:"all"}}).filter(r=>!!r)},$l=(e,i,a,r)=>{const s={...e,nodes:i,groups:r};return $i(s).map(o=>({id:o.id,type:"parallel",members:o.members,joinPolicy:o.joinPolicy}))},Hv=(e,i,a,r="before")=>{if(!i||!a||i===a)return e;const s=e.nodes.findIndex(y=>y.id===i),o=e.nodes.findIndex(y=>y.id===a);if(s<0||o<0)return e;const f=e.nodes[s]?.lane==="branch"?"branch":"main",c=e.nodes[o]?.lane==="branch"?"branch":"main";if(f!==c)return e;const p=[...e.nodes],[d]=p.splice(s,1);if(!d)return e;const g=p.findIndex(y=>y.id===a);if(g<0)return e;const m=r==="after"?g+1:g;return p.splice(m,0,d),{...e,nodes:p}},yO=(e,i,a)=>{const r=e.nodes.findIndex(g=>g.id===i);if(r<0)return e;const o=e.nodes[r].lane==="branch"?"branch":"main",f=e.nodes.reduce((g,m,y)=>((m.lane==="branch"?"branch":"main")===o&&g.push(y),g),[]),c=f.indexOf(r);if(c<0)return e;const p=a==="up"?f[c-1]:f[c+1];if(p===void 0)return e;const d=e.nodes[p]?.id??"";return d?Hv(e,i,d,a==="up"?"before":"after"):e},vO=({workflow:e,previousGroupId:i,nextGroupId:a,memberIds:r,upstreamIds:s,joinPolicy:o})=>{const c=$i(e).find(k=>k.id===i)??null;if(!c)return e;const p=c.members,d=p.filter(k=>!r.includes(k)),g=[...new Set([...p,...r])],m=Uv(e,i,p),y=e.groups.filter(k=>k.id!==i&&k.id!==a),v=e.nodes.map(k=>d.includes(k.id)?{...k,parallelGroupId:null}:r.includes(k.id)?{...k,parallelGroupId:a}:k),N=k=>k===i?a:k,M=eo([...e.edges.map(k=>({...k,from:N(k.from),to:N(k.to)})).filter(k=>k.when!==null?k.from!==i&&k.to!==i:!(k.from===a||k.to===a||g.includes(k.from)||g.includes(k.to))),...s.map(k=>({from:k,to:a,when:null})),...m.map(k=>({from:a,to:k,when:null})),...d.flatMap(k=>[...s.map(U=>({from:U,to:k,when:null})),...m.map(U=>({from:k,to:U,when:null}))])]),D=$l(e,v,M,[...y,{id:a,type:"parallel",members:r,joinPolicy:o}]);return{...e,nodes:v,edges:M,groups:D}},SO=(e,i,a)=>{const r=e.edges.filter(c=>c.to===i).map(c=>c.from);if(r.length>0)return[...new Set(r)];if(a.length===0)return[];const s=a.map(c=>new Set(e.edges.filter(p=>p.to===c&&p.when===null&&!a.includes(p.from)).map(p=>p.from))),[o,...f]=s;return[...o].filter(c=>f.every(p=>p.has(c)))},Uv=(e,i,a)=>{const r=e.edges.filter(c=>c.from===i&&c.when===null).map(c=>c.to);if(r.length>0)return[...new Set(r)];if(a.length===0)return[];const s=a.map(c=>new Set(e.edges.filter(p=>p.from===c&&p.when===null&&!a.includes(p.to)).map(p=>p.to))),[o,...f]=s;return[...o].filter(c=>f.every(p=>p.has(c)))},Kb=(e,i)=>{const a=new Set([i]),s=((e.nodes.find(f=>f.id===i)??null)?.parallelGroupId??"").trim();if(!s)return a;const o=$i(e).find(f=>f.id===s)??null;if(!o)return a;a.add(s);for(const f of o.members)f!==i&&a.add(f);for(const f of e.edges)f.to===s&&a.add(f.from);return a},NO=(e,i)=>{if(e&&e.nodes.length>0){const a=new Map(i.map(r=>[r.id,r]));return e.nodes.map(r=>{const s=a.get(r.id);return{id:r.id,title:r.name??s?.title??r.id,executor:r.executor??s?.executor??{agentId:"operator-main",role:"operator",fallbackAgentId:null,sessionId:null},instruction:r.instruction??s?.instruction??"",outputSpec:r.outputSpec??s?.outputSpec??{type:"generic.v1",schemaVersion:1},dependsOn:xO(e,r.id),allowReject:r.allowReject??s?.allowReject??!1,maxRejectCount:r.maxRejectCount??s?.maxRejectCount??3}})}return i.map(a=>({id:a.id,title:a.title,executor:a.executor,instruction:a.instruction,outputSpec:a.outputSpec,dependsOn:a.dependsOn,allowReject:a.allowReject,maxRejectCount:a.maxRejectCount}))},wO=(e,i,a)=>{const r=i.lane==="branch"?"branch":"main",s=$i(e),o=new Map(e.nodes.map((y,v)=>[y.id,v])),f=new Map(s.map(y=>[y.id,Math.max(...y.members.map(v=>o.get(v)??-1))])),c=y=>{const v=f.get(y);return typeof v=="number"&&v>=0?v:o.get(y)??-1},p=e.nodes.findIndex(y=>(y.lane==="branch"?"branch":"main")===r),d=Array.from(new Set(a.map(y=>y.trim()).filter(Boolean))),g=d.length===0?p>=0?p:e.nodes.length:Math.max(...d.map(c))+1,m=[...e.nodes];return m.splice(Math.max(0,Math.min(g,e.nodes.length)),0,i),m},CO=e=>e.match(/\bevent:[^\s,)\]]+/i)?.[0]??"",EO=(e,i,a,r)=>{const s=(()=>{const o={},f=/Agent\s+([^\s]+)\s+started/,c=/Agent\s+([^\s]+)\s+finished/;for(const p of[...a].reverse()){const d=p.text??"",g=d.match(f);if(g){const y=g[1];o[y]=(o[y]??0)+1;continue}const m=d.match(c);if(m){const y=m[1],v=o[y]??0;v<=1?delete o[y]:o[y]=v-1}}return o})();return e.map(o=>{const f=i.filter(y=>y.executor.agentId===o.id),c=(s[o.id]??0)>0,p=a.find(y=>y.text.includes(`Agent ${o.id} `)||y.text.includes(`agent:${o.id}`))?.text??"",d=CO(p),g=r[o.id],m=f.filter(y=>y.status==="success"||y.status==="failed").sort((y,v)=>{const N=Date.parse(y.finishedAt??"")||0;return(Date.parse(v.finishedAt??"")||0)-N})[0];return{...o,workStatus:c?"busy":"idle",outputRunId:g?.runId??null,outputContent:g?.content??"",outputPreview:g?.content?`${g.content.slice(0,72)}${g.content.length>72?"...":""}`:"",eventPreview:d,lastExecution:m?{nodeId:m.id,nodeTitle:m.title,status:m.status==="success"?"success":"failed",finishedAt:m.finishedAt}:null}})},Yb=(e,i)=>i||e.some(a=>a.status==="running"||a.status==="success"||a.status==="failed"||(a.attempt??0)>0||!!a.startedAt||!!a.finishedAt),kO=e=>!e||typeof e!="object"?!1:typeof e.status=="number",mn=e=>kO(e)?String((()=>{const i=e.body??null;return i?.error&&i?.detail?`${i.error}: ${i.detail}`:i?.error??`HTTP ${e.status}`})()):e instanceof Error?e.message:"unknown_error",Rl=e=>{if(e.version!=="3.0")return{ok:!1,message:Be.t("common:validation.versionInvalid",{version:String(e.version)})};if(!Array.isArray(e.nodes)||!Array.isArray(e.edges)||!Array.isArray(e.groups))return{ok:!1,message:Be.t("common:validation.mustBeArray")};const i=new Set(e.nodes.map(y=>y.id)),a=new Set(e.groups.map(y=>y.id)),r=new Set([...i,...a]);if(i.size!==e.nodes.length)return{ok:!1,message:Be.t("common:validation.duplicateNodeId")};if(a.size!==e.groups.length)return{ok:!1,message:Be.t("common:validation.duplicateGroupId")};const s=new Set,o=new Map,f=new Map,c=new Map,p=new Map([...r].map(y=>[y,0]));for(const y of e.edges){if(!r.has(y.from)||!r.has(y.to))return{ok:!1,message:Be.t("common:validation.edgeReferencesMissing",{from:y.from,to:y.to})};if(y.from===y.to)return{ok:!1,message:Be.t("common:validation.selfLoopEdge",{from:y.from,to:y.to})};const v=`${y.from}|${y.to}|${y.when??""}`;if(s.has(v))return{ok:!1,message:Be.t("common:validation.duplicateEdge",{from:y.from,to:y.to})};s.add(v);const N=y.when===null?"dependency":"route",M=o.get(y.from)??new Set;M.add(N),o.set(y.from,M),f.set(y.from,[...f.get(y.from)??[],y]),c.set(y.from,[...c.get(y.from)??[],y.to]),p.set(y.to,(p.get(y.to)??0)+1)}for(const[y,v]of o.entries())if(!(v.size<=1||e.nodes.find(M=>M.id===y)?.routePolicy))return{ok:!1,message:Be.t("common:validation.mixedEdgeTypes",{nodeId:y})};for(const y of e.nodes){const v=y.routePolicy?.allowed??[];if(v.length===0)continue;if(!v.includes(Kh)||!v.includes(gO))return{ok:!1,message:Be.t("common:validation.routeMustContainYesNo",{nodeId:y.id})};const N=f.get(y.id)??[];if(N.filter(k=>k.when===null).length>1)return{ok:!1,message:Be.t("common:validation.yesMainlineMaxOne",{nodeId:y.id})};const D=new Map;for(const k of N.filter(U=>U.when!==null)){if(D.set(k.when??"",(D.get(k.when??"")??0)+1),k.when===Kh)return{ok:!1,message:Be.t("common:validation.yesCannotBeRouteEdge",{nodeId:y.id})};if(!v.includes(k.when??""))return{ok:!1,message:Be.t("common:validation.undeclaredRouteEdge",{nodeId:y.id,route:k.when})};const U=e.nodes.find(R=>R.id===k.to),T=e.groups.find(R=>R.id===k.to),Q=T?T.members.map(R=>e.nodes.find(F=>F.id===R)).filter(Boolean):[];if(!(U?.lane==="branch"||Q.length>0&&Q.every(R=>R?.lane==="branch")))return{ok:!1,message:Be.t("common:validation.routeMustTargetBranch",{nodeId:y.id,route:k.when})}}for(const k of v.filter(U=>U!==Kh))if((D.get(k)??0)!==1)return{ok:!1,message:Be.t("common:validation.routeTargetMustBeOne",{nodeId:y.id,route:k})}}for(const y of e.groups){if(y.type!=="parallel")return{ok:!1,message:Be.t("common:validation.groupTypeInvalid",{groupId:y.id})};if(!Array.isArray(y.members)||y.members.length<2)return{ok:!1,message:Be.t("common:validation.groupMinMembers",{groupId:y.id})};if(new Set(y.members).size!==y.members.length)return{ok:!1,message:Be.t("common:validation.groupDuplicateMembers",{groupId:y.id})};for(const N of y.members)if(!i.has(N))return{ok:!1,message:Be.t("common:validation.groupMemberMissing",{groupId:y.id,memberId:N})}}const d=new Map(e.groups.map(y=>[y.id,y]));for(const y of e.nodes){const v=(y.parallelGroupId??"").trim();if(!v)continue;const N=d.get(v);if(!N)return{ok:!1,message:Be.t("common:validation.nodeGroupMissing",{nodeId:y.id,groupId:v})};if(!N.members.includes(y.id))return{ok:!1,message:Be.t("common:validation.nodeNotInGroup",{nodeId:y.id,groupId:v})}}for(const y of e.groups){const v=new Set(y.members),N=new Set(e.edges.filter(M=>M.to===y.id).map(M=>M.from));for(const M of e.edges)if(M.when===null&&v.has(M.to)){if(M.from===y.id)return{ok:!1,message:Be.t("common:validation.groupCannotDirectConnect",{groupId:y.id})};if(v.has(M.from))return{ok:!1,message:Be.t("common:validation.groupMemberNoDirectDep",{groupId:y.id})};if(N.has(M.from))return{ok:!1,message:Be.t("common:validation.groupEntryCannotDirectConnect",{groupId:y.id})}}}const g=[...[...r].filter(y=>(p.get(y)??0)===0)];let m=0;for(;g.length>0;){const y=g.shift();m+=1;for(const v of c.get(y)??[]){const N=(p.get(v)??0)-1;p.set(v,N),N===0&&g.push(v)}}return m!==r.size?{ok:!1,message:Be.t("common:validation.workflowHasCycle")}:{ok:!0}};function AO({selectedNode:e,selectedWorkflowNode:i,selectedGroup:a,selectedRouteTargets:r,workflow:s,isSessionForAgent:o}){const[f,c]=C.useState(""),[p,d]=C.useState(""),[g,m]=C.useState(""),[y,v]=C.useState(""),[N,M]=C.useState([]),[D,k]=C.useState(!1),[U,T]=C.useState(3),[Q,ee]=C.useState("main"),[R,F]=C.useState(""),[I,K]=C.useState({}),[j,P]=C.useState(""),[q,W]=C.useState([]),[H,ae]=C.useState([]),[E,_]=C.useState("all"),[Y,oe]=C.useState(""),[O,B]=C.useState("node"),[Z,w]=C.useState(""),[he,Ce]=C.useState(""),[Se,ze]=C.useState(""),[Ve,Ue]=C.useState(""),[Dt,Ht]=C.useState([]),[Jt,Rt]=C.useState(""),[de,Ke]=C.useState([]),[Ot,pe]=C.useState([]),[Me,Xe]=C.useState("all");C.useEffect(()=>{if(!e){c(""),d(""),m(""),v(""),M([]),k(!1),T(3);return}c(e.title);const _e=e.executor.agentId;d(_e),m(e.executor.sessionId?.trim()||""),v(e.instruction??""),M(e.dependsOn),k(e.allowReject===!0),T(Number.isFinite(e.maxRejectCount)?e.maxRejectCount:3)},[e?.id,e?.title,e?.executor.agentId,e?.executor.sessionId,e?.instruction,e?.dependsOn,e?.allowReject,e?.maxRejectCount]),C.useEffect(()=>{const _e=p.trim();if(!_e){g&&m("");return}const Pe=g.trim();Pe&&!o(Pe,_e)&&m("")},[p,g,o]),C.useEffect(()=>{if(!i){ee("main"),F(""),K({});return}ee(i.lane==="branch"?"branch":"main"),F(i.routePolicy?.allowed?.join(", ")??""),K(r)},[i?.lane,i?.routePolicy,r]),C.useEffect(()=>{if(!a){P(""),W([]),ae([]),_("all");return}P(a.id),W(a.members),ae(a.upstreams),_(a.joinPolicy)},[a]),C.useEffect(()=>{if(!s){oe("");return}oe(JSON.stringify(s,null,2))},[s]);const et=C.useMemo(()=>{if(!e)return!1;const _e=Array.from(new Set(N.map(le=>le.trim()).filter(Boolean))),Pe=Array.from(new Set((e.dependsOn??[]).map(le=>le.trim()).filter(Boolean))),Kt=_e.length===Pe.length&&_e.every((le,xe)=>le===Pe[xe]);return f.trim()!==(e.title??"").trim()||p.trim()!==(e.executor.agentId??"").trim()||g.trim()!==(e.executor.sessionId&&e.executor.sessionId.trim()||"")||(y??"").trim()!==(e.instruction??"").trim()||D!==(e.allowReject===!0)||Math.max(0,Math.min(10,Math.trunc(Number(U)||0)))!==Math.max(0,Math.min(10,Math.trunc(Number(e.maxRejectCount)||0)))||!Kt},[e,f,p,g,y,N,D,U]),Ae=C.useMemo(()=>{if(!i)return!1;const _e=i.lane==="branch"?"branch":"main",Pe=i.routePolicy?.allowed??[],Kt=Array.from(new Set(Pe.map(je=>je.trim()).filter(Boolean))),le=Array.from(new Set(R.split(",").map(je=>je.trim()).filter(Boolean))),xe=Kt.length===le.length&&Kt.every((je,Re)=>je===le[Re]);if(_e!==Q||!xe)return!0;const z=Object.fromEntries(Kt.map(je=>[je,(r[je]??"").trim()])),me=Object.fromEntries(le.map(je=>[je,(I[je]??"").trim()])),we=Object.keys(z),qe=Object.keys(me);return we.length!==qe.length?!0:qe.some(je=>z[je]!==me[je])},[i,r,Q,R,I]);return{draftTitle:f,setDraftTitle:c,draftAgentId:p,setDraftAgentId:d,draftExecutorSessionId:g,setDraftExecutorSessionId:m,draftInstruction:y,setDraftInstruction:v,draftDependsOn:N,setDraftDependsOn:M,draftAllowReject:D,setDraftAllowReject:k,draftMaxRejectCount:U,setDraftMaxRejectCount:T,draftWorkflowLane:Q,setDraftWorkflowLane:ee,draftWorkflowRouteAllowed:R,setDraftWorkflowRouteAllowed:F,draftWorkflowRouteTargets:I,setDraftWorkflowRouteTargets:K,setDraftWorkflowRouteTarget:(_e,Pe)=>{K(Kt=>({...Kt,[_e]:Pe}))},draftGroupId:j,setDraftGroupId:P,draftGroupMembers:q,setDraftGroupMembers:W,draftGroupUpstreams:H,setDraftGroupUpstreams:ae,draftGroupJoinPolicy:E,setDraftGroupJoinPolicy:_,workflowJsonDraft:Y,setWorkflowJsonDraft:oe,draftCreateKind:O,setDraftCreateKind:B,draftNewNodeId:Z,setDraftNewNodeId:w,draftNewNodeTitle:he,setDraftNewNodeTitle:Ce,draftNewNodeAgentId:Se,setDraftNewNodeAgentId:ze,draftNewNodeInstruction:Ve,setDraftNewNodeInstruction:Ue,draftNewNodeDependsOn:Dt,setDraftNewNodeDependsOn:Ht,draftNewGroupId:Jt,setDraftNewGroupId:Rt,draftNewGroupMembers:de,setDraftNewGroupMembers:Ke,draftNewGroupUpstreams:Ot,setDraftNewGroupUpstreams:pe,draftNewGroupJoinPolicy:Me,setDraftNewGroupJoinPolicy:Xe,hasNodeDraftChanges:et,hasWorkflowDraftChanges:Ae}}const MO={enabled:!1,url:"",startBatch:1,batchSize:5,sourceField:"list30"},Qb={remoteBatch:MO,scheduler:{enabled:!0}},xc="yes",jO="no",TO=e=>{const i=e.map(a=>a.trim()).filter(Boolean);return i.length===0?[]:Array.from(new Set([xc,jO,...i])).slice(0,5)},DO=()=>({runId:"run-241",pipeline:[],workflow:null,schedulerState:null,pipelineItems:[],pipelineGroups:[],pipelineGroupItems:[],batchRunState:null,isRunning:!1}),OO=e=>{const i=e.lastIndexOf("::");if(i<0)return null;const a=e.slice(i+2),r=a.indexOf(":");return r<=0||r===a.length-1?null:{parentItemKey:e.slice(0,i),splitNodeId:a.slice(0,r),route:a.slice(r+1)}},_O=(e,i,a)=>{const r=new Set([i]),s=new Set,o=e.edges.filter(c=>c.from===i&&(a===xc?c.when===null:c.when===a)).map(c=>c.to),f=new Map(e.groups.map(c=>[c.id,c.members]));for(;o.length>0;){const c=o.shift();if(!c||s.has(c))continue;s.add(c);const p=f.get(c);if(p)for(const d of p)r.add(d),s.has(d)||o.push(d);else r.add(c);for(const d of e.edges)d.from===c&&o.push(d.to)}return r};function FO(){const{t:e}=Gt("common"),[i,a]=C.useState("overview"),[r,s]=C.useState(""),[o,f]=C.useState(!1),[c,p]=C.useState(""),[d,g]=C.useState(""),[m,y]=C.useState(""),[v,N]=C.useState({status:"idle",protocol:null,scopes:[],lastError:null}),[M,D]=C.useState("-"),[k,U]=C.useState(null),[T,Q]=C.useState([]),[ee,R]=C.useState([]),[F,I]=C.useState([]),[K,j]=C.useState({}),[P,q]=C.useState([]),[W,H]=C.useState(""),[ae,E]=C.useState(!1),[_,Y]=C.useState(!1),[oe,O]=C.useState(!1),[B,Z]=C.useState(!1),[w,he]=C.useState({}),[Ce,Se]=C.useState(null),[ze,Ve]=C.useState(!1),[Ue,Dt]=C.useState(""),[Ht,Jt]=C.useState(""),[Rt,de]=C.useState(""),[Ke,Ot]=C.useState(!1),[pe,Me]=C.useState(!1),[Xe,et]=C.useState(!1),[Ae,Nt]=C.useState(!1),[_e,Pe]=C.useState(!1),[Kt,le]=C.useState(!1),[xe,z]=C.useState({}),me=C.useRef(new Map),we=C.useRef(null),qe=C.useCallback((L,G)=>G[L]??DO(),[]),je=C.useRef(F),Re=C.useRef(r);C.useEffect(()=>{je.current=F},[F]),C.useEffect(()=>{Re.current=r},[r]);const Fe=C.useCallback((L,G)=>{j(X=>({...X,[L]:G(qe(L,X))}))},[qe]),pt=(L,G)=>{const X=L.trim(),ge=G.trim();return!X||!ge?!1:X===ge||X.startsWith(`agent:${ge}:`)},at=L=>`agent:${L}:main`,Lt=qe(r,K),hn=F.find(L=>L.id===r)?.title??"",Sn=Lt.runId,Xt=Lt.pipeline,be=Lt.workflow,ki=Lt.schedulerState,nn=Lt.pipelineItems,Vn=Lt.pipelineGroups,ai=Lt.pipelineGroupItems,nr=Lt.batchRunState,Ai=Lt.isRunning,ke=Ce===r,tt=w[r]||String(Lt.workflow?.plugins.remoteBatch.startBatch||1),Ct=C.useMemo(()=>be?$i(be):[],[be]),Rn=C.useMemo(()=>Ct.map(L=>({id:L.id,members:L.members})),[Ct]),He=C.useMemo(()=>m?void 0:Xt.find(L=>L.id===d),[d,m,Xt]),Dn=C.useMemo(()=>d&&!m?be?.nodes.find(L=>L.id===d)??null:null,[be,d,m]),ct=C.useMemo(()=>{if(!be||!m)return null;const L=Ct.find(ne=>ne.id===m)??null;if(!L)return null;const G=Vn.find(ne=>ne.id===m)??null,X=L.members.map(ne=>Xt.find(Ee=>Ee.id===ne)).filter(ne=>!!ne),ge=ai.filter(ne=>ne.groupId===m);return{id:L.id,members:L.members,upstreams:SO(be,L.id,L.members),joinPolicy:L.joinPolicy,status:G?.status??"blocked",artifacts:G?.artifacts??[],startedAt:G?.startedAt??null,finishedAt:G?.finishedAt??null,lastError:G?.lastError??null,memberRuns:X,itemRuns:ge}},[be,m,Ct,Vn,ai,Xt]),cn=C.useMemo(()=>{if(!be||nn.length===0)return nn;const L=new Map;return nn.filter(G=>{const X=OO(G.itemKey);if(!X)return!0;const ge=`${X.splitNodeId}:${X.route}`;let ne=L.get(ge);return ne||(ne=_O(be,X.splitNodeId,X.route),L.set(ge,ne)),ne.has(G.nodeId)})},[be,nn]),Nn=C.useMemo(()=>!be||!d?{}:be.edges.filter(L=>L.from===d&&L.when).reduce((L,G)=>(G.when&&(L[G.when]=G.to),L),{}),[be,d]),{draftTitle:Zt,setDraftTitle:xt,draftAgentId:lt,setDraftAgentId:At,draftExecutorSessionId:zt,setDraftExecutorSessionId:wn,draftInstruction:ir,setDraftInstruction:Bc,draftDependsOn:ya,setDraftDependsOn:ar,draftAllowReject:Pi,setDraftAllowReject:va,draftMaxRejectCount:ri,setDraftMaxRejectCount:rr,draftWorkflowLane:bi,setDraftWorkflowLane:an,draftWorkflowRouteAllowed:qr,setDraftWorkflowRouteAllowed:No,draftWorkflowRouteTargets:yi,setDraftWorkflowRouteTarget:Sa,draftGroupId:Vl,setDraftGroupId:wo,draftGroupMembers:Gr,setDraftGroupMembers:Rc,draftGroupUpstreams:Na,setDraftGroupUpstreams:Vr,draftGroupJoinPolicy:Kn,setDraftGroupJoinPolicy:Ln,workflowJsonDraft:lr,setWorkflowJsonDraft:Lc,draftCreateKind:Kl,setDraftCreateKind:Yl,draftNewNodeId:sr,setDraftNewNodeId:Co,draftNewNodeTitle:On,setDraftNewNodeTitle:Kr,draftNewNodeAgentId:Ql,setDraftNewNodeAgentId:qi,draftNewNodeInstruction:Gi,setDraftNewNodeInstruction:Jl,draftNewNodeDependsOn:Xl,setDraftNewNodeDependsOn:Vi,draftNewGroupId:Eo,setDraftNewGroupId:Zl,draftNewGroupMembers:or,setDraftNewGroupMembers:Yr,draftNewGroupUpstreams:ko,setDraftNewGroupUpstreams:Ao,draftNewGroupJoinPolicy:ur,setDraftNewGroupJoinPolicy:li,hasNodeDraftChanges:Qr,hasWorkflowDraftChanges:Jr}=AO({selectedNode:He,selectedWorkflowNode:Dn,selectedGroup:ct,selectedRouteTargets:Nn,workflow:be,isSessionForAgent:pt}),Ut=C.useMemo(()=>NO(be,Xt),[be,Xt]),wa=C.useMemo(()=>{if(!He||!be)return[];const L=Kb(be,He.id),G=Ut.findIndex(ne=>ne.id===He.id),X=G<=0?[]:Ut.slice(0,G).filter(ne=>!L.has(ne.id)).map(ne=>({id:ne.id,title:ne.title})),ge=Ct.filter(ne=>!L.has(ne.id)).map(ne=>({id:ne.id,title:`${e("modal:fieldLabel.group")} ${ne.id}`}));return[...X,...ge]},[He?.id,Ut,be,Ct]),Mo=C.useMemo(()=>{const L=new Set(ct?.members??[]);return[...Ut.filter(G=>!L.has(G.id)).map(G=>({id:G.id,title:G.title})),...Ct.filter(G=>G.id!==ct?.id&&!G.members.some(X=>L.has(X))).map(G=>({id:G.id,title:`${e("modal:fieldLabel.group")} ${G.id}`}))]},[ct?.members,ct?.id,Ut,Ct]),Wl=C.useMemo(()=>{const L=new Set(or);return[...Ut.filter(G=>!L.has(G.id)).map(G=>({id:G.id,title:G.title})),...Ct.filter(G=>!G.members.some(X=>L.has(X))).map(G=>({id:G.id,title:`${e("modal:fieldLabel.group")} ${G.id}`}))]},[Ut,or,Ct]),jo=C.useMemo(()=>Ut.map(L=>({id:L.id,title:L.title})),[Ut]),cr=C.useMemo(()=>{if(!be||!d)return[];const L=$i(be),G=Ut.filter(ge=>ge.id===d?!1:be.nodes.find(Ee=>Ee.id===ge.id)?.lane==="branch"),X=[];for(const ge of L){const ne=new Set(G.map(Ee=>Ee.id));ge.members.some(Ee=>ne.has(Ee))&&X.push({id:ge.id,title:`${e("pipeline:branchNodes")} | ${ge.id} | ${ge.members.join(", ")}`})}for(const ge of G)X.push({id:ge.id,title:`${e("pipeline:branchNodes")} | ${ge.title} | agent:${ge.executor.agentId}`});return X},[Ut,d,be]),si=C.useMemo(()=>[...Ut.map(L=>({id:L.id,title:L.title})),...Ct.map(L=>({id:L.id,title:`${e("modal:fieldLabel.group")} ${L.id}`}))],[Ut,Ct]),es=si,fr=C.useMemo(()=>{const L=lt.trim();if(!L)return[];const G=ee.filter(ne=>pt(ne.id,L)),X=at(L);G.some(ne=>ne.id===X)||G.unshift({id:X,title:X});const ge=new Set;return G.filter(ne=>!ne.id||ge.has(ne.id)?!1:(ge.add(ne.id),!0))},[ee,lt]),Mi=C.useMemo(()=>{const L=lt.trim(),G=zt.trim();return L?G||at(L):G},[lt,zt]),ts=C.useCallback(L=>{const G=L.trim();At(G),wn(X=>{const ge=X.trim();return!G||!ge?"":pt(ge,G)?ge:""})},[At,wn]),ji=C.useMemo(()=>{if(!c)return ee;const L=ee.filter(G=>pt(G.id,c));return L.length>0?L:[{id:`agent:${c}:main`,title:`agent:${c}:main`}]},[ee,c]),To=C.useMemo(()=>EO(T,Xt,P,xe),[T,Xt,P,xe]),Xr=C.useMemo(()=>Yb(Xt,Ai),[Ai,Xt]),dr=C.useCallback(L=>qe(L,K).workflow?.plugins.remoteBatch??Qb.remoteBatch,[qe,K]),Zr=C.useCallback(L=>qe(L,K).workflow?.plugins??Qb,[qe,K]),Cn=C.useCallback(L=>Zr(L).scheduler,[Zr]),Ti=C.useCallback(async()=>{const L=performance.now(),[G,X,ge]=await Promise.allSettled([ub(),cb(),fb()]),ne=G.status==="fulfilled"&&G.value.length>0?G.value:je.current,Ee=ne.map(Ne=>Ne.id),nt=await Promise.allSettled(Ee.map(Ne=>MT(Ne)));U(Math.round(performance.now()-L)),G.status==="fulfilled"&&I(ne),X.status==="fulfilled"&&(Q(X.value),qi(Ne=>Ne||X.value[0]?.id||"operator-main")),ge.status==="fulfilled"&&R(ge.value),j(Ne=>{const it={};for(let De=0;De<Ee.length;De+=1){const yt=Ee[De],Qe=nt[De],ve=qe(yt,Ne),Wt=Qe?.status==="fulfilled"?Qe.value:ve.workflow;it[yt]={...ve,workflow:Wt}}return it}),he(Ne=>{const it={};for(let De=0;De<Ee.length;De+=1){const yt=nt[De],Qe=Ee[De],ve=Ne[Qe]?.trim();it[Qe]=ve||(yt?.status==="fulfilled"&&yt.value?String(yt.value.plugins.remoteBatch.startBatch||1):"")}return it}),ne.length>0?(s(Ne=>ne.some(it=>it.id===Ne)?Ne:ne[0].id),Se(Ne=>Ne&&ne.some(it=>it.id===Ne)?Ne:null)):(s(""),Se(null),g(""),y("")),[G,X,ge,...nt].some(Ne=>Ne.status==="rejected")&&H(Ne=>Ne||e("actionMessage.partialLoadFailed"))},[qe,qi]),bt=C.useCallback(async()=>{const[L,G,X]=await Promise.allSettled([ub(),cb(),fb()]),ge=L.status==="fulfilled"&&L.value.length>0?L.value:je.current;L.status==="fulfilled"&&I(ge),G.status==="fulfilled"&&(Q(G.value),qi(ne=>ne||G.value[0]?.id||"operator-main")),X.status==="fulfilled"&&R(X.value),ge.length>0?(s(ne=>ge.some(Ee=>Ee.id===ne)?ne:ge[0].id),Se(ne=>ne&&ge.some(Ee=>Ee.id===ne)?ne:null)):(s(""),Se(null),g(""),y(""))},[qi]);C.useEffect(()=>{Ti()},[Ti]),C.useEffect(()=>{if(F.length===0){r&&s(""),Ce&&Se(null),d&&g(""),m&&y("");return}F.some(L=>L.id===r)||(s(F[0].id),g(""),y("")),Ce&&!F.some(L=>L.id===Ce)&&Se(null)},[r,Ce,F,m,d]),C.useEffect(()=>{const L=jv(G=>{kv(G,{bootstrap:X=>{if(X){if(X.status&&N(X.status),X.pipelines){const ge=Object.entries(X.pipelines);I(ge.map(([ne,Ee])=>({id:ne,title:Ee.title}))),j(ne=>{const Ee={};for(const[nt,Ne]of ge){const it=Ne.run,De=qe(nt,ne);Ee[nt]={...De,runId:Ne.runId??it?.id??De.runId,pipeline:Ne.pipeline??it?.nodes??De.pipeline,pipelineGroups:Array.isArray(it?.groups)?it.groups:De.pipelineGroups,pipelineGroupItems:Array.isArray(it?.groupItemRuns)?it.groupItemRuns:De.pipelineGroupItems,schedulerState:Ne.scheduler??De.schedulerState,pipelineItems:Array.isArray(it?.itemRuns)?it.itemRuns:De.pipelineItems,batchRunState:Ne.batchRunState!==void 0?Ne.batchRunState:De.batchRunState}}return Ee})}else{const ge=je.current[0]?.id??Re.current??"A";X.run&&Fe(ge,ne=>({...ne,runId:X.run?.id??ne.runId,pipeline:X.run?.nodes??ne.pipeline,pipelineGroups:Array.isArray(X.run?.groups)?X.run.groups:ne.pipelineGroups,pipelineGroupItems:Array.isArray(X.run?.groupItemRuns)?X.run.groupItemRuns:ne.pipelineGroupItems})),X.pipeline&&Fe(ge,ne=>({...ne,pipeline:X.pipeline??ne.pipeline})),X.runId&&Fe(ge,ne=>({...ne,runId:X.runId??ne.runId})),X.scheduler&&Fe(ge,ne=>({...ne,schedulerState:X.scheduler??ne.schedulerState}))}X.timeline&&q(X.timeline),D(X.hello?.server?.version??"-")}},gatewayStatus:X=>{X&&N(X)},gatewayReady:X=>{D(X?.server?.version??"-")},gatewayFrame:X=>{if(!X||X.type!=="event"||X.event!=="agent")return;const ge=X.payload;if(!ge)return;const ne=typeof ge.sessionKey=="string"?ge.sessionKey.trim():"",Ee=typeof ge.runId=="string"?ge.runId.trim():"";if(!ne||!Ee)return;const nt=ne.match(/^agent:([^:]+):/i);if(!nt)return;const Ne=nt[1],it=typeof ge.stream=="string"?ge.stream:"",De=ge.data??{},yt=`${Ee}::${Ne}`;if(it==="assistant"){const Qe=typeof De.text=="string"?De.text:"";if(!Qe)return;me.current.set(yt,Qe);return}if(it==="lifecycle"){const Qe=typeof De.phase=="string"?De.phase:"";if(Qe==="start"){me.current.delete(yt);return}if(Qe==="end"){const ve=me.current.get(yt)??"";if(!ve.trim())return;z(Wt=>({...Wt,[Ne]:{runId:Ee,content:ve,updatedAt:Date.now()}}))}}},pipelineUpdated:X=>{if(!X)return;const ge=X.pipelineId??je.current[0]?.id??Re.current??"A";if(X.scheduler&&Fe(ge,ne=>({...ne,schedulerState:X.scheduler??ne.schedulerState})),X.batchRunState!==void 0&&Fe(ge,ne=>({...ne,batchRunState:X.batchRunState??ne.batchRunState})),X.run){Fe(ge,ne=>({...ne,runId:X.run?.id??ne.runId,pipeline:X.run?.nodes??ne.pipeline,pipelineGroups:Array.isArray(X.run?.groups)?X.run.groups:ne.pipelineGroups,pipelineGroupItems:Array.isArray(X.run?.groupItemRuns)?X.run.groupItemRuns:ne.pipelineGroupItems,pipelineItems:Array.isArray(X.run?.itemRuns)?X.run.itemRuns:ne.pipelineItems}));return}X.runId&&Fe(ge,ne=>({...ne,runId:X.runId??ne.runId})),Array.isArray(X.nodes)&&Fe(ge,ne=>({...ne,pipeline:X.nodes??ne.pipeline}))},timelineUpdated:X=>{if(X?.item){const ge=X.item;q(ne=>{const Ee=[ge,...ne];return Ee.length>200&&(Ee.length=200),Ee})}}})});return()=>L()},[qe,Fe]);const{selectedSessionId:Ki,setSelectedSessionId:ns,sessionMessage:is,setSessionMessage:as,sendMode:hr,setSendMode:Wr,lastSendInfo:Do,ensureDefaultSession:zc,selectPreferredSessionForAgent:Ic,sendSessionMessage:$c}=mO({reload:bt}),{sessionCreatePayload:rs,setSessionCreatePayload:Hc,createSession:Uc}=pO({reload:bt}),{retryNode:Pc}=hO();C.useEffect(()=>{zc(ee)},[ee]);const qc=L=>{p(L),Ic(L,ee.filter(G=>pt(G.id,L))),f(!0)},Gc=(L,G)=>{s(L),y(""),g(G)},Oo=(L,G)=>{s(L),g(""),y(G)},_o=(L,G)=>{s(L),Se(X=>G?L:X===L?null:X)},Vc=(L,G)=>{he(X=>({...X,[L]:G}))},Kc=C.useCallback(async(L,G)=>{const X=qe(L,K).workflow;if(!X){H(e("actionMessage.pluginSaveFailedNoWorkflow"));return}const ge={...X,plugins:G,scheduler:G.scheduler.enabled?X.scheduler:{...X.scheduler,enabled:!1}};try{await wi(L,ge),Fe(L,ne=>({...ne,workflow:ge})),he(ne=>({...ne,[L]:ne[L]?.trim()?ne[L]:String(G.remoteBatch.startBatch||1)}))}catch(ne){const Ee=mn(ne);H(e("actionMessage.pluginSaveFailed",{message:Ee}))}},[qe,K]),Yc=C.useCallback(async L=>{const G=L.id.trim(),X=L.title?.trim()??"",ge=L.cloneFrom?.trim()||void 0;if(!G)return{ok:!1,message:e("actionMessage.idEmpty",{field:"pipelineId"})};Y(!0),H("");try{const Ee=(await ET({id:G,title:X||void 0,cloneFrom:ge})).item?.id??G;return await bt(),s(Ee),g(""),y(""),Se(null),H(e("actionMessage.pipelineCreated",{id:Ee})),{ok:!0,pipelineId:Ee}}catch(ne){const Ee=mn(ne);return H(e("actionMessage.createPipelineFailed",{message:Ee})),{ok:!1,message:Ee}}finally{Y(!1)}},[bt]),ls=C.useCallback(async(L,G)=>{const X=L.trim(),ge=G.trim();if(!X)return{ok:!1,message:e("actionMessage.idEmpty",{field:"pipelineId"})};if(!ge)return{ok:!1,message:e("actionMessage.pipelineTitleEmpty")};Z(!0),H("");try{return await AT(X,ge),await bt(),H(e("actionMessage.pipelineTitleUpdated",{id:X})),{ok:!0,pipelineId:X}}catch(ne){const Ee=mn(ne);return H(e("actionMessage.renamePipelineFailed",{message:Ee})),{ok:!1,message:Ee}}finally{Z(!1)}},[bt]),Qc=C.useCallback(async L=>{if(!L.trim())return{ok:!1,message:e("actionMessage.idEmpty",{field:"pipelineId"})};O(!0),H("");try{return await kT(L),Se(G=>G===L?null:G),Re.current===L&&(g(""),y("")),await bt(),H(e("actionMessage.pipelineDeleted",{id:L})),{ok:!0,pipelineId:L}}catch(G){const X=mn(G);return H(e("actionMessage.deletePipelineFailed",{message:X})),{ok:!1,message:X}}finally{O(!1)}},[bt]);C.useEffect(()=>{if(!o||!c||ji.length===0)return;ji.some(G=>G.id===Ki)||ns(ji[0].id)},[o,c,ji,Ki,ns]);const Jc=async(L=r)=>{we.current?await we.current:L===r&&He&&Qr&&await Yi({silentSuccess:!0}),s(L),Fe(L,G=>({...G,isRunning:!0})),H("");try{const G=await _T(L);G.run&&Fe(L,X=>({...X,runId:G.run?.id??X.runId,pipeline:G.run?.nodes??X.pipeline})),await bt()}catch(G){const X=mn(G);H(e("actionMessage.runStartFailed",{message:X}))}finally{Fe(L,G=>({...G,isRunning:!1}))}},Xc=async(L,G=r)=>{await jT(G,L),await bt()},Fo=async(L,G=r)=>{await TT(G,L),await bt()},Zc=async(L=r)=>{await DT(L),await bt()},Wc=async(L=r)=>{E(!0),H("");try{const G=dr(L),X=Math.max(1,Math.trunc(Number(w[L]||String(G.startBatch||1))||G.startBatch||1)),ge=G.url.trim(),ne=await BT(L,{batchSize:G.batchSize,startBatch:X,url:ge||void 0});ne.state&&Fe(L,Ee=>({...Ee,batchRunState:ne.state??Ee.batchRunState})),H(e("actionMessage.remoteBatchStarted",{startBatch:X,totalItems:ne.totalFetched??ne.state?.totalItems??0,batchSize:ne.state?.batchSize??5})),await bt()}catch(G){const X=mn(G);H(e("actionMessage.remoteBatchStartFailed",{message:X}))}finally{E(!1)}},ef=async(L=r)=>{E(!0);try{const G=await RT(L);G.state&&Fe(L,X=>({...X,batchRunState:G.state??X.batchRunState})),H(e("actionMessage.batchStopRequested")),await bt()}catch(G){const X=mn(G);H(e("actionMessage.batchStopFailed",{message:X}))}finally{E(!1)}},tf=async(L=r)=>{E(!0),H("");try{const G=await FT(L);G.status?.batchRun&&Fe(L,X=>({...X,batchRunState:G.status?.batchRun??X.batchRunState})),Fe(L,X=>({...X,isRunning:!1})),H(G.mode==="remote_batch"?e("actionMessage.batchStopNodeRequested"):e("actionMessage.pipelineStopRequested")),await bt()}catch(G){const X=mn(G);H(e("actionMessage.stopPipelineFailed",{message:X}))}finally{E(!1)}},Bo=({includeNodeConfig:L,includeWorkflowConfig:G})=>{if(!be||!He)return{ok:!1,error:e("actionMessage.nodeSaveFailedNoWorkflow")};if(!be.nodes.find(rt=>rt.id===He.id))return{ok:!1,error:e("actionMessage.nodeSaveFailedNodeNotFound",{nodeId:He.id})};const ge=Zt.trim(),ne=lt.trim(),Ee=zt.trim(),nt=Ee&&pt(Ee,ne)?Ee:at(ne),Ne=Array.from(new Set(ya.map(rt=>rt.trim()).filter(Boolean))),it=Math.max(0,Math.min(10,Math.trunc(Number(ri)||0))),De=Array.from(new Set(qr.split(",").map(rt=>rt.trim()).filter(Boolean))),yt=TO(De);if(L){if(!ge||!ne)return{ok:!1,error:e("actionMessage.nodeSaveFailedEmptyFields")};const rt=new Set([...be.nodes.map(Di=>Di.id),...$i(be).map(Di=>Di.id)]),fn=Ne.find(Di=>!rt.has(Di)||Di===He.id);if(fn)return{ok:!1,error:e("actionMessage.nodeSaveFailedInvalidDep",{depId:fn})};const _n=Kb(be,He.id),mr=Ne.find(Di=>_n.has(Di));if(mr)return{ok:!1,error:e("actionMessage.nodeSaveFailedParallelGroupDep",{depId:mr})}}if(G&&yt.length>5)return{ok:!1,error:e("actionMessage.routeSaveFailedMaxAllowed")};const Qe=yt.reduce((rt,fn)=>{if(fn===xc)return rt;const _n=(yi[fn]??"").trim();return _n&&(rt[fn]=_n),rt},{});if(G){const rt=new Set([...be.nodes.map(_n=>_n.id),...$l(be,be.nodes,be.edges,be.groups).map(_n=>_n.id)]),fn=Object.entries(Qe).find(([_n,mr])=>!yt.includes(_n)||!rt.has(mr)||mr===He.id||_n===xc);if(fn)return{ok:!1,error:e("actionMessage.routeSaveFailedInvalidTarget",{route:fn[0],targetId:fn[1]})}}const ve=be.nodes.map(rt=>rt.id!==He.id?rt:(()=>{const fn=rt.executor??He.executor,_n=(fn.agentId??"").trim()!==ne;return{...rt,name:L?ge:rt.name,instruction:L?ir.trim():rt.instruction,allowReject:L?Pi:rt.allowReject,maxRejectCount:L?it:rt.maxRejectCount,executor:L?{...fn,agentId:ne,sessionId:nt,fallbackAgentId:_n?null:fn.fallbackAgentId}:fn,lane:G?bi:rt.lane,isMainline:G?bi!=="branch":rt.isMainline,routePolicy:G?yt.length>=2?{allowed:yt}:null:rt.routePolicy}})());let Wt=[...be.edges];return L&&(Wt=eo([...Wt.filter(rt=>!(rt.to===He.id&&rt.when===null)),...Ne.map(rt=>({from:rt,to:He.id,when:null}))])),G&&(Wt=Wt.filter(rt=>!(rt.from===He.id&&rt.when!==null)),Wt=eo([...Wt,...Object.entries(Qe).map(([rt,fn])=>({from:He.id,to:fn,when:rt}))])),{ok:!0,workflow:{...be,nodes:ve,edges:Wt,groups:$l(be,ve,Wt,be.groups)}}},ss=C.useCallback(async L=>{if(!(!be||!He)){Ot(!0),L?.silentSuccess||H("");try{const G=Bo({includeNodeConfig:!1,includeWorkflowConfig:!0});if(!G.ok){H(G.error);return}const X=Rl(G.workflow);if(!X.ok){H(e("validation.workflowConfigSaveFailed",{message:X.message}));return}await wi(r,G.workflow),Fe(r,ge=>({...ge,workflow:G.workflow})),await bt(),L?.silentSuccess||H(e("actionMessage.nodeWorkflowSaved",{nodeId:He.id}))}catch(G){const X=mn(G);H(e("validation.workflowConfigSaveFailed",{message:X}))}finally{Ot(!1)}}},[be,He,Zt,lt,zt,ya,ir,Pi,ri,bi,qr,yi,pt]);C.useEffect(()=>{if(!He||!Jr||Ke)return;const L=setTimeout(()=>{ss({silentSuccess:!0})},250);return()=>clearTimeout(L)},[He?.id,Jr,Ke,ss]);const nf=C.useCallback(async()=>{if(!be||!ct)return;const L=Vl.trim(),G=Array.from(new Set(Gr.map(De=>De.trim()).filter(Boolean)));if(!L){H(e("actionMessage.groupSaveFailedEmptyId"));return}if(G.length<2){H(e("actionMessage.groupSaveFailedMinMembers"));return}const X=new Set(be.nodes.map(De=>De.id)),ge=G.find(De=>!X.has(De));if(ge){H(e("actionMessage.groupSaveFailedInvalidMember",{memberId:ge}));return}const ne=Array.from(new Set(Na.map(De=>De.trim()).filter(Boolean))),Ee=new Set([...be.nodes.map(De=>De.id),...$i(be).map(De=>De.id)]),nt=ne.find(De=>!Ee.has(De)||G.includes(De)||De===L);if(nt){H(e("actionMessage.groupSaveFailedInvalidUpstream",{upstreamId:nt}));return}const Ne=vO({workflow:be,previousGroupId:ct.id,nextGroupId:L,memberIds:G,upstreamIds:ne,joinPolicy:Kn}),it=Rl(Ne);if(!it.ok){H(e("actionMessage.groupSaveFailed",{message:it.message}));return}Me(!0);try{await wi(r,Ne),Fe(r,De=>({...De,workflow:Ne})),y(L),H(e("actionMessage.groupSaved",{groupId:L})),await bt()}catch(De){const yt=mn(De);H(e("actionMessage.groupSaveFailed",{message:yt}))}finally{Me(!1)}},[be,ct,Vl,Gr,Na,Kn,bt]),Ro=C.useCallback(async(L,G,X)=>{if(Ae)return;const ge=qe(L,K).workflow;if(!ge)return;const ne=yO(ge,G,X);if(ne!==ge){Nt(!0),H("");try{await wi(L,ne),Fe(L,Ee=>({...Ee,workflow:ne})),s(L),g(G),H(X==="up"?e("actionMessage.nodeMovedUp",{nodeId:G}):e("actionMessage.nodeMovedDown",{nodeId:G})),await bt()}catch(Ee){const nt=mn(Ee);H(e("actionMessage.nodeMoveFailed",{message:nt}))}finally{Nt(!1)}}},[qe,Ae,K,bt,Fe]),af=C.useCallback(async(L,G,X,ge="before")=>{if(Ae)return;const ne=qe(L,K).workflow;if(!ne)return;const Ee=Hv(ne,G,X,ge);if(Ee!==ne){Nt(!0),H("");try{await wi(L,Ee),Fe(L,nt=>({...nt,workflow:Ee})),s(L),g(G),H(ge==="after"?e("actionMessage.nodeReorderedAfter",{nodeId:G,targetNodeId:X}):e("actionMessage.nodeReorderedBefore",{nodeId:G,targetNodeId:X})),await bt()}catch(nt){const Ne=mn(nt);H(e("actionMessage.nodeReorderFailed",{message:Ne}))}finally{Nt(!1)}}},[qe,Ae,K,bt,Fe]),os=C.useCallback(async()=>{if(!lr.trim()){H(e("actionMessage.workflowJsonEmpty"));return}let L;try{L=JSON.parse(lr)}catch(G){H(e("actionMessage.workflowJsonInvalid",{error:String(G)}));return}et(!0);try{const G=Rl(L);if(!G.ok){H(e("actionMessage.workflowJsonSaveFailed",{message:G.message}));return}await wi(r,L),Fe(r,X=>({...X,workflow:L})),await bt(),H(e("actionMessage.workflowJsonSaved"))}catch(G){const X=mn(G);H(e("actionMessage.workflowJsonSaveFailed",{message:X}))}finally{et(!1)}},[lr]),Yi=C.useCallback(async L=>{if(!(!He||!be)){Nt(!0),L?.silentSuccess||H("");try{const G=Bo({includeNodeConfig:!0,includeWorkflowConfig:!1});if(!G.ok){H(G.error);return}const X=Rl(G.workflow);if(!X.ok){H(e("validation.nodeConfigSaveFailed",{message:X.message}));return}await wi(r,G.workflow),Fe(r,ge=>({...ge,workflow:G.workflow,pipeline:ge.pipeline.map(ne=>ne.id===He.id?(()=>{const Ee=Zt.trim(),nt=lt.trim(),Ne=zt.trim(),it=Ne&&pt(Ne,nt)?Ne:at(nt),De=Array.from(new Set(ya.map(ve=>ve.trim()).filter(Boolean))),yt=Math.max(0,Math.min(10,Math.trunc(Number(ri)||0))),Qe=(ne.executor.agentId??"").trim()!==nt;return{...ne,title:Ee,instruction:ir.trim(),dependsOn:De,allowReject:Pi,maxRejectCount:yt,executor:{...ne.executor,agentId:nt,sessionId:it,fallbackAgentId:Qe?null:ne.executor.fallbackAgentId}}})():ne)})),L?.silentSuccess||H(e("actionMessage.nodeSaved",{nodeId:He.id})),await bt()}catch(G){const X=mn(G);H(e("actionMessage.nodeSaveFailed",{message:X}))}finally{Nt(!1)}}},[be,He,Zt,lt,zt,ya,ir,Pi,ri,pt]);return{active:i,setActive:a,sessionModalOpen:o,setSessionModalOpen:f,selectedAgentId:c,gateway:v,pipelineList:F,activePipelineId:r,activePipelineTitle:hn,setActivePipelineId:s,pipelineStateById:K,runId:Sn,latencyMs:k,agents:T,sessions:ee,filteredSessionsForSelectedAgent:ji,selectedSessionId:Ki,setSelectedSessionId:ns,sessionMessage:is,setSessionMessage:as,sendMode:hr,setSendMode:Wr,lastSendInfo:Do,sessionCreatePayload:rs,setSessionCreatePayload:Hc,pipeline:Xt,workflow:be,parallelGroups:Rn,getParallelGroupsForPipeline:L=>{const G=qe(L,K).workflow;return G?$i(G).map(X=>({id:X.id,members:X.members})):[]},schedulerState:ki,batchRunState:nr,batchStartBatch:tt,batchStartBatchById:w,agentCards:To,selectedNode:He,selectedGroup:ct,selectedWorkflowNode:Dn,dependencyOptions:wa,groupMemberOptions:jo,groupUpstreamOptions:Mo,routeTargetOptions:cr,newNodeDependencyOptions:si,setSelectedNodeId:g,setSelectedGroupId:y,selectNodeInPipeline:Gc,selectGroupInPipeline:Oo,timeline:P,pipelineItems:cn,createSession:Uc,sendSessionMessage:$c,retryNode:()=>Pc(r,He?.id),openSessionModalForAgent:qc,serverVersion:M,actionMessage:W,isCreatingPipeline:_,isDeletingPipeline:oe,isRenamingPipeline:B,isRunning:Ai,startPipelineRun:Jc,stopPipelineRun:tf,createPipeline:Yc,renamePipeline:ls,deletePipeline:Qc,getHasPipelineExecutionForPipeline:L=>Yb(qe(L,K).pipeline,qe(L,K).isRunning),isBatchOperating:ae,getPipelineRemoteBatchPlugin:dr,getPipelinePlugins:Zr,getPipelineSchedulerPlugin:Cn,savePipelinePlugins:Kc,setBatchStartBatch:Vc,startRemoteKeywordBatchRun:Wc,stopKeywordBatchRun:ef,toggleScheduler:Xc,switchSchedulerMode:Fo,manualTick:Zc,workflowJsonDraft:lr,setWorkflowJsonDraft:Lc,isSavingWorkflowJson:Xe,saveWorkflowJsonDraft:os,hasPipelineExecution:Xr,isPipelineEditing:ke,getIsPipelineEditing:L=>Ce===L,setIsPipelineEditing:L=>_o(r,L),setPipelineEditing:_o,isCreateNodeModalOpen:ze,setIsCreateNodeModalOpen:Ve,deleteTargetNodeId:Ue,setDeleteTargetNodeId:Dt,deleteTargetGroupId:Ht,setDeleteTargetGroupId:Jt,agentOutputModalAgentId:Rt,setAgentOutputModalAgentId:de,draftTitle:Zt,setDraftTitle:xt,draftAgentId:lt,setDraftAgentId:ts,draftExecutorSessionId:Mi,setDraftExecutorSessionId:wn,nodeSessionOptions:fr,draftInstruction:ir,setDraftInstruction:Bc,draftDependsOn:ya,setDraftDependsOn:ar,draftAllowReject:Pi,setDraftAllowReject:va,draftMaxRejectCount:ri,setDraftMaxRejectCount:rr,draftWorkflowLane:bi,setDraftWorkflowLane:an,draftWorkflowRouteAllowed:qr,setDraftWorkflowRouteAllowed:No,draftWorkflowRouteTargets:yi,setDraftWorkflowRouteTarget:Sa,isSavingWorkflowConfig:Ke,saveSelectedWorkflowNodeConfig:ss,draftGroupId:Vl,setDraftGroupId:wo,draftGroupMembers:Gr,setDraftGroupMembers:Rc,draftGroupUpstreams:Na,setDraftGroupUpstreams:Vr,draftGroupJoinPolicy:Kn,setDraftGroupJoinPolicy:Ln,isSavingGroupConfig:pe,saveSelectedGroupConfig:nf,isSavingNodeConfig:Ae,saveSelectedNodeConfig:Yi,saveSelectedNodeConfigOnBlur:()=>{if(!He||!Qr||Ae)return;const L=Yi({silentSuccess:!0});we.current=L,L.finally(()=>{we.current===L&&(we.current=null)})},moveSelectedNodeUp:(L=He?.id??"",G=r)=>Ro(G,L,"up"),moveSelectedNodeDown:(L=He?.id??"",G=r)=>Ro(G,L,"down"),reorderNode:af,draftCreateKind:Kl,setDraftCreateKind:Yl,draftNewNodeId:sr,setDraftNewNodeId:Co,draftNewNodeTitle:On,setDraftNewNodeTitle:Kr,draftNewNodeAgentId:Ql,setDraftNewNodeAgentId:qi,draftNewNodeInstruction:Gi,setDraftNewNodeInstruction:Jl,draftNewNodeDependsOn:Xl,setDraftNewNodeDependsOn:Vi,draftNewGroupId:Eo,setDraftNewGroupId:Zl,draftNewGroupMembers:or,setDraftNewGroupMembers:Yr,draftNewGroupUpstreams:ko,setDraftNewGroupUpstreams:Ao,draftNewGroupJoinPolicy:ur,setDraftNewGroupJoinPolicy:li,newGroupMemberOptions:es,newGroupUpstreamOptions:Wl,isAddingNode:_e,addTemplateNode:async()=>{if(!be){H(e("actionMessage.nodeAddFailedNoWorkflow"));return}const L=sr.trim(),G=On.trim(),X=Ql.trim(),ge=Gi.trim();if(!L||!G||!X){H(e("actionMessage.nodeAddFailedEmptyFields"));return}if(Ut.some(Qe=>Qe.id===L)){H(e("actionMessage.nodeAddFailedDuplicateId",{nodeId:L}));return}const ne=Array.from(new Set(Xl.map(Qe=>Qe.trim()).filter(Boolean))),Ee=new Set([...Ut.map(Qe=>Qe.id),...Ct.map(Qe=>Qe.id),L]),nt=ne.find(Qe=>!Ee.has(Qe)||Qe===L);if(nt){H(e("actionMessage.nodeAddFailedInvalidDep",{depId:nt}));return}const Ne=He?.outputSpec??{type:"generic.v1",schemaVersion:1},it={id:L,name:G,type:"task",enabled:!0,isMainline:!0,lane:"main",parallelGroupId:null,inputMode:"single",outputMode:"single",routePolicy:null,retryPolicy:{maxAttempts:2,backoffMs:0},executor:{agentId:X,role:"operator",fallbackAgentId:null,sessionId:at(X)},instruction:ge,outputSpec:{type:Ne.type,schemaVersion:Ne.schemaVersion},allowReject:!1,maxRejectCount:3},De={...be,nodes:wO(be,it,ne),edges:eo([...be.edges,...ne.map(Qe=>({from:Qe,to:L,when:null}))])},yt=Rl(De);if(!yt.ok){H(e("actionMessage.nodeAddFailed",{message:yt.message}));return}Pe(!0),H("");try{await wi(r,De),Fe(r,Qe=>({...Qe,workflow:De})),Co(""),Kr(""),Jl(""),Vi([]),Ve(!1),H(e("actionMessage.nodeAdded",{nodeId:L})),await bt(),g(L)}catch(Qe){const ve=mn(Qe);H(e("actionMessage.nodeAddFailed",{message:ve}))}finally{Pe(!1)}},addParallelGroup:async()=>{if(!be){H(e("actionMessage.groupAddFailedNoWorkflow"));return}const L=Eo.trim();if(!L){H(e("actionMessage.groupAddFailedEmptyId"));return}if(be.groups.some(ve=>ve.id===L)){H(e("actionMessage.groupAddFailedDuplicateId",{groupId:L}));return}const G=Array.from(new Set(or.map(ve=>ve.trim()).filter(Boolean)));if(G.length<2){H(e("actionMessage.groupAddFailedMinMembers"));return}const X=new Set(be.nodes.map(ve=>ve.id)),ge=G.find(ve=>!X.has(ve));if(ge){H(e("actionMessage.groupAddFailedInvalidMember",{memberId:ge}));return}const ne=Array.from(new Set(ko.map(ve=>ve.trim()).filter(Boolean))),Ee=new Set([...be.nodes.map(ve=>ve.id),...$i(be).map(ve=>ve.id)]),nt=ne.find(ve=>!Ee.has(ve)||G.includes(ve)||ve===L);if(nt){H(e("actionMessage.groupAddFailedInvalidUpstream",{upstreamId:nt}));return}const Ne=be.nodes.map(ve=>G.includes(ve.id)?{...ve,parallelGroupId:L}:ve),it=Uv(be,L,G);let De=be.edges.filter(ve=>ve.when!==null?!0:!(ve.to===L||ve.from===L||G.includes(ve.to)||G.includes(ve.from)&&!G.includes(ve.to)));De=eo([...De,...ne.map(ve=>({from:ve,to:L,when:null})),...it.map(ve=>({from:L,to:ve,when:null}))]);const yt={...be,nodes:Ne,edges:De,groups:$l(be,Ne,De,[...be.groups,{id:L,type:"parallel",members:G,joinPolicy:ur}])},Qe=Rl(yt);if(!Qe.ok){H(e("actionMessage.groupAddFailed",{message:Qe.message}));return}Pe(!0),H("");try{await wi(r,yt),Fe(r,ve=>({...ve,workflow:yt})),Zl(""),Yr([]),Ao([]),li("all"),Yl("node"),Ve(!1),g(""),y(L),H(e("actionMessage.groupAdded",{groupId:L})),await bt()}catch(ve){const Wt=mn(ve);H(e("actionMessage.groupAddFailed",{message:Wt}))}finally{Pe(!1)}},isDeletingNode:Kt,deleteTemplateNodeById:async L=>{if(!be){H(e("actionMessage.nodeDeleteFailedNoWorkflow"));return}const G=Ut.find(ve=>ve.id===L);if(!G)return;if(Ut.length<=1){H(e("actionMessage.nodeDeleteFailedMinNodes"));return}const X=be.nodes.filter(ve=>ve.id!==L),ge=be.edges.filter(ve=>ve.to===L),ne=be.edges.filter(ve=>ve.from===L),Ee=ge.filter(ve=>ve.when===null),nt=ne.filter(ve=>ve.when===null),Ne=Ee.length===1&&nt.length===1?{from:Ee[0].from,to:nt[0].to,when:null}:null,it=new Set([...ge,...ne].map(ve=>`${ve.from}|${ve.when??""}|${ve.to}`)),De=Ne?[...be.edges.filter(ve=>!it.has(`${ve.from}|${ve.when??""}|${ve.to}`)),Ne]:be.edges.filter(ve=>ve.from!==L&&ve.to!==L),yt=be.groups.map(ve=>({...ve,members:ve.members.filter(Wt=>Wt!==L)})).filter(ve=>ve.members.length>=2),Qe={...be,nodes:X,edges:De,groups:yt};le(!0),H("");try{await wi(r,Qe),Fe(r,ve=>({...ve,workflow:Qe})),Dt(""),H(e("actionMessage.nodeDeleted",{nodeId:G.id})),await bt(),g(ve=>ve===L?"":ve)}catch(ve){const Wt=mn(ve);H(e("actionMessage.nodeDeleteFailed",{message:Wt}))}finally{le(!1)}},deleteParallelGroupById:async L=>{if(!be){H(e("actionMessage.groupDeleteFailedNoWorkflow"));return}const G=$l(be,be.nodes,be.edges,be.groups).find(Ne=>Ne.id===L);if(!G){H(e("actionMessage.groupDeleteFailedNotFound",{groupId:L}));return}const X=new Set(G.members),ge=be.nodes.map(Ne=>X.has(Ne.id)?{...Ne,parallelGroupId:null}:Ne),ne=be.edges.filter(Ne=>Ne.when!==null?Ne.from!==L&&Ne.to!==L:!(Ne.from===L||Ne.to===L)),Ee=be.groups.filter(Ne=>Ne.id!==L),nt={...be,nodes:ge,edges:ne,groups:$l(be,ge,ne,Ee)};le(!0),H("");try{await wi(r,nt),Fe(r,Ne=>({...Ne,workflow:nt})),Jt(""),y(Ne=>Ne===L?"":Ne),H(e("actionMessage.groupDeleted",{groupId:L})),await bt()}catch(Ne){const it=mn(Ne);H(e("actionMessage.groupDeleteFailed",{message:it}))}finally{le(!1)}}}}const Ll=`${Ec} w-[min(560px,94vw)]`,BO=`${Ec} grid max-h-[90vh] w-[min(980px,96vw)] grid-rows-[auto_auto_minmax(0,1fr)] gap-[10px] max-[760px]:h-screen max-[760px]:max-h-screen max-[760px]:w-screen`,RO=`${Ec} max-h-[90vh] w-[min(1100px,96vw)] max-[760px]:h-screen max-[760px]:max-h-screen max-[760px]:w-screen`,Yh="font-[JetBrains_Mono,monospace]",kn="mx-3 min-w-0",An="mb-1.5 block text-xs text-[var(--muted)]",Br="mt-0 cursor-pointer border border-[var(--live-25)] bg-transparent px-[10px] py-2 font-semibold text-[var(--live)] hover:bg-[rgba(50,215,186,0.1)]",Jb="mt-0 inline-flex h-8 items-center justify-center cursor-pointer border border-[var(--live-25)] bg-[rgba(12,21,27,0.96)] px-[10px] text-[13px] font-semibold text-[var(--live)] hover:bg-[rgba(18,31,38,0.98)]",Qh={ready:"muted",success:"good",running:"live",blocked:"warn",waiting:"warn",rejected:"warn",skipped:"muted",stopped:"muted",queued:"muted",failed:"bad"},LO={ready:"ready",connecting:"connecting",ws_open:"ws_open",challenged:"challenged",connect_sent:"connect_sent",idle:"idle",failed:"failed",success:"success",running:"running",blocked:"blocked",waiting:"waiting",rejected:"rejected",skipped:"skipped",stopped:"stopped",queued:"queued"};function zl({open:e,onClose:i,panelClassName:a,ariaLabel:r,children:s}){const o=C.useRef(null),f=C.useRef(i);f.current=i;const c=C.useCallback(p=>{p.key==="Escape"&&f.current()},[]);return C.useEffect(()=>{if(!e)return;document.addEventListener("keydown",c);const p=document.body.style.overflow;return document.body.style.overflow="hidden",o.current?.focus(),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=p}},[e,c]),e?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:`${ao} ${ro}`,onClick:i,"aria-hidden":!0}),x.jsx("aside",{className:`${lo} ${so}`,"aria-hidden":!0,onClick:i,children:x.jsx("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,className:`${a} outline-none`,onClick:p=>p.stopPropagation(),children:s})})]}):null}function Rr({pageRoute:e="home",initialActive:i="overview",onNavigateByNav:a,onNavigateHome:r,focusPipelineId:s}){const{t:o}=Gt(["modal","common","nav","pipeline"]),f=C.useMemo(()=>Object.fromEntries(Object.entries(LO).map(([z,me])=>[z,o(`common:status.${me}`)])),[o]),c=FO(),p=e,d=p==="pipeline",m=o({pipeline:"nav:pipeline",logs:"nav:logs",agents:"nav:agents",artifacts:"nav:artifacts",settings:"nav:settings",overview:"nav:overview"}[p]??"nav:overview"),y=C.useCallback((z,me)=>{c.selectNodeInPipeline(z,me),me&&T(!1)},[c.selectNodeInPipeline]),v=C.useCallback((z,me)=>{c.selectGroupInPipeline(z,me),me&&T(!1)},[c.selectGroupInPipeline]),N=C.useCallback((z,me,we,qe)=>{c.selectNodeInPipeline(z,me),c.reorderNode(z,me,we,qe)},[c.selectNodeInPipeline,c.reorderNode]),M=Z4("(max-width: 767px)"),[D,k]=C.useState(!1);C.useLayoutEffect(()=>{M&&k(!0)},[M]);const[U,T]=C.useState(!0),[Q,ee]=C.useState(!1),[R,F]=C.useState(null),[I,K]=C.useState(!1),[j,P]=C.useState(""),[q,W]=C.useState(""),[H,ae]=C.useState(!1),[E,_]=C.useState(""),[Y,oe]=C.useState(""),[O,B]=C.useState(null),[Z,w]=C.useState(""),[he,Ce]=C.useState(""),[Se,ze]=C.useState(null),[Ve,Ue]=C.useState(""),[Dt,Ht]=C.useState(!1),Jt=c.pipelineList.find(z=>z.id===O)??null,Rt=c.pipelineList.find(z=>z.id===Se)??null,de=M?"grid h-screen overflow-hidden grid-cols-[minmax(0,1fr)]":["grid h-screen overflow-hidden",D?"grid-cols-[53px_minmax(0,1fr)]":"grid-cols-[210px_minmax(0,1fr)]"].join(" "),Ke="grid min-h-0 min-w-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden",Ot=["grid h-full min-h-0 grid-rows-[minmax(0,1fr)] overflow-hidden border-b border-r border-[var(--line)]",d?U?"grid-cols-[minmax(0,1fr)_0px]":"grid-cols-[minmax(0,1fr)_300px]":"grid-cols-[minmax(0,1fr)]"].join(" "),pe=[`flex min-h-0 min-w-0 flex-col ${p==="settings"?"overflow-visible":`overflow-x-hidden ${p==="agents"||p==="pipeline"||p==="artifacts"?"overflow-y-hidden":"overflow-y-auto"}`} border-r border-[var(--line)]`,"[&>[data-center-card]]:min-h-0 [&>[data-center-card]]:min-w-0 [&>[data-center-card]]:shrink-0 [&>[data-center-card]]:border-b [&>[data-center-card]]:border-[var(--line)]","[&>[data-pipeline-card]]:shrink [&>[data-pipeline-card]]:flex-1 [&>[data-pipeline-card]]:overflow-y-auto","[&>[data-agent-card]]:shrink [&>[data-agent-card]]:flex-1 [&>[data-agent-card]]:overflow-hidden","[&>[data-center-card]:last-child]:border-b-0","[&>[data-run-log-page]]:min-h-0 [&>[data-run-log-page]]:flex-1 [&>[data-run-log-page]]:overflow-hidden [&>[data-run-log-page]]:border-b-0"].join(" "),Me=c.pipeline.find(z=>z.id===c.deleteTargetNodeId),Xe=c.parallelGroups.find(z=>z.id===c.deleteTargetGroupId),et=c.agentCards.find(z=>z.id===c.agentOutputModalAgentId),Ae=()=>{document.activeElement?.blur()},Nt=z=>{R===z&&F(null),Q&&c.activePipelineId===z&&ee(!1),O===z&&(Ce(""),B(null)),c.activePipelineId===z&&(c.setIsCreateNodeModalOpen(!1),c.setDeleteTargetNodeId(""),c.setDeleteTargetGroupId(""),T(!0))},_e=()=>{P(""),W(""),ae(!1),_(c.activePipelineId||c.pipelineList[0]?.id||""),oe("")},Pe=()=>{Ce(""),B(null),w("")},Kt=async()=>{const z=await c.createPipeline({id:j,title:q,cloneFrom:H?E:void 0});if(!z.ok){oe(z.message);return}Ae(),K(!1),_e()},le=async()=>{if(!O)return;const z=await c.renamePipeline(O,Z);if(!z.ok){Ce(z.message);return}Ae(),Pe()},xe=async z=>{const me=await c.deletePipeline(z);if(!me.ok){Ue(me.message);return}Ue(""),Nt(z),Ae(),ze(null)};return C.useEffect(()=>{c.setActive(i)},[i,c.setActive]),C.useEffect(()=>{if(!d||U)return;const z=me=>{const we=me.target;we&&(we.closest("[data-pipeline-node-id]")||we.closest("[data-pipeline-group-id]")||we.closest("[data-pipeline-detail-panel]")||T(!0))};return window.addEventListener("pointerdown",z,!0),()=>window.removeEventListener("pointerdown",z,!0)},[U,d]),C.useEffect(()=>{if(!d||!s?.trim())return;const z=s.trim();c.setActivePipelineId(z);const me=window.setTimeout(()=>{document.querySelector(`[data-pipeline-section-id="${z}"]`)?.scrollIntoView({block:"start",behavior:"smooth"})},0);return()=>window.clearTimeout(me)},[s,d,c.setActivePipelineId]),C.useEffect(()=>{const z=me=>{if(me.key==="Escape"){if(O){Ae(),Pe();return}if(Se){Ae(),Ue(""),ze(null);return}if(I){Ae(),K(!1),_e();return}if(c.agentOutputModalAgentId){Ae(),c.setAgentOutputModalAgentId("");return}if(c.deleteTargetNodeId){Ae(),c.setDeleteTargetNodeId("");return}if(c.deleteTargetGroupId){Ae(),c.setDeleteTargetGroupId("");return}if(c.isCreateNodeModalOpen){Ae(),c.setIsCreateNodeModalOpen(!1);return}if(Q){Ae(),ee(!1);return}R&&(Ae(),F(null))}};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[I,O,Se,c.agentOutputModalAgentId,c.deleteTargetNodeId,c.deleteTargetGroupId,c.isCreateNodeModalOpen,Q,R,c.setAgentOutputModalAgentId,c.setDeleteTargetNodeId,c.setDeleteTargetGroupId,c.setIsCreateNodeModalOpen]),C.useEffect(()=>{const z=new Set(c.pipelineList.map(me=>me.id));R&&!z.has(R)&&F(null),O&&!z.has(O)&&Pe(),Se&&!z.has(Se)&&(Ue(""),ze(null)),Q&&!c.activePipelineId&&ee(!1)},[Se,R,O,c.activePipelineId,c.pipelineList,Q]),x.jsxs("div",{className:de,children:[M?x.jsxs(x.Fragment,{children:[!D&&x.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:()=>k(!0),"aria-hidden":!0}),x.jsx(P1,{navItems:Vb,active:c.active,onChangeActive:z=>{c.setActive(z),a?.(z)},onNavigateHome:r,protocol:c.gateway.protocol,scopes:c.gateway.scopes,collapsed:D,variant:"overlay",onCloseDrawer:()=>k(!0)})]}):x.jsx(P1,{navItems:Vb,active:c.active,onChangeActive:z=>{c.setActive(z),a?.(z)},onNavigateHome:r,protocol:c.gateway.protocol,scopes:c.gateway.scopes,collapsed:D}),x.jsxs("div",{className:Ke,children:[x.jsx(h4,{runId:c.runId,gateway:c.gateway,latencyMs:c.latencyMs,agentCount:c.agents.length,sessionCount:c.sessions.length,statusLabel:f,navCollapsed:D,onToggleNav:()=>k(z=>!z),routeText:m}),x.jsxs("main",{className:Ot,id:"main-content",children:[x.jsx("section",{className:pe,children:p==="logs"?x.jsx(d4,{currentRunId:c.runId}):p==="pipeline"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-center-card":!0,className:"sticky top-0 z-10 shrink-0 flex h-[66px] items-center justify-start px-8 [background-color:rgba(9,15,21,0.1)] [background-image:repeating-linear-gradient(-45deg,rgba(150,170,190,0.07)_0,rgba(150,170,190,0.07)_2px,transparent_2px,transparent_8px)]",children:[x.jsxs("button",{className:Jb,type:"button",onClick:()=>{K(!0),P(""),W(""),ae(!!c.activePipelineId),_(c.activePipelineId||c.pipelineList[0]?.id||""),oe("")},disabled:c.isCreatingPipeline||c.isDeletingPipeline||c.isRenamingPipeline,children:[x.jsx(Up,{className:"mr-1.5 h-4 w-4"}),c.isCreatingPipeline?o("modal:creating"):o("modal:createPipeline")]}),x.jsx("button",{className:`${Jb} ml-2`,type:"button",onClick:()=>Ht(!0),children:o("pipeline:schedulerPanel")})]}),x.jsx(bT,{sections:c.pipelineList.map(z=>{const me=z.id,we=c.pipelineStateById[me];if(!we)return null;const je=we.workflow?c.getParallelGroupsForPipeline(me):[];return{pipelineId:me,title:z.title,canDelete:c.pipelineList.length>1,pipeline:we.pipeline,workflowNodeOrder:we.workflow?.nodes.map(Re=>Re.id)??we.pipeline.map(Re=>Re.id),parallelGroups:je,pluginState:c.getPipelineRemoteBatchPlugin(me),schedulerPluginEnabled:c.getPipelineSchedulerPlugin(me).enabled,schedulerMode:we.schedulerState?.mode??"-",schedulerEnabled:we.schedulerState?.enabled!==!1,batchStartBatch:c.batchStartBatchById[me],isBatchOperating:c.isBatchOperating,batchRunStatus:we.batchRunState?.status,batchRunProcessedItems:we.batchRunState?.processedItems,batchRunTotalItems:we.batchRunState?.totalItems,batchRunProcessedBatches:we.batchRunState?.processedBatches,batchRunTotalBatches:we.batchRunState?.totalBatches,batchRunBatchSize:we.batchRunState?.batchSize,batchRunError:we.batchRunState?.error??null,isRunning:we.isRunning,hasPipelineExecution:c.getHasPipelineExecutionForPipeline(me),isEditing:c.getIsPipelineEditing(me)}}).filter(z=>!!z),selectedNodeId:c.selectedNode?.id??"",selectedGroupId:c.selectedGroup?.id??"",activePipelineId:c.activePipelineId,onSelectNode:y,onSelectGroup:v,onRun:z=>{c.startPipelineRun(z)},onStop:z=>{c.stopPipelineRun(z)},deletingEntity:c.isDeletingNode,savingNodeOrder:c.isSavingNodeConfig,onToggleEditing:(z,me)=>c.setPipelineEditing(z,me),onOpenWorkflowJson:z=>{c.setActivePipelineId(z),ee(!0)},onOpenPlugins:z=>{c.setActivePipelineId(z),F(z)},onRenamePipeline:(z,me)=>c.renamePipeline(z,me),onRequestDeletePipeline:z=>{Ue(""),ze(z)},onRequestDeleteNode:(z,me)=>{c.setActivePipelineId(z),c.setDeleteTargetNodeId(me)},onRequestDeleteGroup:(z,me)=>{c.setActivePipelineId(z),c.setDeleteTargetGroupId(me)},onRequestCreateNode:()=>c.setIsCreateNodeModalOpen(!0),onMoveNode:(z,me,we)=>{c.selectNodeInPipeline(z,me),we==="up"?c.moveSelectedNodeUp(me,z):c.moveSelectedNodeDown(me,z)},onReorderNode:N,onChangeBatchStartBatch:(z,me)=>c.setBatchStartBatch(z,me),onStartRemoteKeywordBatchRun:z=>{c.startRemoteKeywordBatchRun(z)},onToggleScheduler:(z,me)=>{c.toggleScheduler(me,z)},onSwitchSchedulerMode:(z,me)=>{c.switchSchedulerMode(me,z)},onManualTick:z=>{c.manualTick(z)},deletingPipeline:c.isDeletingPipeline,statusTone:Qh,statusLabel:f})]}):p==="agents"?x.jsx(tw,{agents:c.agentCards,onOpenAgentSession:c.openSessionModalForAgent,onOpenAgentOutput:z=>c.setAgentOutputModalAgentId(z)}):p==="artifacts"?x.jsx(Q4,{pipelines:c.pipelineList.map(z=>({id:z.id,title:z.title})),onNavigatePipeline:z=>{c.setActivePipelineId(z),a?.("pipeline",z)}}):p==="settings"?x.jsx(X4,{}):x.jsx(C4,{pipelines:c.pipelineList.map(z=>({id:z.id,title:z.title,nodes:c.pipelineStateById[z.id]?.pipeline??[],isRunning:c.pipelineStateById[z.id]?.isRunning??!1})),onStartPipeline:async z=>{if(c.getPipelineRemoteBatchPlugin(z).enabled){await c.startRemoteKeywordBatchRun(z);return}await c.startPipelineRun(z)},onNavigatePipeline:z=>{c.setActivePipelineId(z),a?.("pipeline",z)},onOpenAgentSession:c.openSessionModalForAgent})}),p==="pipeline"&&!U&&c.selectedNode?x.jsx("div",{className:Fh,"data-pipeline-detail-panel":!0,children:x.jsx(_j,{selectedNode:c.selectedNode,selectedWorkflowNode:c.selectedWorkflowNode,agentOptions:c.agents.map(z=>z.id),dependencyOptions:c.dependencyOptions,routeTargetOptions:c.routeTargetOptions,draftTitle:c.draftTitle,draftAgentId:c.draftAgentId,draftExecutorSessionId:c.draftExecutorSessionId,draftInstruction:c.draftInstruction,draftDependsOn:c.draftDependsOn,draftAllowReject:c.draftAllowReject,draftMaxRejectCount:c.draftMaxRejectCount,draftWorkflowLane:c.draftWorkflowLane,draftWorkflowRouteAllowed:c.draftWorkflowRouteAllowed,draftWorkflowRouteTargets:c.draftWorkflowRouteTargets,isSavingWorkflowConfig:c.isSavingWorkflowConfig,savingConfig:c.isSavingNodeConfig,hasPipelineExecution:c.hasPipelineExecution,onChangeDraftTitle:c.setDraftTitle,onChangeDraftAgentId:c.setDraftAgentId,onChangeDraftExecutorSessionId:c.setDraftExecutorSessionId,onChangeDraftInstruction:c.setDraftInstruction,sessionOptions:c.nodeSessionOptions,onChangeDraftDependsOn:c.setDraftDependsOn,onChangeDraftAllowReject:c.setDraftAllowReject,onChangeDraftMaxRejectCount:c.setDraftMaxRejectCount,onChangeDraftWorkflowLane:c.setDraftWorkflowLane,onChangeDraftWorkflowRouteAllowed:c.setDraftWorkflowRouteAllowed,onChangeDraftWorkflowRouteTarget:c.setDraftWorkflowRouteTarget,onBlurSave:c.saveSelectedNodeConfigOnBlur,onRetry:c.retryNode,statusTone:Qh,statusLabel:f})}):p==="pipeline"&&!U&&c.selectedGroup?x.jsx("div",{className:Fh,"data-pipeline-detail-panel":!0,children:x.jsx(zj,{selectedGroup:c.selectedGroup,groupMemberOptions:c.groupMemberOptions,groupUpstreamOptions:c.groupUpstreamOptions,draftGroupId:c.draftGroupId,draftGroupMembers:c.draftGroupMembers,draftGroupUpstreams:c.draftGroupUpstreams,draftGroupJoinPolicy:c.draftGroupJoinPolicy,isSaving:c.isSavingGroupConfig,onChangeDraftGroupId:c.setDraftGroupId,onChangeDraftGroupMembers:c.setDraftGroupMembers,onChangeDraftGroupUpstreams:c.setDraftGroupUpstreams,onChangeDraftGroupJoinPolicy:c.setDraftGroupJoinPolicy,onSave:c.saveSelectedGroupConfig,isDeleting:c.isDeletingNode,statusTone:Qh,statusLabel:f,onDelete:()=>c.setDeleteTargetGroupId(c.selectedGroup?.id??"")})}):U?null:x.jsx("aside",{className:Fh})]})]}),x.jsxs(zl,{open:I,onClose:()=>{Ae(),K(!1),_e()},panelClassName:Ll,ariaLabel:o("modal:createPipelineTitle"),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:o("modal:createPipeline")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),K(!1),_e()},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.pipelineId")}),x.jsx("input",{className:ap,value:j,onChange:z=>P(z.target.value),placeholder:o("modal:placeholder.pipelineId")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.pipelineTitle")}),x.jsx("input",{className:ph,value:q,onChange:z=>W(z.target.value),placeholder:o("modal:placeholder.pipelineTitle")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.createMethod")}),x.jsx(qn,{value:H?"clone":"blank",options:[{value:"blank",label:o("modal:fieldLabel.blank")},{value:"clone",label:o("modal:fieldLabel.clone")}],onChange:z=>{const me=z==="clone";ae(me),me&&!E&&_(c.activePipelineId||c.pipelineList[0]?.id||"")},triggerClassName:Mn,ariaLabel:o("modal:fieldLabel.createMethod")})]}),H?x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.cloneSource")}),x.jsx(qn,{value:E,options:c.pipelineList.map(z=>({value:z.id,label:`${z.id} | ${z.title}`})),onChange:_,triggerClassName:Mn,ariaLabel:o("modal:fieldLabel.cloneSource")})]}):null,Y?x.jsx("p",{className:`${Li} text-(--bad)`,children:Y}):null,x.jsx("div",{className:Wa,children:x.jsx("button",{className:Br,type:"button",onClick:()=>{Kt()},disabled:c.isCreatingPipeline||H&&!E,children:c.isCreatingPipeline?o("modal:creating"):o("modal:action.confirmCreate")})})]}),x.jsxs(zl,{open:!!O,onClose:()=>{Ae(),Pe()},panelClassName:Ll,ariaLabel:o("modal:renamePipeline"),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:o("modal:renamePipeline")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),Pe()},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsxs("p",{className:Li,children:[o("modal:currentPipeline")," ",x.jsx("code",{children:Jt?.id??O??"-"}),Jt?.title?` (${o("modal:currentTitle")}: ${Jt.title})`:"","."]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.newTitle")}),x.jsx("input",{className:ph,value:Z,onChange:z=>w(z.target.value),placeholder:o("modal:placeholder.newTitle")})]}),he?x.jsx("p",{className:`${Li} text-(--bad)`,children:he}):null,x.jsx("div",{className:Wa,children:x.jsx("button",{className:Br,type:"button",onClick:()=>{le()},disabled:!O||!Z.trim()||c.isRenamingPipeline,children:c.isRenamingPipeline?o("modal:saving"):o("modal:action.confirmRename")})})]}),x.jsxs(zl,{open:!!Se,onClose:()=>{Ae(),Ue(""),ze(null)},panelClassName:Ll,ariaLabel:o("modal:deletePipeline"),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:o("modal:deletePipeline")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),Ue(""),ze(null)},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsxs("p",{className:Li,children:[o("modal:deleteConfirm")," ",x.jsx("code",{children:Rt?.id??Se??"-"}),Rt?.title?` (${Rt.title})`:"",". ",o("modal:archiveNote")," ",x.jsx("code",{children:".data/pipelines/_deleted"}),"."]}),Ve?x.jsx("p",{className:`${Li} text-(--bad)`,children:Ve}):null,x.jsx("div",{className:Wa,children:x.jsx("button",{className:Br,type:"button",onClick:()=>Se&&void xe(Se),disabled:!Se||c.isDeletingPipeline,children:c.isDeletingPipeline?o("modal:deleting"):o("modal:action.confirmDeletePipeline")})})]}),x.jsx("div",{className:`${ao} ${c.isCreateNodeModalOpen?ro:Zu}`,onClick:()=>{Ae(),c.setIsCreateNodeModalOpen(!1)},"aria-hidden":!c.isCreateNodeModalOpen}),x.jsx("aside",{className:`${lo} ${c.isCreateNodeModalOpen?so:Wu}`,"aria-hidden":!c.isCreateNodeModalOpen,onClick:()=>{Ae(),c.setIsCreateNodeModalOpen(!1)},children:x.jsxs("div",{className:Ll,onClick:z=>z.stopPropagation(),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:o("modal:addObject")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),c.setIsCreateNodeModalOpen(!1)},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.createType")}),x.jsx(qn,{value:c.draftCreateKind,options:[{value:"node",label:o("modal:fieldLabel.node")},{value:"group",label:o("modal:fieldLabel.group")}],onChange:z=>c.setDraftCreateKind(z),triggerClassName:gn,ariaLabel:o("modal:fieldLabel.createType")})]}),c.draftCreateKind==="node"?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.nodeId")}),x.jsx("input",{className:ap,value:c.draftNewNodeId,onChange:z=>c.setDraftNewNodeId(z.target.value),placeholder:o("modal:placeholder.nodeId")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.nodeTitle")}),x.jsx("input",{className:ph,value:c.draftNewNodeTitle,onChange:z=>c.setDraftNewNodeTitle(z.target.value),placeholder:o("modal:placeholder.nodeTitle")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:"Agent"}),x.jsx(qn,{value:c.draftNewNodeAgentId,options:(c.agents.length?c.agents.map(z=>z.id):[c.draftNewNodeAgentId||"-"]).map(z=>({value:z,label:z})),onChange:c.setDraftNewNodeAgentId,triggerClassName:Mn,ariaLabel:"Agent"})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.nodeInstruction")}),x.jsx("textarea",{className:oc,value:c.draftNewNodeInstruction,onChange:z=>c.setDraftNewNodeInstruction(z.target.value),rows:4,placeholder:o("modal:placeholder.nodeInstruction")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.dependsOn")}),x.jsx("select",{className:gn,value:c.draftNewNodeDependsOn,onChange:z=>c.setDraftNewNodeDependsOn(Array.from(z.target.selectedOptions).map(me=>me.value).filter(Boolean)),multiple:!0,size:Math.max(3,Math.min(8,c.newNodeDependencyOptions.length||3)),children:c.newNodeDependencyOptions.map(z=>x.jsxs("option",{value:z.id,children:[z.id," - ",z.title]},z.id))}),x.jsx("small",{className:`${Yh} mt-1.5 block text-xs text-(--muted)`,children:o("modal:multiSelectHint")})]}),x.jsx("button",{className:Br,type:"button",onClick:c.addTemplateNode,disabled:c.isAddingNode,children:c.isAddingNode?o("modal:creating"):o("modal:action.confirmAdd")})]}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.groupId")}),x.jsx("input",{className:gn,value:c.draftNewGroupId,onChange:z=>c.setDraftNewGroupId(z.target.value),placeholder:o("modal:placeholder.groupId")})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.members")}),x.jsx("select",{className:gn,value:c.draftNewGroupMembers,onChange:z=>c.setDraftNewGroupMembers(Array.from(z.target.selectedOptions).map(me=>me.value).filter(Boolean)),multiple:!0,size:Math.max(3,Math.min(8,c.newGroupMemberOptions.length||3)),children:c.newGroupMemberOptions.map(z=>x.jsxs("option",{value:z.id,children:[z.id," - ",z.title]},z.id))})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.commonUpstream")}),x.jsx("select",{className:gn,value:c.draftNewGroupUpstreams,onChange:z=>c.setDraftNewGroupUpstreams(Array.from(z.target.selectedOptions).map(me=>me.value).filter(Boolean)),multiple:!0,size:Math.max(3,Math.min(8,c.newGroupUpstreamOptions.length||3)),children:c.newGroupUpstreamOptions.map(z=>x.jsxs("option",{value:z.id,children:[z.id," - ",z.title]},z.id))})]}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:fieldLabel.joinPolicy")}),x.jsx(qn,{value:c.draftNewGroupJoinPolicy,options:[{value:"all",label:"all"},{value:"any",label:"any"},{value:"quorum",label:"quorum"}],onChange:z=>c.setDraftNewGroupJoinPolicy(z),triggerClassName:gn,ariaLabel:o("modal:fieldLabel.joinPolicy")})]}),x.jsx("button",{className:Br,type:"button",onClick:c.addParallelGroup,disabled:c.isAddingNode,children:c.isAddingNode?o("modal:creating"):o("modal:action.confirmAddGroup")})]})]})}),x.jsx("div",{className:`${ao} ${c.deleteTargetNodeId||c.deleteTargetGroupId?ro:Zu}`,onClick:()=>{Ae(),c.setDeleteTargetNodeId(""),c.setDeleteTargetGroupId("")},"aria-hidden":!c.deleteTargetNodeId&&!c.deleteTargetGroupId}),x.jsx("aside",{className:`${lo} ${c.deleteTargetNodeId||c.deleteTargetGroupId?so:Wu}`,"aria-hidden":!c.deleteTargetNodeId&&!c.deleteTargetGroupId,onClick:()=>{Ae(),c.setDeleteTargetNodeId(""),c.setDeleteTargetGroupId("")},children:x.jsxs("div",{className:Ll,onClick:z=>z.stopPropagation(),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:c.deleteTargetGroupId?o("modal:deleteGroup"):o("modal:deleteNode")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),c.setDeleteTargetNodeId(""),c.setDeleteTargetGroupId("")},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),c.deleteTargetGroupId?x.jsxs("p",{className:Li,children:[o("modal:deleteGroupConfirm")," ",x.jsx("code",{children:Xe?.id??c.deleteTargetGroupId}),Xe?o("modal:deleteGroupNote",{members:Xe.members.join(", ")}):""]}):x.jsxs("p",{className:Li,children:[o("modal:deleteNodeConfirm")," ",x.jsx("code",{children:Me?.id??c.deleteTargetNodeId}),Me?` (${Me.title})`:"",o("modal:deleteNodeNote")]}),x.jsx("button",{className:Br,type:"button",onClick:()=>{c.deleteTargetGroupId?c.deleteParallelGroupById(c.deleteTargetGroupId):c.deleteTemplateNodeById(c.deleteTargetNodeId)},disabled:!c.deleteTargetNodeId&&!c.deleteTargetGroupId||c.isDeletingNode,children:c.isDeletingNode?o("modal:deleting"):o("modal:action.confirmDelete")})]})}),x.jsx("div",{className:`${ao} ${c.agentOutputModalAgentId?ro:Zu}`,onClick:()=>{Ae(),c.setAgentOutputModalAgentId("")},"aria-hidden":!c.agentOutputModalAgentId}),x.jsx("aside",{className:`${lo} ${c.agentOutputModalAgentId?so:Wu}`,"aria-hidden":!c.agentOutputModalAgentId,onClick:()=>{Ae(),c.setAgentOutputModalAgentId("")},children:x.jsxs("div",{className:BO,onClick:z=>z.stopPropagation(),children:[x.jsxs("div",{className:Ci,children:[x.jsx("h2",{children:o("modal:outputContent")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),c.setAgentOutputModalAgentId("")},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsxs("div",{className:`${Yh} flex items-center justify-between gap-3 overflow-hidden border border-(--line) bg-[rgba(15,23,29,0.6)] px-2.5 py-2 text-xs text-(--muted)`,children:[x.jsxs("span",{children:["Agent: ",et?.id??c.agentOutputModalAgentId]}),x.jsx("span",{children:et?.outputRunId??"run:unknown"})]}),x.jsx("div",{className:"min-h-26.25 max-h-[calc(90vh-160px)] overflow-auto border border-(--line) bg-[#0f171d] max-[760px]:h-full max-[760px]:min-h-0 max-[760px]:max-h-none",children:x.jsx("pre",{className:"m-0 whitespace-pre-wrap wrap-break-word p-3 font-[JetBrains_Mono,monospace] text-[13px] leading-[1.45] text-(--text)",children:et?.outputContent||o("modal:noOutput")})})]})}),x.jsx(J5,{open:c.sessionModalOpen,selectedAgentId:c.selectedAgentId,selectedSessionId:c.selectedSessionId,sessions:c.filteredSessionsForSelectedAgent,sendMode:c.sendMode,sessionMessage:c.sessionMessage,onClose:()=>{Ae(),c.setSessionModalOpen(!1)},onChangeSelectedSessionId:c.setSelectedSessionId,onChangeSendMode:c.setSendMode,onChangeMessage:c.setSessionMessage,onSendMessage:c.sendSessionMessage}),x.jsx(zl,{open:!!R,onClose:()=>{Ae(),F(null)},panelClassName:Ll,ariaLabel:o("modal:pluginConfig"),children:R?x.jsx(vT,{pipelineId:R,pluginState:c.getPipelinePlugins(R),onClose:()=>{Ae(),F(null)},onSave:z=>{c.savePipelinePlugins(R,z)}}):null}),x.jsxs(zl,{open:Q,onClose:()=>{Ae(),ee(!1)},panelClassName:RO,ariaLabel:o("modal:editWorkflowJson"),children:[x.jsxs("div",{className:Ci,children:[x.jsxs("h2",{children:["Workflow JSON (",c.activePipelineTitle||c.activePipelineId||"-",")"]}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),ee(!1)},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsx("p",{className:`${Li} ${Yh}`,children:c.workflow?`nodes=${c.workflow.nodes.length}`:"-"}),x.jsxs("div",{className:kn,children:[x.jsx("label",{className:An,children:o("modal:workflowJsonLabel")}),x.jsx("textarea",{className:oc,rows:18,value:c.workflowJsonDraft,onChange:z=>c.setWorkflowJsonDraft(z.target.value),placeholder:"workflow json"})]}),x.jsx("div",{className:Wa,children:x.jsx("button",{className:Br,type:"button",onClick:()=>{c.saveWorkflowJsonDraft()},disabled:c.isSavingWorkflowJson,children:c.isSavingWorkflowJson?o("modal:saving"):o("modal:action.saveWorkflow")})})]}),x.jsxs(zl,{open:Dt,onClose:()=>{Ae(),Ht(!1)},panelClassName:"overflow-auto border border-[var(--line)] bg-[linear-gradient(180deg,var(--panel)_0%,var(--panel-2)_100%)] p-0 max-h-[88vh] w-[min(760px,94vw)]",ariaLabel:o("modal:schedulerManagement"),children:[x.jsxs("div",{className:"flex items-center justify-between px-3 pt-3 pb-2 border-b border-[var(--line)]",children:[x.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:o("modal:schedulerManagement")}),x.jsx("button",{className:ni,type:"button",onClick:()=>{Ae(),Ht(!1)},"aria-label":o("modal:close"),children:x.jsx(Ii,{})})]}),x.jsx(QT,{pipelines:c.pipelineList.map(z=>({id:z.id,title:z.title}))})]})]})}const ho="/pipeline",bc="/logs",yc="/agents",vc="/artifacts",zr="/overview",Sc="/settings",Za="/",Jh=e=>{const i=e.trim();return!i||i==="/"?Za:i.startsWith(zr)?zr:i.startsWith(yc)?yc:i.startsWith(ho)?ho:i.startsWith(vc)?vc:i.startsWith(bc)?bc:i.startsWith(Sc)?Sc:Za};function zO(){const{t:e}=Gt("nav"),[i,a]=C.useState(()=>({path:Jh(window.location.pathname),search:window.location.search}));C.useEffect(()=>{document.documentElement.lang=Be.language==="zh"?"zh-CN":Be.language},[Be.language]),C.useEffect(()=>{const p=()=>{a({path:Jh(window.location.pathname),search:window.location.search})};return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[]);const r=C.useCallback((p,d="")=>{const g=Jh(p),m=d.startsWith("?")||!d?d:`?${d}`;window.history.pushState({},"",`${g}${m}`),a({path:g,search:m})},[]),s=i.path===ho?new URLSearchParams(i.search).get("pipeline")?.trim()??"":"",o={overview:zr,agents:yc,pipeline:ho,pipelineRuns:zr,artifacts:vc,logs:bc,settings:Sc},f=C.useCallback((p,d)=>{const g=o[p]??zr,m=p==="pipeline"&&d?.trim()?`pipeline=${encodeURIComponent(d.trim())}`:"";r(g,m)},[r]);let c;return i.path===ho?c=x.jsx(Rr,{pageRoute:"pipeline",initialActive:"pipeline",onNavigateByNav:f,onNavigateHome:()=>r(Za),focusPipelineId:s||void 0}):i.path===bc?c=x.jsx(Rr,{pageRoute:"logs",initialActive:"logs",onNavigateByNav:f,onNavigateHome:()=>r(Za)}):i.path===yc?c=x.jsx(Rr,{pageRoute:"agents",initialActive:"agents",onNavigateByNav:f,onNavigateHome:()=>r(Za)}):i.path===vc?c=x.jsx(Rr,{pageRoute:"artifacts",initialActive:"artifacts",onNavigateByNav:f,onNavigateHome:()=>r(Za)}):i.path===zr?c=x.jsx(Rr,{pageRoute:"home",initialActive:"overview",onNavigateByNav:f,onNavigateHome:()=>r(Za)}):i.path===Sc?c=x.jsx(Rr,{pageRoute:"settings",initialActive:"settings",onNavigateByNav:f,onNavigateHome:()=>r(Za)}):c=x.jsx(Rr,{pageRoute:"home",initialActive:"overview",onNavigateByNav:f,onNavigateHome:()=>r(zr)}),x.jsxs(x.Fragment,{children:[x.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:fixed focus:top-3 focus:left-3 focus:z-(--z-tooltip) focus:inline-flex focus:h-10 focus:items-center focus:border focus:border-[var(--live)] focus:bg-[var(--panel)] focus:px-4 focus:text-sm focus:font-medium focus:text-[var(--live)] focus:shadow-lg focus:outline-none",children:e("skipToContent")}),c]})}nj.then(()=>{SN.createRoot(document.getElementById("root")).render(x.jsx(Xb.StrictMode,{children:x.jsx(zO,{})}))});