@tea-agent/loop-agent 0.40.0-next.4 → 0.40.0-next.6

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 (134) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/build-stamp.json +3 -3
  3. package/dist/executors/shell-executor.js +4 -1
  4. package/dist/infrastructure/harness/atomic-write.js +23 -0
  5. package/dist/worker/console/chat/chat-event-store.js +62 -4
  6. package/dist/worker/console/chat/context-panel.js +7 -0
  7. package/dist/worker/console/chat/deferred-turn.js +12 -0
  8. package/dist/worker/console/chat/pi-runtime.js +264 -16
  9. package/dist/worker/console/chat/provider-error.js +98 -0
  10. package/dist/worker/console/chat/routes.js +292 -29
  11. package/dist/worker/console/chat/session-stats.js +179 -0
  12. package/dist/worker/console/chat/session-store.js +93 -63
  13. package/dist/worker/console/chat/todos.js +115 -0
  14. package/dist/worker/console/chat/tool-preview.js +42 -0
  15. package/dist/worker/console/chat/turn-process.js +20 -55
  16. package/dist/worker/console/chat/user-questions.js +266 -0
  17. package/dist/worker/console/chat/workspace-landing.js +14 -0
  18. package/dist/worker/console/native-directory-picker.js +13 -0
  19. package/dist/worker/console/routes.js +309 -1
  20. package/dist/worker/console/security.js +4 -4
  21. package/dist/worker/console/server.js +529 -186
  22. package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-CTx1TrNa.js → abnfDiagram-N423BO3Z-DGt5TRsk.js} +1 -1
  23. package/dist/worker/console/static/assets/{arc-B4i9cVxX.js → arc-DKBSJsXm.js} +1 -1
  24. package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-BAXE8_Rl.js → architectureDiagram-T3A2C74G-BnhooRBs.js} +1 -1
  25. package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-C5Xh59at.js → blockDiagram-VBNYF7ZC-Bm9qkrJP.js} +1 -1
  26. package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-B_asOzAu.js → c4Diagram-5PPSVZJV-B2cFh4bO.js} +1 -1
  27. package/dist/worker/console/static/assets/channel-DSgFX07x.js +1 -0
  28. package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-wRO_iRNc.js → chunk-2GRJ4B5K-DhvWRI03.js} +1 -1
  29. package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-ByOaSh_G.js → chunk-2Q5K7J3B-chzTP_2w.js} +1 -1
  30. package/dist/worker/console/static/assets/{chunk-5RXB4S5H-DjLzudan.js → chunk-5RXB4S5H-SdWIR12m.js} +1 -1
  31. package/dist/worker/console/static/assets/{chunk-5VM5RSS4-JCNGkXYT.js → chunk-5VM5RSS4-C2-8Eo_A.js} +1 -1
  32. package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-BhrPXXMZ.js → chunk-6Q2QTUOP-DvbE1yQW.js} +1 -1
  33. package/dist/worker/console/static/assets/{chunk-GF5L2VYU-TJ5JuEBT.js → chunk-GF5L2VYU-CEenyPTz.js} +1 -1
  34. package/dist/worker/console/static/assets/{chunk-JWPE2WC7-VVthn_mD.js → chunk-JWPE2WC7-CcaZrq0k.js} +1 -1
  35. package/dist/worker/console/static/assets/{chunk-KBJHAD2P-D60-Mny4.js → chunk-KBJHAD2P-FGngOTto.js} +1 -1
  36. package/dist/worker/console/static/assets/{chunk-RYQCIY6F-zXv7aVye.js → chunk-RYQCIY6F-jT_yX3sf.js} +1 -1
  37. package/dist/worker/console/static/assets/{chunk-XXDRQBXY-By9VQoi1.js → chunk-XXDRQBXY-CjE9LQOM.js} +1 -1
  38. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-unJObRls.js +1 -0
  39. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-unJObRls.js +1 -0
  40. package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-C4zQLe-M.js → cose-bilkent-JH36ORCC-GQWns1tb.js} +1 -1
  41. package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-wh5N2ReN.js → cynefin-VYW2F7L2-CGRpxWNJ.js} +1 -1
  42. package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-Dlu5wIqs.js → cynefinDiagram-MW4NZA55-Cd3uFGE4.js} +1 -1
  43. package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-CrDgthc6.js → dagre-VZM6K2ZE-DmDHuUW0.js} +1 -1
  44. package/dist/worker/console/static/assets/{diagram-7IWD3JNH-zN1clg27.js → diagram-7IWD3JNH-kAr--hF3.js} +1 -1
  45. package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-BN-o7J7-.js → diagram-B4RE2ZJO-woahL2Oh.js} +1 -1
  46. package/dist/worker/console/static/assets/{diagram-LBJQPF4R-C8SuPt0d.js → diagram-LBJQPF4R-7syNVaNf.js} +1 -1
  47. package/dist/worker/console/static/assets/{diagram-Q27KOJAE-BoizuHbZ.js → diagram-Q27KOJAE-BELPXiaY.js} +1 -1
  48. package/dist/worker/console/static/assets/{diagram-UB23O5K3-BzUzXixG.js → diagram-UB23O5K3-CrPa4aXi.js} +1 -1
  49. package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-Ev3lA4Cf.js → ebnfDiagram-BXEA7PRR-B48u2VVe.js} +1 -1
  50. package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-GALUzRbs.js → erDiagram-JOGREHBK-DhBTfwTF.js} +1 -1
  51. package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-CZJN65Sb.js → flowDiagram-UKHOOZJN-CAeZ5nDU.js} +1 -1
  52. package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-JLB9OESl.js → ganttDiagram-PKOTCBZU-CkIFeFLN.js} +1 -1
  53. package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-CcvCr4GD.js → gitGraphDiagram-DS77QQ5N-t0HGYDel.js} +1 -1
  54. package/dist/worker/console/static/assets/index-B4l5ag79.js +407 -0
  55. package/dist/worker/console/static/assets/index-CwVHWB71.css +1 -0
  56. package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-HG5z7aVg.js → infoDiagram-6WML65LV-WM0HZhe4.js} +1 -1
  57. package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-BHEu9chR.js → ishikawaDiagram-WSZJBQD7-CV5byHe0.js} +1 -1
  58. package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-Cp_Up8-a.js → journeyDiagram-NVQOT4AX-lIyWkgnw.js} +1 -1
  59. package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-DvVeY-em.js → kanban-definition-27J2QSJJ-BIH4YNRY.js} +1 -1
  60. package/dist/worker/console/static/assets/{linear-aGmcjgTn.js → linear-lQ0ZGrWc.js} +1 -1
  61. package/dist/worker/console/static/assets/{mermaid.core-Biyo-tqA.js → mermaid.core-BYdXtke8.js} +5 -5
  62. package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-DyxY2pIb.js → mindmap-definition-FAOFIHXS-k93vkIa4.js} +1 -1
  63. package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-CkdGuc50.js → pegDiagram-VL7TDLO6-Bm6AqvSy.js} +1 -1
  64. package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-NNQI9xVR.js → pieDiagram-7S7Q4E2Y-DnJW6Xpf.js} +1 -1
  65. package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-PAJkuz_G.js → quadrantDiagram-CIZ2JOQS-CMzm4ObL.js} +1 -1
  66. package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-ZwrQod0O.js → railroadDiagram-AXF67PYL-fwFF5dFQ.js} +1 -1
  67. package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-D3ZfrzM2.js → requirementDiagram-LRYGKXZP-tzl9VDUc.js} +1 -1
  68. package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-DDGFmWk5.js → sankeyDiagram-W5VNT64P-B26V09DD.js} +1 -1
  69. package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-DO6mmXTA.js → sequenceDiagram-SI44F4Z6-D2npyCeP.js} +1 -1
  70. package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-DMbCQiJt.js → sizeCapture-X5ZJPWSS-CTJtkRU2.js} +1 -1
  71. package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-Di_YUEfC.js → stateDiagram-OKZ733FA-B8lk4Lzu.js} +1 -1
  72. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BmOcMTJE.js +1 -0
  73. package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-Bn2PphNJ.js → swimlanes-SLNWSIFB-C3yP53hH.js} +2 -2
  74. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-Beah-dq0.js +8 -0
  75. package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-DPh8pRsp.js → timeline-definition-Z64GVDOM-Bck7xjhe.js} +1 -1
  76. package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-GMfl26pW.js → vennDiagram-T6HMQDX7-CCntr1w7.js} +1 -1
  77. package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-DTlmVrmF.js → wardleyDiagram-T6FBY63Y-DsCqCBZz.js} +1 -1
  78. package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-YGBjKAS5.js → xychartDiagram-ELKLHX3M-Br2l90OM.js} +1 -1
  79. package/dist/worker/console/static/index.html +2 -2
  80. package/dist/worker/console/static-src/app/console-types.js +29 -4
  81. package/dist/worker/console/static-src/app/useConsoleShell.js +30 -12
  82. package/dist/worker/console/static-src/app/useOperatorActions.js +36 -6
  83. package/dist/worker/console/static-src/app/useRecoveryConsole.js +10 -11
  84. package/dist/worker/console/static-src/app/useRunProgress.js +2 -1
  85. package/dist/worker/console/static-src/app/useTaskWizard.js +2 -2
  86. package/dist/worker/console/static-src/night/useNightBoard.js +8 -5
  87. package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +140 -8
  88. package/dist/worker/console/static-src/operator-chat/details-dag-actions.js +122 -0
  89. package/dist/worker/console/static-src/operator-chat/refs.js +3 -0
  90. package/dist/worker/console/static-src/operator-chat/runtime-selection-labels.js +27 -0
  91. package/dist/worker/console/static-src/operator-chat/turn-submission.js +3 -2
  92. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +168 -72
  93. package/dist/worker/console/static-src/operator-chat/useChatStream.js +78 -17
  94. package/dist/worker/console/static-src/operator-chat/useChatThread.js +184 -4
  95. package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +63 -9
  96. package/dist/worker/console/static-src/operator-chat/useWorkspaceBrowserGate.js +4 -0
  97. package/dist/worker/console/static-src/operator-chat/workspace-layout-mode.js +3 -3
  98. package/dist/worker/console/static-src/shell/useWorkspaces.js +299 -0
  99. package/dist/worker/console/static-src/shell/workspace-route.js +337 -0
  100. package/dist/worker/console/workspace-context.js +234 -0
  101. package/dist/worker/console/workspace-registry.js +214 -0
  102. package/dist/worker/observe/server.js +4 -0
  103. package/dist/worker/observe/static/api.js +26 -6
  104. package/dist/worker/observe/static/app.js +18 -70
  105. package/dist/worker/observe/static/index.html +1 -1
  106. package/dist/worker/observe/static/inspect-workspace.js +307 -0
  107. package/dist/worker/observe/static/operator-chrome.css +145 -20
  108. package/dist/worker/observe/static/operator-chrome.d.ts +20 -3
  109. package/dist/worker/observe/static/operator-chrome.js +330 -100
  110. package/dist/worker/observe/static/router.d.ts +46 -0
  111. package/dist/worker/observe/static/router.js +25 -1
  112. package/dist/worker/observe/static/state.d.ts +50 -0
  113. package/dist/worker/observe/static/state.js +172 -0
  114. package/dist/worker/observe/static/views/dag-inspector.js +3 -2
  115. package/dist/worker/observe/static/views/dag.js +2 -1
  116. package/dist/worker/observe/static/views/dashboard.js +6 -4
  117. package/dist/worker/observe/static/views/night.js +2 -2
  118. package/dist/worker/observe/static/views/pool.js +1 -0
  119. package/dist/worker/observe/static/views/run.js +3 -1
  120. package/dist/worker/observe/static/views/task.js +1 -1
  121. package/dist/workflows/dag/backend-test-pytest-collection.js +11 -10
  122. package/dist/workflows/dag/interrupt-request.js +3 -3
  123. package/dist/workflows/dag/lifecycle.js +3 -3
  124. package/docs/README.md +1 -0
  125. package/docs/operations/local-development-environment.md +21 -0
  126. package/harness.json +3 -3
  127. package/package.json +3 -1
  128. package/dist/worker/console/static/assets/channel-Dj_4Moei.js +0 -1
  129. package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-C0YYAyCa.js +0 -1
  130. package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-C0YYAyCa.js +0 -1
  131. package/dist/worker/console/static/assets/index-CW88Fjbw.js +0 -406
  132. package/dist/worker/console/static/assets/index-DP0ZJl39.css +0 -1
  133. package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DrdDvela.js +0 -1
  134. package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DPkEAULl.js +0 -8
@@ -0,0 +1,407 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(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 a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function dd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jf={exports:{}},vl={};var Q2;function i9(){if(Q2)return vl;Q2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,o){var c=null;if(o!==void 0&&(c=""+o),s.key!==void 0&&(c=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:o}}return vl.Fragment=t,vl.jsx=n,vl.jsxs=n,vl}var J2;function s9(){return J2||(J2=1,jf.exports=i9()),jf.exports}var u=s9(),Lf={exports:{}},wt={};var eb;function o9(){if(eb)return wt;eb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=x&&G[x]||G["@@iterator"],typeof G=="function"?G:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,N={};function R(G,Y,D){this.props=G,this.context=Y,this.refs=N,this.updater=D||S}R.prototype.isReactComponent={},R.prototype.setState=function(G,Y){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,Y,"setState")},R.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=R.prototype;function _(G,Y,D){this.props=G,this.context=Y,this.refs=N,this.updater=D||S}var P=_.prototype=new M;P.constructor=_,T(P,R.prototype),P.isPureReactComponent=!0;var F=Array.isArray;function A(){}var L={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function U(G,Y,D){var ye=D.ref;return{$$typeof:e,type:G,key:Y,ref:ye!==void 0?ye:null,props:D}}function $(G,Y){return U(G.type,Y,G.props)}function q(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function W(G){var Y={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(D){return Y[D]})}var oe=/\/+/g;function J(G,Y){return typeof G=="object"&&G!==null&&G.key!=null?W(""+G.key):Y.toString(36)}function H(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(A,A):(G.status="pending",G.then(function(Y){G.status==="pending"&&(G.status="fulfilled",G.value=Y)},function(Y){G.status==="pending"&&(G.status="rejected",G.reason=Y)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function I(G,Y,D,ye,se){var V=typeof G;(V==="undefined"||V==="boolean")&&(G=null);var Q=!1;if(G===null)Q=!0;else switch(V){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(G.$$typeof){case e:case t:Q=!0;break;case p:return Q=G._init,I(Q(G._payload),Y,D,ye,se)}}if(Q)return se=se(G),Q=ye===""?"."+J(G,0):ye,F(se)?(D="",Q!=null&&(D=Q.replace(oe,"$&/")+"/"),I(se,Y,D,"",function(he){return he})):se!=null&&(q(se)&&(se=$(se,D+(se.key==null||G&&G.key===se.key?"":(""+se.key).replace(oe,"$&/")+"/")+Q)),Y.push(se)),1;Q=0;var ae=ye===""?".":ye+":";if(F(G))for(var ue=0;ue<G.length;ue++)ye=G[ue],V=ae+J(ye,ue),Q+=I(ye,Y,D,V,se);else if(ue=y(G),typeof ue=="function")for(G=ue.call(G),ue=0;!(ye=G.next()).done;)ye=ye.value,V=ae+J(ye,ue++),Q+=I(ye,Y,D,V,se);else if(V==="object"){if(typeof G.then=="function")return I(H(G),Y,D,ye,se);throw Y=String(G),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Q}function K(G,Y,D){if(G==null)return G;var ye=[],se=0;return I(G,ye,"","",function(V){return Y.call(D,V,se++)}),ye}function X(G){if(G._status===-1){var Y=G._result;Y=Y(),Y.then(function(D){(G._status===0||G._status===-1)&&(G._status=1,G._result=D)},function(D){(G._status===0||G._status===-1)&&(G._status=2,G._result=D)}),G._status===-1&&(G._status=0,G._result=Y)}if(G._status===1)return G._result.default;throw G._result}var be=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},j={map:K,forEach:function(G,Y,D){K(G,function(){Y.apply(this,arguments)},D)},count:function(G){var Y=0;return K(G,function(){Y++}),Y},toArray:function(G){return K(G,function(Y){return Y})||[]},only:function(G){if(!q(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return wt.Activity=g,wt.Children=j,wt.Component=R,wt.Fragment=n,wt.Profiler=s,wt.PureComponent=_,wt.StrictMode=a,wt.Suspense=h,wt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,wt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return L.H.useMemoCache(G)}},wt.cache=function(G){return function(){return G.apply(null,arguments)}},wt.cacheSignal=function(){return null},wt.cloneElement=function(G,Y,D){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var ye=T({},G.props),se=G.key;if(Y!=null)for(V in Y.key!==void 0&&(se=""+Y.key),Y)!Z.call(Y,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&Y.ref===void 0||(ye[V]=Y[V]);var V=arguments.length-2;if(V===1)ye.children=D;else if(1<V){for(var Q=Array(V),ae=0;ae<V;ae++)Q[ae]=arguments[ae+2];ye.children=Q}return U(G.type,se,ye)},wt.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},wt.createElement=function(G,Y,D){var ye,se={},V=null;if(Y!=null)for(ye in Y.key!==void 0&&(V=""+Y.key),Y)Z.call(Y,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(se[ye]=Y[ye]);var Q=arguments.length-2;if(Q===1)se.children=D;else if(1<Q){for(var ae=Array(Q),ue=0;ue<Q;ue++)ae[ue]=arguments[ue+2];se.children=ae}if(G&&G.defaultProps)for(ye in Q=G.defaultProps,Q)se[ye]===void 0&&(se[ye]=Q[ye]);return U(G,V,se)},wt.createRef=function(){return{current:null}},wt.forwardRef=function(G){return{$$typeof:d,render:G}},wt.isValidElement=q,wt.lazy=function(G){return{$$typeof:p,_payload:{_status:-1,_result:G},_init:X}},wt.memo=function(G,Y){return{$$typeof:m,type:G,compare:Y===void 0?null:Y}},wt.startTransition=function(G){var Y=L.T,D={};L.T=D;try{var ye=G(),se=L.S;se!==null&&se(D,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(A,be)}catch(V){be(V)}finally{Y!==null&&D.types!==null&&(Y.types=D.types),L.T=Y}},wt.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},wt.use=function(G){return L.H.use(G)},wt.useActionState=function(G,Y,D){return L.H.useActionState(G,Y,D)},wt.useCallback=function(G,Y){return L.H.useCallback(G,Y)},wt.useContext=function(G){return L.H.useContext(G)},wt.useDebugValue=function(){},wt.useDeferredValue=function(G,Y){return L.H.useDeferredValue(G,Y)},wt.useEffect=function(G,Y){return L.H.useEffect(G,Y)},wt.useEffectEvent=function(G){return L.H.useEffectEvent(G)},wt.useId=function(){return L.H.useId()},wt.useImperativeHandle=function(G,Y,D){return L.H.useImperativeHandle(G,Y,D)},wt.useInsertionEffect=function(G,Y){return L.H.useInsertionEffect(G,Y)},wt.useLayoutEffect=function(G,Y){return L.H.useLayoutEffect(G,Y)},wt.useMemo=function(G,Y){return L.H.useMemo(G,Y)},wt.useOptimistic=function(G,Y){return L.H.useOptimistic(G,Y)},wt.useReducer=function(G,Y,D){return L.H.useReducer(G,Y,D)},wt.useRef=function(G){return L.H.useRef(G)},wt.useState=function(G){return L.H.useState(G)},wt.useSyncExternalStore=function(G,Y,D){return L.H.useSyncExternalStore(G,Y,D)},wt.useTransition=function(){return L.H.useTransition()},wt.version="19.2.8",wt}var tb;function N1(){return tb||(tb=1,Lf.exports=o9()),Lf.exports}var w=N1();const at=dd(w);var zf={exports:{}},yl={},Bf={exports:{}},qf={};var nb;function l9(){return nb||(nb=1,(function(e){function t(I,K){var X=I.length;I.push(K);e:for(;0<X;){var be=X-1>>>1,j=I[be];if(0<s(j,K))I[be]=K,I[X]=j,X=be;else break e}}function n(I){return I.length===0?null:I[0]}function a(I){if(I.length===0)return null;var K=I[0],X=I.pop();if(X!==K){I[0]=X;e:for(var be=0,j=I.length,G=j>>>1;be<G;){var Y=2*(be+1)-1,D=I[Y],ye=Y+1,se=I[ye];if(0>s(D,X))ye<j&&0>s(se,D)?(I[be]=se,I[ye]=X,be=ye):(I[be]=D,I[Y]=X,be=Y);else if(ye<j&&0>s(se,X))I[be]=se,I[ye]=X,be=ye;else break e}}return K}function s(I,K){var X=I.sortIndex-K.sortIndex;return X!==0?X:I.id-K.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 c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],p=1,g=null,x=3,y=!1,S=!1,T=!1,N=!1,R=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function P(I){for(var K=n(m);K!==null;){if(K.callback===null)a(m);else if(K.startTime<=I)a(m),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(m)}}function F(I){if(T=!1,P(I),!S)if(n(h)!==null)S=!0,A||(A=!0,W());else{var K=n(m);K!==null&&H(F,K.startTime-I)}}var A=!1,L=-1,Z=5,U=-1;function $(){return N?!0:!(e.unstable_now()-U<Z)}function q(){if(N=!1,A){var I=e.unstable_now();U=I;var K=!0;try{e:{S=!1,T&&(T=!1,M(L),L=-1),y=!0;var X=x;try{t:{for(P(I),g=n(h);g!==null&&!(g.expirationTime>I&&$());){var be=g.callback;if(typeof be=="function"){g.callback=null,x=g.priorityLevel;var j=be(g.expirationTime<=I);if(I=e.unstable_now(),typeof j=="function"){g.callback=j,P(I),K=!0;break t}g===n(h)&&a(h),P(I)}else a(h);g=n(h)}if(g!==null)K=!0;else{var G=n(m);G!==null&&H(F,G.startTime-I),K=!1}}break e}finally{g=null,x=X,y=!1}K=void 0}}finally{K?W():A=!1}}}var W;if(typeof _=="function")W=function(){_(q)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,J=oe.port2;oe.port1.onmessage=q,W=function(){J.postMessage(null)}}else W=function(){R(q,0)};function H(I,K){L=R(function(){I(e.unstable_now())},K)}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(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var X=x;x=K;try{return I()}finally{x=X}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(I,K){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var X=x;x=I;try{return K()}finally{x=X}},e.unstable_scheduleCallback=function(I,K,X){var be=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?be+X:be):X=be,I){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=X+j,I={id:p++,callback:K,priorityLevel:I,startTime:X,expirationTime:j,sortIndex:-1},X>be?(I.sortIndex=X,t(m,I),n(h)===null&&I===n(m)&&(T?(M(L),L=-1):T=!0,H(F,X-be))):(I.sortIndex=j,t(h,I),S||y||(S=!0,A||(A=!0,W()))),I},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(I){var K=x;return function(){var X=x;x=K;try{return I.apply(this,arguments)}finally{x=X}}}})(qf)),qf}var rb;function c9(){return rb||(rb=1,Bf.exports=l9()),Bf.exports}var Hf={exports:{}},or={};var ab;function u9(){if(ab)return or;ab=1;var e=N1();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)m+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,m,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:h,containerInfo:m,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return or.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,or.createPortal=function(h,m){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(h,m,null,p)},or.flushSync=function(h){var m=c.T,p=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=m,a.p=p,a.d.f()}},or.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},or.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},or.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var p=m.as,g=d(p,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,y=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;p==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:y}):p==="script"&&a.d.X(h,{crossOrigin:g,integrity:x,fetchPriority:y,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},or.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var p=d(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},or.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var p=m.as,g=d(p,m.crossOrigin);a.d.L(h,p,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},or.preloadModule=function(h,m){if(typeof h=="string")if(m){var p=d(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},or.requestFormReset=function(h){a.d.r(h)},or.unstable_batchedUpdates=function(h,m){return h(m)},or.useFormState=function(h,m,p){return c.H.useFormState(h,m,p)},or.useFormStatus=function(){return c.H.useHostTransitionStatus()},or.version="19.2.8",or}var ib;function j3(){if(ib)return Hf.exports;ib=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(t){console.error(t)}}return e(),Hf.exports=u9(),Hf.exports}var sb;function d9(){if(sb)return yl;sb=1;var e=c9(),t=N1(),n=j3();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function d(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(o(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,f=i;;){var b=l.return;if(b===null)break;var v=b.alternate;if(v===null){if(f=b.return,f!==null){l=f;continue}break}if(b.child===v.child){for(v=b.child;v;){if(v===l)return h(b),r;if(v===f)return h(b),i;v=v.sibling}throw Error(a(188))}if(l.return!==f.return)l=b,f=v;else{for(var C=!1,z=b.child;z;){if(z===l){C=!0,l=b,f=v;break}if(z===f){C=!0,f=b,l=v;break}z=z.sibling}if(!C){for(z=v.child;z;){if(z===l){C=!0,l=v,f=b;break}if(z===f){C=!0,f=v,l=b;break}z=z.sibling}if(!C)throw Error(a(189))}}if(l.alternate!==f)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),_=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function W(r){return r===null||typeof r!="object"?null:(r=q&&r[q]||r["@@iterator"],typeof r=="function"?r:null)}var oe=Symbol.for("react.client.reference");function J(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===oe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case R:return"Profiler";case N:return"StrictMode";case F:return"Suspense";case A:return"SuspenseList";case U:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case _:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case L:return i=r.displayName||null,i!==null?i:J(r.type)||"Memo";case Z:i=r._payload,r=r._init;try{return J(r(i))}catch{}}return null}var H=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},be=[],j=-1;function G(r){return{current:r}}function Y(r){0>j||(r.current=be[j],be[j]=null,j--)}function D(r,i){j++,be[j]=r.current,r.current=i}var ye=G(null),se=G(null),V=G(null),Q=G(null);function ae(r,i){switch(D(V,i),D(se,r),D(ye,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?w2(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=w2(i),r=k2(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Y(ye),D(ye,r)}function ue(){Y(ye),Y(se),Y(V)}function he(r){r.memoizedState!==null&&D(Q,r);var i=ye.current,l=k2(i,r.type);i!==l&&(D(se,r),D(ye,l))}function Ne(r){se.current===r&&(Y(ye),Y(se)),Q.current===r&&(Y(Q),ml._currentValue=X)}var He,We;function rt(r){if(He===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);He=i&&i[1]||"",We=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+He+r+We}var Ye=!1;function gt(r,i){if(!r||Ye)return"";Ye=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(xe){var ve=xe}Reflect.construct(r,[],Ce)}else{try{Ce.call()}catch(xe){ve=xe}r.call(Ce.prototype)}}else{try{throw Error()}catch(xe){ve=xe}(Ce=r())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(xe){if(xe&&ve&&typeof xe.stack=="string")return[xe.stack,ve.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=f.DetermineComponentFrameRoot(),C=v[0],z=v[1];if(C&&z){var ie=C.split(`
4
+ `),ge=z.split(`
5
+ `);for(b=f=0;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(f===ie.length||b===ge.length)for(f=ie.length-1,b=ge.length-1;1<=f&&0<=b&&ie[f]!==ge[b];)b--;for(;1<=f&&0<=b;f--,b--)if(ie[f]!==ge[b]){if(f!==1||b!==1)do if(f--,b--,0>b||ie[f]!==ge[b]){var Se=`
6
+ `+ie[f].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=f&&0<=b);break}}}finally{Ye=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?rt(l):""}function Rt(r,i){switch(r.tag){case 26:case 27:case 5:return rt(r.type);case 16:return rt("Lazy");case 13:return r.child!==i&&i!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return gt(r.type,!1);case 11:return gt(r.type.render,!1);case 1:return gt(r.type,!0);case 31:return rt("Activity");default:return""}}function st(r){try{var i="",l=null;do i+=Rt(r,l),l=r,r=r.return;while(r);return i}catch(f){return`
7
+ Error generating stack: `+f.message+`
8
+ `+f.stack}}var kt=Object.prototype.hasOwnProperty,$t=e.unstable_scheduleCallback,Ut=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Qe=e.unstable_requestPaint,Ue=e.unstable_now,ot=e.unstable_getCurrentPriorityLevel,fe=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,we=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,mt=e.log,Ie=e.unstable_setDisableYieldValue,Pt=null,bt=null;function Mt(r){if(typeof mt=="function"&&Ie(r),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Pt,r)}catch{}}var Tt=Math.clz32?Math.clz32:lt,$n=Math.log,en=Math.LN2;function lt(r){return r>>>=0,r===0?32:31-($n(r)/en|0)|0}var Ze=256,vt=262144,ct=4194304;function Yt(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function re(r,i,l){var f=r.pendingLanes;if(f===0)return 0;var b=0,v=r.suspendedLanes,C=r.pingedLanes;r=r.warmLanes;var z=f&134217727;return z!==0?(f=z&~v,f!==0?b=Yt(f):(C&=z,C!==0?b=Yt(C):l||(l=z&~r,l!==0&&(b=Yt(l))))):(z=f&~v,z!==0?b=Yt(z):C!==0?b=Yt(C):l||(l=f&~r,l!==0&&(b=Yt(l)))),b===0?0:i!==0&&i!==b&&(i&v)===0&&(v=b&-b,l=i&-i,v>=l||v===32&&(l&4194048)!==0)?i:b}function ke(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Re(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 et(){var r=ct;return ct<<=1,(ct&62914560)===0&&(ct=4194304),r}function St(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Ct(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function De(r,i,l,f,b,v){var C=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var z=r.entanglements,ie=r.expirationTimes,ge=r.hiddenUpdates;for(l=C&~l;0<l;){var Se=31-Tt(l),Ce=1<<Se;z[Se]=0,ie[Se]=-1;var ve=ge[Se];if(ve!==null)for(ge[Se]=null,Se=0;Se<ve.length;Se++){var xe=ve[Se];xe!==null&&(xe.lane&=-536870913)}l&=~Ce}f!==0&&Pe(r,f,0),v!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=v&~(C&~i))}function Pe(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-Tt(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|l&261930}function dt(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var f=31-Tt(l),b=1<<f;b&i|r[f]&i&&(r[f]|=i),l&=~b}}function xn(r,i){var l=i&-i;return l=(l&42)!==0?1:fn(l),(l&(r.suspendedLanes|i))!==0?0:l}function fn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function oa(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ba(){var r=K.p;return r!==0?r:(r=window.event,r===void 0?32:G2(r.type))}function yr(r,i){var l=K.p;try{return K.p=r,i()}finally{K.p=l}}var dr=Math.random().toString(36).slice(2),Wt="__reactFiber$"+dr,Tn="__reactProps$"+dr,Kr="__reactContainer$"+dr,va="__reactEvents$"+dr,di="__reactListeners$"+dr,fi="__reactHandles$"+dr,_s="__reactResources$"+dr,Da="__reactMarker$"+dr;function ja(r){delete r[Wt],delete r[Tn],delete r[va],delete r[di],delete r[fi]}function Xn(r){var i=r[Wt];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Kr]||l[Wt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=A2(r);r!==null;){if(l=r[Wt])return l;r=A2(r)}return i}r=l,l=r.parentNode}return null}function la(r){if(r=r[Wt]||r[Kr]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ya(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function ca(r){var i=r[_s];return i||(i=r[_s]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function wn(r){r[Da]=!0}var Ms=new Set,Mr={};function Yr(r,i){Me(r,i),Me(r+"Capture",i)}function Me(r,i){for(Mr[r]=i,r=0;r<i.length;r++)Ms.add(i[r])}var tt=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]*$"),At={},Gt={};function hn(r){return kt.call(Gt,r)?!0:kt.call(At,r)?!1:tt.test(r)?Gt[r]=!0:(At[r]=!0,!1)}function Pn(r,i,l){if(hn(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function ir(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function Qn(r,i,l,f){if(f===null)r.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+f)}}function ee(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Te(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Dt(r,i,l){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var b=f.get,v=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return b.call(this)},set:function(C){l=""+C,v.call(this,C)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(C){l=""+C},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Jt(r){if(!r._valueTracker){var i=Te(r)?"checked":"value";r._valueTracker=Dt(r,i,""+r[i])}}function fr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return r&&(f=Te(r)?r.checked?"true":"false":r.value),r=f,r!==l?(i.setValue(r),!0):!1}function Wn(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var sr=/[\n"\\]/g;function gn(r){return r.replace(sr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Or(r,i,l,f,b,v,C,z){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),i!=null?C==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ee(i)):r.value!==""+ee(i)&&(r.value=""+ee(i)):C!=="submit"&&C!=="reset"||r.removeAttribute("value"),i!=null?ua(r,C,ee(i)):l!=null?ua(r,C,ee(l)):f!=null&&r.removeAttribute("value"),b==null&&v!=null&&(r.defaultChecked=!!v),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?r.name=""+ee(z):r.removeAttribute("name")}function Jn(r,i,l,f,b,v,C,z){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Jt(r);return}l=l!=null?""+ee(l):"",i=i!=null?""+ee(i):l,z||i===r.value||(r.value=i),r.defaultValue=i}f=f??b,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=z?r.checked:!!f,r.defaultChecked=!!f,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C),Jt(r)}function ua(r,i,l){i==="number"&&Wn(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function er(r,i,l,f){if(r=r.options,i){i={};for(var b=0;b<l.length;b++)i["$"+l[b]]=!0;for(l=0;l<r.length;l++)b=i.hasOwnProperty("$"+r[l].value),r[l].selected!==b&&(r[l].selected=b),b&&f&&(r[l].defaultSelected=!0)}else{for(l=""+ee(l),i=null,b=0;b<r.length;b++){if(r[b].value===l){r[b].selected=!0,f&&(r[b].defaultSelected=!0);return}i!==null||r[b].disabled||(i=r[b])}i!==null&&(i.selected=!0)}}function sc(r,i,l){if(i!=null&&(i=""+ee(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+ee(l):""}function Os(r,i,l,f){if(i==null){if(f!=null){if(l!=null)throw Error(a(92));if(H(f)){if(1<f.length)throw Error(a(93));f=f[0]}l=f}l==null&&(l=""),i=l}l=ee(i),r.defaultValue=l,f=r.textContent,f===l&&f!==""&&f!==null&&(r.value=f),Jt(r)}function ht(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var oc=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 On(r,i,l){var f=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,l):typeof l!="number"||l===0||oc.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function tn(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var b in i)f=i[b],i.hasOwnProperty(b)&&l[b]!==f&&On(r,b,f)}else for(var v in i)i.hasOwnProperty(v)&&On(r,v,i[v])}function hi(r){if(r.indexOf("-")===-1)return!1;switch(r){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 La=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 mi(r){return Ao.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function qe(){}var Xe=null;function Et(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Bt=null,kn=null;function Wr(r){var i=la(r);if(i&&(r=i.stateNode)){var l=r[Tn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Or(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+gn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==r&&f.form===r.form){var b=f[Tn]||null;if(!b)throw Error(a(90));Or(f,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<l.length;i++)f=l[i],f.form===r.form&&fr(f)}break e;case"textarea":sc(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&er(r,!!l.multiple,i,!1)}}}var Io=!1;function lc(r,i,l){if(Io)return r(i,l);Io=!0;try{var f=r(i);return f}finally{if(Io=!1,(Bt!==null||kn!==null)&&(Wc(),Bt&&(i=Bt,r=kn,kn=Bt=null,Wr(i),r)))for(i=0;i<r.length;i++)Wr(r[i])}}function _o(r,i){var l=r.stateNode;if(l===null)return null;var f=l[Tn]||null;if(f===null)return null;l=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var za=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dd=!1;if(za)try{var Mo={};Object.defineProperty(Mo,"passive",{get:function(){Dd=!0}}),window.addEventListener("test",Mo,Mo),window.removeEventListener("test",Mo,Mo)}catch{Dd=!1}var pi=null,jd=null,cc=null;function kp(){if(cc)return cc;var r,i=jd,l=i.length,f,b="value"in pi?pi.value:pi.textContent,v=b.length;for(r=0;r<l&&i[r]===b[r];r++);var C=l-r;for(f=1;f<=C&&i[l-f]===b[v-f];f++);return cc=b.slice(r,1<f?1-f:void 0)}function uc(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function dc(){return!0}function Sp(){return!1}function xr(r){function i(l,f,b,v,C){this._reactName=l,this._targetInst=b,this.type=f,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var z in r)r.hasOwnProperty(z)&&(l=r[z],this[z]=l?l(v):v[z]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?dc:Sp,this.isPropagationStopped=Sp,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),i}var Xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=xr(Xi),Oo=g({},Xi,{view:0,detail:0}),rx=xr(Oo),Ld,zd,Do,hc=g({},Oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Do&&(Do&&r.type==="mousemove"?(Ld=r.screenX-Do.screenX,zd=r.screenY-Do.screenY):zd=Ld=0,Do=r),Ld)},movementY:function(r){return"movementY"in r?r.movementY:zd}}),Ep=xr(hc),ax=g({},hc,{dataTransfer:0}),ix=xr(ax),sx=g({},Oo,{relatedTarget:0}),Bd=xr(sx),ox=g({},Xi,{animationName:0,elapsedTime:0,pseudoElement:0}),lx=xr(ox),cx=g({},Xi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ux=xr(cx),dx=g({},Xi,{data:0}),Tp=xr(dx),fx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hx={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"},mx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function px(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=mx[r])?!!i[r]:!1}function qd(){return px}var gx=g({},Oo,{key:function(r){if(r.key){var i=fx[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=uc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?hx[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qd,charCode:function(r){return r.type==="keypress"?uc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?uc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),bx=xr(gx),vx=g({},hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cp=xr(vx),yx=g({},Oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qd}),xx=xr(yx),wx=g({},Xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),kx=xr(wx),Sx=g({},hc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Ex=xr(Sx),Tx=g({},Xi,{newState:0,oldState:0}),Cx=xr(Tx),Nx=[9,13,27,32],Hd=za&&"CompositionEvent"in window,jo=null;za&&"documentMode"in document&&(jo=document.documentMode);var Rx=za&&"TextEvent"in window&&!jo,Np=za&&(!Hd||jo&&8<jo&&11>=jo),Rp=" ",Ap=!1;function Ip(r,i){switch(r){case"keyup":return Nx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ds=!1;function Ax(r,i){switch(r){case"compositionend":return _p(i);case"keypress":return i.which!==32?null:(Ap=!0,Rp);case"textInput":return r=i.data,r===Rp&&Ap?null:r;default:return null}}function Ix(r,i){if(Ds)return r==="compositionend"||!Hd&&Ip(r,i)?(r=kp(),cc=jd=pi=null,Ds=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Np&&i.locale!=="ko"?null:i.data;default:return null}}var _x={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Mp(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!_x[r.type]:i==="textarea"}function Op(r,i,l,f){Bt?kn?kn.push(f):kn=[f]:Bt=f,i=nu(i,"onChange"),0<i.length&&(l=new fc("onChange","change",null,l,f),r.push({event:l,listeners:i}))}var Lo=null,zo=null;function Mx(r){p2(r,0)}function mc(r){var i=ya(r);if(fr(i))return r}function Dp(r,i){if(r==="change")return i}var jp=!1;if(za){var Ud;if(za){var Fd="oninput"in document;if(!Fd){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),Fd=typeof Lp.oninput=="function"}Ud=Fd}else Ud=!1;jp=Ud&&(!document.documentMode||9<document.documentMode)}function zp(){Lo&&(Lo.detachEvent("onpropertychange",Bp),zo=Lo=null)}function Bp(r){if(r.propertyName==="value"&&mc(zo)){var i=[];Op(i,zo,r,Et(r)),lc(Mx,i)}}function Ox(r,i,l){r==="focusin"?(zp(),Lo=i,zo=l,Lo.attachEvent("onpropertychange",Bp)):r==="focusout"&&zp()}function Dx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return mc(zo)}function jx(r,i){if(r==="click")return mc(i)}function Lx(r,i){if(r==="input"||r==="change")return mc(i)}function zx(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Dr=typeof Object.is=="function"?Object.is:zx;function Bo(r,i){if(Dr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var b=l[f];if(!kt.call(i,b)||!Dr(r[b],i[b]))return!1}return!0}function qp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Hp(r,i){var l=qp(r);r=0;for(var f;l;){if(l.nodeType===3){if(f=r+l.textContent.length,r<=i&&f>=i)return{node:l,offset:i-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=qp(l)}}function Up(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Up(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Fp(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Wn(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=Wn(r.document)}return i}function $d(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Bx=za&&"documentMode"in document&&11>=document.documentMode,js=null,Pd=null,qo=null,Gd=!1;function $p(r,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Gd||js==null||js!==Wn(f)||(f=js,"selectionStart"in f&&$d(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),qo&&Bo(qo,f)||(qo=f,f=nu(Pd,"onSelect"),0<f.length&&(i=new fc("onSelect","select",null,i,l),r.push({event:i,listeners:f}),i.target=js)))}function Qi(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Ls={animationend:Qi("Animation","AnimationEnd"),animationiteration:Qi("Animation","AnimationIteration"),animationstart:Qi("Animation","AnimationStart"),transitionrun:Qi("Transition","TransitionRun"),transitionstart:Qi("Transition","TransitionStart"),transitioncancel:Qi("Transition","TransitionCancel"),transitionend:Qi("Transition","TransitionEnd")},Vd={},Pp={};za&&(Pp=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function Ji(r){if(Vd[r])return Vd[r];if(!Ls[r])return r;var i=Ls[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Pp)return Vd[r]=i[l];return r}var Gp=Ji("animationend"),Vp=Ji("animationiteration"),Kp=Ji("animationstart"),qx=Ji("transitionrun"),Hx=Ji("transitionstart"),Ux=Ji("transitioncancel"),Yp=Ji("transitionend"),Wp=new Map,Kd="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(" ");Kd.push("scrollEnd");function da(r,i){Wp.set(r,i),Yr(i,[r])}var pc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Zr=[],zs=0,Yd=0;function gc(){for(var r=zs,i=Yd=zs=0;i<r;){var l=Zr[i];Zr[i++]=null;var f=Zr[i];Zr[i++]=null;var b=Zr[i];Zr[i++]=null;var v=Zr[i];if(Zr[i++]=null,f!==null&&b!==null){var C=f.pending;C===null?b.next=b:(b.next=C.next,C.next=b),f.pending=b}v!==0&&Zp(l,b,v)}}function bc(r,i,l,f){Zr[zs++]=r,Zr[zs++]=i,Zr[zs++]=l,Zr[zs++]=f,Yd|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Wd(r,i,l,f){return bc(r,i,l,f),vc(r)}function es(r,i){return bc(r,null,null,i),vc(r)}function Zp(r,i,l){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l);for(var b=!1,v=r.return;v!==null;)v.childLanes|=l,f=v.alternate,f!==null&&(f.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(b=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,b&&i!==null&&(b=31-Tt(l),r=v.hiddenUpdates,f=r[b],f===null?r[b]=[i]:f.push(i),i.lane=l|536870912),v):null}function vc(r){if(50<ol)throw ol=0,af=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Bs={};function Fx(r,i,l,f){this.tag=r,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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(r,i,l,f){return new Fx(r,i,l,f)}function Zd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ba(r,i){var l=r.alternate;return l===null?(l=jr(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function Xp(r,i){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function yc(r,i,l,f,b,v){var C=0;if(f=r,typeof r=="function")Zd(r)&&(C=1);else if(typeof r=="string")C=K8(r,l,ye.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case U:return r=jr(31,l,i,b),r.elementType=U,r.lanes=v,r;case T:return ts(l.children,b,v,i);case N:C=8,b|=24;break;case R:return r=jr(12,l,i,b|2),r.elementType=R,r.lanes=v,r;case F:return r=jr(13,l,i,b),r.elementType=F,r.lanes=v,r;case A:return r=jr(19,l,i,b),r.elementType=A,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _:C=10;break e;case M:C=9;break e;case P:C=11;break e;case L:C=14;break e;case Z:C=16,f=null;break e}C=29,l=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=jr(C,l,i,b),i.elementType=r,i.type=f,i.lanes=v,i}function ts(r,i,l,f){return r=jr(7,r,f,i),r.lanes=l,r}function Xd(r,i,l){return r=jr(6,r,null,i),r.lanes=l,r}function Qp(r){var i=jr(18,null,null,0);return i.stateNode=r,i}function Qd(r,i,l){return i=jr(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Jp=new WeakMap;function Xr(r,i){if(typeof r=="object"&&r!==null){var l=Jp.get(r);return l!==void 0?l:(i={value:r,source:i,stack:st(i)},Jp.set(r,i),i)}return{value:r,source:i,stack:st(i)}}var qs=[],Hs=0,xc=null,Ho=0,Qr=[],Jr=0,gi=null,xa=1,wa="";function qa(r,i){qs[Hs++]=Ho,qs[Hs++]=xc,xc=r,Ho=i}function eg(r,i,l){Qr[Jr++]=xa,Qr[Jr++]=wa,Qr[Jr++]=gi,gi=r;var f=xa;r=wa;var b=32-Tt(f)-1;f&=~(1<<b),l+=1;var v=32-Tt(i)+b;if(30<v){var C=b-b%5;v=(f&(1<<C)-1).toString(32),f>>=C,b-=C,xa=1<<32-Tt(i)+b|l<<b|f,wa=v+r}else xa=1<<v|l<<b|f,wa=r}function Jd(r){r.return!==null&&(qa(r,1),eg(r,1,0))}function e0(r){for(;r===xc;)xc=qs[--Hs],qs[Hs]=null,Ho=qs[--Hs],qs[Hs]=null;for(;r===gi;)gi=Qr[--Jr],Qr[Jr]=null,wa=Qr[--Jr],Qr[Jr]=null,xa=Qr[--Jr],Qr[Jr]=null}function tg(r,i){Qr[Jr++]=xa,Qr[Jr++]=wa,Qr[Jr++]=gi,xa=i.id,wa=i.overflow,gi=r}var tr=null,mn=null,Ft=!1,bi=null,ea=!1,t0=Error(a(519));function vi(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(Xr(i,r)),t0}function ng(r){var i=r.stateNode,l=r.type,f=r.memoizedProps;switch(i[Wt]=r,i[Tn]=f,l){case"dialog":Lt("cancel",i),Lt("close",i);break;case"iframe":case"object":case"embed":Lt("load",i);break;case"video":case"audio":for(l=0;l<cl.length;l++)Lt(cl[l],i);break;case"source":Lt("error",i);break;case"img":case"image":case"link":Lt("error",i),Lt("load",i);break;case"details":Lt("toggle",i);break;case"input":Lt("invalid",i),Jn(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Lt("invalid",i);break;case"textarea":Lt("invalid",i),Os(i,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||f.suppressHydrationWarning===!0||y2(i.textContent,l)?(f.popover!=null&&(Lt("beforetoggle",i),Lt("toggle",i)),f.onScroll!=null&&Lt("scroll",i),f.onScrollEnd!=null&&Lt("scrollend",i),f.onClick!=null&&(i.onclick=qe),i=!0):i=!1,i||vi(r,!0)}function rg(r){for(tr=r.return;tr;)switch(tr.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:tr=tr.return}}function Us(r){if(r!==tr)return!1;if(!Ft)return rg(r),Ft=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||xf(r.type,r.memoizedProps)),l=!l),l&&mn&&vi(r),rg(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=R2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=R2(r)}else i===27?(i=mn,Mi(r.type)?(r=Tf,Tf=null,mn=r):mn=i):mn=tr?na(r.stateNode.nextSibling):null;return!0}function ns(){mn=tr=null,Ft=!1}function n0(){var r=bi;return r!==null&&(Er===null?Er=r:Er.push.apply(Er,r),bi=null),r}function Uo(r){bi===null?bi=[r]:bi.push(r)}var r0=G(null),rs=null,Ha=null;function yi(r,i,l){D(r0,i._currentValue),i._currentValue=l}function Ua(r){r._currentValue=r0.current,Y(r0)}function a0(r,i,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===l)break;r=r.return}}function i0(r,i,l,f){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var v=b.dependencies;if(v!==null){var C=b.child;v=v.firstContext;e:for(;v!==null;){var z=v;v=b;for(var ie=0;ie<i.length;ie++)if(z.context===i[ie]){v.lanes|=l,z=v.alternate,z!==null&&(z.lanes|=l),a0(v.return,l,r),f||(C=null);break e}v=z.next}}else if(b.tag===18){if(C=b.return,C===null)throw Error(a(341));C.lanes|=l,v=C.alternate,v!==null&&(v.lanes|=l),a0(C,l,r),C=null}else C=b.child;if(C!==null)C.return=b;else for(C=b;C!==null;){if(C===r){C=null;break}if(b=C.sibling,b!==null){b.return=C.return,C=b;break}C=C.return}b=C}}function Fs(r,i,l,f){r=null;for(var b=i,v=!1;b!==null;){if(!v){if((b.flags&524288)!==0)v=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var C=b.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var z=b.type;Dr(b.pendingProps.value,C.value)||(r!==null?r.push(z):r=[z])}}else if(b===Q.current){if(C=b.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(ml):r=[ml])}b=b.return}r!==null&&i0(i,r,l,f),i.flags|=262144}function wc(r){for(r=r.firstContext;r!==null;){if(!Dr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function as(r){rs=r,Ha=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function nr(r){return ag(rs,r)}function kc(r,i){return rs===null&&as(r),ag(r,i)}function ag(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ha===null){if(r===null)throw Error(a(308));Ha=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Ha=Ha.next=i;return l}var $x=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},Px=e.unstable_scheduleCallback,Gx=e.unstable_NormalPriority,Dn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function s0(){return{controller:new $x,data:new Map,refCount:0}}function Fo(r){r.refCount--,r.refCount===0&&Px(Gx,function(){r.controller.abort()})}var $o=null,o0=0,$s=0,Ps=null;function Vx(r,i){if($o===null){var l=$o=[];o0=0,$s=df(),Ps={status:"pending",value:void 0,then:function(f){l.push(f)}}}return o0++,i.then(ig,ig),i}function ig(){if(--o0===0&&$o!==null){Ps!==null&&(Ps.status="fulfilled");var r=$o;$o=null,$s=0,Ps=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Kx(r,i){var l=[],f={status:"pending",value:null,reason:null,then:function(b){l.push(b)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var b=0;b<l.length;b++)(0,l[b])(i)},function(b){for(f.status="rejected",f.reason=b,b=0;b<l.length;b++)(0,l[b])(void 0)}),f}var sg=I.S;I.S=function(r,i){$4=Ue(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Vx(r,i),sg!==null&&sg(r,i)};var is=G(null);function l0(){var r=is.current;return r!==null?r:ln.pooledCache}function Sc(r,i){i===null?D(is,is.current):D(is,i.pool)}function og(){var r=l0();return r===null?null:{parent:Dn._currentValue,pool:r}}var Gs=Error(a(460)),c0=Error(a(474)),Ec=Error(a(542)),Tc={then:function(){}};function lg(r){return r=r.status,r==="fulfilled"||r==="rejected"}function cg(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then(qe,qe),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,dg(r),r;default:if(typeof i.status=="string")i.then(qe,qe);else{if(r=ln,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=f}},function(f){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,dg(r),r}throw os=i,Gs}}function ss(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(os=l,Gs):l}}var os=null;function ug(){if(os===null)throw Error(a(459));var r=os;return os=null,r}function dg(r){if(r===Gs||r===Ec)throw Error(a(483))}var Vs=null,Po=0;function Cc(r){var i=Po;return Po+=1,Vs===null&&(Vs=[]),cg(Vs,r,i)}function Go(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Nc(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function fg(r){function i(de,le){if(r){var pe=de.deletions;pe===null?(de.deletions=[le],de.flags|=16):pe.push(le)}}function l(de,le){if(!r)return null;for(;le!==null;)i(de,le),le=le.sibling;return null}function f(de){for(var le=new Map;de!==null;)de.key!==null?le.set(de.key,de):le.set(de.index,de),de=de.sibling;return le}function b(de,le){return de=Ba(de,le),de.index=0,de.sibling=null,de}function v(de,le,pe){return de.index=pe,r?(pe=de.alternate,pe!==null?(pe=pe.index,pe<le?(de.flags|=67108866,le):pe):(de.flags|=67108866,le)):(de.flags|=1048576,le)}function C(de){return r&&de.alternate===null&&(de.flags|=67108866),de}function z(de,le,pe,Ee){return le===null||le.tag!==6?(le=Xd(pe,de.mode,Ee),le.return=de,le):(le=b(le,pe),le.return=de,le)}function ie(de,le,pe,Ee){var it=pe.type;return it===T?Se(de,le,pe.props.children,Ee,pe.key):le!==null&&(le.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&ss(it)===le.type)?(le=b(le,pe.props),Go(le,pe),le.return=de,le):(le=yc(pe.type,pe.key,pe.props,null,de.mode,Ee),Go(le,pe),le.return=de,le)}function ge(de,le,pe,Ee){return le===null||le.tag!==4||le.stateNode.containerInfo!==pe.containerInfo||le.stateNode.implementation!==pe.implementation?(le=Qd(pe,de.mode,Ee),le.return=de,le):(le=b(le,pe.children||[]),le.return=de,le)}function Se(de,le,pe,Ee,it){return le===null||le.tag!==7?(le=ts(pe,de.mode,Ee,it),le.return=de,le):(le=b(le,pe),le.return=de,le)}function Ce(de,le,pe){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=Xd(""+le,de.mode,pe),le.return=de,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case y:return pe=yc(le.type,le.key,le.props,null,de.mode,pe),Go(pe,le),pe.return=de,pe;case S:return le=Qd(le,de.mode,pe),le.return=de,le;case Z:return le=ss(le),Ce(de,le,pe)}if(H(le)||W(le))return le=ts(le,de.mode,pe,null),le.return=de,le;if(typeof le.then=="function")return Ce(de,Cc(le),pe);if(le.$$typeof===_)return Ce(de,kc(de,le),pe);Nc(de,le)}return null}function ve(de,le,pe,Ee){var it=le!==null?le.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return it!==null?null:z(de,le,""+pe,Ee);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case y:return pe.key===it?ie(de,le,pe,Ee):null;case S:return pe.key===it?ge(de,le,pe,Ee):null;case Z:return pe=ss(pe),ve(de,le,pe,Ee)}if(H(pe)||W(pe))return it!==null?null:Se(de,le,pe,Ee,null);if(typeof pe.then=="function")return ve(de,le,Cc(pe),Ee);if(pe.$$typeof===_)return ve(de,le,kc(de,pe),Ee);Nc(de,pe)}return null}function xe(de,le,pe,Ee,it){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return de=de.get(pe)||null,z(le,de,""+Ee,it);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case y:return de=de.get(Ee.key===null?pe:Ee.key)||null,ie(le,de,Ee,it);case S:return de=de.get(Ee.key===null?pe:Ee.key)||null,ge(le,de,Ee,it);case Z:return Ee=ss(Ee),xe(de,le,pe,Ee,it)}if(H(Ee)||W(Ee))return de=de.get(pe)||null,Se(le,de,Ee,it,null);if(typeof Ee.then=="function")return xe(de,le,pe,Cc(Ee),it);if(Ee.$$typeof===_)return xe(de,le,pe,kc(le,Ee),it);Nc(le,Ee)}return null}function Ke(de,le,pe,Ee){for(var it=null,Vt=null,Je=le,It=le=0,Ht=null;Je!==null&&It<pe.length;It++){Je.index>It?(Ht=Je,Je=null):Ht=Je.sibling;var Kt=ve(de,Je,pe[It],Ee);if(Kt===null){Je===null&&(Je=Ht);break}r&&Je&&Kt.alternate===null&&i(de,Je),le=v(Kt,le,It),Vt===null?it=Kt:Vt.sibling=Kt,Vt=Kt,Je=Ht}if(It===pe.length)return l(de,Je),Ft&&qa(de,It),it;if(Je===null){for(;It<pe.length;It++)Je=Ce(de,pe[It],Ee),Je!==null&&(le=v(Je,le,It),Vt===null?it=Je:Vt.sibling=Je,Vt=Je);return Ft&&qa(de,It),it}for(Je=f(Je);It<pe.length;It++)Ht=xe(Je,de,It,pe[It],Ee),Ht!==null&&(r&&Ht.alternate!==null&&Je.delete(Ht.key===null?It:Ht.key),le=v(Ht,le,It),Vt===null?it=Ht:Vt.sibling=Ht,Vt=Ht);return r&&Je.forEach(function(zi){return i(de,zi)}),Ft&&qa(de,It),it}function ft(de,le,pe,Ee){if(pe==null)throw Error(a(151));for(var it=null,Vt=null,Je=le,It=le=0,Ht=null,Kt=pe.next();Je!==null&&!Kt.done;It++,Kt=pe.next()){Je.index>It?(Ht=Je,Je=null):Ht=Je.sibling;var zi=ve(de,Je,Kt.value,Ee);if(zi===null){Je===null&&(Je=Ht);break}r&&Je&&zi.alternate===null&&i(de,Je),le=v(zi,le,It),Vt===null?it=zi:Vt.sibling=zi,Vt=zi,Je=Ht}if(Kt.done)return l(de,Je),Ft&&qa(de,It),it;if(Je===null){for(;!Kt.done;It++,Kt=pe.next())Kt=Ce(de,Kt.value,Ee),Kt!==null&&(le=v(Kt,le,It),Vt===null?it=Kt:Vt.sibling=Kt,Vt=Kt);return Ft&&qa(de,It),it}for(Je=f(Je);!Kt.done;It++,Kt=pe.next())Kt=xe(Je,de,It,Kt.value,Ee),Kt!==null&&(r&&Kt.alternate!==null&&Je.delete(Kt.key===null?It:Kt.key),le=v(Kt,le,It),Vt===null?it=Kt:Vt.sibling=Kt,Vt=Kt);return r&&Je.forEach(function(a9){return i(de,a9)}),Ft&&qa(de,It),it}function on(de,le,pe,Ee){if(typeof pe=="object"&&pe!==null&&pe.type===T&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case y:e:{for(var it=pe.key;le!==null;){if(le.key===it){if(it=pe.type,it===T){if(le.tag===7){l(de,le.sibling),Ee=b(le,pe.props.children),Ee.return=de,de=Ee;break e}}else if(le.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===Z&&ss(it)===le.type){l(de,le.sibling),Ee=b(le,pe.props),Go(Ee,pe),Ee.return=de,de=Ee;break e}l(de,le);break}else i(de,le);le=le.sibling}pe.type===T?(Ee=ts(pe.props.children,de.mode,Ee,pe.key),Ee.return=de,de=Ee):(Ee=yc(pe.type,pe.key,pe.props,null,de.mode,Ee),Go(Ee,pe),Ee.return=de,de=Ee)}return C(de);case S:e:{for(it=pe.key;le!==null;){if(le.key===it)if(le.tag===4&&le.stateNode.containerInfo===pe.containerInfo&&le.stateNode.implementation===pe.implementation){l(de,le.sibling),Ee=b(le,pe.children||[]),Ee.return=de,de=Ee;break e}else{l(de,le);break}else i(de,le);le=le.sibling}Ee=Qd(pe,de.mode,Ee),Ee.return=de,de=Ee}return C(de);case Z:return pe=ss(pe),on(de,le,pe,Ee)}if(H(pe))return Ke(de,le,pe,Ee);if(W(pe)){if(it=W(pe),typeof it!="function")throw Error(a(150));return pe=it.call(pe),ft(de,le,pe,Ee)}if(typeof pe.then=="function")return on(de,le,Cc(pe),Ee);if(pe.$$typeof===_)return on(de,le,kc(de,pe),Ee);Nc(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,le!==null&&le.tag===6?(l(de,le.sibling),Ee=b(le,pe),Ee.return=de,de=Ee):(l(de,le),Ee=Xd(pe,de.mode,Ee),Ee.return=de,de=Ee),C(de)):l(de,le)}return function(de,le,pe,Ee){try{Po=0;var it=on(de,le,pe,Ee);return Vs=null,it}catch(Je){if(Je===Gs||Je===Ec)throw Je;var Vt=jr(29,Je,null,de.mode);return Vt.lanes=Ee,Vt.return=de,Vt}}}var ls=fg(!0),hg=fg(!1),xi=!1;function u0(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function d0(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function wi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ki(r,i,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Zt&2)!==0){var b=f.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),f.pending=i,i=vc(r),Zp(r,null,l),i}return bc(r,f,i,l),vc(r)}function Vo(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,dt(r,l)}}function f0(r,i){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var b=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var C={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?b=v=C:v=v.next=C,l=l.next}while(l!==null);v===null?b=v=i:v=v.next=i}else b=v=i;l={baseState:f.baseState,firstBaseUpdate:b,lastBaseUpdate:v,shared:f.shared,callbacks:f.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var h0=!1;function Ko(){if(h0){var r=Ps;if(r!==null)throw r}}function Yo(r,i,l,f){h0=!1;var b=r.updateQueue;xi=!1;var v=b.firstBaseUpdate,C=b.lastBaseUpdate,z=b.shared.pending;if(z!==null){b.shared.pending=null;var ie=z,ge=ie.next;ie.next=null,C===null?v=ge:C.next=ge,C=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,z=Se.lastBaseUpdate,z!==C&&(z===null?Se.firstBaseUpdate=ge:z.next=ge,Se.lastBaseUpdate=ie))}if(v!==null){var Ce=b.baseState;C=0,Se=ge=ie=null,z=v;do{var ve=z.lane&-536870913,xe=ve!==z.lane;if(xe?(qt&ve)===ve:(f&ve)===ve){ve!==0&&ve===$s&&(h0=!0),Se!==null&&(Se=Se.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Ke=r,ft=z;ve=i;var on=l;switch(ft.tag){case 1:if(Ke=ft.payload,typeof Ke=="function"){Ce=Ke.call(on,Ce,ve);break e}Ce=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=ft.payload,ve=typeof Ke=="function"?Ke.call(on,Ce,ve):Ke,ve==null)break e;Ce=g({},Ce,ve);break e;case 2:xi=!0}}ve=z.callback,ve!==null&&(r.flags|=64,xe&&(r.flags|=8192),xe=b.callbacks,xe===null?b.callbacks=[ve]:xe.push(ve))}else xe={lane:ve,tag:z.tag,payload:z.payload,callback:z.callback,next:null},Se===null?(ge=Se=xe,ie=Ce):Se=Se.next=xe,C|=ve;if(z=z.next,z===null){if(z=b.shared.pending,z===null)break;xe=z,z=xe.next,xe.next=null,b.lastBaseUpdate=xe,b.shared.pending=null}}while(!0);Se===null&&(ie=Ce),b.baseState=ie,b.firstBaseUpdate=ge,b.lastBaseUpdate=Se,v===null&&(b.shared.lanes=0),Ni|=C,r.lanes=C,r.memoizedState=Ce}}function mg(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function pg(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)mg(l[r],i)}var Ks=G(null),Rc=G(0);function gg(r,i){r=Za,D(Rc,r),D(Ks,i),Za=r|i.baseLanes}function m0(){D(Rc,Za),D(Ks,Ks.current)}function p0(){Za=Rc.current,Y(Ks),Y(Rc)}var Lr=G(null),ta=null;function Si(r){var i=r.alternate;D(In,In.current&1),D(Lr,r),ta===null&&(i===null||Ks.current!==null||i.memoizedState!==null)&&(ta=r)}function g0(r){D(In,In.current),D(Lr,r),ta===null&&(ta=r)}function bg(r){r.tag===22?(D(In,In.current),D(Lr,r),ta===null&&(ta=r)):Ei()}function Ei(){D(In,In.current),D(Lr,Lr.current)}function zr(r){Y(Lr),ta===r&&(ta=null),Y(In)}var In=G(0);function Ac(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Sf(l)||Ef(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Fa=0,Nt=null,an=null,jn=null,Ic=!1,Ys=!1,cs=!1,_c=0,Wo=0,Ws=null,Yx=0;function Cn(){throw Error(a(321))}function b0(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Dr(r[l],i[l]))return!1;return!0}function v0(r,i,l,f,b,v){return Fa=v,Nt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=r===null||r.memoizedState===null?e4:O0,cs=!1,v=l(f,b),cs=!1,Ys&&(v=yg(i,l,f,b)),vg(r),v}function vg(r){I.H=Qo;var i=an!==null&&an.next!==null;if(Fa=0,jn=an=Nt=null,Ic=!1,Wo=0,Ws=null,i)throw Error(a(300));r===null||Ln||(r=r.dependencies,r!==null&&wc(r)&&(Ln=!0))}function yg(r,i,l,f){Nt=r;var b=0;do{if(Ys&&(Ws=null),Wo=0,Ys=!1,25<=b)throw Error(a(301));if(b+=1,jn=an=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}I.H=t4,v=i(l,f)}while(Ys);return v}function Wx(){var r=I.H,i=r.useState()[0];return i=typeof i.then=="function"?Zo(i):i,r=r.useState()[0],(an!==null?an.memoizedState:null)!==r&&(Nt.flags|=1024),i}function y0(){var r=_c!==0;return _c=0,r}function x0(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function w0(r){if(Ic){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ic=!1}Fa=0,jn=an=Nt=null,Ys=!1,Wo=_c=0,Ws=null}function hr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Nt.memoizedState=jn=r:jn=jn.next=r,jn}function _n(){if(an===null){var r=Nt.alternate;r=r!==null?r.memoizedState:null}else r=an.next;var i=jn===null?Nt.memoizedState:jn.next;if(i!==null)jn=i,an=r;else{if(r===null)throw Nt.alternate===null?Error(a(467)):Error(a(310));an=r,r={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},jn===null?Nt.memoizedState=jn=r:jn=jn.next=r}return jn}function Mc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zo(r){var i=Wo;return Wo+=1,Ws===null&&(Ws=[]),r=cg(Ws,r,i),i=Nt,(jn===null?i.memoizedState:jn.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?e4:O0),r}function Oc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Zo(r);if(r.$$typeof===_)return nr(r)}throw Error(a(438,String(r)))}function k0(r){var i=null,l=Nt.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var f=Nt.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Mc(),Nt.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),f=0;f<r;f++)l[f]=$;return i.index++,l}function $a(r,i){return typeof i=="function"?i(r):i}function Dc(r){var i=_n();return S0(i,an,r)}function S0(r,i,l){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=l;var b=r.baseQueue,v=f.pending;if(v!==null){if(b!==null){var C=b.next;b.next=v.next,v.next=C}i.baseQueue=b=v,f.pending=null}if(v=r.baseState,b===null)r.memoizedState=v;else{i=b.next;var z=C=null,ie=null,ge=i,Se=!1;do{var Ce=ge.lane&-536870913;if(Ce!==ge.lane?(qt&Ce)===Ce:(Fa&Ce)===Ce){var ve=ge.revertLane;if(ve===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ce===$s&&(Se=!0);else if((Fa&ve)===ve){ge=ge.next,ve===$s&&(Se=!0);continue}else Ce={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ie===null?(z=ie=Ce,C=v):ie=ie.next=Ce,Nt.lanes|=ve,Ni|=ve;Ce=ge.action,cs&&l(v,Ce),v=ge.hasEagerState?ge.eagerState:l(v,Ce)}else ve={lane:Ce,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ie===null?(z=ie=ve,C=v):ie=ie.next=ve,Nt.lanes|=Ce,Ni|=Ce;ge=ge.next}while(ge!==null&&ge!==i);if(ie===null?C=v:ie.next=z,!Dr(v,r.memoizedState)&&(Ln=!0,Se&&(l=Ps,l!==null)))throw l;r.memoizedState=v,r.baseState=C,r.baseQueue=ie,f.lastRenderedState=v}return b===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function E0(r){var i=_n(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var f=l.dispatch,b=l.pending,v=i.memoizedState;if(b!==null){l.pending=null;var C=b=b.next;do v=r(v,C.action),C=C.next;while(C!==b);Dr(v,i.memoizedState)||(Ln=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,f]}function xg(r,i,l){var f=Nt,b=_n(),v=Ft;if(v){if(l===void 0)throw Error(a(407));l=l()}else l=i();var C=!Dr((an||b).memoizedState,l);if(C&&(b.memoizedState=l,Ln=!0),b=b.queue,N0(Sg.bind(null,f,b,r),[r]),b.getSnapshot!==i||C||jn!==null&&jn.memoizedState.tag&1){if(f.flags|=2048,Zs(9,{destroy:void 0},kg.bind(null,f,b,l,i),null),ln===null)throw Error(a(349));v||(Fa&127)!==0||wg(f,i,l)}return l}function wg(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Nt.updateQueue,i===null?(i=Mc(),Nt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function kg(r,i,l,f){i.value=l,i.getSnapshot=f,Eg(i)&&Tg(r)}function Sg(r,i,l){return l(function(){Eg(i)&&Tg(r)})}function Eg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Dr(r,l)}catch{return!0}}function Tg(r){var i=es(r,2);i!==null&&Tr(i,r,2)}function T0(r){var i=hr();if(typeof r=="function"){var l=r;if(r=l(),cs){Mt(!0);try{l()}finally{Mt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:r},i}function Cg(r,i,l,f){return r.baseState=l,S0(r,an,typeof f=="function"?f:$a)}function Zx(r,i,l,f,b){if(zc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};I.T!==null?l(!0):v.isTransition=!1,f(v),l=i.pending,l===null?(v.next=i.pending=v,Ng(i,v)):(v.next=l.next,i.pending=l.next=v)}}function Ng(r,i){var l=i.action,f=i.payload,b=r.state;if(i.isTransition){var v=I.T,C={};I.T=C;try{var z=l(b,f),ie=I.S;ie!==null&&ie(C,z),Rg(r,i,z)}catch(ge){C0(r,i,ge)}finally{v!==null&&C.types!==null&&(v.types=C.types),I.T=v}}else try{v=l(b,f),Rg(r,i,v)}catch(ge){C0(r,i,ge)}}function Rg(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){Ag(r,i,f)},function(f){return C0(r,i,f)}):Ag(r,i,l)}function Ag(r,i,l){i.status="fulfilled",i.value=l,Ig(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,Ng(r,l)))}function C0(r,i,l){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=l,Ig(i),i=i.next;while(i!==f)}r.action=null}function Ig(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function _g(r,i){return i}function Mg(r,i){if(Ft){var l=ln.formState;if(l!==null){e:{var f=Nt;if(Ft){if(mn){t:{for(var b=mn,v=ea;b.nodeType!==8;){if(!v){b=null;break t}if(b=na(b.nextSibling),b===null){b=null;break t}}v=b.data,b=v==="F!"||v==="F"?b:null}if(b){mn=na(b.nextSibling),f=b.data==="F!";break e}}vi(f)}f=!1}f&&(i=l[0])}}return l=hr(),l.memoizedState=l.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_g,lastRenderedState:i},l.queue=f,l=Xg.bind(null,Nt,f),f.dispatch=l,f=T0(!1),v=M0.bind(null,Nt,!1,f.queue),f=hr(),b={state:i,dispatch:null,action:r,pending:null},f.queue=b,l=Zx.bind(null,Nt,b,v,l),b.dispatch=l,f.memoizedState=r,[i,l,!1]}function Og(r){var i=_n();return Dg(i,an,r)}function Dg(r,i,l){if(i=S0(r,i,_g)[0],r=Dc($a)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Zo(i)}catch(C){throw C===Gs?Ec:C}else f=i;i=_n();var b=i.queue,v=b.dispatch;return l!==i.memoizedState&&(Nt.flags|=2048,Zs(9,{destroy:void 0},Xx.bind(null,b,l),null)),[f,v,r]}function Xx(r,i){r.action=i}function jg(r){var i=_n(),l=an;if(l!==null)return Dg(i,l,r);_n(),i=i.memoizedState,l=_n();var f=l.queue.dispatch;return l.memoizedState=r,[i,f,!1]}function Zs(r,i,l,f){return r={tag:r,create:l,deps:f,inst:i,next:null},i=Nt.updateQueue,i===null&&(i=Mc(),Nt.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(f=l.next,l.next=r,r.next=f,i.lastEffect=r),r}function Lg(){return _n().memoizedState}function jc(r,i,l,f){var b=hr();Nt.flags|=r,b.memoizedState=Zs(1|i,{destroy:void 0},l,f===void 0?null:f)}function Lc(r,i,l,f){var b=_n();f=f===void 0?null:f;var v=b.memoizedState.inst;an!==null&&f!==null&&b0(f,an.memoizedState.deps)?b.memoizedState=Zs(i,v,l,f):(Nt.flags|=r,b.memoizedState=Zs(1|i,v,l,f))}function zg(r,i){jc(8390656,8,r,i)}function N0(r,i){Lc(2048,8,r,i)}function Qx(r){Nt.flags|=4;var i=Nt.updateQueue;if(i===null)i=Mc(),Nt.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function Bg(r){var i=_n().memoizedState;return Qx({ref:i,nextImpl:r}),function(){if((Zt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function qg(r,i){return Lc(4,2,r,i)}function Hg(r,i){return Lc(4,4,r,i)}function Ug(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Fg(r,i,l){l=l!=null?l.concat([r]):null,Lc(4,4,Ug.bind(null,i,r),l)}function R0(){}function $g(r,i){var l=_n();i=i===void 0?null:i;var f=l.memoizedState;return i!==null&&b0(i,f[1])?f[0]:(l.memoizedState=[r,i],r)}function Pg(r,i){var l=_n();i=i===void 0?null:i;var f=l.memoizedState;if(i!==null&&b0(i,f[1]))return f[0];if(f=r(),cs){Mt(!0);try{r()}finally{Mt(!1)}}return l.memoizedState=[f,i],f}function A0(r,i,l){return l===void 0||(Fa&1073741824)!==0&&(qt&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=G4(),Nt.lanes|=r,Ni|=r,l)}function Gg(r,i,l,f){return Dr(l,i)?l:Ks.current!==null?(r=A0(r,l,f),Dr(r,i)||(Ln=!0),r):(Fa&42)===0||(Fa&1073741824)!==0&&(qt&261930)===0?(Ln=!0,r.memoizedState=l):(r=G4(),Nt.lanes|=r,Ni|=r,i)}function Vg(r,i,l,f,b){var v=K.p;K.p=v!==0&&8>v?v:8;var C=I.T,z={};I.T=z,M0(r,!1,i,l);try{var ie=b(),ge=I.S;if(ge!==null&&ge(z,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=Kx(ie,f);Xo(r,i,Se,Hr(r))}else Xo(r,i,f,Hr(r))}catch(Ce){Xo(r,i,{then:function(){},status:"rejected",reason:Ce},Hr())}finally{K.p=v,C!==null&&z.types!==null&&(C.types=z.types),I.T=C}}function Jx(){}function I0(r,i,l,f){if(r.tag!==5)throw Error(a(476));var b=Kg(r).queue;Vg(r,b,i,X,l===null?Jx:function(){return Yg(r),l(f)})}function Kg(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:X},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$a,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Yg(r){var i=Kg(r);i.next===null&&(i=r.alternate.memoizedState),Xo(r,i.next.queue,{},Hr())}function _0(){return nr(ml)}function Wg(){return _n().memoizedState}function Zg(){return _n().memoizedState}function e8(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Hr();r=wi(l);var f=ki(i,r,l);f!==null&&(Tr(f,i,l),Vo(f,i,l)),i={cache:s0()},r.payload=i;return}i=i.return}}function t8(r,i,l){var f=Hr();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zc(r)?Qg(i,l):(l=Wd(r,i,l,f),l!==null&&(Tr(l,r,f),Jg(l,i,f)))}function Xg(r,i,l){var f=Hr();Xo(r,i,l,f)}function Xo(r,i,l,f){var b={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zc(r))Qg(i,b);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var C=i.lastRenderedState,z=v(C,l);if(b.hasEagerState=!0,b.eagerState=z,Dr(z,C))return bc(r,i,b,0),ln===null&&gc(),!1}catch{}if(l=Wd(r,i,b,f),l!==null)return Tr(l,r,f),Jg(l,i,f),!0}return!1}function M0(r,i,l,f){if(f={lane:2,revertLane:df(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},zc(r)){if(i)throw Error(a(479))}else i=Wd(r,l,f,2),i!==null&&Tr(i,r,2)}function zc(r){var i=r.alternate;return r===Nt||i!==null&&i===Nt}function Qg(r,i){Ys=Ic=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function Jg(r,i,l){if((l&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,dt(r,l)}}var Qo={readContext:nr,use:Oc,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useLayoutEffect:Cn,useInsertionEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useSyncExternalStore:Cn,useId:Cn,useHostTransitionStatus:Cn,useFormState:Cn,useActionState:Cn,useOptimistic:Cn,useMemoCache:Cn,useCacheRefresh:Cn};Qo.useEffectEvent=Cn;var e4={readContext:nr,use:Oc,useCallback:function(r,i){return hr().memoizedState=[r,i===void 0?null:i],r},useContext:nr,useEffect:zg,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,jc(4194308,4,Ug.bind(null,i,r),l)},useLayoutEffect:function(r,i){return jc(4194308,4,r,i)},useInsertionEffect:function(r,i){jc(4,2,r,i)},useMemo:function(r,i){var l=hr();i=i===void 0?null:i;var f=r();if(cs){Mt(!0);try{r()}finally{Mt(!1)}}return l.memoizedState=[f,i],f},useReducer:function(r,i,l){var f=hr();if(l!==void 0){var b=l(i);if(cs){Mt(!0);try{l(i)}finally{Mt(!1)}}}else b=i;return f.memoizedState=f.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},f.queue=r,r=r.dispatch=t8.bind(null,Nt,r),[f.memoizedState,r]},useRef:function(r){var i=hr();return r={current:r},i.memoizedState=r},useState:function(r){r=T0(r);var i=r.queue,l=Xg.bind(null,Nt,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:R0,useDeferredValue:function(r,i){var l=hr();return A0(l,r,i)},useTransition:function(){var r=T0(!1);return r=Vg.bind(null,Nt,r.queue,!0,!1),hr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var f=Nt,b=hr();if(Ft){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ln===null)throw Error(a(349));(qt&127)!==0||wg(f,i,l)}b.memoizedState=l;var v={value:l,getSnapshot:i};return b.queue=v,zg(Sg.bind(null,f,v,r),[r]),f.flags|=2048,Zs(9,{destroy:void 0},kg.bind(null,f,v,l,i),null),l},useId:function(){var r=hr(),i=ln.identifierPrefix;if(Ft){var l=wa,f=xa;l=(f&~(1<<32-Tt(f)-1)).toString(32)+l,i="_"+i+"R_"+l,l=_c++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=Yx++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:_0,useFormState:Mg,useActionState:Mg,useOptimistic:function(r){var i=hr();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=M0.bind(null,Nt,!0,l),l.dispatch=i,[r,i]},useMemoCache:k0,useCacheRefresh:function(){return hr().memoizedState=e8.bind(null,Nt)},useEffectEvent:function(r){var i=hr(),l={impl:r};return i.memoizedState=l,function(){if((Zt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},O0={readContext:nr,use:Oc,useCallback:$g,useContext:nr,useEffect:N0,useImperativeHandle:Fg,useInsertionEffect:qg,useLayoutEffect:Hg,useMemo:Pg,useReducer:Dc,useRef:Lg,useState:function(){return Dc($a)},useDebugValue:R0,useDeferredValue:function(r,i){var l=_n();return Gg(l,an.memoizedState,r,i)},useTransition:function(){var r=Dc($a)[0],i=_n().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:xg,useId:Wg,useHostTransitionStatus:_0,useFormState:Og,useActionState:Og,useOptimistic:function(r,i){var l=_n();return Cg(l,an,r,i)},useMemoCache:k0,useCacheRefresh:Zg};O0.useEffectEvent=Bg;var t4={readContext:nr,use:Oc,useCallback:$g,useContext:nr,useEffect:N0,useImperativeHandle:Fg,useInsertionEffect:qg,useLayoutEffect:Hg,useMemo:Pg,useReducer:E0,useRef:Lg,useState:function(){return E0($a)},useDebugValue:R0,useDeferredValue:function(r,i){var l=_n();return an===null?A0(l,r,i):Gg(l,an.memoizedState,r,i)},useTransition:function(){var r=E0($a)[0],i=_n().memoizedState;return[typeof r=="boolean"?r:Zo(r),i]},useSyncExternalStore:xg,useId:Wg,useHostTransitionStatus:_0,useFormState:jg,useActionState:jg,useOptimistic:function(r,i){var l=_n();return an!==null?Cg(l,an,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:k0,useCacheRefresh:Zg};t4.useEffectEvent=Bg;function D0(r,i,l,f){i=r.memoizedState,l=l(f,i),l=l==null?i:g({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var j0={enqueueSetState:function(r,i,l){r=r._reactInternals;var f=Hr(),b=wi(f);b.payload=i,l!=null&&(b.callback=l),i=ki(r,b,f),i!==null&&(Tr(i,r,f),Vo(i,r,f))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var f=Hr(),b=wi(f);b.tag=1,b.payload=i,l!=null&&(b.callback=l),i=ki(r,b,f),i!==null&&(Tr(i,r,f),Vo(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Hr(),f=wi(l);f.tag=2,i!=null&&(f.callback=i),i=ki(r,f,l),i!==null&&(Tr(i,r,l),Vo(i,r,l))}};function n4(r,i,l,f,b,v,C){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,v,C):i.prototype&&i.prototype.isPureReactComponent?!Bo(l,f)||!Bo(b,v):!0}function r4(r,i,l,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==r&&j0.enqueueReplaceState(i,i.state,null)}function us(r,i){var l=i;if("ref"in i){l={};for(var f in i)f!=="ref"&&(l[f]=i[f])}if(r=r.defaultProps){l===i&&(l=g({},l));for(var b in r)l[b]===void 0&&(l[b]=r[b])}return l}function a4(r){pc(r)}function i4(r){console.error(r)}function s4(r){pc(r)}function Bc(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function o4(r,i,l){try{var f=r.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function L0(r,i,l){return l=wi(l),l.tag=3,l.payload={element:null},l.callback=function(){Bc(r,i)},l}function l4(r){return r=wi(r),r.tag=3,r}function c4(r,i,l,f){var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var v=f.value;r.payload=function(){return b(v)},r.callback=function(){o4(i,l,f)}}var C=l.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(r.callback=function(){o4(i,l,f),typeof b!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var z=f.stack;this.componentDidCatch(f.value,{componentStack:z!==null?z:""})})}function n8(r,i,l,f,b){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=l.alternate,i!==null&&Fs(i,l,b,!0),l=Lr.current,l!==null){switch(l.tag){case 31:case 13:return ta===null?Zc():l.alternate===null&&Nn===0&&(Nn=3),l.flags&=-257,l.flags|=65536,l.lanes=b,f===Tc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([f]):i.add(f),lf(r,f,b)),!1;case 22:return l.flags|=65536,f===Tc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([f]):l.add(f)),lf(r,f,b)),!1}throw Error(a(435,l.tag))}return lf(r,f,b),Zc(),!1}if(Ft)return i=Lr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,f!==t0&&(r=Error(a(422),{cause:f}),Uo(Xr(r,l)))):(f!==t0&&(i=Error(a(423),{cause:f}),Uo(Xr(i,l))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,f=Xr(f,l),b=L0(r.stateNode,f,b),f0(r,b),Nn!==4&&(Nn=2)),!1;var v=Error(a(520),{cause:f});if(v=Xr(v,l),sl===null?sl=[v]:sl.push(v),Nn!==4&&(Nn=2),i===null)return!0;f=Xr(f,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=b&-b,l.lanes|=r,r=L0(l.stateNode,f,r),f0(l,r),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ri===null||!Ri.has(v))))return l.flags|=65536,b&=-b,l.lanes|=b,b=l4(b),c4(b,r,l,f),f0(l,b),!1}l=l.return}while(l!==null);return!1}var z0=Error(a(461)),Ln=!1;function rr(r,i,l,f){i.child=r===null?hg(i,null,l,f):ls(i,r.child,l,f)}function u4(r,i,l,f,b){l=l.render;var v=i.ref;if("ref"in f){var C={};for(var z in f)z!=="ref"&&(C[z]=f[z])}else C=f;return as(i),f=v0(r,i,l,C,v,b),z=y0(),r!==null&&!Ln?(x0(r,i,b),Pa(r,i,b)):(Ft&&z&&Jd(i),i.flags|=1,rr(r,i,f,b),i.child)}function d4(r,i,l,f,b){if(r===null){var v=l.type;return typeof v=="function"&&!Zd(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,f4(r,i,v,f,b)):(r=yc(l.type,null,f,i,i.mode,b),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!G0(r,b)){var C=v.memoizedProps;if(l=l.compare,l=l!==null?l:Bo,l(C,f)&&r.ref===i.ref)return Pa(r,i,b)}return i.flags|=1,r=Ba(v,f),r.ref=i.ref,r.return=i,i.child=r}function f4(r,i,l,f,b){if(r!==null){var v=r.memoizedProps;if(Bo(v,f)&&r.ref===i.ref)if(Ln=!1,i.pendingProps=f=v,G0(r,b))(r.flags&131072)!==0&&(Ln=!0);else return i.lanes=r.lanes,Pa(r,i,b)}return B0(r,i,l,f,b)}function h4(r,i,l,f){var b=f.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(f=i.child=r.child,b=0;f!==null;)b=b|f.lanes|f.childLanes,f=f.sibling;f=b&~v}else f=0,i.child=null;return m4(r,i,v,l,f)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Sc(i,v!==null?v.cachePool:null),v!==null?gg(i,v):m0(),bg(i);else return f=i.lanes=536870912,m4(r,i,v!==null?v.baseLanes|l:l,l,f)}else v!==null?(Sc(i,v.cachePool),gg(i,v),Ei(),i.memoizedState=null):(r!==null&&Sc(i,null),m0(),Ei());return rr(r,i,b,l),i.child}function Jo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function m4(r,i,l,f,b){var v=l0();return v=v===null?null:{parent:Dn._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},r!==null&&Sc(i,null),m0(),bg(i),r!==null&&Fs(r,i,f,!0),i.childLanes=b,null}function qc(r,i){return i=Uc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function p4(r,i,l){return ls(i,r.child,null,l),r=qc(i,i.pendingProps),r.flags|=2,zr(i),i.memoizedState=null,r}function r8(r,i,l){var f=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Ft){if(f.mode==="hidden")return r=qc(i,f),i.lanes=536870912,Jo(null,r);if(g0(i),(r=mn)?(r=N2(r,ea),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:gi!==null?{id:xa,overflow:wa}:null,retryLane:536870912,hydrationErrors:null},l=Qp(r),l.return=i,i.child=l,tr=i,mn=null)):r=null,r===null)throw vi(i);return i.lanes=536870912,null}return qc(i,f)}var v=r.memoizedState;if(v!==null){var C=v.dehydrated;if(g0(i),b)if(i.flags&256)i.flags&=-257,i=p4(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ln||Fs(r,i,l,!1),b=(l&r.childLanes)!==0,Ln||b){if(f=ln,f!==null&&(C=xn(f,l),C!==0&&C!==v.retryLane))throw v.retryLane=C,es(r,C),Tr(f,r,C),z0;Zc(),i=p4(r,i,l)}else r=v.treeContext,mn=na(C.nextSibling),tr=i,Ft=!0,bi=null,ea=!1,r!==null&&tg(i,r),i=qc(i,f),i.flags|=4096;return i}return r=Ba(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Hc(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function B0(r,i,l,f,b){return as(i),l=v0(r,i,l,f,void 0,b),f=y0(),r!==null&&!Ln?(x0(r,i,b),Pa(r,i,b)):(Ft&&f&&Jd(i),i.flags|=1,rr(r,i,l,b),i.child)}function g4(r,i,l,f,b,v){return as(i),i.updateQueue=null,l=yg(i,f,l,b),vg(r),f=y0(),r!==null&&!Ln?(x0(r,i,v),Pa(r,i,v)):(Ft&&f&&Jd(i),i.flags|=1,rr(r,i,l,v),i.child)}function b4(r,i,l,f,b){if(as(i),i.stateNode===null){var v=Bs,C=l.contextType;typeof C=="object"&&C!==null&&(v=nr(C)),v=new l(f,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=j0,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=f,v.state=i.memoizedState,v.refs={},u0(i),C=l.contextType,v.context=typeof C=="object"&&C!==null?nr(C):Bs,v.state=i.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(D0(i,l,C,f),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&j0.enqueueReplaceState(v,v.state,null),Yo(i,f,v,b),Ko(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){v=i.stateNode;var z=i.memoizedProps,ie=us(l,z);v.props=ie;var ge=v.context,Se=l.contextType;C=Bs,typeof Se=="object"&&Se!==null&&(C=nr(Se));var Ce=l.getDerivedStateFromProps;Se=typeof Ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",z=i.pendingProps!==z,Se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(z||ge!==C)&&r4(i,v,f,C),xi=!1;var ve=i.memoizedState;v.state=ve,Yo(i,f,v,b),Ko(),ge=i.memoizedState,z||ve!==ge||xi?(typeof Ce=="function"&&(D0(i,l,Ce,f),ge=i.memoizedState),(ie=xi||n4(i,l,ie,f,ve,ge,C))?(Se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=ge),v.props=f,v.state=ge,v.context=C,f=ie):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{v=i.stateNode,d0(r,i),C=i.memoizedProps,Se=us(l,C),v.props=Se,Ce=i.pendingProps,ve=v.context,ge=l.contextType,ie=Bs,typeof ge=="object"&&ge!==null&&(ie=nr(ge)),z=l.getDerivedStateFromProps,(ge=typeof z=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==Ce||ve!==ie)&&r4(i,v,f,ie),xi=!1,ve=i.memoizedState,v.state=ve,Yo(i,f,v,b),Ko();var xe=i.memoizedState;C!==Ce||ve!==xe||xi||r!==null&&r.dependencies!==null&&wc(r.dependencies)?(typeof z=="function"&&(D0(i,l,z,f),xe=i.memoizedState),(Se=xi||n4(i,l,Se,f,ve,xe,ie)||r!==null&&r.dependencies!==null&&wc(r.dependencies))?(ge||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,xe,ie),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,xe,ie)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=xe),v.props=f,v.state=xe,v.context=ie,f=Se):(typeof v.componentDidUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&ve===r.memoizedState||(i.flags|=1024),f=!1)}return v=f,Hc(r,i),f=(i.flags&128)!==0,v||f?(v=i.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&f?(i.child=ls(i,r.child,null,b),i.child=ls(i,null,l,b)):rr(r,i,l,b),i.memoizedState=v.state,r=i.child):r=Pa(r,i,b),r}function v4(r,i,l,f){return ns(),i.flags|=256,rr(r,i,l,f),i.child}var q0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function H0(r){return{baseLanes:r,cachePool:og()}}function U0(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=qr),r}function y4(r,i,l){var f=i.pendingProps,b=!1,v=(i.flags&128)!==0,C;if((C=v)||(C=r!==null&&r.memoizedState===null?!1:(In.current&2)!==0),C&&(b=!0,i.flags&=-129),C=(i.flags&32)!==0,i.flags&=-33,r===null){if(Ft){if(b?Si(i):Ei(),(r=mn)?(r=N2(r,ea),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:gi!==null?{id:xa,overflow:wa}:null,retryLane:536870912,hydrationErrors:null},l=Qp(r),l.return=i,i.child=l,tr=i,mn=null)):r=null,r===null)throw vi(i);return Ef(r)?i.lanes=32:i.lanes=536870912,null}var z=f.children;return f=f.fallback,b?(Ei(),b=i.mode,z=Uc({mode:"hidden",children:z},b),f=ts(f,b,l,null),z.return=i,f.return=i,z.sibling=f,i.child=z,f=i.child,f.memoizedState=H0(l),f.childLanes=U0(r,C,l),i.memoizedState=q0,Jo(null,f)):(Si(i),F0(i,z))}var ie=r.memoizedState;if(ie!==null&&(z=ie.dehydrated,z!==null)){if(v)i.flags&256?(Si(i),i.flags&=-257,i=$0(r,i,l)):i.memoizedState!==null?(Ei(),i.child=r.child,i.flags|=128,i=null):(Ei(),z=f.fallback,b=i.mode,f=Uc({mode:"visible",children:f.children},b),z=ts(z,b,l,null),z.flags|=2,f.return=i,z.return=i,f.sibling=z,i.child=f,ls(i,r.child,null,l),f=i.child,f.memoizedState=H0(l),f.childLanes=U0(r,C,l),i.memoizedState=q0,i=Jo(null,f));else if(Si(i),Ef(z)){if(C=z.nextSibling&&z.nextSibling.dataset,C)var ge=C.dgst;C=ge,f=Error(a(419)),f.stack="",f.digest=C,Uo({value:f,source:null,stack:null}),i=$0(r,i,l)}else if(Ln||Fs(r,i,l,!1),C=(l&r.childLanes)!==0,Ln||C){if(C=ln,C!==null&&(f=xn(C,l),f!==0&&f!==ie.retryLane))throw ie.retryLane=f,es(r,f),Tr(C,r,f),z0;Sf(z)||Zc(),i=$0(r,i,l)}else Sf(z)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,mn=na(z.nextSibling),tr=i,Ft=!0,bi=null,ea=!1,r!==null&&tg(i,r),i=F0(i,f.children),i.flags|=4096);return i}return b?(Ei(),z=f.fallback,b=i.mode,ie=r.child,ge=ie.sibling,f=Ba(ie,{mode:"hidden",children:f.children}),f.subtreeFlags=ie.subtreeFlags&65011712,ge!==null?z=Ba(ge,z):(z=ts(z,b,l,null),z.flags|=2),z.return=i,f.return=i,f.sibling=z,i.child=f,Jo(null,f),f=i.child,z=r.child.memoizedState,z===null?z=H0(l):(b=z.cachePool,b!==null?(ie=Dn._currentValue,b=b.parent!==ie?{parent:ie,pool:ie}:b):b=og(),z={baseLanes:z.baseLanes|l,cachePool:b}),f.memoizedState=z,f.childLanes=U0(r,C,l),i.memoizedState=q0,Jo(r.child,f)):(Si(i),l=r.child,r=l.sibling,l=Ba(l,{mode:"visible",children:f.children}),l.return=i,l.sibling=null,r!==null&&(C=i.deletions,C===null?(i.deletions=[r],i.flags|=16):C.push(r)),i.child=l,i.memoizedState=null,l)}function F0(r,i){return i=Uc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Uc(r,i){return r=jr(22,r,null,i),r.lanes=0,r}function $0(r,i,l){return ls(i,r.child,null,l),r=F0(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function x4(r,i,l){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),a0(r.return,i,l)}function P0(r,i,l,f,b,v){var C=r.memoizedState;C===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:b,treeForkCount:v}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=f,C.tail=l,C.tailMode=b,C.treeForkCount=v)}function w4(r,i,l){var f=i.pendingProps,b=f.revealOrder,v=f.tail;f=f.children;var C=In.current,z=(C&2)!==0;if(z?(C=C&1|2,i.flags|=128):C&=1,D(In,C),rr(r,i,f,l),f=Ft?Ho:0,!z&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&x4(r,l,i);else if(r.tag===19)x4(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(l=i.child,b=null;l!==null;)r=l.alternate,r!==null&&Ac(r)===null&&(b=l),l=l.sibling;l=b,l===null?(b=i.child,i.child=null):(b=l.sibling,l.sibling=null),P0(i,!1,b,l,v,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,b=i.child,i.child=null;b!==null;){if(r=b.alternate,r!==null&&Ac(r)===null){i.child=b;break}r=b.sibling,b.sibling=l,l=b,b=r}P0(i,!0,l,null,v,f);break;case"together":P0(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function Pa(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Ni|=i.lanes,(l&i.childLanes)===0)if(r!==null){if(Fs(r,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,l=Ba(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Ba(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function G0(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&wc(r)))}function a8(r,i,l){switch(i.tag){case 3:ae(i,i.stateNode.containerInfo),yi(i,Dn,r.memoizedState.cache),ns();break;case 27:case 5:he(i);break;case 4:ae(i,i.stateNode.containerInfo);break;case 10:yi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,g0(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Si(i),i.flags|=128,null):(l&i.child.childLanes)!==0?y4(r,i,l):(Si(i),r=Pa(r,i,l),r!==null?r.sibling:null);Si(i);break;case 19:var b=(r.flags&128)!==0;if(f=(l&i.childLanes)!==0,f||(Fs(r,i,l,!1),f=(l&i.childLanes)!==0),b){if(f)return w4(r,i,l);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),D(In,In.current),f)break;return null;case 22:return i.lanes=0,h4(r,i,l,i.pendingProps);case 24:yi(i,Dn,r.memoizedState.cache)}return Pa(r,i,l)}function k4(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ln=!0;else{if(!G0(r,l)&&(i.flags&128)===0)return Ln=!1,a8(r,i,l);Ln=(r.flags&131072)!==0}else Ln=!1,Ft&&(i.flags&1048576)!==0&&eg(i,Ho,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=ss(i.elementType),i.type=r,typeof r=="function")Zd(r)?(f=us(r,f),i.tag=1,i=b4(null,i,r,f,l)):(i.tag=0,i=B0(null,i,r,f,l));else{if(r!=null){var b=r.$$typeof;if(b===P){i.tag=11,i=u4(null,i,r,f,l);break e}else if(b===L){i.tag=14,i=d4(null,i,r,f,l);break e}}throw i=J(r)||r,Error(a(306,i,""))}}return i;case 0:return B0(r,i,i.type,i.pendingProps,l);case 1:return f=i.type,b=us(f,i.pendingProps),b4(r,i,f,b,l);case 3:e:{if(ae(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var v=i.memoizedState;b=v.element,d0(r,i),Yo(i,f,null,l);var C=i.memoizedState;if(f=C.cache,yi(i,Dn,f),f!==v.cache&&i0(i,[Dn],l,!0),Ko(),f=C.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:C.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=v4(r,i,f,l);break e}else if(f!==b){b=Xr(Error(a(424)),i),Uo(b),i=v4(r,i,f,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,mn=na(r.firstChild),tr=i,Ft=!0,bi=null,ea=!0,l=hg(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ns(),f===b){i=Pa(r,i,l);break e}rr(r,i,f,l)}i=i.child}return i;case 26:return Hc(r,i),r===null?(l=O2(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ft||(l=i.type,r=i.pendingProps,f=ru(V.current).createElement(l),f[Wt]=i,f[Tn]=r,ar(f,l,r),wn(f),i.stateNode=f):i.memoizedState=O2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return he(i),r===null&&Ft&&(f=i.stateNode=I2(i.type,i.pendingProps,V.current),tr=i,ea=!0,b=mn,Mi(i.type)?(Tf=b,mn=na(f.firstChild)):mn=b),rr(r,i,i.pendingProps.children,l),Hc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Ft&&((b=f=mn)&&(f=D8(f,i.type,i.pendingProps,ea),f!==null?(i.stateNode=f,tr=i,mn=na(f.firstChild),ea=!1,b=!0):b=!1),b||vi(i)),he(i),b=i.type,v=i.pendingProps,C=r!==null?r.memoizedProps:null,f=v.children,xf(b,v)?f=null:C!==null&&xf(b,C)&&(i.flags|=32),i.memoizedState!==null&&(b=v0(r,i,Wx,null,null,l),ml._currentValue=b),Hc(r,i),rr(r,i,f,l),i.child;case 6:return r===null&&Ft&&((r=l=mn)&&(l=j8(l,i.pendingProps,ea),l!==null?(i.stateNode=l,tr=i,mn=null,r=!0):r=!1),r||vi(i)),null;case 13:return y4(r,i,l);case 4:return ae(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=ls(i,null,f,l):rr(r,i,f,l),i.child;case 11:return u4(r,i,i.type,i.pendingProps,l);case 7:return rr(r,i,i.pendingProps,l),i.child;case 8:return rr(r,i,i.pendingProps.children,l),i.child;case 12:return rr(r,i,i.pendingProps.children,l),i.child;case 10:return f=i.pendingProps,yi(i,i.type,f.value),rr(r,i,f.children,l),i.child;case 9:return b=i.type._context,f=i.pendingProps.children,as(i),b=nr(b),f=f(b),i.flags|=1,rr(r,i,f,l),i.child;case 14:return d4(r,i,i.type,i.pendingProps,l);case 15:return f4(r,i,i.type,i.pendingProps,l);case 19:return w4(r,i,l);case 31:return r8(r,i,l);case 22:return h4(r,i,l,i.pendingProps);case 24:return as(i),f=nr(Dn),r===null?(b=l0(),b===null&&(b=ln,v=s0(),b.pooledCache=v,v.refCount++,v!==null&&(b.pooledCacheLanes|=l),b=v),i.memoizedState={parent:f,cache:b},u0(i),yi(i,Dn,b)):((r.lanes&l)!==0&&(d0(r,i),Yo(i,null,null,l),Ko()),b=r.memoizedState,v=i.memoizedState,b.parent!==f?(b={parent:f,cache:f},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),yi(i,Dn,f)):(f=v.cache,yi(i,Dn,f),f!==b.cache&&i0(i,[Dn],l,!0))),rr(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ga(r){r.flags|=4}function V0(r,i,l,f,b){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(W4())r.flags|=8192;else throw os=Tc,c0}else r.flags&=-16777217}function S4(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!B2(i))if(W4())r.flags|=8192;else throw os=Tc,c0}function Fc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?et():536870912,r.lanes|=i,eo|=i)}function el(r,i){if(!Ft)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function pn(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,f=0;if(i)for(var b=r.child;b!==null;)l|=b.lanes|b.childLanes,f|=b.subtreeFlags&65011712,f|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)l|=b.lanes|b.childLanes,f|=b.subtreeFlags,f|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=f,r.childLanes=l,i}function i8(r,i,l){var f=i.pendingProps;switch(e0(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(i),null;case 1:return pn(i),null;case 3:return l=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Ua(Dn),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Us(i)?Ga(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,n0())),pn(i),null;case 26:var b=i.type,v=i.memoizedState;return r===null?(Ga(i),v!==null?(pn(i),S4(i,v)):(pn(i),V0(i,b,null,f,l))):v?v!==r.memoizedState?(Ga(i),pn(i),S4(i,v)):(pn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&Ga(i),pn(i),V0(i,b,r,f,l)),null;case 27:if(Ne(i),l=V.current,b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Ga(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return pn(i),null}r=ye.current,Us(i)?ng(i):(r=I2(b,f,l),i.stateNode=r,Ga(i))}return pn(i),null;case 5:if(Ne(i),b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&Ga(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return pn(i),null}if(v=ye.current,Us(i))ng(i);else{var C=ru(V.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?C.createElement("select",{is:f.is}):C.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?C.createElement(b,{is:f.is}):C.createElement(b)}}v[Wt]=i,v[Tn]=f;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=v;e:switch(ar(v,b,f),b){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Ga(i)}}return pn(i),V0(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&Ga(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=V.current,Us(i)){if(r=i.stateNode,l=i.memoizedProps,f=null,b=tr,b!==null)switch(b.tag){case 27:case 5:f=b.memoizedProps}r[Wt]=i,r=!!(r.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||y2(r.nodeValue,l)),r||vi(i,!0)}else r=ru(r).createTextNode(f),r[Wt]=i,i.stateNode=r}return pn(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(f=Us(i),l!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Wt]=i}else ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;pn(i),r=!1}else l=n0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(zr(i),i):(zr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return pn(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=Us(i),f!==null&&f.dehydrated!==null){if(r===null){if(!b)throw Error(a(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(a(317));b[Wt]=i}else ns(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;pn(i),b=!1}else b=n0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(zr(i),i):(zr(i),null)}return zr(i),(i.flags&128)!==0?(i.lanes=l,i):(l=f!==null,r=r!==null&&r.memoizedState!==null,l&&(f=i.child,b=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(b=f.alternate.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==b&&(f.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),Fc(i,i.updateQueue),pn(i),null);case 4:return ue(),r===null&&pf(i.stateNode.containerInfo),pn(i),null;case 10:return Ua(i.type),pn(i),null;case 19:if(Y(In),f=i.memoizedState,f===null)return pn(i),null;if(b=(i.flags&128)!==0,v=f.rendering,v===null)if(b)el(f,!1);else{if(Nn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Ac(r),v!==null){for(i.flags|=128,el(f,!1),r=v.updateQueue,i.updateQueue=r,Fc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)Xp(l,r),l=l.sibling;return D(In,In.current&1|2),Ft&&qa(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&Ue()>Kc&&(i.flags|=128,b=!0,el(f,!1),i.lanes=4194304)}else{if(!b)if(r=Ac(v),r!==null){if(i.flags|=128,b=!0,r=r.updateQueue,i.updateQueue=r,Fc(i,r),el(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!Ft)return pn(i),null}else 2*Ue()-f.renderingStartTime>Kc&&l!==536870912&&(i.flags|=128,b=!0,el(f,!1),i.lanes=4194304);f.isBackwards?(v.sibling=i.child,i.child=v):(r=f.last,r!==null?r.sibling=v:i.child=v,f.last=v)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=Ue(),r.sibling=null,l=In.current,D(In,b?l&1|2:l&1),Ft&&qa(i,f.treeForkCount),r):(pn(i),null);case 22:case 23:return zr(i),p0(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(l&536870912)!==0&&(i.flags&128)===0&&(pn(i),i.subtreeFlags&6&&(i.flags|=8192)):pn(i),l=i.updateQueue,l!==null&&Fc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==l&&(i.flags|=2048),r!==null&&Y(is),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ua(Dn),pn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function s8(r,i){switch(e0(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Ua(Dn),ue(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Ne(i),null;case 31:if(i.memoizedState!==null){if(zr(i),i.alternate===null)throw Error(a(340));ns()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(zr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ns()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Y(In),null;case 4:return ue(),null;case 10:return Ua(i.type),null;case 22:case 23:return zr(i),p0(),r!==null&&Y(is),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Ua(Dn),null;case 25:return null;default:return null}}function E4(r,i){switch(e0(i),i.tag){case 3:Ua(Dn),ue();break;case 26:case 27:case 5:Ne(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&zr(i);break;case 13:zr(i);break;case 19:Y(In);break;case 10:Ua(i.type);break;case 22:case 23:zr(i),p0(),r!==null&&Y(is);break;case 24:Ua(Dn)}}function tl(r,i){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var b=f.next;l=b;do{if((l.tag&r)===r){f=void 0;var v=l.create,C=l.inst;f=v(),C.destroy=f}l=l.next}while(l!==b)}}catch(z){rn(i,i.return,z)}}function Ti(r,i,l){try{var f=i.updateQueue,b=f!==null?f.lastEffect:null;if(b!==null){var v=b.next;f=v;do{if((f.tag&r)===r){var C=f.inst,z=C.destroy;if(z!==void 0){C.destroy=void 0,b=i;var ie=l,ge=z;try{ge()}catch(Se){rn(b,ie,Se)}}}f=f.next}while(f!==v)}}catch(Se){rn(i,i.return,Se)}}function T4(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{pg(i,l)}catch(f){rn(r,r.return,f)}}}function C4(r,i,l){l.props=us(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(f){rn(r,i,f)}}function nl(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof l=="function"?r.refCleanup=l(f):l.current=f}}catch(b){rn(r,i,b)}}function ka(r,i){var l=r.ref,f=r.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(b){rn(r,i,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(b){rn(r,i,b)}else l.current=null}function N4(r){var i=r.type,l=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(b){rn(r,r.return,b)}}function K0(r,i,l){try{var f=r.stateNode;R8(f,r.type,l,i),f[Tn]=i}catch(b){rn(r,r.return,b)}}function R4(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Mi(r.type)||r.tag===4}function Y0(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||R4(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Mi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function W0(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=qe));else if(f!==4&&(f===27&&Mi(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(W0(r,i,l),r=r.sibling;r!==null;)W0(r,i,l),r=r.sibling}function $c(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(f!==4&&(f===27&&Mi(r.type)&&(l=r.stateNode),r=r.child,r!==null))for($c(r,i,l),r=r.sibling;r!==null;)$c(r,i,l),r=r.sibling}function A4(r){var i=r.stateNode,l=r.memoizedProps;try{for(var f=r.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);ar(i,f,l),i[Wt]=r,i[Tn]=l}catch(v){rn(r,r.return,v)}}var Va=!1,zn=!1,Z0=!1,I4=typeof WeakSet=="function"?WeakSet:Set,Zn=null;function o8(r,i){if(r=r.containerInfo,vf=uu,r=Fp(r),$d(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var b=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var C=0,z=-1,ie=-1,ge=0,Se=0,Ce=r,ve=null;t:for(;;){for(var xe;Ce!==l||b!==0&&Ce.nodeType!==3||(z=C+b),Ce!==v||f!==0&&Ce.nodeType!==3||(ie=C+f),Ce.nodeType===3&&(C+=Ce.nodeValue.length),(xe=Ce.firstChild)!==null;)ve=Ce,Ce=xe;for(;;){if(Ce===r)break t;if(ve===l&&++ge===b&&(z=C),ve===v&&++Se===f&&(ie=C),(xe=Ce.nextSibling)!==null)break;Ce=ve,ve=Ce.parentNode}Ce=xe}l=z===-1||ie===-1?null:{start:z,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(yf={focusedElem:r,selectionRange:l},uu=!1,Zn=i;Zn!==null;)if(i=Zn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Zn=r;else for(;Zn!==null;){switch(i=Zn,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)b=r[l],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=i,b=v.memoizedProps,v=v.memoizedState,f=l.stateNode;try{var Ke=us(l.type,b);r=f.getSnapshotBeforeUpdate(Ke,v),f.__reactInternalSnapshotBeforeUpdate=r}catch(ft){rn(l,l.return,ft)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)kf(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":kf(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Zn=r;break}Zn=i.return}}function _4(r,i,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:Ya(r,l),f&4&&tl(5,l);break;case 1:if(Ya(r,l),f&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(C){rn(l,l.return,C)}else{var b=us(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(b,i,r.__reactInternalSnapshotBeforeUpdate)}catch(C){rn(l,l.return,C)}}f&64&&T4(l),f&512&&nl(l,l.return);break;case 3:if(Ya(r,l),f&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{pg(r,i)}catch(C){rn(l,l.return,C)}}break;case 27:i===null&&f&4&&A4(l);case 26:case 5:Ya(r,l),i===null&&f&4&&N4(l),f&512&&nl(l,l.return);break;case 12:Ya(r,l);break;case 31:Ya(r,l),f&4&&D4(r,l);break;case 13:Ya(r,l),f&4&&j4(r,l),f&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=g8.bind(null,l),L8(r,l))));break;case 22:if(f=l.memoizedState!==null||Va,!f){i=i!==null&&i.memoizedState!==null||zn,b=Va;var v=zn;Va=f,(zn=i)&&!v?Wa(r,l,(l.subtreeFlags&8772)!==0):Ya(r,l),Va=b,zn=v}break;case 30:break;default:Ya(r,l)}}function M4(r){var i=r.alternate;i!==null&&(r.alternate=null,M4(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&ja(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var bn=null,wr=!1;function Ka(r,i,l){for(l=l.child;l!==null;)O4(r,i,l),l=l.sibling}function O4(r,i,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Pt,l)}catch{}switch(l.tag){case 26:zn||ka(l,i),Ka(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:zn||ka(l,i);var f=bn,b=wr;Mi(l.type)&&(bn=l.stateNode,wr=!1),Ka(r,i,l),dl(l.stateNode),bn=f,wr=b;break;case 5:zn||ka(l,i);case 6:if(f=bn,b=wr,bn=null,Ka(r,i,l),bn=f,wr=b,bn!==null)if(wr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(l.stateNode)}catch(v){rn(l,i,v)}else try{bn.removeChild(l.stateNode)}catch(v){rn(l,i,v)}break;case 18:bn!==null&&(wr?(r=bn,T2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),lo(r)):T2(bn,l.stateNode));break;case 4:f=bn,b=wr,bn=l.stateNode.containerInfo,wr=!0,Ka(r,i,l),bn=f,wr=b;break;case 0:case 11:case 14:case 15:Ti(2,l,i),zn||Ti(4,l,i),Ka(r,i,l);break;case 1:zn||(ka(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"&&C4(l,i,f)),Ka(r,i,l);break;case 21:Ka(r,i,l);break;case 22:zn=(f=zn)||l.memoizedState!==null,Ka(r,i,l),zn=f;break;default:Ka(r,i,l)}}function D4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{lo(r)}catch(l){rn(i,i.return,l)}}}function j4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{lo(r)}catch(l){rn(i,i.return,l)}}function l8(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new I4),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new I4),i;default:throw Error(a(435,r.tag))}}function Pc(r,i){var l=l8(r);i.forEach(function(f){if(!l.has(f)){l.add(f);var b=b8.bind(null,r,f);f.then(b,b)}})}function kr(r,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var b=l[f],v=r,C=i,z=C;e:for(;z!==null;){switch(z.tag){case 27:if(Mi(z.type)){bn=z.stateNode,wr=!1;break e}break;case 5:bn=z.stateNode,wr=!1;break e;case 3:case 4:bn=z.stateNode.containerInfo,wr=!0;break e}z=z.return}if(bn===null)throw Error(a(160));O4(v,C,b),bn=null,wr=!1,v=b.alternate,v!==null&&(v.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)L4(i,r),i=i.sibling}var fa=null;function L4(r,i){var l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:kr(i,r),Sr(r),f&4&&(Ti(3,r,r.return),tl(3,r),Ti(5,r,r.return));break;case 1:kr(i,r),Sr(r),f&512&&(zn||l===null||ka(l,l.return)),f&64&&Va&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var b=fa;if(kr(i,r),Sr(r),f&512&&(zn||l===null||ka(l,l.return)),f&4){var v=l!==null?l.memoizedState:null;if(f=r.memoizedState,l===null)if(f===null)if(r.stateNode===null){e:{f=r.type,l=r.memoizedProps,b=b.ownerDocument||b;t:switch(f){case"title":v=b.getElementsByTagName("title")[0],(!v||v[Da]||v[Wt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=b.createElement(f),b.head.insertBefore(v,b.querySelector("head > title"))),ar(v,f,l),v[Wt]=r,wn(v),f=v;break e;case"link":var C=L2("link","href",b).get(f+(l.href||""));if(C){for(var z=0;z<C.length;z++)if(v=C[z],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){C.splice(z,1);break t}}v=b.createElement(f),ar(v,f,l),b.head.appendChild(v);break;case"meta":if(C=L2("meta","content",b).get(f+(l.content||""))){for(z=0;z<C.length;z++)if(v=C[z],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){C.splice(z,1);break t}}v=b.createElement(f),ar(v,f,l),b.head.appendChild(v);break;default:throw Error(a(468,f))}v[Wt]=r,wn(v),f=v}r.stateNode=f}else z2(b,r.type,r.stateNode);else r.stateNode=j2(b,f,r.memoizedProps);else v!==f?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,f===null?z2(b,r.type,r.stateNode):j2(b,f,r.memoizedProps)):f===null&&r.stateNode!==null&&K0(r,r.memoizedProps,l.memoizedProps)}break;case 27:kr(i,r),Sr(r),f&512&&(zn||l===null||ka(l,l.return)),l!==null&&f&4&&K0(r,r.memoizedProps,l.memoizedProps);break;case 5:if(kr(i,r),Sr(r),f&512&&(zn||l===null||ka(l,l.return)),r.flags&32){b=r.stateNode;try{ht(b,"")}catch(Ke){rn(r,r.return,Ke)}}f&4&&r.stateNode!=null&&(b=r.memoizedProps,K0(r,b,l!==null?l.memoizedProps:b)),f&1024&&(Z0=!0);break;case 6:if(kr(i,r),Sr(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,l=r.stateNode;try{l.nodeValue=f}catch(Ke){rn(r,r.return,Ke)}}break;case 3:if(su=null,b=fa,fa=au(i.containerInfo),kr(i,r),fa=b,Sr(r),f&4&&l!==null&&l.memoizedState.isDehydrated)try{lo(i.containerInfo)}catch(Ke){rn(r,r.return,Ke)}Z0&&(Z0=!1,z4(r));break;case 4:f=fa,fa=au(r.stateNode.containerInfo),kr(i,r),Sr(r),fa=f;break;case 12:kr(i,r),Sr(r);break;case 31:kr(i,r),Sr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 13:kr(i,r),Sr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vc=Ue()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 22:b=r.memoizedState!==null;var ie=l!==null&&l.memoizedState!==null,ge=Va,Se=zn;if(Va=ge||b,zn=Se||ie,kr(i,r),zn=Se,Va=ge,Sr(r),f&8192)e:for(i=r.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(l===null||ie||Va||zn||ds(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){ie=l=i;try{if(v=ie.stateNode,b)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{z=ie.stateNode;var Ce=ie.memoizedProps.style,ve=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;z.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ke){rn(ie,ie.return,Ke)}}}else if(i.tag===6){if(l===null){ie=i;try{ie.stateNode.nodeValue=b?"":ie.memoizedProps}catch(Ke){rn(ie,ie.return,Ke)}}}else if(i.tag===18){if(l===null){ie=i;try{var xe=ie.stateNode;b?C2(xe,!0):C2(ie.stateNode,!1)}catch(Ke){rn(ie,ie.return,Ke)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,Pc(r,l))));break;case 19:kr(i,r),Sr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Pc(r,f)));break;case 30:break;case 21:break;default:kr(i,r),Sr(r)}}function Sr(r){var i=r.flags;if(i&2){try{for(var l,f=r.return;f!==null;){if(R4(f)){l=f;break}f=f.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var b=l.stateNode,v=Y0(r);$c(r,v,b);break;case 5:var C=l.stateNode;l.flags&32&&(ht(C,""),l.flags&=-33);var z=Y0(r);$c(r,z,C);break;case 3:case 4:var ie=l.stateNode.containerInfo,ge=Y0(r);W0(r,ge,ie);break;default:throw Error(a(161))}}catch(Se){rn(r,r.return,Se)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function z4(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;z4(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Ya(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_4(r,i.alternate,i),i=i.sibling}function ds(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ti(4,i,i.return),ds(i);break;case 1:ka(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&C4(i,i.return,l),ds(i);break;case 27:dl(i.stateNode);case 26:case 5:ka(i,i.return),ds(i);break;case 22:i.memoizedState===null&&ds(i);break;case 30:ds(i);break;default:ds(i)}r=r.sibling}}function Wa(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,b=r,v=i,C=v.flags;switch(v.tag){case 0:case 11:case 15:Wa(b,v,l),tl(4,v);break;case 1:if(Wa(b,v,l),f=v,b=f.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){rn(f,f.return,ge)}if(f=v,b=f.updateQueue,b!==null){var z=f.stateNode;try{var ie=b.shared.hiddenCallbacks;if(ie!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ie.length;b++)mg(ie[b],z)}catch(ge){rn(f,f.return,ge)}}l&&C&64&&T4(v),nl(v,v.return);break;case 27:A4(v);case 26:case 5:Wa(b,v,l),l&&f===null&&C&4&&N4(v),nl(v,v.return);break;case 12:Wa(b,v,l);break;case 31:Wa(b,v,l),l&&C&4&&D4(b,v);break;case 13:Wa(b,v,l),l&&C&4&&j4(b,v);break;case 22:v.memoizedState===null&&Wa(b,v,l),nl(v,v.return);break;case 30:break;default:Wa(b,v,l)}i=i.sibling}}function X0(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Fo(l))}function Q0(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Fo(r))}function ha(r,i,l,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)B4(r,i,l,f),i=i.sibling}function B4(r,i,l,f){var b=i.flags;switch(i.tag){case 0:case 11:case 15:ha(r,i,l,f),b&2048&&tl(9,i);break;case 1:ha(r,i,l,f);break;case 3:ha(r,i,l,f),b&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Fo(r)));break;case 12:if(b&2048){ha(r,i,l,f),r=i.stateNode;try{var v=i.memoizedProps,C=v.id,z=v.onPostCommit;typeof z=="function"&&z(C,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){rn(i,i.return,ie)}}else ha(r,i,l,f);break;case 31:ha(r,i,l,f);break;case 13:ha(r,i,l,f);break;case 23:break;case 22:v=i.stateNode,C=i.alternate,i.memoizedState!==null?v._visibility&2?ha(r,i,l,f):rl(r,i):v._visibility&2?ha(r,i,l,f):(v._visibility|=2,Xs(r,i,l,f,(i.subtreeFlags&10256)!==0||!1)),b&2048&&X0(C,i);break;case 24:ha(r,i,l,f),b&2048&&Q0(i.alternate,i);break;default:ha(r,i,l,f)}}function Xs(r,i,l,f,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,C=i,z=l,ie=f,ge=C.flags;switch(C.tag){case 0:case 11:case 15:Xs(v,C,z,ie,b),tl(8,C);break;case 23:break;case 22:var Se=C.stateNode;C.memoizedState!==null?Se._visibility&2?Xs(v,C,z,ie,b):rl(v,C):(Se._visibility|=2,Xs(v,C,z,ie,b)),b&&ge&2048&&X0(C.alternate,C);break;case 24:Xs(v,C,z,ie,b),b&&ge&2048&&Q0(C.alternate,C);break;default:Xs(v,C,z,ie,b)}i=i.sibling}}function rl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,f=i,b=f.flags;switch(f.tag){case 22:rl(l,f),b&2048&&X0(f.alternate,f);break;case 24:rl(l,f),b&2048&&Q0(f.alternate,f);break;default:rl(l,f)}i=i.sibling}}var al=8192;function Qs(r,i,l){if(r.subtreeFlags&al)for(r=r.child;r!==null;)q4(r,i,l),r=r.sibling}function q4(r,i,l){switch(r.tag){case 26:Qs(r,i,l),r.flags&al&&r.memoizedState!==null&&Y8(l,fa,r.memoizedState,r.memoizedProps);break;case 5:Qs(r,i,l);break;case 3:case 4:var f=fa;fa=au(r.stateNode.containerInfo),Qs(r,i,l),fa=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=al,al=16777216,Qs(r,i,l),al=f):Qs(r,i,l));break;default:Qs(r,i,l)}}function H4(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function il(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Zn=f,F4(f,r)}H4(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)U4(r),r=r.sibling}function U4(r){switch(r.tag){case 0:case 11:case 15:il(r),r.flags&2048&&Ti(9,r,r.return);break;case 3:il(r);break;case 12:il(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Gc(r)):il(r);break;default:il(r)}}function Gc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Zn=f,F4(f,r)}H4(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ti(8,i,i.return),Gc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Gc(i));break;default:Gc(i)}r=r.sibling}}function F4(r,i){for(;Zn!==null;){var l=Zn;switch(l.tag){case 0:case 11:case 15:Ti(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Fo(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,Zn=f;else e:for(l=r;Zn!==null;){f=Zn;var b=f.sibling,v=f.return;if(M4(f),f===l){Zn=null;break e}if(b!==null){b.return=v,Zn=b;break e}Zn=v}}}var c8={getCacheForType:function(r){var i=nr(Dn),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return nr(Dn).controller.signal}},u8=typeof WeakMap=="function"?WeakMap:Map,Zt=0,ln=null,jt=null,qt=0,nn=0,Br=null,Ci=!1,Js=!1,J0=!1,Za=0,Nn=0,Ni=0,fs=0,ef=0,qr=0,eo=0,sl=null,Er=null,tf=!1,Vc=0,$4=0,Kc=1/0,Yc=null,Ri=null,Gn=0,Ai=null,to=null,Xa=0,nf=0,rf=null,P4=null,ol=0,af=null;function Hr(){return(Zt&2)!==0&&qt!==0?qt&-qt:I.T!==null?df():ba()}function G4(){if(qr===0)if((qt&536870912)===0||Ft){var r=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),qr=r}else qr=536870912;return r=Lr.current,r!==null&&(r.flags|=32),qr}function Tr(r,i,l){(r===ln&&(nn===2||nn===9)||r.cancelPendingCommit!==null)&&(no(r,0),Ii(r,qt,qr,!1)),Ct(r,l),((Zt&2)===0||r!==ln)&&(r===ln&&((Zt&2)===0&&(fs|=l),Nn===4&&Ii(r,qt,qr,!1)),Sa(r))}function V4(r,i,l){if((Zt&6)!==0)throw Error(a(327));var f=!l&&(i&127)===0&&(i&r.expiredLanes)===0||ke(r,i),b=f?h8(r,i):of(r,i,!0),v=f;do{if(b===0){Js&&!f&&Ii(r,i,0,!1);break}else{if(l=r.current.alternate,v&&!d8(l)){b=of(r,i,!1),v=!1;continue}if(b===2){if(v=i,r.errorRecoveryDisabledLanes&v)var C=0;else C=r.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){i=C;e:{var z=r;b=sl;var ie=z.current.memoizedState.isDehydrated;if(ie&&(no(z,C).flags|=256),C=of(z,C,!1),C!==2){if(J0&&!ie){z.errorRecoveryDisabledLanes|=v,fs|=v,b=4;break e}v=Er,Er=b,v!==null&&(Er===null?Er=v:Er.push.apply(Er,v))}b=C}if(v=!1,b!==2)continue}}if(b===1){no(r,0),Ii(r,i,0,!0);break}e:{switch(f=r,v=b,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ii(f,i,qr,!Ci);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(b=Vc+300-Ue(),10<b)){if(Ii(f,i,qr,!Ci),re(f,0,!0)!==0)break e;Xa=i,f.timeoutHandle=S2(K4.bind(null,f,l,Er,Yc,tf,i,qr,fs,eo,Ci,v,"Throttled",-0,0),b);break e}K4(f,l,Er,Yc,tf,i,qr,fs,eo,Ci,v,null,-0,0)}}break}while(!0);Sa(r)}function K4(r,i,l,f,b,v,C,z,ie,ge,Se,Ce,ve,xe){if(r.timeoutHandle=-1,Ce=i.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qe},q4(i,v,Ce);var Ke=(v&62914560)===v?Vc-Ue():(v&4194048)===v?$4-Ue():0;if(Ke=W8(Ce,Ke),Ke!==null){Xa=v,r.cancelPendingCommit=Ke(t2.bind(null,r,i,v,l,f,b,C,z,ie,Se,Ce,null,ve,xe)),Ii(r,v,C,!ge);return}}t2(r,i,v,l,f,b,C,z,ie)}function d8(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var b=l[f],v=b.getSnapshot;b=b.value;try{if(!Dr(v(),b))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ii(r,i,l,f){i&=~ef,i&=~fs,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var b=i;0<b;){var v=31-Tt(b),C=1<<v;f[v]=-1,b&=~C}l!==0&&Pe(r,l,i)}function Wc(){return(Zt&6)===0?(ll(0),!1):!0}function sf(){if(jt!==null){if(nn===0)var r=jt.return;else r=jt,Ha=rs=null,w0(r),Vs=null,Po=0,r=jt;for(;r!==null;)E4(r.alternate,r),r=r.return;jt=null}}function no(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,_8(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),Xa=0,sf(),ln=r,jt=l=Ba(r.current,null),qt=i,nn=0,Br=null,Ci=!1,Js=ke(r,i),J0=!1,eo=qr=ef=fs=Ni=Nn=0,Er=sl=null,tf=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var b=31-Tt(f),v=1<<b;i|=r[b],f&=~v}return Za=i,gc(),l}function Y4(r,i){Nt=null,I.H=Qo,i===Gs||i===Ec?(i=ug(),nn=3):i===c0?(i=ug(),nn=4):nn=i===z0?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Br=i,jt===null&&(Nn=1,Bc(r,Xr(i,r.current)))}function W4(){var r=Lr.current;return r===null?!0:(qt&4194048)===qt?ta===null:(qt&62914560)===qt||(qt&536870912)!==0?r===ta:!1}function Z4(){var r=I.H;return I.H=Qo,r===null?Qo:r}function X4(){var r=I.A;return I.A=c8,r}function Zc(){Nn=4,Ci||(qt&4194048)!==qt&&Lr.current!==null||(Js=!0),(Ni&134217727)===0&&(fs&134217727)===0||ln===null||Ii(ln,qt,qr,!1)}function of(r,i,l){var f=Zt;Zt|=2;var b=Z4(),v=X4();(ln!==r||qt!==i)&&(Yc=null,no(r,i)),i=!1;var C=Nn;e:do try{if(nn!==0&&jt!==null){var z=jt,ie=Br;switch(nn){case 8:sf(),C=6;break e;case 3:case 2:case 9:case 6:Lr.current===null&&(i=!0);var ge=nn;if(nn=0,Br=null,ro(r,z,ie,ge),l&&Js){C=0;break e}break;default:ge=nn,nn=0,Br=null,ro(r,z,ie,ge)}}f8(),C=Nn;break}catch(Se){Y4(r,Se)}while(!0);return i&&r.shellSuspendCounter++,Ha=rs=null,Zt=f,I.H=b,I.A=v,jt===null&&(ln=null,qt=0,gc()),C}function f8(){for(;jt!==null;)Q4(jt)}function h8(r,i){var l=Zt;Zt|=2;var f=Z4(),b=X4();ln!==r||qt!==i?(Yc=null,Kc=Ue()+500,no(r,i)):Js=ke(r,i);e:do try{if(nn!==0&&jt!==null){i=jt;var v=Br;t:switch(nn){case 1:nn=0,Br=null,ro(r,i,v,1);break;case 2:case 9:if(lg(v)){nn=0,Br=null,J4(i);break}i=function(){nn!==2&&nn!==9||ln!==r||(nn=7),Sa(r)},v.then(i,i);break e;case 3:nn=7;break e;case 4:nn=5;break e;case 7:lg(v)?(nn=0,Br=null,J4(i)):(nn=0,Br=null,ro(r,i,v,7));break;case 5:var C=null;switch(jt.tag){case 26:C=jt.memoizedState;case 5:case 27:var z=jt;if(C?B2(C):z.stateNode.complete){nn=0,Br=null;var ie=z.sibling;if(ie!==null)jt=ie;else{var ge=z.return;ge!==null?(jt=ge,Xc(ge)):jt=null}break t}}nn=0,Br=null,ro(r,i,v,5);break;case 6:nn=0,Br=null,ro(r,i,v,6);break;case 8:sf(),Nn=6;break e;default:throw Error(a(462))}}m8();break}catch(Se){Y4(r,Se)}while(!0);return Ha=rs=null,I.H=f,I.A=b,Zt=l,jt!==null?0:(ln=null,qt=0,gc(),Nn)}function m8(){for(;jt!==null&&!ze();)Q4(jt)}function Q4(r){var i=k4(r.alternate,r,Za);r.memoizedProps=r.pendingProps,i===null?Xc(r):jt=i}function J4(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=g4(l,i,i.pendingProps,i.type,void 0,qt);break;case 11:i=g4(l,i,i.pendingProps,i.type.render,i.ref,qt);break;case 5:w0(i);default:E4(l,i),i=jt=Xp(i,Za),i=k4(l,i,Za)}r.memoizedProps=r.pendingProps,i===null?Xc(r):jt=i}function ro(r,i,l,f){Ha=rs=null,w0(i),Vs=null,Po=0;var b=i.return;try{if(n8(r,b,i,l,qt)){Nn=1,Bc(r,Xr(l,r.current)),jt=null;return}}catch(v){if(b!==null)throw jt=b,v;Nn=1,Bc(r,Xr(l,r.current)),jt=null;return}i.flags&32768?(Ft||f===1?r=!0:Js||(qt&536870912)!==0?r=!1:(Ci=r=!0,(f===2||f===9||f===3||f===6)&&(f=Lr.current,f!==null&&f.tag===13&&(f.flags|=16384))),e2(i,r)):Xc(i)}function Xc(r){var i=r;do{if((i.flags&32768)!==0){e2(i,Ci);return}r=i.return;var l=i8(i.alternate,i,Za);if(l!==null){jt=l;return}if(i=i.sibling,i!==null){jt=i;return}jt=i=r}while(i!==null);Nn===0&&(Nn=5)}function e2(r,i){do{var l=s8(r.alternate,r);if(l!==null){l.flags&=32767,jt=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){jt=r;return}jt=r=l}while(r!==null);Nn=6,jt=null}function t2(r,i,l,f,b,v,C,z,ie){r.cancelPendingCommit=null;do Qc();while(Gn!==0);if((Zt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Yd,De(r,l,v,C,z,ie),r===ln&&(jt=ln=null,qt=0),to=i,Ai=r,Xa=l,nf=v,rf=b,P4=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,v8($e,function(){return s2(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,b=K.p,K.p=2,C=Zt,Zt|=4;try{o8(r,i,l)}finally{Zt=C,K.p=b,I.T=f}}Gn=1,n2(),r2(),a2()}}function n2(){if(Gn===1){Gn=0;var r=Ai,i=to,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=I.T,I.T=null;var f=K.p;K.p=2;var b=Zt;Zt|=4;try{L4(i,r);var v=yf,C=Fp(r.containerInfo),z=v.focusedElem,ie=v.selectionRange;if(C!==z&&z&&z.ownerDocument&&Up(z.ownerDocument.documentElement,z)){if(ie!==null&&$d(z)){var ge=ie.start,Se=ie.end;if(Se===void 0&&(Se=ge),"selectionStart"in z)z.selectionStart=ge,z.selectionEnd=Math.min(Se,z.value.length);else{var Ce=z.ownerDocument||document,ve=Ce&&Ce.defaultView||window;if(ve.getSelection){var xe=ve.getSelection(),Ke=z.textContent.length,ft=Math.min(ie.start,Ke),on=ie.end===void 0?ft:Math.min(ie.end,Ke);!xe.extend&&ft>on&&(C=on,on=ft,ft=C);var de=Hp(z,ft),le=Hp(z,on);if(de&&le&&(xe.rangeCount!==1||xe.anchorNode!==de.node||xe.anchorOffset!==de.offset||xe.focusNode!==le.node||xe.focusOffset!==le.offset)){var pe=Ce.createRange();pe.setStart(de.node,de.offset),xe.removeAllRanges(),ft>on?(xe.addRange(pe),xe.extend(le.node,le.offset)):(pe.setEnd(le.node,le.offset),xe.addRange(pe))}}}}for(Ce=[],xe=z;xe=xe.parentNode;)xe.nodeType===1&&Ce.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<Ce.length;z++){var Ee=Ce[z];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}uu=!!vf,yf=vf=null}finally{Zt=b,K.p=f,I.T=l}}r.current=i,Gn=2}}function r2(){if(Gn===2){Gn=0;var r=Ai,i=to,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=I.T,I.T=null;var f=K.p;K.p=2;var b=Zt;Zt|=4;try{_4(r,i.alternate,i)}finally{Zt=b,K.p=f,I.T=l}}Gn=3}}function a2(){if(Gn===4||Gn===3){Gn=0,Qe();var r=Ai,i=to,l=Xa,f=P4;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gn=5:(Gn=0,to=Ai=null,i2(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(Ri=null),oa(l),i=i.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Pt,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=I.T,b=K.p,K.p=2,I.T=null;try{for(var v=r.onRecoverableError,C=0;C<f.length;C++){var z=f[C];v(z.value,{componentStack:z.stack})}}finally{I.T=i,K.p=b}}(Xa&3)!==0&&Qc(),Sa(r),b=r.pendingLanes,(l&261930)!==0&&(b&42)!==0?r===af?ol++:(ol=0,af=r):ol=0,ll(0)}}function i2(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Fo(i)))}function Qc(){return n2(),r2(),a2(),s2()}function s2(){if(Gn!==5)return!1;var r=Ai,i=nf;nf=0;var l=oa(Xa),f=I.T,b=K.p;try{K.p=32>l?32:l,I.T=null,l=rf,rf=null;var v=Ai,C=Xa;if(Gn=0,to=Ai=null,Xa=0,(Zt&6)!==0)throw Error(a(331));var z=Zt;if(Zt|=4,U4(v.current),B4(v,v.current,C,l),Zt=z,ll(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Pt,v)}catch{}return!0}finally{K.p=b,I.T=f,i2(r,i)}}function o2(r,i,l){i=Xr(l,i),i=L0(r.stateNode,i,2),r=ki(r,i,2),r!==null&&(Ct(r,2),Sa(r))}function rn(r,i,l){if(r.tag===3)o2(r,r,l);else for(;i!==null;){if(i.tag===3){o2(i,r,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ri===null||!Ri.has(f))){r=Xr(l,r),l=l4(2),f=ki(i,l,2),f!==null&&(c4(l,f,i,r),Ct(f,2),Sa(f));break}}i=i.return}}function lf(r,i,l){var f=r.pingCache;if(f===null){f=r.pingCache=new u8;var b=new Set;f.set(i,b)}else b=f.get(i),b===void 0&&(b=new Set,f.set(i,b));b.has(l)||(J0=!0,b.add(l),r=p8.bind(null,r,i,l),i.then(r,r))}function p8(r,i,l){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,ln===r&&(qt&l)===l&&(Nn===4||Nn===3&&(qt&62914560)===qt&&300>Ue()-Vc?(Zt&2)===0&&no(r,0):ef|=l,eo===qt&&(eo=0)),Sa(r)}function l2(r,i){i===0&&(i=et()),r=es(r,i),r!==null&&(Ct(r,i),Sa(r))}function g8(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),l2(r,l)}function b8(r,i){var l=0;switch(r.tag){case 31:case 13:var f=r.stateNode,b=r.memoizedState;b!==null&&(l=b.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),l2(r,l)}function v8(r,i){return $t(r,i)}var Jc=null,ao=null,cf=!1,eu=!1,uf=!1,_i=0;function Sa(r){r!==ao&&r.next===null&&(ao===null?Jc=ao=r:ao=ao.next=r),eu=!0,cf||(cf=!0,x8())}function ll(r,i){if(!uf&&eu){uf=!0;do for(var l=!1,f=Jc;f!==null;){if(r!==0){var b=f.pendingLanes;if(b===0)var v=0;else{var C=f.suspendedLanes,z=f.pingedLanes;v=(1<<31-Tt(42|r)+1)-1,v&=b&~(C&~z),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,f2(f,v))}else v=qt,v=re(f,f===ln?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||ke(f,v)||(l=!0,f2(f,v));f=f.next}while(l);uf=!1}}function y8(){c2()}function c2(){eu=cf=!1;var r=0;_i!==0&&I8()&&(r=_i);for(var i=Ue(),l=null,f=Jc;f!==null;){var b=f.next,v=u2(f,i);v===0?(f.next=null,l===null?Jc=b:l.next=b,b===null&&(ao=l)):(l=f,(r!==0||(v&3)!==0)&&(eu=!0)),f=b}Gn!==0&&Gn!==5||ll(r),_i!==0&&(_i=0)}function u2(r,i){for(var l=r.suspendedLanes,f=r.pingedLanes,b=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var C=31-Tt(v),z=1<<C,ie=b[C];ie===-1?((z&l)===0||(z&f)!==0)&&(b[C]=Re(z,i)):ie<=i&&(r.expiredLanes|=z),v&=~z}if(i=ln,l=qt,l=re(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,l===0||r===i&&(nn===2||nn===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&Ut(f),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||ke(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(f!==null&&Ut(f),oa(l)){case 2:case 8:l=me;break;case 32:l=$e;break;case 268435456:l=Fe;break;default:l=$e}return f=d2.bind(null,r),l=$t(l,f),r.callbackPriority=i,r.callbackNode=l,i}return f!==null&&f!==null&&Ut(f),r.callbackPriority=2,r.callbackNode=null,2}function d2(r,i){if(Gn!==0&&Gn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Qc()&&r.callbackNode!==l)return null;var f=qt;return f=re(r,r===ln?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(V4(r,f,i),u2(r,Ue()),r.callbackNode!=null&&r.callbackNode===l?d2.bind(null,r):null)}function f2(r,i){if(Qc())return null;V4(r,i,!0)}function x8(){M8(function(){(Zt&6)!==0?$t(fe,y8):c2()})}function df(){if(_i===0){var r=$s;r===0&&(r=Ze,Ze<<=1,(Ze&261888)===0&&(Ze=256)),_i=r}return _i}function h2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:mi(""+r)}function m2(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function w8(r,i,l,f,b){if(i==="submit"&&l&&l.stateNode===b){var v=h2((b[Tn]||null).action),C=f.submitter;C&&(i=(i=C[Tn]||null)?h2(i.formAction):C.getAttribute("formAction"),i!==null&&(v=i,C=null));var z=new fc("action","action",null,f,b);r.push({event:z,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(_i!==0){var ie=C?m2(b,C):new FormData(b);I0(l,{pending:!0,data:ie,method:b.method,action:v},null,ie)}}else typeof v=="function"&&(z.preventDefault(),ie=C?m2(b,C):new FormData(b),I0(l,{pending:!0,data:ie,method:b.method,action:v},v,ie))},currentTarget:b}]})}}for(var ff=0;ff<Kd.length;ff++){var hf=Kd[ff],k8=hf.toLowerCase(),S8=hf[0].toUpperCase()+hf.slice(1);da(k8,"on"+S8)}da(Gp,"onAnimationEnd"),da(Vp,"onAnimationIteration"),da(Kp,"onAnimationStart"),da("dblclick","onDoubleClick"),da("focusin","onFocus"),da("focusout","onBlur"),da(qx,"onTransitionRun"),da(Hx,"onTransitionStart"),da(Ux,"onTransitionCancel"),da(Yp,"onTransitionEnd"),Me("onMouseEnter",["mouseout","mouseover"]),Me("onMouseLeave",["mouseout","mouseover"]),Me("onPointerEnter",["pointerout","pointerover"]),Me("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var cl="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(" "),E8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(cl));function p2(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var f=r[l],b=f.event;f=f.listeners;e:{var v=void 0;if(i)for(var C=f.length-1;0<=C;C--){var z=f[C],ie=z.instance,ge=z.currentTarget;if(z=z.listener,ie!==v&&b.isPropagationStopped())break e;v=z,b.currentTarget=ge;try{v(b)}catch(Se){pc(Se)}b.currentTarget=null,v=ie}else for(C=0;C<f.length;C++){if(z=f[C],ie=z.instance,ge=z.currentTarget,z=z.listener,ie!==v&&b.isPropagationStopped())break e;v=z,b.currentTarget=ge;try{v(b)}catch(Se){pc(Se)}b.currentTarget=null,v=ie}}}}function Lt(r,i){var l=i[va];l===void 0&&(l=i[va]=new Set);var f=r+"__bubble";l.has(f)||(g2(i,r,2,!1),l.add(f))}function mf(r,i,l){var f=0;i&&(f|=4),g2(l,r,f,i)}var tu="_reactListening"+Math.random().toString(36).slice(2);function pf(r){if(!r[tu]){r[tu]=!0,Ms.forEach(function(l){l!=="selectionchange"&&(E8.has(l)||mf(l,!1,r),mf(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[tu]||(i[tu]=!0,mf("selectionchange",!1,i))}}function g2(r,i,l,f){switch(G2(i)){case 2:var b=Q8;break;case 8:b=J8;break;default:b=If}l=b.bind(null,i,l,r),b=void 0,!Dd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),f?b!==void 0?r.addEventListener(i,l,{capture:!0,passive:b}):r.addEventListener(i,l,!0):b!==void 0?r.addEventListener(i,l,{passive:b}):r.addEventListener(i,l,!1)}function gf(r,i,l,f,b){var v=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var C=f.tag;if(C===3||C===4){var z=f.stateNode.containerInfo;if(z===b)break;if(C===4)for(C=f.return;C!==null;){var ie=C.tag;if((ie===3||ie===4)&&C.stateNode.containerInfo===b)return;C=C.return}for(;z!==null;){if(C=Xn(z),C===null)return;if(ie=C.tag,ie===5||ie===6||ie===26||ie===27){f=v=C;continue e}z=z.parentNode}}f=f.return}lc(function(){var ge=v,Se=Et(l),Ce=[];e:{var ve=Wp.get(r);if(ve!==void 0){var xe=fc,Ke=r;switch(r){case"keypress":if(uc(l)===0)break e;case"keydown":case"keyup":xe=bx;break;case"focusin":Ke="focus",xe=Bd;break;case"focusout":Ke="blur",xe=Bd;break;case"beforeblur":case"afterblur":xe=Bd;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":xe=Ep;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=ix;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=xx;break;case Gp:case Vp:case Kp:xe=lx;break;case Yp:xe=kx;break;case"scroll":case"scrollend":xe=rx;break;case"wheel":xe=Ex;break;case"copy":case"cut":case"paste":xe=ux;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Cp;break;case"toggle":case"beforetoggle":xe=Cx}var ft=(i&4)!==0,on=!ft&&(r==="scroll"||r==="scrollend"),de=ft?ve!==null?ve+"Capture":null:ve;ft=[];for(var le=ge,pe;le!==null;){var Ee=le;if(pe=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||pe===null||de===null||(Ee=_o(le,de),Ee!=null&&ft.push(ul(le,Ee,pe))),on)break;le=le.return}0<ft.length&&(ve=new xe(ve,Ke,null,l,Se),Ce.push({event:ve,listeners:ft}))}}if((i&7)===0){e:{if(ve=r==="mouseover"||r==="pointerover",xe=r==="mouseout"||r==="pointerout",ve&&l!==Xe&&(Ke=l.relatedTarget||l.fromElement)&&(Xn(Ke)||Ke[Kr]))break e;if((xe||ve)&&(ve=Se.window===Se?Se:(ve=Se.ownerDocument)?ve.defaultView||ve.parentWindow:window,xe?(Ke=l.relatedTarget||l.toElement,xe=ge,Ke=Ke?Xn(Ke):null,Ke!==null&&(on=o(Ke),ft=Ke.tag,Ke!==on||ft!==5&&ft!==27&&ft!==6)&&(Ke=null)):(xe=null,Ke=ge),xe!==Ke)){if(ft=Ep,Ee="onMouseLeave",de="onMouseEnter",le="mouse",(r==="pointerout"||r==="pointerover")&&(ft=Cp,Ee="onPointerLeave",de="onPointerEnter",le="pointer"),on=xe==null?ve:ya(xe),pe=Ke==null?ve:ya(Ke),ve=new ft(Ee,le+"leave",xe,l,Se),ve.target=on,ve.relatedTarget=pe,Ee=null,Xn(Se)===ge&&(ft=new ft(de,le+"enter",Ke,l,Se),ft.target=pe,ft.relatedTarget=on,Ee=ft),on=Ee,xe&&Ke)t:{for(ft=T8,de=xe,le=Ke,pe=0,Ee=de;Ee;Ee=ft(Ee))pe++;Ee=0;for(var it=le;it;it=ft(it))Ee++;for(;0<pe-Ee;)de=ft(de),pe--;for(;0<Ee-pe;)le=ft(le),Ee--;for(;pe--;){if(de===le||le!==null&&de===le.alternate){ft=de;break t}de=ft(de),le=ft(le)}ft=null}else ft=null;xe!==null&&b2(Ce,ve,xe,ft,!1),Ke!==null&&on!==null&&b2(Ce,on,Ke,ft,!0)}}e:{if(ve=ge?ya(ge):window,xe=ve.nodeName&&ve.nodeName.toLowerCase(),xe==="select"||xe==="input"&&ve.type==="file")var Vt=Dp;else if(Mp(ve))if(jp)Vt=Lx;else{Vt=Dx;var Je=Ox}else xe=ve.nodeName,!xe||xe.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?ge&&hi(ge.elementType)&&(Vt=Dp):Vt=jx;if(Vt&&(Vt=Vt(r,ge))){Op(Ce,Vt,l,Se);break e}Je&&Je(r,ve,ge),r==="focusout"&&ge&&ve.type==="number"&&ge.memoizedProps.value!=null&&ua(ve,"number",ve.value)}switch(Je=ge?ya(ge):window,r){case"focusin":(Mp(Je)||Je.contentEditable==="true")&&(js=Je,Pd=ge,qo=null);break;case"focusout":qo=Pd=js=null;break;case"mousedown":Gd=!0;break;case"contextmenu":case"mouseup":case"dragend":Gd=!1,$p(Ce,l,Se);break;case"selectionchange":if(Bx)break;case"keydown":case"keyup":$p(Ce,l,Se)}var It;if(Hd)e:{switch(r){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else Ds?Ip(r,l)&&(Ht="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ht="onCompositionStart");Ht&&(Np&&l.locale!=="ko"&&(Ds||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Ds&&(It=kp()):(pi=Se,jd="value"in pi?pi.value:pi.textContent,Ds=!0)),Je=nu(ge,Ht),0<Je.length&&(Ht=new Tp(Ht,r,null,l,Se),Ce.push({event:Ht,listeners:Je}),It?Ht.data=It:(It=_p(l),It!==null&&(Ht.data=It)))),(It=Rx?Ax(r,l):Ix(r,l))&&(Ht=nu(ge,"onBeforeInput"),0<Ht.length&&(Je=new Tp("onBeforeInput","beforeinput",null,l,Se),Ce.push({event:Je,listeners:Ht}),Je.data=It)),w8(Ce,r,ge,l,Se)}p2(Ce,i)})}function ul(r,i,l){return{instance:r,listener:i,currentTarget:l}}function nu(r,i){for(var l=i+"Capture",f=[];r!==null;){var b=r,v=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||v===null||(b=_o(r,l),b!=null&&f.unshift(ul(r,b,v)),b=_o(r,i),b!=null&&f.push(ul(r,b,v))),r.tag===3)return f;r=r.return}return[]}function T8(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function b2(r,i,l,f,b){for(var v=i._reactName,C=[];l!==null&&l!==f;){var z=l,ie=z.alternate,ge=z.stateNode;if(z=z.tag,ie!==null&&ie===f)break;z!==5&&z!==26&&z!==27||ge===null||(ie=ge,b?(ge=_o(l,v),ge!=null&&C.unshift(ul(l,ge,ie))):b||(ge=_o(l,v),ge!=null&&C.push(ul(l,ge,ie)))),l=l.return}C.length!==0&&r.push({event:i,listeners:C})}var C8=/\r\n?/g,N8=/\u0000|\uFFFD/g;function v2(r){return(typeof r=="string"?r:""+r).replace(C8,`
9
+ `).replace(N8,"")}function y2(r,i){return i=v2(i),v2(r)===i}function sn(r,i,l,f,b,v){switch(l){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||ht(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&ht(r,""+f);break;case"className":ir(r,"class",f);break;case"tabIndex":ir(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":ir(r,l,f);break;case"style":tn(r,f,v);break;case"data":if(i!=="object"){ir(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=mi(""+f),r.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){r.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 v=="function"&&(l==="formAction"?(i!=="input"&&sn(r,i,"name",b.name,b,null),sn(r,i,"formEncType",b.formEncType,b,null),sn(r,i,"formMethod",b.formMethod,b,null),sn(r,i,"formTarget",b.formTarget,b,null)):(sn(r,i,"encType",b.encType,b,null),sn(r,i,"method",b.method,b,null),sn(r,i,"target",b.target,b,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=mi(""+f),r.setAttribute(l,f);break;case"onClick":f!=null&&(r.onclick=qe);break;case"onScroll":f!=null&&Lt("scroll",r);break;case"onScrollEnd":f!=null&&Lt("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}l=mi(""+f),r.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":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""+f):r.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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":f===!0?r.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,f):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(l,f):r.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(l):r.setAttribute(l,f);break;case"popover":Lt("beforetoggle",r),Lt("toggle",r),Pn(r,"popover",f);break;case"xlinkActuate":Qn(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Qn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Qn(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Qn(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Qn(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Qn(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Qn(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Pn(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=La.get(l)||l,Pn(r,l,f))}}function bf(r,i,l,f,b,v){switch(l){case"style":tn(r,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof f=="string"?ht(r,f):(typeof f=="number"||typeof f=="bigint")&&ht(r,""+f);break;case"onScroll":f!=null&&Lt("scroll",r);break;case"onScrollEnd":f!=null&&Lt("scrollend",r);break;case"onClick":f!=null&&(r.onclick=qe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(b=l.endsWith("Capture"),i=l.slice(2,b?l.length-7:void 0),v=r[Tn]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(i,v,b),typeof f=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,f,b);break e}l in r?r[l]=f:f===!0?r.setAttribute(l,""):Pn(r,l,f)}}}function ar(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",r),Lt("load",r);var f=!1,b=!1,v;for(v in l)if(l.hasOwnProperty(v)){var C=l[v];if(C!=null)switch(v){case"src":f=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,v,C,l,null)}}b&&sn(r,i,"srcSet",l.srcSet,l,null),f&&sn(r,i,"src",l.src,l,null);return;case"input":Lt("invalid",r);var z=v=C=b=null,ie=null,ge=null;for(f in l)if(l.hasOwnProperty(f)){var Se=l[f];if(Se!=null)switch(f){case"name":b=Se;break;case"type":C=Se;break;case"checked":ie=Se;break;case"defaultChecked":ge=Se;break;case"value":v=Se;break;case"defaultValue":z=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(a(137,i));break;default:sn(r,i,f,Se,l,null)}}Jn(r,v,z,ie,ge,C,b,!1);return;case"select":Lt("invalid",r),f=C=v=null;for(b in l)if(l.hasOwnProperty(b)&&(z=l[b],z!=null))switch(b){case"value":v=z;break;case"defaultValue":C=z;break;case"multiple":f=z;default:sn(r,i,b,z,l,null)}i=v,l=C,r.multiple=!!f,i!=null?er(r,!!f,i,!1):l!=null&&er(r,!!f,l,!0);return;case"textarea":Lt("invalid",r),v=b=f=null;for(C in l)if(l.hasOwnProperty(C)&&(z=l[C],z!=null))switch(C){case"value":f=z;break;case"defaultValue":b=z;break;case"children":v=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(91));break;default:sn(r,i,C,z,l,null)}Os(r,f,b,v);return;case"option":for(ie in l)l.hasOwnProperty(ie)&&(f=l[ie],f!=null)&&(ie==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":sn(r,i,ie,f,l,null));return;case"dialog":Lt("beforetoggle",r),Lt("toggle",r),Lt("cancel",r),Lt("close",r);break;case"iframe":case"object":Lt("load",r);break;case"video":case"audio":for(f=0;f<cl.length;f++)Lt(cl[f],r);break;case"image":Lt("error",r),Lt("load",r);break;case"details":Lt("toggle",r);break;case"embed":case"source":case"link":Lt("error",r),Lt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ge in l)if(l.hasOwnProperty(ge)&&(f=l[ge],f!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,ge,f,l,null)}return;default:if(hi(i)){for(Se in l)l.hasOwnProperty(Se)&&(f=l[Se],f!==void 0&&bf(r,i,Se,f,l,void 0));return}}for(z in l)l.hasOwnProperty(z)&&(f=l[z],f!=null&&sn(r,i,z,f,l,null))}function R8(r,i,l,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,v=null,C=null,z=null,ie=null,ge=null,Se=null;for(xe in l){var Ce=l[xe];if(l.hasOwnProperty(xe)&&Ce!=null)switch(xe){case"checked":break;case"value":break;case"defaultValue":ie=Ce;default:f.hasOwnProperty(xe)||sn(r,i,xe,null,f,Ce)}}for(var ve in f){var xe=f[ve];if(Ce=l[ve],f.hasOwnProperty(ve)&&(xe!=null||Ce!=null))switch(ve){case"type":v=xe;break;case"name":b=xe;break;case"checked":ge=xe;break;case"defaultChecked":Se=xe;break;case"value":C=xe;break;case"defaultValue":z=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(137,i));break;default:xe!==Ce&&sn(r,i,ve,xe,f,Ce)}}Or(r,C,z,ie,ge,Se,v,b);return;case"select":xe=C=z=ve=null;for(v in l)if(ie=l[v],l.hasOwnProperty(v)&&ie!=null)switch(v){case"value":break;case"multiple":xe=ie;default:f.hasOwnProperty(v)||sn(r,i,v,null,f,ie)}for(b in f)if(v=f[b],ie=l[b],f.hasOwnProperty(b)&&(v!=null||ie!=null))switch(b){case"value":ve=v;break;case"defaultValue":z=v;break;case"multiple":C=v;default:v!==ie&&sn(r,i,b,v,f,ie)}i=z,l=C,f=xe,ve!=null?er(r,!!l,ve,!1):!!f!=!!l&&(i!=null?er(r,!!l,i,!0):er(r,!!l,l?[]:"",!1));return;case"textarea":xe=ve=null;for(z in l)if(b=l[z],l.hasOwnProperty(z)&&b!=null&&!f.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:sn(r,i,z,null,f,b)}for(C in f)if(b=f[C],v=l[C],f.hasOwnProperty(C)&&(b!=null||v!=null))switch(C){case"value":ve=b;break;case"defaultValue":xe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(a(91));break;default:b!==v&&sn(r,i,C,b,f,v)}sc(r,ve,xe);return;case"option":for(var Ke in l)ve=l[Ke],l.hasOwnProperty(Ke)&&ve!=null&&!f.hasOwnProperty(Ke)&&(Ke==="selected"?r.selected=!1:sn(r,i,Ke,null,f,ve));for(ie in f)ve=f[ie],xe=l[ie],f.hasOwnProperty(ie)&&ve!==xe&&(ve!=null||xe!=null)&&(ie==="selected"?r.selected=ve&&typeof ve!="function"&&typeof ve!="symbol":sn(r,i,ie,ve,f,xe));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 ft in l)ve=l[ft],l.hasOwnProperty(ft)&&ve!=null&&!f.hasOwnProperty(ft)&&sn(r,i,ft,null,f,ve);for(ge in f)if(ve=f[ge],xe=l[ge],f.hasOwnProperty(ge)&&ve!==xe&&(ve!=null||xe!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(a(137,i));break;default:sn(r,i,ge,ve,f,xe)}return;default:if(hi(i)){for(var on in l)ve=l[on],l.hasOwnProperty(on)&&ve!==void 0&&!f.hasOwnProperty(on)&&bf(r,i,on,void 0,f,ve);for(Se in f)ve=f[Se],xe=l[Se],!f.hasOwnProperty(Se)||ve===xe||ve===void 0&&xe===void 0||bf(r,i,Se,ve,f,xe);return}}for(var de in l)ve=l[de],l.hasOwnProperty(de)&&ve!=null&&!f.hasOwnProperty(de)&&sn(r,i,de,null,f,ve);for(Ce in f)ve=f[Ce],xe=l[Ce],!f.hasOwnProperty(Ce)||ve===xe||ve==null&&xe==null||sn(r,i,Ce,ve,f,xe)}function x2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A8(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var b=l[f],v=b.transferSize,C=b.initiatorType,z=b.duration;if(v&&z&&x2(C)){for(C=0,z=b.responseEnd,f+=1;f<l.length;f++){var ie=l[f],ge=ie.startTime;if(ge>z)break;var Se=ie.transferSize,Ce=ie.initiatorType;Se&&x2(Ce)&&(ie=ie.responseEnd,C+=Se*(ie<z?1:(z-ge)/(ie-ge)))}if(--f,i+=8*(v+C)/(b.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var vf=null,yf=null;function ru(r){return r.nodeType===9?r:r.ownerDocument}function w2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function k2(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function xf(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var wf=null;function I8(){var r=window.event;return r&&r.type==="popstate"?r===wf?!1:(wf=r,!0):(wf=null,!1)}var S2=typeof setTimeout=="function"?setTimeout:void 0,_8=typeof clearTimeout=="function"?clearTimeout:void 0,E2=typeof Promise=="function"?Promise:void 0,M8=typeof queueMicrotask=="function"?queueMicrotask:typeof E2<"u"?function(r){return E2.resolve(null).then(r).catch(O8)}:S2;function O8(r){setTimeout(function(){throw r})}function Mi(r){return r==="head"}function T2(r,i){var l=i,f=0;do{var b=l.nextSibling;if(r.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"||l==="/&"){if(f===0){r.removeChild(b),lo(i);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")dl(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,dl(l);for(var v=l.firstChild;v;){var C=v.nextSibling,z=v.nodeName;v[Da]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=C}}else l==="body"&&dl(r.ownerDocument.body);l=b}while(l);lo(i)}function C2(r,i){var l=r;r=0;do{var f=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=f}while(l)}function kf(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":kf(l),ja(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function D8(r,i,l,f){for(;r.nodeType===1;){var b=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Da])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=na(r.nextSibling),r===null)break}return null}function j8(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=na(r.nextSibling),r===null))return null;return r}function N2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=na(r.nextSibling),r===null))return null;return r}function Sf(r){return r.data==="$?"||r.data==="$~"}function Ef(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function L8(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var f=function(){i(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function na(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Tf=null;function R2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return na(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function A2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function I2(r,i,l){switch(i=ru(l),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function dl(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);ja(r)}var ra=new Map,_2=new Set;function au(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Qa=K.d;K.d={f:z8,r:B8,D:q8,C:H8,L:U8,m:F8,X:P8,S:$8,M:G8};function z8(){var r=Qa.f(),i=Wc();return r||i}function B8(r){var i=la(r);i!==null&&i.tag===5&&i.type==="form"?Yg(i):Qa.r(r)}var io=typeof document>"u"?null:document;function M2(r,i,l){var f=io;if(f&&typeof i=="string"&&i){var b=gn(i);b='link[rel="'+r+'"][href="'+b+'"]',typeof l=="string"&&(b+='[crossorigin="'+l+'"]'),_2.has(b)||(_2.add(b),r={rel:r,crossOrigin:l,href:i},f.querySelector(b)===null&&(i=f.createElement("link"),ar(i,"link",r),wn(i),f.head.appendChild(i)))}}function q8(r){Qa.D(r),M2("dns-prefetch",r,null)}function H8(r,i){Qa.C(r,i),M2("preconnect",r,i)}function U8(r,i,l){Qa.L(r,i,l);var f=io;if(f&&r&&i){var b='link[rel="preload"][as="'+gn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(b+='[imagesrcset="'+gn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(b+='[imagesizes="'+gn(l.imageSizes)+'"]')):b+='[href="'+gn(r)+'"]';var v=b;switch(i){case"style":v=so(r);break;case"script":v=oo(r)}ra.has(v)||(r=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),ra.set(v,r),f.querySelector(b)!==null||i==="style"&&f.querySelector(fl(v))||i==="script"&&f.querySelector(hl(v))||(i=f.createElement("link"),ar(i,"link",r),wn(i),f.head.appendChild(i)))}}function F8(r,i){Qa.m(r,i);var l=io;if(l&&r){var f=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+gn(f)+'"][href="'+gn(r)+'"]',v=b;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=oo(r)}if(!ra.has(v)&&(r=g({rel:"modulepreload",href:r},i),ra.set(v,r),l.querySelector(b)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(hl(v)))return}f=l.createElement("link"),ar(f,"link",r),wn(f),l.head.appendChild(f)}}}function $8(r,i,l){Qa.S(r,i,l);var f=io;if(f&&r){var b=ca(f).hoistableStyles,v=so(r);i=i||"default";var C=b.get(v);if(!C){var z={loading:0,preload:null};if(C=f.querySelector(fl(v)))z.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},l),(l=ra.get(v))&&Cf(r,l);var ie=C=f.createElement("link");wn(ie),ar(ie,"link",r),ie._p=new Promise(function(ge,Se){ie.onload=ge,ie.onerror=Se}),ie.addEventListener("load",function(){z.loading|=1}),ie.addEventListener("error",function(){z.loading|=2}),z.loading|=4,iu(C,i,f)}C={type:"stylesheet",instance:C,count:1,state:z},b.set(v,C)}}}function P8(r,i){Qa.X(r,i);var l=io;if(l&&r){var f=ca(l).hoistableScripts,b=oo(r),v=f.get(b);v||(v=l.querySelector(hl(b)),v||(r=g({src:r,async:!0},i),(i=ra.get(b))&&Nf(r,i),v=l.createElement("script"),wn(v),ar(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(b,v))}}function G8(r,i){Qa.M(r,i);var l=io;if(l&&r){var f=ca(l).hoistableScripts,b=oo(r),v=f.get(b);v||(v=l.querySelector(hl(b)),v||(r=g({src:r,async:!0,type:"module"},i),(i=ra.get(b))&&Nf(r,i),v=l.createElement("script"),wn(v),ar(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(b,v))}}function O2(r,i,l,f){var b=(b=V.current)?au(b):null;if(!b)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=so(l.href),l=ca(b).hoistableStyles,f=l.get(i),f||(f={type:"style",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=so(l.href);var v=ca(b).hoistableStyles,C=v.get(r);if(C||(b=b.ownerDocument||b,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,C),(v=b.querySelector(fl(r)))&&!v._p&&(C.instance=v,C.state.loading=5),ra.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ra.set(r,l),v||V8(b,r,l,C.state))),i&&f===null)throw Error(a(528,""));return C}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=oo(l),l=ca(b).hoistableScripts,f=l.get(i),f||(f={type:"script",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function so(r){return'href="'+gn(r)+'"'}function fl(r){return'link[rel="stylesheet"]['+r+"]"}function D2(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function V8(r,i,l,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),ar(i,"link",l),wn(i),r.head.appendChild(i))}function oo(r){return'[src="'+gn(r)+'"]'}function hl(r){return"script[async]"+r}function j2(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+gn(l.href)+'"]');if(f)return i.instance=f,wn(f),f;var b=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),wn(f),ar(f,"style",b),iu(f,l.precedence,r),i.instance=f;case"stylesheet":b=so(l.href);var v=r.querySelector(fl(b));if(v)return i.state.loading|=4,i.instance=v,wn(v),v;f=D2(l),(b=ra.get(b))&&Cf(f,b),v=(r.ownerDocument||r).createElement("link"),wn(v);var C=v;return C._p=new Promise(function(z,ie){C.onload=z,C.onerror=ie}),ar(v,"link",f),i.state.loading|=4,iu(v,l.precedence,r),i.instance=v;case"script":return v=oo(l.src),(b=r.querySelector(hl(v)))?(i.instance=b,wn(b),b):(f=l,(b=ra.get(v))&&(f=g({},l),Nf(f,b)),r=r.ownerDocument||r,b=r.createElement("script"),wn(b),ar(b,"link",f),r.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,iu(f,l.precedence,r));return i.instance}function iu(r,i,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=f.length?f[f.length-1]:null,v=b,C=0;C<f.length;C++){var z=f[C];if(z.dataset.precedence===i)v=z;else if(v!==b)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Cf(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Nf(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var su=null;function L2(r,i,l){if(su===null){var f=new Map,b=su=new Map;b.set(l,f)}else b=su,f=b.get(l),f||(f=new Map,b.set(l,f));if(f.has(r))return f;for(f.set(r,null),l=l.getElementsByTagName(r),b=0;b<l.length;b++){var v=l[b];if(!(v[Da]||v[Wt]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(i)||"";C=r+C;var z=f.get(C);z?z.push(v):f.set(C,[v])}}return f}function z2(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function K8(r,i,l){if(l===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function B2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Y8(r,i,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var b=so(f.href),v=i.querySelector(fl(b));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ou.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=v,wn(v);return}v=i.ownerDocument||i,f=D2(f),(b=ra.get(b))&&Cf(f,b),v=v.createElement("link"),wn(v);var C=v;C._p=new Promise(function(z,ie){C.onload=z,C.onerror=ie}),ar(v,"link",f),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=ou.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var Rf=0;function W8(r,i){return r.stylesheets&&r.count===0&&cu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var f=setTimeout(function(){if(r.stylesheets&&cu(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Rf===0&&(Rf=62500*A8());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&cu(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Rf?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(b)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var lu=null;function cu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,lu=new Map,i.forEach(Z8,r),lu=null,ou.call(r))}function Z8(r,i){if(!(i.state.loading&4)){var l=lu.get(r);if(l)var f=l.get(null);else{l=new Map,lu.set(r,l);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<b.length;v++){var C=b[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(l.set(C.dataset.precedence,C),f=C)}f&&l.set(null,f)}b=i.instance,C=b.getAttribute("data-precedence"),v=l.get(C)||f,v===f&&l.set(null,b),l.set(C,b),this.count++,f=ou.bind(this),b.addEventListener("load",f),b.addEventListener("error",f),v?v.parentNode.insertBefore(b,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),i.state.loading|=4}}var ml={$$typeof:_,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function X8(r,i,l,f,b,v,C,z,ie){this.tag=1,this.containerInfo=r,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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=f,this.onUncaughtError=b,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function q2(r,i,l,f,b,v,C,z,ie,ge,Se,Ce){return r=new X8(r,i,l,C,ie,ge,Se,Ce,z),i=1,v===!0&&(i|=24),v=jr(3,null,null,i),r.current=v,v.stateNode=r,i=s0(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:f,isDehydrated:l,cache:i},u0(v),r}function H2(r){return r?(r=Bs,r):Bs}function U2(r,i,l,f,b,v){b=H2(b),f.context===null?f.context=b:f.pendingContext=b,f=wi(i),f.payload={element:l},v=v===void 0?null:v,v!==null&&(f.callback=v),l=ki(r,f,i),l!==null&&(Tr(l,r,i),Vo(l,r,i))}function F2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function Af(r,i){F2(r,i),(r=r.alternate)&&F2(r,i)}function $2(r){if(r.tag===13||r.tag===31){var i=es(r,67108864);i!==null&&Tr(i,r,67108864),Af(r,67108864)}}function P2(r){if(r.tag===13||r.tag===31){var i=Hr();i=fn(i);var l=es(r,i);l!==null&&Tr(l,r,i),Af(r,i)}}var uu=!0;function Q8(r,i,l,f){var b=I.T;I.T=null;var v=K.p;try{K.p=2,If(r,i,l,f)}finally{K.p=v,I.T=b}}function J8(r,i,l,f){var b=I.T;I.T=null;var v=K.p;try{K.p=8,If(r,i,l,f)}finally{K.p=v,I.T=b}}function If(r,i,l,f){if(uu){var b=_f(f);if(b===null)gf(r,i,f,du,l),V2(r,f);else if(t9(b,r,i,l,f))f.stopPropagation();else if(V2(r,f),i&4&&-1<e9.indexOf(r)){for(;b!==null;){var v=la(b);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=Yt(v.pendingLanes);if(C!==0){var z=v;for(z.pendingLanes|=2,z.entangledLanes|=2;C;){var ie=1<<31-Tt(C);z.entanglements[1]|=ie,C&=~ie}Sa(v),(Zt&6)===0&&(Kc=Ue()+500,ll(0))}}break;case 31:case 13:z=es(v,2),z!==null&&Tr(z,v,2),Wc(),Af(v,2)}if(v=_f(f),v===null&&gf(r,i,f,du,l),v===b)break;b=v}b!==null&&f.stopPropagation()}else gf(r,i,f,null,l)}}function _f(r){return r=Et(r),Mf(r)}var du=null;function Mf(r){if(du=null,r=Xn(r),r!==null){var i=o(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=c(i),r!==null)return r;r=null}else if(l===31){if(r=d(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return du=r,null}function G2(r){switch(r){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(ot()){case fe:return 2;case me:return 8;case $e:case we:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var Of=!1,Oi=null,Di=null,ji=null,pl=new Map,gl=new Map,Li=[],e9="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 V2(r,i){switch(r){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":pl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":gl.delete(i.pointerId)}}function bl(r,i,l,f,b,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:v,targetContainers:[b]},i!==null&&(i=la(i),i!==null&&$2(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),r)}function t9(r,i,l,f,b){switch(i){case"focusin":return Oi=bl(Oi,r,i,l,f,b),!0;case"dragenter":return Di=bl(Di,r,i,l,f,b),!0;case"mouseover":return ji=bl(ji,r,i,l,f,b),!0;case"pointerover":var v=b.pointerId;return pl.set(v,bl(pl.get(v)||null,r,i,l,f,b)),!0;case"gotpointercapture":return v=b.pointerId,gl.set(v,bl(gl.get(v)||null,r,i,l,f,b)),!0}return!1}function K2(r){var i=Xn(r.target);if(i!==null){var l=o(i);if(l!==null){if(i=l.tag,i===13){if(i=c(l),i!==null){r.blockedOn=i,yr(r.priority,function(){P2(l)});return}}else if(i===31){if(i=d(l),i!==null){r.blockedOn=i,yr(r.priority,function(){P2(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function fu(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=_f(r.nativeEvent);if(l===null){l=r.nativeEvent;var f=new l.constructor(l.type,l);Xe=f,l.target.dispatchEvent(f),Xe=null}else return i=la(l),i!==null&&$2(i),r.blockedOn=l,!1;i.shift()}return!0}function Y2(r,i,l){fu(r)&&l.delete(i)}function n9(){Of=!1,Oi!==null&&fu(Oi)&&(Oi=null),Di!==null&&fu(Di)&&(Di=null),ji!==null&&fu(ji)&&(ji=null),pl.forEach(Y2),gl.forEach(Y2)}function hu(r,i){r.blockedOn===i&&(r.blockedOn=null,Of||(Of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,n9)))}var mu=null;function W2(r){mu!==r&&(mu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mu===r&&(mu=null);for(var i=0;i<r.length;i+=3){var l=r[i],f=r[i+1],b=r[i+2];if(typeof f!="function"){if(Mf(f||l)===null)continue;break}var v=la(l);v!==null&&(r.splice(i,3),i-=3,I0(v,{pending:!0,data:b,method:l.method,action:f},f,b))}}))}function lo(r){function i(ie){return hu(ie,r)}Oi!==null&&hu(Oi,r),Di!==null&&hu(Di,r),ji!==null&&hu(ji,r),pl.forEach(i),gl.forEach(i);for(var l=0;l<Li.length;l++){var f=Li[l];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Li.length&&(l=Li[0],l.blockedOn===null);)K2(l),l.blockedOn===null&&Li.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var b=l[f],v=l[f+1],C=b[Tn]||null;if(typeof v=="function")C||W2(l);else if(C){var z=null;if(v&&v.hasAttribute("formAction")){if(b=v,C=v[Tn]||null)z=C.formAction;else if(Mf(b)!==null)continue}else z=C.action;typeof z=="function"?l[f+1]=z:(l.splice(f,3),f-=3),W2(l)}}}function Z2(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return b=C})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function Df(r){this._internalRoot=r}pu.prototype.render=Df.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,f=Hr();U2(l,f,r,i,null,null)},pu.prototype.unmount=Df.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;U2(r.current,2,null,r,null,null),Wc(),i[Kr]=null}};function pu(r){this._internalRoot=r}pu.prototype.unstable_scheduleHydration=function(r){if(r){var i=ba();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Li.length&&i!==0&&i<Li[l].priority;l++);Li.splice(l,0,r),l===0&&K2(r)}};var X2=t.version;if(X2!=="19.2.8")throw Error(a(527,X2,"19.2.8"));K.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var r9={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gu.isDisabled&&gu.supportsFiber)try{Pt=gu.inject(r9),bt=gu}catch{}}return yl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var l=!1,f="",b=a4,v=i4,C=s4;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError)),i=q2(r,1,!1,null,null,l,f,null,b,v,C,Z2),r[Kr]=i.current,pf(r),new Df(i)},yl.hydrateRoot=function(r,i,l){if(!s(r))throw Error(a(299));var f=!1,b="",v=a4,C=i4,z=s4,ie=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(b=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(C=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError),l.formState!==void 0&&(ie=l.formState)),i=q2(r,1,!0,i,l??null,f,b,ie,v,C,z,Z2),i.context=H2(null),l=i.current,f=Hr(),f=fn(f),b=wi(f),b.callback=null,ki(l,b,f),l=f,i.current.lanes=l,Ct(i,l),Sa(i),r[Kr]=i.current,pf(r),new pu(i)},yl.version="19.2.8",yl}var ob;function f9(){if(ob)return zf.exports;ob=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(t){console.error(t)}}return e(),zf.exports=d9(),zf.exports}var h9=f9();const Al={"worker-managed-rerun-unsupported":"这次运行由 Console/Worker 启动,不能只从某个节点续跑","workspace-drift":"工作区在上次运行后又改过文件,旧结果不能接着用","controller-drift":"控制器版本已变化,不能接到上次运行上继续","binding-drift":"任务契约或源文件已变化,不能只续跑旧计划","restart-subgraph-contains-unsafe-shell":"下游包含会执行命令的验证步骤,不能只重跑这一段","restart-subgraph-contains-writer":"下游包含会改代码的写入步骤,不能只重跑这一段","restart-subgraph-contains-decision-gate":"下游包含需要人工决策的门禁,不能只重跑这一段","dynamic-rerun-unsupported":"这次运行含动态展开节点,不支持从节点续跑","parent-lifecycle-ineligible":"当前运行状态不允许从节点续跑","convergence-rerun-unsupported":"收敛型运行不支持从节点续跑","evaluation-rerun-unsupported":"带评估的运行不支持从节点续跑","budget-rerun-unsupported":"硬预算运行不支持从节点续跑","workspace-checkpoint-missing":"缺少工作区快照,无法安全地只续跑一段","skill-snapshot-invalid":"技能快照缺失或损坏,不能接到上次运行上继续","unresolved-errors-outside-reset-closure":"选中节点之外还有未解决的失败,只重跑这一段不够","selected-node-missing":"找不到要续跑的起始节点","ambiguous-skipped-rewrite":"跳过的节点有多个上游失败,无法自动选定起点","skipped-without-upstream-error":"该节点被跳过且没有明确的上游失败","parent-facts-invalid":"上次运行的证据不完整或已损坏,不能只续跑一段",RUN_NOT_ACTIVE:"这次运行不在活动状态,不能协作中止",RUN_NOT_CONSOLE_OWNED:"此运行不由当前 Console 持有,暂不支持协作中止",RUNNER_IDENTITY_MISMATCH:"运行身份已变化,不能中止这份过期请求",INTERRUPT_ALREADY_PENDING:"已有一条中止请求等待结算",RUN_ALREADY_TERMINAL:"运行已经结束,没有可中止的活 runner",INTERRUPT_NEEDS_RECONCILE:"中止请求已登记但无法确认 runner 已处理,需要对账"};function m9(){return Object.keys(Al)}function qu(e){const t=e.trim().replace(/[.…]+$/,"");if(!t)return null;if(Al[t])return{code:t};const n=t.lastIndexOf(":");if(n>0){const a=t.slice(n+1),s=t.slice(0,n);if(Al[a])return{code:a,nodeId:s};const o=m9().find(c=>a.length>=3&&c.startsWith(a));if(o)return{code:o,nodeId:s}}return Al[t]?{code:t}:null}function p9(e){const t=[];for(const n of e.blockedReasons??[]){const a=qu(String(n));a&&t.push(a)}for(const n of e.blockingNodes??[]){const a=n.reasonCode?.trim();if(!a)continue;const s=qu(n.nodeId?`${n.nodeId}:${a}`:a);s&&t.push(s)}if(t.length===0&&e.fallbackMessage?.trim()){const n=e.fallbackMessage.trim().replace(/^从节点重跑不具备安全资格[::]?\s*/,"").replace(/[。..]+$/,"");for(const a of n.split(/[;;]/)){const s=qu(a);s&&t.push(s)}}return t}function g9(e){const t=new Map;for(const a of e){const s=t.get(a.code)??[];a.nodeId&&!s.includes(a.nodeId)&&s.push(a.nodeId),t.set(a.code,s)}const n=[];for(const[a,s]of t){const o=Al[a];o&&(s.length>0&&a.startsWith("restart-subgraph-contains-")?n.push(`${o}(${s.join("、")})`):n.push(o))}return n}function b9(e){return e.join("; ").includes("worker-managed-rerun-unsupported")||e.some(n=>qu(n)?.code==="worker-managed-rerun-unsupported")?"下一步:请点下方「重新排队 Worker Task」,从头完整执行。":"下一步:请改用「带反馈重新执行任务」,重新生成完整 DAG。"}function L3(e){const t=e.fallbackMessage?.trim();if(t?.startsWith("无法从该节点续跑"))return t;const n=p9(e),a=g9(n),s=n.map(c=>c.code),o=b9(s.length>0?s:[t??""]);return a.length===0?["无法从该节点续跑。这次续跑不够安全(工作区、控制器或下游步骤不允许只重跑一段)。",o].join(`
10
+ `):["无法从该节点续跑,因为:",...a.map(c=>`• ${c}`),"",o].join(`
11
+ `)}function v9(e){const t=e.trim();if(!t)return null;if(t.startsWith("无法从该节点续跑"))return t;if(/从节点重跑不具备安全资格|worker-managed-rerun-unsupported|restart-subgraph-contains-|workspace-drift|controller-drift|binding-drift/.test(t))return L3({fallbackMessage:t});if(/action must be a mutation-gate target/i.test(t))return"这个操作不能再走确认门。Worker 启动的任务请直接点「重新排队 Worker Task」;独立运行请点「带反馈重新执行任务」。";if(/cannot read dagReport run facts/i.test(t))return"读不到这次运行的失败报告,不能完整重跑。请先点「查看报告」或「Doctor 诊断」。";if(/dagRerunPlan run facts unavailable/i.test(t))return"读不到节点恢复资格,不能直接改走完整重跑。请先点「从失败节点恢复」查看资格,或先「查看报告」。";if(/node rerun plan is eligible/i.test(t))return"节点恢复是安全的,请改用「从失败节点恢复」,不必重新执行完整任务。";if(/does not support autonomous standaloneTaskRerun/i.test(t))return"当前失败不适合自动完整重跑。请先点「查看报告」,按建议操作。";if(/primaryRecovery requires a human decision/i.test(t))return"这次失败需要人工决策,不能自动重跑。请先点「查看报告」。";if(/is not bound to run/i.test(t))return"填写的任务 ID 与这次运行不匹配。请使用该运行绑定的原任务 ID。";if(/cannot read pool doctor/i.test(t))return"读不到任务队列状态,暂时不能重新排队。请稍后重试,或先跑 Doctor 诊断。";if(/not found in the pool doctor inventory/i.test(t))return"任务队列里找不到这个任务,不能重新排队。请确认 Task ID 来自 Worker 队列,而不是只填了 DAG 运行 ID。";if(/only Failed tasks are retry-eligible/i.test(t)){const n=t.match(/is ([A-Za-z_]+); only Failed/)?.[1];return n?`该任务当前是「${n}」,只有失败(Failed)的任务才能重新排队。`:"只有失败(Failed)的任务才能重新排队。请先确认任务已失败。"}return/featureId .+ does not match the pool task/i.test(t)?"Feature ID 与队列中的任务不一致。请改用队列里记录的 Feature ID,或留空后重试。":/RUN_NOT_CONSOLE_OWNED|不由当前 Console 持有/.test(t)?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":/RUNNER_IDENTITY_MISMATCH|运行身份已变化/.test(t)?"运行身份已变化,不能中止这份过期请求。请刷新后再试。":/INTERRUPT_ALREADY_PENDING|已有一条中止请求/.test(t)?"已有一条中止请求等待当前节点安全收敛。请稍候刷新,不要重复提交。":/RUN_ALREADY_TERMINAL|运行已经结束/.test(t)?"运行已经结束,没有可中止的活 runner。请改用报告或对账。":/INTERRUPT_NEEDS_RECONCILE|无法确认 runner 已处理/.test(t)?"中止请求已登记,但无法确认 runner 已处理。请用 Doctor 对账,不要当成已经中止。":/RUN_NOT_ACTIVE/.test(t)?"这次运行不在本机活动目录,或已经不是 running,不能协作中止。":null}function y9(e){return e==="validate"||e==="apply"||e==="spine"?"contract":e}async function x9(e,t){const a=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}/prewrite-result`),{credentials:"same-origin"});if(!a.ok)return{ok:!1,status:a.status};const s=await a.json();return!s||typeof s.classification!="string"?{ok:!1,status:a.status}:{ok:!0,result:{schemaVersion:typeof s.schemaVersion=="number"?s.schemaVersion:1,schemaId:typeof s.schemaId=="string"?s.schemaId:"",classification:s.classification,failureCode:typeof s.failureCode=="string"?s.failureCode:null,failureReason:typeof s.failureReason=="string"?s.failureReason:null}}}function w9(e){return e==="fail"?"未通过":e==="pass"?"通过":"未知/不可判定"}const R1="X-Loop-Console-Confirmation",z3="agent-worker console doctor --repo .",A1=["LOW","MED","HIGH"];function k9(e){if(e.length===0)return"模型值不能为空";if(e.trim()!==e)return"模型值不能包含首尾空白";if(e==="default")return"default 是保留哨兵,不能作为模型值";if(e.startsWith("/")||e.endsWith("/")||e.includes("//"))return"provider/model 格式非法:不允许 /model、provider/ 或 a//b"}function S9(e){const t={};for(const n of A1){const a=k9(e[n]);a&&(t[n]=a)}return t}function lb(e){return{LOW:e?.LOW?.value??"",MED:e?.MED?.value??"",HIGH:e?.HIGH?.value??""}}function E9(e){return A1.every(t=>e[t]===void 0)}const Om=[{kind:"standard",label:"后端研发(默认 DAG)",hint:"生成标准 hybrid DAG(contract → implement → verify)"},{kind:"frontend-implementation",label:"前端研发",hint:"生成 frontend-implementation 专用节点链"},{kind:"backend-test",label:"后端测试",hint:"生成 backend-test-dag(分析 / 用例 / pytest)"},{kind:"frontend-test",label:"前端测试",hint:"生成 frontend-test-dag(RAG 用例 + Playwright CLI)"}],B3={"setup-required":"需要设置",ready:"已就绪",degraded:"降级可用",unknown:"未知"},T9={idle:"未探测",match:"匹配",mismatch:"仓库不匹配",unavailable:"不可用"},q3={low:"低",medium:"中",high:"高"},H3={"validation-failed":"校验失败","contract-drift":"契约漂移","runtime-mismatch":"运行时不匹配","pause-on-human":"等待人工","verification-failed":"验证失败","orphan-unknown":"孤立/未知","terminal-failed":"已终止(失败)","terminal-succeeded":"已终止(成功)","needs-reconcile":"需要对账","running-active":"正在运行"},C9={idle:"空闲","not-started":"未开始","not-run":"未运行","n/a (MVP)":"不适用(MVP)",accepted:"已接受",succeeded:"已成功",running:"运行中",ran:"已执行"};function bu(e){return C9[e]??e}function I1(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function $u(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function U3(e=typeof globalThis.location?.hash=="string"?globalThis.location.hash:""){const t=e.indexOf("?");if(!(t<0))return new URLSearchParams(e.slice(t+1)).get("workspaceId")?.trim()||void 0}function F3(e,t){const n=t?.trim()||U3();if(!n)return e;const a=e.includes("?")?"&":"?";return`${e}${a}workspaceId=${encodeURIComponent(n)}`}function Ir(e,t){return F3(e,t)}async function Ll(e,t={},n,a){const s=a?.trim()||U3(),o={"Content-Type":"application/json",[R1]:I1()},c=await fetch("/api/operator/v1/operations",{method:"POST",credentials:"same-origin",headers:o,body:JSON.stringify({action:e,actionParams:t,...s?{workspaceId:s}:{},...n?{clientRequestId:n}:{}})});let d={};try{d=await c.json()}catch{d={ok:!1,error:{code:"INVALID_INPUT",message:"操作响应不是合法 JSON"}}}return{status:c.status,body:d}}const N9=new Set(["runDag","dagRerun","dagReconcileRun","dagRequestInterrupt","standaloneTaskRerun","consoleUpdateAndInit"]);function Uf(e,t){return L3({blockedReasons:e.blockedReasons,blockingNodes:e.blockingNodes,fallbackMessage:t})}async function cb(e,t=3e5,n){const a=F3(`/api/operator/v1/operations/${encodeURIComponent(e)}`,n),s=Date.now();for(;Date.now()-s<t;){const o=await fetch(a,{credentials:"same-origin"});if(!o.ok)return null;const c=await o.json(),d=c.operation??c,h=d.state??"";if(h==="succeeded"||h==="failed"||h==="needs-reconcile"||h==="timed-out"||h==="restarting")return d;await new Promise(m=>setTimeout(m,250))}return{state:"needs-reconcile",errorMessage:"等待操作结果超时"}}function hs(e){if(e==null)return null;if(typeof e=="string")return e.trim()||null;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object"){const t=e;if(typeof t.text=="string"&&t.text.trim())return t.text.trim();if(typeof t.errorMessage=="string"&&t.errorMessage.trim())return t.errorMessage.trim();if(Array.isArray(t.content)){const n=t.content.map(a=>{if(typeof a=="string")return a;if(a&&typeof a=="object"){const s=a;if(typeof s.text=="string")return s.text}return""}).filter(Boolean);if(n.length)return n.join(`
12
+ `).slice(0,240)}if(typeof t.role=="string")return`${t.role} 消息`}return null}function R9(e){const t=hs(e.at)??hs(e.timestamp)??hs(e.recordedAt)??"",n=hs(e.errorMessage)??hs(e.label)??hs(e.type)??hs(e.message)??"运行事件";return t?`${t} · ${n}`:n}function Il(e){return String(e.nodeId??e.id??"").trim()}function Ff(e){const t=Il(e);return String(e.label??e.name??(t||"未命名节点"))}function ub(e,t){if(e.length===0)return;const n=t?.trim();if(n){const o=e.find(c=>Il(c)===n);if(o)return o}const a=e.find(o=>{const c=String(o.status??"").toLowerCase();return c.includes("fail")||c.includes("error")||c==="blocked"});return a||(e.find(o=>{const c=String(o.status??"").toLowerCase();return c==="running"||c==="in_progress"||c==="active"})??e[0])}const A9=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function Dm(e){if(!e)return!1;const t=String(e.effectiveStatus??e.status??"").toLowerCase();return A9.has(t)}const I9=5e3;function _9({dagRunId:e,nodeId:t,onClose:n,onOpenFull:a}){const s=w.useRef(null),[o,c]=w.useState(null),[d,h]=w.useState([]),[m,p]=w.useState(null),[g,x]=w.useState(!0),[y,S]=w.useState(null),T=Dm(o);w.useEffect(()=>{s.current?.focus();const P=F=>{F.key==="Escape"&&n()};return document.addEventListener("keydown",P),document.title=`检视 · DAG ${e} · Loop Operator`,()=>document.removeEventListener("keydown",P)},[e,n]),w.useEffect(()=>{const P=new AbortController;let F;const A=async L=>{L&&(x(!0),p(null),h([]));try{const Z=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}`),{signal:P.signal,credentials:"same-origin"});if(!Z.ok)throw new Error(`DAG 查询失败(HTTP ${Z.status})`);const U=await Z.json();if(P.signal.aborted)return;c(U),p(null);const $=Array.isArray(U.nodes)?U.nodes:[];try{const oe=await x9(e);if(P.signal.aborted)return;oe.ok?S({status:"success",...oe.result}):oe.status===404&&S({status:"missing"})}catch{}const q=ub($,t),W=q?Il(q):t?.trim();if(W){const oe=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(W)}/session-events`),{signal:P.signal,credentials:"same-origin"});if(oe.ok){const J=await oe.json();P.signal.aborted||h((J.events??[]).slice(-20))}}Dm(U)&&F!==void 0&&(window.clearInterval(F),F=void 0)}catch(Z){P.signal.aborted||p(Z instanceof Error?Z.message:String(Z))}finally{!P.signal.aborted&&L&&x(!1)}};return A(!0),F=window.setInterval(()=>{A(!1)},I9),()=>{P.abort(),F!==void 0&&window.clearInterval(F)}},[e,t]);const N=w.useMemo(()=>Array.isArray(o?.nodes)?o.nodes:[],[o]),R=ub(N,t),M=R?Il(R):"",_=String(o?.effectiveStatus??o?.status??(g?"加载中…":"未知"));return u.jsxs("aside",{className:"inspect-split-panel","aria-label":"DAG 紧凑检视",children:[u.jsxs("div",{className:"inspect-split-header",children:[u.jsxs("div",{children:[u.jsx("p",{className:"inspect-split-kicker",children:"Inspect"}),u.jsx("h2",{children:"检视 DAG"})]}),u.jsx("button",{ref:s,type:"button","aria-label":"关闭检视面板",onClick:n,children:"关闭"})]}),u.jsx("p",{className:"inspect-split-id",children:u.jsx("code",{children:e})}),o?u.jsx("p",{className:`inspect-split-refresh${T?" is-terminal":""}`,"data-testid":"inspect-split-refresh",children:T?"已结束 · 停止自动刷新":"进行中 · 每 5 秒自动刷新"}):null,m?u.jsx("p",{className:"error",children:m}):null,g&&!o?u.jsx("p",{className:"muted",children:"正在加载 DAG…"}):null,u.jsxs("dl",{className:"inspect-split-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:_})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"当前节点"}),u.jsx("dd",{children:R?Ff(R):"暂无节点"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"节点状态"}),u.jsx("dd",{children:R?.status??"—"})]}),R?.errorPreview?u.jsxs("div",{children:[u.jsx("dt",{children:"错误摘要"}),u.jsx("dd",{children:R.errorPreview})]}):null,y?u.jsxs("div",{"data-testid":"inspect-prewrite-gate",children:[u.jsx("dt",{children:"prewrite 门禁"}),u.jsx("dd",{children:y.status==="missing"?u.jsx("span",{className:"muted",children:"prewrite 门禁结果尚未生成"}):u.jsxs(u.Fragment,{children:[y.classification,y.failureCode?u.jsxs("code",{"data-testid":"inspect-prewrite-failure-code",children:[" ",y.failureCode]}):null,y.failureReason?u.jsxs("span",{className:"muted",children:[" ","— ",y.failureReason]}):null]})})]}):null]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["节点(",N.length,")"]}),N.length?u.jsx("ul",{className:"inspect-split-nodes",children:N.slice(0,24).map(P=>{const F=Il(P)||Ff(P),A=F===M;return u.jsxs("li",{"data-active":A?"true":void 0,className:A?"is-active":void 0,children:[u.jsx("span",{children:Ff(P)}),u.jsx("code",{children:P.status??"—"})]},F)})}):u.jsx("p",{className:"muted",children:g?"加载节点中…":"该运行暂无节点。"})]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["最近事件",M?` · ${M}`:""]}),d.length?u.jsx("ul",{className:"inspect-split-events",children:d.map((P,F)=>u.jsx("li",{children:R9(P)},`${P.at??F}-${F}`))}):u.jsx("p",{className:"muted",children:g?"加载事件中…":"节点事件将在可用时显示。"})]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,children:"全屏观测"}),u.jsx("p",{className:"muted",children:"全屏后点顶栏「返回操作台」可回来。"})]})}const ma="loop-console.operator-chat.active-session.v1",M9="loop-console.operator-chat.default-landing.v1";function Pu(e){const t=e?.trim().toLowerCase();if(t==="chat")return"chat";if(t==="tasks")return"tasks"}function O9(e){const t=e?.trim().toLowerCase();if(t==="chat"||t==="tasks"||t==="recovery"||t==="night"||t==="models"||t==="settings")return t}function D9(e){const t=n=>e.get(n)?.trim()||void 0;return{...t("taskId")?{taskId:t("taskId")}:{},...t("dagRunId")?{dagRunId:t("dagRunId")}:{},...t("fromNodeId")?{fromNodeId:t("fromNodeId")}:{},...t("featureId")?{featureId:t("featureId")}:{},...t("intent")?{intent:t("intent")}:{},...t("workspaceId")?{workspaceId:t("workspaceId")}:{},...t("sessionId")?{sessionId:t("sessionId")}:{}}}function j9(e){const t=String(e??"").replace(/^#/,"");if(!t)return null;const n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n+1):"",o=(a||"/").split("?")[0]||"/";if(o==="/"||o==="")return null;const c=o.replace(/^\//,"").split("/")[0],d=O9(c);return d?{workspace:d,...D9(new URLSearchParams(s))}:null}function L9(e){if(!e)return;const t=j9(e.hash);if(t)return t.workspace;const n=new URLSearchParams(e.search),a=Pu(n.get("landing")??n.get("workspace"));if(a)return a;const s=e.hash.startsWith("#")?e.hash.slice(1):e.hash;return Pu(new URLSearchParams(s).get("workspace"))}function z9(e){return L9(e.location)??Pu(e.storage?.getItem(M9))??Pu(e.env)??"chat"}function B9(e,t={}){const n=new URLSearchParams;for(const[o,c]of Object.entries(t))c?.trim()&&n.set(o,c.trim());const a=n.toString(),s=`/${e}`;return a?`${s}?${a}`:s}function q9(e,t={}){return`#${B9(e,t)}`}const H9={};function U9(){const[e,t]=w.useState(()=>z9({env:H9?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location})),[n,a]=w.useState(null),[s,o]=w.useState("unknown"),[c,d]=w.useState(null),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,y]=w.useState(!1),[S,T]=w.useState(null),[N,R]=w.useState(null),[M,_]=w.useState(null),[P,F]=w.useState(null),[A,L]=w.useState({command:"idle",dag:"not-started",verification:"not-run",promote:"n/a (MVP)"}),[Z,U]=w.useState("setup"),$=w.useCallback(H=>{U(I=>y9(typeof H=="function"?H(I):H))},[]),q=s==="setup-required",W=s==="degraded",oe=w.useCallback(H=>{H!==e&&(T(null),_(null),R(null)),t(H)},[e]),J=w.useCallback(async H=>{const I=H?.trim(),K=be=>{o(be),$(be==="ready"||be==="degraded"?j=>j==="setup"?"import-prd":j:"setup")};let X="setup-required";try{const j=await(await fetch("/api/health")).json();a(j),X=j.piReadiness??"setup-required",m(null)}catch(be){m(be instanceof Error?be.message:String(be))}if(!I){K(X);return}try{const be=await fetch(`/api/operator/v1/readiness?workspaceId=${encodeURIComponent(I)}`);if(!be.ok){K(X);return}const j=await be.json();d(j),K(j.state??X)}catch{K(X)}},[$]);return{nav:e,setNav:t,selectNav:oe,health:n,readiness:s,setReadiness:o,readinessReport:c,healthError:h,loadHealth:J,busy:p,setBusy:g,observeBusy:x,setObserveBusy:y,opError:S,setOpError:T,opMessage:N,setOpMessage:R,opErrorCode:M,setOpErrorCode:_,lastOpState:P,setLastOpState:F,layers:A,setLayers:L,step:Z,setStep:$,setupBlocked:q,degraded:W}}const F9=[{pattern:/invalid (boot capability|confirmation header) token/i,copy:"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。"},{pattern:/mutation requires boot capability cookie|mutation requires confirmation header token/i,copy:"页面状态异常,请刷新页面(F5)后重试。"},{pattern:/Host header is required for non-loopback/i,copy:"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。"}];function ai(e){const t=(e??"").trim();if(!t)return"操作失败";const n=v9(t);if(n)return n;if(/controller identity changed|package fingerprint changed|entry binary sha256 changed/i.test(t))return"控制器版本已变更(Console 启动后代码被重新编译,或提交了 package.json / bin / dist / skills 等指纹范围文件)。请重启 Console 进程使其重新加载当前构建后再重试本操作;一次会话中途不要重建控制器。";if(/Pi session file missing or not openable|cannot reopen chat session .* no persisted Pi session file/i.test(t))return"该对话的 Pi 会话文件已丢失,无法恢复上下文。请新建对话继续(历史记录无法重开)。";if(/reopened Pi sessionId mismatch/i.test(t))return"重开对话失败:Pi 会话身份与记录不一致(常见于会话文件丢失后被误建)。请新建对话继续。";if(/base HEAD .+ != frozen baseCommit|exact-base|not a descendant of frozen baseCommit/i.test(t))return"主分支已相对夜间冻结的 baseCommit 前进,无法安全 fast-forward harvest。请人工核对后使用 Discard(必要时勾选强制),或改走日间合并流程。";if(/force-required|requires --force/i.test(t))return"该终态需要强制 Discard。请确认后勾选强制再试。";for(const a of F9)if(a.pattern.test(t))return a.copy;return t}const $9={bootstrapFromPrd:"正在导入 PRD 并创建任务:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",importPrd:"正在导入 PRD:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",interviewStart:"正在启动需求访谈…",interviewTurn:"正在提交访谈回答…",interviewSkip:"正在跳过访谈并生成评估…",contractValidate:"正在校验契约草稿…",contractDiff:"正在计算契约差异…",contractApply:"正在应用契约(写入需求与执行约束)…",spineCheck:"正在运行 Spine 审计…",dagGenerate:"正在生成 DAG…",standaloneTaskRerun:"正在带反馈重新执行任务:服务端校验资格后生成并启动新 DAG…",consoleUpdateAndInit:"正在检查活动运行、所选 npm 渠道与安全初始化;完成后 Console 将自动刷新…",workerTaskRetry:"正在重新排队 Worker Task…"};function P9(e){const{shell:t,applyInterviewPayload:n,workspaceId:a}=e,{setBusy:s,setOpError:o,setOpErrorCode:c,setOpMessage:d,setReadiness:h,setStep:m,setNav:p,setLastOpState:g,setLayers:x,step:y,nav:S}=t,[T,N]=w.useState(null),[R,M]=w.useState(null),[_,P]=w.useState([]),[F,A]=w.useState(!0),L=w.useRef(null),[Z,U]=w.useState(null),[$,q]=w.useState(null),W=w.useCallback(async(X,be={},j)=>{const G=a?.trim()||null;if(!G){const Y="当前 Workspace 不可用;请先选择有效 Workspace 后再执行操作";return o(Y),c("WORKSPACE_REQUIRED"),{ok:!1,error:{code:"WORKSPACE_REQUIRED",message:Y}}}s(!0),o(null),c(null),d($9[X]??null);try{const{status:Y,body:D}=await Ll(X,be,j?.clientRequestId,G);if(Y===412||D.error?.code==="PI_SETUP_REQUIRED")return o(ai(D.error?.message??"Pi 未就绪或已降级:该操作暂不可用")),c(D.error?.code??"PI_SETUP_REQUIRED"),h("setup-required"),m("setup"),p("models"),D;if(Y>=400||D.ok===!1)return o(ai(D.error?.message??D.message??`操作失败(HTTP ${Y})`)),c(D.error?.code??String(Y)),g(D.state??`failed:${Y}`),x(V=>({...V,command:D.error?.message??`failed:${D.error?.code??Y}`})),D;if(D.operationId){M(G??null);const V=window.localStorage.getItem(ma)?.trim();if(V&&fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/operation-links`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[R1]:I1()},body:JSON.stringify({operationId:D.operationId})}).then(Q=>{Q.ok||console.warn("Operator Chat operation link failed",Q.status)}).catch(Q=>console.warn("Operator Chat operation link failed",Q)),N(D.operationId),g(D.state??"accepted"),x(Q=>({...Q,command:D.state??"accepted",dag:X==="runDag"?"running":Q.dag})),N9.has(X)){A(!0),d(`操作已接受,后台运行中:${D.operationId}(请看事件流;可同时打开 Observe)`);const Q=D.operationId;cb(Q,30*6e4,G).then(ae=>{if(ae){if(g(ae.state??null),ae.state==="failed"||ae.state==="needs-reconcile"||ae.state==="timed-out"){o(ai(ae.errorMessage??ae.stderrPreview??`操作失败:${ae.state}`)),c(ae.errorCode??ae.state??null),x(ue=>({...ue,command:`failed:${ae.errorCode??ae.state}`}));return}ae.state==="succeeded"&&(d(`${X} 已成功`),x(ue=>({...ue,command:"succeeded"}))),X==="consoleUpdateAndInit"&&ae.state==="restarting"&&(d("新 Console 正在接棒,页面即将刷新…"),setTimeout(()=>window.location.reload(),800))}})}else{d(`操作已接受:${D.operationId}`);const Q=await cb(D.operationId,3e5,G);if(Q){if(g(Q.state??null),Q.state==="failed"||Q.state==="needs-reconcile"||Q.state==="timed-out")return o(ai(Q.errorMessage??Q.stderrPreview??`操作失败:${Q.state}`)),c(Q.errorCode??Q.state??null),x(Ne=>({...Ne,command:`failed:${Q.errorCode??Q.state}`})),{ok:!1,operationId:D.operationId,state:Q.state,error:{code:Q.errorCode??Q.state??"INTERNAL_ERROR",message:Q.errorMessage??Q.stderrPreview??`操作失败:${Q.state}`}};d(Q.errorMessage?`${X}:${Q.errorMessage}`:`${X} 已成功`),x(Ne=>({...Ne,command:Q.state??"succeeded"}));const ae=Q.result??{},ue={ok:!0,operationId:D.operationId,state:Q.state??"succeeded",result:ae};(X==="interviewStart"||X==="interviewTurn"||X==="interviewSkip")&&n(ae);const he=ae.confirmation;return he?.confirmationId&&(U(he.confirmationId),q(ae)),j?.advanceTo&&m(j.advanceTo),ue}}}else d(`${X} 已完成`),g(D.state??"succeeded"),x(V=>({...V,command:"succeeded",verification:X==="contractValidate"||X==="spineCheck"?"ran":V.verification}));const ye=D.result??{};(X==="interviewStart"||X==="interviewTurn"||X==="interviewSkip")&&n(ye);const se=ye.confirmation;return se?.confirmationId&&(U(se.confirmationId),q(ye)),j?.advanceTo&&m(j.advanceTo),D}catch(Y){o(Y instanceof Error?Y.message:String(Y));return}finally{s(!1)}},[n,s,o,c,d,h,m,p,g,x,a]),oe=w.useCallback(X=>{if(!X)return"无响应";if(X.error?.message)return X.error.message;if(X.message)return X.message;const be=X.result;if(be&&typeof be=="object")try{return JSON.stringify(be).slice(0,1200)}catch{return"已返回结果"}return X.ok===!1?"失败":"成功"},[]),J=w.useCallback(X=>{if(!X||X.ok===!1||X.error)return!1;const be=X.result;if(!be)return!0;if(typeof be.valid=="boolean")return be.valid;const j=be.result;return j&&typeof j.valid=="boolean"?j.valid:!0},[]),H=w.useCallback(async X=>{L.current?.abort();const be=new AbortController;L.current=be,P(j=>[...j,`开始跟随事件流 ${X}`]);try{const j=R?`?workspaceId=${encodeURIComponent(R)}`:"",G=await fetch(`/api/operator/v1/operations/${encodeURIComponent(X)}/events${j}`,{credentials:"same-origin",signal:be.signal});if(!G.ok||!G.body){P(se=>[...se,`事件流 HTTP ${G.status}`]);return}const Y=G.body.getReader(),D=new TextDecoder;let ye="";for(;F;){const{done:se,value:V}=await Y.read();if(se)break;ye+=D.decode(V,{stream:!0});const Q=ye.split(`
13
+
14
+ `);ye=Q.pop()??"";for(const ae of Q){const ue=ae.split(`
15
+ `).find(Ne=>Ne.startsWith("data:"));if(!ue)continue;const he=ue.slice(5).trim();P(Ne=>[...Ne.slice(-80),he.slice(0,240)])}}}catch(j){j.name!=="AbortError"&&P(G=>[...G,`事件流错误:${j instanceof Error?j.message:String(j)}`])}},[F,R]);w.useEffect(()=>(T&&F&&(y==="run"||S==="recovery")&&H(T),()=>L.current?.abort()),[T,F,y,S,H]);const I=w.useCallback(()=>{A(!1),L.current?.abort(),d("已停止跟随日志(未取消子进程)")},[d]),K=w.useCallback(()=>{L.current?.abort(),N(null),M(null),P([]),A(!0),U(null),q(null)},[]);return{runAction:W,summarizeEnvelope:oe,isActionSuccess:J,operationId:T,setOperationId:N,sseLog:_,followSse:F,setFollowSse:A,stopFollowSse:I,resetForWorkspaceScope:K,confirmationId:Z,setConfirmationId:U,confirmationDetails:$,setConfirmationDetails:q}}const jm=8*1024*1024,G9=10*1024*1024,Gu=8,V9=".md,.markdown,.txt,text/markdown,text/plain",K9=[".md",".markdown",".txt"],_1=/\.[^.]+$/;function Y9(e){const t=_1.exec(e.trim());return t?t[0].toLowerCase():""}function W9(e){const t=Y9(e);return K9.includes(t)}function Lm(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;if(e<1024*1024){const n=e/1024;return`${n>=10?n.toFixed(0):n.toFixed(1)} KiB`}const t=e/(1024*1024);return`${t>=10?t.toFixed(1):t.toFixed(2)} MiB`}function ni(e,t){return{ok:!1,code:e,message:t}}function Z9(e,t){const n=e?Array.from(e):[],a=t?.maxFiles??Gu,s=t?.existingCount??0;return n.length===0?ni("file-count","请选择至少一个 .md / .markdown / .txt 文件"):s+n.length>a?ni("file-count",`最多支持 ${a} 个文件(当前已有 ${s} 个)`):null}async function X9(e){const t=e.name?.trim()||"untitled.md";if(!W9(t))return ni("unsupported-extension","仅支持 .md、.markdown、.txt 文件");if(e.size>jm)return ni("file-too-large",`文件不能超过 ${Lm(jm)}`);let n;try{n=await e.arrayBuffer()}catch{return ni("read-failed","文件读取失败,请重试或直接粘贴")}let a;try{a=new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return ni("invalid-utf8","文件不是有效 UTF-8,请另存为 UTF-8")}if(a.trim().length===0)return ni("empty-content","文件内容不能为空或只有空白");const s=new TextEncoder().encode(a).byteLength;return{ok:!0,text:a,fileName:t,sourceBytes:e.size,textBytes:s}}async function Q9(e){if(e.length===0)return ni("file-count","请选择至少一个 .md / .markdown / .txt 文件");if(e.length>Gu)return ni("file-count",`最多支持 ${Gu} 个文件`);const t=[];for(const n of e){const a=await X9(n);if(!a.ok)return a;t.push({fileName:a.fileName,text:a.text,sourceBytes:a.sourceBytes,textBytes:a.textBytes})}return{ok:!0,documents:t}}function J9(e,t){const n=e.split(/\r?\n/);for(const s of n){const o=/^(#{1,6})\s+(.+)$/.exec(s.trim());if(o?.[2])return o[2].trim()}for(const s of n){const o=s.trim();if(o&&!/^---+$/.test(o)&&!/^```/.test(o)&&!/^<!--/.test(o))return o.replace(/^>\s+/,"").slice(0,120)}return t.replace(_1,"").trim()||"需求"}function ew(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||"requirement"}function tw(e,t){const n=e.replace(_1,"").trim(),a=ew(n);return a==="requirement"&&/[^\u0000-\u007f]/.test(n)?`part-${t+1}`:a==="requirement"?n?`part-${t+1}`:`part-${t+1}`:a}function nw(e){const t=new Set;return e.map((n,a)=>{let s=tw(n.fileName,a);if(t.has(s)){let o=2;for(;t.has(`${s}-${o}`);)o+=1;s=`${s}-${o}`}return t.add(s),{name:s,content:n.text,fileName:n.fileName}})}function rw(e,t){if(e.length===0)return"";if(e.length===1)return e[0].text;const n=Math.min(Math.max(0,t?.primaryIndex??0),e.length-1),a=e[n],s=J9(a.text,a.fileName),c=[`<!-- composed-from: ${e.map(d=>d.fileName).join(", ")} -->`,"",`# ${s}`,""];for(const d of e)c.push(`## 来源:${d.fileName}`,"",d.text.trim(),"");return`${c.join(`
16
+ `).trimEnd()}
17
+ `}function aw(e,t,n){const a={action:e,actionParams:t};return new TextEncoder().encode(JSON.stringify(a)).byteLength<=G9}function iw(){return"最终内容导致请求体超过服务端限制,请缩小文档或减少文件数量"}function sw(){const[e,t]=w.useState(""),[n,a]=w.useState([]),[s,o]=w.useState(0),[c,d]=w.useState(!1),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,y]=w.useState(!1),S=w.useRef(0),T=w.useRef(0),N=w.useCallback((q,W)=>{const oe=q.length===0?0:Math.min(Math.max(0,W),q.length-1);o(oe),t(rw(q,{primaryIndex:oe})),d(!1)},[]),R=w.useCallback(async q=>{const W=Z9(q,{existingCount:n.length});if(W){m(W.message);return}const oe=Array.from(q),J=++T.current;g(!0),m(null);try{const H=await Q9(oe);if(J!==T.current)return;if(!H.ok){m(H.message);return}const I=[...n,...H.documents],K=n.length===0?0:s;a(I),n.length===0||!c?(N(I,K),m(null)):m("已追加文件,未改正文(正文已手动编辑);可点「按文件重新合成」覆盖。")}catch{if(J!==T.current)return;m("文件读取失败,请重试或直接粘贴")}finally{J===T.current&&g(!1)}},[N,c,n,s]),M=w.useCallback(q=>{t(q),n.length>0&&d(!0)},[n.length]),_=w.useCallback(q=>{o(q),c||N(n,q)},[N,c,n]),P=w.useCallback((q,W)=>{const oe=q+W,J=[...n],H=J[oe];J[oe]=J[q],J[q]=H;const I=s===q?oe:s===oe?q:s;a(J),o(I),c||N(J,I)},[N,c,n,s]),F=w.useCallback(q=>{const W=n.filter((J,H)=>H!==q),oe=W.length===0?0:Math.min(s>=q?Math.max(0,s-1):s,Math.max(0,W.length-1));a(W),o(oe),W.length===0?d(!1):c||N(W,oe)},[N,c,n,s]),A=w.useCallback(()=>{a([]),o(0),d(!1),m(null)},[]),L=w.useCallback(()=>{c&&!window.confirm("将用当前文件列表重新合成正文,覆盖你在编辑区的修改。继续?")||(N(n,s),m(null))},[N,c,n,s]),Z=w.useCallback((q,W)=>{q.preventDefault(),q.stopPropagation(),!W&&(S.current+=1,y(!0))},[]),U=w.useCallback(q=>{q.preventDefault(),q.stopPropagation(),S.current=Math.max(0,S.current-1),S.current===0&&y(!1)},[]),$=w.useCallback((q,W)=>{q.preventDefault(),q.stopPropagation(),S.current=0,y(!1),!W&&R(q.dataTransfer.files)},[R]);return{prdText:e,setPrdText:t,onPrdTextChange:M,prdDocuments:n,prdPrimaryIndex:s,prdComposedDirty:c,prdFileError:h,setPrdFileError:m,prdFileReading:p,prdDragOver:x,loadPrdFromFiles:R,applyPrdComposition:N,setPrimaryDocument:_,moveDocument:P,removeDocument:F,clearDocuments:A,recomposeDocuments:L,onDragEnter:Z,onDragLeave:U,onDrop:$}}const ow={report:{id:"report",label:"查看报告",action:"dagReport",lane:"dag",guide:"看失败分类与建议动作(交接报告摘要)",commandHint:"loop-agent dag report --run-id <run-id> --json"},doctor:{id:"doctor",label:"Doctor 诊断",action:"doctor",lane:"dag",guide:"只读诊断:检查 Console / Pi / 仓库就绪,不是重跑前置",commandHint:"agent-worker console doctor --repo ."},decision:{id:"decision",label:"人工决策",lane:"dag",guide:"暂停等人时:先看 doctor 输出再做决策(经 CLI)",commandHint:"loop-agent dag doctor --run-id <run-id> --markdown"},resume:{id:"resume",label:"恢复运行",lane:"dag",guide:"仅当运行可安全 resume 时使用(经 CLI)",commandHint:"loop-agent task advance <task-id> --json"},reconcile:{id:"reconcile",label:"对账 / reconcile",requiresReason:!0,action:"dagReconcileRun",lane:"dag",guide:"Orphan/中断时先对账归档(默认 supersede);runner 仍存活时勿盲 supersede",commandHint:"loop-agent dag reconcile-run --run-id <run-id> --action supersede --reason <structured-reason>"},regenerate:{id:"regenerate",label:"重新生成契约/计划",lane:"dag",guide:"契约/计划过期时:回任务页或经 CLI 重新 task advance(本页仅提示)",commandHint:"loop-agent task advance <task-id> --json"},observeLink:{id:"observeLink",label:"全屏观测",action:"observeLink",lane:"dag",guide:"打开完整 Inspect 画布;顶栏可返回操作台",commandHint:"agent-worker console --repo . --port 8790"},dagRerun:{id:"dagRerun",label:"从失败节点恢复",requiresReason:!0,action:"dagRerun",lane:"dag",guide:"Provider、网络、限流或超时等非代码问题的首选:先评估安全子图,合格后创建 continuation run 从有效节点恢复(无需 Human Gate)。Worker 持有的 run、workspace/controller 漂移或含 unsafe shell 时不要强跑子图",commandHint:"loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan"},standaloneTaskRerun:{id:"standaloneTaskRerun",label:"带反馈重新执行任务",requiresReason:!0,action:"standaloneTaskRerun",lane:"dag",guide:"独立 DAG run 无法安全从节点恢复时,重新生成完整 DAG,并带入上一轮仍未解决的 verify/review 反馈;没有可继承反馈时会明确说明(无需 Human Gate)。Worker 持有的 run 请用下方「重新排队 Worker Task」",commandHint:"loop-agent dag rerun-task --run-id <run-id> --reason <text> --json"},workerTaskRetry:{id:"workerTaskRetry",label:"重新排队 Worker Task",requiresReason:!0,action:"workerTaskRetry",lane:"worker",guide:"仅 Worker 队列任务失败时直调执行,服务端校验 Failed 状态,无需 Human Gate;不要与 DAG 完整重跑混用",commandHint:"agent-worker task retry <task-id> --feature-id <feature-id> --repo . --reason <reason>"},interrupt:{id:"interrupt",label:"中止运行",requiresReason:!0,action:"dagRequestInterrupt",lane:"dag",guide:"仅本机 Console 持有的正在运行 DAG:经 Human Gate 登记协作中止,等待当前节点安全收敛。不会立即强杀进程",commandHint:"loop-agent dag request-interrupt --run-id <run-id> --reason-code operator-request --reason <structured-reason>"}},db={"validation-failed":["report","doctor","regenerate"],"contract-drift":["report","doctor","decision","reconcile","regenerate"],"runtime-mismatch":["report","doctor","reconcile","regenerate"],"pause-on-human":["decision","resume","report","doctor"],"verification-failed":["report","doctor","dagRerun","standaloneTaskRerun","resume","regenerate"],"orphan-unknown":["report","doctor"],"terminal-failed":["report","doctor","dagRerun","standaloneTaskRerun","workerTaskRetry","regenerate"],"terminal-succeeded":["report","observeLink"],"needs-reconcile":["report","doctor","reconcile","regenerate"],"running-active":["interrupt","report","doctor","observeLink"]},lw=new Set(["succeeded","failed","timed-out"]);function cw(e){const t=(e.interruptStatus??"").trim();if(!t||t==="none")return null;if(t==="requested")return"请求已登记,等待 runner 确认。";if(t==="acknowledged")return"等待当前节点安全收敛(不会立即强杀)。";if(t==="needs-reconcile")return"需要对账:中止请求未能确认。";if(t==="settled"){const n=e.dagStatus==="failed"||e.dagStatus==="partial_failed",a=(e.failureCategory??"").includes("controller-interrupted"),s=lw.has(e.targetOperationState??"");return n&&a&&s?"已中止。":"正在对账,尚未确认退出。"}return null}function uw(e){return(db[e]??db["orphan-unknown"]).map(n=>ow[n])}function dw(e){const t=[],n=[];for(const a of e)a.lane==="worker"?n.push(a):t.push(a);return{dag:t,worker:n}}function fw(e){return typeof e.action=="string"&&e.action.trim().length>0}function $3(e){return uw(e).filter(fw)}function hw(e){const t=new Set($3(e).map(a=>a.id)),n=(...a)=>{for(const s of a)if(t.has(s))return s;return null};switch(e){case"terminal-failed":case"verification-failed":return n("dagRerun","standaloneTaskRerun","doctor","report");case"pause-on-human":return n("doctor","report");case"needs-reconcile":return n("doctor","reconcile","report");case"running-active":return n("interrupt","doctor","report");case"runtime-mismatch":case"contract-drift":return n("doctor","report");case"validation-failed":return n("doctor","report");case"terminal-succeeded":return n("observeLink","report");default:return n("doctor","report")}}function mw(e){if(e.needsReconcile)return"needs-reconcile";const t=(e.errorCode??"").toLowerCase(),n=(e.operationState??"").toLowerCase(),a=(e.dagStatus??"").toLowerCase(),s=(e.failureCategory??"").toLowerCase();return t.includes("validation")||t.includes("invalid")||n.includes("validation")?"validation-failed":t.includes("contract")||t.includes("drift")||t.includes("binding")?"contract-drift":t.includes("runtime")||t.includes("mismatch")||t.includes("fingerprint")?"runtime-mismatch":t.includes("human")||n.includes("paused")||a.includes("paused")||n.includes("awaiting")?"pause-on-human":t.includes("verif")||n.includes("verif")?"verification-failed":s==="controller-interrupted"||t.includes("controller-interrupted")||t.includes("interrupted")||a==="interrupted"||a==="orphaned"||n.includes("controller-interrupted")||n.includes("interrupted")?"needs-reconcile":a==="running-suspected-stall"||a==="running-quiet"||a==="suspected-stall"||a.includes("suspected-stall")||n.includes("suspected-stall")?"orphan-unknown":a==="running"||a==="active"?"running-active":n==="succeeded"||n==="completed"||n==="finished"||a==="succeeded"||a==="completed"||a==="finished"?"terminal-succeeded":n==="failed"||n.includes("fail")||a==="failed"||a==="partial_failed"||t.includes("fail")?"terminal-failed":t.includes("reconcil")||n.includes("reconcil")?"needs-reconcile":"orphan-unknown"}const M1=new Set(["failed","error","partial_failed"]),P3=new Set(["blocked","paused","awaiting_human"]);function fd(e){return(e??"").trim().toLowerCase()}function pw(e){return M1.has(fd(e))}function fb(e){const t=fd(e.status);return M1.has(t)||t.includes("fail")?0:e.lifecycle==="paused"||t==="paused"?1:e.lifecycle==="active"?2:3}function gw(e){return[...e].sort((t,n)=>{const a=fb(t)-fb(n);return a!==0?a:n.mtimeMs-t.mtimeMs})}function bw(e){return gw(e)[0]?.dagRunId}function hb(e){const t=fd(e.status);return M1.has(t)?0:P3.has(t)?1:2}function G3(e){return[...e].sort((t,n)=>{const a=hb(t)-hb(n);return a!==0?a:t.nodeId.localeCompare(n.nodeId)})}function vw(e){const t=G3(e);return t.find(a=>pw(a.status)||P3.has(fd(a.status)))?.nodeId??t[0]?.nodeId}function yw(e){const t=e.status?.trim()||e.lifecycle;return`${e.dagRunId.length>36?`${e.dagRunId.slice(0,18)}…${e.dagRunId.slice(-8)}`:e.dagRunId} · ${t}`}function xw(e){const t=e.status?.trim()||"unknown",n=e.label?.trim();return n&&n!==e.nodeId?`${e.nodeId} · ${t} · ${n}`:`${e.nodeId} · ${t}`}function ww(e){const n=[`operator-recovery: ${e.actionLabel?.trim()||"恢复"}`],a=e.dagRunId?.trim();if(a){const d=e.runStatus?.trim();n.push(d?`run=${a} (${d})`:`run=${a}`)}const s=e.fromNodeId?.trim();if(s){const d=e.nodeStatus?.trim();n.push(d?`from-node=${s} (${d})`:`from-node=${s}`)}const o=e.factClassLabel?.trim();o&&n.push(`fact=${o}`);const c=e.nodeError?.trim()||e.errorMessage?.trim()||(e.errorCode?.trim()?`code=${e.errorCode.trim()}`:"");return c&&n.push(`detail=${c.replace(/\s+/g," ").slice(0,280)}`),n.join(`
18
+ `).slice(0,500)}function V3(e){const t=e.trim();return t?t==="operator-recovery"||t.startsWith("operator-recovery:")||t.startsWith("recovery:"):!0}async function mb(e){const t=await e.runAction("prepareMutationGate",{action:e.action,actionParams:e.actionParams});if(!e.isActionSuccess(t))return;const n=t?.result??t,a=n.receiptId?n:n.result??n;if(!a.receiptId||!a.humanGateToken){e.setOpError("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await e.runAction(e.action,{...e.actionParams,confirmationId:a.receiptId,humanGateToken:a.humanGateToken},{clientRequestId:e.clientRequestId})}function kw(e){const{shell:t,actions:n,taskId:a,dagRunId:s,fromNodeId:o,featureId:c,recoveryReason:d,recoveryReasonTouched:h,recoveryConfirm:m,recoveryPlanSummary:p,interruptReasonCode:g,setRecoveryConfirm:x,setRecoveryPlanSummary:y,setRecoveryReport:S,setRecoveryReason:T,setRecoveryReasonTouched:N,buildCurrentRecoveryReason:R,openFullCanvas:M}=e,{setOpError:_,setOpErrorCode:P,setOpMessage:F,setBusy:A}=t,{runAction:L,isActionSuccess:Z}=n,U=w.useCallback(async q=>{if(q.requiresReason||(x(null),y(null)),q.action==="doctor"){S(null),L("doctor",{});return}if(q.action==="dagReport"||q.id==="report"){const W=s.trim();if(W){x(null),y(null);const oe=await L("dagReport",{runId:W}),J=oe?.result??{},H=(J.raw?.runs??J.runs)?.[0];oe&&oe.ok!==!1&&!oe.error&&H&&(S({runId:H.runId??W,title:H.title,status:H.status,category:H.productLineFailureCategory,recommendation:H.recoveryRecommendation?.summary??H.recommendedFollowUp??void 0}),F(null));return}if(a.trim()){S(null),L("status",{taskId:a});return}_("查看报告需要先选择 DAG 运行 ID(或填写任务 ID)");return}if(q.action==="observeLink"){S(null),M();return}if(q.requiresReason){if(S(null),x(q),y(null),q.id!=="dagRerun"&&(_(null),P(null)),(!h||V3(d))&&(T(R(q.label)),N(!1)),q.id==="dagRerun"&&s.trim()&&o.trim()){A(!0);try{const{status:W,body:oe}=await Ll("dagRerunPlan",{runId:s.trim(),fromNode:o.trim()}),J=oe.result??{};J&&typeof J=="object"&&("eligible"in J||J.planHash)&&y(J),W<400&&oe.ok!==!1&&J.eligible!==!1?F(null):J.eligible===!1?_(ai(Uf(J,oe.error?.message))):F(oe.error?.message??"无法预检重跑计划;确认后仍将尝试提交(CLI 可能尚未就绪)")}finally{A(!1)}}return}_(null),P(null),F(`${q.label}:请经 CLI — ${q.commandHint??""}`)},[R,s,o,M,d,h,L,A,_,P,F,x,y,S,T,N,a]),$=w.useCallback(async()=>{const q=m;if(!q)return;const W=d.trim();if(!W){_("恢复操作需要结构化原因");return}const oe=$u(`recovery-${q.id}`);if(x(null),q.id==="dagRerun"){const J=s.trim(),H=o.trim();if(!J||!H){_("从失败节点恢复需要 DAG 运行 ID 与起始节点 ID");return}let I=p?.planHash?.trim(),K=p?.eligible;if(!I||K===void 0){const X=await L("dagRerunPlan",{runId:J,fromNode:H}),be=X?.result??{};if((be.planHash||be.eligible!==void 0)&&y(be),I=be.planHash?.trim()||I,K=be.eligible,be.eligible===!1){_(ai(Uf(be,X?.error?.message)));return}if(X&&X.ok===!1&&!I){_(X.error?.message??"无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}}if(K===!1){_(ai(Uf(p??{})));return}if(!I){_("无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}await L("dagRerun",{runId:J,fromNode:H,planHash:I,reason:W},{clientRequestId:oe});return}if(q.id==="standaloneTaskRerun"){const J=s.trim();if(!J){_("带反馈重新执行任务需要 DAG 运行 ID");return}await L("standaloneTaskRerun",{runId:J,reason:W,...a.trim()?{taskId:a.trim()}:{}},{clientRequestId:oe});return}if(q.id==="workerTaskRetry"){const J=a.trim();if(!J){_("重新排队 Worker Task 需要任务 ID");return}await L("workerTaskRetry",{taskId:J,reason:W,...c.trim()?{featureId:c.trim()}:{}},{clientRequestId:oe});return}if(q.id==="interrupt"){const J=s.trim();if(!J){_("中止运行需要 DAG 运行 ID");return}if(W.trim().length<10||W.trim().length>500){_("中止原因去首尾空白后必须是 10–500 个字符,请手写说明,不要用占位句。");return}await mb({runAction:L,isActionSuccess:Z,setOpError:_,action:"dagRequestInterrupt",actionParams:{runId:J,reasonCode:g.trim()||"operator-request",reasonDetail:W},clientRequestId:oe});return}if(q.id==="reconcile"){const J=s.trim();if(!J){_("对账恢复需要 DAG 运行 ID");return}await mb({runAction:L,isActionSuccess:Z,setOpError:_,action:"dagReconcileRun",actionParams:{runId:J,reason:W,reconcileAction:"supersede"},clientRequestId:oe});return}F(`${q.label}:请经 CLI — ${q.commandHint??""}`)},[s,c,o,m,p?.planHash,d,g,L,Z,_,F,x,y,a]);return{handleRecoveryCta:U,submitRecoveryConfirm:$}}function Sw(e,t){const n=e?.trim();return n?t.includes(n)?{status:"ok",workspaceId:n}:{status:"unknown-workspace",workspaceId:n}:{status:"ok",workspaceId:void 0}}const K3="loop-console.operator-shell.last-operate-tab.v1",Y3="loop-console.operator-shell.last-inspect-hash.v1",wo="tasks",pb="/#/chat",zl="/#/inspect",zm=/^(dag|run|task|feature|batch|night|pool|failures|dags)(\/|$)/;function Bl(e){const t=String(e??"").replace(/^#/,""),n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=a?a.startsWith("/")?a:`/${a}`:"/",o=new URLSearchParams(n>=0?t.slice(n+1):"");return{path:s,query:o}}function ql(e){return e==="/inspect"||e==="/inspect/"?"/":e.startsWith("/inspect/")?e.slice(8)||"/":e}function Bm(e){return e==="tasks"||e==="recovery"||e==="night"||e==="models"||e==="settings"}function Cr(e,t){return e.get(t)?.trim()||void 0}function Vu(e){return{...Cr(e,"taskId")?{taskId:Cr(e,"taskId")}:{},...Cr(e,"dagRunId")?{dagRunId:Cr(e,"dagRunId")}:{},...Cr(e,"fromNodeId")?{fromNodeId:Cr(e,"fromNodeId")}:{},...Cr(e,"featureId")?{featureId:Cr(e,"featureId")}:{},...Cr(e,"intent")?{intent:Cr(e,"intent")}:{},...Cr(e,"workspaceId")?{workspaceId:Cr(e,"workspaceId")}:{},...Cr(e,"sessionId")?{sessionId:Cr(e,"sessionId")}:{}}}function W3(e){const t=new URLSearchParams;for(const n of["taskId","dagRunId","fromNodeId","featureId","intent","workspaceId","sessionId"]){const a=e[n]?.trim();a&&t.set(n,a)}return t.toString()}function $f(e){try{const t=e?.getItem(K3);if(Bm(t))return t}catch{}return wo}function Ew(e,t){try{t?.setItem(K3,e)}catch{}}function Tw(e){try{const t=e?.getItem(Y3)?.trim();if(t?.startsWith("/#/inspect"))return t}catch{}return zl}function Cw(e,t){const n=e.startsWith("/#/inspect")?e:Pi(e);if(n.startsWith("/#/inspect"))try{t?.setItem(Y3,n)}catch{}}function Ku(e=wo,t={}){const n=W3(t);return`/#/operate/${e}${n?`?${n}`:""}`}function pa(e="/",t){const n=ql(e.startsWith("/")?e:`/${e}`),a=n==="/"||n===""?"/inspect":`/inspect${n}`,s=typeof t=="string"?t.replace(/^\?/,""):t?.toString()??"";return`/#${a}${s?`?${s}`:""}`}function Hl(e={}){const t=W3(e);return t?`${pb}?${t}`:pb}function Pf(e,t){const n=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:Pi(e),{path:a,query:s}=Bl(n.slice(2)),o=t?.trim();o?s.set("workspaceId",o):s.delete("workspaceId");const c=s.toString();return`/#${a}${c?`?${c}`:""}`}function vu(e){return e.workspace==="chat"?Hl(e):e.workspace==="operate"?Ku(e.operateTab??wo,e):pa(e.inspectPath??"/",e.inspectQuery)}function Gf(e,t,n){const a=t.toString(),s=pa(e,a);return{workspace:"inspect",operateTab:wo,inspectPath:ql(e),canonicalHash:s.slice(2),canonicalHref:s,replace:n,...Vu(t)}}function yu(e,t,n){const a=Ku(e,Vu(t));return{workspace:"operate",operateTab:e,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:n,...Vu(t)}}function Nw(e,t){const n=t??{},a=Hl(n);return{workspace:"chat",operateTab:wo,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:e,...n}}function Vf(e,t={}){const n=String(e.pathname??"/").replace(/\/+$/,"")||"/",a=t.lastOperateTab??wo;if(n==="/inspect"){const{path:d,query:h}=Bl(e.hash??"#/");return Gf(d,h,!0)}const{path:s,query:o}=Bl(e.hash??"");if(!e.hash||s==="/")return null;if(s==="/inspect"||s.startsWith("/inspect/"))return Gf(ql(s),o,!1);if(s==="/chat")return Nw(!1,Vu(o));if(s==="/operate")return yu(a,o,!0);if(s.startsWith("/operate/")){const d=s.slice(9).split("/")[0]??"";return Bm(d)?yu(d,o,!1):yu(a,o,!0)}if(Bm(s.replace(/^\//,"").split("/")[0]??"")){const d=s.replace(/^\//,"").split("/")[0];return yu(d,o,!0)}const c=ql(s).replace(/^\//,"");return zm.test(c)?Gf(s,o,!0):null}function Pi(e,t=typeof globalThis.location?.href=="string"?globalThis.location.href:"http://local.invalid/"){const n=String(e??"").trim();if(!n)return zl;if(n.startsWith("/#/inspect"))return n;if(n.startsWith("#/inspect"))return`/${n}`;if(n.startsWith("/#/operate")||n.startsWith("/#/chat"))return n;if(n.startsWith("#/operate")||n.startsWith("#/chat"))return`/${n}`;try{const a=new URL(n,t);if((a.pathname.replace(/\/+$/,"")||"/")==="/inspect"){const{path:h,query:m}=Bl(a.hash||"#/"),p=new URLSearchParams(a.search);for(const[g,x]of m)p.set(g,x);return pa(h,p)}const{path:o,query:c}=Bl(a.hash||"");if(o==="/inspect"||o.startsWith("/inspect/"))return pa(ql(o),c);const d=o.replace(/^\//,"");if(zm.test(d))return pa(o,c)}catch{}return n.startsWith("#/")&&zm.test(n.slice(2))?pa(n.slice(1)):zl}function Rw(e){const t=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:Pi(e);return t.startsWith("/#")?t.slice(1):t}function Es(e){const t=Rw(e);if(typeof window>"u")return t;const n=window.location.hash||"",a=n.startsWith("#")?n:`#${n}`,s=t.startsWith("#")?t:`#${t}`;return a!==s&&(window.location.hash=s),s}function Aw(e){const{shell:t,actions:n,wizard:a}=e,{nav:s,opError:o,opErrorCode:c,lastOpState:d,setOpError:h,setObserveBusy:m}=t,{taskId:p}=a,[g,x]=w.useState(""),[y,S]=w.useState(""),[T,N]=w.useState(""),[R,M]=w.useState(""),[_,P]=w.useState(!1),[F,A]=w.useState(null),[L,Z]=w.useState(null),[U,$]=w.useState(!1),[q,W]=w.useState("operator-request"),[oe,J]=w.useState(null),[H,I]=w.useState([]),[K,X]=w.useState([]),[be,j]=w.useState(!1),[G,Y]=w.useState(!1),[D,ye]=w.useState(null),[se,V]=w.useState(null),[Q,ae]=w.useState(null),[ue,he]=w.useState(!1),[Ne,He]=w.useState(!1),[We,rt]=w.useState(null),[Ye,gt]=w.useState("idle"),[Rt,st]=w.useState(null),[kt,$t]=w.useState(null),[Ut,ze]=w.useState(!1),Qe=w.useCallback(()=>g.trim()?pa(`/dag/${encodeURIComponent(g.trim())}`,"from=recovery"):"/#/inspect",[g]),Ue=w.useCallback(()=>{Es(Qe())},[Qe]),ot=w.useCallback(async()=>{if(g.trim())return g.trim();const lt=p.trim();if(!lt)return h("打开 DAG 检视需要任务 ID 或 DAG 运行 ID"),null;m(!0),h(null);try{const{status:Ze,body:vt}=await Ll("observeLink",{taskId:lt}),ct=vt.result??{};if(Ze>=400||vt.ok===!1)return h(vt.error?.message??"无法解析 DAG 画布地址"),gt("unavailable"),st(vt.error?.message??null),null;const Yt=typeof ct.dagRunId=="string"?ct.dagRunId.trim():"";return Yt?(x(Yt),gt("match"),st(null),$t(pa(`/dag/${encodeURIComponent(Yt)}`)),Yt):(h("尚未找到该任务的 DAG 运行,请稍后再打开检视"),gt("unavailable"),st(ct.message??"未解析到 DAG run"),null)}catch(Ze){return h(Ze instanceof Error?Ze.message:String(Ze)),null}finally{m(!1)}},[g,p,h,m]),fe=w.useCallback(async()=>{await ot()&&ze(!0)},[ot]),me=w.useCallback(async()=>{const lt=await ot();lt&&Es(pa(`/dag/${encodeURIComponent(lt)}`,"from=recovery"))},[ot]),$e=w.useCallback(async()=>{j(!0);try{const lt=p.trim(),Ze=new URLSearchParams;lt&&Ze.set("taskId",lt),Ze.set("limit","40");const vt=await fetch(Ir(`/api/operator/v1/recovery/candidates?${Ze.toString()}`),{credentials:"same-origin"});if(!vt.ok){I([]);return}const ct=await vt.json();I(Array.isArray(ct.runs)?ct.runs:[])}catch{I([])}finally{j(!1)}},[p]),we=w.useCallback(async lt=>{const Ze=lt.trim();if(!Ze){X([]),ye(null),V(null),ae(null);return}Y(!0);try{const vt=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(Ze)}`),{credentials:"same-origin"});if(!vt.ok){X([]),ye(null),V(null);return}const ct=await vt.json(),Yt=typeof ct.effectiveStatus=="string"&&ct.effectiveStatus||typeof ct.status=="string"&&ct.status||null;ye(Yt);const re=Array.isArray(ct.nodes)?ct.nodes:[],ke=G3(re.map(St=>{const Ct=(St.nodeId??St.id??"").trim();return Ct?{nodeId:Ct,status:St.status,label:St.label??St.name,errorPreview:St.errorPreview}:null}).filter(St=>St!==null));X(ke);const Re=typeof ct.failureCategory=="string"&&ct.failureCategory||void 0,et=re.find(St=>typeof St.failureCategory=="string"&&St.failureCategory&&St.failureCategory!=="success")?.failureCategory;V(Re??et??null),ae(ct.frontendRecovery??null)}catch{X([]),ye(null),V(null),ae(null)}finally{Y(!1)}},[]);w.useEffect(()=>{s==="recovery"&&$e()},[s,p,$e]),w.useEffect(()=>{if(s!=="recovery"||ue||H.length===0)return;const lt=g.trim(),Ze=lt?H.some(vt=>vt.dagRunId===lt):!1;if(!lt||!Ze){const vt=bw(H);vt&&vt!==lt&&x(vt)}},[s,H,g,ue]),w.useEffect(()=>{s==="recovery"&&we(g)},[s,g,we]),w.useEffect(()=>{if(s!=="recovery")return;const lt=g.trim();if(!lt){J(null);return}const vt=D&&new Set(["finished","failed","partial_failed","superseded","abandoned","interrupted"]).has(D)?3e4:4e3,ct=vt===4e3;let Yt=!1;const re=async()=>{const{body:Re}=await Ll("dagInterruptEligibility",{runId:lt});if(Yt)return;const et=Re.result??Re;if(J({eligible:et.eligible===!0,ownerKind:et.ownerKind,message:et.message,interruptStatus:et.interruptStatus,reasonCodes:et.reasonCodes,targetOperationId:et.targetOperationId,targetOperationState:et.targetOperationState}),!!ct)try{const St=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(lt)}`),{credentials:"same-origin"});if(!St.ok||Yt)return;const Ct=await St.json();if(Yt)return;const De=typeof Ct.effectiveStatus=="string"&&Ct.effectiveStatus||typeof Ct.status=="string"&&Ct.status||null;ye(De)}catch{}};re();const ke=window.setInterval(()=>{re()},vt);return()=>{Yt=!0,window.clearInterval(ke)}},[s,g,D]),w.useEffect(()=>{if(s!=="recovery"||Ne||K.length===0)return;const lt=y.trim(),Ze=lt?K.some(vt=>vt.nodeId===lt):!1;if(!lt||!Ze){const vt=vw(K);vt&&vt!==lt&&S(vt)}},[s,K,y,Ne]);const Fe=mw({operationState:D?null:d,errorCode:D?null:c,dagStatus:D,failureCategory:se}),mt=w.useMemo(()=>{const lt=$3(Fe);return Fe!=="running-active"||oe?.eligible?lt:lt.filter(Ze=>Ze.id!=="interrupt")},[Fe,oe?.eligible]),Ie=w.useMemo(()=>dw(mt),[mt]),Pt=w.useMemo(()=>hw(Fe),[Fe]),bt=w.useMemo(()=>K.find(lt=>lt.nodeId===y.trim()),[K,y]),Mt=w.useRef(null);w.useEffect(()=>{L&&Mt.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[L?.id]);const Tt=w.useCallback(lt=>ww({actionLabel:lt,dagRunId:g.trim()||void 0,fromNodeId:y.trim()||void 0,runStatus:D,nodeStatus:bt?.status,nodeError:bt?.errorPreview,factClassLabel:H3[Fe],errorMessage:o,errorCode:c}),[g,y,o,c,Fe,D,bt?.errorPreview,bt?.status]);w.useEffect(()=>{if(s!=="recovery"||_&&!V3(R))return;const lt=Tt(L?.label);lt&&lt!==R&&M(lt)},[s,g,y,D,bt,Fe,o,c,L?.label,_,R,Tt]);const{handleRecoveryCta:$n,submitRecoveryConfirm:en}=kw({shell:t,actions:n,taskId:p,dagRunId:g,fromNodeId:y,featureId:T,recoveryReason:R,recoveryReasonTouched:_,recoveryConfirm:L,recoveryPlanSummary:F,interruptReasonCode:q,setRecoveryConfirm:Z,setRecoveryPlanSummary:A,setRecoveryReport:rt,setRecoveryReason:M,setRecoveryReasonTouched:P,buildCurrentRecoveryReason:Tt,openFullCanvas:me});return w.useEffect(()=>{if(s!=="recovery"||!U||!oe?.eligible)return;const lt=mt.find(Ze=>Ze.id==="interrupt");lt&&(Z(lt),M(Tt(lt.label)),P(!1),$(!1))},[s,U,oe?.eligible,mt,Tt]),{dagRunId:g,setDagRunId:x,fromNodeId:y,setFromNodeId:S,featureId:T,setFeatureId:N,recoveryReason:R,setRecoveryReason:M,recoveryReasonTouched:_,setRecoveryReasonTouched:P,recoveryPlanSummary:F,recoveryConfirm:L,setRecoveryConfirm:Z,setRecoveryPlanSummary:A,recoveryRuns:H,recoveryNodes:K,recoveryRunsLoading:be,recoveryNodesLoading:G,recoveryRunStatus:D,recoveryFailureCategory:se,frontendRecovery:Q,manualRunId:ue,setManualRunId:he,manualNodeId:Ne,setManualNodeId:He,recoveryReport:We,setRecoveryReport:rt,observeLinkStatus:Ye,observeLinkMessage:Rt,observeUrl:kt,inspectSplitOpen:Ut,setInspectSplitOpen:ze,inspectPath:Qe,openFullInspect:Ue,resolveDagRunForInspect:ot,openInspectSplit:fe,openFullCanvas:me,loadRecoveryRuns:$e,loadRecoveryNodes:we,recoveryFact:Fe,recoveryCtas:mt,recoveryLanes:Ie,recommendedCtaId:Pt,interruptIntent:U,setInterruptIntent:$,interruptReasonCode:q,setInterruptReasonCode:W,interruptEligibility:oe,recoveryConfirmRef:Mt,buildCurrentRecoveryReason:Tt,handleRecoveryCta:$n,submitRecoveryConfirm:en}}async function Iw(e,t){const a=await fetch(Ir(`/api/tasks/${encodeURIComponent(e)}/ledger`),{credentials:"same-origin"});return a.ok?{ok:!0,summary:await a.json()}:{ok:!1}}function _w(e){const{shell:t,actions:n,prd:a}=e,{step:s,setStep:o,setOpMessage:c}=t,{runAction:d,isActionSuccess:h,summarizeEnvelope:m}=n,[p,g]=w.useState(""),[x,y]=w.useState(""),[S,T]=w.useState("standard"),[N,R]=w.useState(""),[M,_]=w.useState(""),[P,F]=w.useState(""),A=Om.find(we=>we.kind===S)??Om[0],[L,Z]=w.useState(null),[U,$]=w.useState(null),[q,W]=w.useState(""),[oe,J]=w.useState(null),[H,I]=w.useState(null),[K,X]=w.useState(null),[be,j]=w.useState(null),[G,Y]=w.useState(null),[D,ye]=w.useState(!1),[se,V]=w.useState(null),[Q,ae]=w.useState(!1),[ue,he]=w.useState(null),[Ne,He]=w.useState(null),[We,rt]=w.useState(null),Ye=w.useRef(!1),gt=w.useRef(0),Rt=w.useCallback(()=>{X(null),j(null),Y(null),ye(!1),V(null),ae(!1),he(null),He(null),rt(null),Ye.current=!1,gt.current=0},[]),st=w.useCallback(()=>{Rt(),o("contract")},[Rt,o]),kt=w.useCallback(we=>{const Fe=we.session;Fe?.sessionId&&Z(Fe.sessionId);const mt=we.question;$(mt),J(we.summary??null);const Ie=we.assessmentId;typeof Ie=="string"&&Ie&&I(Ie),(we.complete===!0||typeof Ie=="string"&&Ie)&&(st(),c(we.skipped===!0?"已跳过访谈:已按推荐补齐草稿并签发评估":"访谈已完成:草稿已绑定完整评估结果"))},[st,c]),$t=w.useCallback(async(we,Fe)=>{const mt=++gt.current;ae(!0),he(null);try{const Ie=await Iw(we);if(gt.current!==mt)return;if(!Ie.ok){He(null),Fe&&he("ledger 接口不可达(安全降级)");return}He(Ie.summary)}catch{if(gt.current!==mt)return;he("ledger 接口不可达(安全降级)"),He(null)}finally{gt.current===mt&&ae(!1)}},[]),Ut=w.useCallback(async(we=!1)=>{const Fe=p.trim();if(!Fe)return;const mt=`${Fe}:${H??""}`;if(!(!we&&We===mt&&K!==null)&&!Ye.current){Ye.current=!0,X(null),j(null),Y(null),V(null),ye(!1),await $t(Fe,!1);try{const Ie=await d("contractValidate",{taskId:Fe}),Pt=h(Ie);if(X(Pt),j(m(Ie)),!Pt){rt(mt),c("契约校验未通过:请先修正草稿后再应用");return}const bt=await d("contractDiff",{taskId:Fe});Y(m(bt)),rt(mt),c(h(bt)?"校验与差异已就绪:确认后可应用契约":"校验通过,但差异查询失败(仍可查看下方摘要)")}finally{Ye.current=!1}}},[H,We,K,h,$t,d,c,m,p]),ze=w.useCallback(async()=>{const we=p.trim();if(!we||!H)return;const Fe=await d("contractApply",{taskId:we,assessmentId:H},{clientRequestId:$u("apply")});if(!h(Fe)){ye(!1);return}ye(!0),await $t(we,!0);const mt=await d("spineCheck",{taskId:we});if(h(mt)){V(!0),o("dag-confirm"),c("契约已应用并通过 Spine 审计,可生成并运行 DAG");return}V(!1),c("契约已应用,但 Spine 审计未通过:可重试 Spine")},[H,h,$t,d,c,o,p]),Qe=w.useCallback(async()=>{const we=p.trim();if(!we)return;const Fe=await d("spineCheck",{taskId:we});if(h(Fe)){V(!0),o("dag-confirm"),c("Spine 审计已通过,可生成并运行 DAG");return}V(!1)},[h,d,c,o,p]),Ue=w.useCallback(async()=>{const we=n.confirmationId?.trim();if(!we)return;const Fe=n.confirmationDetails?.confirmation?.humanGateToken,mt=await d("confirmDagConfirmation",{confirmationId:we,humanGateToken:Fe});h(mt)&&(o("run"),await d("runDag",{confirmationId:we},{clientRequestId:$u("run")}))},[n.confirmationId,n.confirmationDetails,h,d,o]);w.useEffect(()=>{s==="contract"&&p.trim()&&Ut(!1)},[s,p,H,Ut]);const ot=w.useCallback(we=>we.split(/[\n,;,;]+/).map(Fe=>Fe.trim()).filter(Boolean),[]),fe=w.useCallback(async()=>{const we=a.prdDocuments.length>0?nw(a.prdDocuments):void 0,Fe=ot(N),mt=ot(M),Ie=ot(P),Pt={content:a.prdText,taskKind:S,...we?{documents:we}:{},...Fe.length>0?{allowedPaths:Fe}:{},...mt.length>0?{forbiddenPaths:mt}:{},...Ie.length>0?{verifyCommands:Ie}:{}};if(!aw("bootstrapFromPrd",Pt)){a.setPrdFileError(iw());return}const bt=await d("bootstrapFromPrd",Pt);if(!bt||bt.ok===!1)return;const Mt=bt.result??{};Mt.taskId&&g(Mt.taskId),Mt.title&&y(Mt.title);const Tt=Mt.parseStatus??"pending",$n=Mt.draftPreview?.objective?.trim(),en=Array.isArray(Mt.gaps)?Mt.gaps.length:0,lt=Mt.semanticIntake?.applied?"semantic":Mt.semanticIntake?.code??"no-semantic",Ze=(Mt.autoImportedReferences??[]).filter(ct=>ct.repoRelative),vt=(Mt.unresolvedReferences??[]).filter(ct=>ct.token);c([`已创建任务「${Mt.title??""}」(${Mt.taskId??""})`,`来源:${Mt.identitySource??"prd"}`,`解析:${Tt}(${lt})`,$n?`目标:${$n.slice(0,120)}`:null,en>0?`缺口 ${en} 项待确认`:null,Ze.length>0?`已自动导入 ${Ze.length} 个引用文档(${Ze.map(ct=>`${ct.repoRelative}${ct.role?`:${ct.role}`:""}`).join("、")})`:null,vt.length>0?`有 ${vt.length} 个引用未能解析:${vt.map(ct=>`${ct.token}(${ct.reason??"未知原因"})`).join("、")}`:null].filter(Boolean).join(" · ")),o("interview")},[N,M,a,d,c,o,ot,S,P]),me=[{id:"setup",label:"就绪检查"},{id:"import-prd",label:"导入需求"},{id:"interview",label:"需求访谈(可跳过)"},{id:"contract",label:"契约落地"},{id:"dag-confirm",label:"确认 DAG"},{id:"run",label:"运行"}],$e=me.findIndex(we=>we.id===s);return{taskId:p,setTaskId:g,taskTitle:x,taskKind:S,setTaskKind:T,engineering:{allowedPathsText:N,forbiddenPathsText:M,verifyCommandsText:P},setEngineering:we=>{we.allowedPathsText!==void 0&&R(we.allowedPathsText),we.forbiddenPathsText!==void 0&&_(we.forbiddenPathsText),we.verifyCommandsText!==void 0&&F(we.verifyCommandsText)},workflowMeta:A,sessionId:L,question:U,answerText:q,setAnswerText:W,draftSummary:oe,assessmentId:H,contractValidateOk:K,contractValidateSummary:be,contractDiffSummary:G,ledgerLoading:Q,ledgerError:ue,ledgerSummary:Ne,contractApplied:D,spineOk:se,applyInterviewPayload:kt,runContractPreflight:Ut,applyContractThenSpine:ze,retrySpineOnly:Qe,confirmAndRunDag:Ue,importPrdAndCreate:fe,wizardSteps:me,stepIndex:$e}}async function Mw(e){return await import(e)}function Ow(e){const{nav:t,primary:n,chatHref:a,operateHref:s,readiness:o,setupBlocked:c,degraded:d,inspectHref:h,workspaces:m,workspaceId:p,workspacesLoading:g,onSelectWorkspace:x,onNavigate:y}=e,S=c||d?"models":"settings",T=c?"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。点击前往模型与认证。":d?"Pi 暂时降级:仍可恢复草稿与需求访谈。点击查看详情。":"Pi 已就绪。点击打开设置查看详情。",N=n==="operate"?`/#/operate/${t==="chat"?"tasks":t}`:n==="inspect"?h:null,R=n==="chat";return{mode:n,activeTabHref:N,chatHref:a,operateHref:s,inspectHref:h||zl,freshness:!1,readinessState:o,readinessHref:`/#/operate/${S}`,readinessTitle:T,onNavigate:y,repo:null,statusVisible:!1,workspaceSwitcher:R?null:{activeId:p,loading:g,items:m.map(M=>({workspaceId:M.workspaceId,name:M.name,displayPath:M.displayPath}))},onSelectWorkspace:x}}function Dw(e){const t=w.useRef(null),n=w.useRef(null),[a,s]=w.useState(!1),o=w.useMemo(()=>Ow(e),[e.nav,e.primary,e.chatHref,e.operateHref,e.readiness,e.setupBlocked,e.degraded,e.inspectHref,e.workspaces,e.workspaceId,e.workspacesLoading,e.onSelectWorkspace,e.onNavigate]),c=w.useRef(o);c.current=o,w.useEffect(()=>{let h=!1;return Mw("/inspect/operator-chrome.js").then(m=>{h||!t.current||(n.current=m.mountOperatorChrome(t.current,c.current))}).catch(()=>{h||s(!0)}),()=>{h=!0,n.current?.destroy(),n.current=null}},[]),w.useEffect(()=>{n.current?.update(o)},[o]);const d=h=>{e.onNavigate?e.onNavigate(h):window.location.hash=h.startsWith("/#")?h.slice(1):h};return u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:t,"data-testid":"operator-chrome"}),a?u.jsxs("nav",{className:"operator-chrome-fallback","aria-label":"产品模式",children:[u.jsx("select",{"aria-label":"切换工作区",value:e.workspaceId??"",onChange:h=>e.onSelectWorkspace(h.target.value),children:e.workspaces.map(h=>u.jsx("option",{value:h.workspaceId,children:h.name},h.workspaceId))}),u.jsx("button",{type:"button",onClick:()=>d(e.chatHref),children:"对话"}),u.jsx("button",{type:"button",onClick:()=>d(e.operateHref),children:"操作"}),u.jsx("button",{type:"button",onClick:()=>d(e.inspectHref),children:"观测"}),u.jsx("span",{role:"status",children:"共享导航加载失败,请刷新页面"})]}):null]})}function jw(e){const[t,n]=w.useState(!1),[a,s]=w.useState("latest"),o=w.useId(),c=e.busy||t;return u.jsxs("div",{className:"console-update-control","aria-live":"polite",children:[u.jsx("span",{className:"console-update-badge",children:a==="latest"?"稳定版更新":"预发布更新"}),u.jsx("label",{className:"console-update-channel-label",htmlFor:o,children:"更新渠道"}),u.jsxs("select",{id:o,className:"console-update-channel",value:a,disabled:c,onChange:d=>s(d.target.value==="next"?"next":"latest"),children:[u.jsx("option",{value:"latest",children:"稳定版(latest)"}),u.jsx("option",{value:"next",children:"预发布版(next)"})]}),u.jsx("button",{type:"button",className:"console-update-button",disabled:c,onClick:()=>{n(!0),e.runAction("consoleUpdateAndInit",{channel:a},{clientRequestId:`console-update-${crypto.randomUUID()}`}).then(d=>{if(d?.state==="restarting"){setTimeout(()=>window.location.reload(),800);return}n(!1)})},children:t?"正在更新…":"更新并初始化"})]})}function Lw(e){return u.jsxs(u.Fragment,{children:[e.opError?u.jsxs("div",{className:"flash flash-error","data-testid":"op-error",children:[u.jsx("span",{className:"flash-label",children:"错误"}),u.jsx("p",{className:"flash-body",children:e.opError})]}):null,e.opMessage?u.jsxs("div",{className:"flash flash-info","data-testid":"op-message",children:[u.jsx("span",{className:"flash-label",children:"状态"}),u.jsx("p",{className:"flash-body",children:e.opMessage})]}):null]})}const Yu=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"})),hd=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),zw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})),Z3=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})),Bw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})),qw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})),X3=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M6.99979 7V3C6.99979 2.44772 7.4475 2 7.99979 2H20.9998C21.5521 2 21.9998 2.44772 21.9998 3V16C21.9998 16.5523 21.5521 17 20.9998 17H17V20.9925C17 21.5489 16.551 22 15.9925 22H3.00728C2.45086 22 2 21.5511 2 20.9925L2.00276 8.00748C2.00288 7.45107 2.4518 7 3.01025 7H6.99979ZM8.99979 7H15.9927C16.549 7 17 7.44892 17 8.00748V15H19.9998V4H8.99979V7ZM15 9H4.00255L4.00021 20H15V9ZM8.50242 18L4.96689 14.4645L6.3811 13.0503L8.50242 15.1716L12.7451 10.9289L14.1593 12.3431L8.50242 18Z"})),Ts=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})),O1=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),D1=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"})),Hw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})),Uw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M21 8V20.9932C21 21.5501 20.5552 22 20.0066 22H3.9934C3.44495 22 3 21.556 3 21.0082V2.9918C3 2.45531 3.4487 2 4.00221 2H14.9968L21 8ZM19 9H14V4H5V20H19V9ZM8 7H11V9H8V7ZM8 11H16V13H8V11ZM8 15H16V17H8V15Z"})),Fw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM9.71002 19.6674C8.74743 17.6259 8.15732 15.3742 8.02731 13H4.06189C4.458 16.1765 6.71639 18.7747 9.71002 19.6674ZM10.0307 13C10.1811 15.4388 10.8778 17.7297 12 19.752C13.1222 17.7297 13.8189 15.4388 13.9693 13H10.0307ZM19.9381 13H15.9727C15.8427 15.3742 15.2526 17.6259 14.29 19.6674C17.2836 18.7747 19.542 16.1765 19.9381 13ZM4.06189 11H8.02731C8.15732 8.62577 8.74743 6.37407 9.71002 4.33256C6.71639 5.22533 4.458 7.8235 4.06189 11ZM10.0307 11H13.9693C13.8189 8.56122 13.1222 6.27025 12 4.24799C10.8778 6.27025 10.1811 8.56122 10.0307 11ZM14.29 4.33256C15.2526 6.37407 15.8427 8.62577 15.9727 11H19.9381C19.542 7.8235 17.2836 5.22533 14.29 4.33256Z"})),$w=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"})),Q3=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})),Pw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z"})),J3=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"})),Gw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M13 18V20H19V22H13C11.8954 22 11 21.1046 11 20V18H8C5.79086 18 4 16.2091 4 14V7C4 6.44772 4.44772 6 5 6H8V2H10V6H14V2H16V6H19C19.5523 6 20 6.44772 20 7V14C20 16.2091 18.2091 18 16 18H13ZM8 16H16C17.1046 16 18 15.1046 18 14V11H6V14C6 15.1046 6.89543 16 8 16ZM18 8H6V9H18V8ZM12 14.5C11.4477 14.5 11 14.0523 11 13.5C11 12.9477 11.4477 12.5 12 12.5C12.5523 12.5 13 12.9477 13 13.5C13 14.0523 12.5523 14.5 12 14.5Z"})),Vw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"})),qm=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),Kw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M3.5 1.34558C3.58425 1.34558 3.66714 1.36687 3.74096 1.40747L22.2034 11.5618C22.4454 11.6949 22.5337 11.9989 22.4006 12.2409C22.3549 12.324 22.2865 12.3924 22.2034 12.4381L3.74096 22.5924C3.499 22.7255 3.19497 22.6372 3.06189 22.3953C3.02129 22.3214 3 22.2386 3 22.1543V1.84558C3 1.56944 3.22386 1.34558 3.5 1.34558ZM5 4.38249V10.9999H10V12.9999H5V19.6174L18.8499 11.9999L5 4.38249Z"})),e5=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M3.33946 17.0002C2.90721 16.2515 2.58277 15.4702 2.36133 14.6741C3.3338 14.1779 3.99972 13.1668 3.99972 12.0002C3.99972 10.8345 3.3348 9.824 2.36353 9.32741C2.81025 7.71651 3.65857 6.21627 4.86474 4.99001C5.7807 5.58416 6.98935 5.65534 7.99972 5.072C9.01009 4.48866 9.55277 3.40635 9.4962 2.31604C11.1613 1.8846 12.8847 1.90004 14.5031 2.31862C14.4475 3.40806 14.9901 4.48912 15.9997 5.072C17.0101 5.65532 18.2187 5.58416 19.1346 4.99007C19.7133 5.57986 20.2277 6.25151 20.66 7.00021C21.0922 7.7489 21.4167 8.53025 21.6381 9.32628C20.6656 9.82247 19.9997 10.8336 19.9997 12.0002C19.9997 13.166 20.6646 14.1764 21.6359 14.673C21.1892 16.2839 20.3409 17.7841 19.1347 19.0104C18.2187 18.4163 17.0101 18.3451 15.9997 18.9284C14.9893 19.5117 14.4467 20.5941 14.5032 21.6844C12.8382 22.1158 11.1148 22.1004 9.49633 21.6818C9.55191 20.5923 9.00929 19.5113 7.99972 18.9284C6.98938 18.3451 5.78079 18.4162 4.86484 19.0103C4.28617 18.4205 3.77172 17.7489 3.33946 17.0002ZM8.99972 17.1964C10.0911 17.8265 10.8749 18.8227 11.2503 19.9659C11.7486 20.0133 12.2502 20.014 12.7486 19.9675C13.1238 18.8237 13.9078 17.8268 14.9997 17.1964C16.0916 16.5659 17.347 16.3855 18.5252 16.6324C18.8146 16.224 19.0648 15.7892 19.2729 15.334C18.4706 14.4373 17.9997 13.2604 17.9997 12.0002C17.9997 10.74 18.4706 9.5632 19.2729 8.6665C19.1688 8.4405 19.0538 8.21822 18.9279 8.00021C18.802 7.78219 18.667 7.57148 18.5233 7.36842C17.3457 7.61476 16.0911 7.43414 14.9997 6.80405C13.9083 6.17395 13.1246 5.17768 12.7491 4.03455C12.2509 3.98714 11.7492 3.98646 11.2509 4.03292C10.8756 5.17671 10.0916 6.17364 8.99972 6.80405C7.9078 7.43447 6.65245 7.61494 5.47428 7.36803C5.18485 7.77641 4.93463 8.21117 4.72656 8.66637C5.52881 9.56311 5.99972 10.74 5.99972 12.0002C5.99972 13.2604 5.52883 14.4372 4.72656 15.3339C4.83067 15.5599 4.94564 15.7822 5.07152 16.0002C5.19739 16.2182 5.3324 16.4289 5.47612 16.632C6.65377 16.3857 7.90838 16.5663 8.99972 17.1964ZM11.9997 15.0002C10.3429 15.0002 8.99972 13.6571 8.99972 12.0002C8.99972 10.3434 10.3429 9.00021 11.9997 9.00021C13.6566 9.00021 14.9997 10.3434 14.9997 12.0002C14.9997 13.6571 13.6566 15.0002 11.9997 15.0002ZM11.9997 13.0002C12.552 13.0002 12.9997 12.5525 12.9997 12.0002C12.9997 11.4479 12.552 11.0002 11.9997 11.0002C11.4474 11.0002 10.9997 11.4479 10.9997 12.0002C10.9997 12.5525 11.4474 13.0002 11.9997 13.0002Z"})),Yw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M10 3V5H5V19H19V14H21V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM17.5858 5H13V3H21V11H19V6.41421L12 13.4142L10.5858 12L17.5858 5Z"})),Ww=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M20.0833 15.1999L21.2854 15.9212C21.5221 16.0633 21.5989 16.3704 21.4569 16.6072C21.4146 16.6776 21.3557 16.7365 21.2854 16.7787L12.5144 22.0412C12.1977 22.2313 11.8021 22.2313 11.4854 22.0412L2.71451 16.7787C2.47772 16.6366 2.40093 16.3295 2.54301 16.0927C2.58523 16.0223 2.64413 15.9634 2.71451 15.9212L3.9166 15.1999L11.9999 20.0499L20.0833 15.1999ZM20.0833 10.4999L21.2854 11.2212C21.5221 11.3633 21.5989 11.6704 21.4569 11.9072C21.4146 11.9776 21.3557 12.0365 21.2854 12.0787L11.9999 17.6499L2.71451 12.0787C2.47772 11.9366 2.40093 11.6295 2.54301 11.3927C2.58523 11.3223 2.64413 11.2634 2.71451 11.2212L3.9166 10.4999L11.9999 15.3499L20.0833 10.4999ZM12.5144 1.30864L21.2854 6.5712C21.5221 6.71327 21.5989 7.0204 21.4569 7.25719C21.4146 7.32757 21.3557 7.38647 21.2854 7.42869L11.9999 12.9999L2.71451 7.42869C2.47772 7.28662 2.40093 6.97949 2.54301 6.7427C2.58523 6.67232 2.64413 6.61343 2.71451 6.5712L11.4854 1.30864C11.8021 1.11864 12.1977 1.11864 12.5144 1.30864ZM11.9999 3.33233L5.88723 6.99995L11.9999 10.6676L18.1126 6.99995L11.9999 3.33233Z"})),Zw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM4 5V19H20V5H4ZM12 15H18V17H12V15ZM8.66685 12L5.83842 9.17157L7.25264 7.75736L11.4953 12L7.25264 16.2426L5.83842 14.8284L8.66685 12Z"})),Xw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M9 4C10.1046 4 11 4.89543 11 6V12.8271C10.1058 12.1373 8.96602 11.7305 7.6644 11.5136L7.3356 13.4864C8.71622 13.7165 9.59743 14.1528 10.1402 14.7408C10.67 15.3147 11 16.167 11 17.5C11 18.8807 9.88071 20 8.5 20C7.11929 20 6 18.8807 6 17.5V17.1493C6.43007 17.2926 6.87634 17.4099 7.3356 17.4864L7.6644 15.5136C6.92149 15.3898 6.1752 15.1144 5.42909 14.7599C4.58157 14.3573 4 13.499 4 12.5C4 11.6653 4.20761 11.0085 4.55874 10.5257C4.90441 10.0504 5.4419 9.6703 6.24254 9.47014L7 9.28078V6C7 4.89543 7.89543 4 9 4ZM12 3.35418C11.2671 2.52376 10.1947 2 9 2C6.79086 2 5 3.79086 5 6V7.77422C4.14895 8.11644 3.45143 8.64785 2.94126 9.34933C2.29239 10.2415 2 11.3347 2 12.5C2 14.0652 2.79565 15.4367 4 16.2422V17.5C4 19.9853 6.01472 22 8.5 22C9.91363 22 11.175 21.3482 12 20.3287C12.825 21.3482 14.0864 22 15.5 22C17.9853 22 20 19.9853 20 17.5V16.2422C21.2044 15.4367 22 14.0652 22 12.5C22 11.3347 21.7076 10.2415 21.0587 9.34933C20.5486 8.64785 19.8511 8.11644 19 7.77422V6C19 3.79086 17.2091 2 15 2C13.8053 2 12.7329 2.52376 12 3.35418ZM18 17.1493V17.5C18 18.8807 16.8807 20 15.5 20C14.1193 20 13 18.8807 13 17.5C13 16.167 13.33 15.3147 13.8598 14.7408C14.4026 14.1528 15.2838 13.7165 16.6644 13.4864L16.3356 11.5136C15.034 11.7305 13.8942 12.1373 13 12.8271V6C13 4.89543 13.8954 4 15 4C16.1046 4 17 4.89543 17 6V9.28078L17.7575 9.47014C18.5581 9.6703 19.0956 10.0504 19.4413 10.5257C19.7924 11.0085 20 11.6653 20 12.5C20 13.499 19.4184 14.3573 18.5709 14.7599C17.8248 15.1144 17.0785 15.3898 16.3356 15.5136L16.6644 17.4864C17.1237 17.4099 17.5699 17.2926 18 17.1493Z"})),Qw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M18.793 5.79285 12.5859 12 18.793 18.2071 20.2072 16.7928 15.4143 12 20.2072 7.20706 18.793 5.79285ZM5.20694 18.2072 11.414 12.0001 5.20694 5.793 3.79272 7.20721 8.58562 12.0001 3.79272 16.793 5.20694 18.2072Z"})),Jw=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M14 4.4375C15.3462 4.4375 16.4375 3.34619 16.4375 2H17.5625C17.5625 3.34619 18.6538 4.4375 20 4.4375V5.5625C18.6538 5.5625 17.5625 6.65381 17.5625 8H16.4375C16.4375 6.65381 15.3462 5.5625 14 5.5625V4.4375ZM1 11C4.31371 11 7 8.31371 7 5H9C9 8.31371 11.6863 11 15 11V13C11.6863 13 9 15.6863 9 19H7C7 15.6863 4.31371 13 1 13V11ZM4.87601 12C6.18717 12.7276 7.27243 13.8128 8 15.124 8.72757 13.8128 9.81283 12.7276 11.124 12 9.81283 11.2724 8.72757 10.1872 8 8.87601 7.27243 10.1872 6.18717 11.2724 4.87601 12ZM17.25 14C17.25 15.7949 15.7949 17.25 14 17.25V18.75C15.7949 18.75 17.25 20.2051 17.25 22H18.75C18.75 20.2051 20.2051 18.75 22 18.75V17.25C20.2051 17.25 18.75 15.7949 18.75 14H17.25Z"})),gb=({color:e="currentColor",size:t=24,className:n,...a})=>at.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},at.createElement("path",{d:"M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z"}));var Zl=j3();const j1=10,bb='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Xl(e){const{open:t,containerRef:n,triggerRef:a,onEscape:s}=e,o=w.useRef(null),c=w.useRef(!1);w.useEffect(()=>{if(t){if(!c.current){const d=document.activeElement;o.current=a?.current??(d instanceof HTMLElement?d:null);const h=n.current;h&&(h.querySelector(bb)??h).focus?.(),c.current=!0}return()=>{if(!c.current)return;const d=a?.current??o.current;d&&document.contains(d)&&d.focus(),o.current=null,c.current=!1}}c.current=!1},[t,n,a]),w.useEffect(()=>{if(!t)return;const d=n.current;if(!d)return;const h=m=>{if(m.key==="Escape"){m.preventDefault(),s?.();return}if(m.key!=="Tab")return;const p=Array.from(d.querySelectorAll(bb)).filter(S=>!S.hasAttribute("disabled")&&S.tabIndex!==-1);if(p.length===0){m.preventDefault(),d.focus?.();return}const g=p[0],x=p[p.length-1],y=document.activeElement;m.shiftKey?(y===g||!d.contains(y))&&(m.preventDefault(),x.focus()):(y===x||!d.contains(y))&&(m.preventDefault(),g.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[t,n,s])}const ek=["command","query","operation","tool","server","symbol","path","file_path","filePath","pattern","glob","url"],tk=120,nk=800;function Wu(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function rk(e){if(e!=null){if(typeof e=="string"){const t=e.trim();if(!t)return;try{return Wu(JSON.parse(t))}catch{return}}return Wu(e)}}function ei(e,t){const n=e.replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t)}…`:n:""}function Vn(e,t){const n=e[t];if(typeof n=="string"&&n.trim())return n.trim();if(typeof n=="number"&&Number.isFinite(n))return String(n)}function ak(e,t,n){const a=(e??"").toLowerCase();if(a==="bash"||a==="shell"){const s=Vn(t,"command");return s?ei(s,n):void 0}if(a==="mcp"||a.startsWith("mcp_")){const s=Vn(t,"server"),o=Vn(t,"tool")??Vn(t,"name"),c=Vn(t,"query");return s&&o?ei(`${s} · ${o}`,n):o?ei(o,n):c?ei(c,n):s?ei(s,n):void 0}if(a==="lsp_navigation"||a.includes("lsp")){const s=[Vn(t,"operation"),Vn(t,"symbol"),Vn(t,"path")??Vn(t,"file_path")??Vn(t,"filePath")].filter(Boolean),o=Vn(t,"line")??Vn(t,"position");if(s.length===0&&!o)return;const c=s.join(" · ");return ei(o?`${c}${c?":":""}${o}`:c,n)}if(a==="symbol_search"||a.includes("symbol_search")){const s=Vn(t,"query")??Vn(t,"symbol");return s?ei(s,n):void 0}if(a==="read"||a==="read_symbol"||a==="read_enclosing"||a.startsWith("read_")){const s=Vn(t,"path")??Vn(t,"file_path")??Vn(t,"filePath"),o=Vn(t,"symbol"),c=Vn(t,"line");if(!s&&!o)return;const d=[s,o,c].filter(Boolean);return ei(d.join(" · "),n)}}function ik(e,t){const n=t?.maxLen??tk,a=rk(e);if(!a){if(typeof e=="string"){const h=e.replace(/\s+/g," ").trim();return!h||h==="{}"?"":h.length>n?`${h.slice(0,n)}…`:h}return""}const s=ak(t?.toolName,a,n);if(s)return s;for(const h of ek){const m=a[h];if(typeof m=="string"&&m.trim())return ei(m,n)}const o=Object.keys(a);if(o.length===0)return"";const c=a[o[0]],d=String(c??"").replace(/\s+/g," ").trim();return d?d.length>n?`${d.slice(0,n)}…`:d:""}function sk(e){const t=e?.trim()||"Tool",n=t.toLowerCase();return n==="bash"||n==="shell"||n.includes("exec_command")?{kind:"bash",label:"Bash"}:n==="read"||n==="read_file"||n.startsWith("read_")||n.includes("view_file")?{kind:"read",label:"Read"}:n==="search"||n==="grep"||n==="glob"||n.includes("search")||n.includes("codegraph")||n.includes("lsp")?{kind:"search",label:n==="glob"?"Glob":"Search"}:n==="write"||n==="edit"||n.includes("apply_patch")||n.includes("write_file")||n.includes("edit_file")?{kind:"write",label:n==="write"||n.includes("write_file")?"Write":"Edit"}:n==="web"||n.includes("browser")||n.includes("fetch")||n.includes("web_")?{kind:"web",label:"Web"}:n==="mcp"||n.startsWith("mcp_")||n.includes("__")?{kind:"mcp",label:n==="mcp"?"MCP":t}:{kind:"tool",label:t}}function ok(e){const t=(e??"").toLowerCase();return t==="bash"||t==="shell"?{argsLabel:"命令",resultLabel:"输出"}:t==="mcp"||t.startsWith("mcp_")?{argsLabel:"参数",resultLabel:"结果"}:{argsLabel:"入参",resultLabel:"结果"}}function t5(e){if(e==null)return"";if(typeof e=="string"){const a=e.trim();if(!a)return"";if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return t5(JSON.parse(a))}catch{return e}return e}if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Wu(e);if(!t)try{return JSON.stringify(e,null,2)}catch{return String(e)}const n=t.content;if(Array.isArray(n)){const a=[];for(const s of n){const o=Wu(s);o&&(o.type==="text"&&typeof o.text=="string"||typeof o.text=="string")&&a.push(o.text)}if(a.length>0)return a.join(`
19
+ `)}if(typeof t.text=="string")return t.text;if(typeof t.output=="string")return t.output;if(typeof t.message=="string")return t.message;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function lk(e){if(e==null)return"";try{return typeof e=="string"?e:JSON.stringify(e,null,2)}catch{return String(e)}}function ck(e,t){if(e===void 0)return{text:"",truncated:!1};const n=t?.maxLen??nk;return e.length<=n?{text:e,truncated:!1}:{text:`${e.slice(0,n)}…`,truncated:!0}}function uk(e,t){if(t===void 0||!Number.isFinite(e)||!Number.isFinite(t))return;const n=Math.round((t-e)/1e3);return n>0?n:void 0}function qn(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function ri(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function Kf(e,t){return new Promise((n,a)=>{if(t?.aborted){a(new DOMException("Aborted","AbortError"));return}const s=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e),o=()=>{clearTimeout(s),a(new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",o)})}function Ul(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Yf(e){const t=new Date(e),n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?"今天":t.toLocaleDateString([],{month:"long",day:"numeric"})}function dk(e,t){return e?e.taskId===t.taskId&&e.updatedAt===t.updatedAt&&e.lastEventId===t.lastEventId&&e.operations.length===t.operations.length:!1}const n5={status:"idle",snapshot:null,error:null,reloading:!1,reloadError:null,mutationBusy:!1,mutationToken:null};function L1(e){if(!e||typeof e!="object")return{message:"runtime snapshot request failed"};const t=e,n=t.error;if(n&&typeof n=="object"){const a=n;return{...typeof a.code=="string"&&a.code?{code:a.code}:{},...typeof t.status=="number"?{status:t.status}:{},message:typeof a.message=="string"&&a.message?a.message:"runtime snapshot request failed"}}return{...typeof t.status=="number"?{status:t.status}:{},message:typeof t=="object"&&"message"in t&&typeof t.message=="string"&&t.message?t.message:"runtime snapshot request failed"}}function fk(e,t){switch(t.type){case"load-start":return{...e,sessionId:t.sessionId,status:"loading",error:null};case"load-success":return e.snapshot&&e.sessionId===t.sessionId&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"load-failure":return{...e,sessionId:t.sessionId,status:"error",error:t.error,snapshot:null};case"reload-start":return e.reloading?e:{...e,reloading:!0,reloadError:null,...e.status==="error"?{error:null}:{}};case"reload-success":return{...e,status:"ready",snapshot:t.snapshot,reloading:!1,reloadError:null,error:null,sessionId:t.snapshot.sessionId||e.sessionId};case"reload-failure":return{...e,reloading:!1,reloadError:t.error};case"mutation-start":return{...e,mutationBusy:!0,mutationToken:t.token};case"mutation-adopt":return e.mutationToken!==t.token||e.sessionId!==void 0&&e.sessionId!==t.sessionId||e.snapshot&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"mutation-settle":return e.mutationToken!==t.token?e:{...e,mutationBusy:!1,mutationToken:null};case"mutation-reset":return{...e,mutationBusy:!1,mutationToken:null};case"reset":return{...n5};default:return e}}function r5(e){const t=e.selection;return{...t.model?{model:{provider:t.model.provider,modelId:t.model.id}}:{},...t.thinkingSelection==="auto"?t.effectiveThinkingLevel?{thinkingLevel:t.effectiveThinkingLevel}:{}:{thinkingLevel:t.thinkingSelection}}}function hk(e,t,n,a){const s=n&&n.sessionId===a?r5(n):{},o=s.model??e?.model,c=s.thinkingLevel??e?.thinkingLevel;return{readOnly:t.readOnly,systemPrompt:t.systemPrompt,resources:t.resources,suffix:t.suffix,...o?{model:o}:{},...c?{thinkingLevel:c}:{}}}function mk(e=n5){let t=e;const n=new Set;return{getState:()=>t,dispatch:a=>{t=fk(t,a);for(const s of n)s();return t},subscribe:a=>(n.add(a),()=>n.delete(a))}}function pk(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}/auto-invocation`}async function gk(e){const t=e.fetchImpl??fetch;try{const n=await t(pk(e.origin,e.sessionId,e.resourceId),{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":e.confirmationToken},body:JSON.stringify({autoInvocationEnabled:e.autoInvocationEnabled})}),a=await n.json().catch(()=>({}));if(!n.ok||a.ok===!1)return{ok:!1,error:{...L1(a),status:n.status}};const s=a.preferenceSaved===!0,o=a.reloadApplied===!0;if(!s)return{ok:!1,error:{status:n.status,code:"PI_RESOURCE_PREFERENCES_WRITE_FAILED",message:"preference was not saved"}};if(!o){const c=a.error?.code??"PI_SESSION_BUSY",d=a.error?.message??"preference saved; current session is busy and was not reloaded";return{ok:!0,preferenceSaved:!0,reloadApplied:!1,...a.snapshot?{snapshot:a.snapshot}:{},partialBusy:{code:c,message:d}}}return{ok:!0,preferenceSaved:!0,reloadApplied:!0,...a.snapshot?{snapshot:a.snapshot}:{}}}catch(n){return{ok:!1,error:{message:n instanceof Error?n.message:String(n)}}}}const An=mk();let $i;function a5(e){return`/api/operator/v1/chat/sessions/${encodeURIComponent(e)}`}function bk(e){const t=$i;if($i=e,!(t&&t.sessionId===e.sessionId&&t.origin===e.origin)){if((!t||t.sessionId!==e.sessionId)&&An.dispatch({type:"mutation-reset"}),!e.sessionId){An.dispatch({type:"reset"});return}An.dispatch({type:"load-start",sessionId:e.sessionId}),i5(e.sessionId,e.origin)}}async function i5(e,t){try{const n=await fetch(`${t}${a5(e)}/runtime-snapshot`,{credentials:"include"}),a=await n.json().catch(()=>({}));if($i?.sessionId!==e)return;if(!n.ok){An.dispatch({type:"load-failure",sessionId:e,error:{...L1(a),status:n.status}});return}if(!a.snapshot){An.dispatch({type:"load-failure",sessionId:e,error:{status:n.status,message:"runtime snapshot missing in response"}});return}An.dispatch({type:"load-success",sessionId:e,snapshot:a.snapshot})}catch(n){if($i?.sessionId!==e)return;An.dispatch({type:"load-failure",sessionId:e,error:{message:n instanceof Error?n.message:String(n)}})}}async function Zu(){const e=$i;if(!e?.sessionId||An.getState().reloading)return!1;const t=e.sessionId;An.dispatch({type:"reload-start"});try{const n=await fetch(`${e.origin}${a5(t)}/reload`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:"{}"}),a=await n.json().catch(()=>({}));return $i?.sessionId!==t?!1:n.ok?a.snapshot?(An.dispatch({type:"reload-success",snapshot:a.snapshot}),!0):(An.dispatch({type:"reload-failure",error:{status:n.status,message:"reload succeeded but snapshot missing"}}),!1):(An.dispatch({type:"reload-failure",error:{...L1(a),status:n.status}}),!1)}catch(n){return $i?.sessionId!==t||An.dispatch({type:"reload-failure",error:{message:n instanceof Error?n.message:String(n)}}),!1}}async function Hm(){const e=$i;if(!e?.sessionId)return!1;const t=e.sessionId;return An.dispatch({type:"load-start",sessionId:t}),i5(t,e.origin),!0}function vk(e,t,n){return n?(An.dispatch({type:"mutation-adopt",token:e,sessionId:t,snapshot:n}),An.getState().snapshot===n):!1}function yk(e,t,n){return n.sessionRef.current?.sessionId!==t||An.getState().mutationToken!==e?!1:(An.dispatch({type:"mutation-settle",token:e}),!0)}function Ql(){return w.useSyncExternalStore(An.subscribe,An.getState)}function s5(e){An.dispatch(e)}function xk(){return An.getState()}const vb=[{id:"version",label:"版本信息"},{id:"models",label:"模型"},{id:"skills",label:"技能"},{id:"plugins",label:"插件"},{id:"mcp",label:"MCP"}];function ms({children:e}){return u.jsx("p",{className:"oc-settings-empty",children:e})}function wk(e){return e==="loaded"?"已加载":e==="configured"?"已配置":e==="disabled"?"未启用":"状态未知"}function kk(e){const[t,n]=w.useState("version"),[a,s]=w.useState(null),[o,c]=w.useState(null),[d,h]=w.useState(null),[m,p]=w.useState({}),[g,x]=w.useState(null),[y,S]=w.useState(null),T=w.useRef(null),N=Ql(),R=N.snapshot;Xl({open:e.open,containerRef:T,triggerRef:e.triggerRef,onEscape:e.onClose}),w.useEffect(()=>{if(!e.open)return;let A=!0;return c(null),fetch(`${e.origin}/api/health`,{credentials:"include"}).then(async L=>{const Z=await L.json();if(!L.ok)throw new Error("版本信息读取失败");A&&s(Z)}).catch(L=>{A&&c(L instanceof Error?L.message:String(L))}),()=>{A=!1}},[e.open,e.origin]);const M=w.useMemo(()=>[...R?.packages.map(A=>({name:A.packageName??A.spec,detail:A.version?`v${A.version}`:A.spec,enabled:A.enabled}))??[],...R?.extensions.map(A=>({name:A.name,detail:A.scope,enabled:A.enabled}))??[]],[R]);w.useEffect(()=>{h(null),p({}),x(null),S(null)},[R?.sessionId]);const _=(A,L)=>Object.hasOwn(m,A)?m[A]:L,P=async A=>{if(!R?.sessionId||!A.resourceId||d)return;const L=!_(A.resourceId,A.autoInvocationEnabled);h(A.resourceId),S(null),x(null),p(U=>({...U,[A.resourceId]:L}));const Z=await gk({origin:e.origin,sessionId:R.sessionId,resourceId:A.resourceId,autoInvocationEnabled:L,confirmationToken:qn()});if(h(null),!Z.ok){p(U=>{const $={...U};return delete $[A.resourceId],$}),S(`${Z.error.code?`${Z.error.code}:`:""}${Z.error.message}`);return}if(Z.reloadApplied&&Z.snapshot){s5({type:"load-success",sessionId:R.sessionId,snapshot:Z.snapshot}),p(U=>{const $={...U};return delete $[A.resourceId],$});return}Z.partialBusy&&x("设置已保存,将在本轮对话结束并重新加载会话后生效。")};if(!e.open||typeof document>"u")return null;const F=()=>{if(t==="version")return u.jsxs("div",{className:"oc-settings-version-grid",children:[u.jsxs("div",{children:[u.jsx("span",{children:"产品"}),u.jsx("strong",{children:a?.productName??a?.product??"Loop Agent"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"版本"}),u.jsx("strong",{children:a?.packageVersion??(o?"读取失败":"读取中…")})]}),u.jsxs("div",{children:[u.jsx("span",{children:"工作区"}),u.jsx("strong",{children:a?.repoName??"当前工作区"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Pi 状态"}),u.jsx("strong",{children:a?.piReadiness??"读取中…"})]}),o?u.jsx("p",{className:"oc-settings-error",children:o}):null]});if(N.status==="loading"||N.status==="idle")return u.jsx(ms,{children:"正在读取当前会话的运行配置…"});if(N.status==="error")return u.jsx(ms,{children:N.error?.message??"运行配置读取失败"});if(!R)return u.jsx(ms,{children:"新建或打开一个会话后即可查看。"});if(t==="models")return R.models.length?u.jsx("ul",{className:"oc-settings-list",children:R.models.map(L=>{const Z=R.selection.model?.provider===L.provider&&R.selection.model.id===L.id;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:L.name??L.id}),u.jsxs("span",{children:[L.provider," / ",L.id]})]}),Z?u.jsx("em",{children:"当前"}):null]},`${L.provider}/${L.id}`)})}):u.jsx(ms,{children:"当前会话没有可用模型。"});if(t==="skills")return R.skills.length?u.jsxs("div",{className:"oc-settings-skill-section",children:[u.jsx("p",{className:"oc-settings-help",children:"开启后允许模型自动选择并注入该技能上下文;关闭后仍可手动调用。"}),y?u.jsx("p",{className:"oc-settings-error",role:"alert",children:y}):null,g?u.jsx("p",{className:"oc-settings-notice",role:"status",children:g}):null,u.jsx("ul",{className:"oc-settings-list",children:R.skills.map(L=>{const Z=_(L.resourceId,L.autoInvocationEnabled),U=d===L.resourceId;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:L.name}),u.jsx("span",{children:L.description||L.scope})]}),u.jsxs("div",{className:"oc-settings-skill-control",children:[u.jsx("em",{children:Z?"已启用":"未启用"}),u.jsx("button",{type:"button",className:`oc-toggle${Z?" is-on":""}`,role:"switch","aria-checked":Z,"aria-label":`${Z?"关闭":"开启"} ${L.name} 自动注入上下文`,disabled:U||!!d||!L.resourceId,title:U?"保存中…":"控制模型是否可自动选择该技能",onClick:()=>{P(L)},children:u.jsx("span",{className:"oc-toggle-knob","aria-hidden":"true"})})]})]},L.resourceId)})})]}):u.jsx(ms,{children:"当前会话没有加载技能。"});if(t==="plugins")return M.length?u.jsx("ul",{className:"oc-settings-list",children:M.map((L,Z)=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:L.name}),u.jsx("span",{children:L.detail})]}),u.jsx("em",{children:L.enabled?"已启用":"未启用"})]},`${L.name}-${Z}`))}):u.jsx(ms,{children:"当前会话没有加载插件。"});const A=R.mcp?.servers??[];return A.length?u.jsx("ul",{className:"oc-settings-list",children:A.map(L=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:L.name}),u.jsxs("span",{children:[L.tools.length," 个工具 · ",L.transport??L.scope]})]}),u.jsx("em",{children:wk(L.status)})]},L.name))}):u.jsx(ms,{children:"当前会话没有加载 MCP 服务。"})};return Zl.createPortal(u.jsx("div",{className:"oc-settings-backdrop",onMouseDown:A=>{A.target===A.currentTarget&&e.onClose()},children:u.jsxs("section",{ref:T,className:"oc-settings-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"oc-settings-title",tabIndex:-1,children:[u.jsxs("header",{className:"oc-settings-head",children:[u.jsxs("div",{children:[u.jsx("h2",{id:"oc-settings-title",children:"设置"}),u.jsx("p",{children:"Loop Agent Console"})]}),u.jsx("button",{type:"button",onClick:e.onClose,"aria-label":"关闭设置",title:"关闭",children:u.jsx(Ts,{size:18,"aria-hidden":"true"})})]}),u.jsxs("div",{className:"oc-settings-layout",children:[u.jsx("nav",{"aria-label":"设置分类",children:vb.map(A=>u.jsx("button",{type:"button",className:t===A.id?"is-active":"","aria-current":t===A.id?"page":void 0,onClick:()=>n(A.id),children:A.label},A.id))}),u.jsxs("div",{className:"oc-settings-content",children:[u.jsx("h3",{children:vb.find(A=>A.id===t)?.label}),F()]})]})]})}),document.body)}function Sk(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),u.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Ek(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})})}function yb(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Tk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:u.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Um({side:e="left"}){return u.jsx("svg",{className:`oc-panel-icon${e==="right"?" is-right":""}`,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 0 10.3111 0 9.14986V6.85014C0 5.68895-0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z",fill:"currentColor"})})}function Ck(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function o5(){return u.jsx("svg",{className:"oc-tool-chevron",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"2.5 4 6 7.5 9.5 4"})})}function Nk({open:e}){return u.jsx("svg",{className:`oc-tree-chevron${e?" is-open":""}`,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M4.2 2.4 7.8 6 4.2 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rk({open:e}){return u.jsx("svg",{className:`oc-workspace-chevron${e?" is-open":""}`,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M4.25 2.82782V11.1722C4.25 11.6622 4.84243 11.9076 5.18891 11.5611L9.36109 7.38891C9.57588 7.17412 9.57588 6.82588 9.36109 6.61109L5.18891 2.43891C4.84243 2.09243 4.25 2.33782 4.25 2.82782Z",fill:"currentColor"})})}function Ak(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3 3.5h10v2H3v-2Zm0 3.5h10v2H3V7Zm0 3.5h7V13H3v-2Z",fill:"currentColor"})})}function Ik(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 3v10M3 8h10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function l5(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M2 4h5l1 1.5h6V13H2V4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function _k({open:e}){return u.jsx("svg",{className:`oc-tree-glyph${e?" is-folder-open":" is-folder"}`,width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M1.5 4h3.2l1 1.1H12a.8.8 0 0 1 .8.8v5.3a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V4.8a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:e?.9:.68})})}function Mk(){return u.jsx("svg",{className:"oc-tree-glyph is-file",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M3.2 1.6h5.1L10.8 4v8.4a.8.8 0 0 1-.8.8H3.2a.8.8 0 0 1-.8-.8V2.4a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.55"})})}function Ok(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,void 0,{sensitivity:"base"}))}function c5(e){const t=w.useMemo(()=>Ok(e.entries),[e.entries]);return t.length?u.jsx("ul",{className:"oc-tree",role:e.depth===0?"tree":"group",children:t.map(n=>{const a=n.kind==="directory"&&e.expanded.has(n.path);return u.jsxs("li",{className:`oc-tree-node is-${n.kind}${a?" is-open":""}`,role:"treeitem","aria-expanded":n.kind==="directory"?a:void 0,children:[u.jsxs("button",{type:"button",className:`oc-tree-row oc-tree-${n.kind==="directory"?"dir":"file"}`,style:{paddingLeft:`${8+e.depth*12}px`},onClick:()=>n.kind==="directory"?e.onToggle(n.path):e.onPreview(n.path),children:[n.kind==="directory"?u.jsxs(u.Fragment,{children:[u.jsx(Nk,{open:a}),u.jsx(_k,{open:a})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tree-chevron-spacer","aria-hidden":"true"}),u.jsx(Mk,{})]}),u.jsx("span",{className:"oc-tree-label",children:n.name}),u.jsx("span",{className:"oc-tree-at",role:"button",tabIndex:0,"aria-label":`插入 ${n.name} 引用`,onClick:s=>{s.stopPropagation(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path)},onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path))},children:"@"})]}),n.kind==="directory"&&a?u.jsx(c5,{...e,entries:e.tree[n.path]??[],depth:e.depth+1}):null]},n.path)})}):u.jsx("p",{className:"oc-tree-empty",children:"此目录为空或没有可安全浏览的文件。"})}function xb(e){return u.jsxs("section",{className:"oc-details-files","aria-label":"Workspace 文件",children:[u.jsxs("header",{children:[u.jsx("span",{className:"oc-details-workspace-name",title:e.workspaceName,children:e.workspaceName}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onRefresh,"aria-label":"刷新文件",title:"刷新文件",children:u.jsx(Vw,{size:15,"aria-hidden":"true"})})]}),e.treeError?u.jsx("p",{className:"oc-sidebar-error",role:"alert",children:e.treeError}):null,u.jsx("div",{className:"oc-details-tree-scroll",children:u.jsx(c5,{entries:e.tree[""]??[],tree:e.tree,expanded:e.expanded,depth:0,onToggle:e.onToggle,onInsert:e.onInsert,onPreview:e.onPreview})})]})}function wb(e,t=Date.now()){const n=new Date(e).getTime();if(!Number.isFinite(n))return"";const a=Math.max(0,t-n),s=Math.floor(a/6e4);if(s<1)return"刚刚";if(s<60)return`${s}分钟`;const o=Math.floor(s/60);if(o<24)return`${o}小时`;const c=Math.floor(o/24);if(c<30)return`${c}天`;const d=Math.floor(c/30);return d<12?`${d}个月`:`${Math.floor(d/12)}年`}function u5(e){const t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"时间未知"}function d5(e=!1){const[t,n]=w.useState(null),a=w.useRef(null),s=w.useRef(null),o=w.useCallback(()=>{a.current!==null&&window.clearTimeout(a.current),s.current!==null&&window.clearTimeout(s.current),a.current=null,s.current=null},[]),c=w.useCallback(()=>{o(),n(null)},[o]);w.useEffect(()=>{e&&c()},[c,e]),w.useEffect(()=>c,[c]);const d=w.useCallback(p=>{if(e||(s.current!==null&&(window.clearTimeout(s.current),s.current=null),t))return;const g=p.currentTarget.getBoundingClientRect();a.current=window.setTimeout(()=>{n({left:Math.min(g.right+8,window.innerWidth-252),top:Math.max(8,Math.min(g.top,window.innerHeight-180))})},500)},[e,t]),h=w.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),t&&(s.current=window.setTimeout(c,180))},[c,t]),m=w.useCallback(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]);return{position:t,close:c,onPointerEnter:d,onPointerLeave:h,onCardPointerEnter:m}}function f5(e){return!e.position||typeof document>"u"?null:Zl.createPortal(u.jsx("div",{className:"oc-sidebar-hover-card",style:{left:e.position.left,top:e.position.top},onPointerEnter:e.onPointerEnter,onPointerLeave:e.onPointerLeave,children:e.children}),document.body)}function Dk(e){const{item:t,active:n,streamingNow:a,turnPhaseNow:s,state:o,deleteConfirming:c,deleting:d}=e,h=s??t.turnPhase,m=a||h==="running"||h==="stopping"||!!t.activeTurnId,p=t.deferredTurn?.state==="failed"?"发送失败":t.deferredTurn?.state==="dispatching"||t.deferredTurn?.state==="accepted"?"发送中":t.deferredTurn?.state==="queued"?"待发送":null,g=t.title||t.displayTitle||"未命名对话",x=u5(t.updatedAt),y=new Date(t.updatedAt),S=Number.isFinite(y.getTime())?y.toISOString():void 0,T=w.useRef(null),N=w.useRef(null),R=w.useRef(null),[M,_]=w.useState(null),P=d5(!!M||c);return w.useEffect(()=>{const F=Z=>{R.current?.contains(Z.target)||N.current?.contains(Z.target)||(c&&e.onCancelDelete(),_(null))},A=()=>{P.close(),_(null)},L=Z=>{Z.key==="Escape"&&(P.close(),c&&e.onCancelDelete(),_(null))};return document.addEventListener("mousedown",F),window.addEventListener("scroll",A,!0),window.addEventListener("keydown",L),()=>{document.removeEventListener("mousedown",F),window.removeEventListener("scroll",A,!0),window.removeEventListener("keydown",L)}},[c,P.close,e.onCancelDelete]),w.useEffect(()=>{c&&T.current?.focus()},[c]),u.jsxs("div",{className:`oc-session-item${n?" is-active":""}${c?" is-delete-confirming":""}${M?" is-menu-open":""}`,"data-session-id":t.sessionId,onPointerEnter:P.onPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsxs("a",{href:e.href,className:"oc-session-main","aria-disabled":d||void 0,tabIndex:d?-1:void 0,onClick:F=>{if(d){F.preventDefault();return}e.onActivate()},children:[u.jsx("strong",{children:g}),u.jsx("time",{dateTime:S,title:x,children:wb(t.updatedAt,e.now)})]}),m?u.jsx("span",{className:"oc-session-running","aria-label":"对话进行中",title:"对话进行中",children:u.jsx("span",{className:"oc-spinner","aria-hidden":"true"})}):null,p?u.jsx("span",{className:`oc-session-queue-state is-${t.deferredTurn?.state}`,children:p}):null,u.jsx("div",{className:"oc-session-actions",children:u.jsx("button",{type:"button",ref:N,className:"oc-session-menu","data-session-delete-id":t.sessionId,title:"更多","aria-label":`${g} 更多操作`,"aria-expanded":!!M,onClick:F=>{if(F.stopPropagation(),P.close(),M){_(null);return}const A=F.currentTarget.getBoundingClientRect();_({left:Math.max(8,Math.min(A.right-176,window.innerWidth-184)),top:Math.min(A.bottom+5,window.innerHeight-128)})},children:u.jsx(J3,{size:16,"aria-hidden":"true"})})}),u.jsxs(f5,{position:P.position,onPointerEnter:P.onCardPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsx("strong",{children:g}),u.jsxs("span",{children:[wb(t.updatedAt,e.now)," · ",x]}),u.jsxs("span",{className:"oc-sidebar-hover-status",children:[u.jsx("i",{className:m?"is-running":""}),p??(m?"对话进行中":o==="archived"?"已归档":"空闲")]})]}),M&&typeof document<"u"?Zl.createPortal(u.jsx("div",{ref:R,className:"oc-session-popover-menu",role:"menu",style:{left:M.left,top:M.top},children:c?u.jsxs("div",{className:"oc-session-menu-confirm",children:[u.jsx("span",{children:"确定删除这个会话?"}),u.jsxs("div",{children:[u.jsx("button",{type:"button",ref:T,className:"is-danger",disabled:d,"aria-label":`确认删除会话:${g}`,"aria-busy":d||void 0,onClick:()=>e.onConfirmDelete(),children:d?"删除中…":"删除"}),u.jsx("button",{type:"button",disabled:d,"aria-label":"取消删除会话",onClick:()=>{e.onCancelDelete(),_(null)},children:"取消"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{_(null);const F=window.prompt("会话名称",t.title??"");F!==null&&e.onRename(F)},children:[u.jsx(D1,{size:16,"aria-hidden":"true"}),"编辑标题"]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{_(null),e.onSetState(o==="active"?"archived":"active")},children:[u.jsx($w,{size:16,"aria-hidden":"true"}),o==="active"?"归档会话":"恢复会话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",onClick:()=>e.onRequestDelete(),children:[u.jsx(O1,{size:16,"aria-hidden":"true"}),"删除会话"]})]})}),document.body):null]})}function jk(e){const{workspace:t,active:n}=e,a=e.deletingSessionId,s=e.cancelDelete,[o,c]=w.useState(!0),[d,h]=w.useState(!1),m=w.useRef(null),p=d5(d);w.useEffect(()=>{if(!d)return;const x=S=>{m.current?.contains(S.target)||h(!1)},y=S=>{S.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",x),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y)}},[d]);const g=w.useMemo(()=>e.sessions.filter(x=>x.workspaceId===t.workspaceId||n&&!x.workspaceId),[n,e.sessions,t.workspaceId]);return u.jsxs("div",{className:`oc-workspace-item${n?" is-active":""}`,"data-workspace-id":t.workspaceId,"aria-current":n?"true":void 0,children:[u.jsxs("div",{className:"oc-workspace-row",children:[u.jsxs("button",{type:"button",className:"oc-workspace-main",onMouseDown:x=>x.preventDefault(),onClick:()=>{if(n){c(x=>!x);return}c(!0),e.onActivateWorkspaceRow()},"aria-expanded":n&&o,onPointerEnter:p.onPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("span",{className:"oc-workspace-caret","aria-hidden":"true",children:u.jsx(Rk,{open:o&&n})}),u.jsx("span",{className:"oc-workspace-folder","aria-hidden":"true",children:u.jsx(l5,{})}),u.jsx("strong",{children:t.name})]}),u.jsxs("div",{className:"oc-workspace-actions",ref:m,children:[u.jsx("button",{type:"button",title:"更多","aria-label":`${t.name} 更多操作`,"aria-expanded":d,onClick:x=>{x.stopPropagation(),h(y=>!y)},children:u.jsx(J3,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",title:"新建对话","aria-label":`在 ${t.name} 新建对话`,disabled:e.creatingSession,onClick:x=>{x.stopPropagation(),e.onCreateSession()},children:e.creatingSession?u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}):u.jsx(Yu,{size:16,"aria-hidden":"true"})}),d?u.jsxs("div",{className:"oc-workspace-menu",role:"menu",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),e.onCreateSession()},children:[u.jsx(Yu,{size:15,"aria-hidden":"true"}),"新建对话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",disabled:e.removing,onClick:()=>{h(!1),e.onRemove()},children:[u.jsx(O1,{size:15,"aria-hidden":"true"}),e.removing?"移除中…":"移除工作区"]})]}):null]}),u.jsxs(f5,{position:p.position,onPointerEnter:p.onCardPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("strong",{children:t.name}),u.jsx("span",{className:"oc-sidebar-hover-path",children:t.displayPath}),t.createdAt?u.jsxs("span",{children:["添加于 ",u5(t.createdAt)]}):null]})]}),n&&o?u.jsxs("div",{className:"oc-workspace-sessions",children:[["active","archived"].map(x=>{const y=g.filter(S=>S.state===x);return y.length?u.jsx("div",{className:"oc-session-group",children:y.map(S=>u.jsx(Dk,{item:S,href:Hl({workspaceId:t.workspaceId,sessionId:S.sessionId}),active:e.activeSessionId===S.sessionId,streamingNow:e.activeSessionId===S.sessionId&&e.activeSessionStreaming===!0,turnPhaseNow:e.activeSessionId===S.sessionId?e.activeSessionTurnPhase:void 0,state:x,deleteConfirming:e.pendingDeleteSessionId===S.sessionId,deleting:e.deletingSessionId===S.sessionId,onActivate:()=>{a||(s(!1),e.onActivate(S.sessionId))},onRename:T=>e.onRenameSession(S.sessionId,T),onSetState:T=>e.onSetSessionState(S.sessionId,T),onRequestDelete:()=>e.onRequestDeleteSession(S),onConfirmDelete:()=>e.onConfirmDeleteSession(S.sessionId),onCancelDelete:()=>e.onCancelDeleteSession(),now:e.now},S.sessionId))},x):null}),g.length===0?u.jsx("p",{className:"oc-tree-empty",children:"此工作区暂无会话。"}):null]}):null]})}function Lk(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(!1),[d,h]=w.useState(()=>Date.now()),m=w.useRef(null),p=w.useMemo(()=>{const H=a.trim().toLocaleLowerCase();return e.sessions.slice(0,j1).filter(I=>!H||(I.title||I.displayTitle||"未命名对话").toLocaleLowerCase().includes(H))},[e.sessions,a]);w.useEffect(()=>{const H=window.setInterval(()=>h(Date.now()),6e4);return()=>window.clearInterval(H)},[]);const[g,x]=w.useState(null),[y,S]=w.useState(null),T=w.useRef(null),N=w.useRef(!1),R=e.layoutMode==="comfortable"&&e.open,M=e.layoutMode==="compact",_=e.drawerOpen&&(e.layoutMode==="compact"||e.layoutMode==="narrow"),P=w.useCallback((H=!0)=>{if(y)return;const I=g;x(null),!(!H||!I)&&window.requestAnimationFrame(()=>{const K=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(I):I.replace(/["\\]/g,"\\$&");document.querySelector(`[data-session-delete-id="${K}"]`)?.focus()})},[y,g]),F=w.useCallback(()=>{y||(x(null),e.onCloseDrawer())},[y,e.onCloseDrawer]),A=w.useCallback(()=>{if(g){P();return}F()},[P,F,g]);Xl({open:_,containerRef:T,triggerRef:e.drawerTriggerRef,onEscape:A}),w.useEffect(()=>{N.current&&!_&&!y&&x(null),N.current=_},[y,_]),w.useEffect(()=>{g&&!p.some(H=>H.sessionId===g)&&x(null),y&&!p.some(H=>H.sessionId===y)&&S(null)},[y,g,p]),w.useEffect(()=>{if(_||!g)return;const H=I=>{I.key==="Escape"&&(I.preventDefault(),P())};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[P,g,_]);const L=w.useCallback(async H=>{if(!(y||g!==H)){S(H);try{await e.onDelete(H)}finally{S(null),x(null)}}},[y,g,e.onDelete]),Z=w.useCallback(()=>{y||(P(!1),e.onCreate())},[P,y,e.onCreate]),U=w.useCallback(H=>{y||(P(!1),e.onCreateInWorkspace?e.onCreateInWorkspace(H):e.onCreate())},[P,y,e.onCreateInWorkspace,e.onCreate]),$=w.useCallback(()=>{y||(P(!1),e.onToggleOpen())},[P,y,e.onToggleOpen]),[q,W]=w.useState(!1),oe=w.useCallback(async()=>{if(!(q||e.addingWorkspace)){W(!0);try{const H=await e.onPickWorkspaceDirectory();H&&await e.onAddWorkspace(H)}finally{W(!1)}}},[q,e.addingWorkspace,e.onAddWorkspace,e.onPickWorkspaceDirectory]),J=u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-sidebar-primary-actions",children:[u.jsxs("button",{type:"button",className:"oc-sidebar-new-session",onClick:Z,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:[u.jsx(Yu,{size:17,"aria-hidden":"true"}),e.creatingSession?"创建中…":"新会话"]}),e.layoutMode==="comfortable"?u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:$,"aria-expanded":!0,"aria-label":"收起侧栏",title:"收起侧栏",children:u.jsx(Um,{})}):u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:F,"aria-label":"关闭侧栏抽屉",title:"关闭",children:u.jsx(Ts,{size:16,"aria-hidden":"true"})})]}),u.jsxs("section",{className:"oc-sidebar-section oc-workspaces","aria-busy":e.workspacesLoading||void 0,"aria-label":"Workspace 与会话",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"工作区"}),u.jsxs("div",{className:"oc-sidebar-header-actions",children:[u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"搜索会话",title:"搜索会话","aria-expanded":t,"aria-controls":"oc-session-search",onClick:()=>n(H=>!H),children:u.jsx(qm,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"添加工作区",title:q?"选择目录中…":"添加工作区","aria-busy":q||void 0,disabled:q||e.addingWorkspace,onClick:()=>{oe()},children:u.jsx(Yu,{size:16,"aria-hidden":"true"})})]})]}),t?u.jsxs("div",{className:"oc-session-search-wrap",children:[u.jsx(qm,{size:15,"aria-hidden":"true"}),u.jsx("input",{id:"oc-session-search",type:"search",value:a,onChange:H=>s(H.target.value),placeholder:"搜索会话…","aria-label":"搜索会话",autoFocus:!0})]}):null,e.workspacesError?u.jsxs("p",{className:"oc-sidebar-error",role:"alert",children:[e.workspacesError," ",u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onDismissWorkspaceError,"aria-label":"关闭错误提示",children:u.jsx(Ts,{size:12,"aria-hidden":"true"})})]}):null,u.jsx("div",{className:"oc-workspace-list",children:e.workspacesLoading&&e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-loading",children:"正在加载 Workspace…"}):e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-empty",children:"还没有工作区。点击右上角的 + 选择一个文件夹开始。"}):e.workspaces.map(H=>u.jsx(jk,{workspace:H,active:e.activeWorkspaceId===H.workspaceId,removing:e.removingWorkspaceId===H.workspaceId,sessions:p,activeSessionId:e.activeSessionId,activeSessionStreaming:e.activeSessionStreaming,activeSessionTurnPhase:e.activeSessionTurnPhase,creatingSession:e.creatingSession,pendingDeleteSessionId:g,deletingSessionId:y,cancelDelete:P,onActivateWorkspaceRow:()=>e.onActivateWorkspace(H.workspaceId),onRemove:()=>e.onRemoveWorkspace(H.workspaceId),onCreateSession:()=>U(H.workspaceId),onActivate:I=>{y||(P(!1),e.onActivate(I))},onRenameSession:e.onRename,onSetSessionState:e.onSetState,onRequestDeleteSession:I=>{y||x(I.sessionId)},onConfirmDeleteSession:I=>{L(I)},onCancelDeleteSession:()=>P(),now:d},H.workspaceId))})]}),u.jsx("div",{className:"oc-sidebar-footer",children:u.jsxs("button",{type:"button",ref:m,className:"oc-sidebar-settings",onClick:()=>c(!0),"aria-label":"打开设置",title:"设置",children:[u.jsx(e5,{size:16,"aria-hidden":"true"}),"设置"]})}),u.jsx(kk,{open:o,origin:e.origin,onClose:()=>c(!1),triggerRef:m})]});return u.jsxs(u.Fragment,{children:[M?u.jsxs("nav",{className:"oc-sidebar-rail","aria-label":"紧凑侧栏",children:[u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"打开 Workspace 与会话",title:"Workspace 与会话","aria-expanded":_,onClick:()=>_?F():e.onOpenDrawer(),children:u.jsx(Ak,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":e.creatingSession?"创建会话中":"新建会话",title:e.creatingSession?"创建中…":"新建会话",onClick:Z,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:u.jsx(Ik,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"Workspace",title:"Workspace",onClick:()=>_?F():e.onOpenDrawer(),children:u.jsx(l5,{})})]}):null,e.layoutMode==="comfortable"?u.jsx("aside",{className:`oc-sidebar${R?"":" is-collapsed"}`,"aria-label":"Workspace 与会话",children:R?J:u.jsx("button",{type:"button",className:"oc-sidebar-toggle is-collapsed",onClick:$,"aria-expanded":!1,"aria-label":"展开侧栏",title:"展开侧栏",children:u.jsx(Um,{})})}):null,_?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-overlay-backdrop","aria-label":"关闭侧栏遮罩",onClick:F}),u.jsx("aside",{ref:T,className:"oc-sidebar oc-sidebar-drawer","aria-label":"Workspace 与会话抽屉",role:"dialog","aria-modal":"true",tabIndex:-1,children:J})]}):null]})}const zk="modulepreload",Bk=function(e){return"/"+e},kb={},qk=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let h=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=h(n.map(m=>{if(m=Bk(m),m in kb)return;kb[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":zk,p||(x.as="script"),x.crossOrigin="",x.href=m,d&&x.setAttribute("nonce",d),document.head.appendChild(x),p)return new Promise((y,S)=>{x.addEventListener("load",y),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function Sb(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(s,a).trim();(c||!o)&&t.push(c),s=a+1,a=n.indexOf(",",s)}return t}function Hk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Uk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$k={};function Eb(e,t){return($k.jsx?Fk:Uk).test(e)}const Pk=/[ \t\n\f\r]/g;function Gk(e){return typeof e=="object"?e.type==="text"?Tb(e.value):!1:Tb(e)}function Tb(e){return e.replace(Pk,"")===""}class Jl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Jl.prototype.normal={};Jl.prototype.property={};Jl.prototype.space=void 0;function h5(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Jl(n,a,t)}function Fl(e){return e.toLowerCase()}class _r{constructor(t,n){this.attribute=n,this.property=t}}_r.prototype.attribute="";_r.prototype.booleanish=!1;_r.prototype.boolean=!1;_r.prototype.commaOrSpaceSeparated=!1;_r.prototype.commaSeparated=!1;_r.prototype.defined=!1;_r.prototype.mustUseProperty=!1;_r.prototype.number=!1;_r.prototype.overloadedBoolean=!1;_r.prototype.property="";_r.prototype.spaceSeparated=!1;_r.prototype.space=void 0;let Vk=0;const yt=Rs(),Bn=Rs(),Fm=Rs(),je=Rs(),cn=Rs(),Ss=Rs(),Ur=Rs();function Rs(){return 2**++Vk}const $m=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Bn,commaOrSpaceSeparated:Ur,commaSeparated:Ss,number:je,overloadedBoolean:Fm,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),Wf=Object.keys($m);class z1 extends _r{constructor(t,n,a,s){let o=-1;if(super(t,n),Cb(this,"space",s),typeof a=="number")for(;++o<Wf.length;){const c=Wf[o];Cb(this,Wf[o],(a&$m[c])===$m[c])}}}z1.prototype.defined=!0;function Cb(e,t,n){n&&(e[t]=n)}function ko(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new z1(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Fl(a)]=a,n[Fl(o.attribute)]=a}return new Jl(t,n,e.space)}const m5=ko({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:cn,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:je,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:cn,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:Bn,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function p5(e,t){return t in e?e[t]:t}function g5(e,t){return p5(e,t.toLowerCase())}const Kk=ko({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alpha:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:cn,autoFocus:yt,autoPlay:yt,blocking:cn,capture:null,charSet:null,checked:yt,cite:null,className:cn,closedBy:null,colorSpace:null,cols:je,colSpan:je,command:null,commandFor:null,content:null,contentEditable:Bn,controls:yt,controlsList:cn,coords:je|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Fm,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:cn,height:je,hidden:Fm,high:je,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:cn,itemRef:cn,itemScope:yt,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:je,pattern:null,ping:cn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:cn,required:yt,reversed:yt,rows:je,rowSpan:je,sandbox:cn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootCustomElementRegistry:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shadowRootSerializable:yt,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Bn,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:yt,disablePictureInPicture:yt,disableRemotePlayback:yt,exportParts:Ss,part:cn,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:g5}),Yk=ko({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",maskType:"mask-type",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:Ur,accentHeight:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:cn,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:Ss,g2:Ss,glyphName:Ss,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ur,rev:Ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ur,requiredFeatures:Ur,requiredFonts:Ur,requiredFormats:Ur,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ur,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:p5}),b5=ko({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),v5=ko({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:g5}),y5=ko({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Wk={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"},Zk=/[A-Z]/g,Nb=/-[a-z]/g,Xk=/^data[-\w.:]+$/i;function x5(e,t){const n=Fl(t);let a=t,s=_r;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Xk.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nb,Jk);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nb.test(o)){let c=o.replace(Zk,Qk);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=z1}return new s(a,t)}function Qk(e){return"-"+e.toLowerCase()}function Jk(e){return e.charAt(1).toUpperCase()}const w5=h5([m5,Kk,b5,v5,y5],"html"),md=h5([m5,Yk,b5,v5,y5],"svg");function Rb(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function eS(e){return e.join(" ").trim()}var co={},Zf,Ab;function tS(){if(Ab)return Zf;Ab=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
20
+ `,m="/",p="*",g="",x="comment",y="declaration";function S(N,R){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];R=R||{};var M=1,_=1;function P(J){var H=J.match(t);H&&(M+=H.length);var I=J.lastIndexOf(h);_=~I?J.length-I:_+J.length}function F(){var J={line:M,column:_};return function(H){return H.position=new A(J),U(),H}}function A(J){this.start=J,this.end={line:M,column:_},this.source=R.source}A.prototype.content=N;function L(J){var H=new Error(R.source+":"+M+":"+_+": "+J);if(H.reason=J,H.filename=R.source,H.line=M,H.column=_,H.source=N,!R.silent)throw H}function Z(J){var H=J.exec(N);if(H){var I=H[0];return P(I),N=N.slice(I.length),H}}function U(){Z(n)}function $(J){var H;for(J=J||[];H=q();)H!==!1&&J.push(H);return J}function q(){var J=F();if(!(m!=N.charAt(0)||p!=N.charAt(1))){for(var H=2;g!=N.charAt(H)&&(p!=N.charAt(H)||m!=N.charAt(H+1));)++H;if(H+=2,g===N.charAt(H-1))return L("End of comment missing");var I=N.slice(2,H-2);return _+=2,P(I),N=N.slice(H),_+=2,J({type:x,comment:I})}}function W(){var J=F(),H=Z(a);if(H){if(q(),!Z(s))return L("property missing ':'");var I=Z(o),K=J({type:y,property:T(H[0].replace(e,g)),value:I?T(I[0].replace(e,g)):g});return Z(c),K}}function oe(){var J=[];$(J);for(var H;H=W();)H!==!1&&(J.push(H),$(J));return J}return U(),oe()}function T(N){return N?N.replace(d,g):g}return Zf=S,Zf}var Ib;function nS(){if(Ib)return co;Ib=1;var e=co&&co.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(co,"__esModule",{value:!0}),co.default=n;const t=e(tS());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof s=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:p}=h;d?s(m,p,h):p&&(o=o||{},o[m]=p)}),o}return co}var xl={},_b;function rS(){if(_b)return xl;_b=1,Object.defineProperty(xl,"__esModule",{value:!0}),xl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},c=function(m,p){return p.toUpperCase()},d=function(m,p){return"".concat(p,"-")},h=function(m,p){return p===void 0&&(p={}),o(m)?m:(m=m.toLowerCase(),p.reactCompat?m=m.replace(s,d):m=m.replace(a,d),m.replace(t,c))};return xl.camelCase=h,xl}var wl,Mb;function aS(){if(Mb)return wl;Mb=1;var e=wl&&wl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(nS()),n=rS();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(d,h){d&&h&&(c[(0,n.camelCase)(d,o)]=h)}),c}return a.default=a,wl=a,wl}var iS=aS();const sS=dd(iS),k5=S5("end"),B1=S5("start");function S5(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function oS(e){const t=B1(e),n=k5(e);if(t&&n)return{start:t,end:n}}function _l(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ob(e.position):"start"in e||"end"in e?Ob(e):"line"in e||"column"in e?Pm(e):""}function Pm(e){return Db(e&&e.line)+":"+Db(e&&e.column)}function Ob(e){return Pm(e&&e.start)+"-"+Pm(e&&e.end)}function Db(e){return e&&typeof e=="number"?e:1}class ur extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(c=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const d=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=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=_l(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=c&&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}}ur.prototype.file="";ur.prototype.name="";ur.prototype.reason="";ur.prototype.message="";ur.prototype.stack="";ur.prototype.column=void 0;ur.prototype.line=void 0;ur.prototype.ancestors=void 0;ur.prototype.cause=void 0;ur.prototype.fatal=void 0;ur.prototype.place=void 0;ur.prototype.ruleId=void 0;ur.prototype.source=void 0;const q1={}.hasOwnProperty,lS=new Map,cS=/[A-Z]/g,uS=new Set(["table","tbody","thead","tfoot","tr"]),dS=new Set(["td","th"]),E5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=xS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=yS(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?md:w5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=T5(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function T5(e,t,n){if(t.type==="element")return hS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return mS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gS(e,t,n);if(t.type==="mdxjsEsm")return pS(e,t);if(t.type==="root")return bS(e,t,n);if(t.type==="text")return vS(e,t)}function hS(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=md,e.schema=s),e.ancestors.push(t);const o=N5(e,t.tagName,!1),c=wS(e,t);let d=U1(e,t);return uS.has(t.tagName)&&(d=d.filter(function(h){return typeof h=="string"?!Gk(h):!0})),C5(e,c,o,t),H1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function mS(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}$l(e,t.position)}function pS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$l(e,t.position)}function gS(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=md,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:N5(e,t.name,!0),c=kS(e,t),d=U1(e,t);return C5(e,c,o,t),H1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function bS(e,t,n){const a={};return H1(a,U1(e,t)),e.create(t,e.Fragment,a,n)}function vS(e,t){return t.value}function C5(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function H1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function yS(e,t,n){return a;function a(s,o,c,d){const m=Array.isArray(c.children)?n:t;return d?m(o,c,d):m(o,c)}}function xS(e,t){return n;function n(a,s,o,c){const d=Array.isArray(o.children),h=B1(a);return t(s,o,c,d,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function wS(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&q1.call(t.properties,s)){const o=SS(e,s,t.properties[s]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&dS.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function kS(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else $l(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else $l(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function U1(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:lS;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const m=s.get(h)||0;c=h+"-"+m,s.set(h,m+1)}}const d=T5(e,o,c);d!==void 0&&n.push(d)}return n}function SS(e,t,n){const a=x5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Hk(n):eS(n)),a.property==="style"){let s=typeof n=="object"?n:ES(e,String(n));return e.stylePropertyNameCase==="css"&&(s=TS(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?Wk[a.property]||a.property:a.attribute,n]}}function ES(e,t){try{return sS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new ur("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=E5+"#cannot-parse-style-attribute",s}}function N5(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const d=Eb(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Eb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return q1.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);$l(e)}function $l(e,t){const n=new ur("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=E5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function TS(e){const t={};let n;for(n in e)q1.call(e,n)&&(t[CS(n)]=e[n]);return t}function CS(e){let t=e.replace(cS,NS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function NS(e){return"-"+e.toLowerCase()}const Xf={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"]},RS={};function F1(e,t){const n=RS,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return R5(e,a,s)}function R5(e,t,n){if(AS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return jb(e.children,t,n)}return Array.isArray(e)?jb(e,t,n):""}function jb(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=R5(e[s],t,n);return a.join("")}function AS(e){return!!(e&&typeof e=="object")}const Lb=document.createElement("i");function $1(e){const t="&"+e+";";Lb.innerHTML=t;const n=Lb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Fr(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function aa(e,t){return e.length>0?(Fr(e,e.length,0,t),e):t}const zb={}.hasOwnProperty;function A5(e){const t={};let n=-1;for(;++n<e.length;)IS(t,e[n]);return t}function IS(e,t){let n;for(n in t){const s=(zb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){zb.call(s,c)||(s[c]=[]);const d=o[c];_S(s[c],Array.isArray(d)?d:d?[d]:[])}}}function _S(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Fr(e,0,0,a)}function I5(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ga(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gr=Wi(/[A-Za-z]/),lr=Wi(/[\dA-Za-z]/),MS=Wi(/[#-'*+\--9=?A-Z^-~]/);function Xu(e){return e!==null&&(e<32||e===127)}const Gm=Wi(/\d/),OS=Wi(/[\dA-Fa-f]/),DS=Wi(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function zt(e){return e===-2||e===-1||e===32}const pd=Wi(new RegExp("\\p{P}|\\p{S}","u")),Cs=Wi(/\s/);function Wi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function So(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&lr(e.charCodeAt(n+1))&&lr(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Ot(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(h){return zt(h)?(e.enter(n),d(h)):t(h)}function d(h){return zt(h)&&o++<s?(e.consume(h),d):(e.exit(n),t(h))}}const jS={tokenize:LS};function LS(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ot(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return nt(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const zS={tokenize:BS},Bb={tokenize:qS};function BS(e){const t=this,n=[];let a=0,s,o,c;return d;function d(_){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,h,m)(_)}return m(_)}function h(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&M();const P=t.events.length;let F=P,A;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){A=t.events[F][1].end;break}R(a);let L=P;for(;L<t.events.length;)t.events[L][1].end={...A},L++;return Fr(t.events,F+1,0,t.events.slice(P)),t.events.length=L,m(_)}return d(_)}function m(_){if(a===n.length){if(!s)return x(_);if(s.currentConstruct&&s.currentConstruct.concrete)return S(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Bb,p,g)(_)}function p(_){return s&&M(),R(a),x(_)}function g(_){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(_)}function x(_){return t.containerState={},e.attempt(Bb,y,S)(_)}function y(_){return a++,n.push([t.currentConstruct,t.containerState]),x(_)}function S(_){if(_===null){s&&M(),R(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),T(_)}function T(_){if(_===null){N(e.exit("chunkFlow"),!0),R(0),e.consume(_);return}return nt(_)?(e.consume(_),N(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(_),T)}function N(_,P){const F=t.sliceStream(_);if(P&&F.push(null),_.previous=o,o&&(o.next=_),o=_,s.defineSkip(_.start),s.write(F),t.parser.lazy[_.start.line]){let A=s.events.length;for(;A--;)if(s.events[A][1].start.offset<c&&(!s.events[A][1].end||s.events[A][1].end.offset>c))return;const L=t.events.length;let Z=L,U,$;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(U){$=t.events[Z][1].end;break}U=!0}for(R(a),A=L;A<t.events.length;)t.events[A][1].end={...$},A++;Fr(t.events,Z+1,0,t.events.slice(L)),t.events.length=A}}function R(_){let P=n.length;for(;P-- >_;){const F=n[P];t.containerState=F[1],F[0].exit.call(t,e)}n.length=_}function M(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function qS(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bo(e){if(e===null||un(e)||Cs(e))return 1;if(pd(e))return 2}function gd(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Vm={name:"attention",resolveAll:HS,tokenize:US};function HS(e,t){let n=-1,a,s,o,c,d,h,m,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};qb(g,-h),qb(x,h),c={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},d={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=aa(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=aa(m,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),m=aa(m,gd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=aa(m,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,m=aa(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Fr(e,a-1,n-a+3,m),n=a+m.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function US(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=bo(a);let o;return c;function c(h){return o=h,e.enter("attentionSequence"),d(h)}function d(h){if(h===o)return e.consume(h),d;const m=e.exit("attentionSequence"),p=bo(h),g=!p||p===2&&s||n.includes(h),x=!s||s===2&&p||n.includes(a);return m._open=!!(o===42?g:g&&(s||!x)),m._close=!!(o===42?x:x&&(p||!g)),t(h)}}function qb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const FS={name:"autolink",tokenize:$S};function $S(e,t,n){let a=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return gr(y)?(e.consume(y),c):y===64?n(y):m(y)}function c(y){return y===43||y===45||y===46||lr(y)?(a=1,d(y)):m(y)}function d(y){return y===58?(e.consume(y),a=0,h):(y===43||y===45||y===46||lr(y))&&a++<32?(e.consume(y),d):(a=0,m(y))}function h(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Xu(y)?n(y):(e.consume(y),h)}function m(y){return y===64?(e.consume(y),p):MS(y)?(e.consume(y),m):n(y)}function p(y){return lr(y)?g(y):n(y)}function g(y){return y===46?(e.consume(y),a=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):x(y)}function x(y){if((y===45||lr(y))&&a++<63){const S=y===45?x:g;return e.consume(y),S}return n(y)}}const ec={partial:!0,tokenize:PS};function PS(e,t,n){return a;function a(o){return zt(o)?Ot(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||nt(o)?t(o):n(o)}}const _5={continuation:{tokenize:VS},exit:KS,name:"blockQuote",tokenize:GS};function GS(e,t,n){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return zt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function VS(e,t,n){const a=this;return s;function s(c){return zt(c)?Ot(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(_5,t,n)(c)}}function KS(e){e.exit("blockQuote")}const M5={name:"characterEscape",tokenize:YS};function YS(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return DS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const O5={name:"characterReference",tokenize:WS};function WS(e,t,n){const a=this;let s=0,o,c;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),o=31,c=lr,p(g))}function m(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=OS,p):(e.enter("characterReferenceValue"),o=7,c=Gm,p(g))}function p(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return c===lr&&!$1(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&s++<o?(e.consume(g),p):n(g)}}const Hb={partial:!0,tokenize:XS},Ub={concrete:!0,name:"codeFenced",tokenize:ZS};function ZS(e,t,n){const a=this,s={partial:!0,tokenize:F};let o=0,c=0,d;return h;function h(A){return m(A)}function m(A){const L=a.events[a.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,d=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===d?(c++,e.consume(A),p):c<3?n(A):(e.exit("codeFencedFenceSequence"),zt(A)?Ot(e,g,"whitespace")(A):g(A))}function g(A){return A===null||nt(A)?(e.exit("codeFencedFence"),a.interrupt?t(A):e.check(Hb,T,P)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(A))}function x(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(A)):zt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,y,"whitespace")(A)):A===96&&A===d?n(A):(e.consume(A),x)}function y(A){return A===null||nt(A)?g(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(A))}function S(A){return A===null||nt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(A)):A===96&&A===d?n(A):(e.consume(A),S)}function T(A){return e.attempt(s,P,N)(A)}function N(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),R}function R(A){return o>0&&zt(A)?Ot(e,M,"linePrefix",o+1)(A):M(A)}function M(A){return A===null||nt(A)?e.check(Hb,T,P)(A):(e.enter("codeFlowValue"),_(A))}function _(A){return A===null||nt(A)?(e.exit("codeFlowValue"),M(A)):(e.consume(A),_)}function P(A){return e.exit("codeFenced"),t(A)}function F(A,L,Z){let U=0;return $;function $(H){return A.enter("lineEnding"),A.consume(H),A.exit("lineEnding"),q}function q(H){return A.enter("codeFencedFence"),zt(H)?Ot(A,W,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):W(H)}function W(H){return H===d?(A.enter("codeFencedFenceSequence"),oe(H)):Z(H)}function oe(H){return H===d?(U++,A.consume(H),oe):U>=c?(A.exit("codeFencedFenceSequence"),zt(H)?Ot(A,J,"whitespace")(H):J(H)):Z(H)}function J(H){return H===null||nt(H)?(A.exit("codeFencedFence"),L(H)):Z(H)}}}function XS(e,t,n){const a=this;return s;function s(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Qf={name:"codeIndented",tokenize:JS},QS={partial:!0,tokenize:eE};function JS(e,t,n){const a=this;return s;function s(m){return e.enter("codeIndented"),Ot(e,o,"linePrefix",5)(m)}function o(m){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?h(m):nt(m)?e.attempt(QS,c,h)(m):(e.enter("codeFlowValue"),d(m))}function d(m){return m===null||nt(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),d)}function h(m){return e.exit("codeIndented"),t(m)}}function eE(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):nt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):Ot(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):nt(c)?s(c):n(c)}}const tE={name:"codeText",previous:rE,resolve:nE,tokenize:aE};function nE(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function rE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function aE(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),a++,d):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(o=e.enter("codeTextSequence"),s=0,p(g)):nt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(g))}function m(g){return g===null||g===32||g===96||nt(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),m)}function p(g){return g===96?(e.consume(g),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",m(g))}}class iE{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&kl(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kl(this.left,n.reverse())}}}function kl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function D5(e){const t={};let n=-1,a,s,o,c,d,h,m;const p=new iE(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,sE(p,n)),n=t[n],m=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},d=p.slice(s,n),d.unshift(a),p.splice(s,n-s+1,d))}}return Fr(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!m}function sE(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,h=[],m={};let p,g,x=-1,y=n,S=0,T=0;const N=[T];for(;y;){for(;e.get(++s)[1]!==y;);o.push(s),y._tokenizer||(p=a.sliceStream(y),y.next||p.push(null),g&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=y,y=y.next}for(y=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(T=x+1,N.push(T),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):N.pop(),x=N.length;x--;){const R=d.slice(N[x],N[x+1]),M=o.pop();h.push([M,M+R.length-1]),e.splice(M,2,R)}for(h.reverse(),x=-1;++x<h.length;)m[S+h[x][0]]=S+h[x][1],S+=h[x][1]-h[x][0]-1;return m}const oE={resolve:cE,tokenize:uE},lE={partial:!0,tokenize:dE};function cE(e){return D5(e),e}function uE(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):nt(d)?e.check(lE,c,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function dE(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ot(e,o,"linePrefix")}function o(c){if(c===null||nt(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function j5(e,t,n,a,s,o,c,d,h){const m=h||Number.POSITIVE_INFINITY;let p=0;return g;function g(R){return R===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(R),e.exit(o),x):R===null||R===32||R===41||Xu(R)?n(R):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(R))}function x(R){return R===62?(e.enter(o),e.consume(R),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===62?(e.exit("chunkString"),e.exit(d),x(R)):R===null||R===60||nt(R)?n(R):(e.consume(R),R===92?S:y)}function S(R){return R===60||R===62||R===92?(e.consume(R),y):y(R)}function T(R){return!p&&(R===null||R===41||un(R))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(R)):p<m&&R===40?(e.consume(R),p++,T):R===41?(e.consume(R),p--,T):R===null||R===32||R===40||Xu(R)?n(R):(e.consume(R),R===92?N:T)}function N(R){return R===40||R===41||R===92?(e.consume(R),T):T(R)}}function L5(e,t,n,a,s,o){const c=this;let d=0,h;return m;function m(y){return e.enter(a),e.enter(s),e.consume(y),e.exit(s),e.enter(o),p}function p(y){return d>999||y===null||y===91||y===93&&!h||y===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(o),e.enter(s),e.consume(y),e.exit(s),e.exit(a),t):nt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===null||y===91||y===93||nt(y)||d++>999?(e.exit("chunkString"),p(y)):(e.consume(y),h||(h=!zt(y)),y===92?x:g)}function x(y){return y===91||y===92||y===93?(e.consume(y),d++,g):g(y)}}function z5(e,t,n,a,s,o){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,h):n(x)}function h(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),m(x))}function m(x){return x===c?(e.exit(o),h(c)):x===null?n(x):nt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ot(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===c||x===null||nt(x)?(e.exit("chunkString"),m(x)):(e.consume(x),x===92?g:p)}function g(x){return x===c||x===92?(e.consume(x),p):p(x)}}function Ml(e,t){let n;return a;function a(s){return nt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):zt(s)?Ot(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const fE={name:"definition",tokenize:mE},hE={partial:!0,tokenize:pE};function mE(e,t,n){const a=this;let s;return o;function o(y){return e.enter("definition"),c(y)}function c(y){return L5.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function d(y){return s=ga(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),h):n(y)}function h(y){return un(y)?Ml(e,m)(y):m(y)}function m(y){return j5(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(hE,g,g)(y)}function g(y){return zt(y)?Ot(e,x,"whitespace")(y):x(y)}function x(y){return y===null||nt(y)?(e.exit("definition"),a.parser.defined.push(s),t(y)):n(y)}}function pE(e,t,n){return a;function a(d){return un(d)?Ml(e,s)(d):n(d)}function s(d){return z5(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return zt(d)?Ot(e,c,"whitespace")(d):c(d)}function c(d){return d===null||nt(d)?t(d):n(d)}}const gE={name:"hardBreakEscape",tokenize:bE};function bE(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return nt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const vE={name:"headingAtx",resolve:yE,tokenize:xE};function yE(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Fr(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function xE(e,t,n){let a=0;return s;function s(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||un(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),h(p)):p===null||nt(p)?(e.exit("atxHeading"),t(p)):zt(p)?Ot(e,d,"whitespace")(p):(e.enter("atxHeadingText"),m(p))}function h(p){return p===35?(e.consume(p),h):(e.exit("atxHeadingSequence"),d(p))}function m(p){return p===null||p===35||un(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),m)}}const wE=["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"],Fb=["pre","script","style","textarea"],kE={concrete:!0,name:"htmlFlow",resolveTo:TE,tokenize:CE},SE={partial:!0,tokenize:RE},EE={partial:!0,tokenize:NE};function TE(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function CE(e,t,n){const a=this;let s,o,c,d,h;return m;function m(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),g}function g(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),o=!0,T):D===63?(e.consume(D),s=3,a.interrupt?t:j):gr(D)?(e.consume(D),c=String.fromCharCode(D),N):n(D)}function x(D){return D===45?(e.consume(D),s=2,y):D===91?(e.consume(D),s=5,d=0,S):gr(D)?(e.consume(D),s=4,a.interrupt?t:j):n(D)}function y(D){return D===45?(e.consume(D),a.interrupt?t:j):n(D)}function S(D){const ye="CDATA[";return D===ye.charCodeAt(d++)?(e.consume(D),d===ye.length?a.interrupt?t:W:S):n(D)}function T(D){return gr(D)?(e.consume(D),c=String.fromCharCode(D),N):n(D)}function N(D){if(D===null||D===47||D===62||un(D)){const ye=D===47,se=c.toLowerCase();return!ye&&!o&&Fb.includes(se)?(s=1,a.interrupt?t(D):W(D)):wE.includes(c.toLowerCase())?(s=6,ye?(e.consume(D),R):a.interrupt?t(D):W(D)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(D):o?M(D):_(D))}return D===45||lr(D)?(e.consume(D),c+=String.fromCharCode(D),N):n(D)}function R(D){return D===62?(e.consume(D),a.interrupt?t:W):n(D)}function M(D){return zt(D)?(e.consume(D),M):$(D)}function _(D){return D===47?(e.consume(D),$):D===58||D===95||gr(D)?(e.consume(D),P):zt(D)?(e.consume(D),_):$(D)}function P(D){return D===45||D===46||D===58||D===95||lr(D)?(e.consume(D),P):F(D)}function F(D){return D===61?(e.consume(D),A):zt(D)?(e.consume(D),F):_(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),h=D,L):zt(D)?(e.consume(D),A):Z(D)}function L(D){return D===h?(e.consume(D),h=null,U):D===null||nt(D)?n(D):(e.consume(D),L)}function Z(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||un(D)?F(D):(e.consume(D),Z)}function U(D){return D===47||D===62||zt(D)?_(D):n(D)}function $(D){return D===62?(e.consume(D),q):n(D)}function q(D){return D===null||nt(D)?W(D):zt(D)?(e.consume(D),q):n(D)}function W(D){return D===45&&s===2?(e.consume(D),I):D===60&&s===1?(e.consume(D),K):D===62&&s===4?(e.consume(D),G):D===63&&s===3?(e.consume(D),j):D===93&&s===5?(e.consume(D),be):nt(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(SE,Y,oe)(D)):D===null||nt(D)?(e.exit("htmlFlowData"),oe(D)):(e.consume(D),W)}function oe(D){return e.check(EE,J,Y)(D)}function J(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),H}function H(D){return D===null||nt(D)?oe(D):(e.enter("htmlFlowData"),W(D))}function I(D){return D===45?(e.consume(D),j):W(D)}function K(D){return D===47?(e.consume(D),c="",X):W(D)}function X(D){if(D===62){const ye=c.toLowerCase();return Fb.includes(ye)?(e.consume(D),G):W(D)}return gr(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),X):W(D)}function be(D){return D===93?(e.consume(D),j):W(D)}function j(D){return D===62?(e.consume(D),G):D===45&&s===2?(e.consume(D),j):W(D)}function G(D){return D===null||nt(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),G)}function Y(D){return e.exit("htmlFlow"),t(D)}}function NE(e,t,n){const a=this;return s;function s(c){return nt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function RE(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(ec,t,n)}}const AE={name:"htmlText",tokenize:IE};function IE(e,t,n){const a=this;let s,o,c;return d;function d(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),m):j===47?(e.consume(j),F):j===63?(e.consume(j),_):gr(j)?(e.consume(j),Z):n(j)}function m(j){return j===45?(e.consume(j),p):j===91?(e.consume(j),o=0,S):gr(j)?(e.consume(j),M):n(j)}function p(j){return j===45?(e.consume(j),y):n(j)}function g(j){return j===null?n(j):j===45?(e.consume(j),x):nt(j)?(c=g,K(j)):(e.consume(j),g)}function x(j){return j===45?(e.consume(j),y):g(j)}function y(j){return j===62?I(j):j===45?x(j):g(j)}function S(j){const G="CDATA[";return j===G.charCodeAt(o++)?(e.consume(j),o===G.length?T:S):n(j)}function T(j){return j===null?n(j):j===93?(e.consume(j),N):nt(j)?(c=T,K(j)):(e.consume(j),T)}function N(j){return j===93?(e.consume(j),R):T(j)}function R(j){return j===62?I(j):j===93?(e.consume(j),R):T(j)}function M(j){return j===null||j===62?I(j):nt(j)?(c=M,K(j)):(e.consume(j),M)}function _(j){return j===null?n(j):j===63?(e.consume(j),P):nt(j)?(c=_,K(j)):(e.consume(j),_)}function P(j){return j===62?I(j):_(j)}function F(j){return gr(j)?(e.consume(j),A):n(j)}function A(j){return j===45||lr(j)?(e.consume(j),A):L(j)}function L(j){return nt(j)?(c=L,K(j)):zt(j)?(e.consume(j),L):I(j)}function Z(j){return j===45||lr(j)?(e.consume(j),Z):j===47||j===62||un(j)?U(j):n(j)}function U(j){return j===47?(e.consume(j),I):j===58||j===95||gr(j)?(e.consume(j),$):nt(j)?(c=U,K(j)):zt(j)?(e.consume(j),U):I(j)}function $(j){return j===45||j===46||j===58||j===95||lr(j)?(e.consume(j),$):q(j)}function q(j){return j===61?(e.consume(j),W):nt(j)?(c=q,K(j)):zt(j)?(e.consume(j),q):U(j)}function W(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),s=j,oe):nt(j)?(c=W,K(j)):zt(j)?(e.consume(j),W):(e.consume(j),J)}function oe(j){return j===s?(e.consume(j),s=void 0,H):j===null?n(j):nt(j)?(c=oe,K(j)):(e.consume(j),oe)}function J(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||un(j)?U(j):(e.consume(j),J)}function H(j){return j===47||j===62||un(j)?U(j):n(j)}function I(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function K(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),X}function X(j){return zt(j)?Ot(e,be,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):be(j)}function be(j){return e.enter("htmlTextData"),c(j)}}const P1={name:"labelEnd",resolveAll:DE,resolveTo:jE,tokenize:LE},_E={tokenize:zE},ME={tokenize:BE},OE={tokenize:qE};function DE(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Fr(e,0,e.length,n),e}function jE(e,t){let n=e.length,a=0,s,o,c,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",h,t],["enter",m,t]],d=aa(d,e.slice(o+1,o+a+3)),d=aa(d,[["enter",p,t]]),d=aa(d,gd(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=aa(d,[["exit",p,t],e[c-2],e[c-1],["exit",m,t]]),d=aa(d,e.slice(c+1)),d=aa(d,[["exit",h,t]]),Fr(e,o,e.length,d),e}function LE(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?g(x):(c=a.parser.defined.includes(ga(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):n(x)}function h(x){return x===40?e.attempt(_E,p,c?p:g)(x):x===91?e.attempt(ME,p,c?m:g)(x):c?p(x):g(x)}function m(x){return e.attempt(OE,p,g)(x)}function p(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function zE(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return un(g)?Ml(e,o)(g):o(g)}function o(g){return g===41?p(g):j5(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return un(g)?Ml(e,h)(g):p(g)}function d(g){return n(g)}function h(g){return g===34||g===39||g===40?z5(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function m(g){return un(g)?Ml(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function BE(e,t,n){const a=this;return s;function s(d){return L5.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(ga(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function qE(e,t,n){return a;function a(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"),t):n(o)}}const HE={name:"labelStartImage",resolveAll:P1.resolveAll,tokenize:UE};function UE(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const FE={name:"labelStartLink",resolveAll:P1.resolveAll,tokenize:$E};function $E(e,t,n){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Jf={name:"lineEnding",tokenize:PE};function PE(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const Hu={name:"thematicBreak",tokenize:GE};function GE(e,t,n){let a=0,s;return o;function o(m){return e.enter("thematicBreak"),c(m)}function c(m){return s=m,d(m)}function d(m){return m===s?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||nt(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===s?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),zt(m)?Ot(e,d,"whitespace")(m):d(m))}}const Rr={continuation:{tokenize:WE},exit:XE,name:"list",tokenize:YE},VE={partial:!0,tokenize:QE},KE={partial:!0,tokenize:ZE};function YE(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(y){const S=a.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||y===a.containerState.marker:Gm(y)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Hu,n,m)(y):m(y);if(!a.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(y)}return n(y)}function h(y){return Gm(y)&&++c<10?(e.consume(y),h):(!a.interrupt||c<2)&&(a.containerState.marker?y===a.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),m(y)):n(y)}function m(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||y,e.check(ec,a.interrupt?n:p,e.attempt(VE,x,g))}function p(y){return a.containerState.initialBlankLine=!0,o++,x(y)}function g(y){return zt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):n(y)}function x(y){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function WE(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(ec,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Ot(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!zt(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(KE,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Ot(e,e.attempt(Rr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function ZE(e,t,n){const a=this;return Ot(e,s,"listItemIndent",a.containerState.size+1);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function XE(e){e.exit(this.containerState.type)}function QE(e,t,n){const a=this;return Ot(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!zt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $b={name:"setextUnderline",resolveTo:JE,tokenize:eT};function JE(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function eT(e,t,n){const a=this;let s;return o;function o(m){let p=a.events.length,g;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){g=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),d(m)}function d(m){return m===s?(e.consume(m),d):(e.exit("setextHeadingLineSequence"),zt(m)?Ot(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||nt(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const tT={tokenize:nT};function nT(e){const t=this,n=e.attempt(ec,a,e.attempt(this.parser.constructs.flowInitial,s,Ot(e,e.attempt(this.parser.constructs.flow,s,e.attempt(oE,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rT={resolveAll:q5()},aT=B5("string"),iT=B5("text");function B5(e){return{resolveAll:q5(e==="text"?sT:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,d);return c;function c(p){return m(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),h}function h(p){return m(p)?(n.exit("data"),o(p)):(n.consume(p),h)}function m(p){if(p===null)return!0;const g=s[p];let x=-1;if(g)for(;++x<g.length;){const y=g[x];if(!y.previous||y.previous.call(a,a.previous))return!0}return!1}}}function q5(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function sT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let o=s.length,c=-1,d=0,h;for(;o--;){const m=s[o];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(m===-2)h=!0,d++;else if(m!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const m={type:n===e.length||h||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const oT={42:Rr,43:Rr,45:Rr,48:Rr,49:Rr,50:Rr,51:Rr,52:Rr,53:Rr,54:Rr,55:Rr,56:Rr,57:Rr,62:_5},lT={91:fE},cT={[-2]:Qf,[-1]:Qf,32:Qf},uT={35:vE,42:Hu,45:[$b,Hu],60:kE,61:$b,95:Hu,96:Ub,126:Ub},dT={38:O5,92:M5},fT={[-5]:Jf,[-4]:Jf,[-3]:Jf,33:HE,38:O5,42:Vm,60:[FS,AE],91:FE,92:[gE,M5],93:P1,95:Vm,96:tE},hT={null:[Vm,rT]},mT={null:[42,95]},pT={null:[]},gT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mT,contentInitial:lT,disable:pT,document:oT,flow:uT,flowInitial:cT,insideSpan:hT,string:dT,text:fT},Symbol.toStringTag,{value:"Module"}));function bT(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let c=[],d=[];const h={attempt:L(F),check:L(A),consume:M,enter:_,exit:P,interrupt:L(A,{interrupt:!0})},m={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:y,write:g};let p=t.tokenize.call(m,h);return t.resolveAll&&o.push(t),m;function g(q){return c=aa(c,q),N(),c[c.length-1]!==null?[]:(Z(t,0),m.events=gd(o,m.events,m),m.events)}function x(q,W){return yT(y(q),W)}function y(q){return vT(c,q)}function S(){const{_bufferIndex:q,_index:W,line:oe,column:J,offset:H}=a;return{_bufferIndex:q,_index:W,line:oe,column:J,offset:H}}function T(q){s[q.line]=q.column,$()}function N(){let q;for(;a._index<c.length;){const W=c[a._index];if(typeof W=="string")for(q=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===q&&a._bufferIndex<W.length;)R(W.charCodeAt(a._bufferIndex));else R(W)}}function R(q){p=p(q)}function M(q){nt(q)?(a.line++,a.column=1,a.offset+=q===-3?2:1,$()):q!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=q}function _(q,W){const oe=W||{};return oe.type=q,oe.start=S(),m.events.push(["enter",oe,m]),d.push(oe),oe}function P(q){const W=d.pop();return W.end=S(),m.events.push(["exit",W,m]),W}function F(q,W){Z(q,W.from)}function A(q,W){W.restore()}function L(q,W){return oe;function oe(J,H,I){let K,X,be,j;return Array.isArray(J)?Y(J):"tokenize"in J?Y([J]):G(J);function G(V){return Q;function Q(ae){const ue=ae!==null&&V[ae],he=ae!==null&&V.null,Ne=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(he)?he:he?[he]:[]];return Y(Ne)(ae)}}function Y(V){return K=V,X=0,V.length===0?I:D(V[X])}function D(V){return Q;function Q(ae){return j=U(),be=V,V.partial||(m.currentConstruct=V),V.name&&m.parser.constructs.disable.null.includes(V.name)?se():V.tokenize.call(W?Object.assign(Object.create(m),W):m,h,ye,se)(ae)}}function ye(V){return q(be,j),H}function se(V){return j.restore(),++X<K.length?D(K[X]):I}}}function Z(q,W){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&Fr(m.events,W,m.events.length-W,q.resolve(m.events.slice(W),m)),q.resolveTo&&(m.events=q.resolveTo(m.events,m))}function U(){const q=S(),W=m.previous,oe=m.currentConstruct,J=m.events.length,H=Array.from(d);return{from:J,restore:I};function I(){a=q,m.previous=W,m.currentConstruct=oe,m.events.length=J,d=H,$()}}function $(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function vT(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function yT(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
21
+ `;break}case-3:{c=`\r
22
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function xT(e){const a={constructs:A5([gT,...(e||{}).extensions||[]]),content:s(jS),defined:[],document:s(zS),flow:s(tT),lazy:{},string:s(aT),text:s(iT)};return a;function s(o){return c;function c(d){return bT(a,o,d)}}}function wT(e){for(;!D5(e););return e}const Pb=/[\0\t\n\r]/g;function kT(){let e=1,t="",n=!0,a;return s;function s(o,c,d){const h=[];let m,p,g,x,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Pb.lastIndex=g,m=Pb.exec(o),x=m&&m.index!==void 0?m.index:o.length,y=o.charCodeAt(x),!m){t=o.slice(g);break}if(y===10&&g===x&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),g<x&&(h.push(o.slice(g,x)),e+=x-g),y){case 0:{h.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,h.push(-2);e++<p;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return d&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const ST=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ET(e){return e.replace(ST,TT)}function TT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return I5(n.slice(o?2:1),o?16:10)}return $1(n)||e}const H5={}.hasOwnProperty;function CT(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),NT(n)(wT(xT(n).document().write(kT()(e,t,!0))))}function NT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(kt),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(Ye),blockQuote:o(he),characterEscape:U,characterReference:U,codeFenced:o(Ne),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Ne,c),codeText:o(He,c),codeTextData:U,data:U,codeFlowValue:U,definition:o(We),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(rt),hardBreakEscape:o(gt),hardBreakTrailing:o(gt),htmlFlow:o(Rt,c),htmlFlowData:U,htmlText:o(Rt,c),htmlTextData:U,image:o(st),label:c,link:o(kt),listItem:o(Ut),listItemValue:x,listOrdered:o($t,g),listUnordered:o($t),paragraph:o(ze),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Ye),strong:o(Qe),thematicBreak:o(ot)},exit:{atxHeading:h(),atxHeadingSequence:F,autolink:h(),autolinkEmail:ue,autolinkProtocol:ae,blockQuote:h(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:V,characterReference:Q,codeFenced:h(N),codeFencedFence:T,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:$,codeIndented:h(R),codeText:h(H),codeTextData:$,data:$,definition:h(),definitionDestinationString:P,definitionLabelString:M,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(W),hardBreakTrailing:h(W),htmlFlow:h(oe),htmlFlowData:$,htmlText:h(J),htmlTextData:$,image:h(K),label:be,labelText:X,lineEnding:q,link:h(I),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ye,resourceDestinationString:j,resourceTitleString:G,resource:Y,setextHeading:h(Z),setextHeadingLineSequence:L,setextHeadingText:A,strong:h(),thematicBreak:h()}};U5(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(fe){let me={type:"root",children:[]};const $e={stack:[me],tokenStack:[],config:t,enter:d,exit:m,buffer:c,resume:p,data:n},we=[];let Fe=-1;for(;++Fe<fe.length;)if(fe[Fe][1].type==="listOrdered"||fe[Fe][1].type==="listUnordered")if(fe[Fe][0]==="enter")we.push(Fe);else{const mt=we.pop();Fe=s(fe,mt,Fe)}for(Fe=-1;++Fe<fe.length;){const mt=t[fe[Fe][0]];H5.call(mt,fe[Fe][1].type)&&mt[fe[Fe][1].type].call(Object.assign({sliceSerialize:fe[Fe][2].sliceSerialize},$e),fe[Fe][1])}if($e.tokenStack.length>0){const mt=$e.tokenStack[$e.tokenStack.length-1];(mt[1]||Gb).call($e,void 0,mt[0])}for(me.position={start:Bi(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Bi(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)me=t.transforms[Fe](me)||me;return me}function s(fe,me,$e){let we=me-1,Fe=-1,mt=!1,Ie,Pt,bt,Mt;for(;++we<=$e;){const Tt=fe[we];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?Fe++:Fe--,Mt=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(Ie&&!Mt&&!Fe&&!bt&&(bt=we),Mt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mt=void 0}if(!Fe&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||Fe===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(Ie){let $n=we;for(Pt=void 0;$n--;){const en=fe[$n];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;Pt&&(fe[Pt][1].type="lineEndingBlank",mt=!0),en[1].type="lineEnding",Pt=$n}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}bt&&(!Pt||bt<Pt)&&(Ie._spread=!0),Ie.end=Object.assign({},Pt?fe[Pt][1].start:Tt[1].end),fe.splice(Pt||we,0,["exit",Ie,Tt[2]]),we++,$e++}if(Tt[1].type==="listItemPrefix"){const $n={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};Ie=$n,fe.splice(we,0,["enter",$n,Tt[2]]),we++,$e++,bt=void 0,Mt=!0}}}return fe[me][1]._spread=mt,$e}function o(fe,me){return $e;function $e(we){d.call(this,fe(we),we),me&&me.call(this,we)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(fe,me,$e){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([me,$e||void 0]),fe.position={start:Bi(me.start),end:void 0}}function h(fe){return me;function me($e){fe&&fe.call(this,$e),m.call(this,$e)}}function m(fe,me){const $e=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==fe.type&&(me?me.call(this,fe,we[0]):(we[1]||Gb).call(this,fe,we[0]));else throw new Error("Cannot close `"+fe.type+"` ("+_l({start:fe.start,end:fe.end})+"): it’s not open");$e.position.end=Bi(fe.end)}function p(){return F1(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(fe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.lang=fe}function S(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.meta=fe}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe.replace(/(\r?\n|\r)$/g,"")}function M(fe){const me=this.resume(),$e=this.stack[this.stack.length-1];$e.label=me,$e.identifier=ga(this.sliceSerialize(fe)).toLowerCase()}function _(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.title=fe}function P(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.url=fe}function F(fe){const me=this.stack[this.stack.length-1];if(!me.depth){const $e=this.sliceSerialize(fe).length;me.depth=$e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function L(fe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function U(fe){const $e=this.stack[this.stack.length-1].children;let we=$e[$e.length-1];(!we||we.type!=="text")&&(we=Ue(),we.position={start:Bi(fe.start),end:void 0},$e.push(we)),this.stack.push(we)}function $(fe){const me=this.stack.pop();me.value+=this.sliceSerialize(fe),me.position.end=Bi(fe.end)}function q(fe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=me.children[me.children.length-1];$e.position.end=Bi(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(U.call(this,fe),$.call(this,fe))}function W(){this.data.atHardBreak=!0}function oe(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function J(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function H(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.value=fe}function I(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=me,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function K(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=me,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function X(fe){const me=this.sliceSerialize(fe),$e=this.stack[this.stack.length-2];$e.label=ET(me),$e.identifier=ga(me).toLowerCase()}function be(){const fe=this.stack[this.stack.length-1],me=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const we=fe.children;$e.children=we}else $e.alt=me}function j(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.url=fe}function G(){const fe=this.resume(),me=this.stack[this.stack.length-1];me.title=fe}function Y(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ye(fe){const me=this.resume(),$e=this.stack[this.stack.length-1];$e.label=me,$e.identifier=ga(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function se(fe){this.data.characterReferenceType=fe.type}function V(fe){const me=this.sliceSerialize(fe),$e=this.data.characterReferenceType;let we;$e?(we=I5(me,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=$1(me);const Fe=this.stack[this.stack.length-1];Fe.value+=we}function Q(fe){const me=this.stack.pop();me.position.end=Bi(fe.end)}function ae(fe){$.call(this,fe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(fe)}function ue(fe){$.call(this,fe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(fe)}function he(){return{type:"blockquote",children:[]}}function Ne(){return{type:"code",lang:null,meta:null,value:""}}function He(){return{type:"inlineCode",value:""}}function We(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function rt(){return{type:"emphasis",children:[]}}function Ye(){return{type:"heading",depth:0,children:[]}}function gt(){return{type:"break"}}function Rt(){return{type:"html",value:""}}function st(){return{type:"image",title:null,url:"",alt:null}}function kt(){return{type:"link",title:null,url:"",children:[]}}function $t(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function Ut(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function ze(){return{type:"paragraph",children:[]}}function Qe(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function ot(){return{type:"thematicBreak"}}}function Bi(e){return{line:e.line,column:e.column,offset:e.offset}}function U5(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?U5(e,a):RT(e,a)}}function RT(e,t){let n;for(n in t)if(H5.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Gb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_l({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+") is still open")}function AT(e){const t=this;t.parser=n;function n(a){return CT(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function IT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function _T(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
23
+ `}]}function MT(e,t){const n=t.value?t.value+`
24
+ `:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function OT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jT(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=So(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function LT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function F5(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function BT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return F5(e,t);const s={src:So(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function qT(e,t){const n={src:So(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function HT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function UT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return F5(e,t);const s={href:So(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function FT(e,t){const n={href:So(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function $T(e,t,n){const a=e.all(t),s=n?PT(n):$5(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(s||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
25
+ `}),p.type==="element"&&p.tagName==="p"&&!s?c.push(...p.children):c.push(p)}const h=a[a.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
26
+ `});const m={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,m),e.applyData(t,m)}function PT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=$5(n[a])}return t}function $5(e){const t=e.spread;return t??e.children.length>1}function GT(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const c=a[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function VT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function KT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function YT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WT(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),s.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=B1(t.children[1]),h=k5(t.children[t.children.length-1]);d&&h&&(c.position={start:d,end:h}),s.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function ZT(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let h=-1;const m=[];for(;++h<d;){const g=t.children[h],x={},y=c?c[h]:void 0;y&&(x.align=y);let S={type:"element",tagName:o,properties:x,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),m.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,p),e.applyData(t,p)}function XT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Vb=9,Kb=32;function QT(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(Yb(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(Yb(t.slice(s),s>0,!1)),o.join("")}function Yb(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===Vb||o===Kb;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===Vb||o===Kb;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function JT(e,t){const n={type:"text",value:QT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function eC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const tC={blockquote:IT,break:_T,code:MT,delete:OT,emphasis:DT,footnoteReference:jT,heading:LT,html:zT,imageReference:BT,image:qT,inlineCode:HT,linkReference:UT,link:FT,listItem:$T,list:GT,paragraph:VT,root:KT,strong:YT,table:WT,tableCell:XT,tableRow:ZT,text:JT,thematicBreak:eC,toml:xu,yaml:xu,definition:xu,footnoteDefinition:xu};function xu(){}const P5=-1,bd=0,Ol=1,Qu=2,G1=3,V1=4,K1=5,Y1=6,G5=7,V5=8,K5=typeof self=="object"?self:globalThis,Wb=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new K5[e](t)},nC=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,c]=t[s];switch(o){case bd:case P5:return n(c,s);case Ol:{const d=n([],s);for(const h of c)d.push(a(h));return d}case Qu:{const d=n({},s);for(const[h,m]of c)d[a(h)]=a(m);return d}case G1:return n(new Date(c),s);case V1:{const{source:d,flags:h}=c;return n(new RegExp(d,h),s)}case K1:{const d=n(new Map,s);for(const[h,m]of c)d.set(a(h),a(m));return d}case Y1:{const d=n(new Set,s);for(const h of c)d.add(a(h));return d}case G5:{const{name:d,message:h}=c;return n(typeof K5[d]=="function"?Wb(d,h):new Error(h),s)}case V5:return n(BigInt(c),s);case"BigInt":return n(Object(BigInt(c)),s);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(Wb(o,c),s)};return a},Zb=e=>nC(new Map,e)(0),vs="",{toString:rC}={},{keys:aC}=Object,Sl=e=>{const t=typeof e;if(t!=="object"||!e)return[bd,t];const n=rC.call(e).slice(8,-1);switch(n){case"Array":return[Ol,vs];case"Object":return[Qu,vs];case"Date":return[G1,vs];case"RegExp":return[V1,vs];case"Map":return[K1,vs];case"Set":return[Y1,vs];case"DataView":return[Ol,n]}return n.includes("Array")?[Ol,n]:e instanceof Error?[G5,e.name||"Error"]:[Qu,n]},wu=([e,t])=>e===bd&&(t==="function"||t==="symbol"),iC=(e,t,n,a)=>{const s=(c,d)=>{const h=a.push(c)-1;return n.set(d,h),h},o=c=>{if(n.has(c))return n.get(c);let[d,h]=Sl(c);switch(d){case bd:{let p=c;switch(h){case"bigint":d=V5,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);p=null;break;case"undefined":return s([P5],c)}return s([d,p],c)}case Ol:{if(h){let x=c;return h==="DataView"?x=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(c)),s([h,[...x]],c)}const p=[],g=s([d,p],c);for(const x of c)p.push(o(x));return g}case Qu:{if(h)switch(h){case"BigInt":return s([h,c.toString()],c);case"Boolean":case"Number":case"String":return s([h,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],g=s([d,p],c);for(const x of aC(c))(e||!wu(Sl(c[x])))&&p.push([o(x),o(c[x])]);return g}case G1:return s([d,isNaN(c.getTime())?vs:c.toISOString()],c);case V1:{const{source:p,flags:g}=c;return s([d,{source:p,flags:g}],c)}case K1:{const p=[],g=s([d,p],c);for(const[x,y]of c)(e||!(wu(Sl(x))||wu(Sl(y))))&&p.push([o(x),o(y)]);return g}case Y1:{const p=[],g=s([d,p],c);for(const x of c)(e||!wu(Sl(x)))&&p.push(o(x));return g}}const{message:m}=c;return s([d,{name:h,message:m}],c)};return o},Xb=(e,{json:t,lossy:n}={})=>{const a=[];return iC(!(t||n),!!t,new Map,a)(e),a},Ju=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Zb(Xb(e,t)):structuredClone(e):(e,t)=>Zb(Xb(e,t));function sC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function lC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||sC,a=e.options.footnoteBackLabel||oC,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const p=e.all(m),g=String(m.identifier).toUpperCase(),x=So(g.toLowerCase());let y=0;const S=[],T=e.footnoteCounts.get(g);for(;T!==void 0&&++y<=T;){S.length>0&&S.push({type:"text",value:" "});let M=typeof n=="string"?n:n(h,y);typeof M=="string"&&(M={type:"text",value:M}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,y),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const N=p[p.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const M=N.children[N.children.length-1];M&&M.type==="text"?M.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...S)}else p.push(...S);const R={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(m,R),d.push(R)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ju(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
27
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
28
+ `}]}}const tc=(function(e){if(e==null)return fC;if(typeof e=="function")return vd(e);if(typeof e=="object")return Array.isArray(e)?cC(e):uC(e);if(typeof e=="string")return dC(e);throw new Error("Expected function, string, or object as test")});function cC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tc(e[n]);return vd(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function uC(e){const t=e;return vd(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function dC(e){return vd(t);function t(n){return n&&n.type===e}}function vd(e){return t;function t(n,a,s){return!!(hC(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function fC(){return!0}function hC(e){return e!==null&&typeof e=="object"&&"type"in e}const Y5=[],mC=!0,Km=!1,W5="skip";function W1(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=tc(s),c=a?-1:1;d(e,void 0,[])();function d(h,m,p){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const y=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(y?"<"+y+">":""))+")"})}return x;function x(){let y=Y5,S,T,N;if((!t||o(h,m,p[p.length-1]||void 0))&&(y=pC(n(h,p)),y[0]===Km))return y;if("children"in h&&h.children){const R=h;if(R.children&&y[0]!==W5)for(T=(a?R.children.length:-1)+c,N=p.concat(R);T>-1&&T<R.children.length;){const M=R.children[T];if(S=d(M,T,N)(),S[0]===Km)return S;T=typeof S[1]=="number"?S[1]:T+c}}return y}}}function pC(e){return Array.isArray(e)?e:typeof e=="number"?[mC,e]:e==null?Y5:[e]}function Z1(e,t,n,a){let s,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,s=n):(o=t,c=n,s=a),W1(e,o,d,s);function d(h,m){const p=m[m.length-1],g=p?p.children.indexOf(h):void 0;return c(h,g,p)}}const Ym={}.hasOwnProperty,gC={};function bC(e,t){const n=t||gC,a=new Map,s=new Map,o=new Map,c={...tC,...n.handlers},d={all:m,applyData:yC,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:c,one:h,options:n,patch:vC,wrap:wC};return Z1(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?a:s,x=String(p.identifier).toUpperCase();g.has(x)||g.set(x,p)}}),d;function h(p,g){const x=p.type,y=d.handlers[x];if(Ym.call(d.handlers,x)&&y)return y(d,p,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in p){const{children:T,...N}=p,R=Ju(N);return R.children=d.all(p),R}return Ju(p)}return(d.options.unknownHandler||xC)(d,p,g)}function m(p){const g=[];if("children"in p){const x=p.children;let y=-1;for(;++y<x.length;){const S=d.one(x[y],p);if(S){if(y&&x[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=Qb(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=Qb(T.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function vC(e,t){e.position&&(t.position=oS(e))}function yC(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,Ju(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function xC(e,t){const n=t.data||{},a="value"in t&&!(Ym.call(n,"hProperties")||Ym.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function wC(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
29
+ `});++a<e.length;)a&&n.push({type:"text",value:`
30
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
31
+ `}),n}function Qb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Jb(e,t){const n=bC(e,t),a=n.one(e,void 0),s=lC(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
32
+ `},s),o}function kC(e,t){return e&&"run"in e?async function(n,a){const s=Jb(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Jb(n,{file:a,...e||t})}}function ev(e){if(e)throw e}var eh,tv;function SC(){if(tv)return eh;tv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var p=e.call(m,"constructor"),g=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!p&&!g)return!1;var x;for(x in m);return typeof x>"u"||e.call(m,x)},c=function(m,p){n&&p.name==="__proto__"?n(m,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):m[p.name]=p.newValue},d=function(m,p){if(p==="__proto__")if(e.call(m,p)){if(a)return a(m,p).value}else return;return m[p]};return eh=function h(){var m,p,g,x,y,S,T=arguments[0],N=1,R=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},N=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});N<R;++N)if(m=arguments[N],m!=null)for(p in m)g=d(T,p),x=d(m,p),T!==x&&(M&&x&&(o(x)||(y=s(x)))?(y?(y=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},c(T,{name:p,newValue:h(M,S,x)})):typeof x<"u"&&c(T,{name:p,newValue:x}));return T},eh}var EC=SC();const th=dd(EC);function Wm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function TC(){const e=[],t={run:n,use:a};return t;function n(...s){let o=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(h,...m){const p=e[++o];let g=-1;if(h){c(h);return}for(;++g<s.length;)(m[g]===null||m[g]===void 0)&&(m[g]=s[g]);s=m,p?CC(p,d)(...m):c(null,...m)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function CC(e,t){let n;return a;function a(...c){const d=e.length>c.length;let h;d&&c.push(s);try{h=e.apply(this,c)}catch(m){const p=m;if(d&&n)throw p;return s(p)}d||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(c,...d){n||(n=!0,t(c,...d))}function o(c){s(null,c)}}const Na={basename:NC,dirname:RC,extname:AC,join:IC,sep:"/"};function NC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nc(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else c<0&&(o=!0,c=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function RC(e){if(nc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function AC(e){nc(e);let t=e.length,n=-1,a=0,s=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function IC(...e){let t=-1,n;for(;++t<e.length;)nc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_C(n)}function _C(e){nc(e);const t=e.codePointAt(0)===47;let n=MC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function MC(e,t){let n="",a=0,s=-1,o=0,c=-1,d,h;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||o===1))if(s!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),s=c,o=0;continue}}else if(n.length>0){n="",a=0,s=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,c):n=e.slice(s+1,c),a=c-s-1;s=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function nc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OC={cwd:DC};function DC(){return"/"}function Zm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jC(e){if(typeof e=="string")e=new URL(e);else if(!Zm(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return LC(e)}function LC(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const nh=["history","path","basename","stem","extname","dirname"];class Z5{constructor(t){let n;t?Zm(t)?n={path:t}:typeof t=="string"||zC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":OC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<nh.length;){const o=nh[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)nh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Na.basename(this.path):void 0}set basename(t){ah(t,"basename"),rh(t,"basename"),this.path=Na.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Na.dirname(this.path):void 0}set dirname(t){nv(this.basename,"dirname"),this.path=Na.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Na.extname(this.path):void 0}set extname(t){if(rh(t,"extname"),nv(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Na.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zm(t)&&(t=jC(t)),ah(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Na.basename(this.path,this.extname):void 0}set stem(t){ah(t,"stem"),rh(t,"stem"),this.path=Na.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new ur(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function rh(e,t){if(e&&e.includes(Na.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Na.sep+"`")}function ah(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function nv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function zC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BC=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),qC={}.hasOwnProperty;class X1 extends BC{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=TC()}copy(){const t=new X1;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(th(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(oh("data",this.frozen),this.namespace[t]=n,this):qC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(oh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ku(t),a=this.parser||this.Parser;return ih("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),ih("process",this.parser||this.Parser),sh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,c){const d=ku(t),h=a.parse(d);a.run(h,d,function(p,g,x){if(p||!g||!x)return m(p);const y=g,S=a.stringify(y,x);FC(S)?x.value=S:x.result=S,m(p,x)});function m(p,g){p||!g?c(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),ih("processSync",this.parser||this.Parser),sh("processSync",this.compiler||this.Compiler),this.process(t,s),av("processSync","process",n),a;function s(o,c){n=!0,ev(o),a=c}}run(t,n,a){rv(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const h=ku(n);s.run(t,h,m);function m(p,g,x){const y=g||t;p?d(p):c?c(y):a(void 0,y,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),av("runSync","run",a),s;function o(c,d){ev(c),s=d,a=!0}}stringify(t,n){this.freeze();const a=ku(n),s=this.compiler||this.Compiler;return sh("stringify",s),rv(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(oh("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[p,...g]=m;h(p,g)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))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");d(m.plugins),m.settings&&(s.settings=th(!0,s.settings,m.settings))}function d(m){let p=-1;if(m!=null)if(Array.isArray(m))for(;++p<m.length;){const g=m[p];o(g)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,p){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===m){x=g;break}if(x===-1)a.push([m,...p]);else if(p.length>0){let[y,...S]=p;const T=a[x][1];Wm(T)&&Wm(y)&&(y=th(!0,T,y)),a[x]=[m,y,...S]}}}}const HC=new X1().freeze();function ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function oh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rv(e){if(!Wm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function av(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ku(e){return UC(e)?e:new Z5(e)}function UC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function FC(e){return typeof e=="string"||$C(e)}function $C(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const PC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iv=[],sv={allowDangerousHtml:!0},GC=/^(https?|ircs?|mailto|xmpp)$/i,VC=[{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 KC(e){const t=YC(e),n=WC(e);return ZC(t.runSync(t.parse(n),n),e)}function YC(e){const t=e.rehypePlugins||iv,n=e.remarkPlugins||iv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sv}:sv;return HC().use(AT).use(n).use(kC,a).use(t)}function WC(e){const t=e.children||"",n=new Z5;return typeof t=="string"&&(n.value=t),n}function ZC(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,h=t.urlTransform||XC;for(const p of VC)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+PC+p.id,void 0);return Z1(e,m),fS(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(p,g,x){if(p.type==="raw"&&x&&typeof g=="number")return c?x.children.splice(g,1):x.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let y;for(y in Xf)if(Object.hasOwn(Xf,y)&&Object.hasOwn(p.properties,y)){const S=p.properties[y],T=Xf[y];(T===null||T.includes(p.tagName))&&(p.properties[y]=h(String(S||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!y&&a&&typeof g=="number"&&(y=!a(p,g,x)),y&&x&&typeof g=="number")return d&&p.children?x.children.splice(g,1,...p.children):x.children.splice(g,1),g}}}function XC(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||GC.test(e.slice(0,t))?e:""}function ov(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function QC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function JC(e,t,n){const s=tc((n||{}).ignore||[]),o=eN(t);let c=-1;for(;++c<o.length;)W1(e,"text",d);function d(m,p){let g=-1,x;for(;++g<p.length;){const y=p[g],S=x?x.children:void 0;if(s(y,S?S.indexOf(y):void 0,x))return;x=y}if(x)return h(m,p)}function h(m,p){const g=p[p.length-1],x=o[c][0],y=o[c][1];let S=0;const N=g.children.indexOf(m);let R=!1,M=[];x.lastIndex=0;let _=x.exec(m.value);for(;_;){const P=_.index,F={index:_.index,input:_.input,stack:[...p,m]};let A=y(..._,F);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?x.lastIndex=P+1:(S!==P&&M.push({type:"text",value:m.value.slice(S,P)}),Array.isArray(A)?M.push(...A):A&&M.push(A),S=P+_[0].length,R=!0),!x.global)break;_=x.exec(m.value)}return R?(S<m.value.length&&M.push({type:"text",value:m.value.slice(S)}),g.children.splice(N,1,...M)):M=[m],N+M.length}}function eN(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([tN(s[0]),nN(s[1])])}return t}function tN(e){return typeof e=="string"?new RegExp(QC(e),"g"):e}function nN(e){return typeof e=="function"?e:function(){return e}}const lh="phrasing",ch=["autolink","link","image","label"];function rN(){return{transforms:[uN],enter:{literalAutolink:iN,literalAutolinkEmail:uh,literalAutolinkHttp:uh,literalAutolinkWww:uh},exit:{literalAutolink:cN,literalAutolinkEmail:lN,literalAutolinkHttp:sN,literalAutolinkWww:oN}}}function aN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lh,notInConstruct:ch},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lh,notInConstruct:ch},{character:":",before:"[ps]",after:"\\/",inConstruct:lh,notInConstruct:ch}]}}function iN(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function uh(e){this.config.enter.autolinkProtocol.call(this,e)}function sN(e){this.config.exit.autolinkProtocol.call(this,e)}function oN(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function lN(e){this.config.exit.autolinkEmail.call(this,e)}function cN(e){this.exit(e)}function uN(e){JC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,dN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fN]],{ignore:["link","linkReference"]})}function dN(e,t,n,a,s){let o="";if(!X5(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!hN(n)))return!1;const c=mN(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function fN(e,t,n,a){return!X5(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function hN(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function mN(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=ov(e,"(");let o=ov(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function X5(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Cs(n)||pd(n))&&(!t||n!==47)}Q5.peek=SN;function pN(){this.buffer()}function gN(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function bN(){this.buffer()}function vN(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ga(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xN(e){this.exit(e)}function wN(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ga(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kN(e){this.exit(e)}function SN(){return"["}function Q5(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=s.move("]"),o}function EN(){return{enter:{gfmFootnoteCallString:pN,gfmFootnoteCall:gN,gfmFootnoteDefinitionLabelString:bN,gfmFootnoteDefinition:vN},exit:{gfmFootnoteCallString:yN,gfmFootnoteCall:xN,gfmFootnoteDefinitionLabelString:wN,gfmFootnoteDefinition:kN}}}function TN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Q5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,c){const d=o.createTracker(c);let h=d.move("[^");const m=o.enter("footnoteDefinition"),p=o.enter("label");return h+=d.move(o.safe(o.associationId(a),{before:h,after:"]"})),p(),h+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),h+=d.move((t?`
33
+ `:" ")+o.indentLines(o.containerFlow(a,d.current()),t?J5:CN))),m(),h}}function CN(e,t,n){return t===0?e:J5(e,t,n)}function J5(e,t,n){return(n?"":" ")+e}const NN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];e6.peek=MN;function RN(){return{canContainEols:["delete"],enter:{strikethrough:IN},exit:{strikethrough:_N}}}function AN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NN}],handlers:{delete:e6}}}function IN(e){this.enter({type:"delete",children:[]},e)}function _N(e){this.exit(e)}function e6(e,t,n,a){const s=n.createTracker(a),o=n.enter("strikethrough");let c=s.move("~~");return c+=n.containerPhrasing(e,{...s.current(),before:c,after:"~"}),c+=s.move("~~"),o(),c}function MN(){return"~"}function ON(e){return e.length}function DN(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||ON,o=[],c=[],d=[],h=[];let m=0,p=-1;for(;++p<e.length;){const T=[],N=[];let R=-1;for(e[p].length>m&&(m=e[p].length);++R<e[p].length;){const M=jN(e[p][R]);if(n.alignDelimiters!==!1){const _=s(M);N[R]=_,(h[R]===void 0||_>h[R])&&(h[R]=_)}T.push(M)}c[p]=T,d[p]=N}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<m;)o[g]=lv(a[g]);else{const T=lv(a);for(;++g<m;)o[g]=T}g=-1;const x=[],y=[];for(;++g<m;){const T=o[g];let N="",R="";T===99?(N=":",R=":"):T===108?N=":":T===114&&(R=":");let M=n.alignDelimiters===!1?1:Math.max(1,h[g]-N.length-R.length);const _=N+"-".repeat(M)+R;n.alignDelimiters!==!1&&(M=N.length+M+R.length,M>h[g]&&(h[g]=M),y[g]=M),x[g]=_}c.splice(1,0,x),d.splice(1,0,y),p=-1;const S=[];for(;++p<c.length;){const T=c[p],N=d[p];g=-1;const R=[];for(;++g<m;){const M=T[g]||"";let _="",P="";if(n.alignDelimiters!==!1){const F=h[g]-(N[g]||0),A=o[g];A===114?_=" ".repeat(F):A===99?F%2?(_=" ".repeat(F/2+.5),P=" ".repeat(F/2-.5)):(_=" ".repeat(F/2),P=_):P=" ".repeat(F)}n.delimiterStart!==!1&&!g&&R.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||g)&&R.push(" "),n.alignDelimiters!==!1&&R.push(_),R.push(M),n.alignDelimiters!==!1&&R.push(P),n.padding!==!1&&R.push(" "),(n.delimiterEnd!==!1||g!==m-1)&&R.push("|")}S.push(n.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return S.join(`
34
+ `)}function jN(e){return e==null?"":String(e)}function lv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function LN(e,t,n,a){const s=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),zN);return s(),c}function zN(e,t,n){return">"+(n?"":" ")+e}function BN(e,t){return cv(e,t.inConstruct,!0)&&!cv(e,t.notInConstruct,!1)}function cv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function uv(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
35
+ `&&BN(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
36
+ `}function t6(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>c&&(c=o):o=1,s=a+t.length,a=n.indexOf(t,s);return c}function qN(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HN(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function UN(e,t,n,a){const s=HN(n),o=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(qN(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,FN);return g(),x}const d=n.createTracker(a),h=s.repeat(Math.max(t6(o,s)+1,3)),m=n.enter("codeFenced");let p=d.move(h);if(e.lang){const g=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
37
+ `,encode:["`"],...d.current()})),g()}return p+=d.move(`
38
+ `),o&&(p+=d.move(o+`
39
+ `)),p+=d.move(h),m(),p}function FN(e,t,n){return(n?"":" ")+e}function Q1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $N(e,t,n,a){const s=Q1(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":`
40
+ `,...h.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),c(),m}function PN(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Pl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ed(e,t,n){const a=bo(e),s=bo(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===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}}n6.peek=GN;function n6(e,t,n,a){const s=PN(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(s);let h=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const m=h.charCodeAt(0),p=ed(a.before.charCodeAt(a.before.length-1),m,s);p.inside&&(h=Pl(m)+h.slice(1));const g=h.charCodeAt(h.length-1),x=ed(a.after.charCodeAt(0),g,s);x.inside&&(h=h.slice(0,-1)+Pl(g));const y=c.move(s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+h+y}function GN(e,t,n){return n.options.emphasis||"*"}function VN(e,t){let n=!1;return Z1(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Km}),!!((!e.depth||e.depth<3)&&F1(e)&&(t.options.setext||n))}function KN(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(VN(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
41
+ `,after:`
42
+ `});return g(),p(),x+`
43
+ `+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
44
+ `))+1))}const c="#".repeat(s),d=n.enter("headingAtx"),h=n.enter("phrasing");o.move(c+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
45
+ `,...o.current()});return/^[\t ]/.test(m)&&(m=Pl(m.charCodeAt(0))+m.slice(1)),m=m?c+" "+m:c,n.options.closeAtx&&(m+=" "+c),h(),d(),m}r6.peek=YN;function r6(e){return e.value||""}function YN(){return"<"}a6.peek=WN;function a6(e,t,n,a){const s=Q1(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(d=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),d(),e.title&&(d=n.enter(`title${o}`),m+=h.move(" "+s),m+=h.move(n.safe(e.title,{before:m,after:s,...h.current()})),m+=h.move(s),d()),m+=h.move(")"),c(),m}function WN(){return"!"}i6.peek=ZN;function i6(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let h=d.move("![");const m=n.safe(e.alt,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!m||m!==g?h+=d.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function ZN(){return"!"}s6.peek=XN;function s6(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],d=n.compilePattern(c);let h;if(c.atBreak)for(;h=d.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return s+a+s}function XN(){return"`"}function o6(e,t){const n=F1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}l6.peek=QN;function l6(e,t,n,a){const s=Q1(n),o=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,h;if(o6(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),d(),n.stack=p,g}d=n.enter("link"),h=n.enter("label");let m=c.move("[");return m+=c.move(n.containerPhrasing(e,{before:m,after:"](",...c.current()})),m+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=c.move("<"),m+=c.move(n.safe(e.url,{before:m,after:">",...c.current()})),m+=c.move(">")):(h=n.enter("destinationRaw"),m+=c.move(n.safe(e.url,{before:m,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=n.enter(`title${o}`),m+=c.move(" "+s),m+=c.move(n.safe(e.title,{before:m,after:s,...c.current()})),m+=c.move(s),h()),m+=c.move(")"),d(),m}function QN(e,t,n){return o6(e,n)?"<":"["}c6.peek=JN;function c6(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let h=d.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...d.current()});h+=d.move(m+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:h,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!m||m!==g?h+=d.move(g+"]"):s==="shortcut"?h=h.slice(0,-1):h+=d.move("]"),h}function JN(){return"["}function J1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function eR(e){const t=J1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function tR(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function u6(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function nR(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?tR(n):J1(n);const d=e.ordered?c==="."?")":".":eR(n);let h=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),u6(n)===c&&p){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=d),n.bulletCurrent=c;const m=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,s(),m}function rR(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function aR(e,t,n,a){const s=rR(n);let o=n.bulletCurrent||J1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,d.current()),p);return h(),m;function p(g,x,y){return x?(y?"":" ".repeat(c))+g:(y?o:o+" ".repeat(c-o.length))+g}}function iR(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),s(),c}const sR=tc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oR(e,t,n,a){return(e.children.some(function(c){return sR(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function lR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}d6.peek=cR;function d6(e,t,n,a){const s=lR(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(s+s);let h=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const m=h.charCodeAt(0),p=ed(a.before.charCodeAt(a.before.length-1),m,s);p.inside&&(h=Pl(m)+h.slice(1));const g=h.charCodeAt(h.length-1),x=ed(a.after.charCodeAt(0),g,s);x.inside&&(h=h.slice(0,-1)+Pl(g));const y=c.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+h+y}function cR(e,t,n){return n.options.strong||"*"}function uR(e,t,n,a){return n.safe(e.value,a)}function dR(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function fR(e,t,n){const a=(u6(n)+(n.options.ruleSpaces?" ":"")).repeat(dR(n));return n.options.ruleSpaces?a.slice(0,-1):a}const f6={blockquote:LN,break:uv,code:UN,definition:$N,emphasis:n6,hardBreak:uv,heading:KN,html:r6,image:a6,imageReference:i6,inlineCode:s6,link:l6,linkReference:c6,list:nR,listItem:aR,paragraph:iR,root:oR,strong:d6,text:uR,thematicBreak:fR};function hR(){return{enter:{table:mR,tableData:dv,tableHeader:dv,tableRow:gR},exit:{codeText:bR,table:pR,tableData:dh,tableHeader:dh,tableRow:dh}}}function mR(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function pR(e){this.exit(e),this.data.inTable=void 0}function gR(e){this.enter({type:"tableRow",children:[]},e)}function dh(e){this.exit(e)}function dv(e){this.enter({type:"tableCell",children:[]},e)}function bR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vR(e,t){return t==="|"?t:e}function yR(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
46
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:h,tableRow:d}};function c(y,S,T,N){return m(p(y,T,N),y.align)}function d(y,S,T,N){const R=g(y,T,N),M=m([R]);return M.slice(0,M.indexOf(`
47
+ `))}function h(y,S,T,N){const R=T.enter("tableCell"),M=T.enter("phrasing"),_=T.containerPhrasing(y,{...N,before:o,after:o});return M(),R(),_}function m(y,S){return DN(y,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function p(y,S,T){const N=y.children;let R=-1;const M=[],_=S.enter("table");for(;++R<N.length;)M[R]=g(N[R],S,T);return _(),M}function g(y,S,T){const N=y.children;let R=-1;const M=[],_=S.enter("tableRow");for(;++R<N.length;)M[R]=h(N[R],y,S,T);return _(),M}function x(y,S,T){let N=f6.inlineCode(y,S,T);return T.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function xR(){return{exit:{taskListCheckValueChecked:fv,taskListCheckValueUnchecked:fv,paragraph:kR}}}function wR(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SR}}}function fv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function kR(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,c;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){c=d;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function SR(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let h=f6.listItem(e,t,n,{...a,...d.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(p){return p+c}}function ER(){return[rN(),EN(),RN(),hR(),xR()]}function TR(e){return{extensions:[aN(),TN(e),AN(),yR(e),wR()]}}const CR={tokenize:MR,partial:!0},h6={tokenize:OR,partial:!0},m6={tokenize:DR,partial:!0},p6={tokenize:jR,partial:!0},NR={tokenize:LR,partial:!0},g6={name:"wwwAutolink",tokenize:IR,previous:v6},b6={name:"protocolAutolink",tokenize:_R,previous:y6},oi={name:"emailAutolink",tokenize:AR,previous:x6},Ia={};function RR(){return{text:Ia}}let ps=48;for(;ps<123;)Ia[ps]=oi,ps++,ps===58?ps=65:ps===91&&(ps=97);Ia[43]=oi;Ia[45]=oi;Ia[46]=oi;Ia[95]=oi;Ia[72]=[oi,b6];Ia[104]=[oi,b6];Ia[87]=[oi,g6];Ia[119]=[oi,g6];function AR(e,t,n){const a=this;let s,o;return c;function c(g){return!Xm(g)||!x6.call(a,a.previous)||ep(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return Xm(g)?(e.consume(g),d):g===64?(e.consume(g),h):n(g)}function h(g){return g===46?e.check(NR,p,m)(g):g===45||g===95||lr(g)?(o=!0,e.consume(g),h):p(g)}function m(g){return e.consume(g),s=!0,h}function p(g){return o&&s&&gr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function IR(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!v6.call(a,a.previous)||ep(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(CR,e.attempt(h6,e.attempt(m6,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function _R(e,t,n){const a=this;let s="",o=!1;return c;function c(g){return(g===72||g===104)&&y6.call(a,a.previous)&&!ep(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(gr(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(g),h}return n(g)}function h(g){return g===47?(e.consume(g),o?m:(o=!0,h)):n(g)}function m(g){return g===null||Xu(g)||un(g)||Cs(g)||pd(g)?n(g):e.attempt(h6,e.attempt(m6,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function MR(e,t,n){let a=0;return s;function s(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),s):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function OR(e,t,n){let a,s,o;return c;function c(m){return m===46||m===95?e.check(p6,h,d)(m):m===null||un(m)||Cs(m)||m!==45&&pd(m)?h(m):(o=!0,e.consume(m),c)}function d(m){return m===95?a=!0:(s=a,a=void 0),e.consume(m),c}function h(m){return s||a||!o?n(m):t(m)}}function DR(e,t){let n=0,a=0;return s;function s(c){return c===40?(n++,e.consume(c),s):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(p6,t,o)(c):c===null||un(c)||Cs(c)?t(c):(e.consume(c),s)}function o(c){return c===41&&a++,e.consume(c),s}}function jR(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||un(d)||Cs(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||un(d)||Cs(d)?t(d):a(d)}function o(d){return gr(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):gr(d)?(e.consume(d),c):n(d)}}function LR(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return lr(o)?n(o):t(o)}}function v6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||un(e)}function y6(e){return!gr(e)}function x6(e){return!(e===47||Xm(e))}function Xm(e){return e===43||e===45||e===46||e===95||lr(e)}function ep(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zR={tokenize:GR,partial:!0};function BR(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FR,continuation:{tokenize:$R},exit:PR}},text:{91:{name:"gfmFootnoteCall",tokenize:UR},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qR,resolveTo:HR}}}}function qR(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;s--;){const h=a.events[s][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!c||!c._balanced)return n(h);const m=ga(a.sliceSerialize({start:c.end,end:a.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function HR(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+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)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function UR(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),h}function h(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(g){if(o>999||g===93&&!c||g===null||g===91||un(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(ga(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return un(g)||(c=!0),o++,e.consume(g),g===92?p:m}function p(g){return g===91||g===92||g===93?(e.consume(g),o++,m):m(g)}}function FR(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(c>999||S===93&&!d||S===null||S===91||un(S))return n(S);if(S===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return o=ga(a.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return un(S)||(d=!0),c++,e.consume(S),S===92?g:p}function g(S){return S===91||S===92||S===93?(e.consume(S),c++,p):p(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),Ot(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function $R(e,t,n){return e.check(ec,t,e.attempt(zR,t,n))}function PR(e){e.exit("gfmFootnoteDefinition")}function GR(e,t,n){const a=this;return Ot(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function VR(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,d){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},g={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},x=[["enter",p,d],["enter",c[m][1],d],["exit",c[m][1],d],["enter",g,d]],y=d.parser.constructs.insideSpan.null;y&&Fr(x,x.length,0,gd(y,c.slice(m+1,h),d)),Fr(x,x.length,0,[["exit",g,d],["enter",c[h][1],d],["exit",c[h][1],d],["exit",p,d]]),Fr(c,m-1,h-m+3,x),h=m+x.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function o(c,d,h){const m=this.previous,p=this.events;let g=0;return x;function x(S){return m===126&&p[p.length-1][1].type!=="characterEscape"?h(S):(c.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const T=bo(m);if(S===126)return g>1?h(S):(c.consume(S),g++,y);if(g<2&&!n)return h(S);const N=c.exit("strikethroughSequenceTemporary"),R=bo(S);return N._open=!R||R===2&&!!T,N._close=!T||T===2&&!!R,d(S)}}}class KR{constructor(){this.map=[]}add(t,n,a){YR(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function YR(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function WR(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function ZR(){return{flow:{null:{name:"table",tokenize:XR,resolveAll:QR}}}}function XR(e,t,n){const a=this;let s=0,o=0,c;return d;function d($){let q=a.events.length-1;for(;q>-1;){const J=a.events[q][1].type;if(J==="lineEnding"||J==="linePrefix")q--;else break}const W=q>-1?a.events[q][1].type:null,oe=W==="tableHead"||W==="tableRow"?A:h;return oe===A&&a.parser.lazy[a.now().line]?n($):oe($)}function h($){return e.enter("tableHead"),e.enter("tableRow"),m($)}function m($){return $===124||(c=!0,o+=1),p($)}function p($){return $===null?n($):nt($)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),y):n($):zt($)?Ot(e,p,"whitespace")($):(o+=1,c&&(c=!1,s+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),g($)))}function g($){return $===null||$===124||un($)?(e.exit("data"),p($)):(e.consume($),$===92?x:g)}function x($){return $===92||$===124?(e.consume($),g):g($)}function y($){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($):(e.enter("tableDelimiterRow"),c=!1,zt($)?Ot(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):S($))}function S($){return $===45||$===58?N($):$===124?(c=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),T):F($)}function T($){return zt($)?Ot(e,N,"whitespace")($):N($)}function N($){return $===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),R):$===45?(o+=1,R($)):$===null||nt($)?P($):F($)}function R($){return $===45?(e.enter("tableDelimiterFiller"),M($)):F($)}function M($){return $===45?(e.consume($),M):$===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_($))}function _($){return zt($)?Ot(e,P,"whitespace")($):P($)}function P($){return $===124?S($):$===null||nt($)?!c||s!==o?F($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):F($)}function F($){return n($)}function A($){return e.enter("tableRow"),L($)}function L($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),L):$===null||nt($)?(e.exit("tableRow"),t($)):zt($)?Ot(e,L,"whitespace")($):(e.enter("data"),Z($))}function Z($){return $===null||$===124||un($)?(e.exit("data"),L($)):(e.consume($),$===92?U:Z)}function U($){return $===92||$===124?(e.consume($),Z):Z($)}}function QR(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,h=0,m,p,g;const x=new KR;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(d=!1,h!==0&&(hv(x,t,h,m,p),p=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Su(x,t,o,s,void 0,g),o=[0,0,0,0]),c[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Su(x,t,o,s,void 0,g)),o=c,c=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,o[1]!==0?(c[0]=c[1],g=Su(x,t,o,s,n,g)):c[1]!==0&&(g=Su(x,t,c,s,n,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=n)}for(h!==0&&hv(x,t,h,m,p),x.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=WR(t.events,n))}return e}function Su(e,t,n,a,s,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},mo(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=mo(t.events,n[1]);if(o={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const m=mo(t.events,n[2]),p=mo(t.events,n[3]),g={type:d,start:Object.assign({},m),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],y=t.events[n[3]];if(x[1].end=Object.assign({},y[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,T=n[3]-n[2]-1;e.add(S,T,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},mo(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function hv(e,t,n,a,s){const o=[],c=mo(t.events,n);s&&(s.end=Object.assign({},c),o.push(["exit",s,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function mo(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const JR={name:"tasklistCheck",tokenize:tA};function eA(){return{text:{91:JR}}}function tA(e,t,n){const a=this;return s;function s(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return un(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):n(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(h)}function d(h){return nt(h)?t(h):zt(h)?e.check({tokenize:nA},t,n)(h):n(h)}}function nA(e,t,n){return Ot(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function rA(e){return A5([RR(),BR(),VR(e),ZR(),eA()])}const aA={};function iA(e){const t=this,n=e||aA,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(rA(n)),o.push(ER()),c.push(TR(n))}function sA(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(h){const m={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[m]}},h)}function t(){this.buffer()}function n(){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,m.meta=h}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(h){const m=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(h),p.value=m;const g=p.data.hChildren[0];g.type,g.tagName,g.children.push({type:"text",value:m}),this.data.mathFlowInside=void 0}function o(h){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},h),this.buffer()}function c(h){const m=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(h),p.value=m,p.data.hChildren.push({type:"text",value:m})}function d(h){this.config.enter.data.call(this,h),this.config.exit.data.call(this,h)}}function oA(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
48
+ `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,d,h){const m=o.value||"",p=d.createTracker(h),g="$".repeat(Math.max(t6(m,"$")+1,2)),x=d.enter("mathFlow");let y=p.move(g);if(o.meta){const S=d.enter("mathFlowMeta");y+=p.move(d.safe(o.meta,{after:`
49
+ `,before:y,encode:["$"],...p.current()})),S()}return y+=p.move(`
50
+ `),m&&(y+=p.move(m+`
51
+ `)),y+=p.move(g),x(),y}function a(o,c,d){let h=o.value||"",m=1;for(t||m++;new RegExp("(^|[^$])"+"\\$".repeat(m)+"([^$]|$)").test(h);)m++;const p="$".repeat(m);/[^ \r\n]/.test(h)&&(/^[ \r\n]/.test(h)&&/[ \r\n]$/.test(h)||/^\$|\$$/.test(h))&&(h=" "+h+" ");let g=-1;for(;++g<d.unsafe.length;){const x=d.unsafe[g];if(!x.atBreak)continue;const y=d.compilePattern(x);let S;for(;S=y.exec(h);){let T=S.index;h.codePointAt(T)===10&&h.codePointAt(T-1)===13&&T--,h=h.slice(0,T)+" "+h.slice(S.index+1)}}return p+h+p}function s(){return"$"}}const lA={tokenize:cA,concrete:!0,name:"mathFlow"},mv={tokenize:uA,partial:!0};function cA(e,t,n){const a=this,s=a.events[a.events.length-1],o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let c=0;return d;function d(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),h(M)}function h(M){return M===36?(e.consume(M),c++,h):c<2?n(M):(e.exit("mathFlowFenceSequence"),Ot(e,m,"whitespace")(M))}function m(M){return M===null||nt(M)?g(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(M))}function p(M){return M===null||nt(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),g(M)):M===36?n(M):(e.consume(M),p)}function g(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt(mv,x,N)(M)}function x(M){return e.attempt({tokenize:R,partial:!0},N,y)(M)}function y(M){return(o?Ot(e,S,"linePrefix",o+1):S)(M)}function S(M){return M===null?N(M):nt(M)?e.attempt(mv,x,N)(M):(e.enter("mathFlowValue"),T(M))}function T(M){return M===null||nt(M)?(e.exit("mathFlowValue"),S(M)):(e.consume(M),T)}function N(M){return e.exit("mathFlow"),t(M)}function R(M,_,P){let F=0;return Ot(M,A,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function A(U){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),L(U)}function L(U){return U===36?(F++,M.consume(U),L):F<c?P(U):(M.exit("mathFlowFenceSequence"),Ot(M,Z,"whitespace")(U))}function Z(U){return U===null||nt(U)?(M.exit("mathFlowFence"),_(U)):P(U)}}}function uA(e,t,n){const a=this;return s;function s(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function dA(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:fA,previous:hA,name:"mathText"};function a(s,o,c){let d=0,h,m;return p;function p(T){return s.enter("mathText"),s.enter("mathTextSequence"),g(T)}function g(T){return T===36?(s.consume(T),d++,g):d<2&&!n?c(T):(s.exit("mathTextSequence"),x(T))}function x(T){return T===null?c(T):T===36?(m=s.enter("mathTextSequence"),h=0,S(T)):T===32?(s.enter("space"),s.consume(T),s.exit("space"),x):nt(T)?(s.enter("lineEnding"),s.consume(T),s.exit("lineEnding"),x):(s.enter("mathTextData"),y(T))}function y(T){return T===null||T===32||T===36||nt(T)?(s.exit("mathTextData"),x(T)):(s.consume(T),y)}function S(T){return T===36?(s.consume(T),h++,S):h===d?(s.exit("mathTextSequence"),s.exit("mathText"),o(T)):(m.type="mathTextData",y(T))}}}function fA(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function hA(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function mA(e){return{flow:{36:lA},text:{36:dA(e)}}}class Oe extends Error{constructor(t,n){var a="KaTeX parse error: "+t,s,o,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;s=c.start,o=c.end,s===d.length?a+=" at end of input: ":a+=" at position "+(s+1)+": ";var h=d.slice(s,o).replace(/[^]/g,"$&̲"),m;s>15?m="…"+d.slice(s-15,s):m=d.slice(0,s);var p;o+15<d.length?p=d.slice(o,o+15)+"…":p=d.slice(o),a+=m+h+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Oe.prototype),this.position=s,s!=null&&o!=null&&(this.length=o-s),this.rawMessage=t}}var pA=/([A-Z])/g,gA=e=>e.replace(pA,"-$1").toLowerCase(),bA={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},vA=/[&><"']/g,cr=e=>String(e).replace(vA,t=>bA[t]),Uu=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?Uu(e.body[0]):e:e.type==="font"?Uu(e.body):e,yA=new Set(["mathord","textord","atom"]),li=e=>yA.has(Uu(e).type),xA=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},td={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function wA(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function kA(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return wA(t)}function SA(e,t,n,a){var s=n[t];e[t]=s!==void 0?a.processor?a.processor(s):s:kA(a)}class tp{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(td)){var a=td[n];a&&SA(this,n,t,a)}}reportNonstrict(t,n,a){var s=this.strict;if(typeof s=="function"&&(s=s(t,n,a)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Oe("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var s=this.strict;if(typeof s=="function")try{s=s(t,n,a)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=xA(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class qi{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Ra[EA[this.id]]}sub(){return Ra[TA[this.id]]}fracNum(){return Ra[CA[this.id]]}fracDen(){return Ra[NA[this.id]]}cramp(){return Ra[RA[this.id]]}text(){return Ra[AA[this.id]]}isTight(){return this.size>=2}}var np=0,nd=1,po=2,ii=3,Gl=4,ia=5,vo=6,br=7,Ra=[new qi(np,0,!1),new qi(nd,0,!0),new qi(po,1,!1),new qi(ii,1,!0),new qi(Gl,2,!1),new qi(ia,2,!0),new qi(vo,3,!1),new qi(br,3,!0)],EA=[Gl,ia,Gl,ia,vo,br,vo,br],TA=[ia,ia,ia,ia,br,br,br,br],CA=[po,ii,Gl,ia,vo,br,vo,br],NA=[ii,ii,ia,ia,br,br,br,br],RA=[nd,nd,ii,ii,ia,ia,br,br],AA=[np,nd,po,ii,po,ii,po,ii],xt={DISPLAY:Ra[np],TEXT:Ra[po],SCRIPT:Ra[Gl],SCRIPTSCRIPT:Ra[vo]},Qm=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function IA(e){for(var t=0;t<Qm.length;t++)for(var n=Qm[t],a=0;a<n.blocks.length;a++){var s=n.blocks[a];if(e>=s[0]&&e<=s[1])return n.name}return null}var Fu=[];Qm.forEach(e=>e.blocks.forEach(t=>Fu.push(...t)));function w6(e){for(var t=0;t<Fu.length;t+=2)if(e>=Fu[t]&&e<=Fu[t+1])return!0;return!1}var Kn=e=>e+" "+e,uo=80,_A=function(t,n){return"M95,"+(622+t+n)+`
52
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
53
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
54
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
55
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
56
+ c69,-144,104.5,-217.7,106.5,-221
57
+ l`+t/2.075+" -"+t+`
58
+ c5.3,-9.3,12,-14,20,-14
59
+ H400000v`+(40+t)+`H845.2724
60
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
61
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
62
+ M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},MA=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
63
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
64
+ c340,-704.7,510.7,-1060.3,512,-1067
65
+ l`+t/2.084+" -"+t+`
66
+ c4.7,-7.3,11,-11,19,-11
67
+ H40000v`+(40+t)+`H1012.3
68
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
69
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
70
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
71
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
72
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},OA=function(t,n){return"M983 "+(10+t+n)+`
73
+ l`+t/3.13+" -"+t+`
74
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
75
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
76
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
77
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
78
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
79
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
80
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
81
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},DA=function(t,n){return"M424,"+(2398+t+n)+`
82
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
83
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
84
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
85
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
86
+ l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
87
+ v`+(40+t)+`H1014.6
88
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
89
+ c-2,6,-10,9,-24,9
90
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
91
+ h400000v`+(40+t)+"h-400000z"},jA=function(t,n){return"M473,"+(2713+t+n)+`
92
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
93
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
94
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
95
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
96
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
97
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
98
+ 606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},LA=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},zA=function(t,n,a){var s=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
99
+ H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
100
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
101
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
102
+ 219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},BA=function(t,n,a){n=1e3*n;var s="";switch(t){case"sqrtMain":s=_A(n,uo);break;case"sqrtSize1":s=MA(n,uo);break;case"sqrtSize2":s=OA(n,uo);break;case"sqrtSize3":s=DA(n,uo);break;case"sqrtSize4":s=jA(n,uo);break;case"sqrtTall":s=zA(n,uo,a)}return s},qA=function(t,n){switch(t){case"⎜":return Kn("M291 0 H417 V"+n+" H291z");case"∣":return Kn("M145 0 H188 V"+n+" H145z");case"∥":return Kn("M145 0 H188 V"+n+" H145z")+Kn("M367 0 H410 V"+n+" H367z");case"⎟":return Kn("M457 0 H583 V"+n+" H457z");case"⎢":return Kn("M319 0 H403 V"+n+" H319z");case"⎥":return Kn("M263 0 H347 V"+n+" H263z");case"⎪":return Kn("M384 0 H504 V"+n+" H384z");case"⏐":return Kn("M312 0 H355 V"+n+" H312z");case"‖":return Kn("M257 0 H300 V"+n+" H257z")+Kn("M478 0 H521 V"+n+" H478z");default:return""}},pv={doubleleftarrow:`M262 157
103
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
104
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
105
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
106
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
107
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
108
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
109
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
110
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
111
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
112
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
113
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
114
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
115
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
116
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
117
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
118
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
119
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
120
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
121
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
122
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
123
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
124
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
125
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
126
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
127
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
128
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
129
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
130
+ 435 0h399565z`,leftgroupunder:`M400000 262
131
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
132
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
133
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
134
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
135
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
136
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
137
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
138
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
139
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
140
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
141
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
142
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
143
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
144
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
145
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
146
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
147
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
148
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Kn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Kn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Kn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Kn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
149
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
150
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
151
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Kn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
152
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
153
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
154
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
155
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
156
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
157
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
158
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
159
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
160
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
161
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
162
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
163
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
164
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
165
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
166
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
167
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
168
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
169
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
170
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
171
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
172
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
173
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
174
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
175
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
176
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
177
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
178
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
179
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
180
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
181
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
182
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
183
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
184
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
185
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
186
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
187
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
188
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
189
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
190
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
191
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
192
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
193
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
194
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
195
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
196
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
197
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
198
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
199
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
200
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Kn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Kn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Kn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
201
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
202
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
203
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
204
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
205
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
206
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
207
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
208
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
209
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
210
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
211
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
212
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
213
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
214
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
215
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
216
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
217
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
218
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
219
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
220
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
221
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
222
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
223
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
224
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
225
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
226
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
227
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
228
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
229
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
230
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
231
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
232
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
233
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
234
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
235
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
236
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
237
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
238
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
239
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
240
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
241
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
242
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
243
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
244
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
245
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
246
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
247
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
248
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
249
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
250
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
251
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
252
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
253
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
254
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
255
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
256
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
257
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
258
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
259
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
260
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
261
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
262
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
263
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
264
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
265
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
266
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
267
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
268
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
269
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
270
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
271
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
272
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
273
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},HA=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
274
+ H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
275
+ M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
276
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
277
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
278
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
279
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
280
+ M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
281
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
282
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
283
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
284
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
285
+ M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
286
+ M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
287
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
288
+ -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
289
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
290
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
291
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
292
+ l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
293
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
294
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
295
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
296
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
297
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
298
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
299
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
300
+ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
301
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function UA(e){return"toText"in e}class Eo{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(UA(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Jm={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},FA={ex:!0,em:!0,mu:!0},k6=function(t){return typeof t!="string"&&(t=t.unit),t in Jm||t in FA||t==="ex"},En=function(t,n){var a;if(t.unit in Jm)a=Jm[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")a=s.fontMetrics().xHeight;else if(t.unit==="em")a=s.fontMetrics().quad;else throw new Oe("Invalid unit: '"+t.unit+"'");s!==n&&(a*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Be=function(t){return+t.toFixed(4)+"em"},Gi=function(t){return t.filter(n=>n).join(" ")},rp=function(t){var n="";for(var a of Object.keys(t)){var s=t[a];s!==void 0&&(n+=gA(a)+":"+s+";")}return n},S6=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var s=n.getColor();s&&(this.style.color=s)}},E6=function(t){var n=document.createElement(t);n.className=Gi(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},$A=/[\s"'>/=\x00-\x1f]/,T6=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+cr(Gi(this.classes))+'"');var a=rp(this.style);a&&(n+=' style="'+cr(a)+'"');for(var s of Object.keys(this.attributes)){if($A.test(s))throw new Oe("Invalid attribute name '"+s+"'");n+=" "+s+'="'+cr(this.attributes[s])+'"'}n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class To{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,S6.call(this,t,a,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return E6.call(this,"span")}toMarkup(){return T6.call(this,"span")}}class yd{constructor(t,n,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,S6.call(this,n,s),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return E6.call(this,"a")}toMarkup(){return T6.call(this,"a")}}class PA{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+cr(this.src)+'"'+(' alt="'+cr(this.alt)+'"'),n=rp(this.style);return n&&(t+=' style="'+cr(n)+'"'),t+="'/>",t}}var GA={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Pr{constructor(t,n,a,s,o,c,d,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=s||0,this.skew=o||0,this.width=c||0,this.classes=d||[],this.style=h||{},this.maxFontSize=0;var m=IA(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=GA[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Be(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Gi(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=cr(Gi(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+Be(this.italic)+";"),a+=rp(this.style),a&&(t=!0,n+=' style="'+cr(a)+'"');var s=cr(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class si{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+cr(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Vi{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",pv[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+cr(this.alternate)+'"/>':'<path d="'+cr(pv[this.pathName])+'"/>'}}class e1{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+cr(this.attributes[n])+'"';return t+="/>",t}}function VA(e){if(e instanceof Pr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function KA(e){if(e instanceof To)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var YA=e=>e instanceof To||e instanceof yd||e instanceof Eo,Aa={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Eu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},gv={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function C6(e,t){Aa[e]=t}function ap(e,t,n){if(!Aa[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),s=Aa[t][a];if(!s&&e[0]in gv&&(a=gv[e[0]].charCodeAt(0),s=Aa[t][a]),!s&&n==="text"&&w6(a)&&(s=Aa[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var fh={};function WA(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!fh[t]){var n=fh[t]={cssEmPerMu:Eu.quad[t]/18};for(var a in Eu)Eu.hasOwnProperty(a)&&(n[a]=Eu[a][t])}return fh[t]}var vn={math:{},text:{}};function k(e,t,n,a,s,o){vn[e][s]={font:t,group:n,replace:a},o&&a&&(vn[e][a]=vn[e][s])}var E="math",Ae="text",O="main",te="ams",yn="accent-token",Ve="bin",vr="close",Co="inner",ut="mathord",Fn="op-token",Gr="open",rc="punct",ne="rel",ci="spacing",ce="textord";k(E,O,ne,"≡","\\equiv",!0);k(E,O,ne,"≺","\\prec",!0);k(E,O,ne,"≻","\\succ",!0);k(E,O,ne,"∼","\\sim",!0);k(E,O,ne,"⊥","\\perp");k(E,O,ne,"⪯","\\preceq",!0);k(E,O,ne,"⪰","\\succeq",!0);k(E,O,ne,"≃","\\simeq",!0);k(E,O,ne,"∣","\\mid",!0);k(E,O,ne,"≪","\\ll",!0);k(E,O,ne,"≫","\\gg",!0);k(E,O,ne,"≍","\\asymp",!0);k(E,O,ne,"∥","\\parallel");k(E,O,ne,"⋈","\\bowtie",!0);k(E,O,ne,"⌣","\\smile",!0);k(E,O,ne,"⊑","\\sqsubseteq",!0);k(E,O,ne,"⊒","\\sqsupseteq",!0);k(E,O,ne,"≐","\\doteq",!0);k(E,O,ne,"⌢","\\frown",!0);k(E,O,ne,"∋","\\ni",!0);k(E,O,ne,"∝","\\propto",!0);k(E,O,ne,"⊢","\\vdash",!0);k(E,O,ne,"⊣","\\dashv",!0);k(E,O,ne,"∋","\\owns");k(E,O,rc,".","\\ldotp");k(E,O,rc,"⋅","\\cdotp");k(E,O,rc,"⋅","·");k(Ae,O,ce,"⋅","·");k(E,O,ce,"#","\\#");k(Ae,O,ce,"#","\\#");k(E,O,ce,"&","\\&");k(Ae,O,ce,"&","\\&");k(E,O,ce,"ℵ","\\aleph",!0);k(E,O,ce,"∀","\\forall",!0);k(E,O,ce,"ℏ","\\hbar",!0);k(E,O,ce,"∃","\\exists",!0);k(E,O,ce,"∇","\\nabla",!0);k(E,O,ce,"♭","\\flat",!0);k(E,O,ce,"ℓ","\\ell",!0);k(E,O,ce,"♮","\\natural",!0);k(E,O,ce,"♣","\\clubsuit",!0);k(E,O,ce,"℘","\\wp",!0);k(E,O,ce,"♯","\\sharp",!0);k(E,O,ce,"♢","\\diamondsuit",!0);k(E,O,ce,"ℜ","\\Re",!0);k(E,O,ce,"♡","\\heartsuit",!0);k(E,O,ce,"ℑ","\\Im",!0);k(E,O,ce,"♠","\\spadesuit",!0);k(E,O,ce,"§","\\S",!0);k(Ae,O,ce,"§","\\S");k(E,O,ce,"¶","\\P",!0);k(Ae,O,ce,"¶","\\P");k(E,O,ce,"†","\\dag");k(Ae,O,ce,"†","\\dag");k(Ae,O,ce,"†","\\textdagger");k(E,O,ce,"‡","\\ddag");k(Ae,O,ce,"‡","\\ddag");k(Ae,O,ce,"‡","\\textdaggerdbl");k(E,O,vr,"⎱","\\rmoustache",!0);k(E,O,Gr,"⎰","\\lmoustache",!0);k(E,O,vr,"⟯","\\rgroup",!0);k(E,O,Gr,"⟮","\\lgroup",!0);k(E,O,Ve,"∓","\\mp",!0);k(E,O,Ve,"⊖","\\ominus",!0);k(E,O,Ve,"⊎","\\uplus",!0);k(E,O,Ve,"⊓","\\sqcap",!0);k(E,O,Ve,"∗","\\ast");k(E,O,Ve,"⊔","\\sqcup",!0);k(E,O,Ve,"◯","\\bigcirc",!0);k(E,O,Ve,"∙","\\bullet",!0);k(E,O,Ve,"‡","\\ddagger");k(E,O,Ve,"≀","\\wr",!0);k(E,O,Ve,"⨿","\\amalg");k(E,O,Ve,"&","\\And");k(E,O,ne,"⟵","\\longleftarrow",!0);k(E,O,ne,"⇐","\\Leftarrow",!0);k(E,O,ne,"⟸","\\Longleftarrow",!0);k(E,O,ne,"⟶","\\longrightarrow",!0);k(E,O,ne,"⇒","\\Rightarrow",!0);k(E,O,ne,"⟹","\\Longrightarrow",!0);k(E,O,ne,"↔","\\leftrightarrow",!0);k(E,O,ne,"⟷","\\longleftrightarrow",!0);k(E,O,ne,"⇔","\\Leftrightarrow",!0);k(E,O,ne,"⟺","\\Longleftrightarrow",!0);k(E,O,ne,"↦","\\mapsto",!0);k(E,O,ne,"⟼","\\longmapsto",!0);k(E,O,ne,"↗","\\nearrow",!0);k(E,O,ne,"↩","\\hookleftarrow",!0);k(E,O,ne,"↪","\\hookrightarrow",!0);k(E,O,ne,"↘","\\searrow",!0);k(E,O,ne,"↼","\\leftharpoonup",!0);k(E,O,ne,"⇀","\\rightharpoonup",!0);k(E,O,ne,"↙","\\swarrow",!0);k(E,O,ne,"↽","\\leftharpoondown",!0);k(E,O,ne,"⇁","\\rightharpoondown",!0);k(E,O,ne,"↖","\\nwarrow",!0);k(E,O,ne,"⇌","\\rightleftharpoons",!0);k(E,te,ne,"≮","\\nless",!0);k(E,te,ne,"","\\@nleqslant");k(E,te,ne,"","\\@nleqq");k(E,te,ne,"⪇","\\lneq",!0);k(E,te,ne,"≨","\\lneqq",!0);k(E,te,ne,"","\\@lvertneqq");k(E,te,ne,"⋦","\\lnsim",!0);k(E,te,ne,"⪉","\\lnapprox",!0);k(E,te,ne,"⊀","\\nprec",!0);k(E,te,ne,"⋠","\\npreceq",!0);k(E,te,ne,"⋨","\\precnsim",!0);k(E,te,ne,"⪹","\\precnapprox",!0);k(E,te,ne,"≁","\\nsim",!0);k(E,te,ne,"","\\@nshortmid");k(E,te,ne,"∤","\\nmid",!0);k(E,te,ne,"⊬","\\nvdash",!0);k(E,te,ne,"⊭","\\nvDash",!0);k(E,te,ne,"⋪","\\ntriangleleft");k(E,te,ne,"⋬","\\ntrianglelefteq",!0);k(E,te,ne,"⊊","\\subsetneq",!0);k(E,te,ne,"","\\@varsubsetneq");k(E,te,ne,"⫋","\\subsetneqq",!0);k(E,te,ne,"","\\@varsubsetneqq");k(E,te,ne,"≯","\\ngtr",!0);k(E,te,ne,"","\\@ngeqslant");k(E,te,ne,"","\\@ngeqq");k(E,te,ne,"⪈","\\gneq",!0);k(E,te,ne,"≩","\\gneqq",!0);k(E,te,ne,"","\\@gvertneqq");k(E,te,ne,"⋧","\\gnsim",!0);k(E,te,ne,"⪊","\\gnapprox",!0);k(E,te,ne,"⊁","\\nsucc",!0);k(E,te,ne,"⋡","\\nsucceq",!0);k(E,te,ne,"⋩","\\succnsim",!0);k(E,te,ne,"⪺","\\succnapprox",!0);k(E,te,ne,"≆","\\ncong",!0);k(E,te,ne,"","\\@nshortparallel");k(E,te,ne,"∦","\\nparallel",!0);k(E,te,ne,"⊯","\\nVDash",!0);k(E,te,ne,"⋫","\\ntriangleright");k(E,te,ne,"⋭","\\ntrianglerighteq",!0);k(E,te,ne,"","\\@nsupseteqq");k(E,te,ne,"⊋","\\supsetneq",!0);k(E,te,ne,"","\\@varsupsetneq");k(E,te,ne,"⫌","\\supsetneqq",!0);k(E,te,ne,"","\\@varsupsetneqq");k(E,te,ne,"⊮","\\nVdash",!0);k(E,te,ne,"⪵","\\precneqq",!0);k(E,te,ne,"⪶","\\succneqq",!0);k(E,te,ne,"","\\@nsubseteqq");k(E,te,Ve,"⊴","\\unlhd");k(E,te,Ve,"⊵","\\unrhd");k(E,te,ne,"↚","\\nleftarrow",!0);k(E,te,ne,"↛","\\nrightarrow",!0);k(E,te,ne,"⇍","\\nLeftarrow",!0);k(E,te,ne,"⇏","\\nRightarrow",!0);k(E,te,ne,"↮","\\nleftrightarrow",!0);k(E,te,ne,"⇎","\\nLeftrightarrow",!0);k(E,te,ne,"△","\\vartriangle");k(E,te,ce,"ℏ","\\hslash");k(E,te,ce,"▽","\\triangledown");k(E,te,ce,"◊","\\lozenge");k(E,te,ce,"Ⓢ","\\circledS");k(E,te,ce,"®","\\circledR");k(Ae,te,ce,"®","\\circledR");k(E,te,ce,"∡","\\measuredangle",!0);k(E,te,ce,"∄","\\nexists");k(E,te,ce,"℧","\\mho");k(E,te,ce,"Ⅎ","\\Finv",!0);k(E,te,ce,"⅁","\\Game",!0);k(E,te,ce,"‵","\\backprime");k(E,te,ce,"▲","\\blacktriangle");k(E,te,ce,"▼","\\blacktriangledown");k(E,te,ce,"■","\\blacksquare");k(E,te,ce,"⧫","\\blacklozenge");k(E,te,ce,"★","\\bigstar");k(E,te,ce,"∢","\\sphericalangle",!0);k(E,te,ce,"∁","\\complement",!0);k(E,te,ce,"ð","\\eth",!0);k(Ae,O,ce,"ð","ð");k(E,te,ce,"╱","\\diagup");k(E,te,ce,"╲","\\diagdown");k(E,te,ce,"□","\\square");k(E,te,ce,"□","\\Box");k(E,te,ce,"◊","\\Diamond");k(E,te,ce,"¥","\\yen",!0);k(Ae,te,ce,"¥","\\yen",!0);k(E,te,ce,"✓","\\checkmark",!0);k(Ae,te,ce,"✓","\\checkmark");k(E,te,ce,"ℶ","\\beth",!0);k(E,te,ce,"ℸ","\\daleth",!0);k(E,te,ce,"ℷ","\\gimel",!0);k(E,te,ce,"ϝ","\\digamma",!0);k(E,te,ce,"ϰ","\\varkappa");k(E,te,Gr,"┌","\\@ulcorner",!0);k(E,te,vr,"┐","\\@urcorner",!0);k(E,te,Gr,"└","\\@llcorner",!0);k(E,te,vr,"┘","\\@lrcorner",!0);k(E,te,ne,"≦","\\leqq",!0);k(E,te,ne,"⩽","\\leqslant",!0);k(E,te,ne,"⪕","\\eqslantless",!0);k(E,te,ne,"≲","\\lesssim",!0);k(E,te,ne,"⪅","\\lessapprox",!0);k(E,te,ne,"≊","\\approxeq",!0);k(E,te,Ve,"⋖","\\lessdot");k(E,te,ne,"⋘","\\lll",!0);k(E,te,ne,"≶","\\lessgtr",!0);k(E,te,ne,"⋚","\\lesseqgtr",!0);k(E,te,ne,"⪋","\\lesseqqgtr",!0);k(E,te,ne,"≑","\\doteqdot");k(E,te,ne,"≓","\\risingdotseq",!0);k(E,te,ne,"≒","\\fallingdotseq",!0);k(E,te,ne,"∽","\\backsim",!0);k(E,te,ne,"⋍","\\backsimeq",!0);k(E,te,ne,"⫅","\\subseteqq",!0);k(E,te,ne,"⋐","\\Subset",!0);k(E,te,ne,"⊏","\\sqsubset",!0);k(E,te,ne,"≼","\\preccurlyeq",!0);k(E,te,ne,"⋞","\\curlyeqprec",!0);k(E,te,ne,"≾","\\precsim",!0);k(E,te,ne,"⪷","\\precapprox",!0);k(E,te,ne,"⊲","\\vartriangleleft");k(E,te,ne,"⊴","\\trianglelefteq");k(E,te,ne,"⊨","\\vDash",!0);k(E,te,ne,"⊪","\\Vvdash",!0);k(E,te,ne,"⌣","\\smallsmile");k(E,te,ne,"⌢","\\smallfrown");k(E,te,ne,"≏","\\bumpeq",!0);k(E,te,ne,"≎","\\Bumpeq",!0);k(E,te,ne,"≧","\\geqq",!0);k(E,te,ne,"⩾","\\geqslant",!0);k(E,te,ne,"⪖","\\eqslantgtr",!0);k(E,te,ne,"≳","\\gtrsim",!0);k(E,te,ne,"⪆","\\gtrapprox",!0);k(E,te,Ve,"⋗","\\gtrdot");k(E,te,ne,"⋙","\\ggg",!0);k(E,te,ne,"≷","\\gtrless",!0);k(E,te,ne,"⋛","\\gtreqless",!0);k(E,te,ne,"⪌","\\gtreqqless",!0);k(E,te,ne,"≖","\\eqcirc",!0);k(E,te,ne,"≗","\\circeq",!0);k(E,te,ne,"≜","\\triangleq",!0);k(E,te,ne,"∼","\\thicksim");k(E,te,ne,"≈","\\thickapprox");k(E,te,ne,"⫆","\\supseteqq",!0);k(E,te,ne,"⋑","\\Supset",!0);k(E,te,ne,"⊐","\\sqsupset",!0);k(E,te,ne,"≽","\\succcurlyeq",!0);k(E,te,ne,"⋟","\\curlyeqsucc",!0);k(E,te,ne,"≿","\\succsim",!0);k(E,te,ne,"⪸","\\succapprox",!0);k(E,te,ne,"⊳","\\vartriangleright");k(E,te,ne,"⊵","\\trianglerighteq");k(E,te,ne,"⊩","\\Vdash",!0);k(E,te,ne,"∣","\\shortmid");k(E,te,ne,"∥","\\shortparallel");k(E,te,ne,"≬","\\between",!0);k(E,te,ne,"⋔","\\pitchfork",!0);k(E,te,ne,"∝","\\varpropto");k(E,te,ne,"◀","\\blacktriangleleft");k(E,te,ne,"∴","\\therefore",!0);k(E,te,ne,"∍","\\backepsilon");k(E,te,ne,"▶","\\blacktriangleright");k(E,te,ne,"∵","\\because",!0);k(E,te,ne,"⋘","\\llless");k(E,te,ne,"⋙","\\gggtr");k(E,te,Ve,"⊲","\\lhd");k(E,te,Ve,"⊳","\\rhd");k(E,te,ne,"≂","\\eqsim",!0);k(E,O,ne,"⋈","\\Join");k(E,te,ne,"≑","\\Doteq",!0);k(E,te,Ve,"∔","\\dotplus",!0);k(E,te,Ve,"∖","\\smallsetminus");k(E,te,Ve,"⋒","\\Cap",!0);k(E,te,Ve,"⋓","\\Cup",!0);k(E,te,Ve,"⩞","\\doublebarwedge",!0);k(E,te,Ve,"⊟","\\boxminus",!0);k(E,te,Ve,"⊞","\\boxplus",!0);k(E,te,Ve,"⋇","\\divideontimes",!0);k(E,te,Ve,"⋉","\\ltimes",!0);k(E,te,Ve,"⋊","\\rtimes",!0);k(E,te,Ve,"⋋","\\leftthreetimes",!0);k(E,te,Ve,"⋌","\\rightthreetimes",!0);k(E,te,Ve,"⋏","\\curlywedge",!0);k(E,te,Ve,"⋎","\\curlyvee",!0);k(E,te,Ve,"⊝","\\circleddash",!0);k(E,te,Ve,"⊛","\\circledast",!0);k(E,te,Ve,"⋅","\\centerdot");k(E,te,Ve,"⊺","\\intercal",!0);k(E,te,Ve,"⋒","\\doublecap");k(E,te,Ve,"⋓","\\doublecup");k(E,te,Ve,"⊠","\\boxtimes",!0);k(E,te,ne,"⇢","\\dashrightarrow",!0);k(E,te,ne,"⇠","\\dashleftarrow",!0);k(E,te,ne,"⇇","\\leftleftarrows",!0);k(E,te,ne,"⇆","\\leftrightarrows",!0);k(E,te,ne,"⇚","\\Lleftarrow",!0);k(E,te,ne,"↞","\\twoheadleftarrow",!0);k(E,te,ne,"↢","\\leftarrowtail",!0);k(E,te,ne,"↫","\\looparrowleft",!0);k(E,te,ne,"⇋","\\leftrightharpoons",!0);k(E,te,ne,"↶","\\curvearrowleft",!0);k(E,te,ne,"↺","\\circlearrowleft",!0);k(E,te,ne,"↰","\\Lsh",!0);k(E,te,ne,"⇈","\\upuparrows",!0);k(E,te,ne,"↿","\\upharpoonleft",!0);k(E,te,ne,"⇃","\\downharpoonleft",!0);k(E,O,ne,"⊶","\\origof",!0);k(E,O,ne,"⊷","\\imageof",!0);k(E,te,ne,"⊸","\\multimap",!0);k(E,te,ne,"↭","\\leftrightsquigarrow",!0);k(E,te,ne,"⇉","\\rightrightarrows",!0);k(E,te,ne,"⇄","\\rightleftarrows",!0);k(E,te,ne,"↠","\\twoheadrightarrow",!0);k(E,te,ne,"↣","\\rightarrowtail",!0);k(E,te,ne,"↬","\\looparrowright",!0);k(E,te,ne,"↷","\\curvearrowright",!0);k(E,te,ne,"↻","\\circlearrowright",!0);k(E,te,ne,"↱","\\Rsh",!0);k(E,te,ne,"⇊","\\downdownarrows",!0);k(E,te,ne,"↾","\\upharpoonright",!0);k(E,te,ne,"⇂","\\downharpoonright",!0);k(E,te,ne,"⇝","\\rightsquigarrow",!0);k(E,te,ne,"⇝","\\leadsto");k(E,te,ne,"⇛","\\Rrightarrow",!0);k(E,te,ne,"↾","\\restriction");k(E,O,ce,"‘","`");k(E,O,ce,"$","\\$");k(Ae,O,ce,"$","\\$");k(Ae,O,ce,"$","\\textdollar");k(E,O,ce,"%","\\%");k(Ae,O,ce,"%","\\%");k(E,O,ce,"_","\\_");k(Ae,O,ce,"_","\\_");k(Ae,O,ce,"_","\\textunderscore");k(E,O,ce,"∠","\\angle",!0);k(E,O,ce,"∞","\\infty",!0);k(E,O,ce,"′","\\prime");k(E,O,ce,"△","\\triangle");k(E,O,ce,"Γ","\\Gamma",!0);k(E,O,ce,"Δ","\\Delta",!0);k(E,O,ce,"Θ","\\Theta",!0);k(E,O,ce,"Λ","\\Lambda",!0);k(E,O,ce,"Ξ","\\Xi",!0);k(E,O,ce,"Π","\\Pi",!0);k(E,O,ce,"Σ","\\Sigma",!0);k(E,O,ce,"Υ","\\Upsilon",!0);k(E,O,ce,"Φ","\\Phi",!0);k(E,O,ce,"Ψ","\\Psi",!0);k(E,O,ce,"Ω","\\Omega",!0);k(E,O,ce,"A","Α");k(E,O,ce,"B","Β");k(E,O,ce,"E","Ε");k(E,O,ce,"Z","Ζ");k(E,O,ce,"H","Η");k(E,O,ce,"I","Ι");k(E,O,ce,"K","Κ");k(E,O,ce,"M","Μ");k(E,O,ce,"N","Ν");k(E,O,ce,"O","Ο");k(E,O,ce,"P","Ρ");k(E,O,ce,"T","Τ");k(E,O,ce,"X","Χ");k(E,O,ce,"¬","\\neg",!0);k(E,O,ce,"¬","\\lnot");k(E,O,ce,"⊤","\\top");k(E,O,ce,"⊥","\\bot");k(E,O,ce,"∅","\\emptyset");k(E,te,ce,"∅","\\varnothing");k(E,O,ut,"α","\\alpha",!0);k(E,O,ut,"β","\\beta",!0);k(E,O,ut,"γ","\\gamma",!0);k(E,O,ut,"δ","\\delta",!0);k(E,O,ut,"ϵ","\\epsilon",!0);k(E,O,ut,"ζ","\\zeta",!0);k(E,O,ut,"η","\\eta",!0);k(E,O,ut,"θ","\\theta",!0);k(E,O,ut,"ι","\\iota",!0);k(E,O,ut,"κ","\\kappa",!0);k(E,O,ut,"λ","\\lambda",!0);k(E,O,ut,"μ","\\mu",!0);k(E,O,ut,"ν","\\nu",!0);k(E,O,ut,"ξ","\\xi",!0);k(E,O,ut,"ο","\\omicron",!0);k(E,O,ut,"π","\\pi",!0);k(E,O,ut,"ρ","\\rho",!0);k(E,O,ut,"σ","\\sigma",!0);k(E,O,ut,"τ","\\tau",!0);k(E,O,ut,"υ","\\upsilon",!0);k(E,O,ut,"ϕ","\\phi",!0);k(E,O,ut,"χ","\\chi",!0);k(E,O,ut,"ψ","\\psi",!0);k(E,O,ut,"ω","\\omega",!0);k(E,O,ut,"ε","\\varepsilon",!0);k(E,O,ut,"ϑ","\\vartheta",!0);k(E,O,ut,"ϖ","\\varpi",!0);k(E,O,ut,"ϱ","\\varrho",!0);k(E,O,ut,"ς","\\varsigma",!0);k(E,O,ut,"φ","\\varphi",!0);k(E,O,Ve,"∗","*",!0);k(E,O,Ve,"+","+");k(E,O,Ve,"−","-",!0);k(E,O,Ve,"⋅","\\cdot",!0);k(E,O,Ve,"∘","\\circ",!0);k(E,O,Ve,"÷","\\div",!0);k(E,O,Ve,"±","\\pm",!0);k(E,O,Ve,"×","\\times",!0);k(E,O,Ve,"∩","\\cap",!0);k(E,O,Ve,"∪","\\cup",!0);k(E,O,Ve,"∖","\\setminus",!0);k(E,O,Ve,"∧","\\land");k(E,O,Ve,"∨","\\lor");k(E,O,Ve,"∧","\\wedge",!0);k(E,O,Ve,"∨","\\vee",!0);k(E,O,ce,"√","\\surd");k(E,O,Gr,"⟨","\\langle",!0);k(E,O,Gr,"∣","\\lvert");k(E,O,Gr,"∥","\\lVert");k(E,O,vr,"?","?");k(E,O,vr,"!","!");k(E,O,vr,"⟩","\\rangle",!0);k(E,O,vr,"∣","\\rvert");k(E,O,vr,"∥","\\rVert");k(E,O,ne,"=","=");k(E,O,ne,":",":");k(E,O,ne,"≈","\\approx",!0);k(E,O,ne,"≅","\\cong",!0);k(E,O,ne,"≥","\\ge");k(E,O,ne,"≥","\\geq",!0);k(E,O,ne,"←","\\gets");k(E,O,ne,">","\\gt",!0);k(E,O,ne,"∈","\\in",!0);k(E,O,ne,"","\\@not");k(E,O,ne,"⊂","\\subset",!0);k(E,O,ne,"⊃","\\supset",!0);k(E,O,ne,"⊆","\\subseteq",!0);k(E,O,ne,"⊇","\\supseteq",!0);k(E,te,ne,"⊈","\\nsubseteq",!0);k(E,te,ne,"⊉","\\nsupseteq",!0);k(E,O,ne,"⊨","\\models");k(E,O,ne,"←","\\leftarrow",!0);k(E,O,ne,"≤","\\le");k(E,O,ne,"≤","\\leq",!0);k(E,O,ne,"<","\\lt",!0);k(E,O,ne,"→","\\rightarrow",!0);k(E,O,ne,"→","\\to");k(E,te,ne,"≱","\\ngeq",!0);k(E,te,ne,"≰","\\nleq",!0);k(E,O,ci," ","\\ ");k(E,O,ci," ","\\space");k(E,O,ci," ","\\nobreakspace");k(Ae,O,ci," ","\\ ");k(Ae,O,ci," "," ");k(Ae,O,ci," ","\\space");k(Ae,O,ci," ","\\nobreakspace");k(E,O,ci,"","\\nobreak");k(E,O,ci,"","\\allowbreak");k(E,O,rc,",",",");k(E,O,rc,";",";");k(E,te,Ve,"⊼","\\barwedge",!0);k(E,te,Ve,"⊻","\\veebar",!0);k(E,O,Ve,"⊙","\\odot",!0);k(E,O,Ve,"⊕","\\oplus",!0);k(E,O,Ve,"⊗","\\otimes",!0);k(E,O,ce,"∂","\\partial",!0);k(E,O,Ve,"⊘","\\oslash",!0);k(E,te,Ve,"⊚","\\circledcirc",!0);k(E,te,Ve,"⊡","\\boxdot",!0);k(E,O,Ve,"△","\\bigtriangleup");k(E,O,Ve,"▽","\\bigtriangledown");k(E,O,Ve,"†","\\dagger");k(E,O,Ve,"⋄","\\diamond");k(E,O,Ve,"⋆","\\star");k(E,O,Ve,"◃","\\triangleleft");k(E,O,Ve,"▹","\\triangleright");k(E,O,Gr,"{","\\{");k(Ae,O,ce,"{","\\{");k(Ae,O,ce,"{","\\textbraceleft");k(E,O,vr,"}","\\}");k(Ae,O,ce,"}","\\}");k(Ae,O,ce,"}","\\textbraceright");k(E,O,Gr,"{","\\lbrace");k(E,O,vr,"}","\\rbrace");k(E,O,Gr,"[","\\lbrack",!0);k(Ae,O,ce,"[","\\lbrack",!0);k(E,O,vr,"]","\\rbrack",!0);k(Ae,O,ce,"]","\\rbrack",!0);k(E,O,Gr,"(","\\lparen",!0);k(E,O,vr,")","\\rparen",!0);k(Ae,O,ce,"<","\\textless",!0);k(Ae,O,ce,">","\\textgreater",!0);k(E,O,Gr,"⌊","\\lfloor",!0);k(E,O,vr,"⌋","\\rfloor",!0);k(E,O,Gr,"⌈","\\lceil",!0);k(E,O,vr,"⌉","\\rceil",!0);k(E,O,ce,"\\","\\backslash");k(E,O,ce,"∣","|");k(E,O,ce,"∣","\\vert");k(Ae,O,ce,"|","\\textbar",!0);k(E,O,ce,"∥","\\|");k(E,O,ce,"∥","\\Vert");k(Ae,O,ce,"∥","\\textbardbl");k(Ae,O,ce,"~","\\textasciitilde");k(Ae,O,ce,"\\","\\textbackslash");k(Ae,O,ce,"^","\\textasciicircum");k(E,O,ne,"↑","\\uparrow",!0);k(E,O,ne,"⇑","\\Uparrow",!0);k(E,O,ne,"↓","\\downarrow",!0);k(E,O,ne,"⇓","\\Downarrow",!0);k(E,O,ne,"↕","\\updownarrow",!0);k(E,O,ne,"⇕","\\Updownarrow",!0);k(E,O,Fn,"∐","\\coprod");k(E,O,Fn,"⋁","\\bigvee");k(E,O,Fn,"⋀","\\bigwedge");k(E,O,Fn,"⨄","\\biguplus");k(E,O,Fn,"⋂","\\bigcap");k(E,O,Fn,"⋃","\\bigcup");k(E,O,Fn,"∫","\\int");k(E,O,Fn,"∫","\\intop");k(E,O,Fn,"∬","\\iint");k(E,O,Fn,"∭","\\iiint");k(E,O,Fn,"∏","\\prod");k(E,O,Fn,"∑","\\sum");k(E,O,Fn,"⨂","\\bigotimes");k(E,O,Fn,"⨁","\\bigoplus");k(E,O,Fn,"⨀","\\bigodot");k(E,O,Fn,"∮","\\oint");k(E,O,Fn,"∯","\\oiint");k(E,O,Fn,"∰","\\oiiint");k(E,O,Fn,"⨆","\\bigsqcup");k(E,O,Fn,"∫","\\smallint");k(Ae,O,Co,"…","\\textellipsis");k(E,O,Co,"…","\\mathellipsis");k(Ae,O,Co,"…","\\ldots",!0);k(E,O,Co,"…","\\ldots",!0);k(E,O,Co,"⋯","\\@cdots",!0);k(E,O,Co,"⋱","\\ddots",!0);k(E,O,ce,"⋮","\\varvdots");k(Ae,O,ce,"⋮","\\varvdots");k(E,O,yn,"ˊ","\\acute");k(E,O,yn,"ˋ","\\grave");k(E,O,yn,"¨","\\ddot");k(E,O,yn,"~","\\tilde");k(E,O,yn,"ˉ","\\bar");k(E,O,yn,"˘","\\breve");k(E,O,yn,"ˇ","\\check");k(E,O,yn,"^","\\hat");k(E,O,yn,"⃗","\\vec");k(E,O,yn,"˙","\\dot");k(E,O,yn,"˚","\\mathring");k(E,O,ut,"","\\@imath");k(E,O,ut,"","\\@jmath");k(E,O,ce,"ı","ı");k(E,O,ce,"ȷ","ȷ");k(Ae,O,ce,"ı","\\i",!0);k(Ae,O,ce,"ȷ","\\j",!0);k(Ae,O,ce,"ß","\\ss",!0);k(Ae,O,ce,"æ","\\ae",!0);k(Ae,O,ce,"œ","\\oe",!0);k(Ae,O,ce,"ø","\\o",!0);k(Ae,O,ce,"Æ","\\AE",!0);k(Ae,O,ce,"Œ","\\OE",!0);k(Ae,O,ce,"Ø","\\O",!0);k(Ae,O,yn,"ˊ","\\'");k(Ae,O,yn,"ˋ","\\`");k(Ae,O,yn,"ˆ","\\^");k(Ae,O,yn,"˜","\\~");k(Ae,O,yn,"ˉ","\\=");k(Ae,O,yn,"˘","\\u");k(Ae,O,yn,"˙","\\.");k(Ae,O,yn,"¸","\\c");k(Ae,O,yn,"˚","\\r");k(Ae,O,yn,"ˇ","\\v");k(Ae,O,yn,"¨",'\\"');k(Ae,O,yn,"˝","\\H");k(Ae,O,yn,"◯","\\textcircled");var N6={"--":!0,"---":!0,"``":!0,"''":!0};k(Ae,O,ce,"–","--",!0);k(Ae,O,ce,"–","\\textendash");k(Ae,O,ce,"—","---",!0);k(Ae,O,ce,"—","\\textemdash");k(Ae,O,ce,"‘","`",!0);k(Ae,O,ce,"‘","\\textquoteleft");k(Ae,O,ce,"’","'",!0);k(Ae,O,ce,"’","\\textquoteright");k(Ae,O,ce,"“","``",!0);k(Ae,O,ce,"“","\\textquotedblleft");k(Ae,O,ce,"”","''",!0);k(Ae,O,ce,"”","\\textquotedblright");k(E,O,ce,"°","\\degree",!0);k(Ae,O,ce,"°","\\degree");k(Ae,O,ce,"°","\\textdegree",!0);k(E,O,ce,"£","\\pounds");k(E,O,ce,"£","\\mathsterling",!0);k(Ae,O,ce,"£","\\pounds");k(Ae,O,ce,"£","\\textsterling",!0);k(E,te,ce,"✠","\\maltese");k(Ae,te,ce,"✠","\\maltese");var bv='0123456789/@."';for(var hh=0;hh<bv.length;hh++){var vv=bv.charAt(hh);k(E,O,ce,vv,vv)}var yv='0123456789!@*()-=+";:?/.,';for(var mh=0;mh<yv.length;mh++){var xv=yv.charAt(mh);k(Ae,O,ce,xv,xv)}var rd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var ph=0;ph<rd.length;ph++){var Tu=rd.charAt(ph);k(E,O,ut,Tu,Tu),k(Ae,O,ce,Tu,Tu)}k(E,te,ce,"C","ℂ");k(Ae,te,ce,"C","ℂ");k(E,te,ce,"H","ℍ");k(Ae,te,ce,"H","ℍ");k(E,te,ce,"N","ℕ");k(Ae,te,ce,"N","ℕ");k(E,te,ce,"P","ℙ");k(Ae,te,ce,"P","ℙ");k(E,te,ce,"Q","ℚ");k(Ae,te,ce,"Q","ℚ");k(E,te,ce,"R","ℝ");k(Ae,te,ce,"R","ℝ");k(E,te,ce,"Z","ℤ");k(Ae,te,ce,"Z","ℤ");k(E,O,ut,"h","ℎ");k(Ae,O,ut,"h","ℎ");var pt;for(var mr=0;mr<rd.length;mr++){var Rn=rd.charAt(mr);pt=String.fromCharCode(55349,56320+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56372+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56424+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56580+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56684+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56736+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56788+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56840+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56944+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),mr<26&&(pt=String.fromCharCode(55349,56632+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt),pt=String.fromCharCode(55349,56476+mr),k(E,O,ut,Rn,pt),k(Ae,O,ce,Rn,pt))}pt="𝕜";k(E,O,ut,"k",pt);k(Ae,O,ce,"k",pt);for(var gs=0;gs<10;gs++){var Hi=gs.toString();pt=String.fromCharCode(55349,57294+gs),k(E,O,ut,Hi,pt),k(Ae,O,ce,Hi,pt),pt=String.fromCharCode(55349,57314+gs),k(E,O,ut,Hi,pt),k(Ae,O,ce,Hi,pt),pt=String.fromCharCode(55349,57324+gs),k(E,O,ut,Hi,pt),k(Ae,O,ce,Hi,pt),pt=String.fromCharCode(55349,57334+gs),k(E,O,ut,Hi,pt),k(Ae,O,ce,Hi,pt)}var t1="ÐÞþ";for(var gh=0;gh<t1.length;gh++){var Cu=t1.charAt(gh);k(E,O,ut,Cu,Cu),k(Ae,O,ce,Cu,Cu)}var n1={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},wv={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},kv={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},ZA={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},xs={mathClass:"",textClass:"",font:""},Sv={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Ev={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Tv={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},r1={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},a1={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Cv={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},i1={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},Nv=[n1,n1,wv,wv,kv,kv,ZA,xs,xs,xs,Sv,Sv,Ev,Ev,Tv,Tv,r1,r1,a1,a1,Cv,Cv,xs,xs,i1,i1],XA=[n1,xs,r1,a1,i1],QA=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var s=Math.floor((a-119808)/26);return Nv[s]}else if(120782<=a&&a<=120831){var o=Math.floor((a-120782)/10);return XA[o]}else{if(a===120485||a===120486)return Nv[0];if(120486<a&&a<120782)return xs;throw new Oe("Unsupported character: "+e)}},xd=function(t,n,a){if(vn[a][t]){var s=vn[a][t].replace;s&&(t=s)}return{value:t,metrics:ap(t,n,a)}},pr=function(t,n,a,s,o){var c=xd(t,n,a),d=c.metrics;t=c.value;var h;if(d){var m=d.italic;(a==="text"||s&&s.font==="mathit")&&(m=0),h=new Pr(t,d.height,d.depth,m,d.skew,d.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),h=new Pr(t,0,0,0,0,0,o);if(s){h.maxFontSize=s.sizeMultiplier,s.style.isTight()&&h.classes.push("mtight");var p=s.getColor();p&&(h.style.color=p)}return h},ip=function(t,n,a,s){return s===void 0&&(s=[]),a.font==="boldsymbol"&&xd(t,"Main-Bold",n).metrics?pr(t,"Main-Bold",n,a,s.concat(["mathbf"])):t==="\\"||vn[n][t].font==="main"?pr(t,"Main-Regular",n,a,s):pr(t,"AMS-Regular",n,a,s.concat(["amsrm"]))},JA=function(t,n,a){return a!=="textord"&&xd(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},wd=function(t,n,a){var s=t.mode,o=t.text,c=["mord"],{font:d,fontFamily:h,fontWeight:m,fontShape:p}=n,g=s==="math"||s==="text"&&!!d,x=g?d:h,y="",S="";if(o.charCodeAt(0)===55349){var T=QA(o);y=T.font,S=T[s+"Class"]}if(y)return pr(o,y,s,n,c.concat(S));if(x){var N,R;if(x==="boldsymbol"){var M=JA(o,s,a);N=M.fontName,R=[M.fontClass]}else g?(N=s1[d].fontName,R=[d]):(N=Nu(h,m,p),R=[h,m,p]);if(xd(o,N,s).metrics)return pr(o,N,s,n,c.concat(R));if(N6.hasOwnProperty(o)&&N.slice(0,10)==="Typewriter"){for(var _=[],P=0;P<o.length;P++)_.push(pr(o[P],N,s,n,c.concat(R)));return ui(_)}}if(a==="mathord")return pr(o,"Math-Italic",s,n,c.concat(["mathnormal"]));if(a==="textord"){var F=vn[s][o]&&vn[s][o].font;if(F==="ams"){var A=Nu("amsrm",m,p);return pr(o,A,s,n,c.concat("amsrm",m,p))}else if(F==="main"||!F){var L=Nu("textrm",m,p);return pr(o,L,s,n,c.concat(m,p))}else{var Z=Nu(F,m,p);return pr(o,Z,s,n,c.concat(Z,m,p))}}else throw new Error("unexpected type: "+a+" in makeOrd")},eI=(e,t)=>{if(Gi(e.classes)!==Gi(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},R6=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Pr&&a instanceof Pr&&eI(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},sp=function(t){for(var n=0,a=0,s=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>s&&(s=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=s},_e=function(t,n,a,s){var o=new To(t,n,a,s);return sp(o),o},Ki=(e,t,n,a)=>new To(e,t,n,a),yo=function(t,n,a){var s=_e([t],[],n);return s.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Be(s.height),s.maxFontSize=1,s},tI=function(t,n,a,s){var o=new yd(t,n,a,s);return sp(o),o},ui=function(t){var n=new Eo(t);return sp(n),n},xo=function(t,n){return t instanceof Eo?_e([],[t],n):t},nI=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],s=-n[0].shift-n[0].elem.depth,o=s,c=1;c<n.length;c++){var d=-n[c].shift-o-n[c].elem.depth,h=d-(n[c-1].elem.height+n[c-1].elem.depth);o=o+d,a.push({type:"kern",size:h}),a.push(n[c])}return{children:a,depth:s}}var m;if(t.positionType==="top"){for(var p=t.positionData,g=0;g<t.children.length;g++){var x=t.children[g];p-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}m=p}else if(t.positionType==="bottom")m=-t.positionData;else{var y=t.children[0];if(y.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")m=-y.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")m=-y.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:m}},Xt=function(t,n){for(var{children:a,depth:s}=nI(t),o=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var h=d.elem;o=Math.max(o,h.maxFontSize,h.height)}}o+=2;var m=_e(["pstrut"],[]);m.style.height=Be(o);for(var p=[],g=s,x=s,y=s,S=0;S<a.length;S++){var T=a[S];if(T.type==="kern")y+=T.size;else{var N=T.elem,R=T.wrapperClasses||[],M=T.wrapperStyle||{},_=_e(R,[m,N],void 0,M);_.style.top=Be(-o-y-N.depth),T.marginLeft&&(_.style.marginLeft=T.marginLeft),T.marginRight&&(_.style.marginRight=T.marginRight),p.push(_),y+=N.height+N.depth}g=Math.min(g,y),x=Math.max(x,y)}var P=_e(["vlist"],p);P.style.height=Be(x);var F;if(g<0){var A=_e([],[]),L=_e(["vlist"],[A]);L.style.height=Be(-g);var Z=_e(["vlist-s"],[new Pr("​")]);F=[_e(["vlist-r"],[P,Z]),_e(["vlist-r"],[L])]}else F=[_e(["vlist-r"],[P])];var U=_e(["vlist-t"],F);return F.length===2&&U.classes.push("vlist-t2"),U.height=x,U.depth=-g,U},A6=(e,t)=>{var n=_e(["mspace"],[],t),a=En(e,t);return n.style.marginRight=Be(a),n},Nu=(e,t,n)=>{var a,s;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",a+"-"+s},s1={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},I6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},_6=function(t,n){var[a,s,o]=I6[t],c=new Vi(a),d=new si([c],{width:Be(s),height:Be(o),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),h=Ki(["overlay"],[d],n);return h.height=o,h.style.height=Be(o),h.style.width=Be(s),h},Sn={number:3,unit:"mu"},bs={number:4,unit:"mu"},Ja={number:5,unit:"mu"},rI={mord:{mop:Sn,mbin:bs,mrel:Ja,minner:Sn},mop:{mord:Sn,mop:Sn,mrel:Ja,minner:Sn},mbin:{mord:bs,mop:bs,mopen:bs,minner:bs},mrel:{mord:Ja,mop:Ja,mopen:Ja,minner:Ja},mopen:{},mclose:{mop:Sn,mbin:bs,mrel:Ja,minner:Sn},mpunct:{mord:Sn,mop:Sn,mrel:Ja,mopen:Sn,mclose:Sn,mpunct:Sn,minner:Sn},minner:{mord:Sn,mop:Sn,mbin:bs,mrel:Ja,mopen:Sn,mpunct:Sn,minner:Sn}},aI={mord:{mop:Sn},mop:{mord:Sn,mop:Sn},mbin:{},mrel:{},mopen:{},mclose:{mop:Sn},mpunct:{},minner:{mop:Sn}},M6={},ad={},id={};function Ge(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:s},h=0;h<n.length;++h)M6[n[h]]=d;t&&(o&&(ad[t]=o),c&&(id[t]=c))}function As(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Ge({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var sd=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Hn=function(t){return t.type==="ordgroup"?t.body:[t]},iI=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),sI=new Set(["rightmost","mrel","mclose","mpunct"]),oI={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT},lI={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Yn=function(t,n,a,s){s===void 0&&(s=[null,null]);for(var o=[],c=0;c<t.length;c++){var d=Qt(t[c],n);if(d instanceof Eo){var h=d.children;o.push(...h)}else o.push(d)}if(R6(o),!a)return o;var m=n;if(t.length===1){var p=t[0];p.type==="sizing"?m=n.havingSize(p.size):p.type==="styling"&&(m=n.havingStyle(oI[p.style]))}var g=_e([s[0]||"leftmost"],[],n),x=_e([s[1]||"rightmost"],[],n),y=a==="root";return o1(o,(S,T)=>{var N=T.classes[0],R=S.classes[0];N==="mbin"&&sI.has(R)?T.classes[0]="mord":R==="mbin"&&iI.has(N)&&(S.classes[0]="mord")},{node:g},x,y),o1(o,(S,T)=>{var N,R,M=c1(T),_=c1(S),P=M&&_?S.hasClass("mtight")?(N=aI[M])==null?void 0:N[_]:(R=rI[M])==null?void 0:R[_]:null;if(P)return A6(P,m)},{node:g},x,y),o},o1=function(t,n,a,s,o){s&&t.push(s);for(var c=0;c<t.length;c++){var d=t[c],h=O6(d);if(h){o1(h.children,n,a,null,o);continue}var m=!d.hasClass("mspace");if(m){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}m?a.node=d:o&&d.hasClass("newline")&&(a.node=_e(["leftmost"])),a.insertAfter=(g=>x=>{t.splice(g+1,0,x),c++})(c)}s&&t.pop()},O6=function(t){return t instanceof Eo||t instanceof yd||t instanceof To&&t.hasClass("enclosing")?t:null},l1=function(t,n){var a=O6(t);if(a){var s=a.children;if(s.length){if(n==="right")return l1(s[s.length-1],"right");if(n==="left")return l1(s[0],"left")}}return t},c1=function(t,n){if(!t)return null;n&&(t=l1(t,n));var a=t.classes[0];return lI[a]||null},Vl=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return _e(n.concat(a))},Qt=function(t,n,a){if(!t)return _e();if(ad[t.type]){var s=ad[t.type](t,n);if(a&&n.size!==a.size){s=_e(n.sizingClasses(a),[s],n);var o=n.sizeMultiplier/a.sizeMultiplier;s.height*=o,s.depth*=o}return s}else throw new Oe("Got group of unknown type: '"+t.type+"'")};function Ru(e,t){var n=_e(["base"],e,t),a=_e(["strut"]);return a.style.height=Be(n.height+n.depth),n.depth&&(a.style.verticalAlign=Be(-n.depth)),n.children.unshift(a),n}function u1(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Yn(e,t,"root"),s;a.length===2&&a[1].hasClass("tag")&&(s=a.pop());for(var o=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var h=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(h=!0);h||(o.push(Ru(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(Ru(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(Ru(c,t));var m;n?(m=Ru(Yn(n,t,!0),t),m.classes=["tag"],o.push(m)):s&&o.push(s);var p=_e(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),m){var g=m.children[0];g.style.height=Be(p.height+p.depth),p.depth&&(g.style.verticalAlign=Be(-p.depth))}return p}function D6(e){return new Eo(e)}class Le{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Gi(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Un&&this.children[a+1]instanceof Un){for(var s=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Un;)s+=this.children[++a].toText();t.appendChild(new Un(s).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=cr(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+cr(Gi(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Un{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return cr(this.toText())}toText(){return this.text}}class j6{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Be(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Be(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var cI=new Set(["\\imath","\\jmath"]),uI=new Set(["mrow","mtable"]),sa=function(t,n,a){return vn[n][t]&&vn[n][t].replace&&t.charCodeAt(0)!==55349&&!(N6.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=vn[n][t].replace),new Un(t)},op=function(t){return t.length===1?t[0]:new Le("mrow",t)},dI={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},lp=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,s=dI[n];if(s)return typeof s=="function"?s(e):s;var o=e.text;if(cI.has(o))return null;if(vn[a][o]){var c=vn[a][o].replace;c&&(o=c)}var d=s1[n].fontName;return ap(o,d,a)?s1[n].variant:null};function bh(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Un&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Un&&n.text===","}else return!1}var Vr=function(t,n,a){if(t.length===1){var s=dn(t[0],n);return a&&s instanceof Le&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var o=[],c,d=0;d<t.length;d++){var h=dn(t[d],n);if(h instanceof Le&&c instanceof Le){if(h.type==="mtext"&&c.type==="mtext"&&h.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...h.children);continue}else if(h.type==="mn"&&c.type==="mn"){c.children.push(...h.children);continue}else if(bh(h)&&c.type==="mn"){c.children.push(...h.children);continue}else if(h.type==="mn"&&bh(c))h.children=[...c.children,...h.children],o.pop();else if((h.type==="msup"||h.type==="msub")&&h.children.length>=1&&(c.type==="mn"||bh(c))){var m=h.children[0];m instanceof Le&&m.type==="mn"&&(m.children=[...c.children,...m.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof Un&&p.text==="̸"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var g=h.children[0];g instanceof Un&&g.text.length>0&&(g.text=g.text.slice(0,1)+"̸"+g.text.slice(1),o.pop())}}}o.push(h),c=h}return o},Yi=function(t,n,a){return op(Vr(t,n,a))},dn=function(t,n){if(!t)return new Le("mrow");if(id[t.type])return id[t.type](t,n);throw new Oe("Got group of unknown type: '"+t.type+"'")};function Rv(e,t,n,a,s){var o=Vr(e,n),c;o.length===1&&o[0]instanceof Le&&uI.has(o[0].type)?c=o[0]:c=new Le("mrow",o);var d=new Le("annotation",[new Un(t)]);d.setAttribute("encoding","application/x-tex");var h=new Le("semantics",[c,d]),m=new Le("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var p=s?"katex":"katex-mathml";return _e([p],[m])}var fI=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Av=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Iv=function(t,n){return n.size<2?t:fI[t-1][n.size-1]};class ti{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||ti.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Av[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new ti(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Iv(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Av[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Iv(ti.BASESIZE,t);return this.size===n&&this.textSize===ti.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==ti.BASESIZE?["sizing","reset-size"+this.size,"size"+ti.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=WA(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}ti.BASESIZE=6;var L6=function(t){return new ti({style:t.displayMode?xt.DISPLAY:xt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},z6=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=_e(a,[t])}return t},hI=function(t,n,a){var s=L6(a),o;if(a.output==="mathml")return Rv(t,n,s,a.displayMode,!0);if(a.output==="html"){var c=u1(t,s);o=_e(["katex"],[c])}else{var d=Rv(t,n,s,a.displayMode,!1),h=u1(t,s);o=_e(["katex"],[d,h])}return z6(o,a)},mI=function(t,n,a){var s=L6(a),o=u1(t,s),c=_e(["katex"],[o]);return z6(c,a)},pI={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},kd=function(t){var n=new Le("mo",[new Un(pI[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},gI={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},bI=new Set(["widehat","widecheck","widetilde","utilde"]),Sd=function(t,n){function a(){var d=4e5,h=t.label.slice(1);if(bI.has(h)&&"base"in t){var m=t.base.type==="ordgroup"?t.base.body.length:1,p,g,x;if(m>5)h==="widehat"||h==="widecheck"?(p=420,d=2364,x=.42,g=h+"4"):(p=312,d=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][m];h==="widehat"||h==="widecheck"?(d=[0,1062,2364,2364,2364][y],p=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=h+y):(d=[0,600,1033,2339,2340][y],p=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],g="tilde"+y)}var S=new Vi(g),T=new si([S],{width:"100%",height:Be(x),viewBox:"0 0 "+d+" "+p,preserveAspectRatio:"none"});return{span:Ki([],[T],n),minWidth:0,height:x}}else{var N=[],R=gI[h];if(!R)throw new Error('No SVG data for "'+h+'".');var[M,_,P]=R,F=P/1e3,A=M.length,L,Z;if(A===1){if(R.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+h+'".');L=["hide-tail"],Z=[R[3]]}else if(A===2)L=["halfarrow-left","halfarrow-right"],Z=["xMinYMin","xMaxYMin"];else if(A===3)L=["brace-left","brace-center","brace-right"],Z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
302
+ `+A+" children.");for(var U=0;U<A;U++){var $=new Vi(M[U]),q=new si([$],{width:"400em",height:Be(F),viewBox:"0 0 "+d+" "+P,preserveAspectRatio:Z[U]+" slice"}),W=Ki([L[U]],[q],n);if(A===1)return{span:W,minWidth:_,height:F};W.style.height=Be(F),N.push(W)}return{span:_e(["stretchy"],N,n),minWidth:_,height:F}}}var{span:s,minWidth:o,height:c}=a();return s.height=c,s.style.height=Be(c),o>0&&(s.style.minWidth=Be(o)),s},vI=function(t,n,a,s,o){var c,d=t.height+t.depth+a+s;if(/fbox|color|angl/.test(n)){if(c=_e(["stretchy",n],[],o),n==="fbox"){var h=o.color&&o.getColor();h&&(c.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(n)&&m.push(new e1({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&m.push(new e1({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new si(m,{width:"100%",height:Be(d)});c=Ki([],[p],o)}return c.height=d,c.style.height=Be(d),c},yI={bin:1,close:1,inner:1,open:1,punct:1,rel:1},xI={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function wI(e){return e in yI}function _t(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ed(e){var t=Td(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Td(e){return e&&(e.type==="atom"||xI.hasOwnProperty(e.type))?e:null}var B6=e=>{if(e instanceof Pr)return e;if(YA(e)&&e.children.length===1)return B6(e.children[0])},cp=(e,t)=>{var n,a,s;e&&e.type==="supsub"?(a=_t(e.base,"accent"),n=a.base,e.base=n,s=KA(Qt(e,t)),e.base=a):(a=_t(e,"accent"),n=a.base);var o=Qt(n,t.havingCrampedStyle()),c=a.isShifty&&li(n),d=0;if(c){var h,m;d=(h=(m=B6(o))==null?void 0:m.skew)!=null?h:0}var p=a.label==="\\c",g=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),x;if(a.isStretchy)x=Sd(a,t),x=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+Be(2*d)+")",marginLeft:Be(2*d)}:void 0}]});else{var y,S;a.label==="\\vec"?(y=_6("vec",t),S=I6.vec[1]):(y=wd({mode:a.mode,text:a.label},t,"textord"),y=VA(y),y.italic=0,S=y.width,p&&(g+=y.depth)),x=_e(["accent-body"],[y]);var T=a.label==="\\textcircled";T&&(x.classes.push("accent-full"),g=o.height);var N=d;T||(N-=S/2),x.style.left=Be(N),a.label==="\\textcircled"&&(x.style.top=".2em"),x=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-g},{type:"elem",elem:x}]})}var R=_e(["mord","accent"],[x],t);return s?(s.children[0]=R,s.height=Math.max(R.height,s.height),s.classes[0]="mord",s):R},q6=(e,t)=>{var n=e.isStretchy?kd(e.label):new Le("mo",[sa(e.label,e.mode)]),a=new Le("mover",[dn(e.base,t),n]);return a.setAttribute("accent","true"),a},kI=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ge({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=sd(t[0]),a=!kI.test(e.funcName),s=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:s,base:n}},htmlBuilder:cp,mathmlBuilder:q6});Ge({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:cp,mathmlBuilder:q6});Ge({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:s}},htmlBuilder:(e,t)=>{var n=Qt(e.base,t),a=Sd(e,t),s=e.label==="\\utilde"?.12:0,o=Xt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return _e(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=kd(e.label),a=new Le("munder",[dn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Au=e=>{var t=new Le("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ge({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:s}=e;return{type:"xArrow",mode:a.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),s=xo(Qt(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=xo(Qt(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=Sd(e,t),h=-t.fontMetrics().axisHeight+.5*d.height,m=-t.fontMetrics().axisHeight-.5*d.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(m-=s.depth);var p;if(c){var g=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=Xt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:m},{type:"elem",elem:d,shift:h,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:g}]})}else p=Xt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:m},{type:"elem",elem:d,shift:h,wrapperClasses:["svg-align"]}]});return _e(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=kd(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var s=Au(dn(e.body,t));if(e.below){var o=Au(dn(e.below,t));a=new Le("munderover",[n,o,s])}else a=new Le("mover",[n,s])}else if(e.below){var c=Au(dn(e.below,t));a=new Le("munder",[n,c])}else a=Au(),a=new Le("mover",[n,a]);return a}});function H6(e,t){var n=Yn(e.body,t,!0);return _e([e.mclass],n,t)}function U6(e,t){var n,a=Vr(e.body,t);return e.mclass==="minner"?n=new Le("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Le("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Le("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ge({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Hn(s),isCharacterBox:li(s)}},htmlBuilder:H6,mathmlBuilder:U6});var Cd=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ge({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Cd(t[0]),body:Hn(t[1]),isCharacterBox:li(t[1])}}});Ge({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,s=t[1],o=t[0],c;a!=="\\stackrel"?c=Cd(s):c="mrel";var d={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Hn(s)},h={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[h],isCharacterBox:li(h)}},htmlBuilder:H6,mathmlBuilder:U6});Ge({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Cd(t[0]),body:Hn(t[0])}},htmlBuilder(e,t){var n=Yn(e.body,t,!0),a=_e([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Vr(e.body,t),a=new Le("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var SI={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},_v=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Mv=e=>e.type==="textord"&&e.text==="@",EI=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function TI(e,t,n){var a=SI[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),h={type:"ordgroup",mode:"math",body:[s,c,d]};return n.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function CI(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Oe("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],s=[a],o=0;o<t.length;o++){for(var c=t[o],d=_v(),h=0;h<c.length;h++)if(!Mv(c[h]))d.body.push(c[h]);else{a.push(d),h+=1;var m=Ed(c[h]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(m))if("<>AV".includes(m))for(var g=0;g<2;g++){for(var x=!0,y=h+1;y<c.length;y++){if(EI(c[y],m)){x=!1,h=y;break}if(Mv(c[y]))throw new Oe("Missing a "+m+" character to complete a CD arrow.",c[y]);p[g].body.push(c[y])}if(x)throw new Oe("Missing a "+m+" character to complete a CD arrow.",c[h])}else throw new Oe('Expected one of "<>AV=|." after @',c[h]);var S=TI(m,p,e),T={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};a.push(T),d=_v()}o%2===0?a.push(d):a.shift(),a=[],s.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var N=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:N,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Ge({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=xo(Qt(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Be(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Le("mrow",[dn(e.label,t)]);return n=new Le("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Le("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ge({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=xo(Qt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Le("mrow",[dn(e.fragment,t)])}});Ge({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=_t(t[0],"ordgroup"),s=a.body,o="",c=0;c<s.length;c++){var d=_t(s[c],"textord");o+=d.text}var h=parseInt(o),m;if(isNaN(h))throw new Oe("\\@char has non-numeric argument "+o);if(h<0||h>=1114111)throw new Oe("\\@char with invalid code point "+o);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:n.mode,text:m}}});var F6=(e,t)=>{var n=Yn(e.body,t.withColor(e.color),!1);return ui(n)},$6=(e,t)=>{var n=Vr(e.body,t.withColor(e.color)),a=new Le("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Ge({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=_t(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:a,body:Hn(s)}},htmlBuilder:F6,mathmlBuilder:$6});Ge({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,s=_t(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:s,body:o}},htmlBuilder:F6,mathmlBuilder:$6});Ge({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,s=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:s&&_t(s,"size").value}},htmlBuilder(e,t){var n=_e(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Be(En(e.size,t)))),n},mathmlBuilder(e,t){var n=new Le("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Be(En(e.size,t)))),n}});var d1={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},P6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Oe("Expected a control sequence",e);return t},NI=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},G6=(e,t,n,a)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,a)};Ge({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(d1[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=d1[a.text]),_t(t.parseFunction(),"internal");throw new Oe("Invalid token after macro prefix",a)}});Ge({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),s=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Oe("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Oe('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Oe('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Oe("Expected a macro definition");d[o].push(a.text)}var{tokens:h}=t.gullet.consumeArg();return c&&h.unshift(c),(n==="\\edef"||n==="\\xdef")&&(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(s,{tokens:h,numArgs:o,delimiters:d},n===d1[n]),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=P6(t.gullet.popToken());t.gullet.consumeSpaces();var s=NI(t);return G6(t,a,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=P6(t.gullet.popToken()),s=t.gullet.popToken(),o=t.gullet.popToken();return G6(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var Cl=function(t,n,a){var s=vn.math[t]&&vn.math[t].replace,o=ap(s||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},up=function(t,n,a,s){var o=a.havingBaseStyle(n),c=_e(s.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},V6=function(t,n,a){var s=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Be(o),t.height-=o,t.depth+=o},RI=function(t,n,a,s,o,c){var d=pr(t,"Main-Regular",o,s),h=up(d,n,s,c);return V6(h,s,n),h},AI=function(t,n,a,s){return pr(t,"Size"+n+"-Regular",a,s)},K6=function(t,n,a,s,o,c){var d=AI(t,n,o,s),h=up(_e(["delimsizing","size"+n],[d],s),xt.TEXT,s,c);return a&&V6(h,s,xt.TEXT),h},vh=function(t,n,a){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var o=_e(["delimsizinginner",s],[_e([],[pr(t,n,a)])]);return{type:"elem",elem:o}},yh=function(t,n,a){var s=Aa["Size4-Regular"][t.charCodeAt(0)]?Aa["Size4-Regular"][t.charCodeAt(0)][4]:Aa["Size1-Regular"][t.charCodeAt(0)][4],o=new Vi("inner",qA(t,Math.round(1e3*n))),c=new si([o],{width:Be(s),height:Be(n),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=Ki([],[c],a);return d.height=n,d.style.height=Be(n),d.style.width=Be(s),{type:"elem",elem:d}},f1=.008,Iu={type:"kern",size:-1*f1},II=new Set(["|","\\lvert","\\rvert","\\vert"]),_I=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Y6=function(t,n,a,s,o,c){var d,h,m,p,g="",x=0;d=m=p=t,h=null;var y="Size1-Regular";t==="\\uparrow"?m=p="⏐":t==="\\Uparrow"?m=p="‖":t==="\\downarrow"?d=m="⏐":t==="\\Downarrow"?d=m="‖":t==="\\updownarrow"?(d="\\uparrow",m="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",m="‖",p="\\Downarrow"):II.has(t)?(m="∣",g="vert",x=333):_I.has(t)?(m="∥",g="doublevert",x=556):t==="["||t==="\\lbrack"?(d="⎡",m="⎢",p="⎣",y="Size4-Regular",g="lbrack",x=667):t==="]"||t==="\\rbrack"?(d="⎤",m="⎥",p="⎦",y="Size4-Regular",g="rbrack",x=667):t==="\\lfloor"||t==="⌊"?(m=d="⎢",p="⎣",y="Size4-Regular",g="lfloor",x=667):t==="\\lceil"||t==="⌈"?(d="⎡",m=p="⎢",y="Size4-Regular",g="lceil",x=667):t==="\\rfloor"||t==="⌋"?(m=d="⎥",p="⎦",y="Size4-Regular",g="rfloor",x=667):t==="\\rceil"||t==="⌉"?(d="⎤",m=p="⎥",y="Size4-Regular",g="rceil",x=667):t==="("||t==="\\lparen"?(d="⎛",m="⎜",p="⎝",y="Size4-Regular",g="lparen",x=875):t===")"||t==="\\rparen"?(d="⎞",m="⎟",p="⎠",y="Size4-Regular",g="rparen",x=875):t==="\\{"||t==="\\lbrace"?(d="⎧",h="⎨",p="⎩",m="⎪",y="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",h="⎬",p="⎭",m="⎪",y="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",m="⎪",y="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",m="⎪",y="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",m="⎪",y="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",m="⎪",y="Size4-Regular");var S=Cl(d,y,o),T=S.height+S.depth,N=Cl(m,y,o),R=N.height+N.depth,M=Cl(p,y,o),_=M.height+M.depth,P=0,F=1;if(h!==null){var A=Cl(h,y,o);P=A.height+A.depth,F=2}var L=T+_+P,Z=Math.max(0,Math.ceil((n-L)/(F*R))),U=L+Z*F*R,$=s.fontMetrics().axisHeight;a&&($*=s.sizeMultiplier);var q=U/2-$,W=[];if(g.length>0){var oe=U-T-_,J=Math.round(U*1e3),H=HA(g,Math.round(oe*1e3)),I=new Vi(g,H),K=Be(x/1e3),X=Be(J/1e3),be=new si([I],{width:K,height:X,viewBox:"0 0 "+x+" "+J}),j=Ki([],[be],s);j.height=J/1e3,j.style.width=K,j.style.height=X,W.push({type:"elem",elem:j})}else{if(W.push(vh(p,y,o)),W.push(Iu),h===null){var G=U-T-_+2*f1;W.push(yh(m,G,s))}else{var Y=(U-T-_-P)/2+2*f1;W.push(yh(m,Y,s)),W.push(Iu),W.push(vh(h,y,o)),W.push(Iu),W.push(yh(m,Y,s))}W.push(Iu),W.push(vh(d,y,o))}var D=s.havingBaseStyle(xt.TEXT),ye=Xt({positionType:"bottom",positionData:q,children:W});return up(_e(["delimsizing","mult"],[ye],D),xt.TEXT,s,c)},xh=80,wh=.08,kh=function(t,n,a,s,o){var c=BA(t,s,a),d=new Vi(t,c),h=new si([d],{width:"400em",height:Be(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return Ki(["hide-tail"],[h],o)},MI=function(t,n){var a=n.havingBaseSizing(),s=J6("\\surd",t*a.sizeMultiplier,Q6,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,h,m,p,g;return s.type==="small"?(p=1e3+1e3*c+xh,t<1?o=1:t<1.4&&(o=.7),h=(1+c+wh)/o,m=(1+c)/o,d=kh("sqrtMain",h,p,c,n),d.style.minWidth="0.853em",g=.833/o):s.type==="large"?(p=(1e3+xh)*Dl[s.size],m=(Dl[s.size]+c)/o,h=(Dl[s.size]+c+wh)/o,d=kh("sqrtSize"+s.size,h,p,c,n),d.style.minWidth="1.02em",g=1/o):(h=t+c+wh,m=t+c,p=Math.floor(1e3*t+c)+xh,d=kh("sqrtTall",h,p,c,n),d.style.minWidth="0.742em",g=1.056),d.height=m,d.style.height=Be(h),{span:d,advanceWidth:g,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},W6=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),OI=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Z6=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Dl=[0,1.2,1.8,2.4,3],X6=function(t,n,a,s,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),W6.has(t)||Z6.has(t))return K6(t,n,!1,a,s,o);if(OI.has(t))return Y6(t,Dl[n],!1,a,s,o);throw new Oe("Illegal delimiter: '"+t+"'")},DI=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],jI=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"stack"}],Q6=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],LI=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},J6=function(t,n,a,s){for(var o=Math.min(2,3-s.style.size),c=o;c<a.length;c++){var d=a[c];if(d.type==="stack")break;var h=Cl(t,LI(d),"math"),m=h.height+h.depth;if(d.type==="small"){var p=s.havingBaseStyle(d.style);m*=p.sizeMultiplier}if(m>n)return d}return a[a.length-1]},h1=function(t,n,a,s,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;Z6.has(t)?d=DI:W6.has(t)?d=Q6:d=jI;var h=J6(t,n,d,s);return h.type==="small"?RI(t,h.style,a,s,o,c):h.type==="large"?K6(t,h.size,a,s,o,c):Y6(t,n,a,s,o,c)},Sh=function(t,n,a,s,o,c){var d=s.fontMetrics().axisHeight*s.sizeMultiplier,h=901,m=5/s.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),g=Math.max(p/500*h,2*p-m);return h1(t,g,!0,s,o,c)},Ov={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},zI=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Dv(e){return"isMiddle"in e}function Nd(e,t){var n=Td(e);if(n&&zI.has(n.text))return n;throw n?new Oe("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Oe("Invalid delimiter type '"+e.type+"'",e)}Ge({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Nd(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Ov[e.funcName].size,mclass:Ov[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?_e([e.mclass]):X6(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(sa(e.delim,e.mode));var n=new Le("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Be(Dl[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function jv(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ge({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Oe("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Nd(t[0],e).text,color:n}}});Ge({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nd(t[0],e),a=e.parser;++a.leftrightDepth;var s=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=_t(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:s,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{jv(e);for(var n=Yn(e.body,t,!0,["mopen","mclose"]),a=0,s=0,o=!1,c=0;c<n.length;c++){var d=n[c];Dv(d)?o=!0:(a=Math.max(n[c].height,a),s=Math.max(n[c].depth,s))}a*=t.sizeMultiplier,s*=t.sizeMultiplier;var h;if(e.left==="."?h=Vl(t,["mopen"]):h=Sh(e.left,a,s,t,e.mode,["mopen"]),n.unshift(h),o)for(var m=1;m<n.length;m++){var p=n[m];if(Dv(p)){var g=p.isMiddle;n[m]=Sh(g.delim,a,s,g.options,e.mode,[])}}var x;if(e.right===".")x=Vl(t,["mclose"]);else{var y=e.rightColor?t.withColor(e.rightColor):t;x=Sh(e.right,a,s,y,e.mode,["mclose"])}return n.push(x),_e(["minner"],n,t)},mathmlBuilder:(e,t)=>{jv(e);var n=Vr(e.body,t);if(e.left!=="."){var a=new Le("mo",[sa(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var s=new Le("mo",[sa(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return op(n)}});Ge({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Nd(t[0],e);if(!e.parser.leftrightDepth)throw new Oe("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Vl(t,[]):(n=X6(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?sa("|","text"):sa(e.delim,e.mode),a=new Le("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Rd=(e,t)=>{var n=xo(Qt(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,o,c,d=li(e.body);if(a==="sout")o=_e(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/s,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var h=En({number:.6,unit:"pt"},t),m=En({number:.35,unit:"ex"},t),p=t.havingBaseSizing();s=s/p.sizeMultiplier;var g=n.height+n.depth+h+m;n.style.paddingLeft=Be(g/2+h);var x=Math.floor(1e3*g*s),y=LA(x),S=new si([new Vi("phase",y)],{width:"400em",height:Be(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});o=Ki(["hide-tail"],[S],t),o.style.height=Be(g),c=n.depth+h+m}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var T,N,R=0;/box/.test(a)?(R=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),T=t.fontMetrics().fboxsep+(a==="colorbox"?0:R),N=T):a==="angl"?(R=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),T=4*R,N=Math.max(0,.25-n.depth)):(T=d?.2:0,N=T),o=vI(n,a,T,N,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Be(R)):a==="angl"&&R!==.049&&(o.style.borderTopWidth=Be(R),o.style.borderRightWidth=Be(R)),c=n.depth+N,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=Xt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]});else{var _=/cancel|phase/.test(a)?["svg-align"]:[];M=Xt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:_}]})}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!d?_e(["mord","cancel-lap"],[M],t):_e(["mord"],[M],t)},Ad=(e,t)=>{var n,a=new Le(e.label.includes("colorbox")?"mpadded":"menclose",[dn(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+Be(s)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Ge({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=_t(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:s,backgroundColor:o,body:c}},htmlBuilder:Rd,mathmlBuilder:Ad});Ge({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=_t(t[0],"color-token").color,c=_t(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:s,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:Rd,mathmlBuilder:Ad});Ge({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ge({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:Rd,mathmlBuilder:Ad});Ge({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:Rd,mathmlBuilder:Ad});Ge({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var e7={};function _a(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},h=0;h<n.length;++h)e7[n[h]]=d;o&&(ad[t]=o),c&&(id[t]=c)}var t7={};function B(e,t){t7[e]=t}class Ar{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Ar(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class $r{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new $r(n,Ar.range(this,t))}}function Lv(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Id=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Oe("{"+e.envName+"} can be used only in display mode.")},BI=new Set(["gather","gather*"]);function dp(e){if(!e.includes("ed"))return!e.includes("*")}function Zi(e,t,n){var{hskipBeforeAndAfter:a,addJot:s,cols:o,arraystretch:c,colSeparationType:d,autoTag:h,singleRow:m,emptySingleRow:p,maxNumCols:g,leqno:x}=t;if(e.gullet.beginGroup(),m||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var y=e.gullet.expandMacroAsText("\\arraystretch");if(y==null)c=1;else if(c=parseFloat(y),!c||c<0)throw new Oe("Invalid \\arraystretch: "+y)}e.gullet.beginGroup();var S=[],T=[S],N=[],R=[],M=h!=null?[]:void 0;function _(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function P(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new $r("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!h&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(_(),R.push(Lv(e));;){var F=e.parseExpression(!1,m?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var A={type:"ordgroup",mode:e.mode,body:F};n&&(A={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[A]}),S.push(A);var L=e.fetch().text;if(L==="&"){if(g&&S.length===g){if(m||d)throw new Oe("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(L==="\\end"){P(),S.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(T.length>1||!p)&&T.pop(),R.length<T.length+1&&R.push([]);break}else if(L==="\\\\"){e.consume();var Z=void 0;e.gullet.future().text!==" "&&(Z=e.parseSizeGroup(!0)),N.push(Z?Z.value:null),P(),R.push(Lv(e)),S=[],T.push(S),_()}else throw new Oe("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:c,body:T,cols:o,rowGaps:N,hskipBeforeAndAfter:a,hLinesBeforeRow:R,colSeparationType:d,tags:M,leqno:x}}function fp(e){return e.slice(0,1)==="d"?"display":"text"}var Ma=function(t,n){var a,s,o=t.body.length,c=t.hLinesBeforeRow,d=0,h=new Array(o),m=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),g=1/n.fontMetrics().ptPerEm,x=5*g;if(t.colSeparationType&&t.colSeparationType==="small"){var y=n.havingStyle(xt.SCRIPT).sizeMultiplier;x=.2778*(y/n.sizeMultiplier)}var S=t.colSeparationType==="CD"?En({number:3,unit:"ex"},n):12*g,T=3*g,N=t.arraystretch*S,R=.7*N,M=.3*N,_=0;function P($e){for(var we=0;we<$e.length;++we)we>0&&(_+=.25),m.push({pos:_,isDashed:$e[we]})}for(P(c[0]),a=0;a<t.body.length;++a){var F=t.body[a],A=R,L=M;d<F.length&&(d=F.length);var Z={cells:new Array(F.length),height:0,depth:0,pos:0};for(s=0;s<F.length;++s){var U=Qt(F[s],n);L<U.depth&&(L=U.depth),A<U.height&&(A=U.height),Z.cells[s]=U}var $=t.rowGaps[a],q=0;$&&(q=En($,n),q>0&&(q+=M,L<q&&(L=q),q=0)),t.addJot&&a<t.body.length-1&&(L+=T),Z.height=A,Z.depth=L,_+=A,Z.pos=_,_+=L+q,h[a]=Z,P(c[a+1])}var W=_/2+n.fontMetrics().axisHeight,oe=t.cols||[],J=[],H,I,K=[];if(t.tags&&t.tags.some($e=>$e))for(a=0;a<o;++a){var X=h[a],be=X.pos-W,j=t.tags[a],G=void 0;j===!0?G=_e(["eqn-num"],[],n):j===!1?G=_e([],[],n):G=_e([],Yn(j,n,!0),n),G.depth=X.depth,G.height=X.height,K.push({type:"elem",elem:G,shift:be})}for(s=0,I=0;s<d||I<oe.length;++s,++I){for(var Y,D=oe[I],ye=!0;((se=D)==null?void 0:se.type)==="separator";){var se;if(ye||(H=_e(["arraycolsep"],[]),H.style.width=Be(n.fontMetrics().doubleRuleSep),J.push(H)),D.separator==="|"||D.separator===":"){var V=D.separator==="|"?"solid":"dashed",Q=_e(["vertical-separator"],[],n);Q.style.height=Be(_),Q.style.borderRightWidth=Be(p),Q.style.borderRightStyle=V,Q.style.margin="0 "+Be(-p/2);var ae=_-W;ae&&(Q.style.verticalAlign=Be(-ae)),J.push(Q)}else throw new Oe("Invalid separator type: "+D.separator);I++,D=oe[I],ye=!1}if(!(s>=d)){var ue=void 0;if(s>0||t.hskipBeforeAndAfter){var he,Ne;ue=(he=(Ne=D)==null?void 0:Ne.pregap)!=null?he:x,ue!==0&&(H=_e(["arraycolsep"],[]),H.style.width=Be(ue),J.push(H))}var He=[];for(a=0;a<o;++a){var We=h[a],rt=We.cells[s];if(rt){var Ye=We.pos-W;rt.depth=We.depth,rt.height=We.height,He.push({type:"elem",elem:rt,shift:Ye})}}var gt=Xt({positionType:"individualShift",children:He}),Rt=_e(["col-align-"+(((Y=D)==null?void 0:Y.align)||"c")],[gt]);if(J.push(Rt),s<d-1||t.hskipBeforeAndAfter){var st,kt;ue=(st=(kt=D)==null?void 0:kt.postgap)!=null?st:x,ue!==0&&(H=_e(["arraycolsep"],[]),H.style.width=Be(ue),J.push(H))}}}var $t=_e(["mtable"],J);if(m.length>0){for(var Ut=yo("hline",n,p),ze=yo("hdashline",n,p),Qe=[{type:"elem",elem:$t,shift:0}];m.length>0;){var Ue=m.pop(),ot=Ue.pos-W;Ue.isDashed?Qe.push({type:"elem",elem:ze,shift:ot}):Qe.push({type:"elem",elem:Ut,shift:ot})}$t=Xt({positionType:"individualShift",children:Qe})}if(K.length===0)return _e(["mord"],[$t],n);var fe=Xt({positionType:"individualShift",children:K}),me=_e(["tag"],[fe],n);return ui([$t,me])},qI={c:"center ",l:"left ",r:"right "},Oa=function(t,n){for(var a=[],s=new Le("mtd",[],["mtr-glue"]),o=new Le("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],h=[],m=0;m<d.length;m++)h.push(new Le("mtd",[dn(d[m],n)]));t.tags&&t.tags[c]&&(h.unshift(s),h.push(s),t.leqno?h.unshift(o):h.push(o)),a.push(new Le("mtr",h))}var p=new Le("mtable",a),g=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",Be(g));var x="",y="";if(t.cols&&t.cols.length>0){var S=t.cols,T="",N=!1,R=0,M=S.length;S[0].type==="separator"&&(x+="top ",R=1),S[S.length-1].type==="separator"&&(x+="bottom ",M-=1);for(var _=R;_<M;_++){var P=S[_];P.type==="align"?(y+=qI[P.align],N&&(T+="none "),N=!0):P.type==="separator"&&N&&(T+=P.separator==="|"?"solid ":"dashed ",N=!1)}p.setAttribute("columnalign",y.trim()),/[sd]/.test(T)&&p.setAttribute("columnlines",T.trim())}if(t.colSeparationType==="align"){for(var F=t.cols||[],A="",L=1;L<F.length;L++)A+=L%2?"0em ":"1em ";p.setAttribute("columnspacing",A.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var Z="",U=t.hLinesBeforeRow;x+=U[0].length>0?"left ":"",x+=U[U.length-1].length>0?"right ":"";for(var $=1;$<U.length-1;$++)Z+=U[$].length===0?"none ":U[$][0]?"dashed ":"solid ";return/[sd]/.test(Z)&&p.setAttribute("rowlines",Z.trim()),x!==""&&(p=new Le("menclose",[p]),p.setAttribute("notation",x.trim())),t.arraystretch&&t.arraystretch<1&&(p=new Le("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},n7=function(t,n){t.envName.includes("ed")||Id(t);var a=[],s=t.envName.includes("at")?"alignat":"align",o=t.envName==="split",c=Zi(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:dp(t.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d=0,h=0,m={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",g=0;g<n[0].body.length;g++){var x=_t(n[0].body[g],"textord");p+=x.text}d=Number(p),h=d*2}var y=!h;c.body.forEach(function(R){for(var M=1;M<R.length;M+=2){var _=_t(R[M],"styling"),P=_t(_.body[0],"ordgroup");P.body.unshift(m)}if(y)h<R.length&&(h=R.length);else{var F=R.length/2;if(d<F)throw new Oe("Too many math in a row: "+("expected "+d+", but got "+F),R[0])}});for(var S=0;S<h;++S){var T="r",N=0;S%2===1?T="l":S>0&&y&&(N=1),a[S]={type:"align",align:T,pregap:N,postgap:0}}return c.colSeparationType=y?"align":"alignat",c};_a({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Td(t[0]),a=n?[t[0]]:_t(t[0],"ordgroup").body,s=a.map(function(c){var d=Ed(c),h=d.text;if("lcr".includes(h))return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new Oe("Unknown column alignment: "+h,c)}),o={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Zi(e.parser,o,fp(e.envName))},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new Oe("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),a.cols=[{type:"align",align:n}]}}var o=Zi(e.parser,a,fp(e.envName)),c=Math.max(0,...o.body.map(d=>d.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Zi(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Td(t[0]),a=n?[t[0]]:_t(t[0],"ordgroup").body,s=a.map(function(d){var h=Ed(d),m=h.text;if("lc".includes(m))return{type:"align",align:m};throw new Oe("Unknown column alignment: "+m,d)});if(s.length>1)throw new Oe("{subarray} can contain only one column");var o={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},c=Zi(e.parser,o,"script");if(c.body.length>0&&c.body[0].length>1)throw new Oe("{subarray} can contain only one column");return c},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Zi(e.parser,t,fp(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:n7,htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){BI.has(e.envName)&&Id(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:dp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Zi(e.parser,t,"display")},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:n7,htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Id(e);var t={autoTag:dp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Zi(e.parser,t,"display")},htmlBuilder:Ma,mathmlBuilder:Oa});_a({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Id(e),CI(e.parser)},htmlBuilder:Ma,mathmlBuilder:Oa});B("\\nonumber","\\gdef\\@eqnsw{0}");B("\\notag","\\nonumber");Ge({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Oe(e.funcName+" valid only within array environment")}});var zv=e7;Ge({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];if(s.type!=="ordgroup")throw new Oe("Invalid environment name",s);for(var o="",c=0;c<s.body.length;++c)o+=_t(s.body[c],"textord").text;if(a==="\\begin"){if(!zv.hasOwnProperty(o))throw new Oe("No such environment: "+o,s);var d=zv[o],{args:h,optArgs:m}=n.parseArguments("\\begin{"+o+"}",d),p={mode:n.mode,envName:o,parser:n},g=d.handler(p,h,m);n.expect("\\end",!1);var x=n.nextToken,y=_t(n.parseFunction(),"environment");if(y.name!==o)throw new Oe("Mismatch: \\begin{"+o+"} matched by \\end{"+y.name+"}",x);return g}return{type:"environment",mode:n.mode,name:o,nameGroup:s}}});var r7=(e,t)=>{var n=e.font,a=t.withFont(n);return Qt(e.body,a)},a7=(e,t)=>{var n=e.font,a=t.withFont(n);return dn(e.body,a)},Bv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ge({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=sd(t[0]),o=a;return o in Bv&&(o=Bv[o]),{type:"font",mode:n.mode,font:o.slice(1),body:s}},htmlBuilder:r7,mathmlBuilder:a7});Ge({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:Cd(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:li(a)}}});Ge({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:s}=e,{mode:o}=n,c=n.parseExpression(!0,s);return{type:"font",mode:o,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:r7,mathmlBuilder:a7});var HI=(e,t)=>{var n=t.style,a=n.fracNum(),s=n.fracDen(),o;o=t.havingStyle(a);var c=Qt(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,h=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<h?h:c.depth}o=t.havingStyle(s);var m=Qt(e.denom,o,t),p,g,x;e.hasBarLine?(e.barSize?(g=En(e.barSize,t),p=yo("frac-line",t,g)):p=yo("frac-line",t),g=p.height,x=p.height):(p=null,g=0,x=t.fontMetrics().defaultRuleThickness);var y,S,T;n.size===xt.DISPLAY.size?(y=t.fontMetrics().num1,g>0?S=3*x:S=7*x,T=t.fontMetrics().denom1):(g>0?(y=t.fontMetrics().num2,S=x):(y=t.fontMetrics().num3,S=3*x),T=t.fontMetrics().denom2);var N;if(p){var M=t.fontMetrics().axisHeight;y-c.depth-(M+.5*g)<S&&(y+=S-(y-c.depth-(M+.5*g))),M-.5*g-(m.height-T)<S&&(T+=S-(M-.5*g-(m.height-T)));var _=-(M-.5*g);N=Xt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:T},{type:"elem",elem:p,shift:_},{type:"elem",elem:c,shift:-y}]})}else{var R=y-c.depth-(m.height-T);R<S&&(y+=.5*(S-R),T+=.5*(S-R)),N=Xt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:T},{type:"elem",elem:c,shift:-y}]})}o=t.havingStyle(n),N.height*=o.sizeMultiplier/t.sizeMultiplier,N.depth*=o.sizeMultiplier/t.sizeMultiplier;var P;n.size===xt.DISPLAY.size?P=t.fontMetrics().delim1:n.size===xt.SCRIPTSCRIPT.size?P=t.havingStyle(xt.SCRIPT).fontMetrics().delim2:P=t.fontMetrics().delim2;var F,A;return e.leftDelim==null?F=Vl(t,["mopen"]):F=h1(e.leftDelim,P,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?A=_e([]):e.rightDelim==null?A=Vl(t,["mclose"]):A=h1(e.rightDelim,P,!0,t.havingStyle(n),e.mode,["mclose"]),_e(["mord"].concat(o.sizingClasses(t)),[F,_e(["mfrac"],[N]),A],t)},UI=(e,t)=>{var n=new Le("mfrac",[dn(e.numer,t),dn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=En(e.barSize,t);n.setAttribute("linethickness",Be(a))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var o=new Le("mo",[new Un(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),e.rightDelim!=null){var c=new Le("mo",[new Un(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),s.push(c)}return op(s)}return n},i7=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ge({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],o=t[1],c,d=null,h=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,d="(",h=")";break;case"\\\\bracefrac":c=!1,d="\\{",h="\\}";break;case"\\\\brackfrac":c=!1,d="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}var m=a==="\\cfrac",p=null;return m||a.startsWith("\\d")?p="display":a.startsWith("\\t")&&(p="text"),i7({type:"genfrac",mode:n.mode,numer:s,denom:o,continued:m,hasBarLine:c,leftDelim:d,rightDelim:h,barSize:null},p)},htmlBuilder:HI,mathmlBuilder:UI});Ge({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:a}}});var qv=["display","text","script","scriptscript"],Hv=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ge({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],s=t[5],o=sd(t[0]),c=o.type==="atom"&&o.family==="open"?Hv(o.text):null,d=sd(t[1]),h=d.type==="atom"&&d.family==="close"?Hv(d.text):null,m=_t(t[2],"size"),p,g=null;m.isBlank?p=!0:(g=m.value,p=g.number>0);var x=null,y=t[3];if(y.type==="ordgroup"){if(y.body.length>0){var S=_t(y.body[0],"textord");x=qv[Number(S.text)]}}else y=_t(y,"textord"),x=qv[Number(y.text)];return i7({type:"genfrac",mode:n.mode,numer:a,denom:s,continued:!1,hasBarLine:p,barSize:g,leftDelim:c,rightDelim:h},x)}});Ge({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:_t(t[0],"size").value,token:s}}});Ge({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],o=_t(t[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null}}});var s7=(e,t)=>{var n=t.style,a,s;e.type==="supsub"?(a=e.sup?Qt(e.sup,t.havingStyle(n.sup()),t):Qt(e.sub,t.havingStyle(n.sub()),t),s=_t(e.base,"horizBrace")):s=_t(e,"horizBrace");var o=Qt(s.base,t.havingBaseStyle(xt.DISPLAY)),c=Sd(s,t),d;if(s.isOver?d=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):d=Xt({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:o}]}),a){var h=_e(["minner",s.isOver?"mover":"munder"],[d],t);s.isOver?d=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]}):d=Xt({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]})}return _e(["minner",s.isOver?"mover":"munder"],[d],t)},FI=(e,t)=>{var n=kd(e.label);return new Le(e.isOver?"mover":"munder",[dn(e.base,t),n])};Ge({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:s7,mathmlBuilder:FI});Ge({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],s=_t(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Hn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Yn(e.body,t,!1);return tI(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Yi(e.body,t);return n instanceof Le||(n=new Le("mrow",[n])),n.setAttribute("href",e.href),n}});Ge({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=_t(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var s=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),s.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:a,body:Hn(d)}}});Ge({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Hn(t[0])}},htmlBuilder(e,t){var n=Yn(e.body,t.withFont(""),!1);return ui(n)},mathmlBuilder(e,t){return new Le("mrow",Vr(e.body,t.withFont("")))}});Ge({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:s}=e,o=_t(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,h={};switch(a){case"\\htmlClass":h.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":h.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":h.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var m=o.split(","),p=0;p<m.length;p++){var g=m[p],x=g.indexOf("=");if(x<0)throw new Oe("\\htmlData key/value '"+g+"' missing equals sign");var y=g.slice(0,x),S=g.slice(x+1);h["data-"+y.trim()]=S}d={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:h,body:Hn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Yn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var s=_e(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&s.setAttribute(o,e.attributes[o]);return s},mathmlBuilder:(e,t)=>Yi(e.body,t)});Ge({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Hn(t[0]),mathml:Hn(t[1])}},htmlBuilder:(e,t)=>{var n=Yn(e.html,t,!1);return ui(n)},mathmlBuilder:(e,t)=>Yi(e.mathml,t)});var Eh=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Oe("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!k6(a))throw new Oe("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ge({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,s={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var h=_t(n[0],"raw").string,m=h.split(","),p=0;p<m.length;p++){var g=m[p].split("=");if(g.length===2){var x=g[1].trim();switch(g[0].trim()){case"alt":d=x;break;case"width":s=Eh(x);break;case"height":o=Eh(x);break;case"totalheight":c=Eh(x);break;default:throw new Oe("Invalid key: '"+g[0]+"' in \\includegraphics.")}}}var y=_t(t[0],"url").url;return d===""&&(d=y,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:y})?{type:"includegraphics",mode:a.mode,alt:d,width:s,height:o,totalheight:c,src:y}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=En(e.height,t),a=0;e.totalheight.number>0&&(a=En(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=En(e.width,t));var o={height:Be(n+a)};s>0&&(o.width=Be(s)),a>0&&(o.verticalAlign=Be(-a));var c=new PA(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Le("mglyph",[]);n.setAttribute("alt",e.alt);var a=En(e.height,t),s=0;if(e.totalheight.number>0&&(s=En(e.totalheight,t)-a,n.setAttribute("valign",Be(-s))),n.setAttribute("height",Be(a+s)),e.width.number>0){var o=En(e.width,t);n.setAttribute("width",Be(o))}return n.setAttribute("src",e.src),n}});Ge({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=_t(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=s.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+s.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:s.value}},htmlBuilder(e,t){return A6(e.dimension,t)},mathmlBuilder(e,t){var n=En(e.dimension,t);return new j6(n)}});Ge({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=_e([],[Qt(e.body,t)]),n=_e(["inner"],[n],t)):n=_e(["inner"],[Qt(e.body,t)]);var a=_e(["fix"],[]),s=_e([e.alignment],[n,a],t),o=_e(["strut"]);return o.style.height=Be(s.height+s.depth),s.depth&&(o.style.verticalAlign=Be(-s.depth)),s.children.unshift(o),s=_e(["thinbox"],[s],t),_e(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Le("mpadded",[dn(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Ge({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,s=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(s),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Ge({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Oe("Mismatched "+e.funcName)}});var Uv=(e,t)=>{switch(t.style.size){case xt.DISPLAY.size:return e.display;case xt.TEXT.size:return e.text;case xt.SCRIPT.size:return e.script;case xt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ge({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Hn(t[0]),text:Hn(t[1]),script:Hn(t[2]),scriptscript:Hn(t[3])}},htmlBuilder:(e,t)=>{var n=Uv(e,t),a=Yn(n,t,!1);return ui(a)},mathmlBuilder:(e,t)=>{var n=Uv(e,t);return Yi(n,t)}});var o7=(e,t,n,a,s,o,c)=>{e=_e([],[e]);var d=n&&li(n),h,m;if(t){var p=Qt(t,a.havingStyle(s.sup()),a);m={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var g=Qt(n,a.havingStyle(s.sub()),a);h={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-g.height)}}var x;if(m&&h){var y=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+c;x=Xt({positionType:"bottom",positionData:y,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Be(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Be(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(h){var S=e.height-c;x=Xt({positionType:"top",positionData:S,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Be(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e}]})}else if(m){var T=e.depth+c;x=Xt({positionType:"bottom",positionData:T,children:[{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Be(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var N=[x];if(h&&o!==0&&!d){var R=_e(["mspace"],[],a);R.style.marginRight=Be(o),N.unshift(R)}return _e(["mop","op-limits"],N,a)},l7=new Set(["\\smallint"]),No=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=_t(e.base,"op"),s=!0):o=_t(e,"op");var c=t.style,d=!1;c.size===xt.DISPLAY.size&&o.symbol&&!l7.has(o.name)&&(d=!0);var h,m;if(o.symbol){var p=d?"Size2-Regular":"Size1-Regular",g="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(g=o.name.slice(1),o.name=g==="oiint"?"\\iint":"\\iiint"),h=pr(o.name,p,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),m=h.italic,g.length>0){var x=_6(g+"Size"+(d?"2":"1"),t);h=Xt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:x,shift:d?.08:0}]}),o.name="\\"+g,h.classes.unshift("mop"),h.italic=m}}else if(o.body){var y=Yn(o.body,t,!0);y.length===1&&y[0]instanceof Pr?(h=y[0],h.classes[0]="mop"):h=_e(["mop"],y,t)}else{for(var S=[],T=1;T<o.name.length;T++)S.push(ip(o.name[T],o.mode,t));h=_e(["mop"],S,t)}var N=0,R=0;if((h instanceof Pr||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift){var M;N=(h.height-h.depth)/2-t.fontMetrics().axisHeight,R=(M=h.italic)!=null?M:0}return s?o7(h,n,a,t,c,R,N):(N&&(h.style.position="relative",h.style.top=Be(N)),h)},ac=(e,t)=>{var n;if(e.symbol)n=new Le("mo",[sa(e.name,e.mode)]),l7.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Le("mo",Vr(e.body,t));else{n=new Le("mi",[new Un(e.name.slice(1))]);var a=new Le("mo",[sa("⁡","text")]);e.parentIsSupSub?n=new Le("mrow",[n,a]):n=D6([n,a])}return n},$I={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ge({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=a;return s.length===1&&(s=$I[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Hn(a)}},htmlBuilder:No,mathmlBuilder:ac});var PI={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ge({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:No,mathmlBuilder:ac});Ge({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=PI[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:No,mathmlBuilder:ac});var c7=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=_t(e.base,"operatorname"),s=!0):o=_t(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(g=>{var x="text"in g?g.text:void 0;return typeof x=="string"?{type:"textord",mode:g.mode,text:x}:g}),h=Yn(d,t.withFont("mathrm"),!0),m=0;m<h.length;m++){var p=h[m];p instanceof Pr&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=_e(["mop"],h,t)}else c=_e(["mop"],[],t);return s?o7(c,n,a,t,t.style,0,0):c},GI=(e,t)=>{for(var n=Vr(e.body,t.withFont("mathrm")),a=!0,s=0;s<n.length;s++){var o=n[s];if(!(o instanceof j6))if(o instanceof Le)switch(o.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Un?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Un(d)]}var h=new Le("mi",n);h.setAttribute("mathvariant","normal");var m=new Le("mo",[sa("⁡","text")]);return e.parentIsSupSub?new Le("mrow",[h,m]):D6([h,m])};Ge({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:Hn(s),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:c7,mathmlBuilder:GI});B("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");As({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ui(Yn(e.body,t,!1)):_e(["mord"],Yn(e.body,t,!0),t)},mathmlBuilder(e,t){return Yi(e.body,t,!0)}});Ge({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=Qt(e.body,t.havingCrampedStyle()),a=yo("overline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:a},{type:"kern",size:s}]});return _e(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Le("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new Le("mover",[dn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Ge({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Hn(a)}},htmlBuilder:(e,t)=>{var n=Yn(e.body,t.withPhantom(),!1);return ui(n)},mathmlBuilder:(e,t)=>{var n=Vr(e.body,t);return new Le("mphantom",n)}});B("\\hphantom","\\smash{\\phantom{#1}}");Ge({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=_e(["inner"],[Qt(e.body,t.withPhantom())]),a=_e(["fix"],[]);return _e(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Vr(Hn(e.body),t),a=new Le("mphantom",n),s=new Le("mpadded",[a]);return s.setAttribute("width","0px"),s}});Ge({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=_t(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:s}},htmlBuilder(e,t){var n=Qt(e.body,t),a=En(e.dy,t);return Xt({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Le("mpadded",[dn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Ge({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ge({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,s=n[0],o=_t(t[0],"size"),c=_t(t[1],"size");return{type:"rule",mode:a.mode,shift:s&&_t(s,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=_e(["mord","rule"],[],t),a=En(e.width,t),s=En(e.height,t),o=e.shift?En(e.shift,t):0;return n.style.borderRightWidth=Be(a),n.style.borderTopWidth=Be(s),n.style.bottom=Be(o),n.width=a,n.height=s+o,n.depth=-o,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=En(e.width,t),a=En(e.height,t),s=e.shift?En(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Le("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Be(n)),c.setAttribute("height",Be(a));var d=new Le("mpadded",[c]);return s>=0?d.setAttribute("height",Be(s)):(d.setAttribute("height",Be(s)),d.setAttribute("depth",Be(-s))),d.setAttribute("voffset",Be(s)),d}});function u7(e,t,n){for(var a=Yn(e,t,!1),s=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=s,a[o].depth*=s}return ui(a)}var Fv=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],VI=(e,t)=>{var n=t.havingSize(e.size);return u7(e.body,n,t)};Ge({type:"sizing",names:Fv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Fv.indexOf(a)+1,body:o}},htmlBuilder:VI,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Vr(e.body,n),s=new Le("mstyle",a);return s.setAttribute("mathsize",Be(n.sizeMultiplier)),s}});Ge({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,s=!1,o=!1,c=n[0]&&_t(n[0],"ordgroup");if(c)for(var d,h=0;h<c.body.length;++h){var m=c.body[h];if(d=Ed(m).text,d==="t")s=!0;else if(d==="b")o=!0;else{s=!1,o=!1;break}}else s=!0,o=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:s,smashDepth:o}},htmlBuilder:(e,t)=>{var n=_e([],[Qt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return _e(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var s=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return _e(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new Le("mpadded",[dn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ge({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,s=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:s}},htmlBuilder(e,t){var n=Qt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=xo(n,t);var a=t.fontMetrics(),s=a.defaultRuleThickness,o=s;t.style.id<xt.TEXT.id&&(o=t.fontMetrics().xHeight);var c=s+o/4,d=n.height+n.depth+c+s,{span:h,ruleWidth:m,advanceWidth:p}=MI(d,t),g=h.height-m;g>n.height+n.depth+c&&(c=(c+g-n.height-n.depth)/2);var x=h.height-n.height-c-m;n.style.paddingLeft=Be(p);var y=Xt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+x)},{type:"elem",elem:h},{type:"kern",size:m}]});if(e.index){var S=t.havingStyle(xt.SCRIPTSCRIPT),T=Qt(e.index,S,t),N=.6*(y.height-y.depth),R=Xt({positionType:"shift",positionData:-N,children:[{type:"elem",elem:T}]}),M=_e(["root"],[R]);return _e(["mord","sqrt"],[M,y],t)}else return _e(["mord","sqrt"],[y],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Le("mroot",[dn(n,t),dn(a,t)]):new Le("msqrt",[dn(n,t)])}});var m1={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT};function KI(e){return e in m1}Ge({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!KI(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:s.mode,style:c,body:o}},htmlBuilder(e,t){var n=m1[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),u7(e.body,a,t)},mathmlBuilder(e,t){var n=m1[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var s=Vr(e.body,a),o=new Le("mstyle",s),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var YI=function(t,n){var a=t.base;if(a)if(a.type==="op"){var s=a.limits&&(n.style.size===xt.DISPLAY.size||a.alwaysHandleSupSub);return s?No:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===xt.DISPLAY.size||a.limits);return o?c7:null}else{if(a.type==="accent")return li(a.base)?cp:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?s7:null}else return null}else return null};As({type:"supsub",htmlBuilder(e,t){var n=YI(e,t);if(n)return n(e,t);var{base:a,sup:s,sub:o}=e,c=Qt(a,t),d,h,m=t.fontMetrics(),p=0,g=0,x=a&&li(a);if(s){var y=t.havingStyle(t.style.sup());d=Qt(s,y,t),x||(p=c.height-y.fontMetrics().supDrop*y.sizeMultiplier/t.sizeMultiplier)}if(o){var S=t.havingStyle(t.style.sub());h=Qt(o,S,t),x||(g=c.depth+S.fontMetrics().subDrop*S.sizeMultiplier/t.sizeMultiplier)}var T;t.style===xt.DISPLAY?T=m.sup1:t.style.cramped?T=m.sup3:T=m.sup2;var N=t.sizeMultiplier,R=Be(.5/m.ptPerEm/N),M=null;if(h){var _=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Pr||_){var P;M=Be(-((P=c.italic)!=null?P:0))}}var F;if(d&&h){p=Math.max(p,T,d.depth+.25*m.xHeight),g=Math.max(g,m.sub2);var A=m.defaultRuleThickness,L=4*A;if(p-d.depth-(h.height-g)<L){g=L-(p-d.depth)+h.height;var Z=.8*m.xHeight-(p-d.depth);Z>0&&(p+=Z,g-=Z)}var U=[{type:"elem",elem:h,shift:g,marginRight:R,marginLeft:M},{type:"elem",elem:d,shift:-p,marginRight:R}];F=Xt({positionType:"individualShift",children:U})}else if(h){g=Math.max(g,m.sub1,h.height-.8*m.xHeight);var $=[{type:"elem",elem:h,marginLeft:M,marginRight:R}];F=Xt({positionType:"shift",positionData:g,children:$})}else if(d)p=Math.max(p,T,d.depth+.25*m.xHeight),F=Xt({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:R}]});else throw new Error("supsub must have either sup or sub.");var q=c1(c,"right")||"mord";return _e([q],[c,_e(["msupsub"],[F])],t)},mathmlBuilder(e,t){var n=!1,a,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[dn(e.base,t)];e.sub&&o.push(dn(e.sub,t)),e.sup&&o.push(dn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var m=e.base;m&&m.type==="op"&&m.limits&&t.style===xt.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(t.style===xt.DISPLAY||m.limits)?c="munderover":c="msubsup"}else{var h=e.base;h&&h.type==="op"&&h.limits&&(t.style===xt.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||t.style===xt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===xt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===xt.DISPLAY)?c="mover":c="msup"}return new Le(c,o)}});As({type:"atom",htmlBuilder(e,t){return ip(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Le("mo",[sa(e.text,e.mode)]);if(e.family==="bin"){var a=lp(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var d7={mi:"italic",mn:"normal",mtext:"normal"};As({type:"mathord",htmlBuilder(e,t){return wd(e,t,"mathord")},mathmlBuilder(e,t){var n=new Le("mi",[sa(e.text,e.mode,t)]),a=lp(e,t)||"italic";return a!==d7[n.type]&&n.setAttribute("mathvariant",a),n}});As({type:"textord",htmlBuilder(e,t){return wd(e,t,"textord")},mathmlBuilder(e,t){var n=sa(e.text,e.mode,t),a=lp(e,t)||"normal",s;return e.mode==="text"?s=new Le("mtext",[n]):/[0-9]/.test(e.text)?s=new Le("mn",[n]):e.text==="\\prime"?s=new Le("mo",[n]):s=new Le("mi",[n]),a!==d7[s.type]&&s.setAttribute("mathvariant",a),s}});var Th={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Ch={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};As({type:"spacing",htmlBuilder(e,t){if(Ch.hasOwnProperty(e.text)){var n=Ch[e.text].className||"";if(e.mode==="text"){var a=wd(e,t,"textord");return a.classes.push(n),a}else return _e(["mspace",n],[ip(e.text,e.mode,t)],t)}else{if(Th.hasOwnProperty(e.text))return _e(["mspace",Th[e.text]],[],t);throw new Oe('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Ch.hasOwnProperty(e.text))n=new Le("mtext",[new Un(" ")]);else{if(Th.hasOwnProperty(e.text))return new Le("mspace");throw new Oe('Unknown type of space "'+e.text+'"')}return n}});var $v=()=>{var e=new Le("mtd",[]);return e.setAttribute("width","50%"),e};As({type:"tag",mathmlBuilder(e,t){var n=new Le("mtable",[new Le("mtr",[$v(),new Le("mtd",[Yi(e.body,t)]),$v(),new Le("mtd",[Yi(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Pv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Gv={"\\textbf":"textbf","\\textmd":"textmd"},WI={"\\textit":"textit","\\textup":"textup"},Vv=(e,t)=>{var n=e.font;if(n){if(Pv[n])return t.withTextFontFamily(Pv[n]);if(Gv[n])return t.withTextFontWeight(Gv[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(WI[n])};Ge({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"text",mode:n.mode,body:Hn(s),font:a}},htmlBuilder(e,t){var n=Vv(e,t),a=Yn(e.body,n,!0);return _e(["mord","text"],a,n)},mathmlBuilder(e,t){var n=Vv(e,t);return Yi(e.body,n)}});Ge({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Qt(e.body,t),a=yo("underline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Xt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:a},{type:"kern",size:3*s},{type:"elem",elem:n}]});return _e(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Le("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new Le("munder",[dn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Ge({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Qt(e.body,t),a=t.fontMetrics().axisHeight,s=.5*(n.height-a-(n.depth+a));return Xt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Le("mpadded",[dn(e.body,t)],["vcenter"]);return new Le("mrow",[n])}});Ge({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Oe("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Kv(e),a=[],s=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(pr(c,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return _e(["mord","text"].concat(s.sizingClasses(t)),R6(a),s)},mathmlBuilder(e,t){var n=new Un(Kv(e)),a=new Le("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var Kv=e=>e.body.replace(/ /g,e.star?"␣":" "),Fi=M6,f7=`[ \r
303
+ ]`,ZI="\\\\[a-zA-Z@]+",XI="\\\\[^\uD800-\uDFFF]",QI="("+ZI+")"+f7+"*",JI=`\\\\(
304
+ |[ \r ]+
305
+ ?)[ \r ]*`,p1="[̀-ͯ]",e_=new RegExp(p1+"+$"),t_="("+f7+"+)|"+(JI+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(p1+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(p1+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+QI)+("|"+XI+")");class Yv{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(t_,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new $r("EOF",new Ar(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Oe("Unexpected character: '"+t[n]+"'",new $r(t[n],new Ar(this,n,n+1)));var s=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[s]===14){var o=t.indexOf(`
306
+ `,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new $r(s,new Ar(this,n,this.tokenRegex.lastIndex))}}class n_{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Oe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var r_=t7;B("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});B("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});B("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});B("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});B("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});B("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");B("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Wv={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};B("\\char",function(e){var t=e.popToken(),n,a=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Oe("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=Wv[t.text],a==null||a>=n)throw new Oe("Invalid base-"+n+" digit "+t.text);for(var s;(s=Wv[e.future().text])!=null&&s<n;)a*=n,a+=s,e.popToken()}return"\\@char{"+a+"}"});var hp=(e,t,n,a)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new Oe("\\newcommand's first argument must be a macro name");var o=s[0].text,c=e.isDefined(o);if(c&&!t)throw new Oe("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Oe("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var h="",m=e.expandNextToken();m.text!=="]"&&m.text!=="EOF";)h+=m.text,m=e.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new Oe("Invalid number of arguments: "+h);d=parseInt(h),s=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:s,numArgs:d}),""};B("\\newcommand",e=>hp(e,!1,!0,!1));B("\\renewcommand",e=>hp(e,!0,!1,!1));B("\\providecommand",e=>hp(e,!0,!0,!0));B("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});B("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});B("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Fi[n],vn.math[n],vn.text[n]),""});B("\\bgroup","{");B("\\egroup","}");B("~","\\nobreakspace");B("\\lq","`");B("\\rq","'");B("\\aa","\\r a");B("\\AA","\\r A");B("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");B("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");B("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");B("ℬ","\\mathscr{B}");B("ℰ","\\mathscr{E}");B("ℱ","\\mathscr{F}");B("ℋ","\\mathscr{H}");B("ℐ","\\mathscr{I}");B("ℒ","\\mathscr{L}");B("ℳ","\\mathscr{M}");B("ℛ","\\mathscr{R}");B("ℭ","\\mathfrak{C}");B("ℌ","\\mathfrak{H}");B("ℨ","\\mathfrak{Z}");B("\\Bbbk","\\Bbb{k}");B("\\llap","\\mathllap{\\textrm{#1}}");B("\\rlap","\\mathrlap{\\textrm{#1}}");B("\\clap","\\mathclap{\\textrm{#1}}");B("\\mathstrut","\\vphantom{(}");B("\\underbar","\\underline{\\text{#1}}");B("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');B("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");B("\\ne","\\neq");B("≠","\\neq");B("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");B("∉","\\notin");B("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");B("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");B("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");B("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");B("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");B("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");B("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");B("⟂","\\perp");B("‼","\\mathclose{!\\mkern-0.8mu!}");B("∌","\\notni");B("⌜","\\ulcorner");B("⌝","\\urcorner");B("⌞","\\llcorner");B("⌟","\\lrcorner");B("©","\\copyright");B("®","\\textregistered");B("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');B("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');B("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');B("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');B("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");B("⋮","\\vdots");B("\\varGamma","\\mathit{\\Gamma}");B("\\varDelta","\\mathit{\\Delta}");B("\\varTheta","\\mathit{\\Theta}");B("\\varLambda","\\mathit{\\Lambda}");B("\\varXi","\\mathit{\\Xi}");B("\\varPi","\\mathit{\\Pi}");B("\\varSigma","\\mathit{\\Sigma}");B("\\varUpsilon","\\mathit{\\Upsilon}");B("\\varPhi","\\mathit{\\Phi}");B("\\varPsi","\\mathit{\\Psi}");B("\\varOmega","\\mathit{\\Omega}");B("\\substack","\\begin{subarray}{c}#1\\end{subarray}");B("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");B("\\boxed","\\fbox{$\\displaystyle{#1}$}");B("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");B("\\implies","\\DOTSB\\;\\Longrightarrow\\;");B("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");B("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");B("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var Zv={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},a_=new Set(["bin","rel"]);B("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Zv?t=Zv[n]:(n.slice(0,4)==="\\not"||n in vn.math&&a_.has(vn.math[n].group))&&(t="\\dotsb"),t});var mp={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};B("\\dotso",function(e){var t=e.future().text;return t in mp?"\\ldots\\,":"\\ldots"});B("\\dotsc",function(e){var t=e.future().text;return t in mp&&t!==","?"\\ldots\\,":"\\ldots"});B("\\cdots",function(e){var t=e.future().text;return t in mp?"\\@cdots\\,":"\\@cdots"});B("\\dotsb","\\cdots");B("\\dotsm","\\cdots");B("\\dotsi","\\!\\cdots");B("\\dotsx","\\ldots\\,");B("\\DOTSI","\\relax");B("\\DOTSB","\\relax");B("\\DOTSX","\\relax");B("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");B("\\,","\\tmspace+{3mu}{.1667em}");B("\\thinspace","\\,");B("\\>","\\mskip{4mu}");B("\\:","\\tmspace+{4mu}{.2222em}");B("\\medspace","\\:");B("\\;","\\tmspace+{5mu}{.2777em}");B("\\thickspace","\\;");B("\\!","\\tmspace-{3mu}{.1667em}");B("\\negthinspace","\\!");B("\\negmedspace","\\tmspace-{4mu}{.2222em}");B("\\negthickspace","\\tmspace-{5mu}{.277em}");B("\\enspace","\\kern.5em ");B("\\enskip","\\hskip.5em\\relax");B("\\quad","\\hskip1em\\relax");B("\\qquad","\\hskip2em\\relax");B("\\tag","\\@ifstar\\tag@literal\\tag@paren");B("\\tag@paren","\\tag@literal{({#1})}");B("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Oe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});B("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");B("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");B("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");B("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");B("\\newline","\\\\\\relax");B("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var h7=Be(Aa["Main-Regular"][84][1]-.7*Aa["Main-Regular"][65][1]);B("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+h7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");B("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+h7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");B("\\hspace","\\@ifstar\\@hspacer\\@hspace");B("\\@hspace","\\hskip #1\\relax");B("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");B("\\ordinarycolon",":");B("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");B("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');B("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');B("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');B("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');B("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');B("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');B("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');B("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');B("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');B("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');B("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');B("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');B("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');B("∷","\\dblcolon");B("∹","\\eqcolon");B("≔","\\coloneqq");B("≕","\\eqqcolon");B("⩴","\\Coloneqq");B("\\ratio","\\vcentcolon");B("\\coloncolon","\\dblcolon");B("\\colonequals","\\coloneqq");B("\\coloncolonequals","\\Coloneqq");B("\\equalscolon","\\eqqcolon");B("\\equalscoloncolon","\\Eqqcolon");B("\\colonminus","\\coloneq");B("\\coloncolonminus","\\Coloneq");B("\\minuscolon","\\eqcolon");B("\\minuscoloncolon","\\Eqcolon");B("\\coloncolonapprox","\\Colonapprox");B("\\coloncolonsim","\\Colonsim");B("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");B("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");B("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");B("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");B("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");B("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");B("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");B("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");B("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");B("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");B("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");B("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");B("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");B("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");B("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");B("\\nleqq","\\html@mathml{\\@nleqq}{≰}");B("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");B("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");B("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");B("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");B("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");B("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");B("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");B("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");B("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");B("\\imath","\\html@mathml{\\@imath}{ı}");B("\\jmath","\\html@mathml{\\@jmath}{ȷ}");B("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");B("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");B("⟦","\\llbracket");B("⟧","\\rrbracket");B("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");B("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");B("⦃","\\lBrace");B("⦄","\\rBrace");B("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");B("⦵","\\minuso");B("\\darr","\\downarrow");B("\\dArr","\\Downarrow");B("\\Darr","\\Downarrow");B("\\lang","\\langle");B("\\rang","\\rangle");B("\\uarr","\\uparrow");B("\\uArr","\\Uparrow");B("\\Uarr","\\Uparrow");B("\\N","\\mathbb{N}");B("\\R","\\mathbb{R}");B("\\Z","\\mathbb{Z}");B("\\alef","\\aleph");B("\\alefsym","\\aleph");B("\\Alpha","\\mathrm{A}");B("\\Beta","\\mathrm{B}");B("\\bull","\\bullet");B("\\Chi","\\mathrm{X}");B("\\clubs","\\clubsuit");B("\\cnums","\\mathbb{C}");B("\\Complex","\\mathbb{C}");B("\\Dagger","\\ddagger");B("\\diamonds","\\diamondsuit");B("\\empty","\\emptyset");B("\\Epsilon","\\mathrm{E}");B("\\Eta","\\mathrm{H}");B("\\exist","\\exists");B("\\harr","\\leftrightarrow");B("\\hArr","\\Leftrightarrow");B("\\Harr","\\Leftrightarrow");B("\\hearts","\\heartsuit");B("\\image","\\Im");B("\\infin","\\infty");B("\\Iota","\\mathrm{I}");B("\\isin","\\in");B("\\Kappa","\\mathrm{K}");B("\\larr","\\leftarrow");B("\\lArr","\\Leftarrow");B("\\Larr","\\Leftarrow");B("\\lrarr","\\leftrightarrow");B("\\lrArr","\\Leftrightarrow");B("\\Lrarr","\\Leftrightarrow");B("\\Mu","\\mathrm{M}");B("\\natnums","\\mathbb{N}");B("\\Nu","\\mathrm{N}");B("\\Omicron","\\mathrm{O}");B("\\plusmn","\\pm");B("\\rarr","\\rightarrow");B("\\rArr","\\Rightarrow");B("\\Rarr","\\Rightarrow");B("\\real","\\Re");B("\\reals","\\mathbb{R}");B("\\Reals","\\mathbb{R}");B("\\Rho","\\mathrm{P}");B("\\sdot","\\cdot");B("\\sect","\\S");B("\\spades","\\spadesuit");B("\\sub","\\subset");B("\\sube","\\subseteq");B("\\supe","\\supseteq");B("\\Tau","\\mathrm{T}");B("\\thetasym","\\vartheta");B("\\weierp","\\wp");B("\\Zeta","\\mathrm{Z}");B("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");B("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");B("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");B("\\bra","\\mathinner{\\langle{#1}|}");B("\\ket","\\mathinner{|{#1}\\rangle}");B("\\braket","\\mathinner{\\langle{#1}\\rangle}");B("\\Bra","\\left\\langle#1\\right|");B("\\Ket","\\left|#1\\right\\rangle");var m7=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var h=g=>x=>{e&&(x.macros.set("|",c),s.length&&x.macros.set("\\|",d));var y=g;if(!g&&s.length){var S=x.future();S.text==="|"&&(x.popToken(),y=!0)}return{tokens:y?s:a,numArgs:0}};t.macros.set("|",h(!1)),s.length&&t.macros.set("\\|",h(!0));var m=t.consumeArg().tokens,p=t.expandTokens([...o,...m,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};B("\\bra@ket",m7(!1));B("\\bra@set",m7(!0));B("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");B("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");B("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");B("\\angln","{\\angl n}");B("\\blue","\\textcolor{##6495ed}{#1}");B("\\orange","\\textcolor{##ffa500}{#1}");B("\\pink","\\textcolor{##ff00af}{#1}");B("\\red","\\textcolor{##df0030}{#1}");B("\\green","\\textcolor{##28ae7b}{#1}");B("\\gray","\\textcolor{gray}{#1}");B("\\purple","\\textcolor{##9d38bd}{#1}");B("\\blueA","\\textcolor{##ccfaff}{#1}");B("\\blueB","\\textcolor{##80f6ff}{#1}");B("\\blueC","\\textcolor{##63d9ea}{#1}");B("\\blueD","\\textcolor{##11accd}{#1}");B("\\blueE","\\textcolor{##0c7f99}{#1}");B("\\tealA","\\textcolor{##94fff5}{#1}");B("\\tealB","\\textcolor{##26edd5}{#1}");B("\\tealC","\\textcolor{##01d1c1}{#1}");B("\\tealD","\\textcolor{##01a995}{#1}");B("\\tealE","\\textcolor{##208170}{#1}");B("\\greenA","\\textcolor{##b6ffb0}{#1}");B("\\greenB","\\textcolor{##8af281}{#1}");B("\\greenC","\\textcolor{##74cf70}{#1}");B("\\greenD","\\textcolor{##1fab54}{#1}");B("\\greenE","\\textcolor{##0d923f}{#1}");B("\\goldA","\\textcolor{##ffd0a9}{#1}");B("\\goldB","\\textcolor{##ffbb71}{#1}");B("\\goldC","\\textcolor{##ff9c39}{#1}");B("\\goldD","\\textcolor{##e07d10}{#1}");B("\\goldE","\\textcolor{##a75a05}{#1}");B("\\redA","\\textcolor{##fca9a9}{#1}");B("\\redB","\\textcolor{##ff8482}{#1}");B("\\redC","\\textcolor{##f9685d}{#1}");B("\\redD","\\textcolor{##e84d39}{#1}");B("\\redE","\\textcolor{##bc2612}{#1}");B("\\maroonA","\\textcolor{##ffbde0}{#1}");B("\\maroonB","\\textcolor{##ff92c6}{#1}");B("\\maroonC","\\textcolor{##ed5fa6}{#1}");B("\\maroonD","\\textcolor{##ca337c}{#1}");B("\\maroonE","\\textcolor{##9e034e}{#1}");B("\\purpleA","\\textcolor{##ddd7ff}{#1}");B("\\purpleB","\\textcolor{##c6b9fc}{#1}");B("\\purpleC","\\textcolor{##aa87ff}{#1}");B("\\purpleD","\\textcolor{##7854ab}{#1}");B("\\purpleE","\\textcolor{##543b78}{#1}");B("\\mintA","\\textcolor{##f5f9e8}{#1}");B("\\mintB","\\textcolor{##edf2df}{#1}");B("\\mintC","\\textcolor{##e0e5cc}{#1}");B("\\grayA","\\textcolor{##f6f7f7}{#1}");B("\\grayB","\\textcolor{##f0f1f2}{#1}");B("\\grayC","\\textcolor{##e3e5e6}{#1}");B("\\grayD","\\textcolor{##d6d8da}{#1}");B("\\grayE","\\textcolor{##babec2}{#1}");B("\\grayF","\\textcolor{##888d93}{#1}");B("\\grayG","\\textcolor{##626569}{#1}");B("\\grayH","\\textcolor{##3b3e40}{#1}");B("\\grayI","\\textcolor{##21242c}{#1}");B("\\kaBlue","\\textcolor{##314453}{#1}");B("\\kaGreen","\\textcolor{##71B307}{#1}");var p7={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class i_{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new n_(r_,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new Yv(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:a}=this.consumeArg(["]"])}else({tokens:s,start:n,end:a}=this.consumeArg());return this.pushToken(new $r("EOF",a.loc)),this.pushTokens(s),new $r("",Ar.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var s=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Oe("Extra }",o)}else if(o.text==="EOF")throw new Oe("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Oe("The length of delimiters doesn't match the number of args!");for(var a=n[0],s=0;s<a.length;s++){var o=this.popToken();if(a[s]!==o.text)throw new Oe("Use of the macro doesn't match its definition",o)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Oe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,s=n.noexpand?null:this._getExpansion(a);if(s==null||t&&s.unexpandable){if(t&&s==null&&a[0]==="\\"&&!this.isDefined(a))throw new Oe("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=s.tokens,c=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var h=o[d];if(h.text==="#"){if(d===0)throw new Oe("Incomplete placeholder at end of macro body",h);if(h=o[--d],h.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(h.text))o.splice(d,2,...c[+h.text-1]);else throw new Oe("Not a valid argument number",h)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new $r(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var o=0;if(s.includes("#"))for(var c=s.replace(/##/g,"");c.includes("#"+(o+1));)++o;for(var d=new Yv(s,this.settings),h=[],m=d.lex();m.text!=="EOF";)h.push(m),m=d.lex();h.reverse();var p={tokens:h,numArgs:o};return p}return s}isDefined(t){return this.macros.has(t)||Fi.hasOwnProperty(t)||vn.math.hasOwnProperty(t)||vn.text.hasOwnProperty(t)||p7.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Fi.hasOwnProperty(t)&&!Fi[t].primitive}}var Xv=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,_u=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Nh={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Qv={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class _d{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new i_(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Oe("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new $r("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(_d.endOfExpression.has(s.text)||n&&s.text===n||t&&Fi[s.text]&&Fi[s.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,s=0;s<t.length;s++){var o=t[s];if(o.type==="infix"){if(n!==-1)throw new Oe("only one infix operator per group",o.token);n=s,a=o.replaceWith}}if(n!==-1&&a){var c,d,h=t.slice(0,n),m=t.slice(n+1);h.length===1&&h[0].type==="ordgroup"?c=h[0]:c={type:"ordgroup",mode:this.mode,body:h},m.length===1&&m[0].type==="ordgroup"?d=m[0]:d={type:"ordgroup",mode:this.mode,body:m};var p;return a==="\\\\abovefrac"?p=this.callFunction(a,[c,t[n],d],[]):p=this.callFunction(a,[c,d],[]),[p]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var s;do{var o;s=this.parseGroup(t)}while(((o=s)==null?void 0:o.type)==="internal");if(!s)throw new Oe("Expected group after '"+a+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var s={type:"text",mode:this.mode,body:n},o={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return o}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,s;;){this.consumeSpaces();var o=this.fetch();if(o.text==="\\limits"||o.text==="\\nolimits"){if(n&&n.type==="op"){var c=o.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=o.text==="\\limits");else throw new Oe("Limit controls must follow a math operator",o);this.consume()}else if(o.text==="^"){if(a)throw new Oe("Double superscript",o);a=this.handleSupSubscript("superscript")}else if(o.text==="_"){if(s)throw new Oe("Double subscript",o);s=this.handleSupSubscript("subscript")}else if(o.text==="'"){if(a)throw new Oe("Double superscript",o);var d={type:"textord",mode:this.mode,text:"\\prime"},h=[d];for(this.consume();this.fetch().text==="'";)h.push(d),this.consume();this.fetch().text==="^"&&h.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:h}}else if(_u[o.text]){var m=Xv.test(o.text),p=[];for(p.push(new $r(_u[o.text])),this.consume();;){var g=this.fetch().text;if(!_u[g]||Xv.test(g)!==m)break;p.unshift(new $r(_u[g])),this.consume()}var x=this.subparse(p);m?s={type:"ordgroup",mode:"math",body:x}:a={type:"ordgroup",mode:"math",body:x}}else break}return a||s?{type:"supsub",mode:this.mode,base:n,sup:a,sub:s}:n}parseFunction(t,n){var a=this.fetch(),s=a.text,o=Fi[s];if(!o)return null;if(this.consume(),n&&n!=="atom"&&!o.allowedInArgument)throw new Oe("Got function '"+s+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!o.allowedInText)throw new Oe("Can't use function '"+s+"' in text mode",a);if(this.mode==="math"&&o.allowedInMath===!1)throw new Oe("Can't use function '"+s+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(s,o);return this.callFunction(s,c,d,a,t)}callFunction(t,n,a,s,o){var c={funcName:t,parser:this,token:s,breakOnTokenText:o},d=Fi[t];if(d&&d.handler)return d.handler(c,n,a);throw new Oe("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var s=[],o=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],h=c<n.numOptionalArgs;("primitive"in n&&n.primitive&&d==null||n.type==="sqrt"&&c===1&&o[0]==null)&&(d="primitive");var m=this.parseGroupOfType("argument to '"+t+"'",d,h);if(h)o.push(m);else if(m!=null)s.push(m);else throw new Oe("Null argument, please report this as a bug")}return{args:s,optArgs:o}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var s=this.parseArgumentGroup(a,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var o=this.parseStringGroup("raw",a);return o!=null?{type:"raw",mode:"text",string:o.text}:null}case"primitive":{if(a)throw new Oe("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Oe("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Oe("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var s="",o;(o=this.fetch()).text!=="EOF";)s+=o.text,this.consume();return this.consume(),a.text=s,a}parseRegexGroup(t,n){for(var a=this.fetch(),s=a,o="",c;(c=this.fetch()).text!=="EOF"&&t.test(o+c.text);)s=c,o+=s.text,this.consume();if(o==="")throw new Oe("Invalid "+n+": '"+a.text+"'",a);return a.range(s,o)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Oe("Invalid color: '"+n.text+"'",n);var s=a[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new Oe("Invalid size: '"+n.text+"'",n);var o={number:+(s[1]+s[2]),unit:s[3]};if(!k6(o))throw new Oe("Invalid unit: '"+o.unit+"'",n);return{type:"size",mode:this.mode,value:o,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:o};return n&&this.switchMode(s),c}parseGroup(t,n){var a=this.fetch(),s=a.text,o;if(s==="{"||s==="\\begingroup"){this.consume();var c=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),h=this.fetch();this.expect(c),this.gullet.endGroup(),o={type:"ordgroup",mode:this.mode,loc:Ar.range(a,h),body:d,semisimple:s==="\\begingroup"||void 0}}else if(o=this.parseFunction(n,t)||this.parseSymbol(),o==null&&s[0]==="\\"&&!p7.hasOwnProperty(s)){if(this.settings.throwOnError)throw new Oe("Undefined control sequence: "+s,a);o=this.formatUnsupportedCmd(s),this.consume()}return o}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var s=t[a];if(s.type==="textord"){var o=s.text,c=t[a+1];if(!(!c||c.type!=="textord")){if(o==="-"&&c.text==="-"){var d=t[a+2];a+1<n&&d&&d.type==="textord"&&d.text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Ar.range(s,d),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Ar.range(s,c),text:"--"}),n-=1)}(o==="'"||o==="`")&&c.text===o&&(t.splice(a,2,{type:"textord",mode:"text",loc:Ar.range(s,c),text:o+o}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),s=a.charAt(0)==="*";if(s&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Oe(`\\verb assertion failed --
307
+ please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:s}}Qv.hasOwnProperty(n[0])&&!vn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=Qv[n[0]]+n.slice(1));var o=e_.exec(n);o&&(n=n.substring(0,o.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(vn[this.mode][n]){this.settings.strict&&this.mode==="math"&&t1.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=vn[this.mode][n].group,h=Ar.range(t),m;wI(d)?m={type:"atom",mode:this.mode,family:d,loc:h,text:n}:m={type:d,mode:this.mode,loc:h,text:n},c=m}else if(n.charCodeAt(0)>=128)this.settings.strict&&(w6(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Ar.range(t),text:n};else return null;if(this.consume(),o)for(var p=0;p<o[0].length;p++){var g=o[0][p];if(!Nh[g])throw new Oe("Unknown accent ' "+g+"'",t);var x=Nh[g][this.mode]||Nh[g].text;if(!x)throw new Oe("Accent "+g+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Ar.range(t),label:x,isStretchy:!1,isShifty:!0,base:c}}return c}}_d.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var pp=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new _d(t,n);delete a.gullet.macros.current["\\df@tag"];var s=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Oe("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:a.subparse([new $r("\\df@tag")])}]}return s},gp=function(t,n,a){n.textContent="";var s=Md(t,a).toNode();n.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),gp=function(){throw new Oe("KaTeX doesn't work in quirks mode.")});var g7=function(t,n){var a=Md(t,n).toMarkup();return a},b7=function(t,n){var a=new tp(n);return pp(t,a)},v7=function(t,n,a){if(a.throwOnError||!(t instanceof Oe))throw t;var s=_e(["katex-error"],[new Pr(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+a.errorColor),s},Md=function(t,n){var a=new tp(n);try{var s=pp(t,a);return hI(s,t,a)}catch(o){return v7(o,t,a)}},y7=function(t,n){var a=new tp(n);try{var s=pp(t,a);return mI(s,t,a)}catch(o){return v7(o,t,a)}},x7="0.16.47",w7={Span:To,Anchor:yd,SymbolNode:Pr,SvgNode:si,PathNode:Vi,LineNode:e1},g1={version:x7,render:gp,renderToString:g7,ParseError:Oe,SETTINGS_SCHEMA:td,__parse:b7,__renderToDomTree:Md,__renderToHTMLTree:y7,__setFontMetrics:C6,__defineSymbol:k,__defineFunction:Ge,__defineMacro:B,__domTree:w7};const tz=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Oe,SETTINGS_SCHEMA:td,__defineFunction:Ge,__defineMacro:B,__defineSymbol:k,__domTree:w7,__parse:b7,__renderToDomTree:Md,__renderToHTMLTree:y7,__setFontMetrics:C6,default:g1,get render(){return gp},renderToString:g7,version:x7},Symbol.toStringTag,{value:"Module"})),s_={};function o_(e){const t=this,n=e||s_,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(mA(n)),o.push(sA()),c.push(oA(n))}const Jv=/[#.]/g;function l_(e,t){const n=e||"",a={};let s=0,o,c;for(;s<n.length;){Jv.lastIndex=s;const d=Jv.exec(n),h=n.slice(s,d?d.index:n.length);h&&(o?o==="#"?a.id=h:Array.isArray(a.className)?a.className.push(h):a.className=[h]:c=h,s+=h.length),d&&(o=d[0],s++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function k7(e,t,n){const a=n?f_(n):void 0;function s(o,c,...d){let h;if(o==null){h={type:"root",children:[]};const m=c;d.unshift(m)}else{h=l_(o,t);const m=h.tagName.toLowerCase(),p=a?a.get(m):void 0;if(h.tagName=p||m,c_(c))d.unshift(c);else for(const[g,x]of Object.entries(c))u_(e,h.properties,g,x)}for(const m of d)b1(h.children,m);return h.type==="element"&&h.tagName==="template"&&(h.content={type:"root",children:h.children},h.children=[]),h}return s}function c_(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const o=s;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function u_(e,t,n,a){const s=x5(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?s.spaceSeparated?o=Rb(a):s.commaSeparated?o=Sb(a):s.commaOrSpaceSeparated?o=Rb(Sb(a).join(" ")):o=ey(s,s.property,a):Array.isArray(a)?o=[...a]:o=s.property==="style"?d_(a):String(a);if(Array.isArray(o)){const c=[];for(const d of o)c.push(ey(s,s.property,d));o=c}s.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[s.property]=o}}function b1(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)b1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?b1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ey(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Fl(n)===Fl(t)))return!0}return n}function d_(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function f_(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const h_=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],m_=k7(w5,"div"),p_=k7(md,"g",h_),Rh={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function g_(e,t){return S7(e,{})||{type:"root",children:[]}}function S7(e,t){const n=b_(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function b_(e,t){switch(e.nodeType){case 1:return w_(e,t);case 3:return y_(e);case 8:return x_(e);case 9:return ty(e,t);case 10:return v_();case 11:return ty(e,t);default:return}}function ty(e,t){return{type:"root",children:E7(e,t)}}function v_(){return{type:"doctype"}}function y_(e){return{type:"text",value:e.nodeValue||""}}function x_(e){return{type:"comment",value:e.nodeValue||""}}function w_(e,t){const n=e.namespaceURI,a=n===Rh.svg?p_:m_,s=n===Rh.html?e.tagName.toLowerCase():e.tagName,o=n===Rh.html&&s==="template"?e.content:e,c=e.getAttributeNames(),d={};let h=-1;for(;++h<c.length;)d[c[h]]=e.getAttribute(c[h])||"";return a(s,d,E7(o,t))}function E7(e,t){const n=e.childNodes,a=[];let s=-1;for(;++s<n.length;){const o=S7(n[s],t);o!==void 0&&a.push(o)}return a}new DOMParser;function k_(e,t){const n=S_(e);return g_(n)}function S_(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const ny=(function(e,t,n){const a=tc(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),Is=(function(e){if(e==null)return C_;if(typeof e=="string")return T_(e);if(typeof e=="object")return E_(e);if(typeof e=="function")return bp(e);throw new Error("Expected function, string, or array as `test`")});function E_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Is(e[n]);return bp(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function T_(e){return bp(t);function t(n){return n.tagName===e}}function bp(e){return t;function t(n,a,s){return!!(N_(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function C_(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function N_(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const ry=/\n/g,ay=/[\t ]+/g,v1=Is("br"),iy=Is(j_),R_=Is("p"),sy=Is("tr"),A_=Is(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",D_,L_]),T7=Is(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function I_(e,t){const n=t||{},a="children"in e?e.children:[],s=T7(e),o=R7(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...N7(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...C7(a[d],e,{whitespace:o,breakBefore:d?void 0:s,breakAfter:d<a.length-1?v1(a[d+1]):s}));const h=[];let m;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?m!==void 0&&p>m&&(m=p):p&&(m!==void 0&&m>-1&&h.push(`
308
+ `.repeat(m)||" "),m=-1,h.push(p))}return h.join("")}function C7(e,t,n){return e.type==="element"?__(e,t,n):e.type==="text"?n.whitespace==="normal"?N7(e,n):M_(e):[]}function __(e,t,n){const a=R7(e,n),s=e.children||[];let o=-1,c=[];if(A_(e))return c;let d,h;for(v1(e)||sy(e)&&ny(t,e,sy)?h=`
309
+ `:R_(e)?(d=2,h=2):T7(e)&&(d=1,h=1);++o<s.length;)c=c.concat(C7(s[o],e,{whitespace:a,breakBefore:o?void 0:d,breakAfter:o<s.length-1?v1(s[o+1]):h}));return iy(e)&&ny(t,e,iy)&&c.push(" "),d&&c.unshift(d),h&&c.push(h),c}function N7(e,t){const n=String(e.value),a=[],s=[];let o=0;for(;o<=n.length;){ry.lastIndex=o;const h=ry.exec(n),m=h&&"index"in h?h.index:n.length;a.push(O_(n.slice(o,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),o=m+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(s.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&s.push(d),s.push(a[c]),d=0):(c===0||c===a.length-1)&&s.push(0);return s}function M_(e){return[String(e.value)]}function O_(e,t,n){const a=[];let s=0,o;for(;s<e.length;){ay.lastIndex=s;const c=ay.exec(e);o=c?c.index:e.length,!s&&!o&&c&&!t&&a.push(""),s!==o&&a.push(e.slice(s,o)),s=c?o+c[0].length:o}return s!==o&&!n&&a.push(""),a.join(" ")}function R7(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function D_(e){return!!(e.properties||{}).hidden}function j_(e){return e.tagName==="td"||e.tagName==="th"}function L_(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const z_={},B_=[];function q_(e){const t=e||z_;return function(n,a){W1(n,"element",function(s,o){const c=Array.isArray(s.properties.className)?s.properties.className:B_,d=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let p=h;if(!d&&!h&&!m)return;let g=o[o.length-1],x=s;if(s.tagName==="code"&&d&&g&&g.type==="element"&&g.tagName==="pre"&&(x=g,g=o[o.length-2],p=!0),!g)return;const y=I_(x,{whitespace:"pre"});let S;try{S=g1.renderToString(y,{...t,displayMode:p,throwOnError:!0})}catch(N){const R=N,M=R.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,s],cause:R,place:s.position,ruleId:M,source:"rehype-katex"});try{S=g1.renderToString(y,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(N)},children:[{type:"text",value:y}]}]}}typeof S=="string"&&(S=k_(S).children);const T=g.children.indexOf(x);return g.children.splice(T,1,...S),W5})}}var Ah,oy;function H_(){if(oy)return Ah;oy=1;function e(re){return re instanceof Map?re.clear=re.delete=re.set=function(){throw new Error("map is read-only")}:re instanceof Set&&(re.add=re.clear=re.delete=function(){throw new Error("set is read-only")}),Object.freeze(re),Object.getOwnPropertyNames(re).forEach(ke=>{const Re=re[ke],et=typeof Re;(et==="object"||et==="function")&&!Object.isFrozen(Re)&&e(Re)}),re}class t{constructor(ke){ke.data===void 0&&(ke.data={}),this.data=ke.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(re){return re.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function a(re,...ke){const Re=Object.create(null);for(const et in re)Re[et]=re[et];return ke.forEach(function(et){for(const St in et)Re[St]=et[St]}),Re}const s="</span>",o=re=>!!re.scope,c=(re,{prefix:ke})=>{if(re.startsWith("language:"))return re.replace("language:","language-");if(re.includes(".")){const Re=re.split(".");return[`${ke}${Re.shift()}`,...Re.map((et,St)=>`${et}${"_".repeat(St+1)}`)].join(" ")}return`${ke}${re}`};class d{constructor(ke,Re){this.buffer="",this.classPrefix=Re.classPrefix,ke.walk(this)}addText(ke){this.buffer+=n(ke)}openNode(ke){if(!o(ke))return;const Re=c(ke.scope,{prefix:this.classPrefix});this.span(Re)}closeNode(ke){o(ke)&&(this.buffer+=s)}value(){return this.buffer}span(ke){this.buffer+=`<span class="${ke}">`}}const h=(re={})=>{const ke={children:[]};return Object.assign(ke,re),ke};class m{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ke){this.top.children.push(ke)}openNode(ke){const Re=h({scope:ke});this.add(Re),this.stack.push(Re)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ke){return this.constructor._walk(ke,this.rootNode)}static _walk(ke,Re){return typeof Re=="string"?ke.addText(Re):Re.children&&(ke.openNode(Re),Re.children.forEach(et=>this._walk(ke,et)),ke.closeNode(Re)),ke}static _collapse(ke){typeof ke!="string"&&ke.children&&(ke.children.every(Re=>typeof Re=="string")?ke.children=[ke.children.join("")]:ke.children.forEach(Re=>{m._collapse(Re)}))}}class p extends m{constructor(ke){super(),this.options=ke}addText(ke){ke!==""&&this.add(ke)}startScope(ke){this.openNode(ke)}endScope(){this.closeNode()}__addSublanguage(ke,Re){const et=ke.root;Re&&(et.scope=`language:${Re}`),this.add(et)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(re){return re?typeof re=="string"?re:re.source:null}function x(re){return T("(?=",re,")")}function y(re){return T("(?:",re,")*")}function S(re){return T("(?:",re,")?")}function T(...re){return re.map(Re=>g(Re)).join("")}function N(re){const ke=re[re.length-1];return typeof ke=="object"&&ke.constructor===Object?(re.splice(re.length-1,1),ke):{}}function R(...re){return"("+(N(re).capture?"":"?:")+re.map(et=>g(et)).join("|")+")"}function M(re){return new RegExp(re.toString()+"|").exec("").length-1}function _(re,ke){const Re=re&&re.exec(ke);return Re&&Re.index===0}const P=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function F(re,{joinWith:ke}){let Re=0;return re.map(et=>{Re+=1;const St=Re;let Ct=g(et),De="";for(;Ct.length>0;){const Pe=P.exec(Ct);if(!Pe){De+=Ct;break}De+=Ct.substring(0,Pe.index),Ct=Ct.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?De+="\\"+String(Number(Pe[1])+St):(De+=Pe[0],Pe[0]==="("&&Re++)}return De}).map(et=>`(${et})`).join(ke)}const A=/\b\B/,L="[a-zA-Z]\\w*",Z="[a-zA-Z_]\\w*",U="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",oe=(re={})=>{const ke=/^#![ ]*\//;return re.binary&&(re.begin=T(ke,/.*\b/,re.binary,/\b.*/)),a({scope:"meta",begin:ke,end:/$/,relevance:0,"on:begin":(Re,et)=>{Re.index!==0&&et.ignoreMatch()}},re)},J={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(re,ke,Re={}){const et=a({scope:"comment",begin:re,end:ke,contains:[]},Re);et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const St=R("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return et.contains.push({begin:T(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),et},be=X("//","$"),j=X("/\\*","\\*/"),G=X("#","$"),Y={scope:"number",begin:U,relevance:0},D={scope:"number",begin:$,relevance:0},ye={scope:"number",begin:q,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},V={scope:"title",begin:L,relevance:0},Q={scope:"title",begin:Z,relevance:0},ae={begin:"\\.\\s*"+Z,relevance:0};var he=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:ye,BINARY_NUMBER_RE:q,COMMENT:X,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:be,C_NUMBER_MODE:D,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(re){return Object.assign(re,{"on:begin":(ke,Re)=>{Re.data._beginMatch=ke[1]},"on:end":(ke,Re)=>{Re.data._beginMatch!==ke[1]&&Re.ignoreMatch()}})},HASH_COMMENT_MODE:G,IDENT_RE:L,MATCH_NOTHING_RE:A,METHOD_GUARD:ae,NUMBER_MODE:Y,NUMBER_RE:U,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:I,REGEXP_MODE:se,RE_STARTERS_RE:W,SHEBANG:oe,TITLE_MODE:V,UNDERSCORE_IDENT_RE:Z,UNDERSCORE_TITLE_MODE:Q});function Ne(re,ke){re.input[re.index-1]==="."&&ke.ignoreMatch()}function He(re,ke){re.className!==void 0&&(re.scope=re.className,delete re.className)}function We(re,ke){ke&&re.beginKeywords&&(re.begin="\\b("+re.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",re.__beforeBegin=Ne,re.keywords=re.keywords||re.beginKeywords,delete re.beginKeywords,re.relevance===void 0&&(re.relevance=0))}function rt(re,ke){Array.isArray(re.illegal)&&(re.illegal=R(...re.illegal))}function Ye(re,ke){if(re.match){if(re.begin||re.end)throw new Error("begin & end are not supported with match");re.begin=re.match,delete re.match}}function gt(re,ke){re.relevance===void 0&&(re.relevance=1)}const Rt=(re,ke)=>{if(!re.beforeMatch)return;if(re.starts)throw new Error("beforeMatch cannot be used with starts");const Re=Object.assign({},re);Object.keys(re).forEach(et=>{delete re[et]}),re.keywords=Re.keywords,re.begin=T(Re.beforeMatch,x(Re.begin)),re.starts={relevance:0,contains:[Object.assign(Re,{endsParent:!0})]},re.relevance=0,delete Re.beforeMatch},st=["of","and","for","in","not","or","if","then","parent","list","value"],kt="keyword";function $t(re,ke,Re=kt){const et=Object.create(null);return typeof re=="string"?St(Re,re.split(" ")):Array.isArray(re)?St(Re,re):Object.keys(re).forEach(function(Ct){Object.assign(et,$t(re[Ct],ke,Ct))}),et;function St(Ct,De){ke&&(De=De.map(Pe=>Pe.toLowerCase())),De.forEach(function(Pe){const dt=Pe.split("|");et[dt[0]]=[Ct,Ut(dt[0],dt[1])]})}}function Ut(re,ke){return ke?Number(ke):ze(re)?0:1}function ze(re){return st.includes(re.toLowerCase())}const Qe={},Ue=re=>{console.error(re)},ot=(re,...ke)=>{console.log(`WARN: ${re}`,...ke)},fe=(re,ke)=>{Qe[`${re}/${ke}`]||(console.log(`Deprecated as of ${re}. ${ke}`),Qe[`${re}/${ke}`]=!0)},me=new Error;function $e(re,ke,{key:Re}){let et=0;const St=re[Re],Ct={},De={};for(let Pe=1;Pe<=ke.length;Pe++)De[Pe+et]=St[Pe],Ct[Pe+et]=!0,et+=M(ke[Pe-1]);re[Re]=De,re[Re]._emit=Ct,re[Re]._multi=!0}function we(re){if(Array.isArray(re.begin)){if(re.skip||re.excludeBegin||re.returnBegin)throw Ue("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),me;if(typeof re.beginScope!="object"||re.beginScope===null)throw Ue("beginScope must be object"),me;$e(re,re.begin,{key:"beginScope"}),re.begin=F(re.begin,{joinWith:""})}}function Fe(re){if(Array.isArray(re.end)){if(re.skip||re.excludeEnd||re.returnEnd)throw Ue("skip, excludeEnd, returnEnd not compatible with endScope: {}"),me;if(typeof re.endScope!="object"||re.endScope===null)throw Ue("endScope must be object"),me;$e(re,re.end,{key:"endScope"}),re.end=F(re.end,{joinWith:""})}}function mt(re){re.scope&&typeof re.scope=="object"&&re.scope!==null&&(re.beginScope=re.scope,delete re.scope)}function Ie(re){mt(re),typeof re.beginScope=="string"&&(re.beginScope={_wrap:re.beginScope}),typeof re.endScope=="string"&&(re.endScope={_wrap:re.endScope}),we(re),Fe(re)}function Pt(re){function ke(De,Pe){return new RegExp(g(De),"m"+(re.case_insensitive?"i":"")+(re.unicodeRegex?"u":"")+(Pe?"g":""))}class Re{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,dt){dt.position=this.position++,this.matchIndexes[this.matchAt]=dt,this.regexes.push([dt,Pe]),this.matchAt+=M(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(dt=>dt[1]);this.matcherRe=ke(F(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const dt=this.matcherRe.exec(Pe);if(!dt)return null;const xn=dt.findIndex((oa,ba)=>ba>0&&oa!==void 0),fn=this.matchIndexes[xn];return dt.splice(0,xn),Object.assign(dt,fn)}}class et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const dt=new Re;return this.rules.slice(Pe).forEach(([xn,fn])=>dt.addRule(xn,fn)),dt.compile(),this.multiRegexes[Pe]=dt,dt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,dt){this.rules.push([Pe,dt]),dt.type==="begin"&&this.count++}exec(Pe){const dt=this.getMatcher(this.regexIndex);dt.lastIndex=this.lastIndex;let xn=dt.exec(Pe);if(this.resumingScanAtSamePosition()&&!(xn&&xn.index===this.lastIndex)){const fn=this.getMatcher(0);fn.lastIndex=this.lastIndex+1,xn=fn.exec(Pe)}return xn&&(this.regexIndex+=xn.position+1,this.regexIndex===this.count&&this.considerAll()),xn}}function St(De){const Pe=new et;return De.contains.forEach(dt=>Pe.addRule(dt.begin,{rule:dt,type:"begin"})),De.terminatorEnd&&Pe.addRule(De.terminatorEnd,{type:"end"}),De.illegal&&Pe.addRule(De.illegal,{type:"illegal"}),Pe}function Ct(De,Pe){const dt=De;if(De.isCompiled)return dt;[He,Ye,Ie,Rt].forEach(fn=>fn(De,Pe)),re.compilerExtensions.forEach(fn=>fn(De,Pe)),De.__beforeBegin=null,[We,rt,gt].forEach(fn=>fn(De,Pe)),De.isCompiled=!0;let xn=null;return typeof De.keywords=="object"&&De.keywords.$pattern&&(De.keywords=Object.assign({},De.keywords),xn=De.keywords.$pattern,delete De.keywords.$pattern),xn=xn||/\w+/,De.keywords&&(De.keywords=$t(De.keywords,re.case_insensitive)),dt.keywordPatternRe=ke(xn,!0),Pe&&(De.begin||(De.begin=/\B|\b/),dt.beginRe=ke(dt.begin),!De.end&&!De.endsWithParent&&(De.end=/\B|\b/),De.end&&(dt.endRe=ke(dt.end)),dt.terminatorEnd=g(dt.end)||"",De.endsWithParent&&Pe.terminatorEnd&&(dt.terminatorEnd+=(De.end?"|":"")+Pe.terminatorEnd)),De.illegal&&(dt.illegalRe=ke(De.illegal)),De.contains||(De.contains=[]),De.contains=[].concat(...De.contains.map(function(fn){return Mt(fn==="self"?De:fn)})),De.contains.forEach(function(fn){Ct(fn,dt)}),De.starts&&Ct(De.starts,Pe),dt.matcher=St(dt),dt}if(re.compilerExtensions||(re.compilerExtensions=[]),re.contains&&re.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return re.classNameAliases=a(re.classNameAliases||{}),Ct(re)}function bt(re){return re?re.endsWithParent||bt(re.starts):!1}function Mt(re){return re.variants&&!re.cachedVariants&&(re.cachedVariants=re.variants.map(function(ke){return a(re,{variants:null},ke)})),re.cachedVariants?re.cachedVariants:bt(re)?a(re,{starts:re.starts?a(re.starts):null}):Object.isFrozen(re)?a(re):re}var Tt="11.11.2";class $n extends Error{constructor(ke,Re){super(ke),this.name="HTMLInjectionError",this.html=Re}}const en=n,lt=a,Ze=Symbol("nomatch"),vt=7,ct=function(re){const ke=Object.create(null),Re=Object.create(null),et=[];let St=!0;const Ct="Could not find the language '{}', did you forget to load/include a language module?",De={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function dt(Me){return Pe.noHighlightRe.test(Me)}function xn(Me){let tt=Me.className+" ";tt+=Me.parentNode?Me.parentNode.className:"";const At=Pe.languageDetectRe.exec(tt);if(At){const Gt=Xn(At[1]);return Gt||(ot(Ct.replace("{}",At[1])),ot("Falling back to no-highlight mode for this block.",Me)),Gt?At[1]:"no-highlight"}return tt.split(/\s+/).find(Gt=>dt(Gt)||Xn(Gt))}function fn(Me,tt,At){let Gt="",hn="";typeof tt=="object"?(Gt=Me,At=tt.ignoreIllegals,hn=tt.language):(fe("10.7.0","highlight(lang, code, ...args) has been deprecated."),fe("10.7.0",`Please use highlight(code, options) instead.
310
+ https://github.com/highlightjs/highlight.js/issues/2277`),hn=Me,Gt=tt),At===void 0&&(At=!0);const Pn={code:Gt,language:hn};Mr("before:highlight",Pn);const ir=Pn.result?Pn.result:oa(Pn.language,Pn.code,At);return ir.code=Pn.code,Mr("after:highlight",ir),ir}function oa(Me,tt,At,Gt){const hn=Object.create(null);function Pn(qe,Xe){return qe.keywords[Xe]}function ir(){if(!ht.keywords){On.addText(tn);return}let qe=0;ht.keywordPatternRe.lastIndex=0;let Xe=ht.keywordPatternRe.exec(tn),Et="";for(;Xe;){Et+=tn.substring(qe,Xe.index);const Bt=er.case_insensitive?Xe[0].toLowerCase():Xe[0],kn=Pn(ht,Bt);if(kn){const[Wr,Io]=kn;if(On.addText(Et),Et="",hn[Bt]=(hn[Bt]||0)+1,hn[Bt]<=vt&&(hi+=Io),Wr.startsWith("_"))Et+=Xe[0];else{const lc=er.classNameAliases[Wr]||Wr;Te(Xe[0],lc)}}else Et+=Xe[0];qe=ht.keywordPatternRe.lastIndex,Xe=ht.keywordPatternRe.exec(tn)}Et+=tn.substring(qe),On.addText(Et)}function Qn(){if(tn==="")return;let qe=null;if(typeof ht.subLanguage=="string"){if(!ke[ht.subLanguage]){On.addText(tn);return}qe=oa(ht.subLanguage,tn,!0,oc[ht.subLanguage]),oc[ht.subLanguage]=qe._top}else qe=yr(tn,ht.subLanguage.length?ht.subLanguage:null);ht.relevance>0&&(hi+=qe.relevance),On.__addSublanguage(qe._emitter,qe.language)}function ee(){ht.subLanguage!=null?Qn():ir(),tn=""}function Te(qe,Xe){qe!==""&&(On.startScope(Xe),On.addText(qe),On.endScope())}function Dt(qe,Xe){let Et=1;const Bt=Xe.length-1;for(;Et<=Bt;){if(!qe._emit[Et]){Et++;continue}const kn=er.classNameAliases[qe[Et]]||qe[Et],Wr=Xe[Et];kn?Te(Wr,kn):(tn=Wr,ir(),tn=""),Et++}}function Jt(qe,Xe){return qe.scope&&typeof qe.scope=="string"&&On.openNode(er.classNameAliases[qe.scope]||qe.scope),qe.beginScope&&(qe.beginScope._wrap?(Te(tn,er.classNameAliases[qe.beginScope._wrap]||qe.beginScope._wrap),tn=""):qe.beginScope._multi&&(Dt(qe.beginScope,Xe),tn="")),ht=Object.create(qe,{parent:{value:ht}}),ht}function fr(qe,Xe,Et){let Bt=_(qe.endRe,Et);if(Bt){if(qe["on:end"]){const kn=new t(qe);qe["on:end"](Xe,kn),kn.isMatchIgnored&&(Bt=!1)}if(Bt){for(;qe.endsParent&&qe.parent;)qe=qe.parent;return qe}}if(qe.endsWithParent)return fr(qe.parent,Xe,Et)}function Wn(qe){return ht.matcher.regexIndex===0?(tn+=qe[0],1):(mi=!0,0)}function sr(qe){const Xe=qe[0],Et=qe.rule,Bt=new t(Et),kn=[Et.__beforeBegin,Et["on:begin"]];for(const Wr of kn)if(Wr&&(Wr(qe,Bt),Bt.isMatchIgnored))return Wn(Xe);return Et.skip?tn+=Xe:(Et.excludeBegin&&(tn+=Xe),ee(),!Et.returnBegin&&!Et.excludeBegin&&(tn=Xe)),Jt(Et,qe),Et.returnBegin?0:Xe.length}function gn(qe){const Xe=qe[0],Et=tt.substring(qe.index),Bt=fr(ht,qe,Et);if(!Bt)return Ze;const kn=ht;ht.endScope&&ht.endScope._wrap?(ee(),Te(Xe,ht.endScope._wrap)):ht.endScope&&ht.endScope._multi?(ee(),Dt(ht.endScope,qe)):kn.skip?tn+=Xe:(kn.returnEnd||kn.excludeEnd||(tn+=Xe),ee(),kn.excludeEnd&&(tn=Xe));do ht.scope&&On.closeNode(),!ht.skip&&!ht.subLanguage&&(hi+=ht.relevance),ht=ht.parent;while(ht!==Bt.parent);return Bt.starts&&Jt(Bt.starts,qe),kn.returnEnd?0:Xe.length}function Or(){const qe=[];for(let Xe=ht;Xe!==er;Xe=Xe.parent)Xe.scope&&qe.unshift(Xe.scope);qe.forEach(Xe=>On.openNode(Xe))}let Jn={};function ua(qe,Xe){const Et=Xe&&Xe[0];if(tn+=qe,Et==null)return ee(),0;if(Jn.type==="begin"&&Xe.type==="end"&&Jn.index===Xe.index&&Et===""){if(tn+=tt.slice(Xe.index,Xe.index+1),!St){const Bt=new Error(`0 width match regex (${Me})`);throw Bt.languageName=Me,Bt.badRule=Jn.rule,Bt}return 1}if(Jn=Xe,Xe.type==="begin")return sr(Xe);if(Xe.type==="illegal"&&!At){const Bt=new Error('Illegal lexeme "'+Et+'" for mode "'+(ht.scope||"<unnamed>")+'"');throw Bt.mode=ht,Bt}else if(Xe.type==="end"){const Bt=gn(Xe);if(Bt!==Ze)return Bt}if(Xe.type==="illegal"&&Et==="")return Xe.index===tt.length||(tn+=`
311
+ `),1;if(Ao>1e5&&Ao>Xe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return tn+=Et,Et.length}const er=Xn(Me);if(!er)throw Ue(Ct.replace("{}",Me)),new Error('Unknown language: "'+Me+'"');const sc=Pt(er);let Os="",ht=Gt||sc;const oc={},On=new Pe.__emitter(Pe);Or();let tn="",hi=0,La=0,Ao=0,mi=!1;try{if(er.__emitTokens)er.__emitTokens(tt,On);else{for(ht.matcher.considerAll();;){Ao++,mi?mi=!1:ht.matcher.considerAll(),ht.matcher.lastIndex=La;const qe=ht.matcher.exec(tt);if(!qe)break;const Xe=tt.substring(La,qe.index),Et=ua(Xe,qe);La=qe.index+Et}ua(tt.substring(La))}return On.finalize(),Os=On.toHTML(),{language:Me,value:Os,relevance:hi,illegal:!1,_emitter:On,_top:ht}}catch(qe){if(qe.message&&qe.message.includes("Illegal"))return{language:Me,value:en(tt),illegal:!0,relevance:0,_illegalBy:{message:qe.message,index:La,context:tt.slice(La-100,La+100),mode:qe.mode,resultSoFar:Os},_emitter:On};if(St)return{language:Me,value:en(tt),illegal:!1,relevance:0,errorRaised:qe,_emitter:On,_top:ht};throw qe}}function ba(Me){const tt={value:en(Me),illegal:!1,relevance:0,_top:De,_emitter:new Pe.__emitter(Pe)};return tt._emitter.addText(Me),tt}function yr(Me,tt){tt=tt||Pe.languages||Object.keys(ke);const At=ba(Me),Gt=tt.filter(Xn).filter(ya).map(ee=>oa(ee,Me,!1));Gt.unshift(At);const hn=Gt.sort((ee,Te)=>{if(ee.relevance!==Te.relevance)return Te.relevance-ee.relevance;if(ee.language&&Te.language){if(Xn(ee.language).supersetOf===Te.language)return 1;if(Xn(Te.language).supersetOf===ee.language)return-1}return 0}),[Pn,ir]=hn,Qn=Pn;return Qn.secondBest=ir,Qn}function dr(Me,tt,At){const Gt=tt&&Re[tt]||At;Me.classList.add("hljs"),Me.classList.add(`language-${Gt}`)}function Wt(Me){let tt=null;const At=xn(Me);if(dt(At))return;if(Mr("before:highlightElement",{el:Me,language:At}),Me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Me);return}if(Me.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Me)),Pe.throwUnescapedHTML))throw new $n("One of your code blocks includes unescaped HTML.",Me.innerHTML);tt=Me;const Gt=tt.textContent,hn=At?fn(Gt,{language:At,ignoreIllegals:!0}):yr(Gt);Me.innerHTML=hn.value,Me.dataset.highlighted="yes",dr(Me,At,hn.language),Me.result={language:hn.language,re:hn.relevance,relevance:hn.relevance},hn.secondBest&&(Me.secondBest={language:hn.secondBest.language,relevance:hn.secondBest.relevance}),Mr("after:highlightElement",{el:Me,result:hn,text:Gt})}function Tn(Me){Pe=lt(Pe,Me)}const Kr=()=>{fi(),fe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function va(){fi(),fe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let di=!1;function fi(){function Me(){fi()}if(document.readyState==="loading"){di||window.addEventListener("DOMContentLoaded",Me,!1),di=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(Wt)}function _s(Me,tt){let At=null;try{At=tt(re)}catch(Gt){if(Ue("Language definition for '{}' could not be registered.".replace("{}",Me)),St)Ue(Gt);else throw Gt;At=De}At.name||(At.name=Me),ke[Me]=At,At.rawDefinition=tt.bind(null,re),At.aliases&&la(At.aliases,{languageName:Me})}function Da(Me){delete ke[Me];for(const tt of Object.keys(Re))Re[tt]===Me&&delete Re[tt]}function ja(){return Object.keys(ke)}function Xn(Me){return Me=(Me||"").toLowerCase(),ke[Me]||ke[Re[Me]]}function la(Me,{languageName:tt}){typeof Me=="string"&&(Me=[Me]),Me.forEach(At=>{Re[At.toLowerCase()]=tt})}function ya(Me){const tt=Xn(Me);return tt&&!tt.disableAutodetect}function ca(Me){Me["before:highlightBlock"]&&!Me["before:highlightElement"]&&(Me["before:highlightElement"]=tt=>{Me["before:highlightBlock"](Object.assign({block:tt.el},tt))}),Me["after:highlightBlock"]&&!Me["after:highlightElement"]&&(Me["after:highlightElement"]=tt=>{Me["after:highlightBlock"](Object.assign({block:tt.el},tt))})}function wn(Me){ca(Me),et.push(Me)}function Ms(Me){const tt=et.indexOf(Me);tt!==-1&&et.splice(tt,1)}function Mr(Me,tt){const At=Me;et.forEach(function(Gt){Gt[At]&&Gt[At](tt)})}function Yr(Me){return fe("10.7.0","highlightBlock will be removed entirely in v12.0"),fe("10.7.0","Please use highlightElement now."),Wt(Me)}Object.assign(re,{highlight:fn,highlightAuto:yr,highlightAll:fi,highlightElement:Wt,highlightBlock:Yr,configure:Tn,initHighlighting:Kr,initHighlightingOnLoad:va,registerLanguage:_s,unregisterLanguage:Da,listLanguages:ja,getLanguage:Xn,registerAliases:la,autoDetection:ya,inherit:lt,addPlugin:wn,removePlugin:Ms}),re.debugMode=function(){St=!1},re.safeMode=function(){St=!0},re.versionString=Tt,re.regex={concat:T,lookahead:x,either:R,optional:S,anyNumberOfTimes:y};for(const Me in he)typeof he[Me]=="object"&&e(he[Me]);return Object.assign(re,he),re},Yt=ct({});return Yt.newInstance=()=>ct({}),Ah=Yt,Yt.HighlightJS=Yt,Yt.default=Yt,Ah}var Ih,ly;function U_(){if(ly)return Ih;ly=1;function e(t){const n=t.regex,a=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=t.inherit(c,{begin:/\(/,end:/\)/}),h=t.inherit(t.APOS_STRING_MODE,{className:"string"}),m=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,m,h,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,m,h]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(a,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Ih=e,Ih}var _h,cy;function F_(){if(cy)return _h;cy=1;function e(t){const n=t.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},h={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,o]};o.contains.push(h);const m={match:/\\"/},p={className:"string",begin:/'/,end:/'/},g={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],S=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],R=["true","false"],M={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],F=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],A=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:R,built_in:[..._,...P,"set","shopt",...F,...A]},contains:[S,t.SHEBANG(),T,x,c,d,M,h,m,p,g,a]}}return _h=e,_h}var Mh,uy;function $_(){if(uy)return Mh;uy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",h={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",R={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},M=[x,h,a,t.C_BLOCK_COMMENT_MODE,g,p],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:R,contains:M.concat([{begin:/\(/,end:/\)/,keywords:R,contains:M.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:R,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:R,relevance:0},{begin:S,returnBegin:!0,contains:[t.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,g,h,{begin:/\(/,end:/\)/,keywords:R,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,g,h]}]},h,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C",aliases:["h"],keywords:R,disableAutodetect:!0,illegal:"</",contains:[].concat(_,P,M,[x,{begin:t.IDENT_RE+"::",keywords:R},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:x,strings:p,keywords:R}}}return Mh=e,Mh}var Oh,dy;function P_(){if(dy)return Oh;dy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",h={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],R=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],M=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],F={type:N,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:R},A={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:n.concat(/\b/,`(?!${T.join("|")})`,t.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},L=[A,x,h,a,t.C_BLOCK_COMMENT_MODE,g,p],Z={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:F,contains:L.concat([{begin:/\(/,end:/\)/,keywords:F,contains:L.concat(["self"]),relevance:0}]),relevance:0},U={className:"function",begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:F,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:F,relevance:0},{begin:S,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,g,h,{begin:/\(/,end:/\)/,keywords:F,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,g,h]}]},h,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:F,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(Z,U,A,L,[x,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:F,contains:["self",h]},{begin:t.IDENT_RE+"::",keywords:F},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Oh=e,Oh}var Dh,fy;function G_(){if(fy)return Dh;fy=1;function e(t){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(c),built_in:n,literal:s},h=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},x=t.inherit(g,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},S=t.inherit(y,{illegal:/\n/}),T={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,S]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},R=t.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},S]});y.contains=[N,T,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,t.C_BLOCK_COMMENT_MODE],S.contains=[R,T,x,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const M={variants:[p,N,T,g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},_={begin:"<",end:">",contains:[{beginKeywords:"in out"},h]},P=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",F={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},M,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},h,_,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[h,_,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,_],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[M,m,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},F]}}return Dh=e,Dh}var jh,hy;function V_(){if(hy)return jh;hy=1;const e=m=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:m.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:m.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function h(m){const p=m.regex,g=e(m),x={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},y="and or not only",S=/@-?\w[\w]*(-\w+)*/,T="[a-zA-Z-][a-zA-Z0-9_-]*",N=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[g.BLOCK_COMMENT,x,g.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+T,relevance:0},g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+o.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[g.BLOCK_COMMENT,g.HEXCOLOR,g.IMPORTANT,g.CSS_NUMBER_MODE,g.UNICODE_RANGE,...N,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...N,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},g.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:S},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:s.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...N,g.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b"}]}}return jh=h,jh}var Lh,my;function K_(){if(my)return Lh;my=1;function e(t){const n=t.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},h=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,h,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),y=t.inherit(g,{contains:[]});p.contains.push(y),g.contains.push(x);let S=[a,m];return[p,g,x,y].forEach(M=>{M.contains=M.contains.concat(S)}),S=S.concat(p,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:S},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:S}]}]},a,c,p,g,{className:"quote",begin:"^>\\s+",contains:S,end:"$"},o,s,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Lh=e,Lh}var zh,py;function Y_(){if(py)return zh;py=1;function e(t){const n=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return zh=e,zh}var Bh,gy;function W_(){if(gy)return Bh;gy=1;function e(t){const n=t.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=n.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},h={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[h]}),t.COMMENT("^=begin","^=end",{contains:[h],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:d},x={className:"string",contains:[t.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,g]})]}]},y="[1-9](_?[0-9])*|0",S="[0-9](_?[0-9])*",T={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${S}))?([eE][+-]?(${S})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},L=[x,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{begin:a}],relevance:0},T,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,p),relevance:0}].concat(m,p);g.contains=L,N.contains=L;const q=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:L}}];return p.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(q).concat(p).concat(L)}}return Bh=e,Bh}var qh,by;function Z_(){if(by)return qh;by=1;function e(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}return qh=e,qh}var Hh,vy;function X_(){if(vy)return Hh;vy=1;function e(t){const n=t.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(a,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Hh=e,Hh}var Uh,yy;function Q_(){if(yy)return Uh;yy=1;function e(t){const n=t.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},s=t.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h={begin:/\[/,end:/\]/,contains:[s,c,o,d,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,g=/'[^']*'/,x=n.either(m,p,g),y=n.concat(x,"(\\s*\\.\\s*",x,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[s,h,c,o,d,a]}}]}}return Uh=e,Uh}var Fh,xy;function J_(){if(xy)return Fh;xy=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(c,d,h){return h===-1?"":c.replace(d,m=>s(c,d,h-1))}function o(c){const d=c.regex,h="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",m=h+s("(?:<"+h+"~~~(?:\\s*,\\s*"+h+"~~~)*>)?",/~~~/g,2),S={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},T={className:"meta",begin:"@"+h,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},N={className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:S,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,h],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[d.concat(/(?!else)/,h),/\s+/,h,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,h],className:{1:"keyword",3:"title.class"},contains:[N,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+m+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:S,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[T,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,a,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},a,T]}}return Fh=o,Fh}var $h,wy;function eM(){if(wy)return $h;wy=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function h(m){const p=m.regex,g=(Q,{after:ae})=>{const ue="</"+Q[0].slice(1);return Q.input.indexOf(ue,ae)!==-1},x=e,y={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,T={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,ae)=>{const ue=Q[0].length+Q.index,he=Q.input[ue];if(he==="<"||he===","){ae.ignoreMatch();return}he===">"&&(g(Q,{after:ue})||ae.ignoreMatch());let Ne;const He=Q.input.substring(ue);if(Ne=He.match(/^\s*=/)){ae.ignoreMatch();return}if((Ne=He.match(/^\s+extends\s+/))&&Ne.index===0){ae.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},R="[0-9](_?[0-9])*",M=`\\.(${R})`,_="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",P={className:"number",variants:[{begin:`(\\b(${_})((${M})|\\.)?|(${M}))[eE][+-]?(${R})\\b`},{begin:`\\b(${_})\\b((${M})\\b|\\.)?|(${M})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},A={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},L={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,F],subLanguage:"css"}},Z={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},U={className:"string",begin:"`",end:"`",contains:[m.BACKSLASH_ESCAPE,F]},q={className:"comment",variants:[m.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),m.C_BLOCK_COMMENT_MODE,m.C_LINE_COMMENT_MODE]},W=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,A,L,Z,U,{match:/\$\d+/},P];F.contains=W.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(W)});const oe=[].concat(q,F.contains),J=oe.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(oe)}]),H={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:J},I={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,p.concat(x,"(",p.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:p.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},be={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[H],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Q){return p.concat("(?!",Q.join("|"),")")}const Y={match:p.concat(/\b/,G([...o,"super","import","await"].map(Q=>`${Q}\\s*\\(`)),x,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:p.concat(/\./,p.lookahead(p.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},H]},se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+m.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[H]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:J,CLASS_REFERENCE:K},illegal:/#(?![$_A-Za-z])/,contains:[m.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,A,L,Z,U,q,{match:/\$\d+/},P,K,{scope:"attr",match:x+p.lookahead(":"),relevance:0},V,{begin:"("+m.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[q,m.REGEXP_MODE,{className:"function",begin:se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:m.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:J}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:S},{begin:T.begin,"on:begin":T.isTrulyOpeningTag,end:T.end}],subLanguage:"xml",contains:[{begin:T.begin,end:T.end,skip:!0,contains:["self"]}]}]},be,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+m.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[H,m.inherit(m.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[H]},Y,j,I,ye,{match:/\$[(.]/}]}}return $h=h,$h}var Ph,ky;function tM(){if(ky)return Ph;ky=1;const t={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function n(a){const s={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:c},contains:[s,o,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,d,t,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Ph=n,Ph}var Gh,Sy;function nM(){if(Sy)return Gh;Sy=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(o){const c={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},d={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},h={className:"symbol",begin:o.UNDERSCORE_IDENT_RE+"@"},m={className:"subst",begin:/\$\{/,end:/\}/,contains:[o.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+o.UNDERSCORE_IDENT_RE},g={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,m]},{begin:"'",end:"'",illegal:/\n/,contains:[o.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[o.BACKSLASH_ESCAPE,p,m]}]};m.contains.push(g);const x={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},y={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(g,{className:"string"}),"self"]}]},S=a,T=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),N={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},R=N;return R.variants[1].contains=[N],N.variants[1].contains=[R],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),o.C_LINE_COMMENT_MODE,T,d,h,x,y,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:o.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[o.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[N,o.C_LINE_COMMENT_MODE,T],relevance:0},o.C_LINE_COMMENT_MODE,T,x,y,g,o.C_NUMBER_MODE]},T]},{begin:[/class|interface|trait/,/\s+/,o.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},o.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},x,y]},g,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
312
+ `},S]}}return Gh=s,Gh}var Vh,Ey;function rM(){if(Ey)return Vh;Ey=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),h=o.concat(c).sort().reverse();function m(p){const g=e(p),x=h,y="and or not only",S="[\\w-]+",T="("+S+"|@\\{"+S+"\\})",N=[],R=[],M=function(oe){return{className:"string",begin:"~?"+oe+".*?"+oe}},_=function(oe,J,H){return{className:oe,begin:J,relevance:H}},P={$pattern:/[a-z-]+/,keyword:y,attribute:s.join(" ")},F={begin:"\\(",end:"\\)",contains:R,keywords:P,relevance:0};R.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,M("'"),M('"'),g.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},g.UNICODE_RANGE,g.HEXCOLOR,F,_("variable","@@?"+S,10),_("variable","@\\{"+S+"\\}"),_("built_in","~?`[^`]*?`"),{className:"attribute",begin:S+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},g.IMPORTANT,{beginKeywords:"and not"},g.FUNCTION_DISPATCH);const A=R.concat({begin:/\{/,end:/\}/,contains:N}),L={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(R)},Z={begin:T+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},g.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:R}}]},U={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:P,returnEnd:!0,contains:R,relevance:0}},$={className:"variable",variants:[{begin:"@"+S+"\\s*:",relevance:15},{begin:"@"+S}],starts:{end:"[;}]",returnEnd:!0,contains:A}},q={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:T,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,L,_("keyword","all\\b"),_("variable","@\\{"+S+"\\}"),{begin:"\\b("+a.join("|")+")\\b",className:"selector-tag"},g.CSS_NUMBER_MODE,_("selector-tag",T,0),_("selector-id","#"+T),_("selector-class","\\."+T,0),_("selector-tag","&",0),g.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:A},{begin:"!important"},g.FUNCTION_DISPATCH]},W={begin:S+`:(:)?(${x.join("|")})`,returnBegin:!0,contains:[q]};return N.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,U,$,W,Z,q,L,g.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:N}}return Vh=m,Vh}var Kh,Ty;function aM(){if(Ty)return Kh;Ty=1;function e(t){const n="\\[=*\\[",a="\\]=*\\]",s={begin:n,end:a,contains:["self"]},o=[t.COMMENT("--(?!"+n+")","$"),t.COMMENT("--"+n,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:n,end:a,contains:[s],relevance:5}])}}return Kh=e,Kh}var Yh,Cy;function iM(){if(Cy)return Yh;Cy=1;function e(t){const n={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,a]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,n,a,s,o,c,d]}}return Yh=e,Yh}var Wh,Ny;function sM(){if(Ny)return Wh;Ny=1;function e(t){const n=t.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},h={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[h]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[t.BACKSLASH_ESCAPE,c,m],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(N,R,M="\\1")=>{const _=M==="\\1"?M:n.concat(M,R);return n.concat(n.concat("(?:",N,")"),R,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,M,s)},S=(N,R,M)=>n.concat(n.concat("(?:",N,")"),R,/(?:\\.|[^\\\/])*?/,M,s),T=[m,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",n.either(...x,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:S("(?:m|qr)?",/\//,/\//)},{begin:S("m|qr",n.either(...x,{capture:!0}),/\1/)},{begin:S("m|qr",/\(/,/\)/)},{begin:S("m|qr",/\[/,/\]/)},{begin:S("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,h]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,h,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=T,d.contains=T,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:T}}return Wh=e,Wh}var Zh,Ry;function oM(){if(Ry)return Zh;Ry=1;function e(t){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,h={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:h,illegal:"</",contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return Zh=e,Zh}var Xh,Ay;function lM(){if(Ay)return Xh;Ay=1;function e(t){const n=t.regex,a=/(?![A-Za-z0-9])(?![$])/,s=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),c=n.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},h={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),g=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(m)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(H,I)=>{I.data._beginMatch=H[1]||H[2]},"on:end":(H,I)=>{I.data._beginMatch!==H[1]&&I.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),S=`[
313
+ ]`,T={scope:"string",variants:[g,p,x,y]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},R=["false","null","true"],M=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],F={keyword:M,literal:(H=>{const I=[];return H.forEach(K=>{I.push(K),K.toLowerCase()===K?I.push(K.toUpperCase()):I.push(K.toLowerCase())}),I})(R),built_in:_},A=H=>H.map(I=>I.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,n.concat(S,"+"),n.concat("(?!",A(_).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},Z=n.concat(s,"\\b(?!\\()"),U={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),Z],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),Z],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:F,contains:[$,d,U,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N,L]},W={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",A(M).join("\\b|"),"|",A(_).join("\\b|"),"\\b)"),s,n.concat(S,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(W);const oe=[$,U,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N,L],J={begin:n.concat(/#\[\s*\\?/,n.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:R,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:R,keyword:["new","array"]},contains:["self",...oe]},...oe,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:F,contains:[J,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},h,{scope:"variable.language",match:/\$this\b/},d,W,U,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},L,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:F,contains:["self",J,d,U,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},T,N]}}return Xh=e,Xh}var Qh,Iy;function cM(){if(Iy)return Qh;Iy=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return Qh=e,Qh}var Jh,_y;function uM(){if(_y)return Jh;_y=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Jh=e,Jh}var em,My;function dM(){if(My)return em;My=1;function e(t){const n=t.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},g={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,m,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,m,g,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,g,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",S=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,T=`\\b|${s.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${S}))[eE][+-]?(${y})[jJ]?(?=${T})`},{begin:`(${S})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${y})[jJ](?=${T})`}]},R={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",m,N,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,N,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[m,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,R,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[M]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,M,x]}]}}return em=e,em}var tm,Oy;function fM(){if(Oy)return tm;Oy=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return tm=e,tm}var nm,Dy;function hM(){if(Dy)return nm;Dy=1;function e(t){const n=t.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[c,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return nm=e,nm}var rm,jy;function mM(){if(jy)return rm;jy=1;function e(t){const n=t.regex,a=/(r#)?/,s=n.concat(a,t.UNDERSCORE_IDENT_RE),o=n.concat(a,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,n.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",h=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:g,keyword:h,literal:m,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:g}},{className:"punctuation",begin:"->"},c]}}return rm=e,rm}var am,Ly;function pM(){if(Ly)return am;Ly=1;const e=m=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:m.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:m.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function h(m){const p=e(m),g=c,x=o,y="@[a-z-]+",S="and or not only",N={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[m.C_LINE_COMMENT_MODE,m.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+x.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+g.join("|")+")"},N,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[p.BLOCK_COMMENT,N,p.HEXCOLOR,p.CSS_NUMBER_MODE,p.UNICODE_RANGE,m.QUOTE_STRING_MODE,m.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:y,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:S,attribute:s.join(" ")},contains:[{begin:y,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},N,m.QUOTE_STRING_MODE,m.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return am=h,am}var im,zy;function gM(){if(zy)return im;zy=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return im=e,im}var sm,By;function bM(){if(By)return sm;By=1;function e(t){const n=t.regex,a=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],h=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],S=g,T=[...p,...m].filter(A=>!g.includes(A)),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},R={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={match:n.concat(/\b/,n.either(...S),/\s*\(/),relevance:0,keywords:{built_in:S}};function _(A){return n.concat(/\b/,n.either(...A.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:_(y),relevance:0};function F(A,{exceptions:L,when:Z}={}){const U=Z;return L=L||[],A.map($=>$.match(/\|\d+$/)||L.includes($)?$:U($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:F(T,{when:A=>A.length<3}),literal:c,type:h,built_in:x},contains:[{scope:"type",match:_(d)},P,M,N,s,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,a,R]}}return sm=e,sm}var om,qy;function vM(){if(qy)return om;qy=1;function e(Z){return Z?typeof Z=="string"?Z:Z.source:null}function t(Z){return n("(?=",Z,")")}function n(...Z){return Z.map($=>e($)).join("")}function a(Z){const U=Z[Z.length-1];return typeof U=="object"&&U.constructor===Object?(Z.splice(Z.length-1,1),U):{}}function s(...Z){return"("+(a(Z).capture?"":"?:")+Z.map(q=>e(q)).join("|")+")"}const o=Z=>n(/\b/,Z,/\w$/.test(Z)?/\b/:/\B/),c=["Protocol","Type"].map(o),d=["init","self"].map(o),h=["Any","Self"],m=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],g=["assignment","associativity","higherThan","left","lowerThan","none","right"],x=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],y=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],S=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),T=s(S,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),N=n(S,T,"*"),R=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),M=s(R,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),_=n(R,M,"*"),P=n(/[A-Z]/,M,"*"),F=["attached","autoclosure",n(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,_,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],A=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function L(Z){const U={match:/\s+/,relevance:0},$=Z.COMMENT("/\\*","\\*/",{contains:["self"]}),q=[Z.C_LINE_COMMENT_MODE,$],W={match:[/\./,s(...c,...d)],className:{2:"keyword"}},oe={match:n(/\./,s(...m)),relevance:0},J=m.filter(Ze=>typeof Ze=="string").concat(["_|0"]),H=m.filter(Ze=>typeof Ze!="string").concat(h).map(o),I={variants:[{className:"keyword",match:s(...H,...d)}]},K={$pattern:s(/\b\w+/,/#\w+/),keyword:J.concat(x),literal:p},X=[W,oe,I],be={match:n(/\./,s(...y)),relevance:0},j={className:"built_in",match:n(/\b/,s(...y),/(?=\()/)},G=[be,j],Y={match:/->/,relevance:0},D={className:"operator",relevance:0,variants:[{match:N},{match:`\\.(\\.|${T})+`}]},ye=[Y,D],se="([0-9]_*)+",V="([0-9a-fA-F]_*)+",Q={className:"number",relevance:0,variants:[{match:`\\b(${se})(\\.(${se}))?([eE][+-]?(${se}))?\\b`},{match:`\\b0x(${V})(\\.(${V}))?([pP][+-]?(${se}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ae=(Ze="")=>({className:"subst",variants:[{match:n(/\\/,Ze,/[0\\tnr"']/)},{match:n(/\\/,Ze,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ue=(Ze="")=>({className:"subst",match:n(/\\/,Ze,/[\t ]*(?:[\r\n]|\r\n)/)}),he=(Ze="")=>({className:"subst",label:"interpol",begin:n(/\\/,Ze,/\(/),end:/\)/}),Ne=(Ze="")=>({begin:n(Ze,/"""/),end:n(/"""/,Ze),contains:[ae(Ze),ue(Ze),he(Ze)]}),He=(Ze="")=>({begin:n(Ze,/"/),end:n(/"/,Ze),contains:[ae(Ze),he(Ze)]}),We={className:"string",variants:[Ne(),Ne("#"),Ne("##"),Ne("###"),He(),He("#"),He("##"),He("###")]},rt=[Z.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[Z.BACKSLASH_ESCAPE]}],Ye={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:rt},gt=Ze=>{const vt=n(Ze,/\//),ct=n(/\//,Ze);return{begin:vt,end:ct,contains:[...rt,{scope:"comment",begin:`#(?!.*${ct})`,end:/$/}]}},Rt={scope:"regexp",variants:[gt("###"),gt("##"),gt("#"),Ye]},st={match:n(/`/,_,/`/)},kt={className:"variable",match:/\$\d+/},$t={className:"variable",match:`\\$${M}+`},Ut=[st,kt,$t],ze={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:A,contains:[...ye,Q,We]}]}},Qe={scope:"keyword",match:n(/@/,s(...F),t(s(/\(/,/\s+/)))},Ue={scope:"meta",match:n(/@/,_)},ot=[ze,Qe,Ue],fe={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:n(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,M,"+")},{className:"type",match:P,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:n(/\s+&\s+/,t(P)),relevance:0}]},me={begin:/</,end:/>/,keywords:K,contains:[...q,...X,...ot,Y,fe]};fe.contains.push(me);const $e={match:n(_,/\s*:/),keywords:"_|0",relevance:0},we={begin:/\(/,end:/\)/,relevance:0,keywords:K,contains:["self",$e,...q,Rt,...X,...G,...ye,Q,We,...Ut,...ot,fe]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...q,fe]},mt={begin:s(t(n(_,/\s*:/)),t(n(_,/\s+/,_,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:_}]},Ie={begin:/\(/,end:/\)/,keywords:K,contains:[mt,...q,...X,...ye,Q,We,...ot,fe,we],endsParent:!0,illegal:/["']/},Pt={match:[/(func|macro)/,/\s+/,s(st.match,_,N)],className:{1:"keyword",3:"title.function"},contains:[Fe,Ie,U],illegal:[/\[/,/%/]},bt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,Ie,U],illegal:/\[|%/},Mt={match:[/operator/,/\s+/,N],className:{1:"keyword",3:"title"}},Tt={begin:[/precedencegroup/,/\s+/,P],className:{1:"keyword",3:"title"},contains:[fe],keywords:[...g,...p],end:/}/},$n={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},en={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},lt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,_,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:K,contains:[Fe,...X,{begin:/:/,end:/\{/,keywords:K,contains:[{scope:"title.class.inherited",match:P},...X],relevance:0}]};for(const Ze of We.variants){const vt=Ze.contains.find(Yt=>Yt.label==="interpol");vt.keywords=K;const ct=[...X,...G,...ye,Q,We,...Ut];vt.contains=[...ct,{begin:/\(/,end:/\)/,contains:["self",...ct]}]}return{name:"Swift",keywords:K,contains:[...q,Pt,bt,$n,en,lt,Mt,Tt,{beginKeywords:"import",end:/$/,contains:[...q],relevance:0},Rt,...X,...G,...ye,Q,We,...Ut,...ot,fe,we]}}return om=L,om}var lm,Hy;function yM(){if(Hy)return lm;Hy=1;function e(t){const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},h=t.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},S={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},T={begin:/\{/,end:/\}/,contains:[S],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[S],illegal:"\\n",relevance:0},R=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},T,N,c,d],M=[...R];return M.pop(),M.push(h),S.contains=M,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:R}}return lm=e,lm}var cm,Uy;function xM(){if(Uy)return cm;Uy=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function h(p){const g=p.regex,x=(ae,{after:ue})=>{const he="</"+ae[0].slice(1);return ae.input.indexOf(he,ue)!==-1},y=e,S={begin:"<>",end:"</>"},T=/<[A-Za-z0-9\\._:-]+\s*\/>/,N={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ae,ue)=>{const he=ae[0].length+ae.index,Ne=ae.input[he];if(Ne==="<"||Ne===","){ue.ignoreMatch();return}Ne===">"&&(x(ae,{after:he})||ue.ignoreMatch());let He;const We=ae.input.substring(he);if(He=We.match(/^\s*=/)){ue.ignoreMatch();return}if((He=We.match(/^\s+extends\s+/))&&He.index===0){ue.ignoreMatch();return}}},R={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},M="[0-9](_?[0-9])*",_=`\\.(${M})`,P="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",F={className:"number",variants:[{begin:`(\\b(${P})((${_})|\\.)?|(${_}))[eE][+-]?(${M})\\b`},{begin:`\\b(${P})\\b((${_})\\b|\\.)?|(${_})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},A={className:"subst",begin:"\\$\\{",end:"\\}",keywords:R,contains:[]},L={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"xml"}},Z={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,A],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,A]},W={className:"comment",variants:[p.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:y+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},oe=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,Z,U,$,{match:/\$\d+/},F];A.contains=oe.concat({begin:/\{/,end:/\}/,keywords:R,contains:["self"].concat(oe)});const J=[].concat(W,A.contains),H=J.concat([{begin:/(\s*)\(/,end:/\)/,keywords:R,contains:["self"].concat(J)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:H},K={variants:[{match:[/class/,/\s+/,y,/\s+/,/extends/,/\s+/,g.concat(y,"(",g.concat(/\./,y),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,y],scope:{1:"keyword",3:"title.class"}}]},X={relevance:0,match:g.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},be={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,y,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(ae){return g.concat("(?!",ae.join("|"),")")}const D={match:g.concat(/\b/,Y([...o,"super","import","await"].map(ae=>`${ae}\\s*\\(`)),y,g.lookahead(/\s*\(/)),className:"title.function",relevance:0},ye={begin:g.concat(/\./,g.lookahead(g.concat(y,/(?![0-9A-Za-z$_(])/))),end:y,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,y,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},V="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",Q={match:[/const|var|let/,/\s+/,y,/\s*/,/=\s*/,/(async\s*)?/,g.lookahead(V)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:R,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:X},illegal:/#(?![$_A-Za-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),be,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,Z,U,$,W,{match:/\$\d+/},F,X,{scope:"attr",match:y+g.lookahead(":"),relevance:0},Q,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[W,p.REGEXP_MODE,{className:"function",begin:V,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:R,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:S.begin,end:S.end},{match:T},{begin:N.begin,"on:begin":N.isTrulyOpeningTag,end:N.end}],subLanguage:"xml",contains:[{begin:N.begin,end:N.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,p.inherit(p.TITLE_MODE,{begin:y,className:"title.function"})]},{match:/\.\.\./,relevance:0},ye,{match:"\\$"+y,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},D,G,K,se,{match:/\$[(.]/}]}}function m(p){const g=p.regex,x=h(p),y=e,S=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],T={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},N={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:S},contains:[x.exports.CLASS_REFERENCE]},R={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},M=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],_={$pattern:e,keyword:t.concat(M),literal:n,built_in:d.concat(S),"variable.language":c},P={className:"meta",begin:"@"+y},F=(U,$,q)=>{const W=U.contains.findIndex(oe=>oe.label===$);if(W===-1)throw new Error("can not find mode to replace");U.contains.splice(W,1,q)};Object.assign(x.keywords,_),x.exports.PARAMS_CONTAINS.push(P);const A=x.contains.find(U=>U.scope==="attr"),L=Object.assign({},A,{match:g.concat(y,g.lookahead(/\s*\?:/))});x.exports.PARAMS_CONTAINS.push([x.exports.CLASS_REFERENCE,A,L]),x.contains=x.contains.concat([P,T,N,L]),F(x,"shebang",p.SHEBANG()),F(x,"use_strict",R);const Z=x.contains.find(U=>U.label==="func.def");return Z.relevance=0,Object.assign(x,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),x}return cm=m,cm}var um,Fy;function wM(){if(Fy)return um;Fy=1;function e(t){const n=t.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,h=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,o),/ *#/)},{begin:n.concat(/# */,h,/ *#/)},{begin:n.concat(/# */,d,/ *#/)},{begin:n.concat(/# */,n.either(c,o),/ +/,n.either(d,h),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},x=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,m,p,g,x,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}return um=e,um}var dm,$y;function kM(){if($y)return dm;$y=1;function e(t){t.regex;const n=t.COMMENT(/\(;/,/;\)/);n.contains.push("self");const a=t.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},h={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,d,o,t.QUOTE_STRING_MODE,m,p,h]}}return dm=e,dm}var fm,Py;function SM(){if(Py)return fm;Py=1;var e=H_();return e.registerLanguage("xml",U_()),e.registerLanguage("bash",F_()),e.registerLanguage("c",$_()),e.registerLanguage("cpp",P_()),e.registerLanguage("csharp",G_()),e.registerLanguage("css",V_()),e.registerLanguage("markdown",K_()),e.registerLanguage("diff",Y_()),e.registerLanguage("ruby",W_()),e.registerLanguage("go",Z_()),e.registerLanguage("graphql",X_()),e.registerLanguage("ini",Q_()),e.registerLanguage("java",J_()),e.registerLanguage("javascript",eM()),e.registerLanguage("json",tM()),e.registerLanguage("kotlin",nM()),e.registerLanguage("less",rM()),e.registerLanguage("lua",aM()),e.registerLanguage("makefile",iM()),e.registerLanguage("perl",sM()),e.registerLanguage("objectivec",oM()),e.registerLanguage("php",lM()),e.registerLanguage("php-template",cM()),e.registerLanguage("plaintext",uM()),e.registerLanguage("python",dM()),e.registerLanguage("python-repl",fM()),e.registerLanguage("r",hM()),e.registerLanguage("rust",mM()),e.registerLanguage("scss",pM()),e.registerLanguage("shell",gM()),e.registerLanguage("sql",bM()),e.registerLanguage("swift",vM()),e.registerLanguage("yaml",yM()),e.registerLanguage("typescript",xM()),e.registerLanguage("vbnet",wM()),e.registerLanguage("wasm",kM()),e.HighlightJS=e,e.default=e,fm=e,fm}var EM=SM();const Gy=dd(EM),A7=/^(javascript|vbscript|data):/i;function TM(e){if(!e)return!1;const t=e.trim();return!(!t||A7.test(t))}function CM(e){if(!e)return!1;const t=e.trim();return!t||A7.test(t)||t.startsWith("blob:")||t.startsWith("data:image/")||/^https?:\/\//i.test(t)?!1:!!(t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))}const NM=[[iA,{singleTilde:!1}],[o_,{singleDollarTextMath:!0}]],RM=[q_];let hm=null,Vy=null;async function AM(){return hm||(Vy??=qk(()=>import("./mermaid.core-BYdXtke8.js").then(e=>e.bp),[]).then(e=>{e.default.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"});const t=async(n,a)=>{const{svg:s}=await e.default.render(`oc-mermaid-${Math.random().toString(36).slice(2,10)}`,a);n.innerHTML=s};return hm=t,t}).catch(()=>null),Vy)}function IM({code:e}){const t=w.useRef(null),[n,a]=w.useState(!1);return w.useEffect(()=>{let s=!1;return AM().then(o=>{if(s||!o||!t.current){o||a(!0);return}o(t.current,e).catch(()=>{s||a(!0)})}),()=>{s=!0}},[e]),n?u.jsx(y1,{lang:"mermaid",text:e}):u.jsx("div",{className:"oc-mermaid",ref:t,role:"img","aria-label":"Mermaid 图表"})}function y1({lang:e,text:t,children:n}){const[a,s]=w.useState(!1),o=w.useMemo(()=>{const d=Gy.getLanguage(e)?e:"";return d?Gy.highlight(t,{language:d,ignoreIllegals:!0}).value:void 0},[e,t]),c=()=>{navigator.clipboard?.writeText(t).then(()=>{s(!0),window.setTimeout(()=>s(!1),1600)},()=>{})};return u.jsxs("div",{className:"oc-codeblock",children:[u.jsxs("div",{className:"oc-codeblock-head",children:[u.jsx("span",{className:"oc-codeblock-lang",children:e||"text"}),u.jsx("button",{type:"button",className:"oc-codeblock-copy",onClick:c,children:a?"已复制":"复制"})]}),u.jsx("pre",{children:o!==void 0?u.jsx("code",{className:`hljs language-${e}`,dangerouslySetInnerHTML:{__html:o}}):u.jsx("code",{className:e?`hljs language-${e}`:"hljs",children:n??t})})]})}function _M(e){return e?.children?.find(a=>a.tagName==="thead"||a.tagName==="tbody")?.children?.find(a=>a.tagName==="tr")?.children?.filter(a=>a.tagName==="th"||a.tagName==="td").length??0}function x1(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(x1).join("");if(typeof e=="object"&&"props"in e){const t=e.props;return x1(t?.children)}return""}const MM={pre({children:e}){return u.jsx(u.Fragment,{children:e})},code({className:e,children:t,...n}){const a=x1(t).replace(/\n$/,""),s=/language-([\w-]+)/.exec(e??"");return s?.[1]==="mermaid"?u.jsx(IM,{code:a}):s||e&&a.includes(`
314
+ `)?u.jsx(y1,{lang:s?.[1]??"",text:a}):a.includes(`
315
+ `)?u.jsx(y1,{lang:"",text:a}):u.jsx("code",{className:e,...n,children:t})},a({href:e,children:t,...n}){if(!TM(e))return u.jsx("span",{...n,children:t});const a=/^https?:\/\//i.test(e??"");return u.jsx("a",{href:e,...a?{target:"_blank",rel:"noopener noreferrer"}:{},...n,children:t})},img({src:e,alt:t}){return CM(e)?u.jsxs(u.Fragment,{children:[u.jsx("img",{src:e,alt:t??"",loading:"lazy",onError:n=>{const a=n.currentTarget;a.hidden=!0,a.nextElementSibling?.removeAttribute("hidden")}}),u.jsx("span",{className:"oc-md-img-fallback",hidden:!0,title:e??void 0,children:t?`[图片加载失败: ${t}]`:"[图片加载失败]"})]}):u.jsx("span",{className:"oc-md-img-fallback",title:e??void 0,children:t?`[图片: ${t}]`:"[图片已屏蔽]"})},table({children:e,node:t}){const n=_M(t)>=4;return u.jsx("div",{className:`oc-md-table-wrap ${n?"is-wide":"is-fill"}`,tabIndex:n?0:void 0,children:u.jsx("table",{children:e})})},input(e){return e.type==="checkbox"?u.jsx("input",{type:"checkbox",checked:!!e.checked,disabled:!0,readOnly:!0}):u.jsx("input",{...e,disabled:!0,readOnly:!0})}};class OM extends w.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}componentDidUpdate(t){t.text!==this.props.text&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:this.props.text})}):this.props.children}}function ic({text:e}){try{return u.jsx(OM,{text:e,children:u.jsx("div",{className:"oc-md",children:u.jsx(KC,{remarkPlugins:NM,rehypePlugins:RM,components:MM,children:e})})})}catch{return u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:e})})}}const Ky="无法在浏览器中打开:弹窗被拦截",DM="内容已截断,以下为已加载片段。";function jM(e){const t=e?.availWidth??1440,n=e?.availHeight??900,a=Math.min(1280,Math.max(880,Math.floor(t*.82))),s=Math.min(960,Math.max(640,Math.floor(n*.88)));return["popup=yes",`width=${a}`,`height=${s}`,"left=72","top=36","menubar=yes","toolbar=yes","location=yes","status=yes","resizable=yes","scrollbars=yes"].join(",")}function go(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Od(e){return e.trim().toLowerCase()}function LM(e){const t=Od(e);return t==="html"||t==="htm"}function zM(e){const t=Od(e);return t==="md"||t==="markdown"}function BM(e){if(Od(e.language)!=="json")return e.content;try{return JSON.stringify(JSON.parse(e.content),null,2)}catch{return e.content}}function qM(e){return/^https?:\/\//i.test(e.trim())}function Nl(e){const t=[];return e.replace(/`([^`]+)`/g,(o,c)=>(t.push(`<code>${c}</code>`),`\0${t.length-1}\0`)).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(o,c,d)=>qM(d)?`<a href="${d}" rel="noopener noreferrer" target="_blank">${c}</a>`:c).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\u0000(\d+)\u0000/g,(o,c)=>t[Number(c)]??"")}function HM(e){return e.length?`<p>${Nl(e.join(" "))}</p>`:""}function Yy(e){const t=e.replaceAll(`\r
316
+ `,`
317
+ `).split(`
318
+ `),n=[];let a=[],s=null;const o=()=>{s&&(n.push(s==="ul"?"</ul>":"</ol>"),s=null)},c=()=>{a.length&&(n.push(HM(a)),a=[])};for(const d of t){const h=/^(#{1,6})\s+(.+)$/.exec(d);if(h){c(),o();const x=h[1].length;n.push(`<h${x}>${Nl(h[2])}</h${x}>`);continue}if(/^---+$/.test(d.trim())||/^\*\*\*+$/.test(d.trim())){c(),o(),n.push("<hr>");continue}const m=/^&gt;\s?(.*)$/.exec(d);if(m){c(),o(),n.push(`<blockquote><p>${Nl(m[1]??"")}</p></blockquote>`);continue}const p=/^[-*]\s+(.+)$/.exec(d);if(p){c(),s!=="ul"&&(o(),n.push("<ul>"),s="ul"),n.push(`<li>${Nl(p[1])}</li>`);continue}const g=/^\d+\.\s+(.+)$/.exec(d);if(g){c(),s!=="ol"&&(o(),n.push("<ol>"),s="ol"),n.push(`<li>${Nl(g[1])}</li>`);continue}if(d.trim()===""){c(),o();continue}o(),a.push(d)}return c(),o(),n.join(`
319
+ `)}function UM(e){const t=go(e),n=[],a=/```([^\n`]*)\n([\s\S]*?)```/g;let s=0,o;for(;o=a.exec(t);)o.index>s&&n.push(Yy(t.slice(s,o.index))),n.push(`<pre class="md-code"><code>${o[2]??""}</code></pre>`),s=o.index+o[0].length;return s<t.length&&n.push(Yy(t.slice(s))),n.filter(Boolean).join(`
320
+ `)}function FM(){return`
321
+ :root { color-scheme: light dark; }
322
+ html, body { margin: 0; min-height: 100%; background: #f7f5f0; color: #1f1b16; }
323
+ body { font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
324
+ .bar { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 20px; border-bottom: 1px solid #e4ddd2; background: #fffdf8; }
325
+ .bar .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
326
+ .bar strong { font-size: 13px; font-weight: 650; word-break: break-all; }
327
+ .bar .kind { color: #6b6258; font-size: 12px; }
328
+ .modes { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #e4ddd2; border-radius: 8px; background: #f3eee6; }
329
+ .modes button { appearance: none; border: 0; background: transparent; color: #6b6258; font: 12px/1.2 inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
330
+ .modes button:hover { color: #1f1b16; }
331
+ .modes button.is-active { background: #fff; color: #1f1b16; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
332
+ .notice { margin: 0; padding: 8px 20px; background: #fff6d8; color: #5c4b00; font-size: 13px; }
333
+ .pane { display: none; }
334
+ .pane.is-active { display: block; }
335
+ .doc { max-width: 52rem; margin: 0 auto; padding: 32px 24px 96px; }
336
+ .doc.md h1, .doc.md h2, .doc.md h3, .doc.md h4 { line-height: 1.25; margin: 1.4em 0 0.5em; }
337
+ .doc.md h1 { font-size: 2rem; }
338
+ .doc.md h2 { font-size: 1.45rem; }
339
+ .doc.md p { margin: 0.8em 0; }
340
+ .doc.md ul, .doc.md ol { margin: 0.6em 0; padding-left: 1.4em; }
341
+ .doc.md blockquote { margin: 0.8em 0; padding: 0.2em 0.9em; border-left: 3px solid #d9cfc0; color: #4a433c; }
342
+ .doc.md hr { border: 0; border-top: 1px solid #e4ddd2; margin: 1.6em 0; }
343
+ .doc.md a { color: #0b57d0; }
344
+ .doc.md code, .md-code, .source { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
345
+ .doc.md :not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: #efe8dc; }
346
+ .md-code, .source { margin: 1em 0; padding: 14px 16px; overflow: auto; white-space: pre-wrap; background: #fff; border: 1px solid #e4ddd2; border-radius: 8px; }
347
+ .frame { margin: 0; padding: 0; }
348
+ iframe.page { display: block; width: 100%; height: calc(100vh - 53px); border: 0; background: #fff; }
349
+ `.trim()}function I7(e){return go(BM(e))}function $M(e){return LM(e.language)?`<div class="frame"><iframe class="page" sandbox="" srcdoc="${go(e.content)}"></iframe></div>`:zM(e.language)?`<article class="doc md">${UM(e.content)}</article>`:`<article class="doc"><pre class="source">${I7(e)}</pre></article>`}function PM(e){return`<article class="doc"><pre class="source">${I7(e)}</pre></article>`}function GM(){return`<script>
350
+ (function () {
351
+ var previewBtn = document.getElementById("view-preview");
352
+ var sourceBtn = document.getElementById("view-source");
353
+ var previewPane = document.getElementById("pane-preview");
354
+ var sourcePane = document.getElementById("pane-source");
355
+ if (!previewBtn || !sourceBtn || !previewPane || !sourcePane) return;
356
+ function show(mode) {
357
+ var source = mode === "source";
358
+ previewBtn.classList.toggle("is-active", !source);
359
+ sourceBtn.classList.toggle("is-active", source);
360
+ previewBtn.setAttribute("aria-pressed", String(!source));
361
+ sourceBtn.setAttribute("aria-pressed", String(source));
362
+ previewPane.classList.toggle("is-active", !source);
363
+ sourcePane.classList.toggle("is-active", source);
364
+ }
365
+ previewBtn.addEventListener("click", function () { show("preview"); });
366
+ sourceBtn.addEventListener("click", function () { show("source"); });
367
+ })();
368
+ <\/script>`}function VM(e){const t=go(e.path),n=e.truncated?`<p class="notice">${go(DM)}</p>`:"",a=Od(e.language);return`<!doctype html>
369
+ <html lang="zh-CN">
370
+ <head>
371
+ <meta charset="utf-8">
372
+ <meta name="viewport" content="width=device-width, initial-scale=1">
373
+ <title>${t}</title>
374
+ <style>
375
+ ${FM()}
376
+ </style>
377
+ </head>
378
+ <body>
379
+ <header class="bar">
380
+ <div class="meta">
381
+ <strong>${t}</strong>
382
+ <span class="kind">${go(a||"text")}${e.truncated?" · 已截断":""}</span>
383
+ </div>
384
+ <div class="modes" role="group" aria-label="查看模式">
385
+ <button type="button" id="view-preview" class="is-active" aria-pressed="true">预览</button>
386
+ <button type="button" id="view-source" aria-pressed="false">查看原文</button>
387
+ </div>
388
+ </header>
389
+ ${n}
390
+ <div id="pane-preview" class="pane is-active">${$M(e)}</div>
391
+ <div id="pane-source" class="pane">${PM(e)}</div>
392
+ ${GM()}
393
+ </body>
394
+ </html>`}function KM(){const e=globalThis.screen;return{availWidth:e?.availWidth,availHeight:e?.availHeight}}function YM(){const e=globalThis;if(typeof e.open!="function")throw new Error("window.open is unavailable");return{open:e.open.bind(e),createObjectURL:e.URL.createObjectURL.bind(e.URL),revokeObjectURL:e.URL.revokeObjectURL.bind(e.URL)}}function WM(e,t=YM(),n=jM(KM())){let a;try{const s=VM(e),o=new Blob([s],{type:"text/html;charset=utf-8"});a=t.createObjectURL(o);const c=t.open(a,"_blank",n);if(!c)return t.revokeObjectURL(a),{ok:!1,error:Ky};try{c.opener=null}catch{}return{ok:!0}}catch{return a&&t.revokeObjectURL(a),{ok:!1,error:Ky}}}function Mu(e){const t=e.nodes.length,n=e.nodes.filter(a=>["succeeded","completed","passed"].includes(a.status)).length;return{completed:n,total:t,pct:t?Math.round(n/t*100):0}}function Wy(e){const[t,n]=w.useState("files"),a=e.activeTab??t,s=!!e.dagRunId,o=[{id:"files",label:"文件"},...e.contextContent?[{id:"context",label:"上下文"}]:[],...e.callsContent?[{id:"calls",label:"调用记录"}]:[],...s?[{id:"dag",label:"DAG"}]:[]],c=o.some(N=>N.id===a)?a:"files",d=w.useRef(null),h=w.useRef(null),m=w.useRef(null),p=w.useRef(null),g=w.useRef(null),x=w.useRef(e.open),y=N=>{n(N),e.onSelectTab?.(N)},S=N=>{switch(N){case"context":return h;case"calls":return m;case"dag":return p;default:return d}};w.useEffect(()=>{c!==a&&y(c)},[a,c]),w.useEffect(()=>{const N=x.current;x.current=e.open,!N&&e.open&&g.current?.focus()},[e.open]);const T=N=>{if(o.length<2)return;let R=null;const M=Math.max(0,o.findIndex(_=>_.id===c));if(N.key==="ArrowLeft"||N.key==="ArrowRight"){const _=N.key==="ArrowRight"?1:-1;R=o[(M+_+o.length)%o.length]?.id??null}else N.key==="Home"?R=o[0]?.id??null:N.key==="End"&&(R=o[o.length-1]?.id??null);R&&(N.preventDefault(),y(R),S(R).current?.focus())};return e.open?u.jsxs("aside",{className:"oc-details-rail","aria-label":"辅助栏",children:[u.jsxs("header",{className:"oc-details-rail-head",children:[u.jsx("div",{className:"oc-details-tabs",role:"tablist","aria-label":"辅助栏",children:o.map(N=>{const R=N.id==="context"||N.id==="calls"?N.id:null;return u.jsxs("div",{className:`oc-details-tab${c===N.id?" is-active":""}`,role:"presentation",children:[u.jsx("button",{type:"button",id:`oc-details-tab-${N.id}`,ref:S(N.id),role:"tab","aria-selected":c===N.id,"aria-controls":"oc-details-rail-body",tabIndex:c===N.id?0:-1,className:"oc-details-tab-select",onClick:()=>y(N.id),onKeyDown:T,children:N.label}),R&&e.onCloseTab?u.jsx("button",{type:"button",className:"oc-details-tab-close","aria-label":`关闭${N.label}标签页`,title:`关闭${N.label}`,onClick:()=>e.onCloseTab?.(R),children:u.jsx(Ts,{size:13,"aria-hidden":"true"})}):null]},N.id)})}),u.jsx("button",{type:"button",className:"oc-details-rail-toggle",ref:g,onClick:e.onToggleOpen,"aria-label":"关闭辅助栏","aria-expanded":e.open,"aria-controls":"oc-details-rail-body",title:"关闭辅助栏",children:u.jsx(Ck,{})})]}),e.open?u.jsx("div",{id:"oc-details-rail-body",className:"oc-details-rail-body",role:"tabpanel","aria-labelledby":`oc-details-tab-${c}`,"data-tab":c,children:c==="dag"&&e.dagRunId?u.jsxs("section",{className:"oc-details-dag","aria-label":"当前 DAG",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"当前 DAG"}),u.jsx("code",{children:e.dagRunId})]}),e.dagRun?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"oc-details-dag-point",children:["运行点:",u.jsx("code",{children:e.dagRun.currentNodeId??"—"}),e.dagRun.status?u.jsxs("span",{children:["(",e.dagRun.status,")"]}):null]}),u.jsx("ul",{className:"oc-details-dag-nodes","aria-label":"DAG 节点",children:e.dagRun.nodes.map(N=>u.jsxs("li",{"data-status":N.status,children:[u.jsx("span",{className:"oc-details-dag-node-id",children:N.id}),u.jsx("span",{className:"oc-details-dag-node-status",children:N.status})]},N.id))}),u.jsxs("p",{className:"oc-details-dag-progress",children:["完成 ",Mu(e.dagRun).completed,"/",Mu(e.dagRun).total]}),u.jsx("div",{className:"oc-details-dag-progressbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Mu(e.dagRun).pct,"aria-label":"DAG 完成进度",children:u.jsx("div",{className:"oc-details-dag-progressfill",style:{width:`${Mu(e.dagRun).pct}%`}})})]}):u.jsx("p",{className:"oc-details-dag-empty-reason",children:"当前运行暂无安全汇总数据,等待运行数据同步。"})]}):c==="context"?e.contextContent:c==="calls"?e.callsContent:e.children},c):null]}):u.jsx("aside",{className:"oc-details-rail is-collapsed","aria-label":"辅助栏","aria-hidden":"true",inert:!0})}function ZM(e){return e.language==="md"||e.language==="markdown"}function Zy(e){const t=e.previews.find(d=>d.path===e.activePath),n=t?ZM(t):!1,[a,s]=w.useState(n?"preview":"source"),[o,c]=w.useState(null);return w.useEffect(()=>{s(n?"preview":"source"),c(null)},[t?.path,n]),!t&&!e.loading?null:u.jsxs(u.Fragment,{children:[t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"oc-file-preview-backdrop",onMouseDown:d=>{d.target===d.currentTarget&&e.onClose(t.path)}}),u.jsxs("section",{className:"oc-file-preview","aria-label":`文件预览 ${t.path}`,children:[u.jsxs("header",{children:[u.jsx("div",{className:"oc-file-tabs",role:"tablist","aria-label":"文件预览 Tabs",children:e.previews.map(d=>{const h=d.path===t.path;return u.jsxs("div",{className:`oc-file-tab${h?" is-active":""}`,title:d.path,children:[u.jsx("button",{type:"button",role:"tab","aria-selected":h,className:"oc-file-tab-activate",onClick:()=>e.onActivate(d.path),children:d.path}),u.jsx("button",{type:"button",className:"oc-file-preview-close","aria-label":`关闭预览 ${d.path}`,title:"关闭预览",onClick:()=>e.onClose(d.path),children:u.jsx(Ts,{size:14,"aria-hidden":"true"})})]},d.path)})}),u.jsxs("span",{children:[t.bytes," bytes",t.truncated?" · 已截断":""]}),u.jsxs("div",{className:"oc-file-preview-actions",children:[n&&u.jsxs("div",{className:"oc-file-view-modes",role:"group","aria-label":"文件查看模式",children:[u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="preview"?" is-active":""}`,"aria-pressed":a==="preview",onClick:()=>s("preview"),children:"预览"}),u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="source"?" is-active":""}`,"aria-pressed":a==="source",onClick:()=>s("source"),children:"源文件"})]}),u.jsx("button",{type:"button",className:"oc-file-preview-open",title:"新窗口打开","aria-label":`新窗口打开 ${t.path}`,onClick:()=>{const d=WM(t);c(d.ok?null:d.error)},children:u.jsx(Yw,{size:16,"aria-hidden":"true"})})]})]}),o?u.jsx("p",{className:"oc-file-preview-open-error",role:"alert",children:o}):null,a==="preview"&&n?u.jsx("div",{className:"oc-file-preview-rendered",children:u.jsx(ic,{text:t.content})}):u.jsx("pre",{children:u.jsx("code",{children:t.content})})]})]}),e.loading&&u.jsx("div",{className:"oc-file-preview-loading",children:"正在读取文件…"})]})}const _7=[{command:"/task",label:"Task context",description:"查看当前任务、Draft 与 assessment",action:"focus-panel:task",source:"operator"},{command:"/contract",label:"Contract",description:"查看 contract diff 与 apply gate",action:"focus-panel:contract",source:"operator"},{command:"/dag",label:"DAG",description:"查看 DAG spine、确认与运行状态",action:"focus-panel:dag",source:"operator"},{command:"/interview",label:"Interview",description:"打开 Requirement Interview",action:"focus:interview",source:"operator"},{command:"/reload",label:"Reload session",description:"重新加载当前 Pi 会话的设置、扩展、技能、提示词、主题与上下文文件(不产生消息)",action:"reload",source:"operator"}],M7=[{command:"/compact",label:"压缩上下文",description:"压缩当前会话上下文,释放 token",action:"compact",source:"web"},{command:"/name",label:"重命名会话",description:"设置当前会话标题",action:"name",source:"web"},{command:"/session",label:"会话信息",description:"显示当前会话元信息",action:"session",source:"web"},{command:"/copy",label:"复制回复",description:"复制最后一条助手消息原文",action:"copy",source:"web"}],ws={operator:0,web:1,extension:2,skill:3,prompt:4};function Xy(e){const t=e.trim().split(/\s+/,1)[0]??"";return t?t.startsWith("/")?t.toLowerCase():`/${t.toLowerCase()}`:""}function Qy(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t?.startsWith("/"))return;const n=[..._7,...M7].find(a=>a.command===t);return n?{command:n.command,action:n.action}:{command:t,action:"unknown"}}function XM(e){if(e==="focus-panel:task"||e==="focus-panel:contract")return"tasks";if(e==="focus-panel:dag")return"recovery"}function QM(e=[]){const t=new Map,n=a=>{const s=Xy(a.command);if(!s)return;const o=t.get(s);if(!o){t.set(s,{...a,command:s});return}ws[a.source]<ws[o.source]&&t.set(s,{...a,command:s})};for(const a of _7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of M7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of e){const s=Xy(a.command);s&&n({command:s,label:a.label||s,description:a.description||"",source:a.source,action:"pi-prompt"})}return[...t.values()].sort((a,s)=>{const o=ws[a.source]-ws[s.source];return o!==0?o:a.command.localeCompare(s.command)})}function JM(e,t){const n=(t.trim().split(/\s+/,1)[0]??"").toLowerCase();if((/\s/.test(t.trimStart().slice(1))||t.includes(" "))&&t.trimStart().includes(" "))return[];const a=n.startsWith("/")?n:n?`/${n}`:"/",s=a==="/"?"":a.slice(1),o=[];for(const c of e){const d=c.command.toLowerCase(),h=d.startsWith("/")?d.slice(1):d,m=c.description.toLowerCase();let p=100;if(!s)p=10+ws[c.source];else if(d===a||h===s)p=0;else if(d.startsWith(a)||h.startsWith(s))p=1;else if(h.includes(s)||d.includes(s))p=2;else if(m.includes(s))p=3;else continue;o.push({...c,score:p})}return o.sort((c,d)=>{if(c.score!==d.score)return c.score-d.score;const h=ws[c.source]-ws[d.source];return h!==0?h:c.command.localeCompare(d.command)})}const eO={operator:"Operator",web:"Pi Web",extension:"Extensions",prompt:"Prompts",skill:"Skills"},tO=new Set(["operatorCapabilities","operationList","operationGet","operationEventSummary","statsContext","sourceInstructions","spineCheck","inspect","observeLink"]);function nO(e){return tO.has(e)?"technical-only":e==="doctor"?"inline-detail":"activity-detail"}const rO={newTask:"创建任务",importPrd:"任务需求",contractShow:"任务边界",contractApply:"更新任务契约",contractDiff:"任务契约差异",contractDraftSave:"任务契约草稿",contractValidate:"检查任务契约",taskAdvance:"推进任务准备",dagRunTask:"执行流程",dagValidate:"校验执行流程",prepareDagConfirmation:"执行确认",confirmDagConfirmation:"确认执行边界",prepareDagExecution:"执行边界",runDag:"任务执行",operationWait:"执行监督",operationGet:"任务活动详情",operationList:"会话活动",operationEventSummary:"执行进展摘要",dagStatus:"执行状态",dagDoctor:"执行诊断",dagReport:"执行结果",dagRerunPlan:"节点恢复评估",dagRerun:"从失败节点恢复",dagInterruptEligibility:"中止资格",standaloneTaskRerun:"带反馈重新执行",workerTaskRetry:"重试 Worker 任务",workerPoolDoctor:"任务池诊断",promoteRun:"任务推进",status:"任务状态"},aO={newTask:{running:"正在创建任务",success:"任务已经创建",error:"创建任务时遇到问题"},importPrd:{running:"正在整理并导入任务需求",success:"任务需求已经导入",error:"导入任务需求时遇到问题"},contractShow:{running:"正在读取任务目标和执行边界",success:"任务目标与执行边界已经读取",error:"读取任务边界时遇到问题"},taskAdvance:{running:"正在推进任务契约并准备执行流程",success:"任务已经推进到下一安全阶段",error:"任务推进被契约或执行边界阻塞"},dagRunTask:{running:"正在生成并校验执行流程",success:"执行流程已经准备好",error:"准备执行流程时遇到问题"},prepareDagExecution:{running:"正在确认任务可以安全执行",success:"执行边界已经确认",error:"执行边界尚未通过确认"},runDag:{running:"正在启动任务执行",success:"任务执行已经启动",error:"启动任务执行时遇到问题"},dagReport:{running:"正在读取本次执行结果",success:"本次执行结果已经读取",error:"读取执行结果时遇到问题"},dagRerunPlan:{running:"正在评估能否从失败节点安全恢复",success:"节点恢复条件评估已经完成",error:"暂时无法确定安全的恢复方式"},dagRerun:{running:"正在创建节点恢复 run",success:"节点恢复 run 已经启动",error:"从失败节点恢复时遇到问题"},dagInterruptEligibility:{running:"正在检查能否协作中止此运行",success:"中止资格已经确认",error:"当前运行不能协作中止"},standaloneTaskRerun:{running:"正在创建新的完整 DAG,并带入上一轮未解决反馈",success:"新的完整 DAG 已经按上一轮反馈重新执行",error:"带反馈重新执行任务时遇到问题"},workerPoolDoctor:{running:"正在读取任务池状态",success:"任务池状态已经读取",error:"读取任务池状态时遇到问题"},promoteRun:{running:"正在推进任务状态",success:"任务状态已经更新",error:"推进任务状态时遇到问题"},status:{running:"正在读取任务状态",success:"任务状态已经更新",error:"读取任务状态时遇到问题"},contractApply:{running:"正在应用任务契约变更",success:"任务契约已经更新",error:"应用任务契约变更时遇到问题"},contractDiff:{running:"正在比较任务契约版本",success:"任务契约差异已经读取",error:"比较任务契约时遇到问题"},contractDraftSave:{running:"正在保存任务契约草稿",success:"任务契约草稿已经保存",error:"保存任务契约草稿时遇到问题"},contractValidate:{running:"正在检查任务契约",success:"任务契约检查已经完成",error:"任务契约检查没有通过"},dagValidate:{running:"正在校验执行流程",success:"执行流程校验已经通过",error:"执行流程校验没有通过"},prepareDagConfirmation:{running:"正在准备执行确认",success:"执行确认已经准备好",error:"准备执行确认时遇到问题"},confirmDagConfirmation:{running:"正在确认执行边界",success:"执行边界已经确认",error:"执行边界尚未通过确认"},operationGet:{running:"正在读取任务活动详情",success:"任务活动详情已经读取",error:"读取任务活动详情时遇到问题"},operationList:{running:"正在读取本次对话的活动",success:"本次对话的活动已经读取",error:"读取对话活动时遇到问题"},operationEventSummary:{running:"正在汇总执行进展",success:"执行进展已经汇总",error:"汇总执行进展时遇到问题"},dagStatus:{running:"正在读取执行状态",success:"执行状态已经更新",error:"读取执行状态时遇到问题"},dagDoctor:{running:"正在诊断本次任务执行",success:"任务执行诊断已经完成",error:"诊断任务执行时遇到问题"},workerTaskRetry:{running:"正在重试失败的任务",success:"失败任务已经重新开始",error:"重试失败任务时遇到问题"},doctor:{running:"正在检查运行环境",success:"运行环境检查已经完成",error:"运行环境检查发现问题"},inspect:{running:"正在读取详细运行信息",success:"详细运行信息已经读取",error:"读取详细运行信息时遇到问题"},observeLink:{running:"正在准备运行看板入口",success:"运行看板入口已经准备好",error:"准备运行看板入口时遇到问题"},operatorCapabilities:{running:"正在读取可用操作能力",success:"可用操作能力已经读取",error:"读取可用操作能力时遇到问题"},sourceInstructions:{running:"正在读取任务来源说明",success:"任务来源说明已经读取",error:"读取任务来源说明时遇到问题"},spineCheck:{running:"正在检查计划执行步骤",success:"计划执行步骤检查已经完成",error:"计划执行步骤检查发现问题"},statsContext:{running:"正在统计上下文使用情况",success:"上下文使用情况已经统计完成",error:"统计上下文使用情况时遇到问题"}},iO=[{pattern:/(?:^|-)contract(?:-pi)?$/i,running:"正在核对任务目标和执行边界",finished:"任务目标与执行边界已确认",error:"任务边界存在冲突,需要先处理"},{pattern:/scout-src/i,running:"正在梳理与任务相关的代码",finished:"相关代码范围已梳理",error:"梳理相关代码时遇到问题"},{pattern:/scout-tests/i,running:"正在检查现有测试和验证方式",finished:"现有测试与验证方式已确认",error:"检查现有测试时遇到问题"},{pattern:/plan/i,running:"正在整理具体实施步骤",finished:"实施步骤已经准备好",error:"实施方案还需要进一步完善"},{pattern:/implement|writer/i,running:"正在修改并保存相关文件",finished:"文件修改已经完成",error:"修改文件时遇到问题"},{pattern:/verify|reverify/i,running:"正在验证本次修改",finished:"本次修改已通过验证",error:"验证没有通过,正在检查原因"},{pattern:/review/i,running:"正在检查改动是否完整",finished:"改动完整性检查已通过",error:"发现需要补充或修正的内容"},{pattern:/closeout/i,running:"正在整理交付结果",finished:"任务已经完成并形成交付记录",error:"交付结果尚未整理完整"}];function O7(e){if(!(!e||typeof e!="object"))return e}function vp(e){if(e&&typeof e=="object")return e;if(typeof e=="string")try{return O7(JSON.parse(e))}catch{return}}function mm(e){const n=vp(e)?.operationId;return typeof n=="string"&&n?n:void 0}function sO(e){const n=vp(e)?.maxWaitMs;if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.max(1,Math.round(n/1e3))}function D7(e){const t=e.operationId??mm(e.args)??mm(e.result)??mm(e.resultText);return t?`operation:${t}`:`tool:${e.id}`}function oO(e){return e==="running"?"progress":e==="error"?"error":"success"}function lO(e){return vp(e.resultText??e.result)}function cO(e){return Array.isArray(e.events)?e.events.flatMap(t=>{const n=O7(t);if(!n)return[];const a=n.messagePreview??n.message;return typeof a=="string"?[a]:[]}):[]}function uO(e,t,n){const a=[];for(const h of e)for(const m of h.matchAll(/node-(started|finished)[^\n]*?node=([^\s,]+)/gi)){const p=m[1]?.toLowerCase(),g=m[2]??"",x=h.match(/status=([^\s,]+)/i)?.[1]?.toUpperCase();let y="finished";x==="ERROR"||x==="FAILED"?y="error":p==="started"&&(y="running"),a.push({node:g,status:y})}const s=a.at(-1);if(!s)return;const o=a.some(h=>/scout-src/i.test(h.node)&&h.status==="finished"),c=a.some(h=>/scout-tests/i.test(h.node)&&h.status==="finished");if(o&&c)return{id:t,kind:"success",title:"代码与测试的影响范围已确认",activityRef:n};const d=iO.find(h=>h.pattern.test(s.node));return d?s.status==="running"?{id:t,kind:"progress",title:d.running,activityRef:n}:s.status==="error"?{id:t,kind:"error",title:d.error,activityRef:n}:{id:t,kind:"success",title:d.finished,activityRef:n}:{id:t,kind:"success",title:"执行状态已经更新",activityRef:n}}function dO(e){const t=D7(e),n=`activity:${e.id}`,a=sO(e.args);if(e.status==="running")return{id:n,kind:"progress",title:a?`正在等待新的执行进展,最长等待时间 ${a} 秒`:"正在等待新的执行进展",activityRef:t};if(e.status==="error")return{id:n,kind:"error",title:"等待执行进展时遇到问题",activityRef:t};let s="";typeof e.resultText=="string"?s=e.resultText:typeof e.result=="string"&&(s=e.result);const o=lO(e),c=uO([s,...o?cO(o):[]],n,t);if(c)return c;if(o){if(o.timedOut===!0||o.changed===!1)return{id:n,kind:"warning",title:"等待期间没有新的执行进展",activityRef:t};if(o.changed===!0)return{id:n,kind:"success",title:"已经收到新的执行进展",activityRef:t}}return{id:n,kind:"success",title:"执行状态已经更新",activityRef:t}}function fO(e){const t=nO(e.toolName);if(t==="technical-only"||t==="inline-detail")return;if(e.toolName==="operationWait")return dO(e);const n=aO[e.toolName];if(!n)return;let a=n.success;return e.status==="running"?a=n.running:e.status==="error"&&(a=n.error),{id:`activity:${e.id}`,kind:oO(e.status),title:a,activityRef:D7(e)}}function j7(e){return rO[e]??"任务活动"}function yp(e){switch(e){case"starting":return{label:"正在启动",kind:"progress"};case"running":return{label:"运行中",kind:"progress"};case"succeeded":case"finished":case"FINISHED":case"pass":return{label:"已完成",kind:"success"};case"failed":case"partial_failed":case"ERROR":case"FAILED":case"timed-out":return{label:"未完成",kind:"error"};case"needs-reconcile":return{label:"需要同步",kind:"warning"};case"cancelled":case"abandoned":case"superseded":return{label:"已停止",kind:"warning"};default:return{label:"状态已更新",kind:"success"}}}function L7(e){return[e.activityRef??`operation:${e.operationId}`,`operation:${e.operationId}`,...e.toolCallId?[`tool:${e.toolCallId}`]:[]]}function z7(e){return[e.activityRef??`gate:${e.cardId}`]}function B7(e){return[e.activityRef??`artifact:${e.artifactId}`]}function hO(e){return new Set([...e.operations.flatMap(L7),...e.gates.flatMap(z7),...e.artifacts.flatMap(B7)])}function Jy(e){return e.updatedSeq??e.eventSeq}function e3(e){const t=Date.parse(e.updatedAt);return Number.isFinite(t)?t:0}function xp(e,t){const n=Jy(e),a=Jy(t);return n!==void 0&&a!==void 0?n-a:e3(e)-e3(t)}function mO(e){return e.taskId?`task:${e.taskId}`:e.dagRunId?`run:${e.dagRunId}`:`operation:${e.operationId}`}function pO(e){return e.taskId?e.taskId.replace(/^\d{4}-\d{2}-\d{2}-/,"").replace(/[-_]+/g," ").trim()||e.taskId:j7(e.action)}function gO(e){return[...new Set(e)]}function bO(e){const t=new Map;for(const n of e)t.set(n.action,n);return[...t.values()].sort(xp).map(n=>{const a=yp(n.state);return{id:n.operationId,label:j7(n.action),stateLabel:a.label,kind:a.kind,at:n.updatedAt}})}function vO(e){const t=new Map;for(const n of e){const a=n.dagRunId??n.runSummary?.runId;if(!a)continue;const s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort((m,p)=>xp(p,m)),o=s[0];if(!o)return[];const c=s.find(m=>m.runSummary)?.runSummary,d=c?.status??o.state,h=yp(d);return[{runId:n,state:d,stateLabel:h.label,kind:h.kind,updatedAt:o.updatedAt,operationCount:a.length,firstFailedNode:c?.nodes.find(m=>m.status==="ERROR")?.id,failureCategory:c?.failureCategory,inspectHref:o.inspectHref}]}).sort((n,a)=>Date.parse(a.updatedAt)-Date.parse(n.updatedAt))}function q7(e){const t=new Map;for(const n of e){const a=mO(n),s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort(xp),o=s.at(-1);if(!o)return[];const c=yp(o.state);return[{key:n,taskId:o.taskId,displayTitle:pO(o),state:o.state,stateLabel:c.label,kind:c.kind,updatedAt:o.updatedAt,latestOperation:o,operations:s,steps:bO(s),runs:vO(s),activityRefs:gO(s.flatMap(L7)),compactEligible:c.kind==="success"}]}).sort((n,a)=>{const s=n.kind==="progress"||n.kind==="error"?0:1,o=a.kind==="progress"||a.kind==="error"?0:1;return s!==o?s-o:Date.parse(a.updatedAt)-Date.parse(n.updatedAt)})}const yO={operation:"执行记录",contract:"任务契约",dag:"执行流程",report:"报告",html:"HTML 预览"};function xO(e){const{artifact:t}=e,n=!!(t.reportText||t.htmlPreview);return u.jsxs("section",{className:"oc-artifact-card","aria-label":`任务产物:${t.title??t.artifactId}`,"data-activity-ref":t.activityRef??`artifact:${t.artifactId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"任务产物"}),u.jsx("strong",{children:t.title??t.artifactId}),u.jsx("code",{children:t.artifactId})]}),u.jsx("span",{children:yO[t.kind]})]}),t.summary?u.jsx("p",{children:t.summary}):null,n?u.jsxs("details",{className:"oc-artifact-details",children:[u.jsx("summary",{children:"预览与技术详情"}),t.reportText?u.jsx("pre",{children:t.reportText}):null,t.htmlPreview?u.jsx("iframe",{title:`${t.title??t.artifactId} preview`,sandbox:"",srcDoc:t.htmlPreview}):null]}):null,t.inspectHref?u.jsx("footer",{children:u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>Es(Pi(t.inspectHref??"")),children:"打开产物"})}):null]})}const t3={prepared:"等待确认",confirmed:"已经确认",dispatched:"正在执行",consumed:"已经完成",stale:"已经失效",expired:"已经过期",error:"处理失败"};function n3(e){return e.gateType==="contract-apply"?"确认任务契约变更":e.gateType==="mutation"?"确认执行工作区修改":"确认启动任务执行"}function wO({card:e,origin:t,sessionId:n}){const[a,s]=w.useState(!1),[o,c]=w.useState(),d=async()=>{s(!0),c(void 0);try{let g="contract-apply";e.gateType==="dag-run"?g=e.state==="prepared"?"dag-confirm":"dag-run":e.gateType==="mutation"&&(g="mutation-apply");const x=e.gateType==="dag-run"?{confirmationId:e.confirmationId,...e.state==="prepared"?{humanGateToken:e.humanGateToken}:{}}:{receiptId:e.receiptId,humanGateToken:e.humanGateToken},y=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/human-gate/${g}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(x)}),S=await y.json();if(!y.ok)throw new Error(S.error?.message??`HTTP ${y.status}`)}catch(g){c(g instanceof Error?g.message:String(g))}finally{s(!1)}},h=e.state==="prepared"||e.gateType==="dag-run"&&e.state==="confirmed";let m="确认接受";e.gateType==="mutation"?m="确认执行":e.gateType==="dag-run"&&(m=e.state==="prepared"?"确认边界":"启动执行");const p=(e.displayOnlyChallenges?.length??0)+(e.dagSpine?.length??0);return u.jsxs("section",{className:`oc-human-gate-card is-${e.state}`,"aria-label":`${n3(e)}:${t3[e.state]}`,"data-activity-ref":e.activityRef??`gate:${e.cardId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"人工门禁"}),u.jsx("strong",{children:n3(e)}),u.jsx("code",{children:e.taskId})]}),u.jsx("span",{children:t3[e.state]})]}),e.contractDiffSummary?u.jsx("p",{className:"oc-human-gate-summary",children:e.contractDiffSummary}):null,p>0||e.errorMessage?u.jsxs("details",{className:"oc-human-gate-details",children:[u.jsxs("summary",{children:["门禁详情 · ",p," 项"]}),e.displayOnlyChallenges?.length?u.jsxs("div",{className:"oc-human-gate-challenges",children:[u.jsx("b",{children:"确认前请检查"}),u.jsx("ul",{children:e.displayOnlyChallenges.map(g=>u.jsx("li",{children:g},g))})]}):null,e.dagSpine?.length?u.jsxs("div",{children:[u.jsx("b",{children:"计划执行步骤"}),u.jsx("ol",{children:e.dagSpine.map(g=>u.jsx("li",{children:u.jsx("code",{children:g})},g))})]}):null,e.errorMessage?u.jsx("p",{className:"oc-human-gate-error",children:e.errorMessage}):null]}):null,u.jsxs("footer",{children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>Es(Pi(e.inspectHref)),children:"查看记录"}),u.jsx("button",{className:"btn btn-primary",type:"button",disabled:!h||a,onClick:()=>{d()},children:a?"提交中…":m})]}),o?u.jsx("div",{className:"oc-human-gate-error",children:o}):null]})}const kO={validation:"节点输出未通过契约或门禁校验。可在恢复页从失败节点重跑;若错误指向任务契约(如验证命令、Mock 策略),先修正任务配置并重新生成 DAG。",executor:"执行器或模型提供方调用失败(网络、配额或运行时错误)。稍后可在恢复页从失败节点重跑;反复出现请到「模型与认证」页检查配置与凭据。","write-guard":"写入越过了授权边界(writeSet / allowedPaths)。检查计划中的写入路径是否越界,修正后从失败节点重跑。",timeout:"节点执行超时。可在恢复页从失败节点重跑;反复超时建议缩小任务范围或排查卡住的命令。",auth:"模型或服务认证失败。请先到「模型与认证」页检查 API Key 与模型配置,再从失败节点重跑。","human-required":"节点正在等待人工审批。完成审批后该节点可继续执行;也可在恢复页查看对账状态。","human-rejected":"人工审批被拒绝。请调整任务描述或契约后重新发起任务。","shell-command":"验证/构建命令以非零退出。进入 DAG 查看命令输出定位具体失败,修复后从失败节点重跑。","static-error":"静态检查(typecheck / lint 等)失败。修复对应代码错误后从失败节点重跑。","decision-envelope":"决策与证据不匹配(决策包络校验失败)。进入 DAG 查看节点决策依据,修正后重跑。",unknown:"失败原因未归类。进入 DAG 查看节点详情,或在恢复页使用对账 / 诊断入口。"};function SO(e){if(e)return kO[e]}function r3(e,t=900){if(e)return e.length>t?`${e.slice(0,t)}…`:e}function pm(e){return new Date(e).toLocaleString()}function a3(e){if(!e)return;const t=e.trim();if(/taskId[^\n]*(?:placeholder|占位)|["']?<id>["']?/i.test(t))return"任务编号仍是占位符;请提供实际的 YYYY-MM-DD-<slug> 任务编号后重试。";if(/ENOENT|no such file or directory/i.test(t))return"任务活动缺少所需文件或目录,可进入 DAG 查看详情。";if(/command failed|exited with code/i.test(t))return"相关命令没有成功完成,可进入 DAG 查看详情。";if(!(t.length>220||t.startsWith("{")||t.startsWith("[")||t.includes("[dag execute]")||t.includes("schemaVersion")||/[A-Za-z]:\\/.test(t)))return t}function EO(e){const t=e.latestOperation,n=t.runSummary;if(e.kind==="success"||e.kind==="progress")return;const a=n?.nodes.find(c=>c.status==="ERROR")?.id;if(a){const c=n?.failureCategory?`,原因分类为 ${n.failureCategory}`:"";return`执行在 ${a} 阶段未完成${c}。`}const s=n?.next?.description;if(s&&/fail|error|block|cannot|unable/i.test(s))return s;const o=a3(t.stderrPreview)??a3(t.summaryPreview);return o||(e.kind==="error"?"本次任务活动没有完成,可进入 DAG 查看详情或使用恢复选项。":"本次任务活动需要进一步确认,请查看相关记录。")}function TO(e){const{journey:t}=e,n=t.latestOperation,a=t.runs[0],s=t.runs.slice(1),o=Pi(n.inspectHref),c=EO(t),d=t.kind==="error"||t.kind==="warning",h=t.latestOperation.runSummary,m=h?.nodes.find(x=>x.failureCategory)?.failureCategory??h?.failureCategory,p=d?SO(m):void 0,g=(x,y)=>{e.onNavigateWorkspace?e.onNavigateWorkspace(x,y):window.location.assign(q9(x,y))};return e.compact?u.jsxs("details",{className:"oc-journey-compact",children:[u.jsxs("summary",{children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsxs("span",{children:[u.jsx("strong",{children:t.displayTitle}),u.jsxs("small",{children:[t.stateLabel," · ",pm(t.updatedAt)]})]}),u.jsx("span",{"aria-hidden":"true",children:"›"})]}),u.jsxs("div",{className:"oc-journey-compact-body",children:[t.taskId?u.jsx("code",{children:t.taskId}):null,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>Es(o),children:"查看记录"})]})]}):u.jsxs("section",{className:`oc-task-journey-card is-${t.kind}`,"aria-label":`${t.displayTitle}:${t.stateLabel}`,children:[u.jsxs("header",{className:"oc-journey-head",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"oc-journey-state-line",children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsx("span",{children:t.stateLabel})]}),u.jsx("strong",{children:t.displayTitle}),t.taskId?u.jsxs("small",{children:["Task · ",u.jsx("code",{children:t.taskId})]}):null]}),u.jsx("time",{dateTime:t.updatedAt,children:pm(t.updatedAt)})]}),u.jsx("div",{className:"oc-journey-steps","aria-label":"任务旅程",children:t.steps.slice(-6).map(x=>u.jsxs("div",{className:"oc-journey-step",children:[u.jsx("span",{className:`oc-journey-step-icon is-${x.kind}`,"aria-hidden":"true",children:x.kind==="success"?"✓":x.kind==="error"?"!":"•"}),u.jsx("span",{children:x.label}),u.jsx("small",{children:x.stateLabel})]},x.id))}),c?u.jsxs("div",{className:`oc-journey-outcome is-${t.kind}`,children:[u.jsx("strong",{children:d?"当前问题":"最新结果"}),u.jsx("p",{children:c}),p?u.jsxs("p",{className:"oc-journey-advice","data-testid":"oc-journey-advice",children:["建议:",p]}):null]}):null,a?u.jsxs("div",{className:"oc-journey-latest-run",children:[u.jsx("span",{children:"最新执行"}),u.jsx("code",{children:a.runId}),u.jsx("b",{className:`is-${a.kind}`,children:a.stateLabel}),a.firstFailedNode?u.jsxs("small",{children:["失败阶段 · ",a.firstFailedNode]}):null]}):null,s.length>0?u.jsxs("details",{className:"oc-journey-history",children:[u.jsxs("summary",{children:["执行历史 ",t.runs.length," 次"]}),u.jsx("div",{children:t.runs.map(x=>u.jsxs("div",{className:"oc-journey-run-row",children:[u.jsx("code",{children:x.runId}),u.jsx("span",{className:`is-${x.kind}`,children:x.stateLabel}),x.firstFailedNode?u.jsx("small",{children:x.firstFailedNode}):null,u.jsx("time",{dateTime:x.updatedAt,children:pm(x.updatedAt)})]},x.runId))})]}):null,u.jsxs("footer",{className:"oc-journey-actions",children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>{const x=n.dagRunId??a?.runId,y=x?Pi(`/#/inspect/dag/${encodeURIComponent(x)}`):o;Es(y)},children:"进入 DAG"}),d&&(t.taskId||n.dagRunId)?u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>g("recovery",{taskId:t.taskId,dagRunId:n.dagRunId}),children:"恢复选项"}):null]}),u.jsxs("details",{className:"oc-journey-technical",children:[u.jsxs("summary",{children:["技术详情 · ",t.operations.length," 项活动"]}),u.jsx("div",{className:"oc-journey-technical-body",children:t.operations.map(x=>u.jsxs("div",{className:"oc-journey-operation-row",children:[u.jsxs("div",{children:[u.jsx("code",{children:x.operationId}),u.jsx("span",{children:x.action})]}),x.dagRunId?u.jsxs("small",{children:["run · ",x.dagRunId]}):null,x.controller?u.jsxs("small",{children:["controller · ",x.controller]}):null,x.stderrPreview?u.jsx("pre",{className:"is-error",children:r3(x.stderrPreview)}):null,x.summaryPreview?u.jsx("pre",{children:r3(x.summaryPreview)}):null]},x.operationId))})]})]})}function i3(e){return e.state==="prepared"||e.state==="confirmed"?0:e.state==="dispatched"?1:e.state==="error"?2:3}function gm(e,t){return e!==null&&t.includes(e)}function CO(e){return e.operations>0?"operations":e.gates>0?"gates":"artifacts"}function NO(e){const t=e.presentation==="sidecar",n=t||e.open,a=w.useRef(null),[s,o]=w.useState("operations"),c=w.useMemo(()=>q7(e.operationCards),[e.operationCards]),d=c.length+e.humanGateCards.length+e.artifactCards.length,h=w.useMemo(()=>[...e.humanGateCards].sort((y,S)=>{const T=i3(y)-i3(S);return T!==0?T:(S.eventSeq??0)-(y.eventSeq??0)}),[e.humanGateCards]),m=w.useMemo(()=>[...e.artifactCards].sort((y,S)=>(S.eventSeq??0)-(y.eventSeq??0)),[e.artifactCards]);if(Xl({open:n&&!t,containerRef:a,triggerRef:e.triggerRef,onEscape:e.onClose}),w.useEffect(()=>{o(CO({operations:c.length,gates:e.humanGateCards.length,artifacts:e.artifactCards.length}))},[e.sessionId]),w.useEffect(()=>{e.focusRef&&(e.focusRef.startsWith("gate:")?o("gates"):e.focusRef.startsWith("artifact:")?o("artifacts"):o("operations"))},[e.focusRef]),w.useEffect(()=>{if(!n||!e.focusRef)return;const y=window.requestAnimationFrame(()=>{const S=a.current;if(!S)return;Array.from(S.querySelectorAll("[data-activity-ref], [data-tool-call-id], [data-activity-refs]")).find(R=>{const M=R.dataset.activityRefs?.split(" ")??[];return R.dataset.activityRef===e.focusRef||M.includes(e.focusRef??"")||R.dataset.toolCallId&&`tool:${R.dataset.toolCallId}`===e.focusRef})?.scrollIntoView({block:"nearest",behavior:"smooth"})});return()=>window.cancelAnimationFrame(y)},[n,s,e.focusRef]),!n||d===0)return null;let p="is-drawer";t?p="is-sidecar":e.presentation==="sheet"&&(p="is-sheet");const g=t&&e.sidecarRect?{top:e.sidecarRect.top,left:e.sidecarRect.left,height:e.sidecarRect.height,width:e.sidecarRect.width}:void 0,x=u.jsxs("aside",{ref:a,id:"oc-activity-rail",className:`oc-activity-rail ${p} is-${e.phase}`,style:g,"aria-label":"本次对话的活动","aria-busy":e.phase==="switching",tabIndex:-1,children:[u.jsxs("header",{className:"oc-activity-rail-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"本次对话的活动"}),u.jsx("small",{children:"运行、门禁与任务产物"})]}),u.jsx("span",{className:"oc-activity-count",children:d}),t?null:u.jsx("button",{type:"button",className:"oc-activity-close","aria-label":"关闭运行活动",onClick:e.onClose,children:"×"})]}),u.jsxs("div",{className:"oc-activity-content",children:[u.jsxs("div",{className:"oc-activity-tabs",role:"tablist","aria-label":"活动类型",children:[u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="operations",className:s==="operations"?"is-active":"",onClick:()=>o("operations"),children:["运行 ",u.jsx("span",{children:c.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="gates",className:s==="gates"?"is-active":"",onClick:()=>o("gates"),children:["门禁 ",u.jsx("span",{children:h.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":s==="artifacts",className:s==="artifacts"?"is-active":"",onClick:()=>o("artifacts"),children:["产物 ",u.jsx("span",{children:m.length})]})]}),u.jsxs("div",{className:"oc-activity-list",children:[s==="operations"&&c.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务执行记录。"}):null,s==="operations"?c.map((y,S)=>{const T=y.activityRefs;return u.jsxs("div",{"data-activity-refs":T.join(" "),className:`oc-activity-card-wrap${gm(e.focusRef,T)?" is-focused":""}`,children:[u.jsx(TO,{journey:y,compact:S>0&&y.compactEligible,origin:e.origin,onNavigateWorkspace:e.onNavigateWorkspace}),u.jsx("button",{type:"button",className:"oc-activity-locate",onClick:()=>e.onLocateConversation(T),children:"查看对话位置"})]},y.key)}):null,s==="gates"&&h.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有需要展示的门禁。"}):null,s==="gates"?h.map(y=>{const S=z7(y);return u.jsx("div",{className:`oc-activity-card-wrap${gm(e.focusRef,S)?" is-focused":""}`,children:u.jsx(wO,{card:y,origin:e.origin,sessionId:e.sessionId})},y.cardId)}):null,s==="artifacts"&&m.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务产物。"}):null,s==="artifacts"?m.map(y=>{const S=B7(y);return u.jsx("div",{className:`oc-activity-card-wrap${gm(e.focusRef,S)?" is-focused":""}`,children:u.jsx(xO,{artifact:y})},y.artifactId)}):null]})]},e.sessionId)]});return t?Zl.createPortal(x,document.body):x}const H7=420,U7=12;function RO(e){if(e.layoutMode==="narrow")return"sheet";const t=e.railWidth??H7,n=e.gap??U7;return e.viewportWidth-e.mainRight>=t+n?"sidecar":"drawer"}const AO={presentation:"drawer",sidecarRect:null};function IO(e,t,n){const[a,s]=w.useState(AO);return w.useLayoutEffect(()=>{const o=e.current;if(!o)return;const c=o.closest(".panel--chat")??o;let d=0;const h=()=>{window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{const p=o.getBoundingClientRect(),g=c.getBoundingClientRect(),x=RO({layoutMode:t,viewportWidth:window.innerWidth,mainRight:p.right}),y=x==="sidecar"?{top:g.top,left:p.right+U7,height:g.height,width:H7}:null;s(S=>S.presentation===x&&S.sidecarRect?.top===y?.top&&S.sidecarRect?.left===y?.left&&S.sidecarRect?.height===y?.height&&S.sidecarRect?.width===y?.width?S:{presentation:x,sidecarRect:y})})};h();const m=new ResizeObserver(h);return m.observe(o),c!==o&&m.observe(c),window.addEventListener("resize",h),()=>{window.cancelAnimationFrame(d),m.disconnect(),window.removeEventListener("resize",h)}},[t,e,n]),a}const s3={comfortableMin:620,compactMin:480};function _O(e){return!Number.isFinite(e)||e<0?"extra-compact":e>=s3.comfortableMin?"comfortable":e>=s3.compactMin?"compact":"extra-compact"}function MO(e){return`is-landing-${e}`}const OO=[{label:"新建任务",hint:"先走需求分析 skills,再导入创建任务",prompt:["我要新建任务。请先做需求分析,不要用一句话直接 bootstrapFromPrd。","1. 先问我需求内容和范围(frontend / backend / both,默认 both)。","2. 读取并严格执行 `.agents/skills/analyze-product-requirements/SKILL.md`(`loop-agent init --profile full` 会投影该 skill):按规程澄清访谈、校验,并把产物写到 `docs/product-analysis/<requirement-id>/`(product-analysis.md、requirement-clarification.md、product-requirement.md)。","3. product-requirement 为 complete 且校验通过后,再严格执行 `.agents/skills/analyze-product-dependencies/SKILL.md`,生成 dependency-analysis.md 和按需的 api-documentation.md。","4. 两套产物都校验通过后,再用这些文件 bootstrapFromPrd 创建任务,并建议 taskKind。","若上述 skill 不存在,先说明缺失,并提示运行 `loop-agent init --repo-root . --profile full --merge`。"].join(`
395
+ `)},{label:"查看任务状态",hint:"列出任务与就绪/阻塞状态",prompt:"列出当前所有 task 及其状态,重点说明哪些是 Ready 可以推进、哪些 Blocked 及阻塞原因。"},{label:"诊断 DAG 运行",hint:"对失败运行跑 Doctor",prompt:"帮我诊断最近失败或异常的 DAG 运行:先列出最近的 DAG 运行,对有问题的运行执行 doctor,总结根因和可执行的恢复方案。"},{label:"恢复或重跑任务",hint:"默认从节点续跑,勿无故新开 task",prompt:"我要恢复失败或卡住的 DAG。请先 dagReport/dagDoctor 看 primaryFailure.nodeId 与 primaryRecovery;默认用 dagRerunPlan→dagRerun 从失败节点续跑(plan 合格后直接 dagRerun,不要 prepareMutationGate)。不要新建 task-id。plan 不合格时:Worker Task Pool Failed 用 workerPoolDoctor 确认后再 workerTaskRetry;独立 Console run 用 standaloneTaskRerun(整单重生,不是从节点续跑)。paused/中断需要 resume 时准备 Human Gate,不要自己调 dagResume。确定后直接帮我发起。"}];function F7(e){const t=e.readiness==="setup-required",n=!!e.disabled||t,a=e.density??"comfortable",s=e.mode==="no-session"?"开始一段新的对话":"今天想推进什么?",o=e.mode==="no-session"?"用自然语言编排 loop-agent:查询状态、诊断问题、创建与恢复任务。可先点选下方建议,或新建空白对话。":"会话已就绪。点选建议快速开场,或在下方输入框直接描述目标。业务写入仍经受治理 DAG。";return u.jsxs("div",{className:`oc-empty ${MO(a)}`,role:"status","data-landing-density":a,children:[u.jsxs("div",{className:"oc-empty-hero",children:[u.jsx("img",{className:"oc-empty-icon oc-empty-brand",src:"/favicon.svg",alt:"","aria-hidden":"true",draggable:!1}),u.jsxs("div",{className:"oc-empty-copy",children:[u.jsx("h3",{children:s}),u.jsx("p",{children:o})]})]}),u.jsx("div",{className:"oc-suggestions","aria-label":"开场建议",children:OO.map(c=>u.jsxs("button",{type:"button",className:"oc-suggestion",onClick:()=>e.onSuggest(c.prompt),disabled:n,children:[u.jsx("strong",{children:c.label}),u.jsx("span",{children:a==="extra-compact"?c.hint.replace(/[,,].*$/,""):c.hint})]},c.label))}),u.jsxs("ul",{className:"oc-empty-tips",children:[u.jsxs("li",{children:[u.jsx("kbd",{children:"@"}),u.jsx("span",{children:"引用仓库文件"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"/"}),u.jsx("span",{children:"快捷命令"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"Enter"}),u.jsx("span",{children:"发送 · Shift+Enter 换行"})]})]}),e.mode==="no-session"&&e.onCreateSession?u.jsx("button",{type:"button",className:"btn btn-primary oc-empty-cta",onClick:e.onCreateSession,disabled:n,"aria-busy":e.disabled||void 0,children:t?"需先完成 Pi setup":e.disabled?"创建中…":"新建空白对话"}):null]})}function DO(e){const{interview:t,interviewAnswer:n,onAnswerChange:a,onAnswer:s}=e;return u.jsxs("section",{className:"oc-draft-card","aria-label":"Requirement Interview",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Requirement Interview"}),u.jsx("span",{children:t.state})]}),t.question&&u.jsxs("div",{className:"oc-interview-bubble",children:[u.jsx("strong",{children:t.question.text}),u.jsxs("p",{children:["建议:",t.question.recommendation]}),u.jsx("textarea",{value:n,onChange:o=>a(o.target.value),placeholder:"输入答案"}),u.jsxs("div",{children:[u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>s("override"),disabled:!n.trim(),children:"提交答案"}),u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>s("accept-recommendation"),children:"接受建议"})]})]}),t.draft&&u.jsxs("details",{open:!0,children:[u.jsxs("summary",{children:["TaskContractDraftV1 · ",t.draftSha256?.slice(0,12)]}),u.jsx("pre",{children:JSON.stringify(t.draft,null,2)})]}),t.assessment&&u.jsxs("div",{className:`oc-assessment${t.assessment.fresh?" is-fresh":""}`,children:[u.jsxs("strong",{children:["完整性:",t.assessment.outcome]}),(t.assessment.missingFields??[]).length>0&&u.jsxs("p",{children:["缺失:",t.assessment.missingFields?.join("、")]})]}),t.taskKindRecommendation&&u.jsxs("div",{className:"oc-task-kind-card",children:[u.jsx("span",{children:"taskKind 建议"}),u.jsx("strong",{children:t.taskKindRecommendation}),u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>e.onConfirmTaskKind(),children:"由我确认"}),u.jsx("small",{children:"模型不能代替人类确认。"})]}),t.confirmedTaskKind&&u.jsxs("div",{className:"oc-task-kind-card is-confirmed",children:["已由人类确认:",u.jsx("strong",{children:t.confirmedTaskKind})]})]})}function $7(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function w1(e){const[t,n]=w.useState(!1),a=()=>{navigator.clipboard?.writeText(e.text).then(()=>{n(!0),window.setTimeout(()=>n(!1),1600)},()=>{})};return u.jsx("button",{type:"button",className:`oc-message-copy${t?" is-copied":""}`,"aria-label":t?"已复制":"复制消息",title:t?"已复制":"复制",onClick:a,children:t?u.jsx(Ek,{}):u.jsx(Sk,{})})}function jO({message:e}){const[t,n]=w.useState(!1),a=e.text.trim().length>0,s=e.compaction?.tokensBefore,o=s?`已压缩历史上下文(压缩前约 ${$7(s)} tokens)`:"已压缩历史上下文";return u.jsxs("div",{className:`oc-compaction-card${t?" is-expanded":""}`,role:"status",children:[u.jsxs("button",{type:"button",className:"oc-compaction-trigger",disabled:!a,"aria-expanded":a?t:void 0,onClick:()=>n(c=>!c),children:[u.jsxs("span",{className:"oc-compaction-leading","aria-hidden":"true",children:[u.jsx("span",{className:"oc-compaction-icon",children:u.jsx(Qw,{size:15})}),u.jsx("span",{className:"oc-compaction-chevron",children:t?u.jsx(hd,{size:15}):u.jsx(zw,{size:15})})]}),u.jsx("strong",{children:"compact"}),u.jsx("span",{className:"oc-compaction-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-compaction-summary-line",children:o}),u.jsx("span",{className:"oc-compaction-time",children:Ul(e.createdAt)})]}),t&&a?u.jsx("div",{className:"oc-compaction-details",children:u.jsx(ic,{text:e.text})}):null]})}function o3(e){const{message:t,streaming:n,activeAssistantId:a}=e;if(t.kind==="compaction")return u.jsx(jO,{message:t});const s=t.role==="user",o=s?"你":"助手",c=!s&&n&&a!==null&&t.id===a,d=c&&t.text.length===0,h=t.text.trim().length>0,m=u.jsxs("div",{className:"oc-meta",children:[!s&&u.jsx("span",{className:"oc-role oc-role-assistant","aria-hidden":"true",children:"π"}),u.jsxs("span",{className:"oc-time",children:[Ul(t.createdAt),u.jsxs("span",{className:"sr-only",children:["(",o,")"]})]}),h&&u.jsx(w1,{text:t.text})]}),p=u.jsxs("div",{className:`oc-bubble ${s?"oc-bubble-user":"oc-bubble-assistant"}`,children:[h?s?u.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t.text}):u.jsx(ic,{text:t.text}):d?u.jsx("span",{className:"oc-cursor","aria-hidden":"true"}):null,c&&h&&u.jsx("span",{className:"oc-cursor","aria-hidden":"true"})]});return u.jsx("div",{className:`oc-row ${s?"is-user":"is-assistant"}`,"data-user-message-id":s?t.id:void 0,children:s?u.jsxs("div",{className:"oc-user-stack",children:[p,m]}):u.jsxs(u.Fragment,{children:[m,p]})})}function LO(e){switch(e){case"authentication":return"认证失败";case"context-overflow":return"上下文过大";case"rate-limit":return"请求过于频繁";default:return"Provider 请求失败"}}function zO(){return u.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[u.jsx("path",{d:"M10 2.4 18 16H2L10 2.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),u.jsx("path",{d:"M10 7v4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),u.jsx("circle",{cx:"10",cy:"14",r:".9",fill:"currentColor"})]})}function BO({error:e}){const[t,n]=w.useState(!1),a=[e.code===void 0?void 0:`HTTP ${e.code}`,e.type].filter(Boolean);return u.jsxs("section",{className:"oc-provider-error",role:"status",children:[u.jsx("div",{className:"oc-provider-error-mark",children:u.jsx(zO,{})}),u.jsxs("div",{className:"oc-provider-error-body",children:[u.jsxs("div",{className:"oc-provider-error-heading",children:[u.jsx("strong",{children:LO(e.category)}),a.length>0&&u.jsx("span",{className:"oc-provider-error-meta",children:a.join(" · ")})]}),u.jsx("p",{children:e.message}),u.jsxs("details",{className:"oc-provider-error-details",open:t,onToggle:s=>n(s.currentTarget.open),children:[u.jsx("summary",{children:t?"收起原始响应":"查看原始响应"}),u.jsx("pre",{children:e.raw})]})]})]})}function qO(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return null}if(!t||typeof t!="object")return null;const n=t.todos;return Array.isArray(n)?n.filter(a=>!!a&&typeof a=="object"&&typeof a.content=="string"&&(a.status==="pending"||a.status==="in_progress"||a.status==="completed")):null}function HO(e){const t=qO(e);if(!t)return null;const n=t.filter(s=>s.status==="completed").length,a=t.filter(s=>s.status==="in_progress");return{text:`${n}/${t.length} 已完成${a[0]?.content?` · ${a[0].content}`:""}`,extra:Math.max(0,a.length-1)}}function UO(e){const t={size:14,"aria-hidden":!0};return e.kind==="bash"?u.jsx(Zw,{...t}):e.kind==="read"?u.jsx(Uw,{...t}):e.kind==="search"?u.jsx(qm,{...t}):e.kind==="write"?u.jsx(D1,{...t}):e.kind==="web"?u.jsx(Fw,{...t}):e.kind==="mcp"?u.jsx(Gw,{...t}):u.jsx(Jw,{...t})}function FO(e,t){const n=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);return(t?n.at(-1):n[0])??"…"}function $O(e){const t=e.split(/\r?\n/).map(n=>n.replace(/\s+/g," ").trim()).find(Boolean);return t?t.length>180?`${t.slice(0,180)}…`:t:"工具调用失败"}function P7(e){const{entry:t}=e,[n,a]=w.useState(t.status==="error"),[s,o]=w.useState(!1),c=t.status==="running"?"运行中":t.status==="error"?"出错":"完成",d=ik(t.args,{toolName:t.toolName}),h=uk(t.createdAt,t.finishedAt),m=ok(t.toolName),p=sk(t.toolName),g=t.toolName==="todo_write",x=g?HO(t.args):null,y=t5(t.resultText??t.result),S=t.status==="error"?$O(y):d,T=x?.text??S,N=ck(y,s?{maxLen:Number.MAX_SAFE_INTEGER}:void 0);return w.useEffect(()=>{t.status==="error"&&a(!0)},[t.status]),u.jsxs("div",{className:`oc-tool ${t.status==="error"?"is-error":""} ${t.status==="running"?"is-running":""} is-${p.kind}`,"data-tool-kind":p.kind,children:[u.jsxs("button",{type:"button",className:"oc-tool-head","aria-expanded":n,onClick:()=>a(R=>!R),children:[u.jsxs("span",{className:"oc-tool-leading",children:[t.status==="error"?u.jsx("span",{className:"oc-tool-state-dot","aria-hidden":"true"}):u.jsx("span",{className:"oc-tool-icon",children:g?u.jsx(X3,{size:14,"aria-hidden":"true"}):u.jsx(UO,{kind:p.kind})}),u.jsx(o5,{})]}),u.jsx("span",{className:"oc-tool-name",children:g?"更新任务清单":p.label}),S&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:`oc-tool-args${t.status==="error"?" is-error":""}`,children:T})]}),x&&x.extra>0?u.jsxs("span",{className:"oc-tool-summary-suffix",children:["+",x.extra]}):null,h!==void 0&&u.jsxs("span",{className:"oc-tool-duration",children:[h,"s"]}),u.jsx("span",{className:"sr-only",children:c})]}),n&&u.jsxs("div",{className:"oc-tool-body",children:[t.args!==void 0&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:m.argsLabel}),u.jsx("pre",{className:"oc-tool-code",children:lk(t.args)})]}),(t.resultText!==void 0||t.result!==void 0)&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:t.status==="error"?"错误":m.resultLabel}),u.jsx("pre",{className:"oc-tool-code",children:N.text}),N.truncated&&!s&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-tool-expand-result",onClick:()=>o(!0),children:"展开全部"})]}),t.status==="running"&&t.resultText===void 0&&t.result===void 0&&t.args===void 0&&u.jsx("div",{className:"oc-tool-section",children:u.jsx("div",{className:"oc-tool-waiting",children:"等待结果…"})})]})]})}function PO(e){const{thinking:t,defaultOpen:n}=e,[a,s]=w.useState(n),o=FO(t,n);return w.useEffect(()=>{s(n)},[n]),u.jsxs("div",{className:`oc-thinking${n?" is-running":""}`,children:[n?u.jsx("span",{className:"sr-only",children:"运行中"}):null,u.jsxs("button",{type:"button",className:`oc-thinking-summary${a?" is-open":""}`,"aria-expanded":a,onClick:()=>s(c=>!c),children:[u.jsxs("span",{className:"oc-tool-leading",children:[u.jsx("span",{className:"oc-tool-icon",children:u.jsx(Xw,{size:14,"aria-hidden":"true"})}),u.jsx(o5,{})]}),u.jsx("span",{className:"oc-thinking-label",children:"Think"}),a?null:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-thinking-preview",children:o})]})]}),a?u.jsx("pre",{className:"oc-thinking-body",children:t||"…"}):null]})}function GO(e){return e.kind==="progress"?"••":e.kind==="success"?"✓":e.kind==="warning"?"!":"×"}function VO(e){const{activity:t,onActivate:n}=e,a=!!(t.activityRef&&n&&(e.canActivate?.(t.activityRef)??!0)),s=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-semantic-activity-icon","aria-hidden":"true",children:GO(t)}),u.jsxs("span",{className:"oc-semantic-activity-copy",children:[u.jsx("strong",{children:t.title}),t.detail?u.jsx("small",{children:t.detail}):null]}),a?u.jsx("span",{className:"oc-semantic-activity-link",children:"查看详情"}):null]});if(a&&t.activityRef&&n){const o=t.activityRef;return u.jsx("button",{type:"button",className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":o,onClick:()=>n(o),children:s})}return u.jsx("div",{className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":t.activityRef,children:s})}function KO(e){const{items:t,live:n}=e;return u.jsx(u.Fragment,{children:t.map((a,s)=>{if(a.kind==="thinking")return u.jsx(PO,{thinking:a.thinking,defaultOpen:n},`thinking-${s}`);if(a.kind==="text")return u.jsx("div",{className:"oc-process-text",children:u.jsx(ic,{text:a.text})},`text-${s}`);if(a.kind==="activity")return u.jsx(VO,{activity:a.activity,onActivate:e.onActivateActivity,canActivate:e.canActivateActivity},a.activity.id);if(a.kind==="tool")return u.jsx(P7,{entry:a.tool},a.tool.id);if(a.kind==="provider-error")return u.jsx(BO,{error:a.error},`provider-error-${s}`)})})}function YO(e){const{scrollContainerRef:t,messagesEndRef:n,onScroll:a,showScrollToLatest:s,onScrollToLatest:o,hasThread:c,readiness:d,streaming:h,compacting:m=!1,streamingAssistantId:p,messagesCount:g,visibleCount:x,onLoadMore:y,turnGroups:S,interview:T}=e;return u.jsxs("div",{ref:t,className:`oc-messages${c?" has-thread":" is-empty"}`,onScroll:a,children:[c?null:u.jsx(F7,{mode:"empty-session",readiness:d,disabled:h,onSuggest:e.onSuggest}),c?u.jsxs("div",{className:"oc-message-column",children:[g>x&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-load-history",onClick:y,children:"加载更早消息"}),S.map((N,R)=>{const M=N.user??N.assistants[0],_=R>0?S[R-1].user??S[R-1].assistants[0]:void 0,P=!!M&&(!_||Yf(_.createdAt)!==Yf(M.createdAt)),F=N.answer,A=!!F?.text.trim(),L=N.live&&N.processItems.length===0;return u.jsxs("div",{className:"oc-turn-group","aria-live":N.live?"polite":void 0,children:[P&&M&&u.jsx("div",{className:"oc-day-sep",children:Yf(M.createdAt)}),N.user&&u.jsx(o3,{message:N.user,streaming:h,activeAssistantId:p}),N.processItems.length>0&&u.jsx(KO,{items:N.processItems,live:N.live,onActivateActivity:e.onActivateActivity,canActivateActivity:e.canActivateActivity}),F&&(A||L)?u.jsx(o3,{message:F,streaming:h,activeAssistantId:p}):null]},N.key)}),m?u.jsx("div",{className:"oc-compaction-card is-running",role:"status","aria-live":"polite",children:u.jsxs("div",{className:"oc-compaction-trigger","aria-busy":"true",children:[u.jsx("span",{className:"oc-compaction-leading","aria-hidden":"true",children:u.jsx("span",{className:"oc-spinner oc-spinner-inline"})}),u.jsx("strong",{children:"compact"}),u.jsx("span",{className:"oc-compaction-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-compaction-summary-line",children:"正在压缩上下文…"})]})}):null,T&&u.jsx(DO,{interview:T,interviewAnswer:e.interviewAnswer,onAnswerChange:e.onInterviewAnswerChange,onAnswer:e.onAnswerInterview,onConfirmTaskKind:e.onConfirmTaskKind}),u.jsx("div",{ref:n})]}):u.jsx("div",{ref:n}),c&&s?u.jsx("div",{className:"oc-scroll-to-latest-slot",children:u.jsx("button",{type:"button",className:"oc-scroll-to-latest","aria-label":"跳转到最新输出",title:"跳转到最新输出",onClick:o,children:u.jsx(hd,{size:19,"aria-hidden":"true"})})}):null]})}const WO=13,l3=240;function ZO(e){const t=e.trim();return t.length>l3?`${t.slice(0,l3).trimEnd()}…`:t}function bm(e,t=64){const n=e.trim().replace(/\s+/g," ");return n.length>t?`${n.slice(0,t)}…`:n}function XO(e,t){if(e.length===0)return[];const n=t>0?Math.max(1,Math.floor(t/WO)):e.length;if(e.length<=n)return e.map((s,o)=>({key:`b${o}`,members:[s]}));const a=[];for(let s=0;s<n;s+=1){const o=Math.floor(s*e.length/n),c=Math.floor((s+1)*e.length/n),d=e.slice(o,Math.max(c,o+1));d.length>0&&a.push({key:`b${s}`,members:d})}return a}function QO(e){const{scrollContainerRef:t,turnGroups:n,measureKey:a}=e,s=w.useRef(null),o=w.useMemo(()=>n.filter(_=>_.user).map((_,P)=>{const F=_.user;return{id:F.id,index:P+1,text:F.text,createdAt:F.createdAt}}),[n]),[c,d]=w.useState(0),[h,m]=w.useState(null),[p,g]=w.useState(null),x=w.useRef(new Map),y=w.useRef(0),S=w.useRef(null),T=w.useCallback(()=>{const _=t.current;if(!_)return;const P=_.offsetTop,F=new Map;for(const L of o){const Z=_.querySelector(`[data-user-message-id="${CSS.escape(L.id)}"]`);Z&&F.set(L.id,Math.max(0,Z.offsetTop-P))}x.current=F;const A=s.current?.clientHeight??_.clientHeight;A!==y.current&&(y.current=A,d(A))},[t,o]),N=w.useCallback(()=>{const _=t.current;if(!_)return;const P=48;let F=null;for(const A of o){const L=x.current.get(A.id);if(L!==void 0)if(L<=_.scrollTop+P)F=A.id;else break}m(F)},[t,o]);w.useEffect(()=>{const _=window.requestAnimationFrame(T);return()=>window.cancelAnimationFrame(_)},[T,a]),w.useEffect(()=>{const _=t.current;if(!_)return;const P=()=>{S.current=null,T(),N()},F=()=>{S.current===null&&(S.current=window.requestAnimationFrame(P))};F(),_.addEventListener("scroll",F,{passive:!0}),window.addEventListener("resize",F);const A=new MutationObserver(F);return A.observe(_,{childList:!0,subtree:!0}),()=>{_.removeEventListener("scroll",F),window.removeEventListener("resize",F),A.disconnect(),S.current!==null&&(window.cancelAnimationFrame(S.current),S.current=null)}},[T,N,t]);const R=w.useMemo(()=>XO(o,c),[o,c]),M=w.useCallback(_=>{const P=t.current,F=x.current.get(_);!P||F===void 0||P.scrollTo({top:Math.max(0,F-8),behavior:"smooth"})},[t]);return o.length===0?null:u.jsx("nav",{ref:s,className:"oc-anchor-rail","aria-label":`用户消息锚点(共 ${o.length} 条)`,children:R.map(_=>{const P=_.members[0],F=h!==null&&_.members.some(Z=>Z.id===h),A=_.members.length,L=p===_.key;return u.jsxs("div",{className:"oc-anchor-cluster",onMouseEnter:()=>g(_.key),onMouseLeave:()=>g(null),children:[u.jsx("button",{type:"button",className:`oc-anchor-bar${F?" is-active":""}${A>1?" is-cluster":""}`,title:A>1?`${A} 条相邻输入`:void 0,"aria-label":A>1?`定位到 ${A} 条聚合输入中的第 ${P.index} 条:${bm(P.text,40)}`:`定位到第 ${P.index} 条输入:${bm(P.text,80)}`,onClick:()=>M(P.id),onFocus:()=>g(_.key),onBlur:()=>g(null)}),L?u.jsx("div",{className:"oc-anchor-popover",role:"tooltip",children:A>1?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:[A," 条聚合输入"]}),u.jsxs("span",{children:["第 ",P.index,"–",_.members[_.members.length-1].index," 条"]})]}),u.jsx("ul",{className:"oc-anchor-popover-list",children:_.members.map(Z=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"oc-anchor-popover-item",onClick:()=>M(Z.id),children:[u.jsx("span",{className:"oc-anchor-popover-item-time",children:Ul(Z.createdAt)}),u.jsx("span",{className:"oc-anchor-popover-item-text",children:bm(Z.text)})]})},Z.id))})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:["第 ",P.index,"/",o.length," 条输入"]}),u.jsx("span",{children:Ul(P.createdAt)})]}),u.jsx("div",{className:"oc-anchor-popover-body",children:ZO(P.text)})]})}):null]},_.key)})})}function G7(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function JO(e){const t=G7(e);return t>0?Math.round(e.cacheReadTokens/t*100):null}function vm(e){const t=e/1e3;if(t<60)return`${Math.round(t*10)/10}s`;const n=Math.round(t);return`${Math.floor(n/60)}m${n%60}s`}function c3(e){const t=n=>n>=100?String(Math.round(n)):String(Math.round(n*10)/10);return e<1e3?String(e):e<1e6?`${t(e/1e3)}K`:`${t(e/1e6)}M`}const eD={auto:"auto(跟随 Pi 默认等级)",off:"off · 关闭",minimal:"minimal · 极简",low:"low · 低",medium:"medium · 中",high:"high · 高",xhigh:"xhigh · 极高",max:"max · 最高"};function V7(e,t){const n=t.trim().toLowerCase(),a=new Map;for(const s of e){if(n&&!s.provider.toLowerCase().includes(n)&&!s.id.toLowerCase().includes(n)&&!(s.name??"").toLowerCase().includes(n))continue;const o=a.get(s.provider)??[];o.push(s),a.set(s.provider,o)}return[...a.entries()].map(([s,o])=>({provider:s,models:o}))}function tD(e,t){const n=new Set,a=[],s=o=>{n.has(o)||(n.add(o),a.push({value:o,label:eD[o]??o,...o==="auto"&&t?{effective:t}:{}}))};s("auto");for(const o of e)s(o);return a}function Ns(e,t){return`${e}/${t}`}function k1(e){return{...e.modelProvider&&e.modelId?{model:{provider:e.modelProvider,modelId:e.modelId}}:{},...e.thinkingLevel?{thinkingLevel:e.thinkingLevel}:{}}}function K7(e,t){return{...e,model:t.model??e.model,thinkingLevel:t.thinkingLevel??e.thinkingLevel}}function nD(e,t){const n=K7(e,t);return n.model?.provider===e.model?.provider&&n.model?.modelId===e.model?.modelId&&n.thinkingLevel===e.thinkingLevel}const u3={auto:"Auto",off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"XHigh",max:"Max"};function rD(e,t){const n=e,a=u3[n]??n;return n!=="auto"||!t?a:`${a} · ${u3[t]??t}`}function aD(e,t){if(!t)return"选择模型";const n=e.find(s=>Ns(s.provider,s.id)===t);if(n)return n.name?.trim()||n.id;const a=t.indexOf("/");return a===-1?t:t.slice(a+1)}function iD(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function d3(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"m5 3.5 3.5 3.5L5 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function sD(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M9 3.5 5.5 7 9 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function oD(e){const t=Ql(),[n,a]=w.useState(!1),[s,o]=w.useState("root"),[c,d]=w.useState(""),[h,m]=w.useState(0),[p,g]=w.useState(0),[x,y]=w.useState(0),S=w.useRef(null),T=w.useRef(null),N=w.useRef(null),R=t.snapshot,M=t.status==="loading",_=t.status==="error"?t.error:null,P=R?.selection?.effectiveThinkingLevel,F=w.useMemo(()=>R?.thinkingLevels?.length?R.thinkingLevels.map(Y=>Y.value):void 0,[R?.thinkingLevels]),A=w.useMemo(()=>tD(F??e.thinkingLevels,P),[F,e.thinkingLevels,P]),L=w.useMemo(()=>R?(R.models??[]).map(Y=>({provider:Y.provider,id:Y.id,...Y.name?{name:Y.name}:{},...Y.hasCredentials!==void 0?{hasCredentials:Y.hasCredentials}:{}})):e.models,[R,e.models]),Z=w.useMemo(()=>V7(L,c),[L,c]),U=w.useMemo(()=>Z.flatMap(Y=>Y.models),[Z]),$=aD(L,e.activeModelRef),q=e.activeThinkingLevel||"auto",W=rD(q,P),oe=!!e.activeModelRef&&(!e.activeModelListed||!L.some(Y=>Ns(Y.provider,Y.id)===e.activeModelRef)),J=()=>{a(!1),o("root"),d("")};w.useEffect(()=>{if(!n)return;const Y=ye=>{ye.target instanceof Node&&S.current&&!S.current.contains(ye.target)&&J()},D=ye=>{ye.key==="Escape"&&J()};return document.addEventListener("mousedown",Y),document.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",Y),document.removeEventListener("keydown",D)}},[n]),w.useEffect(()=>{if(!n)return;if(s==="root"){m(0),window.setTimeout(()=>T.current?.focus(),0);return}if(s==="model"){d(""),g(0),window.setTimeout(()=>N.current?.focus(),0);return}const Y=A.findIndex(D=>D.value===q);y(Y<0?0:Y),window.setTimeout(()=>T.current?.focus(),0)},[n,s,A,q]);const H=Y=>{e.disabled||o(Y)},I=Y=>{if(e.disabled)return;const D=U[Y];D&&(J(),e.onSelectModel(D.provider,D.id))},K=Y=>{if(e.disabled)return;const D=A[Y];D&&(J(),e.onSelectThinking(D.value))},X=Y=>{if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault(),m(D=>D===0?1:0);return}(Y.key==="Enter"||Y.key==="ArrowRight")&&(Y.preventDefault(),H(h===0?"model":"thinking"))},be=Y=>{if(Y.key==="ArrowDown"){Y.preventDefault(),g(D=>U.length?(D+1)%U.length:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),g(D=>U.length?(D-1+U.length)%U.length:0);return}if(Y.key==="Enter"){Y.preventDefault(),I(p);return}Y.key==="ArrowLeft"&&(Y.preventDefault(),o("root"))},j=Y=>{if(Y.key==="ArrowDown"){Y.preventDefault(),y(D=>A.length?(D+1)%A.length:0);return}if(Y.key==="ArrowUp"){Y.preventDefault(),y(D=>A.length?(D-1+A.length)%A.length:0);return}if(Y.key==="Enter"){Y.preventDefault(),K(x);return}Y.key==="ArrowLeft"&&(Y.preventDefault(),o("root"))},G=`选择模型,当前 ${$},推理等级 ${W}`;return u.jsxs("div",{className:"oc-select-menu oc-runtime-selection-menu",ref:S,children:[u.jsxs("button",{type:"button",className:"oc-select-trigger oc-runtime-selection-trigger","aria-haspopup":"menu","aria-expanded":n,"aria-label":G,title:G,disabled:e.disabled,onClick:()=>{n?J():(o("root"),a(!0))},children:[u.jsx("span",{className:"oc-runtime-selection-model",children:$}),u.jsx("span",{className:"oc-runtime-selection-effort",children:W}),u.jsx(iD,{})]}),n&&u.jsx("div",{ref:T,className:"oc-select-panel oc-runtime-selection-panel",role:"menu","aria-label":"模型与推理等级",tabIndex:-1,onKeyDown:s==="root"?X:s==="model"?be:j,children:s==="root"?u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${h===0?" is-highlighted":""}`,onMouseEnter:()=>m(0),onClick:()=>H("model"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"模型"}),u.jsxs("span",{className:"oc-runtime-selection-row-value",children:[$,oe?"(不可用)":""]}),u.jsx(d3,{})]}),u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${h===1?" is-highlighted":""}`,onMouseEnter:()=>m(1),onClick:()=>H("thinking"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"推理等级"}),u.jsx("span",{className:"oc-runtime-selection-row-value",children:W}),u.jsx(d3,{})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:"oc-runtime-selection-back",onClick:()=>o("root"),children:[u.jsx(sD,{}),u.jsx("span",{children:s==="model"?"选择模型":"推理等级"})]}),s==="model"?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:N,className:"oc-select-search",placeholder:"搜索模型或供应商…","aria-label":"搜索模型或供应商",value:c,onChange:Y=>{d(Y.target.value),g(0)}}),u.jsxs("div",{className:"oc-runtime-selection-groups",children:[M&&u.jsx("div",{className:"oc-select-status",children:"模型列表加载中…"}),_&&u.jsxs("div",{className:"oc-select-status is-error",children:[u.jsxs("span",{children:[_.code?`${_.code}:`:"",_.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Hm()},children:"重试"})]}),!M&&!_&&Z.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有匹配的可用模型"}),Z.map(Y=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:Y.provider}),Y.models.map(D=>{const ye=Ns(D.provider,D.id),se=ye===e.activeModelRef,V=U[p]===D;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":se,title:ye,disabled:e.disabled,className:`oc-select-option oc-model-option${V?" is-highlighted":""}${se?" is-active":""}`,onMouseEnter:()=>g(U.indexOf(D)),onClick:()=>{e.disabled||(J(),e.onSelectModel(D.provider,D.id))},children:[u.jsx("span",{className:"oc-model-option-name",children:D.name?.trim()||D.id}),se&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},ye)})]},Y.provider))]})]}):A.map((Y,D)=>{const ye=Y.value===q;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":ye,disabled:e.disabled,className:`oc-select-option oc-thinking-option${x===D?" is-highlighted":""}${ye?" is-active":""}`,onMouseEnter:()=>y(D),onClick:()=>K(D),children:[u.jsx("span",{className:"oc-thinking-option-label",children:Y.label}),Y.value==="auto"&&Y.effective?u.jsxs("span",{className:"oc-thinking-badge",children:["Pi 实际:",Y.effective]}):null,ye&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},Y.value)})]})})]})}const ym="--oc-shortcut-palette-available-height",lD=8,cD=8;function uD(e){const t=e.viewportTop??0,n=e.topInset??lD,a=e.anchorGap??cD;if([e.boundaryTop,e.anchorTop,t,n,a].some(c=>!Number.isFinite(c)))return null;const o=Math.max(e.boundaryTop,t);return Math.max(0,Math.floor(e.anchorTop-o-n-a))}function dD(e){const t=w.useMemo(()=>e.items.filter(y=>y.state==="queued"||y.state==="failed"),[e.items]),[n,a]=w.useState(!0),[s,o]=w.useState(null),[c,d]=w.useState(null),h=w.useId();if(w.useEffect(()=>{t.length===0&&!n&&a(!0),s!==null&&!t.some(y=>y.clientRequestId===s.id)&&o(null)},[n,s,t]),t.length===0)return null;const m=s!==null||c!==null,p=!n||m,g=t.length===1||p,x=(y,S,T)=>{d(y),S().then(()=>T?.()).catch(()=>{}).finally(()=>d(N=>N===y?null:N))};return u.jsx("div",{className:"oc-queue-dock","data-queue-dock":"",children:u.jsxs("div",{className:"oc-queue-panel",children:[t.length>1?u.jsxs("button",{type:"button",className:"oc-queue-header","aria-controls":h,"aria-expanded":p,disabled:m,onClick:()=>a(y=>!y),children:[u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(gb,{size:14})}),u.jsxs("span",{className:"oc-queue-count",children:[t.length," 条排队消息"]}),u.jsx("span",{className:"oc-queue-chevron","aria-hidden":"true",children:p?u.jsx(hd,{size:14}):u.jsx(Z3,{size:14})})]}):null,u.jsx("ul",{id:h,className:"oc-queue-list",hidden:!g,children:g?t.map(y=>{const S=y.clientRequestId,T={clientRequestId:S,revision:y.revision},N="textPreview"in y?y.textPreview:y.text,R=("text"in y?y.text:N)??"",M="imageCount"in y?y.imageCount:y.images?.length??0;return u.jsxs("li",{className:`oc-queue-row is-${y.state}`,children:[t.length===1?u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(gb,{size:14})}):null,s?.id===S?u.jsx("input",{autoFocus:!0,className:"oc-queue-editor","aria-label":"编辑排队消息",value:s.text,onChange:_=>o({id:S,text:_.currentTarget.value}),onKeyDown:_=>{_.key==="Escape"&&o(null),_.key==="Enter"&&!_.nativeEvent.isComposing&&(_.preventDefault(),x(S,()=>e.onEdit(T,s.text),()=>o(null)))}}):u.jsx("span",{className:"oc-queue-preview",title:R,children:N||(M>0?`${M} 张图片`:"待发送消息")}),u.jsx("div",{className:"oc-queue-actions",children:s?.id===S?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"保存排队消息",title:"保存排队消息",disabled:c!==null||s.text.trim()==="",onClick:()=>x(S,()=>e.onEdit(T,s.text),()=>o(null)),children:u.jsx(Bw,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"取消编辑",title:"取消编辑",disabled:c!==null,onClick:()=>o(null),children:u.jsx(Ts,{size:15})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"编辑排队消息",title:"编辑排队消息",disabled:c!==null||!("text"in y),onClick:()=>o({id:S,text:R}),children:u.jsx(D1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"删除排队消息",title:"删除排队消息",disabled:c!==null,onClick:()=>x(S,()=>e.onRemove(T)),children:u.jsx(O1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"插话发送",title:"插话发送",disabled:c!==null||e.turnPhase==="idle",onClick:()=>x(S,()=>e.onSteer(T)),children:u.jsx(Kw,{size:15})})]})})]},S)}):null})]})})}function fD(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),u.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),u.jsx("path",{d:"m21 16-5.5-5.5L9 17"})]})}function hD(e){const{composer:t,streaming:n,turnPhase:a,deferredTurn:s,deferredTurns:o=s?[s]:[],hasThread:c}=e,d=w.useRef(null),h=Ql(),m=h.reloading,p=h.reloadError,x=h.mutationBusy||m||a!=="idle",y=w.useCallback(()=>{t.setInput(""),t.setShortcutOpen(!1),Zu()},[t.setInput,t.setShortcutOpen]),S=w.useCallback(U=>{const $=t.isComposingNow()||U.nativeEvent.isComposing,q=t.recentlyComposedNow();if(U.key==="Enter"&&!U.shiftKey&&!$&&!q&&(!n||a!=="idle")){if(t.shortcutOpen&&t.filteredShortcuts.length>0){if((t.filteredShortcuts[t.shortcutIndex]??t.filteredShortcuts[0])?.command==="/reload"){U.preventDefault(),y();return}}else if(t.input.trim()==="/reload"){U.preventDefault(),y();return}}e.onKeyDown(U)},[t.isComposingNow,t.recentlyComposedNow,t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,t.input,y,n,a,e.onKeyDown]),T=w.useCallback((U,$)=>{if($==="pi-prompt"||U==="/name"||U==="/compact"){t.setInput(`${U} `),t.setShortcutOpen(!1),t.textareaRef.current?.focus();return}if(U==="/reload"){y();return}e.onRunShortcut(U)},[y,e.onRunShortcut,t]),N=w.useCallback(()=>{if(t.input.trim()==="/reload"){y();return}e.onSend(t.input)},[t.input,y,e.onSend]);w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0||!e.paletteKeyboardNavRef.current)return;const U=e.shortcutPaletteRef.current;if(!U)return;U.querySelector(`[data-shortcut-index="${t.shortcutIndex}"]`)?.scrollIntoView({block:"nearest",inline:"nearest"}),e.paletteKeyboardNavRef.current=!1},[t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,e.shortcutPaletteRef,e.paletteKeyboardNavRef]),w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0)return;const U=d.current,$=e.shortcutPaletteRef.current,q=U?.closest(".oc-main")??null;if(!U||!$||!q)return;let W=0;const oe=()=>{W=0;const I=q.getBoundingClientRect(),K=U.getBoundingClientRect(),X=uD({boundaryTop:I.top,anchorTop:K.top,viewportTop:window.visualViewport?.offsetTop??0});if(X===null){$.style.removeProperty(ym);return}$.style.setProperty(ym,`${X}px`)},J=()=>{W!==0&&window.cancelAnimationFrame(W),W=window.requestAnimationFrame(oe)};oe();const H=typeof ResizeObserver>"u"?null:new ResizeObserver(J);return H?.observe(q),H?.observe(U),window.addEventListener("resize",J),window.visualViewport?.addEventListener("resize",J),window.visualViewport?.addEventListener("scroll",J),()=>{W!==0&&window.cancelAnimationFrame(W),H?.disconnect(),window.removeEventListener("resize",J),window.visualViewport?.removeEventListener("resize",J),window.visualViewport?.removeEventListener("scroll",J),$.style.removeProperty(ym)}},[t.shortcutOpen,t.filteredShortcuts.length,e.layoutMode,e.shortcutPaletteRef]);const R=(()=>{const U=e.processSummary;return U?U.statusKind==="error"?`查看工具调用记录,共 ${U.count} 次,其中 ${U.statusLabel}`:U.statusKind==="running"?`查看工具调用记录,共 ${U.count} 次,${U.statusLabel||"正在运行"}`:`查看工具调用记录,共 ${U.count} 次,全部已完成`:"查看工具调用记录"})(),M=(()=>{const U=e.sessionStats,$=[];if(U.steps>0){$.push(`${U.turns} 轮 · ${U.steps} 步`);const oe=[];U.llmMs>0&&oe.push(`LLM ${vm(U.llmMs)}`),U.toolMs>0&&oe.push(`工具调用 ${vm(U.toolMs)}`),oe.length>0&&$.push(oe.join(" · "));const J=[];if(U.ttftSteps>0&&J.push(`首 token 平均 ${vm(U.ttftMs/U.ttftSteps)}`),U.decodeMs>0){const H=U.decodeTokens/(U.decodeMs/1e3),I=H>=10?String(Math.round(H)):String(Math.round(H*10)/10);J.push(`${I} tok/s`)}J.length>0&&$.push(J.join(" · "))}const q=G7(e.usage),W=e.usage.outputTokens;if(q>0||W>0){const oe=JO(e.usage);oe!==null&&$.push(`缓存命中 ${oe}%`),$.push(`输入 ${c3(q)} tok · 输出 ${c3(W)} tok`)}return $})(),_=M.join(" | "),P=e.usage.contextUsage,F=P?.percent??null,A=P?`上下文 ${F===null?"—":`${Math.round(F*10)/10}%`} / ${P.contextWindow>0?$7(P.contextWindow):"—"}`:"上下文 —",L=u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"oc-attach-button oc-attach-icon",title:"添加图片","aria-label":"添加图片",children:[u.jsx(fD,{}),u.jsx("span",{className:"sr-only",children:"添加图片"}),u.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:U=>{t.addImagesFromFiles(Array.from(U.target.files??[]).slice(0,4)),U.target.value=""}})]}),u.jsx("span",{className:"oc-composer-actions-spacer"}),u.jsx("div",{className:"oc-composer-model-controls",children:u.jsx(oD,{models:e.models,activeModelRef:e.activeModelRef,activeModelListed:e.activeModelListed,activeThinkingLevel:e.activeThinkingLevel||"auto",thinkingLevels:e.thinkingLevels,disabled:x,onSelectModel:(U,$)=>e.onSwitchRuntime({provider:U,modelId:$}),onSelectThinking:U=>e.onSwitchRuntime({thinkingLevel:U})})}),u.jsxs("button",{type:"button",className:"btn btn-ghost oc-composer-compact",onClick:e.onCompact,disabled:a!=="idle"||!c||e.compacting,title:e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文","aria-label":e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文",children:[e.compacting?u.jsx("span",{className:"oc-spinner oc-spinner-inline","aria-hidden":"true"}):u.jsx(Ww,{size:16,"aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:e.compacting?"正在压缩上下文":"压缩上下文"})]}),e.runtimeContext?u.jsxs("button",{type:"button",ref:e.runtimeContextTriggerRef,className:`oc-runtime-context-toggle${e.runtimeContextOpen?" is-active":""}`,style:{"--oc-context-percent":`${Math.max(0,Math.min(100,F??0))}%`},"aria-expanded":e.runtimeContextOpen,"aria-controls":"oc-runtime-context-panel",title:A,"aria-label":e.runtimeContextOpen?"关闭注入上下文(当前运行时上下文与活跃工具)":"展开注入上下文(当前运行时上下文与活跃工具)",onClick:e.onToggleRuntimeContext,children:[u.jsx("span",{className:"oc-context-ring","aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:A})]}):null]}),Z=u.jsxs("div",{className:"oc-telemetry",title:_||void 0,children:[a!=="idle"?u.jsx("span",{className:"oc-usage-state",children:a==="stopping"?"正在停止":"运行中"}):null,e.unread>0?u.jsxs("span",{children:[e.unread," 未读"]}):null,M.length>0?u.jsx("span",{className:"oc-telemetry-stats",children:M.map((U,$)=>u.jsx("span",{className:"oc-telemetry-group",children:U},`${$}:${U}`))}):null,e.processSummary?u.jsxs("button",{type:"button",ref:e.processTriggerRef,className:`oc-process-summary is-${e.processSummary.statusKind}${e.processOpen?" is-open":""}`,"aria-expanded":e.processOpen,"aria-controls":"oc-process-panel","aria-label":R,title:R,onClick:e.onToggleProcess,children:["调用记录 ",e.processSummary.count]}):null]});return u.jsx("div",{className:"oc-composer",children:u.jsxs("div",{className:"oc-composer-inner",ref:d,children:[t.fileOptions.length>0&&u.jsx("div",{className:"oc-file-palette",role:"listbox","aria-label":"Repository files",children:t.fileOptions.map(U=>u.jsx("button",{type:"button",role:"option",className:U.endsWith("/")?"is-dir":void 0,onMouseDown:$=>$.preventDefault(),onClick:()=>t.insertFileReference(U),children:u.jsxs("code",{children:["@",U]})},U))}),t.pendingImages.length>0&&u.jsx("div",{className:"oc-attachment-list",children:t.pendingImages.map(U=>u.jsxs("span",{children:[U.name,u.jsx("button",{type:"button","aria-label":`移除 ${U.name}`,onClick:()=>t.removeImage(U),children:"×"})]},U.name))}),t.shortcutOpen&&t.filteredShortcuts.length>0&&u.jsxs("div",{className:"oc-shortcut-palette",id:"oc-shortcut-palette",ref:e.shortcutPaletteRef,role:"listbox","aria-label":"命令","aria-busy":t.dynamicCommandsLoading||void 0,"data-layout-mode":e.layoutMode,children:[u.jsxs("div",{className:"oc-shortcut-palette-head",children:[u.jsxs("strong",{children:["命令 · ",t.filteredShortcuts.length]}),t.dynamicCommandsLoading?u.jsx("span",{className:"oc-shortcut-palette-meta",children:"正在加载扩展、提示词与技能…"}):null,t.dynamicCommandsError?u.jsxs("span",{className:"oc-shortcut-palette-meta is-error",children:[t.dynamicCommandsError,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t.retryDynamicCommands(),children:"重试"})]}):null]}),u.jsx("div",{className:"oc-shortcut-palette-body",children:e.paletteModel.map(U=>u.jsxs("div",{className:"oc-shortcut-group",children:[u.jsxs("small",{children:[U.label," · ",U.items.length]}),U.items.map(({entry:$,globalIndex:q})=>u.jsxs("button",{type:"button",role:"option",id:`oc-shortcut-option-${q}`,"aria-label":$.command,"aria-describedby":`oc-shortcut-option-desc-${q}`,"aria-selected":q===t.shortcutIndex,className:q===t.shortcutIndex?"is-active":"","data-shortcut-index":q,title:$.command,onMouseEnter:()=>t.setShortcutIndex(q),onMouseDown:W=>W.preventDefault(),onClick:W=>{W.currentTarget.scrollIntoView({block:"nearest"}),T($.command,$.action)},children:[u.jsx("code",{children:$.command}),u.jsx("small",{id:`oc-shortcut-option-desc-${q}`,children:$.description})]},`${$.source}:${$.command}`))]},U.source))})," "]}),u.jsx(dD,{items:o,turnPhase:a,onEdit:e.onEditDeferred,onRemove:U=>e.onDiscardDeferred(U),onSteer:e.onSteerDeferred}),u.jsxs("div",{className:`oc-composer-shell${a!=="idle"?" is-busy":""}`,children:[u.jsx("textarea",{ref:t.textareaRef,className:"oc-textarea",value:t.input,rows:2,placeholder:a==="stopping"?"上一轮正在停止…输入后可排队自动发送":n?"正在执行…继续输入以排队,当前回合结束后自动发送":c?"输入消息… Enter 发送 · Shift+Enter 换行 · ↑ 召回历史输入":"描述目标,或点选上方建议开始…",onChange:U=>t.handleInputChange(U.target.value),onKeyDown:S,onCompositionStart:t.onCompositionStart,onCompositionEnd:t.onCompositionEnd,"aria-expanded":t.shortcutOpen,"aria-controls":t.shortcutOpen?"oc-shortcut-palette":void 0,"aria-activedescendant":t.shortcutOpen&&t.filteredShortcuts.length>0?`oc-shortcut-option-${t.shortcutIndex}`:void 0}),u.jsxs("div",{className:"oc-composer-actions",children:[L,a==="running"?u.jsxs(u.Fragment,{children:[(t.input.trim()!==""||t.pendingImages.length>0)&&u.jsx("button",{type:"button",className:"oc-send is-queue",title:"排队发送:当前回合结束后自动发送","aria-label":"排队发送:当前回合结束后自动发送",onClick:N,disabled:m,children:u.jsx(yb,{})}),u.jsxs("button",{type:"button",className:"oc-stop",title:s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止","aria-label":s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止",onClick:e.onStop,children:[u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}),u.jsx(Tk,{})]})]}):u.jsx("button",{type:"button",className:"oc-send",title:a==="stopping"?"停止后发送":"发送","aria-label":a==="stopping"?"停止后发送":"发送",onClick:N,disabled:!t.input.trim()&&t.pendingImages.length===0||m,children:u.jsx(yb,{})})]})]}),p&&u.jsxs("div",{className:"oc-reload-banner is-error",role:"alert",children:[u.jsxs("span",{children:[p.code?`${p.code}:`:"",p.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Zu()},children:"重试"})]}),m?u.jsx("div",{className:"oc-reload-status",children:"正在重新加载会话…"}):null,Z]})})}function mD(e){return e.nativeEvent.isComposing||e.nativeEvent.keyCode===229}function pD(e){const t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,""),recommended:!0}:{label:e,recommended:!1}}function xm(e){const t={left:"9 2.5 5.5 6 9 9.5",right:"3 2.5 6.5 6 3 9.5",up:"2.5 8 6 4.5 9.5 8",down:"2.5 4 6 7.5 9.5 4"}[e.direction];return u.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("polyline",{points:t})})}function gD(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m4 4 8 8m0-8-8 8"})})}function f3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m3.25 8.25 3.1 3.1 6.4-6.7"})})}function bD(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"m3.2 11.9-.7 2.6 2.6-.7L12.8 6a1.7 1.7 0 0 0-2.4-2.4L3.2 11.9Z"}),u.jsx("path",{d:"m9.5 4.5 2 2"})]})}function vD(e){return u.jsxs("div",{className:"oc-question-answer-field",children:[u.jsx("div",{className:"oc-question-field-mirror","aria-hidden":"true",children:`${e.value}
396
+ `}),u.jsx("textarea",{className:"oc-question-field-input",rows:1,value:e.value,disabled:e.disabled,autoFocus:e.autoFocus,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e.onChange,onKeyDown:e.onKeyDown})]})}function yD(e){const t=e.pending.questions,[n,a]=w.useState(0),[s,o]=w.useState(()=>t.map(()=>({selected:[],custom:"",skipped:!1}))),[c,d]=w.useState(null),[h,m]=w.useState(null),[p,g]=w.useState(!1),x=w.useRef(new Set),y=t[n],S=s[n],T=!!y.options?.length,N=U=>{o($=>$.map((q,W)=>W===n?U(q):q)),m(null)},R=U=>U.selected.length>0||U.custom.trim().length>0,M=U=>R(U)||U.skipped,_=async(U,$)=>{const q=e.workspaceId?`?workspaceId=${encodeURIComponent(e.workspaceId)}`:"",W=await fetch(`${e.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(e.pending.sessionId)}/questions/${encodeURIComponent(e.pending.requestId)}/${U}${q}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify($)}),oe=await W.json().catch(()=>({}));if(!W.ok){if(W.status===404||W.status===409){e.onSettled();return}throw new Error(oe.error?.message??`请求失败 (${W.status})`)}e.onSettled()},P=U=>{const $=U.findIndex(W=>!M(W));if($>=0){a($),m("请回答或跳过这个问题");return}const q={answers:t.map((W,oe)=>{const J=U[oe];if(J.skipped)return{id:W.id,selected:[]};const H=J.custom.trim();return{id:W.id,selected:H&&W.multiSelect!==!0?[]:J.selected,...H?{custom:H}:{}}})};d("answer"),m(null),_("answer",q).catch(W=>{d(null),m(W instanceof Error?W.message:String(W))})},F=()=>{if(!R(S)){m("请选择一个选项或填写回答");return}if(n<t.length-1){a(U=>U+1),m(null);return}P(s)},A=U=>{N($=>y.multiSelect?{...$,selected:$.selected.includes(U)?$.selected.filter(q=>q!==U):[...$.selected,U],skipped:!1}:{selected:[U],custom:"",skipped:!1}),!y.multiSelect&&n<t.length-1&&a($=>$+1)},L=U=>{const $=U.target.value;N(q=>({...q,selected:y.multiSelect?q.selected:[],custom:$,skipped:!1}))},Z=()=>{const U=s.map(($,q)=>q===n?{selected:[],custom:"",skipped:!0}:$);o(U),m(null),n<t.length-1?a($=>$+1):P(U)};return u.jsx("div",{className:"oc-question-composer","data-question-request":e.pending.requestId,children:u.jsxs("section",{className:`oc-question-card${p?" is-minimized":""}`,"aria-labelledby":`oc-question-${e.pending.requestId}-${n}`,children:[u.jsxs("header",{className:"oc-question-header",children:[u.jsxs("div",{className:"oc-question-heading",children:[y.header?u.jsx("div",{className:"oc-question-eyebrow",children:y.header}):null,u.jsx("h2",{id:`oc-question-${e.pending.requestId}-${n}`,children:y.question})]}),u.jsxs("div",{className:"oc-question-header-actions",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":p?"展开问题":"收起问题",title:p?"展开问题":"收起问题","aria-expanded":!p,disabled:c!==null,onClick:()=>g(U=>!U),children:u.jsx(xm,{direction:p?"up":"down"})}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"取消回答",title:"取消回答",disabled:c!==null,onClick:()=>{d("cancel"),m(null),_("cancel",{reason:"USER_CANCELLED"}).catch(U=>{d(null),m(U instanceof Error?U.message:String(U))})},children:u.jsx(gD,{})})]})]}),p?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-question-body",children:[y.detail!==void 0?u.jsx("div",{className:"oc-question-detail",children:u.jsx(ic,{text:y.detail})}):null,u.jsxs("div",{className:"oc-question-options",role:y.multiSelect?"group":"radiogroup",children:[(y.options??[]).map((U,$)=>{const q=S.selected.includes(U.label),W=pD(U.label);return u.jsxs("button",{type:"button",className:`oc-question-option${q&&!y.multiSelect?" is-selected":""}`,role:y.multiSelect?"checkbox":"radio","aria-checked":q,disabled:c!==null,onClick:()=>A(U.label),children:[y.multiSelect?u.jsx("span",{className:`oc-question-checkbox${q?" is-checked":""}`,"aria-hidden":"true",children:q?u.jsx(f3,{}):null}):u.jsx("span",{className:"oc-question-number",children:$+1}),u.jsx("span",{className:"oc-question-option-copy",children:u.jsxs("span",{className:"oc-question-option-main",children:[u.jsx("span",{className:"oc-question-option-label",children:W.label}),W.recommended?u.jsx("span",{className:"oc-question-badge",children:"推荐"}):null,U.description?u.jsx("span",{className:"oc-question-description",children:U.description}):null]})})]},`${U.label}-${$}`)}),u.jsxs("div",{className:`oc-question-custom${S.custom?" is-active":""}`,children:[T?y.multiSelect===!0?u.jsx("span",{className:`oc-question-checkbox${S.custom?" is-checked":""}`,"aria-hidden":"true",children:S.custom?u.jsx(f3,{}):null}):u.jsx("span",{className:"oc-question-number",children:u.jsx(bD,{})}):null,u.jsx(vD,{value:S.custom,disabled:c!==null,placeholder:"输入自定义回答…",autoFocus:!T&&!x.current.has(n),onFocus:()=>x.current.add(n),onChange:L,onKeyDown:U=>{U.key!=="Enter"||U.shiftKey||mD(U)||(U.preventDefault(),F())}})]})]})]}),u.jsxs("footer",{className:"oc-question-footer",children:[u.jsxs("div",{className:"oc-question-pager",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"上一题",title:"上一题",disabled:n===0||c!==null,onClick:()=>{a(n-1),m(null)},children:u.jsx(xm,{direction:"left"})}),u.jsxs("span",{children:[n+1," / ",t.length]}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"下一题",title:"下一题",disabled:n===t.length-1||c!==null,onClick:()=>{a(n+1),m(null)},children:u.jsx(xm,{direction:"right"})})]}),u.jsx("div",{className:"oc-question-feedback",role:"status",children:h}),u.jsxs("div",{className:"oc-question-actions",children:[u.jsx("button",{type:"button",className:"oc-question-button is-secondary",disabled:c!==null,onClick:Z,children:"跳过"}),u.jsx("button",{type:"button",className:"oc-question-button is-primary",disabled:c!==null||!R(S),onClick:F,children:c==="answer"?"提交中…":n===t.length-1?"提交":"下一题"})]})]})]})]})})}function xD({status:e}){return e==="completed"?u.jsx(qw,{size:15,"aria-hidden":"true"}):e==="in_progress"?u.jsx(Pw,{size:15,"aria-hidden":"true",className:"oc-todo-spin"}):u.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:u.jsx("circle",{cx:"7.5",cy:"7.5",r:"6.4",stroke:"currentColor",strokeWidth:"1.2",strokeDasharray:"2.4 2.4"})})}function wD({todos:e}){const[t,n]=w.useState(!0);if(e.length===0)return null;const a=e.filter(d=>d.status==="completed").length,s=e.filter(d=>d.status==="in_progress").length,o=e.length-a-s,c=[a?`${a} 已完成`:"",s?`${s} 进行中`:"",o?`${o} 待处理`:""].filter(Boolean).join(" · ");return u.jsxs("section",{className:"oc-todo-panel","aria-label":"任务",children:[u.jsxs("button",{type:"button",className:"oc-todo-head","aria-expanded":!t,onClick:()=>n(d=>!d),children:[u.jsx("span",{className:"oc-todo-leading",children:u.jsx(X3,{size:15,"aria-hidden":"true"})}),u.jsx("strong",{children:"任务"}),u.jsx("span",{className:"oc-todo-summary",children:c}),u.jsx("span",{className:"oc-todo-chevron","aria-hidden":"true",children:t?u.jsx(Z3,{size:16}):u.jsx(hd,{size:16})})]}),t?null:u.jsx("ul",{className:"oc-todo-list",children:e.map(d=>u.jsxs("li",{className:`oc-todo-item is-${d.status}`,children:[u.jsx("span",{className:"oc-todo-status","aria-hidden":"true",children:u.jsx(xD,{status:d.status})}),u.jsx("span",{children:d.content})]},d.content))})]})}function kD(e){const{toolCalls:t,onClose:n,overlay:a=!1,embedded:s=!1}=e,o=w.useRef(null);return Xl({open:a&&!s,containerRef:o,triggerRef:e.triggerRef,onEscape:n}),u.jsxs("aside",{ref:o,id:"oc-process-panel",className:`oc-process${a?" is-process-overlay":""}${s?" is-details-tab":""}`,"aria-label":"工具调用记录",role:a&&!s?"dialog":"region","aria-modal":a&&!s?!0:void 0,tabIndex:-1,children:[s?null:u.jsxs("header",{className:"oc-process-head",children:[u.jsxs("div",{className:"oc-process-title",children:[u.jsx("span",{className:"oc-process-title-mark","aria-hidden":"true"}),"工具调用记录",u.jsxs("span",{className:"oc-process-count",children:[t.length," 次"]})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-process-close","aria-label":"关闭工具调用记录",onClick:n,children:"关闭"})]}),u.jsx("div",{className:"oc-process-timeline",children:t.length===0?u.jsx("div",{className:"oc-process-empty",children:"本轮对话尚无工具调用。诊断细节会在这里按时间线展示。"}):t.map((c,d)=>u.jsxs("div",{className:`oc-process-item${d===0?" is-first":""}${d===t.length-1?" is-last":""}${c.status==="error"?" is-error":""}${c.status==="running"?" is-running":""}`,children:[u.jsx("div",{className:"oc-process-rail","aria-hidden":"true",children:u.jsx("span",{className:"oc-process-dot"})}),u.jsx("div",{className:"oc-process-time",children:Ul(c.createdAt)}),u.jsx("div",{className:"oc-process-body",children:u.jsx(P7,{entry:c})})]},c.id))})]})}const h3=[{id:"overview",label:"概览"},{id:"system",label:"System prompt"},{id:"files",label:"Context files"},{id:"skills",label:"Skills"},{id:"extensions",label:"Extensions"},{id:"packages",label:"Plugins"},{id:"tools",label:"Active tools"},{id:"raw",label:"原始 JSON"}];function Ou(e){const t=Array.isArray(e.items)?e.items:void 0;return u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:e.title}),u.jsx("span",{className:"oc-runtime-context-meta",children:t?`${t.length} 项`:"未投影"})]}),t===void 0?u.jsx("p",{className:"oc-runtime-context-empty",children:"该 session 未提供资源投影"}):t.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:e.emptyText}):u.jsx("ul",{className:"oc-runtime-context-resources",children:t.map((n,a)=>u.jsx(SD,{item:n},`${n.name??n.path??a}:${a}`))})]})}function SD(e){const t=e.item,a=[t.scope?`scope ${t.scope}`:"",t.source??"",t.version?`v${t.version}`:"",t.cwd?`cwd ${t.cwd}`:""].filter(Boolean).join(" · "),s=t.path?`${t.path}${t.baseDir?`(base: ${t.baseDir})`:""}`:"";return u.jsxs("li",{children:[u.jsxs("div",{className:"oc-runtime-context-resource-head",children:[u.jsx("strong",{className:"oc-runtime-context-resource-name",title:t.path??t.name,children:t.name||t.path||"未命名资源"}),t.enabled===!1?u.jsx("span",{className:"oc-runtime-context-resource-flag",children:"未启用"}):null,a?u.jsx("span",{className:"oc-runtime-context-meta",title:a,children:a}):null]}),t.description?u.jsx("span",{className:"oc-runtime-context-resource-desc",children:t.description}):null,t.path?u.jsx("code",{className:"oc-runtime-context-resource-path",title:s,children:s}):null,t.error?u.jsxs("span",{className:"oc-runtime-context-diag is-error",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"✕"}),t.error]}):null,Array.isArray(t.diagnostics)&&t.diagnostics.length>0?u.jsxs("span",{className:"oc-runtime-context-diag",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"⚠"}),t.diagnostics.join(";")]}):null,Array.isArray(t.resolved)&&t.resolved.length>0?u.jsxs("details",{className:"oc-runtime-context-resolved",children:[u.jsxs("summary",{children:["已解析 ",t.resolved.length," 项"]}),u.jsx("ul",{className:"oc-runtime-context-resolved-list",children:t.resolved.map((o,c)=>{const d=`${o.type??"?"}:${o.name??o.path??"?"}`;return u.jsx("li",{children:u.jsx("code",{title:d,children:d})},c)})})]}):null]})}const ED=w.forwardRef(function({open:t,onToggle:n,onClose:a,context:s,panelOnly:o=!1,embedded:c=!1,triggerOnly:d=!1,triggerRef:h},m){const p=Ql(),g=p.reloading,x=p.reloadError,[y,S]=w.useState("overview"),T=w.useRef(null);Xl({open:t&&!d&&!c,containerRef:T,triggerRef:h,onEscape:a}),w.useEffect(()=>{t||S("overview")},[t]);const N=Array.isArray(s.resources.activeTools)?s.resources.activeTools:[],R=typeof s.resources.activeToolCount=="number"?s.resources.activeToolCount:N.length,M=s.systemPrompt.text??s.systemPrompt.summary??"",_=s.systemPrompt.charCount??M.length,P=s.suffix.present?s.suffix.text??s.suffix.summary??"":"",F=s.model?Ns(s.model.provider,s.model.modelId):"",A=s.resources,L=String(s.resources.mode??"closed"),Z=L.includes("open")?"open":"closed",U={files:A.contextFiles?.length??0,skills:A.skills?.length??0,extensions:A.extensions?.length??0,packages:A.packages?.length??0},$=["files","skills","extensions","packages"].map(oe=>({id:oe,label:h3.find(J=>J.id===oe)?.label??oe,count:U[oe]??0})),q=u.jsx("button",{type:"button",ref:oe=>{typeof m=="function"?m(oe):m&&(m.current=oe)},className:`btn btn-ghost oc-runtime-context-toggle${t?" is-active":""}`,"aria-expanded":t,"aria-controls":"oc-runtime-context-panel",onClick:n,children:"注入上下文"});if(d)return q;const W=t?u.jsxs("div",{ref:T,id:"oc-runtime-context-panel",className:`oc-runtime-context-sidepanel${c?" is-details-tab":""}`,role:c?"region":"dialog","aria-modal":c?void 0:!0,"aria-label":"注入上下文",tabIndex:-1,children:[c?null:u.jsxs("header",{className:"oc-runtime-context-head",children:[u.jsxs("div",{className:"oc-runtime-context-head-copy",children:[u.jsx("strong",{children:"注入上下文"}),u.jsx("span",{className:"oc-runtime-context-meta",children:"只读 · 本轮实际注入的 system prompt / 资源(已脱敏)"})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-runtime-context-close","aria-label":"关闭注入上下文",onClick:a,children:"关闭"})]}),u.jsxs("div",{className:"oc-runtime-context-layout",children:[u.jsx("nav",{className:"oc-runtime-context-nav","aria-label":"上下文分类",children:h3.map(oe=>{const J=U[oe.id];return u.jsxs("button",{type:"button",className:`oc-runtime-context-nav-item${y===oe.id?" is-active":""}`,"aria-current":y===oe.id?"page":void 0,onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-nav-label",title:oe.label,children:oe.label}),typeof J=="number"?u.jsx("span",{className:"oc-runtime-context-nav-count",children:J}):null]},oe.id)})}),u.jsxs("div",{className:"oc-runtime-context-body",children:[y==="overview"?u.jsxs("div",{className:"oc-runtime-context-overview",children:[s.model?u.jsxs("section",{className:"oc-runtime-context-model-card",children:[u.jsx("span",{className:"oc-runtime-context-model-label",children:"模型"}),u.jsx("code",{className:"oc-runtime-context-model-ref",title:F,children:F})]}):null,u.jsxs("div",{className:"oc-runtime-context-stat-grid",children:[u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"Prompt 字数"}),u.jsxs("strong",{className:"oc-runtime-context-stat-value",children:[_.toLocaleString()," 字"]})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"工具"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:R})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"思考"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:s.thinkingLevel??"—"})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"资源面"}),u.jsxs("strong",{className:`oc-runtime-context-stat-value oc-runtime-context-mode is-${Z}`,title:L,children:[u.jsx("span",{className:"oc-runtime-context-mode-dot","aria-hidden":"true"}),L]})]})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsx("header",{className:"oc-runtime-context-section-head",children:u.jsx("strong",{children:"已加载资源"})}),u.jsx("div",{className:"oc-runtime-context-resource-links",children:$.map(oe=>u.jsxs("button",{type:"button",className:"oc-runtime-context-resource-link",onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-resource-label",children:oe.label}),u.jsx("span",{className:`oc-runtime-context-resource-count${oe.count===0?" is-zero":""}`,children:oe.count}),u.jsx("span",{className:"oc-runtime-context-resource-chevron","aria-hidden":"true",children:"›"})]},oe.id))})]})]}):null,y==="system"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"System prompt"}),u.jsxs("code",{className:"oc-runtime-context-hash",children:[s.systemPrompt.hash.slice(0,12),"…"]})]}),M?u.jsx(w1,{text:M}):null]}),u.jsx("pre",{className:"oc-runtime-context-text",children:M||"(空)"})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{className:"oc-runtime-context-section-title",children:[u.jsx("strong",{children:"Session suffix"}),u.jsx("span",{className:"oc-runtime-context-meta",children:s.suffix.present?`${(s.suffix.charCount??0).toLocaleString()} 字`:"未注入"})]}),P?u.jsx(w1,{text:P}):null]}),s.suffix.present?u.jsx("pre",{className:"oc-runtime-context-text",children:P||"已注入"}):u.jsx("p",{className:"oc-runtime-context-empty",children:"本会话无额外 suffix"})]})]}):null,y==="files"?u.jsx(Ou,{title:"Context files",items:A.contextFiles?.map(oe=>({name:oe.path,description:`${oe.characters.toLocaleString()} 字符`})),emptyText:"该 session 未加载任何上下文文件"}):null,y==="skills"?u.jsx(Ou,{title:"Skills",items:A.skills,emptyText:"该 session 未加载任何 Skills"}):null,y==="extensions"?u.jsx(Ou,{title:"Extensions",items:A.extensions,emptyText:"该 session 未加载任何 Extensions"}):null,y==="packages"?u.jsx(Ou,{title:"Plugins",items:A.packages,emptyText:"该会话没有插件"}):null,y==="tools"?u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:"Active tools"}),u.jsxs("span",{className:"oc-runtime-context-meta",children:[R," 项"]})]}),N.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:"无激活工具"}):u.jsx("ul",{className:"oc-runtime-context-tools",children:N.map(oe=>u.jsx("li",{children:u.jsx("code",{children:oe})},oe))}),Array.isArray(A.diagnostics)&&A.diagnostics.length>0?u.jsx("ul",{className:"oc-runtime-context-resources",children:A.diagnostics.map((oe,J)=>u.jsxs("li",{children:[u.jsxs("span",{className:`oc-runtime-context-diag is-${oe.type??"warning"}`,children:[oe.type,": ",oe.message]}),oe.path?u.jsx("code",{children:oe.path}):null]},J))}):null]}):null,y==="raw"?u.jsxs("details",{className:"oc-runtime-context-raw",open:!0,children:[u.jsx("summary",{children:"原始投影 JSON"}),u.jsx("pre",{children:JSON.stringify(s,null,2)})]}):null]},y)]}),u.jsxs("footer",{className:"oc-runtime-context-foot",children:[u.jsx("span",{className:"oc-runtime-context-meta",children:g?"正在重新加载会话…":"重新加载 Pi 会话设置、扩展、技能、提示词与上下文文件"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:g,onClick:()=>{Zu()},children:"重新加载会话"}),x&&u.jsxs("span",{className:"oc-runtime-context-diag is-error",role:"alert",children:[x.code?`${x.code}:`:"",x.message,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Zu()},children:"重试"})]})]})]}):null;return o?W:u.jsxs("div",{className:"oc-runtime-context-menu",children:[q,W]})});function TD(){const e=w.useRef(null),t=w.useRef(!1),n=w.useRef(null),a=w.useRef(new Map),s=w.useRef(new Set),o=w.useRef(null),c=w.useRef(null),d=w.useRef(0),h=w.useRef(null),m=w.useRef(new Set),p=w.useRef(new Set),g=w.useRef(new Map),x=w.useRef(new Set),y=w.useRef(null),S=w.useRef(null),T=w.useRef(!1),N=w.useRef(0),R=w.useRef(null),M=w.useRef(!1),_=w.useRef(!1),P=w.useRef(null),F=w.useRef(new Set),A=w.useRef(new Set),L=w.useRef(new Set),Z=w.useRef(new Map),U=w.useRef(!1),$=w.useRef(0);return w.useMemo(()=>({sessionRef:e,streamingRef:t,abortRef:n,sessionAbortControllersRef:a,inlineStreamSessionIdsRef:s,assistantIdRef:o,lastEventIdRef:c,sessionGenerationRef:d,eventsStreamStateRef:h,settledTurnIdsRef:m,seenEventIdsRef:p,turnAssistantIdsRef:g,sealedAssistantIdsRef:x,reconnectAbortRef:y,activeTurnIdRef:S,submitInFlightRef:T,submitGenerationRef:N,pendingSubmissionRef:R,stopInFlightRef:M,stopRequestedRef:_,stoppingTurnIdRef:P,abortPostedTurnIdsRef:F,releasedClientRequestIdsRef:A,usageResponseKeysRef:L,unlinkedOperationIdsRef:Z,isComposingRef:U,compositionEndedAtRef:$}),[e,t,n,a,s,o,c,d,h,m,p,g,x,y,S,T,N,R,M,_,P,F,A,L,Z,U,$])}function CD(e){if(!(!e||typeof e!="object"))return e}function Ui(e){return typeof e=="string"?e:void 0}function S1(e){if(!Array.isArray(e))return;const t=[];for(const n of e){const a=CD(n);if(!a)continue;const s=Ui(a.type)??"";if(s==="thinking"||s==="reasoning"){const o=Ui(a.thinking)??Ui(a.text)??"";t.push({type:"thinking",thinking:o});continue}if(s==="toolCall"||s==="tool_call"||s==="toolUse"||s==="tool_use"){const o=Ui(a.toolCallId)??Ui(a.id)??"";if(!o)continue;const c=Ui(a.toolName)??Ui(a.name);t.push({type:"toolCall",toolCallId:o,...c?{toolName:c}:{}});continue}if(s==="text"||s==="output_text"||s===""){const o=Ui(a.text);o!==void 0&&t.push({type:"text",text:o})}}return t}function ND(e,t={}){return e.type==="thinking"&&!t.isStreaming&&e.thinking.trim()===""}function E1(e,t={}){return e.filter(n=>!ND(n,t))}function RD(e){return e.type==="text"}function AD(e,t={}){const n=E1(e,t);let a=-1;for(let s=n.length-1;s>=0;s--)if(!RD(n[s])){a=s;break}return a===-1?{answerBlocks:n,processBlocks:[]}:{answerBlocks:n.slice(a+1),processBlocks:n.slice(0,a+1)}}function ID(e){return e.filter(t=>t.type==="text").map(t=>t.text).join("")}function _D(e){return{key:e,assistants:[],tools:[],processItems:[],live:!1}}function T1(e){const t=[],n=[];let a,s=[];const o=c=>{for(const d of s)d.assistantMessageId||(d.assistantMessageId=c),d.turnId||(d.turnId=a);s=[]};for(const c of e){const d=Date.parse(c.at)||Date.now();if(c.role==="user"){a=`restored-${c.id}`,s=[],t.push({id:c.id,role:"user",text:c.text,createdAt:d});continue}if(c.role==="assistant"){a||(a=`restored-${c.id}`);const h=S1(c.content);t.push({id:c.id,role:"assistant",text:c.text,createdAt:d,...c.kind==="provider-error"&&c.providerError?{kind:c.kind,providerError:c.providerError}:{},...h&&h.length>0?{content:h}:{}}),o(c.id);continue}if(c.role==="tool"){a||(a=`restored-tool-${c.id}`);const h={id:c.toolCallId||c.id,toolName:c.toolName||"tool",status:c.isError===!0?"error":"ok",resultText:c.text,result:c.text,createdAt:d,finishedAt:d,turnId:a,...c.operationId?{operationId:c.operationId}:{}};n.push(h),s.push(h)}}return{messages:t,toolCalls:n}}function MD(e){return[...e].sort((t,n)=>t.eventSeq!==void 0&&n.eventSeq!==void 0&&t.eventSeq!==n.eventSeq?t.eventSeq-n.eventSeq:t.createdAt!==n.createdAt?t.createdAt-n.createdAt:t.id<n.id?-1:1)}function jl(e,t){if(t.length===0)return;const n=MD(t);for(const a of n){const s=fO(a);s?e.push({kind:"activity",activity:s}):e.push({kind:"tool",tool:a})}}function wm(e,t,n,a){let s=[];for(const o of e){if(o.type==="thinking"){jl(n,s),s=[],n.push({kind:"thinking",thinking:o.thinking});continue}if(o.type==="text"){jl(n,s),s=[],o.text.trim()&&n.push({kind:"text",text:o.text});continue}const c=t.tools.find(d=>d.id===o.toolCallId);c&&!a.has(c.id)&&(s.push(c),a.add(c.id))}jl(n,s)}function km(e,t,n,a){const s=e.tools.filter(o=>!a.has(o.id)&&o.assistantMessageId===t.id);if(s.length!==0){for(const o of s)a.add(o.id);jl(n,s)}}function OD(e){const t=new Set,n=[],a=e.assistants.at(-1),s=a?.kind==="provider-error"?void 0:a,o=s?e.assistants.lastIndexOf(s):-1;for(const[p,g]of e.assistants.entries())if(p!==o){if(g.kind==="provider-error"&&g.providerError){wm(E1(g.content??[]),e,n,t),km(e,g,n,t),n.push({kind:"provider-error",error:g.providerError});continue}wm(E1(g.content??[]),e,n,t),km(e,g,n,t)}const c=s?.content??[],d=AD(c,{isStreaming:e.live});wm(d.processBlocks,e,n,t),s&&km(e,s,n,t);const h=e.tools.filter(p=>!t.has(p.id));if(h.length>0&&jl(n,h),e.processItems=n,!s)return;if(c.length===0){e.answer=s;return}const m=ID(d.answerBlocks);e.answer={...s,text:m,content:d.answerBlocks}}function DD(e){const t=e.messages.filter(d=>d.role==="user"||d.role==="assistant"),n=[];let a=null;const s=d=>{const h=_D(d);return n.push(h),h};for(const d of t){if(d.role==="user"){a=s(`user-${d.id}`),a.user=d;continue}if(d.kind==="compaction"){a=s(`compaction-${d.id}`),a.assistants.push(d),a=null;continue}a||(a=s(`assistant-${d.id}`)),a.assistants.push(d)}const o=new Set,c=new Map;for(const d of n)for(const h of d.assistants)c.set(h.id,d);for(const d of e.toolCalls)if(d.assistantMessageId){const h=c.get(d.assistantMessageId);h&&(h.tools.push(d),o.add(d.id))}for(const d of e.toolCalls)if(!o.has(d.id)&&d.turnId){const h=n.find(p=>p.tools.some(g=>g.turnId===d.turnId)||p.key===`turn-${d.turnId}`||p.user&&`restored-${p.user.id}`===d.turnId);if(h){h.tools.push(d),o.add(d.id);continue}const m=n.find(p=>d.turnId===`restored-${p.user?.id}`||p.assistants.some(g=>d.turnId===`restored-${g.id}`));m&&(m.tools.push(d),o.add(d.id))}for(const d of e.toolCalls){if(o.has(d.id))continue;const h=n.find((m,p)=>{const g=m.user?.createdAt??m.assistants[0]?.createdAt??0,y=n[p+1]?.user?.createdAt??Number.POSITIVE_INFINITY;return d.createdAt>=g&&d.createdAt<y});h&&(h.tools.push(d),o.add(d.id))}for(const d of n)d.tools.sort((h,m)=>h.eventSeq!==void 0&&m.eventSeq!==void 0?h.eventSeq-m.eventSeq:h.createdAt-m.createdAt),d.live=e.streaming&&e.activeAssistantId!==null&&d.assistants.some(h=>h.id===e.activeAssistantId),OD(d);return n}function jD(e,t){return t<=0?[]:e.length<=t?[...e]:e.slice(-t)}function Y7(e,t){const n=e.findIndex(a=>a.operationId===t.operationId);return n<0?[...e,t]:e.map((a,s)=>{if(s!==n)return a;let o=a.eventSeq;return o===void 0?o=t.eventSeq:t.eventSeq!==void 0&&(o=Math.min(o,t.eventSeq)),{...a,...t,...o===void 0?{}:{eventSeq:o},updatedSeq:Math.max(a.updatedSeq??a.eventSeq??0,t.updatedSeq??t.eventSeq??0),toolCallId:a.toolCallId??t.toolCallId,activityRef:a.activityRef??t.activityRef}})}function LD(e){const t=e.operation;if(!t||typeof t!="object")return;const n=t;if(n.schemaVersion!==1||typeof n.operationId!="string"||typeof n.action!="string"||typeof n.state!="string"||typeof n.inspectHref!="string"||typeof n.createdAt!="string"||typeof n.updatedAt!="string"||typeof n.previewHash!="string")return;const a=zD(n.runSummary),{runSummary:s,...o}=n;return{...o,...a?{runSummary:a}:{}}}function zD(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(typeof t.runId!="string"||!t.runId||typeof t.status!="string"||!t.status)return;let n=[];Array.isArray(t.nodes)&&(n=t.nodes.flatMap(o=>{if(!o||typeof o!="object")return[];const c=String(o.id??""),d=String(o.status??"");if(!c||!d)return[];const h=String(o.failureCategory??"");return[{id:c,status:d,...h?{failureCategory:h}:{}}]}).slice(0,20));let a;if(t.next&&typeof t.next=="object"){const o=t.next;a={kind:String(o.kind??""),...typeof o.description=="string"?{description:o.description}:{}}}return{runId:t.runId,status:t.status,nodes:n,...typeof t.verdict=="string"?{verdict:t.verdict}:{},...typeof t.failureCategory=="string"?{failureCategory:t.failureCategory}:{},...a&&a.kind?{next:a}:{}}}const BD=["operation","contract","dag","report","html"];function qD(e){const t=e.artifact;if(!t||typeof t!="object")return;const n=t;if(!(n.schemaVersion!==1||typeof n.artifactId!="string"||!n.artifactId||typeof n.kind!="string"||!BD.includes(n.kind)||typeof n.previewHash!="string")){for(const a of["title","summary","htmlPreview","reportText","inspectHref"])if(n[a]!==void 0&&typeof n[a]!="string")return;return n}}function HD(e,t){const n=e.findIndex(a=>a.artifactId===t.artifactId);return n<0?[...e,t]:e.map((a,s)=>s===n?{...a,...t,eventSeq:a.eventSeq??t.eventSeq,activityRef:a.activityRef??t.activityRef}:a)}function UD(e){if(!e||typeof e!="object")return;const t=e;if(!(t.schemaVersion!==1||typeof t.cardId!="string"||t.gateType!=="contract-apply"&&t.gateType!=="dag-run"||typeof t.taskId!="string"||typeof t.state!="string"||typeof t.expiresAt!="string"||typeof t.inspectHref!="string"||typeof t.previewHash!="string"))return t}function FD(e,t){const n=e.findIndex(o=>o.cardId===t.cardId);if(n<0)return[...e,t];const a=[...e],s=a[n];return s?(a[n]={...s,...t,eventSeq:s.eventSeq??t.eventSeq,activityRef:s.activityRef??t.activityRef},a):[...e,t]}function $D(e){const{refs:t,onReconcile:n,setError:a,setInterview:s,setHumanGateCards:o,setArtifactCards:c,setStreaming:d,setTurnPhase:h=()=>{},setDeferredTurn:m=()=>{},setDeferredTurns:p=()=>{},setStreamingAssistantId:g,setUnread:x,setOperationCards:y,setUsage:S,onTelemetryRefresh:T,setMessages:N,setToolCalls:R,setPendingQuestion:M=()=>{},setTodos:_=()=>{}}=e;let P,F=-1;return(A,L,Z,U)=>{if(U?.generation!==void 0&&t.sessionGenerationRef.current!==U.generation)return;const $=U?.replay===!0;if(A==="stream_ready")return;if(A==="reconcile"){const K={reason:typeof L.reason=="string"?L.reason:"cursor_expired",...typeof L.minSeq=="number"?{minSeq:L.minSeq}:{},...typeof L.epoch=="string"?{epoch:L.epoch}:{},...typeof L.latestTurnId=="string"?{latestTurnId:L.latestTurnId}:{}};(typeof L.latestEventId=="string"||L.latestEventId===null)&&(K.latestEventId=L.latestEventId),n?.(K);return}const q=L.data&&typeof L.data=="object"?L.data:L;if(A==="todo_updated"||A==="todo_cleared"){const I=Array.isArray(q.todos)?q.todos:[];_(I.filter(K=>!!K&&typeof K=="object"&&typeof K.content=="string"&&(K.status==="pending"||K.status==="in_progress"||K.status==="completed")));return}if((A==="question_requested"||A==="question_resolved"||A==="question_cancelled")&&q.question&&typeof q.question=="object"){const I=q.question;typeof I.requestId=="string"&&typeof I.sessionId=="string"&&I.sessionId===t.sessionRef.current?.sessionId&&M(A==="question_requested"&&I.status==="pending"?I:null);return}const W=typeof L.turnId=="string"?L.turnId:void 0,oe=typeof L.seq=="number"&&Number.isFinite(L.seq)?L.seq:void 0,J=typeof L.at=="string"&&Number.isFinite(Date.parse(L.at))?Date.parse(L.at):Date.now();if(A==="queue_update"){const I=typeof q.revision=="number"?q.revision:-1,K=t.sessionRef.current?.sessionId;if(K!==P&&(P=K,F=-1),I<F)return;F=I,m(q.deferredTurn&&typeof q.deferredTurn=="object"?q.deferredTurn:null),Array.isArray(q.deferredTurns)&&p(q.deferredTurns);return}if(A==="user_message"){const I=q.message&&typeof q.message=="object"?q.message:null;if(I&&typeof I.id=="string"&&typeof I.text=="string"){const K=typeof I.at=="string"&&Number.isFinite(Date.parse(I.at))?Date.parse(I.at):Date.now();N(X=>X.some(be=>be.id===I.id)?X:[...X,{id:I.id,role:"user",text:I.text,createdAt:K}])}return}if(A==="compact"){const I=typeof q.summary=="string"?q.summary:"",K=typeof q.tokensBefore=="number"&&Number.isFinite(q.tokensBefore)?Math.max(0,Math.floor(q.tokensBefore)):void 0,X=typeof q.firstKeptEntryId=="string"&&q.firstKeptEntryId?q.firstKeptEntryId:void 0,be=typeof L.eventId=="string"&&L.eventId?`compaction-${L.eventId}`:W&&oe!==void 0?`compaction-${W}-${oe}`:ri("compaction");N(j=>j.some(G=>G.id===be)?j:[...j,{id:be,role:"assistant",kind:"compaction",text:I||"历史上下文已精简,关键决策与当前任务已保留。",createdAt:J,compaction:{...K===void 0?{}:{tokensBefore:K},...X?{firstKeptEntryId:X}:{},...typeof L.eventId=="string"?{eventId:L.eventId}:{}}}]);return}if(W&&(A==="agent_start"||A==="message_update")&&t.settledTurnIdsRef.current.has(W))return;let H=Z;if(W){const I=t.turnAssistantIdsRef.current.get(W);I?H=I:t.turnAssistantIdsRef.current.set(W,Z)}if(A==="interview-turn"){s(I=>({...I??{},interviewSessionId:typeof q.interviewSessionId=="string"?q.interviewSessionId:I?.interviewSessionId,taskId:typeof q.taskId=="string"?q.taskId:I?.taskId,state:typeof q.state=="string"?q.state:I?.state,question:q.question&&typeof q.question=="object"?q.question:void 0}));return}if(A==="draft"){s(I=>({...I??{},taskId:typeof q.taskId=="string"?q.taskId:I?.taskId,draft:q.draft&&typeof q.draft=="object"?q.draft:I?.draft,draftSha256:typeof q.draftSha256=="string"?q.draftSha256:I?.draftSha256,taskKindRecommendation:typeof q.taskKindRecommendation=="string"?q.taskKindRecommendation:I?.taskKindRecommendation}));return}if(A==="assessment"){s(I=>({...I??{},assessment:q}));return}if(A==="taskKind-confirmed"){s(I=>({...I??{},confirmedTaskKind:typeof q.taskKind=="string"?q.taskKind:I?.confirmedTaskKind,taskKindRecommendation:void 0}));return}if(A==="human-gate-card"){const I=UD(q);I&&o(K=>FD(K,{...I,...oe===void 0?{}:{eventSeq:oe},...W?{turnId:W}:{},activityRef:`gate:${I.cardId}`}));return}if(A==="artifact-ref"){const I=qD(q);I&&c(K=>HD(K,{...I,...oe===void 0?{}:{eventSeq:oe},...W?{turnId:W}:{},activityRef:`artifact:${I.artifactId}`}));return}if(A==="agent_start"){if($&&W!==void 0&&W!==t.activeTurnIdRef.current)return;W&&(t.settledTurnIdsRef.current.delete(W),t.activeTurnIdRef.current=W),t.streamingRef.current=!0,d(!0),h("running"),g(H);return}if(A==="agent_settled"||A==="agent_end"){if(W&&t.settledTurnIdsRef.current.add(W),A==="agent_end")return;W===t.activeTurnIdRef.current&&(t.activeTurnIdRef.current=null),t.streamingRef.current=!1,d(!1),h("idle"),g(null),A==="agent_settled"&&!$&&typeof document<"u"&&document.hidden&&x(K=>K+1);let I=!1;R(K=>(I=K.some(X=>X.assistantMessageId===H),K.map(X=>X.status==="running"&&(W!==void 0&&X.turnId===W||X.assistantMessageId===H)?{...X,status:"error",finishedAt:Date.now()}:X))),N(K=>K.filter(X=>X.id!==H||X.role!=="assistant"||X.text.trim()||X.content&&X.content.length>0?!0:I)),$||T?.();return}if(A==="operation-ref"||A==="operation-status"){const I=LD(q),K=t.sessionRef.current?.sessionId;if(I&&K&&t.unlinkedOperationIdsRef.current.get(K)?.has(I.operationId))return;if(I){const X=typeof q.toolCallId=="string"?q.toolCallId:void 0;y(be=>Y7(be,{...I,...oe===void 0?{}:{eventSeq:oe,updatedSeq:oe},...W?{turnId:W}:{},...X?{toolCallId:X}:{},activityRef:`operation:${I.operationId}`}))}return}if(A==="operation-unlinked"){const I=typeof q.operationId=="string"?q.operationId:"",K=t.sessionRef.current?.sessionId;if(I&&K){const X=t.unlinkedOperationIdsRef.current.get(K)??new Set;X.add(I),t.unlinkedOperationIdsRef.current.set(K,X),y(be=>be.filter(j=>j.operationId!==I))}return}if(A==="usage"){if($)return;const I=q,K=typeof I.responseKey=="string"&&I.responseKey?I.responseKey:void 0;if(K&&t.usageResponseKeysRef.current.has(K))return;K&&t.usageResponseKeysRef.current.add(K),S(X=>{const be=I.inputTokens??0,j=I.outputTokens??0,G=I.cacheReadTokens??0,Y=I.cacheWriteTokens??0,D=I.totalTokens??be+j+G+Y,ye=I.contextUsage,se=ye&&typeof ye=="object"?{tokens:typeof ye.tokens=="number"?ye.tokens:null,contextWindow:typeof ye.contextWindow=="number"?ye.contextWindow:0,percent:typeof ye.percent=="number"?ye.percent:null}:X.contextUsage;return{inputTokens:X.inputTokens+be,outputTokens:X.outputTokens+j,cacheReadTokens:X.cacheReadTokens+G,cacheWriteTokens:X.cacheWriteTokens+Y,totalTokens:X.totalTokens+D,cost:I.cost===void 0?X.cost:(X.cost??0)+I.cost,...se?{contextUsage:se}:{}}});return}if(A==="message_update"||A==="message_end"){if($)return;const I=t.sealedAssistantIdsRef.current;if(A==="message_update"&&I.has(H)){const j=ri("a");W&&t.turnAssistantIdsRef.current.set(W,j);const G=H;R(Y=>Y.map(D=>D.assistantMessageId===G?{...D,assistantMessageId:j}:D)),H=j,g(j)}const K=typeof q.text=="string"?q.text:"",X=S1(q.content),be=H;N(j=>j.some(Y=>Y.id===be)?j.map(Y=>Y.id!==be?Y:{...Y,text:K,...X?{content:X}:{}}):[...j,{id:be,role:"assistant",text:K,createdAt:J,...X?{content:X}:{}}]),A==="message_end"&&I.add(be)}else if(A==="tool_call"){const I=typeof q.toolCallId=="string"?q.toolCallId:ri("t"),K=typeof q.toolName=="string"?q.toolName:"tool",X=typeof q.argsPreview=="string"?q.argsPreview:"{}";R(be=>be.some(j=>j.id===I)?be.map(j=>j.id!==I?j:{...j,args:X,status:"running",turnId:W??j.turnId,assistantMessageId:H,...oe===void 0?{}:{eventSeq:oe}}):[...be,{id:I,toolName:K,args:X,status:"running",createdAt:J,...oe===void 0?{}:{eventSeq:oe},turnId:W,assistantMessageId:H}])}else if(A==="tool_result"){const I=typeof q.toolCallId=="string"?q.toolCallId:ri("r"),K=typeof q.toolName=="string"?q.toolName:"tool",X=q.isError===!0,be=typeof q.resultPreview=="string"?q.resultPreview:"{}",j=typeof q.operationId=="string"&&q.operationId?q.operationId:void 0;R(G=>G.find(D=>D.id===I)?G.map(D=>D.id!==I?D:{...D,result:be,resultText:be,status:X?"error":"ok",finishedAt:J,...oe===void 0?{}:{finishedSeq:oe},turnId:W??D.turnId,assistantMessageId:D.assistantMessageId??H,...j?{operationId:j}:D.operationId?{operationId:D.operationId}:{}}):[...G,{id:I,toolName:K,result:be,resultText:be,status:X?"error":"ok",createdAt:J,finishedAt:J,...oe===void 0?{}:{eventSeq:oe,finishedSeq:oe},turnId:W,assistantMessageId:H,...j?{operationId:j}:{}}])}else if(A==="error"){const I=q.providerError&&typeof q.providerError=="object"?q.providerError:void 0;if(I&&typeof I.message=="string"&&typeof I.raw=="string"&&(I.category==="authentication"||I.category==="context-overflow"||I.category==="rate-limit"||I.category==="provider")){if($)return;const K=I,X=S1(q.content),be=W&&oe!==void 0?`provider-error-${W}-${oe}`:ri("provider-error");N(j=>{if(j.some(Y=>Y.id===be))return j;const G=j.some(Y=>Y.id===H&&!!Y.content?.length);return[...j,{id:be,role:"assistant",kind:"provider-error",text:K.message,createdAt:J,providerError:K,...!G&&X?{content:X}:{}}]});return}a(typeof q.message=="string"?q.message:"chat error")}}}const Sm={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0},Em={turns:0,steps:0,llmMs:0,toolMs:0,ttftMs:0,ttftSteps:0,decodeMs:0,decodeTokens:0};function PD(e){const t=h=>{const m=e[h];return typeof m=="string"&&m?m:void 0},n=t("operationId"),a=t("action"),s=t("state"),o=t("createdAt");if(!n||!a||!s||!o)return;const c=t("updatedAt")??t("finishedAt")??t("startedAt")??o,d=t("dagRunId");return{schemaVersion:1,operationId:n,action:a,state:s,createdAt:o,updatedAt:c,inspectHref:`/inspect/?operationId=${encodeURIComponent(n)}#/`,...t("taskId")?{taskId:t("taskId")}:{},...d?{dagRunId:d}:{},...t("errorCode")?{errorCode:t("errorCode")}:{},activityRef:`operation:${n}`,previewHash:`${n}:${s}:${c}`}}async function GD(e){const{identity:t}=e,n=()=>{const a=e.currentOwner();return a.sessionId===t.sessionId&&a.workspaceId===t.workspaceId};if(!t.workspaceId||!n())return!1;if(t.action==="remove")return e.setOperationCards(a=>a.filter(s=>s.operationId!==t.operationId)),!0;try{const a=new URLSearchParams({workspaceId:t.workspaceId}),o=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/operations/${encodeURIComponent(t.operationId)}?${a.toString()}`,{credentials:"include"});if(!o.ok||!n())return!1;const c=await o.json(),d=c.operation;if(c.workspaceId!==t.workspaceId||!d||d.workspaceId!==t.workspaceId||d.operationId!==t.operationId||!n())return!1;const h=PD(d);return h?(e.setOperationCards(m=>n()?Y7(m,h):m),n()):!1}catch{return!1}}function VD(e,t){const n=[...e];for(const a of t??[]){const s=a.data&&typeof a.data=="object"?a.data:{},o=typeof a.eventId=="string"?a.eventId:void 0,c=o?`compaction-${o}`:`compaction-${a.at??Date.now()}`;n.some(d=>d.id===c)||n.push({id:c,role:"assistant",kind:"compaction",text:typeof s.summary=="string"?s.summary:"历史上下文已精简,关键决策与当前任务已保留。",createdAt:Date.parse(a.at??"")||Date.now(),compaction:{...typeof s.tokensBefore=="number"?{tokensBefore:s.tokensBefore}:{},...typeof s.firstKeptEntryId=="string"?{firstKeptEntryId:s.firstKeptEntryId}:{},...o?{eventId:o}:{}}})}return n.sort((a,s)=>a.createdAt-s.createdAt)}function KD(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,setError:o,onReconcile:c}=e,[d,h]=w.useState([]),[m,p]=w.useState([]),[g,x]=w.useState([]),[y,S]=w.useState([]),[T,N]=w.useState(50),[R,M]=w.useState(0),[_,P]=w.useState([]),[F,A]=w.useState(null),[L,Z]=w.useState(null),[U,$]=w.useState(!1),[q,W]=w.useState(Sm),[oe,J]=w.useState(Em),[H,I]=w.useState(!1),[K,X]=w.useState("idle"),[be,j]=w.useState(null),[G,Y]=w.useState([]),[D,ye]=w.useState(null),[se,V]=w.useState([]),[Q,ae]=w.useState(null),[ue]=w.useState(!1),he=w.useCallback(async()=>{const ze=n.sessionRef.current?.sessionId;if(ze)try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}`,{credentials:"include"});if(!Qe.ok)return;const Ue=await Qe.json();if(n.sessionRef.current?.sessionId!==ze)return;Ue.sessionStats&&J(Ue.sessionStats),Ue.usage&&W(Ue.usage)}catch{}},[t,n]),Ne=w.useMemo(()=>$D({refs:n,onReconcile:c,setError:o,setInterview:A,setHumanGateCards:P,setArtifactCards:S,setStreaming:I,setTurnPhase:X,setDeferredTurn:j,setDeferredTurns:Y,setPendingQuestion:ye,setTodos:V,setStreamingAssistantId:ae,setUnread:M,setOperationCards:x,setUsage:W,onTelemetryRefresh:()=>{he()},setMessages:h,setToolCalls:p}),[n,c,o,he]),He=w.useCallback((ze,Qe,Ue)=>{if(Ue?.targetSessionId&&n.sessionRef.current?.sessionId!==Ue.targetSessionId||Ue?.generation!==void 0&&n.sessionGenerationRef.current!==Ue.generation)return null;const ot=ze.split(`
397
+ `);let fe="message",me="",$e=null;for(const mt of ot)mt.startsWith("event: ")?fe=mt.slice(7).trim():mt.startsWith("data: ")?me+=mt.slice(6):mt.startsWith("id: ")&&($e=mt.slice(4).trim());if(!me)return $e;let we;try{we=JSON.parse(me)}catch{return $e}const Fe=$e??(typeof we.eventId=="string"?we.eventId:null);if(Fe){if(n.seenEventIdsRef.current.has(Fe))return Fe;n.seenEventIdsRef.current.add(Fe)}return Ne(fe,we,Qe,Ue),$e??Fe},[Ne,n]),We=w.useCallback(async(ze,Qe)=>{const Ue=Qe?.background===!0;Ue||$(!0);try{const ot=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}/context`,{credentials:"include"});if(!ot.ok)return;const fe=await ot.json();fe.context&&n.sessionRef.current?.sessionId===ze&&Z(me=>dk(me,fe.context)?me:fe.context)}finally{Ue||$(!1)}},[t,n]);w.useEffect(()=>{a&&We(a)},[a,We]),w.useEffect(()=>{if(!a)return;const ze=window.setTimeout(()=>{We(a,{background:!0})},350);return()=>window.clearTimeout(ze)},[a,g,_,F,We]);const rt=w.useCallback(ze=>GD({origin:t,identity:ze,currentOwner:()=>({sessionId:n.sessionRef.current?.sessionId,workspaceId:s}),setOperationCards:x}),[t,n,s]),Ye=w.useMemo(()=>d.filter(ze=>ze.role!=="system"||ue),[d,ue]);w.useEffect(()=>{const ze=()=>{document.hidden||M(0)};return document.addEventListener("visibilitychange",ze),()=>document.removeEventListener("visibilitychange",ze)},[]);const gt=w.useMemo(()=>{if(m.length===0)return null;const ze=m.filter(me=>me.status==="running"),Qe=m.filter(me=>me.status==="error"),Ue=ze[ze.length-1];let ot="完成",fe="ok";return Qe.length>0?(ot=`${Qe.length} 次出错`,fe="error"):ze.length>0?(ot=Ue?`${Ue.toolName} 运行中`:"运行中",fe="running"):ot="",{count:m.length,statusLabel:ot,statusKind:fe}},[m]),Rt=w.useMemo(()=>{const ze=DD({messages:Ye,toolCalls:m,streaming:H,activeAssistantId:Q});return jD(ze,T)},[Ye,m,H,Q,T]),st=w.useMemo(()=>{const ze=[];for(const Qe of Rt)Qe.user&&ze.push(Qe.user),ze.push(...Qe.assistants);return ze},[Rt]),kt=w.useCallback(()=>{h([]),p([]),x([]),P([]),S([]),A(null),Z(null),W(Sm),J(Em),I(!1),X("idle"),j(null),Y([]),ye(null),V([]),ae(null),M(0),N(50),n.usageResponseKeysRef.current=new Set},[n]),$t=w.useCallback(ze=>{h(ze.messages),p(ze.toolCalls),x([]),P([]),S([]),Z(null),A(null),W(ze.usage??Sm),J(ze.sessionStats??Em),n.usageResponseKeysRef.current=new Set,I(ze.streaming),X(ze.turnPhase??(ze.streaming?"running":"idle")),j(ze.deferredTurn??null),Y(ze.deferredTurns??(ze.deferredTurn?[ze.deferredTurn]:[])),ye(ze.pendingQuestion??null),V(ze.todos??[]),ae(null),M(0),N(50)},[n]),Ut=w.useCallback(async ze=>{try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}`,{credentials:"include"});if(!Qe.ok)return!1;const Ue=await Qe.json();if(!Ue.session||n.sessionRef.current?.sessionId!==ze)return!1;const ot=Ue.session.activeTurnId??null;n.activeTurnIdRef.current=ot,n.streamingRef.current=!!ot,X(Ue.session.turnPhase??(ot?"running":"idle")),j(Ue.session.deferredTurn??null),Y(Ue.session.deferredTurns??(Ue.session.deferredTurn?[Ue.session.deferredTurn]:[])),ye(Ue.session.pendingQuestion??null),V(Ue.session.todos??[]),Ue.sessionStats&&J(Ue.sessionStats),Ue.usage&&W(Ue.usage),n.lastEventIdRef.current=Ue.lastEventId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set;const fe=T1(Ue.session.messages??[]);return h(VD(fe.messages,Ue.compactions)),p(fe.toolCalls),ae(null),!0}catch{return!1}},[t,n,h,p,ae,X,j,ye,V]);return{messages:d,setMessages:h,toolCalls:m,setToolCalls:p,operationCards:g,artifactCards:y,historyLimit:T,setHistoryLimit:N,unread:R,humanGateCards:_,interview:F,setInterview:A,taskContext:L,contextLoading:U,usage:q,sessionStats:oe,streaming:H,setStreaming:I,turnPhase:K,setTurnPhase:X,deferredTurn:be,setDeferredTurn:j,deferredTurns:G,setDeferredTurns:Y,pendingQuestion:D,setPendingQuestion:ye,todos:se,streamingAssistantId:Q,setStreamingAssistantId:ae,visibleMessages:st,turnGroups:Rt,processSummary:gt,applyChatSseEvent:Ne,applySseBlock:He,loadTaskContext:We,applyOperationLinkMutation:rt,resetForNewSession:kt,applyActivatedSession:$t,recoverSession:Ut}}const YD={error:6e3,info:4e3};function WD(e){const{toast:t,onDismiss:n}=e,[a,s]=w.useState(!1),o=w.useRef(null),c=w.useRef(null),d=()=>{o.current!==null&&window.clearTimeout(o.current),c.current!==null&&window.clearTimeout(c.current),o.current=null,c.current=null},h=()=>{d(),s(!0),c.current=window.setTimeout(()=>{s(!1),n()},140)};if(w.useEffect(()=>{if(t)return s(!1),o.current=window.setTimeout(h,YD[t.kind]),d},[t?.id]),w.useEffect(()=>d,[]),!t)return null;const m=t.kind==="error";return Zl.createPortal(u.jsxs("div",{className:`oc-toast is-${t.kind}${a?" is-leaving":""}`,role:m?"alert":"status",onMouseEnter:d,onMouseLeave:()=>{a||(o.current=window.setTimeout(h,1600))},children:[u.jsx("span",{className:"oc-toast-icon","aria-hidden":"true",children:m?u.jsx(Hw,{size:16}):u.jsx(Q3,{size:16})}),u.jsx("span",{className:"oc-toast-message",children:t.message}),u.jsx("button",{type:"button",className:"oc-toast-close","aria-label":"关闭提示",onClick:h,children:u.jsx(Ts,{size:14,"aria-hidden":"true"})})]}),document.body)}function m3(e){if(e.readiness==="ready"||e.readiness==="unknown")return null;const t=e.readiness==="setup-required";return u.jsxs("section",{className:`oc-readiness-notice is-${e.presentation}${t?" is-setup":" is-degraded"}`,role:"status","aria-live":"polite",children:[u.jsx("span",{className:"oc-readiness-notice-icon","aria-hidden":"true",children:t?u.jsx(e5,{size:18}):u.jsx(Q3,{size:17})}),u.jsxs("div",{className:"oc-readiness-notice-copy",children:[u.jsx("strong",{children:t?"Pi 尚未配置":"Pi 当前为降级状态"}),u.jsx("span",{children:t?"完成认证并选择模型后即可开始对话":"仍可继续对话,但部分模型或工具能力可能暂不可用"})]}),t&&e.onOpenModels?u.jsx("button",{type:"button",className:"oc-readiness-notice-action",onClick:e.onOpenModels,children:"去配置"}):null]})}function Kl(e){return e==="missing-capability-token"||e==="invalid-capability-token"||e==="missing-confirmation-token"||e==="invalid-confirmation-token"||e==="host-not-loopback"||e==="origin-mismatch"||e==="cross-site-fetch"}function W7(e){return e==="invalid-capability-token"||e==="invalid-confirmation-token"||e==="missing-capability-token"||e==="missing-confirmation-token"}function Yl(e){return W7(e)?"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。":e==="host-not-loopback"?"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。":e==="origin-mismatch"?"请求来源与控制台地址不一致,请通过控制台页面操作。":e==="cross-site-fetch"?"检测到跨站请求,已拒绝。请通过控制台页面操作。":"操作被拒绝,请刷新页面后重试。"}class ZD{constructor(t){this.options=t,this.fetchFn=t.fetchFn??fetch,this.backoffMs=t.backoffMs??1e3,this.deadlineMs=t.deadlineMs??3e4}options;eligible=new Set;controllers=new Map;fetchFn;backoffMs;deadlineMs;markEligible(t){this.eligible.add(t)}startIfEligible(t){if(!this.eligible.delete(t)||this.controllers.has(t))return;const n=new AbortController;this.controllers.set(t,n),this.run(t,n)}cancel(t){this.eligible.delete(t),this.controllers.get(t)?.abort(),this.controllers.delete(t)}reconcile(t){const n=new Set(t);for(const a of this.controllers.keys())n.has(a)||this.cancel(a)}dispose(){for(const t of this.controllers.values())t.abort();this.controllers.clear(),this.eligible.clear()}async run(t,n){let a;const s=new Set;let o=!1;const c=window.setTimeout(()=>{o=!0,n.abort()},this.deadlineMs);try{for(;!n.signal.aborted;){try{const d={Accept:"text/event-stream"};a&&(d["Last-Event-ID"]=a);const h=await this.fetchFn(`${this.options.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`,{headers:d,credentials:"include",signal:n.signal});if(h.status===404||!h.body)return;if(!h.ok)throw new Error(`HTTP ${h.status}`);const m=h.body.getReader(),p=new TextDecoder;let g="";for(;;){const{done:x,value:y}=await m.read();if(x||n.signal.aborted)break;g+=p.decode(y,{stream:!0});const S=g.split(`
398
+
399
+ `);g=S.pop()??"";for(const T of S){const N=T.split(`
400
+ `).find(M=>M.startsWith("id: "))?.slice(4);if(N&&(a=N),!N||s.has(N)||!T.includes("event: session_title"))continue;const R=T.split(`
401
+ `).find(M=>M.startsWith("data: "))?.slice(6);if(R)try{const M=JSON.parse(R),_=M.data?.title?.trim();if(!_)continue;if(s.add(N),!this.options.hasSession(t)||(this.options.onTitle(t,{title:_,automatic:!!M.data?.automatic}),M.data?.automatic))return}catch{}}}}catch{if(n.signal.aborted)return}n.signal.aborted||await XD(this.backoffMs,n.signal)}}finally{window.clearTimeout(c),this.controllers.get(t)===n&&this.controllers.delete(t),(o||!this.options.hasSession(t))&&this.options.refresh()}}}function XD(e,t){return new Promise(n=>{const a=window.setTimeout(o,e),s=()=>o();function o(){window.clearTimeout(a),t.removeEventListener("abort",s),n()}t.addEventListener("abort",s,{once:!0})})}async function QD(e){if(e.creatingRef?.current)throw new Error("CREATE_SESSION_IN_FLIGHT");e.creatingRef&&(e.creatingRef.current=!0),e.setCreatingSession?.(!0);try{const t=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/chat/sessions`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify(e.options??{})});if(!t.ok){const c=await t.json().catch(()=>({}));throw Kl(c.error?.code)?new Error(Yl(c.error.code)):new Error(c.error?.message??`HTTP ${t.status}`)}const n=await t.json();if(!n.session)throw new Error("创建会话响应缺少 durable session");const a=n.session,s={sessionId:a.sessionId,...a.workspaceId||e.options?.workspaceId?{workspaceId:a.workspaceId??e.options?.workspaceId}:{},...k1(a)},o=[a,...e.sessionListRef.current.filter(c=>c.sessionId!==a.sessionId)].slice(0,j1);return e.sessionListRef.current=o,e.setSessionList(o),e.titleWatcher?.markEligible(a.sessionId),e.refreshSessionList(),s}finally{e.creatingRef&&(e.creatingRef.current=!1),e.setCreatingSession?.(!1)}}function p3(e,t){const n=[...e];for(const a of t??[]){const s=a.data&&typeof a.data=="object"?a.data:{},o=typeof a.eventId=="string"?a.eventId:void 0,c=o?`compaction-${o}`:`compaction-${a.at??Date.now()}`;if(n.some(h=>h.id===c))continue;const d=typeof s.summary=="string"?s.summary:"历史上下文已精简,关键决策与当前任务已保留。";n.push({id:c,role:"assistant",kind:"compaction",text:d,createdAt:Date.parse(a.at??"")||Date.now(),compaction:{...typeof s.tokensBefore=="number"?{tokensBefore:s.tokensBefore}:{},...typeof s.firstKeptEntryId=="string"?{firstKeptEntryId:s.firstKeptEntryId}:{},...o?{eventId:o}:{}}})}return n.sort((a,s)=>a.createdAt-s.createdAt)}function JD(e){const{origin:t,refs:n,setSession:a,thread:s,composer:o,browser:c,setError:d,setNotice:h,onCompactionChange:m,setProcessOpen:p,setAutoScroll:g}=e,{applyActivatedSession:x,resetForNewSession:y,setMessages:S}=s,{setInput:T,setPendingImages:N}=o,{setPreviews:R,setActivePreviewPath:M}=c,{workspaceId:_,blocked:P}=e,F=_?`?workspaceId=${encodeURIComponent(_)}`:"",A=w.useCallback(se=>{const V=se?.trim()||n.sessionRef.current?.workspaceId?.trim()||"";return V?`?workspaceId=${encodeURIComponent(V)}`:""},[n]),[L,Z]=w.useState([]),U=w.useRef([]);U.current=L;const $=w.useRef(null),[q,W]=w.useState(!1),oe=w.useRef(!1),J=w.useRef(!1),H=w.useRef(0),I=w.useCallback(se=>{const V=se?.keepStreams===!0;n.sessionGenerationRef.current+=1,V||n.abortRef.current?.abort(),n.reconnectAbortRef.current?.abort();for(const Q of n.sessionAbortControllersRef.current.values())Q.abort();n.sessionAbortControllersRef.current.clear(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null,n.streamingRef.current=!1,n.abortRef.current=null,n.assistantIdRef.current=null,n.lastEventIdRef.current=null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.activeTurnIdRef.current=null,y(),T(""),N([]),R([]),M(null),p(!1),g(!0)},[n,y,T,N,R,M,p,g]),K=w.useCallback(async()=>{if(!P)try{const se=await fetch(`${t}/api/operator/v1/chat/sessions${F}`,{credentials:"include"});if(!se.ok)return;const V=(await se.json()).sessions??[],ae=(_?V.filter(ue=>!ue.workspaceId||ue.workspaceId===_):V).slice(0,j1);Z(ae)}catch{}},[t,F,_,P]),X=w.useCallback(async se=>{try{const V=A(U.current.find(ae=>ae.sessionId===se)?.workspaceId??null);return(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${V}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":qn()}})).ok?($.current?.cancel(se),n.sessionRef.current?.sessionId===se&&(H.current+=1,n.sessionRef.current=null,I(),a(null),window.localStorage.removeItem(ma)),await K(),!0):(d("删除会话失败"),!1)}catch(V){return d(V instanceof Error?V.message:String(V)),!1}},[t,n,a,I,K,d,A]),be=w.useCallback(async(se,V)=>{const Q=++H.current,ae=A(V);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${ae}`,{credentials:"include"}),he=await ue.json();if(!ue.ok||!he.session)throw new Error(he.error?.message??"会话不可用");if(Q!==H.current)return;const Ne={sessionId:he.session.sessionId,...he.session.workspaceId?{workspaceId:he.session.workspaceId}:{},...k1(he.session)};I({keepStreams:!0}),n.sessionRef.current=Ne,n.streamingRef.current=!!he.session.activeTurnId,n.activeTurnIdRef.current=he.session.activeTurnId??null,n.streamingRef.current=!!he.session.activeTurnId,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(Ne),n.assistantIdRef.current=null,n.abortRef.current=n.sessionAbortControllersRef.current.get(se)??null,N([]),R([]),T(he.session.composerDraft??"");const He=T1(he.session.messages??[]);He.messages=p3(He.messages,he.compactions),x({messages:He.messages,toolCalls:He.toolCalls,sessionStats:he.sessionStats,usage:he.usage,streaming:!!he.session.activeTurnId,turnPhase:he.session.turnPhase??(he.session.activeTurnId?"running":"idle"),deferredTurn:he.session.deferredTurn??null,deferredTurns:he.session.deferredTurns??(he.session.deferredTurn?[he.session.deferredTurn]:[]),pendingQuestion:he.session.pendingQuestion??null,todos:he.session.todos??[]}),window.localStorage.setItem(ma,se),M(null)}catch(ue){if(Q!==H.current)return;d(ue instanceof Error?ue.message:String(ue))}},[t,n,a,N,R,T,x,I,M,d,A]);w.useEffect(()=>{K()},[K]),$.current||($.current=new ZD({origin:t,hasSession:se=>U.current.some(V=>V.sessionId===se),onTitle:(se,V)=>{Z(Q=>Q.map(ae=>ae.sessionId!==se||V.automatic&&ae.title?ae:V.automatic?{...ae,title:V.title}:{...ae,displayTitle:V.title}))},refresh:K}));const j=w.useCallback(se=>$.current?.startIfEligible(se),[]);w.useEffect(()=>{$.current?.reconcile(L.filter(se=>se.state!=="archived"&&!se.title).map(se=>se.sessionId))},[L]),w.useEffect(()=>()=>$.current?.dispose(),[]),w.useEffect(()=>{let se=!1;if(P)return;const V=window.localStorage.getItem(ma);if(!V)return;const Q=++H.current;return(async()=>{try{const ae=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}${F}`,{credentials:"include"});if(!ae.ok){window.localStorage.removeItem(ma);return}const ue=await ae.json();if(se||P||Q!==H.current||!ue.session)return;const he={sessionId:ue.session.sessionId,...k1(ue.session)};n.sessionGenerationRef.current+=1,n.sessionRef.current=he,n.activeTurnIdRef.current=ue.session.activeTurnId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(he),T(ue.session.composerDraft??"");const Ne=T1(ue.session.messages??[]);Ne.messages=p3(Ne.messages,ue.compactions),x({messages:Ne.messages,toolCalls:Ne.toolCalls,sessionStats:ue.sessionStats,usage:ue.usage,streaming:!!ue.session.activeTurnId,turnPhase:ue.session.turnPhase??(ue.session.activeTurnId?"running":"idle"),deferredTurn:ue.session.deferredTurn??null,deferredTurns:ue.session.deferredTurns??(ue.session.deferredTurn?[ue.session.deferredTurn]:[]),pendingQuestion:ue.session.pendingQuestion??null,todos:ue.session.todos??[]})}catch{}})(),()=>{se=!0}},[t,F,n,a,T,x,P]);const G=w.useCallback(se=>{const V=se?.workspaceId?.trim()??_?.trim();return V?QD({origin:t,sessionListRef:U,setSessionList:Z,titleWatcher:$.current,refreshSessionList:K,options:{...se,workspaceId:V},setCreatingSession:W,creatingRef:oe}):(d("创建会话需要选择一个有效的工作区(不会回退默认工作区)"),Promise.reject(new Error("WORKSPACE_REQUIRED")))},[t,K,_,d]),Y=w.useCallback(async se=>{if(oe.current||P)return null;const V=++H.current;d(null);try{const Q=await G(se);return V!==H.current?null:(I({keepStreams:!0}),n.sessionRef.current=Q,window.localStorage.setItem(ma,Q.sessionId),a(Q),Q)}catch(Q){if(V!==H.current)return null;const ae=Q instanceof Error?Q.message:String(Q);return ae!=="CREATE_SESSION_IN_FLIGHT"&&d(ae),null}},[n,a,d,I,G,P]),D=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||n.streamingRef.current)return;const Q=typeof se=="string"?se.trim():"";m?.(!0);try{const ae={"x-loop-console-confirmation":qn()};Q&&(ae["content-type"]="application/json");const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/compact${A()}`,{method:"POST",credentials:"include",headers:ae,...Q?{body:JSON.stringify({instructions:Q})}:{}}),he=await ue.json().catch(()=>({}));if(!ue.ok){const rt=he.error?.code;if(Kl(rt)){d(Yl(rt)),W7(rt)&&!J.current&&(J.current=!0,window.setTimeout(()=>window.location.reload(),1200));return}d(he.error?.message??"上下文压缩失败");return}d(null);const Ne=he.snapshot?.summary?.trim(),He=he.snapshot?.tokensBefore,We=Ne||"历史上下文已精简,关键决策与当前任务已保留。";await be(V.sessionId),S(rt=>{const Ye=typeof he.eventId=="string"?he.eventId:void 0,gt=Ye?`compaction-${Ye}`:`compaction-${Date.now()}`;return rt.some(Rt=>Rt.id===gt)?rt:[...rt,{id:gt,role:"assistant",kind:"compaction",text:We,createdAt:Date.now(),compaction:{...He===void 0?{}:{tokensBefore:He},...Ye?{eventId:Ye}:{}}}]}),h({id:Date.now(),message:`已压缩上下文:${We.slice(0,72)}${We.length>72?"…":""}`})}catch(ae){d(ae instanceof Error?ae.message:"上下文压缩失败")}finally{m?.(!1)}},[t,n,d,h,S,m,be,A]);return{sessionList:L,creatingSession:q,activateSession:be,refreshSessionList:K,deleteSession:X,createSession:Y,updateSession:async(se,V)=>{if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${A(U.current.find(ae=>ae.sessionId===se)?.workspaceId??null)}`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)})).ok){d("会话更新失败");return}await K(),V.state==="archived"&&$.current?.cancel(se),V.state==="archived"&&n.sessionRef.current?.sessionId===se&&(H.current+=1,n.sessionRef.current=null,I(),a(null),window.localStorage.removeItem(ma))},watchSessionTitle:j,compactSession:D}}function ej(e){return e.turnPhase==="stopping"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:e.turnPhase==="running"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:{action:"send-now"}}function g3(e){const{clientRequestId:t,blockedByTurnId:n,state:a}=e;if(!a)return{action:"hold"};const s=a.deferredTurns?.find(c=>c.clientRequestId===t)??(a.deferredTurn?.clientRequestId===t?a.deferredTurn:void 0);if(s)return{action:"deferred",deferredTurn:s};if(a.activeTurn?.clientRequestId===t)return{action:"accepted",turn:a.activeTurn};if(a.latestTurn?.clientRequestId===t)return{action:"accepted",turn:a.latestTurn};const o=a.activeTurn?.turnId??a.activeTurnId??null;return a.turnPhase==="stopping"&&o===n?{action:"retry-deferred"}:Wl(a)?{action:"hold"}:{action:"send-now"}}function tj(e){let t;const n=new Promise(a=>{t=a});return{...e,outcomePromise:n,resolveOutcome:t}}function b3(e="network error while creating turn"){return{kind:"ambiguous",message:e}}function nj(e="无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"){return{kind:"ambiguous",message:e}}function v3(e){const{body:t,clientRequestId:n}=e,a=t.error?.code,s=t.error?.message??(e.httpOk?"turn was not accepted":`HTTP ${e.status}`);if(a==="TURN_ACTIVE"&&t.activeTurn?.turnId)return{kind:"adopt-active",activeTurn:t.activeTurn,message:"上一轮仍在运行,已重新连接;当前消息已保留。"};if(t.accepted===!0||e.httpOk&&t.turnId){const o=t.turn?.turnId??t.turnId;return o?{kind:"accepted",turnId:o,idempotent:t.idempotent===!0,turn:t.turn??{turnId:o,clientRequestId:n,state:t.state}}:{kind:"ambiguous",message:s}}return t.accepted===!1||a?{kind:"rejected",code:a,message:s}:{kind:"ambiguous",message:s}}function rj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn;return n?.clientRequestId===t&&n.turnId?{kind:"accepted",turnId:n.turnId,idempotent:!0,turn:n}:a?.clientRequestId===t&&a.turnId?{kind:"accepted",turnId:a.turnId,idempotent:!0,turn:a}:n?.turnId?{kind:"adopt-active",activeTurn:n,message:"上一轮仍在运行,已重新连接;当前消息已保留。"}:null}function aj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn,s=n?.state??e.state?.activeTurnState??void 0,o=a?.state??e.state?.latestTurnState??void 0;if(n?.clientRequestId===t&&n.turnId)return ks(s)?{action:"release-terminal",turnId:n.turnId,state:String(s)}:{action:"bind-active",turnId:n.turnId};if(a?.clientRequestId===t&&a.turnId){if(ks(o))return{action:"release-terminal",turnId:a.turnId,state:String(o)};if(!n?.turnId||n.clientRequestId===t)return{action:"bind-active",turnId:a.turnId}}return!Wl(e.state)&&!(!!n?.turnId&&n?.clientRequestId!==t)?{action:"release-not-accepted"}:{action:"hold"}}function Wl(e){if(e?.activeTurnId||e?.activeTurn?.turnId)return!0;const t=e?.runtime;return t?t.isStreaming===!0||t.isPromptRunning===!0||t.isCompacting===!0||t.isBashRunning===!0:!1}function ks(e){return e==="settled"||e==="aborted"||e==="failed"}function od(e){return e.pending.sessionId===e.sessionId&&e.pending.sessionGeneration===e.sessionGeneration&&e.pending.submitGeneration===e.submitGeneration}function ij(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns`}function y3(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/state`}function sj(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`}function oj(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns/${encodeURIComponent(n)}/abort`}function fo(e){return e.stoppingTurnId||e.stopRequested?"stopping":e.activeTurnId||e.streaming||e.submitInFlight||e.pendingSubmission?"running":"idle"}function Ro(e,t){const n=e.pendingSubmission;t&&n&&n.clientRequestId!==t||(e.submitInFlight=!1,(!t||n?.clientRequestId===t)&&(n?.clientRequestId?e.releasedClientRequestIds.add(n.clientRequestId):t&&e.releasedClientRequestIds.add(t),e.pendingSubmission=null),e.pendingSubmission||(e.stopRequested=!1))}function Z7(e){e.stopRequested=!0}function ld(e){e.stopRequested=!1}function lj(e,t){return!(!t||e.abortPostedTurnIds.has(t))}function cj(e,t){t&&e.abortPostedTurnIds.add(t)}function cd(e,t){return!e.stopRequested||!lj(e,t)?null:(cj(e,t),e.stoppingTurnId=t,e.activeTurnId=t,t)}function x3(e,t){const n=e.pendingSubmission;return n&&n.clientRequestId!==t.clientRequestId?!1:(t.turnId&&e.settledTurnIds.add(t.turnId),Ro(e,t.clientRequestId),ld(e),t.markIdle!==!1&&(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null),!0)}function uj(e,t){return od({pending:t.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration})?(t.pending.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,t.assistantId),e.streaming=!0,e.submitInFlight=!1,t.pending.resolveOutcome({kind:"accepted",turnId:t.turnId}),t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(t.assistantId),t.ui?.setPendingImages([]),t.ui?.watchSessionTitle?.(t.sessionId),!0):(t.pending.resolveOutcome({kind:"stale"}),!1)}function dj(e,t){t.pending.resolveOutcome({kind:"adopt-active",activeTurn:{turnId:t.activeTurnId},message:t.message}),Ro(e,t.pending.clientRequestId),t.current&&(t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images),e.activeTurnId=t.activeTurnId,e.assistantId=null,e.streaming=!0,t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(null),t.notice.setError(null),t.notice.showNotice(t.message))}function fj(e,t){if(t.pending.resolveOutcome({kind:"rejected",message:t.message}),Ro(e,t.pending.clientRequestId),!t.current)return;const n=t.ui?.formatError?t.ui.formatError(t.message):t.message;t.ui?.setError(n),e.streaming=!1,e.assistantId=null,t.ui?.setStreaming(!1),t.ui?.setStreamingAssistantId(null),t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images)}function hj(e,t,n){const a=od({pending:n.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration});if(t.kind==="accepted"){if(uj(e,{turnId:t.turnId,assistantId:n.assistantId,pending:n.pending,sessionId:n.sessionId,ui:n.acceptedUi})){const o=cd(e,t.turnId);o&&n.onAutoAbort?.(o)}return}if(t.kind==="adopt-active"){const s=a?cd(e,t.activeTurn.turnId):null;dj(e,{activeTurnId:t.activeTurn.turnId,message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,notice:n.notice,ui:n.adoptUi}),s&&n.onAutoAbort?.(s);return}if(t.kind==="rejected"){fj(e,{message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,ui:n.rejectedUi}),ld(e);return}if(t.kind==="stale"){n.pending.resolveOutcome(t),Ro(e,n.pending.clientRequestId),ld(e);return}n.pending.resolveOutcome(t)}function mj(e,t,n,a){const s=e.pendingSubmission;if(!s)return"held";if(t.action==="bind-active"){const c=!!s.acceptedTurnId;c||(s.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,s.assistantId),e.streaming=!0,e.submitInFlight=!1);const d=cd(e,t.turnId);return d&&a?.onAutoAbort?.(d),c?"held":"bound"}if(t.action==="release-terminal"||t.action==="release-not-accepted")return t.action==="release-terminal"&&e.settledTurnIds.add(t.turnId),Ro(e,s.clientRequestId),ld(e),Wl(n)||(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.()),"released";const o=n?.activeTurn?.turnId??n?.activeTurnId??null;return o&&(e.activeTurnId=o),"held"}const pj="正在停止…",gj="正在停止…",bj="停止请求未完成,正在与服务端对账…",vj="停止请求失败,正在与服务端对账…";function w3(e){e.showNotice(pj)}function k3(e){if(e.networkError)return{action:"keep-busy-notice",message:vj};const t=e.body.turn?.state;return e.body.accepted===!0&&ks(t)?{action:"terminal-idle",turnId:e.turnId}:e.body.error?.code==="TURN_ABORT_PENDING"?{action:"abort-pending-notice"}:e.body.error?.code==="CHAT_TURN_OWNER_LOST"||e.body.error?.code==="OWNER_LOST"?{action:"owner-lost-reconcile"}:e.httpOk?{action:"noop"}:{action:"keep-busy-notice",message:bj}}function Tm(e,t,n,a){const s=a?.sessionStillCurrent!==!1;if(t.action==="terminal-idle"){if(!s)return;e.settledTurnIds.add(t.turnId),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.();return}if(t.action==="abort-pending-notice"){n.showNotice(gj);return}if(t.action==="owner-lost-reconcile"){if(!s)return;a?.runtimeBusy||(e.stoppingTurnId&&e.settledTurnIds.add(e.stoppingTurnId),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.());return}if(t.action==="keep-busy-notice"){n.showNotice(t.message);return}}function S3(e,t){Z7(e);const n=e.activeTurnId??e.pendingSubmission?.acceptedTurnId??null;if(n){const a=cd(e,n);return a?(t.notice&&w3(t.notice),t.postAbort(a),{abortedTurnId:a,stopRequested:!0}):{abortedTurnId:null,stopRequested:!0}}return t.notice&&w3(t.notice),{abortedTurnId:null,stopRequested:!0}}function Ea(e){return{submitInFlight:e.submitInFlightRef.current,pendingSubmission:e.pendingSubmissionRef.current,activeTurnId:e.activeTurnIdRef.current,streaming:e.streamingRef.current,assistantId:e.assistantIdRef.current,stoppingTurnId:e.stoppingTurnIdRef.current,settledTurnIds:e.settledTurnIdsRef.current,turnAssistantIds:e.turnAssistantIdsRef.current,sessionId:e.sessionRef.current?.sessionId??null,sessionGeneration:e.sessionGenerationRef.current,submitGeneration:e.submitGenerationRef.current,stopInFlight:e.stopInFlightRef.current,stopRequested:e.stopRequestedRef.current,abortPostedTurnIds:e.abortPostedTurnIdsRef.current,releasedClientRequestIds:e.releasedClientRequestIdsRef.current}}function Ta(e,t){e.submitInFlightRef.current=t.submitInFlight,e.pendingSubmissionRef.current=t.pendingSubmission,e.activeTurnIdRef.current=t.activeTurnId,e.streamingRef.current=t.streaming,e.assistantIdRef.current=t.assistantId,e.stoppingTurnIdRef.current=t.stoppingTurnId,e.submitGenerationRef.current=t.submitGeneration,e.stopInFlightRef.current=t.stopInFlight,e.stopRequestedRef.current=t.stopRequested}function yj(e){return e.split(`
402
+ `).find(t=>t.startsWith("event: "))?.slice(7).trim()??"message"}function xj(){return new Promise(e=>window.setTimeout(e,25))}function Cm(e,t){t&&e(n=>n.filter(a=>!(a.id===t&&a.role==="assistant"&&!a.text.trim())))}function wj(e){const{origin:t,refs:n,session:a,thread:s,composer:o,setError:c,setAutoScroll:d,setNotice:h,recoveryVersion:m=0,watchSessionTitle:p}=e,{applySseBlock:g,setMessages:x,setStreaming:y,setStreamingAssistantId:S,streaming:T,setTurnPhase:N,setDeferredTurn:R,setDeferredTurns:M}=s,{setInput:_,setPendingImages:P,recordHistory:F}=o,A=w.useCallback(se=>{h&&h({id:Date.now(),message:se})},[h]),L=w.useCallback(se=>{const V=Ea(n);Ro(V,se),Ta(n,V)},[n]),Z=w.useCallback((se,V,Q)=>{n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V||(n.streamingRef.current=!1,n.activeTurnIdRef.current=null,n.assistantIdRef.current=null,n.stoppingTurnIdRef.current=null,y(!1),N("idle"),S(null),Cm(x,Q))},[n,y,N,S,x]),U=w.useCallback(async(se,V,Q)=>{for(;!Q.aborted;){const ae=n.eventsStreamStateRef.current;if(!ae||ae.sessionId!==se||ae.generation!==V)return;ae.ready=!1;try{const ue={Accept:"text/event-stream"},he=n.lastEventIdRef.current;he&&(ue["Last-Event-ID"]=he);const Ne=await fetch(sj(t,se),{headers:ue,credentials:"include",signal:Q});if(!Ne.ok||!Ne.body){if(Ne.status===404)return;await Kf(2e3,Q);continue}const He=Ne.body.getReader(),We=new TextDecoder;let rt="",Ye=!0;const gt=ri("a");for(;;){const{done:st,value:kt}=await He.read();if(st)break;rt+=We.decode(kt,{stream:!0});const $t=rt.split(`
403
+
404
+ `);rt=$t.pop()??"";for(const Ut of $t){if(yj(Ut)==="stream_ready"){const Ue=n.eventsStreamStateRef.current;Ue?.sessionId===se&&Ue.generation===V&&(Ue.ready=!0),Ye=!1;continue}const ze=n.assistantIdRef.current??gt,Qe=g(Ut,ze,{replay:Ye,targetSessionId:se,generation:V});Qe&&(n.lastEventIdRef.current=Qe)}}const Rt=n.eventsStreamStateRef.current;Rt?.sessionId===se&&Rt.generation===V&&(Rt.ready=!1),await Kf(1e3,Q)}catch{if(Q.aborted)return;await Kf(2e3,Q)}}},[t,n,g]),$=w.useCallback((se,V)=>{const Q=n.eventsStreamStateRef.current;if(Q?.sessionId===se&&Q.generation===V&&n.reconnectAbortRef.current)return;n.reconnectAbortRef.current?.abort();const ae=new AbortController;n.reconnectAbortRef.current=ae,n.eventsStreamStateRef.current={sessionId:se,generation:V,ready:!1},U(se,V,ae.signal)},[n,U]),q=w.useCallback(async(se,V)=>{$(se,V);const Q=Date.now()+5e3;for(;Date.now()<Q;){const ae=n.eventsStreamStateRef.current;if(ae?.sessionId===se&&ae.generation===V&&ae.ready)return;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)throw new Error("会话已切换");await xj()}throw new Error("事件连接未就绪,请检查 Console 连接后重试")},[n,$]),W=w.useCallback(async se=>{try{const V=await fetch(y3(t,se),{credentials:"include"}),Q=await V.json().catch(()=>({}));return V.ok?Q.state??null:null}catch{return null}},[t]),oe=w.useCallback(async se=>{try{const V=await fetch(ij(t,se.sessionId),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,text:se.text.trim()||"请查看附件图片。",images:se.images.map(({type:ae,mimeType:ue,data:he})=>({type:ae,mimeType:ue,data:he}))})}),Q=await V.json().catch(()=>({}));return{httpOk:V.ok,status:V.status,body:Q}}catch{return{httpOk:!1,status:0,body:{},networkError:!0}}},[t]),J=w.useCallback(()=>({showNotice:A,setError:se=>c(se)}),[A,c]),H=w.useCallback(async(se,V,Q)=>{n.stoppingTurnIdRef.current=Q,n.streamingRef.current=!1,y(!1),N("stopping"),S(null);try{const ae=await fetch(oj(t,se,Q),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:"{}"}),ue=await ae.json().catch(()=>({}));if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V||n.stoppingTurnIdRef.current!==Q)return;const he=k3({httpOk:ae.ok,turnId:Q,body:ue}),Ne=Ea(n);if(Ne.stoppingTurnId=Q,he.action==="owner-lost-reconcile"){const He=await W(se),We=n.sessionRef.current?.sessionId===se&&n.sessionGenerationRef.current===V;Tm(Ne,he,J(),{sessionStillCurrent:We,runtimeBusy:Wl(He??void 0),markIdle:()=>Z(se,V,n.assistantIdRef.current)}),Ta(n,Ne),N(fo(Ne));return}Tm(Ne,he,J(),{sessionStillCurrent:!0,markIdle:()=>Z(se,V,n.assistantIdRef.current)}),Ta(n,Ne),N(fo(Ne)),Ne.streaming&&y(!0)}catch{const ae=Ea(n);Tm(ae,k3({httpOk:!1,turnId:Q,body:{},networkError:!0}),J()),Ta(n,ae),n.streamingRef.current=!0,y(!0),N("stopping")}},[t,n,y,N,Z,W,J]),I=w.useCallback((se,V)=>{const Q=Ea(n);Q.sessionId=n.sessionRef.current?.sessionId??null,Q.sessionGeneration=n.sessionGenerationRef.current,Q.submitGeneration=n.submitGenerationRef.current;const ae=ue=>{P(ue)};hj(Q,se,{assistantId:V.assistantId,text:V.text,images:V.images,pending:V.pending,sessionId:V.sessionId,notice:J(),acceptedUi:{setStreaming:y,setStreamingAssistantId:S,setPendingImages:ae,watchSessionTitle:p},adoptUi:{clearEmptyAssistant:ue=>Cm(x,ue),setInput:_,setPendingImages:ae,setStreaming:y,setStreamingAssistantId:S},rejectedUi:{setError:c,setStreaming:y,setStreamingAssistantId:S,clearEmptyAssistant:ue=>Cm(x,ue),setInput:_,setPendingImages:ae,formatError:ai},onAutoAbort:ue=>{H(V.sessionId,V.generation,ue)}}),Ta(n,Q),N(fo(Q))},[n,J,y,N,S,P,p,x,_,c,H]),K=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||!se.text.trim()&&se.images.length===0)return{action:"handled"};A("正在排队…");const Q=(he,Ne)=>{R(Ne?.[0]??he),M(Ne??[he]),_(""),P([]),c(null),A("已排队,将在当前回合结束后自动发送")},ae=()=>{R(null),M([]),_(""),P([]),c(null),A("消息已进入发送")},ue=async()=>{const he=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,text:se.text,images:se.images})}),Ne=await he.json().catch(()=>({}));return{response:he,body:Ne}};try{for(let he=0;he<2;he+=1){const{response:Ne,body:He}=await ue();if(Ne.ok&&He.accepted&&He.deferredTurn)return Q(He.deferredTurn,He.deferredTurns),{action:"handled"};if(He.deferredTurns&&M(He.deferredTurns),He.deferredTurn&&R(He.deferredTurn),He.error?.code!=="TURN_NOT_ACTIVE")return c(He.error?.message??`待发送消息未被服务端接受(HTTP ${Ne.status})`),{action:"handled"};const We=await W(V.sessionId),rt=g3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:We??void 0});if(rt.action==="deferred")return Q(rt.deferredTurn,We?.deferredTurns),{action:"handled"};if(rt.action==="accepted")return ae(),{action:"handled"};if(!(rt.action==="retry-deferred"&&he===0))return rt.action==="send-now"?(A("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(He.error?.message??"停止状态已变化,当前消息仍保留在输入框"),{action:"handled"})}return{action:"handled"}}catch(he){const Ne=await W(V.sessionId),He=g3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:Ne??void 0});return He.action==="deferred"?(Q(He.deferredTurn,Ne?.deferredTurns),{action:"handled"}):He.action==="accepted"?(ae(),{action:"handled"}):He.action==="send-now"?(A("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(he instanceof Error?`无法确认消息是否已排队:${he.message}`:"无法确认消息是否已排队,请刷新后查看服务端状态"),{action:"handled"})}},[t,n,s.deferredTurn,R,M,_,P,c,A,W]),X=w.useCallback(async(se,V)=>{const Q=n.sessionRef.current,ae=V?s.deferredTurns.find(ue=>ue.clientRequestId===V.clientRequestId):s.deferredTurns[0]??s.deferredTurn;if(!(!Q||!ae))try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Q.sessionId)}/deferred-turn`,{method:"DELETE",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:ae.clientRequestId,expectedRevision:ae.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok||!he.cancelled){c(he.error?.message??"待发送消息撤回失败");return}const Ne=s.deferredTurns.filter(He=>He.clientRequestId!==ae.clientRequestId);M(Ne),R(Ne[0]??null),se==="restore"?(_(ae.text??he.deferredTurn?.text??""),P(ae.images??he.deferredTurn?.images??[]),A("待发送消息已移回输入框")):A("已删除排队消息"),c(null)}catch(ue){c(ue instanceof Error?ue.message:String(ue))}},[t,n,s.deferredTurn,s.deferredTurns,R,M,_,P,c,A]),be=w.useCallback(()=>X("restore"),[X]),j=w.useCallback(se=>X("discard",se),[X]),G=w.useCallback(async(se,V)=>{const Q=n.sessionRef.current;if(!Q)return;const ae=s.deferredTurns.find(ue=>ue.clientRequestId===se.clientRequestId);if(ae)try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Q.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:ae.blockedByTurnId,text:V,images:ae.images??[],expectedRevision:se.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(he.error?.message??"编辑排队消息失败");he.deferredTurns&&M(he.deferredTurns),he.deferredTurn&&R(he.deferredTurn),c(null)}catch(ue){c(ue instanceof Error?ue.message:"编辑排队消息失败")}},[t,n,s.deferredTurns,R,M,c]),Y=w.useCallback(async se=>{const V=n.sessionRef.current;if(V)try{const Q=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn/${encodeURIComponent(se.clientRequestId)}/steer`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({expectedRevision:se.revision})}),ae=await Q.json().catch(()=>({}));if(!Q.ok)throw new Error(ae.error?.message??"插话发送失败");const ue=ae.deferredTurns??s.deferredTurns.filter(he=>he.clientRequestId!==se.clientRequestId);M(ue),R(ue[0]??null),c(null)}catch(Q){c(Q instanceof Error?Q.message:"插话发送失败")}},[t,n,s.deferredTurns,R,M,c]),D=w.useCallback(async(se,V)=>{const Q=n.sessionRef.current;if(!Q||!se.trim()&&V.length===0)return;const ae=Ea(n),ue=ej({turnPhase:fo(ae),blockedByTurnId:ae.stoppingTurnId??ae.activeTurnId}),he=ri("chat-submit");if(ue.action==="hold"){const Qe=fo(ae);Qe==="stopping"?A("正在确认上一轮停止状态,当前消息已保留"):Qe==="running"&&A("正在确认当前回合状态,当前消息已保留");return}if(F?.(se),ue.action==="queue-deferred"&&(await K({text:se,images:V,clientRequestId:he,blockedByTurnId:ue.blockedByTurnId})).action!=="send-now")return;const Ne=n.sessionRef.current,He=n.sessionGenerationRef.current;if(!Ne||Ne.sessionId!==Q.sessionId||!se.trim()&&V.length===0||n.streamingRef.current||n.submitInFlightRef.current||n.pendingSubmissionRef.current)return;n.submitInFlightRef.current=!0;const We=++n.submitGenerationRef.current,rt=ri("u"),Ye=ri("a"),gt=se.trim(),Rt=V.slice(),st=tj({clientRequestId:he,submitGeneration:We,sessionId:Ne.sessionId,sessionGeneration:He,text:gt,images:Rt,assistantId:Ye,userMessageId:rt});n.pendingSubmissionRef.current=st;try{await q(Ne.sessionId,He)}catch(Qe){n.sessionRef.current?.sessionId===Ne.sessionId&&n.sessionGenerationRef.current===He&&c(ai(Qe instanceof Error?Qe.message:String(Qe))),L(he);return}if(n.sessionRef.current?.sessionId!==Ne.sessionId||n.sessionGenerationRef.current!==He){L(he);return}const kt={id:rt,role:"user",text:gt,createdAt:Date.now()};x(Qe=>[...Qe,kt,{id:Ye,role:"assistant",text:"",createdAt:Date.now()}]),_(""),d(!0),c(null),n.streamingRef.current=!0,N("running"),n.assistantIdRef.current=Ye,y(!0),S(Ye);const $t={sessionId:Ne.sessionId,generation:He,submitGeneration:We,assistantId:Ye,text:gt,images:Rt,pending:st},Ut=await oe({sessionId:Ne.sessionId,clientRequestId:he,text:gt,images:Rt});if(!od({pending:st,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){st.resolveOutcome({kind:"stale"}),L(he);return}let ze=Ut.networkError?b3():v3({httpOk:Ut.httpOk,status:Ut.status,body:Ut.body,clientRequestId:he});if(ze.kind==="ambiguous"){const Qe=await W(Ne.sessionId),Ue=Qe?rj({clientRequestId:he,state:Qe}):null;if(Ue)ze=Ue;else{const ot=await oe({sessionId:Ne.sessionId,clientRequestId:he,text:gt,images:Rt});if(!od({pending:st,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){st.resolveOutcome({kind:"stale"}),L(he);return}if(ze=ot.networkError?b3("无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"):v3({httpOk:ot.httpOk,status:ot.status,body:ot.body,clientRequestId:he}),ze.kind==="ambiguous"){const fe=ze.message||"无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)";ze=nj(fe),A(fe)}}}I(ze,$t)},[t,n,q,oe,W,I,L,A,x,_,d,c,y,N,S,K,F]),ye=w.useCallback(async()=>{const se=n.sessionRef.current?.sessionId,V=n.sessionGenerationRef.current;if(!se)return;const Q=Ea(n),ae=S3(Q,{postAbort:()=>{},notice:J()});if(Ta(n,Q),N("stopping"),ae.abortedTurnId){if(n.stopInFlightRef.current)return;n.stopInFlightRef.current=!0;try{await H(se,V,ae.abortedTurnId)}finally{n.stopInFlightRef.current=!1}return}const ue=n.pendingSubmissionRef.current;if(ue&&!n.stopInFlightRef.current){n.stopInFlightRef.current=!0;try{const he=await ue.outcomePromise;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)return;let Ne=null;if(he.kind==="accepted")Ne=he.turnId;else if(he.kind==="adopt-active")Ne=he.activeTurn.turnId;else{if(he.kind==="ambiguous")return;n.stopRequestedRef.current=!1;return}if(!Ne)return;const He=Ea(n);Z7(He);const We=S3(He,{postAbort:()=>{},notice:J()});Ta(n,He),We.abortedTurnId&&await H(se,V,We.abortedTurnId)}finally{n.stopInFlightRef.current=!1}}},[n,J,H]);return w.useEffect(()=>{const se=!!n.pendingSubmissionRef.current||n.submitInFlightRef.current||n.stopRequestedRef.current||!!n.activeTurnIdRef.current;if(!a||!T&&!se)return;const V=a.sessionId,Q=n.sessionGenerationRef.current;let ae=!1;const ue=async()=>{try{const We=await fetch(y3(t,V),{credentials:"include"}),rt=await We.json().catch(()=>({}));if(ae||!We.ok||n.sessionRef.current?.sessionId!==V||n.sessionGenerationRef.current!==Q)return;const Ye=rt.state,gt=n.pendingSubmissionRef.current;if(gt){const ze=aj({clientRequestId:gt.clientRequestId,state:Ye}),Qe=Ea(n),Ue=mj(Qe,ze,Ye,{markIdle:()=>Z(V,Q,n.assistantIdRef.current),onAutoAbort:ot=>{H(V,Q,ot)}});if(Ta(n,Qe),N(fo(Qe)),Ye&&"deferredTurn"in Ye&&R(Ye.deferredTurn??null),Ue==="bound"){y(!0);return}if(Ue==="released"||!gt.acceptedTurnId&&!Qe.pendingSubmission?.acceptedTurnId)return}const Rt=Ye?.activeTurn?.turnId??Ye?.activeTurnId??null;n.activeTurnIdRef.current=Rt;const st=Wl(Ye),kt=n.pendingSubmissionRef.current;if(kt){const ze=Ye?.latestTurn?.clientRequestId===kt.clientRequestId&&ks(Ye?.latestTurn?.state),Qe=Ye?.activeTurn?.clientRequestId===kt.clientRequestId&&ks(Ye?.activeTurn?.state);if(ze||Qe){const Ue=Qe?Ye?.activeTurn?.turnId??null:Ye?.latestTurn?.turnId??kt.acceptedTurnId??null,ot=Ea(n);x3(ot,{clientRequestId:kt.clientRequestId,turnId:Ue,markIdle:!st}),Ta(n,ot),st||Z(V,Q,n.assistantIdRef.current);return}}if(st)return;const $t=n.assistantIdRef.current;if(Rt&&!(ks(Ye?.activeTurn?.state)||ks(Ye?.activeTurnState)))return;Rt&&n.settledTurnIdsRef.current.add(Rt);const Ut=kt?.clientRequestId;if(Ut){const ze=Ea(n);x3(ze,{clientRequestId:Ut,turnId:Rt,markIdle:!0}),Ta(n,ze)}else L();Z(V,Q,$t)}catch{}},he=()=>{document.visibilityState==="visible"&&ue()},Ne=()=>{ue()},He=window.setInterval(()=>{ue()},15e3);return document.addEventListener("visibilitychange",he),window.addEventListener("online",Ne),ue(),()=>{ae=!0,window.clearInterval(He),document.removeEventListener("visibilitychange",he),window.removeEventListener("online",Ne)}},[t,n,a,T,N,Z,L,H]),w.useEffect(()=>{if(!a)return;const se=n.sessionGenerationRef.current;return $(a.sessionId,se),()=>{const V=n.eventsStreamStateRef.current;V?.sessionId===a.sessionId&&V.generation===se&&(n.reconnectAbortRef.current?.abort(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null)}},[a,m,n,$]),{sendPrompt:D,handleStop:ye,cancelDeferredTurn:be,discardDeferredTurn:j,editDeferredTurn:G,steerDeferredTurn:Y,openEventsStream:U}}function kj(e){const{origin:t,refs:n,thread:a,setError:s}=e,{interview:o,setInterview:c}=a,[d,h]=w.useState(""),m=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x)return;const y=window.prompt("Task ID(例如 2026-07-26-my-task)")?.trim();if(!y)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskId:y})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c({interviewSessionId:T.interview?.sessionId,taskId:y,state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment})},[t,n,c,s]),p=w.useCallback(async x=>{const y=n.sessionRef.current;if(!y||!o?.interviewSessionId||!o.question)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${y.sessionId}/interviews/${o.interviewSessionId}/answers`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({questionId:o.question.id,response:x,...x==="override"?{text:d}:{}})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c(N=>({...N??{},state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment,taskKindRecommendation:T.taskKindRecommendation??N?.taskKindRecommendation})),h("")},[t,n,o,d,c,s]),g=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x||!o?.interviewSessionId||!o.taskKindRecommendation)return;const y=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews/${o.interviewSessionId}/task-kind/confirm`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskKind:o.taskKindRecommendation})}),S=await y.json();if(!y.ok){s(S.error?.message??`HTTP ${y.status}`);return}c(T=>({...T??{},confirmedTaskKind:T?.taskKindRecommendation,taskKindRecommendation:void 0,draft:S.draft?.draft,draftSha256:S.draft?.draftSha256,assessment:S.assessment}))},[t,n,o,c,s]);return{interviewAnswer:d,setInterviewAnswer:h,startInterview:m,answerInterview:p,confirmTaskKind:g}}function Sj(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,blocked:o,setError:c}=e,[d,h]=w.useState({}),[m,p]=w.useState(new Set),[g,x]=w.useState(null),[y,S]=w.useState([]),[T,N]=w.useState(null),[R,M]=w.useState(!1),_=w.useRef(s??null);_.current=s??null;const P=w.useRef(new Set),F=w.useRef(new Set);F.current=m;const A=s?`&workspaceId=${encodeURIComponent(s)}`:"",L=w.useCallback(async(J="")=>{if(o)return;const H=s??null;try{x(null);const I=await fetch(`${t}/api/operator/v1/chat/repo/tree?path=${encodeURIComponent(J)}${A}`,{credentials:"include"}),K=await I.json();if(_.current!==H)return;if(!I.ok)throw new Error(K.error?.message??"无法读取仓库目录");h(X=>({...X,[J]:K.data?.entries??[]}))}catch(I){if(_.current!==H)return;x(I instanceof Error?I.message:String(I))}},[t,A,s,o]);w.useEffect(()=>{L()},[L]);const[Z,U]=w.useState(0),$=w.useCallback(()=>{U(J=>J+1)},[]);w.useEffect(()=>{const J=["",...F.current];for(const H of J)L(H)},[L,Z]),w.useEffect(()=>{const J=()=>{document.hidden||$()};return document.addEventListener("visibilitychange",J),()=>document.removeEventListener("visibilitychange",J)},[$]);const q=w.useCallback(async J=>{if(o)return;const H=s??null;M(!0);try{const I=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(J)}${A}`,{credentials:"include"}),K=await I.json();if(_.current!==H)return;if(!I.ok||!K.data)throw new Error(K.error?.message??"无法预览文件");S(X=>{const be=[...X.filter(G=>G.path!==K.data.path),K.data],j=n.sessionRef.current?.sessionId;return j&&window.localStorage.setItem(`${ma}.previews.${j}`,JSON.stringify(be.map(G=>G.path))),be}),N(K.data.path)}catch(I){if(_.current!==H)return;c(I instanceof Error?I.message:String(I))}finally{_.current===H&&M(!1)}},[t,A,s,n,c,o]);w.useEffect(()=>{h({}),p(new Set),x(null),S([]),N(null),M(!1)},[s]),w.useEffect(()=>{if(o||T||y.length>0)return;const J=s??"__default__";if(P.current.has(J))return;const H=(d[""]??[]).filter(K=>K.kind==="file");if(H.length===0)return;const I=H.find(K=>/^readme(?:\.[^.]+)?$/i.test(K.name))??H[0];P.current.add(J),q(I.path)},[T,o,q,y.length,d,s]),w.useEffect(()=>{if(!a)return;let J=[];try{const H=JSON.parse(window.localStorage.getItem(`${ma}.previews.${a}`)??"[]");Array.isArray(H)&&(J=H.filter(I=>typeof I=="string").slice(0,10))}catch{}J.length&&Promise.all(J.map(async H=>{const I=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(H)}${A}`,{credentials:"include"});if(I.ok)return(await I.json()).data})).then(H=>{if(n.sessionRef.current?.sessionId!==a)return;const I=H.filter(K=>!!K);S(I),N(I.at(-1)?.path??null)})},[t,A,a,n]);const W=w.useCallback(J=>{p(H=>{const I=new Set(H);return I.has(J)?I.delete(J):I.add(J),I}),d[J]||L(J)},[d,L]),oe=w.useCallback(J=>{S(H=>{const I=H.filter(K=>K.path!==J);return a&&window.localStorage.setItem(`${ma}.previews.${a}`,JSON.stringify(I.map(K=>K.path))),I}),N(H=>H===J?y.find(I=>I.path!==J)?.path??null:H)},[y,a]);return{tree:d,expandedDirs:m,treeError:g,previews:y,activePreviewPath:T,setActivePreviewPath:N,previewLoading:R,setPreviews:S,loadTree:L,refreshTree:$,openPreview:q,closePreview:oe,toggleDir:W}}const Nm={status:"ok"};function Rm(e){return e.status!=="ok"}const Ej=["operator","web","extension","prompt","skill"];function Tj(e){const t=[];for(const n of Ej){const a=[];for(let s=0;s<e.length;s+=1)e[s].source===n&&a.push({entry:e[s],globalIndex:s});a.length!==0&&t.push({source:n,label:eO[n],items:a})}return t}function Cj(e,t){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<0?0:e>=t?t-1:e}function Nj(e){return e==="comfortable"?3:e==="compact"?2:1}function E3(e,t,n,a){const s=t.findIndex(g=>g.items.some(x=>x.globalIndex===e));if(s<0)return e;const o=t[s],c=o.items.findIndex(g=>g.globalIndex===e);if(c<0)return e;const d=Math.floor(c/n),h=c%n;if(a==="left"||a==="right"){if(n<=1)return e;const x=c+(a==="left"?-1:1);return x<0||x>=o.items.length||Math.floor(x/n)!==d?e:o.items[x].globalIndex}const m=a==="up"?-1:1,p=c+m*n;if(p>=0&&p<o.items.length)return o.items[p].globalIndex;for(let g=s+m;g>=0&&g<t.length;g+=m){const x=t[g];if(x.items.length===0)continue;const y=Math.floor((x.items.length-1)/n)*n,S=a==="up"?y+h:h;return S>=x.items.length?e:x.items[S].globalIndex}return e}function Rj(e,t,n){const a=(e.left+e.right)/2;let s=null;for(const o of t){if(o.globalIndex===e.globalIndex)continue;const c=n==="up"?e.top-o.bottom:o.top-e.bottom;if(c<0)continue;const d=(o.left+o.right)/2,h=Math.abs(d-a);(s===null||c<s.gap||c===s.gap&&h<s.dist||c===s.gap&&h===s.dist&&o.globalIndex<s.index)&&(s={gap:c,dist:h,index:o.globalIndex})}return s?.index??null}function Aj(){return{entries:[],index:-1,draft:""}}function Ij(e,t){return t.trim()?e.entries[e.entries.length-1]===t?e.index===-1?e:{...e,index:-1,draft:""}:{entries:[...e.entries,t].slice(-100),index:-1,draft:""}:e}function _j(e){return e.index===-1?e:{...e,index:-1}}function Mj(e,t,n){const{text:a,caretStart:s,caretEnd:o}=n;if(e.entries.length===0)return{handled:!1};if(t==="up"){if(a.slice(0,s).includes(`
405
+ `))return{handled:!1};if(e.index===-1){const h=e.entries.length-1;return{handled:!0,state:{...e,index:h,draft:a},text:e.entries[h]}}if(e.index===0)return{handled:!0,state:e,text:e.entries[0]};const d=e.index-1;return{handled:!0,state:{...e,index:d},text:e.entries[d]}}if(e.index===-1)return{handled:!1};if(a.slice(o).includes(`
406
+ `))return{handled:!1};if(e.index>=e.entries.length-1)return{handled:!0,state:{...e,index:-1},text:e.draft};const c=e.index+1;return{handled:!0,state:{...e,index:c},text:e.entries[c]}}function Oj(e){const{origin:t,sessionId:n,refs:a,setError:s}=e,[o,c]=w.useState(""),[d,h]=w.useState([]),[m,p]=w.useState([]),[g,x]=w.useState(!1),y=w.useCallback(V=>{if(typeof V=="function"){c(Q=>{const ae=V(Q);return x(ae.startsWith("/")),ae});return}c(V),x(V.startsWith("/"))},[]),[S,T]=w.useState(0),[N,R]=w.useState([]),[M,_]=w.useState(!1),[P,F]=w.useState(null),[A,L]=w.useState(0),Z=w.useRef(null),U=w.useRef(Aj()),$=w.useRef(n),q=w.useRef(0),W=w.useCallback(V=>{y(V),x(V.startsWith("/")),T(0),U.current=_j(U.current)},[]),oe=w.useCallback(V=>{const Q=Z.current,ae=Mj(U.current,V,{text:o,caretStart:Q?.selectionStart??o.length,caretEnd:Q?.selectionEnd??o.length});if(!ae.handled)return!1;U.current=ae.state,y(ae.text);const ue=ae.text.length;return queueMicrotask(()=>{const he=Z.current;he&&he.value===ae.text&&he.setSelectionRange(ue,ue)}),!0},[o,y]),J=w.useCallback(V=>{U.current=Ij(U.current,V)},[]);w.useLayoutEffect(()=>{$.current=n,q.current+=1,R([]),F(null),_(!1)},[n]);const H=w.useCallback(async()=>{if(!n){R([]),F(null),_(!1);return}const V=n,Q=q.current;$.current=V,_(!0),F(null);const ae=()=>$.current===V&&q.current===Q;try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/commands`,{credentials:"include"});if(!ae())return;if(!ue.ok){F("动态命令加载失败"),R([]);return}const he=await ue.json().catch(()=>null),Ne=[];for(const We of he?.commands??[]){const rt=We.source;if(rt!=="extension"&&rt!=="prompt"&&rt!=="skill")continue;const Ye=String(We.command??We.name??"").trim();Ye&&Ne.push({command:Ye.startsWith("/")?Ye:`/${Ye}`,label:String(We.label??We.name??Ye),description:String(We.description??""),source:rt})}if(!ae())return;R(Ne);const He=typeof he?.warning=="string"?he.warning.trim():"";F(He?He.slice(0,160):null)}catch{if(!ae())return;F("动态命令加载失败"),R([])}finally{ae()&&_(!1)}},[t,n]);w.useEffect(()=>{n&&(!g&&A===0||H())},[n,g,A,H]);const I=w.useCallback(()=>{L(V=>V+1),H()},[H]);w.useEffect(()=>{if(!n)return;const V=o.slice(0,Z.current?.selectionStart??o.length).match(/(?:^|\s)@([^\s@]*)$/);if(!V){h([]);return}const Q=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/files?q=${encodeURIComponent(V[1]??"")}`).then(ae=>ae.ok?ae.json():null).then(ae=>h((ae?.files??[]).map(ue=>ue.path)))},150);return()=>window.clearTimeout(Q)},[t,n,o]);const K=w.useCallback(V=>{const Q=Z.current?.selectionStart??o.length,ue=o.slice(0,Q).search(/@[^\s@]*$/);ue<0||(y(`${o.slice(0,ue)}@${V} ${o.slice(Q)}`),h([]))},[o]),X=w.useCallback(V=>{for(const Q of Array.from(V).slice(0,4)){if(!Q.type.startsWith("image/")||Q.size>5*1024*1024){s("图片仅支持 PNG/JPEG/GIF/WebP,单张不超过 5 MiB");continue}const ae=new FileReader;ae.onload=()=>{const ue=String(ae.result??""),he=ue.slice(ue.indexOf(",")+1);p(Ne=>[...Ne,{name:Q.name,type:"image",mimeType:Q.type,data:he}].slice(0,4))},ae.readAsDataURL(Q)}},[s]),be=w.useCallback(V=>{p(Q=>Q.filter(ae=>ae!==V))},[]);w.useLayoutEffect(()=>{const V=Z.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,280)}px`)},[o]),w.useEffect(()=>{if(!n)return;const V=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/draft`,{method:"PUT",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify({text:o})})},400);return()=>window.clearTimeout(V)},[t,n,o]);const j=w.useMemo(()=>QM(N),[N]),G=w.useMemo(()=>o.startsWith("/")?JM(j,o):[],[o,j]);w.useEffect(()=>{T(V=>Cj(V,G.length))},[G.length]);const Y=w.useCallback(()=>{a.isComposingRef.current=!0},[a]),D=w.useCallback(()=>{a.isComposingRef.current=!1,a.compositionEndedAtRef.current=Date.now()},[a]),ye=w.useCallback(()=>a.isComposingRef.current,[a]),se=w.useCallback(()=>Date.now()-a.compositionEndedAtRef.current<100,[a]);return w.useEffect(()=>{bk({origin:t,sessionId:n,refs:a})},[t,n,a]),{input:o,setInput:y,handleInputChange:W,navigateHistory:oe,recordHistory:J,fileOptions:d,pendingImages:m,setPendingImages:p,addImagesFromFiles:X,removeImage:be,shortcutOpen:g,setShortcutOpen:x,shortcutIndex:S,setShortcutIndex:T,filteredShortcuts:G,dynamicCommandsLoading:M,dynamicCommandsError:P,retryDynamicCommands:I,insertFileReference:K,textareaRef:Z,onCompositionStart:Y,onCompositionEnd:D,isComposingNow:ye,recentlyComposedNow:se}}const Dj=[{toolId:"read",kind:"explore",description:"Pi 内置读取文件。"},{toolId:"write",kind:"explore",description:"Pi 内置写入文件(软约束:大改优先走 DAG)。"},{toolId:"edit",kind:"explore",description:"Pi 内置编辑文件(软约束:大改优先走 DAG)。"},{toolId:"bash",kind:"explore",description:"Pi 内置 shell 执行(软约束:优先受治路径)。"},{toolId:"grep",kind:"explore",description:"Pi 内置内容搜索。"},{toolId:"find",kind:"explore",description:"按名称查找文件路径。"},{toolId:"ls",kind:"explore",description:"列出目录内容。"},{toolId:"safe-read",kind:"explore",description:"安全读取仓库相对路径文件;拒绝敏感文件并自动脱敏 secret。"},{toolId:"safe-grep",kind:"explore",description:"安全搜索仓库内容;跳过敏感文件并自动脱敏搜索结果。"},{toolId:"git-status",kind:"explore",description:"固定参数执行 git status --porcelain(无 shell)。"},{toolId:"git-diff",kind:"explore",description:"固定参数查看 git diff;敏感路径不可查看且结果自动脱敏。"}];function jj(e){if(!e)return null;const t=(e.tools??[]).map(a=>({toolId:a.toolId,action:a.action,description:a.description,kind:a.kind??"read",cli:a.cli})),n=[...Dj];return{explore:n,operator:t,total:n.length+t.length}}let Lj=0;function zj(e){const{origin:t,session:n,setSession:a,refs:s,setError:o}=e,[c,d]=w.useState(null),[h,m]=w.useState([]),[p,g]=w.useState("idle"),[x,y]=w.useState(null),[S,T]=w.useState([]),[N,R]=w.useState(null),[M,_]=w.useState(null),[P,F]=w.useState(!1),[A,L]=w.useState(!1),[Z,U]=w.useState(!1),$=w.useRef(null),q=w.useRef(null),W=w.useRef(0);w.useEffect(()=>{W.current=-1,F(!1)},[n?.sessionId,F]);const J=Ql().snapshot,H=w.useCallback(async()=>{try{const V=await fetch(`${t}/api/operator/v1/chat/capabilities`);if(!V.ok)return;const Q=await V.json();d(Q)}catch{}},[t]);w.useEffect(()=>{H()},[H]);const I=w.useCallback(async()=>{if(!n){m([]),g("idle");return}const V=n.sessionId;g("loading"),y(null);try{const Q=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/models`,{credentials:"include"}),ae=await Q.json().catch(()=>null);if(s.sessionRef.current?.sessionId!==V)return;if(!Q.ok||!ae){g("error"),y(ae?.error?.message??`模型列表读取失败(HTTP ${Q.status})`);return}m(ae.models??[]),T(ae.thinkingLevels??[]),g("ready")}catch(Q){if(s.sessionRef.current?.sessionId!==V)return;g("error"),y(Q instanceof Error?Q.message:String(Q))}},[t,n,s]);w.useEffect(()=>{I()},[I]),w.useEffect(()=>{if(!n){R(null),_(null);return}const V=n.sessionId,Q=`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}`;_(null),fetch(`${Q}/runtime-context`,{credentials:"include"}).then(async ae=>{const ue=await ae.json().catch(()=>null);if(!ue?.context||s.sessionRef.current?.sessionId!==V)return;const he=ue.context,Ne=xk().snapshot;R(He=>hk(He,he,Ne,V))}).catch(()=>{s.sessionRef.current?.sessionId===V&&_("注入上下文读取失败,请重试")})},[t,n?.sessionId,s]),w.useEffect(()=>{if(!J||!n||J.sessionId!==n.sessionId)return;const V=r5(J);a(Q=>{if(!Q||Q.sessionId!==J.sessionId||nD(Q,V))return Q;const ae=K7(Q,V);return s.sessionRef.current=ae,ae}),R(Q=>{if(!Q)return Q;const ae={...Q,...V.model?{model:V.model}:{},...V.thinkingLevel?{thinkingLevel:V.thinkingLevel}:{}};return ae.model?.provider===Q.model?.provider&&ae.model?.modelId===Q.model?.modelId&&ae.thinkingLevel===Q.thinkingLevel?Q:ae})},[J,n?.sessionId,s,a,R]);const K=w.useCallback(async V=>{if(!n)return!1;const Q=n.sessionId,ae=++Lj;W.current=ae,s5({type:"mutation-start",token:ae}),F(!0);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n.sessionId)}/model`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)}),he=await ue.json().catch(()=>({}));return W.current!==ae?!1:ue.ok?!he.session||s.sessionRef.current?.sessionId!==Q?!1:vk(ae,Q,he.snapshot):(s.sessionRef.current?.sessionId===Q&&(o(he.error?.message??`模型或思考等级切换失败(HTTP ${ue.status})`),Hm()),!1)}catch(ue){return W.current!==ae||s.sessionRef.current?.sessionId===Q&&o(ue instanceof Error?ue.message:String(ue)),!1}finally{yk(ae,Q,s)&&W.current===ae&&F(!1)}},[t,n,s,a,o]);w.useEffect(()=>{if(!A)return;const V=ae=>{const ue=$.current;ue&&ae.target instanceof Node&&!ue.contains(ae.target)&&L(!1)},Q=ae=>{ae.key==="Escape"&&L(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Q),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Q)}},[A]),w.useEffect(()=>{if(!Z)return;const V=ae=>{const ue=q.current;ue&&ae.target instanceof Node&&!ue.contains(ae.target)&&U(!1)},Q=ae=>{ae.key==="Escape"&&U(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Q),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Q)}},[Z]);const X=w.useMemo(()=>jj(c),[c]),be=J?(J.models??[]).map(V=>({provider:V.provider,id:V.id,...V.name?{name:V.name}:{},...V.hasCredentials!==void 0?{hasCredentials:V.hasCredentials}:{}})):h,j=J?.thinkingLevels?.length?J.thinkingLevels.map(V=>V.value):S,G=n?.model??N?.model,Y=G?Ns(G.provider,G.modelId):"",D=J?.selection?.thinkingSelection??n?.thinkingLevel??"",ye=J?.selection?.effectiveThinkingLevel??n?.thinkingLevel??void 0,se=!Y||be.some(V=>Ns(V.provider,V.id)===Y);return{capabilities:c,models:be,modelsStatus:p,modelsError:x,onRetryModels:()=>{I()},thinkingLevels:j,runtimeContext:N,runtimeContextError:M,onRetryRuntimeContext:()=>{_(null),Hm()},toolsOpen:A,setToolsOpen:L,runtimeContextOpen:Z,setRuntimeContextOpen:U,toolsMenuRef:$,runtimeContextMenuRef:q,switchRuntime:K,switching:P,toolCatalog:X,activeModel:G,activeModelRef:Y,activeThinkingLevel:D,effectiveThinkingLevel:ye,activeModelListed:se}}const T3={comfortableMin:1200,compactMin:720};function Bj(e){return!Number.isFinite(e)||e<0?"narrow":e>=T3.comfortableMin?"comfortable":e>=T3.compactMin?"compact":"narrow"}const qj={mode:"comfortable",width:1600,landingDensity:"comfortable",emptyHeight:720};function Hj(e,t){const[n,a]=w.useState(qj);return w.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const o=()=>{const p=s.getBoundingClientRect().width,g=t?.current??null,x=g?g.getBoundingClientRect().height:720;a({mode:Bj(p),width:p,landingDensity:_O(x),emptyHeight:x})};o();const c=new ResizeObserver(()=>o());c.observe(s);let d=null;const h=()=>{const p=t?.current??null;p&&p!==d&&(d&&c.unobserve(d),c.observe(p),d=p,o())};h();const m=window.setInterval(h,250);return()=>{window.clearInterval(m),c.disconnect()}},[e,t]),n}const C1="loop-console.operator-shell.active-workspace.v1";function Uj(e){try{return e?.getItem(C1)?.trim()||null}catch{return null}}function Du(e,t){try{e?t?.setItem(C1,e):t?.removeItem(C1)}catch{}}function Fj(e,t){return t?e.some(n=>n.workspaceId===t)?{status:"ok",workspaceId:t}:{status:"ok",workspaceId:e[0]?.workspaceId??null}:{status:"ok",workspaceId:e[0]?.workspaceId??null}}function $j(e,t,n){return e===409||t==="DUPLICATE"?n||"该目录(或等价路径)已存在为 Workspace:请直接选择既有条目,或更换其他真实目录。":e===400||t==="INVALID_PATH"?n||"目录不可用:请确认输入的是存在的真实目录绝对路径。":Kl(t)?Yl(t):n||`添加 Workspace 失败(HTTP ${e})`}function Pj(e={}){const t=e.origin??"",n=e.fetchFn??fetch,a=e.storage,s=e.confirmationTokenFn??qn,o=new Set;let c={workspaces:[],loading:!0,error:null,workspaceId:Uj(a),unknownWorkspaceId:null};const d=()=>{for(const S of o)S()},h=S=>{c={...c,...S},d()},m=async()=>{try{const S=await n(`${t}/api/operator/v1/workspaces`,{credentials:"include"});if(!S.ok)return;const N=(await S.json()).workspaces??[],R=Fj(N,c.workspaceId);if(R.status==="unknown-workspace"){h({workspaces:N,unknownWorkspaceId:R.workspaceId});return}const M=R.workspaceId,_=c.workspaceId;h({workspaces:N,unknownWorkspaceId:null,...M!==_?{workspaceId:M}:{}}),M!==_&&Du(M,a)}catch{}finally{c.loading&&h({loading:!1})}},p=async(S,T)=>{h({error:null});try{const N=await n(`${t}/api/operator/v1/workspaces`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":s()},body:JSON.stringify({directoryPath:S,...T?{name:T}:{}})}),R=await N.json().catch(()=>({}));if(!N.ok||!R.workspace){const M=$j(N.status,R.error?.code,R.error?.message);return h({error:M}),{ok:!1,error:M}}return await m(),h({workspaceId:R.workspace.workspaceId}),Du(R.workspace.workspaceId,a),{ok:!0,workspaceId:R.workspace.workspaceId}}catch(N){const M=`添加 Workspace 失败:${N instanceof Error?N.message:String(N)}`;return h({error:M}),{ok:!1,error:M}}},g=async()=>{h({error:null});try{const S=await n(`${t}/api/operator/v1/workspaces/pick`,{method:"POST",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),T=await S.json().catch(()=>({}));if(!S.ok){const N=Kl(T.error?.code)?Yl(T.error?.code??""):T.error?.message??`打开目录选择窗口失败(HTTP ${S.status})`;return h({error:N}),null}return typeof T.directoryPath=="string"&&T.directoryPath.trim()?T.directoryPath:null}catch(S){const T=S instanceof Error?S.message:String(S);return h({error:`打开目录选择窗口失败:${T}`}),null}},x=async S=>{h({error:null});try{const T=await n(`${t}/api/operator/v1/workspaces/${encodeURIComponent(S)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),N=await T.json().catch(()=>({}));if(!T.ok){const R=T.status===404?"Workspace 已不存在(可能已被移除),列表将刷新。":Kl(N.error?.code)?Yl(N.error?.code??""):N.error?.message??`移除 Workspace 失败(HTTP ${T.status})`;return h({error:R}),await m(),{ok:!1,error:R}}if(await m(),c.workspaceId===S){const R=c.workspaces[0]?.workspaceId??null;h({workspaceId:R}),Du(R,a)}return{ok:!0}}catch(T){const R=`移除 Workspace 失败:${T instanceof Error?T.message:String(T)}`;return h({error:R}),{ok:!1,error:R}}},y=S=>{S===c.workspaceId&&!c.unknownWorkspaceId||(h({workspaceId:S,unknownWorkspaceId:null}),Du(S,a))};return m(),{get workspaces(){return c.workspaces},get loading(){return c.loading},get error(){return c.error},get workspaceId(){return c.workspaceId},get unknownWorkspaceId(){return c.unknownWorkspaceId},refresh:m,pickWorkspaceDirectory:g,addWorkspace:p,removeWorkspace:x,selectWorkspace:y,subscribe(S){return o.add(S),()=>o.delete(S)}}}function Gj(e){const t=w.useRef(null);t.current||(t.current=Pj(e));const n=t.current,[a,s]=w.useState(()=>({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId}));return w.useEffect(()=>n.subscribe(()=>{s({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId})}),[n]),w.useMemo(()=>({get workspaces(){return a.workspaces},get loading(){return a.loading},get error(){return a.error},get workspaceId(){return a.workspaceId},get unknownWorkspaceId(){return a.unknownWorkspaceId},refresh:n.refresh,pickWorkspaceDirectory:n.pickWorkspaceDirectory,addWorkspace:n.addWorkspace,removeWorkspace:n.removeWorkspace,selectWorkspace:n.selectWorkspace}),[a,n])}function Vj(e="none"){return{active:e}}function ho(e,t){return{active:t}}function Nr(e={active:"none"}){return{active:"none"}}function Kj(e){return{sidebarDrawerOpen:e.active==="sidebar-drawer",processOpen:e.active==="process",runtimeContextOpen:e.active==="runtime-context",toolsOpen:e.active==="tools",activityOpen:e.active==="activity"}}const Yj=160,Wj=120,Zj=120;function Xj(e){return e?e.operationCards.length+e.humanGateCards.length+e.artifactCards.length:0}function Qj(e){const t=Xj(e),[n,a]=w.useState(()=>t>0?{phase:"visible",snapshot:e}:{phase:"hidden",snapshot:null}),s=w.useRef(n);s.current=n;const o=w.useMemo(()=>`${e?.sessionId??"none"}:${t}`,[e?.sessionId,t]);return w.useEffect(()=>{const c=[],d=s.current.snapshot;if(!e||t===0){if(!d){a({phase:"hidden",snapshot:null});return}a({phase:"leaving",snapshot:d}),c.push(window.setTimeout(()=>{a({phase:"hidden",snapshot:null})},Wj))}else d?d.sessionId!==e.sessionId?(a({phase:"switching",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},Zj))):a({phase:"visible",snapshot:e}):(a({phase:"entering",snapshot:e}),c.push(window.setTimeout(()=>{a({phase:"visible",snapshot:e})},Yj)));return()=>{for(const h of c)window.clearTimeout(h)}},[e,o,t]),n}const Jj=264,eL=420,Rl=280,X7=360,ys=160,Q7=480,tL=240,nL=120,C3="loop-agent:operator-chat:details-width:v1",Am="loop-agent:operator-chat:details-tree-width:v1";function Ca(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function ju(){return typeof window>"u"?X7:Math.max(Rl,window.innerWidth)}function El(e){return Math.min(Q7,Math.max(ys,Math.round(e-nL)))}function N3(e,t,n,a){if(typeof window>"u")return t;try{const s=Number(window.localStorage.getItem(e));return Number.isFinite(s)&&s>0?Ca(s,n,a):t}catch{return t}}function Im(e,t){try{window.localStorage.setItem(e,String(Math.round(t)))}catch{}}function Lu(e){const t=w.useRef(0),n=w.useRef(0),a=w.useRef(0),s=w.useRef(null),o=w.useRef(!1),c=w.useRef(null),d=w.useRef(e);d.current=e;const h=w.useCallback(()=>{s.current=null;const p=d.current,g=a.current-t.current,x=n.current+(p.side==="sidebar"?g:-g);return p.onResize(x),x},[]),m=w.useCallback((p,g,x)=>{if(!o.current)return;typeof x=="number"&&(a.current=x),o.current=!1,p&&g!==void 0&&p.hasPointerCapture(g)&&p.releasePointerCapture(g),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null);const y=h(),S=p??c.current;S&&delete S.dataset.dragging,d.current.onResizeEnd?.(y),d.current.onDragChange(!1)},[h]);return w.useEffect(()=>{const p=y=>{o.current&&(a.current=y.clientX,s.current??=requestAnimationFrame(h))},g=y=>m(void 0,void 0,y.clientX),x=()=>m();return window.addEventListener("pointermove",p),window.addEventListener("pointerup",g),window.addEventListener("pointercancel",x),()=>{if(window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",x),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),o.current){o.current=!1;const y=c.current;y&&delete y.dataset.dragging,d.current.onDragChange(!1)}}},[m,h]),u.jsx("div",{ref:c,className:"oc-column-resize-handle","data-side":e.side,role:"separator","aria-orientation":"vertical","aria-label":e.side==="sidebar"?"调整左侧栏宽度":e.side==="details-tree"?"调整文件树宽度":"调整右侧栏宽度",onPointerDown:p=>{p.preventDefault(),p.currentTarget.setPointerCapture(p.pointerId),p.currentTarget.dataset.dragging="true",o.current=!0,t.current=p.clientX,a.current=p.clientX,n.current=d.current.value,d.current.onDragChange(!0)},onPointerMove:p=>{p.currentTarget.hasPointerCapture(p.pointerId)&&(a.current=p.clientX,s.current??=requestAnimationFrame(h))},onPointerUp:p=>m(p.currentTarget,p.pointerId,p.clientX),onPointerCancel:p=>m(p.currentTarget,p.pointerId),onLostPointerCapture:p=>m(p.currentTarget)})}function rL(e){const{origin:t,surface:n="standalone"}=e,a=n==="workspace",s=TD(),[o,c]=w.useState(null),[d,h]=w.useState(!1),[m,p]=w.useState(null),[g,x]=w.useState(!0),[y,S]=w.useState(!1),[T,N]=w.useState("files"),[R,M]=w.useState(!1),[_,P]=w.useState(!1),[F,A]=w.useState(280),[L,Z]=w.useState(()=>N3(C3,X7,Rl,ju())),[U,$]=w.useState(()=>N3(Am,tL,ys,Q7)),[q,W]=w.useState(!1);w.useEffect(()=>{let ee=null;const Te=()=>{ee=null,Z(Jt=>Ca(Jt,Rl,ju()))},Dt=()=>{ee??=window.requestAnimationFrame(Te)};return window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt),ee!==null&&window.cancelAnimationFrame(ee)}},[]);const oe=w.useRef(!0),[J,H]=w.useState(!0),I=w.useCallback(ee=>{const Te=typeof ee=="function"?ee(oe.current):ee;oe.current=Te,H(Te)},[]),[K,X]=w.useState(()=>Vj()),[be,j]=w.useState(null),[G,Y]=w.useState(null),[D,ye]=w.useState(0),se=w.useRef(null),V=w.useRef(null),Q=w.useRef(null),ae=w.useRef(null),ue=w.useRef(null),he=w.useRef(null),Ne=w.useRef(null),He=w.useRef(null),We=w.useRef(null),rt=w.useRef(()=>{}),Ye=w.useRef(null),gt=w.useRef(!1),Rt=Hj(Q,ue),st=Rt.mode,kt=e.workspaceRegistry,[$t,Ut]=w.useState(null),ze=Kj(K),Qe=ze.processOpen,Ue=ze.runtimeContextOpen,ot=ze.activityOpen;w.useEffect(()=>{S(!1),N("files"),M(!1),P(!1),X(ee=>ee.active==="process"||ee.active==="runtime-context"?Nr(ee):ee)},[m?.sessionId,e.workspaceId]);const fe=w.useCallback(ee=>{X(Te=>{const Dt=Te.active==="process";return(typeof ee=="function"?ee(Dt):ee)?(N("calls"),P(!0),S(!0),ho(Te,"process")):(Dt&&(P(!1),N("files"),S(!1)),Te.active==="process"?Nr(Te):Te)})},[]),me=Oj({origin:t,sessionId:m?.sessionId,refs:s,setError:c}),$e=w.useMemo(()=>Tj(me.filteredShortcuts),[me.filteredShortcuts]),we=Sj({origin:t,refs:s,sessionId:m?.sessionId,workspaceId:m?.workspaceId??e.workspaceId,blocked:Rm(e.workspaceGate??Nm),setError:c}),Fe=w.useRef(()=>{}),mt=w.useCallback(ee=>{Fe.current(ee)},[]),Ie=KD({origin:t,refs:s,sessionId:m?.sessionId,workspaceId:e.workspaceId??null,setError:c,onReconcile:mt});Fe.current=ee=>{const Te=s.sessionRef.current?.sessionId;Te&&(async()=>await Ie.recoverSession(Te)?(Y({id:Date.now(),message:"已自动恢复:会话事件已重新同步,可继续对话。"}),ye(Jt=>Jt+1)):Y({id:Date.now(),message:"自动恢复未完成,将在重连时重试。"}))()};const Pt=Ie.operationCards.length+Ie.humanGateCards.length+Ie.artifactCards.length,bt=w.useMemo(()=>{for(const ee of Ie.operationCards)if(ee.dagRunId)return ee.dagRunId;return null},[Ie.operationCards]),Mt=w.useMemo(()=>{if(!bt)return null;for(const ee of Ie.operationCards){if(ee.dagRunId!==bt||!ee.runSummary)continue;const Te=ee.runSummary,Dt=Te.next&&Te.nodes.every(Jt=>Jt.id!==Te.next?.kind)?Te.nodes.find(Jt=>!["succeeded","completed","passed"].includes(Jt.status))?.id:void 0;return{dagRunId:bt,currentNodeId:Dt,nodes:Te.nodes,status:Te.status}}return{dagRunId:bt,nodes:[]}},[bt,Ie.operationCards]),Tt=w.useMemo(()=>q7(Ie.operationCards).length+Ie.humanGateCards.length+Ie.artifactCards.length,[Ie.operationCards,Ie.humanGateCards.length,Ie.artifactCards.length]),$n=w.useMemo(()=>m?{sessionId:m.sessionId,operationCards:Ie.operationCards,humanGateCards:Ie.humanGateCards,artifactCards:Ie.artifactCards}:null,[m,Ie.operationCards,Ie.humanGateCards,Ie.artifactCards]),en=Qj($n),lt=w.useMemo(()=>hO({operations:Ie.operationCards,gates:Ie.humanGateCards,artifacts:Ie.artifactCards}),[Ie.operationCards,Ie.humanGateCards,Ie.artifactCards]),Ze=w.useCallback(ee=>lt.has(ee),[lt]),vt=IO(ae,st,m?.sessionId??"no-session"),ct=vt.presentation==="sidecar";w.useEffect(()=>{const ee=st==="comfortable"&&K.active==="sidebar-drawer",Te=ct&&K.active==="activity";(ee||Te)&&X(Dt=>Dt.active===K.active?Nr(Dt):Dt)},[ct,st,K.active]),w.useEffect(()=>{j(null)},[m?.sessionId]),w.useEffect(()=>{Pt>0||K.active!=="activity"||X(ee=>ee.active==="activity"?Nr(ee):ee)},[Pt,K.active]);const Yt=w.useCallback(ee=>{ee&&j(ee),ct||X(Te=>ho(Te,"activity"))},[ct]),re=w.useCallback(()=>{X(ee=>ee.active==="activity"?Nr(ee):ee)},[]),ke=w.useCallback(ee=>{const Te=V.current;if(!Te)return;const Jt=Array.from(Te.querySelectorAll("[data-activity-ref]")).find(fr=>ee.includes(fr.dataset.activityRef??""));if(!Jt){Y({id:Date.now(),message:"详细运行记录暂时没有对应的对话位置。"});return}Jt.scrollIntoView({block:"center",behavior:"smooth"}),Jt.classList.add("is-located"),window.setTimeout(()=>Jt.classList.remove("is-located"),1400),ct||re()},[ct,re]),Re=JD({origin:t,refs:s,setSession:p,thread:Ie,composer:{setInput:me.setInput,setPendingImages:me.setPendingImages},browser:{setPreviews:we.setPreviews,setActivePreviewPath:we.setActivePreviewPath},setError:c,setNotice:Y,onCompactionChange:h,setProcessOpen:fe,setAutoScroll:I,workspaceId:e.workspaceId??void 0,blocked:Rm(e.workspaceGate??Nm)}),et=w.useRef(null);w.useEffect(()=>{const ee=e.requestedSessionId?.trim();if(!ee||Rm(e.workspaceGate??Nm)||m?.sessionId===ee)return;const Te=`${e.workspaceId??""}:${ee}`;if(et.current===Te)return;et.current=Te;const Dt=Re.sessionList.find(Jt=>Jt.sessionId===ee)?.workspaceId;Re.activateSession(ee,Dt)},[e.requestedSessionId,e.workspaceGate,e.workspaceId,m?.sessionId,Re.activateSession]);const St=wj({origin:t,refs:s,session:m,thread:Ie,composer:{setInput:me.setInput,setPendingImages:me.setPendingImages,recordHistory:me.recordHistory},setError:c,setNotice:Y,setAutoScroll:I,recoveryVersion:D,watchSessionTitle:Re.watchSessionTitle}),Ct=kj({origin:t,refs:s,thread:Ie,setError:c}),De=zj({origin:t,session:m,setSession:p,refs:s,setError:c});w.useEffect(()=>{if(Ie.streaming){Re.refreshSessionList();return}we.refreshTree();const ee=window.setTimeout(()=>{Re.refreshSessionList()},1200);return()=>window.clearTimeout(ee)},[Ie.streaming,Ie.turnPhase,Ie.deferredTurn?.revision,Ie.deferredTurn?.state,Re.refreshSessionList,we.refreshTree]),w.useEffect(()=>{De.runtimeContextOpen&&K.active!=="runtime-context"?X(ee=>ho(ee,"runtime-context")):!De.runtimeContextOpen&&K.active==="runtime-context"&&X(ee=>Nr(ee))},[De.runtimeContextOpen,K.active]),w.useEffect(()=>{K.active!=="runtime-context"&&De.runtimeContextOpen&&De.setRuntimeContextOpen(!1)},[K.active]),w.useEffect(()=>{Ie.streaming&&K.active==="process"&&X(Nr)},[Ie.streaming,K.active]);const{sendPrompt:Pe,handleStop:dt,discardDeferredTurn:xn,editDeferredTurn:fn,steerDeferredTurn:oa}=St,ba=w.useRef(()=>{}),yr=w.useCallback(async ee=>{const Te=Qy(ee);if(Te&&Te.action!=="unknown"&&Te.action!=="pi-prompt"){if(s.streamingRef.current){Y({id:Date.now(),message:"当前回合进行中,命令请在回合结束后执行"});return}ba.current(ee);return}await Pe(ee,me.pendingImages)},[Pe,me.pendingImages,s]);rt.current=ee=>{yr(ee)};const dr=w.useCallback(()=>{me.textareaRef.current?.focus()},[me.textareaRef]),Wt=w.useCallback(()=>{X(ee=>ee.active==="sidebar-drawer"?Nr(ee):ee)},[]),Tn=w.useCallback(ee=>{if(N(ee),S(!0),ee==="context"){M(!0),De.setRuntimeContextOpen(!0),X(Te=>ho(Te,"runtime-context"));return}if(ee==="calls"){P(!0),De.setRuntimeContextOpen(!1),X(Te=>ho(Te,"process"));return}De.setRuntimeContextOpen(!1),X(Te=>Te.active==="process"||Te.active==="runtime-context"?Nr(Te):Te)},[De.setRuntimeContextOpen]),Kr=w.useCallback(ee=>{ee==="context"?(M(!1),De.setRuntimeContextOpen(!1),X(Te=>Te.active==="runtime-context"?Nr(Te):Te)):(P(!1),X(Te=>Te.active==="process"?Nr(Te):Te)),T===ee&&N("files")},[T,De.setRuntimeContextOpen]),va=w.useCallback(ee=>{if(y&&T===ee){S(!1),ee==="context"&&De.setRuntimeContextOpen(!1),ee==="calls"&&X(Te=>Te.active==="process"?Nr(Te):Te);return}Tn(ee)},[Kr,y,T,Tn]),di=w.useCallback(()=>{De.setRuntimeContextOpen(!1),X(ee=>ho(ee,"sidebar-drawer"))},[De.setRuntimeContextOpen]),fi=w.useCallback((ee,Te)=>{Re.activateSession(ee,Te),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:ee}),Wt(),queueMicrotask(()=>{V.current?.focus?.(),dr()})},[Re,Wt,dr,e.onNavigateWorkspace,e.workspaceId]),_s=w.useCallback(ee=>{me.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${ee} `),Wt(),queueMicrotask(()=>dr())},[me,Wt,dr]),Da=w.useCallback(ee=>{N("files"),S(!0),we.openPreview(ee),Wt()},[we,Wt]),ja=w.useCallback(ee=>{N("files"),S(!0),we.openPreview(ee)},[we]),Xn=w.useCallback(()=>{const ee=V.current;ee&&(I(!0),ee.scrollTop=ee.scrollHeight)},[I]),la=w.useCallback(()=>{const ee=V.current;if(!ee)return;const Te=ee.scrollHeight-ee.scrollTop-ee.clientHeight<=25;I(Te)},[I]);w.useLayoutEffect(()=>{if(!oe.current)return;const ee=V.current;ee&&(ee.scrollTop=ee.scrollHeight)},[Ie.messages,Ie.streaming]),w.useEffect(()=>{const ee=se.current?.parentElement;if(!ee||typeof ResizeObserver>"u")return;const Te=new ResizeObserver(()=>{if(!oe.current)return;const Dt=V.current;Dt&&(Dt.scrollTop=Dt.scrollHeight)});return Te.observe(ee),()=>Te.disconnect()},[m?.sessionId]),w.useEffect(()=>{if(!G)return;const ee=window.setTimeout(()=>Y(null),6500);return()=>window.clearTimeout(ee)},[G]);const ya=o?{id:G?.id??1,kind:"error",message:o}:G?{id:G.id,kind:"info",message:G.message}:null,ca=w.useCallback(ee=>{if(ee.action==="pi-prompt"||ee.command==="/name"||ee.command==="/compact"){me.setInput(`${ee.command} `),me.setShortcutOpen(!1),me.textareaRef.current?.focus();return}ba.current(ee.command)},[me]),wn=w.useCallback(ee=>{const Te=Qy(ee),Dt=ee.trim(),Jt=Dt.split(/\s+/,1)[0]?.toLowerCase()??"";if(me.setInput(""),me.setShortcutOpen(!1),!Te)return;if(Te.action==="focus:interview"){if(!m){Y({id:Date.now(),message:"请先创建或打开一个会话,再开始 Interview"});return}Ct.startInterview();return}const fr=XM(Te.action);if(fr){e.onNavigateWorkspace?.(fr,{});return}if(Te.action==="compact"){const Wn=Dt.slice(Jt.length).trim();Re.compactSession(Wn||void 0);return}if(Te.action==="name"){const Wn=Dt.slice(Jt.length).trim(),sr=m?.sessionId;if(!sr){c("当前没有可重命名的会话");return}const gn=Re.sessionList.find(Jn=>Jn.sessionId===sr),Or=Wn||window.prompt("会话名称",gn?.title??gn?.displayTitle??"")||"";Or.trim()&&Re.updateSession(sr,{title:Or.trim()});return}if(Te.action==="session"){const Wn=m?.sessionId??"(none)",sr=Re.sessionList.find(Or=>Or.sessionId===Wn),gn=sr?.title||sr?.displayTitle||"未命名对话";Y({id:Date.now(),message:`当前会话:${gn}(${Wn})`});return}if(Te.action==="copy"){const sr=[...Ie.visibleMessages??[]].reverse().find(gn=>gn.role==="assistant");if(!sr?.text){c("没有可复制的助手消息");return}navigator.clipboard?.writeText(sr.text).then(()=>Y({id:Date.now(),message:"已复制最后一条助手消息"}),()=>c("复制失败"));return}if(Te.action==="unknown"){Pe(Dt,me.pendingImages);return}c(`未知 shortcut:${Te.command}`)},[me.setInput,me.setShortcutOpen,me.pendingImages,Ct.startInterview,e.onNavigateWorkspace,Re,m,Ie.visibleMessages,Pe]);ba.current=wn;const Ms=w.useCallback(ee=>{const Te=s.isComposingRef.current||ee.nativeEvent.isComposing,Dt=Date.now()-s.compositionEndedAtRef.current<100;if(me.shortcutOpen&&me.filteredShortcuts.length>0&&!Te&&!Dt){if(ee.key==="ArrowLeft"||ee.key==="ArrowRight"||ee.key==="ArrowUp"||ee.key==="ArrowDown"){ee.preventDefault();const Jt=Nj(st);let fr=me.shortcutIndex;if(ee.key==="ArrowLeft"||ee.key==="ArrowRight")fr=E3(me.shortcutIndex,$e,Jt,ee.key==="ArrowLeft"?"left":"right");else{const Wn=Ye.current;let sr=null;if(Wn){const gn=Array.from(Wn.querySelectorAll("[data-shortcut-index]")).map(Jn=>{const ua=Jn.getBoundingClientRect();return{globalIndex:Number(Jn.dataset.shortcutIndex??-1),top:ua.top,bottom:ua.bottom,left:ua.left,right:ua.right}}).filter(Jn=>Number.isFinite(Jn.globalIndex)&&Jn.globalIndex>=0),Or=gn.find(Jn=>Jn.globalIndex===me.shortcutIndex)??null;Or&&(sr=Rj(Or,gn,ee.key==="ArrowUp"?"up":"down"))}fr=sr??E3(me.shortcutIndex,$e,Jt,ee.key==="ArrowUp"?"up":"down")}fr!==me.shortcutIndex&&(gt.current=!0,me.setShortcutIndex(fr));return}if(ee.key==="Escape"){ee.preventDefault(),me.setShortcutOpen(!1);return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const Jt=me.filteredShortcuts[me.shortcutIndex]??me.filteredShortcuts[0];ca(Jt);return}}if(ee.key==="Enter"&&!ee.shiftKey&&(Te||Dt)){Dt&&ee.preventDefault();return}if((ee.key==="ArrowUp"||ee.key==="ArrowDown")&&!Te&&!Dt&&me.fileOptions.length===0&&me.navigateHistory(ee.key==="ArrowUp"?"up":"down")){ee.preventDefault();return}if(ee.key==="Enter"&&!ee.shiftKey){ee.preventDefault(),yr(me.input);return}},[me.input,me.shortcutOpen,me.filteredShortcuts,me.shortcutIndex,me.setShortcutIndex,me.setShortcutOpen,me.fileOptions,me.navigateHistory,s,yr,ca,st,$e,Ye,gt]),Mr=Ie.visibleMessages.length>0||Ie.operationCards.length>0||Ie.humanGateCards.length>0||Ie.artifactCards.length>0||!!Ie.interview,Yr=e.onNavigateWorkspace?()=>e.onNavigateWorkspace?.("models",{}):void 0,Me=u.jsx(Lk,{origin:t,workspaces:kt.workspaces,workspacesLoading:kt.loading,workspacesError:kt.error,activeWorkspaceId:e.workspaceId??kt.workspaceId,removingWorkspaceId:$t,onPickWorkspaceDirectory:kt.pickWorkspaceDirectory,onAddWorkspace:ee=>kt.addWorkspace(ee),onActivateWorkspace:ee=>{ee!==(e.workspaceId??kt.workspaceId)&&e.onSwitchWorkspace?.(ee)},onRemoveWorkspace:ee=>{Ut(ee),kt.removeWorkspace(ee).finally(()=>{Ut(null)})},onDismissWorkspaceError:()=>{kt.refresh()},open:g,layoutMode:st,drawerOpen:ze.sidebarDrawerOpen,activeSessionId:m?.sessionId,activeSessionStreaming:Ie.streaming,activeSessionTurnPhase:Ie.turnPhase,sessions:Re.sessionList,tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onToggleOpen:()=>x(ee=>!ee),onOpenDrawer:di,onCloseDrawer:Wt,onCreate:()=>{Re.createSession()},onCreateInWorkspace:ee=>{Re.createSession(ee===(e.workspaceId??kt.workspaceId)?void 0:{workspaceId:ee})},creatingSession:Re.creatingSession,onActivate:ee=>{const Te=Re.sessionList.find(Dt=>Dt.sessionId===ee)?.workspaceId;ze.sidebarDrawerOpen?fi(ee,Te):(Re.activateSession(ee,Te),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:ee}))},onRename:(ee,Te)=>{Re.updateSession(ee,{title:Te})},onSetState:(ee,Te)=>{Re.updateSession(ee,{state:Te})},onDelete:ee=>Re.deleteSession(ee),onRefreshTree:we.refreshTree,onToggleDir:we.toggleDir,onInsert:ee=>{ze.sidebarDrawerOpen?_s(ee):me.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${ee} `)},onPreview:ee=>{ze.sidebarDrawerOpen?Da(ee):ja(ee)},drawerTriggerRef:he}),tt=["oc-workspace",q?"is-column-dragging":""].filter(Boolean).join(" "),At=st==="narrow"?0:st==="compact"?56:g?F:40,Gt=st==="narrow"||!y?0:L,hn=Ca(U,ys,El(L)),Pn={"--oc-sidebar-width":`${At}px`,"--oc-details-width":`${Gt}px`,"--oc-file-tree-width":`${hn}px`,gridTemplateColumns:st==="narrow"?"minmax(0, 1fr)":`${At}px minmax(0, 1fr) ${Gt}px`},ir=u.jsxs(u.Fragment,{children:[st==="comfortable"&&g?u.jsx(Lu,{side:"sidebar",value:F,onResize:ee=>A(Ca(ee,Jj,eL)),onDragChange:W}):null,y&&st!=="narrow"?u.jsx(Lu,{side:"details",value:L,onResize:ee=>Z(Ca(ee,Rl,ju())),onResizeEnd:ee=>Im(C3,Ca(ee,Rl,ju())),onDragChange:W}):null,!y&&st!=="narrow"?u.jsx("button",{type:"button",className:"oc-details-reopen",onClick:()=>Tn(T),"aria-label":"展开右侧辅助栏",title:"展开辅助栏",children:u.jsx(Um,{side:"right"})}):null]}),Qn=ee=>u.jsx("div",{className:"oc-messages is-empty",ref:ue,"data-landing-density":Rt.landingDensity,children:e.readiness==="setup-required"?u.jsx(m3,{readiness:e.readiness,presentation:"landing",onOpenModels:Yr}):u.jsx(F7,{mode:ee,readiness:e.readiness,density:Rt.landingDensity,onSuggest:async Te=>{Re.creatingSession||(ee==="no-session"?await Re.createSession()&&await yr(Te):await yr(Te))},disabled:Re.creatingSession,onCreateSession:ee==="no-session"?()=>{Re.createSession()}:void 0})});return u.jsxs("div",{className:"oc-shell",children:[a?null:u.jsxs("div",{className:"oc-banner",children:[u.jsxs("span",{className:"oc-banner-title",children:[u.jsx("span",{className:"oc-banner-dot","aria-hidden":"true"}),"对话"]}),u.jsxs("span",{className:"oc-banner-body",children:["用自然语言编排 loop-agent / agent-worker 的",u.jsx("strong",{children:"全部能力"}),"。这是 ",u.jsx("strong",{children:"Operator"})," 面:默认具备完整 Pi 工具(read/write/edit/bash/grep/find/ls)与 safe-* 探查、以及受策略约束的 operator action(ADR 0011)。",u.jsx("strong",{children:"软约束"}),":大改与高风险变更优先走受治 DAG 的 implement-pi / repair-pi 与 Human Gate,而非把 Chat 当作第二套 DAG kernel。"]})]}),u.jsx(WD,{toast:ya,onDismiss:()=>{c(null),Y(null)}}),m?u.jsxs("div",{className:tt,ref:Q,"data-layout-mode":st,style:Pn,children:[Me,u.jsxs("div",{ref:ae,className:`oc-main${Mr?"":" is-landing"}`,children:[!ct&&(st==="narrow"||Pt>0)?u.jsxs("div",{className:"oc-main-topbar",children:[st==="narrow"?u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:he,"aria-label":"打开会话与仓库","aria-expanded":ze.sidebarDrawerOpen,onClick:()=>ze.sidebarDrawerOpen?Wt():di(),children:"会话与仓库"}):null,Pt>0?u.jsxs("button",{type:"button",className:"oc-main-topbar-btn oc-activity-trigger",ref:We,"aria-controls":"oc-activity-rail","aria-expanded":ot,onClick:()=>ot?re():Yt(),children:["运行活动 ",u.jsx("span",{children:Tt})]}):null]}):null,Mr&&e.readiness!=="ready"?u.jsx(m3,{readiness:e.readiness,presentation:"thread",onOpenModels:Yr}):null,Mr?u.jsxs("div",{className:"oc-thread-anchor-wrap",children:[u.jsx(QO,{scrollContainerRef:V,turnGroups:Ie.turnGroups,measureKey:Ie.visibleMessages.length}),u.jsx(YO,{scrollContainerRef:V,messagesEndRef:se,onScroll:la,showScrollToLatest:!J,onScrollToLatest:Xn,hasThread:Mr,readiness:e.readiness,streaming:Ie.streaming,compacting:d,streamingAssistantId:Ie.streamingAssistantId,messagesCount:Ie.messages.length,visibleCount:Ie.visibleMessages.length,onLoadMore:()=>Ie.setHistoryLimit(ee=>ee+50),turnGroups:Ie.turnGroups,interview:Ie.interview,interviewAnswer:Ct.interviewAnswer,onInterviewAnswerChange:Ct.setInterviewAnswer,onAnswerInterview:ee=>{Ct.answerInterview(ee)},onConfirmTaskKind:()=>{Ct.confirmTaskKind()},onActivateActivity:Yt,canActivateActivity:Ze,onSuggest:ee=>{yr(ee)}})]}):Qn("empty-session"),Ie.pendingQuestion?u.jsx(yD,{origin:t,pending:Ie.pendingQuestion,workspaceId:m?.workspaceId,onSettled:()=>Ie.setPendingQuestion(null)}):u.jsxs("div",{className:"oc-composer-dock",children:[u.jsx(wD,{todos:Ie.todos}),u.jsx(hD,{composer:me,streaming:Ie.streaming,turnPhase:Ie.turnPhase,deferredTurn:Ie.deferredTurn,deferredTurns:Ie.deferredTurns,hasThread:Mr,layoutMode:st,paletteModel:$e,shortcutPaletteRef:Ye,paletteKeyboardNavRef:gt,onSend:ee=>{yr(ee)},onStop:dt,onDiscardDeferred:xn,onEditDeferred:fn,onSteerDeferred:oa,onKeyDown:Ms,onRunShortcut:wn,models:De.models,activeModel:De.activeModel,activeModelRef:De.activeModelRef,activeModelListed:De.activeModelListed,activeThinkingLevel:De.activeThinkingLevel,thinkingLevels:De.thinkingLevels,onSwitchRuntime:ee=>{De.switchRuntime(ee)},usage:Ie.usage,sessionStats:Ie.sessionStats,unread:Ie.unread,onCompact:()=>{Re.compactSession()},compacting:d,processSummary:Ie.streaming?null:Ie.processSummary,processOpen:Qe,onToggleProcess:()=>va("calls"),processTriggerRef:Ne,runtimeContext:De.runtimeContext,runtimeContextOpen:Ue,onToggleRuntimeContext:()=>va("context"),runtimeContextTriggerRef:He})]})]}),u.jsxs(Wy,{open:y,onToggleOpen:()=>{S(!1),T==="context"&&De.setRuntimeContextOpen(!1),T==="calls"&&X(ee=>ee.active==="process"?Nr(ee):ee)},activeTab:T,onSelectTab:Tn,dagRunId:bt,dagRun:Mt,contextContent:R&&De.runtimeContext?u.jsx(ED,{panelOnly:!0,embedded:!0,open:T==="context"&&y&&!!De.runtimeContext,onToggle:()=>va("context"),onClose:()=>{S(!1),De.setRuntimeContextOpen(!1),X(ee=>ee.active==="runtime-context"?Nr(ee):ee)},context:De.runtimeContext,triggerRef:He}):void 0,callsContent:_?u.jsx(kD,{toolCalls:Ie.toolCalls,overlay:!1,embedded:!0,onClose:()=>va("calls"),triggerRef:Ne}):void 0,onCloseTab:Kr,children:[u.jsx(Zy,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(Lu,{side:"details-tree",value:hn,onResize:ee=>$(Ca(ee,ys,El(L))),onResizeEnd:ee=>Im(Am,Ca(ee,ys,El(L))),onDragChange:W}),u.jsx(xb,{workspaceName:kt.workspaces.find(ee=>ee.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:ee=>me.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${ee} `),onPreview:ee=>{ja(ee)}})]}),ir,Pt>0&&!ct&&ot?u.jsx("button",{type:"button",className:"oc-overlay-backdrop is-activity","aria-label":"关闭运行活动遮罩",onClick:re}):null,en.snapshot?u.jsx(NO,{origin:t,sessionId:en.snapshot.sessionId,presentation:vt.presentation,sidecarRect:vt.sidecarRect,phase:en.phase,open:ot,focusRef:be,triggerRef:We,operationCards:en.snapshot.operationCards,humanGateCards:en.snapshot.humanGateCards,artifactCards:en.snapshot.artifactCards,onClose:re,onLocateConversation:ke,onNavigateWorkspace:e.onNavigateWorkspace}):null]}):u.jsxs("div",{className:tt,ref:Q,"data-layout-mode":st,style:Pn,children:[Me,u.jsxs("div",{className:"oc-main is-landing",children:[st==="narrow"?u.jsx("div",{className:"oc-main-topbar",children:u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:he,"aria-label":"打开会话与仓库","aria-expanded":ze.sidebarDrawerOpen,onClick:()=>ze.sidebarDrawerOpen?Wt():di(),children:"会话与仓库"})}):null,Qn("no-session")]}),u.jsxs(Wy,{open:y,onToggleOpen:()=>S(ee=>!ee),activeTab:T,onSelectTab:Tn,onCloseTab:Kr,dagRunId:bt,dagRun:Mt,children:[u.jsx(Zy,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(Lu,{side:"details-tree",value:hn,onResize:ee=>$(Ca(ee,ys,El(L))),onResizeEnd:ee=>Im(Am,Ca(ee,ys,El(L))),onDragChange:W}),u.jsx(xb,{workspaceName:kt.workspaces.find(ee=>ee.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:ee=>me.setInput(Te=>`${Te}${Te&&!Te.endsWith(" ")?" ":""}@${ee} `),onPreview:ee=>{ja(ee)}})]}),ir]})]})}function aL(e){const{active:t}=e;return u.jsxs("section",{id:"workspace-chat",className:"workspace-pane workspace-pane--chat panel panel--chat","aria-labelledby":"chat-title",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,style:{minWidth:0,height:"100%"},children:[u.jsx("h2",{id:"chat-title",className:"sr-only",children:"对话"}),u.jsx(rL,{origin:"",readiness:e.readiness,surface:"workspace",workspaceRegistry:e.workspaceRegistry,workspaceId:e.workspaceId,requestedSessionId:e.sessionId,workspaceGate:e.workspaceGate,onSwitchWorkspace:e.onSwitchWorkspace,onNavigateWorkspace:e.onNavigateWorkspace})]})}function iL(e){const{board:t,busy:n}=e;return u.jsxs("details",{className:"night-advanced","data-testid":"night-advanced",open:t.advancedOpen,onToggle:a=>t.setAdvancedOpen(a.target.open),children:[u.jsx("summary",{children:"高级 / Inspect"}),u.jsxs("p",{className:"muted",children:["只读深链:"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-morning-btn",onClick:()=>{t.onMorningReport()},children:"早晨 night 报告"})}),t.morningPreview?u.jsx("pre",{className:"cmd","data-testid":"night-morning-preview",children:t.morningPreview}):null]})}function zu(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function Mn(e,t){const n=e[t];return typeof n=="string"&&n.trim()?n.trim():void 0}function R3(e,t){const n=e[t];if(!Array.isArray(n))return;const a=n.filter(s=>typeof s=="string");return a.length>0?a:void 0}function sL(e){const t=zu(e);if(!t)return null;const n=zu(t.result),a=[zu(t.reviewPacket),n?zu(n.reviewPacket):null,n,t].filter(Boolean);for(const s of a){const o=Mn(s,"scheduleId")??Mn(s,"id"),c=Mn(s,"gateToken")??Mn(s,"approveGate")??Mn(s,"writeSetGateToken");if(!(!o||!c))return{scheduleId:o,gateToken:c,...Mn(s,"featureId")?{featureId:Mn(s,"featureId")}:{},...Mn(s,"taskId")?{taskId:Mn(s,"taskId")}:{},...R3(s,"writeSet")?{writeSet:R3(s,"writeSet")}:{},...Mn(s,"worktreePath")?{worktreePath:Mn(s,"worktreePath")}:{},...Mn(s,"branch")?{branch:Mn(s,"branch")}:{},...Mn(s,"baseBranch")?{baseBranch:Mn(s,"baseBranch")}:{},...Mn(s,"baseCommit")?{baseCommit:Mn(s,"baseCommit")}:{},...Mn(s,"executeAtUtc")?{executeAtUtc:Mn(s,"executeAtUtc")}:{},...Mn(s,"taskCard")?{taskCard:Mn(s,"taskCard")}:{}}}return null}function A3(e){return`docs/features/${e.trim().replace(/^\/+|\/+$/g,"")}`}function oL(e){const t=e.trim(),n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/.exec(t);return n?`${n[1]} ${n[2]}`:null}function I3(){const e=new Date;e.setHours(20,0,0,0);const t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function J7(e){if(!e)return"—";const t=Date.parse(e);if(Number.isNaN(t))return e;try{return new Intl.DateTimeFormat("zh-CN",{dateStyle:"short",timeStyle:"short",timeZone:"Asia/Shanghai"}).format(new Date(t))}catch{return e}}function lL(e){return e.mergeState==="pending-harvest"||/\bscheduler harvest\b/i.test(e.nextAction)}function cL(e){return e.status==="failed"||e.status==="human_required"||e.status==="cancelled"||/\bscheduler discard\b/i.test(e.nextAction)}function ud(e){return e==="failed"||e==="human_required"}function uL(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function ex(e){return{submitted:"已提交",validating:"校验中",validated:"待预约确认",scheduled:"已预约",waiting:"等待触发",dispatching:"派发中",running:"执行中",succeeded:"成功",failed:"失败",human_required:"需人工",cancelled:"已取消",rejected:"已拒绝",cancel_requested:"取消中"}[e]??e}function dL(e){const{target:t,reason:n,onReasonChange:a,force:s,onForceChange:o,busy:c}=e;return u.jsxs("div",{className:"night-discard-card","data-testid":"night-discard-card",children:[u.jsx("h3",{children:"确认 Discard"}),u.jsxs("p",{className:"muted",children:[t.featureId,"/",t.taskId,"(",ex(t.status),")"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"原因"}),u.jsx("input",{"data-testid":"night-discard-reason",value:n,disabled:c,placeholder:"human discard reason",onChange:d=>a(d.target.value)})]}),ud(t.status)?u.jsxs("label",{className:"field checkbox-field",children:[u.jsx("input",{type:"checkbox","data-testid":"night-discard-force",checked:s,disabled:c,onChange:d=>o(d.target.checked)}),u.jsx("span",{className:"muted",children:"强制 Discard(failed / human_required)"})]}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c||ud(t.status)&&!s,"data-testid":"night-discard-confirm",onClick:e.onConfirm,children:"确认 Discard"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:c,onClick:e.onCancel,children:"返回"})]})]})}function fL(e){const{board:t}=e,{doctor:n,list:a,clockHint:s,doctorIssues:o,auxTicker:c}=t;return u.jsxs("div",{className:"night-health","data-testid":"night-health-bar",children:[u.jsxs("div",{className:"night-health-main",children:[u.jsx("span",{className:`night-health-pill${n?.ok===!1?" is-bad":""}`,children:n?.ok===!1?"Scheduler 异常":"Scheduler 健康"}),u.jsxs("span",{className:"muted",children:["计划 ",n?.scheduleCount??a?.summary.total??"—"," · 活动"," ",n?.activeCount??a?.summary.active??"—"]})]}),s?u.jsxs("p",{className:"muted night-health-hint","data-testid":"night-clock-hint",children:["时钟:",s.message,"(安装/启停请用 CLI:",u.jsx("code",{children:"agent-worker scheduler clock status --repo ."}),")"]}):u.jsxs("p",{className:"muted night-health-hint",children:["到点执行依赖本机 clock / tick,不在此面板安装。详见"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsxs("div",{className:"night-aux-ticker","data-testid":"night-aux-ticker",children:[u.jsxs("p",{className:"night-aux-ticker-label",children:["开着 Console 时辅助 tick(每 ",c?.intervalSec??60,"s)"]}),u.jsx("p",{className:"muted night-health-hint","data-testid":"night-aux-ticker-disclaimer",children:c?.disclaimer??"仅在本 Console 进程开着时有效;过夜无人值守仍需 OS clock。"}),c?.lastOutcome?u.jsxs("p",{className:"muted","data-testid":"night-aux-ticker-last",children:["上次:",c.lastOutcome,c.running?"(进行中)":"",c.lastSummary?` · ${c.lastSummary}`:"",c.lastError?` · ${c.lastError}`:""]}):null]}),o.length>0?u.jsx("ul",{className:"night-doctor-list","data-testid":"night-doctor-findings",children:o.slice(0,4).map(d=>u.jsxs("li",{children:[u.jsx("strong",{children:d.severity})," ",d.message]},`${d.code}-${d.scheduleId??""}-${d.message}`))}):null]})}function hL(e){const{board:t,busy:n,onHarvest:a,onOpenDiscard:s}=e,{list:o}=t;return u.jsxs(u.Fragment,{children:[o?u.jsxs("div",{className:"night-kpi","data-testid":"night-kpi",children:[u.jsxs("span",{children:["合计 ",o.summary.total]}),u.jsxs("span",{children:["活动 ",o.summary.active]}),u.jsxs("span",{children:["待收成 ",o.summary.pendingHarvest]}),u.jsxs("span",{children:["需人工 ",o.summary.humanRequired]}),u.jsxs("span",{children:["失败 ",o.summary.failed]})]}):null,u.jsxs("div",{className:"night-board","data-testid":"night-board",children:[u.jsx("h3",{children:"计划列表"}),!o||o.schedules.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-board-empty",children:[u.jsx("p",{className:"empty-title",children:"暂无夜间计划"}),u.jsx("p",{className:"muted",children:"用下方向导预约第一个任务。"})]}):u.jsx("ul",{className:"night-schedule-list",children:o.schedules.map(c=>u.jsxs("li",{className:"night-schedule-row","data-testid":"night-schedule-row","data-status":c.status,children:[u.jsxs("div",{className:"night-schedule-head",children:[u.jsxs("strong",{children:[c.featureId,"/",c.taskId]}),u.jsx("span",{className:"night-status-chip",children:ex(c.status)})]}),u.jsxs("p",{className:"muted",children:["执行 ",J7(c.executeAtUtc),c.mergeState?` · merge ${c.mergeState}`:"",c.taskCard?` · ${c.taskCard}`:""]}),c.waitingReason?u.jsxs("p",{className:"muted",children:["等待原因:",c.waitingReason]}):null,u.jsxs("p",{className:"muted night-next-action",children:["下一步:",c.nextAction]}),u.jsxs("div",{className:"cta-row",children:[lL(c)?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n,"data-testid":"night-row-harvest",onClick:()=>a(c),children:"Harvest"}):null,cL(c)?u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-row-discard",onClick:()=>s(c),children:"Discard"}):null,u.jsx("a",{className:"external-link",href:`/#/inspect/night/${encodeURIComponent(c.scheduleId)}`,children:"Inspect"})]})]},c.scheduleId))})]})]})}function mL(e){const{wizard:t,busy:n}=e;return u.jsxs("div",{className:"night-wizard","data-testid":"night-wizard",children:[u.jsx("h3",{children:"预约夜间任务"}),t.phase==="pick"?u.jsxs(u.Fragment,{children:[t.selectableTasks.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-task-empty",children:[u.jsx("p",{className:"empty-title",children:"没有可选任务"}),u.jsx("p",{className:"muted",children:"请先在 Feature Packet / Task Pool 中创建任务,再回到此处刷新。"})]}):u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature / Task"}),u.jsxs("select",{"data-testid":"night-task-select",value:t.selectedKey,disabled:n,onChange:a=>t.setSelectedKey(a.target.value),children:[u.jsx("option",{value:"",children:"选择任务…"}),t.selectableTasks.map(a=>{const s=`${a.featureId}::${a.taskId}`;return u.jsxs("option",{value:s,children:[a.featureId,"/",a.taskId,a.status?` · ${a.status}`:""]},s)})]})]}),t.derivedFeatureDir?u.jsxs("p",{className:"muted","data-testid":"night-feature-dir",children:["Feature 目录:",u.jsx("code",{children:t.derivedFeatureDir})]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"本地执行时间"}),u.jsx("input",{type:"datetime-local","data-testid":"night-at",value:t.nightAt,disabled:n,onChange:a=>t.setNightAt(a.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务卡片(可选)"}),u.jsx("input",{"data-testid":"night-task-card",value:t.taskCard,disabled:n,placeholder:"UCP-LOOP#11",onChange:a=>t.setTaskCard(a.target.value)})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.selectedKey||!t.nightAt,"data-testid":"night-prepare-btn",onClick:()=>{t.onPrepare()},children:"准备并审阅"})})]}):u.jsxs("div",{className:"night-review-card","data-testid":"night-review-card",children:[u.jsx("p",{className:"muted",children:"请确认 writeSet 与执行环境后预约。Token 已隐藏。"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Schedule"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.scheduleId})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务"}),u.jsxs("dd",{children:[t.review?.featureId,"/",t.review?.taskId]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"执行时间 (UTC)"}),u.jsx("dd",{children:J7(t.review?.executeAtUtc)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Worktree"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.worktreePath??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"分支"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.branch??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Base"}),u.jsx("dd",{children:u.jsxs("code",{children:[t.review?.baseBranch??"—","@",(t.review?.baseCommit??"").slice(0,12)||"—"]})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"WriteSet"}),u.jsx("dd",{children:t.review?.writeSet&&t.review.writeSet.length>0?u.jsx("ul",{className:"night-writeset",children:t.review.writeSet.map(a=>u.jsx("li",{children:u.jsx("code",{children:a})},a))}):u.jsx("span",{className:"muted",children:"(未返回显式 writeSet)"})})]})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.review,"data-testid":"night-confirm-add-btn",onClick:()=>{t.onConfirmAdd()},children:"确认预约"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-review-back-btn",onClick:t.onCancelWizard,children:"返回修改"})]})]})]})}function pL(e){const{setOpError:t}=e,[n,a]=w.useState(null),[s,o]=w.useState(null),[c,d]=w.useState([]),[h,m]=w.useState(null),[p,g]=w.useState(!1),[x,y]=w.useState(!1),[S,T]=w.useState(null),[N,R]=w.useState(null),M=w.useCallback(async()=>{g(!0),m(null);try{const[A,L,Z,U]=await Promise.all([fetch(Ir("/api/night-jobs"),{credentials:"same-origin"}),fetch(Ir("/api/night-jobs/doctor"),{credentials:"same-origin"}),fetch(Ir("/api/tasks"),{credentials:"same-origin"}),fetch(Ir("/api/operator/v1/night-aux-ticker"),{credentials:"same-origin"})]);if(!A.ok)throw new Error(`加载计划列表失败(HTTP ${A.status})`);const $=await A.json();if(a($),L.ok?o(await L.json()):o(null),Z.ok){const q=await Z.json();d(Array.isArray(q)?q:[])}else d([]);if(U.ok){const q=await U.json();q.ticker&&R(q.ticker)}}catch(A){m(A instanceof Error?A.message:String(A))}finally{g(!1)}},[]);w.useEffect(()=>{M()},[M]);const _=w.useCallback(async()=>{try{const A=await fetch(Ir("/api/night-jobs/morning"),{credentials:"same-origin"});if(!A.ok){t(`早晨报告加载失败(HTTP ${A.status})`);return}const L=await A.json();T(JSON.stringify(L,null,2).slice(0,4e3)),y(!0)}catch(A){t(A instanceof Error?A.message:String(A))}},[t]),P=(s?.findings??[]).filter(A=>A.severity==="error"||A.severity==="warning"),F=(s?.findings??[]).find(A=>/clock/i.test(A.code)||/clock/i.test(A.message));return{list:n,doctor:s,tasks:c,loadError:h,loadingBoard:p,advancedOpen:x,setAdvancedOpen:y,morningPreview:S,auxTicker:N,refreshBoard:M,onMorningReport:_,doctorIssues:P,clockHint:F}}function gL(e){const{board:t,runAction:n,isActionSuccess:a,setOpError:s}=e,{tasks:o,refreshBoard:c}=t,[d,h]=w.useState("pick"),[m,p]=w.useState(""),[g,x]=w.useState(I3),[y,S]=w.useState(""),[T,N]=w.useState(null),[R,M]=w.useState(""),[_,P]=w.useState(null),[F,A]=w.useState(!1),L=w.useMemo(()=>{const K=o.filter(X=>typeof X.featureId=="string"&&X.featureId.trim()&&X.taskId);return K.sort((X,be)=>{const j=X.featureId??"",G=be.featureId??"";return j!==G?j.localeCompare(G):X.taskId.localeCompare(be.taskId)}),K},[o]),Z=w.useMemo(()=>m?L.find(K=>`${K.featureId}::${K.taskId}`===m)??null:null,[L,m]),U=Z?.featureId?A3(Z.featureId):"",$=w.useCallback(async(K,X,be)=>{const j=await n("prepareMutationGate",{action:K,actionParams:X});if(!a(j))return;const G=j?.result??j,Y=G.receiptId?G:G.result??G;if(!Y.receiptId||!Y.humanGateToken){s("prepareMutationGate 未返回可消费的 Human Gate receipt");return}return n(K,{...X,confirmationId:Y.receiptId,humanGateToken:Y.humanGateToken},{clientRequestId:uL(be)})},[a,n,s]),q=w.useCallback(async()=>{if(!Z?.featureId){s("请先点选 Feature / Task");return}const K=oL(g);if(!K){s("执行时间格式无效,请使用日期时间选择器");return}const X={featureDir:A3(Z.featureId),taskId:Z.taskId,at:K,tz:"Asia/Shanghai",...y.trim()?{taskCard:y.trim()}:{}},be=await $("workerAdmissionPrepare",X,"night-prepare");if(!a(be))return;const j=sL(be?.result??be);if(!j){s("准备成功但未解析到 scheduleId / gateToken。请刷新后重试,或查看 Inspect。");return}N(j),h("review")},[a,g,$,Z,s,y]),W=w.useCallback(async()=>{if(!T)return;const K=await $("workerSchedulerAdd",{scheduleId:T.scheduleId,approveGate:T.gateToken},"night-add");a(K)&&(N(null),h("pick"),p(""),S(""),x(I3()),await c())},[a,c,T,$]),oe=w.useCallback(()=>{h("pick"),N(null)},[]),J=w.useCallback(async K=>{const X=await $("workerSchedulerHarvest",{scheduleId:K.scheduleId},"night-harvest");a(X)&&await c()},[a,c,$]),H=w.useCallback(async()=>{if(!_)return;const K=R.trim()||"discard from console night workbench",X=ud(_.status),be=await $("workerSchedulerDiscard",{scheduleId:_.scheduleId,reason:K,...X||F?{force:!0}:{}},"night-discard");a(be)&&(P(null),M(""),A(!1),await c())},[R,_,F,a,c,$]),I=w.useCallback(K=>{P(K),A(ud(K.status)),M("")},[]);return{phase:d,selectedKey:m,setSelectedKey:p,nightAt:g,setNightAt:x,taskCard:y,setTaskCard:S,review:T,discardReason:R,setDiscardReason:M,discardTarget:_,setDiscardTarget:P,forceDiscard:F,setForceDiscard:A,selectableTasks:L,derivedFeatureDir:U,onPrepare:q,onConfirmAdd:W,onCancelWizard:oe,onHarvest:J,onDiscard:H,openDiscard:I}}function bL({busy:e,runAction:t,isActionSuccess:n,setOpError:a}){const s=pL({setOpError:a}),o=gL({board:s,runAction:t,isActionSuccess:n,setOpError:a});return u.jsxs("section",{className:"panel night-workbench","aria-labelledby":"night-title","data-testid":"night-jobs-panel",children:[u.jsx("h2",{id:"night-title",children:"夜间任务"}),u.jsx("p",{className:"panel-lead",children:"白天点选任务并预约;列表查看状态;早晨在行内收成或丢弃。写操作仍经 Human Gate,列表复用 Inspect 投影。"}),u.jsx(fL,{board:s,busy:e}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e||s.loadingBoard,"data-testid":"night-refresh-btn",onClick:()=>{s.refreshBoard()},children:"刷新看板"})}),s.loadError?u.jsx("p",{className:"error","data-testid":"night-load-error",children:s.loadError}):null,u.jsx(hL,{board:s,busy:e,onHarvest:c=>{o.onHarvest(c)},onOpenDiscard:o.openDiscard}),o.discardTarget?u.jsx(dL,{target:o.discardTarget,reason:o.discardReason,onReasonChange:o.setDiscardReason,force:o.forceDiscard,onForceChange:o.setForceDiscard,busy:e,onConfirm:()=>{o.onDiscard()},onCancel:()=>o.setDiscardTarget(null)}):null,u.jsx(mL,{wizard:o,busy:e}),u.jsx(iL,{board:s,busy:e})]})}function vL(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bu(e){return e.provider?Ns(e.provider,e.id):e.id}function yL(e){const t=e.trim();if(!t)return;const n=t.indexOf("/");return n<=0||n===t.length-1?{provider:"",id:t}:{provider:t.slice(0,n),id:t.slice(n+1)}}function xL(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(0),d=w.useRef(null),h=w.useRef(null),m=w.useRef(null),p=w.useMemo(()=>{const T=[...e.models];if(e.value&&!T.some(N=>Bu(N)===e.value)){const N=yL(e.value);N&&T.push(N)}return T},[e.models,e.value]),g=w.useMemo(()=>V7(p,a),[p,a]),x=w.useMemo(()=>g.flatMap(T=>T.models),[g]);w.useEffect(()=>{t&&(s(""),c(Math.max(0,p.findIndex(T=>Bu(T)===e.value))),window.setTimeout(()=>m.current?.focus(),0))},[t,p,e.value]),w.useEffect(()=>{if(!t)return;const T=R=>{const M=d.current;M&&R.target instanceof Node&&!M.contains(R.target)&&n(!1)},N=R=>{R.key==="Escape"&&(n(!1),h.current?.focus())};return document.addEventListener("mousedown",T),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",N)}},[t]);const y=T=>{if(e.disabled)return;const N=x[T];N&&(n(!1),e.onChange(Bu(N)),h.current?.focus())},S=T=>{if(T.key==="ArrowDown"){T.preventDefault(),c(N=>x.length?(N+1)%x.length:0);return}if(T.key==="ArrowUp"){T.preventDefault(),c(N=>x.length?(N-1+x.length)%x.length:0);return}if(T.key==="Enter"){T.preventDefault(),y(o);return}if(T.key==="Escape"){T.preventDefault(),n(!1),h.current?.focus();return}};return u.jsxs("div",{className:"oc-select-menu models-matrix-select",ref:d,children:[u.jsxs("button",{type:"button",ref:h,id:e.id,className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":t,"aria-invalid":e.ariaInvalid,"data-testid":e.dataTestId,disabled:e.disabled,onClick:()=>n(T=>!T),children:[u.jsx("span",{className:"oc-select-trigger-label",children:e.value||"选择模型"}),u.jsx(vL,{})]}),t&&u.jsxs("div",{className:"oc-select-panel oc-model-panel is-below",role:"listbox","aria-label":"选择模型",children:[u.jsx("input",{ref:m,className:"oc-select-search",placeholder:"搜索模型…",value:a,onChange:T=>{s(T.target.value),c(0)},onKeyDown:S}),g.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有可用模型"}),g.map(T=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:T.provider||"其他"}),T.models.map(N=>{const R=Bu(N),M=R===e.value,_=x[o]===N;return u.jsxs("button",{type:"button",role:"option","aria-selected":M,disabled:e.disabled,className:`oc-select-option oc-model-option${_?" is-highlighted":""}${M?" is-active":""}`,onMouseDown:P=>P.preventDefault(),onClick:()=>{e.disabled||(n(!1),e.onChange(R))},children:[u.jsxs("span",{className:"oc-model-option-name",children:[N.name?`${N.name} · `:"",N.id]}),M&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},R)})]},T.provider))]})]})}const wL=[{key:"sdkAvailable",detailKey:"sdkMessage",label:"Pi SDK",hint:"Node 侧 Pi SDK 可加载"},{key:"authReady",detailKey:"authMessage",label:"认证凭据",hint:"Pi auth / provider 密钥已配置"},{key:"modelsAvailable",detailKey:"modelsMessage",label:"可用模型",hint:"harness.json executors.pi(LOW/MED/HIGH)可在 Pi 凭据面解析"},{key:"interviewSessionOk",detailKey:"sessionMessage",label:"访谈会话",hint:"Interview 会话预检通过"}];function kL(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function SL(e){const t=e.readinessReport?.state??e.readiness,n=e.readinessReport?.probe,a=n?.details??{},s=e.readinessReport?.blockedActions??[],o=kL(e.readinessReport?.generatedAt),c=e.readinessReport??{state:e.readiness,health:e.health},d=n?.piModelMatrix,h=n?.piAvailableModels??[],[m,p]=w.useState(()=>lb(d)),[g,x]=w.useState(!1),[y,S]=w.useState(null),[T,N]=w.useState(null);w.useEffect(()=>{p(lb(d)),S(null)},[d]);const R=S9(m),M=!E9(R),_=e.busy||g||M;async function P(){if(!_){x(!0),S(null),N(null);try{const F=await e.onSaveMatrix({LOW:m.LOW,MED:m.MED,HIGH:m.HIGH});if(F&&F.ok===!1){S(F.error?.message??"保存模型矩阵失败");return}const A=window.localStorage.getItem(ma)?.trim();if(A)try{const L=await fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(A)}/reload`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[R1]:I1()},body:"{}"});L.ok?N("配置已保存,活动会话已重载。"):L.status===409?N("配置已保存;活动会话正忙(PI_SESSION_BUSY),请稍后手动重载。"):N("配置已保存;活动会话重载未完成,请手动重载。")}catch{N("配置已保存;活动会话重载未完成,请手动重载。")}else N("配置已保存,检测结果已刷新。")}catch(F){S(F instanceof Error?F.message:String(F))}finally{x(!1)}}}return u.jsxs("section",{className:"panel models-page","aria-labelledby":"models-title",children:[u.jsxs("div",{className:"models-header",children:[u.jsx("h2",{id:"models-title",children:"模型与认证"}),u.jsx("span",{className:"models-status-pill","data-state":t,"data-testid":"models-readiness-pill",children:B3[t]??t})]}),u.jsxs("p",{className:"panel-lead",children:["复用 Pi ModelRuntime 凭据平面;密钥不会回传到页面。请用"," ",u.jsx("code",{children:"pi"})," 或 Pi 认证存储完成配置,然后刷新就绪探测。"]}),u.jsxs("section",{className:"models-probe-card","aria-labelledby":"models-probe-title","data-testid":"readiness-details",children:[u.jsx("h3",{id:"models-probe-title",className:"models-subtitle",children:"就绪检查"}),u.jsx("ul",{className:"models-probe-list",children:wL.map(F=>{const A=n?.[F.key],L=a[F.detailKey],Z=A===void 0;return u.jsxs("li",{className:`models-probe-item${Z?" is-pending":A?" is-ok":" is-bad"}`,children:[u.jsx("span",{className:"models-probe-badge","aria-label":Z?"未探测":A?"通过":"未通过",children:Z?"—":A?"✓":"✕"}),u.jsxs("div",{className:"models-probe-body",children:[u.jsx("strong",{children:F.label}),u.jsx("span",{className:"muted",children:F.hint}),L?u.jsx("p",{className:"models-probe-detail",children:L}):null]})]},F.key)})})]}),u.jsxs("section",{className:"models-matrix-card","aria-labelledby":"models-matrix-title","data-testid":"models-matrix-editor",children:[u.jsx("h3",{id:"models-matrix-title",className:"models-subtitle",children:"Herness模型矩阵(LOW/MED/HIGH)"}),u.jsxs("p",{className:"models-matrix-lead",children:["从 Pi 可用模型中选择 ",u.jsx("code",{children:"provider/model"})," 或裸 model id; 保存后原子写入 ",u.jsx("code",{children:"executors.pi"})," 并自动重测就绪。"]}),u.jsx("div",{className:"models-matrix-list",children:A1.map(F=>u.jsxs("div",{className:"models-matrix-row",children:[u.jsxs("label",{htmlFor:`pi-model-${F}`,children:[F," 档",R[F]?u.jsxs("span",{className:"error","data-testid":`pi-model-error-${F}`,children:[" ","— ",R[F]]}):null]}),u.jsx(xL,{id:`pi-model-${F}`,value:m[F],models:h,onChange:A=>p(L=>({...L,[F]:A})),ariaInvalid:R[F]!==void 0,"data-testid":`pi-model-select-${F}`})]},F))}),y?u.jsx("p",{className:"error","data-testid":"models-matrix-save-error",children:y}):null,T?u.jsx("p",{className:"muted","data-testid":"models-matrix-save-notice",children:T}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:_,"data-testid":"models-matrix-save",onClick:()=>{P()},children:g||e.busy?"保存中…":"保存模型矩阵"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e.busy||g,"data-testid":"models-matrix-refresh-models",onClick:e.onRefreshReadiness,children:e.busy?"刷新中…":"刷新模型"})]})]}),t==="setup-required"?u.jsxs("div",{className:"models-setup-card","data-testid":"models-setup-hint",children:[u.jsx("h3",{className:"models-subtitle",children:"如何完成配置"}),u.jsxs("ol",{className:"models-setup-steps",children:[u.jsxs("li",{children:["在终端配置 Pi 认证(例如 ",u.jsx("code",{children:"pi auth login"}),")或写入 provider API key。"]}),u.jsxs("li",{children:["确认 agent 目录下 ",u.jsx("code",{children:"models.json"})," / 认证文件可读。"]}),u.jsx("li",{children:"点击下方「刷新就绪探测」,或运行诊断命令查看详情。"})]}),u.jsx("pre",{className:"cmd",children:z3})]}):null,t==="degraded"?u.jsx("p",{className:"models-degraded-note","data-testid":"models-degraded-note",children:"Pi 暂时降级:仍可恢复草稿与需求访谈;部分写入/运行类操作会被拦截。"}):null,s.length>0?u.jsxs("div",{className:"models-blocked-card",children:[u.jsx("h3",{className:"models-subtitle",children:"当前受限操作"}),u.jsx("ul",{className:"models-blocked-list",children:s.map(F=>u.jsx("li",{children:u.jsx("code",{children:F})},F))})]}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:e.busy,onClick:e.onRefreshReadiness,children:"刷新就绪探测"}),o?u.jsxs("span",{className:"muted models-generated-at",children:["上次探测:",o]}):null]}),u.jsxs("details",{className:"models-raw-details",children:[u.jsx("summary",{children:"查看原始探测数据(调试)"}),u.jsx("pre",{className:"cmd models-raw-json",children:JSON.stringify(c,null,2)})]})]})}const EL=[{value:"requirements-changed",label:"需求已变更"},{value:"suspected-runaway",label:"疑似失控"},{value:"resource-protection",label:"保护资源"},{value:"operator-request",label:"操作者请求"},{value:"other",label:"其他"}];function _3(e){const{lane:t,cta:n,planSummary:a,reason:s,busy:o,confirmRef:c}=e;return!n||n.lane!==t?null:u.jsxs("div",{ref:c,className:"recovery-confirm","data-testid":"recovery-confirm",children:[u.jsxs("h3",{children:["待确认:",n.label]}),u.jsx("p",{className:"muted",children:n.id==="reconcile"?"破坏性对账需经浏览器 Human Gate 确认。请核对运行与原因后再点「确定」。":n.id==="interrupt"?"协作中止需经浏览器 Human Gate。原因已按当前运行预填,可改分类或编辑后再确定。提交只表示请求已登记,当前节点仍会跑完。":"核对上方运行 / 节点与恢复原因后直接执行;服务端会校验资格,不再走 Human Gate。"}),n.id==="interrupt"?u.jsxs("fieldset",{className:"recovery-reason-code","data-testid":"recovery-interrupt-reason-code",disabled:o,children:[u.jsx("legend",{children:"原因分类"}),u.jsx("div",{className:"recovery-reason-code-group",children:EL.map(d=>{const h=(e.reasonCode??"operator-request")===d.value;return u.jsxs("label",{className:h?"recovery-reason-code-option is-active":"recovery-reason-code-option",children:[u.jsx("input",{type:"radio",name:"recovery-interrupt-reason-code",value:d.value,checked:h,onChange:()=>e.onReasonCodeChange?.(d.value)}),d.label]},d.value)})})]}):null,a?u.jsxs("div",{className:"recovery-plan-summary",children:[u.jsxs("p",{className:"muted",children:["计划 eligible=",String(a.eligible??"—")," · 风险=",q3[a.risk??""]??a.risk??"—"]}),a.effectiveFromNodeId?u.jsxs("p",{className:"muted",children:["有效起点:",a.effectiveFromNodeId]}):null,a.estimatedExecution?u.jsxs("p",{className:"muted",children:["将执行 ",a.estimatedExecution.nodeCount??"?"," 个节点 / ",a.estimatedExecution.piCallCount??"?"," 次 Pi;预计避免"," ",a.estimatedExecution.avoidedNodeCount??"?"," 个节点"]}):null,a.planHash?u.jsxs("p",{className:"muted",children:["planHash: ",u.jsxs("code",{children:[a.planHash.slice(0,16),"…"]})]}):null]}):n.id==="dagRerun"?u.jsx("p",{className:"muted",children:"未加载计划摘要;点「确定」前将再次尝试资格检查。"}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:o||!s.trim(),"data-testid":"recovery-confirm-submit",onClick:e.onSubmit,children:"确定"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-confirm-cancel",onClick:e.onCancel,children:"取消"})]})]})}function TL(e){const{shell:t,recovery:n,wizard:a}=e,{busy:s}=t,o=cw({interruptStatus:n.interruptEligibility?.interruptStatus,dagStatus:n.recoveryRunStatus,failureCategory:n.recoveryFailureCategory,targetOperationState:n.interruptEligibility?.targetOperationState}),c={planSummary:n.recoveryPlanSummary,reason:n.recoveryReason,reasonCode:n.interruptReasonCode,onReasonCodeChange:n.setInterruptReasonCode,busy:s,confirmRef:n.recoveryConfirmRef,onSubmit:()=>{n.submitRecoveryConfirm()},onCancel:()=>{n.setRecoveryConfirm(null),n.setRecoveryPlanSummary(null)}};return u.jsxs("section",{className:"panel","aria-labelledby":"recovery-title",children:[u.jsx("h2",{id:"recovery-title",children:"恢复"}),u.jsxs("p",{className:"muted",children:["事实分类:",H3[n.recoveryFact]," · 无 Cancel · 无「直接改代码」"]}),n.frontendRecovery?u.jsxs("div",{className:"muted","data-testid":"frontend-recovery-lineage",style:{marginBottom:"0.75rem"},children:[u.jsxs("div",{children:["前端恢复:outcome=",u.jsx("code",{children:n.frontendRecovery.outcome??"—"})," phase=",u.jsx("code",{children:n.frontendRecovery.phase??"—"})]}),u.jsxs("div",{children:["root ",u.jsx("code",{children:n.frontendRecovery.recoveryRootRunId??"—"}),n.frontendRecovery.parentRunId?` · parent ${n.frontendRecovery.parentRunId}`:"",n.frontendRecovery.childRunId?` · child ${n.frontendRecovery.childRunId}`:"",n.frontendRecovery.attemptIndex!==void 0?` · attempt ${n.frontendRecovery.attemptIndex}`:""]})]}):null,u.jsxs("ol",{className:"muted recovery-steps",children:[u.jsx("li",{children:"上方选 DAG 运行 / 节点,用「DAG 运行恢复」动作"}),u.jsx("li",{children:"Worker 持有的失败 run 用下方「Worker Task 重排队」;独立 DAG run 无法从节点恢复时才用「带反馈重新执行任务」"}),u.jsx("li",{children:"带 * 的动作:核对预填原因后点「确定」。重跑/重试直接执行;对账与中止运行走 Human Gate"})]}),o?u.jsxs("p",{className:"muted","data-testid":"recovery-interrupt-status",children:["中止进度:",o]}):null,n.recoveryFact==="running-active"&&n.interruptEligibility&&!n.interruptEligibility.eligible&&(!n.interruptEligibility.interruptStatus||n.interruptEligibility.interruptStatus==="none")?u.jsx("p",{className:"muted","data-testid":"recovery-interrupt-unavailable",children:n.interruptEligibility.ownerKind==="worker-managed"?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":n.interruptEligibility.message??"当前运行不具备协作中止资格。"}):null,u.jsxs("p",{className:"muted",children:[a.taskId.trim()?`按任务 ${a.taskId.trim()} 拉取候选。`:"未填任务 ID 时列出最近 DAG 运行。","Doctor 诊断可选,不是重跑前置。"," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s||n.recoveryRunsLoading,"data-testid":"recovery-refresh-candidates",onClick:()=>{n.loadRecoveryRuns()},children:n.recoveryRunsLoading?"刷新中…":"刷新候选"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"DAG 运行 ID"}),!n.manualRunId&&n.recoveryRuns.length>0?u.jsxs("select",{"data-testid":"recovery-run-select",value:n.dagRunId,disabled:s||n.recoveryRunsLoading,onChange:d=>{n.setManualRunId(!1),n.setManualNodeId(!1),n.setFromNodeId(""),n.setDagRunId(d.target.value),n.recoveryReasonTouched||n.setRecoveryReasonTouched(!1)},children:[n.recoveryRuns.some(d=>d.dagRunId===n.dagRunId)?null:u.jsx("option",{value:n.dagRunId||"",children:n.dagRunId?`${n.dagRunId}(当前)`:"— 请选择 —"}),n.recoveryRuns.map(d=>u.jsx("option",{value:d.dagRunId,children:yw(d)},d.dagRunId))]}):u.jsx("input",{"data-testid":"recovery-run-input",value:n.dagRunId,disabled:s,onChange:d=>{n.setManualRunId(!0),n.setDagRunId(d.target.value.trim())},placeholder:"dag-run-id(节点恢复/完整重新执行)"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-run-manual-toggle",onClick:()=>{if(!n.manualRunId&&n.recoveryRuns.length>0){n.setManualRunId(!0);return}n.setManualRunId(!1),n.loadRecoveryRuns()},children:!n.manualRunId&&n.recoveryRuns.length>0?"手动输入运行 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsxs("span",{className:"muted",children:["起始节点 ID(从失败节点恢复)",n.recoveryNodesLoading?" · 加载节点…":""]}),!n.manualNodeId&&n.recoveryNodes.length>0?u.jsxs("select",{"data-testid":"recovery-node-select",value:n.fromNodeId,disabled:s||n.recoveryNodesLoading,onChange:d=>{n.setManualNodeId(!1),n.setFromNodeId(d.target.value)},children:[n.recoveryNodes.some(d=>d.nodeId===n.fromNodeId)?null:u.jsx("option",{value:n.fromNodeId||"",children:n.fromNodeId?`${n.fromNodeId}(当前)`:"— 请选择 —"}),n.recoveryNodes.map(d=>u.jsx("option",{value:d.nodeId,children:xw(d)},d.nodeId))]}):u.jsx("input",{"data-testid":"recovery-node-input",value:n.fromNodeId,disabled:s,onChange:d=>{n.setManualNodeId(!0),n.setFromNodeId(d.target.value.trim())},placeholder:"例如 review-verdict-recovery-pi"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-node-manual-toggle",onClick:()=>{if(!n.manualNodeId&&n.recoveryNodes.length>0){n.setManualNodeId(!0);return}n.setManualNodeId(!1),n.loadRecoveryNodes(n.dagRunId)},children:!n.manualNodeId&&n.recoveryNodes.length>0?"手动输入节点 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"恢复原因(已按 run/节点失败事实自动预填,可编辑)"}),u.jsx("textarea",{"data-testid":"recovery-reason",value:n.recoveryReason,disabled:s,rows:4,onChange:d=>{n.setRecoveryReasonTouched(!0),n.setRecoveryReason(d.target.value)},placeholder:"将自动预填 operator-recovery / run / from-node / detail"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-reason-refresh",onClick:()=>{n.setRecoveryReasonTouched(!1),n.setRecoveryReason(n.buildCurrentRecoveryReason(n.recoveryConfirm?.label))},children:"重新预填原因"})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-dag",children:[u.jsx("h3",{children:"DAG 运行恢复"}),u.jsx("p",{className:"muted",children:"针对 `.harness/dag-runs` 的 Agent DAG 运行。橙色为当前建议;带 * 需确认原因。"}),u.jsxs("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-dag",children:[n.recoveryLanes.dag.map(d=>{const h=d.id===n.recommendedCtaId;return u.jsxs("button",{type:"button",className:h?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"aria-pressed":n.recoveryConfirm?.id===d.id?!0:void 0,"data-testid":`recovery-cta-${d.id}`,"data-recommended":h?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!n.dagRunId.trim(),"data-testid":"recovery-dag-preview",title:"在本页侧栏预览,可关闭返回",onClick:()=>{if(!n.dagRunId.trim()){t.setOpError("侧栏预览需要先选择 DAG 运行 ID");return}n.setInspectSplitOpen(!0)},children:"侧栏预览"})]}),n.recoveryReport?u.jsxs("div",{className:"recovery-report","data-testid":"recovery-report",children:[u.jsxs("div",{className:"recovery-report-header",children:[u.jsx("h3",{children:"交接报告摘要"}),u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"recovery-report-close",onClick:()=>n.setRecoveryReport(null),children:"关闭"})]}),u.jsxs("dl",{className:"recovery-report-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"运行"}),u.jsx("dd",{children:u.jsx("code",{children:n.recoveryReport.runId})})]}),n.recoveryReport.title?u.jsxs("div",{children:[u.jsx("dt",{children:"标题"}),u.jsx("dd",{children:n.recoveryReport.title})]}):null,u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:n.recoveryReport.status??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"失败分类"}),u.jsx("dd",{children:n.recoveryReport.category??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"建议"}),u.jsx("dd",{children:n.recoveryReport.recommendation??"暂无结构化建议"})]})]}),u.jsxs("p",{className:"muted",children:["完整 Markdown 可用 CLI:",u.jsxs("code",{children:["loop-agent dag report --run-id"," ",n.recoveryReport.runId," --markdown"]})]})]}):null,u.jsx(_3,{lane:"dag",cta:n.recoveryConfirm,...c})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-worker",children:[u.jsx("h3",{children:"Worker Task 重排队"}),u.jsx("p",{className:"muted",children:"针对 agent-worker Task Pool,不是 DAG run。需要 Task ID;Feature ID 可选。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Task ID(Worker 重排队必填)"}),u.jsx("input",{"data-testid":"recovery-worker-task-id",value:a.taskId,disabled:s,onChange:d=>a.setTaskId(d.target.value.trim()),placeholder:"harness / worker task-id"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature ID(可选)"}),u.jsx("input",{"data-testid":"recovery-feature-id",value:n.featureId,disabled:s,onChange:d=>n.setFeatureId(d.target.value.trim()),placeholder:"feature-id"})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-worker",children:n.recoveryLanes.worker.length>0?n.recoveryLanes.worker.map(d=>u.jsxs("button",{type:"button",className:d.id===n.recommendedCtaId?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"data-testid":`recovery-cta-${d.id}`,"data-recommended":d.id===n.recommendedCtaId?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)):u.jsx("p",{className:"muted","data-testid":"recovery-worker-unavailable",children:"当前事实分类下不提供 Worker 重排队。"})}),u.jsx(_3,{lane:"worker",cta:n.recoveryConfirm,...c})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row",hidden:!0,children:n.recoveryCtas.map(d=>u.jsx("span",{children:d.id},d.id))}),n.observeLinkMessage?u.jsxs("p",{className:"muted",children:["[",T9[n.observeLinkStatus],"]"," ",n.observeLinkMessage]}):null,n.observeUrl?u.jsx("p",{className:"muted",children:u.jsx("a",{className:"external-link",href:n.observeUrl,children:n.observeUrl})}):null]})}function CL(e){const{health:t,readiness:n,healthError:a,layers:s,setupBlocked:o,degraded:c}=e;return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"panel","aria-labelledby":"settings-title",children:[u.jsx("h2",{id:"settings-title",children:"设置"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"产品"}),u.jsx("dd",{children:t?.productName??"Loop Operator Console"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库根目录"}),u.jsx("dd",{children:u.jsx("code",{children:t?.repoRoot??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库指纹"}),u.jsx("dd",{children:u.jsx("code",{title:t?.repoFingerprint??void 0,children:t?.repoFingerprint?`${t.repoFingerprint.slice(0,12)}…`:"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Pi 就绪"}),u.jsxs("dd",{children:[u.jsxs("code",{children:[B3[n]??n,"(",n,")"]}),o?u.jsx("p",{className:"muted",children:"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。请前往「模型与认证」。"}):c?u.jsx("p",{className:"muted",children:"Pi 暂时降级:仍可恢复草稿与需求访谈。"}):null]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Inspect"}),u.jsxs("dd",{children:[u.jsx("code",{children:"/inspect/"}),"(同一 Console 进程)"]})]})]}),a?u.jsx("p",{className:"error",children:a}):null]}),u.jsxs("section",{className:"panel","aria-labelledby":"layers-title",children:[u.jsx("h2",{id:"layers-title",children:"完成语义分层"}),u.jsx("p",{className:"muted",children:"MVP 不执行收尾提交;不显示「任务已关闭/已交付」。"}),u.jsxs("dl",{className:"kv","data-testid":"completion-layers",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"命令"}),u.jsx("dd",{children:bu(s.command)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"DAG 生命周期"}),u.jsx("dd",{children:bu(s.dag)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"最终验证"}),u.jsx("dd",{children:bu(s.verification)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"晋升"}),u.jsx("dd",{children:bu(s.promote)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务关闭"}),u.jsx("dd",{children:"不可用(MVP)"})]})]})]})]})}function NL(e){const t=(e??"").trim().toLowerCase();return t?t.includes("running")||t==="in_progress"||t==="active"?"running":t.includes("fail")||t.includes("error")||t==="blocked"?"failed":t.includes("finish")||t.includes("success")||t==="done"||t==="ok"?"finished":t.includes("skip")?"skipped":"pending":"pending"}function RL(e){const t=String(e.nodeId??e.id??"").trim();return{nodeId:t,label:String((e.label??e.name??t)||"未命名节点"),status:String(e.status??""),rank:typeof e.rank=="string"?e.rank:void 0,startedAt:typeof e.startedAt=="string"?e.startedAt:void 0,durationMs:typeof e.durationMs=="number"?e.durationMs:void 0,errorPreview:typeof e.errorPreview=="string"?e.errorPreview:void 0}}function _m(e,t){if(!e)return null;const n=Date.parse(e);if(Number.isNaN(n))return null;const a=t-n;return a>=0?a:null}function AL(e,t=Date.now()){if(!e)return{total:0,finished:0,running:null,failed:null,terminal:!1,effectiveStatus:null,stalled:!1,currentNodeElapsedMs:null,runElapsedMs:null};const a=(Array.isArray(e.nodes)?e.nodes:[]).map(RL),s=a.map(S=>NL(S.status)),o=s.filter(S=>S==="finished"||S==="skipped").length,c=s.indexOf("running"),d=c>=0?a[c]:null,h=s.indexOf("failed"),m=h>=0?a[h]:null,p=String(e.effectiveStatus??e.status??"").toLowerCase(),g=IL.has(p),x=typeof e.startedAt=="string"?e.startedAt:void 0,y=typeof e.durationMs=="number"?e.durationMs:void 0;return{total:a.length,finished:o,running:d,failed:m,terminal:g,effectiveStatus:p||null,stalled:p==="running-suspected-stall",currentNodeElapsedMs:d?.durationMs??_m(d?.startedAt,t),runElapsedMs:g?y??_m(x,t):_m(x,t)}}const IL=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function M3(e){if(e==null||!Number.isFinite(e)||e<0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n} 时 ${a} 分`:a>0?`${a} 分 ${s} 秒`:`${s} 秒`}const _L=5e3;function ML(e){const[t,n]=w.useState(null);return w.useEffect(()=>{const a=e.trim();if(n(null),!a)return;const s=new AbortController;let o;const c=async()=>{try{const d=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(a)}`),{credentials:"same-origin",signal:s.signal});if(!d.ok)return;const h=await d.json();if(s.signal.aborted)return;n(h),Dm(h)&&o!==void 0&&(window.clearInterval(o),o=void 0)}catch{}};return c(),o=window.setInterval(()=>{c()},_L),()=>{s.abort(),o!==void 0&&window.clearInterval(o)}},[e]),w.useMemo(()=>AL(t),[t])}function OL(e){const t=[`fragments=${e.fragmentCount}`,`canonical=${e.canonicalRequirementCount}`,`context-only=${e.contextOnlyCount}`,`duplicate=${e.duplicateCount}`,`unresolved=${e.unresolvedCount}`,`conflict=${e.conflictCount}`];return e.bindingSchemaVersion===2&&(t.push(`binding=v2${e.stale?" · STALE(输入漂移)":""}`),e.ledgerSha256&&t.push(`ledgerSha256=${e.ledgerSha256}`),e.inputDigest&&t.push(`inputDigest=${e.inputDigest}`)),t.join(" ")}function wp(e){const{ledgerLoading:t=!1,ledgerError:n=null,ledgerSummary:a=null}=e;return u.jsxs("div",{className:"contract-checks","data-testid":"ledger-summary-block","aria-busy":t||void 0,"aria-labelledby":"ledger-summary-heading",children:[u.jsx("h4",{id:"ledger-summary-heading",children:"Source fidelity ledger"}),t?u.jsxs("p",{className:"muted",role:"status",children:[u.jsx("span",{className:"sr-only",children:"ledger 加载中"}),"加载中…"]}):n?u.jsxs("p",{className:"muted",role:"alert",children:["ledger 只读接口失败:",n,"(安全降级,不展示敏感内容)"]}):!a||a.present!==!0?u.jsx("p",{className:"empty",role:"status",children:"无 source fidelity ledger(任务无引用或 ledger 缺失,不伪造计数)"}):u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:[u.jsx("strong",{children:"gate"}),": ",w9(a.gateStatus),a.bindingSchemaVersion===2?u.jsxs(u.Fragment,{children:[" ",u.jsxs("code",{"data-testid":"ledger-binding-version",children:["binding v2",a.stale?" · STALE":""]})]}):null,a.failureCode?u.jsxs(u.Fragment,{children:[" ",u.jsx("code",{"data-testid":"ledger-failure-code",children:a.failureCode})]}):null]}),u.jsx("pre",{className:"cmd","data-testid":"ledger-summary",children:OL(a)}),a.exclusions.length>0?u.jsx("ul",{"data-testid":"ledger-exclusions",children:a.exclusions.slice(0,10).map(s=>u.jsxs("li",{className:"muted",children:[u.jsx("code",{children:s.fragmentId}),": ",s.reason]},s.fragmentId))}):null]})]})}function DL(e){const{busy:t,taskId:n,confirmationId:a,confirmationDetails:s,ledgerLoading:o=!1,ledgerError:c=null,ledgerSummary:d=null,runAction:h,onConfirmAndRun:m}=e;return u.jsxs("div",{"data-testid":"panel-dag-confirm",children:[u.jsx("h3",{children:"DAG 确认(§5.5)"}),u.jsxs("ul",{className:"checklist",children:[u.jsx("li",{children:"源绑定(source)"}),u.jsx("li",{children:"Writer 写集范围(writer-scope)"}),u.jsx("li",{children:"验证命令(verification)"}),u.jsx("li",{children:"人工门禁(human-gates)"})]}),s?u.jsx("pre",{className:"cmd",children:JSON.stringify(s,null,2).slice(0,4e3)}):null,u.jsx(wp,{ledgerLoading:o,ledgerError:c,ledgerSummary:d}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{h("prepareDagConfirmation",{taskId:n,dagHandle:`${n}.dag.json`,profile:"auto"})},children:"生成 DAG 并准备确认"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!a,onClick:m,children:"开始运行"})]}),a?u.jsxs("p",{className:"muted",children:["确认 ID: ",u.jsx("code",{children:a})]}):null]})}function jL(e){const{busy:t,degraded:n,taskId:a,assessmentId:s,contractValidateOk:o,contractValidateSummary:c,contractDiffSummary:d,contractApplied:h,spineOk:m,ledgerLoading:p=!1,ledgerError:g=null,ledgerSummary:x=null,onRerunPreflight:y,onApplyContract:S,onRetrySpine:T}=e;return u.jsxs("div",{"data-testid":"panel-contract",children:[u.jsx("h3",{children:"契约落地"}),u.jsx("p",{className:"muted",children:"进入本步后自动跑确定性校验与差异(非 AI 代判)。写入仓库仍需你人工确认一次;应用成功后会自动跑 Spine 审计。"}),u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:s??"—"})]}),u.jsxs("div",{className:"contract-checks",children:[u.jsxs("p",{children:[u.jsx("strong",{children:"校验"}),":"," ",o===null?t?"进行中…":"等待开始":o?"通过":"未通过"]}),c?u.jsx("pre",{className:"cmd","data-testid":"contract-validate-summary",children:c}):null,u.jsxs("p",{children:[u.jsx("strong",{children:"差异"}),d?"":":尚未拉取"]}),d?u.jsx("pre",{className:"cmd","data-testid":"contract-diff-summary",children:d}):null,h?u.jsxs("p",{children:[u.jsx("strong",{children:"Spine"}),":"," ",m===null?"待检查":m?"通过":"未通过"]}):null]}),u.jsx(wp,{ledgerLoading:p,ledgerError:g,ledgerSummary:x}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||!a.trim(),onClick:y,children:"重新校验"}),u.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"contract-apply",disabled:t||n||!s||o!==!0||h,onClick:S,children:"确认并应用契约"}),h&&m===!1?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:T,children:"重试 Spine"}):null]})]})}function LL(e){const{busy:t,taskKind:n,onTaskKindChange:a,workflowHint:s,prd:o,engineering:c,onEngineeringChange:d,onImport:h}=e,m=t||o.prdFileReading;return u.jsxs("div",{"data-testid":"panel-import-prd",children:[u.jsx("h3",{children:"导入需求"}),u.jsx("p",{className:"muted",children:"粘贴、选择或拖入一份或多份 PRD / 需求 Markdown。多文件会分别归档到 source/references,并合成一份可编辑正文。创建前可继续编辑。 系统会对 PRD 做确定性/语义结构化;工程边界(路径与验证)须人类确认,不会由模型编造。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"流程类型"}),u.jsx("select",{"data-testid":"workflow-kind-select",value:n,disabled:t||o.prdFileReading,onChange:p=>a(p.target.value),children:Om.map(p=>u.jsx("option",{value:p.kind,children:p.label},p.kind))})]}),u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-hint",children:[s," · taskKind=",u.jsx("code",{children:n})]}),u.jsxs("div",{className:`prd-drop-zone${o.prdDragOver?" is-dragover":""}`,"data-testid":"prd-drop-zone","data-dragover":o.prdDragOver?"true":"false",onDragEnter:p=>o.onDragEnter(p,m),onDragOver:p=>{p.preventDefault(),p.stopPropagation()},onDragLeave:o.onDragLeave,onDrop:p=>o.onDrop(p,m),children:[u.jsxs("div",{className:"prd-upload-toolbar",children:[u.jsxs("label",{className:`btn btn-ghost prd-upload-btn${m?" is-disabled":""}`,children:["选择需求文档",u.jsx("input",{type:"file",accept:V9,multiple:!0,hidden:!0,disabled:m,"data-testid":"prd-file-input",onChange:p=>{const g=p.currentTarget;o.loadPrdFromFiles(g.files).finally(()=>{g.value=""})}})]}),u.jsxs("span",{className:"muted prd-upload-hint",children:["支持多文件 .md / .markdown / .txt,单文件最大"," ",Lm(jm),",最多 ",Gu," 个"]}),o.prdDocuments.length>0?u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"prd-recompose",disabled:m,onClick:o.recomposeDocuments,children:"按文件重新合成"}):null]}),o.prdDocuments.length>0?u.jsx("ul",{className:"prd-file-list","data-testid":"prd-file-list",children:o.prdDocuments.map((p,g)=>u.jsxs("li",{className:g===o.prdPrimaryIndex?"is-primary":void 0,"data-testid":`prd-file-item-${g}`,children:[u.jsxs("span",{className:"prd-file-item-name",children:[p.fileName,g===o.prdPrimaryIndex?u.jsx("span",{className:"prd-file-primary-tag",children:"主"}):null,u.jsxs("span",{className:"muted",children:[" ","· ",Lm(p.sourceBytes)]})]}),u.jsxs("span",{className:"prd-file-item-actions",children:[u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===o.prdPrimaryIndex,onClick:()=>o.setPrimaryDocument(g),children:"设为主"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===0,onClick:()=>o.moveDocument(g,-1),children:"上移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m||g===o.prdDocuments.length-1,onClick:()=>o.moveDocument(g,1),children:"下移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:m,onClick:()=>o.removeDocument(g),children:"移除"})]})]},`${p.fileName}-${g}`))}):null,o.prdDocuments.length>0?u.jsxs("div",{className:"prd-file-meta",children:[u.jsxs("span",{children:["分卷=上传原件(将分别归档);正文=本会话采用稿",o.prdComposedDirty?"(已手动编辑)":""]}),u.jsx("button",{type:"button",className:"btn btn-ghost prd-file-clear","data-testid":"prd-file-clear",disabled:m,onClick:o.clearDocuments,children:"清除来源列表"})]}):null,o.prdDragOver?u.jsx("p",{className:"prd-drop-hint","data-testid":"prd-drop-hint",children:"释放以载入"}):null,u.jsxs("label",{className:"field prd-text-field",children:[u.jsx("span",{className:"muted",children:"PRD Markdown"}),u.jsx("textarea",{rows:10,value:o.prdText,disabled:m,"data-testid":"prd-textarea",onChange:p=>o.onPrdTextChange(p.target.value)})]})]}),o.prdFileError?u.jsx("p",{className:"prd-file-error",role:"alert","aria-live":"polite","data-testid":"prd-file-error",children:o.prdFileError}):null,u.jsxs("details",{className:"engineering-boundary","data-testid":"engineering-boundary",children:[u.jsx("summary",{children:"工程边界(可选,人类确认)"}),u.jsxs("p",{className:"muted",children:["逗号或换行分隔。留空则 intake 后进入访谈补齐;不会自动填",u.jsx("code",{children:"src/worker/console/**"})," 模板。"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"allowedPaths"}),u.jsx("textarea",{rows:2,value:c.allowedPathsText,disabled:m,"data-testid":"prd-allowed-paths",placeholder:"src/**, test/**",onChange:p=>d({allowedPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"forbiddenPaths"}),u.jsx("textarea",{rows:2,value:c.forbiddenPathsText,disabled:m,"data-testid":"prd-forbidden-paths",placeholder:".harness/**, node_modules/**",onChange:p=>d({forbiddenPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"verifyCommands(label:command 或纯命令)"}),u.jsx("textarea",{rows:2,value:c.verifyCommandsText,disabled:m,"data-testid":"prd-verify-commands",placeholder:"typecheck:npm run typecheck",onChange:p=>d({verifyCommandsText:p.target.value})})]})]}),u.jsx("div",{className:"cta-row",children:u.jsxs("button",{type:"button",className:`btn btn-primary${t?" is-loading":""}`,disabled:t||o.prdFileReading||!o.prdText.trim(),"aria-busy":t||void 0,onClick:h,children:[t?u.jsx("span",{className:"spinner","aria-hidden":"true"}):null,t?"导入中…":"导入并创建任务"]})})]})}function zL(e){const{busy:t,taskId:n,taskTitle:a,taskKind:s,sessionId:o,question:c,answerText:d,onAnswerTextChange:h,draftSummary:m,assessmentId:p,runAction:g}=e;return u.jsxs("div",{"data-testid":"panel-interview",children:[u.jsx("h3",{children:"需求访谈(grill-me)"}),u.jsx("p",{className:"muted",children:"一次一问;也可跳过:系统会按推荐补齐草稿并签发评估,随后进入校验。 访谈中不可应用契约 / 运行 DAG / 对账。"}),m?u.jsx("pre",{className:"cmd","data-testid":"draft-summary",children:JSON.stringify(m,null,2)}):null,u.jsxs("div",{className:"cta-row",style:{marginBottom:"0.75rem"},children:[!o||!c?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n.trim(),onClick:()=>{g("interviewStart",{taskId:n,title:a,taskKind:s})},children:"开始 / 继续访谈"}):null,u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"interview-skip",disabled:t||!n.trim(),onClick:()=>{g("interviewSkip",{taskId:n,title:a,taskKind:s})},children:"跳过访谈"})]}),o&&c?u.jsxs("div",{className:"interview-card",children:[u.jsxs("p",{className:"interview-q",children:[u.jsx("strong",{children:c.id})," · 风险=",q3[c.risk??""]??c.risk??"—"]}),u.jsx("p",{children:c.text}),c.recommendation?u.jsxs("p",{className:"muted",children:["推荐:",c.recommendation]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"你的回答(覆盖推荐)"}),u.jsx("textarea",{rows:3,value:d,disabled:t,onChange:x=>h(x.target.value)})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"accept-recommendation"}).then(()=>h(""))},children:"接受推荐"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!d.trim(),onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"override",text:d}).then(()=>h(""))},children:"提交自定义回答"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||c.risk==="high",onClick:()=>{g("interviewTurn",{sessionId:o,questionId:c.id,response:"defer",text:d||c.recommendation}).then(()=>h(""))},children:"暂缓(非高风险)"})]})]}):null,p?u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:p})]}):null]})}function BL({progress:e}){const t=e.total>0?Math.round(e.finished/e.total*100):0;return u.jsxs("div",{className:"run-progress","data-testid":"run-progress",children:[u.jsxs("div",{className:"run-progress-head",children:[u.jsxs("b",{children:["节点进度 ",e.finished,"/",e.total||"—",e.total>0?`(${t}%)`:""]}),u.jsx("span",{className:`run-progress-status${e.stalled?" is-stalled":""}`,"data-testid":"run-progress-status",children:e.effectiveStatus??"未知状态"})]}),u.jsx("div",{className:"run-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.finished,"aria-label":"DAG 节点完成进度",children:u.jsx("span",{style:{width:`${t}%`}})}),u.jsx("p",{className:"run-progress-current","data-testid":"run-progress-current",children:e.running?u.jsxs(u.Fragment,{children:["当前节点:",u.jsx("strong",{children:e.running.label}),"(已运行 ",M3(e.currentNodeElapsedMs),")"]}):e.terminal?u.jsxs(u.Fragment,{children:["运行已结束(总时长 ",M3(e.runElapsedMs),")"]}):u.jsx(u.Fragment,{children:"暂无正在运行的节点"})}),e.stalled?u.jsx("p",{className:"run-progress-stall","data-testid":"run-progress-stall",children:"疑似停滞:超过阈值没有实质进展。可打开检视查看节点活动,或到恢复页 使用协作中止 / 诊断入口判断是否继续等待。"}):null,e.failed?u.jsxs("p",{className:"run-progress-failed","data-testid":"run-progress-failed",children:["失败节点:",u.jsx("strong",{children:e.failed.label}),e.failed.errorPreview?` — ${e.failed.errorPreview}`:""]}):null]})}function qL(e){const{busy:t,confirmationId:n,operationId:a,dagRunId:s,observeBusy:o,ledgerLoading:c=!1,ledgerError:d=null,ledgerSummary:h=null,sseLog:m,progress:p,runAction:g,onStopFollow:x,onShowInspectSplit:y,onOpenInspectSplit:S}=e;return u.jsxs("div",{"data-testid":"panel-run",children:[u.jsx("h3",{children:"运行详情"}),u.jsxs("div",{className:"meta-row",children:[u.jsxs("div",{children:["操作 ID: ",u.jsx("code",{children:a??"—"})]}),u.jsxs("div",{children:["确认 ID: ",u.jsx("code",{children:n??"—"})]})]}),u.jsx(wp,{ledgerLoading:c,ledgerError:d,ledgerSummary:h}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n,onClick:()=>{g("runDag",{confirmationId:n},{clientRequestId:$u("run")})},children:"重新运行"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:x,children:"停止跟随日志"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!s.trim(),onClick:y,children:"打开检视"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:o||!s.trim(),title:"在本页侧栏预览当前运行的 DAG,可关闭返回",onClick:S,children:"侧栏预览"})]}),p?u.jsx(BL,{progress:p}):null,u.jsxs("details",{className:"run-sse-log",children:[u.jsx("summary",{children:"原始事件日志(最近 80 条)"}),u.jsx("pre",{className:"cmd","data-testid":"sse-log",children:m.join(`
407
+ `)||"(尚无事件)"})]})]})}const tx=[2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3,3e4,3e4];function HL(e,t){if(e===!0)return{kind:"own"};if(e===!1)return{kind:"clear"};const n=tx[t];return n===void 0?{kind:"give-up"}:{kind:"retry",delayMs:n}}tx.reduce((e,t)=>e+t,0);function UL(){return{baseline:null,ownedRunId:"",pendingSelection:""}}function FL(e,t){const n=e.task===void 0,a=!n&&e.task!==t.task,s=!n&&e.dispatch!==t.dispatchId,o={...e,task:t.task,dispatch:t.dispatchId,pendingSelection:""};if(a)return o.baseline=null,o.ownedRunId="",{state:o,observation:{action:"reset-selection"}};if(s&&(o.ownedRunId="",t.selectedRunId))return o.baseline=t.selectedRunId,{state:o,observation:{action:"invalidate-selection"}};const c=t.selectedRunId;return c&&c!==o.ownedRunId?(o.pendingSelection=c,{state:o,observation:{action:"verify-ownership"}}):{state:o,observation:{action:c?"idle":"probe"}}}function O3(e){return{...e,baseline:null}}function $L(e,t){return{...e,baseline:t??""}}function PL(e,t){return!t.ok||!t.dagRunId?{state:e,acceptedRunId:null}:e.baseline===null||t.dagRunId===e.baseline?{state:e,acceptedRunId:null}:{state:{...e,ownedRunId:t.dagRunId},acceptedRunId:t.dagRunId}}function GL(e,t){return t?{state:{...e,ownedRunId:e.pendingSelection,pendingSelection:""},clearSelection:!1}:{state:{...e,ownedRunId:"",pendingSelection:"",baseline:null},clearSelection:!0}}async function D3(e){try{const{status:t,body:n}=await Ll("observeLink",{taskId:e});if(t>=400||n.ok===!1)return{ok:!1};const a=n.result??{};return{ok:!0,dagRunId:(typeof a.dagRunId=="string"?a.dagRunId.trim():"")||null}}catch{return{ok:!1}}}async function VL(e,t){try{const n=await fetch(Ir(`/api/dag-runs/${encodeURIComponent(e)}`),{credentials:"same-origin"});if(n.status===404)return!1;if(!n.ok)return null;const a=await n.json(),s=typeof a.taskId=="string"?a.taskId.trim():"";return s?s===t.trim():null}catch{return null}}function KL(e){const{shell:t,actions:n,wizard:a,prd:s,recovery:o}=e,{busy:c,step:d,setupBlocked:h,degraded:m}=t,p=w.useRef(UL()),g=w.useRef(0),[x,y]=w.useState(""),S=w.useCallback(R=>{const M=++g.current;p.current=O3(p.current);const _=async P=>{const F=await D3(R);if(g.current===M){if(F.ok){p.current=$L(p.current,F.dagRunId);return}P>0&&window.setTimeout(()=>{_(P-1)},1500)}};_(8)},[]);w.useEffect(()=>{if(d!=="dag-confirm")return;const R=a.taskId.trim();if(!R){g.current+=1,p.current=O3(p.current);return}S(R)},[d,a.taskId,S]),w.useEffect(()=>{if(d!=="run")return;const R=a.taskId.trim();if(!R)return;const M=FL(p.current,{task:R,dispatchId:n.operationId??null,selectedRunId:o.dagRunId.trim()});switch(p.current=M.state,y(M.state.ownedRunId),M.observation.action){case"reset-selection":{o.setManualRunId(!1),o.setDagRunId(""),S(R);return}case"invalidate-selection":{o.setManualRunId(!1),o.setDagRunId("");return}case"verify-ownership":{const _=M.state.pendingSelection;let P=!1,F=0;const A=async L=>{if(P)return;const Z=await VL(_,R);if(P)return;const U=HL(Z,L);if(U.kind==="own"||U.kind==="clear"){const $=GL(p.current,U.kind==="own");p.current=$.state,y($.state.ownedRunId),$.clearSelection&&(o.setManualRunId(!1),o.setDagRunId(""),S(R));return}U.kind==="retry"&&(F=window.setTimeout(()=>{A(L+1)},U.delayMs))};return A(0),()=>{P=!0,window.clearTimeout(F)}}case"idle":return;case"probe":{p.current.baseline===null&&S(R);let _=!1,P=0,F=0;const A=async()=>{if(_)return;if(p.current.baseline===null){F+=1,F<120&&(P=window.setTimeout(()=>{A()},1e3));return}const L=await D3(R);if(_)return;F+=1;const Z=PL(p.current,L);if(p.current=Z.state,Z.acceptedRunId){y(Z.state.ownedRunId),o.setManualRunId(!0),o.setDagRunId(Z.acceptedRunId);return}F<120&&(P=window.setTimeout(()=>{A()},2500))};return P=window.setTimeout(()=>{A()},1200),()=>{_=!0,window.clearTimeout(P)}}}},[d,n.operationId,a.taskId,o.dagRunId,o.setManualRunId,o.setDagRunId,S]);const T=o.dagRunId===x?o.dagRunId:"",N=ML(d==="run"?T:"");return u.jsxs("section",{className:"panel task-ops","aria-labelledby":"task-ops-title",children:[u.jsx("h2",{id:"task-ops-title",children:"任务操作"}),u.jsx("p",{className:"panel-lead",children:"按 Happy Path 推进;契约落地一步内自动校验,人工确认写入。"}),u.jsx("ol",{className:"wizard-steps","data-testid":"wizard-steps",children:a.wizardSteps.map((R,M)=>u.jsxs("li",{"data-active":d===R.id,"data-done":M<a.stepIndex,children:[u.jsx("span",{className:"step-index",children:String(M+1).padStart(2,"0")}),u.jsx("span",{className:"step-label",children:R.label})]},R.id))}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务 ID"}),u.jsx("input",{"data-testid":"task-id-input",value:a.taskId,disabled:c||h||d==="import-prd",placeholder:d==="import-prd"?"导入需求后自动生成":"task-id",onChange:R=>a.setTaskId(R.target.value.trim())})]}),a.taskTitle?u.jsxs("p",{className:"workflow-hint","data-testid":"task-title-chip",children:["任务名称:",a.taskTitle]}):null,d!=="import-prd"&&!h?u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-chip",children:["当前流程:",a.workflowMeta.label," ·"," ",u.jsx("code",{children:a.taskKind})]}):null,h||d==="setup"?u.jsxs("div",{className:"empty-state","data-testid":"setup-gate",children:[u.jsx("p",{className:"empty-title",children:"需要先完成设置"}),u.jsx("p",{className:"muted",children:"请先在「模型与认证」完成 Pi 就绪,再导入需求与访谈。"}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{t.selectNav("models"),n.runAction("refreshReadiness",{}).then(()=>t.loadHealth())},children:"刷新就绪状态"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{n.runAction("doctor",{})},children:"运行诊断"}),u.jsx("pre",{className:"cmd",children:z3})]})]}):u.jsxs("div",{className:"wizard-body","data-testid":"wizard-body",children:[d==="import-prd"&&u.jsx(LL,{busy:c,taskKind:a.taskKind,onTaskKindChange:a.setTaskKind,workflowHint:a.workflowMeta.hint,prd:s,engineering:a.engineering,onEngineeringChange:a.setEngineering,onImport:()=>{a.importPrdAndCreate()}}),d==="interview"&&u.jsx(zL,{busy:c,taskId:a.taskId,taskTitle:a.taskTitle,taskKind:a.taskKind,sessionId:a.sessionId,question:a.question,answerText:a.answerText,onAnswerTextChange:a.setAnswerText,draftSummary:a.draftSummary,assessmentId:a.assessmentId,runAction:n.runAction}),d==="contract"&&u.jsx(jL,{busy:c,degraded:m,taskId:a.taskId,assessmentId:a.assessmentId,contractValidateOk:a.contractValidateOk,contractValidateSummary:a.contractValidateSummary,contractDiffSummary:a.contractDiffSummary,contractApplied:a.contractApplied,spineOk:a.spineOk,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,onRerunPreflight:()=>{a.runContractPreflight(!0)},onApplyContract:()=>{a.applyContractThenSpine()},onRetrySpine:()=>{a.retrySpineOnly()}}),d==="dag-confirm"&&u.jsx(DL,{busy:c,taskId:a.taskId,confirmationId:n.confirmationId,confirmationDetails:n.confirmationDetails,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,runAction:n.runAction,onConfirmAndRun:()=>{a.confirmAndRunDag()}}),d==="run"&&u.jsx(qL,{busy:c,confirmationId:n.confirmationId,operationId:n.operationId,dagRunId:T,observeBusy:t.observeBusy,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,sseLog:n.sseLog,progress:N,runAction:n.runAction,onStopFollow:n.stopFollowSse,onShowInspectSplit:()=>{T.trim()&&o.setInspectSplitOpen(!0)},onOpenInspectSplit:()=>{T.trim()&&o.openInspectSplit()}})]})]})}function YL(e,t){if(e.has(t))return e instanceof Set?e:new Set(e);const n=new Set(e);return n.add(t),n}function WL(e,t,n){return n===!1?e instanceof Set?e:new Set(e):YL(e,t)}function Tl(e){return{hidden:!e,inert:!e,"aria-hidden":!e}}function ZL(e){const{active:t,operateTab:n,shell:a,actions:s,wizard:o,prd:c,recovery:d}=e,[h,m]=w.useState(()=>new Set),p=WL(h,n,t);return p!==h&&m(p),u.jsxs("section",{id:"workspace-operate",className:"workspace-pane workspace-pane--operate","aria-label":"操作工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[p.has("tasks")?u.jsx("div",{className:"operate-subpane",...Tl(n==="tasks"),children:u.jsx(KL,{shell:a,actions:s,wizard:o,prd:c,recovery:d})}):null,p.has("recovery")?u.jsx("div",{className:"operate-subpane",...Tl(n==="recovery"),children:u.jsx(TL,{shell:a,recovery:d,wizard:o})}):null,p.has("night")?u.jsx("div",{className:"operate-subpane",...Tl(n==="night"),children:u.jsx(bL,{busy:a.busy,runAction:s.runAction,isActionSuccess:s.isActionSuccess,setOpError:a.setOpError})}):null,p.has("models")?u.jsx("div",{className:"operate-subpane",...Tl(n==="models"),children:u.jsx(SL,{busy:a.busy,readiness:a.readiness,readinessReport:a.readinessReport,health:a.health,onRefreshReadiness:()=>{s.runAction("refreshReadiness",{}).then(()=>a.loadHealth())},onSaveMatrix:async g=>{const x=await s.runAction("savePiModelMatrix",{matrix:g});return await a.loadHealth(),x}})}):null,p.has("settings")?u.jsx("div",{className:"operate-subpane",...Tl(n==="settings"),children:u.jsx(CL,{health:a.health,readiness:a.readiness,healthError:a.healthError,layers:a.layers,setupBlocked:a.setupBlocked,degraded:a.degraded})}):null]})}async function XL(){return await import("/inspect/inspect-workspace.js")}function Mm(e,t){if(!t.active){e.setActive(!1),e.updateRoute(t.hash);return}e.updateRoute(t.hash),e.setActive(!0)}function QL(e){const{active:t,hash:n,onNavigate:a}=e,s=w.useRef(null),o=w.useRef(null),c=w.useRef(0),d=w.useRef(null),h=w.useRef(a);h.current=a;const m=w.useRef(t),p=w.useRef(n),g=w.useRef(e.workspaceId);m.current=t,p.current=n,g.current=e.workspaceId;const[x,y]=w.useState("idle"),[S,T]=w.useState(!1),N=(_,P,F)=>{_.then(A=>{if(P===c.current){if(!A){y("error");return}o.current=A,Mm(A,{active:m.current,hash:p.current}),y("ready")}}).catch(()=>{P===c.current&&y("error")}).finally(()=>{d.current===_&&(d.current=null),F?.()})},R=async()=>{const _=await XL();if(!s.current)return null;typeof _.prepareInspectWorkspace=="function"&&await _.prepareInspectWorkspace(s.current);const P={active:m.current,hash:p.current};return o.current?(Mm(o.current,P),o.current):_.mountInspectWorkspace(s.current,{hosted:!0,autoStart:!1,hash:P.hash,active:P.active,workspaceId:g.current??void 0,onNavigate:F=>h.current(F)})};w.useEffect(()=>{window.postMessage({type:"loop-console:workspace-scope",workspaceId:e.workspaceId??null},"*")},[e.workspaceId]),w.useEffect(()=>{if(o.current){Mm(o.current,{active:t,hash:n});return}if(d.current||!t||x==="error")return;const _=++c.current;y("loading");const P=R();d.current=P,N(P,_)},[t,n,x]),w.useEffect(()=>()=>{o.current?.destroy(),o.current=null},[]);const M=()=>{if(S||d.current)return;T(!0),y("loading");const _=++c.current,P=R();d.current=P,N(P,_,()=>T(!1))};return u.jsxs("section",{id:"workspace-inspect",className:"workspace-pane workspace-pane--inspect","aria-label":"观测工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[u.jsx("div",{ref:s,className:"inspect-workspace-root"}),x==="loading"&&!o.current?u.jsx("p",{className:"muted",role:"status",children:"正在加载观测工作区…"}):null,x==="error"?u.jsxs("div",{className:"workspace-inspect-error",role:"alert",children:[u.jsx("p",{children:"观测工作区加载失败。"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:S,onClick:M,children:"重试"})]}):null]})}function JL(e){const t=e==="chat"?"workspace-chat":e==="operate"?"workspace-operate":"workspace-inspect",n=document.getElementById(t);if(!(n instanceof HTMLElement))return;if(e==="chat"){n.focus();return}(n.querySelector('button:not([disabled]), [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')??n).focus()}function ez(){const e=U9(),t=Gj({}),n=w.useRef(()=>{}),a=w.useCallback(H=>n.current(H),[]),[s,o]=w.useState("chat"),[c,d]=w.useState(null),h=c?.workspaceId??t.unknownWorkspaceId,m=h?null:t.workspaceId,p=P9({shell:e,applyInterviewPayload:a,workspaceId:m}),g=sw(),x=_w({shell:e,actions:p,prd:g}),y=Aw({shell:e,actions:p,wizard:x}),[S,T]=w.useState(()=>$f(window.localStorage)),[N,R]=w.useState(()=>Tw(window.localStorage)),[M,_]=w.useState(()=>Vf(window.location,{lastOperateTab:$f(window.localStorage)})?.sessionId??null);w.useEffect(()=>{n.current=x.applyInterviewPayload}),w.useEffect(()=>{h||t.loading||e.loadHealth(t.workspaceId)},[e.loadHealth,h,t.loading,t.workspaceId]);const P=w.useRef(m);w.useEffect(()=>{P.current!==m&&(P.current=m,p.resetForWorkspaceScope(),x.setTaskId(""),y.setDagRunId(""),y.setFromNodeId(""),y.setFeatureId(""),y.setRecoveryConfirm(null),y.setInspectSplitOpen(!1),y.setInterruptIntent(!1),e.setBusy(!1),e.setOpError(null),e.setOpMessage(null))},[p,y,m,e,x]);const F=w.useCallback((H,I={},K={})=>{if(H==="operate"){const G=I.operateTab??S;T(G),Ew(G,window.localStorage),e.selectNav(G)}else H==="chat"?(e.selectNav("chat"),_(I.sessionId??null)):e.selectNav("recovery");I.taskId&&x.setTaskId(I.taskId),I.dagRunId&&y.setDagRunId(I.dagRunId),I.fromNodeId&&y.setFromNodeId(I.fromNodeId),I.featureId&&y.setFeatureId(I.featureId),y.setInterruptIntent(I.intent==="interrupt"),o(H);const X=H==="inspect"?Pf(I.inspectHref??N,I.workspaceId??m):vu({workspace:H,operateTab:I.operateTab??S,...m?{workspaceId:m}:{},...I});H==="inspect"&&(R(X),Cw(X,window.localStorage));const be=X.startsWith("/#")?X.slice(1):X.startsWith("#")?X:`#${X}`;(window.location.hash.startsWith("#")?window.location.hash:`#${window.location.hash}`)!==be&&(K.replace&&typeof history.replaceState=="function"?history.replaceState(null,"",be):window.location.hash=be),queueMicrotask(()=>JL(H))},[N,S,y.setDagRunId,y.setFeatureId,y.setFromNodeId,y.setInterruptIntent,m,e.selectNav,x.setTaskId]),A=w.useCallback((H,I={})=>{if(H==="chat"){F("chat",I);return}F("operate",{...I,operateTab:H})},[F]),L=w.useCallback(H=>{const I=Pi(H),K=Vf({pathname:"/",hash:I.startsWith("/#")?I.slice(1):I});if(!K){Es(I);return}F(K.workspace,{...K,operateTab:K.operateTab,inspectHref:K.canonicalHref},{replace:K.replace})},[F]),Z=w.useCallback(()=>{const H=Vf(window.location,{lastOperateTab:$f(window.localStorage)});if(H){const I=Sw(H.workspaceId,t.workspaces.map(K=>K.workspaceId));if(I.status==="unknown-workspace"){d({workspaceId:I.workspaceId});return}d(null),H.workspaceId&&H.workspaceId!==m&&t.selectWorkspace(H.workspaceId),F(H.workspace,{...H,operateTab:H.operateTab,inspectHref:H.canonicalHref},{replace:H.replace});return}d(null),F("chat",{})},[F,m,t]),U=w.useCallback(H=>{t.selectWorkspace(H),L(vu({workspace:"chat",workspaceId:H}))},[t,L]),$=w.useCallback(H=>{d(null),t.selectWorkspace(H);const I=s==="chat"?Hl({workspaceId:H}):s==="operate"?Ku(S,{workspaceId:H}):Pf(N,H);L(I)},[N,L,S,s,t]);w.useEffect(()=>(Z(),window.addEventListener("hashchange",Z),()=>window.removeEventListener("hashchange",Z)),[Z]);const q=y.dagRunId.trim()?pa(`/dag/${encodeURIComponent(y.dagRunId.trim())}`,"from=recovery"):zl,W=Pf(s==="inspect"?N:q,m),oe=Hl(m?{workspaceId:m}:{}),J=Ku(S,m?{workspaceId:m}:{});return u.jsx(u.Fragment,{children:u.jsxs("div",{className:`console-app${s==="chat"?" is-chat-focus":""}`,children:[u.jsx(Dw,{nav:e.nav,primary:s,chatHref:oe,operateHref:J,readiness:e.readiness,setupBlocked:e.setupBlocked,degraded:e.degraded,inspectHref:W,workspaces:t.workspaces,workspaceId:m,workspacesLoading:t.loading,onSelectWorkspace:$,onNavigate:L}),u.jsx(jw,{busy:e.busy,runAction:p.runAction}),u.jsxs("div",{className:`console-shell${s==="chat"?" is-chat-focus":""}`,children:[u.jsx(Lw,{opError:e.opError,opMessage:e.opMessage}),h?u.jsxs("div",{className:"workspace-route-error",role:"alert","aria-live":"polite",children:[u.jsxs("p",{children:["URL 指向的 Workspace",u.jsx("code",{children:h}),"不存在或已被移除。为避免数据泄漏,不会回退到默认 Workspace。"]}),u.jsx("ul",{className:"workspace-route-error-options",children:t.workspaces.map(H=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null),t.selectWorkspace(H.workspaceId),L(vu({workspace:"chat",workspaceId:H.workspaceId}))},children:["选择 ",H.name]})},H.workspaceId))}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null);const H=t.workspaces[0]?.workspaceId??null;H&&t.selectWorkspace(H),L(vu({workspace:"chat"}))},children:"返回对话首页"})]}):null,h?null:u.jsxs("main",{className:`console-main${s==="chat"?" console-main--fill":""}`,children:[u.jsx(aL,{active:s==="chat",readiness:e.readiness,workspaceRegistry:t,workspaceId:m,sessionId:M,workspaceGate:c?{status:"unknown-workspace",workspaceId:c.workspaceId}:void 0,onSwitchWorkspace:U,onNavigateWorkspace:A}),u.jsx(ZL,{active:s==="operate",operateTab:S,shell:e,actions:p,wizard:x,prd:g,recovery:y}),u.jsx(QL,{active:s==="inspect",hash:N.startsWith("/#")?N.slice(1):N,workspaceId:m,onNavigate:L})]}),!h&&y.inspectSplitOpen&&y.dagRunId.trim()?u.jsx(_9,{dagRunId:y.dagRunId.trim(),nodeId:y.fromNodeId.trim()||void 0,onClose:()=>y.setInspectSplitOpen(!1),onOpenFull:()=>L(pa(`/dag/${encodeURIComponent(y.dagRunId.trim())}`,"from=recovery"))}):null]})]})})}const nx=document.getElementById("root");if(!nx)throw new Error("Loop Operator Console: #root missing");h9.createRoot(nx).render(u.jsx(w.StrictMode,{children:u.jsx(ez,{})}));export{qk as _,dd as g,tz as k};