@moonshot-ai/kimi-code 0.29.1 → 0.30.0

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 (383) hide show
  1. package/dist/main.mjs +98315 -83947
  2. package/dist-web/assets/CodeBlockNode-Doj0S5Qm.js +28 -0
  3. package/dist-web/assets/{DesignSystemView-CfA4rGvh.js → DesignSystemView-vhCcqafK.js} +1 -1
  4. package/dist-web/assets/{Tooltip-DkFhsYAE.js → Tooltip-BoDrXlWQ.js} +1 -1
  5. package/dist-web/assets/arc-HbtY4z3B.js +1 -0
  6. package/dist-web/assets/{architectureDiagram-3BPJPVTR-MONdkJ4P.js → architectureDiagram-3BPJPVTR-BAmuBHqF.js} +1 -1
  7. package/dist-web/assets/{blockDiagram-GPEHLZMM-BQdOB_MY.js → blockDiagram-GPEHLZMM-DB3vN4xE.js} +1 -1
  8. package/dist-web/assets/{c4Diagram-AAUBKEIU-Cu1H06Mp.js → c4Diagram-AAUBKEIU-CZbqDAkl.js} +1 -1
  9. package/dist-web/assets/channel-CU58lQ_S.js +1 -0
  10. package/dist-web/assets/{chunk-2J33WTMH-Bfn_2ak5.js → chunk-2J33WTMH-BscD-1Bg.js} +1 -1
  11. package/dist-web/assets/{chunk-4BX2VUAB-Cmi4qEu-.js → chunk-4BX2VUAB-CFKKaSjy.js} +1 -1
  12. package/dist-web/assets/{chunk-55IACEB6-BHQ14DOs.js → chunk-55IACEB6-DbBsFQ-y.js} +1 -1
  13. package/dist-web/assets/{chunk-727SXJPM-DapS8RNe.js → chunk-727SXJPM-DYO-4Meq.js} +1 -1
  14. package/dist-web/assets/{chunk-AQP2D5EJ-CziksSwo.js → chunk-AQP2D5EJ-D6jF8sjg.js} +1 -1
  15. package/dist-web/assets/{chunk-FMBD7UC4-B3GC7Sz0.js → chunk-FMBD7UC4-DsHK87xk.js} +1 -1
  16. package/dist-web/assets/{chunk-ND2GUHAM-oB3xRz9Y.js → chunk-ND2GUHAM-DIwTtEns.js} +1 -1
  17. package/dist-web/assets/{chunk-QZHKN3VN-BNd8WtG1.js → chunk-QZHKN3VN-CuLzG4Y7.js} +1 -1
  18. package/dist-web/assets/classDiagram-4FO5ZUOK-CGUxw8pC.js +1 -0
  19. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CGUxw8pC.js +1 -0
  20. package/dist-web/assets/{cose-bilkent-S5V4N54A-DXbZfUP-.js → cose-bilkent-S5V4N54A-Bp0vQcJ1.js} +1 -1
  21. package/dist-web/assets/{dagre-BM42HDAG-CMJQZ2Bu.js → dagre-BM42HDAG-bItLk1GT.js} +1 -1
  22. package/dist-web/assets/{diagram-2AECGRRQ-CwraTt3I.js → diagram-2AECGRRQ-BHyt2Sg_.js} +1 -1
  23. package/dist-web/assets/{diagram-5GNKFQAL-Bd9tvtZS.js → diagram-5GNKFQAL-BBCo61BE.js} +1 -1
  24. package/dist-web/assets/{diagram-KO2AKTUF-C5pfOuBJ.js → diagram-KO2AKTUF-DoHEBKBQ.js} +1 -1
  25. package/dist-web/assets/{diagram-LMA3HP47-CgECk7pt.js → diagram-LMA3HP47-DBz0dyT9.js} +1 -1
  26. package/dist-web/assets/{diagram-OG6HWLK6-B7FUf4ia.js → diagram-OG6HWLK6-DFrLnVp0.js} +1 -1
  27. package/dist-web/assets/{erDiagram-TEJ5UH35-Cjkndd1u.js → erDiagram-TEJ5UH35-BBSZg_IG.js} +1 -1
  28. package/dist-web/assets/floating-ui.dom-xGUaHE3m.js +1 -0
  29. package/dist-web/assets/{flowDiagram-I6XJVG4X-CI_zEpWp.js → flowDiagram-I6XJVG4X-BtzrctJW.js} +1 -1
  30. package/dist-web/assets/{ganttDiagram-6RSMTGT7-CMrlDYY3.js → ganttDiagram-6RSMTGT7-Rct-HdJu.js} +1 -1
  31. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-B0XncnVx.js → gitGraphDiagram-PVQCEYII-CIcCOtkG.js} +1 -1
  32. package/dist-web/assets/index-LE6Cy54W.css +1 -0
  33. package/dist-web/assets/index-Nwori_8N.js +337 -0
  34. package/dist-web/assets/index10-DPW9hHwA.js +2 -0
  35. package/dist-web/assets/index11-BLlVIBCh.js +8 -0
  36. package/dist-web/assets/index5-DKcWNKrg.js +1 -0
  37. package/dist-web/assets/index6-p0NcquyY.js +1 -0
  38. package/dist-web/assets/index7-BSYWAfC9.js +1 -0
  39. package/dist-web/assets/index8-rpBPk4Do.js +1 -0
  40. package/dist-web/assets/{infoDiagram-5YYISTIA-CvqINGXD.js → infoDiagram-5YYISTIA-Bhpn0mW8.js} +1 -1
  41. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-DwwlWu1M.js → ishikawaDiagram-YF4QCWOH-DAOuLEX-.js} +1 -1
  42. package/dist-web/assets/{journeyDiagram-JHISSGLW-CYZW7fDv.js → journeyDiagram-JHISSGLW-yHUiaaDQ.js} +1 -1
  43. package/dist-web/assets/{kanban-definition-UN3LZRKU-zG-qNeF7.js → kanban-definition-UN3LZRKU-B3kDKb1C.js} +1 -1
  44. package/dist-web/assets/{linear-acuFr1vC.js → linear--OXOnpnD.js} +1 -1
  45. package/dist-web/assets/{mermaid.core-L_9TZBiV.js → mermaid.core-DAOd3KoM.js} +5 -5
  46. package/dist-web/assets/{mindmap-definition-RKZ34NQL-C2VDmHdb.js → mindmap-definition-RKZ34NQL-ChCxAI9W.js} +1 -1
  47. package/dist-web/assets/{pieDiagram-4H26LBE5-DnboUQSM.js → pieDiagram-4H26LBE5-CrPFtitk.js} +2 -2
  48. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DyRggwu0.js → quadrantDiagram-W4KKPZXB-C_gARk7v.js} +1 -1
  49. package/dist-web/assets/{requirementDiagram-4Y6WPE33-C-dIj1bH.js → requirementDiagram-4Y6WPE33-D_o55gu8.js} +1 -1
  50. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-7FZAnV5g.js → sankeyDiagram-5OEKKPKP-wKm43hSH.js} +1 -1
  51. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-If9EbQdz.js → sequenceDiagram-3UESZ5HK-2RzKgEZf.js} +1 -1
  52. package/dist-web/assets/stateDiagram-AJRCARHV-Hw8hv14l.js +1 -0
  53. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-Dw1h0bx6.js +1 -0
  54. package/dist-web/assets/{timeline-definition-PNZ67QCA-Bs3VdnFW.js → timeline-definition-PNZ67QCA-Dg7etDfW.js} +1 -1
  55. package/dist-web/assets/{vennDiagram-CIIHVFJN-BKfxf_Op.js → vennDiagram-CIIHVFJN-Cb4wNSt1.js} +1 -1
  56. package/dist-web/assets/{vue.runtime.esm-bundler-DoE1gDt1.js → vue.runtime.esm-bundler-DivoU6l0.js} +1 -1
  57. package/dist-web/assets/{wardley-L42UT6IY-Dj3P4QZ2.js → wardley-L42UT6IY-DUKkueSc.js} +1 -1
  58. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DpDKmq4X.js → wardleyDiagram-YWT4CUSO-CxO_ve6G.js} +1 -1
  59. package/dist-web/assets/{xychartDiagram-2RQKCTM6-QlL1FEqA.js → xychartDiagram-2RQKCTM6-Da49nivv.js} +1 -1
  60. package/dist-web/index.html +2 -2
  61. package/package.json +7 -7
  62. package/dist-web/assets/CodeBlockNode-CQ4Ggiye.js +0 -22
  63. package/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-DE9J_U3X.js +0 -1
  64. package/dist-web/assets/abap-BdImnpbu.js +0 -1
  65. package/dist-web/assets/actionscript-3-CoDkCxhg.js +0 -1
  66. package/dist-web/assets/ada-bCR0ucgS.js +0 -1
  67. package/dist-web/assets/andromeeda-C4gqWexZ.js +0 -1
  68. package/dist-web/assets/angular-html-DA-rfuFy.js +0 -1
  69. package/dist-web/assets/angular-ts-BrjP3tb8.js +0 -1
  70. package/dist-web/assets/apache-Pmp26Uib.js +0 -1
  71. package/dist-web/assets/apex-Dqspr-GT.js +0 -1
  72. package/dist-web/assets/apl-CORt7UWP.js +0 -1
  73. package/dist-web/assets/applescript-Co6uUVPk.js +0 -1
  74. package/dist-web/assets/ara-BRHolxvo.js +0 -1
  75. package/dist-web/assets/arc-C8hiqmRK.js +0 -1
  76. package/dist-web/assets/asciidoc-Ve4PFQV2.js +0 -1
  77. package/dist-web/assets/asm-D_Q5rh1f.js +0 -1
  78. package/dist-web/assets/astro-HNnZUWAn.js +0 -1
  79. package/dist-web/assets/aurora-x-D-2ljcwZ.js +0 -1
  80. package/dist-web/assets/awk-DMzUqQB5.js +0 -1
  81. package/dist-web/assets/ayu-dark-DYE7WIF3.js +0 -1
  82. package/dist-web/assets/ayu-light-BA47KaF1.js +0 -1
  83. package/dist-web/assets/ayu-mirage-32ctXXKs.js +0 -1
  84. package/dist-web/assets/ballerina-BFfxhgS-.js +0 -1
  85. package/dist-web/assets/bat-BkioyH1T.js +0 -1
  86. package/dist-web/assets/beancount-k_qm7-4y.js +0 -1
  87. package/dist-web/assets/berry-uYugtg8r.js +0 -1
  88. package/dist-web/assets/bibtex-CHM0blh-.js +0 -1
  89. package/dist-web/assets/bicep-Bmn6On1c.js +0 -1
  90. package/dist-web/assets/bird2-BIv1doCn.js +0 -1
  91. package/dist-web/assets/blade-2xfisSek.js +0 -1
  92. package/dist-web/assets/bsl-BO_Y6i37.js +0 -1
  93. package/dist-web/assets/c-BIGW1oBm.js +0 -1
  94. package/dist-web/assets/c3-MRO5bC_T.js +0 -1
  95. package/dist-web/assets/cadence-Bv_4Rxtq.js +0 -1
  96. package/dist-web/assets/cairo-KRGpt6FW.js +0 -1
  97. package/dist-web/assets/catppuccin-frappe-DFWUc33u.js +0 -1
  98. package/dist-web/assets/catppuccin-latte-C9dUb6Cb.js +0 -1
  99. package/dist-web/assets/catppuccin-macchiato-DQyhUUbL.js +0 -1
  100. package/dist-web/assets/catppuccin-mocha-D87Tk5Gz.js +0 -1
  101. package/dist-web/assets/channel-Bs7tX-6q.js +0 -1
  102. package/dist-web/assets/clarity-D53aC0YG.js +0 -1
  103. package/dist-web/assets/classDiagram-4FO5ZUOK-tAwOEdCB.js +0 -1
  104. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-tAwOEdCB.js +0 -1
  105. package/dist-web/assets/clojure-P80f7IUj.js +0 -1
  106. package/dist-web/assets/cmake-D1j8_8rp.js +0 -1
  107. package/dist-web/assets/cobol-nBiQ_Alo.js +0 -1
  108. package/dist-web/assets/codeowners-Bp6g37R7.js +0 -1
  109. package/dist-web/assets/codeql-DsOJ9woJ.js +0 -1
  110. package/dist-web/assets/coffee-Ch7k5sss.js +0 -1
  111. package/dist-web/assets/common-lisp-Cg-RD9OK.js +0 -1
  112. package/dist-web/assets/coq-DkFqJrB1.js +0 -1
  113. package/dist-web/assets/cpp-UfJy6YNI.js +0 -1
  114. package/dist-web/assets/crystal-DGywbUpC.js +0 -1
  115. package/dist-web/assets/csharp-DSvCPggb.js +0 -1
  116. package/dist-web/assets/css-CLj8gQPS.js +0 -1
  117. package/dist-web/assets/csv-fuZLfV_i.js +0 -1
  118. package/dist-web/assets/cue-D82EKSYY.js +0 -1
  119. package/dist-web/assets/cypher-COkxafJQ.js +0 -1
  120. package/dist-web/assets/d-85-TOEBH.js +0 -1
  121. package/dist-web/assets/dark-plus-C3mMm8J8.js +0 -1
  122. package/dist-web/assets/dart-bE4Kk8sk.js +0 -1
  123. package/dist-web/assets/dax-CEL-wOlO.js +0 -1
  124. package/dist-web/assets/desktop-BmXAJ9_W.js +0 -1
  125. package/dist-web/assets/diff-D97Zzqfu.js +0 -1
  126. package/dist-web/assets/docker-BcOcwvcX.js +0 -1
  127. package/dist-web/assets/dotenv-Da5cRb03.js +0 -1
  128. package/dist-web/assets/dracula-BzJJZx-M.js +0 -1
  129. package/dist-web/assets/dracula-soft-BXkSAIEj.js +0 -1
  130. package/dist-web/assets/dream-maker-BtqSS_iP.js +0 -1
  131. package/dist-web/assets/edge-FbVlp4U3.js +0 -1
  132. package/dist-web/assets/elixir-CkH2-t6x.js +0 -1
  133. package/dist-web/assets/elm-DbKCFpqz.js +0 -1
  134. package/dist-web/assets/emacs-lisp-CXvaQtF9.js +0 -1
  135. package/dist-web/assets/erb-Dm6A9KJ5.js +0 -1
  136. package/dist-web/assets/erlang-DsQrWhSR.js +0 -1
  137. package/dist-web/assets/everforest-dark-BgDCqdQA.js +0 -1
  138. package/dist-web/assets/everforest-light-C8M2exoo.js +0 -1
  139. package/dist-web/assets/fennel-BYunw83y.js +0 -1
  140. package/dist-web/assets/fish-BvzEVeQv.js +0 -1
  141. package/dist-web/assets/floating-ui.dom-CDU05fwN.js +0 -1
  142. package/dist-web/assets/fluent-C4IJs8-o.js +0 -1
  143. package/dist-web/assets/fortran-fixed-form-CkoXwp7k.js +0 -1
  144. package/dist-web/assets/fortran-free-form-BxgE0vQu.js +0 -1
  145. package/dist-web/assets/fsharp-CXgrBDvD.js +0 -1
  146. package/dist-web/assets/gdresource-BOOCDP_w.js +0 -1
  147. package/dist-web/assets/gdscript-C5YyOfLZ.js +0 -1
  148. package/dist-web/assets/gdshader-DkwncUOv.js +0 -1
  149. package/dist-web/assets/genie-D0YGMca9.js +0 -1
  150. package/dist-web/assets/gherkin-DyxjwDmM.js +0 -1
  151. package/dist-web/assets/git-commit-F4YmCXRG.js +0 -1
  152. package/dist-web/assets/git-rebase-r7XF79zn.js +0 -1
  153. package/dist-web/assets/github-dark-DHJKELXO.js +0 -1
  154. package/dist-web/assets/github-dark-default-Cuk6v7N8.js +0 -1
  155. package/dist-web/assets/github-dark-dimmed-DH5Ifo-i.js +0 -1
  156. package/dist-web/assets/github-dark-high-contrast-E3gJ1_iC.js +0 -1
  157. package/dist-web/assets/github-light-DAi9KRSo.js +0 -1
  158. package/dist-web/assets/github-light-default-D7oLnXFd.js +0 -1
  159. package/dist-web/assets/github-light-high-contrast-BfjtVDDH.js +0 -1
  160. package/dist-web/assets/gleam-BspZqrRM.js +0 -1
  161. package/dist-web/assets/glimmer-js-ByusRIyA.js +0 -1
  162. package/dist-web/assets/glimmer-ts-BfAWNZQY.js +0 -1
  163. package/dist-web/assets/glsl-DplSGwfg.js +0 -1
  164. package/dist-web/assets/gn-n2N0HUVH.js +0 -1
  165. package/dist-web/assets/gnuplot-DdkO51Og.js +0 -1
  166. package/dist-web/assets/go-C27-OAKa.js +0 -1
  167. package/dist-web/assets/graphql-ChdNCCLP.js +0 -1
  168. package/dist-web/assets/groovy-gcz8RCvz.js +0 -1
  169. package/dist-web/assets/gruvbox-dark-hard-CFHQjOhq.js +0 -1
  170. package/dist-web/assets/gruvbox-dark-medium-GsRaNv29.js +0 -1
  171. package/dist-web/assets/gruvbox-dark-soft-CVdnzihN.js +0 -1
  172. package/dist-web/assets/gruvbox-light-hard-CH1njM8p.js +0 -1
  173. package/dist-web/assets/gruvbox-light-medium-DRw_LuNl.js +0 -1
  174. package/dist-web/assets/gruvbox-light-soft-hJgmCMqR.js +0 -1
  175. package/dist-web/assets/hack-DbPARsA_.js +0 -1
  176. package/dist-web/assets/haml-D5jkg6IW.js +0 -1
  177. package/dist-web/assets/handlebars-BpdQsYii.js +0 -1
  178. package/dist-web/assets/haskell-Df6bDoY_.js +0 -1
  179. package/dist-web/assets/haxe-CzTSHFRz.js +0 -1
  180. package/dist-web/assets/hcl-BWvSN4gD.js +0 -1
  181. package/dist-web/assets/hjson-D5-asLiD.js +0 -1
  182. package/dist-web/assets/hlsl-D3lLCCz7.js +0 -1
  183. package/dist-web/assets/horizon-BUw7H-hv.js +0 -1
  184. package/dist-web/assets/horizon-bright-CUuTKBJd.js +0 -1
  185. package/dist-web/assets/houston-DnULxvSX.js +0 -1
  186. package/dist-web/assets/html-derivative-DlHx6ybY.js +0 -1
  187. package/dist-web/assets/html-pp8916En.js +0 -1
  188. package/dist-web/assets/http-jrhK8wxY.js +0 -1
  189. package/dist-web/assets/hurl-irOxFIW8.js +0 -1
  190. package/dist-web/assets/hxml-Bvhsp5Yf.js +0 -1
  191. package/dist-web/assets/hy-DFXneXwc.js +0 -1
  192. package/dist-web/assets/imba-DGztddWO.js +0 -1
  193. package/dist-web/assets/index-BLWprWMc.js +0 -153
  194. package/dist-web/assets/index-Cm9Q4xVi.js +0 -3
  195. package/dist-web/assets/index-DQCzob0_.js +0 -325
  196. package/dist-web/assets/index-EBME1gg6.js +0 -9
  197. package/dist-web/assets/index-Wf9AlDd6.css +0 -1
  198. package/dist-web/assets/index10-NUIajxVf.js +0 -2
  199. package/dist-web/assets/index11-BcVJnkIL.js +0 -8
  200. package/dist-web/assets/index5-MWD_buly.js +0 -1
  201. package/dist-web/assets/index6-CG6lZVHt.js +0 -1
  202. package/dist-web/assets/index7-QggNhLVT.js +0 -1
  203. package/dist-web/assets/index8-BF4qnAVu.js +0 -2
  204. package/dist-web/assets/ini-BEwlwnbL.js +0 -1
  205. package/dist-web/assets/java-CylS5w8V.js +0 -1
  206. package/dist-web/assets/javascript-wDzz0qaB.js +0 -1
  207. package/dist-web/assets/jinja-f2NsQr07.js +0 -1
  208. package/dist-web/assets/jison-wvAkD_A8.js +0 -1
  209. package/dist-web/assets/json-Cp-IABpG.js +0 -1
  210. package/dist-web/assets/json5-C9tS-k6U.js +0 -1
  211. package/dist-web/assets/jsonc-Des-eS-w.js +0 -1
  212. package/dist-web/assets/jsonl-DcaNXYhu.js +0 -1
  213. package/dist-web/assets/jsonnet-DFQXde-d.js +0 -1
  214. package/dist-web/assets/jssm-C2t-YnRu.js +0 -1
  215. package/dist-web/assets/jsx-g9-lgVsj.js +0 -1
  216. package/dist-web/assets/julia-D7OTSIA_.js +0 -1
  217. package/dist-web/assets/just-CUsbIsdP.js +0 -1
  218. package/dist-web/assets/kanagawa-dragon-CkXjmgJE.js +0 -1
  219. package/dist-web/assets/kanagawa-lotus-CfQXZHmo.js +0 -1
  220. package/dist-web/assets/kanagawa-wave-DWedfzmr.js +0 -1
  221. package/dist-web/assets/kdl-DV7GczEv.js +0 -1
  222. package/dist-web/assets/kotlin-BdnUsdx6.js +0 -1
  223. package/dist-web/assets/kusto-wEQ09or8.js +0 -1
  224. package/dist-web/assets/laserwave-DUszq2jm.js +0 -1
  225. package/dist-web/assets/latex-CaSxy8MP.js +0 -1
  226. package/dist-web/assets/lean-BZvkOJ9d.js +0 -1
  227. package/dist-web/assets/less-B1dDrJ26.js +0 -1
  228. package/dist-web/assets/light-plus-B7mTdjB0.js +0 -1
  229. package/dist-web/assets/liquid-C0sCDyMI.js +0 -1
  230. package/dist-web/assets/llvm-DjAJT7YJ.js +0 -1
  231. package/dist-web/assets/log-2UxHyX5q.js +0 -1
  232. package/dist-web/assets/logo-BtOb2qkB.js +0 -1
  233. package/dist-web/assets/lua-BaeVxFsk.js +0 -1
  234. package/dist-web/assets/luau-KW6xsasC.js +0 -1
  235. package/dist-web/assets/make-CHLpvVh8.js +0 -1
  236. package/dist-web/assets/markdown-Cvjx9yec.js +0 -1
  237. package/dist-web/assets/marko-DjSrsDqO.js +0 -1
  238. package/dist-web/assets/material-theme-D5KoaKCx.js +0 -1
  239. package/dist-web/assets/material-theme-darker-BfHTSMKl.js +0 -1
  240. package/dist-web/assets/material-theme-lighter-B0m2ddpp.js +0 -1
  241. package/dist-web/assets/material-theme-ocean-CyktbL80.js +0 -1
  242. package/dist-web/assets/material-theme-palenight-Csfq5Kiy.js +0 -1
  243. package/dist-web/assets/matlab-D7o27uSR.js +0 -1
  244. package/dist-web/assets/mdc-DTYItulj.js +0 -1
  245. package/dist-web/assets/mdx-Cmh6b_Ma.js +0 -1
  246. package/dist-web/assets/mermaid-mWjccvbQ.js +0 -1
  247. package/dist-web/assets/min-dark-CafNBF8u.js +0 -1
  248. package/dist-web/assets/min-light-CTRr51gU.js +0 -1
  249. package/dist-web/assets/mipsasm-CKIfxQSi.js +0 -1
  250. package/dist-web/assets/mojo-rZm6bMo-.js +0 -1
  251. package/dist-web/assets/monokai-D4h5O-jR.js +0 -1
  252. package/dist-web/assets/moonbit-_H4v1dQx.js +0 -1
  253. package/dist-web/assets/move-IF9eRakj.js +0 -1
  254. package/dist-web/assets/narrat-DRg8JJMk.js +0 -1
  255. package/dist-web/assets/nextflow-C-mBbutL.js +0 -1
  256. package/dist-web/assets/nextflow-groovy-vE_lwT2v.js +0 -1
  257. package/dist-web/assets/nginx-BpAMiNFr.js +0 -1
  258. package/dist-web/assets/night-owl-C39BiMTA.js +0 -1
  259. package/dist-web/assets/night-owl-light-CMTm3GFP.js +0 -1
  260. package/dist-web/assets/nim-BIad80T-.js +0 -1
  261. package/dist-web/assets/nix-CwoSXNpI.js +0 -1
  262. package/dist-web/assets/nord-Ddv68eIx.js +0 -1
  263. package/dist-web/assets/nushell-Cz2AlsmD.js +0 -1
  264. package/dist-web/assets/objective-c-DXmwc3jG.js +0 -1
  265. package/dist-web/assets/objective-cpp-CLxacb5B.js +0 -1
  266. package/dist-web/assets/ocaml-C0hk2d4L.js +0 -1
  267. package/dist-web/assets/odin-BBf5iR-q.js +0 -1
  268. package/dist-web/assets/one-dark-pro-DVMEJ2y_.js +0 -1
  269. package/dist-web/assets/one-light-C3Wv6jpd.js +0 -1
  270. package/dist-web/assets/openscad-C4EeE6gA.js +0 -1
  271. package/dist-web/assets/pascal-D93ZcfNL.js +0 -1
  272. package/dist-web/assets/perl-B9cMNwum.js +0 -1
  273. package/dist-web/assets/php-Csjmro_R.js +0 -1
  274. package/dist-web/assets/pkl-u5AG7uiY.js +0 -1
  275. package/dist-web/assets/plastic-3e1v2bzS.js +0 -1
  276. package/dist-web/assets/plsql-ChMvpjG-.js +0 -1
  277. package/dist-web/assets/po-BTJTHyun.js +0 -1
  278. package/dist-web/assets/poimandres-CS3Unz2-.js +0 -1
  279. package/dist-web/assets/polar-C0HS_06l.js +0 -1
  280. package/dist-web/assets/postcss-CXtECtnM.js +0 -1
  281. package/dist-web/assets/powerquery-CEu0bR-o.js +0 -1
  282. package/dist-web/assets/powershell-Dpen1YoG.js +0 -1
  283. package/dist-web/assets/prisma-Dd19v3D-.js +0 -1
  284. package/dist-web/assets/prolog-CbFg5uaA.js +0 -1
  285. package/dist-web/assets/proto-C7zT0LnQ.js +0 -1
  286. package/dist-web/assets/pug-DKIMFp6K.js +0 -1
  287. package/dist-web/assets/puppet-BMWR74SV.js +0 -1
  288. package/dist-web/assets/purescript-CklMAg4u.js +0 -1
  289. package/dist-web/assets/python-B6aJPvgy.js +0 -1
  290. package/dist-web/assets/qml-3beO22l8.js +0 -1
  291. package/dist-web/assets/qmldir-C8lEn-DE.js +0 -1
  292. package/dist-web/assets/qss-IeuSbFQv.js +0 -1
  293. package/dist-web/assets/r-Dspwwk_N.js +0 -1
  294. package/dist-web/assets/racket-BqYA7rlc.js +0 -1
  295. package/dist-web/assets/raku-DXvB9xmW.js +0 -1
  296. package/dist-web/assets/razor-BjBPvh-w.js +0 -1
  297. package/dist-web/assets/red-bN70gL4F.js +0 -1
  298. package/dist-web/assets/reg-C-SQnVFl.js +0 -1
  299. package/dist-web/assets/regexp-CDVJQ6XC.js +0 -1
  300. package/dist-web/assets/rel-C3B-1QV4.js +0 -1
  301. package/dist-web/assets/riscv-BM1_JUlF.js +0 -1
  302. package/dist-web/assets/ron-D8l8udqQ.js +0 -1
  303. package/dist-web/assets/rose-pine-dawn-DHQR4-dF.js +0 -1
  304. package/dist-web/assets/rose-pine-moon-D4_iv3hh.js +0 -1
  305. package/dist-web/assets/rose-pine-qdsjHGoJ.js +0 -1
  306. package/dist-web/assets/rosmsg-BJDFO7_C.js +0 -1
  307. package/dist-web/assets/rst-CpCqk9r5.js +0 -1
  308. package/dist-web/assets/ruby-DyJCeAvU.js +0 -1
  309. package/dist-web/assets/rust-B1yitclQ.js +0 -1
  310. package/dist-web/assets/sas-DEy46yEz.js +0 -1
  311. package/dist-web/assets/sass-Cj5Yp3dK.js +0 -1
  312. package/dist-web/assets/scala-C151Ov-r.js +0 -1
  313. package/dist-web/assets/scheme-C98Dy4si.js +0 -1
  314. package/dist-web/assets/scss-D5BDwBP9.js +0 -1
  315. package/dist-web/assets/sdbl-DVxCFoDh.js +0 -1
  316. package/dist-web/assets/shaderlab-Dg9Lc6iA.js +0 -1
  317. package/dist-web/assets/shellscript-Yzrsuije.js +0 -1
  318. package/dist-web/assets/shellsession-BADoaaVG.js +0 -1
  319. package/dist-web/assets/slack-dark-BthQWCQV.js +0 -1
  320. package/dist-web/assets/slack-ochin-DqwNpetd.js +0 -1
  321. package/dist-web/assets/smalltalk-BERRCDM3.js +0 -1
  322. package/dist-web/assets/snazzy-light-Bw305WKR.js +0 -1
  323. package/dist-web/assets/solarized-dark-DXbdFlpD.js +0 -1
  324. package/dist-web/assets/solarized-light-L9t79GZl.js +0 -1
  325. package/dist-web/assets/solidity-rGO070M0.js +0 -1
  326. package/dist-web/assets/soy-8wufbnw4.js +0 -1
  327. package/dist-web/assets/sparql-rVzFXLq3.js +0 -1
  328. package/dist-web/assets/splunk-BtCnVYZw.js +0 -1
  329. package/dist-web/assets/sql-CRqJ_cUM.js +0 -1
  330. package/dist-web/assets/ssh-config-_ykCGR6B.js +0 -1
  331. package/dist-web/assets/stata-DI20mbqo.js +0 -1
  332. package/dist-web/assets/stateDiagram-AJRCARHV-C4DtY8Lk.js +0 -1
  333. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-B9dzT7Ej.js +0 -1
  334. package/dist-web/assets/stylus-BEDo0Tqx.js +0 -1
  335. package/dist-web/assets/surrealql-Bq5Q-fJD.js +0 -1
  336. package/dist-web/assets/svelte-Cy7k_4gC.js +0 -1
  337. package/dist-web/assets/swift-D82vCrfD.js +0 -1
  338. package/dist-web/assets/synthwave-84-CbfX1IO0.js +0 -1
  339. package/dist-web/assets/system-verilog-CnnmHF94.js +0 -1
  340. package/dist-web/assets/systemd-4A_iFExJ.js +0 -1
  341. package/dist-web/assets/talonscript-CkByrt1z.js +0 -1
  342. package/dist-web/assets/tasl-QIJgUcNo.js +0 -1
  343. package/dist-web/assets/tcl-dwOrl1Do.js +0 -1
  344. package/dist-web/assets/templ-DhtptRzy.js +0 -1
  345. package/dist-web/assets/terraform-BETggiCN.js +0 -1
  346. package/dist-web/assets/tex-idrVyKtj.js +0 -1
  347. package/dist-web/assets/tokyo-night-hegEt444.js +0 -1
  348. package/dist-web/assets/toml-vGWfd6FD.js +0 -1
  349. package/dist-web/assets/ts-tags-D351s5mN.js +0 -1
  350. package/dist-web/assets/tsv-B_m7g4N7.js +0 -1
  351. package/dist-web/assets/tsx-COt5Ahok.js +0 -1
  352. package/dist-web/assets/turtle-BsS91CYL.js +0 -1
  353. package/dist-web/assets/twig-CW1WmMYd.js +0 -1
  354. package/dist-web/assets/typescript-BPQ3VLAy.js +0 -1
  355. package/dist-web/assets/typespec-CAFt9gP4.js +0 -1
  356. package/dist-web/assets/typst-DHCkPAjA.js +0 -1
  357. package/dist-web/assets/v-BcVCzyr7.js +0 -1
  358. package/dist-web/assets/vala-CsfeWuGM.js +0 -1
  359. package/dist-web/assets/vb-D17OF-Vu.js +0 -1
  360. package/dist-web/assets/verilog-BQ8w6xss.js +0 -1
  361. package/dist-web/assets/vesper-DRje8inN.js +0 -1
  362. package/dist-web/assets/vhdl-CeAyd5Ju.js +0 -1
  363. package/dist-web/assets/viml-CJc9bBzg.js +0 -1
  364. package/dist-web/assets/vitesse-black-Bkuqu6BP.js +0 -1
  365. package/dist-web/assets/vitesse-dark-D0r3Knsf.js +0 -1
  366. package/dist-web/assets/vitesse-light-CVO1_9PV.js +0 -1
  367. package/dist-web/assets/vue-D2xRrEX4.js +0 -1
  368. package/dist-web/assets/vue-html-AaS7Mt5G.js +0 -1
  369. package/dist-web/assets/vue-vine-BoDAl6tE.js +0 -1
  370. package/dist-web/assets/vyper-CDx5xZoG.js +0 -1
  371. package/dist-web/assets/wasm-CG6Dc4jp.js +0 -1
  372. package/dist-web/assets/wasm-MzD3tlZU.js +0 -1
  373. package/dist-web/assets/wenyan-BV7otONQ.js +0 -1
  374. package/dist-web/assets/wgsl-Dx-B1_4e.js +0 -1
  375. package/dist-web/assets/wikitext-BhOHFoWU.js +0 -1
  376. package/dist-web/assets/wit-5i3qLPDT.js +0 -1
  377. package/dist-web/assets/wolfram-lXgVvXCa.js +0 -1
  378. package/dist-web/assets/xml-sdJ4AIDG.js +0 -1
  379. package/dist-web/assets/xsl-CtQFsRM5.js +0 -1
  380. package/dist-web/assets/yaml-Buea-lGh.js +0 -1
  381. package/dist-web/assets/zenscript-DVFEvuxE.js +0 -1
  382. package/dist-web/assets/zig-VOosw3JB.js +0 -1
  383. /package/dist-web/assets/{__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js → __vite-optional-peer-dep_stream-diffs_markstream-vue-BIHI7g3E.js} +0 -0
@@ -0,0 +1,337 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-vhCcqafK.js","assets/DesignSystemView-CuTwm3PV.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-Doj0S5Qm.js","assets/safeRaf-DGuzXxDK.js","assets/index5-DKcWNKrg.js","assets/index11-BLlVIBCh.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();/**
3
+ * @vue/shared v3.5.35
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/function i1(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ln={},Zc=[],Ci=()=>{},J3=()=>!1,Mf=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),r1=e=>e.startsWith("onUpdate:"),Ln=Object.assign,wk=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ZN=Object.prototype.hasOwnProperty,wn=(e,t)=>ZN.call(e,t),At=Array.isArray,Xc=e=>_u(e)==="[object Map]",Qa=e=>_u(e)==="[object Set]",ew=e=>_u(e)==="[object Date]",XN=e=>_u(e)==="[object RegExp]",Rt=e=>typeof e=="function",Rn=e=>typeof e=="string",ri=e=>typeof e=="symbol",Sn=e=>e!==null&&typeof e=="object",_k=e=>(Sn(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),eA=Object.prototype.toString,_u=e=>eA.call(e),QN=e=>_u(e).slice(8,-1),l1=e=>_u(e)==="[object Object]",a1=e=>Rn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fa=i1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),c1=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},JN=/-\w/g,Fo=c1(e=>e.replace(JN,t=>t.slice(1).toUpperCase())),e9=/\B([A-Z])/g,Bs=c1(e=>e.replace(e9,"-$1").toLowerCase()),u1=c1(e=>e.charAt(0).toUpperCase()+e.slice(1)),vp=c1(e=>e?`on${u1(e)}`:""),Zo=(e,t)=>!Object.is(e,t),Qc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},tA=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},d1=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Up=e=>{const t=Rn(e)?Number(e):NaN;return isNaN(t)?e:t};let tw;const f1=()=>tw||(tw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),t9="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",n9=i1(t9);function on(e){if(At(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Rn(o)?r9(o):on(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Rn(e)||Sn(e))return e}const o9=/;(?![^(]*\))/g,s9=/:([^]+)/,i9=/\/\*[^]*?\*\//g;function r9(e){const t={};return e.replace(i9,"").split(o9).forEach(n=>{if(n){const o=n.split(s9);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Ue(e){let t="";if(Rn(e))t=e;else if(At(e))for(let n=0;n<e.length;n++){const o=Ue(e[n]);o&&(t+=o+" ")}else if(Sn(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function l9(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Rn(t)&&(e.class=Ue(t)),n&&(e.style=on(n)),e}const a9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",c9=i1(a9);function nA(e){return!!e||e===""}function u9(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=jr(e[o],t[o]);return n}function jr(e,t){if(e===t)return!0;let n=ew(e),o=ew(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=ri(e),o=ri(t),n||o)return e===t;if(n=At(e),o=At(t),n||o)return n&&o?u9(e,t):!1;if(n=Sn(e),o=Sn(t),n||o){if(!n||!o)return!1;const s=Object.keys(e).length,i=Object.keys(t).length;if(s!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!jr(e[r],t[r]))return!1}}return String(e)===String(t)}function h1(e,t){return e.findIndex(n=>jr(n,t))}const oA=e=>!!(e&&e.__v_isRef===!0),B=e=>Rn(e)?e:e==null?"":At(e)||Sn(e)&&(e.toString===eA||!Rt(e.toString))?oA(e)?B(e.value):JSON.stringify(e,sA,2):String(e),sA=(e,t)=>oA(t)?sA(e,t.value):Xc(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[rg(o,i)+" =>"]=s,n),{})}:Qa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>rg(n))}:ri(t)?rg(t):Sn(t)&&!At(t)&&!l1(t)?String(t):t,rg=(e,t="")=>{var n;return ri(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function d9(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
7
+ * @vue/reactivity v3.5.35
8
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
+ * @license MIT
10
+ **/let $o;class iA{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&$o&&($o.active?(this.parent=$o,this.index=($o.scopes||($o.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=$o;try{return $o=this,t()}finally{$o=n}}}on(){++this._on===1&&(this.prevScope=$o,$o=this)}off(){if(this._on>0&&--this._on===0){if($o===this)$o=this.prevScope;else{let t=$o;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function f9(e){return new iA(e)}function Sk(){return $o}function Ef(e,t=!1){$o&&$o.cleanups.push(e)}let Yn;const lg=new WeakSet;class qp{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,$o&&($o.active?$o.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,lg.has(this)&&(lg.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||lA(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,nw(this),aA(this);const t=Yn,n=Ui;Yn=this,Ui=!0;try{return this.fn()}finally{cA(this),Yn=t,Ui=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Mk(t);this.deps=this.depsTail=void 0,nw(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?lg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){zv(this)&&this.run()}get dirty(){return zv(this)}}let rA=0,Nd,Id;function lA(e,t=!1){if(e.flags|=8,t){e.next=Id,Id=e;return}e.next=Nd,Nd=e}function Ck(){rA++}function Ak(){if(--rA>0)return;if(Id){let t=Id;for(Id=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Nd;){let t=Nd;for(Nd=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function aA(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function cA(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),Mk(o),h9(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function zv(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(uA(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function uA(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Qd)||(e.globalVersion=Qd,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!zv(e))))return;e.flags|=2;const t=e.dep,n=Yn,o=Ui;Yn=e,Ui=!0;try{aA(e);const s=e.fn(e._value);(t.version===0||Zo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Yn=n,Ui=o,cA(e),e.flags&=-3}}function Mk(e,t=!1){const{dep:n,prevSub:o,nextSub:s}=e;if(o&&(o.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)Mk(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function h9(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function WCe(e,t){e.effect instanceof qp&&(e=e.effect.fn);const n=new qp(e);t&&Ln(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function zCe(e){e.effect.stop()}let Ui=!0;const dA=[];function Vr(){dA.push(Ui),Ui=!1}function Kr(){const e=dA.pop();Ui=e===void 0?!0:e}function nw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Yn;Yn=void 0;try{t()}finally{Yn=n}}}let Qd=0;class p9{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class p1{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Yn||!Ui||Yn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Yn)n=this.activeLink=new p9(Yn,this),Yn.deps?(n.prevDep=Yn.depsTail,Yn.depsTail.nextDep=n,Yn.depsTail=n):Yn.deps=Yn.depsTail=n,fA(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Yn.depsTail,n.nextDep=void 0,Yn.depsTail.nextDep=n,Yn.depsTail=n,Yn.deps===n&&(Yn.deps=o)}return n}trigger(t){this.version++,Qd++,this.notify(t)}notify(t){Ck();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ak()}}}function fA(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)fA(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const jp=new WeakMap,Oa=Symbol(""),Uv=Symbol(""),Jd=Symbol("");function rs(e,t,n){if(Ui&&Yn){let o=jp.get(e);o||jp.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new p1),s.map=o,s.key=n),s.track()}}function Dr(e,t,n,o,s,i){const r=jp.get(e);if(!r){Qd++;return}const l=a=>{a&&a.trigger()};if(Ck(),t==="clear")r.forEach(l);else{const a=At(e),c=a&&a1(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===Jd||!ri(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Jd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(Oa)),Xc(e)&&l(r.get(Uv)));break;case"delete":a||(l(r.get(Oa)),Xc(e)&&l(r.get(Uv)));break;case"set":Xc(e)&&l(r.get(Oa));break}}Ak()}function m9(e,t){const n=jp.get(e);return n&&n.get(t)}function wc(e){const t=dn(e);return t===e?t:(rs(t,"iterate",Jd),ti(e)?t:t.map(Vi))}function m1(e){return rs(e=dn(e),"iterate",Jd),e}function ar(e,t){return Gr(e)?mu(Il(e)?Vi(t):t):Vi(t)}const g9={__proto__:null,[Symbol.iterator](){return ag(this,Symbol.iterator,e=>ar(this,e))},concat(...e){return wc(this).concat(...e.map(t=>At(t)?wc(t):t))},entries(){return ag(this,"entries",e=>(e[1]=ar(this,e[1]),e))},every(e,t){return Cr(this,"every",e,t,void 0,arguments)},filter(e,t){return Cr(this,"filter",e,t,n=>n.map(o=>ar(this,o)),arguments)},find(e,t){return Cr(this,"find",e,t,n=>ar(this,n),arguments)},findIndex(e,t){return Cr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Cr(this,"findLast",e,t,n=>ar(this,n),arguments)},findLastIndex(e,t){return Cr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Cr(this,"forEach",e,t,void 0,arguments)},includes(...e){return cg(this,"includes",e)},indexOf(...e){return cg(this,"indexOf",e)},join(e){return wc(this).join(e)},lastIndexOf(...e){return cg(this,"lastIndexOf",e)},map(e,t){return Cr(this,"map",e,t,void 0,arguments)},pop(){return td(this,"pop")},push(...e){return td(this,"push",e)},reduce(e,...t){return ow(this,"reduce",e,t)},reduceRight(e,...t){return ow(this,"reduceRight",e,t)},shift(){return td(this,"shift")},some(e,t){return Cr(this,"some",e,t,void 0,arguments)},splice(...e){return td(this,"splice",e)},toReversed(){return wc(this).toReversed()},toSorted(e){return wc(this).toSorted(e)},toSpliced(...e){return wc(this).toSpliced(...e)},unshift(...e){return td(this,"unshift",e)},values(){return ag(this,"values",e=>ar(this,e))}};function ag(e,t,n){const o=m1(e),s=o[t]();return o!==e&&!ti(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const v9=Array.prototype;function Cr(e,t,n,o,s,i){const r=m1(e),l=r!==e&&!ti(e),a=r[t];if(a!==v9[t]){const d=a.apply(e,i);return l?Vi(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,ar(e,d),f,e)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,e)}));const u=a.call(r,c,o);return l&&s?s(u):u}function ow(e,t,n,o){const s=m1(e),i=s!==e&&!ti(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=ar(e,c)),n.call(this,c,ar(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=s[t](r,...o);return l?ar(e,a):a}function cg(e,t,n){const o=dn(e);rs(o,"iterate",Jd);const s=o[t](...n);return(s===-1||s===!1)&&y1(n[0])?(n[0]=dn(n[0]),o[t](...n)):s}function td(e,t,n=[]){Vr(),Ck();const o=dn(e)[t].apply(e,n);return Ak(),Kr(),o}const y9=i1("__proto__,__v_isRef,__isVue"),hA=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ri));function k9(e){ri(e)||(e=String(e));const t=dn(this);return rs(t,"has",e),t.hasOwnProperty(e)}class pA{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(s?i?bA:kA:i?yA:vA).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=At(t);if(!s){let a;if(r&&(a=g9[n]))return a;if(n==="hasOwnProperty")return k9}const l=Reflect.get(t,n,vo(t)?t:o);if((ri(n)?hA.has(n):y9(n))||(s||rs(t,"get",n),i))return l;if(vo(l)){const a=r&&a1(n)?l:l.value;return s&&Sn(a)?jv(a):a}return Sn(l)?s?jv(l):zo(l):l}}class mA extends pA{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=At(t)&&a1(n);if(!this._isShallow){const c=Gr(i);if(!ti(o)&&!Gr(o)&&(i=dn(i),o=dn(o)),!r&&vo(i)&&!vo(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:wn(t,n),a=Reflect.set(t,n,o,vo(t)?t:s);return t===dn(s)&&(l?Zo(o,i)&&Dr(t,"set",n,o):Dr(t,"add",n,o)),a}deleteProperty(t,n){const o=wn(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Dr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!ri(n)||!hA.has(n))&&rs(t,"has",n),o}ownKeys(t){return rs(t,"iterate",At(t)?"length":Oa),Reflect.ownKeys(t)}}class gA extends pA{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const b9=new mA,x9=new gA,w9=new mA(!0),_9=new gA(!0),qv=e=>e,Sh=e=>Reflect.getPrototypeOf(e);function S9(e,t,n){return function(...o){const s=this.__v_raw,i=dn(s),r=Xc(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?qv:t?mu:Vi;return!t&&rs(i,"iterate",a?Uv:Oa),Ln(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:l?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Ch(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function C9(e,t){const n={get(s){const i=this.__v_raw,r=dn(i),l=dn(s);e||(Zo(s,l)&&rs(r,"get",s),rs(r,"get",l));const{has:a}=Sh(r),c=t?qv:e?mu:Vi;if(a.call(r,s))return c(i.get(s));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(s)},get size(){const s=this.__v_raw;return!e&&rs(dn(s),"iterate",Oa),s.size},has(s){const i=this.__v_raw,r=dn(i),l=dn(s);return e||(Zo(s,l)&&rs(r,"has",s),rs(r,"has",l)),s===l?i.has(s):i.has(s)||i.has(l)},forEach(s,i){const r=this,l=r.__v_raw,a=dn(l),c=t?qv:e?mu:Vi;return!e&&rs(a,"iterate",Oa),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return Ln(n,e?{add:Ch("add"),set:Ch("set"),delete:Ch("delete"),clear:Ch("clear")}:{add(s){const i=dn(this),r=Sh(i),l=dn(s),a=!t&&!ti(s)&&!Gr(s)?l:s;return r.has.call(i,a)||Zo(s,a)&&r.has.call(i,s)||Zo(l,a)&&r.has.call(i,l)||(i.add(a),Dr(i,"add",a,a)),this},set(s,i){!t&&!ti(i)&&!Gr(i)&&(i=dn(i));const r=dn(this),{has:l,get:a}=Sh(r);let c=l.call(r,s);c||(s=dn(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?Zo(i,u)&&Dr(r,"set",s,i):Dr(r,"add",s,i),this},delete(s){const i=dn(this),{has:r,get:l}=Sh(i);let a=r.call(i,s);a||(s=dn(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Dr(i,"delete",s,void 0),c},clear(){const s=dn(this),i=s.size!==0,r=s.clear();return i&&Dr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=S9(s,e,t)}),n}function g1(e,t){const n=C9(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(wn(n,s)&&s in o?n:o,s,i)}const A9={get:g1(!1,!1)},M9={get:g1(!1,!0)},E9={get:g1(!0,!1)},T9={get:g1(!0,!0)},vA=new WeakMap,yA=new WeakMap,kA=new WeakMap,bA=new WeakMap;function N9(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function zo(e){return Gr(e)?e:v1(e,!1,b9,A9,vA)}function I9(e){return v1(e,!1,w9,M9,yA)}function jv(e){return v1(e,!0,x9,E9,kA)}function UCe(e){return v1(e,!0,_9,T9,bA)}function v1(e,t,n,o,s){if(!Sn(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=s.get(e);if(i)return i;const r=N9(QN(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function Il(e){return Gr(e)?Il(e.__v_raw):!!(e&&e.__v_isReactive)}function Gr(e){return!!(e&&e.__v_isReadonly)}function ti(e){return!!(e&&e.__v_isShallow)}function y1(e){return e?!!e.__v_raw:!1}function dn(e){const t=e&&e.__v_raw;return t?dn(t):e}function gt(e){return!wn(e,"__v_skip")&&Object.isExtensible(e)&&tA(e,"__v_skip",!0),e}const Vi=e=>Sn(e)?zo(e):e,mu=e=>Sn(e)?jv(e):e;function vo(e){return e?e.__v_isRef===!0:!1}function oe(e){return xA(e,!1)}function gr(e){return xA(e,!0)}function xA(e,t){return vo(e)?e:new L9(e,t)}class L9{constructor(t,n){this.dep=new p1,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:dn(t),this._value=n?t:Vi(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||ti(t)||Gr(t);t=o?t:dn(t),Zo(t,n)&&(this._rawValue=t,this._value=o?t:Vi(t),this.dep.trigger())}}function $9(e){e.dep&&e.dep.trigger()}function C(e){return vo(e)?e.value:e}function wA(e){return Rt(e)?e():C(e)}const F9={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return vo(s)&&!vo(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function _A(e){return Il(e)?e:new Proxy(e,F9)}class O9{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new p1,{get:o,set:s}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=s}get value(){return this._value=this._get()}set value(t){this._set(t)}}function B9(e){return new O9(e)}function qCe(e){const t=At(e)?new Array(e.length):{};for(const n in e)t[n]=SA(e,n);return t}class R9{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=ri(n)?n:String(n),this._raw=dn(t);let s=!0,i=t;if(!At(t)||ri(this._key)||!a1(this._key))do s=!y1(i)||ti(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let t=this._object[this._key];return this._shallow&&(t=C(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&vo(this._raw[this._key])){const n=this._object[this._key];if(vo(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return m9(this._raw,this._key)}}class D9{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function jCe(e,t,n){return vo(e)?e:Rt(e)?new D9(e):Sn(e)&&arguments.length>1?SA(e,t,n):oe(e)}function SA(e,t,n){return new R9(e,t,n)}class P9{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new p1(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Yn!==this)return lA(this,!0),!0}get value(){const t=this.dep.track();return uA(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function H9(e,t,n=!1){let o,s;return Rt(e)?o=e:(o=e.get,s=e.set),new P9(o,s,n)}const VCe={GET:"get",HAS:"has",ITERATE:"iterate"},KCe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Ah={},Vp=new WeakMap;let bl;function GCe(){return bl}function W9(e,t=!1,n=bl){if(n){let o=Vp.get(n);o||Vp.set(n,o=[]),o.push(e)}}function z9(e,t,n=ln){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=b=>s?b:ti(b)||s===!1||s===0?Pr(b,1):Pr(b);let u,d,f,h,p=!1,m=!1;if(vo(e)?(d=()=>e.value,p=ti(e)):Il(e)?(d=()=>c(e),p=!0):At(e)?(m=!0,p=e.some(b=>Il(b)||ti(b)),d=()=>e.map(b=>{if(vo(b))return b.value;if(Il(b))return c(b);if(Rt(b))return a?a(b,2):b()})):Rt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Vr();try{f()}finally{Kr()}}const b=bl;bl=u;try{return a?a(e,3,[h]):e(h)}finally{bl=b}}:d=Ci,t&&s){const b=d,A=s===!0?1/0:s;d=()=>Pr(b(),A)}const k=Sk(),y=()=>{u.stop(),k&&k.active&&wk(k.effects,u)};if(i&&t){const b=t;t=(...A)=>{b(...A),y()}}let g=m?new Array(e.length).fill(Ah):Ah;const v=b=>{if(!(!(u.flags&1)||!u.dirty&&!b))if(t){const A=u.run();if(s||p||(m?A.some((I,T)=>Zo(I,g[T])):Zo(A,g))){f&&f();const I=bl;bl=u;try{const T=[A,g===Ah?void 0:m&&g[0]===Ah?[]:g,h];g=A,a?a(t,3,T):t(...T)}finally{bl=I}}}else u.run()};return l&&l(v),u=new qp(d),u.scheduler=r?()=>r(v,!1):v,h=b=>W9(b,!1,u),f=u.onStop=()=>{const b=Vp.get(u);if(b){if(a)a(b,4);else for(const A of b)A();Vp.delete(u)}},t?o?v(!0):g=u.run():r?r(v.bind(null,!0),!0):u.run(),y.pause=u.pause.bind(u),y.resume=u.resume.bind(u),y.stop=y,y}function Pr(e,t=1/0,n){if(t<=0||!Sn(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,vo(e))Pr(e.value,t,n);else if(At(e))for(let o=0;o<e.length;o++)Pr(e[o],t,n);else if(Qa(e)||Xc(e))e.forEach(o=>{Pr(o,t,n)});else if(l1(e)){for(const o in e)Pr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Pr(e[o],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.35
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/const CA=[];function U9(e){CA.push(e)}function q9(){CA.pop()}function YCe(e,t){}const ZCe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},j9={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Tf(e,t,n,o){try{return o?e(...o):e()}catch(s){Su(s,t,n)}}function Ei(e,t,n,o){if(Rt(e)){const s=Tf(e,t,n,o);return s&&_k(s)&&s.catch(i=>{Su(i,t,n)}),s}if(At(e)){const s=[];for(let i=0;i<e.length;i++)s.push(Ei(e[i],t,n,o));return s}}function Su(e,t,n,o=!0){const s=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||ln;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Vr(),Tf(i,null,10,[e,a,c]),Kr();return}}V9(e,n,s,o,r)}function V9(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ms=[];let ir=-1;const Jc=[];let xl=null,$c=0;const AA=Promise.resolve();let Kp=null;function yt(e){const t=Kp||AA;return e?t.then(this?e.bind(this):e):t}function K9(e){let t=ir+1,n=ms.length;for(;t<n;){const o=t+n>>>1,s=ms[o],i=ef(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function Ek(e){if(!(e.flags&1)){const t=ef(e),n=ms[ms.length-1];!n||!(e.flags&2)&&t>=ef(n)?ms.push(e):ms.splice(K9(t),0,e),e.flags|=1,MA()}}function MA(){Kp||(Kp=AA.then(EA))}function Gp(e){At(e)?Jc.push(...e):xl&&e.id===-1?xl.splice($c+1,0,e):e.flags&1||(Jc.push(e),e.flags|=1),MA()}function sw(e,t,n=ir+1){for(;n<ms.length;n++){const o=ms[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ms.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Yp(e){if(Jc.length){const t=[...new Set(Jc)].sort((n,o)=>ef(n)-ef(o));if(Jc.length=0,xl){xl.push(...t);return}for(xl=t,$c=0;$c<xl.length;$c++){const n=xl[$c];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}xl=null,$c=0}}const ef=e=>e.id==null?e.flags&2?-1:1/0:e.id;function EA(e){try{for(ir=0;ir<ms.length;ir++){const t=ms[ir];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Tf(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ir<ms.length;ir++){const t=ms[ir];t&&(t.flags&=-2)}ir=-1,ms.length=0,Yp(),Kp=null,(ms.length||Jc.length)&&EA()}}let Fc,Mh=[];function TA(e,t){var n,o;Fc=e,Fc?(Fc.enabled=!0,Mh.forEach(({event:s,args:i})=>Fc.emit(s,...i)),Mh=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{TA(i,t)}),setTimeout(()=>{Fc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Mh=[])},3e3)):Mh=[]}let Qo=null,k1=null;function tf(e){const t=Qo;return Qo=e,k1=e&&e.type.__scopeId||null,t}function XCe(e){k1=e}function QCe(){k1=null}const JCe=e=>Ie;function Ie(e,t=Qo,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&em(-1);const i=tf(t);let r;try{r=e(...s)}finally{tf(i),o._d&&em(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function qn(e,t){if(Qo===null)return e;const n=$f(Qo),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=ln]=t[s];i&&(Rt(i)&&(i={mounted:i,updated:i}),i.deep&&Pr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function rr(e,t,n,o){const s=e.dirs,i=t&&t.dirs;for(let r=0;r<s.length;r++){const l=s[r];i&&(l.oldValue=i[r].value);let a=l.dir[o];a&&(Vr(),Ei(a,n,8,[e.el,l,e,t]),Kr())}}function In(e,t){if(Xo){let n=Xo.provides;const o=Xo.parent&&Xo.parent.provides;o===n&&(n=Xo.provides=Object.create(o)),n[e]=t}}function Jt(e,t,n=!1){const o=Eo();if(o||Ba){let s=Ba?Ba._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Rt(t)?t.call(o&&o.proxy):t}}function e4e(){return!!(Eo()||Ba)}const G9=Symbol.for("v-scx"),Y9=()=>Jt(G9);function NA(e,t){return Nf(e,null,t)}function t4e(e,t){return Nf(e,null,{flush:"post"})}function Z9(e,t){return Nf(e,null,{flush:"sync"})}function et(e,t,n){return Nf(e,t,n)}function Nf(e,t,n=ln){const{immediate:o,deep:s,flush:i,once:r}=n,l=Ln({},n),a=t&&o||!t&&i!=="post";let c;if(za){if(i==="sync"){const h=Y9();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=Ci,h.resume=Ci,h.pause=Ci,h}}const u=Xo;l.call=(h,p,m)=>Ei(h,u,p,m);let d=!1;i==="post"?l.scheduler=h=>{xo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():Ek(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=z9(e,t,l);return za&&(c?c.push(f):a&&f()),f}function X9(e,t,n){const o=this.proxy,s=Rn(e)?e.includes(".")?IA(o,e):()=>o[e]:e.bind(o,o);let i;Rt(t)?i=t:(i=t.handler,n=t);const r=Cu(this),l=Nf(s,i.bind(o),n);return r(),l}function IA(e,t){const n=t.split(".");return()=>{let o=e;for(let s=0;s<n.length&&o;s++)o=o[n[s]];return o}}const gl=new WeakMap,LA=Symbol("_vte"),$A=e=>e.__isTeleport,wa=e=>e&&(e.disabled||e.disabled===""),Q9=e=>e&&(e.defer||e.defer===""),iw=e=>typeof SVGElement<"u"&&e instanceof SVGElement,rw=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Vv=(e,t)=>{const n=e&&e.to;return Rn(n)?t?t(n):null:n},J9={name:"Teleport",__isTeleport:!0,process(e,t,n,o,s,i,r,l,a,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:p,createText:m,createComment:k,parentNode:y}}=c,g=wa(t.props);let{dynamicChildren:v}=t;const b=(T,M,$)=>{T.shapeFlag&16&&u(T.children,M,$,s,i,r,l,a)},A=(T=t)=>{const M=wa(T.props),$=T.target=Vv(T.props,p),N=Kv($,T,m,h);$&&(r!=="svg"&&iw($)?r="svg":r!=="mathml"&&rw($)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add($),M||(b(T,$,N),md(T,!1)))},I=T=>{const M=()=>{if(gl.get(T)===M){if(gl.delete(T),wa(T.props)){const $=y(T.el)||n;b(T,$,T.anchor),md(T,!0)}A(T)}};gl.set(T,M),xo(M,i)};if(e==null){const T=t.el=m(""),M=t.anchor=m("");if(h(T,n,o),h(M,n,o),Q9(t.props)||i&&i.pendingBranch){I(t);return}g&&(b(t,n,M),md(t,!0)),A()}else{t.el=e.el;const T=t.anchor=e.anchor,M=gl.get(e);if(M){M.flags|=8,gl.delete(e),I(t);return}t.targetStart=e.targetStart;const $=t.target=e.target,N=t.targetAnchor=e.targetAnchor,F=wa(e.props),S=F?n:$,R=F?T:N;if(r==="svg"||iw($)?r="svg":(r==="mathml"||rw($))&&(r="mathml"),v?(f(e.dynamicChildren,v,S,s,i,r,l),Dk(e,t,!0)):a||d(e,t,S,R,s,i,r,l,!1),g)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Eh(t,n,T,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const z=t.target=Vv(t.props,p);z&&Eh(t,z,null,c,0)}else F&&Eh(t,$,N,c,1);md(t,g)}},remove(e,t,n,{um:o,o:{remove:s}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:f}=e,h=i||!wa(f),p=gl.get(e);if(p&&(p.flags|=8,gl.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let m=0;m<l.length;m++){const k=l[m];o(k,t,n,h,!!k.dynamicChildren)}},move:Eh,hydrate:eI};function Eh(e,t,n,{o:{insert:o},m:s},i=2){i===0&&o(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&o(r,t,n),!gl.has(e)&&(!d||wa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function eI(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(k,y){let g=y;for(;g;){if(g&&g.nodeType===8){if(g.data==="teleport start anchor")t.targetStart=g;else if(g.data==="teleport anchor"){t.targetAnchor=g,k._lpa=t.targetAnchor&&r(t.targetAnchor);break}}g=r(g)}}function h(k,y){y.anchor=d(r(k),y,l(k),n,o,s,i)}const p=t.target=Vv(t.props,a),m=wa(t.props);if(p){const k=p._lpa||p.firstChild;t.shapeFlag&16&&(m?(h(e,t),f(p,k),t.targetAnchor||Kv(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,k),t.targetAnchor||Kv(p,t,u,c),d(k&&r(k),t,p,n,o,s,i))),md(t,m)}else m&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const b1=J9;function md(e,t){const n=e.ctx;if(n&&n.ut){let o,s;for(t?(o=e.el,s=e.anchor):(o=e.targetStart,s=e.targetAnchor);o&&o!==s;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Kv(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[LA]=r,e&&(o(i,e,s),o(r,e,s)),r}const bi=Symbol("_leaveCb"),nd=Symbol("_enterCb");function FA(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Cn(()=>{e.isMounted=!0}),ho(()=>{e.isUnmounting=!0}),e}const mi=[Function,Array],OA={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:mi,onEnter:mi,onAfterEnter:mi,onEnterCancelled:mi,onBeforeLeave:mi,onLeave:mi,onAfterLeave:mi,onLeaveCancelled:mi,onBeforeAppear:mi,onAppear:mi,onAfterAppear:mi,onAppearCancelled:mi},BA=e=>{const t=e.subTree;return t.component?BA(t.component):t},tI={name:"BaseTransition",props:OA,setup(e,{slots:t}){const n=Eo(),o=FA();return()=>{const s=t.default&&Tk(t.default(),!0),i=s&&s.length?RA(s):n.subTree?ue():void 0;if(!i)return;const r=dn(e),{mode:l}=r;if(o.isLeaving)return ug(i);const a=lw(i);if(!a)return ug(i);let c=nf(a,r,o,n,d=>c=d);a.type!==So&&Rl(a,c);let u=n.subTree&&lw(n.subTree);if(u&&u.type!==So&&!Pi(u,a)&&BA(n).type!==So){let d=nf(u,r,o,n);if(Rl(u,d),l==="out-in"&&a.type!==So)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},ug(i);l==="in-out"&&a.type!==So?d.delayLeave=(f,h,p)=>{const m=DA(o,u);m[String(u.key)]=u,f[bi]=()=>{h(),f[bi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function RA(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==So){t=n;break}}return t}const nI=tI;function DA(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function nf(e,t,n,o,s){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:p,onLeaveCancelled:m,onBeforeAppear:k,onAppear:y,onAfterAppear:g,onAppearCancelled:v}=t,b=String(e.key),A=DA(n,e),I=($,N)=>{$&&Ei($,o,9,N)},T=($,N)=>{const F=N[1];I($,N),At($)?$.every(S=>S.length<=1)&&F():$.length<=1&&F()},M={mode:r,persisted:l,beforeEnter($){let N=a;if(!n.isMounted)if(i)N=k||a;else return;$[bi]&&$[bi](!0);const F=A[b];F&&Pi(e,F)&&F.el[bi]&&F.el[bi](),I(N,[$])},enter($){if(A[b]===e)return;let N=c,F=u,S=d;if(!n.isMounted)if(i)N=y||c,F=g||u,S=v||d;else return;let R=!1;$[nd]=W=>{R||(R=!0,W?I(S,[$]):I(F,[$]),M.delayedLeave&&M.delayedLeave(),$[nd]=void 0)};const z=$[nd].bind(null,!1);N?T(N,[$,z]):z()},leave($,N){const F=String(e.key);if($[nd]&&$[nd](!0),n.isUnmounting)return N();I(f,[$]);let S=!1;$[bi]=z=>{S||(S=!0,N(),z?I(m,[$]):I(p,[$]),$[bi]=void 0,A[F]===e&&delete A[F])};const R=$[bi].bind(null,!1);A[F]=e,h?T(h,[$,R]):R()},clone($){const N=nf($,t,n,o,s);return s&&s(N),N}};return M}function ug(e){if(If(e))return e=Yr(e),e.children=null,e}function lw(e){if(!If(e))return $A(e.type)&&e.children?RA(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Rt(n.default))return n.default()}}function Rl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Rl(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Tk(e,t=!1,n){let o=[],s=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===We?(r.patchFlag&128&&s++,o=o.concat(Tk(r.children,t,l))):(t||r.type!==So)&&o.push(l!=null?Yr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Je(e,t){return Rt(e)?Ln({name:e.name},t,{setup:e}):e}function n4e(){const e=Eo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Nk(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function o4e(e){const t=Eo(),n=gr(null);if(t){const s=t.refs===ln?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function aw(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Zp=new WeakMap;function eu(e,t,n,o,s=!1){if(At(e)){e.forEach((m,k)=>eu(m,t&&(At(t)?t[k]:t),n,o,s));return}if(qr(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&eu(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?$f(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===ln?l.refs={}:l.refs,d=l.setupState,f=dn(d),h=d===ln?J3:m=>aw(u,m)?!1:wn(f,m),p=(m,k)=>!(k&&aw(u,k));if(c!=null&&c!==a){if(cw(t),Rn(c))u[c]=null,h(c)&&(d[c]=null);else if(vo(c)){const m=t;p(c,m.k)&&(c.value=null),m.k&&(u[m.k]=null)}}if(Rt(a))Tf(a,l,12,[r,u]);else{const m=Rn(a),k=vo(a);if(m||k){const y=()=>{if(e.f){const g=m?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)At(g)&&wk(g,i);else if(At(g))g.includes(i)||g.push(i);else if(m)u[a]=[i],h(a)&&(d[a]=u[a]);else{const v=[i];p(a,e.k)&&(a.value=v),e.k&&(u[e.k]=v)}}else m?(u[a]=r,h(a)&&(d[a]=r)):k&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const g=()=>{y(),Zp.delete(e)};g.id=-1,Zp.set(e,g),xo(g,n)}else cw(e),y()}}}function cw(e){const t=Zp.get(e);t&&(t.flags|=8,Zp.delete(e))}let uw=!1;const _c=()=>{uw||(console.error("Hydration completed but contains mismatches."),uw=!0)},oI=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",sI=e=>e.namespaceURI.includes("MathML"),Th=e=>{if(e.nodeType===1){if(oI(e))return"svg";if(sI(e))return"mathml"}},zc=e=>e.nodeType===8;function iI(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(v,b)=>{if(!b.hasChildNodes()){n(null,v,b),Yp(),b._vnode=v;return}d(b.firstChild,v,null,null,null),Yp(),b._vnode=v},d=(v,b,A,I,T,M=!1)=>{M=M||!!b.dynamicChildren;const $=zc(v)&&v.data==="[",N=()=>m(v,b,A,I,T,$),{type:F,ref:S,shapeFlag:R,patchFlag:z}=b;let W=v.nodeType;b.el=v,z===-2&&(M=!1,b.dynamicChildren=null);let L=null;switch(F){case Ll:W!==3?b.children===""?(a(b.el=s(""),r(v),v),L=v):L=N():(v.data!==b.children&&(_c(),v.data=b.children),L=i(v));break;case So:g(v)?(L=i(v),y(b.el=v.content.firstChild,v,A)):W!==8||$?L=N():L=i(v);break;case nu:if($&&(v=i(v),W=v.nodeType),W===1||W===3){L=v;const O=!b.children.length;for(let U=0;U<b.staticCount;U++)O&&(b.children+=L.nodeType===1?L.outerHTML:L.data),U===b.staticCount-1&&(b.anchor=L),L=i(L);return $?i(L):L}else N();break;case We:$?L=p(v,b,A,I,T,M):L=N();break;default:if(R&1)(W!==1||b.type.toLowerCase()!==v.tagName.toLowerCase())&&!g(v)?L=N():L=f(v,b,A,I,T,M);else if(R&6){b.slotScopeIds=T;const O=r(v);if($?L=k(v):zc(v)&&v.data==="teleport start"?L=k(v,v.data,"teleport end"):L=i(v),t(b,O,null,A,I,Th(O),M),qr(b)&&!b.type.__asyncResolved){let U;$?(U=ae(We),U.anchor=L?L.previousSibling:O.lastChild):U=v.nodeType===3?ot(""):ae("div"),U.el=v,b.component.subTree=U}}else R&64?W!==8?L=N():L=b.type.hydrate(v,b,A,I,T,M,e,h):R&128&&(L=b.type.hydrate(v,b,A,I,Th(r(v)),T,M,e,d))}return S!=null&&eu(S,null,I,b),L},f=(v,b,A,I,T,M)=>{M=M||!!b.dynamicChildren;const{type:$,props:N,patchFlag:F,shapeFlag:S,dirs:R,transition:z}=b,W=$==="input"||$==="option";if(W||F!==-1){R&&rr(b,null,A,"created");let L=!1;if(g(v)){L=sM(null,z)&&A&&A.vnode.props&&A.vnode.props.appear;const U=v.content.firstChild;if(L){const Z=U.getAttribute("class");Z&&(U.$cls=Z),z.beforeEnter(U)}y(U,v,A),b.el=v=U}if(S&16&&!(N&&(N.innerHTML||N.textContent))){let U=h(v.firstChild,b,v,A,I,T,M);for(U&&!Nh(v,1)&&_c();U;){const Z=U;U=U.nextSibling,l(Z)}}else if(S&8){let U=b.children;U[0]===`
15
+ `&&(v.tagName==="PRE"||v.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Z}=v;Z!==U&&Z!==U.replace(/\r\n|\r/g,`
16
+ `)&&(Nh(v,0)||_c(),v.textContent=b.children)}if(N){if(W||!M||F&48){const U=v.tagName.includes("-");for(const Z in N)(W&&(Z.endsWith("value")||Z==="indeterminate")||Mf(Z)&&!Fa(Z)||Z[0]==="."||U&&!Fa(Z))&&o(v,Z,null,N[Z],void 0,A)}else if(N.onClick)o(v,"onClick",null,N.onClick,void 0,A);else if(F&4&&Il(N.style))for(const U in N.style)N.style[U]}let O;(O=N&&N.onVnodeBeforeMount)&&Is(O,A,b),R&&rr(b,null,A,"beforeMount"),((O=N&&N.onVnodeMounted)||R||L)&&aM(()=>{O&&Is(O,A,b),L&&z.enter(v),R&&rr(b,null,A,"mounted")},I)}return v.nextSibling},h=(v,b,A,I,T,M,$)=>{$=$||!!b.dynamicChildren;const N=b.children,F=N.length;let S=!1;for(let R=0;R<F;R++){const z=$?N[R]:N[R]=Os(N[R]),W=z.type===Ll;v?(W&&!$&&R+1<F&&Os(N[R+1]).type===Ll&&(a(s(v.data.slice(z.children.length)),A,i(v)),v.data=z.children),v=d(v,z,I,T,M,$)):W&&!z.children?a(z.el=s(""),A):(S||(S=!0,Nh(A,1)||_c()),n(null,z,A,null,I,T,Th(A),M))}return v},p=(v,b,A,I,T,M)=>{const{slotScopeIds:$}=b;$&&(T=T?T.concat($):$);const N=r(v),F=h(i(v),b,N,A,I,T,M);return F&&zc(F)&&F.data==="]"?i(b.anchor=F):(_c(),a(b.anchor=c("]"),N,F),F)},m=(v,b,A,I,T,M)=>{if(Nh(v.parentElement,1)||_c(),b.el=null,M){const F=k(v);for(;;){const S=i(v);if(S&&S!==F)l(S);else break}}const $=i(v),N=r(v);return l(v),n(null,b,N,$,A,I,Th(N),T),A&&(A.vnode.el=b.el,_1(A,b.el)),$},k=(v,b="[",A="]")=>{let I=0;for(;v;)if(v=i(v),v&&zc(v)&&(v.data===b&&I++,v.data===A)){if(I===0)return i(v);I--}return v},y=(v,b,A)=>{const I=b.parentNode;I&&I.replaceChild(v,b);let T=A;for(;T;)T.vnode.el===b&&(T.vnode.el=T.subTree.el=v),T=T.parent},g=v=>v.nodeType===1&&v.tagName==="TEMPLATE";return[u,d]}const dw="data-allow-mismatch",rI={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Nh(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(dw);)e=e.parentElement;const n=e&&e.getAttribute(dw);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(rI[t])}}const lI=f1().requestIdleCallback||(e=>setTimeout(e,1)),aI=f1().cancelIdleCallback||(e=>clearTimeout(e)),s4e=(e=1e4)=>t=>{const n=lI(t,{timeout:e});return()=>aI(n)};function cI(e){const{top:t,left:n,bottom:o,right:s}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||o>0&&o<i)&&(n>0&&n<r||s>0&&s<r)}const i4e=e=>(t,n)=>{const o=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){o.disconnect(),t();break}},e);return n(s=>{if(s instanceof Element){if(cI(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},r4e=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},l4e=(e=[])=>(t,n)=>{Rn(e)&&(e=[e]);let o=!1;const s=r=>{o||(o=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,s)})};return n(r=>{for(const l of e)r.addEventListener(l,s,{once:!0})}),i};function uI(e,t){if(zc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(zc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const qr=e=>!!e.type.__asyncLoader;function Hi(e){Rt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:o,delay:s=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const f=()=>(d++,c=null,h()),h=()=>{let p;return c||(p=c=t().catch(m=>{if(m=m instanceof Error?m:new Error(String(m)),a)return new Promise((k,y)=>{a(m,()=>k(f()),()=>y(m),d+1)});throw m}).then(m=>p!==c&&c?c:(m&&(m.__esModule||m[Symbol.toStringTag]==="Module")&&(m=m.default),u=m,m)))};return Je({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,m,k){let y=!1;(m.bu||(m.bu=[])).push(()=>y=!0);const g=()=>{y||k()},v=i?()=>{const b=i(g,A=>uI(p,A));b&&(m.bum||(m.bum=[])).push(b)}:g;u?v():h().then(()=>!m.isUnmounted&&v())},get __asyncResolved(){return u},setup(){const p=Xo;if(Nk(p),u)return()=>Ih(u,p);const m=v=>{c=null,Su(v,p,13,!o)};if(l&&p.suspense||za)return h().then(v=>()=>Ih(v,p)).catch(v=>(m(v),()=>o?ae(o,{error:v}):null));const k=oe(!1),y=oe(),g=oe(!!s);return s&&setTimeout(()=>{g.value=!1},s),r!=null&&setTimeout(()=>{if(!k.value&&!y.value){const v=new Error(`Async component timed out after ${r}ms.`);m(v),y.value=v}},r),h().then(()=>{k.value=!0,p.parent&&If(p.parent.vnode)&&p.parent.update()}).catch(v=>{m(v),y.value=v}),()=>{if(k.value&&u)return Ih(u,p);if(y.value&&o)return ae(o,{error:y.value});if(n&&!g.value)return Ih(n,p)}}})}function Ih(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=ae(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const If=e=>e.type.__isKeepAlive,dI={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Eo(),o=n.ctx;if(!o.renderer)return()=>{const g=t.default&&t.default();return g&&g.length===1?g[0]:g};const s=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=o,f=d("div");o.activate=(g,v,b,A,I)=>{const T=g.component;c(g,v,b,0,l),a(T.vnode,g,v,b,T,l,A,g.slotScopeIds,I),xo(()=>{T.isDeactivated=!1,T.a&&Qc(T.a);const M=g.props&&g.props.onVnodeMounted;M&&Is(M,T.parent,g)},l)},o.deactivate=g=>{const v=g.component;Qp(v.m),Qp(v.a),c(g,f,null,1,l),xo(()=>{v.da&&Qc(v.da);const b=g.props&&g.props.onVnodeUnmounted;b&&Is(b,v.parent,g),v.isDeactivated=!0},l)};function h(g){dg(g),u(g,n,l,!0)}function p(g){s.forEach((v,b)=>{const A=ny(qr(v)?v.type.__asyncResolved||{}:v.type);A&&!g(A)&&m(b)})}function m(g){const v=s.get(g);v&&(!r||!Pi(v,r))?h(v):r&&dg(r),s.delete(g),i.delete(g)}et(()=>[e.include,e.exclude],([g,v])=>{g&&p(b=>gd(g,b)),v&&p(b=>!gd(v,b))},{flush:"post",deep:!0});let k=null;const y=()=>{k!=null&&(Jp(n.subTree.type)?xo(()=>{s.set(k,Lh(n.subTree))},n.subTree.suspense):s.set(k,Lh(n.subTree)))};return Cn(y),Ik(y),ho(()=>{s.forEach(g=>{const{subTree:v,suspense:b}=n,A=Lh(v);if(g.type===A.type&&g.key===A.key){dg(A);const I=A.component.da;I&&xo(I,b);return}h(g)})}),()=>{if(k=null,!t.default)return r=null;const g=t.default(),v=g[0];if(g.length>1)return r=null,g;if(!Dl(v)||!(v.shapeFlag&4)&&!(v.shapeFlag&128))return r=null,v;let b=Lh(v);if(b.type===So)return r=null,b;const A=b.type,I=ny(qr(b)?b.type.__asyncResolved||{}:A),{include:T,exclude:M,max:$}=e;if(T&&(!I||!gd(T,I))||M&&I&&gd(M,I))return b.shapeFlag&=-257,r=b,v;const N=b.key==null?A:b.key,F=s.get(N);return b.el&&(b=Yr(b),v.shapeFlag&128&&(v.ssContent=b)),k=N,F?(b.el=F.el,b.component=F.component,b.transition&&Rl(b,b.transition),b.shapeFlag|=512,i.delete(N),i.add(N)):(i.add(N),$&&i.size>parseInt($,10)&&m(i.values().next().value)),b.shapeFlag|=256,r=b,Jp(v.type)?v:b}}},a4e=dI;function gd(e,t){return At(e)?e.some(n=>gd(n,t)):Rn(e)?e.split(",").includes(t):XN(e)?(e.lastIndex=0,e.test(t)):!1}function fI(e,t){PA(e,"a",t)}function hI(e,t){PA(e,"da",t)}function PA(e,t,n=Xo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(x1(t,o,n),n){let s=n.parent;for(;s&&s.parent;)If(s.parent.vnode)&&pI(o,t,n,s),s=s.parent}}function pI(e,t,n,o){const s=x1(t,e,o,!0);$n(()=>{wk(o[t],s)},n)}function dg(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Lh(e){return e.shapeFlag&128?e.ssContent:e}function x1(e,t,n=Xo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Vr();const l=Cu(n),a=Ei(t,n,e,r);return l(),Kr(),a});return o?s.unshift(i):s.push(i),i}}const Xr=e=>(t,n=Xo)=>{(!za||e==="sp")&&x1(e,(...o)=>t(...o),n)},mI=Xr("bm"),Cn=Xr("m"),HA=Xr("bu"),Ik=Xr("u"),ho=Xr("bum"),$n=Xr("um"),gI=Xr("sp"),vI=Xr("rtg"),yI=Xr("rtc");function kI(e,t=Xo){x1("ec",e,t)}const Lk="components",bI="directives";function xI(e,t){return $k(Lk,e,!0,t)||e}const WA=Symbol.for("v-ndc");function Ho(e){return Rn(e)?$k(Lk,e,!1)||e:e||WA}function c4e(e){return $k(bI,e)}function $k(e,t,n=!0,o=!1){const s=Qo||Xo;if(s){const i=s.type;if(e===Lk){const l=ny(i,!1);if(l&&(l===t||l===Fo(t)||l===u1(Fo(t))))return i}const r=fw(s[e]||i[e],t)||fw(s.appContext[e],t);return!r&&o?i:r}}function fw(e,t){return e&&(e[t]||e[Fo(t)]||e[u1(Fo(t))])}function rt(e,t,n,o){let s;const i=n&&n[o],r=At(e);if(r||Rn(e)){const l=r&&Il(e);let a=!1,c=!1;l&&(a=!ti(e),c=Gr(e),e=m1(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?mu(Vi(e[u])):Vi(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){s=new Array(e);for(let l=0;l<e;l++)s[l]=t(l+1,l,void 0,i&&i[l])}else if(Sn(e))if(e[Symbol.iterator])s=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);s=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];s[a]=t(e[u],u,a,i&&i[a])}}else s=[];return n&&(n[o]=s),s}function zA(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(At(o))for(let s=0;s<o.length;s++)e[o[s].name]=o[s].fn;else o&&(e[o.name]=o.key?(...s)=>{const i=o.fn(...s);return i&&(i.key=o.key),i}:o.fn)}return e}function jn(e,t,n={},o,s){if(Qo.ce||Qo.parent&&qr(Qo.parent)&&Qo.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),Se(We,null,[ae("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),x();const r=i&&Fk(i(n)),l=n.key||r&&r.key,a=Se(We,{key:(l&&!ri(l)?l:`_${t}`)+(!r&&o?"_fb":"")},r||(o?o():[]),r&&e._===1?64:-2);return!s&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function Fk(e){return e.some(t=>Dl(t)?!(t.type===So||t.type===We&&!Fk(t.children)):!0)?e:null}function u4e(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:vp(o)]=e[o];return n}const Gv=e=>e?pM(e)?$f(e):Gv(e.parent):null,Ld=Ln(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Gv(e.parent),$root:e=>Gv(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ok(e),$forceUpdate:e=>e.f||(e.f=()=>{Ek(e.update)}),$nextTick:e=>e.n||(e.n=yt.bind(e.proxy)),$watch:e=>X9.bind(e)}),fg=(e,t)=>e!==ln&&!e.__isScriptSetup&&wn(e,t),Yv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:s,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return o[t];case 2:return s[t];case 4:return n[t];case 3:return i[t]}else{if(fg(o,t))return r[t]=1,o[t];if(s!==ln&&wn(s,t))return r[t]=2,s[t];if(wn(i,t))return r[t]=3,i[t];if(n!==ln&&wn(n,t))return r[t]=4,n[t];Zv&&(r[t]=0)}}const c=Ld[t];let u,d;if(c)return t==="$attrs"&&rs(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==ln&&wn(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,wn(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return fg(s,t)?(s[t]=n,!0):o!==ln&&wn(o,t)?(o[t]=n,!0):wn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:s,props:i,type:r}},l){let a;return!!(n[l]||e!==ln&&l[0]!=="$"&&wn(e,l)||fg(t,l)||wn(i,l)||wn(o,l)||wn(Ld,l)||wn(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:wn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},wI=Ln({},Yv,{get(e,t){if(t!==Symbol.unscopables)return Yv.get(e,t,e)},has(e,t){return t[0]!=="_"&&!n9(t)}});function d4e(){return null}function f4e(){return null}function h4e(e){}function p4e(e){}function m4e(){return null}function g4e(){}function v4e(e,t){return null}function y4e(){return UA().slots}function Lf(){return UA().attrs}function UA(e){const t=Eo();return t.setupContext||(t.setupContext=vM(t))}function of(e){return At(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function k4e(e,t){const n=of(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?At(s)||Rt(s)?s=n[o]={type:s,default:t[o]}:s.default=t[o]:s===null&&(s=n[o]={default:t[o]}),s&&t[`__skip_${o}`]&&(s.skipFactory=!0)}return n}function b4e(e,t){return!e||!t?e||t:At(e)&&At(t)?e.concat(t):Ln({},of(e),of(t))}function x4e(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function w4e(e){const t=Eo(),n=za;let o=e();rf(),n&&ou(!1);const s=()=>{Cu(t),n&&ou(!0)},i=()=>{Eo()!==t&&t.scope.off(),rf(),n&&ou(!1)};return _k(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Zv=!0;function _I(e){const t=Ok(e),n=e.proxy,o=e.ctx;Zv=!1,t.beforeCreate&&hw(t.beforeCreate,e,"bc");const{data:s,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:p,activated:m,deactivated:k,beforeDestroy:y,beforeUnmount:g,destroyed:v,unmounted:b,render:A,renderTracked:I,renderTriggered:T,errorCaptured:M,serverPrefetch:$,expose:N,inheritAttrs:F,components:S,directives:R,filters:z}=t;if(c&&SI(c,o,null),r)for(const O in r){const U=r[O];Rt(U)&&(o[O]=U.bind(n))}if(s){const O=s.call(n,n);Sn(O)&&(e.data=zo(O))}if(Zv=!0,i)for(const O in i){const U=i[O],Z=Rt(U)?U.bind(n,n):Rt(U.get)?U.get.bind(n,n):Ci,ie=!Rt(U)&&Rt(U.set)?U.set.bind(n):Ci,q=D({get:Z,set:ie});Object.defineProperty(o,O,{enumerable:!0,configurable:!0,get:()=>q.value,set:ee=>q.value=ee})}if(l)for(const O in l)qA(l[O],o,n,O);if(a){const O=Rt(a)?a.call(n):a;Reflect.ownKeys(O).forEach(U=>{In(U,O[U])})}u&&hw(u,e,"c");function L(O,U){At(U)?U.forEach(Z=>O(Z.bind(n))):U&&O(U.bind(n))}if(L(mI,d),L(Cn,f),L(HA,h),L(Ik,p),L(fI,m),L(hI,k),L(kI,M),L(yI,I),L(vI,T),L(ho,g),L($n,b),L(gI,$),At(N))if(N.length){const O=e.exposed||(e.exposed={});N.forEach(U=>{Object.defineProperty(O,U,{get:()=>n[U],set:Z=>n[U]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===Ci&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),R&&(e.directives=R),$&&Nk(e)}function SI(e,t,n=Ci){At(e)&&(e=Xv(e));for(const o in e){const s=e[o];let i;Sn(s)?"default"in s?i=Jt(s.from||o,s.default,!0):i=Jt(s.from||o):i=Jt(s),vo(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function hw(e,t,n){Ei(At(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function qA(e,t,n,o){let s=o.includes(".")?IA(n,o):()=>n[o];if(Rn(e)){const i=t[e];Rt(i)&&et(s,i)}else if(Rt(e))et(s,e.bind(n));else if(Sn(e))if(At(e))e.forEach(i=>qA(i,t,n,o));else{const i=Rt(e.handler)?e.handler.bind(n):t[e.handler];Rt(i)&&et(s,i,e)}}function Ok(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:s,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!s.length&&!n&&!o?a=t:(a={},s.length&&s.forEach(c=>Xp(a,c,r,!0)),Xp(a,t,r)),Sn(t)&&i.set(t,a),a}function Xp(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Xp(e,i,n,!0),s&&s.forEach(r=>Xp(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=CI[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const CI={data:pw,props:mw,emits:mw,methods:vd,computed:vd,beforeCreate:ds,created:ds,beforeMount:ds,mounted:ds,beforeUpdate:ds,updated:ds,beforeDestroy:ds,beforeUnmount:ds,destroyed:ds,unmounted:ds,activated:ds,deactivated:ds,errorCaptured:ds,serverPrefetch:ds,components:vd,directives:vd,watch:MI,provide:pw,inject:AI};function pw(e,t){return t?e?function(){return Ln(Rt(e)?e.call(this,this):e,Rt(t)?t.call(this,this):t)}:t:e}function AI(e,t){return vd(Xv(e),Xv(t))}function Xv(e){if(At(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ds(e,t){return e?[...new Set([].concat(e,t))]:t}function vd(e,t){return e?Ln(Object.create(null),e,t):t}function mw(e,t){return e?At(e)&&At(t)?[...new Set([...e,...t])]:Ln(Object.create(null),of(e),of(t??{})):t}function MI(e,t){if(!e)return t;if(!t)return e;const n=Ln(Object.create(null),e);for(const o in t)n[o]=ds(e[o],t[o]);return n}function jA(){return{app:null,config:{isNativeTag:J3,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let EI=0;function TI(e,t){return function(o,s=null){Rt(o)||(o=Ln({},o)),s!=null&&!Sn(s)&&(s=null);const i=jA(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:EI++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:s7,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&Rt(u.install)?(r.add(u),u.install(c,...d)):Rt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!a){const h=c._ceVNode||ae(o,s);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),d&&t?t(h,u):e(h,u,f),a=!0,c._container=u,u.__vue_app__=c,$f(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(Ei(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Ba;Ba=c;try{return u()}finally{Ba=d}}};return c}}let Ba=null;function _4e(e,t,n=ln){const o=Eo(),s=Fo(t),i=Bs(t),r=VA(e,s),l=B9((a,c)=>{let u,d=ln,f;return Z9(()=>{const h=e[s];Zo(u,h)&&(u=h,c())}),{get(){return a(),n.get?n.get(u):u},set(h){const p=n.set?n.set(h):h;if(!Zo(p,u)&&!(d!==ln&&Zo(h,d)))return;const m=o.vnode.props;m&&(t in m||s in m||i in m)&&(`onUpdate:${t}`in m||`onUpdate:${s}`in m||`onUpdate:${i}`in m)||(u=h,c()),o.emit(`update:${t}`,p),Zo(h,p)&&Zo(h,d)&&!Zo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||ln:l,done:!1}:{done:!0}}}},l}const VA=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fo(t)}Modifiers`]||e[`${Bs(t)}Modifiers`];function NI(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||ln;let s=n;const i=t.startsWith("update:"),r=i&&VA(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Rn(u)?u.trim():u)),r.number&&(s=n.map(d1)));let l,a=o[l=vp(t)]||o[l=vp(Fo(t))];!a&&i&&(a=o[l=vp(Bs(t))]),a&&Ei(a,e,6,s);const c=o[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ei(c,e,6,s)}}const II=new WeakMap;function KA(e,t,n=!1){const o=n?II:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!Rt(e)){const a=c=>{const u=KA(c,t,!0);u&&(l=!0,Ln(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Sn(e)&&o.set(e,null),null):(At(i)?i.forEach(a=>r[a]=null):Ln(r,i),Sn(e)&&o.set(e,r),r)}function w1(e,t){return!e||!Mf(t)?!1:(t=t.slice(2).replace(/Once$/,""),wn(e,t[0].toLowerCase()+t.slice(1))||wn(e,Bs(t))||wn(e,t))}function yp(e){const{type:t,vnode:n,proxy:o,withProxy:s,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:p,inheritAttrs:m}=e,k=tf(e);let y,g;try{if(n.shapeFlag&4){const b=s||o,A=b;y=Os(c.call(A,b,u,d,h,f,p)),g=l}else{const b=t;y=Os(b.length>1?b(d,{attrs:l,slots:r,emit:a}):b(d,null)),g=t.props?l:$I(l)}}catch(b){$d.length=0,Su(b,e,1),y=ae(So)}let v=y;if(g&&m!==!1){const b=Object.keys(g),{shapeFlag:A}=v;b.length&&A&7&&(i&&b.some(r1)&&(g=FI(g,i)),v=Yr(v,g,!1,!0))}return n.dirs&&(v=Yr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&Rl(v,n.transition),y=v,tf(k),y}function LI(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Dl(s)){if(s.type!==So||s.children==="v-if"){if(n)return;n=s}}else return}return n}const $I=e=>{let t;for(const n in e)(n==="class"||n==="style"||Mf(n))&&((t||(t={}))[n]=e[n]);return t},FI=(e,t)=>{const n={};for(const o in e)(!r1(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function OI(e,t,n){const{props:o,children:s,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return o?gw(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(GA(r,o,f)&&!w1(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?gw(o,r,c):!0:!!r;return!1}function gw(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let s=0;s<o.length;s++){const i=o[s];if(GA(t,e,i)&&!w1(n,i))return!0}return!1}function GA(e,t,n){const o=e[n],s=t[n];return n==="style"&&Sn(o)&&Sn(s)?!jr(o,s):o!==s}function _1({vnode:e,parent:t,suspense:n},o){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.suspense.vnode.el=s.el=o,e=s),s===e)(e=t.vnode).el=o,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=o)}const YA={},ZA=()=>Object.create(YA),XA=e=>Object.getPrototypeOf(e)===YA;function BI(e,t,n,o=!1){const s={},i=ZA();e.propsDefaults=Object.create(null),QA(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:I9(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function RI(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=dn(s),[a]=e.propsOptions;let c=!1;if((o||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(w1(e.emitsOptions,f))continue;const h=t[f];if(a)if(wn(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=Fo(f);s[p]=Qv(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{QA(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!wn(t,d)&&((u=Bs(d))===d||!wn(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Qv(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!wn(t,d))&&(delete i[d],c=!0)}c&&Dr(e.attrs,"set","")}function QA(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Fa(a))continue;const c=t[a];let u;s&&wn(s,u=Fo(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:w1(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=dn(n),c=l||ln;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Qv(s,a,d,c[d],e,!wn(c,d))}}return r}function Qv(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=wn(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&Rt(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=Cu(s);o=c[n]=a.call(null,t),u()}}else o=a;s.ce&&s.ce._setProp(n,o)}r[0]&&(i&&!l?o=!1:r[1]&&(o===""||o===Bs(n))&&(o=!0))}return o}const DI=new WeakMap;function JA(e,t,n=!1){const o=n?DI:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!Rt(e)){const u=d=>{a=!0;const[f,h]=JA(d,t,!0);Ln(r,f),h&&l.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Sn(e)&&o.set(e,Zc),Zc;if(At(i))for(let u=0;u<i.length;u++){const d=Fo(i[u]);vw(d)&&(r[d]=ln)}else if(i)for(const u in i){const d=Fo(u);if(vw(d)){const f=i[u],h=r[d]=At(f)||Rt(f)?{type:f}:Ln({},f),p=h.type;let m=!1,k=!0;if(At(p))for(let y=0;y<p.length;++y){const g=p[y],v=Rt(g)&&g.name;if(v==="Boolean"){m=!0;break}else v==="String"&&(k=!1)}else m=Rt(p)&&p.name==="Boolean";h[0]=m,h[1]=k,(m||wn(h,"default"))&&l.push(d)}}const c=[r,l];return Sn(e)&&o.set(e,c),c}function vw(e){return e[0]!=="$"&&!Fa(e)}const Bk=e=>e==="_"||e==="_ctx"||e==="$stable",Rk=e=>At(e)?e.map(Os):[Os(e)],PI=(e,t,n)=>{if(t._n)return t;const o=Ie((...s)=>Rk(t(...s)),n);return o._c=!1,o},eM=(e,t,n)=>{const o=e._ctx;for(const s in e){if(Bk(s))continue;const i=e[s];if(Rt(i))t[s]=PI(s,i,o);else if(i!=null){const r=Rk(i);t[s]=()=>r}}},tM=(e,t)=>{const n=Rk(t);e.slots.default=()=>n},nM=(e,t,n)=>{for(const o in t)(n||!Bk(o))&&(e[o]=t[o])},HI=(e,t,n)=>{const o=e.slots=ZA();if(e.vnode.shapeFlag&32){const s=t._;s?(nM(o,t,n),n&&tA(o,"_",s,!0)):eM(t,o)}else t&&tM(e,t)},WI=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=ln;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:nM(s,t,n):(i=!t.$stable,eM(t,s)),r=t}else t&&(tM(e,t),r={default:1});if(i)for(const l in s)!Bk(l)&&r[l]==null&&delete s[l]},xo=aM;function zI(e){return oM(e)}function UI(e){return oM(e,iI)}function oM(e,t){const n=f1();n.__VUE__=!0;const{insert:o,remove:s,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Ci,insertStaticContent:p}=e,m=(P,G,me,ye=null,de=null,V=null,se=void 0,pe=null,ke=!!G.dynamicChildren)=>{if(P===G)return;P&&!Pi(P,G)&&(ye=ve(P),ee(P,de,V,!0),P=null),G.patchFlag===-2&&(ke=!1,G.dynamicChildren=null);const{type:Ne,ref:qe,shapeFlag:be}=G;switch(Ne){case Ll:k(P,G,me,ye);break;case So:y(P,G,me,ye);break;case nu:P==null&&g(G,me,ye,se);break;case We:S(P,G,me,ye,de,V,se,pe,ke);break;default:be&1?A(P,G,me,ye,de,V,se,pe,ke):be&6?R(P,G,me,ye,de,V,se,pe,ke):(be&64||be&128)&&Ne.process(P,G,me,ye,de,V,se,pe,ke,re)}qe!=null&&de?eu(qe,P&&P.ref,V,G||P,!G):qe==null&&P&&P.ref!=null&&eu(P.ref,null,V,P,!0)},k=(P,G,me,ye)=>{if(P==null)o(G.el=l(G.children),me,ye);else{const de=G.el=P.el;G.children!==P.children&&c(de,G.children)}},y=(P,G,me,ye)=>{P==null?o(G.el=a(G.children||""),me,ye):G.el=P.el},g=(P,G,me,ye)=>{[P.el,P.anchor]=p(P.children,G,me,ye,P.el,P.anchor)},v=({el:P,anchor:G},me,ye)=>{let de;for(;P&&P!==G;)de=f(P),o(P,me,ye),P=de;o(G,me,ye)},b=({el:P,anchor:G})=>{let me;for(;P&&P!==G;)me=f(P),s(P),P=me;s(G)},A=(P,G,me,ye,de,V,se,pe,ke)=>{if(G.type==="svg"?se="svg":G.type==="math"&&(se="mathml"),P==null)I(G,me,ye,de,V,se,pe,ke);else{const Ne=P.el&&P.el._isVueCE?P.el:null;try{Ne&&Ne._beginPatch(),$(P,G,de,V,se,pe,ke)}finally{Ne&&Ne._endPatch()}}},I=(P,G,me,ye,de,V,se,pe)=>{let ke,Ne;const{props:qe,shapeFlag:be,transition:xe,dirs:Ze}=P;if(ke=P.el=r(P.type,V,qe&&qe.is,qe),be&8?u(ke,P.children):be&16&&M(P.children,ke,null,ye,de,hg(P,V),se,pe),Ze&&rr(P,null,ye,"created"),T(ke,P,P.scopeId,se,ye),qe){for(const lt in qe)lt!=="value"&&!Fa(lt)&&i(ke,lt,null,qe[lt],V,ye);"value"in qe&&i(ke,"value",null,qe.value,V),(Ne=qe.onVnodeBeforeMount)&&Is(Ne,ye,P)}Ze&&rr(P,null,ye,"beforeMount");const tt=sM(de,xe);tt&&xe.beforeEnter(ke),o(ke,G,me),((Ne=qe&&qe.onVnodeMounted)||tt||Ze)&&xo(()=>{try{Ne&&Is(Ne,ye,P),tt&&xe.enter(ke),Ze&&rr(P,null,ye,"mounted")}finally{}},de)},T=(P,G,me,ye,de)=>{if(me&&h(P,me),ye)for(let V=0;V<ye.length;V++)h(P,ye[V]);if(de){let V=de.subTree;if(G===V||Jp(V.type)&&(V.ssContent===G||V.ssFallback===G)){const se=de.vnode;T(P,se,se.scopeId,se.slotScopeIds,de.parent)}}},M=(P,G,me,ye,de,V,se,pe,ke=0)=>{for(let Ne=ke;Ne<P.length;Ne++){const qe=P[Ne]=pe?Br(P[Ne]):Os(P[Ne]);m(null,qe,G,me,ye,de,V,se,pe)}},$=(P,G,me,ye,de,V,se)=>{const pe=G.el=P.el;let{patchFlag:ke,dynamicChildren:Ne,dirs:qe}=G;ke|=P.patchFlag&16;const be=P.props||ln,xe=G.props||ln;let Ze;if(me&&ca(me,!1),(Ze=xe.onVnodeBeforeUpdate)&&Is(Ze,me,G,P),qe&&rr(G,P,me,"beforeUpdate"),me&&ca(me,!0),(be.innerHTML&&xe.innerHTML==null||be.textContent&&xe.textContent==null)&&u(pe,""),Ne?N(P.dynamicChildren,Ne,pe,me,ye,hg(G,de),V):se||U(P,G,pe,null,me,ye,hg(G,de),V,!1),ke>0){if(ke&16)F(pe,be,xe,me,de);else if(ke&2&&be.class!==xe.class&&i(pe,"class",null,xe.class,de),ke&4&&i(pe,"style",be.style,xe.style,de),ke&8){const tt=G.dynamicProps;for(let lt=0;lt<tt.length;lt++){const ut=tt[lt],mt=be[ut],Tt=xe[ut];(Tt!==mt||ut==="value")&&i(pe,ut,mt,Tt,de,me)}}ke&1&&P.children!==G.children&&u(pe,G.children)}else!se&&Ne==null&&F(pe,be,xe,me,de);((Ze=xe.onVnodeUpdated)||qe)&&xo(()=>{Ze&&Is(Ze,me,G,P),qe&&rr(G,P,me,"updated")},ye)},N=(P,G,me,ye,de,V,se)=>{for(let pe=0;pe<G.length;pe++){const ke=P[pe],Ne=G[pe],qe=ke.el&&(ke.type===We||!Pi(ke,Ne)||ke.shapeFlag&198)?d(ke.el):me;m(ke,Ne,qe,null,ye,de,V,se,!0)}},F=(P,G,me,ye,de)=>{if(G!==me){if(G!==ln)for(const V in G)!Fa(V)&&!(V in me)&&i(P,V,G[V],null,de,ye);for(const V in me){if(Fa(V))continue;const se=me[V],pe=G[V];se!==pe&&V!=="value"&&i(P,V,pe,se,de,ye)}"value"in me&&i(P,"value",G.value,me.value,de)}},S=(P,G,me,ye,de,V,se,pe,ke)=>{const Ne=G.el=P?P.el:l(""),qe=G.anchor=P?P.anchor:l("");let{patchFlag:be,dynamicChildren:xe,slotScopeIds:Ze}=G;Ze&&(pe=pe?pe.concat(Ze):Ze),P==null?(o(Ne,me,ye),o(qe,me,ye),M(G.children||[],me,qe,de,V,se,pe,ke)):be>0&&be&64&&xe&&P.dynamicChildren&&P.dynamicChildren.length===xe.length?(N(P.dynamicChildren,xe,me,de,V,se,pe),(G.key!=null||de&&G===de.subTree)&&Dk(P,G,!0)):U(P,G,me,qe,de,V,se,pe,ke)},R=(P,G,me,ye,de,V,se,pe,ke)=>{G.slotScopeIds=pe,P==null?G.shapeFlag&512?de.ctx.activate(G,me,ye,se,ke):z(G,me,ye,de,V,se,ke):W(P,G,ke)},z=(P,G,me,ye,de,V,se)=>{const pe=P.component=hM(P,ye,de);if(If(P)&&(pe.ctx.renderer=re),mM(pe,!1,se),pe.asyncDep){if(de&&de.registerDep(pe,L,se),!P.el){const ke=pe.subTree=ae(So);y(null,ke,G,me),P.placeholder=ke.el}}else L(pe,P,G,me,de,V,se)},W=(P,G,me)=>{const ye=G.component=P.component;if(OI(P,G,me))if(ye.asyncDep&&!ye.asyncResolved){O(ye,G,me);return}else ye.next=G,ye.update();else G.el=P.el,ye.vnode=G},L=(P,G,me,ye,de,V,se)=>{const pe=()=>{if(P.isMounted){let{next:be,bu:xe,u:Ze,parent:tt,vnode:lt}=P;{const Ft=iM(P);if(Ft){be&&(be.el=lt.el,O(P,be,se)),Ft.asyncDep.then(()=>{xo(()=>{P.isUnmounted||Ne()},de)});return}}let ut=be,mt;ca(P,!1),be?(be.el=lt.el,O(P,be,se)):be=lt,xe&&Qc(xe),(mt=be.props&&be.props.onVnodeBeforeUpdate)&&Is(mt,tt,be,lt),ca(P,!0);const Tt=yp(P),wt=P.subTree;P.subTree=Tt,m(wt,Tt,d(wt.el),ve(wt),P,de,V),be.el=Tt.el,ut===null&&_1(P,Tt.el),Ze&&xo(Ze,de),(mt=be.props&&be.props.onVnodeUpdated)&&xo(()=>Is(mt,tt,be,lt),de)}else{let be;const{el:xe,props:Ze}=G,{bm:tt,m:lt,parent:ut,root:mt,type:Tt}=P,wt=qr(G);if(ca(P,!1),tt&&Qc(tt),!wt&&(be=Ze&&Ze.onVnodeBeforeMount)&&Is(be,ut,G),ca(P,!0),xe&&Q){const Ft=()=>{P.subTree=yp(P),Q(xe,P.subTree,P,de,null)};wt&&Tt.__asyncHydrate?Tt.__asyncHydrate(xe,P,Ft):Ft()}else{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(Tt,P.parent?P.parent.type:void 0);const Ft=P.subTree=yp(P);m(null,Ft,me,ye,P,de,V),G.el=Ft.el}if(lt&&xo(lt,de),!wt&&(be=Ze&&Ze.onVnodeMounted)){const Ft=G;xo(()=>Is(be,ut,Ft),de)}(G.shapeFlag&256||ut&&qr(ut.vnode)&&ut.vnode.shapeFlag&256)&&P.a&&xo(P.a,de),P.isMounted=!0,G=me=ye=null}};P.scope.on();const ke=P.effect=new qp(pe);P.scope.off();const Ne=P.update=ke.run.bind(ke),qe=P.job=ke.runIfDirty.bind(ke);qe.i=P,qe.id=P.uid,ke.scheduler=()=>Ek(qe),ca(P,!0),Ne()},O=(P,G,me)=>{G.component=P;const ye=P.vnode.props;P.vnode=G,P.next=null,RI(P,G.props,ye,me),WI(P,G.children,me),Vr(),sw(P),Kr()},U=(P,G,me,ye,de,V,se,pe,ke=!1)=>{const Ne=P&&P.children,qe=P?P.shapeFlag:0,be=G.children,{patchFlag:xe,shapeFlag:Ze}=G;if(xe>0){if(xe&128){ie(Ne,be,me,ye,de,V,se,pe,ke);return}else if(xe&256){Z(Ne,be,me,ye,de,V,se,pe,ke);return}}Ze&8?(qe&16&&K(Ne,de,V),be!==Ne&&u(me,be)):qe&16?Ze&16?ie(Ne,be,me,ye,de,V,se,pe,ke):K(Ne,de,V,!0):(qe&8&&u(me,""),Ze&16&&M(be,me,ye,de,V,se,pe,ke))},Z=(P,G,me,ye,de,V,se,pe,ke)=>{P=P||Zc,G=G||Zc;const Ne=P.length,qe=G.length,be=Math.min(Ne,qe);let xe;for(xe=0;xe<be;xe++){const Ze=G[xe]=ke?Br(G[xe]):Os(G[xe]);m(P[xe],Ze,me,null,de,V,se,pe,ke)}Ne>qe?K(P,de,V,!0,!1,be):M(G,me,ye,de,V,se,pe,ke,be)},ie=(P,G,me,ye,de,V,se,pe,ke)=>{let Ne=0;const qe=G.length;let be=P.length-1,xe=qe-1;for(;Ne<=be&&Ne<=xe;){const Ze=P[Ne],tt=G[Ne]=ke?Br(G[Ne]):Os(G[Ne]);if(Pi(Ze,tt))m(Ze,tt,me,null,de,V,se,pe,ke);else break;Ne++}for(;Ne<=be&&Ne<=xe;){const Ze=P[be],tt=G[xe]=ke?Br(G[xe]):Os(G[xe]);if(Pi(Ze,tt))m(Ze,tt,me,null,de,V,se,pe,ke);else break;be--,xe--}if(Ne>be){if(Ne<=xe){const Ze=xe+1,tt=Ze<qe?G[Ze].el:ye;for(;Ne<=xe;)m(null,G[Ne]=ke?Br(G[Ne]):Os(G[Ne]),me,tt,de,V,se,pe,ke),Ne++}}else if(Ne>xe)for(;Ne<=be;)ee(P[Ne],de,V,!0),Ne++;else{const Ze=Ne,tt=Ne,lt=new Map;for(Ne=tt;Ne<=xe;Ne++){const Pt=G[Ne]=ke?Br(G[Ne]):Os(G[Ne]);Pt.key!=null&&lt.set(Pt.key,Ne)}let ut,mt=0;const Tt=xe-tt+1;let wt=!1,Ft=0;const en=new Array(Tt);for(Ne=0;Ne<Tt;Ne++)en[Ne]=0;for(Ne=Ze;Ne<=be;Ne++){const Pt=P[Ne];if(mt>=Tt){ee(Pt,de,V,!0);continue}let kn;if(Pt.key!=null)kn=lt.get(Pt.key);else for(ut=tt;ut<=xe;ut++)if(en[ut-tt]===0&&Pi(Pt,G[ut])){kn=ut;break}kn===void 0?ee(Pt,de,V,!0):(en[kn-tt]=Ne+1,kn>=Ft?Ft=kn:wt=!0,m(Pt,G[kn],me,null,de,V,se,pe,ke),mt++)}const Dn=wt?qI(en):Zc;for(ut=Dn.length-1,Ne=Tt-1;Ne>=0;Ne--){const Pt=tt+Ne,kn=G[Pt],hn=G[Pt+1],Kt=Pt+1<qe?hn.el||rM(hn):ye;en[Ne]===0?m(null,kn,me,Kt,de,V,se,pe,ke):wt&&(ut<0||Ne!==Dn[ut]?q(kn,me,Kt,2):ut--)}}},q=(P,G,me,ye,de=null)=>{const{el:V,type:se,transition:pe,children:ke,shapeFlag:Ne}=P;if(Ne&6){q(P.component.subTree,G,me,ye);return}if(Ne&128){P.suspense.move(G,me,ye);return}if(Ne&64){se.move(P,G,me,re);return}if(se===We){o(V,G,me);for(let be=0;be<ke.length;be++)q(ke[be],G,me,ye);o(P.anchor,G,me);return}if(se===nu){v(P,G,me);return}if(ye!==2&&Ne&1&&pe)if(ye===0)pe.persisted&&!V[bi]?o(V,G,me):(pe.beforeEnter(V),o(V,G,me),xo(()=>pe.enter(V),de));else{const{leave:be,delayLeave:xe,afterLeave:Ze}=pe,tt=()=>{P.ctx.isUnmounted?s(V):o(V,G,me)},lt=()=>{const ut=V._isLeaving||!!V[bi];V._isLeaving&&V[bi](!0),pe.persisted&&!ut?tt():be(V,()=>{tt(),Ze&&Ze()})};xe?xe(V,tt,lt):lt()}else o(V,G,me)},ee=(P,G,me,ye=!1,de=!1)=>{const{type:V,props:se,ref:pe,children:ke,dynamicChildren:Ne,shapeFlag:qe,patchFlag:be,dirs:xe,cacheIndex:Ze,memo:tt}=P;if(be===-2&&(de=!1),pe!=null&&(Vr(),eu(pe,null,me,P,!0),Kr()),Ze!=null&&(G.renderCache[Ze]=void 0),qe&256){G.ctx.deactivate(P);return}const lt=qe&1&&xe,ut=!qr(P);let mt;if(ut&&(mt=se&&se.onVnodeBeforeUnmount)&&Is(mt,G,P),qe&6)j(P.component,me,ye);else{if(qe&128){P.suspense.unmount(me,ye);return}lt&&rr(P,null,G,"beforeUnmount"),qe&64?P.type.remove(P,G,me,re,ye):Ne&&!Ne.hasOnce&&(V!==We||be>0&&be&64)?K(Ne,G,me,!1,!0):(V===We&&be&384||!de&&qe&16)&&K(ke,G,me),ye&&fe(P)}const Tt=tt!=null&&Ze==null;(ut&&(mt=se&&se.onVnodeUnmounted)||lt||Tt)&&xo(()=>{mt&&Is(mt,G,P),lt&&rr(P,null,G,"unmounted"),Tt&&(P.el=null)},me)},fe=P=>{const{type:G,el:me,anchor:ye,transition:de}=P;if(G===We){ne(me,ye);return}if(G===nu){b(P);return}const V=()=>{s(me),de&&!de.persisted&&de.afterLeave&&de.afterLeave()};if(P.shapeFlag&1&&de&&!de.persisted){const{leave:se,delayLeave:pe}=de,ke=()=>se(me,V);pe?pe(P.el,V,ke):ke()}else V()},ne=(P,G)=>{let me;for(;P!==G;)me=f(P),s(P),P=me;s(G)},j=(P,G,me)=>{const{bum:ye,scope:de,job:V,subTree:se,um:pe,m:ke,a:Ne}=P;Qp(ke),Qp(Ne),ye&&Qc(ye),de.stop(),V&&(V.flags|=8,ee(se,P,G,me)),pe&&xo(pe,G),xo(()=>{P.isUnmounted=!0},G)},K=(P,G,me,ye=!1,de=!1,V=0)=>{for(let se=V;se<P.length;se++)ee(P[se],G,me,ye,de)},ve=P=>{if(P.shapeFlag&6)return ve(P.component.subTree);if(P.shapeFlag&128)return P.suspense.next();const G=f(P.anchor||P.el),me=G&&G[LA];return me?f(me):G};let he=!1;const Ae=(P,G,me)=>{let ye;P==null?G._vnode&&(ee(G._vnode,null,null,!0),ye=G._vnode.component):m(G._vnode||null,P,G,null,null,null,me),G._vnode=P,he||(he=!0,sw(ye),Yp(),he=!1)},re={p:m,um:ee,m:q,r:fe,mt:z,mc:M,pc:U,pbc:N,n:ve,o:e};let Y,Q;return t&&([Y,Q]=t(re)),{render:Ae,hydrate:Y,createApp:TI(Ae,Y)}}function hg({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ca({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function sM(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Dk(e,t,n=!1){const o=e.children,s=t.children;if(At(o)&&At(s))for(let i=0;i<o.length;i++){const r=o[i];let l=s[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=s[i]=Br(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Dk(r,l)),l.type===Ll&&(l.patchFlag===-1&&(l=s[i]=Br(l)),l.el=r.el),l.type===So&&!l.el&&(l.el=r.el)}}function qI(e){const t=e.slice(),n=[0];let o,s,i,r,l;const a=e.length;for(o=0;o<a;o++){const c=e[o];if(c!==0){if(s=n[n.length-1],e[s]<c){t[o]=s,n.push(o);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function iM(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:iM(t)}function Qp(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function rM(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?rM(t.subTree):null}const Jp=e=>e.__isSuspense;let Jv=0;const jI={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)VI(t,n,o,s,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}KI(e,t,n,o,s,r,l,a,c)}},hydrate:GI,normalize:YI},S4e=jI;function sf(e,t){const n=e.props&&e.props[t];Rt(n)&&n()}function VI(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=lM(e,s,o,t,d,n,i,r,l,a);c(null,f.pendingBranch=e.ssContent,d,null,o,f,i,r),f.deps>0?(sf(e,"onPending"),sf(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),tu(f,e.ssFallback)):f.resolve(!1,!0)}function KI(e,t,n,o,s,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:p,pendingBranch:m,isInFallback:k,isHydrating:y}=d;if(m)d.pendingBranch=f,Pi(m,f)?(a(m,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():k&&(y||(a(p,h,n,o,s,null,i,r,l),tu(d,h)))):(d.pendingId=Jv++,y?(d.isHydrating=!1,d.activeBranch=m):c(m,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),k?(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():(a(p,h,n,o,s,null,i,r,l),tu(d,h))):p&&Pi(p,f)?(a(p,f,n,o,s,d,i,r,l),d.resolve(!0)):(a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0&&d.resolve()));else if(p&&Pi(p,f))a(p,f,n,o,s,d,i,r,l),tu(d,f);else if(sf(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Jv++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:g,pendingId:v}=d;g>0?setTimeout(()=>{d.pendingId===v&&d.fallback(h)},g):g===0&&d.fallback(h)}}function lM(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:m,remove:k}}=c;let y;const g=ZI(e);g&&t&&t.pendingBranch&&(y=t.pendingId,t.deps++);const v=e.props?Up(e.props.timeout):void 0,b=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Jv++,timeout:typeof v=="number"?v:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(I=!1,T=!1){const{vnode:M,activeBranch:$,pendingBranch:N,pendingId:F,effects:S,parentComponent:R,container:z,isInFallback:W}=A;let L=!1;if(A.isHydrating)A.isHydrating=!1;else if(!I){L=$&&N.transition&&N.transition.mode==="out-in";let Z=!1;L&&($.transition.afterLeave=()=>{F===A.pendingId&&(f(N,z,i===b&&!Z?p($):i,0),Gp(S),W&&M.ssFallback&&(M.ssFallback.el=null))}),$&&!A.isFallbackMountPending&&(m($.el)===z&&(i=p($),Z=!0),h($,R,A,!0),!L&&W&&M.ssFallback&&xo(()=>M.ssFallback.el=null,A)),L||f(N,z,i,0)}A.isFallbackMountPending=!1,tu(A,N),A.pendingBranch=null,A.isInFallback=!1;let O=A.parent,U=!1;for(;O;){if(O.pendingBranch){O.effects.push(...S),U=!0;break}O=O.parent}!U&&!L&&Gp(S),A.effects=[],g&&t&&t.pendingBranch&&y===t.pendingId&&(t.deps--,t.deps===0&&!T&&t.resolve()),sf(M,"onResolve")},fallback(I){if(!A.pendingBranch)return;const{vnode:T,activeBranch:M,parentComponent:$,container:N,namespace:F}=A;sf(T,"onFallback");const S=p(M),R=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,I,N,S,$,null,F,l,a),tu(A,I))},z=I.transition&&I.transition.mode==="out-in";z&&(A.isFallbackMountPending=!0,M.transition.afterLeave=R),A.isInFallback=!0,h(M,$,null,!0),z||R()},move(I,T,M){A.activeBranch&&f(A.activeBranch,I,T,M),A.container=I},next(){return A.activeBranch&&p(A.activeBranch)},registerDep(I,T,M){const $=!!A.pendingBranch;$&&A.deps++;const N=I.vnode.el;I.asyncDep.catch(F=>{Su(F,I,0)}).then(F=>{if(I.isUnmounted||A.isUnmounted||A.pendingId!==I.suspenseId)return;rf(),I.asyncResolved=!0;const{vnode:S}=I;ey(I,F,!1),N&&(S.el=N);const R=!N&&I.subTree.el;T(I,S,m(N||I.subTree.el),N?null:p(I.subTree),A,r,M),R&&(S.placeholder=null,k(R)),_1(I,S.el),$&&--A.deps===0&&A.resolve()})},unmount(I,T){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,I,T),A.pendingBranch&&h(A.pendingBranch,n,I,T)}};return A}function GI(e,t,n,o,s,i,r,l,a){const c=t.suspense=lM(t,o,n,e.parentNode,document.createElement("div"),null,s,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function YI(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=yw(o?n.default:n),e.ssFallback=o?yw(n.fallback):ae(So)}function yw(e){let t;if(Rt(e)){const n=Wa&&e._c;n&&(e._d=!1,x()),e=e(),n&&(e._d=!0,t=ls,cM())}return At(e)&&(e=LI(e)),e=Os(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function aM(e,t){t&&t.pendingBranch?At(e)?t.effects.push(...e):t.effects.push(e):Gp(e)}function tu(e,t){e.activeBranch=t;const{vnode:n,parentComponent:o}=e;let s=t.el;for(;!s&&t.component;)t=t.component.subTree,s=t.el;n.el=s,o&&o.subTree===n&&(o.vnode.el=s,_1(o,s))}function ZI(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const We=Symbol.for("v-fgt"),Ll=Symbol.for("v-txt"),So=Symbol.for("v-cmt"),nu=Symbol.for("v-stc"),$d=[];let ls=null;function x(e=!1){$d.push(ls=e?null:[])}function cM(){$d.pop(),ls=$d[$d.length-1]||null}let Wa=1;function em(e,t=!1){Wa+=e,e<0&&ls&&t&&(ls.hasOnce=!0)}function uM(e){return e.dynamicChildren=Wa>0?ls||Zc:null,cM(),Wa>0&&ls&&ls.push(e),e}function E(e,t,n,o,s,i){return uM(w(e,t,n,o,s,i,!0))}function Se(e,t,n,o,s){return uM(ae(e,t,n,o,s,!0))}function Dl(e){return e?e.__v_isVNode===!0:!1}function Pi(e,t){return e.type===t.type&&e.key===t.key}function C4e(e){}const dM=({key:e})=>e??null,kp=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Rn(e)||vo(e)||Rt(e)?{i:Qo,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,o=0,s=null,i=e===We?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&dM(t),ref:t&&kp(t),scopeId:k1,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Qo};return l?(Hk(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Rn(n)?8:16),Wa>0&&!r&&ls&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&ls.push(a),a}const ae=XI;function XI(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===WA)&&(e=So),Dl(e)){const l=Yr(e,t,!0);return n&&Hk(l,n),Wa>0&&!i&&ls&&(l.shapeFlag&6?ls[ls.indexOf(e)]=l:ls.push(l)),l.patchFlag=-2,l}if(n7(e)&&(e=e.__vccOpts),t){t=fM(t);let{class:l,style:a}=t;l&&!Rn(l)&&(t.class=Ue(l)),Sn(a)&&(y1(a)&&!At(a)&&(a=Ln({},a)),t.style=on(a))}const r=Rn(e)?1:Jp(e)?128:$A(e)?64:Sn(e)?4:Rt(e)?2:0;return w(e,t,n,o,s,r,i,!0)}function fM(e){return e?y1(e)||XA(e)?Ln({},e):e:null}function Yr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?_n(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&dM(c),ref:t&&t.ref?n&&i?At(i)?i.concat(kp(t)):[i,kp(t)]:kp(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==We?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yr(e.ssContent),ssFallback:e.ssFallback&&Yr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Rl(u,a.clone(u)),u}function ot(e=" ",t=0){return ae(Ll,null,e,t)}function Pk(e,t){const n=ae(nu,null,e);return n.staticCount=t,n}function ue(e="",t=!1){return t?(x(),Se(So,null,e)):ae(So,null,e)}function Os(e){return e==null||typeof e=="boolean"?ae(So):At(e)?ae(We,null,e.slice()):Dl(e)?Br(e):ae(Ll,null,String(e))}function Br(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yr(e)}function Hk(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(At(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),Hk(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!XA(t)?t._ctx=Qo:s===3&&Qo&&(Qo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Rt(t)?(t={default:t,_ctx:Qo},n=32):(t=String(t),o&64?(n=16,t=[ot(t)]):n=8);e.children=t,e.shapeFlag|=n}function _n(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const s in o)if(s==="class")t.class!==o.class&&(t.class=Ue([t.class,o.class]));else if(s==="style")t.style=on([t.style,o.style]);else if(Mf(s)){const i=t[s],r=o[s];r&&i!==r&&!(At(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!r1(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Is(e,t,n,o=null){Ei(e,t,7,[n,o])}const QI=jA();let JI=0;function hM(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||QI,i={uid:JI++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new iA(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:JA(o,s),emitsOptions:KA(o,s),emit:null,emitted:null,propsDefaults:ln,inheritAttrs:o.inheritAttrs,ctx:ln,data:ln,props:ln,attrs:ln,slots:ln,refs:ln,setupState:ln,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=NI.bind(null,i),e.ce&&e.ce(i),i}let Xo=null;const Eo=()=>Xo||Qo;let tm,ou;{const e=f1(),t=(n,o)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(o),i=>{s.length>1?s.forEach(r=>r(i)):s[0](i)}};tm=t("__VUE_INSTANCE_SETTERS__",n=>Xo=n),ou=t("__VUE_SSR_SETTERS__",n=>za=n)}const Cu=e=>{const t=Xo;return tm(e),e.scope.on(),()=>{e.scope.off(),tm(t)}},rf=()=>{Xo&&Xo.scope.off(),tm(null)};function pM(e){return e.vnode.shapeFlag&4}let za=!1;function mM(e,t=!1,n=!1){t&&ou(t);const{props:o,children:s}=e.vnode,i=pM(e);BI(e,o,i,t),HI(e,s,n||t);const r=i?e7(e,t):void 0;return t&&ou(!1),r}function e7(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Yv);const{setup:o}=n;if(o){Vr();const s=e.setupContext=o.length>1?vM(e):null,i=Cu(e),r=Tf(o,e,0,[e.props,s]),l=_k(r);if(Kr(),i(),(l||e.sp)&&!qr(e)&&Nk(e),l){if(r.then(rf,rf),t)return r.then(a=>{ey(e,a,t)}).catch(a=>{Su(a,e,0)});e.asyncDep=r}else ey(e,r,t)}else gM(e,t)}function ey(e,t,n){Rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Sn(t)&&(e.setupState=_A(t)),gM(e,n)}let nm,ty;function A4e(e){nm=e,ty=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,wI))}}const M4e=()=>!nm;function gM(e,t,n){const o=e.type;if(!e.render){if(!t&&nm&&!o.render){const s=o.template||Ok(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=Ln(Ln({isCustomElement:i,delimiters:l},r),a);o.render=nm(s,c)}}e.render=o.render||Ci,ty&&ty(e)}{const s=Cu(e);Vr();try{_I(e)}finally{Kr(),s()}}}const t7={get(e,t){return rs(e,"get",""),e[t]}};function vM(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,t7),slots:e.slots,emit:e.emit,expose:t}}function $f(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_A(gt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ld)return Ld[n](e)},has(t,n){return n in t||n in Ld}})):e.proxy}function ny(e,t=!0){return Rt(e)?e.displayName||e.name:e.name||t&&e.__name}function n7(e){return Rt(e)&&"__vccOpts"in e}const D=(e,t)=>H9(e,t,za);function Lt(e,t,n){try{em(-1);const o=arguments.length;return o===2?Sn(t)&&!At(t)?Dl(t)?ae(e,null,[t]):ae(e,t):ae(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Dl(n)&&(n=[n]),ae(e,t,n))}finally{em(1)}}function E4e(){}function T4e(e,t,n,o){const s=n[o];if(s&&o7(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function o7(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(Zo(n[o],t[o]))return!1;return Wa>0&&ls&&ls.push(e),!0}const s7="3.5.35",N4e=Ci,I4e=j9,L4e=Fc,$4e=TA,i7={createComponentInstance:hM,setupComponent:mM,renderComponentRoot:yp,setCurrentRenderingInstance:tf,isVNode:Dl,normalizeVNode:Os,getComponentPublicInstance:$f,ensureValidVNode:Fk,pushWarningContext:U9,popWarningContext:q9},F4e=i7,O4e=null,B4e=null,R4e=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let oy;const kw=typeof window<"u"&&window.trustedTypes;if(kw)try{oy=kw.createPolicy("vue",{createHTML:e=>e})}catch{}const yM=oy?e=>oy.createHTML(e):e=>e,r7="http://www.w3.org/2000/svg",l7="http://www.w3.org/1998/Math/MathML",Ir=typeof document<"u"?document:null,bw=Ir&&Ir.createElement("template"),a7={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const s=t==="svg"?Ir.createElementNS(r7,e):t==="mathml"?Ir.createElementNS(l7,e):n?Ir.createElement(e,{is:n}):Ir.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>Ir.createTextNode(e),createComment:e=>Ir.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ir.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,s,i){const r=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{bw.innerHTML=yM(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=bw.content;if(o==="svg"||o==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ll="transition",od="animation",gu=Symbol("_vtc"),kM={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},bM=Ln({},OA,kM),c7=e=>(e.displayName="Transition",e.props=bM,e),Ua=c7((e,{slots:t})=>Lt(nI,xM(e),t)),ua=(e,t=[])=>{At(e)?e.forEach(n=>n(...t)):e&&e(...t)},xw=e=>e?At(e)?e.some(t=>t.length>1):e.length>1:!1;function xM(e){const t={};for(const S in e)S in kM||(t[S]=e[S]);if(e.css===!1)return t;const{name:n="v",type:o,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=u7(s),m=p&&p[0],k=p&&p[1],{onBeforeEnter:y,onEnter:g,onEnterCancelled:v,onLeave:b,onLeaveCancelled:A,onBeforeAppear:I=y,onAppear:T=g,onAppearCancelled:M=v}=t,$=(S,R,z,W)=>{S._enterCancelled=W,vl(S,R?u:l),vl(S,R?c:r),z&&z()},N=(S,R)=>{S._isLeaving=!1,vl(S,d),vl(S,h),vl(S,f),R&&R()},F=S=>(R,z)=>{const W=S?T:g,L=()=>$(R,S,z);ua(W,[R,L]),ww(()=>{vl(R,S?a:i),sr(R,S?u:l),xw(W)||_w(R,o,m,L)})};return Ln(t,{onBeforeEnter(S){ua(y,[S]),sr(S,i),sr(S,r)},onBeforeAppear(S){ua(I,[S]),sr(S,a),sr(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,R){S._isLeaving=!0;const z=()=>N(S,R);sr(S,d),S._enterCancelled?(sr(S,f),sy(S)):(sy(S),sr(S,f)),ww(()=>{S._isLeaving&&(vl(S,d),sr(S,h),xw(b)||_w(S,o,k,z))}),ua(b,[S,z])},onEnterCancelled(S){$(S,!1,void 0,!0),ua(v,[S])},onAppearCancelled(S){$(S,!0,void 0,!0),ua(M,[S])},onLeaveCancelled(S){N(S),ua(A,[S])}})}function u7(e){if(e==null)return null;if(Sn(e))return[pg(e.enter),pg(e.leave)];{const t=pg(e);return[t,t]}}function pg(e){return Up(e)}function sr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[gu]||(e[gu]=new Set)).add(t)}function vl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[gu];n&&(n.delete(t),n.size||(e[gu]=void 0))}function ww(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let d7=0;function _w(e,t,n,o){const s=e._endId=++d7,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=wM(e,t);if(!r)return o();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,f),i()},f=h=>{h.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,f)}function wM(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${ll}Delay`),i=o(`${ll}Duration`),r=Sw(s,i),l=o(`${od}Delay`),a=o(`${od}Duration`),c=Sw(l,a);let u=null,d=0,f=0;t===ll?r>0&&(u=ll,d=r,f=i.length):t===od?c>0&&(u=od,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?ll:od:null,f=u?u===ll?i.length:a.length:0);const h=u===ll&&/\b(?:transform|all)(?:,|$)/.test(o(`${ll}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function Sw(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Cw(n)+Cw(e[o])))}function Cw(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function sy(e){return(e?e.ownerDocument:document).body.offsetHeight}function f7(e,t,n){const o=e[gu];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const om=Symbol("_vod"),_M=Symbol("_vsh"),wi={name:"show",beforeMount(e,{value:t},{transition:n}){e[om]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):sd(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),sd(e,!0),o.enter(e)):o.leave(e,()=>{sd(e,!1)}):sd(e,t))},beforeUnmount(e,{value:t}){sd(e,t)}};function sd(e,t){e.style.display=t?e[om]:"none",e[_M]=!t}function h7(){wi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const SM=Symbol("");function D4e(e){const t=Eo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>sm(i,s))},o=()=>{const s=e(t.proxy);t.ce?sm(t.ce,s):iy(t.subTree,s),n(s)};HA(()=>{Gp(o)}),Cn(()=>{et(o,Ci,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),$n(()=>s.disconnect())})}function iy(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{iy(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)sm(e.el,t);else if(e.type===We)e.children.forEach(n=>iy(n,t));else if(e.type===nu){let{el:n,anchor:o}=e;for(;n&&(sm(n,t),n!==o);)n=n.nextSibling}}function sm(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=d9(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[SM]=o}}const p7=/(?:^|;)\s*display\s*:/;function m7(e,t,n){const o=e.style,s=Rn(n);let i=!1;if(n&&!s){if(t)if(Rn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&yd(o,l,"")}else for(const r in t)n[r]==null&&yd(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?v7(e,r,!Rn(t)&&t?t[r]:void 0,l)||yd(o,r,l):yd(o,r,"")}}else if(s){if(t!==n){const r=o[SM];r&&(n+=";"+r),o.cssText=n,i=p7.test(n)}}else t&&e.removeAttribute("style");om in e&&(e[om]=i?o.display:"",e[_M]&&(o.display="none"))}const Aw=/\s*!important$/;function yd(e,t,n){if(At(n))n.forEach(o=>yd(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=g7(e,t);Aw.test(n)?e.setProperty(Bs(o),n.replace(Aw,""),"important"):e[o]=n}}const Mw=["Webkit","Moz","ms"],mg={};function g7(e,t){const n=mg[t];if(n)return n;let o=Fo(t);if(o!=="filter"&&o in e)return mg[t]=o;o=u1(o);for(let s=0;s<Mw.length;s++){const i=Mw[s]+o;if(i in e)return mg[t]=i}return t}function v7(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Rn(o)&&n===o}const Ew="http://www.w3.org/1999/xlink";function Tw(e,t,n,o,s,i=c9(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ew,t.slice(6,t.length)):e.setAttributeNS(Ew,t,n):n==null||i&&!nA(n)?e.removeAttribute(t):e.setAttribute(t,i?"":ri(n)?String(n):n)}function Nw(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?yM(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=nA(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(s||t)}function Hr(e,t,n,o){e.addEventListener(t,n,o)}function y7(e,t,n,o){e.removeEventListener(t,n,o)}const Iw=Symbol("_vei");function k7(e,t,n,o,s=null){const i=e[Iw]||(e[Iw]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=b7(t);if(o){const c=i[t]=_7(o,s);Hr(e,l,c,a)}else r&&(y7(e,l,r,a),i[t]=void 0)}}const Lw=/(?:Once|Passive|Capture)$/;function b7(e){let t;if(Lw.test(e)){t={};let o;for(;o=e.match(Lw);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Bs(e.slice(2)),t]}let gg=0;const x7=Promise.resolve(),w7=()=>gg||(x7.then(()=>gg=0),gg=Date.now());function _7(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(At(s)){const i=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{i.call(o),o._stopped=!0};const r=s.slice(),l=[o];for(let a=0;a<r.length&&!o._stopped;a++){const c=r[a];c&&Ei(c,t,5,l)}}else Ei(s,t,5,[o])};return n.value=e,n.attached=w7(),n}const $w=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,S7=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?f7(e,o,r):t==="style"?m7(e,n,o):Mf(t)?r1(t)||k7(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):C7(e,t,o,r))?(Nw(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Tw(e,t,o,r,i,t!=="value")):e._isVueCE&&(A7(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Rn(o)))?Nw(e,Fo(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Tw(e,t,o,r))};function C7(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&$w(t)&&Rt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return $w(t)&&Rn(n)?!1:t in e}function A7(e,t){const n=e._def.props;if(!n)return!1;const o=Fo(t);return Array.isArray(n)?n.some(s=>Fo(s)===o):Object.keys(n).some(s=>Fo(s)===o)}const Fw={};function M7(e,t,n){let o=Je(e,t);l1(o)&&(o=Ln({},o,t));class s extends Wk{constructor(r){super(o,r,n)}}return s.def=o,s}const P4e=((e,t)=>M7(e,t,q7)),E7=typeof HTMLElement<"u"?HTMLElement:class{};class Wk extends E7{constructor(t,n={},o=lm){super(),this._def=t,this._props=n,this._createApp=o,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&o!==lm?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ln({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof Wk){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,yt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let o=0;o<this.attributes.length;o++)this._setAttr(this.attributes[o].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(o,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=o;let l;if(i&&!At(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Up(this._props[a])),(l||(l=Object.create(null)))[Fo(a)]=!0)}this._numberProps=l,this._resolveProps(o),this.shadowRoot&&this._applyStyles(r),this._mount(o)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(o=>{o.configureApp=this._def.configureApp,t(this._def=o,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const o in n)wn(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=At(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&o.includes(s)&&this._setProp(s,this[s]);for(const s of o.map(Fo))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let o=n?this.getAttribute(t):Fw;const s=Fo(t);n&&this._numberProps&&this._numberProps[s]&&(o=Up(o)),this._setProp(s,o,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,o=!0,s=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Fw?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),o)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Bs(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Bs(t),n+""):n||this.removeAttribute(Bs(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),U7(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=ae(this._def,Ln(t,this._props));return this._instance||(n.ce=o=>{this._instance=o,o.ce=this,o.isCE=!0;const s=(i,r)=>{this.dispatchEvent(new CustomEvent(i,l1(r[0])?Ln({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Bs(i)!==i&&s(Bs(i),r)},this._setParent()}),n}_applyStyles(t,n,o){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,r=o?this._getStyleAnchor(o)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");s&&c.setAttribute("nonce",s),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(o||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const o=t.childNodes[n];if(!(o instanceof HTMLStyleElement))return o}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const o=n.nodeType===1&&n.getAttribute("slot")||"default";(t[o]||(t[o]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let o=0;o<t.length;o++){const s=t[o],i=s.getAttribute("name")||"default",r=this._slots[i],l=s.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,s)}else for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const o of t){const s=o.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function T7(e){const t=Eo(),n=t&&t.ce;return n||null}function H4e(){const e=T7();return e&&e.shadowRoot}function W4e(e="$style"){{const t=Eo();if(!t)return ln;const n=t.type.__cssModules;if(!n)return ln;const o=n[e];return o||ln}}const CM=new WeakMap,AM=new WeakMap,im=Symbol("_moveCb"),Ow=Symbol("_enterCb"),N7=e=>(delete e.props.mode,e),I7=N7({name:"TransitionGroup",props:Ln({},bM,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Eo(),o=FA();let s,i;return Ik(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!B7(s[0].el,n.vnode.el,r)){s=[];return}s.forEach($7),s.forEach(F7);const l=s.filter(O7);sy(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;sr(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[im]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[im]=null,vl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=dn(e),l=xM(r);let a=r.tag||We;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Rl(u,nf(u,l,o,n)),CM.set(u,MM(u.el)))}i=t.default?Tk(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Rl(u,nf(u,l,o,n))}return ae(a,null,i)}}}),L7=I7;function $7(e){const t=e.el;t[im]&&t[im](),t[Ow]&&t[Ow]()}function F7(e){AM.set(e,MM(e.el))}function O7(e){const t=CM.get(e),n=AM.get(e),o=t.left-n.left,s=t.top-n.top;if(o||s){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${o/a}px,${s/c}px)`,r.transitionDuration="0s",e}}function MM(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function B7(e,t,n){const o=e.cloneNode(),s=e[gu];s&&s.forEach(l=>{l.split(/\s+/).forEach(a=>a&&o.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&o.classList.add(l)),o.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(o);const{hasTransform:r}=wM(o);return i.removeChild(o),r}const Pl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return At(t)?n=>Qc(t,n):t};function R7(e){e.target.composing=!0}function Bw(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ai=Symbol("_assign");function Rw(e,t,n){return t&&(e=e.trim()),n&&(e=d1(e)),e}const Cs={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[Ai]=Pl(s);const i=o||s.props&&s.props.type==="number";Hr(e,t?"change":"input",r=>{r.target.composing||e[Ai](Rw(e.value,n,i))}),(n||i)&&Hr(e,"change",()=>{e.value=Rw(e.value,n,i)}),t||(Hr(e,"compositionstart",R7),Hr(e,"compositionend",Bw),Hr(e,"change",Bw))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[Ai]=Pl(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?d1(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(o&&t===n||s&&e.value.trim()===a)||(e.value=a)}},rm={deep:!0,created(e,t,n){e[Ai]=Pl(n),Hr(e,"change",()=>{const o=e._modelValue,s=vu(e),i=e.checked,r=e[Ai];if(At(o)){const l=h1(o,s),a=l!==-1;if(i&&!a)r(o.concat(s));else if(!i&&a){const c=[...o];c.splice(l,1),r(c)}}else if(Qa(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(TM(e,i))})},mounted:Dw,beforeUpdate(e,t,n){e[Ai]=Pl(n),Dw(e,t,n)}};function Dw(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(At(t))s=h1(t,o.props.value)>-1;else if(Qa(t))s=t.has(o.props.value);else{if(t===n)return;s=jr(t,TM(e,!0))}e.checked!==s&&(e.checked=s)}const EM={created(e,{value:t},n){e.checked=jr(t,n.props.value),e[Ai]=Pl(n),Hr(e,"change",()=>{e[Ai](vu(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Ai]=Pl(o),t!==n&&(e.checked=jr(t,o.props.value))}},ry={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Qa(t);Hr(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?d1(vu(r)):vu(r));e[Ai](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,yt(()=>{e._assigning=!1})}),e[Ai]=Pl(o)},mounted(e,{value:t}){Pw(e,t)},beforeUpdate(e,t,n){e[Ai]=Pl(n)},updated(e,{value:t}){e._assigning||Pw(e,t)}};function Pw(e,t){const n=e.multiple,o=At(t);if(!(n&&!o&&!Qa(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=vu(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=h1(t,l)>-1}else r.selected=t.has(l);else if(jr(vu(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function vu(e){return"_value"in e?e._value:e.value}function TM(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const D7={created(e,t,n){$h(e,t,n,null,"created")},mounted(e,t,n){$h(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){$h(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){$h(e,t,n,o,"updated")}};function NM(e,t){switch(e){case"SELECT":return ry;case"TEXTAREA":return Cs;default:switch(t){case"checkbox":return rm;case"radio":return EM;default:return Cs}}}function $h(e,t,n,o,s){const r=NM(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function P7(){Cs.getSSRProps=({value:e})=>({value:e}),EM.getSSRProps=({value:e},t)=>{if(t.props&&jr(t.props.value,e))return{checked:!0}},rm.getSSRProps=({value:e},t)=>{if(At(e)){if(t.props&&h1(e,t.props.value)>-1)return{checked:!0}}else if(Qa(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},D7.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=NM(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const H7=["ctrl","shift","alt","meta"],W7={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>H7.some(n=>e[`${n}Key`]&&!t.includes(n))},St=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=((s,...i)=>{for(let r=0;r<t.length;r++){const l=W7[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},z7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ur=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Bs(s.key);if(t.some(r=>r===i||z7[r]===i))return e(s)}))},IM=Ln({patchProp:S7},a7);let Fd,Hw=!1;function LM(){return Fd||(Fd=zI(IM))}function $M(){return Fd=Hw?Fd:UI(IM),Hw=!0,Fd}const U7=((...e)=>{LM().render(...e)}),z4e=((...e)=>{$M().hydrate(...e)}),lm=((...e)=>{const t=LM().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=OM(o);if(!s)return;const i=t._component;!Rt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,FM(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),q7=((...e)=>{const t=$M().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=OM(o);if(s)return n(s,!0,FM(s))},t});function FM(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function OM(e){return Rn(e)?document.querySelector(e):e}let Ww=!1;const U4e=()=>{Ww||(Ww=!0,P7(),h7())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function j7(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const am=typeof window<"u",Vl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),V7=(e,t,n)=>K7({l:e,k:t,s:n}),K7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ao=e=>typeof e=="number"&&isFinite(e),BM=e=>Uk(e)==="[object Date]",yu=e=>Uk(e)==="[object RegExp]",S1=e=>un(e)&&Object.keys(e).length===0,Mo=Object.assign,G7=Object.create,Bn=(e=null)=>G7(e);let zw;const Ea=()=>zw||(zw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Bn());function Uw(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function Y7(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const Z7=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,X7=/^(?:href|src|action|formaction)$/i;function zk(e){return Z7.test(e)}function Q7(e){const t=/url\s*\(/gi;let n="",o=0,s;for(;(s=t.exec(e))!==null;){const i=s.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const f=e[l];if(c){f===c&&(c=null);continue}if(f==='"'||f==="'")c=f;else if(f==="(")a++;else if(f===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(o,i),n+=zk(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function qw(e,t){if(X7.test(e)&&zk(t))return"about:blank";const n=e.toLowerCase()==="style"?Q7(t):t;return Y7(n)}function J7(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${qw(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${qw(o,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,o,s)=>zk(s)?`${o}about:blank`:n),e}const eL=Object.prototype.hasOwnProperty;function Si(e,t){return eL.call(e,t)}const fo=Array.isArray,oo=e=>typeof e=="function",xt=e=>typeof e=="string",vn=e=>typeof e=="boolean",yn=e=>e!==null&&typeof e=="object",tL=e=>yn(e)&&oo(e.then)&&oo(e.catch),RM=Object.prototype.toString,Uk=e=>RM.call(e),un=e=>Uk(e)==="[object Object]",nL=e=>e==null?"":fo(e)||un(e)&&e.toString===RM?JSON.stringify(e,null,2):String(e);function qk(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Fh=e=>!yn(e)||fo(e);function bp(e,t){if(Fh(e)||Fh(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:s}=n.pop();Object.keys(o).forEach(i=>{i!=="__proto__"&&(yn(o[i])&&!yn(s[i])&&(s[i]=Array.isArray(o[i])?[]:Bn()),Fh(s[i])||Fh(o[i])?s[i]=o[i]:n.push({src:o[i],des:s[i]}))})}}/*!
25
+ * message-compiler v11.4.5
26
+ * (c) 2026 kazuya kawaguchi
27
+ * Released under the MIT License.
28
+ */function oL(e,t,n){return{line:e,column:t,offset:n}}function ly(e,t,n){return{start:e,end:t}}const Mn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},sL=17;function C1(e,t,n={}){const{domain:o,messages:s,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=o,l}function iL(e){throw e}const er=" ",rL="\r",ss=`
29
+ `,lL="\u2028",aL="\u2029";function cL(e){const t=e;let n=0,o=1,s=1,i=0;const r=T=>t[T]===rL&&t[T+1]===ss,l=T=>t[T]===ss,a=T=>t[T]===aL,c=T=>t[T]===lL,u=T=>r(T)||l(T)||a(T)||c(T),d=()=>n,f=()=>o,h=()=>s,p=()=>i,m=T=>r(T)||a(T)||c(T)?ss:t[T],k=()=>m(n),y=()=>m(n+i);function g(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function v(){return r(n+i)&&i++,i++,t[n+i]}function b(){n=0,o=1,s=1,i=0}function A(T=0){i=T}function I(){const T=n+i;for(;T!==n;)g();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:m,currentChar:k,currentPeek:y,next:g,peek:v,reset:b,resetPeek:A,skipToPeek:I}}const Ar=void 0,uL=".",jw="'",dL="tokenizer";function fL(e,t={}){const n=t.location!==!1,o=cL(e),s=()=>o.index(),i=()=>oL(o.line(),o.column(),o.index()),r=i(),l=s(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(V,se,pe,...ke){const Ne=c();if(se.column+=pe,se.offset+=pe,u){const qe=n?ly(Ne.startLoc,se):null,be=C1(V,qe,{domain:dL,args:ke});u(be)}}function f(V,se,pe){V.endLoc=i(),V.currentType=se;const ke={type:se};return n&&(ke.loc=ly(V.startLoc,V.endLoc)),pe!=null&&(ke.value=pe),ke}const h=V=>f(V,13);function p(V,se){return V.currentChar()===se?(V.next(),se):(d(Mn.EXPECTED_TOKEN,i(),0,se),"")}function m(V){let se="";for(;V.currentPeek()===er||V.currentPeek()===ss;)se+=V.currentPeek(),V.peek();return se}function k(V){const se=m(V);return V.skipToPeek(),se}function y(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se===95}function g(V){if(V===Ar)return!1;const se=V.charCodeAt(0);return se>=48&&se<=57}function v(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=y(V.currentPeek());return V.resetPeek(),ke}function b(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=V.currentPeek()==="-"?V.peek():V.currentPeek(),Ne=g(ke);return V.resetPeek(),Ne}function A(V,se){const{currentType:pe}=se;if(pe!==2)return!1;m(V);const ke=V.currentPeek()===jw;return V.resetPeek(),ke}function I(V,se){const{currentType:pe}=se;if(pe!==7)return!1;m(V);const ke=V.currentPeek()===".";return V.resetPeek(),ke}function T(V,se){const{currentType:pe}=se;if(pe!==8)return!1;m(V);const ke=y(V.currentPeek());return V.resetPeek(),ke}function M(V,se){const{currentType:pe}=se;if(!(pe===7||pe===11))return!1;m(V);const ke=V.currentPeek()===":";return V.resetPeek(),ke}function $(V,se){const{currentType:pe}=se;if(pe!==9)return!1;const ke=()=>{const qe=V.currentPeek();return qe==="{"?y(V.peek()):qe==="@"||qe==="|"||qe===":"||qe==="."||qe===er||!qe?!1:qe===ss?(V.peek(),ke()):F(V,!1)},Ne=ke();return V.resetPeek(),Ne}function N(V){m(V);const se=V.currentPeek()==="|";return V.resetPeek(),se}function F(V,se=!0){const pe=(Ne=!1,qe="")=>{const be=V.currentPeek();return be==="{"||be==="@"||!be?Ne:be==="|"?!(qe===er||qe===ss):be===er?(V.peek(),pe(!0,er)):be===ss?(V.peek(),pe(!0,ss)):!0},ke=pe();return se&&V.resetPeek(),ke}function S(V,se){const pe=V.currentChar();return pe===Ar?Ar:se(pe)?(V.next(),pe):null}function R(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36}function z(V){return S(V,R)}function W(V){const se=V.charCodeAt(0);return se>=97&&se<=122||se>=65&&se<=90||se>=48&&se<=57||se===95||se===36||se===45}function L(V){return S(V,W)}function O(V){const se=V.charCodeAt(0);return se>=48&&se<=57}function U(V){return S(V,O)}function Z(V){const se=V.charCodeAt(0);return se>=48&&se<=57||se>=65&&se<=70||se>=97&&se<=102}function ie(V){return S(V,Z)}function q(V){let se="",pe="";for(;se=U(V);)pe+=se;return pe}function ee(V){let se="";for(;;){const pe=V.currentChar();if(pe==="\\"){const ke=V.peek();ke==="{"||ke==="}"||ke==="@"||ke==="|"||ke==="\\"?(se+=pe+ke,V.next(),V.next()):(V.resetPeek(),se+=pe,V.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===er||pe===ss)if(F(V))se+=pe,V.next();else{if(N(V))break;se+=pe,V.next()}else se+=pe,V.next()}}return se}function fe(V){k(V);let se="",pe="";for(;se=L(V);)pe+=se;const ke=V.currentChar();if(ke&&ke!=="}"&&ke!==Ar&&ke!==er&&ke!==ss&&ke!==" "){const Ne=re(V);return d(Mn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+Ne),pe+Ne}return V.currentChar()===Ar&&d(Mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function ne(V){k(V);let se="";return V.currentChar()==="-"?(V.next(),se+=`-${q(V)}`):se+=q(V),V.currentChar()===Ar&&d(Mn.UNTERMINATED_CLOSING_BRACE,i(),0),se}function j(V){return V!==jw&&V!==ss}function K(V){k(V),p(V,"'");let se="",pe="";for(;se=S(V,j);)se==="\\"?pe+=ve(V):pe+=se;const ke=V.currentChar();return ke===ss||ke===Ar?(d(Mn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ke===ss&&(V.next(),p(V,"'")),pe):(p(V,"'"),pe)}function ve(V){const se=V.currentChar();switch(se){case"\\":case"'":return V.next(),`\\${se}`;case"u":return he(V,se,4);case"U":return he(V,se,6);default:return d(Mn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,se),""}}function he(V,se,pe){p(V,se);let ke="";for(let Ne=0;Ne<pe;Ne++){const qe=ie(V);if(!qe){d(Mn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${se}${ke}${V.currentChar()}`);break}ke+=qe}return`\\${se}${ke}`}function Ae(V){return V!=="{"&&V!=="}"&&V!==er&&V!==ss}function re(V){k(V);let se="",pe="";for(;se=S(V,Ae);)pe+=se;return pe}function Y(V){let se="",pe="";for(;se=z(V);)pe+=se;return pe}function Q(V){const se=pe=>{const ke=V.currentChar();return ke==="{"||ke==="@"||ke==="|"||ke==="("||ke===")"||!ke||ke===er?pe:(pe+=ke,V.next(),se(pe))};return se("")}function P(V){k(V);const se=p(V,"|");return k(V),se}function G(V,se){let pe=null;switch(V.currentChar()){case"{":return se.braceNest>=1&&d(Mn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),V.next(),pe=f(se,2,"{"),k(V),se.braceNest++,pe;case"}":return se.braceNest>0&&se.currentType===2&&d(Mn.EMPTY_PLACEHOLDER,i(),0),V.next(),pe=f(se,3,"}"),se.braceNest--,se.braceNest>0&&k(V),se.inLinked&&se.braceNest===0&&(se.inLinked=!1),pe;case"@":return se.braceNest>0&&d(Mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=me(V,se)||h(se),se.braceNest=0,pe;default:{let Ne=!0,qe=!0,be=!0;if(N(V))return se.braceNest>0&&d(Mn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,pe;if(se.braceNest>0&&(se.currentType===4||se.currentType===5||se.currentType===6))return d(Mn.UNTERMINATED_CLOSING_BRACE,i(),0),se.braceNest=0,ye(V,se);if(Ne=v(V,se))return pe=f(se,4,fe(V)),k(V),pe;if(qe=b(V,se))return pe=f(se,5,ne(V)),k(V),pe;if(be=A(V,se))return pe=f(se,6,K(V)),k(V),pe;if(!Ne&&!qe&&!be)return pe=f(se,12,re(V)),d(Mn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),k(V),pe;break}}return pe}function me(V,se){const{currentType:pe}=se;let ke=null;const Ne=V.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&(Ne===ss||Ne===er)&&d(Mn.INVALID_LINKED_FORMAT,i(),0),Ne){case"@":return V.next(),ke=f(se,7,"@"),se.inLinked=!0,ke;case".":return k(V),V.next(),f(se,8,".");case":":return k(V),V.next(),f(se,9,":");default:return N(V)?(ke=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,ke):I(V,se)||M(V,se)?(k(V),me(V,se)):T(V,se)?(k(V),f(se,11,Y(V))):$(V,se)?(k(V),Ne==="{"?G(V,se)||ke:f(se,10,Q(V))):(pe===7&&d(Mn.INVALID_LINKED_FORMAT,i(),0),se.braceNest=0,se.inLinked=!1,ye(V,se))}}function ye(V,se){let pe={type:13};if(se.braceNest>0)return G(V,se)||h(se);if(se.inLinked)return me(V,se)||h(se);switch(V.currentChar()){case"{":return G(V,se)||h(se);case"}":return d(Mn.UNBALANCED_CLOSING_BRACE,i(),0),V.next(),f(se,3,"}");case"@":return me(V,se)||h(se);default:{if(N(V))return pe=f(se,1,P(V)),se.braceNest=0,se.inLinked=!1,pe;if(F(V))return f(se,0,ee(V));break}}return pe}function de(){const{currentType:V,offset:se,startLoc:pe,endLoc:ke}=a;return a.lastType=V,a.lastOffset=se,a.lastStartLoc=pe,a.lastEndLoc=ke,a.offset=s(),a.startLoc=i(),o.currentChar()===Ar?f(a,13):ye(o,a)}return{nextToken:de,currentOffset:s,currentPosition:i,context:c}}const hL="parser",pL=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,mL=/\\([\\@{}|])/g;function gL(e,t){return t}function vL(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function yL(e={}){const t=e.location!==!1,{onError:n}=e;function o(y,g,v,b,...A){const I=y.currentPosition();if(I.offset+=b,I.column+=b,n){const T=t?ly(v,I):null,M=C1(g,T,{domain:hL,args:A});n(M)}}function s(y,g,v){const b={type:y};return t&&(b.start=g,b.end=g,b.loc={start:v,end:v}),b}function i(y,g,v,b){t&&(y.end=g,y.loc&&(y.loc.end=v))}function r(y,g){const v=y.context(),b=s(3,v.offset,v.startLoc);return b.value=g.replace(mL,gL),i(b,y.currentOffset(),y.currentPosition()),b}function l(y,g){const v=y.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(5,b,A);return I.index=parseInt(g,10),y.nextToken(),i(I,y.currentOffset(),y.currentPosition()),I}function a(y,g){const v=y.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(4,b,A);return I.key=g,y.nextToken(),i(I,y.currentOffset(),y.currentPosition()),I}function c(y,g){const v=y.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(9,b,A);return I.value=g.replace(pL,vL),y.nextToken(),i(I,y.currentOffset(),y.currentPosition()),I}function u(y){const g=y.nextToken(),v=y.context(),{lastOffset:b,lastStartLoc:A}=v,I=s(8,b,A);return g.type!==11?(o(y,Mn.UNEXPECTED_EMPTY_LINKED_MODIFIER,v.lastStartLoc,0),I.value="",i(I,b,A),{nextConsumeToken:g,node:I}):(g.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,tr(g)),I.value=g.value||"",i(I,y.currentOffset(),y.currentPosition()),{node:I})}function d(y,g){const v=y.context(),b=s(7,v.offset,v.startLoc);return b.value=g,i(b,y.currentOffset(),y.currentPosition()),b}function f(y){const g=y.context(),v=s(6,g.offset,g.startLoc);let b=y.nextToken();if(b.type===8){const A=u(y);v.modifier=A.node,b=A.nextConsumeToken||y.nextToken()}switch(b.type!==9&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),b=y.nextToken(),b.type===2&&(b=y.nextToken()),b.type){case 10:b.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=d(y,b.value||"");break;case 4:b.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=a(y,b.value||"");break;case 5:b.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=l(y,b.value||"");break;case 6:b.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr(b)),v.key=c(y,b.value||"");break;default:{o(y,Mn.UNEXPECTED_EMPTY_LINKED_KEY,g.lastStartLoc,0);const A=y.context(),I=s(7,A.offset,A.startLoc);return I.value="",i(I,A.offset,A.startLoc),v.key=I,i(v,A.offset,A.startLoc),{nextConsumeToken:b,node:v}}}return i(v,y.currentOffset(),y.currentPosition()),{node:v}}function h(y){const g=y.context(),v=g.currentType===1?y.currentOffset():g.offset,b=g.currentType===1?g.endLoc:g.startLoc,A=s(2,v,b);A.items=[];let I=null;do{const $=I||y.nextToken();switch(I=null,$.type){case 0:$.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(r(y,$.value||""));break;case 5:$.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(l(y,$.value||""));break;case 4:$.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(a(y,$.value||""));break;case 6:$.value==null&&o(y,Mn.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,tr($)),A.items.push(c(y,$.value||""));break;case 7:{const N=f(y);A.items.push(N.node),I=N.nextConsumeToken||null;break}}}while(g.currentType!==13&&g.currentType!==1);const T=g.currentType===1?g.lastOffset:y.currentOffset(),M=g.currentType===1?g.lastEndLoc:y.currentPosition();return i(A,T,M),A}function p(y,g,v,b){const A=y.context();let I=b.items.length===0;const T=s(1,g,v);T.cases=[],T.cases.push(b);do{const M=h(y);I||(I=M.items.length===0),T.cases.push(M)}while(A.currentType!==13);return I&&o(y,Mn.MUST_HAVE_MESSAGES_IN_PLURAL,v,0),i(T,y.currentOffset(),y.currentPosition()),T}function m(y){const g=y.context(),{offset:v,startLoc:b}=g,A=h(y);return g.currentType===13?A:p(y,v,b,A)}function k(y){const g=fL(y,Mo({},e)),v=g.context(),b=s(0,v.offset,v.startLoc);return t&&b.loc&&(b.loc.source=y),b.body=m(g),e.onCacheKey&&(b.cacheKey=e.onCacheKey(y)),v.currentType!==13&&o(g,Mn.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,y[v.offset]||""),i(b,g.currentOffset(),g.currentPosition()),b}return{parse:k}}function tr(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function kL(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Vw(e,t){for(let n=0;n<e.length;n++)jk(e[n],t)}function jk(e,t){switch(e.type){case 1:Vw(e.cases,t),t.helper("plural");break;case 2:Vw(e.items,t);break;case 6:{jk(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function bL(e,t={}){const n=kL(e);n.helper("normalize"),e.body&&jk(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function xL(e){const t=e.body;return t.type===2?Kw(t):t.cases.forEach(n=>Kw(n)),e}function Kw(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=qk(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Oc(e){switch(e.t=e.type,e.type){case 0:{const t=e;Oc(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Oc(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Oc(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Oc(t.key),t.k=t.key,delete t.key,t.modifier&&(Oc(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function wL(e,t){const{filename:n,breakLineCode:o,needIndent:s}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(m,k){r.code+=m}function c(m,k=!0){const y=k?o:"";a(s?y+" ".repeat(m):y)}function u(m=!0){const k=++r.indentLevel;m&&c(k)}function d(m=!0){const k=--r.indentLevel;m&&c(k)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>r.needIndent}}function _L(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),ku(e,t.key),t.modifier?(e.push(", "),ku(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function SL(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const s=t.items.length;for(let i=0;i<s&&(ku(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function CL(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const s=t.cases.length;for(let i=0;i<s&&(ku(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function AL(e,t){t.body?ku(e,t.body):e.push("null")}function ku(e,t){const{helper:n}=e;switch(t.type){case 0:AL(e,t);break;case 1:CL(e,t);break;case 2:SL(e,t);break;case 6:_L(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const ML=(e,t={})=>{const n=xt(t.mode)?t.mode:"normal",o=xt(t.filename)?t.filename:"message.intl";t.sourceMap;const s=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
+ `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=wL(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${qk(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),ku(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function EL(e,t={}){const n=Mo({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=yL(n).parse(e);return o?(i&&xL(l),s&&Oc(l),{ast:l,code:""}):(bL(l,n),ML(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function TL(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ea().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function hr(e){return yn(e)&&Vk(e)===0&&(Si(e,"b")||Si(e,"body"))}const DM=["b","body"];function NL(e){return Kl(e,DM)}const PM=["c","cases"];function IL(e){return Kl(e,PM,[])}const HM=["s","static"];function LL(e){return Kl(e,HM)}const WM=["i","items"];function $L(e){return Kl(e,WM,[])}const zM=["t","type"];function Vk(e){return Kl(e,zM)}const UM=["v","value"];function Oh(e,t){const n=Kl(e,UM);if(n!=null)return n;throw lf(t)}const qM=["m","modifier"];function FL(e){return Kl(e,qM)}const jM=["k","key"];function OL(e){const t=Kl(e,jM);if(t)return t;throw lf(6)}function Kl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(Si(e,s)&&e[s]!=null)return e[s]}return n}const VM=[...DM,...PM,...HM,...WM,...jM,...qM,...UM,...zM];function lf(e){return new Error(`unhandled node type: ${e}`)}function vg(e){return n=>BL(n,e)}function BL(e,t){const n=NL(t);if(n==null)throw lf(0);if(Vk(n)===1){const i=IL(n);return e.plural(i.reduce((r,l)=>[...r,Gw(e,l)],[]))}else return Gw(e,n)}function Gw(e,t){const n=LL(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=$L(t).reduce((s,i)=>[...s,ay(e,i)],[]);return e.normalize(o)}}function ay(e,t){const n=Vk(t);switch(n){case 3:return Oh(t,n);case 9:return Oh(t,n);case 4:{const o=t;if(Si(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Si(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw lf(n)}case 5:{const o=t;if(Si(o,"i")&&Ao(o.i))return e.interpolate(e.list(o.i));if(Si(o,"index")&&Ao(o.index))return e.interpolate(e.list(o.index));throw lf(n)}case 6:{const o=t,s=FL(o),i=OL(o);return e.linked(ay(e,i),s?ay(e,s):void 0,e.type)}case 7:return Oh(t,n);case 8:return Oh(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const RL=e=>e;let Bh=Bn();function DL(e,t={}){let n=!1;const o=t.onError||iL;return t.onError=s=>{n=!0,o(s)},{...EL(e,t),detectError:n}}function PL(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&xt(e)){vn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||RL)(e),s=Bh[o];if(s)return s;const{ast:i,detectError:r}=DL(e,{...t,location:!1,jit:!0}),l=vg(i);return r?l:Bh[o]=l}else{const n=e.cacheKey;if(n){const o=Bh[n];return o||(Bh[n]=vg(e))}else return vg(e)}}let af=null;function HL(e){af=e}function WL(e,t,n){af&&af.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const zL=UL("function:translate");function UL(e){return t=>af&&af.emit(e,t)}const Wr={INVALID_ARGUMENT:sL,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},qL=24;function zr(e){return C1(e,null,void 0)}function Kk(e,t){return t.locale!=null?Yw(t.locale):Yw(e.locale)}let yg;function Yw(e){if(xt(e))return e;if(oo(e)){if(e.resolvedOnce&&yg!=null)return yg;if(e.constructor.name==="Function"){const t=e();if(tL(t))throw zr(Wr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return yg=t}else throw zr(Wr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw zr(Wr.NOT_SUPPORT_LOCALE_TYPE)}function jL(e,t,n){return[...new Set([n,...fo(t)?t:yn(t)?Object.keys(t):xt(t)?[t]:[n]])]}function cy(e,t,n){const o=xt(n)?n:cf,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;fo(r);)r=Zw(i,r,t);const l=fo(t)||!un(t)?t:t.default?t.default:null;r=xt(l)?[l]:l,fo(r)&&Zw(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Zw(e,t,n){let o=!0;for(let s=0;s<t.length&&vn(o);s++){const i=t[s];xt(i)&&(o=VL(e,t[s],n))}return o}function VL(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=KL(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function KL(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const s=t.replace(/!/g,"");e.push(s),(fo(n)||un(n))&&n[s]&&(o=n[s])}return o}const Gl=[];Gl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Gl[1]={w:[1],".":[2],"[":[4],o:[7]};Gl[2]={w:[2],i:[3,0],0:[3,0]};Gl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Gl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Gl[5]={"'":[4,0],o:8,l:[5,0]};Gl[6]={'"':[4,0],o:8,l:[6,0]};const GL=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function YL(e){return GL.test(e)}function ZL(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function XL(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function QL(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:YL(t)?ZL(t):"*"+t}function JL(e){const t=[];let n=-1,o=0,s=0,i,r,l,a,c,u,d;const f=[];f[0]=()=>{r===void 0?r=l:r+=l},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),s++},f[3]=()=>{if(s>0)s--,o=4,f[0]();else{if(s=0,r===void 0||(r=QL(r),r===!1))return!1;f[1]()}};function h(){const p=e[n+1];if(o===5&&p==="'"||o===6&&p==='"')return n++,l="\\"+p,f[0](),!0}for(;o!==null;)if(n++,i=e[n],!(i==="\\"&&h())){if(a=XL(i),d=Gl[o],c=d[a]||d.l||8,c===8||(o=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=i,u()===!1))))return;if(o===7)return t}}const Xw=new Map;function e$(e,t){return yn(e)?e[t]:null}function t$(e,t){if(!yn(e))return null;let n=Xw.get(t);if(n||(n=JL(t),n&&Xw.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(VM.includes(r)&&hr(s)||!yn(s)||!Si(s,r))return null;const l=s[r];if(l===void 0||oo(s))return null;s=l,i++}return s}const n$="11.4.5",A1=-1,cf="en-US",cm="",Qw=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function o$(){return{upper:(e,t)=>t==="text"&&xt(e)?e.toUpperCase():t==="vnode"&&yn(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&xt(e)?e.toLowerCase():t==="vnode"&&yn(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&xt(e)?Qw(e):t==="vnode"&&yn(e)&&"__v_isVNode"in e?Qw(e.children):e}}let KM;function s$(e){KM=e}let GM;function i$(e){GM=e}let YM;function r$(e){YM=e}let ZM=null;const l$=e=>{ZM=e},a$=()=>ZM;let XM=null;const Jw=e=>{XM=e},c$=()=>XM;let e_=0;function u$(e={}){const t=oo(e.onWarn)?e.onWarn:j7,n=xt(e.version)?e.version:n$,o=xt(e.locale)||oo(e.locale)?e.locale:cf,s=oo(o)?cf:o,i=fo(e.fallbackLocale)||un(e.fallbackLocale)||xt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=un(e.messages)?e.messages:kg(s),l=un(e.datetimeFormats)?e.datetimeFormats:kg(s),a=un(e.numberFormats)?e.numberFormats:kg(s),c=Mo(Bn(),e.modifiers,o$()),u=e.pluralRules||Bn(),d=oo(e.missing)?e.missing:null,f=vn(e.missingWarn)||yu(e.missingWarn)?e.missingWarn:!0,h=vn(e.fallbackWarn)||yu(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,m=!!e.unresolving,k=oo(e.postTranslation)?e.postTranslation:null,y=un(e.processor)?e.processor:null,g=vn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,v=!!e.escapeParameter,b=oo(e.messageCompiler)?e.messageCompiler:KM,A=oo(e.messageResolver)?e.messageResolver:GM||e$,I=oo(e.localeFallbacker)?e.localeFallbacker:YM||jL,T=yn(e.fallbackContext)?e.fallbackContext:void 0,M=e,$=yn(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,N=yn(M.__numberFormatters)?M.__numberFormatters:new Map,F=yn(M.__meta)?M.__meta:{};e_++;const S={version:n,cid:e_,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:m,postTranslation:k,processor:y,warnHtmlMessage:g,escapeParameter:v,messageCompiler:b,messageResolver:A,localeFallbacker:I,fallbackContext:T,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=$,S.__numberFormatters=N,__INTLIFY_PROD_DEVTOOLS__&&WL(S,n,F),S}const kg=e=>({[e]:Bn()});function Gk(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return xt(l)?l:t}else return t}function id(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function d$(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function f$(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(d$(e,t[o]))return!0;return!1}function t_(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!xt(t[0])&&!BM(t[0])&&!Ao(t[0]))return cm;const[a,c,u,d]=uy(...t),f=vn(u.missingWarn)?u.missingWarn:e.missingWarn;vn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Kk(e,u),m=r(e,s,p);if(!xt(a)||a===""){const I=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let k={},y,g=null;const v="datetime format";for(let I=0;I<m.length&&(y=m[I],k=n[y]||{},g=k[a],!un(g));I++)Gk(e,a,y,f,v);if(!un(g)||!xt(y))return o?A1:a;let b=`${y}__${a}`;S1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.DateTimeFormat(y,Mo({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const QM=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function uy(...e){const[t,n,o,s]=e,i=Bn();let r=Bn(),l;if(xt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw zr(Wr.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw zr(Wr.INVALID_ISO_DATE_ARGUMENT)}}else if(BM(t)){if(isNaN(t.getTime()))throw zr(Wr.INVALID_DATE_ARGUMENT);l=t}else if(Ao(t))l=t;else throw zr(Wr.INVALID_ARGUMENT);return xt(n)?i.key=n:un(n)&&Object.keys(n).forEach(a=>{QM.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(o)?i.locale=o:un(o)&&(r=o),un(s)&&(r=s),[i.key||"",l,i,r]}function n_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function o_(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Ao(t[0]))return cm;const[a,c,u,d]=dy(...t),f=vn(u.missingWarn)?u.missingWarn:e.missingWarn;vn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Kk(e,u),m=r(e,s,p);if(!xt(a)||a===""){const I=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?I.formatToParts(c):I.format(c)}let k={},y,g=null;const v="number format";for(let I=0;I<m.length&&(y=m[I],k=n[y]||{},g=k[a],!un(g));I++)Gk(e,a,y,f,v);if(!un(g)||!xt(y))return o?A1:a;let b=`${y}__${a}`;S1(d)||(b=`${b}__${JSON.stringify(d)}`);let A=l.get(b);return A||(A=new Intl.NumberFormat(y,Mo({},g,d)),l.set(b,A)),h?A.formatToParts(c):A.format(c)}const JM=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function dy(...e){const[t,n,o,s]=e,i=Bn();let r=Bn();if(!Ao(t))throw zr(Wr.INVALID_ARGUMENT);const l=t;return xt(n)?i.key=n:un(n)&&Object.keys(n).forEach(a=>{JM.includes(a)?r[a]=n[a]:i[a]=n[a]}),xt(o)?i.locale=o:un(o)&&(r=o),un(s)&&(r=s),[i.key||"",l,i,r]}function s_(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const h$=e=>e,p$=e=>"",m$="text",g$=e=>e.length===0?"":qk(e),v$=nL;function bg(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function y$(e){const t=Ao(e.pluralIndex)?e.pluralIndex:-1;return Ao(e.named?.count)?e.named.count:Ao(e.named?.n)?e.named.n:t}function k$(e={}){const t=e.locale,n=y$(e),o=xt(t)&&oo(e.pluralRules?.[t])?e.pluralRules[t]:bg,s=o===bg?void 0:bg,i=y=>y[o(n,y.length,s)],r=e.list||[],l=y=>r[y],a=e.named||Bn();Ao(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=y=>a[y];function u(y,g){const v=oo(e.messages)?e.messages(y,!!g):yn(e.messages)?e.messages[y]:!1;return v||(e.parent?e.parent.message(y):p$)}const d=y=>e.modifiers?e.modifiers[y]:h$,f=oo(e.processor?.normalize)?e.processor.normalize:g$,h=oo(e.processor?.interpolate)?e.processor.interpolate:v$,p=xt(e.processor?.type)?e.processor.type:m$,k={list:l,named:c,plural:i,linked:(y,...g)=>{const[v,b]=g;let A="text",I="";g.length===1?yn(v)?(I=v.modifier||I,A=v.type||A):xt(v)&&(I=v||I):g.length===2&&(xt(v)&&(I=v||I),xt(b)&&(A=b||A));const T=u(y,!0)(k),M=T===""||T===void 0?y:T,$=A==="vnode"&&fo(M)&&I?M[0]:M;return I?d(I)($,A):$},message:u,type:p,interpolate:h,normalize:f,values:Mo(Bn(),r,a)};return k}const i_=()=>"",xi=e=>oo(e);function r_(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=fy(...t),u=vn(c.missingWarn)?c.missingWarn:e.missingWarn,d=vn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=vn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=xt(c.default)||vn(c.default)?vn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,m=n||p!=null&&(xt(p)||oo(p)),k=Kk(e,c);f&&b$(c);let[y,g,v]=h?[a,k,l[k]||Bn()]:e6(e,a,k,r,d,u),b=y,A=a;if(!h&&!(xt(b)||hr(b)||xi(b))&&m&&(b=p,A=b),!h&&(!(xt(b)||hr(b)||xi(b))||!xt(g)))return s?A1:a;let I=!1;const T=()=>{I=!0},M=xi(b)?b:t6(e,a,g,b,A,T);if(I)return b;const $=_$(e,g,v,c),N=k$($),F=x$(e,M,N);let S=o?o(F,a):F;if(f&&xt(S)&&(S=J7(S)),__INTLIFY_PROD_DEVTOOLS__){const R={timestamp:Date.now(),key:xt(a)?a:xi(b)?b.key:"",locale:g||(xi(b)?b.locale:""),format:xt(b)?b:xi(b)?b.source:"",message:S};R.meta=Mo({},e.__meta,a$()||{}),zL(R)}return S}function b$(e){fo(e.list)?e.list=e.list.map(t=>xt(t)?Uw(t):t):yn(e.named)&&Object.keys(e.named).forEach(t=>{xt(e.named[t])&&(e.named[t]=Uw(e.named[t]))})}function e6(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Bn(),f,h=null;const p="translate";for(let m=0;m<u.length&&(f=u[m],d=r[f]||Bn(),(h=a(d,t))===null&&(h=d[t]),!(xt(h)||hr(h)||xi(h)));m++)if(!f$(f,u)){const k=Gk(e,t,f,i,p);k!==t&&(h=k)}return[h,f,d]}function t6(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(xi(o)){const c=o;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>o);return c.locale=n,c.key=t,c}const a=r(o,w$(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function x$(e,t,n){return t(n)}function fy(...e){const[t,n,o]=e,s=Bn();if(!xt(t)&&!Ao(t)&&!xi(t)&&!hr(t))throw zr(Wr.INVALID_ARGUMENT);const i=Ao(t)?String(t):(xi(t),t);return Ao(n)?s.plural=n:xt(n)?s.default=n:un(n)&&!S1(n)?s.named=n:fo(n)&&(s.list=n),Ao(o)?s.plural=o:xt(o)?s.default=o:un(o)&&Mo(s,o),[i,s]}function w$(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>V7(t,n,r)}}function _$(e,t,n,o){const{modifiers:s,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,f={locale:t,modifiers:s,pluralRules:i,messages:(h,p)=>{let m=r(n,h);if(m==null&&(u||p)){const[k,,y]=e6(u||e,h,t,l,a,c);m=k??r(y,h)}if(xt(m)||hr(m)){let k=!1;const g=t6(e,h,t,m,h,()=>{k=!0});return k?i_:g}else return xi(m)?m:i_}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),Ao(o.plural)&&(f.pluralIndex=o.plural),f}TL();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const S$="11.4.5";function C$(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ea().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ea().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ea().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ea().__INTLIFY_PROD_DEVTOOLS__=!1)}const ks={UNEXPECTED_RETURN_TYPE:qL,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Rs(e,...t){return C1(e,null,void 0)}const hy=Vl("__translateVNode"),py=Vl("__datetimeParts"),my=Vl("__numberParts"),n6=Vl("__setPluralRules"),o6=Vl("__injectWithOption"),Uc=Vl("__dispose");function uf(e){if(!yn(e)||hr(e))return e;for(const t in e)if(Si(e,t))if(!t.includes("."))yn(e[t])&&uf(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,i=!1;for(let r=0;r<o;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in s||(s[n[r]]=Bn()),!yn(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(hr(s)?VM.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!hr(s)){const r=s[n[o]];yn(r)&&uf(r)}}return e}function Yk(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=un(n)?n:fo(o)?Bn():{[e]:Bn()};if(fo(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Bn(),bp(c,r[a])):bp(c,r)}else xt(l)&&bp(JSON.parse(l),r)}),s==null&&i)for(const l in r)Si(r,l)&&uf(r[l]);return r}function s6(e){return e.type}function i6(e,t,n){let o=yn(t.messages)?t.messages:Bn();"__i18nGlobal"in n&&(o=Yk(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(yn(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(yn(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function l_(e){return ae(Ll,null,e,0)}function df(){return Eo()}const a_="__INTLIFY_META__",c_=()=>[],A$=()=>!1;let u_=0;function d_(e){return((t,n,o,s)=>e(n,o,df()||void 0,s))}const M$=()=>{const e=df();let t=null;return e&&(t=s6(e)[a_])?{[a_]:t}:null};function um(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=am?oe:gr;let r=vn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:xt(e.locale)?e.locale:cf),a=i(t&&r?t.fallbackLocale.value:xt(e.fallbackLocale)||fo(e.fallbackLocale)||un(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Yk(l.value,e)),u=i(un(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(un(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:vn(e.missingWarn)||yu(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:vn(e.fallbackWarn)||yu(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:vn(e.fallbackRoot)?e.fallbackRoot:!0,m=!!e.fallbackFormat,k=oo(e.missing)?e.missing:null,y=oo(e.missing)?d_(e.missing):null,g=oo(e.postTranslation)?e.postTranslation:null,v=t?t.warnHtmlMessage:vn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,b=!!e.escapeParameter;const A=t?t.modifiers:un(e.modifiers)?e.modifiers:{};let I=e.pluralRules||t&&t.pluralRules,T;T=(()=>{o&&Jw(null);const be={version:S$,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:I,missing:y===null?void 0:y,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:!0,postTranslation:g===null?void 0:g,warnHtmlMessage:v,escapeParameter:b,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};be.datetimeFormats=u.value,be.numberFormats=d.value,be.__datetimeFormatters=un(T)?T.__datetimeFormatters:void 0,be.__numberFormatters=un(T)?T.__numberFormatters:void 0;const xe=u$(be);return o&&Jw(xe),xe})(),id(T,l.value,a.value);function $(){return[l.value,a.value,c.value,u.value,d.value]}const N=D({get:()=>l.value,set:be=>{T.locale=be,l.value=be}}),F=D({get:()=>a.value,set:be=>{T.fallbackLocale=be,a.value=be,id(T,l.value,be)}}),S=D(()=>c.value),R=D(()=>u.value),z=D(()=>d.value);function W(){return oo(g)?g:null}function L(be){g=be,T.postTranslation=be}function O(){return k}function U(be){be!==null&&(y=d_(be)),k=be,T.missing=y}const Z=(be,xe,Ze,tt,lt,ut)=>{$();let mt;try{__INTLIFY_PROD_DEVTOOLS__,o||(T.fallbackContext=t?c$():void 0),mt=be(T)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(T.fallbackContext=void 0)}if(Ze!=="translate exists"&&Ao(mt)&&mt===A1||Ze==="translate exists"&&!mt){const[Tt,wt]=xe();return t&&p?tt(t):lt(Tt)}else{if(ut(mt))return mt;throw Rs(ks.UNEXPECTED_RETURN_TYPE)}};function ie(...be){return Z(xe=>Reflect.apply(r_,null,[xe,...be]),()=>fy(...be),"translate",xe=>Reflect.apply(xe.t,xe,[...be]),xe=>xe,xe=>xt(xe))}function q(...be){const[xe,Ze,tt]=be;if(tt&&!yn(tt))throw Rs(ks.INVALID_ARGUMENT);return ie(xe,Ze,Mo({resolvedMessage:!0},tt||{}))}function ee(...be){return Z(xe=>Reflect.apply(t_,null,[xe,...be]),()=>uy(...be),"datetime format",xe=>Reflect.apply(xe.d,xe,[...be]),()=>cm,xe=>xt(xe)||fo(xe))}function fe(...be){return Z(xe=>Reflect.apply(o_,null,[xe,...be]),()=>dy(...be),"number format",xe=>Reflect.apply(xe.n,xe,[...be]),()=>cm,xe=>xt(xe)||fo(xe))}function ne(be){return be.map(xe=>xt(xe)||Ao(xe)||vn(xe)?l_(String(xe)):xe)}const K={normalize:ne,interpolate:be=>be,type:"vnode"};function ve(...be){return Z(xe=>{let Ze;const tt=xe;try{tt.processor=K,Ze=Reflect.apply(r_,null,[tt,...be])}finally{tt.processor=null}return Ze},()=>fy(...be),"translate",xe=>xe[hy](...be),xe=>[l_(xe)],xe=>fo(xe))}function he(...be){return Z(xe=>Reflect.apply(o_,null,[xe,...be]),()=>dy(...be),"number format",xe=>xe[my](...be),c_,xe=>xt(xe)||fo(xe))}function Ae(...be){return Z(xe=>Reflect.apply(t_,null,[xe,...be]),()=>uy(...be),"datetime format",xe=>xe[py](...be),c_,xe=>xt(xe)||fo(xe))}function re(be){I=be,T.pluralRules=I}function Y(be,xe){return Z(()=>{if(!be)return!1;const Ze=xt(xe)?xe:l.value,tt=xt(xe)?[Ze]:cy(T,a.value,Ze);for(let lt=0;lt<tt.length;lt++){const ut=G(tt[lt]);let mt=T.messageResolver(ut,be);if(mt===null&&(mt=ut[be]),hr(mt)||xi(mt)||xt(mt))return!0}return!1},()=>[be],"translate exists",Ze=>Reflect.apply(Ze.te,Ze,[be,xe]),A$,Ze=>vn(Ze))}function Q(be){let xe=null;const Ze=cy(T,a.value,l.value);for(let tt=0;tt<Ze.length;tt++){const lt=c.value[Ze[tt]]||{},ut=T.messageResolver(lt,be);if(ut!=null){xe=ut;break}}return xe}function P(be){const xe=Q(be);return xe??(t?t.tm(be)||{}:{})}function G(be){return c.value[be]||{}}function me(be,xe){if(s){const Ze={[be]:xe};for(const tt in Ze)Si(Ze,tt)&&uf(Ze[tt]);xe=Ze[be]}c.value[be]=xe,T.messages=c.value}function ye(be,xe){c.value[be]=c.value[be]||{};const Ze={[be]:xe};if(s)for(const tt in Ze)Si(Ze,tt)&&uf(Ze[tt]);xe=Ze[be],bp(xe,c.value[be]),T.messages=c.value}function de(be){return u.value[be]||{}}function V(be,xe){u.value[be]=xe,T.datetimeFormats=u.value,n_(T,be,xe)}function se(be,xe){u.value[be]=Mo(u.value[be]||{},xe),T.datetimeFormats=u.value,n_(T,be,xe)}function pe(be){return d.value[be]||{}}function ke(be,xe){d.value[be]=xe,T.numberFormats=d.value,s_(T,be,xe)}function Ne(be,xe){d.value[be]=Mo(d.value[be]||{},xe),T.numberFormats=d.value,s_(T,be,xe)}u_++,t&&am&&(et(t.locale,be=>{r&&(l.value=be,T.locale=be,id(T,l.value,a.value))}),et(t.fallbackLocale,be=>{r&&(a.value=be,T.fallbackLocale=be,id(T,l.value,a.value))}));const qe={id:u_,locale:N,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(be){r=be,be&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,id(T,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return I||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(be){f=be,T.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(be){h=be,T.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(be){p=be},get fallbackFormat(){return m},set fallbackFormat(be){m=be,T.fallbackFormat=m},get warnHtmlMessage(){return v},set warnHtmlMessage(be){v=be,T.warnHtmlMessage=be},get escapeParameter(){return b},set escapeParameter(be){b=be,T.escapeParameter=be},t:ie,getLocaleMessage:G,setLocaleMessage:me,mergeLocaleMessage:ye,getPostTranslationHandler:W,setPostTranslationHandler:L,getMissingHandler:O,setMissingHandler:U,[n6]:re};return qe.datetimeFormats=R,qe.numberFormats=z,qe.rt=q,qe.te=Y,qe.tm=P,qe.d=ee,qe.n=fe,qe.getDateTimeFormat=de,qe.setDateTimeFormat=V,qe.mergeDateTimeFormat=se,qe.getNumberFormat=pe,qe.setNumberFormat=ke,qe.mergeNumberFormat=Ne,qe[o6]=n,qe[hy]=ve,qe[py]=Ae,qe[my]=he,qe}function E$(e){const t=xt(e.locale)?e.locale:cf,n=xt(e.fallbackLocale)||fo(e.fallbackLocale)||un(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=oo(e.missing)?e.missing:void 0,s=vn(e.silentTranslationWarn)||yu(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=vn(e.silentFallbackWarn)||yu(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=vn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=un(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=oo(e.postTranslation)?e.postTranslation:void 0,d=xt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=vn(e.sync)?e.sync:!0;let p=e.messages;if(un(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((T,M)=>{const $=T[M]||(T[M]={});return Mo($,A[M]),T},p||{})}const{__i18n:m,__root:k,__injectWithOption:y}=e,g=e.datetimeFormats,v=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:b,datetimeFormats:g,numberFormats:v,missing:o,missingWarn:s,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:m,__root:k,__injectWithOption:y}}function gy(e={}){const t=um(E$(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return vn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=vn(s)?!s:s},get silentFallbackWarn(){return vn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=vn(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){return Reflect.apply(t.t,t,[...s])},rt(...s){return Reflect.apply(t.rt,t,[...s])},te(s,i){return t.te(s,i)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,i){t.setLocaleMessage(s,i)},mergeLocaleMessage(s,i){t.mergeLocaleMessage(s,i)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,i){t.setDateTimeFormat(s,i)},mergeDateTimeFormat(s,i){t.mergeDateTimeFormat(s,i)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,i){t.setNumberFormat(s,i)},mergeNumberFormat(s,i){t.mergeNumberFormat(s,i)}};return o.__extender=n,o}function T$(e,t,n){return{beforeCreate(){const o=df();if(!o)throw Rs(ks.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const i=s.i18n;if(s.__i18n&&(i.__i18n=s.__i18n),i.__root=t,this===this.$root)this.$i18n=f_(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=gy(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=f_(e,s);else{this.$i18n=gy({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&i6(t,s,s),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=df();if(!o)throw Rs(ks.UNEXPECTED_ERROR);const s=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function f_(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[n6](t.pluralizationRules||e.pluralizationRules);const n=Yk(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const Zk={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function N$({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===We?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Bn())}function r6(){return We}const I$=Je({name:"i18n-t",props:Mo({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Ao(e)||!isNaN(e)}},Zk),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||$t({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Bn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=xt(e.plural)?+e.plural:e.plural);const u=N$(t,a);return s[hy](e.keypath,u,c)},r=Mo(Bn(),o),l=xt(e.tag)||yn(e.tag)?e.tag:r6();return yn(l)?Lt(l,r,{default:i}):Lt(l,r,i())}}}),h_=I$;function L$(e){return fo(e)&&!xt(e[0])}function l6(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Bn();e.locale&&(c.locale=e.locale),xt(e.format)?c.key=e.format:yn(e.format)&&(xt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?Mo(Bn(),h,{[p]:e.format[p]}):h,Bn()));const d=o(e.value,c,u);let f=[c.key];return fo(d)?f=d.map((h,p)=>{const m=s[h.type],k=m?m({[h.type]:h.value,index:p,parts:d}):[h.value];return L$(k)&&(k[0].key=`${h.type}-${p}`),k}):xt(d)&&(f=[d]),f},l=Mo(Bn(),i),a=xt(e.tag)||yn(e.tag)?e.tag:r6();return yn(a)?Lt(a,l,{default:r}):Lt(a,l,r())}}const $$=Je({name:"i18n-n",props:Mo({value:{type:Number,required:!0},format:{type:[String,Object]}},Zk),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return l6(e,t,JM,(...o)=>n[my](...o))}}),p_=$$;function F$(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function O$(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Rs(ks.UNEXPECTED_ERROR);const c=F$(e,l.$),u=m_(a);return[Reflect.apply(c.t,c,[...g_(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);am&&(r.__i18nWatcher=et(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{am&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=m_(l);r.textContent=Reflect.apply(a.t,a,[...g_(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function m_(e){if(xt(e))return{path:e};if(un(e)){if(!("path"in e))throw Rs(ks.REQUIRED_VALUE,"path");return e}else throw Rs(ks.INVALID_VALUE)}function g_(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return xt(n)&&(r.locale=n),Ao(s)&&(r.plural=s),Ao(i)&&(r.plural=i),[t,l,r]}function B$(e,t,...n){const o=un(n[0])?n[0]:{};(vn(o.globalInstall)?o.globalInstall:!0)&&([h_.name,"I18nT"].forEach(i=>e.component(i,h_)),[p_.name,"I18nN"].forEach(i=>e.component(i,p_)),[k_.name,"I18nD"].forEach(i=>e.component(i,k_))),e.directive("t",O$(t))}const R$=Vl("global-vue-i18n");function D$(e={}){const t=__VUE_I18N_LEGACY_API__&&vn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=vn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=P$(e,t),r=Vl("");function l(d){return o.get(d)||null}function a(d,f){o.set(d,f)}function c(d){o.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),un(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let h=null;!t&&n&&(h=V$(d,u.global)),__VUE_I18N_FULL_INSTALL__&&B$(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(T$(i,i.__composer,u));const p=d.unmount;d.unmount=()=>{h&&h(),u.dispose(),p()}},get global(){return i},dispose(){s.stop()},__instances:o,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function $t(e={}){const t=df();if(t==null)throw Rs(ks.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Rs(ks.NOT_INSTALLED);const n=H$(t),o=z$(n),s=s6(t),i=W$(e,s);if(i==="global")return i6(o,e,s),o;if(i==="parent"){let a=v_(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Rs(ks.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=Mo({},e),u=v_(n,t);c.__root=u||o;const d=um(c);return a.__composerExtend&&(d[Uc]=a.__composerExtend(d)),Sk()&&Ef(()=>{const h=d[Uc];h&&(h(),delete d[Uc])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=Mo({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=um(a),r.__composerExtend&&(l[Uc]=r.__composerExtend(l)),q$(r,t,l),r.__setInstance(t,l)}return l}function P$(e,t){const n=f9(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>gy(e)):n.run(()=>um(e));if(o==null)throw Rs(ks.UNEXPECTED_ERROR);return[n,o]}function H$(e){const t=Jt(e.isCE?R$:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Rs(e.isCE?ks.NOT_INSTALLED_WITH_PROVIDE:ks.UNEXPECTED_ERROR);return t}function W$(e,t){return S1(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function z$(e){return e.mode==="composition"?e.global:e.global.__composer}function v_(e,t,n=!1){let o=null;const s=t.root;let i=U$(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")o=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(o=l.__composer,n&&o&&!o[o6]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function U$(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function q$(e,t,n){Cn(()=>{},t),$n(()=>{const o=n;e.__deleteInstance(t);const s=o[Uc];s&&(s(),delete o[Uc])},t)}const j$=["locale","fallbackLocale","availableLocales"],y_=["t","rt","d","n","tm","te"];function V$(e,t){const n=Object.create(null);return j$.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Rs(ks.UNEXPECTED_ERROR);const r=vo(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,r)}),e.config.globalProperties.$i18n=n,y_.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Rs(ks.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,y_.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const K$=Je({name:"i18n-d",props:Mo({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Zk),setup(e,t){const n=e.i18n||$t({useScope:e.scope,__useComponent:!0});return l6(e,t,QM,(...o)=>n[py](...o))}}),k_=K$;C$();s$(PL);i$(t$);r$(cy);if(__INTLIFY_PROD_DEVTOOLS__){const e=Ea();e.__INTLIFY__=!0,HL(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const G$="modulepreload",Y$=function(e){return"/"+e},b_={},vs=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");s=r(n.map(c=>{if(c=Y$(c),c in b_)return;b_[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":G$,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Dt={permission:"kimi-web.permission",activeWorkspace:"kimi-active-workspace",planMode:"kimi-web.plan-mode",swarmMode:"kimi-web.swarm-mode",goalMode:"kimi-web.goal-mode",uiFontSize:"kimi-web.ui-font-size",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",accent:"kimi-web.accent",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceNameOverrides:"kimi-web.workspace-name-overrides",workspaceSort:"kimi-web.workspace-sort",conversationToc:"kimi-web.beta-toc",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking"};function x_(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function yo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function To(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qa(e){try{globalThis.localStorage.removeItem(e)}catch{}}function M1(e){const t=yo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Ff(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Xk(){const e=yo(Dt.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[o,s]of Object.entries(t))s===!0&&(n[o]=!0);return n}catch{return{}}}function Qk(e){const n={...Xk()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];To(Dt.unread,JSON.stringify(n))}function Z$(){const e=M1(Dt.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function xg(e){Ff(Dt.collapsedWorkspaces,Array.from(e))}function X$(){const e=M1(Dt.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function a6(e){Ff(Dt.workspaceOrder,Array.from(e))}function Rh(){const e=M1(Dt.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))typeof o=="string"&&(t[n]=o);return t}function w_(e){Ff(Dt.workspaceNameOverrides,e)}function Q$(){return yo(Dt.workspaceSort)}function c6(e){To(Dt.workspaceSort,e)}const __=Dt.clientId,J$="kimi-code-web",eF="web";function tF(){return{serverHttpUrl:oF(),clientId:lF(),clientName:J$,clientVersion:aF(),clientUiMode:eF}}function nF(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function oF(e){const t=nF(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function sF(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function iF(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return sF(e)}function qc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function rF(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function lF(){const e=yo(__);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return To(__,t),t}function aF(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function cF(e){try{const t=await fetch("/__kimi-dev/backend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return t.ok?await t.json():null}catch{return null}}function uF(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Jo(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return fF(e)}function dF(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Jo(e)}function fF(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}function hF(e,t){if(e.length===0)return null;const n=new Set(e),o=t.filter(i=>n.has(i)),s=e.filter(i=>!t.includes(i));return s.length===0&&o.length===t.length?null:[...s,...o]}function pF(e,t){const n=new Map(t.map((o,s)=>[o,s]));return e.toSorted((o,s)=>(n.get(o.id)??-1)-(n.get(s.id)??-1))}function mF(e,t,n,o="before"){const s=e.indexOf(t),i=e.indexOf(n);if(s===-1||i===-1||s===i)return e;const r=[...e];r.splice(s,1);const l=s<i?i-1:i,a=o==="before"?l:l+1;return r.splice(a,0,t),r}function gF(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const vF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function S_(e){return e.replace(/[&<>"']/g,t=>vF[t]??t)}function yF(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kF(e,t,n=40){const o=e.replace(/\s+/g," ").trim();if(o.length===0)return"";const s=t.trim();if(s.length===0)return C_(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return C_(o,n*2);const r=Math.max(0,i-n),l=Math.min(o.length,i+s.length+n),a=r>0,c=l<o.length;return`${a?"…":""}${o.slice(r,l)}${c?"…":""}`}function C_(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function wg(e,t){const n=S_(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(yF(S_(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const Bc=oe(0),bF=["type","disabled","aria-label"],xF=Je({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=oe();return t({el:n}),(o,s)=>(x(),E("button",{ref_key:"el",ref:n,class:Ue(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[jn(o.$slots,"default",{},void 0,!0)],10,bF))}}),dt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Xn=dt(xF,[["__scopeId","data-v-c9e67023"]]),wF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _F(e,t){return x(),E("svg",wF,[...t[0]||(t[0]=[w("path",{d:"M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z",fill:"currentColor"},null,-1),w("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z",fill:"currentColor"},null,-1)])])}const SF=gt({name:"kimi-add-conversation",render:_F}),CF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function AF(e,t){return x(),E("svg",CF,[...t[0]||(t[0]=[w("path",{d:"M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z",fill:"currentColor"},null,-1)])])}const MF=gt({name:"kimi-folder",render:AF}),EF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},TF=["clip-path"],NF=["id"];function IF(e,t){return x(),E("svg",EF,[w("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[w("path",{d:"M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z",fill:"currentColor"},null,-1)])],8,TF),w("defs",null,[w("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[w("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,NF)])])}const LF=gt({name:"kimi-folder-open",render:IF,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),$F={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function FF(e,t){return x(),E("svg",$F,[...t[0]||(t[0]=[w("path",{d:"M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z",fill:"currentColor"},null,-1),w("path",{d:"M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z",fill:"currentColor"},null,-1),w("path",{d:"M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z",fill:"currentColor"},null,-1)])])}const OF=gt({name:"kimi-more",render:FF}),BF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function RF(e,t){return x(),E("svg",BF,[...t[0]||(t[0]=[w("path",{d:"M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z",fill:"currentColor"},null,-1)])])}const DF=gt({name:"kimi-search",render:RF}),PF={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function HF(e,t){return x(),E("svg",PF,[...t[0]||(t[0]=[w("path",{d:"M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z",fill:"currentColor"},null,-1),w("path",{d:"M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z",fill:"currentColor"},null,-1)])])}const WF=gt({name:"kimi-setting",render:HF}),zF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UF(e,t){return x(),E("svg",zF,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m15 10l-2 2l2 2"})],-1)])])}const qF=gt({name:"tabler-layout-sidebar-left-collapse",render:UF}),jF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VF(e,t){return x(),E("svg",jF,[...t[0]||(t[0]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"}),w("path",{d:"m14 10l2 2l-2 2"})],-1)])])}const KF=gt({name:"tabler-layout-sidebar-left-expand",render:VF}),GF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YF(e,t){return x(),E("svg",GF,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"},null,-1)])])}const ZF=gt({name:"tabler-paperclip",render:YF}),XF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QF(e,t){return x(),E("svg",XF,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const JF=gt({name:"ri-add-line",render:QF}),eO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tO(e,t){return x(),E("svg",eO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"},null,-1)])])}const nO=gt({name:"ri-alert-line",render:tO}),oO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sO(e,t){return x(),E("svg",oO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"},null,-1)])])}const iO=gt({name:"ri-archive-line",render:sO}),rO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lO(e,t){return x(),E("svg",rO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"},null,-1)])])}const aO=gt({name:"ri-arrow-down-line",render:lO}),cO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uO(e,t){return x(),E("svg",cO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const dO=gt({name:"ri-arrow-down-s-line",render:uO}),fO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hO(e,t){return x(),E("svg",fO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"},null,-1)])])}const pO=gt({name:"ri-arrow-go-back-line",render:hO}),mO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gO(e,t){return x(),E("svg",mO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"},null,-1)])])}const vO=gt({name:"ri-arrow-right-line",render:gO}),yO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kO(e,t){return x(),E("svg",yO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"},null,-1)])])}const bO=gt({name:"ri-arrow-right-s-line",render:kO}),xO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wO(e,t){return x(),E("svg",xO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"},null,-1)])])}const A_=gt({name:"ri-arrow-up-line",render:wO}),_O={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SO(e,t){return x(),E("svg",_O,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)])])}const CO=gt({name:"ri-arrow-up-s-line",render:SO}),AO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function MO(e,t){return x(),E("svg",AO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"},null,-1)])])}const EO=gt({name:"ri-braces-line",render:MO}),TO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NO(e,t){return x(),E("svg",TO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"},null,-1)])])}const IO=gt({name:"ri-calendar-close-line",render:NO}),LO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $O(e,t){return x(),E("svg",LO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"},null,-1)])])}const FO=gt({name:"ri-calendar-schedule-line",render:$O}),OO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BO(e,t){return x(),E("svg",OO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"},null,-1)])])}const RO=gt({name:"ri-calendar-todo-line",render:BO}),DO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function PO(e,t){return x(),E("svg",DO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"},null,-1)])])}const HO=gt({name:"ri-check-line",render:PO}),WO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zO(e,t){return x(),E("svg",WO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)])])}const UO=gt({name:"ri-close-line",render:zO}),qO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jO(e,t){return x(),E("svg",qO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"},null,-1)])])}const VO=gt({name:"ri-code-line",render:jO}),KO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GO(e,t){return x(),E("svg",KO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"},null,-1)])])}const YO=gt({name:"ri-collapse-diagonal-line",render:GO}),ZO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XO(e,t){return x(),E("svg",ZO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"},null,-1)])])}const QO=gt({name:"ri-download-line",render:XO}),JO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eB(e,t){return x(),E("svg",JO,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"},null,-1)])])}const tB=gt({name:"ri-draggable",render:eB}),nB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oB(e,t){return x(),E("svg",nB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const sB=gt({name:"ri-equalizer-line",render:oB}),iB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rB(e,t){return x(),E("svg",iB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"},null,-1)])])}const lB=gt({name:"ri-expand-diagonal-line",render:rB}),aB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cB(e,t){return x(),E("svg",aB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"},null,-1)])])}const uB=gt({name:"ri-external-link-line",render:cB}),dB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fB(e,t){return x(),E("svg",dB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const hB=gt({name:"ri-file-add-line",render:fB}),pB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mB(e,t){return x(),E("svg",pB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"},null,-1)])])}const gB=gt({name:"ri-file-copy-line",render:mB}),vB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yB(e,t){return x(),E("svg",vB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"},null,-1)])])}const kB=gt({name:"ri-file-edit-line",render:yB}),bB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xB(e,t){return x(),E("svg",bB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"},null,-1)])])}const M_=gt({name:"ri-file-line",render:xB}),wB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _B(e,t){return x(),E("svg",wB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"},null,-1)])])}const SB=gt({name:"ri-file-text-line",render:_B}),CB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AB(e,t){return x(),E("svg",CB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const MB=gt({name:"ri-flashlight-line",render:AB}),EB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function TB(e,t){return x(),E("svg",EB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"},null,-1)])])}const NB=gt({name:"ri-folder-add-line",render:TB}),IB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function LB(e,t){return x(),E("svg",IB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"},null,-1)])])}const $B=gt({name:"ri-folder-fill",render:LB}),FB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function OB(e,t){return x(),E("svg",FB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"},null,-1)])])}const BB=gt({name:"ri-git-fork-line",render:OB}),RB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DB(e,t){return x(),E("svg",RB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"},null,-1)])])}const PB=gt({name:"ri-git-pull-request-line",render:DB}),HB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function WB(e,t){return x(),E("svg",HB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"},null,-1)])])}const zB=gt({name:"ri-global-line",render:WB}),UB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qB(e,t){return x(),E("svg",UB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"},null,-1)])])}const E_=gt({name:"ri-image-line",render:qB}),jB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VB(e,t){return x(),E("svg",jB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"},null,-1)])])}const KB=gt({name:"ri-information-line",render:VB}),GB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YB(e,t){return x(),E("svg",GB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"},null,-1)])])}const ZB=gt({name:"ri-links-line",render:YB}),XB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QB(e,t){return x(),E("svg",XB,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const JB=gt({name:"ri-list-check",render:QB}),eR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tR(e,t){return x(),E("svg",eR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const nR=gt({name:"ri-list-unordered",render:tR}),oR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sR(e,t){return x(),E("svg",oR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"},null,-1)])])}const iR=gt({name:"ri-login-box-line",render:sR}),rR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lR(e,t){return x(),E("svg",rR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"},null,-1)])])}const aR=gt({name:"ri-mail-line",render:lR}),cR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uR(e,t){return x(),E("svg",cR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"},null,-1)])])}const dR=gt({name:"ri-message-line",render:uR}),fR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hR(e,t){return x(),E("svg",fR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const pR=gt({name:"ri-pause-fill",render:hR}),mR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gR(e,t){return x(),E("svg",mR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"},null,-1)])])}const vR=gt({name:"ri-pencil-line",render:gR}),yR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kR(e,t){return x(),E("svg",yR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"},null,-1)])])}const bR=gt({name:"ri-play-fill",render:kR}),xR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wR(e,t){return x(),E("svg",xR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"},null,-1)])])}const _R=gt({name:"ri-question-line",render:wR}),SR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CR(e,t){return x(),E("svg",SR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const AR=gt({name:"ri-sort-desc",render:CR}),MR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ER(e,t){return x(),E("svg",MR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"},null,-1)])])}const TR=gt({name:"ri-sparkling-line",render:ER}),NR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IR(e,t){return x(),E("svg",NR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"},null,-1)])])}const LR=gt({name:"ri-star-fill",render:IR}),$R={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FR(e,t){return x(),E("svg",$R,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"},null,-1)])])}const OR=gt({name:"ri-star-line",render:FR}),BR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function RR(e,t){return x(),E("svg",BR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"},null,-1)])])}const DR=gt({name:"ri-stop-fill",render:RR}),PR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HR(e,t){return x(),E("svg",PR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const WR=gt({name:"ri-subtract-line",render:HR}),zR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UR(e,t){return x(),E("svg",zR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"},null,-1)])])}const qR=gt({name:"ri-target-line",render:UR}),jR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VR(e,t){return x(),E("svg",jR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"},null,-1)])])}const KR=gt({name:"ri-terminal-box-line",render:VR}),GR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YR(e,t){return x(),E("svg",GR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"},null,-1)])])}const ZR=gt({name:"ri-time-line",render:YR}),XR={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QR(e,t){return x(),E("svg",XR,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"},null,-1)])])}const JR=gt({name:"ri-tools-line",render:QR}),eD={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tD(e,t){return x(),E("svg",eD,[...t[0]||(t[0]=[w("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"},null,-1)])])}const nD=gt({name:"ri-user-line",render:tD}),oD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
39
+ <path d="M11.1 12.9001V15.0909C11.1 15.593 11.5029 16 12 16C12.4971 16 12.9 15.593 12.9 15.0909V12.9001H15.0909C15.593 12.9001 16 12.4972 16 12.0001C16 11.5031 15.593 11.1001 15.0909 11.1001H12.9V8.90909C12.9 8.40701 12.4971 8 12 8C11.5029 8 11.1 8.40701 11.1 8.90909V11.1001H8.90909C8.40701 11.1001 8 11.5031 8 12.0001C8 12.4972 8.40701 12.9001 8.90909 12.9001H11.1Z" fill="currentColor"/>
40
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9996 2.1001C6.53199 2.1001 2.09961 6.53248 2.09961 12.0001C2.09961 13.9226 2.64847 15.7192 3.59804 17.2391L2.517 19.8207C2.10313 20.8091 2.82908 21.9001 3.90059 21.9001H11.9996C17.4672 21.9001 21.8996 17.4677 21.8996 12.0001C21.8996 6.53248 17.4672 2.1001 11.9996 2.1001ZM3.89961 12.0001C3.89961 7.52659 7.5261 3.9001 11.9996 3.9001C16.4731 3.9001 20.0996 7.52659 20.0996 12.0001C20.0996 16.4736 16.4724 20.1001 11.9989 20.1001H4.35146L5.63494 17.0351L5.35165 16.6291C4.43632 15.3172 3.89961 13.7227 3.89961 12.0001Z" fill="currentColor"/>
41
+ </svg>
42
+ `,sD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
43
+ <path d="M9.2373 3.7002C10.4169 3.7002 11.5297 4.24779 12.249 5.18262L12.4424 5.43359H18C20.0987 5.43359 21.7998 7.13472 21.7998 9.2334V16.5C21.7998 18.5987 20.0987 20.2998 18 20.2998H6C3.90132 20.2998 2.2002 18.5987 2.2002 16.5V7.5C2.2002 5.40132 3.90132 3.7002 6 3.7002H9.2373ZM6 5.5C4.89543 5.5 4 6.39543 4 7.5V16.5C4 17.6046 4.89543 18.5 6 18.5H18C19.0357 18.5 19.887 17.7128 19.9893 16.7041L20 16.5V9.2334C20 8.19775 19.2128 7.34641 18.2041 7.24414L18 7.2334H12.0479L11.9326 7.22656C11.666 7.19561 11.4205 7.05812 11.2549 6.84277L10.8223 6.28027C10.4437 5.78834 9.85808 5.5 9.2373 5.5H6ZM16 9.59961C16.4971 9.59961 16.9004 10.0029 16.9004 10.5C16.9004 10.9971 16.4971 11.4004 16 11.4004H8C7.50294 11.4004 7.09961 10.9971 7.09961 10.5C7.09961 10.0029 7.50294 9.59961 8 9.59961H16Z" fill="currentColor"/>
44
+ </svg>
45
+ `,iD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
46
+ <g clip-path="url(#clip0_4626_2033)">
47
+ <path d="M18.3623 9.99976L18.209 8.48999C18.2031 8.43161 18.2004 8.37289 18.2002 8.31421C18.1988 8.31196 18.1956 8.30842 18.1904 8.30347C18.1718 8.28559 18.1302 8.26245 18.0713 8.26245H11C10.261 8.26245 9.59753 7.81016 9.32617 7.1228L8.9082 6.06421C8.88101 5.9953 8.85737 5.92501 8.83887 5.85327C8.83778 5.85099 8.833 5.84268 8.81836 5.83179C8.79454 5.81475 8.7549 5.79939 8.70605 5.80054H3.92871C3.86986 5.80054 3.82825 5.82368 3.80957 5.84155C3.80816 5.8429 3.80675 5.84428 3.80566 5.84546L4.47559 14.0955L3.62109 17.5154L5.12109 11.5154C5.34367 10.6251 6.1438 9.99977 7.06152 9.99976H18.3623ZM7.06152 11.7996C6.96976 11.7996 6.88944 11.8629 6.86719 11.9519L5.36719 17.9519C5.33598 18.078 5.43158 18.1999 5.56152 18.2H19.4385C19.5302 18.1999 19.6106 18.1376 19.6328 18.0486L21.1328 12.0486C21.1644 11.9224 21.0686 11.7996 20.9385 11.7996H7.06152ZM20.9385 9.99976C22.2396 9.99977 23.1945 11.2228 22.8789 12.4851L21.3789 18.4851C21.1563 19.3754 20.3562 19.9997 19.4385 19.9998H4.92871C4.41722 19.9998 3.92613 19.8059 3.56445 19.4597C3.20281 19.1135 3.00004 18.6436 3 18.1541L2 5.84644C2.00006 5.35711 2.20311 4.88786 2.56445 4.54175C2.92613 4.19554 3.41722 4.00073 3.92871 4.00073H8.66406C9.10133 3.99051 9.5296 4.1225 9.87793 4.37573C10.2285 4.63118 10.4767 4.99457 10.582 5.40405L11 6.46167H18.0713C18.5828 6.46167 19.0739 6.65648 19.4355 7.00269C19.7971 7.34888 20 7.81883 20 8.30835L20.1719 9.99976H20.9385Z" fill="currentColor"/>
48
+ </g>
49
+ <defs>
50
+ <clipPath id="clip0_4626_2033">
51
+ <rect width="24" height="24" fill="white"/>
52
+ </clipPath>
53
+ </defs>
54
+ </svg>
55
+ `,rD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
56
+ <path d="M6 12C6 12.8283 5.32834 13.5 4.5 13.5C3.67166 13.5 3 12.8283 3 12C3 11.1717 3.67166 10.5 4.5 10.5C5.32834 10.5 6 11.1717 6 12Z" fill="currentColor"/>
57
+ <path d="M13.5 12C13.5 12.8283 12.8283 13.5 12 13.5C11.1717 13.5 10.5 12.8283 10.5 12C10.5 11.1717 11.1717 10.5 12 10.5C12.8283 10.5 13.5 11.1717 13.5 12Z" fill="currentColor"/>
58
+ <path d="M19.5002 13.5C20.3287 13.5 21 12.8287 21 12.0002C21 11.1718 20.3287 10.5 19.5002 10.5C18.6718 10.5 18 11.1718 18 12.0002C18 12.8287 18.6718 13.5 19.5002 13.5Z" fill="currentColor"/>
59
+ </svg>
60
+ `,lD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M11.5 3C16.1944 3 20 6.80558 20 11.5C20 13.523 19.2933 15.381 18.1132 16.8404L21.1364 19.8636C21.4879 20.2151 21.4879 20.7849 21.1364 21.1364C20.7849 21.4879 20.2151 21.4879 19.8636 21.1364L16.8404 18.1132C15.381 19.2933 13.523 20 11.5 20C6.80558 20 3 16.1944 3 11.5C3 6.80558 6.80558 3 11.5 3ZM11.5 18.2C15.2003 18.2 18.2 15.2003 18.2 11.5C18.2 7.79969 15.2003 4.8 11.5 4.8C7.79969 4.8 4.8 7.79969 4.8 11.5C4.8 15.2003 7.79969 18.2 11.5 18.2Z" fill="currentColor"/>
62
+ </svg>
63
+ `,aD=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
64
+ <path d="M16.0404 12C16.0404 9.76874 14.2313 7.9596 12.0001 7.9596C9.76883 7.9596 7.95972 9.76874 7.95972 12C7.95972 14.2313 9.76883 16.0404 12.0001 16.0404C14.2313 16.0404 16.0404 14.2313 16.0404 12ZM14.2222 12C14.2222 13.2271 13.2271 14.2222 12 14.2222C10.7729 14.2222 9.77783 13.2271 9.77783 12C9.77783 10.7729 10.7729 9.77778 12 9.77778C13.2271 9.77778 14.2222 10.7729 14.2222 12Z" fill="currentColor"/>
65
+ <path d="M9.91145 21.8009C9.29001 21.6797 8.76914 21.2612 8.50632 20.6922L8.07372 19.7556C7.88838 19.3544 7.43553 19.1048 6.95371 19.1549L5.89572 19.2647C5.2733 19.3293 4.64823 19.114 4.22298 18.6611C3.74343 18.1504 3.32454 17.6037 2.97033 17.0181C2.61571 16.4318 2.32839 15.8106 2.10407 15.1566C1.89769 14.5549 2.02148 13.8954 2.4089 13.3902L3.0376 12.5704C3.30043 12.2277 3.30042 11.7722 3.03758 11.4295L2.40413 10.6035C2.01474 10.0958 1.891 9.43198 2.10208 8.82826C2.55037 7.54612 3.27017 6.35997 4.22 5.34259C4.64518 4.8872 5.27275 4.67067 5.89701 4.73544L6.95383 4.84514C7.43561 4.89515 7.88844 4.6456 8.07377 4.24441L8.50266 3.31593C8.76494 2.74818 9.28448 2.33019 9.90423 2.20761C11.2916 1.9332 12.7148 1.93127 14.0885 2.19913C14.7099 2.32029 15.2308 2.73881 15.4937 3.3078L15.9263 4.24441C16.1116 4.6456 16.5644 4.89514 17.0462 4.84514L18.1043 4.73532C18.7267 4.67072 19.3518 4.88603 19.777 5.33886C20.2566 5.84953 20.6755 6.3963 21.0297 6.98193C21.3843 7.56823 21.6716 8.18942 21.8959 8.84339C22.1023 9.44509 21.9785 10.1046 21.5911 10.6098L20.9624 11.4295C20.6996 11.7722 20.6996 12.2278 20.9624 12.5705L21.5959 13.3964C21.9853 13.9042 22.109 14.568 21.8979 15.1717C21.4497 16.4538 20.7299 17.6399 19.7801 18.6573C19.3549 19.1128 18.7273 19.3294 18.103 19.2646L17.0462 19.1549C16.5645 19.1049 16.1116 19.3544 15.9263 19.7556L15.4974 20.6841C15.2351 21.2518 14.7156 21.6698 14.0958 21.7924C12.7083 22.0668 11.2852 22.0687 9.91145 21.8009ZM13.7432 20.0088C13.7844 20.0006 13.8259 19.9673 13.847 19.9216L14.2758 18.9931C14.7915 17.8768 15.9886 17.2171 17.2341 17.3464L18.2909 17.4561C18.3649 17.4638 18.4272 17.4423 18.4512 17.4166C19.2296 16.5828 19.8171 15.6146 20.1817 14.5716C20.1845 14.5636 20.1796 14.5373 20.1532 14.5029L19.5198 13.677C18.7564 12.6815 18.7564 11.3185 19.5198 10.323L20.1485 9.5033C20.1746 9.46927 20.1795 9.4429 20.1762 9.43327C19.9932 8.89965 19.7603 8.39623 19.4741 7.92293C19.1873 7.4489 18.846 7.00333 18.4517 6.58351C18.4272 6.55739 18.3656 6.53616 18.2921 6.54378L17.234 6.65361C15.9886 6.78287 14.7915 6.12317 14.2758 5.00689L13.8432 4.07027C13.822 4.02448 13.7811 3.9916 13.7406 3.98371C12.5983 3.76097 11.4132 3.76258 10.2571 3.99124C10.2158 3.99941 10.1744 4.03271 10.1533 4.07842L9.72441 5.00689C9.20875 6.12317 8.01164 6.7829 6.76619 6.6536L5.70942 6.54391C5.63535 6.53623 5.573 6.55774 5.54905 6.5834C4.77067 7.41713 4.18312 8.38534 3.81845 9.42835C3.81564 9.43637 3.82054 9.46265 3.84693 9.49706L4.48038 10.323C5.24381 11.3185 5.24383 12.6815 4.48041 13.6769L3.85171 14.4967C3.82561 14.5307 3.82066 14.5571 3.82396 14.5667C4.00701 15.1004 4.23986 15.6038 4.52613 16.0771C4.81284 16.5511 5.15421 16.9967 5.54845 17.4165C5.57298 17.4426 5.63461 17.4638 5.70811 17.4562L6.76608 17.3464C8.01157 17.2171 9.20871 17.8768 9.72438 18.9932L10.157 19.9297C10.1781 19.9755 10.2191 20.0084 10.2595 20.0163C11.4018 20.239 12.587 20.2374 13.7432 20.0088Z" fill="currentColor"/>
66
+ </svg>
67
+ `,cD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m15 10l-2 2l2 2"/></g></svg>',uD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm5-2v16"/><path d="m14 10l2 2l-2 2"/></g></svg>',dD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3L18 10a3 3 0 0 0-6-6l-6.5 6.5a4.5 4.5 0 0 0 9 9L21 13"/></svg>',fD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',hD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0m-8.66 16h15.588L12 5.5zM11 16h2v2h-2zm0-7h2v5h-2z"/></svg>',pD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 10H2V4.003C2 3.449 2.455 3 2.992 3h18.016A.99.99 0 0 1 22 4.003V10h-1v10.002a.996.996 0 0 1-.993.998H3.993A.996.996 0 0 1 3 20.002zm16 0H5v9h14zM4 5v3h16V5zm5 7h6v2H9z"/></svg>',mD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13 16.172l5.364-5.364l1.414 1.414L12 20l-7.778-7.778l1.414-1.414L11 16.172V4h2z"/></svg>',gD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"/></svg>',vD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m5.828 7l2.536 2.535L6.95 10.95L2 6l4.95-4.95l1.414 1.415L5.828 5H13a8 8 0 1 1 0 16H4v-2h9a6 6 0 0 0 0-12z"/></svg>',yD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m16.172 11l-5.364-5.364l1.414-1.414L20 12l-7.778 7.778l-1.414-1.414L16.172 13H4v-2z"/></svg>',kD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z"/></svg>',T_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 7.828V20h-2V7.828l-5.364 5.364l-1.414-1.414L12 4l7.778 7.778l-1.414 1.414z"/></svg>',bD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"/></svg>',xD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12A2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3m16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5"/></svg>',wD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 3V1H7v2H3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4V1h-2v2zm-5 7h16v9H4zm0-5h3v1h2V5h6v1h2V5h3v3H4zm5.879 5.964L12 13.086l2.121-2.122l1.415 1.415l-2.122 2.121l2.121 2.121l-1.414 1.414L12 15.915l-2.121 2.12l-1.415-1.414l2.122-2.12l-2.122-2.122z"/></svg>',_D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 3V1h2v2h6V1h2v2h4a1 1 0 0 1 1 1v5h-2V5h-3v2h-2V5H9v2H7V5H4v14h6v2H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm10 9a4 4 0 1 0 0 8a4 4 0 0 0 0-8m-6 4a6 6 0 1 1 12 0a6 6 0 0 1-12 0m5-3v3.414l2.293 2.293l1.414-1.414L18 15.586V13z"/></svg>',SD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 1v2h6V1h2v2h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1zm11 10H4v8h16zM8 14v2H6v-2zm10 0v2h-8v-2zM7 5H4v4h16V5h-3v2h-2V5H9v2H7z"/></svg>',CD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m10 15.17l9.192-9.191l1.414 1.414L10 17.999l-6.364-6.364l1.414-1.414z"/></svg>',AD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"/></svg>',MD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m23 12l-7.071 7.071l-1.414-1.414L20.172 12l-5.657-5.657l1.414-1.414zM3.828 12l5.657 5.657l-1.414 1.414L1 12l7.071-7.071l1.414 1.414z"/></svg>',ED='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4h-2v7h7V9h-3.586l4.293-4.293l-1.414-1.414L15 7.586zM4 15h3.586l-4.293 4.293l1.414 1.414L9 16.414V20h2v-7H4z"/></svg>',TD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z"/></svg>',ND='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m0 6.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0M15.5 7a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"/></svg>',ID='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.17 18a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2v-2zm6-7a3.001 3.001 0 0 1 5.66 0H22v2h-4.17a3.001 3.001 0 0 1-5.66 0H2v-2zm-6-7a3.001 3.001 0 0 1 5.66 0H22v2H11.83a3.001 3.001 0 0 1-5.66 0H2V4zM9 6a1 1 0 1 0 0-2a1 1 0 0 0 0 2m6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m-6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',LD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M17.586 5H14V3h7v7h-2V6.414l-4.293 4.293l-1.414-1.414zM3 14h2v3.586l4.293-4.293l1.414 1.414L6.414 19H10v2H3z"/></svg>',$D='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z"/></svg>',FD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 4H5v16h14V8h-4zM3 2.992C3 2.444 3.447 2 3.999 2H16l5 5v13.993A1 1 0 0 1 20.007 22H3.993A1 1 0 0 1 3 21.008zM11 11V8h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',OD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1 1 0 0 1 3 21l.003-14c0-.552.45-1 1.006-1zM5.002 8L5 20h10V8zM9 6h8v10h2V4H9z"/></svg>',BD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m21 6.757l-2 2V4h-9v5H5v11h14v-2.757l2-2v5.765a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8l6.003-6h10.995C20.55 2 21 2.455 21 2.992zm.778 2.05l1.414 1.415L15.414 18l-1.416-.002l.002-1.412z"/></svg>',N_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M9 2.003V2h10.998C20.55 2 21 2.455 21 2.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 20.993V8zM5.83 8H9V4.83zM11 4v5a1 1 0 0 1-1 1H5v10h14V4z"/></svg>',RD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M21 8v12.993A1 1 0 0 1 20.007 22H3.993A.993.993 0 0 1 3 21.008V2.992C3 2.455 3.449 2 4.002 2h10.995zm-2 1h-5V4H5v16h14zM8 7h3v2H8zm0 4h8v2H8zm0 4h8v2H8z"/></svg>',DD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"/></svg>',PD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414zM4 5v14h16V7h-8.414l-2-2zm7 7V9h2v3h3v2h-3v3h-2v-3H8v-2z"/></svg>',HD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414z"/></svg>',WD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2M3 6a3 3 0 1 1 4 2.83V9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-.17a3.001 3.001 0 1 1 2 0V9a4 4 0 0 1-4 4h-2v2.17a3.001 3.001 0 1 1-2 0V13H9a4 4 0 0 1-4-4v-.17A3 3 0 0 1 3 6m15-1a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-6 12a1 1 0 1 0 0 2a1 1 0 0 0 0-2"/></svg>',zD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M15 5h2a2 2 0 0 1 2 2v8.17a3.001 3.001 0 1 1-2 0V7h-2v3l-4.5-4L15 2zM5 8.83a3.001 3.001 0 1 1 2 0v6.34a3.001 3.001 0 1 1-2 0zM6 7a1 1 0 1 0 0-2a1 1 0 0 0 0 2m0 12a1 1 0 1 0 0-2a1 1 0 0 0 0 2m12 0a1 1 0 1 0 0-2a1 1 0 0 0 0 2"/></svg>',UD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.01 8.01 0 0 0 5.648 6.667M10.03 13c.151 2.439.848 4.73 1.97 6.752A15.9 15.9 0 0 0 13.97 13zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.01 8.01 0 0 0 19.938 13M4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333A8.01 8.01 0 0 0 4.062 11m5.969 0h3.938A15.9 15.9 0 0 0 12 4.248A15.9 15.9 0 0 0 10.03 11m4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.01 8.01 0 0 0-5.648-6.667"/></svg>',I_='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M2.992 21A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993zM20 15V5H4v14L14 9zm0 2.828l-6-6L6.828 19H20zM8 11a2 2 0 1 1 0-4a2 2 0 0 1 0 4"/></svg>',qD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16M11 7h2v2h-2zm0 4h2v6h-2z"/></svg>',jD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m13.06 8.111l1.415 1.414a7 7 0 0 1 0 9.9l-.354.353a7 7 0 1 1-9.9-9.9l1.415 1.415a5 5 0 1 0 7.071 7.071l.354-.354a5 5 0 0 0 0-7.07l-1.415-1.415zm6.718 6.01l-1.414-1.414a5 5 0 0 0-7.071-7.07l-.354.353a5 5 0 0 0 0 7.07l1.415 1.415l-1.415 1.414l-1.414-1.414a7 7 0 0 1 0-9.9l.354-.353a7 7 0 1 1 9.9 9.9"/></svg>',VD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"/></svg>',KD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 4h13v2H8zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M8 11h13v2H8zm0 7h13v2H8z"/></svg>',GD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 15h2v5h12V4H6v5H4V3a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm6-4V8l5 4l-5 4v-3H2v-2z"/></svg>',YD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m17 4.238l-7.928 7.1L4 7.216V19h16zM4.511 5l7.55 6.662L19.502 5z"/></svg>',ZD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1zm-.692-2H20V5H4v13.385zM8 10h8v2H8z"/></svg>',XD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',QD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m15.728 9.576l-1.414-1.414L5 17.476v1.414h1.414zm1.414-1.414l1.414-1.414l-1.414-1.414l-1.414 1.414zm-9.9 12.728H3v-4.243L16.435 3.212a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414z"/></svg>',JD='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M19.376 12.416L8.777 19.482A.5.5 0 0 1 8 19.066V4.934a.5.5 0 0 1 .777-.416l10.599 7.066a.5.5 0 0 1 0 .832"/></svg>',eP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-1-5h2v2h-2zm2-1.645V14h-2v-1.5a1 1 0 0 1 1-1a1.5 1.5 0 1 0-1.471-1.794l-1.962-.393A3.501 3.501 0 1 1 13 13.355"/></svg>',tP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"/></svg>',nP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 4.438A2.437 2.437 0 0 0 16.438 2h1.125A2.437 2.437 0 0 0 20 4.438v1.125A2.437 2.437 0 0 0 17.563 8h-1.125A2.437 2.437 0 0 0 14 5.563zM1 11a6 6 0 0 0 6-6h2a6 6 0 0 0 6 6v2a6 6 0 0 0-6 6H7a6 6 0 0 0-6-6zm3.876 1A8.04 8.04 0 0 1 8 15.124A8.04 8.04 0 0 1 11.124 12A8.04 8.04 0 0 1 8 8.876A8.04 8.04 0 0 1 4.876 12m12.374 2A3.25 3.25 0 0 1 14 17.25v1.5A3.25 3.25 0 0 1 17.25 22h1.5A3.25 3.25 0 0 1 22 18.75v-1.5A3.25 3.25 0 0 1 18.75 14z"/></svg>',oP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928z"/></svg>',sP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="m12 18.26l-7.053 3.948l1.575-7.928L.588 8.792l8.027-.952L12 .5l3.385 7.34l8.027.952l-5.934 5.488l1.575 7.928zm0-2.292l4.247 2.377l-.948-4.773l3.573-3.305l-4.833-.573l-2.038-4.419l-2.039 4.42l-4.833.572l3.573 3.305l-.948 4.773z"/></svg>',iP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1"/></svg>',rP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',lP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 2a1 1 0 1 1 0 2a8 8 0 1 0 8 8a1 1 0 1 1 2 0c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2m0 4a1 1 0 1 1 0 2a4 4 0 1 0 4 4a1 1 0 1 1 2 0a6 6 0 1 1-6-6m5.656-3.9a1.001 1.001 0 0 1 1.415 1.415l-.708.706h.001a1 1 0 1 0 1.414 1.415l.707-.707A1 1 0 0 1 21.9 6.343l-2.12 2.122a1 1 0 0 1-.708.292h-2.414l-3.95 3.95a1 1 0 0 1-1.414-1.414l3.95-3.95V4.93a1 1 0 0 1 .292-.707z"/></svg>',aP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1m1 2v14h16V5zm8 10h6v2h-6zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243l-1.415-1.415z"/></svg>',cP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m1-8h4v2h-6V7h2z"/></svg>',uP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5.33 3.272a3.5 3.5 0 0 1 4.254 4.962l10.709 10.71l-1.414 1.414l-10.71-10.71a3.502 3.502 0 0 1-4.962-4.255L5.444 7.63a1.5 1.5 0 0 0 2.121-2.121zm10.367 1.883l3.182-1.768l1.414 1.415l-1.768 3.182l-1.768.353l-2.12 2.121l-1.415-1.414l2.121-2.121zm-6.718 8.132l1.415 1.414l-5.304 5.303a1 1 0 0 1-1.492-1.327l.078-.087z"/></svg>',dP='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M4 22a8 8 0 1 1 16 0h-2a6 6 0 0 0-12 0zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6m0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4"/></svg>',u6={sm:14,md:16,lg:20};function bt(e,t){return{component:e,svg:t}}const d6={plus:bt(JF,fD),"chat-new":bt(SF,oD),"calendar-close":bt(IO,wD),"calendar-schedule":bt(FO,_D),"calendar-todo":bt(RO,SD),close:bt(UO,AD),check:bt(HO,CD),archive:bt(iO,pD),search:bt(DF,lD),copy:bt(gB,OD),link:bt(ZB,jD),"external-link":bt(uB,$D),download:bt(QO,TD),undo:bt(pO,vD),send:bt(A_,T_),image:bt(E_,I_),settings:bt(WF,aD),sliders:bt(sB,ID),"log-in":bt(iR,GD),"chevron-down":bt(dO,gD),"chevron-right":bt(bO,kD),"chevron-up":bt(CO,bD),"arrow-up":bt(A_,T_),"arrow-down":bt(aO,mD),"arrow-right":bt(vO,yD),minus:bt(WR,rP),"panel-collapse":bt(qF,cD),"panel-expand":bt(KF,uD),expand:bt(lB,LD),collapse:bt(YO,ED),list:bt(nR,KD),sort:bt(AR,tP),grip:bt(tB,ND),folder:bt(LF,iD),"folder-closed":bt(MF,sD),"folder-plus":bt(NB,PD),"folder-solid":bt($B,HD),file:bt(M_,N_),"file-text":bt(SB,RD),"file-edit":bt(kB,BD),"file-plus":bt(hB,FD),"file-off":bt(M_,N_),attachment:bt(ZF,dD),"image-off":bt(E_,I_),code:bt(VO,MD),terminal:bt(KR,aP),pencil:bt(vR,QD),tool:bt(JR,uP),glob:bt(EO,xD),globe:bt(zB,UD),"check-list":bt(JB,VD),bolt:bt(MB,DD),"git-fork":bt(BB,WD),"git-pull-request":bt(PB,zD),message:bt(dR,ZD),mail:bt(aR,YD),user:bt(nD,dP),info:bt(KB,qD),"help-circle":bt(_R,eP),"alert-triangle":bt(nO,hD),clock:bt(ZR,cP),sparkles:bt(TR,nP),target:bt(qR,lP),pause:bt(pR,XD),play:bt(bR,JD),stop:bt(DR,iP),star:bt(LR,oP),"star-outline":bt(OR,sP),"dots-horizontal":bt(OF,rD)};function fP(e){return d6[e]}function hP(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function Rc(e,t="md"){const n=d6[e];return n?hP(n.svg,u6[t]):""}const q4e=[["Actions",["plus","attachment","chat-new","close","check","search","copy","link","external-link","download","undo","send","image","settings","sliders","log-in"]],["Navigation & layout",["chevron-down","chevron-right","chevron-up","arrow-up","arrow-down","arrow-right","minus","panel-collapse","panel-expand","expand","collapse","list","sort","grip"]],["Files & tools",["folder","folder-closed","folder-plus","folder-solid","file","file-text","file-edit","file-plus","file-off","image-off","code","terminal","pencil","tool","glob","globe","check-list","bolt","git-fork","git-pull-request","archive","target","calendar-schedule","calendar-todo","calendar-close"]],["Communication",["message","mail","user"]],["Status & media",["info","help-circle","alert-triangle","clock","sparkles","pause","play","stop","star","star-outline","dots-horizontal"]]],Ge=Je({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=D(()=>fP(t.name)),o=D(()=>u6[t.size]);return(s,i)=>n.value?(x(),Se(Ho(n.value.component),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ue("",!0)}}),pP={key:0,class:"ui-dialog__head"},mP={class:"ui-dialog__titles"},gP={key:0,class:"ui-dialog__title"},vP={key:1,class:"ui-dialog__desc"},yP={class:"ui-dialog__body"},kP={key:1,class:"ui-dialog__foot"},bP='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',xP=Je({__name:"Dialog",props:{open:{type:Boolean},title:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},initialFocus:{}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,o=t,s=oe(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(bP)):[]}function a(){const{initialFocus:d}=n;return d?typeof d=="function"?d()??null:typeof d=="string"?s.value?.querySelector(d)??null:s.value?.contains(d)?d:null:null}function c(d){if(!n.open)return;if(d.key==="Escape"&&n.closeOnEsc){d.preventDefault(),r();return}if(d.key!=="Tab")return;const f=l(),h=f[0],p=f[f.length-1];if(!h||!p){d.preventDefault(),s.value?.focus();return}const m=document.activeElement;d.shiftKey&&m===h?(d.preventDefault(),p.focus()):!d.shiftKey&&m===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return et(()=>n.open,async d=>{if(d){Bc.value+=1,i=document.activeElement,await yt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else Bc.value=Math.max(0,Bc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(Bc.value=Math.max(0,Bc.value-1))}),(d,f)=>(x(),Se(b1,{to:"body"},[e.open?(x(),E("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[w("div",{ref_key:"panel",ref:s,class:Ue(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed"}]]),role:"dialog","aria-modal":"true",tabindex:"-1"},[e.title||d.$slots.head?(x(),E("div",pP,[jn(d.$slots,"head",{},()=>[w("div",mP,[e.title?(x(),E("div",gP,B(e.title),1)):ue("",!0),e.description?(x(),E("div",vP,B(e.description),1)):ue("",!0)])],!0),ae(Xn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ie(()=>[ae(Ge,{name:"close",size:"md"})]),_:1})])):ue("",!0),w("div",yP,[jn(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(x(),E("div",kP,[jn(d.$slots,"foot",{},void 0,!0)])):ue("",!0)],2)],32)):ue("",!0)]))}}),Qr=dt(xP,[["__scopeId","data-v-3dce23a4"]]),wP={class:"sd-head"},_P=["placeholder","aria-label"],SP=["aria-selected","onClick","onMousemove"],CP={class:"sd-meta"},AP=["innerHTML"],MP={class:"sd-time"},EP=["innerHTML"],TP=["innerHTML"],NP={key:1,class:"sd-empty"},IP={class:"sd-hint"},LP=200,$P=Je({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=oe(""),l=oe(null),a=oe(null),c=D(()=>{const y=r.value.trim().toLowerCase(),g=[];for(const v of o.sessions){const b=v.title??"",A=v.lastPrompt??"",I=v.workspaceName??"",T=y.length>0&&b.toLowerCase().includes(y),M=y.length>0&&A.toLowerCase().includes(y),$=y.length>0&&I.toLowerCase().includes(y);if(!(y.length>0&&!T&&!M&&!$)&&(g.push({session:v,inTitle:T,inWorkspace:$,snippetText:A?kF(A,r.value):""}),g.length>=LP))break}return g}),u=oe(0);et(r,()=>{u.value=0});function d(y){const g=c.value.length;return g===0?0:Math.max(0,Math.min(g-1,y))}async function f(){await yt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(y){u.value=d(u.value+y),f()}function p(y){s("select",y),s("close")}function m(){const y=c.value[u.value];y&&p(y.session.id)}function k(y){y.key==="ArrowDown"?(y.preventDefault(),h(1)):y.key==="ArrowUp"?(y.preventDefault(),h(-1)):y.key==="Enter"&&(y.preventDefault(),m())}return Cn(()=>{l.value?.focus()}),(y,g)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":g[1]||(g[1]=v=>i.value=v),size:"lg",height:"fixed",padded:!1,onClose:g[2]||(g[2]=v=>s("close"))},{head:Ie(()=>[w("div",wP,[ae(Ge,{class:"sd-search-icon",name:"search",size:"md"}),qn(w("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:k},null,40,_P),[[Cs,r.value]])])]),foot:Ie(()=>[w("span",IP,B(C(n)("sidebar.searchHint")),1)]),default:Ie(()=>[w("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(x(!0),E(We,{key:0},rt(c.value,(v,b)=>(x(),E("button",{key:v.session.id,class:Ue(["sd-row",{on:b===u.value,active:v.session.id===e.activeId}]),role:"option","aria-selected":b===u.value,onClick:A=>p(v.session.id),onMousemove:A=>u.value=b},[w("span",CP,[ae(Ge,{class:"sd-folder",name:"folder-closed",size:"sm"}),w("span",{class:"sd-ws",innerHTML:C(wg)(v.session.workspaceName??v.session.workspaceId??"",v.inWorkspace?r.value:"")},null,8,AP),w("span",MP,B(v.session.time),1)]),w("span",{class:"sd-title",innerHTML:C(wg)(v.session.title,v.inTitle?r.value:"")},null,8,EP),v.snippetText?(x(),E("span",{key:0,class:"sd-snippet",innerHTML:C(wg)(v.snippetText,r.value)},null,8,TP)):ue("",!0)],42,SP))),128)):(x(),E("div",NP,B(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),FP=dt($P,[["__scopeId","data-v-a678f802"]]),OP=["aria-label"],BP=Je({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(x(),E("span",{class:Ue(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[w("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[w("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),w("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,OP))}}),Us=dt(BP,[["__scopeId","data-v-e5c5b17d"]]),RP={key:0,class:"ui-badge__dot","aria-hidden":"true"},DP=Je({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(x(),E("span",{class:Ue(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(x(),E("span",RP)):ue("",!0),jn(t.$slots,"default",{},void 0,!0)],2))}}),qi=dt(DP,[["__scopeId","data-v-5bc5cd6d"]]),PP=Je({__name:"Menu",setup(e,{expose:t}){const n=oe();return t({el:n}),(o,s)=>(x(),E("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[jn(o.$slots,"default",{},void 0,!0)],512))}}),Ml=dt(PP,[["__scopeId","data-v-60e6cd8d"]]),HP={key:0,class:"ui-menu-sep",role:"separator"},WP=["disabled"],zP=Je({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"}},emits:["click"],setup(e){return(t,n)=>e.separator?(x(),E("div",HP)):(x(),E("button",{key:1,class:Ue(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:"menuitem",disabled:e.disabled,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[jn(t.$slots,"default",{},void 0,!0)],10,WP))}}),En=dt(zP,[["__scopeId","data-v-f940771a"]]),al=6,cl=8,UP=150,qP=Je({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=oe(),o=oe(),s=oe(!1),i=oe(!1),r=oe({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const m=o.value;if(!a||!m)return;const k=a.getBoundingClientRect(),y=m.offsetWidth,g=m.offsetHeight,v=window.innerWidth,b=window.innerHeight;let A=t.placement;A==="top"&&k.top-al-g<cl?A="bottom":A==="bottom"&&k.bottom+al+g>b-cl?A="top":A==="left"&&k.left-al-y<cl?A="right":A==="right"&&k.right+al+y>v-cl&&(A="left");let I=0,T=0;A==="top"?(I=k.top-al-g,T=k.left+k.width/2-y/2):A==="bottom"?(I=k.bottom+al,T=k.left+k.width/2-y/2):A==="left"?(I=k.top+k.height/2-g/2,T=k.left-al-y):(I=k.top+k.height/2-g/2,T=k.right+al),T=Math.min(Math.max(T,cl),v-cl-y),I=Math.min(Math.max(I,cl),b-cl-g),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(I)}px`,left:`${Math.round(T)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,yt(()=>{u(),i.value=!0})},UP))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(m){m!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=m,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return Cn(()=>{const m=n.value??null;p(m?.firstElementChild??m),m&&(c=new MutationObserver(()=>{const k=m.firstElementChild??null;k!==a&&(f(),p(k??m))}),c.observe(m,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),ho(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(m,k)=>(x(),E(We,null,[w("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[jn(m.$slots,"default",{},void 0,!0)],512),(x(),Se(b1,{to:"body"},[qn(w("div",{ref_key:"bubble",ref:o,class:Ue(["ui-tip__bubble",{positioned:i.value}]),style:on([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},B(e.text),7),[[wi,s.value]])]))],64))}}),an=dt(qP,[["__scopeId","data-v-4c261eb6"]]),jP={class:"row"},VP={class:"lead","aria-hidden":"true"},KP={key:1,class:"unread-dot"},GP={class:"left"},YP=["onKeydown"],ZP={class:"act"},XP={class:"ts"},QP={class:"menu-time"},JP=Je({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork","export"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),s=e,i=n;function r(S){const R=new Date(S);if(Number.isNaN(R.getTime()))return S;const z=W=>String(W).padStart(2,"0");return`${R.getFullYear()}-${z(R.getMonth()+1)}-${z(R.getDate())} ${z(R.getHours())}:${z(R.getMinutes())}`}const l=D(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=oe(!1),c=oe(null),u=oe(null),d=oe({});function f(S){const R=S.target;u.value?.el?.contains(R)||c.value?.el?.contains(R)||m()}function h(){const S=c.value?.el;if(!S)return;const R=u.value?.el,z=S.getBoundingClientRect(),W=4,L=8,O=R?.offsetHeight??0,U=R?.offsetWidth??0;let Z=z.bottom+W;Z+O>window.innerHeight-L&&(Z=Math.max(L,z.top-O-W));let ie=z.right-U;ie<L&&(ie=L),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(ie)}px`}}async function p(S){if(S.stopPropagation(),a.value){m();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",m),await yt(),h()}function m(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)}$n(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",m)});const k=oe(!1),y=oe(""),g=oe(null);async function v(){m(),k.value=!0,y.value=s.session.title,await yt();try{g.value?.focus(),g.value?.select()}catch{}}function b(){const S=y.value.trim();S&&i("rename",s.session.id,S),k.value=!1}function A(){k.value=!1}const I=oe(!1),T=oe(!1);async function M(){const S=await Jo(s.session.id);I.value=S,T.value=!S,setTimeout(()=>{I.value=!1,T.value=!1,m()},1500)}function $(){m(),i("fork",s.session.id)}function N(){m(),i("export",s.session.id)}function F(){m(),i("archive",s.session.id)}return t({closeMenu:m}),(S,R)=>(x(),E("div",{class:Ue(["se",{on:e.active}]),onClick:R[4]||(R[4]=z=>i("select",e.session.id))},[w("div",jP,[w("span",VP,[e.session.busy?(x(),Se(Us,{key:0,size:"sm"})):e.unread?(x(),E("span",KP)):ue("",!0)]),w("div",GP,[k.value?qn((x(),E("input",{key:0,ref_key:"renameInputRef",ref:g,"onUpdate:modelValue":R[0]||(R[0]=z=>y.value=z),class:"rename-input",onClick:R[1]||(R[1]=St(()=>{},["stop"])),onKeydown:[ur(St(b,["stop"]),["enter"]),ur(St(A,["stop"]),["esc"])],onBlur:b},null,40,YP)),[[Cs,y.value]]):(x(),E("span",{key:1,class:"t",onDblclick:St(v,["stop"])},B(e.session.title),33))]),ae(an,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ie(()=>[!k.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(x(),Se(qi,{key:0,variant:"info",size:"sm"},{default:Ie(()=>[ot(B(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ie(()=>[!k.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(x(),Se(qi,{key:0,variant:"warning",size:"sm"},{default:Ie(()=>[ot(B(C(o)("workspace.awaitingPermission")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(o)("workspace.abortedTitle")},{default:Ie(()=>[!k.value&&!e.session.busy&&e.session.pendingInteraction!=="question"&&e.session.pendingInteraction!=="approval"&&e.questionCount===0&&e.approvalCount===0&&(e.session.lastTurnReason==="cancelled"||e.session.lastTurnReason==="failed")?(x(),Se(qi,{key:0,variant:"danger",size:"sm"},{default:Ie(()=>[ot(B(C(o)("workspace.aborted")),1)]),_:1})):ue("",!0)]),_:1},8,["text"]),w("span",ZP,[w("span",XP,B(e.session.time),1),k.value?ue("",!0):(x(),Se(Xn,{key:0,ref_key:"kebabRef",ref:c,class:Ue(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:R[2]||(R[2]=St(z=>p(z),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(x(),Se(b1,{to:"body"},[a.value?(x(),Se(Ml,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:on(d.value),onClick:R[3]||(R[3]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{danger:T.value,onClick:M},{default:Ie(()=>[ae(Ge,{name:I.value?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+B(T.value?C(o)("sidebar.copyFailed"):I.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),ae(En,{separator:""}),ae(En,{onClick:v},{default:Ie(()=>[ae(Ge,{name:"pencil",size:"sm"}),ot(" "+B(C(o)("sidebar.rename")),1)]),_:1}),ae(En,{onClick:$},{default:Ie(()=>[ae(Ge,{name:"git-fork",size:"sm"}),ot(" "+B(C(o)("sidebar.fork")),1)]),_:1}),ae(En,{onClick:N},{default:Ie(()=>[ae(Ge,{name:"download",size:"sm"}),ot(" "+B(C(o)("sidebar.export")),1)]),_:1}),ae(En,{danger:"",onClick:F},{default:Ie(()=>[ae(Ge,{name:"archive",size:"sm"}),ot(" "+B(C(o)("sidebar.archive")),1)]),_:1}),ae(En,{separator:""}),w("div",QP,B(l.value),1)]),_:1},8,["style"])):ue("",!0)]))],2))}}),eH=dt(JP,[["__scopeId","data-v-c1a3c877"]]),tH={class:"gh-top"},nH={class:"gh-name"},oH=["inert"],sH=["disabled"],iH={class:"show-more-label"},rH={class:"show-more-label"},lH={key:2,class:"group-empty"},aH=Je({__name:"WorkspaceGroup",props:{group:{},activeWorkspaceId:{},activeId:{},renamingId:{},renameValue:{},renameInputRef:{},pendingBySession:{},unreadBySession:{},wsMenuOpenId:{},dragging:{type:Boolean},isCollapsed:{type:Function},isExpanded:{type:Function}},emits:["groupClick","groupContextmenu","toggleWsMenu","createInWorkspace","selectSession","renameSession","archiveSession","forkSession","exportSession","loadMore","toggleExpand","confirmRename","cancelRename","updateRenameValue","wsDragstart","wsDragend"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=D(()=>{if(o.isExpanded(o.group.workspace.id))return o.group.sessions;const f=o.group.sessions.slice(0,o.group.initialCount);if(o.activeId&&!f.some(h=>h.id===o.activeId)){const h=o.group.sessions.find(p=>p.id===o.activeId);if(h)return[...f,h]}return f}),l=D(()=>o.group.sessions.length>o.group.initialCount);function a(){return Math.max(0,o.group.workspace.sessionCount-o.group.sessions.length)}function c(){return o.group.sessions.length-o.group.initialCount}function u(f){o.renameInputRef.value=f instanceof HTMLInputElement?f:null}function d(f){f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",o.group.workspace.id),s("wsDragstart",o.group.workspace.id))}return(f,h)=>(x(),E("div",{class:Ue(["group",{dragging:e.dragging}])},[w("div",{class:Ue(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=St(p=>s("groupClick",e.group.workspace.id,p),["stop"])),onContextmenu:h[8]||(h[8]=p=>s("groupContextmenu",e.group.workspace,p)),onDragstart:d,onDragend:h[9]||(h[9]=p=>s("wsDragend"))},[w("div",tH,[e.isCollapsed(e.group.workspace.id)?(x(),Se(Ge,{key:0,class:"gh-folder",name:"folder-closed"})):(x(),Se(Ge,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(x(),Se(an,{key:2,text:e.group.workspace.root},{default:Ie(()=>[w("span",nH,B(e.group.workspace.name),1)]),_:1},8,["text"])):qn((x(),E("input",{key:3,ref:u,"onUpdate:modelValue":h[0]||(h[0]=p=>i.value=p),class:"gh-rename",type:"text",onKeydown:[h[1]||(h[1]=ur(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=ur(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=St(()=>{},["stop"]))},null,544)),[[Cs,i.value]]),e.renamingId!==e.group.workspace.id?(x(),E("div",{key:4,class:Ue(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[ae(Xn,{class:Ue(["gh-more",{open:e.wsMenuOpenId===e.group.workspace.id}]),size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":e.wsMenuOpenId===e.group.workspace.id,onClick:h[5]||(h[5]=St(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),ae(Xn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=St(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"chat-new"})]),_:1},8,["label"])],2)):ue("",!0)])],34),w("div",{class:Ue(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(x(!0),E(We,null,rt(r.value,p=>(x(),Se(eH,{key:p.id,session:p,active:p.id===e.activeId,"approval-count":e.pendingBySession[p.id]?.approvals??0,"question-count":e.pendingBySession[p.id]?.questions??0,unread:e.unreadBySession[p.id]??!1,onSelect:h[10]||(h[10]=m=>s("selectSession",m)),onRename:h[11]||(h[11]=(m,k)=>s("renameSession",m,k)),onArchive:h[12]||(h[12]=m=>s("archiveSession",m)),onFork:h[13]||(h[13]=m=>s("forkSession",m)),onExport:h[14]||(h[14]=m=>s("exportSession",m))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(x(),E("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=St(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",iH,B(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,sH)):ue("",!0),l.value?(x(),E("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=St(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=w("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),w("span",rH,B(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ue("",!0),e.group.sessions.length===0?(x(),E("div",lH,B(C(n)("sidebar.noSessions")),1)):ue("",!0)],10,oH)],2))}}),cH=dt(aH,[["__scopeId","data-v-cdac739a"]]),uH="kimi_desktop",dH="platform",L_="kimi-desktop",$_="kimi-desktop-platform";function fH(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(uH)?(sessionStorage.setItem(L_,"1"),e=!0):e=e||sessionStorage.getItem(L_)==="1";const o=n.get(dH);o?(sessionStorage.setItem($_,o),t=o):t=sessionStorage.getItem($_)}catch{}return{isDesktop:e,platform:t}}const vy=fH(),hH=vy.isDesktop,su=vy.isDesktop&&vy.platform==="darwin",pH={class:"ui-kbd"},mH=Je({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(x(),E("span",pH,[(x(!0),E(We,null,rt(e.keys,o=>(x(),E("kbd",{key:o,class:"ui-kbd__key"},B(o),1))),128))]))}}),Er=dt(mH,[["__scopeId","data-v-32292ed8"]]),gH=["disabled","aria-pressed"],vH=Je({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(x(),E("button",{key:0,class:Ue(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=o=>t.$emit("click",o))},[jn(t.$slots,"default",{},void 0,!0)],10,gH)):(x(),E("span",{key:1,class:Ue(["ui-pill",{"is-active":e.active}])},[jn(t.$slots,"default",{},void 0,!0)],2))}}),xp=dt(vH,[["__scopeId","data-v-317ace1a"]]),yH={class:"ch"},kH={class:"ch-brand"},bH={class:"ch-backend-ep"},xH={class:"btn-wrap"},wH={class:"search-input"},_H={key:0,class:"empty"},SH={class:"side-section-label"},CH={class:"side-section-title"},AH={class:"side-section-actions"},MH=["onDragover","onDrop"],EH={class:"side-footer"},TH={class:"section-menu-check"},NH={class:"section-menu-check"},IH={class:"section-menu-check"},LH={class:"backend-menu-name"},$H={class:"backend-menu-url"},FH=1e3,OH=Je({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},workspaceSortMode:{},backend:{default:"v1"},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220},collapsed:{type:Boolean,default:!1},dragging:{type:Boolean,default:!1}},emits:["select","create","createInWorkspace","selectWorkspace","addWorkspace","rename","archive","fork","export","renameWorkspace","deleteWorkspace","reorderWorkspaces","setWorkspaceSortMode","loadMoreSessions","loadAllSessions","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=$t(),o=!1,s=oe(null),i=D(()=>""),r=["default","multi"];function l(nt){const Be=s.value?.presets[nt]??"";return Be?uF(Be):""}function a(nt){const Be=s.value;return Be!==null&&Be.current===Be.presets[nt]}const c=e,u=t,d=oe(!1),f=m()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(nt){(nt.metaKey||nt.ctrlKey)&&nt.key.toLowerCase()==="k"&&(nt.preventDefault(),h())}Cn(()=>window.addEventListener("keydown",p)),ho(()=>window.removeEventListener("keydown",p));function m(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const nt=navigator.userAgentData;return nt?.platform==="macOS"||nt?.platform==="iOS"}const k=oe(!1);function y(nt){k.value=nt.target.scrollTop>0}const g=oe(new Set(Z$()));function v(nt){return g.value.has(nt)}function b(nt){const Be=new Set(g.value);Be.has(nt)?Be.delete(nt):Be.add(nt),g.value=Be,xg(Be)}function A(){const nt=new Set(c.groups.map(Be=>Be.workspace.id));g.value=nt,xg(nt)}function I(){const nt=new Set;g.value=nt,xg(nt)}const T=D(()=>c.groups.length>0&&c.groups.every(nt=>g.value.has(nt.workspace.id))),M=oe(new Set);function $(nt){return M.value.has(nt)}function N(nt){const Be=new Set(M.value);Be.has(nt)?Be.delete(nt):Be.add(nt),M.value=Be}function F(nt){if(!M.value.has(nt)){const Be=new Set(M.value);Be.add(nt),M.value=Be}u("loadMoreSessions",nt)}const S=oe(null),R=oe(null);function z(nt){S.value=nt}function W(){S.value=null,R.value=null}function L(nt){const Be=nt.currentTarget.getBoundingClientRect();return nt.clientY<Be.top+Be.height/2?"before":"after"}function O(nt,Be){S.value===null||S.value===Be||(nt.preventDefault(),nt.dataTransfer&&(nt.dataTransfer.dropEffect="move"),R.value={id:Be,position:L(nt)})}function U(nt){const Be=S.value,Bt=R.value?.id===nt?R.value.position:"before";if(R.value=null,S.value=null,!Be||Be===nt)return;const Yt=mF(c.groups.map(gn=>gn.workspace.id),Be,nt,Bt);u("reorderWorkspaces",Yt)}function Z(nt,Be){Be.target.closest(".gh-more, .gh-add")||b(nt)}function ie(nt){u("select",nt)}const q=oe(null),ee=oe(""),fe=oe(null);function ne(){return fe}function j(nt,Be){q.value=nt,ee.value=Be,yt().then(()=>fe.value?.focus())}function K(){const nt=q.value,Be=ee.value.trim();nt&&Be&&u("renameWorkspace",nt,Be),q.value=null}function ve(){q.value=null}function he(nt){ee.value=nt}const Ae=oe(!1),re=oe(null),Y=oe({}),Q=oe(null);function P(nt){Q.value?.el&&!Q.value.el.contains(nt.target)&&me()}function G(nt,Be){Be.preventDefault(),Be.stopPropagation(),re.value=nt,Y.value={top:`${Be.clientY}px`,left:`${Be.clientX}px`},Ae.value=!0,document.addEventListener("mousedown",P,!0)}function me(){Ae.value=!1,document.removeEventListener("mousedown",P,!0),re.value=null}function ye(){re.value&&Jo(re.value.root),me()}function de(){re.value&&j(re.value.id,re.value.name),me()}function V(){const nt=re.value;nt&&(me(),u("deleteWorkspace",nt.id))}const se=oe(null),pe=oe(null),ke=oe({}),Ne=oe(null);function qe(nt){const Be=nt.target;Be.closest(".gh-more")||Be.closest(".ws-menu")||xe()}async function be(nt,Be){if(se.value===nt.id){xe();return}const Bt=Be.currentTarget;pe.value=nt,se.value=nt.id,document.addEventListener("mousedown",qe),window.addEventListener("resize",xe),await yt();const Yt=Ne.value?.el,gn=Bt.getBoundingClientRect(),bn=4,nn=8,Vn=Yt?.offsetHeight??0,Kn=Yt?.offsetWidth??0;let Jn=gn.bottom+bn;Jn+Vn>window.innerHeight-nn&&(Jn=Math.max(nn,gn.top-Vn-bn));let Oo=gn.right-Kn;Oo<nn&&(Oo=nn),ke.value={top:`${Math.round(Jn)}px`,left:`${Math.round(Oo)}px`}}function xe(){se.value=null,pe.value=null,document.removeEventListener("mousedown",qe),window.removeEventListener("resize",xe)}function Ze(nt){Jo(nt.root),xe()}function tt(nt){j(nt.id,nt.name),xe()}function lt(nt){xe(),u("deleteWorkspace",nt.id)}const ut=oe(!1),mt=oe({}),Tt=oe(null);function wt(nt){const Be=nt.target;Be.closest(".side-section-kebab")||Be.closest(".section-menu")||en()}async function Ft(nt){if(ut.value){en();return}const Be=nt.currentTarget;ut.value=!0,document.addEventListener("mousedown",wt),window.addEventListener("resize",en),await yt();const Bt=Tt.value?.el,Yt=Be.getBoundingClientRect(),gn=4,bn=8,nn=Bt?.offsetHeight??0,Vn=Bt?.offsetWidth??0;let Kn=Yt.bottom+gn;Kn+nn>window.innerHeight-bn&&(Kn=Math.max(bn,Yt.top-nn-gn));let Jn=Yt.right-Vn;Jn<bn&&(Jn=bn),mt.value={top:`${Math.round(Kn)}px`,left:`${Math.round(Jn)}px`}}function en(){ut.value=!1,document.removeEventListener("mousedown",wt),window.removeEventListener("resize",en)}function Dn(nt){u("setWorkspaceSortMode",nt),en()}const Pt=oe(!1),kn=oe({}),hn=oe(null);function Kt(nt){const Be=nt.target;Be.closest(".ch-backend")||Be.closest(".backend-menu")||Gt()}async function Tn(nt){if(s.value===null)return;if(Pt.value){Gt();return}const Be=nt.currentTarget;Pt.value=!0,document.addEventListener("mousedown",Kt),window.addEventListener("resize",Gt),await yt();const Bt=hn.value?.el,Yt=Be.getBoundingClientRect(),gn=4,bn=8,nn=Bt?.offsetHeight??0;let Vn=Yt.bottom+gn;Vn+nn>window.innerHeight-bn&&(Vn=Math.max(bn,Yt.top-nn-gn)),kn.value={top:`${Math.round(Vn)}px`,left:`${Math.round(Math.max(bn,Yt.left))}px`}}function Gt(){Pt.value=!1,document.removeEventListener("mousedown",Kt),window.removeEventListener("resize",Gt)}async function Wt(nt){if(a(nt)){Gt();return}if(await cF(nt)===null){console.warn("[kimi-web] dev backend switch failed:",nt),Gt();return}window.location.reload()}ho(()=>{document.removeEventListener("mousedown",P,!0),document.removeEventListener("mousedown",qe),document.removeEventListener("mousedown",wt),document.removeEventListener("mousedown",Kt),window.removeEventListener("resize",xe),window.removeEventListener("resize",en),window.removeEventListener("resize",Gt)});const pn=oe(null);let so;function mn(){const nt=pn.value;nt&&(nt.classList.remove("blink-now"),nt.getBoundingClientRect(),nt.classList.add("blink-now"),clearTimeout(so),so=setTimeout(()=>nt.classList.remove("blink-now"),300))}const to=Hi(()=>vs(()=>import("./DesignSystemView-vhCcqafK.js"),__vite__mapDeps([0,1]))),vt=oe(!1);let Pn,Fn=!1;function Qn(nt){Fn=!1,clearTimeout(Pn),nt.currentTarget.setPointerCapture?.(nt.pointerId),Pn=setTimeout(()=>{Fn=!0,vt.value=!0},FH)}function sn(nt){clearTimeout(Pn);const Be=nt.currentTarget;Be.hasPointerCapture?.(nt.pointerId)&&Be.releasePointerCapture(nt.pointerId)}function es(){if(Fn){Fn=!1;return}mn()}return ho(()=>{clearTimeout(Pn)}),(nt,Be)=>(x(),E("aside",{class:Ue(["side",{"macos-desktop":C(su),collapsed:e.collapsed,"no-anim":e.dragging}]),style:on({width:e.collapsed?"0px":e.colWidth+"px"})},[w("div",{class:"col",style:on({width:e.colWidth+"px"})},[w("div",yH,[w("div",kH,[C(su)?ue("",!0):(x(),E(We,{key:0},[(x(),E("svg",{ref_key:"logoRef",ref:pn,class:Ue(["ch-logo",{"is-dev":C(o)}]),viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onClick:es,onPointerdown:Qn,onPointerup:sn,onPointercancel:sn},[...Be[22]||(Be[22]=[Pk('<defs data-v-1b04ce05><mask id="kimiEyes" maskUnits="userSpaceOnUse" data-v-1b04ce05><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-1b04ce05></rect><g class="ch-eyes" fill="#000" data-v-1b04ce05><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-1b04ce05></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" data-v-1b04ce05></rect>',2)])],34)),Be[23]||(Be[23]=w("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(x(),Se(xp,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Tn},{default:Ie(()=>[w("span",{class:Ue(["ch-backend-kind",`is-${e.backend}`])},B(e.backend),3),w("span",bH," · "+B(i.value),1),s.value!==null?(x(),Se(Ge,{key:0,name:"chevron-down",size:"sm"})):ue("",!0)]),_:1},8,["clickable","title"])):ue("",!0)],64))]),C(su)?ue("",!0):(x(),Se(Xn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Be[0]||(Be[0]=St(Bt=>u("collapse"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"panel-collapse"})]),_:1},8,["label"]))]),w("div",xH,[w("button",{class:"btn-new-chat",type:"button",onClick:Be[1]||(Be[1]=St(Bt=>u("create"),["stop"]))},[ae(Ge,{name:"chat-new"}),w("span",null,B(C(n)("sidebar.newChat")),1)]),ue("",!0)]),w("div",{class:Ue(["search-wrap",{"search-wrap--scrolled":k.value}])},[w("button",{class:"search",type:"button",onClick:h},[ae(Ge,{class:"search-icon",name:"search"}),w("span",wH,B(C(n)("sidebar.search")),1),ae(Er,{keys:C(f)},null,8,["keys"])])],2),w("div",{class:"sessions",onScroll:y},[e.groups.length===0?(x(),E("div",_H,B(C(n)("workspace.noWorkspace")),1)):(x(),E(We,{key:1},[w("div",SH,[w("span",CH,B(C(n)("sidebar.workspaces")),1),w("div",AH,[ae(Xn,{class:"side-section-toggle",size:"sm",label:T.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Be[3]||(Be[3]=St(Bt=>T.value?I():A(),["stop"]))},{default:Ie(()=>[T.value?(x(),Se(Ge,{key:0,name:"expand"})):(x(),Se(Ge,{key:1,name:"collapse"}))]),_:1},8,["label"]),ae(Xn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":ut.value,onClick:Be[4]||(Be[4]=St(Bt=>Ft(Bt),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(x(!0),E(We,null,rt(e.groups,Bt=>(x(),E("div",{key:Bt.workspace.id,class:Ue(["ws-drop-target",{"drop-before":R.value?.id===Bt.workspace.id&&R.value.position==="before","drop-after":R.value?.id===Bt.workspace.id&&R.value.position==="after"}]),onDragover:Yt=>O(Yt,Bt.workspace.id),onDrop:Yt=>U(Bt.workspace.id)},[ae(cH,{group:Bt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":q.value,"rename-value":ee.value,"rename-input-ref":ne(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":se.value,dragging:S.value===Bt.workspace.id,"is-collapsed":v,"is-expanded":$,onGroupClick:Z,onGroupContextmenu:G,onToggleWsMenu:be,onCreateInWorkspace:Be[5]||(Be[5]=Yt=>u("createInWorkspace",Yt)),onSelectSession:ie,onRenameSession:Be[6]||(Be[6]=(Yt,gn)=>u("rename",Yt,gn)),onArchiveSession:Be[7]||(Be[7]=Yt=>u("archive",Yt)),onForkSession:Be[8]||(Be[8]=Yt=>u("fork",Yt)),onExportSession:Be[9]||(Be[9]=Yt=>u("export",Yt)),onLoadMore:F,onToggleExpand:N,onConfirmRename:K,onCancelRename:ve,onUpdateRenameValue:he,onWsDragstart:z,onWsDragend:W},null,8,["group","active-workspace-id","active-id","renaming-id","rename-value","rename-input-ref","pending-by-session","unread-by-session","ws-menu-open-id","dragging"])],42,MH))),128))],64))],32),w("div",EH,[w("button",{class:"btn-settings",type:"button",onClick:Be[10]||(Be[10]=St(Bt=>u("openSettings"),["stop"]))},[ae(Ge,{name:"settings"}),w("span",null,B(C(n)("settings.title")),1)])])],4),Ae.value?(x(),Se(Ml,{key:0,ref_key:"ghMenuRef",ref:Q,class:"gh-menu",style:on(Y.value),onClick:Be[11]||(Be[11]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{onClick:ye},{default:Ie(()=>[ot(B(C(n)("sidebar.copyPath")),1)]),_:1}),ae(En,{onClick:de},{default:Ie(()=>[ot(B(C(n)("sidebar.rename")),1)]),_:1}),ae(En,{danger:"",onClick:V},{default:Ie(()=>[ot(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),se.value!==null&&pe.value?(x(),Se(Ml,{key:1,ref_key:"wsMenuRef",ref:Ne,class:"ws-menu",style:on(ke.value),onClick:Be[15]||(Be[15]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{onClick:Be[12]||(Be[12]=Bt=>Ze(pe.value))},{default:Ie(()=>[ot(B(C(n)("sidebar.copyPath")),1)]),_:1}),ae(En,{separator:""}),ae(En,{onClick:Be[13]||(Be[13]=Bt=>tt(pe.value))},{default:Ie(()=>[ot(B(C(n)("sidebar.rename")),1)]),_:1}),ae(En,{separator:""}),ae(En,{danger:"",onClick:Be[14]||(Be[14]=Bt=>lt(pe.value))},{default:Ie(()=>[ot(B(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),ut.value?(x(),Se(Ml,{key:2,ref_key:"sectionMenuRef",ref:Tt,class:"section-menu",style:on(mt.value),onClick:Be[18]||(Be[18]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{onClick:Be[16]||(Be[16]=Bt=>Dn("manual"))},{default:Ie(()=>[w("span",TH,[e.workspaceSortMode==="manual"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),ot(" "+B(C(n)("sidebar.sortManual")),1)]),_:1}),ae(En,{onClick:Be[17]||(Be[17]=Bt=>Dn("recent"))},{default:Ie(()=>[w("span",NH,[e.workspaceSortMode==="recent"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),ot(" "+B(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ue("",!0),Pt.value?(x(),Se(Ml,{key:3,ref_key:"backendMenuRef",ref:hn,class:"backend-menu",style:on(kn.value),onClick:Be[19]||(Be[19]=St(()=>{},["stop"]))},{default:Ie(()=>[(x(),E(We,null,rt(r,Bt=>ae(En,{key:Bt,onClick:Yt=>Wt(Bt)},{default:Ie(()=>[w("span",IH,[a(Bt)?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",LH,B(Bt),1),w("span",$H,B(l(Bt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):ue("",!0),d.value?(x(),Se(FP,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:ie,onClose:Be[20]||(Be[20]=Bt=>d.value=!1)},null,8,["sessions","active-id"])):ue("",!0),(x(),Se(b1,{to:"body"},[vt.value?(x(),Se(C(to),{key:0,onClose:Be[21]||(Be[21]=Bt=>vt.value=!1)})):ue("",!0)]))],6))}}),BH=dt(OH,[["__scopeId","data-v-1b04ce05"]]);function RH(e){try{const t=yo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function DH(e,t){try{To(e,String(t))}catch{}}function PH(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(y){return Number.isFinite(y)?Math.min(wA(s),Math.max(o,Math.round(y))):n}const l=oe(r(RH(t)??n)),a=oe(!1);function c(y){const g=r(y);l.value=g,DH(t,g)}let u=0,d=0,f=null,h=-1;function p(y){if(!a.value)return;const g=y.clientX-u;c(d+(i?-g:g))}function m(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),f){try{f.releasePointerCapture(h)}catch{}f.removeEventListener("pointermove",p),f.removeEventListener("pointerup",m),f.removeEventListener("pointercancel",m)}f=null,h=-1}}function k(y){y.preventDefault(),a.value=!0,u=y.clientX,d=r(l.value),f=y.currentTarget,h=y.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{f.setPointerCapture(h)}catch{}f.addEventListener("pointermove",p),f.addEventListener("pointerup",m),f.addEventListener("pointercancel",m)}return ho(m),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:k}}const HH=["aria-label"],WH=Je({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),{width:i,dragging:r,onPointerDown:l}=PH({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),et(i,a=>o("update:width",a)),et(r,a=>o("update:dragging",a)),(a,c)=>(x(),E("div",{class:Ue(["rh",{dragging:C(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??C(s)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>C(l)&&C(l)(...u))},[...c[1]||(c[1]=[w("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,HH))}}),F_=dt(WH,[["__scopeId","data-v-48fd0a6d"]]),zH={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},UH={authBannerMessage:"Not signed in · Sign in to Kimi Code to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to Kimi Code",authPageMessage:"Connect your Kimi Code account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",connectRetrying:"Cannot reach the server — retrying…",internalBuildBanner:"Internal testing only"},qH={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"Workspaces",sortWorkspaces:"Sort workspaces",sortManual:"Manual",sortRecent:"Last edited",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive this session? You can restore it later from Settings.",options:"Options",rename:"Rename",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",fork:"Fork session",export:"Export session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",showMore:"Load {count} more conversations",showLess:"Show less",showAll:"Show {count} more conversations",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchNoResults:"No matching sessions"},jH={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableConfirm:"Enable swarm mode? The agent will run multiple sub-agents in parallel.",goalStartConfirm:'Start goal: "{objective}"? The agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",recentLabel:"Recent folders",cancel:"Cancel",addFailed:"Couldn't open this folder. Check the path and try again.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search subfolders, or paste an absolute path…",searching:"Searching…",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',checkingPath:"Checking path…",pathPickHint:"Path not found — did you mean:",noPathMatch:"Path not found — no matching folders under {parent}",badParent:"Parent directory does not exist: {parent}",pathFollowHint:'Folder located — press Enter or "Open this folder" to add it.',degradedPlaceholder:"Type an absolute path, press Enter to add…",degradedHint:"File browsing is unavailable — type an absolute path and press Enter to add.",attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},VH={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",everyMinute:"Every minute",everyNMinutes:"Every {n} minutes",everyHour:"Every hour",everyNHours:"Every {n} hours",dailyAt:"Daily at {time}",weekdaysAt:"Weekdays at {time}",expand:"Show more",collapse:"Show less"}},KH={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planDesc:"Have the agent make a plan before changing files",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",goalLabel:"Goal",goalDesc:"Track one objective until it is complete",swarmLabel:"Swarm",swarmDesc:"Run parallel agents for broader exploration",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",thinkingOn:"On",thinkingOff:"Off",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},GH={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",starting:"Sending…",queueAutoDrain:"sends automatically when the current turn ends",queueNext:"Up next",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachmentFile:"File",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachFile:"Attach file",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}"},YH={title:"Sign in to Kimi Code",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection to the daemon",pollErrorHint:"Authorization polling failed repeatedly. Check the kimi-code process and try again."},ZH={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},XH={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size} ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},QH={justNow:"just now"},JH={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit"},eW={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},tW={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",collapse:"Collapse",expand:"Expand"},nW={panelTitle:"Thinking",close:"Close"},oW={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},sW={},iW={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",videoNoPreview:"Video file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},rW={searching:"Searching…",noMatch:"No matches"},lW={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that Kimi daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that Kimi daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},aW={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve tool actions; the agent may still ask questions"},auto:{desc:"Fully autonomous — the agent never asks questions"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it."},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},cW={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{title:"{count} tool call | {count} tool calls",running:"running",error:"failed",done:"done"},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)"}},uW={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},dW={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",groupSession:"Current session",groupApp:"App preferences",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"fully autonomous, never asks",permYoloSub:"auto-approve tools, may still ask",planModeSub:"Plan mode",swarmModeSub:"Swarm mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back"},fW={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},hW={preview:"预览",confirm:"确认",cancel:"取消"},pW={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},mW={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"工作区",sortWorkspaces:"工作区排序",sortManual:"手动排序",sortRecent:"按最后编辑时间",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"确认归档会话?归档后可以从「设置」中恢复",options:"选项",rename:"重命名",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",fork:"分叉会话",export:"导出会话",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",showMore:"加载更多 {count} 个对话",showLess:"收起",showAll:"展开剩余 {count} 个对话",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchNoResults:"没有匹配的会话"},gW={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableConfirm:"启用 swarm 模式?Agent 将并行运行多个子 agent。",goalStartConfirm:"启动 goal:「{objective}」?Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",recentLabel:"最近的文件夹",cancel:"取消",addFailed:"无法打开此文件夹,请检查路径后重试。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"模糊搜索子文件夹,或粘贴绝对路径…",searching:"搜索中…",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',checkingPath:"检查路径…",pathPickHint:"此路径不存在,你是不是想找:",noPathMatch:"此路径不存在,「{parent}」下没有匹配的文件夹",badParent:"上级目录不存在:{parent}",pathFollowHint:'已定位到目标文件夹,按回车或点击"打开此文件夹"完成添加。',degradedPlaceholder:"输入绝对路径,回车添加…",degradedHint:"守护进程无法浏览文件系统,请直接输入绝对路径后回车添加。",attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},vW={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"撤销上一条消息?",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",everyMinute:"每分钟",everyNMinutes:"每 {n} 分钟",everyHour:"每小时",everyNHours:"每 {n} 小时",dailyAt:"每天 {time}",weekdaysAt:"工作日 {time}",expand:"展开",collapse:"收起"}},yW={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,智能体自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planDesc:"先让智能体梳理计划,再修改文件",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",goalLabel:"目标",goalDesc:"持续跟踪一个目标,直到任务完成",swarmLabel:"Swarm",swarmDesc:"并行运行多个智能体,适合大范围探索",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",thinkingOn:"开",thinkingOff:"关",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建对话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},kW={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",starting:"正在发送…",queueAutoDrain:"当前回合结束后自动逐条发送",queueNext:"下一条",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachmentFile:"文件",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachFile:"添加附件",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}"},bW={title:"登录 Kimi Code",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"与 daemon 的连接已断开",pollErrorHint:"授权轮询连续失败,请检查 kimi-code 进程后重试"},xW={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},wW={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},_W={justNow:"刚刚"},SW={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出"},CW={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},AW={tag:"任务",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",collapse:"折叠",expand:"展开"},MW={panelTitle:"思考过程",close:"关闭"},EW={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},TW={},NW={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",videoNoPreview:"视频文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},IW={searching:"搜索中…",noMatch:"无匹配"},LW={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 Kimi daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},$W={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准工具操作,Agent 仍可能提问"},auto:{desc:"完全自主,Agent 不再提问"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},FW={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{title:"{count} 个工具调用",running:"运行中",error:"有失败",done:"已完成"},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)"}},OW={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},BW={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},RW={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},DW={title:"Welcome to Kimi Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},PW={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},HW={title:"Settings",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",advanced:"Advanced",archived:"Archived"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyOnQuestion:"Notify when a question needs an answer",notifyOnApproval:"Notify when a tool needs approval",soundOnComplete:"Play a sound when a turn completes, needs an answer, or needs approval",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",providers:"Providers",providersHint:"Add, remove, or refresh providers",manageProviders:"Manage",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",backend:"Backend",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",conversationToc:"Show conversation outline",conversationTocHint:"Show a clickable outline in the right margin to jump between messages",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},WW={title:"设置",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",advanced:"高级",archived:"已归档"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyOnQuestion:"待回答时通知",notifyOnApproval:"待审批时通知",soundOnComplete:"会话完成、待回答或待审批时播放提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",providers:"提供商",providersHint:"添加、删除或刷新提供商",manageProviders:"管理",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",backend:"后端",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",conversationToc:"显示对话目录",conversationTocHint:"在右侧显示可点击跳转的对话目录",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},zW={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",exportSession:"Export session"},UW={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",exportSession:"导出会话"},qW={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},jW={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},VW={en:{common:zH,app:UH,sidebar:qH,workspace:jH,conversation:VH,status:KH,composer:GH,login:YH,providers:ZH,model:XH,sessions:QH,approval:JH,question:eW,tasks:tW,thinking:nW,diff:oW,fileTree:sW,filePreview:iW,mention:rW,warnings:lW,commands:aW,tools:cW,layout:uW,mobile:dW,theme:fW,onboarding:DW,settings:HW,header:zW,sideChat:qW},zh:{common:hW,app:pW,sidebar:mW,workspace:gW,conversation:vW,status:yW,composer:kW,login:bW,providers:xW,model:wW,sessions:_W,approval:SW,question:CW,tasks:AW,thinking:MW,diff:EW,fileTree:TW,filePreview:NW,mention:IW,warnings:LW,commands:$W,tools:FW,layout:OW,mobile:BW,theme:RW,onboarding:PW,settings:WW,header:UW,sideChat:jW}},f6=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function KW(){const e=yo(Dt.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const On=D$({legacy:!1,locale:KW(),fallbackLocale:"en",messages:VW});function h6(e){On.global.locale.value=e,To(Dt.locale,e)}const is=On.global.t,GW={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update"},YW={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal"};function Ja(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return YW[t]??t}function ec(e){const t=GW[Ja(e)];return t?is(t):e}const ZW={read:"file-text",bash:"terminal",edit:"pencil",multi_edit:"pencil",write:"file-plus",grep:"search",search:"search",glob:"glob",ls:"folder",web_fetch:"globe",todo:"check-list",task:"sparkles",agentswarm:"git-pull-request",askuserquestion:"help-circle",creategoal:"target",getgoal:"target",setgoalbudget:"target",updategoal:"target",croncreate:"calendar-schedule",cronlist:"calendar-todo",crondelete:"calendar-close"};function E1(e){const t=Ja(e);let n=ZW[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),Rc(n,"sm")}const p6=80;function XW(e,t=p6){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function QW(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function JW(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function rn(e){return typeof e=="string"&&e.length>0?e:void 0}function yl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ez(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function _g(e){return rn(e.path)??rn(e.file_path)??rn(e.filePath)??rn(e.filename)}const tz={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function nz(e){const t=rn(e);if(!t)return;const n=tz[t];return n?is(n):t}function oz(e){const t=yl(e.value),n=rn(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return is("tools.goal.turns",{value:t});case"tokens":return is("tools.goal.tokens",{value:t});case"milliseconds":return is("tools.goal.milliseconds",{value:t});case"seconds":return is("tools.goal.seconds",{value:t});case"minutes":return is("tools.goal.minutes",{value:t});case"hours":return is("tools.goal.hours",{value:t});default:return is("tools.goal.budget",{value:t,unit:n})}}const sz=64;function ff(e,t,n=!1){const o=(s,i=p6)=>n?s.trim():XW(s,i);try{const s=JW(t);if(!n&&QW(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Ja(e)){case"read":{const r=_g(s);if(!r)return i();const l=yl(s.offset)??yl(s.line_start)??yl(s.start_line),a=yl(s.limit)??yl(s.length),c=yl(s.line_end)??yl(s.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return o(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=_g(s);return r?o(`${r} ${is("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=_g(s);return r?o(r):i()}case"bash":{const r=rn(s.command)??rn(s.cmd)??rn(s.script);return r?o(r,sz):i()}case"grep":case"search":{const r=rn(s.pattern)??rn(s.query)??rn(s.regex),l=rn(s.path)??rn(s.glob)??rn(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=rn(s.pattern)??rn(s.glob)??rn(s.query),l=rn(s.path)??rn(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):rn(s.path)?o(rn(s.path)):i()}case"ls":{const r=rn(s.path)??rn(s.dir)??rn(s.directory)??rn(s.cwd);return r?o(r):i()}case"web_fetch":{const r=rn(s.url)??rn(s.uri);return r?o(ez(r)):i()}case"todo":case"task":{const r=rn(s.description)??rn(s.title)??rn(s.prompt)??rn(s.name)??rn(s.subagent_type);if(r)return o(r);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(is("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=rn(s.objective),l=rn(s.completionCriterion);return r&&l?o(is("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=oz(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=nz(s.status);return r?o(is("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function iz(e){try{switch(Ja(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return is("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const o=n.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),o=t.match(/[-−](\d+)/);if(n||o)return`${n?`+${n[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(e.status!=="error")return is("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?is("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const rz=Je({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(s){switch(s){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"danger":return"error";case"running":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const o=D(()=>n(t.status));return(s,i)=>(x(),E("span",{class:Ue(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),hf=dt(rz,[["__scopeId","data-v-e36198e5"]]),lz=["innerHTML"],az={class:"bh-text"},cz={class:"a"},uz={key:0,class:"p"},dz={class:"rt"},fz=["aria-label"],hz={key:0,class:"tm"},pz=["inert"],mz={class:"bb-pad"},gz=Je({__name:"ToolRow",props:{status:{},icon:{default:""},name:{},arg:{default:""},time:{default:""},open:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["toggle"],setup(e,{emit:t}){const n=t,o=Jt("pinScroll",()=>{}),s=oe(null);function i(){n("toggle");const r=s.value;r&&yt(()=>o(r))}return(r,l)=>(x(),E("div",{class:Ue(["box",{open:e.open,stacked:e.stacked,err:e.status==="error","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[w("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(x(),E("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,lz)):ue("",!0),w("span",az,[w("span",cz,B(e.name),1),ae(an,{text:e.arg},{default:Ie(()=>[e.arg?(x(),E("span",uz,B(e.arg),1)):ue("",!0)]),_:1},8,["text"])]),w("span",dz,[w("span",{class:Ue(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):e.status==="error"?(x(),Se(Ge,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(x(),Se(hf,{key:2,status:"suspended"})):(x(),Se(hf,{key:3,status:"running"}))],10,fz),jn(r.$slots,"trailing"),e.time?(x(),E("span",hz,B(e.time),1)):ue("",!0)]),e.expandable?(x(),Se(Ge,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ue("",!0)],512),w("div",{class:Ue(["bb",{open:e.open}]),inert:!e.open},[w("div",mz,[jn(r.$slots,"default")])],10,pz)],2))}}),T1=dt(gz,[["__scopeId","data-v-fef8aad2"]]),vz={key:0,class:"at-type"},yz={key:1,class:"at-task"},kz={key:2,class:"bb-code"},bz=Je({__name:"AgentTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(y){if(!y)return{};try{const g=JSON.parse(y);return{description:typeof g.description=="string"?g.description:void 0,subagentType:typeof g.subagent_type=="string"?g.subagent_type:void 0,prompt:typeof g.prompt=="string"?g.prompt:void 0}}catch{return{}}}const r=D(()=>i(o.tool.arg)),l=D(()=>!!o.tool.output&&o.tool.output.length>0),a=D(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=oe(o.tool.defaultExpanded===!0&&a.value),u=D(()=>o.tool.status),d=D(()=>ec(o.tool.name)),f=D(()=>E1(o.tool.name)),h=D(()=>r.value.description||r.value.subagentType||""),p=Jt("resolveAgentTaskId"),m=D(()=>p?p(o.tool.id)!==void 0:!0);function k(){a.value&&(c.value=!c.value)}return et(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(y,g)=>(x(),Se(T1,{status:u.value,icon:f.value,name:d.value,arg:c.value?"":h.value,time:e.tool.timing,open:c.value,expandable:a.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:k},{trailing:Ie(()=>[m.value?(x(),E("button",{key:0,type:"button",class:"at-open",onClick:g[0]||(g[0]=St(v=>s("openAgent",e.tool.id),["stop"]))},B(C(n)("tasks.openDetail")),1)):ue("",!0)]),default:Ie(()=>[r.value.subagentType?(x(),E("div",vz,B(r.value.subagentType),1)):ue("",!0),r.value.prompt?(x(),E("div",yz,B(r.value.prompt),1)):ue("",!0),l.value?(x(),E("div",kz,[(x(!0),E(We,null,rt(e.tool.output??[],(v,b)=>(x(),E("div",{key:b},B(v),1))),128))])):ue("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),xz=dt(bz,[["__scopeId","data-v-14ef8750"]]);function wz(e){if(!e)return[];try{const n=JSON.parse(e).questions;if(!Array.isArray(n))return[];const o=[];for(const s of n){if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.options)?i.options.map(l=>{const a=l&&typeof l=="object"?l:{};return{label:typeof a.label=="string"?a.label:"",description:typeof a.description=="string"?a.description:""}}):[];o.push({question:typeof i.question=="string"?i.question:"",header:typeof i.header=="string"?i.header:"",options:r,multiSelect:i.multi_select===!0})}return o}catch{return[]}}const Dh={recognized:!1,answers:{},note:""};function _z(e){const t=e?.[0];if(!t)return Dh;let n;try{n=JSON.parse(t)}catch{return Dh}if(!n||typeof n!="object"||Array.isArray(n))return Dh;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Dh;const s={};for(const[i,r]of Object.entries(o))typeof r=="string"?s[i]=r:r===!0&&(s[i]=!0);return{recognized:!0,answers:s,note:typeof n.note=="string"?n.note:""}}function Sz(e,t,n){return e[t]??e[`q_${n}`]}const Cz=/^opt_\d+_(\d+)$/;function Az(e,t=[]){if(e===void 0)return{selected:new Set,otherText:"",indeterminate:!1};if(e===!0)return{selected:new Set,otherText:"",indeterminate:!0};const n=new Map;t.forEach((r,l)=>{r.label.length>0&&!n.has(r.label)&&n.set(r.label,l)});const o=n.get(e);if(o!==void 0)return{selected:new Set([o]),otherText:"",indeterminate:!1};const s=new Set,i=[];for(const r of e.split(",")){const l=r.trim(),a=n.get(l);if(a!==void 0){s.add(a);continue}const c=Cz.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const Mz={key:0,class:"chip"},Ez={key:0,class:"au-dismissed"},Tz={key:1,class:"au-list"},Nz={class:"au-q"},Iz={key:0,class:"au-hdr"},Lz={class:"au-qtext"},$z={class:"au-opts"},Fz={class:"au-glyph"},Oz={class:"au-label"},Bz={key:0,class:"au-desc"},Rz={key:0,class:"au-opt sel"},Dz={class:"au-glyph"},Pz={class:"au-label"},Hz={key:1,class:"au-opt sel"},Wz={class:"au-label"},zz={key:2,class:"au-raw"},Uz=80,qz=Je({__name:"AskUserTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,{t:n}=$t();function o(T,M=Uz){const $=T.trim();return $.length>M?$.slice(0,M-1)+"…":$}const s=D(()=>wz(t.tool.arg)),i=D(()=>_z(t.tool.output)),r=D(()=>i.value.recognized),l=D(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=D(()=>s.value.map((T,M)=>Az(Sz(i.value.answers,T.question,M),T.options))),c=D(()=>Object.keys(i.value.answers).length);function u(T,M){return a.value[T]?.selected.has(M)??!1}function d(T){return a.value[T]?.otherText??""}function f(T){return a.value[T]?.indeterminate??!1}function h(T,M){return T?M?"■":"□":M?"●":"○"}const p=D(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const T=s.value[0]?.question??"",M=o(T);return s.value.length<=1?M:`${M} ${n("tools.ask.more",{count:s.value.length-1})}`}),m=D(()=>r.value?l.value?n("tools.ask.dismissed"):c.value===0?"":c.value===1?n("tools.ask.answer",{count:1}):n("tools.ask.answers",{count:c.value}):""),k=D(()=>!!t.tool.output&&t.tool.output.length>0),y=D(()=>r.value&&(s.value.length>0||l.value)||k.value),g=oe(t.tool.defaultExpanded===!0&&y.value),v=D(()=>t.tool.status),b=D(()=>ec(t.tool.name)),A=D(()=>E1(t.tool.name));function I(){y.value&&(g.value=!g.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&y.value&&(g.value=!0)}),(T,M)=>(x(),Se(T1,{status:v.value,icon:A.value,name:b.value,arg:g.value?"":p.value,time:e.tool.timing,open:g.value,expandable:y.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:I},{trailing:Ie(()=>[m.value?(x(),E("span",Mz,B(m.value),1)):ue("",!0)]),default:Ie(()=>[l.value?(x(),E("div",Ez,B(i.value.note),1)):r.value?(x(),E("div",Tz,[(x(!0),E(We,null,rt(s.value,($,N)=>(x(),E("div",{key:N,class:"au-block"},[w("div",Nz,[$.header?(x(),E("span",Iz,B($.header),1)):ue("",!0),w("span",Lz,B($.question),1)]),w("div",$z,[(x(!0),E(We,null,rt($.options,(F,S)=>(x(),E("div",{key:S,class:Ue(["au-opt",{sel:u(N,S)}])},[w("span",Fz,B(h($.multiSelect,u(N,S))),1),w("span",Oz,B(F.label),1),F.description?(x(),E("span",Bz,B(F.description),1)):ue("",!0)],2))),128)),d(N)?(x(),E("div",Rz,[w("span",Dz,B(h($.multiSelect,!0)),1),w("span",Pz,B(d(N)),1)])):ue("",!0),f(N)?(x(),E("div",Hz,[M[0]||(M[0]=w("span",{class:"au-glyph"},"●",-1)),w("span",Wz,B(C(n)("tools.ask.answered")),1)])):ue("",!0)])]))),128))])):(x(),E("div",zz,[(x(!0),E(We,null,rt(e.tool.output??[],($,N)=>(x(),E("div",{key:N},B($),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),jz=dt(qz,[["__scopeId","data-v-a9a0f259"]]),Vz=1e6,O_=5e3;function B_(e){if(e==="")return[];const t=e.split(`
68
+ `);return t.at(-1)===""&&t.pop(),t}function Kz(e,t){const n=B_(e),o=B_(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>O_||i>O_||(s+1)*(i+1)>Vz)return null;const r=Array.from({length:s+1},()=>Array.from({length:i+1},()=>0));for(let h=1;h<=s;h++)for(let p=1;p<=i;p++)r[h][p]=n[h-1]===o[p-1]?r[h-1][p-1]+1:Math.max(r[h-1][p],r[h][p-1]);const l=[];let a=s,c=i;for(;a>0||c>0;)a>0&&c>0&&n[a-1]===o[c-1]?(l.push({type:"context",text:n[a-1]}),a--,c--):c>0&&(a===0||r[a][c-1]>=r[a-1][c])?(l.push({type:"add",text:o[c-1]}),c--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const u=[];let d=1,f=1;for(const h of l)h.type==="context"?(u.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(u.push({type:"add",text:h.text,newNo:f}),f++):(u.push({type:"del",text:h.text,oldNo:d}),d++);return u}function Gz(e){let t=0,n=0;for(const o of e)o.type==="add"?t++:o.type==="del"&&n++;return{added:t,removed:n}}function m6(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function g6(e){const t=Ja(e.name);if(t!=="edit"&&t!=="write")return null;const n=m6(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const o=typeof n.old_string=="string"?n.old_string:void 0,s=typeof n.new_string=="string"?n.new_string:void 0;return o===void 0||s===void 0?null:Kz(o,s)}return null}function Yz(e){const t=m6(e);return t&&typeof t.path=="string"?t.path:void 0}function Zz(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const Xz={key:0,class:"bb-empty"},R_=50,Qz=Je({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=D(()=>t.lines??[]),o=D(()=>n.value.length>R_),s={"--tool-output-visible-lines":String(R_)};return(i,r)=>(x(),E("div",{class:Ue(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(x(),E("div",Xz,B(e.emptyText),1)):ue("",!0),(x(!0),E(We,null,rt(n.value,(l,a)=>(x(),E("div",{key:a},B(l),1))),128))],2))}}),v6=dt(Qz,[["__scopeId","data-v-262bbea0"]]),Jz={key:0,class:"chip"},eU={key:0,class:"bb-summary"},tU=Je({__name:"EditTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status),i=D(()=>ec(n.tool.name)),r=D(()=>E1(n.tool.name)),l=D(()=>ff(n.tool.name,n.tool.arg)),a=D(()=>ff(n.tool.name,n.tool.arg,!0)),c=D(()=>g6(n.tool)),u=D(()=>{const m=c.value;if(m&&n.tool.status!=="error"){const{added:k,removed:y}=Gz(m);if(k||y)return`+${k} −${y}`}return""}),d=D(()=>!!n.tool.output&&n.tool.output.length>0),f=oe(!1),h=D(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(m,k)=>(x(),Se(T1,{status:s.value,icon:r.value,name:i.value,arg:f.value?"":l.value,time:e.tool.timing,open:f.value,expandable:h.value||e.toolDiffPanel,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:p},{trailing:Ie(()=>[u.value?(x(),E("span",Jz,B(u.value),1)):ue("",!0)]),default:Ie(()=>[a.value?(x(),E("div",eU,B(a.value),1)):ue("",!0),ae(v6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),nU=dt(tU,[["__scopeId","data-v-74e1da99"]]),oU={key:0,class:"chip"},sU={key:0,class:"bb-summary"},iU=Je({__name:"GenericTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff"],setup(e){const t=e,n=D(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=D(()=>!!t.tool.output&&t.tool.output.length>0),s=D(()=>o.value||n.value),i=oe(t.tool.defaultExpanded===!0&&s.value),r=D(()=>t.tool.status),l=D(()=>ec(t.tool.name)),a=D(()=>E1(t.tool.name)),c=D(()=>ff(t.tool.name,t.tool.arg)),u=D(()=>ff(t.tool.name,t.tool.arg,!0)),d=D(()=>iz({name:t.tool.name,arg:t.tool.arg,output:t.tool.output,timing:t.tool.timing,status:t.tool.status}));function f(){s.value&&(i.value=!i.value)}return et(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(x(),Se(T1,{status:r.value,icon:a.value,name:l.value,arg:i.value?"":c.value,time:e.tool.name!=="bash"?e.tool.timing:"",open:i.value,expandable:s.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:f},{trailing:Ie(()=>[d.value?(x(),E("span",oU,B(d.value),1)):ue("",!0)]),default:Ie(()=>[u.value?(x(),E("div",sU,B(u.value),1)):ue("",!0),ae(v6,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),rU=dt(iU,[["__scopeId","data-v-aa4edcb0"]]),lU={class:"media-title"},aU=["src","alt"],cU=["src"],uU=["src"],dU=Je({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.tool.status==="ok"?n.tool.media:void 0);function i(c){return c.split(/[\\/]+/).pop()||c}function r(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`}const l=D(()=>{const c=s.value;if(!c)return"";const u=[c.path?i(c.path):n.tool.name];return c.mimeType&&u.push(c.mimeType),c.bytes!==void 0&&u.push(r(c.bytes)),c.dimensions&&u.push(c.dimensions),u.join(" · ")});function a(){const c=s.value;c?.kind==="image"&&o("openMedia",c)}return(c,u)=>s.value?(x(),E("div",{key:0,class:Ue(["media-tool",{mob:e.mobile}])},[ae(an,{text:s.value.path||l.value},{default:Ie(()=>[w("div",lU,B(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(x(),Se(an,{key:0,text:s.value.path||l.value},{default:Ie(()=>[w("button",{type:"button",class:"media-image-button",onClick:a},[w("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,aU)])]),_:1},8,["text"])):s.value.kind==="video"?(x(),E("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,cU)):(x(),E("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,uU))],2)):ue("",!0)}}),fU=dt(dU,[["__scopeId","data-v-c05c114a"]]),hU=/<summary>([\s\S]*?)<\/summary>/,pU=/<resume_hint>([\s\S]*?)<\/resume_hint>/,Sg=/<subagent\b([^>]*)>|<\/subagent>/g,mU="</subagent>",D_=/(completed|failed|aborted):\s*(\d+)/g,P_=/([a-z_]+)="([^"]*)"/g;function gU(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function vU(e){const t={};P_.lastIndex=0;let n;for(;(n=P_.exec(e))!==null;)t[n[1]]=gU(n[2]);return t}function yU(e){const t={completed:0,failed:0,aborted:0};D_.lastIndex=0;let n;for(;(n=D_.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function kU(e,t){const n=vU(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function bU(e){const t=[],n=[];Sg.lastIndex=0;let o;for(;(o=Sg.exec(e))!==null;)if(o[0]===mU){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(kU(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:Sg.lastIndex}):n.push(null);return t}function xU(e){if(e==null)return null;const t=Array.isArray(e)?e.join(`
69
+ `):e;if(!t.includes("<agent_swarm_result>"))return null;const n=hU.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=yU(n),r=pU.exec(t)?.[1]?.trim(),l=bU(t),a=o+s+i;return{summary:n,completed:o,failed:s,aborted:i,total:a>0?a:l.length,subagents:l,resumeHint:r}}function H_(e){return e?e.split(`
70
+ `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function wU(e){return e.suspendedReason||H_(e.text)||H_(e.outputLines?.join(`
71
+ `))||e.summary||""}function _U(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
+ `):e.summary??""}function SU(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function W_(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
+ `)[0]??"",phase:SU(e.outcome),body:e.body}}function CU(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function AU(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:wU(s),phase:s.phase,body:_U(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>CU(i,s))).map((s,i)=>W_(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>W_(s,i))}const MU=["aria-expanded"],EU={class:"title"},TU={key:0,class:"meta"},NU={key:1,class:"sum-txt"},IU={class:"rt"},LU={class:"status"},$U={key:0,class:"chip"},FU={key:1,class:"tm"},OU={class:"body"},BU={class:"overview"},RU={class:"overview-line"},DU={class:"big"},PU={key:0,class:"lbl"},HU={key:1,class:"lbl"},WU={key:2,class:"lbl"},zU={key:0,class:"seg","aria-hidden":"true"},UU={key:1,class:"legend"},qU=["aria-expanded","onClick"],jU={class:"mname"},VU={class:"mact"},KU={class:"mphase"},GU={key:1,class:"fallback-output"},YU={key:2,class:"waiting"},ZU=Je({__name:"SwarmTool",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e){const{t}=$t(),n=e;function o(N){if(!N)return{};try{const F=JSON.parse(N),S=Array.isArray(F.items)?F.items:void 0;return{description:typeof F.description=="string"?F.description:void 0,itemCount:S?.length}}catch{return{}}}const s=Jt("resolveSwarmMembers"),i=D(()=>o(n.tool.arg)),r=D(()=>ec(n.tool.name)),l=D(()=>i.value.description??""),a=D(()=>s?.(n.tool.id)??[]),c=D(()=>xU(n.tool.output)),u=D(()=>n.tool.status),d=D(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=D(()=>AU(a.value,c.value)),h=D(()=>{const N={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)N[F.phase]++;return N}),p=D(()=>f.value.length||i.value.itemCount||0),m=D(()=>h.value.completed+h.value.failed),k=D(()=>h.value.working+h.value.suspended+h.value.queued),y=[{phase:"completed",cls:"s-ok"},{phase:"working",cls:"s-run"},{phase:"suspended",cls:"s-warn"},{phase:"failed",cls:"s-fail"},{phase:"queued",cls:"s-queue"}],g=D(()=>y.map(({phase:N,cls:F})=>({phase:N,count:h.value[N],cls:F})).filter(N=>N.count>0)),v=oe(u.value==="running"||k.value>0);function b(){v.value=!v.value}const A=D(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
+ `).trim()),I=oe(new Set);function T(N){const F=new Set(I.value);F.has(N)?F.delete(N):F.add(N),I.value=F}function M(N){return I.value.has(N)}function $(N){return t(`tools.swarm.phase${N[0].toUpperCase()}${N.slice(1)}`)}return(N,F)=>(x(),E("div",{class:Ue(["swarm-card",{open:v.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[w("button",{class:"head",type:"button","aria-expanded":v.value,onClick:b},[ae(Ge,{class:"ic",name:"git-pull-request",size:"sm"}),w("span",EU,B(r.value),1),l.value?(x(),E("span",TU,"·")):ue("",!0),l.value?(x(),E("span",NU,B(l.value),1)):ue("",!0),w("span",IU,[w("span",LU,[d.value==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):d.value==="error"?(x(),Se(Ge,{key:1,name:"close",size:"sm"})):(x(),Se(hf,{key:2,status:"running"}))]),m.value>0||p.value>0?(x(),E("span",$U,B(m.value)+" / "+B(p.value),1)):ue("",!0),e.tool.timing?(x(),E("span",FU,B(e.tool.timing),1)):ue("",!0)]),ae(Ge,{class:"car",name:v.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,MU),qn(w("div",OU,[w("div",BU,[w("div",RU,[w("span",DU,B(C(t)("tools.swarm.progress",{done:m.value,total:p.value})),1),d.value==="running"&&p.value>0?(x(),E("span",PU,B(C(t)("tools.swarm.runningSub",{count:k.value})),1)):c.value?(x(),E("span",HU,B(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(x(),E("span",WU,B(C(t)("tools.swarm.waiting")),1))]),p.value>0&&g.value.length>0?(x(),E("div",zU,[(x(!0),E(We,null,rt(g.value,S=>(x(),E("span",{key:S.phase,class:Ue(S.cls),style:on({flex:S.count})},null,6))),128))])):ue("",!0),g.value.length>1?(x(),E("div",UU,[(x(!0),E(We,null,rt(g.value,S=>(x(),E("span",{key:S.phase},[w("i",{class:Ue(["lg-dot",S.cls])},null,2),ot(B($(S.phase))+" "+B(S.count),1)]))),128))])):ue("",!0)]),f.value.length>0?(x(!0),E(We,{key:0},rt(f.value,S=>(x(),E("div",{key:S.id,class:Ue(["member",[`phase-${S.phase}`,{open:M(S.id)}]])},[w("button",{class:"member-head",type:"button","aria-expanded":M(S.id),onClick:R=>T(S.id)},[ae(hf,{class:"row-dot",status:S.phase},null,8,["status"]),ae(an,{text:S.name},{default:Ie(()=>[w("span",jU,B(S.name),1)]),_:2},1032,["text"]),S.activity?(x(),Se(an,{key:0,text:S.activity},{default:Ie(()=>[w("span",VU,B(S.activity),1)]),_:2},1032,["text"])):ue("",!0),w("span",KU,B($(S.phase)),1),ae(Ge,{class:"mcar",name:M(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,qU),qn(w("div",{class:"member-body"},B(S.body),513),[[wi,M(S.id)]])],2))),128)):A.value?(x(),E("div",GU,B(A.value),1)):(x(),E("div",YU,B(C(t)("tools.swarm.waiting")),1))],512),[[wi,v.value]])],2))}}),XU=dt(ZU,[["__scopeId","data-v-4b58e128"]]);function QU(e){if(e.media&&e.status==="ok")return fU;const t=Ja(e.name);return t==="edit"||t==="write"||t==="multi_edit"?nU:t==="task"?xz:t==="agentswarm"?XU:t==="askuserquestion"?jz:rU}const y6=Je({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>QU(n.tool));return(i,r)=>(x(),Se(Ho(s.value),{tool:e.tool,mobile:e.mobile,"stack-position":e.stackPosition,"tool-diff-panel":e.toolDiffPanel,"data-scroll-anchor-id":e.tool.id,onOpenMedia:r[0]||(r[0]=l=>o("openMedia",l)),onOpenFile:r[1]||(r[1]=l=>o("openFile",l)),onOpenToolDiff:r[2]||(r[2]=l=>o("openToolDiff",l)),onOpenAgent:r[3]||(r[3]=l=>o("openAgent",l))},null,40,["tool","mobile","stack-position","tool-diff-panel","data-scroll-anchor-id"]))}});function pr(e){if(e>=1024*1024)return`${z_(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):z_(t)}k`}return String(e)}function z_(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function JU(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const t=Math.floor(e/6e4),n=(e%6e4/1e3).toFixed(1);return`${t}m${n}s`}function N1(e){if(e.blocks)return e.blocks;const t=[];e.thinking&&t.push({kind:"thinking",thinking:e.thinking}),e.text&&t.push({kind:"text",text:e.text});for(const n of e.tools??[])t.push({kind:"tool",tool:n});return t}function eq(e){return!(e.tool.status==="ok"&&e.tool.media)}function tq(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function nq(e){const t=N1(e),n=[];let o=[];const s=()=>{if(o.length===1){const[i]=o;i&&n.push({kind:"tool",tool:i.tool,sourceIndex:i.sourceIndex})}else o.length>1&&n.push({kind:"tool-stack",tools:o});o=[]};return t.forEach((i,r)=>{if(i.kind==="tool"){if(eq(i)){o.push({tool:i.tool,sourceIndex:r});return}s(),n.push({kind:"tool",tool:i.tool,sourceIndex:r});return}s(),i.kind==="thinking"?n.push({kind:"thinking",thinking:i.thinking,sourceIndex:r}):i.kind==="text"&&n.push({kind:"text",text:i.text,sourceIndex:r})}),s(),n}function oq(e){return N1(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
+
76
+ `)}function sq(e){const t=[];for(const n of N1(e))if(n.kind==="thinking"&&n.thinking)t.push(`> **Thinking**
77
+ > ${n.thinking.split(`
78
+ `).join(`
79
+ > `)}`);else if(n.kind==="text"&&n.text)t.push(n.text);else if(n.kind==="tool"&&n.tool.output&&n.tool.output.length>0){const o=n.tool.output.join(`
80
+ `);t.push(`\`\`\`
81
+ [${n.tool.name}]
82
+ ${o}
83
+ \`\`\``)}return t.join(`
84
+
85
+ `)}function k6(e){return e.tool.id||`tool-${e.sourceIndex}`}function iq(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?k6({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const rq=["aria-expanded"],lq={class:"tg-title"},aq={class:"tg-meta"},cq=["inert"],uq={class:"tool-group-body-inner"},dq=Je({__name:"ToolGroup",props:{tools:{},mobile:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1}},emits:["openMedia","openFile","openToolDiff","openAgent"],setup(e,{emit:t}){const n=e,o=t,s=oe(!0),i=D(()=>n.tools.length),r=D(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=$t(),a=D(()=>{switch(r.value){case"running":return l("tools.group.running");case"error":return l("tools.group.error");default:return l("tools.group.done")}});function c(){s.value=!s.value}const u=Jt("pinScroll",()=>{}),d=oe(null);function f(){c();const h=d.value;h&&yt(()=>u(h))}return(h,p)=>(x(),E("div",{class:Ue(["tool-group",{open:s.value}])},[w("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[ae(hf,{status:r.value},null,8,["status"]),ae(Ge,{class:"tg-ic",name:"list",size:"sm"}),w("span",lq,B(C(l)("tools.group.title",i.value)),1),w("span",aq,"· "+B(a.value),1),ae(Ge,{class:"tg-car",name:"chevron-right",size:"sm"})],8,rq),w("div",{class:Ue(["tool-group-body",{open:s.value}]),inert:!s.value},[w("div",uq,[(x(!0),E(We,null,rt(e.tools,(m,k)=>(x(),Se(y6,{key:C(k6)(m),tool:m.tool,mobile:e.mobile,"stack-position":C(tq)(k,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=y=>o("openMedia",y)),onOpenFile:p[1]||(p[1]=y=>o("openFile",y)),onOpenToolDiff:p[2]||(p[2]=y=>o("openToolDiff",y)),onOpenAgent:p[3]||(p[3]=y=>o("openAgent",y))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,cq)],2))}}),fq=dt(dq,[["__scopeId","data-v-37eb334f"]]);var hq=Object.create,Jk=Object.defineProperty,pq=Object.getOwnPropertyDescriptor,b6=Object.getOwnPropertyNames,mq=Object.getPrototypeOf,gq=Object.prototype.hasOwnProperty,x6=(e,t)=>function(){return t||(0,e[b6(e)[0]])((t={exports:{}}).exports,t),t.exports},w6=e=>{let t={};for(var n in e)Jk(t,n,{get:e[n],enumerable:!0});return t},vq=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=b6(t),i=0,r=s.length,l;i<r;i++)l=s[i],!gq.call(e,l)&&l!==n&&Jk(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=pq(t,l))||o.enumerable});return e},_6=(e,t,n)=>(n=e!=null?hq(mq(e)):{},vq(Jk(n,"default",{value:e,enumerable:!0}),e));function yq(e,t,n,o){const s=Number(e[t].meta.id+1).toString();let i="";return typeof o.docId=="string"&&(i=`-${o.docId}-`),i+s}function kq(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function bq(e,t,n,o,s){const i=s.rules.footnote_anchor_name(e,t,n,o,s),r=s.rules.footnote_caption(e,t,n,o,s);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function xq(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
86
+ `:`<hr class="footnotes-sep">
87
+ `)+`<section class="footnotes">
88
+ <ol class="footnotes-list">
89
+ `}function wq(){return`</ol>
90
+ </section>
91
+ `}function _q(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function Sq(){return`</li>
92
+ `}function Cq(e,t,n,o,s){let i=s.rules.footnote_anchor_name(e,t,n,o,s);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function Aq(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=bq,e.renderer.rules.footnote_block_open=xq,e.renderer.rules.footnote_block_close=wq,e.renderer.rules.footnote_open=_q,e.renderer.rules.footnote_close=Sq,e.renderer.rules.footnote_anchor=Cq,e.renderer.rules.footnote_caption=kq,e.renderer.rules.footnote_anchor_name=yq;function o(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h<f;h++){if(l.src.charCodeAt(h)===32)return!1;if(l.src.charCodeAt(h)===93)break}if(h===d+2||h+1>=f||l.src.charCodeAt(++h)!==58)return!1;if(u)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const p=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${p}`]=-1;const m=new l.Token("footnote_reference_open","",1);m.meta={label:p},m.level=l.level++,l.tokens.push(m);const k=l.bMarks[a],y=l.tShift[a],g=l.sCount[a],v=l.parentType,b=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let I=A;for(;h<f;){const M=l.src.charCodeAt(h);if(n(M))M===9?I+=4-I%4:I++;else break;h++}l.tShift[a]=h-b,l.sCount[a]=I-A,l.bMarks[a]=b,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=v,l.blkIndent-=4,l.tShift[a]=y,l.sCount[a]=g,l.bMarks[a]=k;const T=new l.Token("footnote_reference_close","",-1);return T.level=--l.level,l.tokens.push(T),!0}function s(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,f=t(l,u+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,p=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,p);const m=l.push("footnote_ref","",0);m.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:p}}return l.pos=f+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const f=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const p=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const m=l.push("footnote_ref","",0);m.meta={id:h,subId:p,label:f}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(p){return p.type==="footnote_reference_open"?(d=!0,c=[],u=p.meta.label,!1):p.type==="footnote_reference_close"?(d=!1,f[":"+u]=c,!1):(d&&c.push(p),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let p=0,m=h.length;p<m;p++){const k=new l.Token("footnote_open","",1);if(k.meta={id:p,label:h[p].label},l.tokens.push(k),h[p].tokens){a=[];const v=new l.Token("paragraph_open","p",1);v.block=!0,a.push(v);const b=new l.Token("inline","",0);b.children=h[p].tokens,b.content=h[p].content,a.push(b);const A=new l.Token("paragraph_close","p",-1);A.block=!0,a.push(A)}else h[p].label&&(a=f[`:${h[p].label}`]);a&&(l.tokens=l.tokens.concat(a));let y;l.tokens[l.tokens.length-1].type==="paragraph_close"?y=l.tokens.pop():y=null;const g=h[p].count>0?h[p].count:1;for(let v=0;v<g;v++){const b=new l.Token("footnote_anchor","",0);b.meta={id:p,subId:v,label:h[p].label},l.tokens.push(b)}y&&l.tokens.push(y),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",o,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",s),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function Mq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==43)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){let i;const r=[],l=s.length;for(let a=0;a<l;a++){const c=s[a];if(c.marker!==43||c.end===-1)continue;const u=s[c.end];i=o.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=o.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",o.tokens[u.token-1].type==="text"&&o.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<o.tokens.length&&o.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=o.tokens[c],o.tokens[c]=o.tokens[a],o.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(o){const s=o.tokens_meta,i=(o.tokens_meta||[]).length;n(o,o.delimiters);for(let r=0;r<i;r++)s[r]&&s[r].delimiters&&n(o,s[r].delimiters)})}function Eq(e){function t(o,s){const i=o.pos,r=o.src.charCodeAt(i);if(s||r!==61)return!1;const l=o.scanDelims(o.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=o.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=o.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&o.delimiters.push({marker:r,length:0,jump:u/2,token:o.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return o.pos+=l.length,!0}function n(o,s){const i=[],r=s.length;for(let l=0;l<r;l++){const a=s[l];if(a.marker!==61||a.end===-1)continue;const c=s[a.end],u=o.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=o.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",o.tokens[c.token-1].type==="text"&&o.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<o.tokens.length&&o.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=o.tokens[a];o.tokens[a]=o.tokens[l],o.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(o){let s;const i=o.tokens_meta,r=(o.tokens_meta||[]).length;for(n(o,o.delimiters),s=0;s<r;s++)i[s]&&i[s].delimiters&&n(o,i[s].delimiters)})}const Tq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function Nq(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==126||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(Tq,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function Iq(e){e.inline.ruler.after("emphasis","sub",Nq)}const Lq=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function $q(e,t){const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==94||t||o+2>=n)return!1;e.pos=o+1;let s=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){s=!0;break}e.md.inline.skipToken(e)}if(!s||o+1===e.pos)return e.pos=o,!1;const i=e.src.slice(o+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=o,!1;e.posMax=e.pos,e.pos=o+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(Lq,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function Fq(e){e.inline.ruler.after("emphasis","sup",$q)}var Oq=x6({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(m,k){k=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},k),m.core.ruler.after("inline","github-task-lists",function(y){for(var g=y.tokens,v=0,b=2;b<g.length;b++)s(g,b)&&(i(g[b],v,k,y.Token),v+=1,n(g[b-2],"class",k.liClass),n(g[o(g,b-2)],"class",k.ulClass))})};function n(m,k,y){var g=m.attrIndex(k),v=[k,y];g<0?m.attrPush(v):m.attrs[g]=v}function o(m,k){for(var y=m[k].level-1,g=k-1;g>=0;g--)if(m[g].level===y)return g;return-1}function s(m,k){return d(m[k])&&f(m[k-1])&&h(m[k-2])&&p(m[k])}function i(m,k,y,g){var v=y.idPrefix+k;m.children[0].content=m.children[0].content.slice(3),m.children.unshift(l(v,g)),m.children.push(a(g)),m.children.unshift(r(m,v,y,g)),y.divWrap&&(m.children.unshift(c(y,g)),m.children.push(u(g)))}function r(m,k,y,g){var v=new g("checkbox_input","input",0);return v.attrs=[["type","checkbox"],["id",k]],/^\[[xX]\][ \u00A0]/.test(m.content)===!0&&v.attrs.push(["checked","true"]),y.disabled===!0&&v.attrs.push(["disabled","true"]),v}function l(m,k){var y=new k("label_open","label",1);return y.attrs=[["for",m]],y}function a(m){return new m("label_close","label",-1)}function c(m,k){var y=new k("checkbox_open","div",0);return y.attrs=[["class",m.divClass]],y}function u(m){return new m("checkbox_close","div",-1)}function d(m){return m.type==="inline"}function f(m){return m.type==="paragraph_open"}function h(m){return m.type==="list_item_open"}function p(m){return/^\[[xX \u00A0]\][ \u00A0]/.test(m.content)}})}),Bq=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Rq=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),Cg;const Dq=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Pq=(Cg=String.fromCodePoint)!==null&&Cg!==void 0?Cg:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Hq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Dq.get(e))!==null&&t!==void 0?t:e}var Wo;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Wo||(Wo={}));const Wq=32;var El;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(El||(El={}));function yy(e){return e>=Wo.ZERO&&e<=Wo.NINE}function zq(e){return e>=Wo.UPPER_A&&e<=Wo.UPPER_F||e>=Wo.LOWER_A&&e<=Wo.LOWER_F}function Uq(e){return e>=Wo.UPPER_A&&e<=Wo.UPPER_Z||e>=Wo.LOWER_A&&e<=Wo.LOWER_Z||yy(e)}function qq(e){return e===Wo.EQUALS||Uq(e)}var Po;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Po||(Po={}));var Sl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Sl||(Sl={}));var jq=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Po.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Sl.Strict}startEntity(e){this.decodeMode=e,this.state=Po.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Po.EntityStart:return e.charCodeAt(t)===Wo.NUM?(this.state=Po.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Po.NamedEntity,this.stateNamedEntity(e,t));case Po.NumericStart:return this.stateNumericStart(e,t);case Po.NumericDecimal:return this.stateNumericDecimal(e,t);case Po.NumericHex:return this.stateNumericHex(e,t);case Po.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Wq)===Wo.LOWER_X?(this.state=Po.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Po.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,o){if(t!==n){const s=n-t;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(t,s),o),this.consumed+=s}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(yy(o)||zq(o))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const o=e.charCodeAt(t);if(yy(o))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Wo.SEMI)this.consumed+=1;else if(this.decodeMode===Sl.Strict)return 0;return this.emitCodePoint(Hq(this.result),this.consumed),this.errors&&(e!==Wo.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let o=n[this.treeIndex],s=(o&El.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=Vq(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Sl.Attribute&&(s===0||qq(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&El.VALUE_LENGTH)>>14,s!==0){if(i===Wo.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Sl.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,o=(n[t]&El.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[e]&~El.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Po.NamedEntity:return this.result!==0&&(this.decodeMode!==Sl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Po.NumericDecimal:return this.emitNumericEntity(0,2);case Po.NumericHex:return this.emitNumericEntity(0,3);case Po.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Po.EntityStart:return 0}}};function S6(e){let t="";const n=new jq(e,o=>t+=Pq(o));return function(s,i){let r=0,l=0;for(;(l=s.indexOf("&",l))>=0;){t+=s.slice(r,l),n.startEntity(i);const c=n.write(s,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+s.slice(r);return t="",a}}function Vq(e,t,n,o){const s=(t&El.BRANCH_LENGTH)>>7,i=t&El.JUMP_TABLE;if(s===0)return i!==0&&o===i?n:-1;if(i){const a=o-i;return a<0||a>=s?-1:e[n+a]-1}let r=n,l=r+s-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<o)r=a+1;else if(c>o)l=a-1;else return e[a+s]}return-1}const Kq=S6(Bq);S6(Rq);function e2(e,t=Sl.Legacy){return Kq(e,t)}var Gq=_6(Oq());const U_={};function Yq(e){let t=U_[e];if(t)return t;t=U_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function I1(e,t){typeof t!="string"&&(t=I1.defaultChars);const n=Yq(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let s="";for(let i=0,r=o.length;i<r;i+=3){const l=parseInt(o.slice(i+1,i+3),16);if(l<128){s+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(o.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?s+="��":s+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?s+="���":s+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(o.slice(i+4,i+6),16),c=parseInt(o.slice(i+7,i+9),16),u=parseInt(o.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?s+="����":(d-=65536,s+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}s+="�"}return s})}I1.defaultChars=";/?:@&=+$,#";I1.componentChars="";var ky=I1;const q_={};function Zq(e){let t=q_[e];if(t)return t;t=q_[e]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function L1(e,t,n){typeof t!="string"&&(n=t,t=L1.defaultChars),typeof n>"u"&&(n=!0);const o=Zq(t);let s="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){s+=e.slice(i,i+3),i+=2;continue}if(l<128){s+=o[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){s+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}s+="%EF%BF%BD";continue}s+=encodeURIComponent(e[i])}return s}L1.defaultChars=";/?:@&=+$,-_.!~*'()#";L1.componentChars="-_.!~*'()";var C6=L1;function t2(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function dm(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Xq=/^([a-z0-9.+-]+:)/i,Qq=/:[0-9]*$/,Jq=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ej=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
+ `," "]),tj=["'"].concat(ej),j_=["%","/","?",";","#"].concat(tj),V_=["/","?","#"],nj=255,K_=/^[+a-z0-9A-Z_-]{0,63}$/,oj=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,G_={javascript:!0,"javascript:":!0},Y_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function sj(e,t){if(e&&e instanceof dm)return e;const n=new dm;return n.parse(e,t),n}dm.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=Jq.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=Xq.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=i.substr(0,2)==="//",s&&!(r&&G_[r])&&(i=i.substr(2),this.slashes=!0)),!G_[r]&&(s||r&&!Y_[r])){let c=-1;for(let p=0;p<V_.length;p++)o=i.indexOf(V_[p]),o!==-1&&(c===-1||o<c)&&(c=o);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let p=0;p<j_.length;p++)o=i.indexOf(j_[p]),o!==-1&&(c===-1||o<c)&&(c=o);c===-1&&(c=i.length),i[c-1]===":"&&c--;const f=i.slice(0,c);i=i.slice(c),this.parseHost(f),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const p=this.hostname.split(/\./);for(let m=0,k=p.length;m<k;m++){const y=p[m];if(y&&!y.match(K_)){let g="";for(let v=0,b=y.length;v<b;v++)y.charCodeAt(v)>127?g+="x":g+=y[v];if(!g.match(K_)){const v=p.slice(0,m),b=p.slice(m+1),A=y.match(oj);A&&(v.push(A[1]),b.unshift(A[2])),b.length&&(i=b.join(".")+i),this.hostname=v.join(".");break}}}}this.hostname.length>nj&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),Y_[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};dm.prototype.parseHost=function(e){let t=Qq.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var n2=sj,A6=w6({decode:()=>ky,encode:()=>C6,format:()=>t2,parse:()=>n2}),M6=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,E6=/[\0-\x1F\x7F-\x9F]/,ij=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,T6=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,rj=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,N6=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,lj=w6({Any:()=>M6,Cc:()=>E6,Cf:()=>ij,P:()=>T6,S:()=>rj,Z:()=>N6}),aj=Object.defineProperty,I6=e=>{let t={};for(var n in e)aj(t,n,{get:e[n],enumerable:!0});return t},Co=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,o=t.length;n<o;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),o=[e,t];n<0?this.attrPush(o):this.attrs[n]=o}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},cj=I6({arrayReplaceAt:()=>gj,assign:()=>pj,countLines:()=>uo,escapeHtml:()=>Cj,escapeRE:()=>Mj,fromCodePoint:()=>mf,has:()=>hj,isMdAsciiPunct:()=>pm,isPunctChar:()=>hm,isPunctCode:()=>by,isSpace:()=>mj,isString:()=>dj,isValidEntityCode:()=>F1,isWhiteSpace:()=>pf,lib:()=>Ej,mdurl:()=>A6,normalizeReference:()=>$1,ucmicro:()=>fm,unescapeAll:()=>gf,unescapeMd:()=>bj});const fm=lj;function uj(e){return Object.prototype.toString.call(e)}function dj(e){return uj(e)==="[object String]"}const fj=Object.prototype.hasOwnProperty;function hj(e,t){return fj.call(e,t)}function pj(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(o=>{e[o]=n[o]})}}),e}function mj(e){return e===9||e===32}function pf(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function hm(e){return fm.P.test(e)||fm.S.test(e)}const Z_=new Map;function by(e){if(pm(e))return!0;const t=Z_.get(e);if(t!==void 0)return t;const n=hm(String.fromCharCode(e));return Z_.set(e,n),n}function pm(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function $1(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function gj(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function F1(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function mf(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const L6=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,vj=new RegExp(`${L6.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yj=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kj(e,t){if(t.charCodeAt(0)===35&&yj.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return F1(o)?mf(o):e}const n=e2(e);return n!==e?n:e}function bj(e){return e.includes("\\")?e.replace(L6,"$1"):e}function gf(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vj,(t,n,o)=>n||kj(t,o))}const xj=/[&<>"]/,wj=/[&<>"]/g,_j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Sj(e){return _j[e]}function Cj(e){return xj.test(e)?e.replace(wj,Sj):e}const Aj=/[.?*+^$[\]\\(){}|-]/g;function Mj(e){return e.replace(Aj,"\\$&")}const Ej={mdurl:A6,ucmicro:fm};function uo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
+ `,n+1))!==-1;)t++;return t}const Tj=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Nj=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Ij=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,o2=["references","footnotes","abbreviations","abbr","abbrs"],s2=Symbol.for("markdown-it-ts.global-state"),i2=Object.prototype.hasOwnProperty;function X_(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Wi(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $l(e){if(Array.isArray(e))return e.map(t=>$l(t));if(Wi(e)){const t={};for(const n of Object.keys(e))t[n]=$l(e[n]);return t}return e}function mm(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Wi(e)?Object.keys(e):[]}function xy(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xy(e[n],t[n]))return!1;return!0}if(Wi(e)||Wi(t)){if(!Wi(e)||!Wi(t))return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const s of n)if(!i2.call(t,s)||!xy(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function $6(e,t){if(Array.isArray(e))return e[Number(t)];if(Wi(e))return e[t]}function Lj(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=$l(t[n]);return e}if(Wi(e)&&Wi(t)){for(const n of Object.keys(e))i2.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=$l(t[n]);return e}return $l(t)}function $j(e,t,n){const o=n.ownedKeys??[],s=e[t];if(Wi(s)||Array.isArray(s)){const i=new Set(mm(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=$l($6(n.value,r)):delete s[r];!n.existed&&mm(s).length===0&&delete e[t];return}n.existed?e[t]=$l(n.value):delete e[t]}function r2(e){const t=e[s2];return X_(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&X_(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function Fj(e,t){Object.defineProperty(e,s2,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ls(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Tj.test(e)?"footnote-definition":Nj.test(e)?"abbreviation-definition":Ij.test(e)?"reference-definition":null}function Of(e){return r2(e)?.reason??null}function iu(e,t,n){if(Of(e)&&Zr(e),!t)return n();l2(e,t);try{const o=n();return a2(e),o}catch(o){throw Zr(e),o}}function l2(e,t){try{Zr(e);const n={};for(const o of o2)n[o]=i2.call(e,o)?{existed:!0,value:$l(e[o])}:{existed:!1};Fj(e,{reason:t,snapshot:n})}catch{}}function a2(e){const t=r2(e);if(t)for(const n of o2){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!Wi(s)&&!Array.isArray(s))continue;const i=new Set(mm(o.existed?o.value:void 0));o.ownedKeys=mm(s).filter(r=>i.has(r)?!xy(s[r],$6(o.value,r)):!0)}}function Zr(e){const t=r2(e);if(t){for(const n of o2){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){$j(e,n,o);continue}o.existed?e[n]=Lj(e[n],o.value):delete e[n]}delete e[s2]}}const wy=Symbol.for("markdown-it-ts.diagnostics");function O1(e,t){if(e)try{const n=e[wy];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[wy]=o,o}catch{return}}function Lr(e){return O1(e,!1)}function Oj(e){if(e)try{const t=e[wy];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function fs(e){Oj(e)}function wo(e,t){const n=O1(e,!0);n&&(n.strategy=t)}function Ag(e,t){const n=O1(e,!0);n&&(n.chunk=t)}function F6(e,t){const n=O1(e,!0);n&&(n.unbounded=t)}function Bj(e){const t={};e=e||{},t.src_Any=M6.source,t.src_Cc=E6.source,t.src_Z=N6.source,t.src_P=T6.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function _y(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function B1(e){return Object.prototype.toString.call(e)}function Rj(e){return B1(e)==="[object String]"}function Dj(e){return B1(e)==="[object Object]"}function Pj(e){return B1(e)==="[object RegExp]"}function Q_(e){return B1(e)==="[object Function]"}function Hj(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const O6={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Wj(e){return Object.keys(e||{}).reduce(function(t,n){return t||O6.hasOwnProperty(n)},!1)}const zj={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},Uj="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",qj="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function jj(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function J_(){return function(e,t){t.normalize(e)}}function gm(e){const t=e.re=Bj(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Uj),n.push(t.src_xn),t.src_tlds=n.join("|");function o(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const s=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,Dj(a)){Pj(a.validate)?c.validate=jj(a.validate):Q_(a.validate)?c.validate=a.validate:i(l,a),Q_(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=J_();return}if(Rj(a)){s.push(l);return}i(l,a)}),s.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:J_()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(Hj).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i")}function B6(e,t,n,o){const s=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=s,this.text=s,this.url=s}function li(e,t){if(!(this instanceof li))return new li(e,t);t||Wj(e)&&(t=e,e={}),this.__opts__=_y({},O6,t),this.__schemas__=_y({},zj,e),this.__compiled__={},this.__tlds__=qj,this.__tlds_replaced__=!1,this.re={},gm(this)}li.prototype.add=function(t,n){return this.__schemas__[t]=n,gm(this),this};li.prototype.set=function(t){return this.__opts__=_y(this.__opts__,t),this};li.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};li.prototype.pretest=function(t){return this.re.pretest.test(t)};li.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};li.prototype.match=function(t){const n=[],o=[],s=[],i=[];let r,l,a;function c(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(a=this.re.schema_search,a.lastIndex=0;(r=a.exec(t))!==null;)l=this.testSchemaAt(t,r[2],a.lastIndex),l&&o.push({schema:r[2],index:r.index+r[1].length,lastIndex:r.index+r[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)s.push({schema:"",index:r.index+r[1].length,lastIndex:r.index+r[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(r=a.exec(t))!==null;)i.push({schema:"mailto:",index:r.index+r[1].length,lastIndex:r.index+r[0].length});const u=[0,0,0];let d=0;for(;;){const f=[o[u[0]],i[u[1]],s[u[2]]],h=c(c(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?u[0]++:h===f[1]?u[1]++:u[2]++,h.index<d)continue;const p=new B6(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};li.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;const s=new B6(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};li.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,s,i){return o!==i[s-1]}).reverse(),gm(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,gm(this),this)};li.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};li.prototype.onCompile=function(){};var R6=li,Vj=x6({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=35,k=Math.floor,y=String.fromCharCode;function g(W){throw new RangeError(p[W])}function v(W,L){const O=[];let U=W.length;for(;U--;)O[U]=L(W[U]);return O}function b(W,L){const O=W.split("@");let U="";O.length>1&&(U=O[0]+"@",W=O[1]),W=W.replace(h,".");const Z=v(W.split("."),L).join(".");return U+Z}function A(W){const L=[];let O=0;const U=W.length;for(;O<U;){const Z=W.charCodeAt(O++);if(Z>=55296&&Z<=56319&&O<U){const ie=W.charCodeAt(O++);(ie&64512)==56320?L.push(((Z&1023)<<10)+(ie&1023)+65536):(L.push(Z),O--)}else L.push(Z)}return L}const I=W=>String.fromCodePoint(...W),T=function(W){return W>=48&&W<58?26+(W-48):W>=65&&W<91?W-65:W>=97&&W<123?W-97:36},M=function(W,L){return W+22+75*(W<26)-((L!=0)<<5)},$=function(W,L,O){let U=0;for(W=O?k(W/700):W>>1,W+=k(W/L);W>m*26>>1;U+=36)W=k(W/m);return k(U+(m+1)*W/(W+38))},N=function(W){const L=[],O=W.length;let U=0,Z=128,ie=72,q=W.lastIndexOf("-");q<0&&(q=0);for(let ee=0;ee<q;++ee)W.charCodeAt(ee)>=128&&g("not-basic"),L.push(W.charCodeAt(ee));for(let ee=q>0?q+1:0;ee<O;){const fe=U;for(let j=1,K=36;;K+=36){ee>=O&&g("invalid-input");const ve=T(W.charCodeAt(ee++));ve>=36&&g("invalid-input"),ve>k((2147483647-U)/j)&&g("overflow"),U+=ve*j;const he=K<=ie?1:K>=ie+26?26:K-ie;if(ve<he)break;const Ae=36-he;j>k(2147483647/Ae)&&g("overflow"),j*=Ae}const ne=L.length+1;ie=$(U-fe,ne,fe==0),k(U/ne)>2147483647-Z&&g("overflow"),Z+=k(U/ne),U%=ne,L.splice(U++,0,Z)}return String.fromCodePoint(...L)},F=function(W){const L=[];W=A(W);const O=W.length;let U=128,Z=0,ie=72;for(const fe of W)fe<128&&L.push(y(fe));const q=L.length;let ee=q;for(q&&L.push("-");ee<O;){let fe=2147483647;for(const j of W)j>=U&&j<fe&&(fe=j);const ne=ee+1;fe-U>k((2147483647-Z)/ne)&&g("overflow"),Z+=(fe-U)*ne,U=fe;for(const j of W)if(j<U&&++Z>2147483647&&g("overflow"),j===U){let K=Z;for(let ve=36;;ve+=36){const he=ve<=ie?1:ve>=ie+26?26:ve-ie;if(K<he)break;const Ae=K-he,re=36-he;L.push(y(M(he+Ae%re,0))),K=k(Ae/re)}L.push(y(M(K,0))),ie=$(Z,ne,ee===q),Z=0,++ee}++Z,++U}return L.join("")},z={version:"2.3.1",ucs2:{decode:A,encode:I},decode:N,encode:F,toASCII:function(W){return b(W,function(L){return f.test(L)?"xn--"+F(L):L})},toUnicode:function(W){return b(W,function(L){return d.test(L)?N(L.slice(4).toLowerCase()):L})}};t.exports=z})}),D6=_6(Vj());function c2(e,t,n){let o,s=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(s)===60){for(s++;s<n;){if(o=e.charCodeAt(s),o===10||o===60)return i;if(o===62)return i.pos=s+1,i.str=gf(e.slice(t+1,s)),i.ok=!0,i;if(o===92&&s+1<n){s+=2;continue}s++}return i}let r=0;for(;s<n&&(o=e.charCodeAt(s),!(o===32||o<32||o===127));){if(o===92&&s+1<n){if(e.charCodeAt(s+1)===32)break;s+=2;continue}if(o===40&&(r++,r>32))return i;if(o===41){if(r===0)break;r--}s++}return t===s||r!==0||(i.str=gf(e.slice(t,s)),i.pos=s,i.ok=!0),i}var P6=c2;const wp=-2;function Kj(e,t,n,o){let s=1,i=t+1;for(;i<n;){const r=e.charCodeAt(i);if(r===93){if(s--,s===0)return i;if(o){const l=i+1<n?e.charCodeAt(i+1):0;if(l===40||l===91)return wp}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return wp;if(r===91){s++,i++;continue}i++}return-1}function u2(e,t,n){let o=1,s=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Kj(l,t,a,n);if(f!==wp)return f;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(o--,o===0)){s=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)o++;else if(n)return e.pos=c,-1}}let h=-1;return s&&(h=e.pos),e.pos=c,h}var vm=u2;function d2(e,t,n,o){let s,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)r.str=o.str,r.marker=o.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(s=e.charCodeAt(i),s===r.marker)return r.pos=i+1,r.str+=gf(e.slice(t,i)),r.ok=!0,r;if(s===40&&r.marker===41)return r;s===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=gf(e.slice(t,i)),r}var H6=d2;function R1(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function f2(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function Gj(e,t,n){const o=R1(e,t),s=[t,n];o<0?f2(e,s):e.attrs[o]=s}function Yj(e,t){const n=R1(e,t);return n>=0?e.attrs[n][1]:null}function Zj(e,t,n){const o=R1(e,t);o<0?f2(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var Xj=I6({attrGet:()=>Yj,attrIndex:()=>R1,attrJoin:()=>Zj,attrPush:()=>f2,attrSet:()=>Gj,parseLinkDestination:()=>c2,parseLinkLabel:()=>u2,parseLinkTitle:()=>d2});function Qj(e){return e.includes("\r")||e.includes("\0")}function W6(e){return typeof e=="string"?e:e.toString()}function Jj(e){if(e.inlineMode){const t=new Co("inline","",0);t.content=W6(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const eV=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,tV=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nV(e,t){let n=e.pos;const o=e.src;if(o.charCodeAt(n)!==60)return!1;const s=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=o.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=o.slice(s+1,n);if(tV.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(eV.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var oV=nV;function sV(e,t){const n=e.src;let o=e.pos;if(n.charCodeAt(o)!==96)return!1;const s=o;o++;const i=e.posMax;for(;o<i&&n.charCodeAt(o)===96;)o++;const r=n.slice(s,o),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=s)return t||(e.pending+=r),e.pos+=l,!0;let a=o,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let f=n.slice(o,c);f.includes(`
95
+ `)&&(f=f.replace(/\n/g," ")),f.length>2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var iV=sV;function eS(e){const t={},n=e.length;if(!n)return;let o=0,s=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[o].marker!==l.marker||s!==l.token-1)&&(o=r),s=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=o-i[o]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+h,i[c]=h,l.open=!1,d.end=r,d.close=!1,u=-1,s=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function rV(e){const t=e.tokens_meta,n=e.tokens_meta.length;eS(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&eS(t[o].delimiters)}var lV=rV;const z6="*",U6="_";function aV(e,t){if(t)return!1;const n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;const o=e.scanDelims(e.pos,n===42);if(!o||o.length===0)return!1;const s=n===42?z6:U6,i=o.length,r=o.can_open,l=o.can_close,a=e.tokens,c=e.delimiters;for(let u=0;u<i;u++){const d=e.push("text","",0);d.content=s,c.push({marker:n,length:i,token:a.length-1,end:-1,open:r,close:l})}return e.pos+=i,!0}function tS(e,t){const n=t.length,o=e.tokens;for(let s=n-1;s>=0;s--){const i=t[s],r=i.marker;if(r!==95&&r!==42||i.end===-1)continue;const l=t[i.end],a=i.token,c=l.token,u=s>0&&t[s-1].end===i.end+1&&t[s-1].marker===r&&t[s-1].token===a-1&&t[i.end+1].token===c+1,d=r===42?z6:U6,f=o[a];u?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=o[c];u?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),u&&(o[t[s-1].token].content="",o[t[i.end+1].token].content="",s--)}}function cV(e){const t=e.tokens_meta,n=e.tokens_meta.length;tS(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&tS(e,t[o].delimiters)}const nS={tokenize:aV,postProcess:cV};function q6(e){return e2(e)}function h2(e){return e>=48&&e<=57}function uV(e){const t=e|32;return h2(e)||t>=97&&t<=102}function j6(e){const t=e|32;return t>=97&&t<=122}function dV(e){return j6(e)||h2(e)}function fV(e,t,n){let o=t+2;if(o>=n)return null;let s=!1,i=7,r=o;for((e.charCodeAt(o)|32)===120&&(s=!0,i=6,o++,r=o);o<n&&o-r<i;){const l=e.charCodeAt(o);if(!(s?uV(l):h2(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function hV(e,t,n){let o=t+1;if(o>=n||!j6(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&dV(e.charCodeAt(o));)o++;if(o-t-1<2||o>=n||e.charCodeAt(o)!==59)return null;const s=e.slice(t,o+1);return q6(s)!==s?s:null}function pV(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const s=fV(e.src,n,o);if(s){if(!t){const i=(s.charCodeAt(2)|32)===120?Number.parseInt(s.slice(3,-1),16):Number.parseInt(s.slice(2,-1),10),r=e.push("text_special","",0);r.content=F1(i)?mf(i):mf(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=hV(e.src,n,o);if(s){const i=q6(s);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}return!1}var mV=pV;const V6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Sy=new Array(128),K6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Sy[e]=`\\${t}`,K6[e]=V6[e]?t:Sy[e]}function oS(e,t,n){e.pending&&e.pushPending();const o=new Co("text_special","",0);o.level=e.level,o.content=t,o.markup=n,o.info="escape",e.pendingLevel=e.level,e.tokens.push(o),e.tokens_meta.push(null)}function gV(e,t){let n=e.pos;const o=e.posMax,s=e.src;if(s.charCodeAt(n)!==92||(n++,n>=o))return!1;let i=s.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(i=s.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(oS(e,K6[i],Sy[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=s.charAt(n);if(i>=55296&&i<=56319&&n+1<o){const a=s.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=s.charAt(n+1),n++)}const l=`\\${r}`;return oS(e,i<256&&V6[i]?r:l,l),e.pos=n+1,!0}var vV=gV;function yV(e){let t,n,o=0;const s=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=s[t];r&&(r.nesting&&r.nesting<0&&o--,r.level=o,r.nesting&&r.nesting>0&&o++,r.type==="text"&&t+1<i&&s[t+1]?.type==="text"?s[t+1].content=r.content+s[t+1].content:(t!==n&&(s[n]=r),n++))}t!==n&&(s.length=n)}var kV=yV;const G6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Y6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",bV=new RegExp(`^(?:${G6}|${Y6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),xV=new RegExp(`^(?:${G6}|${Y6})`);function Z6(e){return e===32||e===9||e===10||e===12||e===13}function wV(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||Z6(t)}function _V(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!Z6(n))return!1}return!1}function SV(e){const t=e|32;return t>=97&&t<=122}function CV(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos,s=e.src;if(s.charCodeAt(o)!==60||o+2>=n)return!1;const i=s.charCodeAt(o+1);if(i!==33&&i!==63&&i!==47&&!SV(i))return!1;const r=s.slice(o).match(bV);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,wV(l)&&e.linkLevel++,_V(l)&&e.linkLevel--}return e.pos+=l.length,!0}var AV=CV;function MV(e,t){let n,o,s,i,r,l,a,c,u="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=vm(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=f)return!1;if(l=P6(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=H6(e.src,i,e.posMax),i<f&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<f&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(c=i+1,i=vm(e,i),i>=0?s=e.src.slice(c,i++):i=p+1):i=p+1,s||(s=e.src.slice(h,p)),r=e.env.references[$1(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const m=[];e.md.inline.parse(o,e.md,e.env,m);const k=e.push("image","img",0);k.attrs=[["src",u],["alt",""]],k.children=m,k.content=o,a&&k.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var EV=MV;function Mg(e,t,n){for(;t<n;){const o=e.charCodeAt(t);if(o!==32&&o!==10)break;t++}return t}function TV(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;const n=e.src,o=e.pos,s=e.posMax,i=e.pos+1,r=vm(e,e.pos,!0);if(r<0)return!1;let l=r+1,a="",c="",u=!0;if(l<s&&n.charCodeAt(l)===40){l=Mg(n,l+1,s);const d=P6(n,l,s);if(d.ok){const f=e.md.normalizeLink(d.str);e.md.validateLink(f)&&(a=f,l=d.pos,u=!1)}else l<s&&n.charCodeAt(l)===41&&(a="",u=!1);if(!u){if(l=Mg(n,l,s),l<s&&n.charCodeAt(l)!==41){const f=H6(n,l,s);f.ok&&(c=f.str,l=Mg(n,f.pos,s))}l<s&&n.charCodeAt(l)===41?l++:u=!0}}if(u){if(typeof e.env.references>"u")return!1;let d;if(l=r+1,l<s&&n.charCodeAt(l)===91){const h=l+1,p=vm(e,l);p>=0?(d=n.slice(h,p),d||(d=n.slice(i,r)),l=p+1):d=n.slice(i,r)}else d=n.slice(i,r);const f=e.env.references[$1(d)];if(!f)return e.pos=o,!1;a=f.href,c=f.title}if(!t){e.pos=i,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=c?[["href",a],["title",c]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=s,!0}var NV=TV;function X6(e){const t=e|32;return t>=97&&t<=122}function IV(e){return e>=48&&e<=57}function LV(e){return X6(e)||IV(e)||e===43||e===45||e===46}function $V(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&LV(e.charCodeAt(t));)t--;return t++,t>=e.length||!X6(e.charCodeAt(t))?null:e.slice(t)}function FV(e,t,n){let o=t;for(;o<n;){const s=e.charCodeAt(o);if(s<=32||s===127||s===60)break;o++}return e.slice(t,o)}function OV(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const s=$V(e.pending);if(!s)return!1;const i=FV(e.src,n-s.length,o),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-s.length,!0}function BV(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,s=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<s;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var RV=BV;function DV(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const s=e.scanDelims(e.pos,!0);if(!s)return!1;let i=s.length;const r=String.fromCharCode(o);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0}function sS(e,t){let n;const o=[],s=t.length;for(let i=0;i<s;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&o.push(l.token-1)}for(;o.length;){const i=o.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function PV(e){const t=e.delimiters;sS(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&sS(e,n[o].delimiters)}const iS={tokenize:DV,postProcess:PV};function rS(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function HV(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||rS(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!rS(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var WV=HV;function p2(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function zV(e){if(e.length===0)return 0;const t=e.slice().sort((o,s)=>o-s),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function UV(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function Q6(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,o={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:p2(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function ru(e,t,n,o,s,i){const r=Q6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=UV(t,n));a.calls++,a.inclusiveMs+=o,o>a.maxMs&&(a.maxMs=o),a.samples.push(o),i?(a.silentCalls++,s&&a.silentHits++):(a.normalCalls++,s&&a.normalHits++),s&&a.hits++,r.completedAt=p2()}function qV(e){const t=Q6(e);if(!t)return null;const n=Object.keys(t.records);for(let o=0;o<n.length;o++){const s=t.records[n[o]];s.medianMs=zV(s.samples)}return t.completedAt=p2(),t}var lS=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const o=this.rules.findIndex(s=>s.name===e);o>=0&&this.rules.splice(o,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const o=this.rules.findIndex(s=>s.name===e);if(t===void 0){if(o<0)return;const s=this.rules[o];return Object.freeze({name:s.name,fn:s.fn,alt:s.alt?Object.freeze(s.alt.slice()):void 0,enabled:s.enabled})}if(o<0)throw new Error(`Parser rule not found: ${e}`);this.rules[o].fn=t,n?.alt!==void 0&&(this.rules[o].alt=n.alt),this.invalidateCache()}before(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,o){const s=this.rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(s+1,0,{name:t,fn:n,alt:o?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const o of this.rules)if(o.enabled&&o.alt)for(const s of o.alt)e.add(s);const t=new Map,n=new Map;for(const o of e){const s=[],i=[];for(const r of this.rules)r.enabled&&(o!==""&&!r.alt?.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(o,s),n.set(o,i)}this.cache=t,this.namedCache=n}},J6=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.tokens_meta=new Array(o.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Co("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Co(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const o=new Co(e,t,n);let s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(s),o}scanDelims(e,t){const{src:n,posMax:o}=this,s=n.charCodeAt(e);let i=e;for(;i<o&&n.charCodeAt(i)===s;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<o?n.charCodeAt(i):32,c=pf(l),u=pf(a),d=by(l),f=by(a),h=!u&&(!f||c||d),p=!c&&(!d||u||f);return{can_open:h&&(t||!p||d),can_close:p&&(t||!h||f),length:r}}};J6.prototype.Token=Co;const jV=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function e5(e){return!jV.test(e)}var VV=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new lS,this.ruler2=new lS,this.ruler.push("text",WV),this.ruler.push("linkify",OV),this.ruler.push("newline",RV),this.ruler.push("escape",vV),this.ruler.push("backticks",iV),this.ruler.push("strikethrough",iS.tokenize),this.ruler.push("emphasis",nS.tokenize),this.ruler.push("link",NV),this.ruler.push("image",EV),this.ruler.push("autolink",oV),this.ruler.push("html_inline",AV),this.ruler.push("entity",mV),this.ruler2.push("balance_pairs",lV),this.ruler2.push("strikethrough",iS.postProcess),this.ruler2.push("emphasis",nS.postProcess),this.ruler2.push("fragments_join",kV),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),o=n.length,s=e.cache,i=s[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<o;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ru(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<o;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,s[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,o=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const s=this.ruler.getNamedRules("");for(;e.pos<o;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=s[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ru(e.env,"inline",s[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,o){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&e5(e)){const a=new Co("text","",0);a.content=e,o.push(a);return}const s=new J6(e,t,n,o);this.tokenize(s);const i=this.getRules2(),r=i.length;if(!(s.env&&(Object.prototype.hasOwnProperty.call(s.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(s.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](s,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(s,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ru(s.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,o){this.parseSource(e,t,n,o)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function KV(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let o=0,s=t.length;o<s;o++){const i=t[o];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&e5(i.content)){const r=new Co("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const GV=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,YV=/[0-9a-z]/i;function ZV(e){return/^<a[>\s]/i.test(e)}function XV(e){return/^<\/a\s*>/i.test(e)}function QV(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const o=t.raw[n-1],s=t.raw[n];if(!GV.test(o)||!YV.test(s))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function JV(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const o=t[n];if(o.type!=="inline"||!e.md.linkify.pretest(o.content))continue;let s=o.children;s||(s=[],o.children=s);let i=0;for(let r=s.length-1;r>=0;r--){const l=s[r];if(l.type==="link_close"){for(r--;r>=0&&s[r].level!==l.level&&s[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(ZV(l.content)&&i>0&&i--,XV(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(h=>QV(e.md.linkify,h));if(c.length===0)continue;const u=[];let d=l.level,f=0;c.length>0&&c[0].index===0&&r>0&&s[r-1].type==="text_special"&&(c=c.slice(1));for(let h=0;h<c.length;h++){const p=c[h],m=e.md.normalizeLink(p.url);if(!e.md.validateLink(m))continue;let k=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(k)?k=e.md.normalizeLinkText(`mailto:${k}`).replace(/^mailto:/,""):k=e.md.normalizeLinkText(k):k=e.md.normalizeLinkText(`http://${k}`).replace(/^http:\/\//,"");const y=p.index;if(y>f){const A=new Co("text","",0);A.content=a.slice(f,y),A.level=d,u.push(A)}const g=new Co("link_open","a",1);g.attrs=[["href",m]],g.level=d++,g.markup="linkify",g.info="auto",u.push(g);const v=new Co("text","",0);v.content=k,v.level=d,u.push(v);const b=new Co("link_close","a",-1);b.level=--d,b.markup="linkify",b.info="auto",u.push(b),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new Co("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const eK=/\r\n?|\n/g,tK=/\0/g;function nK(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),o=t.includes("\0");if(!n&&!o)return;let s=t;n&&(s=s.replace(eK,`
96
+ `)),o&&(s=s.replace(tK,"�")),e.src=s}const t5=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,oK=/\((?:c|tm|r)\)/i,sK=/\((c|tm|r)\)/gi,iK={c:"©",r:"®",tm:"™"};function rK(e,t){return iK[t.toLowerCase()]}function lK(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(sK,rK)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function aK(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&t5.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function cK(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=n.content||(Array.isArray(n.children)?n.children.map(s=>s.type==="text"?s.content:"").join(""):"");oK.test(o)&&lK(n.children||[]),t5.test(o)&&aK(n.children||[])}}var uK=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(o=>o.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(o=>o.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const o=this.rules.findIndex(i=>i.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(i=>i.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,s=!0)}return s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}o.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,s=!0)}return s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this.rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const dK=/['"]/,aS=/['"]/g,cS="’";function Ph(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function fK(e,t){let n;const o=[],s=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){aS.lastIndex=c;const d=aS.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let m=32;if(d.index-1>=0)m=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let k=32;if(c<u)k=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){k=e[n].content.charCodeAt(0);break}const y=pm(m)||hm(String.fromCharCode(m)),g=pm(k)||hm(String.fromCharCode(k)),v=pf(m),b=pf(k);if(b?f=!1:g&&(v||y||(f=!1)),v?h=!1:y&&(b||g||(h=!1)),k===34&&d[0]==='"'&&m>=48&&m<=57&&(h=f=!1),f&&h&&(f=y,h=g),!f&&!h){p&&(r.content=Ph(r.content,d.index,cS));continue}if(h)for(n=o.length-1;n>=0;n--){let A=o[n];if(o[n].level<l)break;if(A.single===p&&o[n].level===l){A=o[n];let I,T;p?(I=s[2]||"‘",T=s[3]||"’"):(I=s[0]||"“",T=s[1]||"”"),r.content=Ph(r.content,d.index,T),e[A.token].content=Ph(e[A.token].content,A.pos,I),c+=T.length-1,A.token===i&&(c+=I.length-1),a=r.content,u=a.length,o.length=n;continue e}}f?o.push({token:i,pos:d.index,single:p,level:l}):h&&p&&(r.content=Ph(r.content,d.index,cS))}}}function hK(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const o=typeof n.content=="string"?n.content:(n.children||[]).map(s=>s.content||"").join("");!dK.test(o)||!n.children||fK(n.children,e)}}function pK(e){const t=e.tokens||[],n=t.length;for(let o=0;o<n;o++){const s=t[o];if(s.type!=="inline"||!Array.isArray(s.children))continue;const i=s.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const mK=/^(?:vbscript|javascript|file|data):/,gK=/^data:image\/(?:gif|png|jpeg|webp);/,n5=["http:","https:","mailto:"];function o5(e){const t=e.trim().toLowerCase();return mK.test(t)?gK.test(t):!0}function s5(e){const t=n2(e,!0);if(t.hostname&&(!t.protocol||n5.includes(t.protocol)))try{t.hostname=D6.default.toASCII(t.hostname)}catch{}return C6(t2(t))}function i5(e){const t=n2(e,!0);if(t.hostname&&(!t.protocol||n5.includes(t.protocol)))try{t.hostname=D6.default.toUnicode(t.hostname)}catch{}return ky(t2(t),`${ky.defaultChars}%`)}function vK(e){switch(e){case 9:case 32:return!0}return!1}function yK(e,t,n,o){const s=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const f=e.lineMax;if(a[t]-e.blkIndent>=4||s.charCodeAt(u)!==62)return!1;if(o)return!0;const h=[],p=[],m=[],k=[],y=e.md.block.ruler.getRulesForState(e,"blockquote"),g=e.parentType;e.parentType="blockquote";let v=!1,b;for(b=t;b<n;b++){const $=a[b]<e.blkIndent;if(u=i[b]+l[b],d=r[b],u>=d)break;if(s.charCodeAt(u++)===62&&!$){let F=a[b]+1,S,R;s.charCodeAt(u)===32?(u++,F++,R=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[b]+F)%4===3?(u++,F++,R=!1):R=!0):S=!1;let z=F;for(h.push(i[b]),i[b]=u;u<d;){const W=s.charCodeAt(u);if(vK(W))W===9?z+=4-(z+c[b]+(R?1:0))%4:z++;else break;u++}v=u>=d,p.push(c[b]),c[b]=a[b]+1+(S?1:0),m.push(a[b]),a[b]=z-F,k.push(l[b]),l[b]=u-i[b];continue}if(v)break;let N=!1;for(let F=0,S=y.length;F<S;F++)if(y[F](e,b,n,!0)){N=!0;break}if(N){e.lineMax=b,e.blkIndent!==0&&(h.push(i[b]),p.push(c[b]),k.push(l[b]),m.push(a[b]),a[b]-=e.blkIndent);break}h.push(i[b]),p.push(c[b]),k.push(l[b]),m.push(a[b]),a[b]=-1}const A=e.blkIndent;e.blkIndent=0;const I=e.push("blockquote_open","blockquote",1);I.markup=">";const T=[t,0];I.map=T,e.md.block.tokenize(e,t,b);const M=e.push("blockquote_close","blockquote",-1);M.markup=">",e.lineMax=f,e.parentType=g,T[1]=e.line;for(let $=0;$<k.length;$++)i[$+t]=h[$],l[$+t]=k[$],a[$+t]=m[$],c[$+t]=p[$];return e.blkIndent=A,!0}function kK(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,s=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,s=o;continue}break}e.line=s;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,s,4+e.blkIndent,!1)}
97
+ `,i.map=[t,e.line],!0}function bK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||s+3>i)return!1;const r=e.src.charCodeAt(s);if(r!==126&&r!==96)return!1;let l=s;s=e.skipChars(s,r);let a=s-l;if(a<3)return!1;const c=e.src.slice(l,s),u=e.src.slice(s,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(s=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],s<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(s)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(s=e.skipChars(s,r),!(s-l<a)&&(s=e.skipSpaces(s),!(s<i)))){f=!0;break}a=e.sCount[t],e.line=d+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,d,a,!0),h.markup=c,h.map=[t,e.line],!0}const uS=["","h1","h2","h3","h4","h5","h6"],dS=["","#","##","###","####","#####","######"];function fS(e){switch(e){case 9:case 32:return!0}return!1}function xK(e,t,n,o){const s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=s.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=s.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=s.charCodeAt(++a);if(d>6||a<c&&!fS(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&fS(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",uS[d],1);h.markup=dS[d],h.map=[t,e.line];const p=e.push("inline","",0);p.content=s.slice(a,c).trim(),p.map=[t,e.line],p.children=[];const m=e.push("heading_close",uS[d],-1);return m.markup=dS[d],!0}function wK(e){switch(e){case 9:case 32:return!0}return!1}function _K(e,t,n,o){const s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<s;){const c=e.src.charCodeAt(i++);if(c!==r&&!wK(c))return!1;c===r&&l++}if(l<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Sc=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["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"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${xV.source}\\s*$`),/^$/,!1]];function SK(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;let r=e.src.slice(s,i),l=0;for(;l<Sc.length&&!Sc[l][0].test(r);l++);if(l===Sc.length)return!1;if(o)return Sc[l][2];let a=t+1;if(!Sc[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(s=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(s,i),Sc[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function hS(e){switch(e){case 9:case 32:return!0}return!1}const Od={Pipe:1,ParagraphTerminator:2};function CK(e){switch(e){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 124:case 126:return!0}return e>=48&&e<=57}var r5=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o;const s=this.src;let i=0,r=0,l=0,a=!1,c=0;for(let u=0,d=s.length;u<d;u++){const f=s.charCodeAt(u);if(f===124&&(c|=Od.Pipe|Od.ParagraphTerminator),!a)if(hS(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,CK(f)&&(c|=Od.ParagraphTerminator);(f===10||u===d-1)&&(f!==10&&u++,this.bMarks.push(l),this.eMarks.push(u),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),this.lineFlags.push(c),a=!1,i=0,r=0,c=0,l=u+1)}this.bMarks.push(s.length),this.eMarks.push(s.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineFlags.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const s=new Co(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new Co(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,o=this.eMarks;for(let s=this.lineMax;e<s&&!(t[e]+n[e]<o[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const o=t.charCodeAt(e);if(o!==9&&o!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const o=n.charCodeAt(--e);if(o!==9&&o!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let o=n.length;e<o&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const o=this.src;for(;e>n;)if(t!==o.charCodeAt(--e))return e+1;return e}getLines(e,t,n,o){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let f=d;const h=o?this.eMarks[u]+1:this.eMarks[u];let p=0;const m=this.src,k=this.bsCount,y=this.tShift;for(;f<h&&p<n;){const g=m.charCodeAt(f);if(g===9||g===32)g===9?p+=4-(p+k[u])%4:p++;else if(f-d<y[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+m.slice(f,h):m.slice(f,h)}const s=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let f=0;const h=r[d];let p=h,m;for(d+1<t||o?m=l[d]+1:m=l[d];p<m&&f<n;){const k=i.charCodeAt(p);if(hS(k))k===9?f+=4-(f+a[d])%4:f++;else if(p-h<c[d])f++;else break;p++}f>n?s[u]=new Array(f-n+1).join(" ")+i.slice(p,m):s[u]=i.slice(p,m)}return s.join("")}};r5.prototype.Token=Co;function AK(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function l5(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function a5(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&Od.ParagraphTerminator)===0||o>=s)return!1;const i=n.charCodeAt(o);switch(i){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return i>=48&&i<=57?!0:AK(n,o,s)}const pS=["","h1","h2"];function MK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=l5(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,p=t+1;for(;p<n;p++){const b=i[p]+r[p],A=l[p];if(b>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(b),h===45||h===61)){let T=b+1,M=T;for(;T<A&&s.charCodeAt(T)===h;)T++;for(M=T;T<A;){const $=s.charCodeAt(T);if($!==9&&$!==32)break;T++}if(T>=A){f=h===61?1:2;break}if(M-b>1)continue}if(a[p]<0||u&&!a5(e,p,s,b,A))continue;let I=!1;for(let T=0,M=o.length;T<M;T++)if(o[T](e,p,n,!0)){I=!0;break}if(I)break}if(!f)return!1;let m;if(p===t+1){const b=i[t]+r[t];let A=l[t];for(;A>b;){const I=s.charCodeAt(A-1);if(I!==9&&I!==32)break;A--}m=s.slice(b,A)}else m=e.getLines(t,p,c,!1).trim();e.line=p+1;const k=h===61?"=":"-",y=e.push("heading_open",pS[f],1);y.markup=k,y.map=[t,e.line];const g=e.push("inline","",0);g.content=m,g.map=[t,e.line-1],g.children=[];const v=e.push("heading_close",pS[f],-1);return v.markup=k,e.parentType=d,!0}function c5(e){switch(e){case 9:case 32:return!0}return!1}function mS(e,t){const n=e.eMarks,o=e.bMarks,s=e.tShift,i=e.src,r=n[t];let l=o[t]+s[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!c5(i.charCodeAt(l))?-1:l}function gS(e,t){const n=e.bMarks,o=e.tShift,s=e.eMarks,i=e.src,r=n[t]+o[t],l=s[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!c5(c))?-1:a}function EK(e,t,n){const o=e.bMarks,s=e.tShift,i=e.src,r=o[t]+s[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const TK=["0","1","2","3","4","5","6","7","8","9"];function NK(e,t){const n=e.level+2,o=e.tokens;for(let s=t+2,i=o.length-2;s<i;s++){const r=o[s];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,o[s+2].hidden=!0,s+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++s<i;)l+=o[s].nesting}}}}function IK(e,t,n,o){let s,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,f;const h=e.src,p=e.bMarks,m=e.tShift,k=e.eMarks,y=e.sCount,g=e.bsCount,v=p[l]+m[l];if(v>=k[l])return!1;const b=h.charCodeAt(v);if(b>=48&&b<=57){if(f=gS(e,l),f<0||(u=!0,r=v,d=EK(e,l,f),c&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=mS(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=k[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),I=String.fromCharCode(A);if(u){const S=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(S.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const T=[l,0];e.tokens[e.tokens.length-1].map=T,e.tokens[e.tokens.length-1].markup=I;let M=!1;const $=e.tokens.length-1,N=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=k[l];const S=y[l]+f-(p[l]+m[l]);let R=S;for(;i<s;){const ne=h.charCodeAt(i);if(ne===9)R+=4-(R+g[l])%4;else if(ne===32)R++;else break;i++}const z=i;let W;z>=s?W=1:W=R-S,W>4&&(W=1);const L=S+W,O=e.push("list_item_open","li",1);O.markup=I;const U=[l,0];O.map=U,u&&(O.info=f-r-1===1?TK[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,ie=e.tShift[l],q=e.sCount[l],ee=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=L,e.tight=!0,e.tShift[l]=z-p[l],e.sCount[l]=R,z>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||M)&&(a=!1),M=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ee,e.tShift[l]=ie,e.sCount[l]=q,e.tight=Z,e.push("list_item_close","li",-1).markup=I,l=e.line,U[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let fe=!1;for(let ne=0,j=N.length;ne<j;ne++)if(N[ne](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=gS(e,l),f<0)break;r=p[l]+m[l]}else if(f=mS(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=I:e.push("bullet_list_close","ul",-1).markup=I,T[1]=l,e.line=l,e.parentType=F,a&&NK(e,$),!0}function vS(e){return e===9||e===32}function LK(e,t,n){const o=e.md.block.ruler.getRulesForState(e,"paragraph"),s=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=l5(e);let f=t+1;for(e.parentType="paragraph";f<n&&!e.isEmpty(f);f++){if(c[f]-u>3||c[f]<0)continue;if(s==="list"&&c[f]>=u){const v=r[f]+l[f],b=a[f];if(v<b){const A=i.charCodeAt(v);if(A===42||A===45||A===43){if(v+1>=b||vS(i.charCodeAt(v+1)))break}else if(A>=48&&A<=57&&v+1<b){let I=v+1;for(;;){if(I>=b){I=-1;break}const T=i.charCodeAt(I++);if(T>=48&&T<=57){if(I-v>=10){I=-1;break}continue}if((T===41||T===46)&&(I>=b||vS(i.charCodeAt(I))))break;I=-1;break}if(I>=0)break}}}const k=r[f]+l[f],y=a[f];if(d&&!a5(e,f,i,k,y))continue;let g=!1;for(let v=0,b=o.length;v<b;v++)if(o[v](e,f,n,!0)){g=!0;break}if(g)break}const h=e.getLines(t,f,u,!1).trim();e.line=f;const p=e.push("paragraph_open","p",1);p.map=[t,e.line];const m=e.push("inline","",0);return m.content=h,m.map=[t,e.line],m.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function Hh(e){switch(e){case 9:case 32:return!0}return!1}function $K(e,t,n,o){let s=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(s)!==91)return!1;function a(v){const b=e.lineMax;if(v>=b||e.isEmpty(v))return null;let A=!1;if(e.sCount[v]-e.blkIndent>3&&(A=!0),e.sCount[v]<0&&(A=!0),!A){const M=e.parentType;e.parentType="reference";let $=!1;for(let N=0,F=l.length;N<F;N++)if(l[N](e,v,b,!0)){$=!0;break}if(e.parentType=M,$)return null}const I=e.bMarks[v]+e.tShift[v],T=e.eMarks[v];return e.src.slice(I,T+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const v=c.charCodeAt(s);if(v===91)return!1;if(v===93){u=s;break}else if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(v===92&&(s++,s<i&&c.charCodeAt(s)===10)){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Hh(v))break}const d=e.md.helpers.parseLinkDestination(c,s,i);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;s=d.pos;const h=s,p=r,m=s;for(;s<i;s++){const v=c.charCodeAt(s);if(v===10){const b=a(r);b!==null&&(c+=b,i=c.length,r++)}else if(!Hh(v))break}let k=e.md.helpers.parseLinkTitle(c,s,i);for(;k.can_continue;){const v=a(r);if(v===null)break;c+=v,s=i,i=c.length,r++,k=e.md.helpers.parseLinkTitle(c,s,i,k)}let y;for(s<i&&m!==s&&k.ok?(y=k.str,s=k.pos):(y="",s=h,r=p);s<i&&Hh(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&y)for(y="",s=h,r=p;s<i&&Hh(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const g=$1(c.slice(1,u));return g?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:y,href:f}),e.line=r),!0):!1}function Eg(e){switch(e){case 9:case 32:return!0}return!1}const FK=65536;function Tg(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function OK(e,t){if(e.lineFlags)return(e.lineFlags[t]&Od.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];n<o;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function yS(e){const t=[],n=e.length;let o=0,s=e.charCodeAt(o),i=!1,r=0,l="";for(;o<n;)s===124&&(i?(l+=e.substring(r,o-1),r=o):(t.push(l+e.substring(r,o)),l="",r=o+1)),i=s===92,o++,s=e.charCodeAt(o);return t.push(l+e.substring(r)),t}function BK(e,t,n,o){if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let i=e.bMarks[s]+e.tShift[s];if(i>=e.eMarks[s])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[s])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!Eg(l)||r===45&&Eg(l)||!OK(e,t))return!1;for(;i<e.eMarks[s];){const b=e.src.charCodeAt(i);if(b!==124&&b!==45&&b!==58&&!Eg(b))return!1;i++}let a=Tg(e,t+1),c=a.split("|");const u=[];for(let b=0;b<c.length;b++){const A=c[b].trim();if(!A){if(b===0||b===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(A))return!1;A.charCodeAt(A.length-1)===58?u.push(A.charCodeAt(0)===58?"center":"right"):A.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=Tg(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=yS(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;const k=e.push("thead_open","thead",1);k.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let b=0;b<c.length;b++){const A=e.push("th_open","th",1);u[b]&&(A.attrs=[["style",`text-align:${u[b]}`]]);const I=e.push("inline","",0);I.content=c[b].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let g,v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let b=!1;for(let I=0,T=h.length;I<T;I++)if(h[I](e,s,n,!0)){b=!0;break}if(b||(a=Tg(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=yS(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=d-c.length,v>FK))break;if(s===t+2){const I=e.push("tbody_open","tbody",1);I.map=g=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let I=0;I<d;I++){const T=e.push("td_open","td",1);u[I]&&(T.attrs=[["style",`text-align:${u[I]}`]]);const M=e.push("inline","",0);M.content=c[I]?c[I].trim():"",M.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return g&&(e.push("tbody_close","tbody",-1),g[1]=s),e.push("table_close","table",-1),m[1]=s,e.parentType=f,e.line=s,!0}var RK=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}after(e,t,n,o){const s=this._rules.findIndex(r=>r.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(s+1,0,{name:t,enabled:!0,fn:n,alt:o?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:o,fn:s})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=s(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return ru(i?.env,"block",o,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const o=this._rules.findIndex(s=>s.name===e);if(o===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[o].fn=t,n?.alt&&(this._rules[o].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,s=!0)}),s&&this.invalidateCache(),o}disable(e,t){const n=Array.isArray(e)?e:[e],o=[];let s=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}o.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,s=!0)}),s&&this.invalidateCache(),o}enableOnly(e){const t=new Set(e);let n=!1;for(const o of this._rules){const s=t.has(o.name);o.enabled!==s&&(o.enabled=s,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const o of this._rules)if(o.enabled)for(const s of o.alt)e.add(s);const t=Object.create(null),n=Object.create(null);for(const o of e){const s=[],i=[];for(const r of this._rules)r.enabled&&(o!==""&&!r.alt.includes(o)||(s.push(r.fn),i.push({name:r.name,fn:r.fn})));t[o]=s,n[o]=i}this.cache=t,this.namedCache=n}};const Wh=[["table",BK,["paragraph","reference"]],["code",kK],["fence",bK,["paragraph","reference","blockquote","list"]],["blockquote",yK,["paragraph","reference","blockquote","list"]],["hr",_K,["paragraph","reference","blockquote","list"]],["list",IK,["paragraph","reference","blockquote"]],["reference",$K],["html_block",SK,["paragraph","reference","blockquote"]],["heading",xK,["paragraph","reference","blockquote"]],["lheading",MK],["paragraph",LK]];var DK=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new RK;for(let e=0;e<Wh.length;e++)this.ruler.push(Wh[e][0],Wh[e][1],{alt:(Wh[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const o=this.getRules(),s=o.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<s;m++)if(p=o[m](e,u,n,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const f=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const h=e.line;let p=!1;for(let m=0;m<s;m++){const k=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[m].fn(e,u,n,!1);const y=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(ru(e.env,"block",f[m].name,y-k,p,!1),p){if(h>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!p)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,o){if(!e||e.length===0)return;const s=new r5(e,t,n,o);this.tokenize(s,s.line,s.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},u5=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};u5.prototype.Token=Co;const kS=[["normalize",nK],["block",Jj],["inline",KV],["linkify",JV],["replacements",cK],["smartquotes",hK],["text_join",pK]],PK={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},HK={parseLinkLabel:u2,parseLinkDestination:c2,parseLinkTitle:d2};function WK(){return{...PK}}function zK(){return{...HK}}var UK=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new DK,this.inline=new VV,this.ruler=new uK;for(let e=0;e<kS.length;e++){const[t,n]=kS[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:WK(),helpers:zK(),normalizeLink:s5,normalizeLinkText:i5,validateLink:o5,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new R6),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new u5(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let o=0;o<n.length;o++)n[o](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();ru(e.env,"core",t[n].name,s-o,!0,!1)}qV(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&Qj(e))return this.parse(W6(e),t,n);const o=this.createState(e,t,n);return this.process(o),this.lastState=o,o}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const qK=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function ym(e){return!qK.test(e)}function kd(e,t){const n=e.indexOf(`
98
+ `,t);return n===-1?e.length:n}function _p(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function bS(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Ng(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function jK(e){if(e.length>3)return ym(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}const VK=["","h1","h2","h3","h4","h5","h6"],KK=["","#","##","###","####","#####","######"],xS=0,Ig=1,Lg=2;function ei(e,t,n,o){const s=new Co(e,t,n);return s.level=o,s.block=!0,s}function d5(e,t,n){const o=ei("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new Co("text","",0);return s.content=e,o.children=[s],o}function GK(e,t,n,o,s){let i=0,r=n;for(;r<o&&t.charCodeAt(r)===35&&i<6;)r++,i++;if(i===0||r>=o||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;l<o&&t.charCodeAt(l)===32;)l++;let a=o;for(;a>l&&t.charCodeAt(a-1)===32;)a--;let c=a;for(;c>l&&t.charCodeAt(c-1)===35;)c--;if(c>l&&t.charCodeAt(c-1)===32)for(a=c-1;a>l&&t.charCodeAt(a-1)===32;)a--;const u=t.slice(l,a);if(!ym(u))return!1;const d=VK[i],f=KK[i],h=ei("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(d5(u,s,1));const p=ei("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function YK(e,t,n){const o=ei("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(d5(t,n,1)),e.push(ei("paragraph_close","p",-1,0))}function ZK(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function $g(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function XK(e,t){const n=ei("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function QK(e,t,n){const o=ei("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=ei("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=ei("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new Co("text","",0);r.content=t,i.children=[r],e.push(i);const l=ei("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=ei("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function JK(e){const t=ei("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function eG(e,t,n,o){if(!bS(e,t,n))return null;const s=e.slice(t+3,n);if(s.includes("`"))return null;const i=n<e.length?n+1:n;let r=i,l=i,a=o+1;for(;l<e.length;){const c=kd(e,l);if(bS(e,l,c)&&_p(e,l+3,c)){const u=ei("fence","code",0,0);return u.map=[o,a+1],u.markup="```",u.info=s,u.content=e.slice(i,r),{token:u,nextPos:c<e.length?c+1:c,nextLine:a+1}}l=c<e.length?c+1:c,r=l,a++}return null}function tG(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?xS:Lg,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=kd(e,r);if(r===a){r=a<e.length?a+1:a,l++;continue}const c=e.charCodeAt(r);if(c===32||c===9){if(!_p(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!GK(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=$g(e,h),l+=1+r-h;continue}if(c===45){if(!Ng(e,r,a))return null;const h=l;let p=r,m=l,k=null,y=null;for(;p<e.length;){const b=kd(e,p);if(!Ng(e,p,b))break;const A=p+2,I=b===A+1?e[A]:e.slice(A,b);if(!jK(I))return null;k===null&&(k=XK(t,h)),y=QK(t,I,m),p=b<e.length?b+1:b,m++}if(k===null||y===null)return null;let g=p,v=m;for(;g<e.length;){if(e.charCodeAt(g)===10){g++,v++;continue}const b=kd(e,g);if(!_p(e,g,b)){if(Ng(e,g,b))return null;break}g=b<e.length?b+1:b,v++}k.map[1]=v,y.map[1]=v,JK(t),r=g,l=v;continue}if(c===96){const h=eG(e,r,a,l);if(!h)return null;t.push(h.token),r=$g(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=ZK(e,r,a);let d;if(n===Lg?d=ym(u):n===Ig&&u===o?d=s:(d=ym(u),n===xS?(i&&(n=u===o?Ig:Lg),o=u,s=d,i=!0):n===Ig&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!_p(e,f,kd(e,f)))return null;YK(t,u,l),r=$g(e,f),l+=1+r-f}return t}const nG=/[&<>"]/,wS=/[&<>"]/g,oG=/&/g,sG=/[<>"]/g,iG={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Fg(e){return iG[e]||e}function Un(e){if(e.length===0)return"";if(e.length<32)return nG.test(e)?e.replace(wS,Fg):e;const t=e.includes("&"),n=e.includes("<"),o=e.includes(">"),s=e.includes('"');return!t&&!n&&!o&&!s?e:t&&!n&&!o&&!s?e.replace(oG,"&amp;"):t?e.replace(wS,Fg):e.replace(sG,Fg)}const rG=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),lG=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function f5(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(rG,(t,n,o)=>{if(n)return n;if(lG.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return F1(i)?mf(i):"�"}const s=e2(t);return s!==t?s:t})}const aG=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,cG=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,uG=/"/g;function jc(e,t){const n=e.indexOf(`
99
+ `,t);return n===-1?e.length:n}function km(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9)return!1}return!0}function zh(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function dG(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!km(e,t,jc(e,t))}function _S(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function fG(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function m2(e){return cG.test(e)?aG.test(e)?null:e.replace(uG,"&quot;"):e}function hG(e,t,n){let o=0,s=t;for(;s<n&&e.charCodeAt(s)===35&&o<6;)s++,o++;if(o===0||s>=n||e.charCodeAt(s)!==32)return null;let i=s+1;for(;i<n&&e.charCodeAt(i)===32;)i++;let r=n;for(;r>i&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>i&&e.charCodeAt(l-1)===35;)l--;if(l>i&&e.charCodeAt(l-1)===32)for(r=l-1;r>i&&e.charCodeAt(r-1)===32;)r--;const a=m2(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
100
+ `}function SS(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function pG(e,t){switch(e.charCodeAt(t)){case 34:return`<li>&quot;</li>
101
+ `;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`<li>${e[t]}</li>
102
+ `}function mG(e,t,n){const o=t+2;if(n===o+1)return pG(e,o);const s=m2(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
103
+ `}function gG(e,t,n){for(;t<n;){const s=e.charCodeAt(t);if(s!==32&&s!==9)break;t++}for(;n>t;){const s=e.charCodeAt(n-1);if(s!==32&&s!==9)break;n--}let o=n;for(let s=t;s<n;s++){const i=e.charCodeAt(s);if(i===96)return null;if(i===32||i===9){o=s;break}}return e.slice(t,o)}function vG(e,t,n,o){if(!_S(e,t,n))return null;const s=gG(e,t+3,n);if(s===null)return null;const i=n<e.length?n+1:n;let r=i,l=i;for(;l<e.length;){const a=jc(e,l);if(_S(e,l,a)&&km(e,l+3,a)){const c=e.slice(i,r);let u;return s===o.lang?u=o.open:(u=s?`<pre><code class="language-${Un(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${Un(c)}</code></pre>
104
+ `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function CS(e){if(e.length===0)return"";if(e.includes("\r")||e.includes("\0"))return null;let t=0,n="";const o=e.length>=25e4,s=[],i={lang:"",open:"<pre><code>"};let r="",l="",a="",c="";for(;t<e.length;){const u=jc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!km(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const m=hG(e,t,u);if(m===null)return null;o?s.push(m):n+=m,t=zh(e,u<e.length?u+1:u);continue}if(d===45){let m=t;for(;m<e.length;){const v=jc(e,m);if(!SS(e,m,v))break;m=v<e.length?v+1:v}if(m===t)return null;const k=e.slice(t,m);let y;if(k===r)y=l;else{let v=t;for(y=`<ul>
105
+ `;v<m;){const b=jc(e,v),A=mG(e,v,b);if(A===null)return null;y+=A,v=b<e.length?b+1:b}y+=`</ul>
106
+ `,r=k,l=y}let g=zh(e,m);for(;g<e.length;){if(e.charCodeAt(g)===10){g++;continue}const v=jc(e,g);if(!km(e,g,v)){if(SS(e,g,v))return null;break}g=v<e.length?v+1:v}o?s.push(y):n+=y,t=g;continue}if(d===96){const m=vG(e,t,u,i);if(!m)return null;o?s.push(m.html):n+=m.html,t=zh(e,m.nextPos);continue}const f=fG(e,t,u);let h;if(f===a)h=c;else{const m=m2(f);if(m===null)return null;h=`<p>${m}</p>
107
+ `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&dG(e,p))return null;o?s.push(h):n+=h,t=zh(e,p)}return o?s.join(""):n}const yG={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function bm(e,t,n={},o){fs(n);const s={...yG,...o||{}},i=Ls(t);if(s.fallbackOnGlobalState!==!1&&i)return Ag(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),iu(n,i,()=>e.core.parse(t,n,e).tokens);let r=Sp(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=wG(r,s.maxChunks)),Cp(t,r))return Ag(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),iu(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return Ag(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),iu(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),f=e.core.parse(d,n,e).tokens;l!==0&&f.length&&bG(f,l),xG(a,f),l+=u.lineCount}return a})}function Sp(e,t,n=!0){const o=[];let s=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(f){f<=r||(o.push({start:r,end:f,lineCount:l}),r=f,s=0,i=0,l=0)}for(let f=0;f<e.length;){let h=e.indexOf(`
108
+ `,f),p=h;h===-1?(h=e.length,p=e.length):p=h+1;const m=_G(e,f,h);if(t.fenceAware){let g=f;for(;g<h;){const b=e.charCodeAt(g);if(b===32||b===9)g++;else break}const v=e[g];if(v==="`"||v==="~"){let b=g;for(;b<h&&e[b]===v;)b++;const A=b-g;A>=3&&(u?u.marker===v&&A>=u.length&&(u=null):u={marker:v,length:A})}}const k=p-f;s+=k,i+=1,l+=1,m?(a=0,c=0):(a+=1,c+=k);const y=m;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(y)d(p);else{const g=Math.max(10,Math.floor(t.maxChunkLines*.5)),v=Math.max(t.maxChunkChars,8e3);(a>=g||c>=v)&&d(p)}f=p}return n&&d(e.length),o}function Cp(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!kG(e,t[s].end))return!0;return!1}function kG(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let o=n+1;o<t-1;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function bG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function xG(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function wG(e,t){if(e.length<=t)return e;const n=[];let o=0;for(let s=0;s<t;s++){const i=t-s,r=e.length-o,l=Math.ceil(r/i),a=e.slice(o,o+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),o+=l}return n}function _G(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}const h5=4e6,p5=8e4,SG=1e4,CG=200,AG=1e4,MG=200;function m5(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function EG(e,t){if(t===0)return;const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);for(;n.length;){const o=n.pop();if(o.map&&(o.map[0]+=t,o.map[1]+=t),o.children)for(let s=o.children.length-1;s>=0;s--)n.push(o.children[s])}}function ul(e){return e.length===0?0:uo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function TG(e,t,n){for(let o=t;o<n;o++){const s=e.charCodeAt(o);if(s!==32&&s!==9&&s!==13)return!1}return!0}function NG(e,t){if(!t||e.length===0)return!1;let n=null;for(let o=0;o<e.length;){let s=e.indexOf(`
109
+ `,o);s===-1&&(s=e.length);let i=o;for(;i<s;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<s&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}o=s===e.length?e.length:s+1}return n!==null}function IG(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return TG(e,n+1,e.length-1)?!NG(e,t):!1}function LG(e,t,n,o={}){const s=o.mode??"full",i=o.fenceAware??(s==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(o.maxChunkChars!==void 0||o.maxChunkLines!==void 0||o.autoTune===!1){const r=o.maxChunkChars??(s==="stream"?e.options.streamChunkSizeChars??AG:e.options.fullChunkSizeChars??SG),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??MG:e.options.fullChunkSizeLines??CG);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return s==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var Bf=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=ul(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=Sp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(Cp(this.pending,o,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const s=this.commitRanges(o,e);return this.pending=this.pending.slice(s),this.updateEnvDiagnostics(e,t,ul(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!IG(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const n=Sp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,ul(this.pending)),null;const o=Cp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;return this.commitRanges(o,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const o=this.resolveWindow();return this.updateEnvDiagnostics(e,o,0),this.tokens}const t=this.resolveWindow(),n=Sp(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=Cp(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:ul(this.pending)}]:n;this.commitRanges(o,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:ul(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+ul(this.pending);return LG(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Of(e)&&Zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ls(t);n&&(l2(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let o=0;o<e.length;o++){const s=e[o],i=this.pending.slice(s.start,s.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&EG(r,a),this.options.retainTokens!==!1&&m5(this.tokens,r),this.committedChars+=i.length,this.committedLines+=s.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:s.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=s.end}return this.markedGlobalStateReason&&a2(t),n}catch(o){throw this.markedGlobalStateReason&&(Zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){F6(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function $G(e,t,n={},o={}){fs(n);const s=new Bf(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function FG(e,t,n={},o={}){fs(n);const s=new Bf(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function OG(e,t,n,o={},s={}){fs(o);const i=new Bf(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}async function BG(e,t,n,o={},s={}){fs(o);const i=new Bf(e,{mode:"full",...s,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(o);return i.flushForce(o),i.stats()}function g5(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??h5,s=e.options.autoUnboundedThresholdLines??p5;return t>=o||n>=s}function v5(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??h5))return"yes";const o=e.options.autoUnboundedThresholdLines??p5;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function Bd(e,t,n={},o={}){fs(n);const s=Ls(t);if(Of(n)&&Zr(n),o.fallbackOnGlobalState!==!1&&s)return F6(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:uo(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),iu(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Bf(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){m5(i,l)}});if(s&&l2(n,s),r.feed(t),r.flushForce(n),s&&(a2(n),o.fallbackOnGlobalState===!1)){const l=Lr(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const lu=(e,t,n)=>e<t?t:e>n?n:e;function y5(e){return e.experimental?{...e,...e.experimental}:e}const AS=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],MS=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function k5(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function RG(e,t=Math.max(0,e/40|0),n={}){const o=y5(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<AS.length;l++){const a=AS[l];if(e<=a.max){if(a.strategy!=="adaptive")return k5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:lu(Math.ceil(e/i),8e3,64e3),maxChunkLines:lu(Math.ceil(t/i),150,700),maxChunks:lu(Math.ceil(e/64e3),i,16),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.fullChunkSizeChars??1e4,maxChunkLines:o.fullChunkSizeLines??200,fenceAware:s,maxChunks:o.fullChunkMaxChunks}}function ES(e,t=Math.max(0,e/40|0),n={}){const o=y5(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<MS.length;l++){const a=MS[l];if(e<=a.max){if(a.strategy!=="adaptive")return k5(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:lu(Math.ceil(e/i),8e3,64e3),maxChunkLines:lu(Math.ceil(t/i),150,700),maxChunks:lu(Math.ceil(e/64e3),i,32),fenceAware:s,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:o.streamChunkSizeChars??1e4,maxChunkLines:o.streamChunkSizeLines??200,maxChunks:o.streamChunkMaxChunks,fenceAware:s}}var DG={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},PG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},HG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function D1(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ap(e,t){if(D1(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const TS=e=>D1(e)?e:Promise.resolve(e);function Rd(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Un(e)}}function Hl(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${Rd(t[0])}="${Un(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${Rd(s[0])}="${Un(s[1])}"`}return n}function b5(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const o=e.charCodeAt(t);if(o===32||o===9||o===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const o=e.charCodeAt(n);if(o!==32&&o!==9&&o!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function Dd(e,t,n,o,s){if(t.indexOf("<pre")===0)return`${t}
110
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${Un(`${s.langPrefix??"language-"}${o}`)}">${t}</code></pre>
111
+ `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${s.langPrefix??"language-"}${o}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${Hl(r)}>${t}</code></pre>
112
+ `}return`<pre><code${Hl(e.attrs)}>${t}</code></pre>
113
+ `}function xm(e){return!e.attrs||e.attrs.length===0?`<code>${Un(e.content)}</code>`:`<code${Hl(e.attrs)}>${Un(e.content)}</code>`}function Cy(e){const t=Un(e.content);return e.attrs?`<pre${Hl(e.attrs)}><code>${t}</code></pre>
114
+ `:`<pre><code>${t}</code></pre>
115
+ `}function WG(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${Un(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${Un(n[0][1])}">`}return null}function NS(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${Rd(t[0][0])}="${Un(t[0][1])}">`:t.length===2?`<a ${Rd(t[0][0])}="${Un(t[0][1])}" ${Rd(t[1][0])}="${Un(t[1][1])}">`:`<a${Hl(t)}>`}function zG(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function IS(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function wm(e,t){if(e.hidden)return"";const n=e.attrs,o=e.nesting,s=e.tag;if(!n||n.length===0)return o===0?t?`<${s} />`:`<${s}>`:o===-1?`</${s}>`:`<${s}>`;let i=(o===-1?"</":"<")+s+Hl(n);return o===0&&t&&(i+=" /"),`${i}>`}const UG={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Uh=Object.prototype.hasOwnProperty,Wn={code_inline(e,t){return xm(e[t])},code_block(e,t){return Cy(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?f5(i.info).trim():"",{langName:l,langAttrs:a}=b5(r),c=n.highlight,u=Un(i.content);if(!c)return Dd(i,u,r,l,n);const d=c(i.content,l,a);return D1(d)?d.then(f=>Dd(i,f||u,r,l,n)):Dd(i,d||u,r,l,n)},image(e,t,n,o,s){const i=e[t],r=s.renderInlineAsText(i.children||[],n,o),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],wm(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
116
+ `:`<br>
117
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
118
+ `:`<br>
119
+ `:`
120
+ `},text(e,t){return Un(e[t].content)},text_special(e,t){return Un(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function LS(e,t,n){const o=e.info?f5(e.info).trim():"",{langName:s,langAttrs:i}=b5(o),r=t.highlight,l=Un(e.content);if(!r)return Dd(e,l,o,s,t);const a=r(e.content,s,i);if(D1(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return Dd(e,a||l,o,s,t)}function qh(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Wn.text)return l.content.length===0?"":Un(l.content);break;case"text_special":if(s.text_special===Wn.text_special)return l.content.length===0?"":Un(l.content);break;case"softbreak":if(s.softbreak===Wn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Wn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Wn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Wn.code_inline)return xm(l);break}const a=s[l.type];if(!a)return wm(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Ap(c,l.type)}var qG=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Wn}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const o=this.mergeOptions(t),s=n??{},i=this.rules,r=o.xhtmlOut===!0;let l,a,c,u,d,f,h="",p="",m=!1,k="";for(let y=0;y<e.length;y++){const g=e[y],v=g.type,b=y>0&&e[y-1].hidden?`
121
+ `:"";if(v==="list_item_open"&&(!g.attrs||g.attrs.length===0)&&y+3<e.length){const T=e[y+1],M=e[y+2],$=e[y+3];if(T.type==="paragraph_open"&&T.hidden&&M.type==="inline"&&$.type==="paragraph_close"&&$.hidden){k+=`${b}<li>${this.renderInlineTokens(M.children||[],o,s)}`,y+=3;continue}}if(y+2<e.length){const T=e[y+1],M=e[y+2];if(T.type==="inline"&&M.nesting===-1&&M.tag===g.tag&&!M.hidden){const $=WG(g,b);if($!==null){k+=`${$+this.renderInlineTokens(T.children||[],o,s)}</${g.tag}>
122
+ `,y+=2;continue}}}if(v==="inline"){const T=g.children||[];if(T.length===1){m||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,f=i.code_inline,h=o.xhtmlOut?`<br />
123
+ `:`<br>
124
+ `,p=o.breaks?h:`
125
+ `,m=!0);const M=T[0];switch(M.type){case"text":if(l===Wn.text){k+=Un(M.content);continue}break;case"text_special":if(a===Wn.text_special){k+=Un(M.content);continue}break;case"softbreak":if(c===Wn.softbreak){k+=p;continue}break;case"hardbreak":if(u===Wn.hardbreak){k+=h;continue}break;case"html_inline":if(d===Wn.html_inline){k+=M.content;continue}break;case"code_inline":if(f===Wn.code_inline){k+=xm(M);continue}break}}k+=this.renderInlineTokens(T,o,s);continue}const A=i[v];if(!A){const T=g.attrs;if(!g.hidden){if(!T||T.length===0)switch(v){case"hr":k+=r?`<hr />
126
+ `:`<hr>
127
+ `;continue;case"heading_open":k+=`<${g.tag}>`;continue;case"heading_close":k+=`</${g.tag}>
128
+ `;continue;case"paragraph_open":k+=`${b}<p>`;continue;case"paragraph_close":k+=`</p>
129
+ `;continue;case"list_item_open":{const M=e[y+1];k+=b+(M&&(M.type==="inline"||M.hidden||M.nesting===-1&&M.tag==="li")?"<li>":`<li>
130
+ `);continue}case"list_item_close":k+=`</li>
131
+ `;continue;case"bullet_list_open":k+=`${b}<ul>
132
+ `;continue;case"bullet_list_close":k+=`</ul>
133
+ `;continue;case"blockquote_open":k+=b+(e[y+1]&&e[y+1].nesting===-1&&e[y+1].tag==="blockquote"?"<blockquote>":`<blockquote>
134
+ `);continue;case"blockquote_close":k+=`</blockquote>
135
+ `;continue;case"ordered_list_open":k+=`${b}<ol>
136
+ `;continue;case"ordered_list_close":k+=`</ol>
137
+ `;continue;case"table_open":k+=`${b}<table>
138
+ `;continue;case"table_close":k+=`</table>
139
+ `;continue;case"thead_open":k+=`${b}<thead>
140
+ `;continue;case"thead_close":k+=`</thead>
141
+ `;continue;case"tbody_open":k+=`${b}<tbody>
142
+ `;continue;case"tbody_close":k+=`</tbody>
143
+ `;continue;case"tr_open":k+=`${b}<tr>
144
+ `;continue;case"tr_close":k+=`</tr>
145
+ `;continue;case"td_open":k+=`${b}<td>`;continue;case"td_close":k+=`</td>
146
+ `;continue;case"th_open":k+=`${b}<th>`;continue;case"th_close":k+=`</th>
147
+ `;continue}else if(T.length===1){const M=T[0];if(v==="ordered_list_open"&&M[0]==="start"){k+=`${b}<ol start="${Un(M[1])}">
148
+ `;continue}if(v==="td_open"&&M[0]==="style"){k+=`${b}<td style="${Un(M[1])}">`;continue}if(v==="th_open"&&M[0]==="style"){k+=`${b}<th style="${Un(M[1])}">`;continue}}}k+=this.renderToken(e,y,o);continue}if(v==="code_block"&&A===Wn.code_block){k+=Cy(g);continue}if(v==="fence"&&A===Wn.fence){k+=LS(g,o);continue}if(v==="html_block"&&A===Wn.html_block){k+=g.content;continue}const I=A(e,y,o,s,this);typeof I=="string"?k+=I:k+=Ap(I,g.type)}return k}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const o=this.mergeOptions(t),s=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],o,s);continue}const c=i[a.type];c?r+=await TS(c(e,l,o,s,this)):r+=this.renderToken(e,l,o)}return r}renderInline(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokens(e,o,s)}async renderInlineAsync(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineTokensAsync(e,o,s)}renderInlineAsText(e,t,n){const o=this.mergeOptions(t),s=n??{};return this.renderInlineAsTextInternal(e,o,s)}renderAttrs(e){return Hl(e.attrs)}renderToken(e,t,n){const o=e[t];if(o.hidden)return"";const s=o.block,i=o.nesting,r=o.tag,l=o.attrs;let a=!1;if(s&&(a=!0,i===1&&t+1<e.length)){const f=e[t+1];(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===r)&&(a=!1)}const c=s&&i!==-1&&t>0&&e[t-1].hidden?`
149
+ `:"",u=a?`>
150
+ `:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+Hl(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const o=()=>(n||(n={...t}),n);if(Uh.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Uh.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Uh.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Uh.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...UG,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Wn.code_block)return Cy(t);if(i==="html_block"&&s.html_block===Wn.html_block)return t.content;const r=this.mergeOptions(n),l=o??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=s[i];if(!a)return t.block?this.renderToken(e,0,r):wm(t,r.xhtmlOut===!0);if(i==="fence"&&a===Wn.fence)return LS(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Ap(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const o=this.rules,s=o.text,i=o.text_special,r=o.softbreak,l=o.hardbreak,a=o.html_inline,c=o.code_inline,u=o.link_open,d=o.link_close,f=o.em_open,h=o.em_close,p=o.strong_open,m=o.strong_close,k=t.xhtmlOut===!0,y=k?`<br />
151
+ `:`<br>
152
+ `,g=t.breaks?y:`
153
+ `;if(e.length===1)return qh(e,t,n,this,o,y,g);let v="";for(let b=0;b<e.length;b++){const A=e[b];if(A.type==="link_open"&&!u&&!d&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="link_close"&&zG(M)){const $=`${NS(A)+qh([M],t,n,this,o,y,g)}</a>`;if(r===Wn.softbreak&&b+3<e.length&&e[b+3].type==="softbreak"){v+=$+g,b+=3;continue}v+=$,b+=2;continue}}if(A.type==="link_open"&&!u&&!d&&b+1<e.length&&e[b+1].type==="link_close"){v+=`${NS(A)}</a>`,b+=1;continue}if(A.type==="em_open"&&!f&&!h&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="em_close"&&IS(M)){v+=`<em>${qh([M],t,n,this,o,y,g)}</em>`,b+=2;continue}}if(A.type==="strong_open"&&!p&&!m&&b+2<e.length){const M=e[b+1];if(e[b+2].type==="strong_close"&&IS(M)){v+=`<strong>${qh([M],t,n,this,o,y,g)}</strong>`,b+=2;continue}}switch(A.type){case"text":if(s===Wn.text){const M=A.content.length===0?"":Un(A.content);if(a===Wn.html_inline&&b+1<e.length&&e[b+1].type==="html_inline"){for(v+=M+e[++b].content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}v+=M;continue}break;case"text_special":if(i===Wn.text_special){A.content.length!==0&&(v+=Un(A.content));continue}break;case"softbreak":if(r===Wn.softbreak){v+=g;continue}break;case"hardbreak":if(l===Wn.hardbreak){v+=y;continue}break;case"html_inline":if(a===Wn.html_inline){for(v+=A.content;b+1<e.length&&e[b+1].type==="html_inline";)v+=e[++b].content;continue}break;case"code_inline":if(c===Wn.code_inline){v+=xm(A);continue}break}const I=o[A.type];if(!I){v+=A.block?this.renderToken(e,b,t):wm(A,k);continue}const T=I(e,b,t,n,this);typeof T=="string"?v+=T:v+=Ap(T,A.type)}return v}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const o=this.rules;let s="";for(let i=0;i<e.length;i++){const r=o[e[i].type];r?s+=await TS(r(e,i,t,n,this)):s+=this.renderToken(e,i,t)}return s}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let o="";for(let s=0;s<e.length;s++){const i=e[s];switch(i.type){case"text":case"text_special":o+=i.content;break;case"image":o+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":o+=i.content;break;case"softbreak":case"hardbreak":o+=`
154
+ `;break}}return o}},jG=qG;const VG=[],Og=4096;function KG(e){const t=e.length;let n=0;for(;n<=t;){let o=e.indexOf(`
155
+ `,n);o===-1&&(o=t);const s=o<t;let i=n,r=0;for(;i<o;){const l=e.charCodeAt(i);if(l===32){if(r++,i++,r>=4)return!0;continue}if(l===9){if(r+=4-r%4,i++,r>=4)return!0;continue}break}if(i<o){const l=e.charCodeAt(i);switch(l){case 35:{let a=i;for(;a<o&&e.charCodeAt(a)===35;)a++;const c=a-i;if(c>0&&c<=6){if(a<o){const u=e.charCodeAt(a);if(u===32||u===9||u===13)return!0}else if(a===o&&s)return!0}break}case 62:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 45:case 42:case 43:{const a=i+1;if(a<o){const c=e.charCodeAt(a);if(c===32||c===9||c===13)return!0}else if(a===o&&s)return!0;break}case 96:case 126:{let a=i;for(;a<o&&e.charCodeAt(a)===l;)a++;if(a-i>=3)return!0;break}default:if(l>=48&&l<=57){let a=i+1;for(;a<o;){const c=e.charCodeAt(a);if(c<48||c>57)break;a++}if(a<o&&e.charCodeAt(a)===46){const c=a+1;if(c<o){const u=e.charCodeAt(c);if(u===32||u===9||u===13)return!0}else if(c===o&&s)return!0}}break}}if(o===t)break;n=o+1}return!1}function GG(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function YG(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!x5(e[n],t[n]))return!1;return!0}function x5(e,t){if(!e||!t||e.type!==t.type)return!1;const n=e.map,o=t.map;return!!n!=!!o||n&&o&&(n[0]!==o[0]||n[1]!==o[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!GG(e.attrs,t.attrs)||!YG(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function $S(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var ZG=class{core;cache=null;stats=$S();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=$S(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(fs(o??s?.env),!s||o&&o!==s.env){const R=o??{},z=!!n.__explicitStreamChunkFallbackSetting,W=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,L=!!n.options?.streamChunkedFallback,O=!z&&W,U=L||O,Z=n.options?.streamChunkAdaptive!==!1,ie=n.options?.streamChunkTargetChunks??8,q=n.options?.streamChunkSizeChars,ee=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,ne=!!n.__explicitStreamChunkConfig,j=n.options?.autoTuneChunks!==!1,K=n.options?.streamChunkFenceAware??!0,ve=n.options?.streamLargeCachePolicy??"retain",he=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Ae=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let re,Y=!1;if(ve==="skip"&&(Y=e.length>=he,!Y&&Ae!==void 0&&(re=uo(e),Y=re>=Ae)),Y){const P=this.parseFullDocument(e,R,n,re,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Lr(R)?.unbounded}),P.tokens}else if(U){const P=(pe,ke,Ne)=>pe<ke?ke:pe>Ne?Ne:pe;re===void 0&&(re=uo(e));const G=j&&!ne?ES(e.length,re,n.options):null,me=G?.maxChunkChars??(Z?P(Math.ceil(e.length/ie),8e3,64e3):q??1e4),ye=G?.maxChunkLines??(Z?P(Math.ceil(re/ie),150,700):ee??200),de=G?.maxChunks??(Z?P(Math.ceil(e.length/64e3),ie,32):fe),V=e.length>0&&e.charCodeAt(e.length-1)===10,se=O&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&G?.strategy!=="plain";if((L||se)&&(e.length>=me*2||re>=ye*2)&&V){const pe=bm(n,e,R,{maxChunkChars:me,maxChunkLines:ye,fenceAware:G?.fenceAware??K,maxChunks:de});return this.cache={src:e,tokens:pe,env:R,lineCount:re,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,re),this.recordChunkedParseResult(R,L?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const Q=this.parseFullDocument(e,R,n,re);return re=Q.lineCount,this.cache={src:e,tokens:Q.tokens,env:R,lineCount:re,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,re),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Lr(R)?.unbounded}),Q.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",wo(s.env,{area:"stream",path:"stream-cache",reason:"same-source"}),s.tokens;const i=e.startsWith(s.src)?e.slice(s.src.length):null;let r=s.globalStateReason;r===void 0&&(r=Ls(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ls(e),a=r||l;if(a){const R=o??s.env;Zr(R);const z=Ls(e),W=this.parseFullDocument(e,R,n),L=W.tokens,O=W.lineCount;return this.cache={src:e,tokens:L,env:R,lineCount:O,lastSegment:void 0,globalStateReason:z},this.updateCacheLineCount(this.cache,O),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(R,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Lr(R)?.unbounded}),L}const c=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(s.src.length<c&&e.length<c*1.5&&!e.startsWith(s.src)){const R=o??s.env,z=this.parseFullDocument(e,R,n),W=z.tokens,L=z.lineCount;return this.cache={src:e,tokens:W,env:R,lineCount:L,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,L),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(R,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!Lr(R)?.unbounded}),W}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const R=s.lineCount??uo(s.src);let z=3;u.length>5e3?z=8:u.length>1e3?z=6:u.length>200&&(z=4),z=Math.min(z,R);let W=null;const L=n.options?.streamContextParseStrategy??"chars",O=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Z;const ie=()=>(Z===void 0&&(Z=uo(u)),Z),q=this.canDirectlyParseAppend(s),ee=q&&this.shouldUseUnboundedAppend(e,s,u);let fe=!1;if(!q)switch(L){case"lines":fe=ie()>=U;break;case"constructs":if(u.length>=O){fe=!0;break}if(KG(u)){fe=!0;break}fe=ie()>=U;break;case"chars":default:fe=u.length>=O}if(z>0&&fe){const K=this.getTailLines(s.src,z)+u;try{const ve=this.core.parse(K,s.env,n).tokens,he=ve.findIndex(Ae=>Ae.map&&typeof Ae.map[1]=="number"&&Ae.map[1]>z);if(he!==-1){const Ae=ve.slice(he),re=R-z;re!==0&&this.shiftTokenLines(Ae,re),W={tokens:Ae}}}catch{W=null}}else W=null;if(!W){const K=R;if(ee)W={tokens:Bd(n,u,s.env,{mode:"stream"})},K>0&&this.shiftTokenLines(W.tokens,K);else{const ve=this.core.parse(u,s.env,n);K>0&&this.shiftTokenLines(ve.tokens,K),W=ve}}let ne=0;if(s.tokens.length>0&&W.tokens.length>0){const K=s.tokens[s.tokens.length-1],ve=W.tokens[0];try{K.type==="inline"&&ve.type==="inline"&&(ve.children&&ve.children.length>0&&(K.children||(K.children=[]),this.appendTokens(K.children,ve.children)),K.content=(K.content||"")+(ve.content||""),ne=1)}catch{ne=0}}const j=s.tokens.length;if(W.tokens.length>ne){const K=s.tokens,ve=W.tokens,he=Math.min(K.length,ve.length-ne);let Ae=0;for(let re=he;re>0;re--){let Y=!0;for(let Q=0;Q<re;Q++){const P=K[K.length-re+Q],G=ve[ne+Q];if(!x5(P,G)){Y=!1;break}}if(Y){Ae=re;break}}Ae>0&&(ne+=Ae),ve.length>ne&&this.appendTokens(s.tokens,ve,ne)}if(s.src=e,s.globalStateReason=null,s.lineCount=R+(Z??ie()),s.tokens.length>j){const K=this.getLastSegment(s.tokens,e,j,s.tokens.length,e.length-u.length,R);K?s.lastSegment=K:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ee&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",wo(s.env,{area:"stream",path:ee?"stream-unbounded-append":"stream-append",reason:ee?"large-delta":"safe-append",unbounded:ee}),s.tokens}const d=o??s.env,f=this.tryTailSegmentReparse(e,s,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",wo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,m=!!n.options?.streamChunkedFallback,k=!h&&!u&&p,y=m||k,g=n.options?.streamChunkAdaptive!==!1,v=n.options?.streamChunkTargetChunks??8,b=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,I=n.options?.streamChunkMaxChunks,T=!!n.__explicitStreamChunkConfig,M=n.options?.autoTuneChunks!==!1,$=n.options?.streamChunkFenceAware??!0;let N=u&&s.lineCount!==void 0?s.lineCount+uo(u):void 0;if(y){N===void 0&&(N=uo(e));const R=(ie,q,ee)=>ie<q?q:ie>ee?ee:ie,z=M&&!T?ES(e.length,N,n.options):null,W=z?.maxChunkChars??(g?R(Math.ceil(e.length/v),8e3,64e3):b??1e4),L=z?.maxChunkLines??(g?R(Math.ceil(N/v),150,700):A??200),O=z?.maxChunks??(g?R(Math.ceil(e.length/64e3),v,32):I),U=e.length>0&&e.charCodeAt(e.length-1)===10,Z=k&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&z?.strategy!=="plain";if((m||Z)&&(e.length>=W*2||N>=L*2)&&U){const ie=bm(n,e,d,{maxChunkChars:W,maxChunkLines:L,fenceAware:z?.fenceAware??$,maxChunks:O});return this.cache={src:e,tokens:ie,env:d,lineCount:N,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,N),this.recordChunkedParseResult(d,m?"explicit-fallback-large-doc":"default-fallback-large-doc"),ie}}const F=this.parseFullDocument(e,d,n,N),S=F.tokens;return N=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:N,lastSegment:void 0,globalStateReason:Ls(e)},this.updateCacheLineCount(this.cache,N),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",wo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Lr(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=Lr(e)?.chunk,o=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,o){this.stats.fullParses+=1,this.stats.lastMode="full",wo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!Lr(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",wo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ls(e);Of(t)&&Zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?v5(n,e.length,o):"no";if(r==="yes"){const a=Bd(n,e,t);return wo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?uo(e):0)}}let l=o;if(r==="need-lines"&&(l=uo(e),g5(n,e.length,l))){const a=Bd(n,e,t);return wo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?uo(e):0),{tokens:iu(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:uo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(`
156
+ `))return null;const o=n??t.slice(e.length);if(!o)return null;const s=o.length;if(o.charCodeAt(s-1)!==10)return null;let i=0,r=-1;for(let a=0;a<s&&!(o.charCodeAt(a)===10&&(r===-1&&(r=a),i++,i>=2));a++);if(i<2)return null;const l=(r===-1?o:o.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),c=a.lastIndexOf(`
157
+ `);if(a.slice(c+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(o)?null:o}tryTailSegmentReparse(e,t,n,o){const s=this.ensureLastSegment(t);if(!s||s.srcOffset<=0&&s.tokenStart<=0)return null;const i=t.src.slice(0,s.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(s.srcOffset),l=e.slice(s.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,o,s,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,o),u=this.getLastSegment(c.tokens,l);return s.lineStart>0&&this.shiftTokenLines(c.tokens,s.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=s.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=s.lineStart+uo(l),u?t.lastSegment={tokenStart:s.tokenStart+u.tokenStart,tokenEnd:s.tokenStart+u.tokenEnd,lineStart:s.lineStart+u.lineStart,lineEnd:s.lineStart+u.lineEnd,srcOffset:s.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let o=e.length-1;o>=0;o--)if(e.charCodeAt(o)===10&&(n--,n===0))return e.slice(o+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,o=e.slice(n),s=o.length;let i=null,r=0;for(;r<=s;){let l=o.indexOf(`
158
+ `,r);l===-1&&(l=s);let a=r;for(;a<l;){const c=o.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=o.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&o.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===s)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??VG}getStats(){return{...this.stats}}appendTokens(e,t,n=0,o=t.length){for(let s=n;s<o;s++)e.push(t[s])}updateCacheLineCount(e,t){e.lineCount=t??uo(e.src),e.lastSegment=void 0,e.globalStateCarry=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;const n=(e.globalStateCarry??e.src.slice(-Og))+t,o=Ls(n);return e.globalStateCarry=n.length>Og?n.slice(n.length-Og):n,o&&(e.globalStateReason=o),o}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,o=e.length,s,i){if(o<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let c=o-1;c>=n;c--){const u=e[c];if(u.map&&(u.map[0]<r&&(r=u.map[0]),u.map[1]>l&&(l=u.map[1])),u.nesting<0){a+=-u.nesting;continue}if(u.nesting>0){if(a-=u.nesting,u.level===0&&a<=0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}continue}if(u.level===0&&a===0){const d=Number.isFinite(r)?r:u.map?.[0]??0,f=l>=d?l:u.map?.[1]??d;return{tokenStart:c,tokenEnd:o,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,s,i)}}}return null}getLineStartOffset(e,t,n,o){if(n!==void 0&&o!==void 0&&t>=o)return this.getLineStartOffsetFrom(e,n,t-o);if(t<=0)return 0;let s=t,i=-1;for(;s>0;){if(i=e.indexOf(`
159
+ `,i+1),i===-1)return e.length;s--}return i+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let o=n,s=t-1;for(;o>0;){if(s=e.indexOf(`
160
+ `,s+1),s===-1)return e.length;o--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,o,s,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[s.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,o,s,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,o,s,i,r);default:return null}}tryListTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const f=t.lineCount??uo(t.src);f>0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,s.tokenStart,t.tokens.length,r.level),p=this.getListParagraphMode(u,0,u.length,0);(h==="loose"||p==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,s.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const m=f+uo(i);t.lineCount=m;const k=this.getDocLineCount(e,m);return r.map&&(r.map[1]=k),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:k,srcOffset:s.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,o,s,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=s.lineEnd-s.lineStart,a=t.src.length-s.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(s.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,o).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const f=this.getTableBodySection(d,0,d.length,0),h=this.getTableBodySection(t.tokens,s.tokenStart,t.tokens.length,r.level);if(!f||!h||f.tbodyOpenIndex<0||f.tbodyCloseIndex<0)return null;const p=h.tbodyOpenIndex>=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(p.length===0)return null;const m=s.lineEnd-2;m!==0&&this.shiftTokenLines(p,m);const k=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,y=t.lineCount??uo(t.src);t.tokens.splice(k,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const g=y+uo(i);t.lineCount=g;const v=this.getDocLineCount(e,g);if(r.map&&(r.map[1]=v),h.tbodyOpenIndex>=0){const b=t.tokens[h.tbodyOpenIndex];b?.map&&(b.map[1]=v)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:v,srcOffset:s.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
161
+ `);if(t<0)return null;const n=e.indexOf(`
162
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,o){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let s=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===o){s=l;break}}if(s<0)return null;let i=-1,r=-1;for(let l=t+1;l<s;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===o+1){i=l;break}}if(i>=0){for(let l=s-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===o+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:s,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,o){if(e.length<2)return!1;const s=e[0],i=e[e.length-1];if(s.type!==t||i.type!==n||s.level!==0||i.level!==0||o!==void 0&&s.markup!==o)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,o){let s=!1,i=!1;const r=o+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?s=!0:i=!0,s&&i))return"loose"}return i?"loose":s?"tight":"none"}setListParagraphVisibility(e,t,n,o,s){const i=o+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=s)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const o=e.charCodeAt(n);if(o===32||o===9){n--;continue}return o===10}return!0}getDocLineCount(e,t=uo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let o=0;o<e.length;o++){const s=e[o];if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children){n??=[];for(let i=s.children.length-1;i>=0;i--)n.push(s.children[i]);for(;n.length>0;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let r=i.children.length-1;r>=0;r--)n.push(i.children[r])}}}}};const FS={default:PG,zero:HG,commonmark:DG};function XG(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function QG(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function OS(e){return e.experimental?{...e,...e.experimental}:e}function ki(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function BS(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ki(t,s)||ki(e,s))return!0}return!1}function RS(e,t,n){return ki(t,n)||ki(e,n)}function DS(e,t){const n=Lr(e)?.chunk;if(n?.fallback){wo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}wo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function JG(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:"retain",streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},o="default",s;!t&&typeof e!="string"?(s=e,o="default"):typeof e=="string"&&(o=e,s=t);const i=FS[o];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${o}", check name`);if(i?.options&&(n={...n,...i.options}),s&&(n={...n,...s}),n=OS(n),typeof n.quotes=="string"){const M=n.quotes;M.length>=4?n.quotes=[M[0],M[1],M[2],M[3]]:n.quotes=["“","”","‘","’"]}let r=BS(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=BS(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=RS(i?.options,s,"fullChunkedFallback"),c=RS(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new UK;let p=null;const m=()=>(p||(p=new jG(n)),p);let k=null;const y=()=>(k||(k=new ZG(h)),k);let g=null;const v=()=>(g||(g=new R6),g),b=M=>!u&&!!d&&!QG(M,d),A=(M,$)=>o==="default"&&!u&&p===null&&f!==null&&M.parse===f&&b(M)&&!M.stream.enabled&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.xhtmlOut===!1&&M.options.breaks===!1&&M.options.langPrefix==="language-"&&M.options.linkify===!1&&M.options.typographer===!1&&M.options.highlight===null,I=(M,$)=>o==="default"&&!u&&b(M)&&!M.stream.enabled&&!M.options.fullChunkedFallback&&$<(M.options.autoUnboundedThresholdChars??4e6)&&M.options.html===!1&&M.options.linkify===!1&&M.options.typographer===!1,T={core:h,block:h.block,inline:h.inline,get linkify(){const M=v();return Object.defineProperty(this,"linkify",{value:M,writable:!0,configurable:!0}),M},get renderer(){const M=m();return Object.defineProperty(this,"renderer",{value:M,writable:!0,configurable:!0}),M},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return b(this)},set(M){const $=OS(M);return this.options={...this.options,...$},(ki(M,"fullChunkSizeChars")||ki(M,"fullChunkSizeLines")||ki(M,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ki(M,"streamChunkSizeChars")||ki(M,"streamChunkSizeLines")||ki(M,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ki(M,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ki(M,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,k&&(k.reset(),k.resetStats())),this},configure(M){const $=typeof M=="string"?FS[M]:M;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const N=$.components;N.core?.rules&&this.core.ruler.enableOnly(N.core.rules),N.block?.rules&&this.block.ruler.enableOnly(N.block.rules),N.inline?.rules&&this.inline.ruler.enableOnly(N.inline.rules),N.inline2?.rules&&this.inline.ruler2.enableOnly(N.inline2.rules)}return this},enable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const R of F){if(!R)continue;const z=R.enable(N,!0);for(let W=0;W<z.length;W++)S.add(z[W])}if(!$){const R=N.filter(z=>!S.has(z));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},disable(M,$){const N=Array.isArray(M)?M:[M],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const R of F){if(!R)continue;const z=R.disable(N,!0);for(let W=0;W<z.length;W++)S.add(z[W])}if(!$){const R=N.filter(z=>!S.has(z));if(R.length)throw new Error(`Rules manager: invalid rule name ${R.join(", ")}`)}return this},use(M,...$){const N=typeof M=="function"?M:M&&typeof M.default=="function"?M.default:void 0;if(!N)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...$],S=M;return u=!0,N.apply(S,F),this},render(M,$){if(A(this,M.length)){$!==void 0&&fs($);const S=CS(M);if(S!==null)return $!==void 0&&wo($,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=$??{},F=this.parse(M,N);return m().render(F,this.options,N)},async renderAsync(M,$){if(A(this,M.length)){$!==void 0&&fs($);const S=CS(M);if(S!==null)return $!==void 0&&wo($,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const N=$??{},F=this.parse(M,N);return m().renderAsync(F,this.options,N)},renderIterable(M,$={}){const N=this.parseIterable(M,$);return m().render(N,this.options,$)},async renderAsyncIterable(M,$={}){const N=await this.parseAsyncIterable(M,$);return m().renderAsync(N,this.options,$)},renderInline(M,$={}){const N=this.parseInline(M,$);return m().render(N,this.options,$)},validateLink:o5,normalizeLink:s5,normalizeLinkText:i5,utils:cj,helpers:{...Xj},parse(M,$){if(typeof M!="string")throw new TypeError("Input data should be a String");if($!==void 0&&fs($),I(this,M.length)){const R=tG(M);if(R!==null)return $!==void 0&&wo($,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const N=$??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){const R=v5(this,M.length);if(R==="yes"){const z=Bd(this,M,N);return wo($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),z}R==="need-lines"&&(F=uo(M))}if(!this.stream.enabled){const R=M.length,z=this.options.autoTuneChunks!==!1,W=r,L=!a&&b(this),O=!!this.options.fullChunkedFallback,U=L&&R>=2e5;let Z;(O||U||F!==void 0)&&(Z=F??uo(M));const ie=(O||U)&&z&&!W?RG(R,Z,this.options):null;if(O||U){const q=Z??0;if(O?R>=(this.options.fullChunkThresholdChars??2e4)||q>=(this.options.fullChunkThresholdLines??400):U){if(ie&&ie.strategy!=="plain"){const ee=bm(this,M,N,{maxChunkChars:ie.maxChunkChars,maxChunkLines:ie.maxChunkLines,fenceAware:ie.fenceAware,maxChunks:ie.maxChunks});return $&&DS($,O?"explicit-full-chunk":"default-large-string"),ee}if(O){const ee=(Y,Q,P)=>Y<Q?Q:Y>P?P:Y,fe=this.options.fullChunkAdaptive!==!1,ne=this.options.fullChunkTargetChunks??8,j=ee(Math.ceil(R/ne),8e3,64e3),K=ee(Math.ceil(q/ne),150,700),ve=fe?j:this.options.fullChunkSizeChars??1e4,he=fe?K:this.options.fullChunkSizeLines??200,Ae=fe?ee(Math.ceil(R/64e3),ne,32):this.options.fullChunkMaxChunks,re=bm(this,M,N,{maxChunkChars:ve,maxChunkLines:he,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ae});return $&&DS($,"explicit-full-chunk"),re}}}if(F!==void 0&&b(this)&&g5(this,R,Z??F)){const q=Bd(this,M,N);return wo($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),q}}const S=Ls(M);return wo($,{area:"parse",path:"plain",reason:"default-plain"}),iu(N,S,()=>h.parse(M,N,this).tokens)},parseIterable(M,$={}){return fs($),$G(this,M,$)},parseAsyncIterable(M,$={}){return fs($),FG(this,M,$)},parseIterableToSink(M,$,N={}){return fs(N),OG(this,M,$,N)},parseAsyncIterableToSink(M,$,N={}){return fs(N),BG(this,M,$,N)},parseInline(M,$={}){if(typeof M!="string")throw new TypeError("Input data should be a String");fs($),Of($)&&Zr($);const N=h.createState(M,$,this);return N.inlineMode=!0,h.process(N),N.tokens}};if(T.stream={enabled:!!n.stream,parse(M,$){return T.stream.enabled?y().parse(M,$,T):T.parse(M,$??{})},reset(){y().reset()},peek(){return k?k.peek():[]},stats(){return k?k.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){k&&k.resetStats()}},i?.components){const M=i.components;M.core?.rules&&T.core.ruler.enableOnly(M.core.rules),M.block?.rules&&T.block.ruler.enableOnly(M.block.rules),M.inline?.rules&&T.inline.ruler.enableOnly(M.inline.rules),M.inline2?.rules&&T.inline.ruler2.enableOnly(M.inline2.rules)}return d=XG(T),f=T.parse,T}var eY=JG;const w5=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],tY=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],_5=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],nY=["svg","g","path"],oY=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],sY=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],iY=["action","data","href","src","srcset","poster","xlink:href","formaction"],rY=["script"],lY=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Wl=new Set(w5),S5=new Set(_5),vf=new Set([...w5,...tY,..._5,...nY]),C5=new Set([...vf,...oY]),aY=new Set(sY),cY=new Set(iY),Rf=new Set(rY),A5=new Set(lY);function M5(e){let t="";for(const n of e){const o=n.charCodeAt(0);o<=31||o>=127&&o<=159||/\s/u.test(n)||(t+=n)}return t}const uY={amp:"&",bsol:"\\",colon:":",newline:`
163
+ `,sol:"/",tab:" "};function E5(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,o,s)=>{const i=n??o;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return uY[String(s??"").toLowerCase()]??t})}const jh=new Set(["http","https","mailto","tel"]),dY=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),da=new Set(["http","https"]);function T5(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const fY=/^https?:\/\//i;function hY(e){if(!fY.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function pY(e,t,n){if(!Pd(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function Pd(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function mY(e,t){return t==="href"||t==="xlink:href"?Pd(e,t)?jh:da:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?da:(Pd(e,t),jh)}function Ra(e,t={}){if(hY(e))return!1;const n=M5(E5(e)).toLowerCase(),o=String(t.tagName??"").toLowerCase(),s=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return o==="img"&&s==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=T5(n);return i?i==="file"?!pY(n,o,s):Pd(o,s)?dY.has(i):!mY(o,s).has(i):!1}function gY(e){const t=E5(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=T5(M5(t).toLowerCase());return n==="http"||n==="https"}function vY(e,t={}){const n=String(e??"").trim();return n?Ra(n,t)?"":n:""}function PS(e){return vY(e,{tagName:"img",attrName:"src"})}function yY(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,m,k){return f[h].nesting===1&&f[h].attrJoin("class",t),k.renderToken(f,h,p,m,k)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||o,u=n.render||s;function d(f,h,p,m){let k,y=!1,g=f.bMarks[h]+f.tShift[h],v=f.eMarks[h];if(l!==f.src.charCodeAt(g))return!1;for(k=g+1;k<=v&&r[(k-g)%a]===f.src[k];k++);const b=Math.floor((k-g)/a);if(b<i)return!1;k-=(k-g)%a;const A=f.src.slice(g,k),I=f.src.slice(k,v);if(!c(I,A))return!1;if(m)return!0;let T=h;for(;T++,!(T>=p||(g=f.bMarks[T]+f.tShift[T],v=f.eMarks[T],g<v&&f.sCount[T]<f.blkIndent));)if(l===f.src.charCodeAt(g)&&!(f.sCount[T]-f.blkIndent>=4)){for(k=g+1;k<=v&&r[(k-g)%a]===f.src[k];k++);if(!(Math.floor((k-g)/a)<b)&&(k-=(k-g)%a,k=f.skipSpaces(k),!(k<v))){y=!0;break}}const M=f.parentType,$=f.lineMax;f.parentType="container",f.lineMax=T;const N=f.push("container_"+t+"_open","div",1);N.markup=A,N.block=!0,N.info=I,N.map=[h,T],f.md.block.tokenize(f,h+1,T);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(g,k),F.block=!0,f.parentType=M,f.lineMax=$,f.line=T+(y?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function kY(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const o=[];let s="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){s+=c,a+1<n.length&&(s+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,s+=c;continue}if(!i&&c==='"'){r=!r,s+=c;continue}if(!i&&!r&&c===","){o.push(s.trim()),s="";continue}s+=c}s.trim()&&o.push(s.trim());const l={};for(const a of o){if(!a)continue;let c=!1,u=!1,d=-1;for(let k=0;k<a.length;k++){const y=a[k];if(y==="\\"){k++;continue}if(!u&&y==="'"){c=!c;continue}if(!c&&y==='"'){u=!u;continue}if(!c&&!u&&y===":"){d=k;break}}if(d===-1)return null;const f=a.slice(0,d).trim(),h=a.slice(d+1).trim();if(!f)return null;let p=f;if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))try{p=JSON.parse(p.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(p))return null;let m;if(!h)m="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{m=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{m=h}else/^-?\d+(?:\.\d+)?$/.test(h)?m=Number(h):h==="true"||h==="false"?m=h==="true":h==="null"?m=null:m=h;l[p]=m}return l}function N5(e,t,n){for(const o of e){const s=o,i=s.map;if(Array.isArray(i)&&i.length>=2){const r=Number(i[0]),l=Number(i[1]);Number.isFinite(r)&&Number.isFinite(l)&&(s.map=[r+t,Math.min(l+t,n)])}Array.isArray(s.children)&&N5(s.children,t,n)}}function bY(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(yY,t,{render(n,o){return n[o].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
164
+ `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,o,s)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let f,h;const p=d.indexOf("{"),m=p>=0?d.slice(p).trimStart():void 0;if(p===-1)f=d||void 0;else{if(f=d.slice(0,p).trim()||void 0,m?.startsWith("{")){let I=0,T=-1;for(let M=0;M<m.length;M++)if(m[M]==="{"?I++:m[M]==="}"&&I--,I===0){T=M+1;break}T>0&&(h=m.slice(0,T))}h||(f=d||void 0)}if(s)return!0;const k=!!i.env.__markstreamFinal;let y=n+1,g=!1;for(;y<=o;){const I=i.bMarks[y]+i.tShift[y],T=i.eMarks[y];if(i.src.slice(I,T).trim()===":::"){g=!0;break}y++}g||(y=o);const v=i.push("vmr_container_open","div",1);if(v.attrSet("class",`vmr-container vmr-container-${u}`),v.map=[n,g?y:o],v.meta={...v.meta??{},unclosed:!g&&!k},f&&v.attrSet("data-args",f),h)try{const I=JSON.parse(h);for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}}catch{const I=kY(h);if(I)for(const[T,M]of Object.entries(I)){const $=M!=null&&typeof M=="object";v.attrSet(`data-${T}`,$?JSON.stringify(M):String(M))}else v.attrSet("data-attrs",h)}const b=[];for(let I=n+1;I<y;I++){const T=i.bMarks[I]+i.tShift[I],M=i.eMarks[I];b.push(i.src.slice(T,M))}if(b.some(I=>I.trim().length>0)){let I=b.join(`
165
+ `);I.endsWith(`
166
+ `)||(I+=`
167
+ `),I.endsWith(`
168
+
169
+ `)||(I+=`
170
+ `);const T=i.tokens[i.tokens.length-1];T&&(T.raw=I);const M=[];i.md.block.parse(I,i.md,i.env,M),N5(M,n+1,n+1+b.length),i.tokens.push(...M)}const A=i.push("vmr_container_close","div",-1);return g||(A.hidden=!0,A.map=[o,o]),i.line=g?y+1:y,!0},{alt:["paragraph","reference","blockquote","list"]})}function Ki(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function po(e){let t=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s==="\\"){o++;continue}if(!n&&s==="'"){t=!t;continue}if(!t&&s==='"'){n=!n;continue}if(!t&&!n&&s===">")return o}return-1}function P1(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=o[2]||o[3]||o[4]||"";t.push([s,i])}return t}const xY=/^[a-z][a-z0-9_-]*$/;function HS(e){return xY.test(String(e??"").trim().toLowerCase())}function Ti(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return HS(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const o=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const s=t.slice(o,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":HS(s)?s:""}function tc(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=Ti(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function wY(...e){const t=new Set,n=[];for(const o of e)for(const s of tc(o))t.has(s)||(t.add(s),n.push(s));return n}function _Y(e){const t=tc(e);return{key:t.join(","),tags:t}}function I5(e){return Ti(e)}function SY(e,t){const n=String(e??""),o=Ti(t);if(!o)return!1;const s=Ki(o),i=n.match(new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${s}\s*>`,"i").test(n):!1}function L5(e,t){const n=Ti(t);return!!n&&!vf.has(n)&&!SY(e,n)}function CY(e,t){const n=String(e??""),o=Ti(t);if(!o)return n;const s=Ki(o),i=new RegExp(String.raw`^\s*<\s*${s}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${s}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const $5=Wl,AY=vf,F5=new Set(S5);F5.delete("details");const MY=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,EY=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Ay=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,TY=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function _m(e){return(e.match(Ay)?.[1]??"").toLowerCase()}function g2(e){return/^\s*<\s*\//.test(e)}function v2(e,t){return $5.has(t)||/\/\s*>\s*$/.test(e)}function NY(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(!s||s.type!=="html_inline")continue;const i=String(s.content??""),r=_m(i);if(r===t){if(g2(i)){if(n===0)return o;n--;continue}v2(i,r)||n++}}return-1}function IY(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=_m(s);if(i===t){if(g2(s)){n>0&&n--;continue}v2(s,i)||n++}}return n}function WS(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");o.lastIndex=Math.max(0,n);let s=0,i;for(;(i=o.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(s===0)return{start:i.index,end:i.index+r.length};s--;continue}a||s++}return null}function LY(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ki(t)}(?=[\s>/])[^>]*>`,"gi");let o=0,s;for(;(s=n.exec(e))!==null;){const i=s[0]??"",r=!!s[1],l=!r&&/\/\s*>$/.test(i);if(r){o>0&&o--;continue}l||o++}return o}function Sm(e){const t=e;return String(t.raw??t.content??t.markup??"")}function $Y(e){const t=e;return t.meta||(t.meta={}),t.meta}function Bg(e,t,n){const o=$Y(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function FY(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Ki(h)}(?=[\s>/])`,"i")),o=[];let s=!1;const i=h=>h?n.some(p=>p.test(h)):!1,r=h=>{if(!(!h||!o.length))for(const p of o)p.raw+=h,p.inner+=h},l=()=>{!o.length||!s||(r(`
171
+ `),s=!1)},a=h=>{r(h)},c=h=>{for(let m=0;m<o.length;m++)o[m].raw+=h,m<o.length-1&&(o[m].inner+=h);const p=o.pop();Bg(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const m=new RegExp(String.raw`^\s*<\s*\/\s*${Ki(p)}\s*>`,"i");return h.match(m)?.[0]??null},d=h=>!!u(h),f=(h,p,m)=>{const k=m??(h.type==="html_inline"?_m(p):"");if(!(k&&t.has(k))){r(p);return}const y=g2(p),g=!y&&v2(p,k);if(y){if(!o.length||o[o.length-1].tag!==k){r(p);return}c(p);return}if(r(p),g){Bg(h,p,"");return}o.push({tag:k,token:h,raw:p,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const p=String(h.content??"");if(d(p)?s=!1:l(),!o.length&&!i(p)){s=!1;continue}let m=0,k=!0;for(const y of h.children){const g=Sm(y),v=y.type==="html_inline"?_m(g):"",b=v&&t.has(v);let A=g;if(k&&p&&g&&(o.length||b)){const I=p.indexOf(g,m);if(I!==-1)a(p.slice(m,I)),A=p.slice(I,I+g.length),m=I+g.length;else{if(o.length&&!b)continue;k=!1}}f(y,A,v)}k&&p&&m<p.length&&o.length&&a(p.slice(m)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=Sm(h),m=h.type==="html_block"?u(p):null;if(m){c(`${s?`
172
+ `:""}${m}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)Bg(h.token,h.raw,h.inner)}function OY(e){return/^\s*<\s*[!?]/.test(e)}function BY(e){const t=new Set(AY);if(e&&Array.isArray(e))for(const n of e){const o=String(n??"").trim();if(!o)continue;const s=o.match(/^[<\s/]*([A-Z][\w-]*)/i);s&&t.add(s[1].toLowerCase())}return t}function zS(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function RY(e,t){let n=null;for(const i of e.matchAll(MY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();zS(l,t)&&po(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(EY)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();zS(l,t)&&po(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const o=/<\/\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const s=/<\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function DY(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function PY(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(DY(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const f=a.slice(d),h=f.match(Ay);if(!h){i("<",c),u=d+1;continue}const p=po(f);if(p===-1){i("<",c),u=d+1;continue}const m=f.slice(0,p+1),k=(h[1]??"").toLowerCase();t.has(k)?n.push({type:"html_inline",tag:"",content:m,raw:m}):i(m,c),u=d+m.length}}function l(a,c){if(!a)return;const u=RY(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),o={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},s=o.buffer}for(const a of e){if(o){o.buffer+=Sm(a),s=o.buffer;const c=po(o.buffer);if(c===-1)continue;const u=o.buffer.slice(0,c+1),d=o.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),o=null,s=null,d&&l(d);continue}if(a.type==="html_inline"){const c=Sm(a),u=(c.match(Ay)?.[1]??"").toLowerCase();if(u&&t.has(u)&&po(c)===-1){o={tag:u,buffer:c,closing:/^<\s*\//.test(c)},s=o.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:s??void 0}}const HY=["a","span","strong","em","b","i","u"];function WY(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=Ti(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),m=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const v of m){const b=Ti(String(v??""));b&&p.add(b)}const k=BY(Array.from(p)),y=new Set(HY);for(const v of p)y.add(v);return{autoCloseInlineTagSet:y,commonHtmlTags:k,customTagSet:p,shouldMergeHtmlBlockTag:v=>p.has(v)||!k.has(v)||F5.has(v)}},s=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},i=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),c=(f,h)=>{const p=r(f);if(!/\S/.test(p))return[];if(l(p))return[{type:"code_block",content:a(p),raw:p}];const m=p.replace(/^[\t ]+/,"");if(!m)return[];if(m.startsWith("<"))return[{type:"html_block",content:m}];const k={type:"inline",tag:"",nesting:0,content:m,children:[{type:"text",content:m,raw:m}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},k,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:m,raw:m}]:[k]},u=(f,h,p)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":p,d=(f,h)=>{const p=r(h);return!/\S/.test(p)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${p}`,f.children.push({type:"text",content:p,raw:p}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:p,customTagSet:m}=o(f);for(const k of h){const y=k;if(y.type!=="inline"||!Array.isArray(y.children))continue;const g=String(y.content??""),v=y.children.length?y.children:g.includes("<")?[{type:"text",content:g,raw:g}]:null;if(v)try{const b=PY(v,p);if(y.children=b.children,b.pendingBuffer){const A=g.lastIndexOf(b.pendingBuffer);if(A!==-1){const I=g.slice(0,A);y.content=I,typeof y.raw=="string"&&(y.raw=I)}}}catch(b){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",b)}}FY(h,m)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:m,shouldMergeHtmlBlockTag:k}=o(f),y=[];for(let g=0;g<h.length;g++){const v=h[g];if(y.length>0){const[A,I]=y[y.length-1];if(g!==I){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const T=String(v.content??v.raw??"");if(T){const M=h[I],$=`${String(M.content||"")}
173
+ ${T}`,N=po($),F=N===-1?null:WS($,A,N+1);if(F){const S=$.slice(0,F.end),R=$.slice(F.end);M.content=S,M.loading=!1,h.splice(g,1),y.pop();const z=d(M,R)?[]:c(R,u(h,g,"paragraph"));z.length&&h.splice(g,0,...z),g--;continue}M.content=$,M.loading!==!1&&(M.loading=!0)}h.splice(g,1),g--;continue}}const b=s(v);if(b){if(OY(b))continue;const A=(b.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),I=/^\s*<\s*\//.test(b);if(!A||!k(A))continue;if(i(v,b),!I)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(b)&&LY(b,A)>0&&y.push([A,g]);else if(y.length>0&&A&&y[y.length-1][0]===A){const[,T]=y[y.length-1],M=h[T];M.content=`${String(M.content||"")}
174
+ ${b}`,M.loading=!1,y.pop(),h.splice(g,1),g--}continue}else if(y.length>0){if(v.type==="paragraph_open"||v.type==="paragraph_close"){h.splice(g,1),g--;continue}const A=v.content||"",I=new RegExp(`<\\s*\\/\\s*${y[y.length-1][0]}\\s*>`,"i").test(A);if(A){const[,T]=y[y.length-1],M=h[T];M.content=`${M.content||""}
175
+ ${A}`,M.loading!==!1&&(M.loading=!I)}I&&y.pop(),h.splice(g,1),g--}else continue}if(m.size>0){const g=new Map,v=new Map,b=T=>{let M=g.get(T);return M||(M=new RegExp(`<\\s*${T}\\b`,"i"),g.set(T,M)),M},A=T=>{let M=v.get(T);return M||(M=new RegExp(`<\\s*\\/\\s*${T}\\s*>`,"i"),v.set(T,M)),M},I=[];for(let T=0;T<h.length;T++){const M=h[T],$=String(M.content??"");if(I.length>0){const F=I[I.length-1],S=h[F.index],R=M.type==="html_block"?A(F.tag).exec($):null;if(R){const L=R.index+R[0].length,O=$.slice(0,L),U=$.slice(L);S.content=`${String(S.content??"")}
176
+ ${O}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),I.pop();const Z=d(S,U)?[]:c(U,u(h,T,"paragraph"));Z.length?h.splice(T,1,...Z):(h.splice(T,1),T--);continue}if(M.type!=="inline")continue;const z=Array.isArray(M.children)?M.children:[],W=NY(z,F.tag);if(W!==-1){const L=z.slice(0,W+1),O=z.slice(W+1),U=L.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
177
+ ${U}`,Array.isArray(S.children)&&S.children.push(...L),O.length){const Z=O.map(ie=>String(ie.content??ie.raw??"")).join("");if(Z.trim()){const ie=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(T,1),T--;else if(ie.startsWith("<"))h.splice(T,1,{type:"html_block",content:ie});else{const q=c(Z,u(h,T,"paragraph"));h.splice(T,1,...q)}}else h.splice(T,1),T--}else h.splice(T,1),T--;I.pop();continue}S.content=`${String(S.content??"")}
178
+ ${$}`,Array.isArray(S.children)&&S.children.push(...z),h.splice(T,1),T--;continue}if(M.type!=="inline")continue;const N=Array.isArray(M.children)?M.children:[];for(const F of m)if((N.length?IY(N,F):b(F).test($)&&!A(F).test($)?1:0)>0){I.push({tag:F,index:T});break}}}{let g=0;for(let v=0;v<h.length;v++){const b=h[v];if(b.type==="paragraph_open"){g++;continue}b.type==="paragraph_close"&&(g>0?g--:(h.splice(v,1),v--))}}for(let g=0;g<h.length;g++){const v=h[g];if(v.type==="html_block"){const M=(v.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(M.startsWith("!")||M.startsWith("?")){v.loading=!1;continue}if(m.has(M)){const W=String(v.content??""),L=po(W),O=L===-1?null:WS(W,M,L+1);v.loading=O?!1:v.loading!==void 0?v.loading:!0;const U=O?.start??-1,Z=O?O.end-O.start:0;if(U!==-1){const ie=W.slice(0,U+Z);let q="";L!==-1&&L<U&&(q=W.slice(L+1,U)),v.children=[{type:M,content:q,raw:ie,attrs:[],tag:M,loading:!1}],v.content=ie,v.raw=ie;const ee=c(W.slice(U+Z)||"","text");ee.length&&h.splice(g+1,0,...ee)}else v.children=[{type:M,content:"",raw:W,attrs:[],tag:M,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(M))continue;v.type="inline";const $=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let N;for(;(N=$.exec(v.content||""))!==null;)N[1],N[2]||N[3]||N[4];const F=String(v.content??""),S=new RegExp(`<\\/\\s*${M}\\s*>`,"i").exec(F),R=S?S.index:-1,z=S?S[0].length:0;if(R!==-1){const W=F.slice(0,R+z),L=(F.slice(R+z)||"").replace(/^\s+/,"");v.children=[{type:"html_block",content:W,tag:M,loading:!1}],v.content=W,v.raw=W,L&&h.splice(g+1,0,L.startsWith("<")?{type:"html_block",content:L}:{type:"text",content:L,raw:L})}else v.children=[{type:"html_block",content:v.content,tag:M,loading:!0}];continue}if(!v||v.type!=="inline")continue;if(v.children.length===2&&v.children[0].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),$=v.children[1],N=String($?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if($?.type==="html_inline"&&N===M)continue;p.has(M)?(v.children[0].loading=!0,v.children[0].tag=M,v.children.push({type:"html_inline",tag:M,loading:!0,content:`</${M}>`})):v.children=[{type:"html_block",loading:!0,tag:M,content:String(v.children[0]?.content??"")+String(v.children[1]?.content??"")}];continue}else if(v.children.length===3&&v.children[0].type==="html_inline"&&v.children[2].type==="html_inline"){const M=(v.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(M))continue;v.children=[{type:"html_block",loading:!1,tag:M,content:v.children.map($=>$.content).join("")}];continue}if(!v.content?.startsWith("<")||v.children?.length!==1)continue;const b=String(v.content),A=v,I=A.children[0];if(I?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(b)&&(A.children.length=0);continue}const T=String(I.content??b).match(TY)?.[1]?.toLowerCase()??"";if(T){if(/\/\s*>\s*$/.test(b)||$5.has(T)){A.children=[{type:"html_inline",content:b}];continue}A.children.length=0}}})}function zY(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function UY(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const o=n.tokens??[];for(let s=0;s<o.length;s++){const i=o[s];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!zY(l[0]??"")){const a=l[0]??"",c=i.level??0;o.splice(s,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),s+=2}}})}const O5=/\.([a-z0-9]{1,15})$/i,qY=/[_()[\]{}<>]/u,jY=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,VY=/[?#@]/u,KY=/[\\/]/u,GY=/^[\p{L}\p{N}./\\-]+$/u,YY=/^[A-Za-z0-9-]{1,63}$/u,ZY=/^xn--[a-z0-9-]{2,59}$/i,XY=/^(?:[A-Z]{1,6}|\d{1,8})$/u,QY=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,JY=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,eZ=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,tZ=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,nZ=2e3,oZ=512,sZ={},iZ=new Set(["ai","md","py","rs","sh","zip"]),B5=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),rZ=new Set([...B5,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),lZ=new Set(["com","dev","io","page","site"]),aZ=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),cZ=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),Ta=new Map;function US(e,t){if(!e||e.length>oZ)return t;for(Ta.set(e,t);Ta.size>nZ;){const n=Ta.keys().next().value;if(!n)break;Ta.delete(n)}return t}function yf(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Rg(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return yf(n)?n:void 0}function qS(e,t){if(!yf(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function jS(e){const t=Df(e);return yf(t)?t:void 0}function uZ(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function VS(e,t){if(!yf(t))return;const n=String(e??"").trim().split(/\s+/u).map(uZ).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>Cm(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>Cm(s,{marketTicker:!0}))&&(o.marketTicker=!0),yf(o)?o:void 0}function Yl(e,t=!1){let n;return{options(o){return t||o==null?qS(e,n):qS(e,Rg(jS(o),VS(o,n)))},remember(o){const s=jS(o);n=t?Rg(n,s):Rg(s,VS(o,n))},reset(){n=void 0}}}function KS(e){return YY.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function dZ(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return KS(n)||ZY.test(n)?t.every(KS):!1}function R5(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function fZ(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function hZ(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function D5(e,t,n){const o=fZ(t);return R5(e)&&hZ(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function pZ(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function Df(e){const t=String(e??""),n=Ta.get(t);return n?(Ta.delete(t),Ta.set(t,n),n):pZ(t)?US(t,{explicitFilename:JY.test(t),filename:eZ.test(t),marketTicker:tZ.test(t)}):US(t,sZ)}function mZ(e){return dZ(e.split(/[\\/]/)[0]??"")}function gZ(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function vZ(e){if(qY.test(e)||!GY.test(e))return!0;if(KY.test(e))return!mZ(e);const t=e.replace(O5,"");return R5(t)?!0:t.split(".").filter(Boolean).some(gZ)}function yZ(e,t,n){if(!(n?rZ:B5).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?QY:XY).test(o)}function Cm(e,t={}){if(!e||jY.test(e)||VY.test(e))return!1;const n=e.match(O5);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return yZ(e,o,t.marketTicker===!0)?!0:cZ.has(o)?!iZ.has(o)||t.filename?!0:vZ(e):!!(t.explicitFilename&&lZ.has(o)||t.filename&&aZ.has(o))}const GS=["!"];function Ns(e){return{type:"text",content:e,raw:e}}function fa(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function ha(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function dl(e,t,n){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return{type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function kZ(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Ns(t))}}function YS(e,t){let n=-1;for(const o of t){const s=e.indexOf(o);s!==-1&&(n===-1||s<n)&&(n=s)}return n}function bZ(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function xZ(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(o=>o?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function wZ(e,t,n){let o="";for(let s=t+1;s<n;s++){const i=e[s];if(i?.type!=="text"||typeof i.content!="string")return null;o+=i.content}return o||null}function _Z(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=SZ(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function SZ(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Df(t);for(let o=0;o<=e.length-1;o++){o<0&&(o=0);const s=e[o];if(!s)break;if(s.type==="link_open"&&(s.markup==="linkify"||s.markup==="autolink")){let i=-1;for(let r=o+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=wZ(e,o,i),l=bZ(s);if(s.markup==="linkify"&&r&&!D5(r,l,t)&&Cm(r,n)){e.splice(o,i-o+1,Ns(r));continue}const a=YS(l,GS);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=YS(u.content,GS);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let y=c+1;y<i;y++){const g=e[y];g?.type==="text"&&typeof g.content=="string"&&(p+=g.content)}u.content=h,u.raw=h;const m=i-(c+1);m>0&&(e.splice(c+1,m),i=c+1);let k=l;if(a!==-1)k=l.slice(0,a);else if(p){const y=encodeURI(p);if(y&&l.endsWith(y))k=l.slice(0,l.length-y.length);else{const g=f?encodeURI(f):"",v=g?l.indexOf(g):-1;v!==-1&&(k=l.slice(0,v))}}k!==l&&xZ(s,k),p&&e.splice(i+1,0,Ns(p));break}}}if(s?.type==="em_open"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("*")){const i=e[o-1].content?.replace(/(\*+)$/,"")||"";e[o-1].content=i,s.type="strong_open",s.tag="strong",s.markup="**";for(let r=o+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(s?.type==="text"&&s.content?.endsWith("(")&&e[o+1]?.type==="link_open"){const i=s.content.match(/\[([^\]]+)\]/);if(i){let r=s.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(Ns(r));const c=i[1],u=l[1].length;fa(a,u);let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(dl(c,d,!e[o+4]?.content?.startsWith(")"))),ha(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ns(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ns(r));let c=i[1];const u=c.match(/^\*+/);if(u){const f=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let h=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(h+=e[o+4]?.content||"",e[o+4].content=""),fa(a,f),a.push(dl(c,h,!e[o+4]?.content?.startsWith(")"))),ha(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ns(p)),e.splice(o,5,...a)}else e.splice(o,4,...a);o===0?o=a.length-1:o-=a.length+1;continue}let d=e[o+2]?.content||"";if(e[o+4]?.type==="text"&&!e[o+4].content?.startsWith(")")&&(d+=e[o+4]?.content||"",e[o+4].content=""),a.push(dl(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ns(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}o-=a.length+1;continue}}else if(s.type==="link_open"&&s.markup==="linkify"&&e[o-1]?.type==="text"&&e[o-1].content?.endsWith("(")){if(e[o-2]?.type==="link_close"){const i=[],r=e[o-3].content||"";let l=s.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[o+3]?.type==="text"){const a=(e[o+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[o+3]?.content?.slice(0,a)||"",e[o+3].content=""),i.push(dl(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ns(u)),e.splice(o-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(o-4,7,...i);continue}else if(e[o-1].content==="]("&&e[o-3]?.type==="text"&&e[o-3].content?.endsWith(")"))if(e[o-2]?.type==="strong_open"){const[i,r]=e[o-3].content?.split("[**")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else if(e[o-2]?.type==="em_open"){const[i,r]=e[o-3].content?.split("[*")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}else{const[i,r]=e[o-3].content?.split("[")||[];e[o+1].content=r||"",e[o-3].content=i||"",e[o-1].content=""}}if(s.type==="link_close"&&s.nesting===-1&&e[o-2]?.type==="link_open"&&e[o+1]?.type==="text"&&e[o-1]?.type==="text"){const i=e[o-1].content||"",r=e[o-2].attrs||[],l=r.find(p=>p[0]==="href")?.[1]||"",a=r.find(p=>p[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[o-3]?.content||"").match(/^(\*+)$/),f=[];if(d){u+=1;const p=d[1].length;fa(f,p)}if(s.markup!=="linkify"&&e[o+1].type==="text"&&e[o+1]?.content?.startsWith("](")){c+=1;for(let p=o+1;p<e.length;p++){const m=d?d[1].length:e[o-3].markup.length,k=e[p];if(m===1&&k.type==="em_close")break;if(m===2&&k.type==="strong_close")break;if(m===3&&(k.type==="em_close"||k.type==="strong_close"))break;c+=1}}const h={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(f.push(h),d){const p=d[1].length;ha(f,p)}e.splice(o-u,c,...f),o-=f.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].markup?.includes("*")&&e[o-4]?.type==="text"&&e[o-4].content?.endsWith("[")){const i=e[o-1].markup.length,r=[],l=e[o-4].content.slice(0,e[o-4].content.length-i);l&&r.push(Ns(l)),fa(r,i);const a=e[o-2].content||"";let c=s.content.slice(2),u=!0;if(e[o+1]?.type==="text"){const d=(e[o+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[o+1]?.content?.slice(0,d)||"",e[o+1].content="")}if(r.push(dl(a,c,u)),ha(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ns(d)),e.splice(o-4,8,...r)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...r):e.splice(o-4,7,...r);o-=r.length+1;continue}else if(s.content?.startsWith("](")&&e[o-1].type==="strong_close"&&e[o-4]?.type==="text"&&e[o-4]?.content?.includes("**[")){const i=[],r=e[o-4].content.split("**[")[0];r&&i.push(Ns(r)),fa(i,2);const l=e[o-2].content||"";let a=s.content.slice(2),c=!0;if(e[o+1]?.type==="text"){const u=(e[o+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[o+1]?.content?.slice(0,u)||"",e[o+1].content="")}if(i.push(dl(l,a,c)),ha(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ns(u)),e.splice(o-4,8,...i)}else e[o+1]?.type==="link_open"?e.splice(o-4,10,...i):e.splice(o-4,7,...i);o-=i.length+1;continue}else if(s.type==="strong_close"&&e[o+1]?.type==="text"&&e[o+1].content?.includes("](")&&e[o-1].type==="text"&&/\[.*$/.test(e[o-1].content||"")){const i=[],[r,l]=e[o-1].content?.split("[")||["",""];r&&i.push(Ns(r)),fa(i,2);let[a,c]=e[o+1].content.split("](");a=l+a;let u=4;if(e[o+2]?.type==="link_open"){const f=e[o+2].attrs?.find(h=>h[0]==="href")?.[1];e[o+5]?.type==="text"&&e[o+5].content==="."?(c=(f||c)+e[o+5].content,e[o+5].content=""):c=f||c,u+=3}let d=!0;if(s.nesting===-1&&(a=a.replace(/\*+$/,"")),e[o+2]?.type==="text"){const f=(e[o+2]?.content??"").indexOf(")");d=f===-1,f===-1&&(c+=e[o+2]?.content?.slice(0,f)||"",e[o+2].content="")}i.push(dl(a,c,d)),ha(i,2),e.splice(o-2,u,...i)}if(s.type==="text"&&/\*+\[[^\]]*$/.test(s.content||"")&&e[o+1]?.type==="strong_open"&&e[o+2]?.type==="text"&&e[o+2].content==="]("&&e[o+3]?.type==="link_open"&&e[o+5]?.type==="link_close"&&e[o+6]?.type==="text"&&e[o+6].content===")"&&e[o+7]?.type==="strong_close"){const i=(s.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[o+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[o+4]?.type==="text"&&(l=e[o+4].content||"");const a=[];fa(a,2),a.push(dl(r,l,!1)),ha(a,2),e.splice(o,9,...a),o-=a.length-1;continue}}}for(let o=0;o<e.length-1;o++){const s=e[o],i=e[o+1];if(s?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(s.href??"");if(String(s.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;kZ(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function CZ(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=AZ(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function AZ(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function MZ(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let o=0;o<n.length;o++){const s=n[o];if(s&&s.type==="inline"&&Array.isArray(s.children))try{s.children=EZ(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function EZ(e){let t=0;const n=new Set,o=new Set;let s=0;for(let u=0;u<e.length;u++){const d=e[u],f=d.type;if(f==="strong_open"){t++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let k=u+1;for(;k<e.length&&e[k].type==="text"&&e[k].content==="";)k++;const y=e[k];h==="__"&&(m?.content?.endsWith("_")||y?.content?.startsWith("_")||y?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(f==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(f==="em_open"){s++;const h=String(d.markup??"");let p=u-1;for(;p>=0&&e[p].type==="text"&&e[p].content==="";)p--;const m=e[p];let k=u+1;for(;k<e.length&&e[k].type==="text"&&e[k].content==="";)k++;const y=e[k];h==="_"&&(m?.content?.endsWith("_")||y?.content?.startsWith("_")||y?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=h,d.raw=h,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,o.add(s))}else f==="em_close"&&(o.has(s)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),s--,s<0&&(s=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,f=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],h=c.slice(0,-1);h&&f.unshift({type:"text",content:h,raw:h}),l.splice(i,d,...f)}return l=TZ(l),l}function TZ(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const o=e[n],s=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const f=u.slice(0,d),h=u.slice(d+2);t.push(o),t.push(s),t.push(l),f&&t.push({...c,type:"text",content:f,raw:f}),t.push(a),h&&t.push({...c,type:"text",content:h,raw:h}),n+=6;continue}}if(o?.type==="strong_open"&&s?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=NZ(e,n+6);if(u){t.push(o),t.push(s),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(o)}return t}function NZ(e,t){for(let n=t;n<e.length;n++){const o=e[n];if(o?.type==="strong_open")return null;if(o?.type!=="text")continue;const s=String(o.content??""),i=s.indexOf("**");if(i!==-1)return{index:n,beforeClose:s.slice(0,i),afterClose:s.slice(i+2)}}return null}function IZ(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=RZ(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(o)&&(n.tokens=o)}catch(o){console.error("[applyFixTableTokens] failed to fix table tokens",o)}})}function ZS(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function XS(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function QS(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function P5(e,t){if(!e.startsWith("|")||e.includes(`
179
+ `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(o=>o.trim().length>0)?n:null}function Dg(e){return P5(e)!==null}function H5(e){return/^:?-+:?$/.test(e.trim())}function LZ(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(H5)}function $Z(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function FZ(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(H5)&&$Z(n)}function OZ(e){return e==="|"||e==="|:"}function BZ(e){const t=P5(e);return t!==null&&t.every(n=>!n.includes(":"))}function RZ(e,t=!1,n=""){const o=[...e];if(e.length<3)return o;const s=e.length-2,i=e[s];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
180
+ `)[0]??"",[a="",c="",...u]=r.split(`
181
+ `),d=!t&&!r.includes(`
182
+ `)&&/\r?\n$/.test(n)&&Dg(r);if(!t&&(r.includes(`
183
+ `)&&u.length===0&&Dg(a)&&FZ(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>QS(p)),h=[...ZS(),...f,...XS()];o.splice(s-1,3,...h)}else if(r.includes(`
184
+ `)&&u.length===0&&Dg(a)&&LZ(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>QS(p)),h=[...ZS(),...f,...XS()];o.splice(s-1,3,...h)}else r.includes(`
185
+ `)&&u.length===0&&BZ(a)&&OZ(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function DZ(e,t,n,o){const s=e.length;if(n==="$$"&&o==="$$"){let c=t;for(;c<s-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=o;let l=0,a=t;for(;a<s;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var PZ=DZ;const HZ=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Am=HZ.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),WZ=/\\[a-z]+/i,W5="(?:\\\\|\\u0008)",zZ=new RegExp(String.raw`${W5}(?:${Am})\s*\{[^}]+\}`,"i"),UZ=new RegExp(String.raw`(?:${W5})?(?:${Am})\s*\{`,"i"),qZ=/\\(?:text|frac|left|right|times)/,jZ=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,VZ=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,KZ=/[A-Z]+\s*\([^)]+\)/i,GZ=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,YZ=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,ZZ=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,XZ={"\b":"\\b","\v":"\\v","\f":"\\f"};function QZ(e){let t="";for(const n of e)t+=XZ[n]??n;return t}function Cl(e){if(!e)return!1;const t=QZ(e),n=t.trim();if(ZZ.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=WZ.test(t),s=zZ.test(t),i=UZ.test(t),r=qZ.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=jZ.test(t)&&!VZ.test(t),c=KZ.test(t),u=GZ.test(n),d=YZ.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return o||s||i||r||l||a||c||u||d||f||h}const z5="__markstreamMathPluginApplied",My=80,U5=2e4,JS=U5+4096;function y2(e){return!!e[z5]}function JZ(e){e[z5]=!0}const q5=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],eX=["cdot","mathbf{","partial","mu_{"],j5=q5.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),V5="[ \r\b\f\v]",tX=new RegExp(`([^\\\\])(${eX.map(e=>e).join("|")})+`,"g"),nX=/span\{([^}]+)\}/,oX=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,sX=/(^|[^\\])\\\r?\n/g,iX=/(^|[^\\])\\$/g,rX=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,lX=new RegExp(`(${V5})|(${j5})\\b`,"g"),eC=new Map,tC=new Map;function aX(e){if(!e)return lX;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=eC.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${V5})|(${s})\\b`,"g");return eC.set(n,i),i}function cX(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=tC.get(o);if(s)return s;const i=e?[Am,j5].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Am].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return tC.set(o,r),r}const nC={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function oC(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function uX(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&rX.test(n))return t;const o=n?t.slice(n.length):t;return`${n}${"\\!".repeat(o.length)}`})}function sC(e){const t=/(^|[^\\])(__|\*\*)/g;let n,o=null;for(;(n=t.exec(e))!==null;)o={marker:n[2],index:n.index+(n[1]?.length??0)};return o}function fl(e,t){const n=t?.commands??q5,o=t?.escapeExclamation??!0,s=t?.commands==null,i=aX(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&nC[u]!==void 0)return`\\${nC[u]}`;if(d&&n.includes(d)){const p=h&&typeof f=="number"?h[f-1]:void 0;return p==="\\"||p&&/\w/.test(p)?c:`\\${d}`}return c});o&&(r=uX(r));let l=r;const a=cX(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(nX,"span\\{$1\\}").replace(oX,"\\operatorname{span}\\{$1\\}"),l=l.replace(sX,`$1\\\\
186
+ `),l=l.replace(iX,"$1\\\\"),l=l.replace(tX,"$1\\$2"),l}function iC(e){const t=e.trim();return!(!Cl(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function K5(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const o=n;let s=1;for(;o+s<e.length&&e[o+s]==="`";)s++;let i=o+s,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===s){r=i;break}i+=l}if(r!==-1){t.push([o,r+s]),n=r+s;continue}n=o+s}return t}function Mm(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function dX(e,t=!1){const n=[];let o=0;for(;o<e.length-1;){if(e[o]==="!"&&e[o+1]==="["){const s=o;let i=o+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([s,l]),o=l;continue}if(t){n.push([s,e.length]),o=e.length;continue}}}o++}return n}function Pf(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function Ey(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Pf(e,o)){n=o+1;continue}return o}return-1}function Pg(e,t){let n=t;for(;n<e.length;){const o=Ey(e,n);if(o===-1)return-1;if(o>0&&e[o-1]==="$"||o+1<e.length&&e[o+1]==="$"){n=o+1;continue}return o}return-1}function Dc(e,t,n=0){let o=Math.max(0,n);for(;o<e.length;){const s=e.indexOf(t,o);if(s===-1)return-1;if(!Pf(e,s))return s;o=s+Math.max(1,t.length)}return-1}function rC(e,t,n=0,o=e.length,s=[]){let i=0,r=Math.max(0,n);const l=Math.min(e.length,Math.max(0,o));for(;r<l;){const a=e.indexOf(t,r);if(a===-1||a>=l)break;const c=Mm(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Pf(e,a)||i++,r=a+Math.max(1,t.length)}return i}function k2(e,t,n){const o=bf(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!bf(o.slice(0,s)).trim()||Pf(o,s))return-1;const i=K5(o);if(Mm(i,s))return-1;const r=rC(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>rC(o,n,0,s,i))return-1;return s}function kf(e){return e===" "||e===" "}function bf(e){let t=e.length;for(;t>0&&kf(e[t-1]);)t--;return e.slice(0,t)}function lC(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
187
+ `&&t++;return t}function aC(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function fX(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s===t){n++;continue}if(!kf(s))return!1}return n>=3}function hX(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let o=0;for(;t[n]==="-";)o++,n++;return o<3?!1:(t[n]===":"&&n++,n===t.length)}function pX(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(hX)}function mX(e){let t=0;if(!aC(e[t]))return!1;for(;aC(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:kf(e[t+1])}function G5(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&kf(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&kf(t[1])||mX(t)||fX(t)||pX(t))}function cC(e,t){return e?t?`${e}
188
+ ${t}`:e:t}function Ty(e){const t=String(e??"").trim();return t?Cl(t):!1}function uC(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Y5(e){if(e.length<=JS)return{source:e,lineOffset:0};let t=e.length-JS;const n=e.indexOf(`
189
+ `,t);return n===-1?{source:"",lineOffset:lC(e)}:(t=n+1,{source:e.slice(t),lineOffset:lC(e.slice(0,t))})}function Z5(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=Y5(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-My-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=bf(o[r]);if(l&&!G5(l)){for(const[a,c]of i)if(k2(l,a,c)!==-1)return!0}}return!1}function gX(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=Y5(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-My-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=bf(s[l]);for(const[c,u]of r){const d=k2(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>My){h=!0;break}const m=s[p],k=Dc(m,u);if(k!==-1){const y=cC(f,m.slice(0,k));if(!Ty(y)){h=!0;break}const g=m.slice(k+u.length),v=g.trim()?`suffix:${uC(g)}`:"nosuffix";return["closed",c,o+l,d,o+p,k,uC(y),v].join(":")}if(G5(m)){h=!0;break}if(f=cC(f,m),f.length>U5){h=!0;break}}if(!h&&Ty(f))return["pending",c,o+l,d].join(":")}}return null}function Hg(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function vX(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const o=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(o)?!1:o===""||/^[)\s,.!?;:]/.test(o)}function Wg(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function yX(e,t){JZ(e);const n=(r,l,a)=>{const c=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!c)return;const u=r.push("paragraph_open","p",1);u.map=[a,a+1];const d=r.push("inline","",0);d.content=c,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},o=(r,l)=>{const a=r,c=!!t?.strictDelimiters,u=!a?.env?.__markstreamFinal,d=(g,v)=>{let b=v;for(;b<g.length&&(g[b]===" "||g[b]===" ");)b++;if(b===v||!(g[b]===`
190
+ `||g[b]==="\r"&&g[b+1]===`
191
+ `))return v;const A=g.slice(v,b),I=a.push("text","",0);return I.content=A,b};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let g=a.pos+1;for(;a.src[g]==="$";)g++;const v=g-a.pos,b=a.src[g];if(v>=3&&(!b||/\s/.test(b))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,g),a.pos=g,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let m=p,k=p;const y=p;for(const[g,v]of f){const b=a.src,A=K5(b),I=dX(b,u);let T=!1;g==="$$"&&m!==y&&(m=y);let M=-1,$=-1,N=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,m=a.pos;return}if(S==="\\)"||S==="\\("){const W=a.push("text_special","",0);W.content=S==="\\)"?")":"(",W.markup=S,a.pos=a.pos+S.length,m=a.pos;return}if(!S)return;if(g==="$$"&&S.includes("$")){let W=0;for(;W<S.length;){const L=Ey(S,W);if(L===-1){const K=S.slice(W);if(K){const ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos}break}if(L>0&&S[L-1]==="$"||L+1<S.length&&S[L+1]==="$"){const K=S.slice(W,L+1);if(K){const ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos}W=L+1;continue}const O=S.slice(W,L);if(O){const K=a.push("text","",0);K.content=O,a.pos=a.pos+O.length,m=a.pos}const U=Pg(S,L+1);if(U===-1){const K=S.slice(L),ve=a.push("text","",0);ve.content=K,a.pos=a.pos+K.length,m=a.pos;break}const Z=S.slice(L+1,U),ie=Z.includes("`"),q=!Z||!Z.trim(),ee=S[U+1],fe=Hg(Z,ee),ne=Wg(Z);if(!ie&&!q&&!fe&&!ne){const K=a.push("math_inline","math",0);K.content=fl(Z,t),K.markup="$",K.raw=`$${Z}$`,K.loading=!1,a.pos=a.pos+(U-L+1),m=a.pos,W=U+1;continue}const j=a.push("text","",0);j.content="$",a.pos=a.pos+1,m=a.pos,W=L+1}return}const R=S.indexOf("![");if(R!==-1){if(R>0){const O=S.slice(0,R),U=a.push("text","",0);U.content=O,a.pos=a.pos+O.length,m=a.pos}const W=S.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(W){const[,O,U]=W,Z=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),ie=Z?Z[1]:U,q=Z&&Z[2]?Z[2]:null,ee=a.push("image","img",0);ee.attrs=[["src",ie],["alt",O]],q&&ee.attrs.push(["title",q]),ee.content=O,ee.children=[{type:"text",content:O,tag:""}],a.pos=a.pos+W[0].length,m=a.pos;const fe=S.slice(R+W[0].length);fe&&F(fe);return}const L=a.push("text","",0);L.content=S,a.pos=a.pos+S.length,m=a.pos;return}const z=a.push("text","",0);z.content=S,a.pos=a.pos+S.length,m=a.pos};for(;!(m>=b.length);){const S=b.indexOf(g,m);if(S===-1)break;if(Pf(b,S)){m=S+Math.max(1,g.length);continue}const R=Mm(A,S);if(R){m=R[1];continue}const z=Mm(I,S);if(z){m=z[1];continue}if(S===M&&m===$){if(N++,N>2){m=S+Math.max(1,g.length);continue}}else N=0,M=S,$=m;if(g==="("&&S>0){let fe=S-1;for(;fe>=0&&b[fe]===" ";)fe--;if(fe>=0&&b[fe]==="]"){m=S+g.length;continue}}if(g==="$"&&S>0&&b[S-1]==="$"){m=S+1;continue}if(g==="$"&&S<b.length-1&&b[S+1]==="$"){m=S+2;continue}const W=g==="$"?Pg(b,S+g.length):PZ(b,S+g.length,g,v);if(W===-1){const fe=b.slice(S+g.length);if(fe.includes(g)){m=b.indexOf(g,S+g.length);continue}if(W===-1){const ne=g==="$"&&vX(fe);if(u&&!c&&!ne&&Cl(fe)&&!fe.includes("`")){if(m=S+g.length,T=!0,!l){a.pending="";const j=k?b.slice(k,m):b.slice(0,m),K=oC(j)%2===1;if(k)F(b.slice(k,m));else{let ve=b.slice(0,m);ve.endsWith(g)&&(ve=ve.slice(0,ve.length-g.length)),F(ve)}if(K){const ve=sC(j)?.marker??"**",he=a.push("strong_open","",0);he.markup=ve;const Ae=a.push("math_inline","math",0);Ae.content=fl(fe,t),Ae.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ae.raw=`${g}${fe}${v}`,Ae.loading=!0,he.content=fe,a.push("strong_close","",0)}else{const ve=a.push("math_inline","math",0);ve.content=fl(fe,t),ve.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",ve.raw=`${g}${fe}${v}`,ve.loading=!0}a.pos=b.length}m=b.length,k=m}break}}const L=b.slice(S+g.length,W),O=L.includes("`"),U=!L||!L.trim(),Z=g==="$",ie=b[W+v.length],q=Z&&Hg(L,ie),ee=Z&&Wg(L);if(c?O||U||q||ee:O||U||q||ee||!Z&&!Cl(L)){m=W+v.length;const fe=b.slice(a.pos,m);a.pending||(F(fe),k=m);continue}if(T=!0,!l){const fe=b.slice(a.pos-(a.pending??"").length,S);let ne=b.slice(0,m)?b.slice(k,S):fe;const j=oC(ne)%2===1;S!==a.pos&&j&&(ne=a.pending+b.slice(a.pos,S));const K=j?sC(ne):null,ve=K?.marker??"**";if(a.pending!==ne)if(a.pending="",j)if(K){const he=ne.slice(K.index+ve.length);F(ne.slice(0,K.index));const Ae=a.push("strong_open","",0);Ae.markup=ve;const re=a.push("text","",0);re.content=he,a.push("strong_close","",0)}else F(ne);else F(ne);if(j){const he=a.push("strong_open","",0);he.markup=ve;const Ae=a.push("math_inline","math",0);Ae.content=fl(L,t),Ae.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",Ae.raw=`${g}${L}${v}`,Ae.loading=!1;const re=b.slice(W+v.length).startsWith(ve);return re&&a.push("strong_close","",0),a.pos=d(b,W+v.length),m=a.pos,k=m,re||a.push("strong_close","",0),!0}else{const he=a.push("math_inline","math",0);he.content=fl(L,t),he.markup=g==="$$"?"$$":g==="\\("?"\\(\\)":g==="$"?"$":"()",he.raw=`${g}${L}${v}`,he.loading=!1}}return m=d(b,W+v.length),k=m,a.pos=m,!0}if(T){if(l)a.pos=m;else{if(g==="$$"&&m<b.length&&b.slice(m).includes("$")){let S=m;for(;!(S>=b.length);){const R=Ey(b,S);if(R===-1)break;if(R+1<b.length&&b[R+1]==="$"){S=R+2;continue}if(R>0&&b[R-1]==="$"){S=R+1;continue}const z=Pg(b,R+1);if(z===-1)break;const W=b.slice(R+1,z),L=W.includes("`"),O=!W||!W.trim(),U=b[z+1],Z=Hg(W,U),ie=Wg(W);if(!L&&!O&&!Z&&!ie){const q=b.slice(m,R);q&&F(q);const ee=a.push("math_inline","math",0);ee.content=fl(W,t),ee.markup="$",ee.raw=`$${W}$`,ee.loading=!1,m=z+1,S=z+1}else F("$"),S=R+1}S<b.length&&F(b.slice(S))}else m<b.length&&F(b.slice(m));a.pos=b.length}return!0}}return!1},s=(r,l,a,c)=>{const u=r,d=!u?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],p=u.bMarks[l]+u.tShift[l];let m=u.src.slice(p,u.eMarks[l]).trim(),k=!1,y="",g="",v=!1,b="",A=!1;for(const[q,ee]of h)if(m.startsWith(q))if(q.includes("[")){const fe=q==="\\["?m.slice(q.length):"";if(q==="\\["&&Dc(fe,ee)===-1&&!/^\s*!\[/.test(fe)&&!fe.includes("`")&&Cl(fe)){k=!0,y=q,g=ee;break}if(t?.strictDelimiters){if(m.replace("\\","")==="["){if(l+1<a){k=!0,y=q,g=ee;break}continue}}else if(m.replace("\\","")==="["){if(l+1<a){k=!0,y=q,g=ee;break}continue}else{const ne=u.tokens[u.tokens.length-1];if(ne&&ne.type==="list_item_open"&&ne.mark==="-"&&m.slice(q.length,m.indexOf("]")).trim()==="x")continue;if(m.replace("\\","").startsWith("[")&&!m.includes("](")){const j=m.indexOf("]");if(m.slice(j).trim()!=="]")continue;const K=m.slice(q.length,j);if(q==="["?iC(K):Cl(K)){k=!0,y=q,g=ee;break}continue}}}else{k=!0,y=q,g=ee;break}else if((q==="$$"||q==="\\[")&&m.endsWith(q)&&l+1<a){const fe=k2(m,q,ee);if(fe===-1)continue;b=bf(m.slice(0,fe)),A=!0;const ne=u.bMarks[l+1]+u.tShift[l+1];m=u.src.slice(ne,u.eMarks[l+1]).trim(),v=!0,k=!0,y=q,g=ee;break}if(!k)return!1;if(c&&!A)return!0;const I=m.indexOf(y),T=I+y.length,M=!f&&y==="["?m.indexOf("\\]",T):-1,$=M>=0?"\\]":g,N=M>=0?M:Dc(m,g,T);if(!v&&N>y.length){const q=m.slice(I+y.length,N),ee=u.push("math_block","math",0);ee.content=fl(q),ee.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ee.map=[l,l+1],ee.raw=`${y}${q}${$}`,ee.block=!0,ee.loading=!1,u.line=l+1;const fe=m.slice(N+$.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",R=!1,z="",W=l;const L=v?m:m===y?"":m.slice(y.length),O=!f&&y==="\\["?"]":"",U=Dc(L,g);if(U!==-1){const q=U;S=L.slice(0,q),z=L.slice(q+g.length),W=v?l+1:l,R=!0,F=W}else for(L&&!v&&(S=L),F=l+1;F<a;F++){const q=u.bMarks[F]+u.tShift[F],ee=u.eMarks[F],fe=u.src.slice(q,ee),ne=fe.trim();if(!f&&y==="["&&ne==="\\]"){g="\\]",R=!0;break}if(O&&fe.trim()===O){g=O,R=!0;break}if(ne===g){R=!0;break}else if(!f&&y==="["&&fe.includes("\\]")){R=!0;const j=fe.indexOf("\\]");g="\\]";const K=fe.slice(0,j);K&&(S+=(S?`
192
+ `:"")+K),z=fe.slice(j+g.length),W=F;break}else if(Dc(fe,g)!==-1){R=!0;const j=Dc(fe,g),K=fe.slice(0,j);K&&(S+=(S?`
193
+ `:"")+K),z=fe.slice(j+g.length),W=F;break}S+=(S?`
194
+ `:"")+fe}if((!d||f)&&!R)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&Ty(S):y==="$$"?!Z:y==="["?iC(S):Cl(S)))return!1;if(c)return!0;b&&n(u,b,l);const ie=u.push("math_block","math",0);return ie.content=fl(S),ie.markup=y==="$$"?"$$":y==="["?"[]":"\\[\\]",ie.raw=`${y}${S}${S.startsWith(`
195
+ `)?`
196
+ `:""}${g}`,ie.map=[l,F+1],ie.block=!0,ie.loading=!R,u.line=F+1,z.trim()&&n(u,z,W),!0},i=(r,l,a,c)=>{const u=r,d=u.bMarks[l]+u.tShift[l],f=u.src.slice(d,u.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:s(r,l,a,c)};e.inline.ruler.before("escape","math",o),e.block.ruler.before("lheading","explicit_math_block",i,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function kX(e){const t=e.renderer.rules.image||function(n,o,s,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,o,s):""};e.renderer.rules.image=(n,o,s,i,r)=>{const l=n;return l[o].attrSet?.("loading","lazy"),t(l,o,s,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,o)=>{const s=n[o],i=String(s.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(s.content??""))}</code></pre>`})}const bX=/^<a[>\s]/i,xX=/^<\/a\s*>/i;function wX(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.pretest(String(e.content??""));let o=0;for(let s=n.length-1;s>=0;s--){const i=n[s];if(i?.type==="link_close"){for(s--;s>=0&&n[s]?.level!==i.level&&n[s]?.type!=="link_open";)s--;continue}if(i?.type==="html_inline"){const r=String(i.content??"");bX.test(r)&&o>0&&o--,xX.test(r)&&o++}if(!(o>0)&&i?.type==="text"&&t.pretest(String(i.content??"")))return!0}return!1}function _X(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(o=>o.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",o=>{if(!o.md?.options?.linkify)return;const s=Array.isArray(o.tokens)?o.tokens:[],i=o.md.linkify;if(!i)return;const r=s.filter(l=>wX(l,i));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(o)),o,{tokens:r}))})}function SX(e){const t=e.inline.ruler,n=t.getNamedRules?.(),o=n?.find(l=>l.name==="link")?.fn,s=n?.find(l=>l.name==="image")?.fn;if(typeof o!="function"||typeof s!="function")return;const i=e.validateLink,r=e;r.__markstreamOriginalValidateLink=i,t.at("link",(...l)=>{const a=l[0].md,c=a?.validateLink===i?a.options?.validateLink:a?.validateLink;if(!a||typeof c!="function")return o(...l);const u=a.validateLink;a.validateLink=c;try{return o(...l)}finally{a.validateLink=u}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return s(...l);const c=a.validateLink;a.validateLink=i;try{return s(...l)}finally{a.validateLink=c}})}function CX(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},o=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,s=Object.prototype.hasOwnProperty.call(t,"validateLink"),i=new eY({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ra(r,{tagName:"a",attrName:"href"})}),SX(i),_X(i),(e.enableMath??!0)&&yX(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&bY(i),e.enableFixIndentedCodeBlock!==!1&&UY(i),_Z(i),MZ(i),CZ(i),IZ(i),kX(i),WY(i,{customHtmlTags:e.customHtmlTags}),i}function Da(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Da(n))),t}function AX(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function MX(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,o=n===""||n==="true";return{type:"checkbox_input",checked:o,raw:o?"[x]":"[ ]"}}function EX(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Vh(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];s+=String(e[i].content??l.text??""),r.push(e[i]),i++}return o.push(...ao(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const dC=/\r?\n[ \t]*`+\s*$/,X5=["diff ","index ","--- ","+++ ","@@ "],TX=/\r?\n/;function NX(e){const t=String(e??"");return t?X5.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function fC(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function hC(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function IX(e,t){const n=[],o=[],s=[],i=[],r=e.split(TX),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!X5.some(m=>p.startsWith(m)))if(p.startsWith("-")){const m=p.slice(1);s.push(hC(m,a))}else if(p.startsWith("+")){const m=p.slice(1);i.push(hC(m,a))}else{fC(n,o,s,i);const m=a&&p.startsWith(" ")?p.slice(1):p;n.push(m),o.push(m)}},u=l?Math.max(0,r.length-1):r.length;for(let h=0;h<u;h++){const p=r[h]??"";!t&&!l&&h===u-1&&NX(p)||c(p)}(t||s.length>0||i.length>0)&&fC(n,o,s,i);const d=n.join(`
197
+ `),f=o.join(`
198
+ `);return{original:t&&l&&d?`${d}
199
+ `:d,updated:t&&l&&f?`${f}
200
+ `:f}}function b2(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},o=typeof n.closed=="boolean"?n.closed:void 0,s=o===!0||o!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(dC.test(a)&&(a=a.replace(dC,"")),r){const{original:c,updated:u}=IX(a,s===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:o===!0?!1:o===!1?!0:!t}}function LX(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function $X(){return{type:"hardbreak",raw:`\\
201
+ `}}function FX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let zg=null;const Ug=new WeakMap;function pC(){return zg||(zg={customTagSet:null,allowedTagSet:q1()}),zg}function Q5(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function J5(e){return/^<\s*\//.test(e)}function e8(e,t){return/\/\s*>\s*$/.test(t)||Wl.has(e)}function OX(e){if(!e||e.length===0)return pC();const t=Ug.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=pC();return Ug.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:q1({customHtmlTags:e})};return Ug.set(e,o),o}function t8(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function BX(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Em(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function RX(e,t,n){const o=e.slice();return Em(o,"href")||o.push(["href",t]),n!=null&&!Em(o,"title")&&o.push(["title",n]),o}function Ny(e){return e.map(t8).join("")}function Mp(e){const t=[],n=o=>{const s=String(o??"");if(!s)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${s}`,i.raw=`${i.raw}${s}`;return}t.push({type:"text",content:s,raw:s})};for(const o of e)if(o){if(o.type==="reference"||o.type==="footnote_reference"){n(String(o.raw??""));continue}if("children"in o&&Array.isArray(o.children)){t.push({...o,children:Mp(o.children)});continue}t.push(o)}return t}function DX(e,t,n){let o=0;for(let s=t;s<e.length;s++){const i=e[s];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=Q5(r),a=J5(r),c=e8(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function qg(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?DX(e,t+1,n):-1;return l!==-1?(s=e.slice(t+1,l),o.push(...s,e[l]),i=l+1,r=!0):(s=e.slice(t+1),s.length&&o.push(...s),i=e.length),{closed:r,html:Ny(o),innerTokens:s,nextIndex:i}}function PX(e,t,n,o,s,i,r){const l=String(e.content??""),a=Q5(l),{customTagSet:c,allowedTagSet:u}=OX(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!qg(t,n,a).closed){const A=t8(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=J5(l),f=e8(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=qg(t,n,a),I=P1(l),T=A.innerTokens,M=String(Em(I,"href")??""),$=Em(I,"title"),N=$==null?null:String($),F=RX(I,M,N),S=Mp(T.length?o(T,s,i,r):[]),R=T.length?Ny(T):M||"";return!S.length&&R&&S.push({type:"text",content:R,raw:R}),[{type:"link",href:M,title:N,text:R,attrs:F,children:S,loading:!A.closed,raw:A.html||l},A.nextIndex]}if(f)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const h=qg(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Mp(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Mp(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let m=h.html||l,k=!h.closed,y=!1;if(!h.closed){const A=`</${a}>`;m.toLowerCase().includes(A.toLowerCase())||(m+=A),y=!0,k=!0}const g=[],v=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let b;for(;(b=v.exec(l))!==null;){const A=b[1],I=b[2]||b[3]||b[4]||"";g.push([A,I])}if(c?.has(a)){const A=BX(e);return[{type:a,tag:a,attrs:g,content:A?A.inner:h.innerTokens.length?Ny(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??m,loading:e.loading||k,autoClosed:y},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:g,content:m,children:p,raw:m,loading:k,autoClosed:y},h.nextIndex]}function n8(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>n8(t)).join(""):String(e.content??"")}function HX(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>n8(t)).join("")}function mC(e,t=!1){let n=e.attrs??[],o=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,o=d;break}}const s=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=HX(o??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):o?.content!=null&&String(o.content).length>0?l=String(o.content):Array.isArray(o?.children)&&o.children[0]?.content?l=String(o.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:s,alt:l,title:c,raw:u,loading:t}}function WX(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function zX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function UX(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const o=n?.[0];o&&t.push([String(o),String(n?.[1]??"")])}return t}function Tm(e,t){const n=t.toLowerCase();for(let o=e.length-1;o>=0;o--){const[s,i]=e[o];if(String(s).toLowerCase()===n)return i}}function qX(e,t,n){const o=e.slice();return Tm(o,"href")||o.push(["href",t]),n!=null&&!Tm(o,"title")&&o.push(["title",n]),o}function Kh(e,t,n){const o=e[t],s=UX(o.attrs),i=String(Tm(s,"href")??""),r=Tm(s,"title"),l=r==null?null:String(r),a=qX(s,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let f=u;const h=u[u.length-1];if(n?.__insideStrong&&h?.type==="text"&&String(h.content??"").endsWith("**")&&!u.some(k=>k.type==="strong_open")){const k=String(h.content??""),y=String(h.raw??k),g=Da(h);g.content=k.slice(0,-2),g.raw=y.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=g}const p=ao(f,void 0,void 0,n),m=p.map(k=>{const y=k;return"content"in k?String(y.content??""):String(y.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:m,children:p,raw:`[${m}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function gC(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function jX(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function vC(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const VX=/\\([\\()[\]`$|*_\-!])/g;function KX(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(VX,"$1")===t))return n}function rd(e,t,n,o){const s=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...o,__insideStrong:!0};return s.push(...ao(l,KX(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function GX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)s+=String(e[i].content??""),r.push(e[i]),i++;o.push(...ao(r,void 0,void 0,n));const l=String(e[t].content??""),a=s||l;return{node:{type:"subscript",children:o.length>0?o:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function YX(e,t,n){const o=[];let s="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)s+=String(e[i].content??""),r.push(e[i]),i++;return o.push(...ao(r,void 0,void 0,n)),{node:{type:"superscript",children:o.length>0?o:[{type:"text",content:s||String(e[t].content??""),raw:s||String(e[t].content??"")}],raw:`^${s||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function ZX(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const XX=/[^~]*~{2,}[^~]+/,QX=/\*\*/,JX=/[[_*^~]/,eQ=/\\([\\()[\]`$|*_\-!])/g,x2=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),tQ=/\s/u,nQ=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,oQ=/\p{P}/u,sQ=/^[《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,iQ=/^[》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,rQ=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,lQ=/:\/\//,Iy=1,o8=2,aQ=4,cQ=8,s8=16,kl=32,Ep=64,bd=128,i8=256,uQ=512,xd=1024,dQ=1982;function Gh(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=bd;break;case 36:t|=i8;break;case 40:t|=xd;break;case 42:t|=o8;break;case 91:t|=kl;break;case 92:t|=Iy;break;case 93:t|=Ep;break;case 95:t|=aQ;break;case 96:t|=s8;break;case 124:t|=uQ;break;case 126:t|=cQ;break}return t}function fQ(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function r8(e,t=0){if(!e)return-1;let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&x2.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function zl(e){return!!e&&tQ.test(e)}function Ul(e){return!!e&&(nQ.test(e)||oQ.test(e))}function l8(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&sQ.test(e)}function a8(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&iQ.test(e)}function hQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||zl(o)?!1:!(Ul(o)&&!l8(o,n)&&n&&!zl(n)&&!Ul(n))}function pQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||zl(n)?!1:!(Ul(n)&&!a8(n,o)&&o&&!zl(o)&&!Ul(o))}function mQ(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?r8(e,o):t.indexOf("*",o);if(i===-1)break;if(pQ(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function gQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||zl(o)?!1:!(Ul(o)&&!l8(o,n)&&n&&!zl(n)&&!Ul(n))}function vQ(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||zl(n)?!1:!(Ul(n)&&!a8(n,o)&&o&&!zl(o)&&!Ul(o))}function yQ(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(vQ(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function kQ(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let o=0;for(;n+o<e.length&&e[n+o]==="\\";)o++;const s=e[n+o];if(t+="\\".repeat(Math.floor(o/2)),o%2===1){if(s&&x2.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function bQ(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&x2.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function xQ(e,t,n){const o=bQ(e,t);if(o===-1||e[o]!==n)return!1;let s=0;for(let i=o-1;i>=0&&e[i]==="\\";i--)s++;return s%2===1}const wQ=/[\p{L}\p{N}]/u,_Q=/^[\p{L}\p{N}]+$/u;function Ly(e){return e?wQ.test(e):!1}function c8(e){return e?_Q.test(e):!1}function Hd(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const o=t>0?e[t-1]:void 0,s=n<e.length?e[n]:void 0;return{len:n-t,prev:o,next:s,intraword:Ly(o)&&Ly(s)}}function SQ(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=Hd(e,n),s=n+o.len;o.len>=2&&o.intraword&&t.push({start:n,end:s}),n=s}for(let n=0;n<t.length-1;n++){const o=t[n],s=t[n+1];if(!c8(e.slice(o.end,s.start)))return s.end}return-1}function CQ(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function AQ(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=Hd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function MQ(e){return e?rQ.test(e)||lQ.test(e):!1}function EQ(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function ao(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Df(t),r={filename:s?.filename||i.filename,explicitFilename:s?.explicitFilename||i.explicitFilename,marketTicker:s?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(o={...o,__linkifyDemotionContext:r});const l=o,a=[];let c=null,u=0;const d=o?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function p(){c=null}function m(Y,Q){const P=e.length===1?t:String(Q.content??""),G=[],me=SQ(Y);if(me!==-1){A(Y.slice(0,me),Y.slice(0,me));const de=Y.slice(me);return de&&(F({type:"text",content:de,raw:de}),u--),u++,!0}if(XX.test(Y)){const de=Y.indexOf("~~");de!==-1&&G.push({type:"strikethrough",index:de})}if(QX.test(Y)){const de=Y.indexOf("**");de!==-1&&G.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(Y)){const de=P?r8(P,0):Y.indexOf("*");if(P&&de===-1)return!1;de!==-1&&G.push({type:"emphasis",index:de})}G.sort((de,V)=>de.index!==V.index?de.index-V.index:de.type===V.type?0:de.type==="strong"?-1:V.type==="strong"?1:0);const ye=G[0];if(!ye)return!1;if(ye.type==="strikethrough"){const de=ye.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;const se=Y.indexOf("~~",de+2),pe=se===-1?Y.slice(de+2):Y.slice(de+2,se),ke=se===-1?"":Y.slice(se+2),{node:Ne}=vC([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),b(Ne),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}if(ye.type==="strong"){const de=ye.index,V=de>-1?Y.slice(0,de):"";if(V&&A(V,V),de===-1)return u++,!0;if(t&&de===0){let be=!1,xe=0;for(;xe<Y.length&&Y[xe]==="*";)xe++;if(t.startsWith("\\*")&&(be=!0),be){let Ze=0,tt=0;for(;tt<t.length&&Ze<xe;)if(t[tt]==="\\"&&tt+1<t.length&&t[tt+1]==="*")Ze+=1,tt+=2;else{if(t[tt]==="*")break;tt++}if(Ze>=2)return A(Y,Y),u++,!0}}if(t&&(Y.match(/\*/g)||[]).length>fQ(t))return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;const se=Hd(Y,de);if(se.len>=3){const be=AQ(Y,de+se.len);if(be!==-1){const xe=Y.slice(de+se.len,be);if(CQ(xe)){const{node:Ze}=rd([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:xe,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);p(),b(Ze);const tt=Y.slice(be+3);return tt&&(F({type:"text",content:tt,raw:tt}),u--),u++,!0}}}if(!gQ(Y,de)){const be=Y.slice(de,de+se.len);A(be,be);const xe=Y.slice(de+se.len);return xe&&(F({type:"text",content:xe,raw:xe}),u--),u++,!0}const pe=yQ(Y,de+2);let ke="",Ne="";if(pe.index!==-1){ke=Y.slice(de+2,pe.index),Ne=Y.slice(pe.index+2);const be=pe.index,xe=Hd(Y,be);if(se.intraword&&xe.intraword&&!c8(ke)||!ke&&se.len>=4&&se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0}else{if(d||pe.sawInvalidClose||se.intraword)return A(Y.slice(V.length),Y.slice(V.length)),u++,!0;ke=Y.slice(de+2),Ne=""}if(!ke&&/^\*+$/.test(Ne))return A(Y,Y),u++,!0;const{node:qe}=rd([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ke,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),b(qe),Ne&&(F({type:"text",content:Ne,raw:Ne}),u--),u++,!0}if(ye.type==="emphasis"){let de=ye.index;de===-1&&(de=0);const V=Y.slice(0,de);if(V&&A(V,V),!hQ(Y,de)){A(Y[de],Y[de]);const be=Y.slice(de+1);return be&&(F({type:"text",content:be,raw:be}),u--),u++,!0}const se=Hd(Y,de),pe=mQ(P,Y,de+1),ke=pe.index,Ne=e[u+1];if(o?.final&&Ne?.type==="em_open"&&ke!==-1&&Y.slice(de+1,ke).trim()!==Y.slice(de+1,ke)||ke===-1&&(pe.sawInvalidClose||o?.final||se.intraword||!Ly(Y[de+1])))return A(Y.slice(de),Y.slice(de)),u++,!0;const{node:qe}=Vh([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ke>-1?Y.slice(de+1,ke):Y.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),b(qe),ke!==-1&&ke<Y.length-1){const be=Y.slice(ke+1);be&&(F({type:"text",content:be,raw:be}),u--)}return u++,!0}return!1}function k(Y,Q){if(!Y.includes("`"))return!1;const G=(Ne=>{for(let qe=0;qe<Ne.length;qe++){if(Ne[qe]!=="`")continue;let be=0;for(let xe=qe-1;xe>=0&&Ne[xe]==="\\";xe--)be++;if(be%2===0)return qe}return-1})(Y);if(G===-1)return!1;let me=1;for(let Ne=G+1;Ne<Y.length&&Y[Ne]==="`";Ne++)me++;const ye="`".repeat(me),de=G+me,V=Y.indexOf(ye,de);if(V===-1){if(me===1){const qe=Y.slice(0,G),be=Y.slice(G+1);return qe&&(m(qe,Q)?u--:A(qe,qe)),g({type:"inline_code",code:be,raw:String(be)}),u++,!0}let Ne=Y;for(let qe=u+1;qe<e.length;qe++)Ne+=String((e[qe].content??"")+(e[qe].markup??""));return u=e.length-1,A(Ne,Ne),u++,!0}p();const se=Y.slice(0,G),pe=Y.slice(G+me,V),ke=Y.slice(V+me);return se&&(m(se,Q)?u--:A(se,se)),g({type:"inline_code",code:pe,raw:String(pe??"")}),ke&&(F({type:"text",content:ke,raw:ke}),u--),u++,!0}function y(Y){const Q=l?.__markdownIt;if(!Q||e.length<=1||!e.some(ye=>ye?.type==="math_inline")||!JX.test(Y))return null;const P=Q.parseInline(Y,{__markstreamFinal:!!o?.final});if(!Array.isArray(P)||P.length===0)return null;const G=(P.find(ye=>ye?.type==="inline")?.children??[]).filter(ye=>!(ye?.type==="text"&&String(ye.content??"")===""));if(!G.length||!G.some(ye=>ye?.type!=="text")||G.length===1&&G[0]?.type==="text"&&String(G[0].content??"")===Y)return null;const me=ao(G,Y,n,o);return me.length?me:null}function g(Y){p(),a.push(Y)}function v(Y){p();const Q=Da(Y);a.push(Q)}function b(Y){g(Y)}function A(Y,Q){c?(c.content+=Y,c.raw+=Q??Y):(c={type:"text",content:String(Y??""),raw:String(Q??Y??"")},a.push(c))}function I(Y,Q){if(!Y)return;const P=ao([{...Q,type:"text",content:Y,raw:Y}],Y,n,o);if(P.length===1&&P[0]?.type==="text"){const G=P[0];A(String(G.content??""),String(G.raw??G.content??""));return}for(const G of P)b(G)}function T(Y,Q){return String(Y.markup??"").startsWith(Q)}function M(Y){if(!c||Y.loading!==!0||Y.markup!=="\\(\\)")return;const Q=e[u-1];!Q||Q.type!=="text"||!T(Q,"\\(")||c.content.endsWith("(")&&(c.content=c.content.slice(0,-1),c.raw.endsWith("(")&&(c.raw=c.raw.slice(0,-1)),!c.content&&a[a.length-1]===c&&(a.pop(),c=null))}function $(Y){return Y.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function N(Y,Q,P=Gh(Y)){let G=Y;const me=String(Q.content??"");return(P&Iy)!==0&&G.endsWith("\\")&&!T(Q,"\\\\")&&!me.endsWith("\\\\")&&(G=G.slice(0,-1)),(P&xd)!==0&&G.endsWith("(")&&!T(Q,"\\(")&&!me.endsWith("\\(")&&(G=G.slice(0,-1)),(P&o8)!==0&&/\*+$/.test(G)&&!T(Q,"\\*")&&!me.endsWith("\\*")&&(G=G.replace(/\*+$/,"")),G}for(;u<e.length;){const Y=e[u];F(Y)}function F(Y){switch(Y.type){case"text":R(Y);break;case"softbreak":c?(c.content+=`
202
+ `,c.raw+=`
203
+ `):(c={type:"text",content:`
204
+ `,raw:`
205
+ `},a.push(c)),u++;break;case"code_inline":b(WX(Y)),u++;break;case"html_inline":{const[Q,P]=PX(Y,e,u,ao,t,n,o);b(Q),u=P;break}case"link_open":z(Y);break;case"image":ne(Y)||(p(),b(mC(Y)),u++);break;case"strong_open":{p();const{node:Q,nextIndex:P}=rd(e,u,Y.content,o);b(Q),u=P;break}case"em_open":{p();const{node:Q,nextIndex:P}=Vh(e,u,o);b(Q),u=P;break}case"s_open":{p();const{node:Q,nextIndex:P}=vC(e,u,o);b(Q),u=P;break}case"mark_open":{p();const{node:Q,nextIndex:P}=FX(e,u,o);b(Q),u=P;break}case"ins_open":{p();const{node:Q,nextIndex:P}=zX(e,u,o);b(Q),u=P;break}case"sub_open":{p();const{node:Q,nextIndex:P}=GX(e,u,o);b(Q),u=P;break}case"sup_open":{p();const{node:Q,nextIndex:P}=YX(e,u,o);b(Q),u=P;break}case"sub":p(),b({type:"subscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`~${String(Y.content??"")}~`}),u++;break;case"sup":p(),b({type:"superscript",children:[{type:"text",content:String(Y.content??""),raw:String(Y.content??"")}],raw:`^${String(Y.content??"")}^`}),u++;break;case"emoji":{p();const Q=e[u-1];Q?.type==="text"&&/\|:-+/.test(String(Q.content??""))?A("",""):b(EX(Y)),u++;break}case"checkbox":p(),b(AX(Y)),u++;break;case"checkbox_input":p(),b(MX(Y)),u++;break;case"footnote_ref":p(),b(LX(Y)),u++;break;case"footnote_anchor":{p();const Q=Y.meta??{};g({type:"footnote_anchor",id:String(Q.label??Y.content??""),raw:String(Y.content??"")}),u++;break}case"hardbreak":p(),b($X()),u++;break;case"fence":p(),b(b2(e[u])),u++;break;case"math_inline":M(Y),p(),!Y.content&&Y.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(b(gC({...Y,content:e[u+1].content})),u+=2):b(gC(Y)),u++;break;case"reference":L(Y);break;case"text_special":A(String(Y.content??""),String(Y.content??"")),u++;break;default:{const Q=Y;if(Y.type==="link"&&Q.href!=null&&o?.validateLink&&!o.validateLink(String(Q.href))){p();const P=String(Q.text??"");A(P,P),u++}else j(Y)||U(Y)||ie(Y)||O(Y)||v(Y),u++;break}}}function S(Y,Q,P,G,me=Gh(Y)){const ye=ZX({...Q,content:Y});if(c){c.content+=N(ye.content,Q,me),c.raw+=ye.raw;return}const de=P?.tag==="br"&&e[u-2]?.content==="[";G||(ye.content=N(ye.content,Q,me)),c=ye,c.center=de,a.push(c)}function R(Y){const Q=String(Y.content??""),P=Gh(Q),G=(P&Iy)!==0,me=e.length===1&&G&&typeof t=="string"?String(t):"";let ye=me?kQ(me):G?Q.replace(eQ,"$1"):Q;const de=ye===Q?P:Gh(ye);if(Y.content==="<"||ye==="1"&&e[u-1]?.tag==="br"){u++;return}const V=(de&i8)!==0?ye.indexOf("$"):-1;V!==-1&&V===ye.lastIndexOf("$")&&ye.endsWith("$")&&(ye=ye.slice(0,-1)),ye.endsWith("undefined")&&!t?.endsWith("undefined")&&(ye=ye.slice(0,-9));let se=a.length,pe="";for(let be=a.length-1;be>=0;be--){const xe=a[be];if(xe.type!=="text")break;se=be,pe=String(xe.content??"")+pe}se<a.length&&(ye.startsWith(pe)?(c=null,a.length=se):c=a[a.length-1]);const ke=e[u+1];if((ye==="`"||ye==="|"||ye==="$")&&!T(Y,`\\${ye}`)||/^\*+$/.test(ye)&&!T(Y,"\\*")){u++;return}if(!ke&&(de&xd)!==0&&/[^\]]\s*\(\s*$/.test(ye)&&(ye=ye.replace(/\(\s*$/,"")),!ye){u++;return}if((de&(kl|bd))===(kl|bd)&&fe(ye)||(de&(Ep|xd))===(Ep|xd)&&K(ye))return;if((de&dQ)===0){S(ye,Y,e[u-1],ke,de),u++;return}if((de&kl)!==0&&re(ye))return;const Ne=e[u-1];if((de&kl)!==0&&ye==="["&&!ke?.markup?.includes("*")&&!T(Y,"\\[")||(de&Ep)!==0&&ye==="]"&&!Ne?.markup?.includes("*")&&!T(Y,"\\]")){u++;return}if((de&s8)!==0&&k(Q,Y)||(de&(bd|kl))===(bd|kl)&&Ae(ye)||(de&kl)!==0&&(e[u+1]?.type!=="link_open"||$(ye))&&he(ye,Y))return;const qe=y(Q);if(qe){p();for(const be of qe)b(be);u++;return}m(ye,Y)||(S(ye,Y,Ne,ke,de),u++)}function z(Y){if(W(Y))return;if(ve()){const{node:V,nextIndex:se}=Kh(e,u,o),pe=String(V.text||V.href||"");A(pe,pe),u=se;return}p();const{node:Q,nextIndex:P}=Kh(e,u,o);u=P;const G=Q.text||Q.href||"";if(Y.markup==="linkify"&&!D5(G,Q.href,t)&&Cm(G,l?.__linkifyDemotionContext)){A(G,G);return}const me=Q.children.length===1&&Q.children[0]?.type==="text";if(Q.loading&&t&&Q.text===Q.href&&me){const V=EQ(t,Q.href);V&&(Q.text=V,Q.children=[{type:"text",content:V,raw:V}],Q.raw=`[${V}](${Q.href}${Q.title?` "${Q.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(Q.href)){A(Q.text,Q.text);return}const ye=Y.attrs?.find(([V])=>V==="href")?.[1],de=String(ye??"");if(t&&de){const V=t.indexOf("](");if(V!==-1){const se=t.indexOf(")",V+2);se===-1?Q.loading=!0:Q.loading&&t.slice(V+2,se).includes(de)&&(Q.loading=!1)}}O(Q)||g(Q)}function W(Y){if(Y.markup!=="linkify")return!1;const{node:Q,nextIndex:P}=Kh(e,u,o);return Z(Q,P)?(u=P,!0):!1}function L(Y){p(),b(jX(Y)),u++}function O(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1];if(!Q||Q.type!=="text")return!1;const P=String(Q.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!P)return!1;const G=Y,me=String(G.href??""),ye=String(G.text??""),de=String(P[2]??""),V=me.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!me||!(ye===me||ye===V||MQ(ye)))return!1;const se=String(P[1]??"");return se?(Q.content=se,Q.raw=se):a.pop(),g({...Y,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${me}${G.title?` "${G.title}"`:""})`}),!0}function U(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.href??"");return P?Z({href:P,title:Q.title==null||Q.title===""?null:String(Q.title),loading:!!Q.loading},u+1):!1}function Z(Y,Q){const P=a[a.length-1];if(P?.type!=="image"||P.src||!P.loading||!String(P.raw??"").endsWith("]("))return!1;const G=e[Q],me=String(G?.content??"");if(G?.type!=="text"||!me.startsWith(")"))return!1;a.pop(),c=null;const ye=String(P.alt??"");g({type:"image",src:Y.href,alt:ye,title:Y.title,raw:`![${ye}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const de=me.slice(1),V=Da(G);return V.content=de,V.raw=de,h()[Q]=V,!0}function ie(Y){if(Y.type!=="link")return!1;const Q=a[a.length-1],P=e[u-1];if(!Q||Q.type!=="text"||P?.type!=="text")return!1;const G=String(Q.content??""),me=String(P.content??"");if(!G.endsWith("!")||!me.endsWith("!")||T(P,"\\!"))return!1;const ye=G.slice(0,-1);ye?(Q.content=ye,Q.raw=ye,c=Q):(a.pop(),c=null);const de=Y,V=String(de.text??de.children?.map(ke=>String(ke?.content??ke?.raw??"")).join("")??""),se=String(de.href??""),pe=de.title==null||de.title===""?null:String(de.title);return g({type:"image",src:se,alt:V,title:pe,raw:`![${V}](${se}${pe?` "${pe}"`:""})`,loading:!!de.loading}),!0}function q(Y,Q="",P=null){const G=String(Y.alt??Y.raw??"");return{type:"link",href:Q,title:P,text:G,children:[Y],raw:`[${G}](${Q}${P?` "${P}"`:""})`,loading:!0}}function ee(Y){const Q=Y.startsWith("![")?Y:`![${Y}`,P=Q.slice(2),G=P.indexOf("](");return{type:"image",src:"",alt:G===-1?P.replace(/\]$/,""):P.slice(0,G),title:null,raw:Q,loading:!0}}function fe(Y){const Q=Y.indexOf("[![");if(Q===-1||typeof t=="string"&&e.length===1&&xQ(t,Q,"["))return!1;const P=Y.slice(0,Q);return P&&A(P,P),g(q(ee(Y.slice(Q+1)))),u++,!0}function ne(Y){if(o?.final)return!1;const Q=e[u-1];if(Q?.type!=="text"||!String(Q.content??"").endsWith("[")||T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type==="text"&&P.content.endsWith("[")){const G=P.content.slice(0,-1);G?(P.content=G,P.raw=G,c=P):(a.pop(),c=null)}return g(q(mC(Y))),u++,!0}function j(Y){if(Y.type!=="link")return!1;const Q=Y,P=String(Q.raw??""),G=String(Q.text??"");if(!P.startsWith("[![")&&!G.startsWith("!["))return!1;const me=Q.title==null||Q.title===""?null:String(Q.title);return g(q({type:"image",src:String(Q.href??""),alt:G.replace(/^!\[/,"").replace(/\]$/,""),title:me,raw:P.startsWith("[![")?P.slice(1):P,loading:!0})),!0}function K(Y){if(!Y.startsWith("]("))return!1;const Q=e[u-2];if(Q?.type==="text"&&String(Q.content??"").endsWith("[")&&T(Q,"\\["))return!1;const P=a[a.length-1];if(P?.type!=="image"&&P?.type!=="link")return!1;const G=P,me=P?.type==="link"&&Array.isArray(G.children)&&G.children.length===1&&G.children[0]?.type==="image"?a.pop():null,ye=me?me.children[0]:a.pop();if(!ye||ye.type!=="image")return!1;const de=e[u+1];let V=String(me?.href??""),se=me?.title==null?null:String(me.title),pe=!0;if(de?.type==="link_open"){const{node:Ne,nextIndex:qe}=Kh(e,u+1,o);V=Ne.href,se=Ne.title,pe=!0,u=qe}else{if(V=Y.slice(2),V.includes('"')){const Ne=V.split('"');V=String(Ne[0]??"").trim(),se=Ne[1]==null?null:String(Ne[1]).trim()}u++}const ke=q(ye,V,se);return ke.loading=pe,g(ke),!0}function ve(){const Y=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&T(Y,"\\[")}function he(Y,Q){const P=Y.indexOf("[");if(P===-1)return!1;let G=Y.slice(0,P);const me=Y.indexOf("](",P);if(me!==-1){const ye=e[u+2];let de=Y.slice(P+1,me);if(de.includes("[")){const be=de.indexOf("[");G+=Y.slice(0,P+be+1);const xe=P+be+1;de=Y.slice(xe+1,me)}const V=e[u+1];if(Y.endsWith("](")&&V?.type==="link_open"&&ye){const be=e[u+4];let xe=4,Ze=!0;if(be?.type==="text"){const lt=String(be.content??"");if(lt.startsWith(")")){Ze=!1;const ut=lt.slice(1);if(ut){const mt=Da(be);mt.content=ut,mt.raw=ut,h()[u+4]=mt}else xe++}else lt==="."&&xe++}I(G,Q);const tt=String(ye.content??"");return o?.validateLink&&!o.validateLink(tt)?A(de,de):g({type:"link",href:tt,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ze}),u+=xe,!0}const se=Y.indexOf(")",me),pe=se!==-1?Y.slice(me+2,se):"",ke=se===-1;let Ne=G.match(/\*+$/);if(Ne&&(G=G.replace(/\*+$/,"")),I(G,Q),Ne||(Ne=de.match(/^\*+/)),!d&&Ne){const be=Ne[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const xe=[];if(be===1?xe.push({type:"em_open",tag:"em",nesting:1}):be===2?xe.push({type:"strong_open",tag:"strong",nesting:1}):be===3&&(xe.push({type:"strong_open",tag:"strong",nesting:1}),xe.push({type:"em_open",tag:"em",nesting:1})),xe.push({type:"link",href:pe,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke}),be===1){xe.push({type:"em_close",tag:"em",nesting:-1});const{node:Ze}=Vh(xe,0,o);b(Ze)}else if(be===2){xe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ze}=rd(xe,0,void 0,o);b(Ze)}else if(be===3){xe.push({type:"em_close",tag:"em",nesting:-1}),xe.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ze}=rd(xe,0,void 0,o);b(Ze)}else{const{node:Ze}=Vh(xe,0,o);b(Ze)}}else o?.validateLink&&!o.validateLink(pe)?A(de,de):g({type:"link",href:pe,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:ke});const qe=se!==-1?Y.slice(se+1):"";return qe&&(F({type:"text",content:qe,raw:qe}),u--),u++,!0}return!1}function Ae(Y){const Q=Y.indexOf("![");if(Q===-1)return!1;const P=Y.slice(0,Q);return P&&!c?c={type:"text",content:P,raw:P}:P&&c&&(c.content+=P),c&&(a.push(c),c=null),g(ee(Y.slice(Q))),u++,!0}function re(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const Q=Y.slice(1).match(/[^\s\]]/);if(Q===null)return u++,!0;if(Q&&/x/i.test(Q[0])){const P=Q[0]==="x"||Q[0]==="X";return g({type:"checkbox_input",checked:P,raw:P?"[x]":"[ ]"}),u++,!0}return!1}return a}function w2(e,t,n){const o=n?.__sourceLineMapper;if(!o)return{startLine:e,endLine:t};const s=o(e),i=t>e?o(t-1).endLine:o(t).startLine;return{startLine:s.startLine,endLine:Math.max(s.startLine,i)}}function yC(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let o=0;for(let s=0;s<n;s++)e[s]===`
206
+ `&&o++;return o}function TQ(e,t,n){const o=Math.max(0,Math.min(e.length,Math.trunc(t))),s=Math.max(o,Math.min(e.length,Math.trunc(n))),i=yC(e,o);let r=yC(e,s);return s>o&&e[s-1]!==`
207
+ `&&r++,{startLine:i,endLine:r}}function H1(e,t,n,o){const s=TQ(e,t,n);return w2(s.startLine,s.endLine,o)}function NQ(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const o=Number(n[0]),s=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(s)?null:w2(o,s,t)}function fn(e,t,n){if(!n?.includeSourceMap)return e;const o=NQ(t,n);if(!o)return e;if(e.sourceMap=o,e.type==="code_block"){const s=e;s.startLine=o.startLine,s.endLine=o.endLine}return e}function IQ(e,t,n,o){if(!o?.includeSourceMap)return e;const s=t?.map;if(!Array.isArray(s)||s.length<2)return e;const i=Number(s[0]),r=Number(s[1]),l=Number(n);return!Number.isFinite(i)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=w2(i,Math.max(r,l),o)),e}function LQ(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){s.content=r;break}o.pop();continue}break}}function $Q(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const o=e.children;if(!(!Array.isArray(o)||o.length===0))for(;o.length;){const s=o[o.length-1];if(!s){o.pop();continue}if(s.type==="softbreak"||s.type==="hardbreak"){o.pop();continue}if(s.type==="text"){const i=String(s.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){o.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?s.content=r:o.pop())}break}}function FQ(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Au(e,t,n){const o=e[t],s=[],i=Yl(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const a=[];let c=r+1;for(;c<e.length&&e[c].type!=="list_item_close";)if(e[c].type==="paragraph_open"){const d=e[c+1],f=FQ(d)?Da(d):d,h=e[c-1];f!==d&&($Q(f),LQ(f));const p=String(f.content??""),m={type:"paragraph",children:ao(f.children||[],p,h,i.options()),raw:p};n?.includeSourceMap&&fn(m,e[c],n),a.push(m),i.remember(p),c+=3}else if(e[c].type==="blockquote_open"){const[d,f]=Mu(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Au(e,c,i.options());a.push(d),i.remember(d.raw),c=f}else{const d=S2(e,c,i.options(),_2);d?(a.push(d[0]),i.remember(d[0].raw),c=d[1]):c+=1}const u={type:"list_item",children:a,raw:a.map(d=>d.raw).join("")};n?.includeSourceMap&&fn(u,e[r],n),s.push(u),r=c+1}else r+=1;const l={type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const a=o.attrs.find(c=>c[0]==="start");if(a){const c=Number(a[1]);return Number.isFinite(c)&&c!==0?c:1}}})(),items:s,raw:s.map(a=>a.raw).join(`
208
+ `)};return n?.includeSourceMap&&fn(l,o,n),[l,r+1]}function OQ(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Yl(o,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:ao(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};o?.includeSourceMap&&fn(u,e[a],o),r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=Au(e,a,l.options());o?.includeSourceMap&&fn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=Mu(e,a,l.options());o?.includeSourceMap&&fn(c,e[a],o),r.push(c),l.remember(c.raw),a=u}else{const c=W1(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:s,title:i,children:r,raw:`:::${s} ${i}
209
+ ${r.map(c=>c.raw).join(`
210
+ `)}
211
+ :::`},a+1]}const BQ=new Set(["warning","info","note","tip","danger","caution"]);function RQ(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const o=n.search(/\s/),s=(o===-1?n:n.slice(0,o)).toLowerCase();return BQ.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function DQ(e,t,n){const o=e[t];let s="note",i="";const r=o.type.match(/^container_(\w+)_open$/);if(r){s=r[1];const d=String(o.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(s)){const f=d.slice(s.length).trim();f&&(i=f)}}else{const d=RQ(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Yl(n,!0);let c=t+1;const u=new RegExp(`^container_${s}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const f=d.children||[];let h=-1;for(let m=f.length-1;m>=0;m--){const k=f[m];if(k.type==="text"&&/:+/.test(k.content)){h=m;break}}const p={type:"paragraph",children:ao((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&fn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,f]=Au(e,c,a.options());n?.includeSourceMap&&fn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=Mu(e,c,a.options());n?.includeSourceMap&&fn(d,e[c],n),l.push(d),a.remember(d.raw),c=f}else{const d=W1(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:s,title:i,children:l,raw:`:::${s} ${i}
212
+ ${l.map(d=>d.raw).join(`
213
+ `)}
214
+ :::`},c+1]}const PQ=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function HQ(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=PQ.exec(String(o.info??""));return s?OQ(e,t,s,n):null}const _2={parseContainer:(e,t,n)=>DQ(e,t,n),matchAdmonition:HQ};function Mu(e,t,n){const o=[],s=Yl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";){const l=e[i];switch(l.type){case"paragraph_open":{const a=e[i+1],c={type:"paragraph",children:ao(a.children||[],String(a.content??""),void 0,s.options()),raw:String(a.content??"")};n?.includeSourceMap&&fn(c,l,n),o.push(c),s.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Au(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Mu(e,i,s.options());o.push(a),s.remember(a.raw),i=c;break}default:{const a=S2(e,i,s.options(),_2);a?(o.push(a[0]),s.remember(a[0].raw),i=a[1]):i++;break}}}const r={type:"blockquote",children:o,raw:o.map(l=>l.raw).join(`
215
+ `)};return n?.includeSourceMap&&fn(r,e[t],n),[r,i+1]}function WQ(e){if(e.info?.startsWith("diff"))return b2(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let o=t;n?.[1]&&(o=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const s=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:o,raw:o,loading:!s}}function zQ(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Yl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=ao(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),s+=3}else if(e[s].type==="dd_open"){let a=s+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:ao(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(o.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
216
+ `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
217
+ `)},s+1]}function UQ(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Yl(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:ao(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:s,children:i,raw:`[^${s}]: ${i.map(a=>a.raw).join(`
218
+ `)}`},l+1]}function qQ(e,t,n){const o=e[t],s=o.attrs,i=Array.isArray(s)&&s.length?Object.fromEntries(s.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(o.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:ao(a.children||[],c,void 0,n),raw:c}}function jQ(e,t,n){const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=po(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(s.test(c)){const u=po(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function u8(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const o=po(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Wl.has(n),l=P1(s),a=(o===-1?-1:jQ(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
219
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function VQ(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function KQ(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,o]=t;if(!o)continue;const s=String(o).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(s);if(i)return i[1].toLowerCase()}}return"left"}function d8(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function f8(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return d8(n)?n:void 0}function GQ(e,t,n){const o=f8(Df(t),n);if(!d8(o))return e;const s=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:s?.filename||o?.filename,explicitFilename:s?.explicitFilename||o?.explicitFilename,marketTicker:s?.marketTicker||o?.marketTicker}}}function YQ(e,t,n){let o=t+1,s=null;const i=[];let r=!1;for(;o<e.length&&e[o].type!=="table_close";)if(e[o].type==="thead_open")r=!0,o++;else if(e[o].type==="thead_close")r=!1,o++;else if(e[o].type==="tbody_open"||e[o].type==="tbody_close")o++;else if(e[o].type==="tr_open"){const a=[];let c=o+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const f=e[c].type==="th_open",h=e[c+1],p=String(h.content??""),m=KQ(e[c].attrs),k=a.length,y=!f&&!r,g=y?s?.cells[k]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:ao(h.children||[],p,void 0,GQ(n,g,y?u:void 0)),raw:p,align:m}),y&&(u=f8(u,Df(p))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(f=>f.raw).join("|")};r?s=d:i.push(d),o=c+1}else o++;s||(s={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:s,rows:i,loading:l&&!n?.final&&i.length===0,raw:[s,...i].map(a=>a.raw).join(`
220
+ `)},o+1]}function ZQ(){return{type:"thematic_break",raw:"---"}}let jg=null;const Vg=new WeakMap;function kC(){return jg||(jg={allowedTagSet:q1(),customTagSet:null}),jg}function XQ(e){if(!e||e.length===0)return kC();const t=Vg.get(e);if(t)return t;const n=e.map(Ti).filter(Boolean);if(!n.length){const s=kC();return Vg.set(e,s),s}const o={allowedTagSet:q1({customHtmlTags:e}),customTagSet:new Set(n)};return Vg.set(e,o),o}function QQ(e,t,n){const o=e[t],s=o.attrs;let i="";const r={};if(s){for(const[h,p]of s)if(h==="class"){const m=p.match(/(?:\s|^)vmr-container-(\S+)/);m&&(i=m[1])}else if(h.startsWith("data-")){const m=h.slice(5);try{r[m]=JSON.parse(p)}catch{r[m]=p}}}const l=[],a=Yl(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const h=e[c+1];if(h){const p={type:"paragraph",children:ao(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};n?.includeSourceMap&&fn(p,e[c],n),l.push(p),a.remember(p.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[h,p]=Au(e,c,a.options());n?.includeSourceMap&&fn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=Mu(e,c,a.options());n?.includeSourceMap&&fn(h,e[c],n),l.push(h),a.remember(h.raw),c=p}else{const h=W1(e,c,a.options());h?(l.push(h[0]),a.remember(h[0].raw),c=h[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u&&o.meta?.unclosed!==!0||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
221
+ `,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
222
+ `),f+=`
223
+ `),f+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:f},u?c+1:c]}function Kg(e,t,n,o){if(n?.type.endsWith("_close")){let s=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(s)||(s=Array.isArray(t.map)?Number(t.map[1])+1:NaN),IQ(e,t,s,o)}return fn(e,t,o)}function JQ(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function eJ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function tJ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Ki(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ki(o)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=po(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(s.test(c)){const u=po(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function nJ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${o}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n||0);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=po(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const p=c+1;return{raw:e.slice(r,p),start:r,end:p}}let u=1,d=c+1;const f=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(m)},h=p=>{const m=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(m)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length};if(h(p)){const m=e.indexOf(">",p);if(m===-1)return null;if(u--,u===0){const k=m+1;return{raw:e.slice(r,k),start:r,end:k}}d=m+1;continue}if(f(p)){const m=po(e.slice(p));if(m===-1)return null;u++,d=p+m+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length}}function $y(e){return Number.isFinite(e)&&e>0?e:0}function oJ(e,t){const n=$y(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
224
+ `&&(o++,o===n))return s+1;return e.length}function W1(e,t,n){const o=e[t],s=n?.includeSourceMap===!0;switch(o.type){case"heading_open":{const i=qQ(e,t,n);return s&&fn(i,o,n),[i,t+3]}case"code_block":{const i=WQ(o);return s&&fn(i,o,n),[i,t+1]}case"fence":{const i=b2(o);return s&&fn(i,o,n),[i,t+1]}case"math_block":{const i=VQ(o);return s&&fn(i,o,n),[i,t+1]}case"html_block":{const i=u8(o),r=i.tag?XQ(n?.customHtmlTags):null;if(i.tag&&i.loading&&r&&!r.allowedTagSet.has(i.tag)){const l=String(o.content??"").replace(/\n+$/,""),a={type:"paragraph",children:l?[{type:"text",content:l,raw:l}]:[],raw:l};return s&&fn(a,o,n),[a,t+1]}if(i.tag&&r?.customTagSet?.has(i.tag)){const l=i.tag,a=String(n?.__sourceMarkdown??""),c=Number(n?.__customHtmlBlockCursor??0),u=Array.isArray(o.map)?oJ(a,Number(o.map?.[0]??0)):0,d=nJ(a,l,Math.max($y(c),$y(u)));d&&n&&(n.__customHtmlBlockCursor=d.end);const f=String(d?.raw??i.raw??""),h=po(f),p=h!==-1?f.slice(0,h+1):f,m=h!==-1&&/\/\s*>\s*$/.test(p),k=h===-1?null:tJ(f,l,h+1),y=k?.start??-1;let g="";h!==-1&&(y!==-1&&h<y?g=f.slice(h+1,y):g=f.slice(h+1)),y===-1&&(g=eJ(g,l));const v=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=b.exec(p))!==null;){const M=A[1];if(!M||M.toLowerCase()===l)continue;const $=A[2]||A[3]||A[4]||"";v.push([M,$])}const I=!n?.final&&!m&&k==null,T={type:l,tag:l,content:JQ(g),raw:String(d?.raw??i.raw??f),loading:I,attrs:v.length?v:void 0};return s&&(d?T.sourceMap=H1(a,d.start,d.end,n):fn(T,o,n)),[T,t+1]}return s&&fn(i,o,n),[i,t+1]}case"table_open":{const[i,r]=YQ(e,t,n);return s&&fn(i,o,n),[i,r]}case"dl_open":{const[i,r]=zQ(e,t,n);return s&&fn(i,o,n),[i,r]}case"footnote_open":{const[i,r]=UQ(e,t,n);return s&&fn(i,o,n),[i,r]}case"hr":{const i=ZQ();return s&&fn(i,o,n),[i,t+1]}}return null}function S2(e,t,n,o){const s=W1(e,t,n);if(s)return s;const i=e[t],r=n?.includeSourceMap===!0;switch(i.type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(o?.parseContainer){const l=o.parseContainer(e,t,n);return r&&Kg(l[0],i,e[l[1]-1],n),l}break;case"container_open":if(o?.matchAdmonition){const l=o.matchAdmonition(e,t,n);if(l)return r&&Kg(l[0],i,e[l[1]-1],n),l}break;case"vmr_container_open":{const l=QQ(e,t,n);return r&&Kg(l[0],i,e[l[1]-1],n),l}}return null}function sJ(){return{type:"hardbreak",raw:`\\
225
+ `}}function iJ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:ao(o.children||[],s,void 0,n),raw:s}}const bC=new WeakMap,h8=new WeakMap,xC=new WeakMap,wC=new WeakMap;function nr(e,t,n){const o=t?.map,s=n?.__sourceMarkdown;if(!Array.isArray(o)||o.length<2||typeof s!="string"||!n)return;const i=Number(o[0]),r=Number(o[1]);if(!Number.isFinite(i)||!Number.isFinite(r))return;let l=xC.get(n);if(!l){l=[0];for(let a=0;a<s.length;a++)s[a]===`
226
+ `&&l.push(a+1);xC.set(n,l)}h8.set(e,{start:l[Math.max(0,Math.trunc(i))]??s.length,end:l[Math.max(0,Math.trunc(r))]??s.length})}const z1=new WeakMap,_C=new WeakMap,rJ=["$$","\\["],lJ=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/,Nm=new WeakMap,wd=new WeakMap,aJ=new Set(["code_inline","em_close","em_open","emoji","hardbreak","ins_close","ins_open","mark_close","mark_open","s_close","s_open","softbreak","strong_close","strong_open","sub","sup","text"]),cJ=new Map([["paragraph_open","paragraph_close"],["heading_open","heading_close"],["bullet_list_open","bullet_list_close"],["ordered_list_open","ordered_list_close"],["blockquote_open","blockquote_close"],["table_open","table_close"]]),uJ=new Set(["code_block","fence","hr","math_block"]);function bu(){return typeof performance<"u"?performance.now():Date.now()}function xf(e,t,n){e&&(e[t]=(e[t]??0)+n)}function p8(e){return e.__timing}function m8(e,t,n){return t&&xf(t,"parseMarkdownToStructureTotalMs",bu()-n),e}function g8(e,t){const n=t.postTransformNodes;if(typeof n!="function")return e;const o=n(e);return Array.isArray(o)?o:e}function SC(e,t,n,o){return m8(g8(e,t),n,o)}function Tp(e,t,n){if(!n)return BC(e,t);xf(n,"processTokensInputTokens",e.length);const o=bu(),s=BC(e,t);return xf(n,"processTokensMs",bu()-o),s}function v8(e){return e.every(t=>{if(!aJ.has(t.type))return!1;const n=t.children;return!Array.isArray(n)||v8(n)})}function dJ(e){const t=[];let n=!1,o=0;for(;o<e.length;){const s=e[o];if(!s||s.level!==0)return null;const i=cJ.get(s.type);let r=o+1;if(i){if(s.nesting!==1)return null;for(;r<e.length;){const l=e[r];if(l.level===0){if(l.type!==i||l.nesting!==-1)return null;r++;break}r++}if(e[r-1]?.type!==i)return null;if(s.type==="paragraph_open"||s.type==="heading_open"){if(r!==o+3||e[o+1]?.type!=="inline")return null}else n=!0}else if(uJ.has(s.type)){if(s.nesting!==0)return null;n=!0}else return null;for(let l=o;l<r;l++){const a=e[l];if(a.type!=="inline")continue;const c=a.children;if(!Array.isArray(c)||!v8(c))return null}t.push(o),o=r}return{mixed:n,starts:t}}function fJ(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function hJ(e){return e.__reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function CC(e,t,n,o,s,i){const r=o.starts;if(r.length===0||s.length!==r.length){Nm.delete(e);return}const l=r.map((a,c)=>{const u=r[c+1]??n.length;return{firstToken:n[a],lastToken:n[u-1],tokenCount:u-a}});Nm.set(e,{groupBoundaries:l,source:t,nodes:s,stableGroupCount:o.mixed?Math.max(0,r.length-1):fJ(t)?r.length:Math.max(0,r.length-1),requireClosingStrong:i.requireClosingStrong})}function pJ(e,t,n,o){for(let s=0;s<o;s++){const i=n[s],r=n[s+1]??t.length,l=e.groupBoundaries[s];if(!l||l.firstToken!==t[i]||l.lastToken!==t[r-1]||l.tokenCount!==r-i)return!1}return!0}function mJ(e,t,n,o,s){const i=e,r=dJ(n);if(!(C2(e,o)&&hJ(o)&&r!==null))return Nm.delete(i),Tp(n,o,s);const l=r.starts,a=Nm.get(i),c=wd.get(i),u=a&&r.mixed?Math.min(a.stableGroupCount,Math.max(0,a.groupBoundaries.length-1)):a?.stableGroupCount??0;if(a&&u>0&&a.requireClosingStrong===o.requireClosingStrong&&t.startsWith(a.source)&&l.length>=u&&(c==="append"||c==="tail")&&pJ(a,n,l,u)){const f=l[u]??n.length,h=Tp(n.slice(f),o,s),p=l.length-u;if(h.length===p){const m=a.nodes.slice(0,u).concat(h);return xf(s,"processTokensReusedTopLevelNodes",u),CC(e,t,n,r,m,o),m}}const d=Tp(n,o,s);return CC(e,t,n,r,d,o),d}function gJ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=tc(t);return n.length?new Set(n):null}function vJ(e,t){const n=e;let o=bC.get(n);o||(o=new Map,bC.set(n,o));const s=t.__markstreamFinal===!0?"final":"streaming";let i=o.get(s);i||(i={},o.set(s,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function yJ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yh(e,t,n){for(const o of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!("value"in s))continue;const i=Object.getOwnPropertyDescriptor(t,o);i&&(!("value"in i)||i.writable===!1)||(t[o]=_a(s.value,n))}}function _a(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,o=t.get(n);if(o)return o;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(_a(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(_a(l,t),_a(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(_a(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),Yh(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Yh(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),Yh(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!yJ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Yh(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=_a(i[r],t);return s}function y8(e,t=!0){if(!t)return Da(e);const n=Object.create(Object.getPrototypeOf(e)),o=new WeakMap;for(const s of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,s);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,s,i);continue}const r=i.value;let l=r;s==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):s==="map"&&Array.isArray(r)?l=[...r]:s==="children"&&Array.isArray(r)?l=r.map(a=>y8(a,t)):t&&r&&typeof r=="object"&&(l=_a(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function AC(e,t=!0){return e.map(n=>y8(n,t))}function C2(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function kJ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&e.__markstreamHasCustomParserExtensions!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function bJ(e){z1.delete(e)}function xJ(){return{fenceChar:"",fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function Wd(e){return{...e}}function wJ(e,t,n,o=U1(t).state){z1.set(e,{explicitBracketMath:o,source:t,key:n,pendingCandidate:n===null&&Z5(t)})}function _J(e){return e.endsWith("$")||e.endsWith("\\")}function SJ(e){const t=Math.max(e.lastIndexOf(`
227
+ `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return rJ.some(o=>n.endsWith(o))}function CJ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&t[0]==="["||SJ(e)&&/[\r\n]/.test(t)):!1}function ld(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function Fy(e){return e===" "||e===" "}function k8(e,t){return t===" "?e+1:e+4-e%4}function A2(e){let t=0,n=0;for(;t<e.length&&Fy(e[t]);)n=k8(n,e[t]),t++;return{index:t,column:n}}function Eu(e){const t=A2(e);return t.column>3?null:t}function Gg(e){const t=Eu(e);if(!t)return null;const n=t.index,o=e[n];if(o!=="`"&&o!=="~")return null;let s=n;for(;s<e.length&&e[s]===o;)s++;const i=s-n;if(i<3)return null;const r=e.slice(s);return o==="`"&&r.includes("`")?null:{markerChar:o,markerLen:i,rest:r}}function M2(e){const t=Eu(e);if(!t)return null;const n=e.slice(t.index),o=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!o)return null;let s=t.index+o.length,i=t.column+o.length;if(!Fy(e[s]))return null;for(;s<e.length&&Fy(e[s]);)i=k8(i,e[s]),s++;return{content:e.slice(s),contentIndent:i}}function E2(e){let t=e,n=!1;for(;;){const o=Eu(t);if(!o)return n?t:null;let s=o.index;if(t[s]!==">")return n?t:null;n=!0,s++,(t[s]===" "||t[s]===" ")&&s++,t=t.slice(s)}}function b8(e){const t=Gg(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};const n=E2(e),o=n==null?null:Gg(n);if(o)return{...o,inBlockquote:!0,inList:!1,listIndent:0};const s=M2(e);if(!s)return null;const i=Gg(s.content);return i==null?null:{...i,inBlockquote:!1,inList:!0,listIndent:s.contentIndent}}function AJ(e,t){let n=!1,o="",s=0,i=!1,r=!1,l=0,a=null,c=0;for(;c<t;){const u=e.indexOf(`
228
+ `,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=A2(h),m=M2(h);n&&i&&h.trim()&&E2(h)==null&&(n=!1,o="",s=0,i=!1,r=!1,l=0),n&&r&&h.trim()&&p.column<l&&!m&&(n=!1,o="",s=0,i=!1,r=!1,l=0),m?a=m.contentIndent:h.trim()&&a!=null&&p.column<a&&!n&&(a=null);const k=b8(h);if(k&&(n?k.markerChar===o&&k.markerLen>=s&&/^\s*$/.test(k.rest)&&(n=!1,o="",s=0,i=!1,r=!1,l=0):(n=!0,o=k.markerChar,s=k.markerLen,i=k.inBlockquote,r=k.inList||a!=null&&!k.inBlockquote&&p.column>=a,l=k.listIndent||a||0)),u===-1||u>=t)break;c=u+1}return n}function MJ(e,t){const n=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"||d===":"},s=d=>{if(d[0]!=="<")return null;let f=1;for(;f<d.length&&n(d[f]);)f++;const h=d[f]==="/";if(h)for(f++;f<d.length&&n(d[f]);)f++;const p=f;for(;f<d.length&&o(d[f]);)f++;if(f===p)return null;const m=d.slice(p,f).toLowerCase();if(!S5.has(m))return null;const k=d[f];if(k&&k!==" "&&k!==" "&&k!==">"&&k!=="/")return null;const y=po(d);if(y===-1)return null;let g=y-1;for(;g>=0&&n(d[g]);)g--;return{closing:h,tag:m,selfClosing:!h&&d[g]==="/",after:d.slice(y+1)}},i=(d,f)=>{const h=d.toLowerCase();let p=0;for(;p<h.length;){const m=h.indexOf("</",p);if(m===-1)return!1;for(p=m+2;p<h.length&&n(h[p]);)p++;if(h.startsWith(f,p)){const k=h[p+f.length];if(!k||k===" "||k===" "||k===">")return!0}}return!1},r=[];let l=!1,a=!1,c=!1,u=0;for(;u<t;){const d=e.indexOf(`
229
+ `,u),f=d===-1||d>=t?t:d,h=e.slice(u,f),p=h.endsWith("\r")?h.slice(0,-1):h,m=Eu(p);if(m){const k=p.slice(m.index);if(l)l=!k.includes("-->");else if(a)a=!k.includes(">");else if(c)c=!k.includes("?>");else if(k.startsWith("<!--"))l=!k.includes("-->");else if(k.startsWith("<?"))c=!k.includes("?>");else if(k.startsWith("<!"))a=!k.includes(">");else{const y=s(k);if(y)if(y.closing){for(let g=r.length-1;g>=0;g--)if(r[g]===y.tag){r.length=g;break}}else y.selfClosing||i(y.after,y.tag)||r.push(y.tag)}}if(d===-1||d>=t)break;u=d+1}return l||a||c||r.length>0}function EJ(e,t,n){if(!n?.length)return!1;const o=new Set(tc(n));if(!o.size)return!1;const s=u=>{const d=u.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||u==="_"||u==="-"||u===":"},i=u=>u===" "||u===" ",r=u=>{if(u[0]!=="<")return null;let d=1;for(;d<u.length&&i(u[d]);)d++;const f=u[d]==="/";if(f)for(d++;d<u.length&&i(u[d]);)d++;const h=d;for(;d<u.length&&s(u[d]);)d++;if(d===h)return null;const p=u.slice(h,d).toLowerCase();if(!o.has(p))return null;const m=u[d];if(m&&m!==" "&&m!==" "&&m!==">"&&m!=="/")return null;const k=u.indexOf(">",d);if(k===-1)return null;let y=k-1;for(;y>=0&&i(u[y]);)y--;return{closing:f,tag:p,selfClosing:!f&&u[y]==="/",after:u.slice(k+1)}},l=(u,d)=>{const f=u.toLowerCase();let h=0;for(;h<f.length;){const p=f.indexOf("</",h);if(p===-1)return!1;for(h=p+2;h<f.length&&i(f[h]);)h++;if(f.startsWith(d,h)){const m=f[h+d.length];if(!m||m===" "||m===" "||m===">")return!0}}return!1},a=[];let c=0;for(;c<t;){const u=e.indexOf(`
230
+ `,c),d=u===-1||u>=t?t:u,f=e.slice(c,d),h=f.endsWith("\r")?f.slice(0,-1):f,p=Eu(h);if(p){const m=r(h.slice(p.index));if(m)if(m.closing){for(let k=a.length-1;k>=0;k--)if(a[k]===m.tag){a.length=k;break}}else m.selfClosing||l(m.after,m.tag)||a.push(m.tag)}if(u===-1||u>=t)break;c=u+1}return a.length>0}function TJ(e,t){const n=lJ.exec(e);if(!n)return null;const o=n[1]??"",s=n.index+o.length,i=e.indexOf(`
231
+ `,s),r=e.slice(s,i===-1?e.length:i);return!Eu(r.endsWith("\r")?r.slice(0,-1):r)||AJ(e,s)||MJ(e,s)||EJ(e,s,t)?null:`${e.slice(0,n.index)}${o}`}function x8(e,t,n){let o=t;for(;o<e.length&&e[o]===n;)o++;return o-t}function NJ(e,t,n){let o=t;for(;o<e.length;){const s=e.indexOf("`",o);if(s===-1)return-1;const i=x8(e,s,"`");if(i===n)return s;o=s+i}return-1}function Yg(e){e.inFence=!1,e.fenceChar="",e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function MC(e,t,n,o,s){let i=0,r=!1;for(;i<e.length;){const l=i;if(t.inMath){if(e.startsWith("\\]",i)&&!ld(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,i+=2;continue}i++;continue}if(t.inDollarMath){if(e.startsWith("$$",i)&&!ld(e,l)){o!=null&&s&&n+i+2>o&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,i+=2;continue}i++;continue}if(e[i]==="`"&&!ld(e,l)){const a=x8(e,i,"`"),c=NJ(e,i+a,a);if(c===-1)break;i=c+a;continue}if(e.startsWith("\\[",i)&&!ld(e,l)){t.inMath=!0,t.mathOpenOffset=n+i,i+=2;continue}if(e.startsWith("$$",i)&&!ld(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+i,i+=2;continue}i++}return r}function IJ(e,t){if(!y2(t))return e;const n=t,o=_C.get(n),s=o?.source===e?o.state:o&&e.startsWith(o.source)?w8(o.state,e.slice(o.source.length),o.source.length-o.state.lineBuffer.length).state:U1(e).state;_C.set(n,{source:e,state:s});const{context:i}=s,r=i.inMath?i.mathOpenOffset:i.inDollarMath?i.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(`
232
+ `,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const c=l.trim(),u=/^(?:[a-z]|pi)$/i.test(c);return Cl(l)&&!u?e:e.slice(0,r)}function LJ(e,t,n,o,s){const i=A2(e),r=M2(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&E2(e)==null&&Yg(t),t.inFence&&t.fenceInList&&e.trim()&&i.column<t.fenceListIndent&&!r&&Yg(t),r?t.listContentIndent=r.contentIndent:e.trim()&&t.listContentIndent!=null&&i.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){const l=b8(e);if(l)t.inFence?l.markerChar===t.fenceChar&&l.markerLen>=t.fenceLen&&/^\s*$/.test(l.rest)&&Yg(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&i.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return MC(e,t,n,o,s)}else return MC(e,t,n,o,s);return!1}function U1(e,t=xJ(),n=null,o=!1,s=0){const i=Wd(t);let r=Wd(t),l="",a=!1,c=0;for(;c<e.length;){const u=e.indexOf(`
233
+ `,c),d=u!==-1,f=d&&u>c&&e[u-1]==="\r"?u-1:d?u:e.length,h=e.slice(c,f);LJ(h,i,s+c,n,o)&&(a=!0),d?(r=Wd(i),l=""):l=h,c=d?u+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:i,lineBuffer:l}}}function w8(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:Wd(e.committedContext),context:Wd(e.context),lineBuffer:e.lineBuffer+t}}:U1(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function $J(e,t){if(!y2(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=z1.get(o);if(s?.source===t)return;const i=s?t.startsWith(s.source):!1,r=i&&s?t.slice(s.source.length):"",l=i&&s?w8(s.explicitBracketMath,r,s.source.length-s.explicitBracketMath.lineBuffer.length):U1(t),a=l.state,c=i&&s?l.closedOpenMath:!1;if(s&&i&&s.key===null&&s.pendingCandidate===!1&&!c&&!CJ(s.source,r)&&!_J(t)){s.source=t,s.explicitBracketMath=a;return}const u=gX(t);(s&&(s&&!i||s.key!==u||c)||!s&&u)&&n.reset(),wJ(e,t,u,a)}function FJ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function OJ(e,t){const n=e?.map,o=t?.map;return n===o?!0:!Array.isArray(n)||!Array.isArray(o)?!1:n.length===o.length&&n.every((s,i)=>s===o[i])}function Zg(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&OJ(e,t)}function EC(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function BJ(e){for(let t=0;t+5<e.length;t++)if(EC(e,t)&&EC(e,t+3)&&Zg(e[t],e[t+3])&&Zg(e[t+1],e[t+4])&&Zg(e[t+2],e[t+5]))return!0;return!1}function RJ(e,t,n){return y2(e)&&Z5(t)&&BJ(n)}function DJ(e){const t=z1.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function TC(e,t,n,o){const s=e;if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!C2(e,o)||($J(e,t),DJ(e)))return wd.set(s,"sync"),e.parse(t,n);const i=e.stream.parse(t,vJ(e,n));if(RJ(e,t,i))return e.stream?.reset?.(),wd.set(s,"sync"),e.parse(t,n);const r=e.stream?.stats?.();if(wd.set(s,r?.lastMode??"stream"),!FJ(o))return i;const l=p8(o);if(!l)return AC(i,!0);const a=bu(),c=AC(i,!0);return xf(l,"tokenCloneMs",bu()-a),c}function q1(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return vf;const n=new Set(vf);for(const o of tc(t))o&&n.add(o);return n}function PJ(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function NC(e){return{type:"paragraph",children:e,raw:e.map(PJ).join("")}}function IC(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function LC(e,t){if(e.type!=="paragraph")return null;const n=e.children,o=Array.isArray(n)?n:[];if(o.length===0)return null;const s=gJ(t);if(!s?.size)return null;let i=-1;for(let u=0;u<o.length;u++){const d=o[u];if(!s.has(String(d?.type??"").toLowerCase()))continue;const f=o.slice(0,u);if(String(d.content??"").trim()&&f.some(h=>h?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=o.slice(0,i),l=o[i];if(!l)return null;const a=[];r.length&&a.push(NC(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(NC(c)),a}function HJ(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),o=/<\/html>\s*$/i.test(t);return!n||!o?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function zd(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function WJ(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ki(t)}\s*>\s*$`,"i").test(n)}const Xg=new Set(["iframe","script","style","textarea","title"]);function Hf(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=f=>{if(e.startsWith("<!--",f)){const v=e.indexOf("-->",f+4);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}if(e.startsWith("<![CDATA[",f)){const v=e.indexOf("]]>",f+9);return{closing:!1,end:v===-1?e.length:v+3,selfClosing:!1,tag:""}}const h=po(e.slice(f));if(h===-1)return null;const p=f+h+1,m=e.slice(f,p);if(/^<\s*[!?]/.test(m))return{closing:!1,end:p,selfClosing:!1,tag:""};let k=m.slice(1).trimStart();const y=k.startsWith("/");y&&(k=k.slice(1).trimStart());const g=k.match(/^([A-Z][\w:-]*)/i);return g?.[1]?{closing:y,end:p,selfClosing:/\/\s*>$/.test(m),tag:g[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},i=(f,h)=>{const p=new RegExp(String.raw`<\s*\/\s*${Ki(f)}(?=\s|>)`,"gi");p.lastIndex=h;const m=p.exec(e);if(!m||m.index==null)return null;const k=s(m.index);return k?{start:m.index,end:k.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a<e.length;){const f=e.indexOf("<",a);if(f===-1)return null;const h=s(f);if(!h)return null;if(!h.closing&&h.tag===o){r=f,l=h.end-1;break}if(!h.closing&&Xg.has(h.tag)){a=i(h.tag,h.end)?.end??e.length;continue}a=h.end}if(r===-1||l===-1)return null;const c=e.slice(r,l+1);if(Wl.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:l+1,closed:!0};if(Xg.has(o)){const f=i(o,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let u=1,d=l+1;for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};const h=s(f);if(!h)return null;if(h.closing&&h.tag===o){u--;const p=h.end;if(u===0)return{raw:e.slice(r,p),start:r,end:p,closeStart:f,closed:!0};d=p;continue}if(!h.closing&&h.tag===o){!h.selfClosing&&!Wl.has(h.tag)&&u++,d=h.end;continue}if(!h.closing&&Xg.has(h.tag)){d=i(h.tag,h.end)?.end??e.length;continue}d=h.end}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function zJ(e,t){if(!t)return 0;let n=0,o=0;for(;n<e.length&&o<t.length;){if(e[n]===t[o]){n++,o++;continue}if(e[n]==="\r"||e[n]===`
234
+ `){n++;continue}return-1}return o===t.length?n:-1}function UJ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
235
+ </${t}>`}function $C(e){return e.replace(/\r\n/g,`
236
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function qJ(e,t,n){return n?e.includes(n,t)?!0:$C(e.slice(Math.max(0,t))).includes($C(n)):!1}function jJ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
237
+ `&&n++,n):e[n]===`
238
+ `?n+1:t}function FC(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function VJ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function _8(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ki(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function S8(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const KJ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),GJ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function YJ(e){return/\n\s*\n/.test(e)||GJ.test(e)}function ZJ(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>KJ.has(String(o?.type??"").toLowerCase()))||t.some(o=>{if(o?.type!=="html_block")return!1;const s=o;return Array.isArray(s.children)&&s.children.length>0}))return!0;if(!YJ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function XJ(e){const t=[];let n=0;for(;n<e.length;){for(;/\s/.test(e[n]??"");)n++;if(n>=e.length)break;const o=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!o?.[1])return null;const s=Hf(e,o[1],n);if(!s||s.start!==n)return null;t.push(s.raw),n=s.end}return t.length>1?t:null}function QJ(e,t,n,o){const s=n.customHtmlTags?.join("\0")??"",i=t,r=wC.get(i),l=r&&r.final===o&&r.customHtmlTags===s&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((c,u)=>l&&r.blocks[u]===c?r.children[u]:au(c,t,n));return wC.set(i,{blocks:e,children:a,customHtmlTags:s,final:o,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function JJ(e,t,n,o){return e.map(s=>{if(s?.type!=="html_block")return s;const i=s,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||A5.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=po(l);if(a===-1)return s;const c=Hf(l,r,0),u=c?.closeStart??-1,d=c?.closed===!0&&u>=a+1,f=d?l.slice(a+1,u):l.slice(a+1);if(!f.trim())return s;const h=S8(n,o),p=d?null:XJ(f),m=p?QJ(p,t,h,o):au(f,t,h);return ZJ(f,m)?{...s,children:m}:s})}function eee(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function au(e,t,n){return e.trim()?A8(e,t,{...n,__disableStreamParse:!0}):[]}function tee(e,t,n){const o=au(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function nee(e,t,n){const o=u8({content:e}),s=po(e),i=_8(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=tee(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function oee(e,t,n){const o=po(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=Hf(s,"summary",0);if(!i)return au(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...au(r,t,n),nee(i.raw,t,n),...au(l,t,n)]}function C8(e,t,n,o,s,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=zd(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!FC(c)){r.push(c);continue}const f=String(c.raw??zd(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,m=-1;for(let ie=a+1;ie<e.length;ie++){const q=e[ie];if(FC(q)){p++;continue}if(VJ(q)&&(p--,p===0)){m=ie;break}}const k=Hf(t,"details",h),y=m===-1&&k?.closed===!0,g=y?(()=>{const ie=_8(f,"details");return ie!==-1?f.slice(0,ie):f})():f,[v]=C8(y?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,o,s,h+f.length),b=oee(g,n,S8(o,s)),A=m===-1?"</details>":String(e[m].raw??zd(e[m])??"</details>"),I=y||m!==-1&&k?.closed===!0,T=A.replace(/[\t\r\n ]+$/,""),M=I?(()=>{const ie=(k?.raw??"").lastIndexOf(T);return ie===-1?t.length:h+ie})():t.length,$=po(f),N=y&&$!==-1?h+$+1:h+f.length,F=t.slice(N,M===-1?t.length:M),S=n.parse(F,{__markstreamFinal:s}),R=n.renderer.render(S,n.options,{__markstreamFinal:s}),z=M+T.length,W=I?Math.max(M+A.length,jJ(t,z)):t.length,L=I?t.slice(M,W):A,O=I?t.slice(h,W):t.slice(h),U=y&&$!==-1?f.slice(0,$+1):f,Z={...c,tag:"details",attrs:P1(f.slice(0,$+1)),raw:O,content:`${U}${R}${L}`,children:[...b,...v],loading:!s&&!I};if(o.includeSourceMap&&(Z.sourceMap=H1(t,h,I?W:t.length,o)),r.push(Z),l=I?W:t.length,m===-1&&!y)break;m!==-1&&(a=m)}return[r,l]}function see(e,t,n,o){if(!n)return e;const s=e.slice();let i=0;for(let r=0;r<s.length;r++){const l=s[r],a=zd(l),c=a?n.indexOf(a,i):-1;if(l?.type!=="html_block"){c!==-1&&(i=c+a.length);continue}const u=String(l.tag??"").toLowerCase();if(!u)continue;if(u==="details"){c!==-1&&(i=c+a.length);continue}const d=Hf(n,u,c!==-1?c:i);if(!d)continue;i=d.end;const f=String(l.content??a),h=String(l.raw??f),p=UJ(d.raw,u,d.closed),m=!t&&!d.closed,k=f!==p||h!==d.raw||!!l.loading!==m,y=po(d.raw),g=y===-1?"":d.raw.slice(0,y+1),v=g?P1(g):[];if(l.content=p,l.raw=d.raw,l.loading=m,l.attrs=v.length?v:void 0,o?.includeSourceMap&&(l.sourceMap=H1(n,d.start,d.end,o)),!k)continue;let b=zJ(d.raw,h);b===-1&&(b=0);const A=r+1;for(;A<s.length;){if(d.closed&&WJ(s[A],u)){s.splice(A,1);continue}const I=zd(s[A]);if(!I)break;const T=d.raw.indexOf(I,b);if(T===-1){if(qJ(n,d.end,I))break;const M=h8.get(s[A]);if(!M)break;if(M.start>=d.start&&M.end<=d.end){s.splice(A,1);continue}break}b=T+I.length,s.splice(A,1)}}return s}function iee(e){const t=l=>l===" "||l===" "||l===`
239
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l.startsWith("<!--")||l.startsWith("<?")||l.startsWith("<!")||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=m=>{const k=m.charCodeAt(0);return k>=65&&k<=90||k>=97&&k<=122},u=m=>{const k=m.charCodeAt(0);return k>=48&&k<=57},d=m=>m==="!"||c(m),f=m=>c(m)||u(m)||m===":"||m==="-",h=m=>c(m)||u(m)||m==="_"||m==="."||m===":"||m==="-",p=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!h(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const m=l[a];if(m==='"'||m==="'"){for(a++;a<l.length&&l[a]!==m;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const k=l[a];if(t(k)||k==="<"||k===">"||k==='"'||k==="'"||k==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=g=>g===" "||g===" ",h=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;const b=g[v];if(b!=="`"&&b!=="~")return null;let A=v;for(;A<g.length&&g[A]===b;)A++;const I=A-v;return I<3?null:{markerChar:b,markerLen:I,rest:g.slice(A)}},p=g=>{let v=0;for(;v<g.length&&f(g[v]);)v++;let b=!1;for(;v<g.length&&g[v]===">";)for(b=!0,v++;v<g.length&&f(g[v]);)v++;return b?g.slice(v):null},m=g=>{const v=h(g);if(v)return v;const b=p(g);return b==null?null:h(b)};let k=0;const y=l.split(/\r?\n/);for(const g of y){const v=k,b=k+g.length;if(a<v)break;const A=m(g);if(A){const I=A.markerChar,T=A.markerLen;c?I===u&&T>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=I,d=T)}if(a<=b)break;k=b+1}return c},s=String(e??""),i=s.lastIndexOf("<");if(i===-1||o(s,i))return s;if(i>0){const l=s[i-1],a=l===" "||l===" "||l===`
240
+ `||l==="\r",c=s[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return s}const r=s.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
241
+ `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function OC(e,t){if(e===t)return;const n=e.split(/\r?\n/),o=t.split(/\r?\n/),s=[];let i=0;for(let r=0;r<o.length;r++){const l=o[r]??"";if(n[i]===l){s[r]={startLine:i,endLine:i+1},i++;continue}const a=n[i]??"";if(l!==""&&a!==l&&a.startsWith(l)){let h=l,p=-1;for(let m=r+1;m<o.length;m++){if(h+=o[m]??"",h===a){p=m;break}if(!a.startsWith(h))break}if(p!==-1){for(let m=r;m<=p;m++)s[m]={startLine:i,endLine:i+1};i++,r=p;continue}s[r]={startLine:i,endLine:i+1};continue}let c=n[i]??"",u=-1;for(let h=i+1;h<n.length;h++){if(c+=`\\n${n[h]??""}`,c===l){u=h+1;break}if(!l.startsWith(c))break}if(u!==-1){s[r]={startLine:i,endLine:u},i=u;continue}let d=-1;if(l!==""){const h=Math.min(n.length,i+80);for(let p=i;p<h;p++)if(n[p]===l){d=p;break}}if(d!==-1){s[r]={startLine:d,endLine:d+1},i=d+1;continue}const f=Math.min(Math.max(0,n.length-1),Math.max(0,i-1));s[r]={startLine:f,endLine:f+1}}return r=>{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(l<s.length)return s[l]??{startLine:0,endLine:0};const a=s[s.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},c=Math.min(n.length,a.endLine+l-s.length);return{startLine:c,endLine:Math.min(n.length,c+1)}}}function ree(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const o=p=>p===" "||p===" ",s=p=>{const m=p.charCodeAt(0);return m>=65&&m<=90||m>=97&&m<=122||m>=48&&m<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let m=0;for(let k=0;k<p.length;k++){const y=p[k];if(y===" "){if(m++,m>=4)return!0;continue}if(y===" ")return!0;break}return!1},r=p=>{let m=!1,k=!1;for(let y=0;y<p.length;y++){const g=p[y];if(g==="\\"){y++;continue}if(!k&&g==="'"){m=!m;continue}if(!m&&g==='"'){k=!k;continue}if(!m&&!k&&g===">")return y}return-1},l=p=>{let m=0;for(;m<p.length&&o(p[m]);)m++;const k=p[m];if(k!=="`"&&k!=="~")return null;let y=m;for(;y<p.length&&p[y]===k;)y++;const g=y-m;return g<3?null:{markerChar:k,markerLen:g,rest:p.slice(y)}},a=(p,m)=>{if(i(p))return-1;const k=p.replace(/^[ \t]+/,"");if(!k||k.startsWith(">")||k.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(k))return-1;let y=!1,g=0;for(;g<p.length;){const v=p[g];if(v!=="<"){o(v)||(y=!0),g++;continue}const b=r(p.slice(g));if(b===-1){y=!0,g++;continue}const A=p.slice(g,g+b+1);let I=1;for(;I<A.length&&o(A[I]);)I++;if(I>=A.length){y=!0,g++;continue}const T=A[I];if(T==="!"||T==="?"){y=!0,g+=b+1;continue}if(T==="/"){y=!0,g+=b+1;continue}const M=I;for(;I<A.length&&s(A[I]);)I++;if(I===M){y=!0,g++;continue}const $=A.slice(M,I).toLowerCase(),N=A[I];if(N&&N!==" "&&N!==" "&&N!==">"&&N!=="/"){y=!0,g++;continue}const F=new RegExp(String.raw`<\s*\/\s*${$}\s*>`,"i"),S=/\/\s*>$/.test(A),R=F.test(p.slice(g+b+1)),z=F.test(e.slice(m+g+b+1)),W=/[\r\n]/.test(e.slice(m+g+b+1));if(y&&n.has($)&&!S&&!R&&(z||W))return g;y=!0,g+=b+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
242
+ `,h),m=p!==-1,k=m&&p>h&&e[p-1]==="\r",y=m?k?p-1:p:e.length,g=e.slice(h,y),v=m?k?`\r
243
+ `:`
244
+ `:"",b=l(g);let A=g;if(!c&&!b){const I=a(g,h);if(I!==-1){const T=v||`
245
+ `;A=`${g.slice(0,I).replace(/[ \t]+$/,"")}${T}${T}${g.slice(I).replace(/^[ \t]+/,"")}`}}f+=A,f+=v,b&&(c?b.markerChar===u&&b.markerLen>=d&&/^\s*$/.test(b.rest)&&(c=!1,u="",d=0):(c=!0,u=b.markerChar,d=b.markerLen)),h=m?p+1:e.length}return f}function lee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const o=d=>d===" "||d===" ",s=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},i=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;return d.slice(f)},r=d=>{let f=!1,h=!1;for(let p=0;p<d.length;p++){const m=d[p];if(m==="\\"){p++;continue}if(!h&&m==="'"){f=!f;continue}if(!f&&m==='"'){h=!h;continue}if(!f&&!h&&m===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let m=d.indexOf("<",f);for(;m!==-1;){let k=m+1;for(;k<d.length&&o(d[k]);)k++;if(k>=d.length||d[k]!=="/"){m=d.indexOf("<",m+1);continue}for(k++;k<d.length&&o(d[k]);)k++;if(k+p.length>d.length){m=d.indexOf("<",m+1);continue}let y=!0;for(let v=0;v<p.length;v++){const b=d[k+v];if((b>="A"&&b<="Z"?String.fromCharCode(b.charCodeAt(0)+32):b)!==p[v]){y=!1;break}}if(!y){m=d.indexOf("<",m+1);continue}let g=k+p.length;if(g<d.length&&s(d[g])){m=d.indexOf("<",m+1);continue}for(;g<d.length&&o(d[g]);)g++;if(g<d.length&&d[g]===">")return!0;m=d.indexOf("<",m+1)}return!1},a=d=>{let f=0;for(;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]!=="<")return d;for(f++;f<d.length&&o(d[f]);)f++;if(f>=d.length||d[f]==="/")return d;const h=f;for(;f<d.length&&s(d[f]);)f++;if(f===h)return d;const p=d.slice(h,f).toLowerCase();if(!n.has(p))return d;const m=r(d.slice(f));if(m===-1)return d;const k=f+m;if(l(d,k+1,p))return d;const y=i(d.slice(k+1));return y?`${d.slice(0,k+1)}
246
+ ${y}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
247
+ `,u);if(d===-1){c+=a(e.slice(u));break}const f=d>u&&e[d-1]==="\r",h=f?d-1:d,p=e.slice(u,h);c+=a(p),c+=f?`\r
248
+ `:`
249
+ `,u=d+1}return c}function aee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const o=f=>f===" "||f===" ",s=f=>{let h=0,p=!1,m=0;for(;h<f.length;){for(;h<f.length&&o(f[h]);)h++;if(h>=f.length||f[h]!==">")break;for(p=!0,h++;h<f.length&&o(f[h]);)h++;m=h}return p?{prefix:f.slice(0,m),content:f.slice(m)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let m=h;for(;m<f.length&&f[m]===p;)m++;const k=m-h;return k<3?null:{markerChar:p,markerLen:k,rest:f.slice(m)}},r=Array.from(n).map(f=>new RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const f=e.indexOf(`
250
+ `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",m=h?p?f-1:f:e.length,k=e.slice(d,m),y=h?p?`\r
251
+ `:`
252
+ `:"",g=s(k),v=g?.prefix??"",b=g?.content??k,A=i(b);A&&(l?A.markerChar===a&&A.markerLen>=c&&/^\s*$/.test(A.rest)&&(l=!1,a="",c=0):(l=!0,a=A.markerChar,c=A.markerLen));let I=b;if(!l&&I.includes("</"))for(const T of r)I=I.replace(T,(M,$,N,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return M;const S=F.slice(0,N).replace(/^[\t ]+/,"");if(S.length>0){const R=$.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",z=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!R||!z||R!==z)return M}return`${$}
253
+
254
+ `});if(v){const T=v+I.split(`
255
+ `).join(`
256
+ ${v}`);u+=T}else u+=I;u+=y,d=h?f+1:e.length}return u}function cee(e,t){if(!e||!t.length)return e;const n=new Set(t.map(S=>String(S??"").toLowerCase()));if(!n.size)return e;const o=S=>S===" "||S===" ",s=S=>{if(!S)return!1;if(S[0]===" ")return!0;let R=0;for(let z=0;z<S.length;z++){const W=S[z];if(W===" "){if(R++,R>=4)return!0;continue}if(W===" ")return!0;break}return!1},i=S=>{const R=S.charCodeAt(0);return R>=65&&R<=90||R>=97&&R<=122||R>=48&&R<=57||S==="_"||S==="-"||S===":"},r=S=>{let R=0;for(;R<S.length&&o(S[R]);)R++;return S.slice(R)},l=S=>{let R=0,z=!1,W=0;for(;R<S.length;){for(;R<S.length&&o(S[R]);)R++;if(R>=S.length||S[R]!==">")break;for(z=!0,R++;R<S.length&&o(S[R]);)R++;W=R}if(!z)return null;const L=S.slice(0,W);return{prefix:L,key:L.replace(/[ \t]+$/,""),content:S.slice(W)}},a=S=>r(S).startsWith("<"),c=S=>{for(let R=0;R<S.length;R++){const z=S[R];if(z!==" "&&z!==" ")return!1}return!0},u=S=>{if(s(S))return"";const R=r(S);if(!R.startsWith("<"))return"";let z=1;for(;z<R.length&&o(R[z]);)z++;if(z>=R.length||R[z]==="/"||R[z]==="!"||R[z]==="?")return"";const W=z;for(;z<R.length&&i(R[z]);)z++;if(z===W)return"";const L=R.slice(W,z).toLowerCase();if(!n.has(L))return"";const O=R[z];return O&&O!==" "&&O!==" "&&O!==">"&&O!=="/"?"":L},d=S=>{if(s(S))return null;const R=r(S);if(!R.startsWith("<"))return null;let z=1;for(;z<R.length&&o(R[z]);)z++;if(z>=R.length)return null;const W=R[z]==="/";if(W)for(z++;z<R.length&&o(R[z]);)z++;const L=R[z];if(!L||L==="!"||L==="?")return null;const O=z;for(;z<R.length&&i(R[z]);)z++;if(z===O)return null;const U=R.slice(O,z).toLowerCase();if(!n.has(U))return null;const Z=R[z];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(W)return{type:"close",name:U};if(/\/\s*>\s*$/.test(R))return{type:"open",name:U,complete:!0};const ie=R.indexOf(">",z);if(ie!==-1){const q=R.slice(ie+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(q))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},f=S=>{if(s(S))return null;const R=r(S).replace(/[ \t]+$/,"");if(!R.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(R))return null;const z=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(z?.[1])return z[1].toLowerCase();const W=R.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!W?.[1]||!W[2])return null;const L=W[1].toLowerCase();return L===W[2].toLowerCase()?L:null};let h=!1,p="",m=0;const k=S=>{let R=0;for(;R<S.length&&o(S[R]);)R++;const z=S[R];if(z!=="`"&&z!=="~")return null;let W=R;for(;W<S.length&&S[W]===z;)W++;const L=W-R;return L<3?null:{markerChar:z,markerLen:L,rest:S.slice(W)}},y=S=>k(S),g=S=>{const R=r(S);return R?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(R):!1},v=(S,R,z)=>{let W=S,L=0;for(;W<e.length;){const O=e.indexOf(`
257
+ `,W),U=O!==-1,Z=U&&O>W&&e[O-1]==="\r",ie=U?Z?O-1:O:e.length,q=e.slice(W,ie),ee=l(q),fe=ee?.key??"";if(L>0&&R&&fe!==R)break;const ne=ee?.content??q,j=d(ne);if(j?.name===z){if(j.type==="open")j.complete||L++;else if(L>0&&(L--,L===0))return!1}else if(L>0&&(c(ne)||g(ne)))return!0;if(U)W=O+1;else break}return!1};let b="",A=0,I=!0,T=!1,M=!1,$=`
258
+ `;const N=[];let F="";for(;A<e.length;){const S=e.indexOf(`
259
+ `,A),R=S!==-1,z=R&&S>A&&e[S-1]==="\r",W=R?z?S-1:S:e.length,L=e.slice(A,W),O=R?z?`\r
260
+ `:`
261
+ `:"",U=l(L),Z=U?.key??"",ie=U?.content??L,q=y(ie);q&&(h?q.markerChar===p&&q.markerLen>=m&&/^\s*$/.test(q.rest)&&(h=!1,p="",m=0):(h=!0,p=q.markerChar,m=q.markerLen));const ee=N.length>0;if(!h&&!ee){const ne=u(ie),j=!!ne&&!I&&T&&M&&v(A,Z,ne);ne&&!I&&(!T||j)&&(Z&&F&&Z===F?b+=`${Z}${$}`:Z||(b+=$))}if(b+=L,b+=O,O&&($=O),!h){const ne=d(ie);if(ne){if(ne.type==="open")ne.complete||N.push(ne.name);else for(let j=N.length-1;j>=0;j--)if(N[j]===ne.name){N.length=j;break}}}const fe=c(ie);I=fe,T=!fe&&a(ie),M=!fe&&!!f(ie),F=Z,A=R?S+1:e.length}return b}function A8(e,t,n={}){const o=p8(n),s=o?bu():0,i=!!n.final,r=(e??"").toString();let l=r.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,"$1\\n$2");if(kJ(t,n)&&(t.stream.reset(),bJ(t)),i||(l.endsWith("- *")&&(l=l.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*-\s*$/,g=>g.startsWith(`
262
+ `)?`
263
+ `:""):/(?:^|\n)\s*--\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*--\s*$/,g=>g.startsWith(`
264
+ `)?`
265
+ `:""):/(?:^|\n)\s*>\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*>\s*$/,g=>g.startsWith(`
266
+ `)?`
267
+ `:""):/\n\s*[*+]\s*$/.test(l)?l=l.replace(/\n\s*[*+]\s*$/,`
268
+ `):/(?:^|\n)\s*\d+\s*$/.test(l)?/^\d+$/.test(l.trim())||(l=l.replace(/(?:^|\n)\s*\d+\s*$/,g=>g.startsWith(`
269
+ `)?`
270
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(l)?l=l.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(g,v,b)=>`${v}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(l)?l=l.replace(/(?:^|\n)\s*\d+[.)]\s*$/,g=>g.startsWith(`
271
+ `)?`
272
+ `:""):/\n[[(]\n*$/.test(l)&&(l=l.replace(/(\n\[|\n\()+\n*$/g,`
273
+ `)),l=IJ(l,t),l=TJ(l,n.customHtmlTags)??l),n.customHtmlTags?.length&&l.includes("<")){const g=tc(n.customHtmlTags);if(g.length&&(l=ree(l,g),l=lee(l,g),l=cee(l,g),l=aee(l,g),l.includes("</")))for(const v of g){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");l=l.replace(b,"$1$2$2")}}i||(l=iee(l));const a=HJ(l);if(a){if(n.includeSourceMap){const b={...n,__sourceLineMapper:OC(r,l)};a[0].sourceMap=H1(l,0,l.length,b)}const g=n.preTransformTokens,v=n.postTransformTokens;if(C2(t,n)||typeof g=="function"||typeof v=="function"){const b=TC(t,l,{__markstreamFinal:i},n),A=typeof g=="function"&&g(b)||b;typeof v=="function"&&v(A)}return SC(a,n,o,s)}const c=TC(t,l,{__markstreamFinal:i},n);if(!c||!Array.isArray(c))return SC([],n,o,s);const u=n.preTransformTokens,d=n.postTransformTokens;let f=c;u&&typeof u=="function"&&(f=u(f)||f);const h=t,p=typeof h.validateLink=="function"&&h.__markstreamOriginalValidateLink&&h.validateLink!==h.__markstreamOriginalValidateLink?h.validateLink:void 0,m=n.validateLink??p??h.options?.validateLink??(typeof h.validateLink=="function"?h.validateLink:void 0),k={...n,validateLink:m,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?OC(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let y=mJ(t,l,f,k,o);if(d&&typeof d=="function"){const g=d(f);if(Array.isArray(g)){const v=g[0],b=v?.type;v&&typeof b=="string"?y=Tp(g,{...k,__customHtmlBlockCursor:0},o):y=g}}if(eee(y)&&(y=see(y,i,l,k),y=C8(y,l,t,k,i)[0],y=JJ(y,t,k,i)),i){const g=new WeakSet,v=b=>{if(!b||typeof b!="object"||g.has(b))return;if(g.add(b),Array.isArray(b)){for(const I of b)v(I);return}const A=b;A.type==="html_block"&&A.loading===!0&&(A.loading=!1);for(const I of Object.values(A))v(I)};v(y)}return y=g8(y,n),n.debug&&console.log("Parsed Markdown Tree Structure:",y),m8(y,o,s)}function BC(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Yl(t),s=t?.includeSourceMap===!0;let i=0;for(;i<e.length;){const r=S2(e,i,o.options(),_2);if(r){nr(r[0],e[i],t),n.push(r[0]),o.remember(r[0].raw),i=r[1];continue}const l=e[i];switch(l.type){case"paragraph_open":{const a=String(e[i+1]?.content??""),c=iJ(e,i,o.options(a));s&&fn(c,l,t);const u=LC(c,t);if(u){s&&IC(u,c);for(const d of u)nr(d,l,t);n.push(...u)}else nr(c,l,t),n.push(c);o.remember(c.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[a,c]=Au(e,i,o.options());s&&fn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"blockquote_open":{const[a,c]=Mu(e,i,o.options());s&&fn(a,l,t),nr(a,l,t),n.push(a),o.remember(a.raw),i=c;break}case"footnote_anchor":{const a=l.meta??{},c={type:"footnote_anchor",id:String(a.label??l.content??""),raw:String(l.content??"")};s&&fn(c,l,t),nr(c,l,t),n.push(c),o.remember(String(l.content??"")),i++;break}case"hardbreak":n.push(sJ()),o.reset(),i++;break;case"text":{const a=String(l.content??""),c={type:"paragraph",raw:a,children:a?[{type:"text",content:a,raw:a}]:[]};s&&fn(c,l,t),nr(c,l,t),n.push(c),o.remember(a),i++;break}case"inline":{const a=String(l.content??""),c=ao(l.children||[],a,void 0,o.options(a));if(c.length!==0)if(c.every(u=>u.type==="html_block")){if(s)for(const u of c)fn(u,l,t);for(const u of c)nr(u,l,t);n.push(...c)}else{const u={type:"paragraph",raw:a,children:c};s&&fn(u,l,t);const d=LC(u,t);if(d){s&&IC(d,u);for(const f of d)nr(f,l,t);n.push(...d)}else nr(u,l,t),n.push(u)}o.remember(a)}i+=1;break;default:i+=1;break}}return n}const uee=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,dee=new Set([...Rf,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),fee=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function RC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hee(e){return typeof e=="string"?e:e==null?"":String(e)}function M8(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Al(e){return hee(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function E8(e){return Al(e).replace(/`/g,"&#96;")}function j1(e){return String(e??"").trim().toLowerCase()}function T2(e,t="safe"){const n=j1(e);return n?t==="escape"?!0:t==="trusted"?Rf.has(n):!fee.has(n):!1}function T8(e,t="safe"){const n=j1(e);return n?t==="escape"?!0:t==="trusted"?Rf.has(n):dee.has(n):!1}function DC(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${E8(o)}"`).join("")}function N8(e){const t=e.startsWith("/"),n=t?e.slice(1):e,o=n.match(uee);return o?{attrsStr:t?"":n.slice(o[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:o[1]}:null}function pee(e,t){const n=e.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.some(o=>{const s=o.split(/\s+/,1)[0]??"";return!s||Ra(s,{tagName:t,attrName:"srcset"})})}function I8(e,t,n,o){return aY.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?pee(t,o):!!(cY.has(e)&&t&&Ra(t,{tagName:o,attrName:e}))}function Sa(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function L8(e,t,n,o=!1){if(t!=="safe"||j1(n)!=="a")return e;const s=Sa(e,"href");if(o&&(!s||!e[s])){const a=Sa(e,"target"),c=Sa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Sa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Sa(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function PC(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!M8(r)||I8(l,i,t,n)||(o[r]=i)}return L8(o,t,n,!!Sa(e,"href"))}function $8(e,t){const n=e.toLowerCase();return C5.has(n)?!1:RC(t,n)||RC(t,e)}function N2(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!M8(r)||I8(l,i,t,n)||(o[r]=i)}return L8(o,t,n,!!Sa(e,"href"))}function Ud(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,o]of e)n&&(t[String(n)]=o==null?"":String(o));return t}function Np(e,t="safe",n){const o=N2(Ud(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function mee(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const o=Number(e);if(e!==""&&!Number.isNaN(o))return o}return e}function gee(e){const t={};for(const[n,o]of Object.entries(e))t[n]=mee(o,n);return t}function Qg(e){return e.trim().length>0}function F8(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const r=e.indexOf("-->",n);if(r!==-1){n=r+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const r=e.slice(n);Qg(r)&&t.push({type:"text",content:r})}break}if(o>n){const r=e.slice(n,o);Qg(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",o+1)){const r=e.indexOf("]]>",o);if(r!==-1){t.push({type:"text",content:e.slice(o,r+3)}),n=r+3;continue}break}if(e.startsWith("!",o+1)){const r=e.indexOf(">",o);if(r!==-1){n=r+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=N8(e.slice(o+1,s));if(!i){const r=e.slice(o,s+1);Qg(r)&&t.push({type:"text",content:r}),n=s+1;continue}if(i.isClosing)t.push({type:"tag_close",tagName:i.tagName});else{const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Wl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r})}n=s+1}return t}function vee(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const l=e.indexOf("-->",n);if(l!==-1){n=l+3;continue}break}const o=e.indexOf("<",n);if(o===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(o>n&&t.push({type:"text",content:e.slice(n,o)}),e.startsWith("![CDATA[",o+1)){const l=e.indexOf("]]>",o);if(l!==-1){t.push({type:"text",content:e.slice(o,l+3)}),n=l+3;continue}break}if(e.startsWith("!",o+1)){const l=e.indexOf(">",o);if(l!==-1){n=l+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=N8(e.slice(o+1,s));if(!i){t.push({type:"text",content:e.slice(o,s+1)}),n=s+1;continue}if(i.isClosing){t.push({type:"tag_close",tagName:i.tagName}),n=s+1;continue}const r={};if(i.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(i.attrsStr))!==null;){const c=a[1],u=a[2]??a[3]??a[4]??"";c&&!c.endsWith("/")&&(r[c]=u)}}t.push({type:i.isSelfClosing||Wl.has(i.tagName.toLowerCase())?"self_closing":"tag_open",tagName:i.tagName,attrs:r}),n=s+1}return t}function yee(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${Al(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${Al(o)}`:` ${Al(o)}="${E8(s)}"`).join("");return e.type==="self_closing"?`&lt;${Al(t)}${n} /&gt;`:`&lt;${Al(t)}${n}&gt;`}function kee(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of F8(e))if((n.type==="tag_open"||n.type==="self_closing")&&$8(n.tagName??"",t))return!0;return!1}function cu(e,t="safe"){if(!e)return"";if(t==="escape")return Al(e);const n=vee(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(Al(r.content??""));continue}const l=j1(r.tagName);if(!l)continue;if(T8(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&T2(l,t)){s.push(yee(r));continue}if(r.type==="self_closing"){s.push(`<${l}${DC(PC(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${DC(PC(r.attrs??{},t,l))}>`),Wl.has(l)||o.push(l);continue}const a=o.lastIndexOf(l);if(a===-1)continue;for(;o.length>a+1;){const u=o.pop();u&&s.push(`</${u}>`)}const c=o.pop();c&&s.push(`</${c}>`)}for(;o.length>0;){const r=o.pop();r&&s.push(`</${r}>`)}return s.join("")}const bee=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],HC="http://www.w3.org/2000/svg",xee=new Set(["script","style","iframe","object","embed","link","meta"]),wee=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),_ee=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),See=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Cee=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Aee(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Mee(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Eee(e){const t=e.nodeName.toLowerCase();return t==="use"?Aee(e):t==="image"?Mee(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Cee.has(t)}function Tee(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Nee(e,t,n){const o=e.toLowerCase(),s=t.toLowerCase(),i=String(n??"").trim();return i?(o==="use"||o==="marker"||o==="clippath"||o==="mask")&&(s==="href"||s==="xlink:href")?i.startsWith("#")?i:"":o==="a"&&(s==="href"||s==="xlink:href")?Ra(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ra(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ra(i,{tagName:o,attrName:s})?"":i:""}function Iee(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const o=e[n];if(o==='"'||o==="'"){const i=n+1,r=e.indexOf(o,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const s=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(s,n)}}function O8(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const o=n.trim();if(/^[0-9a-f]+$/i.test(o)){const s=Number.parseInt(o,16);try{return Number.isFinite(s)?String.fromCodePoint(s):""}catch{return""}}return String(n).trim()})}function B8(e){const t=O8(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=Iee(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function WC(e){const t=O8(e);return bee.some(n=>n.test(t))||B8(t)}function Lee(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Zh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function R8(e,t){if(e.nodeType===Node.TEXT_NODE){const s=e.textContent??"";s&&t.push(s);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,o=n.tagName.toLowerCase();if(!xee.has(o)){if(o==="br"){t.push(`
274
+ `);return}for(const s of Array.from(n.childNodes))R8(s,t)}}function $ee(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];R8(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=Zh(t.getAttribute("width")),i=Zh(t.getAttribute("height")),r=Zh(t.getAttribute("x")),l=Zh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(HC,"text");a.setAttribute("x",String(r+s/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),o.length===1)a.textContent=o[0];else{const u=-.6*(o.length-1);for(const[d,f]of o.entries()){const h=e.ownerDocument.createElementNS(HC,"tspan");h.setAttribute("x",String(r+s/2)),h.setAttribute("dy",d===0?`${u}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function Fee(e){$ee(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!wee.has(o)){n.remove();continue}if(o==="style"&&WC(n.textContent??"")){n.remove();continue}const s=Array.from(n.attributes);for(const i of s){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&WC(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(_ee.has(r)&&i.value){const l=Nee(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(See.has(r)&&i.value&&B8(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=Tee(i.value);l!==i.value&&n.setAttribute(i.name,l)}}Lee(n)}}function j4e(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Fee(n),Oee(n)?null:n}catch{return null}}function Oee(e){const t=e.getAttribute("viewBox");if(t){const s=t.trim().split(/[\s,]+/);if(s.length===4){const i=Number.parseFloat(s[2]||""),r=Number.parseFloat(s[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let o=!1;for(const s of n){Eee(s)&&(o=!0);for(const i of Array.from(s.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!o}const Xh=[];function Jg(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Bee(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Ree(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function zC(e=`editor-${Date.now()}`,t={}){const n=CX(t),o=n;o.__markstreamRegisteredPluginCount=Xh.length,o.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||Xh.length);const s={"common.copy":"Copy"};let i;if(typeof t.i18n=="function")i=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;i=m=>p[m]??s[m]??m}else i=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[k,...y]=m;typeof k=="function"&&n.use(k,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(Xh.length)for(const p of Xh)if(Array.isArray(p)){const[m,...k]=p;typeof m=="function"&&n.use(m,...k)}else typeof p=="function"&&n.use(p);n.use(Iq),n.use(Fq),n.use(Eq);const r=Gq,l=r.default??r;n.use(l),n.use(Mq),n.use(Aq),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,k=m.src,y=!!m.env?.__markstreamFinal,g=k.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const b=v.map[0],A=v.map[1],I=v.markup,T=I[0],M=I.length,$=g[Math.max(0,A-1)]??"";let N=0;for(;N<$.length&&($[N]===" "||$[N]===" ");)N++;let F=0;for(;N+F<$.length&&$[N+F]===T;)F++;let S=N+F;for(;S<$.length&&($[S]===" "||$[S]===" ");)S++;const R=y?!0:A>b+1&&F>=M&&S===$.length,z=v;z.meta=z.meta??{},z.meta.unclosed=!R,z.meta.closed=!!R}});const a=(p,m)=>{const k=p,y=k.pos;if(k.src[y]!=="~")return!1;const g=k.src[y-1],v=k.src[y+1];if(/\d/.test(g)&&/\d/.test(v)){if(!m){const b=k.push("text","",0);b.content="~"}return k.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",a),n.renderer.rules.fence=(p,m)=>{const k=p[m],y=String(k.info??"").trim(),g=String(k.content??""),v=btoa(unescape(encodeURIComponent(g))),b=Bee(y),A=Jg(b),I=Ree(`editor-${e}-${m}-${b}`),T=Jg(i("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${A}" id="${I}">
275
+ <div class="code-header">
276
+ <span class="code-lang">${Jg(b.toUpperCase())}</span>
277
+ <button class="copy-button" data-code="${v}">${T}</button>
278
+ </div>
279
+ <div class="code-editor"></div>
280
+ </div>`};const c=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,d=p=>{if(!p.startsWith("["))return!1;const m=u.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const k=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(k)},f=(p,m)=>{const k=p;if(k.src[k.pos]!=="[")return!1;const y=c.exec(k.src.slice(k.pos));if(!y)return!1;const g=k.src.slice(Math.max(0,k.pos-120),k.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(g))return!1;const v=k.src.slice(k.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||d(v))return!1;if(!m){const b=y[1],A=k.push("reference","span",0);A.content=b,A.markup=y[0],A.raw=y[0]}return k.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",f),n.renderer.rules.reference=(p,m)=>{const y=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${y}" role="button" tabindex="0" title="Click to view reference">${y}</span>`};const h=n.use.bind(n);return n.use=((...p)=>(o.__markstreamHasCustomParserExtensions=!0,h(...p))),n}function Dee({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function D8({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:o,streamRenderVersionChanged:s=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return o?n.streamedDelta&&i===e?s?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Dee({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const Pee={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Hee(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function P8(e){const t=Hee(e);return Pee[t]??t}function Wee(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>P8(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function zee(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const o of e){if(typeof o!="string")continue;const s=o.trim();!s||n.has(s)||(n.add(s),t.push(s))}return t.length>0?t:void 0}function Uee(e){return zee(e)?.join("\0")??""}function qee(e,t){return`${Uee(e)}\0\0${Wee(t)?.join("\0")??""}`}function Cc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function UC(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var jee=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const p=qC();this.startedAt=f&&this.hasStarted?p-this.normalizedStartDelayMs:p,this.lastTick=p,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=qC();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const f=1e3/Math.max(1,this.maxCommitFps),h=Math.min(100,Math.max(0,d-this.lastTick));if(h<f){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const p=this.pendingChars,m=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,k=Yee(p/Math.max(.001,m/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(k-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const y=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),g=Gee(this.source.slice(this.visible.length),y,this.segmenter);g.text&&(this.visible+=g.text,this.charBudget=Math.max(0,this.charBudget-g.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:o=1e3,targetLatencyMs:s=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=Cc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,Cc(o,1e3,1)),this.normalizedTargetLatencyMs=Cc(s,900,1),this.normalizedCatchUpLatencyMs=Cc(i,350,1),this.normalizedCatchUpThreshold=UC(r,600),this.normalizedStartDelayMs=UC(a,80),this.maxCommitFps=Math.trunc(Cc(l,30,1)),this.maxCharsPerCommit=Math.trunc(Cc(c,80,1)),this.flushOnFinish=u,this.segmenter=Kee(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Vee(e={},t){const n=new jee(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Kee(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Gee(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let o="",s=0;for(const i of n.segment(e)){if(s>=t)break;o+=i.segment,s++}return{text:o,graphemeCount:s}}function qC(){return typeof performance<"u"?performance.now():Date.now()}function Yee(e,t,n){return Math.min(n,Math.max(t,e))}var Zee=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Oy=Symbol.for("markstream-vue:node-lifecycle");function V4e(){}const I2=new Map;let H8="material";const Vc=new Map,jC=new Map;let By=null;function Xee(e){I2.set(e.id,e)}function Qee(e){const t=I2.get(H8);if(!t)return;const n=t.core[e];if(n)return n;const o=Vc.get(t.id);if(o){const s=o[e];if(s)return s}t.loadExtended&&!Vc.has(t.id)&&ete(t)}function Jee(){var e,t;return(t=(e=I2.get(H8))==null?void 0:e.fallback)!=null?t:""}function ete(e){return Zee(this,null,function*(){var t,n,o;if(Vc.has(e.id))return(t=Vc.get(e.id))!=null?t:null;let s=jC.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Vc.set(e.id,i),By?.(),i)).catch(()=>(Vc.set(e.id,null),null)),jC.set(e.id,s)),s})}const VC='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',KC='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',tte={id:"material",core:{"":KC,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:KC,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:VC,csharp:VC,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>vs(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},nte=gr(0);By=()=>{nte.value++},Xee(tte);const ote={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function V1(e){var t;const n=(function(o){if(!o)return"";const s=o.trim();if(!s)return"";const[i]=s.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=ote[n])!=null?t:n}function K4e(e){const t=V1(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function G4e(e){return Qee(V1(e))||Jee()}const GC={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var K1=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let gs=null,Na=!1,Ia=null,G1=$2;function Wf(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function L2(){try{const e=globalThis;return Wf(e?.katex)}catch{return null}}function $2(){return K1(null,null,function*(){const e=L2();if(e)return e;const t=yield vs(()=>import("./katex-DnlPpQZa.js"),[]);try{yield vs(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Wf(t)})}function W8(e){const t=Promise.resolve(e).then(n=>{var o;return Ia===t&&n?(gs=(o=Wf(n))!=null?o:n,gs):null}).catch(()=>null).finally(()=>{Ia===t&&(Ia=null)});return Ia=t,Na=!0,t}function ste(e){G1=e,gs=null,Na=!1,Ia=null}function ite(e){ste($2)}function z8(){return typeof G1=="function"}function Y4e(){var e;const t=G1;if(!t||t===$2)return null;if(gs)return gs;const n=L2();if(n)return gs=n,gs;if(Na)return null;try{const o=t();return o?typeof o?.then=="function"?(W8(o),null):(gs=(e=Wf(o))!=null?e:o,gs):null}catch{return null}}function U8(){return K1(this,null,function*(){var e;const t=L2();if(t)return gs=t,gs;if(gs)return gs;if(Ia)return Ia;if(Na)return null;const n=G1;if(!n)return Na=!0,null;try{const o=n();if(typeof o?.then=="function")return W8(o);if(o)return gs=(e=Wf(o))!=null?e:o,Na=!0,gs}catch{}return Na=!0,null})}function q8(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Tl=null,wl=null;const Yo=new Map,Ur=new Map;let wf=5;const Pa=new Set;function qd(){if(Yo.size<wf&&Pa.size){let e=wf-Yo.size;for(const t of Array.from(Pa)){if(e<=0)break;Pa.delete(t),e--;try{t()}catch{}}}}function j8(){for(const e of Array.from(Pa)){Pa.delete(e);try{e()}catch{}}}function rte(e){Tl=e,wl=null,Tl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=Yo.get(n);if(i)if(Yo.delete(n),clearTimeout(i.timeoutId),i.cleanup(),qd(),s)i.aborted||i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Ur.set(a,o),Ur.size>200){const c=Ur.keys().next().value;Ur.delete(c)}}i.aborted||i.resolve(o)}},Tl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of Yo.entries())clearTimeout(o.timeoutId),o.cleanup(),o.aborted||o.reject(new Error(`Worker error: ${t.message}`));Yo.clear(),j8()}}function lte(){var e;for(const t of Yo.values())clearTimeout(t.timeoutId),t.cleanup(),t.aborted||t.reject(new Error("Worker cleared"));Yo.clear(),j8(),Tl&&((e=Tl.terminate)==null||e.call(Tl)),Tl=null,wl=null}function ate(e,t=!0,n=2e3,o){return K1(this,null,function*(){performance.now();const s=q8(e);if(!z8()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(wl)return Promise.reject(wl);const i=`${t?"d":"i"}:${s}`,r=Ur.get(i);if(r)return qd(),Promise.resolve(r);const l=Tl||(wl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),wl.name="WorkerInitError",wl.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(wl);if(Yo.size>=wf){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Yo.size,a.max=wf,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const m=new Error("Aborted");return m.name="AbortError",void c(m)}const u=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const m=Yo.get(u);if(!m)return;Yo.delete(u),m.cleanup();const k=new Error("Worker render timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT",m.aborted||m.reject(k),qd()},n);d=()=>{const m=Yo.get(u);if(!m||m.aborted)return;m.aborted=!0,m.cleanup();const k=new Error("Aborted");k.name="AbortError",c(k)},o&&o.addEventListener("abort",d,{once:!0});const h=a,p=c;Yo.set(u,{resolve:m=>{h(m)},reject:m=>{p(m)},timeoutId:f,aborted:!1,cleanup:()=>{o&&d&&o.removeEventListener("abort",d),d=null}});try{l.postMessage({id:u,content:s,displayMode:t})}catch(m){const k=Yo.get(u);Yo.delete(u),clearTimeout(f),k?.cleanup(),k?.reject(m),qd()}})})}function Z4e(e,t=!0,n){const o=`${t?"d":"i"}:${q8(e)}`;if(Ur.set(o,n),Ur.size>200){const s=Ur.keys().next().value;Ur.delete(s)}}const cte="WORKER_BUSY";function ute(e=2e3,t){return Yo.size<wf?Promise.resolve():new Promise((n,o)=>{let s,i=!1,r=null,l=()=>{};const a=()=>{s&&globalThis.clearTimeout(s),Pa.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{i||(i=!0,a(),n())},Pa.add(l),s=globalThis.setTimeout(()=>{if(i)return;i=!0,a();const c=new Error("Wait for worker slot timed out");c.name="WorkerBusyTimeout",c.code="WORKER_BUSY_TIMEOUT",o(c)},e),queueMicrotask(()=>qd()),t&&(r=()=>{if(i)return;i=!0,a();const c=new Error("Aborted");c.name="AbortError",o(c)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const ad={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function X4e(e){return K1(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!z8()){const m=new Error("KaTeX rendering disabled");throw m.name="KaTeXDisabled",m.code="KATEX_DISABLED",m}const a=(s=o.timeout)!=null?s:ad.timeout,c=(i=o.waitTimeout)!=null?i:ad.waitTimeout,u=(r=o.backoffMs)!=null?r:ad.backoffMs,d=(l=o.maxRetries)!=null?l:ad.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):ad.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const m=new Error("Aborted");throw m.name="AbortError",m}try{return yield ate(t,n,a,h)}catch(m){if(m?.code!==cte||p>=f)throw m;if(p++,yield ute(c,h).catch(()=>{}),h?.aborted){const k=new Error("Aborted");throw k.name="AbortError",k}u>0&&(yield new Promise(k=>globalThis.setTimeout(k,u*p)))}}})}function Kc(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function dte(e){var t;for(const n of e.split(/\r?\n/)){const o=n.trim();if(!o||o.startsWith("%%"))continue;const s=o.match(/^([A-Z][\w-]*)\b/i);return((t=s?.[1])==null?void 0:t.toLowerCase())||""}return""}function Im(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=dte(e);return o==="gantt"?220+28*n:o==="sequencediagram"?180+26*n:o==="classdiagram"||o==="statediagram"||o==="erdiagram"?180+24*n:o==="flowchart"||o==="graph"?170+28*n:200+22*n}function Lm(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function V8(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function $m(e,t=360,n=500){return V8(e,t,n)}function Fm(e,t=360,n=500){return V8(e,t,n)}var fte=Object.defineProperty,hte=Object.defineProperties,pte=Object.getOwnPropertyDescriptors,YC=Object.getOwnPropertySymbols,mte=Object.prototype.hasOwnProperty,gte=Object.prototype.propertyIsEnumerable,ZC=(e,t,n)=>t in e?fte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K8=(e,t)=>{for(var n in t||(t={}))mte.call(t,n)&&ZC(e,n,t[n]);if(YC)for(var n of YC(t))gte.call(t,n)&&ZC(e,n,t[n]);return e},XC=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Om=()=>vs(()=>import("./mermaid.core-DAOd3KoM.js").then(e=>e.bn),[]);let Tr=null,Gc=Om,_d=null,Ry=!1,Dy=!1,Sd=0;function vte(e){Gc=e,Sd++,Tr=null,_d=null,Ry=!1,Dy=!1}function yte(e){vte(Om)}function QC(){return typeof Gc=="function"}function JC(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const s=t.mermaidAPI;return n=K8({},t),o={render:s.render.bind(s),parse:s.parse?s.parse.bind(s):void 0,initialize:i=>typeof t.initialize=="function"?t.initialize(i):s.initialize?s.initialize(i):void 0},hte(n,pte(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function e4(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=K8({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,o):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(o):void 0}}catch{}}function Q4e(){return XC(this,null,function*(){if(Tr)return Tr;const e=(function(){try{const o=globalThis;return JC(o?.mermaid)}catch{return null}})();if(e)return Tr=e,e4(Tr),Tr;const t=Gc,n=Sd;return t?t===Om&&Ry?null:_d||(_d=XC(null,null,function*(){let o;try{o=yield t()}catch(s){if(t===Om)return n===Sd&&t===Gc&&(Ry=!0,(function(i){Dy||(Dy=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',i))})(s)),null;throw s}finally{n===Sd&&t===Gc&&(_d=null)}return n!==Sd||t!==Gc?null:o?(Tr=JC(o),e4(Tr),Tr):null}),_d):null})}let $s=null,_l=null;const Di=new Map,ka=new Map;function Ip(e){for(const t of Di.values())t.reject(e);Di.clear(),ka.clear()}let t4=5,n4=!1;const kte="WORKER_BUSY",o4="MERMAID_DISABLED";function bte(e){if($s&&$s!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",Ip(n)}$s=e,_l=null;const t=e;$s.onmessage=n=>{if($s!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Di.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},$s.onerror=n=>{var o,s;if($s===t)if(Di.size!==0){try{n4?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}Ip(new Error(`Worker error: ${n.message}`))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},$s.onmessageerror=n=>{var o,s;if($s===t)if(Di.size!==0){try{n4?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}Ip(new Error("Worker messageerror"))}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function xte(){var e;if($s)try{Ip(new Error("Worker cleared")),(e=$s.terminate)==null||e.call($s)}catch{}$s=null,_l=null}function G8(e,t,n,o){if(!QC()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=o4,Promise.reject(r)}const s=`${e}\0${t.theme}\0${n}\0${t.code}`;let i=ka.get(s);return i||(i=(function(r,l,a=1400){if(!QC()){const u=new Error("Mermaid rendering disabled");return u.name="MermaidDisabled",u.code=o4,Promise.reject(u)}if(_l)return Promise.reject(_l);const c=$s||(_l=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),_l.name="WorkerInitError",_l.code="WORKER_INIT_ERROR",null);if(!c)return Promise.reject(_l);if(Di.size>=t4){const u=new Error("Worker busy");return u.name="WorkerBusy",u.code=kte,u.inFlight=Di.size,u.max=t4,Promise.reject(u)}return new Promise((u,d)=>{const f=Math.random().toString(36).slice(2);let h,p=!1;const m=()=>{p||(p=!0,h!=null&&globalThis.clearTimeout(h),Di.delete(f))},k={resolve:y=>{m(),u(y)},reject:y=>{m(),d(y)}};Di.set(f,k);try{c.postMessage({id:f,action:r,payload:l})}catch(y){return Di.delete(f),void d(y)}h=globalThis.setTimeout(()=>{const y=new Error("Worker call timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT";const g=Di.get(f);g&&g.reject(y)},a)})})(e,t,n),ka.set(s,i),i.then(()=>{ka.get(s)===i&&ka.delete(s)},()=>{ka.get(s)===i&&ka.delete(s)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,c)=>{let u=()=>{};const d=()=>l.removeEventListener("abort",u);u=()=>{d();const f=new Error("Aborted");f.name="AbortError",c(f)},l.addEventListener("abort",u,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),c(f)})})})(i,o)}function J4e(e,t,n=1400,o){return G8("canParse",{code:e,theme:t},n,o)}function e3e(e,t,n=1400,o){return G8("findPrefix",{code:e,theme:t},n,o)}var wte=Object.defineProperty,_te=Object.defineProperties,Ste=Object.getOwnPropertyDescriptors,s4=Object.getOwnPropertySymbols,Cte=Object.prototype.hasOwnProperty,Ate=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,it=(e,t)=>{for(var n in t||(t={}))Cte.call(t,n)&&i4(e,n,t[n]);if(s4)for(var n of s4(t))Ate.call(t,n)&&i4(e,n,t[n]);return e},Ot=(e,t)=>_te(e,Ste(t)),Zn=(e,t,n)=>new Promise((o,s)=>{var i=a=>{try{l(n.next(a))}catch(c){s(c)}},r=a=>{try{l(n.throw(a))}catch(c){s(c)}},l=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Mte="__global__",ev="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Py=(()=>{const e=globalThis;if(e[ev])return e[ev];const t={scopedCustomComponents:{},revision:gr(0)};return e[ev]=t,t})(),r4=Py.revision,Ete=Symbol("markstreamCustomComponents"),Tte=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function zf(e){return Tte.has(String(e).trim().toLowerCase())}function Nte(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function tv(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([Ti(n),Ti(Nte(n))]))!s||zf(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function No(e){const t=Jt(Ete,null);return D(()=>{var n;return r4.value,(function(o,s={}){return r4.value,it(it(it({},tv(Py.scopedCustomComponents[Mte]||{})),tv(s)),tv((function(i){return i&&Py.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const Ite=["aria-label"],Lte={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},$te={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},An=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},ni=An(Je({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(x(),E("svg",$te,[...n[1]||(n[1]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),w("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(x(),E("svg",Lte,[...n[0]||(n[0]=[w("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,Ite))}),[["__scopeId","data-v-be21ab83"]]);ni.install=e=>{e.component(ni.__name,ni)};const Fte={class:"emoji-node"},Ds=An(Je({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("span",Fte,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Ds.install=e=>{e.component(Ds.__name,Ds)};const Ote=["id"],Bte=["title"],oi=An(Je({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const o=document.querySelector(t);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(o,s)=>(x(),E("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[w("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,Bte)],8,Ote))}}),[["__scopeId","data-v-c1463a29"]]);oi.install=e=>{e.component(oi.__name,oi)};const Y8=(()=>{try{return!1}catch{}return!1})();function nv(e){Y8&&console.warn(e)}function l4(e,t="safe",n){return N2(e,t,n)}function Z8(e){return gee(e)}function ov(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function F2(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=Np((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),ov(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),ov(r.value)]):Object.entries(s).map(([r,l])=>[r,ov(l)]):null,t,n);var s;if(!o)return;const i=Z8(Ud(o));return Object.keys(i).length>0?i:void 0}function a4(e,t,n=!1){const o=Object.entries(t??{}),s=o.length>0?o.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${s} />`:`<${e}${s}>`}function cd(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function sv(e,t,n,o,s,i,r=!1){const l=(function(d,f){return $8(d,f)})(e,o);if(Rf.has(e.toLowerCase())||!l&&T8(e,i))return null;if(!l&&T2(e,i))return r?[a4(e,t,!0)]:[a4(e,t),...n,`</${e}>`];const a=N2(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=Z8(a);return Lt(d,Ot(it({},f),{key:u}),n.length>0?n:void 0)}return Lt(e,Ot(it({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function X8(e,t){return kee(e,t)}function Bm(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const f=sv(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);cd(c.length>0?c[c.length-1].children:u,f)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let p=c.length-1;p>=0;p--)if(c[p].tagName.toLowerCase()===f){h=p;break}if(h!==-1)for(;c.length>h;){const p=c.pop(),m=sv(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?cd(c[c.length-1].children,m):cd(u,m),p.tagName.toLowerCase()!==f&&c.length>h&&nv(`Auto-closing unclosed tag: <${p.tagName}>`)}else nv(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=sv(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?cd(c[c.length-1].children,f):cd(u,f),nv(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(F8(e),t,n)}catch(s){return o=s,Y8&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const Rte=["innerHTML"],si=An(Je({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=No(()=>t.customId),i=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:cu(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Bm(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!X8(l,s.value))return{mode:"html",content:cu(l,o.value)};const a=Bm(l,s.value,o.value);return a===null?{mode:"html",content:cu(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(x(),E("span",{key:0,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[ae(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(x(),E("span",{key:1,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(x(),E("span",{key:2,class:Ue(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Rte))}}),[["__scopeId","data-v-d17f12b0"]]);si.install=e=>{e.component(si.__name,si)};const Dte={class:"inline-code"},Pte={key:0},as=An(Je({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Lf(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const g=n.fade;return g===""||g===!0||g==="true"||g!==!1&&g!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var g;return String((g=t.node.code)!=null?g:"")}),c=D(()=>!l.value),u=D(()=>{var g;const v=(g=n["index-key"])!=null?g:n.indexKey;return v==null||v===""?"":String(v)}),d=oe(t.node.code),f=oe(""),h=oe(0);let p;function m(){p?.(),p=void 0}function k(){m(),f.value&&(d.value=d.value+f.value,f.value="")}et([()=>t.node.code,u,l],([g])=>{const v=String(g??""),b=u.value,A=D8({nextContent:v,persistedContent:b?s?.get(b):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=A.settledContent,f.value=A.streamedDelta,A.appended?(h.value+=1,(function(){if(!f.value||p||!i)return;const I=i.value;p=et(()=>i.value,T=>{T!==I&&k()},{flush:"sync"})})()):f.value||m(),b&&s?.set(b,v)},{immediate:!0}),Ef(m);const y=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(g,v)=>(x(),E("code",Dte,[c.value?(x(),E(We,{key:0},[ot(B(a.value),1)],64)):(x(),E(We,{key:1},[d.value?(x(),E("span",Pte,B(d.value),1)):ue("",!0),f.value?(x(),E("span",{key:1,class:Ue(["inline-code-stream-delta",[y.value]]),onAnimationend:k},B(f.value),35)):ue("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);as.install=e=>{e.component(as.__name,as)};const Hy=oe(!1),c4=oe(""),u4=oe("top"),jd=oe(null),Vd=oe(null),Wy=oe(null),zy=oe(null),d4=oe(null);let Lp=null,$p=null,Uy=0;function Q8(){Lp&&(clearTimeout(Lp),Lp=null),$p&&(clearTimeout($p),$p=null)}let Qh=!1,Jh=null,f4=!1;function Hte(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Uy;Q8();const l=()=>Zn(null,null,function*(){var a,c;if(yield(function(){return Zn(this,null,function*(){if(!Qh&&!f4&&typeof document<"u"){Jh!=null||(Jh=Zn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([vs(()=>import("./vue.runtime.esm-bundler-DivoU6l0.js"),[]),vs(()=>import("./Tooltip-BoDrXlWQ.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Hy.value,"anchor-el":jd.value,content:c4.value,placement:u4.value,id:Vd.value,originX:Wy.value,originY:zy.value,isDark:(p=d4.value)!=null?p:void 0})}}).mount(h),Qh=!0}));try{yield Jh}catch(u){Qh=!1,Jh=null,f4=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),Qh&&r===Uy){Vd.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,jd.value=e,c4.value=t,u4.value=n,Wy.value=(a=s?.x)!=null?a:null,zy.value=(c=s?.y)!=null?c:null,d4.value=typeof i=="boolean"?i:null,Hy.value=!0;try{e.setAttribute("aria-describedby",Vd.value)}catch{}}});o?l():Lp=setTimeout(l,80)}function Wte(e=!1){Uy+=1,Q8();const t=()=>{if(jd.value&&Vd.value)try{jd.value.removeAttribute("aria-describedby")}catch{}Hy.value=!1,jd.value=null,Vd.value=null,Wy.value=null,zy.value=null};e?t():$p=setTimeout(t,120)}const zte={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Ute=Symbol("markstreamI18nFallback");function J8(e,t){var n;return(n=t?.[e])!=null?n:zte[e]}const qy=(e,t)=>{var n;return(n=J8(e,t))!=null?n:(function(o){return(o.split(".").pop()||o).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function h4(e,t){return{t(n){const o=J8(n,t);if(e.te&&o!=null&&!e.te(n))return qy(n,t);const s=e.t(n);return s===n&&o!=null?qy(n,t):s}}}function qte(){const e=(function(){var n,o,s;try{const i=Eo(),r=Ute,l=i?.provides,a=(n=i?.appContext)==null?void 0:n.provides;return(s=(o=l?.[r])!=null?o:a?.[r])!=null?s:null}catch{}return null})(),t=(function(){var n,o;try{const s=Eo(),i=s?.proxy,r=i?.$t;if(typeof r=="function"){const c=i?.$te;return{t:r.bind(i),te:typeof c=="function"?c.bind(i):void 0}}const l=(o=(n=s?.appContext)==null?void 0:n.config)==null?void 0:o.globalProperties,a=l?.$t;if(typeof a=="function"){const c=l?.$te;return{t:a.bind(l),te:typeof c=="function"?c.bind(l):void 0}}}catch{}return null})();if(t)return h4(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const o=n();if(o&&typeof o.t=="function")return h4({t:o.t.bind(o),te:typeof o.te=="function"?o.te.bind(o):void 0},e)}catch{}}catch{}return{t:n=>qy(n,e)}}const eE=Symbol("ViewportPriority"),tE=Symbol("ViewportPriorityOptions"),nE=Symbol("OffscreenHeavyNodeDeferral"),jte=D(()=>!1),ja="400px";function O2(){return Jt(tE,void 0)}function B2(){return Jt(nE,jte)}function Vte(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?oe(t):t,r=s?(n=window.requestIdleCallback)!=null?n:T=>window.setTimeout(()=>T({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:T=>window.clearTimeout(T):null,a=new WeakMap;let c=1;const u=new Map,d=new Map,f=new Set;let h=null,p=null;function m(T){if(!T)return"viewport";let M=a.get(T);return M||(M=c++,a.set(T,M)),String(M)}function k(){if(h!=null){try{l?.(h)}catch{}h=null}}function y(T){if(T){const M=u.get(T);if(M&&!M.targets.size){try{M.io.disconnect()}catch{}u.delete(T)}}d.size||f.size||k()}function g(T){const M=d.get(T);if(!M)return;const $=u.get(M.bucketKey);if(!M.visible.value){M.visible.value=!0;try{M.resolve()}catch{}}try{$?.io.unobserve(T)}catch{}$?.targets.delete(T),d.delete(T),f.delete(T),y(M.bucketKey)}function v(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const T=f.values().next().value;T&&(f.delete(T),g(T),f.size&&v())},{timeout:1200}))}function b(T,M){if(!s||typeof IntersectionObserver>"u")return null;const $=(function(W,L){var O,U,Z;return{root:(O=e?.(W??null))!=null?O:null,rootMargin:(U=L?.rootMargin)!=null?U:ja,threshold:(Z=L?.threshold)!=null?Z:0}})(T,M),N=[m((F=$).root),F.rootMargin,F.threshold].join("\0");var F;const S=u.get(N);if(S)return{key:N,bucket:S};let R;try{R=new IntersectionObserver(W=>{for(const L of W)(L.isIntersecting||L.intersectionRatio>0)&&g(L.target)},{root:$.root,rootMargin:$.rootMargin,threshold:$.threshold})}catch{return null}const z={io:R,targets:new Map};return u.set(N,z),{key:N,bucket:z}}function A(){if(s&&i.value)for(const[T,M]of Array.from(d.entries())){const $=b(T,M.opts);if(!$){g(T);continue}if($.key===M.bucketKey)continue;const N=M.bucketKey,F=u.get(N);try{F?.io.unobserve(T)}catch{}F?.targets.delete(T),M.bucketKey=$.key,$.bucket.targets.set(T,M),$.bucket.io.observe(T),y(N)}}et(i,T=>{if(!T){for(const M of Array.from(d.keys()))g(M);k()}},{flush:"sync"});const I=(T,M)=>{const $=oe(!1);let N,F=!1;const S=new Promise(L=>{N=()=>{F||(F=!0,L())}}),R=()=>{const L=d.get(T);if(!L)return f.delete(T),void y();const O=u.get(L.bucketKey);try{O?.io.unobserve(T)}catch{}O?.targets.delete(T),d.delete(T),f.delete(T),y(L.bucketKey)};if(!s||!i.value)return $.value=!0,N(),{isVisible:$,whenVisible:S,destroy:R};const z=b(T,M);if(!z)return $.value=!0,N(),{isVisible:$,whenVisible:S,destroy:R};const W={resolve:N,visible:$,bucketKey:z.key,opts:M};return d.set(T,W),z.bucket.targets.set(T,W),z.bucket.io.observe(T),s&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,A()})),M?.allowIdle!==!1&&(f.add(T),v()),{isVisible:$,whenVisible:S,destroy:R}};return I.refresh=A,In(eE,I),I}function R2(){var e,t;const n=Jt(eE,void 0);if(n)return n;const o=new WeakMap,s=new Map,i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=h=>{if(!h)return;const p=s.get(h);if(p&&!p.targets.size){try{p.io.disconnect()}catch{}s.delete(h)}},d=h=>{const p=o.get(h);if(!p)return;const m=s.get(p.bucketKey);if(!p.visible.value){p.visible.value=!0;try{p.resolve()}catch{}}try{m?.io.unobserve(h)}catch{}o.delete(h),m?.targets.delete(h),i.delete(h),u(p.bucketKey),i.size||c()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const h=i.values().next().value;h&&(i.delete(h),d(h),i.size&&f())},{timeout:1200}))};return(h,p)=>{const m=oe(!1);let k,y=!1;const g=new Promise(A=>{k=()=>{y||(y=!0,A())}}),v=()=>{const A=o.get(h);if(!A)return i.delete(h),void(i.size||c());const I=s.get(A.bucketKey);try{I?.io.unobserve(h)}catch{}o.delete(h),I?.targets.delete(h),i.delete(h),u(A.bucketKey),i.size||c()},b=(A=>{var I,T;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const M=(R=>{var z,W;return[(z=R?.rootMargin)!=null?z:ja,(W=R?.threshold)!=null?W:0].join("\0")})(A),$=s.get(M);if($)return{key:M,bucket:$};const N=(I=A?.rootMargin)!=null?I:ja;let F;try{F=new IntersectionObserver(R=>{for(const z of R)(z.isIntersecting||z.intersectionRatio>0)&&d(z.target)},{root:null,rootMargin:N,threshold:(T=A?.threshold)!=null?T:0})}catch{return null}const S={io:F,targets:new Set};return s.set(M,S),{key:M,bucket:S}})(p);return b?(o.set(h,{resolve:k,visible:m,bucketKey:b.key}),b.bucket.targets.add(h),b.bucket.io.observe(h),p?.allowIdle!==!1&&(i.add(h),f()),{isVisible:m,whenVisible:g,destroy:v}):(m.value=!0,k(),{isVisible:m,whenVisible:g,destroy:v})}}function Kte(e,t){var n,o;const s=(o=(n=e.indexKey)!=null?n:t["index-key"])!=null?o:t.indexKey;return s==null||s===""?"":String(s)}const Gte=["data-markstream-viewport-pending"],Yte=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Zte={key:1,class:"image-placeholder"},Xte={key:1,class:"image-node__raw-text"},Qte={key:2,class:"image-shimmer-overlay"},Jte={key:1,class:"image-node__raw-text"},ene={key:3,class:"image-error"},Fl=An(Je({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,o,s;const i=e,r=t,l=oe(!1),a=oe(!1),c=oe(""),u=oe("primary"),d=oe(null),f=Lf(),h=Jt(Oy,null),p=R2(),m=O2(),k=B2(),y=D(()=>PS(i.node.src)),g=D(()=>PS(i.fallbackSrc)),v=(s=(o=(n=Eo())==null?void 0:n.vnode.el)==null?void 0:o.querySelector)==null?void 0:s.call(o,"img"),b=typeof window<"u"&&v?.getAttribute("src")===(y.value||g.value),A=oe(typeof window>"u"||b||!k.value),I=gr(null);let T="",M=null;const $=D(()=>c.value),N=D(()=>!i.lazy),F=D(()=>typeof window<"u"&&k.value&&!b),S=D(()=>!F.value||A.value),R=D(()=>S.value?$.value:""),z=D(()=>{var he,Ae;return(Ae=(he=m?.value.heavyBlockMargin)!=null?he:m?.value.rootMargin)!=null?Ae:ja}),W=D(()=>!i.node.loading&&u.value!=="failed"&&c.value.length>0),L=D(()=>u.value==="failed"),O=D(()=>(!N.value||F.value&&!A.value)&&!l.value&&!a.value&&u.value!=="failed"&&c.value.length>0),U=D(()=>Kte(i,f));function Z(he=U.value){he&&d.value&&h?.reportHeight(he,d.value.offsetHeight)}function ie(he=U.value){he&&yt(()=>{Z(he)})}function q(){M&&(clearTimeout(M),M=null)}function ee(){const he=U.value;he&&T!==he&&(T&&h?.markSettled(T),q(),T=he,h?.markPending(he),typeof window<"u"&&(M=window.setTimeout(()=>{T===he&&(ie(he),fe())},8e3)))}function fe(){return Zn(this,null,function*(){const he=T;he&&(q(),T="",yield yt(),Z(he),h?.markSettled(he))})}function ne(){if(u.value==="primary"&&g.value&&g.value!==c.value)return u.value="fallback",c.value=g.value,l.value=!1,a.value=!1,void ie();u.value="failed",a.value=!0,r("error",c.value),ie()}function j(){l.value=!0,a.value=!1,r("load",$.value),ie()}function K(he){he.preventDefault(),l.value&&!a.value&&r("click",[he,$.value])}const{t:ve}=qte();return et([y,g,()=>i.node.loading],()=>(l.value=!1,a.value=!1,i.node.loading||y.value?(c.value=y.value,void(u.value="primary")):g.value?(c.value=g.value,void(u.value="fallback")):(c.value="",u.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&et([d,F],([he,Ae],re,Y)=>{var Q;if((Q=I.value)==null||Q.destroy(),I.value=null,!Ae||A.value)return void(A.value=!0);if(!he)return void(A.value=!1);let P=!0;const G=p(he,{rootMargin:z.value,allowIdle:!1});I.value=G,A.value=G.isVisible.value,G.whenVisible.then(()=>{P&&I.value===G&&(A.value=!0)}),Y(()=>{P=!1,G.destroy(),I.value===G&&(I.value=null)})},{immediate:!0}),et([W,l,a,$,()=>i.lazy,S],([he,Ae,re,Y,Q,P])=>he&&Y&&!re&&P?Ae?(fe(),void ie()):Q?(ee(),void ie()):void(Ae||re||ee()):(fe(),void ie()),{flush:"post",immediate:!0}),ho(()=>{var he;(he=I.value)==null||he.destroy(),I.value=null,(function(){const Ae=T;Ae&&(q(),T="",h?.markSettled(Ae))})()}),(he,Ae)=>{var re,Y,Q,P,G;return x(),E("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":F.value&&!A.value?"true":void 0},[W.value?(x(),E("img",{key:0,src:R.value||void 0,alt:String((Y=(re=i.node.alt)!=null?re:i.node.title)!=null?Y:""),title:String((P=(Q=i.node.title)!=null?Q:i.node.alt)!=null?P:""),class:Ue(["image-node__img",{"is-loading":!N.value&&!l.value,"is-loaded":N.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:i.lazy?"lazy":void 0,fetchpriority:N.value?"high":void 0,decoding:N.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(G=i.node.alt)!=null?G:C(ve)("image.preview"),onError:ne,onLoad:j,onClick:K},null,42,Yte)):ue("",!0),e.node.loading&&!a.value?(x(),E("span",Zte,[i.usePlaceholder?jn(he.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[0]||(Ae[0]=w("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",Xte,B(e.node.raw),1))])):ue("",!0),O.value&&!e.node.loading?(x(),E("span",Qte,[i.usePlaceholder?jn(he.$slots,"placeholder",{key:0,node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[1]||(Ae[1]=w("span",{class:"image-shimmer"},null,-1))],!0):(x(),E("span",Jte,B(e.node.raw),1))])):ue("",!0),L.value?(x(),E("span",ene,[jn(he.$slots,"error",{node:i.node,displaySrc:$.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:i.fallbackSrc,lazy:i.lazy},()=>[Ae[2]||(Ae[2]=w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[w("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),w("span",null,B(C(ve)("image.loadError")),1)],!0)])):ue("",!0)],8,Gte)}}}),[["__scopeId","data-v-046e82ac"]]);Fl.install=e=>{e.component(Fl.__name,Fl)};const tne={key:2},vr=Je({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=No(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamNestedRendererProps",void 0),i=D(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=D(()=>{var p,m;const k=(p=s?.value)!=null?p:{};return Ot(it({},k),{customId:(m=t.customId)!=null?m:k.customId,htmlPolicy:i.value})}),l=Hi({loader:()=>Promise.resolve().then(()=>G2),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),c=D(()=>!!(a.value&&n.value[t.node.type]&&!zf(String(t.node.type)))),u=D(()=>c.value?F2(t.node,i.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=D(()=>{var p,m;return String((m=(p=t.node.content)!=null?p:t.node.raw)!=null?m:"")});return(p,m)=>a.value&&c.value?(x(),Se(Ho(a.value),_n({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:Ie(()=>[d.value?(x(),Se(C(l),_n({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(x(),Se(C(l),_n({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(x(),Se(Ho(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(x(),E("span",tne,B(h.value),1)):ue("",!0)}}),p4=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function nne(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Ot(it(it({},p4),n),{enabled:(t=n.enabled)==null||t})}return it({},p4)}function D2(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,o=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=o}function oE(e){var t,n;const o=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(o.length<3)return"";const s=o[0];if(s!=="`"&&s!=="~"||o[1]!==s||o[2]!==s)return"";let i=3;for(;o[i]===s;)i+=1;return o.slice(i).trim()}function m4(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function one(e){var t;return e.diff===!0||m4(e.language)||m4(oE(String((t=e.raw)!=null?t:"")))}function sne(e,t,n){const o=(function(s){const i=oE(s);if(!i)return"";const r=i.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const c=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(c&&/[./\\-]/.test(c))return c}return""})(e);return{title:o||t,caption:o?n?`Diff / ${t}`:t:""}}const ine=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],rne={key:0,translate:"no",class:"markstream-pre__diff-code"},lne={class:"markstream-pre__diff-pane-content"},ane={class:"markstream-pre__diff-number","aria-hidden":"true"},cne={class:"markstream-pre__diff-content"},une={class:"markstream-pre__diff-content-inner"},dne={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},fne=["textContent"],hne=["textContent"],Fs=Je({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(j,K){const ve=String(j??"");return K?ve:ve.replace(/\r\n$|\n$|\r$/,"")}const o=D(()=>{var j,K,ve;const he=String((K=(j=t.node)==null?void 0:j.language)!=null?K:"");return String((ve=String(he).split(/\s+/g)[0])!=null?ve:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=D(()=>`language-${o.value}`),i=D(()=>{var j;return t.loading===!0||((j=t.node)==null?void 0:j.loading)===!0}),r=D(()=>{var j;return n((j=t.node)==null?void 0:j.code,i.value)});let l="",a=1;const c=D(()=>(function(j){let K=0,ve=1;j.startsWith(l)&&(K=l.length,ve=a,K>0&&j[K-1]==="\r"&&j[K]===`
281
+ `&&K++);for(let he=K;he<j.length;he++)j[he]===`
282
+ `?ve++:j[he]==="\r"&&(ve++,j[he+1]===`
283
+ `&&he++);return l=j,a=ve,ve})(r.value)),u=D(()=>r.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const j=c.value;j<d&&(d=0,f="");for(let K=d+1;K<=j;K++)f+=`${f?`
284
+ `:""}${K}`;return d=j,f}),p=D(()=>{var j;return t.showLineNumbers===!0&&((j=t.node)==null?void 0:j.diff)===!0}),m=D(()=>p.value&&t.diffInline===!0),k=D(()=>{const j=Number(t.reservedHeightPx);if(!Number.isFinite(j)||j<=0)return;const K=`${Math.ceil(j)}px`;return i.value?{maxHeight:K,overflow:"auto"}:{height:K,minHeight:K,maxHeight:K,overflow:"auto"}}),y=["diff ","index ","--- ","+++ ","@@ "];function g(j){return String(j??"").trim().length===0}function v(j,K="context",ve={}){const he=g(j);return{code:j,kind:he&&K!=="hunk"&&K!=="spacer"&&!ve.preserveBlankKind?"context":K,empty:he}}function b(j){const K=n(j,i.value);return K?K.split(/\r\n|\n|\r/):[]}function A(j,K){return!g(j[K])||K<j.length-1}function I(j){return j.startsWith("-")&&!j.startsWith("---")}function T(j){return j.startsWith("+")&&!j.startsWith("+++")}function M(j){return j.some(K=>y.some(ve=>K.startsWith(ve)))}function $(j,K){return K||!j.startsWith(" ")||j.startsWith(" ")?j:` ${j}`}function N(j,K){const ve=j.length,he=K.length,Ae=[];let re=0;for(;re<ve&&re<he&&j[re]===K[re];)Ae.push({originalIndex:re,modifiedIndex:re}),re++;const Y=[];let Q=ve-1,P=he-1;for(;Q>=re&&P>=re&&j[Q]===K[P];)Y.unshift({originalIndex:Q,modifiedIndex:P}),Q--,P--;const G=Q-re+1,me=P-re+1;if(G<=0||me<=0||i.value||(G+1)*(me+1)>15e5)return Ae.concat(Y);const ye=me+1,de=new Uint32Array((G+1)*(me+1));for(let ke=G-1;ke>=0;ke--)for(let Ne=me-1;Ne>=0;Ne--){const qe=ke*ye+Ne;if(j[re+ke]===K[re+Ne])de[qe]=de[(ke+1)*ye+Ne+1]+1;else{const be=de[(ke+1)*ye+Ne],xe=de[ke*ye+Ne+1];de[qe]=be>=xe?be:xe}}const V=[];let se=0,pe=0;for(;se<G&&pe<me;)j[re+se]===K[re+pe]?(V.push({originalIndex:re+se,modifiedIndex:re+pe}),se++,pe++):de[(se+1)*ye+pe]>=de[se*ye+pe+1]?se++:pe++;return Ae.concat(V,Y)}function F(j){var K;const ve=(function(){var P,G;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const ye=me===!0?{}:me;return ye.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((P=ye.contextLineCount)!=null?P:2)),minimumLineCount:Math.max(1,Math.floor((G=ye.minimumLineCount)!=null?G:4))}})();if(!ve||j.length<1||j.length>2||j.length===2&&j[0].lines.length!==j[1].lines.length)return j;const he=j[0].lines,Ae=(K=j[1])==null?void 0:K.lines,re=P=>he[P].kind==="context"&&(Ae===void 0||Ae[P].kind==="context"&&he[P].code===Ae[P].code),Y=[];let Q=0;for(;Q<he.length;){const P=Q;for(;Q<he.length&&re(Q);)Q++;const G=Q;if(G-P>=ve.minimumLineCount){const me=P+(P===0?0:ve.contextLineCount),ye=G-(G===he.length?0:ve.contextLineCount);ye-me>=ve.minimumLineCount&&Y.push({start:me,end:ye})}Q===P&&Q++}return Y.length?j.map((P,G)=>{const me=[];let ye=0;for(const de of Y)me.push(...P.lines.slice(ye,de.start)),me.push({code:G===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${P.key}-collapsed-${de.start}-${de.end}`,number:""}),ye=de.end;return me.push(...P.lines.slice(ye)),Ot(it({},P),{lines:me})}):j}const S=D(()=>{var j,K,ve,he;if(!p.value)return[];const Ae=(function(G){const me=G.some(de=>I(de)),ye=G.some(de=>T(de));return me&&ye||(function(){var de,V,se,pe;if(o.value==="diff")return!0;const ke=(pe=(se=String((V=(de=t.node)==null?void 0:de.raw)!=null?V:"").split(/\r?\n/,1)[0])==null?void 0:se.trim())!=null?pe:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(ke)})()&&(me||ye)})(u.value),re=(function(){var G,me;return((G=t.node)==null?void 0:G.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(m.value){const G=re?(function(me,ye){const de=b(me),V=b(ye),se=N(de,V);if(se.length>0){const xe=[];let Ze=0,tt=0;for(const lt of se){for(;Ze<lt.originalIndex;)xe.push(Ot(it({},v(de[Ze],"removed",{preserveBlankKind:A(de,Ze)})),{key:`inline-removed-source-${Ze}`,number:Ze+1})),Ze++;for(;tt<lt.modifiedIndex;)xe.push(Ot(it({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;xe.push(Ot(it({},v(V[lt.modifiedIndex])),{key:`inline-context-source-${lt.originalIndex}-${lt.modifiedIndex}`,number:lt.modifiedIndex+1})),Ze=lt.originalIndex+1,tt=lt.modifiedIndex+1}for(;Ze<de.length;)xe.push(Ot(it({},v(de[Ze],"removed",{preserveBlankKind:A(de,Ze)})),{key:`inline-removed-source-${Ze}`,number:Ze+1})),Ze++;for(;tt<V.length;)xe.push(Ot(it({},v(V[tt],"added",{preserveBlankKind:A(V,tt)})),{key:`inline-added-source-${tt}`,number:tt+1})),tt++;return xe}const pe=[];let ke=0,Ne=de.length-1,qe=V.length-1;for(;ke<=Ne&&ke<=qe&&de[ke]===V[ke];)pe.push(Ot(it({},v(V[ke])),{key:`inline-prefix-${ke}`,number:ke+1})),ke++;const be=[];for(;Ne>=ke&&qe>=ke&&de[Ne]===V[qe];)be.unshift(Ot(it({},v(V[qe])),{key:`inline-suffix-${qe}`,number:qe+1})),Ne--,qe--;for(let xe=ke;xe<=Ne;xe++)pe.push(Ot(it({},v(de[xe],"removed",{preserveBlankKind:A(de,xe)})),{key:`inline-removed-source-${xe}`,number:xe+1}));for(let xe=ke;xe<=qe;xe++)pe.push(Ot(it({},v(V[xe],"added",{preserveBlankKind:A(V,xe)})),{key:`inline-added-source-${xe}`,number:xe+1}));return pe.concat(be)})((j=t.node)==null?void 0:j.originalCode,(K=t.node)==null?void 0:K.updatedCode):(function(me){const ye=[];let de=1,V=1;const se=M(me);for(const[pe,ke]of me.entries())if(ke.startsWith("@@")){const Ne=ke.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);Ne&&(de=Number(Ne[1]),V=Number(Ne[2])),ye.push(Ot(it({},v(ke,"hunk")),{key:`inline-hunk-${pe}`,number:""}))}else if(I(ke))ye.push(Ot(it({},v($(ke.slice(1),se),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${pe}`,number:de++}));else if(T(ke))ye.push(Ot(it({},v($(ke.slice(1),se),"added",{preserveBlankKind:!0})),{key:`inline-added-${pe}`,number:V++}));else{const Ne=se&&ke.startsWith(" ")?ke.slice(1):ke;ye.push(Ot(it({},v(Ne)),{key:`inline-context-${pe}`,number:V})),de++,V++}return ye})(u.value);return F([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:G}])}if(!Ae&&re)return(function(G,me){const ye=b(G),de=b(me),V=N(ye,de),se=[],pe=[];let ke=0,Ne=0,qe=0;const be=(xe,Ze)=>{const tt=Math.max(xe-ke,Ze-Ne);for(let lt=0;lt<tt;lt++){const ut=ke+lt,mt=Ne+lt;se.push(ut<xe?Ot(it({},v(ye[ut],"removed",{preserveBlankKind:A(ye,ut)})),{key:`original-changed-${qe}-${ut}`,number:ut+1}):Ot(it({},v("","spacer")),{key:`original-spacer-${qe}-${lt}`,number:""})),pe.push(mt<Ze?Ot(it({},v(de[mt],"added",{preserveBlankKind:A(de,mt)})),{key:`modified-changed-${qe}-${mt}`,number:mt+1}):Ot(it({},v("","spacer")),{key:`modified-spacer-${qe}-${lt}`,number:""}))}ke=xe,Ne=Ze,qe++};for(const xe of V)be(xe.originalIndex,xe.modifiedIndex),se.push(Ot(it({},v(ye[xe.originalIndex])),{key:`original-context-${xe.originalIndex}-${xe.modifiedIndex}`,number:xe.originalIndex+1})),pe.push(Ot(it({},v(de[xe.modifiedIndex])),{key:`modified-context-${xe.originalIndex}-${xe.modifiedIndex}`,number:xe.modifiedIndex+1})),ke=xe.originalIndex+1,Ne=xe.modifiedIndex+1;return be(ye.length,de.length),F([{key:"original",className:"markstream-pre__diff-pane--original",lines:se},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:pe}])})((ve=t.node)==null?void 0:ve.originalCode,(he=t.node)==null?void 0:he.updatedCode);const Y=[],Q=[],P=M(u.value);for(const G of u.value)if(G.startsWith("@@"))Y.push(v(G,"hunk")),Q.push(v(G,"hunk"));else if(G.startsWith("-")&&!G.startsWith("---"))Y.push(v($(G.slice(1),P),"removed",{preserveBlankKind:!0}));else if(G.startsWith("+")&&!G.startsWith("+++"))Q.push(v($(G.slice(1),P),"added",{preserveBlankKind:!0}));else{const me=P&&G.startsWith(" ")?G.slice(1):G;Y.push(v(me)),Q.push(v(me))}return F([{key:"original",className:"markstream-pre__diff-pane--original",lines:Y.map((G,me)=>Ot(it({},G),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Q.map((G,me)=>Ot(it({},G),{key:`modified-${me}`,number:me+1}))}])}),R=D(()=>S.value.some(j=>j.lines.some(K=>K.kind==="collapsed"))),z=D(()=>{const j=o.value;return j?`Code block: ${j}`:"Code block"}),W=oe(null),L=oe([]);let O=null,U=!1,Z=null;function ie(j){const K=Number.parseFloat(String(j??""));return Number.isFinite(K)&&K>0?K:0}function q(j,K){var ve;if(!j)return K;if(j.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const he=j.querySelector(".markstream-pre__diff-content"),Ae=he?.getBoundingClientRect(),re=(ve=Ae?.height)!=null?ve:0;return Math.max(K,Math.ceil(re))}function ee(){U||typeof window>"u"||(O!=null&&window.cancelAnimationFrame(O),O=window.requestAnimationFrame(()=>{O=null,U||(function(){var j,K;O=null;const ve=W.value;if(!ve||!p.value||m.value||!ve.classList.contains("is-wrap"))return void(L.value.length&&(L.value=[]));const he=(function(me){const ye=window.getComputedStyle(me),de=ie(ye.getPropertyValue("--markstream-pre-diff-line-height"));if(de>0)return de;const V=ie(ye.lineHeight);return V>0?V:18})(ve),Ae=Array.from(ve.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),re=Array.from(ve.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),Y=Math.max(Ae.length,re.length),Q=[];for(let me=0;me<Y;me++){const ye=q((j=Ae[me])!=null?j:null,he),de=q((K=re[me])!=null?K:null,he),V=Math.max(he,ye,de);Q.push({rowHeight:V,originalHeight:ye,modifiedHeight:de})}var P,G;P=L.value,G=Q,P.length===G.length&&P.every((me,ye)=>{const de=G[ye];return de&&Math.abs(me.rowHeight-de.rowHeight)<=.5&&Math.abs(me.originalHeight-de.originalHeight)<=.5&&Math.abs(me.modifiedHeight-de.modifiedHeight)<=.5})||(L.value=Q)})()}))}function fe(j){Z?.disconnect(),Z=null,j&&p.value&&!m.value&&typeof ResizeObserver<"u"&&(Z=new ResizeObserver(()=>{ee()}),Z.observe(j))}function ne(j,K){const ve=L.value[j];if(!ve)return;const he=K==="original"?ve.originalHeight:ve.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(ve.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(he)}px`}}return et(W,j=>{fe(j),yt(()=>ee())},{flush:"post"}),et([p,m,S],()=>{fe(W.value),yt(()=>ee())},{flush:"post",immediate:!0}),ho(()=>{U=!0,O!=null&&(window.cancelAnimationFrame(O),O=null),Z?.disconnect(),Z=null}),(j,K)=>(x(),E("pre",{ref_key:"preRef",ref:W,style:on(k.value),class:Ue([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":p.value,"markstream-pre--diff-inline":m.value,"markstream-pre--diff-collapsed":R.value}]),"aria-busy":i.value,"aria-label":z.value,"data-language":o.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[p.value?(x(),E("code",rne,[(x(!0),E(We,null,rt(S.value,ve=>(x(),E("span",{key:ve.key,class:Ue(["markstream-pre__diff-pane",ve.className])},[w("span",lne,[(x(!0),E(We,null,rt(ve.lines,(he,Ae)=>(x(),E("span",{key:he.key,class:Ue(["markstream-pre__diff-line",[`markstream-pre__diff-line--${he.kind}`,{"markstream-pre__diff-line--empty":he.empty}]]),style:on(ne(Ae,ve.key))},[K[0]||(K[0]=w("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),w("span",ane,B(he.number),1),w("span",cne,[w("span",une,B(he.code),1)])],6))),128))])],2))),128))])):(x(),E(We,{key:1},[t.showLineNumbers?(x(),E("span",dne,[w("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,fne)])):ue("",!0),w("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,hne)],64))],14,ine))}});Fs.install=e=>{e.component(Fs.__name,Fs)};const pne={key:0},mo=An(Je({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=Lf(),o=Jt("markstreamFade",void 0),s=Jt("markstreamTextStreamState",void 0),i=Jt("markstreamStreamVersion",void 0),r=D(()=>{const k=n.fade;return k===""||k===!0||k==="true"||k!==!1&&k!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=D(()=>{var k;const y=(k=n["index-key"])!=null?k:n.indexKey;return y==null||y===""?"":String(y)}),c=oe(t.node.content),u=oe(""),d=oe(0);let f;function h(){f?.(),f=void 0}function p(){h(),u.value&&(c.value=c.value+u.value,u.value="")}et([()=>t.node.content,a,l],([k])=>{const y=String(k??""),g=a.value,v=D8({nextContent:y,persistedContent:g?s?.get(g):void 0,currentState:{settledContent:c.value,streamedDelta:u.value},typewriterEnabled:l.value});c.value=v.settledContent,u.value=v.streamedDelta,v.appended?(d.value+=1,(function(){if(!u.value||f||!i)return;const b=i.value;f=et(()=>i.value,A=>{A!==b&&p()},{flush:"sync"})})()):u.value||h(),g&&s?.set(g,y)},{immediate:!0}),Ef(h);const m=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(k,y)=>(x(),E("span",{class:Ue([[e.node.center?"text-node-center":""],"text-node"])},[c.value?(x(),E("span",pne,B(c.value),1)):ue("",!0),u.value?(x(),E("span",{key:1,class:Ue(["text-node-stream-delta",[m.value]]),onAnimationend:p},B(u.value),35)):ue("",!0)],2))}}),[["__scopeId","data-v-a7e90764"]]);function Cd(e,t,n){return Je({name:e,inheritAttrs:!1,setup(o,{attrs:s,slots:i}){var r,l;const a=R2(),c=O2(),u=B2(),d=typeof window<"u"&&((l=(r=Eo())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=oe(typeof window>"u"||d||!u.value),h=gr(null);let p=null;function m(k){const y=k&&"$el"in k?k.$el:k;h.value=y instanceof HTMLElement?y:null}return typeof window<"u"&&et([h,u],([k,y],g,v)=>{if(p?.destroy(),p=null,!y||f.value)return void(f.value=!0);if(!k)return;let b=!0;const A=a(k,{rootMargin:c?.value.heavyBlockMargin,allowIdle:!1});p=A,f.value=A.isVisible.value,A.whenVisible.then(()=>{b&&p===A&&(f.value=!0)}),v(()=>{b=!1,A.destroy(),p===A&&(p=null)})},{immediate:!0}),ho(()=>{p?.destroy(),p=null}),()=>Lt(f.value?t:n,Ot(it({},s),{ref:m}),i)}})}mo.install=e=>{e.component(mo.__name,mo)};const Rm=Je({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var o,s,i,r,l,a,c;const u=V1(String((s=(o=n.node)==null?void 0:o.language)!=null?s:"")),d=GC[u]||(u?u.charAt(0).toUpperCase()+u.slice(1):GC[""]),f=one(n.node),h=sne(String((r=(i=n.node)==null?void 0:i.raw)!=null?r:""),d,f),p=n.monacoOptions,m=f&&((l=n.estimatedDiffInline)!=null?l:D2(p??{},typeof window>"u"?0:window.innerWidth)),k=p?.diffAppearance,y=k==="dark"||k!=="light"&&n.isDark===!0,g=typeof p?.fontSize=="number"&&Number.isFinite(p.fontSize)&&p.fontSize>0?p.fontSize:12,v=typeof p?.lineHeight=="number"&&Number.isFinite(p.lineHeight)&&p.lineHeight>0?p.lineHeight:g===12?18:Math.max(12,Math.round(1.5*g)),b=typeof p?.tabSize=="number"&&Number.isFinite(p.tabSize)&&p.tabSize>0?p.tabSize:4,A=f?0:8,I=typeof((a=p?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(p.padding.top)&&p.padding.top>=0?p.padding.top:A,T=typeof((c=p?.padding)==null?void 0:c.bottom)=="number"&&Number.isFinite(p.padding.bottom)&&p.padding.bottom>=0?p.padding.bottom:A,M=typeof p?.fontFamily=="string"?p.fontFamily.trim():"",$=it(it({fontSize:`${g}px`,lineHeight:`${v}px`,tabSize:b,paddingTop:`${I}px`,paddingBottom:`${T}px`,"--markstream-pre-line-number-top":`${I}px`},f?{"--markstream-pre-diff-line-height":`${v}px`}:{}),M?{"--markstream-code-font-family":M}:{}),N=()=>Lt("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Lt("svg",{class:"action-icon"})]),F=n.isShowPreview!==!1&&(u==="html"||u==="svg"),S=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||F&&n.showPreviewButton!==!1,R=W=>{if(W!=null)return typeof W=="number"?`${W}px`:String(W)},z=it(it(it({"--markstream-code-layout-character-width":"1ch"},R(n.minWidth)?{minWidth:R(n.minWidth)}:{}),R(n.maxWidth)?{maxWidth:R(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--vscode-editor-background, var(--markstream-code-fallback-bg, var(--code-bg)))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Lt("div",Ot(it({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":y,"is-diff":f,"is-plain-text":u===""||u==="plaintext"||u==="text"},t.class],style:[z,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Lt("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Lt("div",{class:"code-header-main"},[Lt("span",{class:"icon-slot h-4 w-4 flex-shrink-0"}),Lt("div",{class:"code-header-copy"},[Lt("div",{class:"code-header-title"},h.title),h.caption?Lt("div",{class:"code-header-caption"},h.caption):null])]),Lt("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Lt("div",{class:"code-diff-stats","aria-hidden":"true"},[Lt("span",{class:"code-diff-stat removed"},"-0"),Lt("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:N(),n.showCollapseButton===!1?null:N(),S?Lt("div",{class:"relative"},[N()]):null])]),Lt("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Lt(Fs,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:m,diffHideUnchangedRegions:f?nne(p?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:$,"data-markstream-code-loading":"1"})]),Lt("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Lt("div",{class:"loading-skeleton"},[Lt("div",{class:"skeleton-line"}),Lt("div",{class:"skeleton-line"}),Lt("div",{class:"skeleton-line short"})])]),Lt("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),iv=Cd("ViewportDeferredCodeBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./CodeBlockNode-Doj0S5Qm.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependency stream-diffs is missing. Falling back to preformatted code rendering. To enable enhanced code block features, please install "stream-diffs".',e),Fs}}),loadingComponent:Rm,delay:0,suspensible:!1}),Rm),Gi=Hi(()=>Zn(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,o,s,i;return Lt(mo,Ot(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))};try{return yield U8(),(yield vs(()=>import("./index7-BSYWAfC9.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,o,s,i;return Lt(mo,Ot(it({},t),{node:{type:"text",content:(o=t.node.raw)!=null?o:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(s=t.node.content)!=null?s:""}$`}}))}})),sE=Hi(()=>Zn(null,null,function*(){try{return yield U8(),(yield vs(()=>import("./index6-p0NcquyY.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,o,s;return Lt(mo,Ot(it({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(s=e.node.raw)!=null?s:`$$${(o=e.node.content)!=null?o:""}$$`}}))}})),bs=An(Je({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(x(),E("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=o=>t.$emit("click",o,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=o=>t.$emit("mouseEnter",o,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=o=>t.$emit("mouseLeave",o,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);bs.install=e=>{e.component(bs.__name,bs)};const mne={class:"superscript-node"},Ps=An(Je({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,emphasis:Ss,footnote_reference:oi,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,emoji:Ds,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("sup",mne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"superscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Ps.install=e=>{e.component(Ps.__name,Ps)};const gne={class:"subscript-node"},Hs=An(Je({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,emphasis:Ss,footnote_reference:oi,strikethrough:ws,highlight:ii,insert:Ws,superscript:Ps,emoji:Ds,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("sub",gne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"subscript"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Hs.install=e=>{e.component(Hs.__name,Hs)};const vne={class:"strong-node"},xs=An(Je({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,emphasis:Ss,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:oi,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("strong",vne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"strong"}-${l}`,components:o.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);xs.install=e=>{e.component(xs.__name,xs)};const yne={class:"strikethrough-node"},ws=An(Je({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,emphasis:Ss,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:oi,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("del",yne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"strikethrough"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);ws.install=e=>{e.component(ws.__name,ws)};const kne=["href","title","aria-label","aria-hidden","target","rel"],bne=["aria-hidden"],xne={class:"link-text-wrapper relative inline-flex"},wne={class:"leading-[normal] link-text"},_s=An(Je({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Jt("markstreamShowTooltips",void 0),o=D(()=>{const y=n?.value;return typeof y=="boolean"?y:t.showTooltip}),s=D(()=>{var y,g,v,b,A;const I=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",T=(y=t.animationOpacity)!=null?y:.35,M=Math.max(.12,Math.min(.5*T,T)),$={"--underline-height":`${(g=t.underlineHeight)!=null?g:2}px`,"--underline-bottom":I,"--underline-opacity":String(T),"--underline-rest-opacity":String(M),"--underline-duration":`${(v=t.animationDuration)!=null?v:1.6}s`,"--underline-timing":(b=t.animationTiming)!=null?b:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&($["--link-color"]=t.color),$}),i=No(()=>t.customId),r=D(()=>it({text:mo,strong:xs,strikethrough:ws,emphasis:Ss,image:Fl,html_inline:si,inline_code:as},i.value)),l=Lf(),a=D(()=>{var y,g;const v=(y=t.node)==null?void 0:y.attrs;if(!v||typeof v!="object")return{};const b={};if(Array.isArray(v))for(const A of v)Array.isArray(A)&&A[0]&&(b[String(A[0])]=String((g=A[1])!=null?g:""));else for(const[A,I]of Object.entries(v))A&&I!=null&&I!==!1&&(b[A]=I===!0?"":String(I));return l4(b,"safe","a")}),c=D(()=>it(it({},l),a.value)),u=D(()=>{var y,g;return l4({href:String((g=(y=t.node)==null?void 0:y.href)!=null?g:"")},"safe","a").href}),d=D(()=>{if(!u.value)return;const y=c.value.target;return(typeof y=="string"?y.trim():String(y??"").trim())||(gY(u.value)?"_blank":void 0)}),f=D(()=>{var y;return String((y=d.value)!=null?y:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!u.value)return;const y=c.value.rel,g=new Set((typeof y=="string"?y:String(y??"")).split(/\s+/).filter(Boolean)),v=new Set(Array.from(g).filter(b=>b.toLowerCase()!=="opener"));return f.value&&(v.add("noopener"),v.add("noreferrer")),v.size>0?Array.from(v).join(" "):void 0}),p=D(()=>{const y=it({},c.value);return delete y.title,delete y.href,delete y.target,delete y.rel,y});function m(){o.value&&Wte()}const k=D(()=>{var y,g;const v=(y=t.node)==null?void 0:y.title;return typeof v=="string"&&v.trim().length>0?v:String((g=u.value)!=null?g:"")});return(y,g)=>{var v,b;return e.node.loading?(x(),E("span",_n({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[w("span",xne,[w("span",wne,[ae(C(mo),{class:"leading-[normal] link-text",node:{type:"text",content:String((v=e.node.text)!=null?v:""),raw:String((b=e.node.text)!=null?b:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),g[1]||(g[1]=w("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,bne)):(x(),E("a",_n({key:0,class:"link-node",href:u.value,title:o.value?"":k.value,"aria-label":`Link: ${k.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:g[0]||(g[0]=A=>(function(I){var T,M,$,N;if(!o.value)return;const F=I,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,R=((T=t.node)==null?void 0:T.title)||((M=u.value)!=null&&M.includes("xn--")&&((N=($=t.node)==null?void 0:$.text)!=null&&N.includes("://"))?t.node.text:u.value)||"";Hte(I.currentTarget,R,"top",!1,S)})(A)),onMouseleave:m}),[(x(!0),E(We,null,rt(e.node.children,(A,I)=>(x(),Se(C(vr),{key:`${e.indexKey||"emphasis"}-${I}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${I}`},null,8,["components","node","custom-id","index-key"]))),128))],16,kne))}}}),[["__scopeId","data-v-367e6ca4"]]);_s.install=e=>{e.component(_s.__name,_s)};const _ne={class:"insert-node"},Ws=An(Je({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,emphasis:Ss,strikethrough:ws,highlight:ii,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:oi,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("ins",_ne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"insert"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ws.install=e=>{e.component(Ws.__name,Ws)};const Sne={class:"highlight-node"},ii=An(Je({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,emphasis:Ss,strikethrough:ws,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:oi,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("mark",Sne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"highlight"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ii.install=e=>{e.component(ii.__name,ii)};const Cne={class:"emphasis-node"},Ss=An(Je({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=D(()=>it({text:mo,inline_code:as,link:_s,html_inline:si,strong:xs,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,footnote_reference:oi,math_inline:Gi,reference:bs},n.value));return(s,i)=>(x(),E("em",Cne,[(x(!0),E(We,null,rt(e.node.children,(r,l)=>(x(),Se(C(vr),{key:`${e.indexKey||"emphasis"}-${l}`,components:o.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);Ss.install=e=>{e.component(Ss.__name,Ss)};const Ane={class:"hard-break"},Ol=An(Je({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(x(),E("br",Ane))}),[["__scopeId","data-v-50c58f70"]]);Ol.install=e=>{e.component(Ol.__name,Ol)};const _f=Je({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=gt({checkbox:ni,checkbox_input:ni,emoji:Ds,emphasis:Ss,hardbreak:Ol,highlight:ii,inline_code:as,insert:Ws,link:_s,reference:bs,strikethrough:ws,strong:xs,subscript:Hs,superscript:Ps,text:mo}),o=No(()=>t.customId),s=D(()=>{const i=o.value;return Object.keys(i).length>0?it(it({},n),i):n});return(i,r)=>(x(!0),E(We,null,rt(e.nodes,(l,a)=>(x(),Se(C(vr),{key:a,components:s.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function jy(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(jy)}function Dm(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(jy))return e;if(!t||e.length!==1)return null;const o=e[0];if(o?.type!=="paragraph"||!Array.isArray(o.children))return null;const s=o.children;return(n||s.length>0)&&s.every(jy)?s:null}function Va(e){var t,n;if(!e?.length)return null;let o="";for(const s of e){if(s?.type!=="text"||s.center===!0)return null;o+=String((n=(t=s.content)!=null?t:s.raw)!=null?n:"")}return o}const Mne=["cite"],Ene={key:0,dir:"auto",class:"paragraph-node"},Tne=["custom-id"],Fp=An(Je({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=No(()=>t.customId),o=D(()=>!!n.value.paragraph),s=D(()=>!!n.value.text),i=D(()=>Dm(t.node.children,!o.value)),r=D(()=>t.fade!==!1||s.value?null:Va(i.value));return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(l,a)=>(x(),E("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(x(),E("p",Ene,[r.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Tne)):(x(),Se(C(_f),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(x(),Se(C(zs),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Mne))}}),[["__scopeId","data-v-abfecebc"]]);Fp.install=e=>{e.component(Fp.__name,Fp)};const Nne={class:"definition-list"},Ine={class:"definition-term"},Lne={class:"definition-desc"},Op=An(Je({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("dl",Nne,[(x(!0),E(We,null,rt(t.node.items,(s,i)=>(x(),E(We,{key:i},[w("dt",Ine,[ae(C(zs),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:s.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),w("dd",Lne,[ae(C(zs),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:s.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[1]||(o[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Op.install=e=>{e.component(Op.__name,Op)};const $ne=["href","title"],Kd=An(Je({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(o){var s;if(o.preventDefault(),typeof document>"u")return;const i=`fnref-${String((s=t.node.id)!=null?s:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(o,s)=>(x(),E("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,$ne))}}),[["__scopeId","data-v-e1eb37b6"]]);Kd.install=e=>{e.component(Kd.__name,Kd)};const Fne=["id"],One={class:"flex-1"},Bp=Je({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(x(),E("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[w("div",One,[ae(C(zs),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:o[0]||(o[0]=s=>n.$emit("copy",s))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,Fne))}});Bp.install=e=>{e.component(Bp.__name,Bp)};const Bne=["custom-id"],Vy=An(Je({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=No(()=>t.customId),o=Jt("markstreamFade",void 0),s=D(()=>o?.value!==!1||n.value.text?null:Va(t.node.children)),i=D(()=>it({text:mo,inline_code:as,link:_s,image:Fl,strong:xs,emphasis:Ss,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,checkbox:ni,checkbox_input:ni,footnote_reference:oi,hardbreak:Ol,math_inline:Gi,reference:bs},n.value));return(r,l)=>(x(),Se(Ho(`h${e.node.level}`),_n({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ie(()=>[s.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(s.value),9,Bne)):(x(!0),E(We,{key:1},rt(e.node.children,(a,c)=>(x(),Se(C(vr),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Y1=Vy;Y1.install=e=>{e.component(Vy.__name,Vy)};const Rne={key:0,dir:"auto",class:"paragraph-node"},Dne=["custom-id"],Pne={dir:"auto",class:"paragraph-node"},Hne=["custom-id"],uu=An(Je({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),o=No(()=>t.customId),s=D(()=>!!o.value.paragraph),i=D(()=>!!o.value.text),r=D(()=>{var h;return Dm((h=n.value)==null?void 0:h.children,!s.value)}),l=D(()=>{var h;if(s.value)return null;const p=(h=n.value)==null?void 0:h.children;if(!Array.isArray(p)||p.length<2)return null;const m=p[0];if(m?.type!=="paragraph"||!Array.isArray(m.children))return null;const k=p.slice(1);if(!k.every(g=>g?.type==="list"))return null;const y=Dm([m]);return y?{paragraphChildren:y,nestedLists:k}:null});function a(){return t.fade===!1&&!i.value}const c=D(()=>a()?Va(r.value):null),u=D(()=>{var h;return a()?Va((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade)),(h,p)=>{var m,k;return x(),E("li",_n({class:"list-item",dir:"auto"},f.value),[r.value?(x(),E("p",Rne,[c.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,Dne)):(x(),Se(C(_f),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(x(),E(We,{key:1},[w("p",Pne,[u.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,Hne)):(x(),Se(C(_f),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(x(!0),E(We,null,rt(l.value.nestedLists,(y,g)=>(x(),Se(C(zs),{key:g,nodes:[y],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${g}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:p[0]||(p[0]=v=>h.$emit("copy",v))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(x(),Se(C(zs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(k=(m=n.value)==null?void 0:m.children)!=null?k:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=y=>h.$emit("copy",y))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);uu.install=e=>{e.component(uu.__name,uu)};const du=An(Je({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=No(()=>e.customId),n=D(()=>t.value.list_item||uu);return(o,s)=>(x(),Se(Ho(e.node.ordered?"ol":"ul"),{class:Ue(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ie(()=>[(x(!0),E(We,null,rt(e.node.items,(i,r)=>{var l;return x(),Se(Ho(n.value),_n({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:s[0]||(s[0]=a=>o.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);du.install=e=>{e.component(du.__name,du)};const Wne={key:2,class:"html-block-node__raw"},zne=["innerHTML"],Une={key:1,class:"html-block-node__placeholder"},Gd=An(Je({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Jt("markstreamHtmlPolicy",void 0),o=Jt("markstreamNestedRendererProps",void 0),s=D(()=>{var S,R;return(R=(S=t.htmlPolicy)!=null?S:n?.value)!=null?R:"safe"}),i=D(()=>{var S,R;const z=(S=o?.value)!=null?S:{};return Ot(it({},z),{customId:(R=t.customId)!=null?R:z.customId,htmlPolicy:s.value})}),r=Hi({loader:()=>Promise.resolve().then(()=>G2),suspensible:!1}),l=D(()=>{const S=Np(t.node.attrs,s.value);if(!S)return;const R=Ud(S);return Object.keys(R).length>0?R:void 0}),a=D(()=>{const S=String(t.node.tag||"").trim(),R=Np(t.node.attrs,s.value,S);if(!R)return;const z=Ud(R);return Object.keys(z).length>0?z:void 0}),c=No(()=>t.customId),u=Je({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=oe(null),f=oe(typeof window>"u"),h=oe(t.node.content),p=D(()=>Array.isArray(t.node.children)?t.node.children:[]),m=D(()=>String(t.node.tag||"div")),k=D(()=>{var S;if(m.value.trim().toLowerCase()!=="details"||(S=t.node.attrs)!=null&&S.some(([z])=>String(z).toLowerCase()==="open"))return null;const R=p.value[0];return R?.type==="html_block"&&String(R.tag||"").toLowerCase()==="summary"?R:null}),y=D(()=>{var S;return Va((S=k.value)==null?void 0:S.children)}),g=D(()=>{const S=k.value;if(!S)return;const R=Np(S.attrs,s.value,"summary");if(!R)return;const z=Ud(R);return Object.keys(z).length>0?z:void 0}),v=D(()=>y.value==null?p.value:p.value.slice(1)),b=D(()=>{const S=m.value.trim().toLowerCase();return A5.has(S)||T2(S,s.value)}),A=D(()=>p.value.length>0&&!!t.node.tag&&!b.value),I=D(()=>{var S,R,z;if(A.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(S=h.value)!=null?S:""};const W=(R=h.value)!=null?R:t.node.content;if(!W)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:cu(W,s.value)};if(t.node.loading){const O=Bm(W,c.value,s.value);return O===null?{mode:"text",content:(z=t.node.raw)!=null?z:W}:{mode:"dynamic",nodes:O}}if(!X8(W,c.value))return{mode:"html",content:cu(W,s.value)};const L=Bm(W,c.value,s.value);return L===null?{mode:"html",content:cu(W,s.value)}:{mode:"dynamic",nodes:L}}),T=R2(),M=O2(),$=B2(),N=gr(null),F=!!t.node.loading;return typeof window<"u"?(et([()=>d.value,()=>M?.value.heavyBlockMargin,()=>M?.value.rootMargin],([S],R,z)=>{var W,L,O,U;if((L=(W=N.value)==null?void 0:W.destroy)==null||L.call(W),N.value=null,!F)return f.value=!0,void(h.value=t.node.content);if(!S)return void(f.value=!1);let Z=!0;const ie=(U=(O=M?.value.heavyBlockMargin)!=null?O:M?.value.rootMargin)!=null?U:ja,q=T(S,{rootMargin:ie,allowIdle:!$.value});N.value=q,f.value=f.value||q.isVisible.value,q.whenVisible.then(()=>{Z&&N.value===q&&(f.value=!0)}),z(()=>{Z=!1,q.destroy(),N.value===q&&(N.value=null)})},{immediate:!0}),et(()=>t.node.content,S=>{F&&!f.value||(h.value=S)})):f.value=!0,ho(()=>{var S,R;(R=(S=N.value)==null?void 0:S.destroy)==null||R.call(S),N.value=null}),(S,R)=>(x(),Se(Ho(A.value?m.value:"div"),_n({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":C($)&&!f.value?"true":void 0},A.value?a.value:void 0),{default:Ie(()=>[f.value?(x(),E(We,{key:0},[I.value.mode==="structured"?(x(),E(We,{key:0},[y.value!==null?(x(),E(We,{key:0},[w("summary",l9(fM(g.value)),B(y.value),17),v.value.length?(x(),Se(C(r),_n({key:0},i.value,{nodes:v.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ue("",!0)],64)):(x(),Se(C(r),_n({key:1},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):I.value.mode==="dynamic"?(x(),Se(C(u),{key:1,nodes:I.value.nodes},null,8,["nodes"])):I.value.mode==="text"?(x(),E("pre",Wne,B(I.value.content),1)):(x(),E("div",_n({key:3},l.value,{innerHTML:I.value.content}),null,16,zne))],64)):(x(),E("div",Une,[jn(S.$slots,"placeholder",{node:e.node},()=>[R[0]||(R[0]=w("span",{class:"html-block-node__placeholder-bar"},null,-1)),R[1]||(R[1]=w("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),R[2]||(R[2]=w("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Gd.install=e=>{e.component(Gd.__name,Gd)};const qne={dir:"auto",class:"paragraph-node"},jne=["custom-id"],Ha=An(Je({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=No(()=>t.customId),o=Jt("markstreamHtmlPolicy",void 0),s=Jt("markstreamFade",void 0),i=Jt("markstreamParseOptions",void 0),r=Jt("markstreamCustomMarkdownIt",void 0),l=Jt("markstreamNestedRendererProps",void 0),a=D(()=>{var M;return(M=o?.value)!=null?M:"safe"}),c=D(()=>{var M;return(M=t.parseOptions)!=null?M:i?.value}),u=D(()=>{var M;return(M=t.customMarkdownIt)!=null?M:r?.value}),d=D(()=>{var M,$;return($=t.customHtmlTags)!=null?$:(M=l?.value)==null?void 0:M.customHtmlTags}),f=D(()=>{var M,$;const N=(M=l?.value)!=null?M:{};return Ot(it({},N),{customId:($=t.customId)!=null?$:N.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Hi({loader:()=>Promise.resolve().then(()=>G2),suspensible:!1});function p(M){var $;return M.type==="text"&&String(($=M.content)!=null?$:"").trim()===""}const m=D(()=>t.node.children.filter(M=>!p(M))),k=D(()=>m.value.length>0&&m.value.every(M=>M.type==="image"||(function($){var N;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(R=>!p(R)):[]})($);return F.length===1&&((N=F[0])==null?void 0:N.type)==="image"})(M))),y=D(()=>new Set(tc(d.value))),g=D(()=>{if(!k.value||m.value.length<=1)return t.node.children;const M=[];for(let $=0;$<t.node.children.length;$++){const N=t.node.children[$];if(!p(N)){M.push(N);continue}const F=M.length>0,S=t.node.children.slice($+1).some(R=>!p(R));F&&S&&M.push(Ot(it({},N),{content:" ",raw:" "}))}return M}),v=D(()=>s?.value===!1&&!n.value.text),b=D(()=>v.value?Va(g.value):null);function A(M,$){return{node:M,"index-key":`${t.indexKey}-${$}`,"custom-id":t.customId,"custom-html-tags":d.value}}const I=D(()=>it({inline_code:as,image:Fl,link:_s,hardbreak:Ol,emphasis:Ss,strong:xs,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,html_inline:si,html_block:Gd,emoji:Ds,checkbox:ni,math_inline:Gi,checkbox_input:ni,reference:bs,footnote_anchor:Kd,footnote_reference:oi,text:mo},n.value)),T=D(()=>g.value.map((M,$)=>{var N;const F=(function(S){var R,z,W,L;if(S.type==="html_block"||S.type==="html_inline"){const O=String((R=S.tag)!=null?R:"").trim().toLowerCase()||I5(S.content);if(O&&!y.value.has(O)&&L5((z=S.content)!=null?z:S.raw,O)){const U=String((L=(W=S.content)!=null?W:S.raw)!=null?L:"");return{child:{type:"text",content:U,raw:U},component:mo,isCustomComponent:!1}}}return{child:S,component:I.value[S.type],isCustomComponent:!!(n.value[S.type]&&!zf(String(S.type)))}})(M);return Ot(it({},F),{index:$,key:`${t.indexKey||"paragraph"}-${$}`,customAttrs:F.isCustomComponent?F2(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((N=F.child.content)!=null?N:""),originalChild:M})}));return(M,$)=>(x(),E("p",qne,[b.value!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(b.value),9,jne)):(x(!0),E(We,{key:1},rt(T.value,N=>{return x(),E(We,{key:N.key},[k.value&&p(N.originalChild)?(x(),E(We,{key:0},[ot(B((F=N.originalChild,String((S=F.content)!=null?S:""))),1)],64)):N.isCustomComponent?(x(),Se(Ho(N.component),_n({key:1,ref_for:!0},N.customAttrs,{node:N.child,loading:N.child.loading,"index-key":N.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ie(()=>[N.hasSlotChildren?(x(),Se(C(h),_n({key:0,ref_for:!0},f.value,{nodes:N.child.children,"index-key":N.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):N.slotContent?(x(),Se(C(h),_n({key:1,ref_for:!0},f.value,{content:N.slotContent,final:!N.child.loading,"index-key":`${N.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(x(),Se(Ho(N.component),_n({key:2,ref_for:!0},A(N.child,N.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ha.install=e=>{e.component(Ha.__name,Ha)};const Vne={class:"table-node-wrapper"},Kne=["aria-busy"],Gne={key:0},Yne=["custom-id"],Zne=["aria-label","onPointerdown"],Xne=["custom-id"],Qne={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Yd=An(Je({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var y;return(y=t.node.loading)!=null&&y}),o=D(()=>{var y;return(y=t.node.rows)!=null?y:[]}),s=oe(null),i=oe([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>i.value.some(y=>Number.isFinite(y)&&y>0)),c=D(()=>a.value?i.value.map(y=>y>0?{width:`${y}px`}:void 0):[]);In("markstreamShowTooltips",D(()=>t.showTooltips)),In("markstreamFade",D(()=>t.fade));const u=No(()=>t.customId),d=D(()=>!!u.value.text),f=D(()=>!!u.value.paragraph),h=new WeakMap;function p(y){const g=t.fade===!1&&!d.value,v=!f.value,b=h.get(y);if(b?.children===y.children&&b.textFastPath===g&&b.paragraphFastPath===v)return b.info;const A=Dm(y.children,v,!0),I={simpleChildren:A,plainText:A&&g?Va(A):null};return h.set(y,{children:y.children,textFastPath:g,paragraphFastPath:v,info:I}),I}function m(y){if(!r)return;y.preventDefault();const g=r.startWidth+r.nextStartWidth,v=Math.min(48,Math.floor(g/2)),b=Math.max(v,Math.min(g-v,Math.round(r.startWidth+y.clientX-r.startX))),A=[...r.widths];A[r.index]=b,A[r.index+1]=g-b,i.value=A}function k(){r&&(window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),r=null)}return et(l,()=>{k(),i.value=[]}),ho(k),(y,g)=>(x(),E("div",Vne,[w("table",{ref_key:"tableRef",ref:s,class:Ue(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(x(),E("colgroup",Gne,[(x(!0),E(We,null,rt(e.node.header.cells,(v,b)=>(x(),E("col",{key:b,style:on(c.value[b])},null,4))),128))])):ue("",!0),w("thead",null,[w("tr",null,[(x(!0),E(We,null,rt(e.node.header.cells,(v,b)=>(x(),E("th",{key:b,dir:"auto",class:Ue([v.align==="right"?"text-right":v.align==="center"?"text-center":"text-left"])},[p(v).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(p(v).plainText),9,Yne)):p(v).simpleChildren?(x(),Se(C(_f),{key:1,nodes:p(v).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${b}`},null,8,["nodes","custom-id","index-key"])):(x(),Se(C(zs),{key:2,nodes:v.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[0]||(g[0]=A=>y.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),b<e.node.header.cells.length-1?(x(),E("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${b+1} and ${b+2}`,onPointerdown:A=>(function(I,T){if(T.button!==0)return;const M=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],R=>Math.round(R.getBoundingClientRect().width))})(),$=M[I],N=M[I+1];$&&N&&(T.preventDefault(),r={index:I,startX:T.clientX,startWidth:$,nextStartWidth:N,widths:M},i.value=M,window.addEventListener("pointermove",m),window.addEventListener("pointerup",k),window.addEventListener("pointercancel",k))})(b,A)},null,40,Zne)):ue("",!0)],2))),128))])]),w("tbody",null,[(x(!0),E(We,null,rt(o.value,(v,b)=>(x(),E("tr",{key:b},[(x(!0),E(We,null,rt(v.cells,(A,I)=>(x(),E("td",{key:I,class:Ue([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(x(),E("span",{key:0,class:"text-node","custom-id":t.customId},B(p(A).plainText),9,Xne)):p(A).simpleChildren?(x(),Se(C(_f),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${b}-${I}`},null,8,["nodes","custom-id","index-key"])):(x(),Se(C(zs),{key:2,nodes:A.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:g[1]||(g[1]=T=>y.$emit("copy",T))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Kne),ae(Ua,{name:"table-node-fade"},{default:Ie(()=>[n.value?(x(),E("div",Qne,[jn(y.$slots,"loading",{isLoading:n.value},()=>[g[2]||(g[2]=w("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),g[3]||(g[3]=w("span",{class:"sr-only"},"Loading",-1))],!0)])):ue("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Yd.install=e=>{e.component(Yd.__name,Yd)};const Jne={class:"hr-node"},Rp=An({},[["render",function(e,t){return x(),E("hr",Jne)}],["__scopeId","data-v-39b2349c"]]);Rp.install=e=>{e.component(Rp.__name,Rp)};const eoe={class:"unknown-node"},Ky=Je({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(x(),E("div",eoe,B(e.node.raw),1))}),Dp=An(Je({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),o=No(()=>t.customId),s=D(()=>it({text:mo,paragraph:Ha,heading:Y1,inline_code:as,link:_s,image:Fl,strong:xs,emphasis:Ss,strikethrough:ws,insert:Ws,subscript:Hs,superscript:Ps,checkbox:ni,checkbox_input:ni,hardbreak:Ol,math_inline:Gi,reference:bs,list:du,math_block:sE,table:Yd},o.value));return(i,r)=>(x(),E("div",_n({class:n.value},e.node.attrs),[(x(!0),E(We,null,rt(e.node.children,(l,a)=>{return x(),Se(Ho((c=l.type,s.value[c]||Ky)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Dp.install=e=>{e.component(Dp.__name,Dp)};const toe=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],g4=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function noe(e){if(e<=255)return toe[e];let t=0,n=g4.length-1;for(;t<=n;){const o=t+n>>1,s=g4[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const ooe=/[ \t\n\r\f]+/g,soe=/[\t\n\r\f]| {2,}|^ | $/;let rv=null;const ioe=new RegExp("\\p{Script=Arabic}","u"),ql=new RegExp("\\p{M}","u"),P2=new RegExp("\\p{Nd}","u");function v4(e){return ioe.test(e)}function y4(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function dr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){if(y4(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(y4(n))return!0}}return!1}const roe=new Set([" "," ","⁠","\uFEFF"]),loe=new Set(["-","‐","–","—"]);function iE(e,t){return!((function(n){const o=Zd(n);return o!==null&&roe.has(o)})(e)||t&&((function(n){const o=Zd(n);return o!==null&&(H2.has(o)||Ka.has(o))})(e)||(function(n){const o=Zd(n);return o!==null&&loe.has(o)})(e)))}const H2=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Z1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),W2=new Set(["'","’"]),Ka=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),aoe=new Set([":",".","،","؛"]),coe=new Set(["၏"]),uoe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function doe(e){if(z2(e))return!0;let t=!1;for(const n of e)if(Ka.has(n)||Hm(n))t=!0;else if(!t||!ql.test(n))return!1;return t}function foe(e){for(const t of e)if(!H2.has(t)&&!Ka.has(t))return!1;return e.length>0}function hoe(e){if(z2(e))return!0;for(const t of e)if(!(Z1.has(t)||W2.has(t)||ql.test(t)||Hm(t)))return!1;return e.length>0}function z2(e){let t=!1;for(const n of e)if(n!=="\\"&&!ql.test(n)){if(!(Z1.has(n)||Ka.has(n)||W2.has(n)))return!1;t=!0}return t}function Pm(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function Zd(e){if(e.length===0)return null;const t=Pm(e,e.length);return e.slice(t)}const poe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Hm(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,o){for(let s=0;s<o.length;s+=2)if(n>=o[s]&&n<=o[s+1])return!0;return!1})(t,poe)}function moe(e){const t=(function(n){for(const o of n)if(!ql.test(o))return o;return null})(e);return t!==null&&P2.test(t)}function goe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(ql.test(o))n--;else{if(!Z1.has(o)&&!W2.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function voe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function k4(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function b4(e,t){return e&&t!==null&&aoe.has(t)}function yoe(e){const t=Zd(e);return t!==null&&coe.has(t)}function koe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function Gy(e){let t=e.length;for(;t>0;){const n=Pm(e,t),o=e.slice(n,t);if(uoe.has(o))return!0;if(!Ka.has(o))return!1;t=n}return!1}function boe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
285
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const xoe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ri(e){return e.length===1?e[0]:e.join("")}function woe(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Ri(n)}function _oe(e,t,n,o){if(!xoe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=boe(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:Ri(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&s.push({text:Ri(r),isWordLike:a,kind:i,start:l}),s}function lv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Soe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Coe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Soe.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Aoe(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const Moe=new Set([":","-","/","×",",",".","+","–","—"]),Eoe=/[\p{P}\p{S}\p{Co}]/u,Toe=new RegExp("\\p{Emoji_Presentation}","u"),Noe=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function rE(e){const t=e.charCodeAt(0);return t<128?(function(n){return n>=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Noe.has(e)&&!Toe.test(e)&&Eoe.test(e)}function x4(e){let t=!1;for(const n of e)if(!ql.test(n)){if(!rE(n))return!1;t=!0}return t}function Ioe(e,t,n,o){const s=!t&&x4(e),i=!o&&x4(n),r=(function(a){const c=(function(u){for(let d=u.length;d>0;){const f=Pm(u,d),h=u.slice(f,d);if(!ql.test(h))return h;d=f}return null})(a);return c!==null&&Hm(c)})(e),l=(t||r)&&(function(a){for(let c=a.length;c>0;){const u=Pm(a,c),d=a.slice(u,c);if(!ql.test(d))return rE(d)||Hm(d);c=u}return!1})(e);return!!(s||i||l)&&!dr(e)&&!dr(n)&&(t||s||r)&&(o||i)}function w4(e){for(const t of e)if(P2.test(t))return!0;return!1}function Pp(e){if(e.length===0)return!1;for(const t of e)if(!P2.test(t)&&!Moe.has(t))return!1;return!0}function Loe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function $oe(e,t,n="normal",o="normal"){const s=(function(a){const c=a??"normal";return c==="pre-wrap"?{mode:c,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:c,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(n),i=s.mode==="pre-wrap"?(function(a){return/[\r\f]/.test(a)?a.replace(/\r\n/g,`
286
+ `).replace(/[\r\f]/g,`
287
+ `):a})(e):(function(a){if(!soe.test(a))return a;let c=a.replace(ooe," ");return c.charCodeAt(0)===32&&(c=c.slice(1)),c.length>0&&c.charCodeAt(c.length-1)===32&&(c=c.slice(0,-1)),c})(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,c,u){var d,f,h;const p=(rv===null&&(rv=new Intl.Segmenter(void 0,{granularity:"word"})),rv);let m=0;const k=[],y=[],g=[],v=[],b=[],A=[],I=[],T=[],M=[],$=[],N=[],F=[];for(const L of p.segment(a))for(const O of _oe(L.segment,(d=L.isWordLike)!=null&&d,L.index,u)){let U=function(){A[K]!==null&&(y[K]=[k4(k,A,I,K)],A[K]=null),y[K].push(O.text),g[K]=g[K]||O.isWordLike,T[K]=T[K]||q,M[K]=M[K]||ee,$[K]=ne,N[K]=j,F[K]=b4(M[K],fe)};const Z=O.kind==="text",ie=voe(O.text,O.isWordLike,O.kind),q=dr(O.text),ee=v4(O.text),fe=Zd(O.text),ne=Gy(O.text),j=yoe(O.text),K=m-1;c.carryCJKAfterClosingQuote&&Z&&m>0&&v[K]==="text"&&q&&T[K]&&$[K]||Z&&m>0&&v[K]==="text"&&foe(O.text)&&T[K]||Z&&m>0&&v[K]==="text"&&N[K]?U():Z&&m>0&&v[K]==="text"&&O.isWordLike&&ee&&F[K]?(U(),g[K]=!0):ie!==null&&m>0&&v[K]==="text"&&A[K]===ie?I[K]=((f=I[K])!=null?f:1)+1:Z&&!O.isWordLike&&m>0&&v[K]==="text"&&!T[K]&&(doe(O.text)||O.text==="-"&&g[K])?U():(k[m]=O.text,y[m]=[O.text],g[m]=O.isWordLike,v[m]=O.kind,b[m]=O.start,A[m]=ie,I[m]=ie===null?0:1,T[m]=q,M[m]=ee,$[m]=ne,N[m]=j,F[m]=b4(ee,fe),m++)}for(let L=0;L<m;L++)A[L]===null?k[L]=Ri(y[L]):k[L]=k4(k,A,I,L);for(let L=1;L<m;L++)v[L]!=="text"||g[L]||!z2(k[L])||v[L-1]!=="text"||T[L-1]||(k[L-1]+=k[L],g[L-1]=g[L-1]||g[L],k[L]="");const S=Array.from({length:m},()=>null);let R=-1;for(let L=m-1;L>=0;L--){const O=k[L];if(O.length!==0){if(v[L]==="text"&&!g[L]&&R>=0&&v[R]==="text"&&(hoe(O)||O==="-"&&moe(k[R]))){const U=(h=S[R])!=null?h:[];U.push(O),S[R]=U,b[R]=b[L],k[L]="";continue}R=L}}for(let L=0;L<m;L++){const O=S[L];O!=null&&(k[L]=woe(O,k[L]))}let z=0;for(let L=0;L<m;L++){const O=k[L];O.length!==0&&(z!==L&&(k[z]=O,g[z]=g[L],v[z]=v[L],b[z]=b[L]),z++)}k.length=z,g.length=z,v.length=z,b.length=z;const W=(function(L){const O=L.texts.slice(),U=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let q=0;q<O.length-1;q++){if(Z[q]!=="text"||Z[q+1]!=="text"||!dr(O[q])||!dr(O[q+1]))continue;const ee=goe(O[q]);ee!==null&&(O[q]=ee.head,O[q+1]=ee.tail+O[q+1],ie[q+1]=ie[q]+ee.head.length)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];let q=0;for(;q<L.len;){const ee=L.texts[q],fe=L.kinds[q],ne=L.isWordLike[q];if(fe==="text"){const j=[ee];let K=q+1,ve=ne;for(;K<L.len&&L.kinds[K]==="text"&&Ioe(L.texts[K-1],L.isWordLike[K-1],L.texts[K],L.isWordLike[K]);){const he=L.texts[K];j.push(he),ve=ve||L.isWordLike[K],K++}if(K>q+1){O.push(Ri(j)),U.push(ve),Z.push("text"),ie.push(L.starts[q]),q=K;continue}}O.push(ee),U.push(ne),Z.push(fe),ie.push(L.starts[q]),q++}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q];if(L.kinds[q]==="text"&&ee.includes("-")){const fe=ee.split("-");let ne=fe.length>1;for(let j=0;j<fe.length;j++){const K=fe[j];if(!ne)break;K.length!==0&&w4(K)&&Pp(K)||(ne=!1)}if(ne){let j=0;for(let K=0;K<fe.length;K++){const ve=fe[K],he=K<fe.length-1?`${ve}-`:ve;O.push(he),U.push(!0),Z.push("text"),ie.push(L.starts[q]+j),j+=he.length}continue}}O.push(ee),U.push(L.isWordLike[q]),Z.push(L.kinds[q]),ie.push(L.starts[q])}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q],fe=L.kinds[q];if(fe==="text"&&Pp(ee)&&w4(ee)){const ne=[ee];let j=q+1;for(;j<L.len&&L.kinds[j]==="text"&&Pp(L.texts[j]);)ne.push(L.texts[j]),j++;O.push(Ri(ne)),U.push(!0),Z.push("text"),ie.push(L.starts[q]),q=j-1;continue}O.push(ee),U.push(L.isWordLike[q]),Z.push(fe),ie.push(L.starts[q])}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];for(let q=0;q<L.len;q++){const ee=L.texts[q];if(O.push(ee),U.push(L.isWordLike[q]),Z.push(L.kinds[q]),ie.push(L.starts[q]),!Aoe(ee))continue;const fe=q+1;if(fe>=L.len||lv(L.kinds[fe]))continue;const ne=[],j=L.starts[fe];let K=fe;for(;K<L.len&&!lv(L.kinds[K]);)ne.push(L.texts[K]),K++;ne.length>0&&(O.push(Ri(ne)),U.push(!0),Z.push("text"),ie.push(j),q=K-1)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=L.texts.slice(),U=L.isWordLike.slice(),Z=L.kinds.slice(),ie=L.starts.slice();for(let ee=0;ee<L.len;ee++){if(Z[ee]!=="text"||!Coe(L,ee))continue;const fe=[O[ee]];let ne=ee+1;for(;ne<L.len&&!lv(Z[ne]);){fe.push(O[ne]),U[ee]=!0;const j=O[ne].includes("?");if(Z[ne]="text",O[ne]="",ne++,j)break}O[ee]=Ri(fe)}let q=0;for(let ee=0;ee<O.length;ee++){const fe=O[ee];fe.length!==0&&(q!==ee&&(O[q]=fe,U[q]=U[ee],Z[q]=Z[ee],ie[q]=ie[ee]),q++)}return O.length=q,U.length=q,Z.length=q,ie.length=q,{len:q,texts:O,isWordLike:U,kinds:Z,starts:ie}})((function(L){const O=[],U=[],Z=[],ie=[];let q=0;for(;q<L.len;){const ee=[L.texts[q]];let fe=L.isWordLike[q],ne=L.kinds[q],j=L.starts[q];if(ne==="glue"){const K=[ee[0]],ve=j;for(q++;q<L.len&&L.kinds[q]==="glue";)K.push(L.texts[q]),q++;const he=Ri(K);if(!(q<L.len&&L.kinds[q]==="text")){O.push(he),U.push(!1),Z.push("glue"),ie.push(ve);continue}ee[0]=he,ee.push(L.texts[q]),fe=L.isWordLike[q],ne="text",j=ve,q++}else q++;if(ne==="text")for(;q<L.len&&L.kinds[q]==="glue";){const K=[];for(;q<L.len&&L.kinds[q]==="glue";)K.push(L.texts[q]),q++;const ve=Ri(K);q<L.len&&L.kinds[q]==="text"?(ee.push(ve,L.texts[q]),fe=fe||L.isWordLike[q],q++):ee.push(ve)}O.push(Ri(ee)),U.push(fe),Z.push(ne),ie.push(j)}return{len:O.length,texts:O,isWordLike:U,kinds:Z,starts:ie}})({len:z,texts:k,isWordLike:g,kinds:v,starts:b})))))));for(let L=0;L<W.len-1;L++){const O=koe(W.texts[L]);O!==null&&(W.kinds[L]!=="space"&&W.kinds[L]!=="preserved-space"||W.kinds[L+1]!=="text"||!v4(W.texts[L+1])||(W.texts[L]=O.space,W.isWordLike[L]=!1,W.kinds[L]=W.kinds[L]==="preserved-space"?"preserved-space":"space",W.texts[L+1]=O.marks+W.texts[L+1],W.starts[L+1]=W.starts[L]+O.space.length))}return W})(i,t,s),l=o==="keep-all"?(function(a,c,u){if(c.len<=1)return c;const d=[],f=[],h=[],p=[];let m=-1,k=!1;function y(v){d.push(c.texts[v]),f.push(c.isWordLike[v]),h.push("text"),p.push(c.starts[v])}function g(v){if(!(m<0)){if(k)m+1===v?y(m):(function(b,A){let I=!1;for(let $=b;$<A;$++)I=I||c.isWordLike[$];const T=c.starts[b],M=A<c.len?c.starts[A]:a.length;d.push(a.slice(T,M)),f.push(I),h.push("text"),p.push(T)})(m,v);else for(let b=m;b<v;b++)y(b);m=-1,k=!1}}for(let v=0;v<c.len;v++){const b=c.texts[v],A=c.kinds[v];A!=="text"?(g(v),d.push(b),f.push(c.isWordLike[v]),h.push(A),p.push(c.starts[v])):(m>=0&&!iE(c.texts[v-1],u)&&g(v),m<0&&(m=v),k=k||dr(b))}return g(c.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:p}})(i,r,t.breakKeepAllAfterPunctuation):r;return it({normalized:i,chunks:Loe(l,s)},l)}let Ac=null;const _4=new Map;let Mc=null;const Foe=new RegExp("\\p{Emoji_Presentation}","u"),Ooe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let av=null;const S4=new Map;function Yy(){if(Ac!==null)return Ac;if(typeof OffscreenCanvas<"u")return Ac=new OffscreenCanvas(1,1).getContext("2d"),Ac;if(typeof document<"u")return Ac=document.createElement("canvas").getContext("2d"),Ac;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function hl(e,t){let n=t.get(e);return n===void 0&&(n={width:Yy().measureText(e).width,containsCJK:dr(e)},t.set(e,n)),n}function Wm(){if(Mc!==null)return Mc;if(typeof navigator>"u")return Mc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Mc;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Mc={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Mc}function lE(){return av===null&&(av=new Intl.Segmenter(void 0,{granularity:"grapheme"})),av}function Boe(e){return Foe.test(e)||e.includes("️")}function pa(e,t,n){return n===0?t.width:t.width-(function(o,s){return s.emojiCount===void 0&&(s.emojiCount=(function(i){let r=0;const l=lE();for(const a of l.segment(i))Boe(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function Roe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function C4(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function A4(e,t,n=e.widths.length){for(;t<n&&Roe(e.kinds[t]);)t++;return t}function Doe(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Poe(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function U2(e,t){return t===0?0:e+t}function Hoe(e,t,n,o,s){return U2(o,t==="tab"?s+(function(i,r){return i.letterSpacing!==0&&i.spacingGraphemeCounts[r]>0?i.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function M4(e,t,n,o){return U2(o,t==="tab"?0:e.lineEndFitAdvances[n])}function E4(e,t,n,o,s){return U2(o,t==="tab"?s:e.lineEndPaintAdvances[n])}function Woe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function zoe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function ep(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Uoe(e,t){return(function(n,o){if(n.simpleLineWalkFastPath)return(function(S,R){const{widths:z,kinds:W,breakableFitAdvances:L,breakablePreferredBreaks:O}=S;if(z.length===0)return 0;const U=R+Wm().lineFitEpsilon;let Z=0,ie=0,q=!1,ee=0,fe=0,ne=-1,j=0;function K(Q=ee,P=fe,G=ie){Z++,ie=0,q=!1,ne=-1,j=0}function ve(Q,P){q=!0,ee=Q+1,fe=0,ie=P}function he(Q,P,G){q=!0,ee=Q,fe=P+1,ie=G}function Ae(Q,P){q?(ie+=P,ee=Q+1,fe=0):ve(Q,P)}function re(Q,P){var G;const me=L[Q],ye=(G=O[Q])!=null?G:null;let de=ye===null?-1:ep(ye,0,P+1),V=-1,se=0,pe=P;for(;pe<me.length;){const ke=me[pe];if(q)if(ie+ke>U){if(ye!==null&&V>P){K(Q,V,se),pe=V,de=ep(ye,de,pe+1),V=-1,se=0;continue}K(),he(Q,pe,ke)}else ie+=ke,ee=Q,fe=pe+1;else he(Q,pe,ke);const Ne=pe+1;ye!==null&&ye[de]===Ne&&(V=Ne,se=ie,de++),pe++}q&&ee===Q&&fe===me.length&&(ee=Q+1,fe=0)}let Y=0;for(;Y<z.length&&(q||(Y=A4(S,Y),!(Y>=z.length)));){const Q=z[Y],P=C4(W[Y]);if(q)if(ie+Q>U){if(P){Ae(Y,Q),K(Y+1,0,ie-Q),Y++;continue}if(ne>=0){if(ee>ne||ee===ne&&fe>0){K();continue}K(ne,0,j);continue}if(Q>U&&L[Y]!==null){K(),re(Y,0),Y++;continue}K()}else Ae(Y,Q),P&&(ne=Y+1,j=ie-Q),Y++;else Q>U&&L[Y]!==null?re(Y,0):ve(Y,Q),P&&(ne=Y+1,j=ie-Q),Y++}return q&&K(),Z})(n,o);const{widths:s,kinds:i,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:c}=n;if(s.length===0||c.length===0)return 0;const u=Wm(),d=o+u.lineFitEpsilon;let f=0,h=0,p=!1,m=0,k=0,y=-1,g=0,v=null;function b(){y=-1,g=0,v=null}function A(S=m,R=k,z){f++,h=0,p=!1,b()}function I(S,R){p=!0,m=S+1,k=0,h=R}function T(S,R,z){p=!0,m=S,k=R+1,h=z}function M(S,R){p?(h+=R,m=S+1,k=0):I(S,R)}function $(S,R,z,W,L,O){if(!R)return;const U=M4(n,S,z,L);E4(n,S,z,L,W),y=z+1,g=h-O+U,v=S}function N(S,R){var z;const W=r[S],L=(z=l[S])!=null?z:null;let O=L===null?-1:ep(L,0,R+1),U=-1,Z=R;for(;Z<W.length;){const ie=W[Z];if(p){const ee=Woe(n,!0,ie),fe=h+ee;if(zoe(n,fe)>d){if(L!==null&&U>R){A(S,U),Z=U,O=ep(L,O,Z+1),U=-1;continue}A(),T(S,Z,ie)}else h=fe,m=S,k=Z+1}else T(S,Z,ie);const q=Z+1;L!==null&&L[O]===q&&(U=q,O++),Z++}p&&m===S&&k===W.length&&(m=S+1,k=0)}function F(S){f++,b()}for(let S=0;S<c.length;S++){const R=c[S];if(R.startSegmentIndex===R.endSegmentIndex){F();continue}p=!1,h=0,R.startSegmentIndex,m=R.startSegmentIndex,k=0,b();let z=R.startSegmentIndex;for(;z<R.endSegmentIndex&&(p||(z=A4(n,z,R.endSegmentIndex),!(z>=R.endSegmentIndex)));){const W=i[z],L=C4(W),O=Poe(n,p,z),U=W==="tab"?Doe(h+O,n.tabStopAdvance):s[z],Z=O+U,ie=Hoe(n,W,z,O,U);if(W!=="soft-hyphen")if(p){if(h+ie>d){const q=h+M4(n,W,z,O);if(E4(n,W,z,O,U),v==="soft-hyphen"&&u.preferEarlySoftHyphenBreak&&g<=d){A(y,0);continue}if(L&&q<=d){M(z,Z),A(z+1,0),z++;continue}if(y>=0&&g<=d){if(m>y||m===y&&k>0){A();continue}const ee=y;A(ee,0),z=ee;continue}if(ie>d&&r[z]!==null){A(),N(z,0),z++;continue}A();continue}M(z,Z),$(W,L,z,U,O,Z),z++}else ie>d&&r[z]!==null?N(z,0):I(z,U),$(W,L,z,U,O,Z),z++;else p&&(m=z+1,k=0,y=z+1,g=h+a,v=W),z++}p&&(R.consumedEndSegmentIndex,A(R.consumedEndSegmentIndex,0))}return f})(e,t)}let cv=null;function q2(){return cv===null&&(cv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),cv}function qoe(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=Gy(d),l=Z1.has(d)}function u(d,f){o.push(d),i=i||f;const h=Gy(d);r=d.length===1&&Ka.has(d)&&r||h,l=!1}for(const d of q2().segment(e)){const f=d.segment,h=dr(f);o.length!==0?l||H2.has(f)||Ka.has(f)||t.carryCJKAfterClosingQuote&&h&&r?u(f,h):i||h?(a(),c(f,d.index,h)):u(f,h):c(f,d.index,h)}return a(),n}function joe(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(l){if(!(s<0)){if(i)s+1===l?o.push(t[s]):(function(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})})(s,l);else for(let a=s;a<l;a++)o.push(t[a]);s=-1,i=!1}}for(let l=0;l<t.length;l++){const a=t[l];s>=0&&!iE(t[l-1].text,n)&&r(l),s<0&&(s=l),i=i||dr(a.text)}return r(t.length),o}function T4(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=q2();for(const s of o.segment(e))n++;return n}function Voe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Koe(e,t,n,o,s){const i=Wm(),{cache:r,emojiCorrection:l}=(function(F,S){Yy().font=F;const R=(function(L){let O=_4.get(L);return O||(O=new Map,_4.set(L,O)),O})(F),z=(function(L){const O=L.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(F),W=S?(function(L,O){let U=S4.get(L);if(U!==void 0)return U;const Z=Yy();Z.font=L;const ie=Z.measureText("😀").width;if(U=0,ie>O+.5&&typeof document<"u"&&document.body!==null){const q=document.createElement("span");q.style.font=L,q.style.display="inline-block",q.style.visibility="hidden",q.style.position="absolute",q.textContent="😀",document.body.appendChild(q);const ee=q.getBoundingClientRect().width;document.body.removeChild(q),ie-ee>.5&&(U=ie-ee)}return S4.set(L,U),U})(F,z):0;return{cache:R,fontSize:z,emojiCorrection:W}})(t,(a=e.normalized,Ooe.test(a)));var a;const c=pa("-",hl("-",r),l)+(s===0?0:2*s),u=8*pa(" ",hl(" ",r),l),d=s!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],p=[],m=[];let k=e.chunks.length<=1&&!d;const y=null,g=[],v=[],b=[],A=null,I=Array.from({length:e.len});function T(F,S,R,z,W,L,O,U,Z){W!=="text"&&W!=="space"&&W!=="zero-width-break"&&(k=!1),f.push(S),h.push(R),p.push(z),m.push(W),g.push(O),v.push(U),d&&b.push(Z)}function M(F,S,R,z,W){const L=hl(F,r),O=d?T4(F,S):0,U=(function(ee,fe,ne){return fe>1?ee+(fe-1)*ne:ee})(pa(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,ie=Z===0?0:Z+(O>0?s:0),q=S==="space"||S==="zero-width-break"?0:U;if(W&&z&&F.length>1){let ee="sum-graphemes";s!==0?ee="segment-prefixes":Pp(F)?ee="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ee="segment-prefixes");const fe=(function(j,K,ve,he,Ae){if(K.breakableFitAdvances!==void 0&&K.breakableFitMode===Ae)return K.breakableFitAdvances;K.breakableFitMode=Ae;const re=lE(),Y=[];for(const me of re.segment(j))Y.push(me.segment);if(Y.length<=1)return K.breakableFitAdvances=null,K.breakableFitAdvances;if(Ae==="sum-graphemes"){const me=[];for(const ye of Y){const de=hl(ye,ve);me.push(pa(ye,de,he))}return K.breakableFitAdvances=me,K.breakableFitAdvances}if(Ae==="pair-context"||Y.length>96){const me=[];let ye=null,de=0;for(const V of Y){const se=pa(V,hl(V,ve),he);if(ye===null)me.push(se);else{const pe=ye+V,ke=hl(pe,ve);me.push(pa(pe,ke,he)-de)}ye=V,de=se}return K.breakableFitAdvances=me,K.breakableFitAdvances}const Q=[];let P="",G=0;for(const me of Y){P+=me;const ye=pa(P,hl(P,ve),he);Q.push(ye-G),G=ye}return K.breakableFitAdvances=Q,K.breakableFitAdvances})(F,L,r,l,ee),ne=fe===null||o==="keep-all"?null:(function(j){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(j))return null;const K=[];let ve=0;for(const he of q2().segment(j))ve++,Voe(he.segment)&&K.push(ve);return K.length===0?null:K})(F);return void T(F,U,ie,q,S,R,fe,ne,O)}T(F,U,ie,q,S,R,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],R=e.isWordLike[F],z=e.kinds[F],W=e.starts[F];if(z==="soft-hyphen"){T(S,0,c,c,z,W,null,null,0);continue}if(z==="hard-break"){T(S,0,0,0,z,W,null,null,0);continue}if(z==="tab"){T(S,0,0,0,z,W,null,null,d?T4(S,z):0);continue}const L=hl(S,r);if(z==="text"&&L.containsCJK){const O=qoe(S,i),U=o==="keep-all"?joe(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<U.length;Z++){const ie=U[Z];M(ie.text,"text",W+ie.start,R,o==="keep-all"||!dr(ie.text))}continue}M(S,z,W,R,!0)}const $=(function(F,S,R){const z=[];for(let W=0;W<F.length;W++){const L=F[W],O=L.startSegmentIndex<S.length?S[L.startSegmentIndex]:R,U=L.endSegmentIndex<S.length?S[L.endSegmentIndex]:R,Z=L.consumedEndSegmentIndex<S.length?S[L.consumedEndSegmentIndex]:R;z.push({startSegmentIndex:O,endSegmentIndex:U,consumedEndSegmentIndex:Z})}return z})(e.chunks,I,f.length),N=y===null?null:(function(F,S){const R=(function(W){const L=W.length;if(L===0)return null;const O=new Array(L);let U=!1;for(let ne=0;ne<L;){const j=W.charCodeAt(ne);let K=j,ve=1;if(j>=55296&&j<=56319&&ne+1<L){const Ae=W.charCodeAt(ne+1);Ae>=56320&&Ae<=57343&&(K=Ae-56320+(j-55296<<10)+65536,ve=2)}const he=noe(K);he!=="R"&&he!=="AL"&&he!=="AN"||(U=!0);for(let Ae=0;Ae<ve;Ae++)O[ne+Ae]=he;ne+=ve}if(!U)return null;let Z=0;for(let ne=0;ne<L;ne++){const j=O[ne];if(j==="L"){Z=0;break}if(j==="R"||j==="AL"){Z=1;break}}const ie=new Int8Array(L);for(let ne=0;ne<L;ne++)ie[ne]=Z;const q=1&Z?"R":"L",ee=q;let fe=ee;for(let ne=0;ne<L;ne++)O[ne]==="NSM"?O[ne]=fe:fe=O[ne];fe=ee;for(let ne=0;ne<L;ne++){const j=O[ne];j==="EN"?O[ne]=fe==="AL"?"AN":"EN":j!=="R"&&j!=="L"&&j!=="AL"||(fe=j)}for(let ne=0;ne<L;ne++)O[ne]==="AL"&&(O[ne]="R");for(let ne=1;ne<L-1;ne++)O[ne]==="ES"&&O[ne-1]==="EN"&&O[ne+1]==="EN"&&(O[ne]="EN"),O[ne]!=="CS"||O[ne-1]!=="EN"&&O[ne-1]!=="AN"||O[ne+1]!==O[ne-1]||(O[ne]=O[ne-1]);for(let ne=0;ne<L;ne++){if(O[ne]!=="EN")continue;let j;for(j=ne-1;j>=0&&O[j]==="ET";j--)O[j]="EN";for(j=ne+1;j<L&&O[j]==="ET";j++)O[j]="EN"}for(let ne=0;ne<L;ne++){const j=O[ne];j!=="WS"&&j!=="ES"&&j!=="ET"&&j!=="CS"||(O[ne]="ON")}fe=ee;for(let ne=0;ne<L;ne++){const j=O[ne];j==="EN"?O[ne]=fe==="L"?"L":"EN":j!=="R"&&j!=="L"||(fe=j)}for(let ne=0;ne<L;ne++){if(O[ne]!=="ON")continue;let j=ne+1;for(;j<L&&O[j]==="ON";)j++;const K=(ne>0?O[ne-1]:ee)!=="L"?"R":"L";if(K===((j<L?O[j]:ee)!=="L"?"R":"L"))for(let ve=ne;ve<j;ve++)O[ve]=K;ne=j-1}for(let ne=0;ne<L;ne++)O[ne]==="ON"&&(O[ne]=q);for(let ne=0;ne<L;ne++){const j=O[ne];1&ie[ne]?j!=="L"&&j!=="AN"&&j!=="EN"||ie[ne]++:j==="R"?ie[ne]++:j!=="AN"&&j!=="EN"||(ie[ne]+=2)}return ie})(F);if(R===null)return null;const z=new Int8Array(S.length);for(let W=0;W<S.length;W++)z[W]=R[S[W]];return z})(e.normalized,y);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:k,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:k,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:c,tabStopAdvance:u,chunks:$}}const uv="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Goe=["diff ","index ","--- ","+++ ","@@ "],Lo=(()=>{const e=globalThis;if(e[uv])return e[uv];const t={configs:{},controllers:{},revision:gr(0),preparedCache:new Map,blockEstimateCache:new Map};return e[uv]=t,t})();let ud=null;const dv=Lo.revision;function N4(e){var t;return e&&(t=Lo.configs[e])!=null?t:null}function I4(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Yoe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function fv(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!Yoe(i))return null;i.type==="text"?s+=String((t=i.content)!=null?t:""):i.type==="emoji"?s+=String((o=(n=i.name)!=null?n:i.raw)!=null?o:""):i.type==="hardbreak"&&(s+=`
288
+ `)}return s.length>0?s:null}function hv(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(ud!=null)return ud;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return ud=!!((i=r.getContext)!=null&&i.call(r,"2d")),ud}catch{return ud=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(o=n.whiteSpace)!=null?o:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=Lo.blockEstimateCache.get(r);if(l)return Lo.blockEstimateCache.delete(r),Lo.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(s=n.whiteSpace)!=null?s:"pre-wrap",c=(function(h,p,m){const k=`${m}\0${p}\0${h}`,y=Lo.preparedCache.get(k);if(y)return Lo.preparedCache.delete(k),Lo.preparedCache.set(k,y),y.prepared;const g=(function(v,b,A){return(function(I,T,M,$){var N,F;const S=(N=$?.wordBreak)!=null?N:"normal",R=(F=$?.letterSpacing)!=null?F:0;return Koe($oe(I,Wm(),$?.whiteSpace,S),T,!1,S,R)})(v,b,0,A)})(h,p,{whiteSpace:m});for(Lo.preparedCache.set(k,{prepared:g});Lo.preparedCache.size>240;){const v=Lo.preparedCache.keys().next().value;if(!v)break;Lo.preparedCache.delete(v)}return g})(e,n.font,a),u=(function(h,p,m){const k=Uoe(h,p);return{lineCount:k,height:k*m}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Lo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Lo.blockEstimateCache.size>4e3;){const h=Lo.blockEstimateCache.keys().next().value;if(!h)break;Lo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function aE(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=fv(e.children);return i&&n.paragraph?hv(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=fv(e.children),l=n.headings[i];return r&&l?hv(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((o=i[0])==null?void 0:o.type)!=="paragraph"||!n.listItem)return null;const r=fv((s=i[0])==null?void 0:s.children);return r?hv(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=aE(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function dd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function ma(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function pv(e,t,n=0){return e.diff?D2(t??{},n)?(function(o){const s=ma(o.raw);if(s){const i=s.split(/\r?\n/);return o.originalCode!=null||o.updatedCode!=null?Math.max(1,i.filter(r=>!Goe.some(l=>r.startsWith(l))).length):Math.max(1,i.length)}return dd(ma(o.originalCode))+dd(ma(o.updatedCode))})(e):(function(o){const s=o.originalCode,i=o.updatedCode;if(s!=null||i!=null)return Math.max(dd(ma(s)),dd(ma(i)));const r=ma(o.code).split(/\r?\n/);let l=0,a=0;for(const c of r)c.startsWith("+")&&!c.startsWith("+++")?a++:c.startsWith("-")&&!c.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):dd(ma(e.code,e.loading===!0))}function Zoe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function mv(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=I4(o.lineHeight,1.5*I4(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Zoe(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const Xoe=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function L4(e,t={}){var n;const o={},s=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return o;const i=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(i))Xoe.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}function $4(e,t,n,o){var s;const i=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,i);if(!o.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=o.getNormalizedScrollTop(e,t,!1),p=Math.abs(h-r);p<u&&(u=p,c=f)}e.scrollTop=c;const d=(s=o.epsilonPx)!=null?s:2;Math.abs(o.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}function F4(e,t){let n=0,o=null,s=null;const i=()=>{const r=s;s=null,o=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);s=r,a<=0?(o&&(clearTimeout(o),o=null),n=l,s=null,e(...r)):o||(o=setTimeout(i,a))}}function O4(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const cE=Symbol("MarkstreamMathBlockMinHeightCache");function t3e(){return Jt(cE,null)}const Qoe=new Set(["text","inline_code","emoji","footnote_reference"]),Joe=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function fd(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function ga(e,t,n,o=22){const s=String(e??"");if(!s)return n;const i=Math.max(18,Math.floor(Math.max(320,t)/8)),r=s.split(/\r?\n/).length,l=Math.ceil(s.length/i),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*o+12))}function uE(e){var t;if(!e||typeof e!="object")return!1;const n=e,o=String((t=n.type)!=null?t:"");if(Qoe.has(o))return!0;if(!Joe.has(o))return!1;const s=n.children;return!Array.isArray(s)||!s.length||s.every(uE)}function Zy(e){var t,n,o,s,i,r,l,a;if(!e||typeof e!="object")return"";const c=e,u=String((t=c.type)!=null?t:"");if(u==="text")return String((o=(n=c.content)!=null?n:c.raw)!=null?o:"");if(u==="inline_code")return String((r=(i=(s=c.code)!=null?s:c.content)!=null?i:c.raw)!=null?r:"");if(u==="emoji")return String((a=(l=c.name)!=null?l:c.raw)!=null?a:"");if(typeof c.text=="string")return c.text;const d=[];for(const f of["children","items","cells","rows"]){const h=c[f];if(Array.isArray(h)){const p=h.map(Zy).filter(Boolean).join(" ");p&&d.push(p)}}return d.join(" ").replace(/\s+/g," ").trim()}function dE(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const o=t[n];return Array.isArray(o)&&o.some(dE)})}function ese(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),o=e.split(/\r?\n/).length,s=Math.ceil(e.length/n),i=Math.max(1,o,s);return 30+26*Math.max(0,i-1)}function tse(e,t){var n,o,s,i,r,l,a,c,u,d,f,h,p,m;if(!e||typeof e!="object")return 32;const k=e,y=String((n=k.type)!=null?n:""),g=Number.isFinite(t)&&t>0?t:640;switch(y){case"heading":return(function(v){var b;const A=Number((b=v.level)!=null?b:v.depth);return A>=4?20:A===3?30:A===2?32:44})(k);case"paragraph":return(function(v,b){const A=String(v??"");if(!A)return 28;const I=Math.max(18,Math.floor(Math.max(320,b)/8)),T=A.split(/\r?\n/).length,M=Math.ceil(A.length/I);return Math.max(1,T,M)<=1?28:ga(A,b,34)})(String((s=(o=k.raw)!=null?o:k.content)!=null?s:""),g);case"list":return(function(v,b){var A;const I=Array.isArray(v.items)?v.items:[];if(!I.length)return 48;const T=Math.max(48,30*I.length+12);let M=12;for(const F of I)M+=ese(Zy(F)||String((A=F.raw)!=null?A:""),b);const $=Math.max(0,M-T);if(I.length>20){const F=Math.round(2.4*I.length);return Math.round(T+Math.max(F,Math.min($,3*I.length)))}if($<=0)return T;const N=I.length>8?8*I.length:$;return Math.round(T+Math.min($,N))})(k,g);case"list_item":return ga(String((r=(i=k.raw)!=null?i:k.content)!=null?r:""),g,34);case"blockquote":return ga(String((a=(l=k.raw)!=null?l:k.content)!=null?a:""),g,56);case"table":return(function(v,b){const A=[...v.header?[v.header]:[],...Array.isArray(v.rows)?v.rows:[]];if(!A.length){const I=Array.isArray(v.children)?v.children.length:3;return Math.max(120,38*I+48)}return Math.max(120,Math.round(4+A.reduce((I,T)=>I+(function(M,$){const N=Math.max(1,M.length),F=Math.max(80,($-32)/N),S=Math.max(10,Math.floor(F/8)),R=Math.max(1,...M.map(z=>{var W;const L=Zy(z)||String((W=z?.raw)!=null?W:"");return Math.ceil(L.length/S)||1}));return 54+34*Math.max(0,R-1)+(N<=3&&M.some(dE)?14:0)})((function(M){var $;return Array.isArray(M?.cells)&&($=M.cells)!=null?$:[]})(T),b),0)))})(k,g);case"code_block":{const v=String((c=k.language)!=null?c:"").trim().toLowerCase(),b=String((d=(u=k.code)!=null?u:k.raw)!=null?d:"");return v==="mermaid"?$m(Im(b)):v==="infographic"?Fm(Lm(b)):ga(b,g,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(v,b){var A,I,T;const M=v.match(/^\s*<details\b([^>]*)>/i);return M&&!/(?:^|\s)open(?:\s|=|$)/i.test((A=M[1])!=null?A:"")?ga(((T=(I=v.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i))==null?void 0:I[1])==null?void 0:T.replace(/<[^>]*>/g,"").trim())||"Details",b,28,28):ga(v,b,96)})(String((h=(f=k.raw)!=null?f:k.content)!=null?h:""),g);case"thematic_break":return 24;default:return ga(String((m=(p=k.raw)!=null?p:k.content)!=null?m:""),g,40)}}function B4(e,t,n){return Math.min(Math.max(e,t),n)}const nse=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],ose=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","parseMarkdownToStructureTotalMs"],sse=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),fE=["raw","content","code","originalCode","updatedCode"],R4=new WeakMap,D4=new WeakMap;let ise=1;function Oi(){return typeof performance<"u"?performance.now():Date.now()}function P4(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function Js(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=R4.get(t);return n||(n=ise++,R4.set(t,n)),String(n)}function H4(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:Js(t),customMarkdownIt:Js(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:Js(e.validateLink),preTransformTokens:Js(e.preTransformTokens),postTransformTokens:Js(e.postTransformTokens),postTransformNodes:Js(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function W4(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
289
+ `,t-1)+1;return e.slice(n,t).trim()}function z4(e){const t=hE(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function hE(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function pE(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function j2(e){const t=String(e??"");return`${t.length}:${pE(t)}`}function Xy(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?j2(r):`${r.length}:${pE(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${Js(e)}`;if(typeof e!="object")return typeof e;const o=e,s=t.get(o);if(s)return`cycle:${s}`;if(n>=6)return`object:${Js(o)}`;const i=Js(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Xy(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${Xy(r[c],t,n+1)}`).join(";")}`}return typeof e}function zm(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function mE(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>zm(o)?jl(o,t,n+1):mE(o,t,n+1)).join(",")}`:zm(e)?jl(e,t,n):Xy(e,t,n)}function rse(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!fE.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${j2(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${Js(s)}`:sse.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${mE(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${Js(s)}`:""}).filter(Boolean).join(";")}function lse(e){return fE.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${j2(n)}`:""}).filter(Boolean).join(";")}function jl(e,t=new WeakMap,n=0){const o=D4.get(e);if(o)return o;const s=e,i=t.get(s);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${Js(s)}`;const r=Js(s);t.set(s,r);const l=(function(a,c,u){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(p=>jl(p,c,u+1)).join("|"):"";return[a.type,lse(d),rse(d,c,u),f.length,h].join(":")})(e,t,n);return D4.set(s,l),l}function gE(e,t){return jl(e)===jl(t)}function V2(e,t,n){const o=Oi(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Oi()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function U4(e,t,n){return V2(t,n,()=>jl(e))}function vE(e,t,n){return U4(e,n,"stabilizeSignatureMs")===U4(t,n,"stabilizeSignatureMs")}function tp(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function q4(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function j4(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function ase(e,t){return e.length===t.length&&e===t}function K2(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const o=e,s=t,i=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const f=o[d],h=s[d];if(typeof f!=typeof h)return!1;if(typeof f!="string"){if(typeof f!="number"&&typeof f!="boolean"&&f!=null)return null;if(!Object.is(f,h))return!1}else if(typeof h!="string"||!ase(f,h))return!1}const l=Object.prototype.hasOwnProperty.call(o,"children");if(l!==Object.prototype.hasOwnProperty.call(s,"children"))return!1;if(!l)return!0;const a=o.children,c=s.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],f=c[u];if(!zm(d)||!zm(f))return null;const h=K2(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function cse(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=K2(e,t);return n??gE(e,t)}function use(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return V2(n,"stabilizeSignatureMs",()=>{o=K2(e,t)}),o??vE(e,t,n)}function dse(e,t){const n={};for(const o of nse){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function fse(e,t){var n;const o=zC(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=oe(t.renderContent.value);let l=[],a="",c="",u="",d=!1;const f=(function(){let z="",W=0,L=!1,O=!1,U=!1,Z=!1;function ie(){z="",W=0,L=!1,O=!1,U=!1,Z=!1}function q(ee){let fe=!1;for(let ne=0;ne<ee.length;ne++){const j=ee.charCodeAt(ne);if(j===10||j===13){const ve=j===10&&Z;Z=j===13,L=!1,ve||(U||(O=!1,W=0),U=!1);continue}Z=!1;const K=j===9||j===32;if(K||(U=!0,O&&(fe=!0)),W)if(W!==1)K||(j!==58?W=j===91?1:0:(fe=!0,O=!0));else{if(L){L=!1;continue}if(j===92){L=!0;continue}j===93&&(W=2)}else j===91&&(W=1)}return fe}return(ee,fe)=>{if(!ee||!fe.startsWith(ee)||fe.length<=ee.length)return ie(),[!0,0];let ne=0;z!==ee&&(ie(),q(ee),ne=ee.length);const j=fe.slice(ee.length),K=q(j);return z=fe,[K,ne+j.length]}})();let h,p=0,m=0,k=Oi(),y=-1,g=0;function v(z){y=Number.isInteger(z)?z:0,g+=1}function b(){h&&(clearTimeout(h),h=void 0)}function A(){b();const z=t.renderContent.value;r.value!==z&&(r.value=z),k=Oi()}et([t.renderContent,t.effectiveFinal,i],([z,W,L])=>{r.value!==z&&(!L||W||(function(O,U){if(!O&&U||U.length<=80||U.length<O.length||!U.startsWith(O))return!0;const Z=U.slice(O.length);return!!Z&&(!!z4(W4(U))||!(!Z.includes(`
290
+
291
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(Z))||Z.endsWith(`
292
+ `)&&!(function(ie){const q=W4(ie);if(z4(q))return!1;const ee=hE(q);return ee.length>=2&&ee.some(fe=>fe.trim())})(U))})(r.value,z)?A():(function(){if(m+=1,h)return;const O=Math.max(0,(function(U){const Z=U.parseCoalesceMs;return typeof Z=="number"&&Number.isFinite(Z)&&Z>=0?Z:80})(e)-(Oi()-k));O<=0?A():h=setTimeout(A,O)})())},{flush:"sync",immediate:!0}),Ef(b);const I=D(()=>{var z,W,L,O;return wY(e.customHtmlTags,(z=e.parseOptions)==null?void 0:z.customHtmlTags,(O=(L=(W=t.customComponentsMap)==null?void 0:W.value)!=null?L:{},Object.entries(O).map(([U,Z])=>{const ie=Ti(U);return Z==null||!ie||zf(ie)||C5.has(ie)||Rf.has(ie)?"":ie}).filter(Boolean)))}),T=D(()=>{const{key:z,tags:W}=_Y(I.value);if(!z)return o;const L=s.get(z);if(L)return L;const O=zC(t.instanceMsgId,{customHtmlTags:W});return s.set(z,O),O}),M=D(()=>{const z=T.value;if(!e.customMarkdownIt)return z;const W=e.customMarkdownIt(z);return z.__markstreamHasCustomParserExtensions=!0,W.__markstreamHasCustomParserExtensions=!0,W}),$=D(()=>{var z,W;const L=(z=e.parseOptions)!=null?z:{},O=t.effectiveFinal.value,U=I.value,Z=O!=null,ie=U.length>0;return Z||ie||L.streamParse==null?it(it(Ot(it({},L),{streamParse:(W=L.streamParse)==null||W}),Z?{final:O}:{}),ie?{customHtmlTags:U}:{}):L}),N=D(()=>{var z;return new Set(((z=$.value.customHtmlTags)!=null?z:[]).map(W=>String(W).trim().toLowerCase()).filter(Boolean))}),F=D(()=>H4($.value,M.value,e.customMarkdownIt,{includeFinal:!0})),S=D(()=>H4($.value,M.value,e.customMarkdownIt,{includeFinal:!1}));et([F,S],([z,W],[L,O])=>{L&&(z===L&&W===O||(A(),W!==O&&(l=[],u="")))},{flush:"sync"});const R=D(()=>{var z,W,L,O,U,Z,ie,q,ee,fe,ne;if((z=e.nodes)!=null&&z.length)return l=[],u="",v(0),gt(e.nodes.slice());const j=r.value;if(!j)return l=[],u="",v(-1),[];const K=t.debugPerformanceEnabled.value,ve=K?Oi():0,he=M.value,Ae=F.value,re=S.value;a&&Ae!==a&&(function(tt){var lt,ut;(ut=(lt=tt.stream)==null?void 0:lt.reset)==null||ut.call(lt)})(he),c&&re!==c&&(l=[],u="");const Y=Object.keys((L=(W=t.customComponentsMap)==null?void 0:W.value)!=null?L:{}).length>0||typeof $.value.postTransformNodes=="function";Y!==d&&(l=[],u="");const Q=!Y&&l.length>0&&j.startsWith(u)&&re===c,P=K?P4(he):null,G=K?{}:void 0,me=j4(he),ye=!me&&!Y,de=it(it(Ot(it({},$.value),{__reuseStableTopLevelNodes:ye}),me?{__disableStreamParse:!0}:{}),G?{__timing:G}:{}),V=A8(j,he,de),se=K?Oi():0,pe=K?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ke,Ne=K?tp(V.length):void 0,qe=0,be=0,xe=0;if(Q){const tt=K?Oi():0,[lt,ut]=(function(Tt){var wt,Ft;const[en,Dn]=Tt.scanGlobalReferenceAppend(Tt.previousContent,Tt.content),Pt=Tt.parseOptions;return[Tt.previousDirtyStartIndex>0&&Pt.final!==!0&&!Tt.customMarkdownIt&&!j4(Tt.md)&&!en&&typeof Pt.preTransformTokens!="function"&&typeof Pt.postTransformTokens!="function"&&typeof Pt.postTransformNodes!="function"&&((Ft=(wt=Pt.customHtmlTags)==null?void 0:wt.length)!=null?Ft:0)===0?Tt.previousDirtyStartIndex:0,Dn]})({content:j,previousContent:u,previousDirtyStartIndex:y,parseOptions:$.value,customMarkdownIt:e.customMarkdownIt,md:he,scanGlobalReferenceAppend:f});xe=ut;const mt=lt<=0;if(pe){const Tt=(function(wt,Ft,en,Dn={}){var Pt;if(!Ft.length)return{nodes:wt,metrics:tp(wt.length)};const kn=(Pt=Dn.scanStartIndex)!=null?Pt:0,hn=Dn.reuseDirtyTail!==!1,Kt=(function(Wt,pn,so,mn=0){const to=Math.min(Wt.length,pn.length);for(let vt=Math.min(to,Math.max(0,mn));vt<to;vt++)if(!use(pn[vt],Wt[vt],so))return vt;return Wt.length===pn.length?-1:to})(wt,Ft,en,kn);if(Kt<0)return{nodes:Ft,metrics:{reusedNodeCount:wt.length,dirtyStartIndex:Kt,stablePrefixNodeCount:wt.length,dirtyTailNodeCount:0}};const Tn=wt.slice();let Gt=Kt;for(let Wt=0;Wt<Kt;Wt++)Tn[Wt]=Ft[Wt];if(hn)for(let Wt=Kt;Wt<wt.length;Wt++){const pn=Ft[Wt],so=wt[Wt];pn&&vE(pn,so,en)&&(Tn[Wt]=pn,Gt+=1)}return{nodes:Tn,metrics:{reusedNodeCount:Gt,dirtyStartIndex:Kt,stablePrefixNodeCount:Kt,dirtyTailNodeCount:q4(Kt,wt,Ft)}}})(V,l,pe,{reuseDirtyTail:mt,scanStartIndex:lt});ke=Tt.nodes,Ne=Tt.metrics}else{const Tt=(function(wt,Ft,en={}){var Dn;if(!Ft.length)return{nodes:wt,metrics:tp(wt.length)};const Pt=(Dn=en.scanStartIndex)!=null?Dn:0,kn=en.reuseDirtyTail!==!1,hn=(function(Gt,Wt,pn=0){const so=Math.min(Gt.length,Wt.length);for(let mn=Math.min(so,Math.max(0,pn));mn<so;mn++)if(!cse(Wt[mn],Gt[mn]))return mn;return Gt.length===Wt.length?-1:so})(wt,Ft,Pt);if(hn<0)return{nodes:Ft,metrics:{reusedNodeCount:wt.length,dirtyStartIndex:hn,stablePrefixNodeCount:wt.length,dirtyTailNodeCount:0}};const Kt=wt.slice();let Tn=hn;for(let Gt=0;Gt<hn;Gt++)Kt[Gt]=Ft[Gt];if(kn)for(let Gt=hn;Gt<wt.length;Gt++){const Wt=Ft[Gt],pn=wt[Gt];Wt&&gE(Wt,pn)&&(Kt[Gt]=Wt,Tn+=1)}return{nodes:Kt,metrics:{reusedNodeCount:Tn,dirtyStartIndex:hn,stablePrefixNodeCount:hn,dirtyTailNodeCount:q4(hn,wt,Ft)}}})(V,l,{reuseDirtyTail:mt,scanStartIndex:lt});ke=Tt.nodes,Ne=Tt.metrics}qe=K?Oi()-tt:0,be=mt?Ne?.dirtyStartIndex==null||Ne.dirtyStartIndex<0?ke.length:Ne.dirtyStartIndex:ke.length}else ke=V,Ne=tp(ke.length);t.effectiveFinal.value!==!0&&(pe?(function(tt,lt,ut=0){for(let mt=Math.max(0,ut);mt<tt.length;mt++)V2(lt,"primeSignatureMs",()=>jl(tt[mt]))})(ke,pe,be):(function(tt,lt=0){for(let ut=Math.max(0,lt);ut<tt.length;ut++)jl(tt[ut])})(ke,be));const Ze=K?Oi()-se:0;if(p+=1,u=j,a=Ae,c=re,d=Y,l=ke,v((O=Ne?.dirtyStartIndex)!=null?O:0),K){const tt=P4(he),lt=typeof tt?.total=="number"&&tt.total>((U=P?.total)!=null?U:0);t.logPerf(lt?"parse(stream)":"parse(sync)",it(it(it({rendererId:t.instanceMsgId,ms:Math.round(Oi()-ve),nodes:ke.length,contentLength:j.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Ze,referenceDefinitionScanChars:xe,signatureMs:(Z=pe?.signatureMs)!=null?Z:0,stabilizeSignatureMs:(ie=pe?.stabilizeSignatureMs)!=null?ie:0,primeSignatureMs:(q=pe?.primeSignatureMs)!=null?q:0,signatureCallCount:(ee=pe?.signatureCallCount)!=null?ee:0,stabilizeSignatureCallCount:(fe=pe?.stabilizeSignatureCallCount)!=null?fe:0,primeSignatureCallCount:(ne=pe?.primeSignatureCallCount)!=null?ne:0,stabilizeMs:qe},Ne??{}),G?Object.fromEntries(ose.map(ut=>{var mt;return[ut,(mt=G[ut])!=null?mt:0]})):{}),tt?{streamMode:tt.lastMode,streamDelta:dse(tt,P),streamStats:tt}:{}))}return gt(ke)});return{effectiveCustomHtmlTags:I,effectiveCustomHtmlTagsSet:N,mdBase:T,mdInstance:M,mergedParseOptions:$,getParsedNodesDirtyStartIndex:()=>y,getParsedNodesRevision:()=>g,parsedNodes:R}}function hse(e){const{isClient:t}=e,n=oe(new Set),o=new Map,s=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:o,nodeVisibilityWatchStops:s,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(f,h){if((m=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!m)return;var p,m;const k=n.value,y=k.has(f);if(h){if(y)return;const v=new Set(k);return v.add(f),void(n.value=v)}if(!y)return;const g=new Set(k);g.delete(f),n.value=g})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of s.entries())f<c||(h(),s.delete(f));for(const[f,h]of o.entries())f<c||(h.destroy(),o.delete(f),r(f),(u=e.onNodeVisibilityCleaned)==null||u.call(e,f));for(const f of Array.from(i.keys()))f<c||r(f);if(!n.value.size)return;const d=new Set;for(const f of n.value)f<c&&d.add(f);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of s.values())c();s.clear();for(const c of o.values())c.destroy();o.clear(),l()}}}function pse(e={}){const t=oe(""),n=oe(""),o=oe(!1),s=Vee(e),i=()=>{const u=s.getSnapshot();t.value=u.source,n.value=u.visible,o.value=u.done},r=s.subscribe(i);i();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),c=D(()=>o.value&&a.value);return Sk()&&Ef(()=>{r(),s.destroy()}),{source:t,visible:n,done:o,final:c,caughtUp:a,pendingChars:l,enqueue:u=>s.enqueue(u),finish:u=>s.finish(u),flush:()=>s.flush(),reset:u=>s.reset(u),pause:()=>s.pause(),resume:()=>s.resume()}}const mse={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},V4=/auto|scroll|overlay/i;function gse(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return V4.test(t)||V4.test(n)}function vse(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const yse={class:"m-0 p-0"},kse=["data-probe"],bse=An(Je(Ot(it({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(o){var s,i;return(i=(s=t.headingNodes)==null?void 0:s[o])!=null?i:null}return(o,s)=>(x(),E("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[w("div",{ref:i=>e.setParagraphWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[ae(C(Ha),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),w("div",{ref:i=>e.setListItemWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[w("ul",yse,[ae(C(uu),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),w("div",{ref:i=>e.setListWrapper(i),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[ae(C(du),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(x(),E(We,null,rt(6,i=>w("div",{key:`probe-heading-${i}`,ref_for:!0,ref:r=>e.setHeadingWrapper(i,r),class:Ue(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${i}`},[ae(C(Y1),{node:n(i),"index-key":`probe-heading-${i}`},null,8,["node","index-key"])],10,kse)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),K4=Je({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return Fm((o=Kc(e.estimatedPreviewHeightPx))!=null?o:Lm(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Lt("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Lt("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Lt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Lt("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Lt("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Lt("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Lt("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Lt("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Lt("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Lt("div",{class:"absolute inset-0"},[Lt("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),G4=Je({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,o;return $m((o=Kc(e.estimatedPreviewHeightPx))!=null?o:Im(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Lt("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Lt("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Lt("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Lt("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Lt("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Lt("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Lt("span",{class:"action-icon block"})])))]):null,Lt("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Lt("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Lt("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),xse={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Do(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const wse=["data-custom-id"],_se=["data-node-index","data-node-type"],Y4="typewriter-simple-cursor-target",yE=An(Je(Ot(it({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const o=e,s=n;function i(_){if(!(typeof Event<"u"&&_ instanceof Event))return typeof _=="string"&&s("copy-code",_),void s("copy",_)}const r=Eo(),l=Jt("markstreamNestedRendererProps",void 0);function a(_){const H=r?.vnode.props;return!!H&&(Object.prototype.hasOwnProperty.call(H,_)||Object.prototype.hasOwnProperty.call(H,String(_).replace(/[A-Z]/g,X=>`-${X.toLowerCase()}`)))}function c(_){var H,X;const J=o[_];return a(_)?J:(X=(H=l?.value)==null?void 0:H[_])!=null?X:J}const u=D(()=>{return(_=c("mode"))==="chat"||_==="minimal"||_==="docs"?_:"docs";var _}),d=D(()=>O4(c("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>c("domMode")==="minimal"?"minimal":"full"),p=D(()=>{return(_={mode:u.value,codeRenderer:c("codeRenderer"),renderCodeBlocksAsPre:c("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":_.codeRenderer==="pre"||_.codeRenderer==="shiki"||_.codeRenderer==="monaco"?_.codeRenderer:_.renderCodeBlocksAsPre===!1||_.mode==="docs"?"monaco":"pre";var _}),m=D(()=>xse[u.value]),k=D(()=>{var _;return(_=c("showTooltips"))!=null?_:m.value.showTooltips}),y=D(()=>{var _;return(_=c("fade"))!=null?_:m.value.fade}),g=D(()=>{var _;return(_=c("batchRendering"))!=null?_:m.value.batchRendering}),v=D(()=>{var _;return(_=c("initialRenderBatchSize"))!=null?_:m.value.initialRenderBatchSize}),b=D(()=>{var _;return(_=c("renderBatchSize"))!=null?_:m.value.renderBatchSize}),A=D(()=>{var _;return(_=c("renderBatchDelay"))!=null?_:m.value.renderBatchDelay}),I=D(()=>{var _;return(_=c("renderBatchBudgetMs"))!=null?_:m.value.renderBatchBudgetMs}),T=D(()=>{var _;return(_=c("renderBatchIdleTimeoutMs"))!=null?_:m.value.renderBatchIdleTimeoutMs}),M=D(()=>{var _;return(_=c("deferNodesUntilVisible"))!=null?_:m.value.deferNodesUntilVisible}),$=D(()=>{var _;return(_=c("maxLiveNodes"))!=null?_:m.value.maxLiveNodes}),N=D(()=>{var _;return(_=c("liveNodeBuffer"))!=null?_:m.value.liveNodeBuffer}),F=D(()=>{var _;return(_=c("nodeVirtual"))!=null?_:m.value.nodeVirtual}),S={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return c("parseOptions")},get customMarkdownIt(){return c("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return c("customHtmlTags")},get mode(){return c("mode")},get domMode(){return h.value},get htmlPolicy(){return c("htmlPolicy")},get viewportPriority(){return c("viewportPriority")},get viewportPriorityOptions(){return c("viewportPriorityOptions")},get codeBlockStream(){return c("codeBlockStream")},get codeBlockDarkTheme(){return c("codeBlockDarkTheme")},get codeBlockLightTheme(){return c("codeBlockLightTheme")},get codeBlockMonacoOptions(){return c("codeBlockMonacoOptions")},get codeRenderer(){return c("codeRenderer")},get renderCodeBlocksAsPre(){return c("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return c("codeBlockMinWidth")},get codeBlockMaxWidth(){return c("codeBlockMaxWidth")},get codeBlockProps(){return c("codeBlockProps")},get mermaidProps(){return c("mermaidProps")},get d2Props(){return c("d2Props")},get infographicProps(){return c("infographicProps")},get showTooltips(){return k.value},get themes(){return c("themes")},get langs(){return c("langs")},get isDark(){return c("isDark")},get customId(){return c("customId")},get indexKey(){return o.indexKey},get typewriter(){return c("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return c("smoothStreamingOptions")},get parseCoalesceMs(){return c("parseCoalesceMs")},get fade(){return y.value},get batchRendering(){return g.value},get initialRenderBatchSize(){return v.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return A.value},get renderBatchBudgetMs(){return I.value},get renderBatchIdleTimeoutMs(){return T.value},get deferNodesUntilVisible(){return M.value},get maxLiveNodes(){return $.value},get liveNodeBuffer(){return N.value},get nodeVirtual(){return F.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function R(_){s("height-change",_)}function z(_){s("virtual-state-change",_)}function W(_){s("anchor-change",_)}const L=oe(),O=oe(null),U=oe(null),Z=oe(null),ie=zo({1:null,2:null,3:null,4:null,5:null,6:null}),q=oe(!1),ee=new Map,fe=oe(0),ne=oe(0),j=oe({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function K(_,H){return typeof _!="string"?H:_.trim()||H}function ve(_){const H=Number(_);return Number.isFinite(H)&&H>0?Math.max(1,Math.trunc(H)):640}const he=D(()=>{var _;const H=(_=S.viewportPriorityOptions)!=null?_:{},X=K(H.rootMargin,ja);return{rootMargin:X,heavyBlockMargin:K(H.heavyBlockMargin,X),maxTargets:ve(H.maxTargets)}}),Ae=D(()=>{var _;return(_=he.value.rootMargin)!=null?_:ja}),re=D(()=>{var _;return(_=he.value.maxTargets)!=null?_:640});function Y(){var _,H;if(((_=o.virtualScroll)==null?void 0:_.enabled)!==!0)return null;const X=(H=o.virtualScroll)==null?void 0:H.scrollRoot;return Q(typeof X=="function"?X():X)}function Q(_){return _?typeof HTMLElement<"u"&&_ instanceof HTMLElement?_:typeof _=="object"&&"value"in _?Q(_.value):typeof _=="object"&&"$el"in _?Q(_.$el):null:null}In(tE,he);const{isClient:P,renderAsFragment:G,debugPerformanceEnabled:me,resolvedShowTooltips:ye,resolvedHtmlPolicy:de,inheritedSmoothStreaming:V,ownsTypewriterCursor:se}=(function(_){const H=typeof window<"u",X=Lf(),J=Jt("markstreamHtmlPolicy",void 0),ce=Jt("markstreamTypewriterCursor",void 0),we=Jt("markstreamSmoothStreaming",void 0),Le=D(()=>_.renderAsFragment===!0),Fe=D(()=>!!(_.debugPerformance&&H&&typeof console<"u")),Ve=D(()=>{var je;if(typeof _.showTooltips=="boolean")return _.showTooltips;const $e=(je=X.showTooltips)!=null?je:X["show-tooltips"];return $e===""||$e===!0||$e==="true"||$e!==!1&&$e!=="false"&&void 0}),Oe=D(()=>{var je,$e;return($e=(je=_.htmlPolicy)!=null?je:J?.value)!=null?$e:"safe"}),Pe=D(()=>ce?.value!==!0);return{isClient:H,renderAsFragment:Le,debugPerformanceEnabled:Fe,resolvedShowTooltips:Ve,resolvedHtmlPolicy:Oe,inheritedSmoothStreaming:we,inheritedTypewriterCursor:ce,ownsTypewriterCursor:Pe}})(S),{resolveViewportRoot:pe,resolveScrollContainer:ke,isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:qe,getOffsetTopWithinRoot:be}=(function(_,H){function X(){var Fe,Ve;return(Ve=(Fe=H.scrollRoot)==null?void 0:Fe.call(H))!=null?Ve:null}function J(Fe){if(typeof window>"u")return null;const Ve=X();if(Ve)return Ve;const Oe=Fe??_.value;if(!Oe)return null;const Pe=Oe.ownerDocument||document,je=Pe.scrollingElement||Pe.documentElement;let $e=Oe;for(;$e&&$e!==Pe.body&&$e!==je;){if(gse(window.getComputedStyle($e))&&vse($e))return $e;$e=$e.parentElement}return null}function ce(Fe){if(!H.isClient)return!1;try{const Ve=window.getComputedStyle(Fe);return!!(Ve.display||"").toLowerCase().includes("flex")&&(Ve.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function we(Fe,Ve,Oe){var Pe,je;if(Oe)return Le(Ve);const $e=Fe.scrollTop;if(!ce(Fe))return $e;const He=$e<0?-$e:$e;return Math.max(0,((Pe=Fe.scrollHeight)!=null?Pe:0)-((je=Fe.clientHeight)!=null?je:0))-He}function Le(Fe){var Ve,Oe,Pe,je,$e;const He=Number((Ve=Fe.scrollingElement)==null?void 0:Ve.scrollTop),Qe=Number((Pe=(Oe=Fe.documentElement)==null?void 0:Oe.scrollTop)!=null?Pe:0),Ye=Number(($e=(je=Fe.body)==null?void 0:je.scrollTop)!=null?$e:0);return Math.max(0,Number.isFinite(He)?He:0,Number.isFinite(Qe)?Qe:0,Number.isFinite(Ye)?Ye:0)}return{resolveViewportRoot:J,resolveScrollContainer:function(Fe){var Ve,Oe,Pe,je;const $e=X();if($e)return $e;const He=J((Ve=Fe??_.value)!=null?Ve:null);if(He)return He;const Qe=(je=(Pe=Fe?.ownerDocument)!=null?Pe:(Oe=_.value)==null?void 0:Oe.ownerDocument)!=null?je:typeof document<"u"?document:null;return Qe?.scrollingElement||Qe?.documentElement||null},isReverseFlexScrollRoot:ce,getNormalizedScrollTop:we,getOffsetTopWithinRoot:function(Fe,Ve){const Oe=Ve.ownerDocument||Fe.ownerDocument||document;if((function(He,Qe){return He===Qe.documentElement||He===Qe.body||He===Qe.scrollingElement})(Ve,Oe))return Fe.getBoundingClientRect().top+Le(Oe);const Pe=Ve.getBoundingClientRect(),je=Fe.getBoundingClientRect(),$e=we(Ve,Oe,!1);return je.top-Pe.top+$e}}})(L,{isClient:P,scrollRoot:Y});In("markstreamShowTooltips",ye),In("markstreamHtmlPolicy",de),In("markstreamTypewriter",f),In("markstreamFade",D(()=>S.fade!==!1)),In("markstreamTypewriterCursor",D(()=>!0)),In("markstreamTextStreamState",ee),In("markstreamStreamVersion",fe),In("markstreamParseOptions",D(()=>S.parseOptions)),In("markstreamCustomMarkdownIt",D(()=>S.customMarkdownIt));const{smoothStreamingEnabled:xe,renderContent:Ze,requestedFinal:tt,effectiveFinal:lt}=(function(_,H){const X=pse(it(it({},mse),_.smoothStreamingOptions)),J=D(()=>{var $e,He,Qe;return _.smoothStreaming!==!1&&!(($e=_.nodes)!=null&&$e.length)&&(_.smoothStreaming===!0||!((He=H.inheritedSmoothStreaming)!=null&&He.value))&&(_.smoothStreaming===!0||O4(_.typewriter)!=="off"||((Qe=_.maxLiveNodes)!=null?Qe:0)<=0)}),ce=oe(!H.isClient||_.smoothStreaming===!0);Cn(()=>{ce.value=!0});const we=D(()=>ce.value&&J.value),Le=D(()=>{var $e;return we.value?X.visible.value:($e=_.content)!=null?$e:""}),Fe=D(()=>{var $e,He;const Qe=($e=_.parseOptions)!=null?$e:{};return(He=_.final)!=null?He:Qe.final}),Ve=D(()=>{const $e=Fe.value;return we.value&&$e!=null?!!$e&&X.caughtUp.value:$e});let Oe=0,Pe=!1;function je(){Oe=0,Pe=!1}return et([()=>_.content,()=>_.nodes,we,Fe],([$e,He,Qe,Ye])=>{if(He?.length)return je(),void X.reset("");const ct=$e??"";if(!Qe)return je(),X.reset(ct),void(Ye&&X.finish({flush:!0}));const st=X.source.value;if(ct){if(ct!==st)if(ct.startsWith(st)){const pt=ct.slice(st.length),kt=X.pendingChars.value;pt.length<=8?(Oe++,Pe||Oe>=2&&kt<=8?(Pe=!0,X.reset(ct)):X.enqueue(pt)):(je(),X.enqueue(pt))}else je(),X.reset(ct)}else je(),X.reset("");Ye&&X.finish()},{immediate:!0}),{smoothStream:X,smoothStreamingEligible:J,smoothStreamingEnabled:we,renderContent:Le,requestedFinal:Fe,effectiveFinal:Ve}})(S,{isClient:P,inheritedSmoothStreaming:V}),ut=tt.value===!0;In("markstreamSmoothStreaming",xe);const mt=oe(!1),Tt=oe(!1),wt=oe(!1);let Ft="",en=!1,Dn=null;function Pt(){P&&Dn!=null&&(window.clearTimeout(Dn),Dn=null)}function kn(){mt.value=!1,Pt()}function hn(_,H){if(!me.value)return;const X=(function(){if(!me.value)return null;const J=pn(Kt),ce=pn(Tn),we=Math.max(Wt,ce);if(J<=0&&we<=0)return null;const Le={total:J,maxPerFrame:we,byLabel:(Fe=Kt,Object.fromEntries(Array.from(Fe.entries()).sort((Ve,Oe)=>Oe[1]-Ve[1]||Ve[0].localeCompare(Oe[0]))))};var Fe;return Kt.clear(),Tn.clear(),Wt=0,Le})();console.info(`[markstream-vue][perf] ${_}`,X?Ot(it({},H),{layoutReads:X}):H)}et([()=>S.indexKey,()=>S.customId],()=>{var _,H;kn(),Tt.value=!1,wt.value=!((_=o.nodes)!=null&&_.length)&&tt.value!==!0&&!!o.content,Ft=(H=Ze.value)!=null?H:"",en=Ft.length>0},{flush:"sync"}),et([()=>o.content,()=>o.nodes,tt],([_,H,X])=>{!H?.length&&X!==!0&&_&&(wt.value=!0)},{flush:"sync",immediate:!0}),et([Ze,()=>o.nodes,tt],([_,H,X])=>{const J=_??"";return H?.length||X===!0?(kn(),Tt.value=!1,Ft=J,void(en=!0)):(J.length>0&&(wt.value=!0),en?(Ft&&J.length>Ft.length&&J.startsWith(Ft)?(mt.value=!0,Tt.value=!0,P&&(Pt(),Dn=window.setTimeout(()=>{var ce;Dn=null,lt.value===!0||(ce=o.nodes)!=null&&ce.length||(gc(),mt.value=!1,xr())},1200))):(J.length<Ft.length||!J.startsWith(Ft))&&(kn(),Tt.value=!1),void(Ft=J)):(Ft=J,void(en=!0)))},{flush:"sync",immediate:!0});const Kt=new Map,Tn=new Map;let Gt=!1,Wt=0;function pn(_){let H=0;for(const X of _.values())H+=X;return H}function so(){Wt=Math.max(Wt,pn(Tn)),Tn.clear(),Gt=!1}function mn(_){_.maxPerFrame=Math.max(Number(_.maxPerFrame||0),Number(_.currentFrameTotal||0)),_.currentFrameTotal=0,_.frameScheduled=!1}function to(_){var H,X;me.value&&(Kt.set(_,((H=Kt.get(_))!=null?H:0)+1),Tn.set(_,((X=Tn.get(_))!=null?X:0)+1),(function(J){const ce=(function(){if(!P||typeof window>"u")return null;const we=window;if(we.__markstreamLayoutReadPerformance)return we.__markstreamLayoutReadPerformance;const Le={total:0,maxPerFrame:0,byLabel:{}};return we.__markstreamLayoutReadPerformance=Le,Le})();ce&&(ce.total=Number(ce.total||0)+1,ce.byLabel[J]=Number(ce.byLabel[J]||0)+1,ce.currentFrameTotal=Number(ce.currentFrameTotal||0)+1,ce.frameScheduled||(ce.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>mn(ce),0):queueMicrotask(()=>mn(ce)):window.requestAnimationFrame(()=>mn(ce))))})(_),Gt||(Gt=!0,P&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(so):typeof queueMicrotask!="function"?setTimeout(so,0):queueMicrotask(so)))}function vt(_,H){return to(_),H()}const Pn=S.customId?`renderer-${S.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Fn=(function(_){const H=new Map;return{scope:_,cache:H,clear:()=>H.clear()}})(Pn),Qn=Pn;In(cE,Fn);const sn=No(()=>S.customId),{effectiveCustomHtmlTagsSet:es,mergedParseOptions:nt,parsedNodes:Be,getParsedNodesDirtyStartIndex:Bt,getParsedNodesRevision:Yt}=fse(S,{instanceMsgId:Pn,renderContent:Ze,effectiveFinal:lt,smoothStreamingEnabled:xe,debugPerformanceEnabled:me,customComponentsMap:sn,logPerf:hn});et(Be,()=>{mt.value||Fn.clear(),fe.value+=1},{immediate:!0});const gn=D(()=>({customId:S.customId,customHtmlTags:nt.value.customHtmlTags,parseOptions:S.parseOptions,customMarkdownIt:S.customMarkdownIt,htmlPolicy:de.value,viewportPriority:S.viewportPriority,viewportPriorityOptions:he.value,mode:u.value,domMode:S.domMode,codeRenderer:p.value,codeBlockStream:S.codeBlockStream,codeBlockDarkTheme:S.codeBlockDarkTheme,codeBlockLightTheme:S.codeBlockLightTheme,codeBlockMonacoOptions:S.codeBlockMonacoOptions,renderCodeBlocksAsPre:S.renderCodeBlocksAsPre,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockProps:S.codeBlockProps,mermaidProps:S.mermaidProps,d2Props:S.d2Props,infographicProps:S.infographicProps,showTooltips:ye.value,themes:S.themes,langs:S.langs,isDark:S.isDark,typewriter:f.value,smoothStreamingOptions:S.smoothStreamingOptions,parseCoalesceMs:S.parseCoalesceMs,fade:S.fade}));In("markstreamNestedRendererProps",gn);const bn=D(()=>Be.value),nn=D(()=>Be.value.length),Vn=oe(null),Kn=oe(null),Jn=oe(null),Oo=oe(null),ko=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),ai=!ko&&S.customId?N4(S.customId):null,Uo=D(()=>ai?(dv.value,N4(S.customId)):null),As=D(()=>{var _;return!!(!G.value&&S.customId&&!ko&&((_=Uo.value)!=null&&_.enabled))}),cs=D(()=>!!(P&&As.value)),qo=D(()=>{var _;return!!(!G.value&&((_=o.virtualScroll)!=null&&_.enabled))}),Bo=D(()=>qo.value),ci=oe(!1);Cn(()=>{ci.value=!0});const tn=D(()=>!!(P&&qo.value));In("markstreamHostScrollManaged",tn);const qs=D(()=>!!(ci.value&&tn.value)),io=D(()=>cs.value||tn.value),js=D(()=>cs.value||qs.value),ui=D(()=>{var _;return io.value&&((_=Uo.value)==null?void 0:_.textEstimation)!==!1});function Ni(){const _=ne.value||vt("getMeasuredContainerWidth.clientWidth",()=>{var H;return((H=L.value)==null?void 0:H.clientWidth)||0});return Number.isFinite(_)&&_>0?_:0}const di=D(()=>{const _=Ni();return _>0?Math.max(1,Math.round(_)):640}),Vs=D(()=>{var _,H;return!(lt.value!==!0||qo.value||u.value!=="chat"&&u.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(_=o.nodes)!=null&&_.length||wt.value||!(((H=S.maxLiveNodes)!=null?H:0)<=0))}),ts=D(()=>{var _;return Vs.value?50:Math.max(1,(_=S.maxLiveNodes)!=null?_:320)}),ns=D(()=>{var _;return Vs.value?16:Math.max(0,(_=S.liveNodeBuffer)!=null?_:60)}),zt=D(()=>{var _;return!G.value&&S.nodeVirtual!==!1&&!(((_=S.maxLiveNodes)!=null?_:0)<=0&&!Vs.value)&&(S.nodeVirtual===!0?Be.value.length>0:Be.value.length>ts.value)}),Ms=D(()=>zt.value||cs.value||tn.value),Io=D(()=>S.viewportPriority!==!1),fi=D(()=>!!Io.value&&!q.value);var Ke;Ke=D(()=>Io.value),In(nE,Ke);const Re=D(()=>{var _;return!(G.value||S.deferNodesUntilVisible===!1||((_=S.maxLiveNodes)!=null?_:0)<=0||zt.value||Be.value.length>900||S.viewportPriority===!1)}),le=Vte(_=>{var H;return pe((H=_??L.value)!=null?H:null)},Io),{requestFrame:Te,cancelFrame:ge,hasIdleCallback:Me,isTestEnv:ze}=(function(_){const H=_.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,X=_.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,J=_.isClient&&typeof window.requestIdleCallback=="function",ce=(function(){var we;if(typeof globalThis>"u"||!("process"in globalThis))return;const Le=(we=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:we.value;return Le?.env})();return{requestFrame:H,cancelFrame:X,hasIdleCallback:J,isTestEnv:ce?.NODE_ENV==="test"}})({isClient:P}),Ht=D(()=>lt.value===!0&&!qo.value),{resolvedBatchSize:Ut,resolvedInitialBatch:xn,batchingEnabled:go,incrementalRenderingActive:us,renderedCount:te,previousRenderContext:Ce,adaptiveBatchSize:Ee,previousBatchConfig:De}=(function(_,H){var X;const J=D(()=>{var je;const $e=Math.trunc((je=_.renderBatchSize)!=null?je:80);return Number.isFinite($e)?Math.max(0,$e):0}),ce=D(()=>{var je;const $e=Math.trunc((je=_.initialRenderBatchSize)!=null?je:J.value);return Number.isFinite($e)?Math.max(0,$e):J.value}),we=D(()=>!H.renderAsFragment.value&&_.batchRendering!==!1&&J.value>0&&H.isClient&&!H.isTestEnv),Le=oe(0),Fe=oe({key:_.indexKey,total:0}),Ve=oe(Math.max(1,J.value||1)),Oe=D(()=>{var je,$e,He;return we.value&&!((je=H.continuousStreaming)!=null&&je.value)&&!(($e=H.forceFullRenderFinalContent)!=null&&$e.value)&&((He=_.maxLiveNodes)!=null?He:0)<=0}),Pe=oe({batchSize:J.value,initial:ce.value,delay:(X=_.renderBatchDelay)!=null?X:16,enabled:Oe.value});return{resolvedBatchSize:J,resolvedInitialBatch:ce,batchingEnabled:we,incrementalRenderingActive:Oe,renderedCount:Le,previousRenderContext:Fe,adaptiveBatchSize:Ve,previousBatchConfig:Pe}})(S,{isClient:P,isTestEnv:ze,renderAsFragment:G,forceFullRenderFinalContent:Ht,continuousStreaming:D(()=>Tt.value&&lt.value!==!0)}),Xe=D(()=>{var _;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&!ze&&((_=S.maxLiveNodes)!=null?_:0)<=0&&!Ht.value}),at=D(()=>Xe.value),It=D(()=>io.value||at.value),Qt=D(()=>{var _;return It.value&&((_=Uo.value)==null?void 0:_.codeBlockEstimation)!==!1}),cn=new Map,Vt=new Map,Hn=new WeakMap;let co=null;const Nt=new WeakMap,_t=new Map,Zt=[];let eo=[],ro=[],Ks=-1;const Ii=gr(Zt),Gs=new Set,Gf=oe(0);let Yf=0;const Fb=oe(0),jT=D(()=>(Fb.value,Array.from(cn.entries()).sort((_,H)=>_[0]-H[0]))),Nu=oe(null),Ys=oe(null);let el,Ql=null,u0=0,Iu=null;function hi(){el.markFallbackHeightPrefixDirty()}function d0(_){return el.getFallbackNodeHeight(_)}function nc(_,H){return el.estimateHeightRange(_,H)}function f0(_){return el.estimateIndexForOffset(_)}const{activeRestoreAnchor:oc,getRelativeScrollTopWithinContainer:VT,setRelativeScrollTopWithinContainer:KT,resolveAnchorOffset:GT,clearRestoreReconcile:Zf,scheduleRestoreReconcile:Lu,captureRestoreAnchor:Ob,restoreAnchor:Bb,getAnchorDrift:YT}=(function(_){const{isClient:H,containerRef:X,parsedNodeCount:J,requestFrame:ce,cancelFrame:we,resolveScrollContainer:Le,getNormalizedScrollTop:Fe,getOffsetTopWithinRoot:Ve,isReverseFlexScrollRoot:Oe,estimateIndexForOffset:Pe,estimateHeightRange:je,getFallbackNodeHeight:$e,clamp:He}=_,Qe=oe(null);let Ye=null,ct=[];function st(){const Et=Le(),qt=X.value;if(!Et||!qt)return null;const Xt=Et.ownerDocument||qt.ownerDocument||document;if(Et===Xt.documentElement||Et===Xt.body||Et===Xt.scrollingElement){const Nn=qt.getBoundingClientRect();return Math.max(0,-Nn.top)}return Math.max(0,Fe(Et,Xt,!1)-Ve(qt,Et))}function pt(Et){var qt;const Xt=Le(),Nn=X.value;if(!Xt||!Nn)return;const Ko=Math.max(0,Et),Ro=Xt.ownerDocument||Nn.ownerDocument||document,$i=Ro.defaultView||(typeof window<"u"?window:null);if(Xt===Ro.documentElement||Xt===Ro.body||Xt===Ro.scrollingElement){const Ji=Fe(Xt,Ro,!0)+Nn.getBoundingClientRect().top;return void((qt=$i?.scrollTo)==null||qt.call($i,0,Math.max(0,Ji+Ko)))}$4(Xt,Ro,Ve(Nn,Xt)+Ko,{isReverseFlexScrollRoot:Ji=>{var Ju;return(Ju=Oe?.(Ji))!=null&&Ju},getNormalizedScrollTop:Fe})}function kt(Et){const qt=J.value,Xt=He(Et.nodeIndex,0,Math.max(0,qt-1));return je(0,Xt)+Math.max(0,Et.offsetWithinNodePx)}function Mt(){if(Ye!=null&&(we?.(Ye),Ye=null),H)for(const Et of ct)window.clearTimeout(Et);ct=[]}function Ct(Et){const qt=kt(Et),Xt=st();Xt!=null&&Math.abs(Xt-qt)<=.5||pt(qt)}return{activeRestoreAnchor:Qe,getRelativeScrollTopWithinContainer:st,setRelativeScrollTopWithinContainer:pt,resolveAnchorOffset:kt,clearRestoreReconcile:Mt,applyRestoreAnchor:Ct,scheduleRestoreReconcile:function(){Qe.value&&H&&Ye==null&&(Ye=ce?ce(()=>{Ye=null,Qe.value&&Ct(Qe.value)}):null,Ye==null&&Qe.value&&Ct(Qe.value))},captureRestoreAnchor:function(){const Et=st(),qt=J.value;if(Et==null||qt<=0)return null;const Xt=He(Pe(Et+1),0,qt-1),Nn=je(0,Xt),Ko=$e(Xt);return{nodeIndex:Xt,offsetWithinNodePx:He(Et-Nn,0,Math.max(0,Ko-1))}},restoreAnchor:function(Et){const qt=J.value;if(Qe.value={nodeIndex:He(Et.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Et.offsetWithinNodePx)},Mt(),Ct(Qe.value),H)for(const Xt of[0,120,280,480])ct.push(window.setTimeout(()=>{Qe.value&&Ct(Qe.value)},Xt))},getAnchorDrift:function(Et){const qt=st();return qt==null?null:qt-kt(Et)}}})({isClient:P,containerRef:L,parsedNodeCount:nn,requestFrame:Te,cancelFrame:ge,resolveScrollContainer:()=>Nu.value||ke(),getNormalizedScrollTop:qe,getOffsetTopWithinRoot:be,isReverseFlexScrollRoot:Ne,estimateIndexForOffset:f0,estimateHeightRange:nc,getFallbackNodeHeight:d0,clamp:Vo}),{nodeHeights:sc,heightStats:pi,heightTreeSize:h0,heightSumTree:ZT,heightKnownTree:XT,averageNodeHeight:Rb,resetHeightMeasurements:QT,pruneHeightMeasurements:JT,rebuildHeightTrees:Xf,recordNodeHeight:eN,removeNodeHeights:tN,exportHeightCache:nN,importHeightCache:oN,fenwickRangeSum:sN}=(function(_={}){const H=zo({}),X=zo({total:0,count:0}),J=oe(0),ce=oe([]),we=oe([]);function Le(){for(const $e of Object.keys(H))delete H[Number($e)];X.total=0,X.count=0,J.value=0,ce.value=[],we.value=[]}function Fe($e,He,Qe){for(let Ye=He+1;Ye<$e.length;Ye+=Ye&-Ye)$e[Ye]+=Qe}function Ve($e,He){let Qe=0;for(let Ye=He+1;Ye>0;Ye-=Ye&-Ye)Qe+=$e[Ye];return Qe}function Oe($e){J.value=$e;const He=new Array($e+1).fill(0),Qe=new Array($e+1).fill(0);for(const[Ye,ct]of Object.entries(H)){const st=Number(Ye),pt=Number(ct);!Number.isFinite(st)||st<0||st>=$e||!Number.isFinite(pt)||pt<=0||(Fe(He,st,pt),Fe(Qe,st,1))}ce.value=He,we.value=Qe}function Pe($e){if(!Number.isInteger($e)||$e<0)return!1;const He=H[$e];if(!Number.isFinite(He)||He<=0)return!1;if(delete H[$e],X.total=Math.max(0,X.total-He),X.count=Math.max(0,X.count-1),J.value>$e){const Qe=ce.value,Ye=we.value;Qe.length&&Ye.length&&(Fe(Qe,$e,-He),Fe(Ye,$e,-1))}return!0}const je=D(()=>X.count>0?Math.max(12,X.total/X.count):32);return{nodeHeights:H,heightStats:X,heightTreeSize:J,heightSumTree:ce,heightKnownTree:we,averageNodeHeight:je,resetHeightMeasurements:Le,pruneHeightMeasurements:function($e){if($e<=0)return void Le();let He=0,Qe=0;for(const[Ye,ct]of Object.entries(H)){const st=Number(Ye),pt=Number(ct);!Number.isFinite(st)||st<0||st>=$e||!Number.isFinite(pt)||pt<=0?delete H[st]:(He+=pt,Qe++)}X.total=He,X.count=Qe},rebuildHeightTrees:Oe,recordNodeHeight:function($e,He,Qe={}){(function(Ye,ct,st={}){var pt;if(!Number.isFinite(ct)||ct<=0)return!1;const kt=H[Ye];if(kt&&(st.allowShrink===!1&&ct<kt||Math.abs(ct-kt)<=1))return!1;if(H[Ye]=ct,kt?X.total+=ct-kt:(X.total+=ct,X.count++),J.value>Ye){const Mt=ce.value,Ct=we.value;if(Mt.length&&Ct.length)if(kt){const Et=ct-kt;Et!==0&&Fe(Mt,Ye,Et)}else Fe(Mt,Ye,ct),Fe(Ct,Ye,1)}st.notify!==!1&&((pt=_.onHeightRecorded)==null||pt.call(_))})($e,He,Ot(it({},Qe),{notify:!0}))},removeNodeHeight:function($e,He={}){var Qe;const Ye=Pe($e);return Ye&&He.notify!==!1&&((Qe=_.onHeightRecorded)==null||Qe.call(_)),Ye},removeNodeHeights:function($e,He={}){var Qe;let Ye=0;for(const ct of $e)Pe(Number(ct))&&Ye++;return Ye>0&&He.notify!==!1&&((Qe=_.onHeightRecorded)==null||Qe.call(_)),Ye},exportHeightCache:function(){return Object.entries(H).map(([$e,He])=>({index:Number($e),height:Number(He)})).filter($e=>Number.isFinite($e.index)&&$e.index>=0&&Number.isFinite($e.height)&&$e.height>0).sort(($e,He)=>$e.index-He.index)},importHeightCache:function($e,He={}){var Qe;if(!Array.isArray($e))return;const Ye=J.value;let ct=!1;if(He.mode!=="merge"){const st=Object.keys(H);if(st.length>0){for(const pt of st)delete H[Number(pt)];ct=!0}}for(const st of $e){const pt=Number(st.index),kt=Number(st.height);if(!Number.isInteger(pt)||pt<0||Ye>0&&pt>=Ye||!Number.isFinite(kt)||kt<=0)continue;const Mt=H[pt];Mt&&Math.abs(Mt-kt)<=1||(H[pt]=kt,ct=!0)}ct&&((function(){let st=0,pt=0;const kt=J.value;for(const[Mt,Ct]of Object.entries(H)){const Et=Number(Mt),qt=Number(Ct);!Number.isFinite(Et)||Et<0||kt>0&&Et>=kt||!Number.isFinite(qt)||qt<=0?delete H[Et]:(st+=qt,pt++)}X.total=st,X.count=pt})(),Ye>0&&Oe(Ye),(Qe=_.onHeightRecorded)==null||Qe.call(_))},fenwickRangeSum:function($e,He,Qe){if(Qe<=He)return 0;const Ye=Ve($e,Qe-1);return He<=0?Ye:Ye-Ve($e,He-1)}}})({onHeightRecorded:()=>{hi(),tn.value&&Ku(),oc.value&&Lu(),Ys.value&&hc(),Gn("node-resize")}});function Db(_){Number.isInteger(_)&&_>=0&&Gs.add(_)}function Pb(_){for(const H of _)Db(Number(H))}function ic(_){Yf++;let H=!0;try{const X=_();return H=X!==!1,X}finally{Yf--,Yf===0&&H&&Gf.value++}}function p0(){eo=[],ro=[],Ks=-1,Gs.clear(),Ii.value=Zt}function Qf(){p0(),ic(()=>QT()),_t.clear()}function Hb(_){!Number.isInteger(_)||_<0||_>=Be.value.length||_t.set(_,Bu(_))}function Wb(_,H,X={}){const J=sc[_];Db(_),eN(_,H,X);const ce=sc[_];return Object.is(J,ce)?(Gs.delete(_),!1):(ce&&ce>0?Hb(_):J&&_t.delete(_),!0)}function zb(_,H){const X=vt("getNodeLayoutHeight.slot.offsetHeight",()=>{var J,ce;return(ce=(J=cn.get(_))==null?void 0:J.offsetHeight)!=null?ce:0});return X>0?X:vt("getNodeLayoutHeight.content.offsetHeight",()=>H.offsetHeight)}function Ub(_,H={}){H.mode!=="merge"?p0():Pb(_.map(X=>X.index)),ic(()=>oN(_,H)),z0()}const Zi=D(()=>Re.value&&fi.value),iN=D(()=>{var _;return!G.value&&S.batchRendering!==!1&&Ut.value>0&&((_=S.maxLiveNodes)!=null?_:0)<=0}),rN=D(()=>!G.value&&ut&&lt.value===!0&&!zt.value&&!qo.value&&!As.value&&!Zi.value&&!iN.value),qb=D(()=>!!le&&Zi.value),jb=D(()=>zt.value||tn.value),{focusIndex:yr,liveRange:jo,updateLiveRange:$u}=(function(_,H){const{parsedNodeCount:X,virtualizationEnabled:J,maxLiveNodesResolved:ce,liveNodeBufferResolved:we,clamp:Le}=H,Fe=we??D(()=>{var Pe;return Math.max(0,(Pe=_.liveNodeBuffer)!=null?Pe:60)}),Ve=oe(0),Oe=zo({start:0,end:0});return{liveNodeBufferResolved:Fe,focusIndex:Ve,liveRange:Oe,updateLiveRange:function(){const Pe=X.value;if(!J.value||Pe===0)return Oe.start=0,void(Oe.end=Pe);const je=Math.min(ce.value,Pe),$e=Fe.value,He=Le(Ve.value-$e,0,Math.max(0,Pe-je));Oe.start=He,Oe.end=Math.min(Pe,He+je)}}})(S,{parsedNodeCount:nn,virtualizationEnabled:zt,maxLiveNodesResolved:ts,liveNodeBufferResolved:ns,clamp:Vo}),Xi=new Map,Jl=new Map,tl=new Map,Jf=[],kr=new Map,nl=new Set,Vb=oe(0);let m0=!1;const Kb=D(()=>(Vb.value,nl.size)),Zs=new Map,Qi=new Map,Gb=oe(0),g0=D(()=>{Gb.value;let _=0;for(const H of Zs.values())_+=Math.max(0,H);return _});let Xs=null;const eh=D(()=>{if(!zt.value)return Be.value.length;const _=ns.value,H=Math.max(jo.end+_,xn.value),X=Math.min(Be.value.length,H);return Math.max(te.value,X)});function th(){m0||(m0=!0,queueMicrotask(()=>{m0=!1,Vb.value+=1}))}function Yb(_,H,X="node-resize"){if(!P||typeof window>"u")return null;const J=window.setTimeout(()=>{nl.delete(J)&&th();try{H()}finally{Gn(X)}},Math.max(0,_));return nl.add(J),th(),J}function nh(_){P&&_!=null&&(nl.delete(_)&&th(),window.clearTimeout(_))}function Zb(){if(P&&typeof window<"u")for(const _ of nl)window.clearTimeout(_);nl.size&&(nl.clear(),th()),Jf.length=0,tl.clear()}function lN(_){O.value=_}function aN(_){U.value=_}function cN(_){Z.value=_}const{cancelScheduledFocusSync:v0,scheduleFocusSync:Li}=(function(_){const{isClient:H,containerRef:X,virtualizationEnabled:J,requestFrame:ce,cancelFrame:we,syncFocusToScroll:Le}=_;let Fe=null;function Ve(){var Pe,je,$e;return($e=(je=(Pe=X.value)==null?void 0:Pe.ownerDocument)==null?void 0:je.defaultView)!=null?$e:typeof window<"u"?window:null}function Oe(){if(!Fe)return;const Pe=Ve();Fe.viaTimeout?Pe?Pe.clearTimeout(Fe.id):clearTimeout(Fe.id):we?.(Fe.id),Fe=null}return{cancelScheduledFocusSync:Oe,scheduleFocusSync:function(Pe={}){if(!J.value)return;if(!H)return void Le(!0);if(Pe.immediate)return Oe(),void Le(!0);if(Fe)return;const je=()=>{Fe=null,Le()};if(ce)return void(Fe={id:ce(je),viaTimeout:!1});const $e=Ve();Fe={id:$e?$e.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:P,containerRef:L,virtualizationEnabled:zt,requestFrame:Te,cancelFrame:ge,syncFocusToScroll:function(_=!1){var H;if(!zt.value)return;const X=Nu.value||ke();if(!X)return;const J=X.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,ce=J?.defaultView||(typeof window<"u"?window:null),we=X===J?.documentElement||X===J?.body,Le=Be.value.length;if(Le<=0)return;if(!we&&Le>0&&Ne(X)){const Ye=vt("syncFocusToScroll.clientHeight",()=>X.clientHeight||0),ct=vt("syncFocusToScroll.scrollTop",()=>X.scrollTop),st=ct<0?-ct:ct;return void ih(Vo((Fe=Math.max(0,st)+.5*Math.max(0,Ye),el.estimateIndexForOffsetFromEnd(Fe)),0,Math.max(0,Le-1)),_)}var Fe;const Ve=(function(Ye,ct,st,pt){const kt=L.value;if(!kt)return null;const Mt=pt?0:vt("syncFocusToScroll.model.root.getBoundingClientRect",()=>Ye.getBoundingClientRect().top),Ct=vt("syncFocusToScroll.model.container.getBoundingClientRect",()=>kt.getBoundingClientRect().top),Et=Math.max(0,Mt-Ct),qt=pt?vt("syncFocusToScroll.model.viewport.clientHeight",()=>{var Xt,Nn,Ko,Ro;return(Ro=(Ko=(Nn=st?.innerHeight)!=null?Nn:(Xt=ct.documentElement)==null?void 0:Xt.clientHeight)!=null?Ko:Ye.clientHeight)!=null?Ro:0}):vt("syncFocusToScroll.model.root.clientHeight",()=>Ye.clientHeight);return Vo(f0(Et+.5*Math.max(0,qt)),0,Math.max(0,Be.value.length-1))})(X,J,ce,we);if(Ve!=null)return void ih(Ve,_);const Oe=we?null:vt("syncFocusToScroll.root.getBoundingClientRect",()=>X.getBoundingClientRect()),Pe=we?0:Oe.top,je=we?vt("syncFocusToScroll.viewport.clientHeight",()=>{var Ye,ct;return(ct=(Ye=ce?.innerHeight)!=null?Ye:X.clientHeight)!=null?ct:0}):Oe.bottom,$e=jT.value;let He=null,Qe=null;for(const[Ye,ct]of $e){if(!ct)continue;const st=vt("syncFocusToScroll.slot.getBoundingClientRect",()=>ct.getBoundingClientRect());st.bottom<=Pe||st.top>=je||(He==null&&(He=Ye),Qe=Ye)}if(He==null||Qe==null){const Ye=L.value;if(!Ye)return;const ct=we?{top:0}:vt("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>X.getBoundingClientRect()),st=vt("syncFocusToScroll.fallback.scrollTop",()=>qe(X,J,we)),pt=we?(()=>{const Mt=vt("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>Ye.getBoundingClientRect()),Ct=(we?0:ct.top)-Mt.top;return Math.max(0,Ct)})():(()=>{const Mt=be(Ye,X);return Math.max(0,st-Mt)})(),kt=we?vt("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var Mt,Ct,Et,qt;return(qt=(Et=(Ct=ce?.innerHeight)!=null?Ct:(Mt=J?.documentElement)==null?void 0:Mt.clientHeight)!=null?Et:X.clientHeight)!=null?qt:0}):vt("syncFocusToScroll.fallback.root.clientHeight",()=>X.clientHeight);return void ih(Vo(f0(pt+.5*Math.max(0,kt)),0,Math.max(0,Be.value.length-1)),!0)}ih(Math.round((He+Qe)/2),_)}}),{visibleNodeIndices:y0,nodeVisibilityHandles:rc,nodeVisibilityWatchStops:oh,nodeVisibilityFallbackTimers:Xb,clearVisibilityFallback:sh,markNodeVisible:ol,cleanupNodeVisibility:uN,destroyNodeVisibilityState:k0}=hse({isClient:P,shouldTrackVisibleNodeIndices:()=>Zi.value,shouldCleanupNodeVisibility:()=>zt.value,onNodeMarkedVisible:_=>{zt.value?Li():yr.value=Vo(_,0,Math.max(0,Be.value.length-1))},onNodeVisibilityCleaned:_=>{cn.delete(_)&&Cx()}}),{cleanupScrollListener:Qb,setupScrollListener:dN}=(function(_){const{isClient:H,virtualizationEnabled:X,listenerEnabled:J,scrollRootElement:ce,resolveScrollContainer:we,scheduleFocusSync:Le,onScroll:Fe}=_;let Ve=null,Oe=null;function Pe(){Ve&&(Ve(),Ve=null),Oe=null,ce.value=null}function je($e){const He=_.getScrollTop?_.getScrollTop($e):$e.scrollTop;return Math.max(0,Number.isFinite(He)?Math.abs(He):0)}return{cleanupScrollListener:Pe,setupScrollListener:function(){if(!H)return;if(!(($e=J?.value)!=null?$e:X.value))return void Pe();var $e;const He=we();if(!He)return void Pe();if(ce.value===He&&Ve)return;Pe(),Oe=je(He);const Qe=()=>{if(Fe?.(),X.value){const Ye=(function(ct){const st=je(ct),pt=Oe;Oe=st;const kt=Math.max(480,.75*(ct.clientHeight||0));return pt==null?st>kt?{immediate:!0}:void 0:Math.abs(st-pt)>kt?{immediate:!0}:void 0})(He);Ye?Le(Ye):Le()}};He.addEventListener("scroll",Qe,{passive:!0}),ce.value=He,Ve=()=>{He.removeEventListener("scroll",Qe)}}}})({isClient:P,virtualizationEnabled:zt,listenerEnabled:jb,scrollRootElement:Nu,resolveScrollContainer:ke,scheduleFocusSync:Li,onScroll:function(){const _=Ys.value;if(!_)return;const H=Ou();if(!H||(function(J){if(Wu()>=u0)return Iu=null,!1;const ce=Iu;if(ce==null)return!0;const we=Math.abs(J.scrollTop-ce)<=2;return we||(Iu=null),we})(H))return;const X=hx(H);X!=null?(X<-32||Math.abs(Math.max(0,X)-Math.max(0,_.distanceFromBottomPx))>32)&&fc("restore"):fc("restore")},getScrollTop:_=>{var H;const X=_.ownerDocument||((H=L.value)==null?void 0:H.ownerDocument)||document,J=_===X.documentElement||_===X.body||_===X.scrollingElement;return vt("scrollListener.getScrollTop",()=>qe(_,X,J))}});function ih(_,H=!1){const X=Vo(_,0,Math.max(0,Be.value.length-1));!H&&Math.abs(X-yr.value)<=1||(yr.value=X,$u())}function Vo(_,H,X){return Math.min(Math.max(_,H),X)}function b0(_=Be.value.length){const H=Bt();return!Number.isInteger(H)||H<0?_:Vo(H,0,_)}function x0(_){return _?.firstElementChild}function Jb(_,H){var X;return _?(X=_.matches)!=null&&X.call(_,H)?_:_.querySelector(H):null}function fN(_,H){_<1||_>6||(ie[_]=H)}function ex(){if(!io.value)return void(ne.value=0);const _=vt("updateExperimentContainerWidth.clientWidth",()=>{var H,X;return(X=(H=L.value)==null?void 0:H.clientWidth)!=null?X:0});ne.value=_>0?_:0}let Fu=null;function w0(){Fu?.disconnect(),Fu=null}const tx=Cd("ViewportDeferredMarkdownCodeBlockNode",Hi({loader:()=>Zn(null,null,function*(){return(yield vs(()=>import("./index5-DKcWNKrg.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:Rm,delay:0,suspensible:!1}),Rm);function nx(_){return _===tx}const ox=D(()=>p.value==="pre"?Fs:p.value==="shiki"?tx:iv);function sx(){var _;return((_=S.codeBlockProps)==null?void 0:_.showHeader)!==!1}function ix(_,H,X){const J=sc[H],ce=typeof J=="number"&&J>0;if(ui.value&&!ce&&!(function(we){return!!sn.value.paragraph&&(we.type==="paragraph"||we.type==="list_item"||we.type==="list")})(_)){const we=aE(_,X,j.value);if(we)return we}if(Qt.value&&_.type==="code_block"){const we=(function(Le){if(Le.type!=="code_block")return null;const Fe=Rx(Le,mh(Le));return nx(Fe)?"markdown":Fe===Fs?"pre":Fe===ox.value||Fe===iv?"monaco":null})(_);if(we==="monaco"||we==="markdown"||we==="pre")return(function(Le,Fe){var Ve,Oe,Pe;if(!Le||Le.type!=="code_block")return null;const je=Fe.rendererKind,$e=je!=="pre"&&Fe.showHeader!==!1,He=!!Le.diff;let Qe=0,Ye=500;if(je==="monaco"){const st=(Ve=Fe.monacoOptions)!=null?Ve:{},pt=pv(Le,st,Fe.width),kt=(function(Ct){const Et=typeof Ct?.fontSize=="number"&&Ct.fontSize>0?Ct.fontSize:12;return typeof Ct?.lineHeight=="number"&&Ct.lineHeight>0?Ct.lineHeight:Math.round(1.5*Et)})(st),Mt=(function(Ct,Et){var qt,Xt;const Nn=typeof((qt=Ct?.padding)==null?void 0:qt.top)=="number"?Ct.padding.top:Et?0:8,Ko=typeof((Xt=Ct?.padding)==null?void 0:Xt.bottom)=="number"?Ct.padding.bottom:Et?0:8;return Math.max(0,Nn)+Math.max(0,Ko)})(st,He);Ye=typeof st.MAX_HEIGHT=="number"&&st.MAX_HEIGHT>0?st.MAX_HEIGHT:500,Qe=Math.round(pt*kt+Mt)}else if(je==="markdown"){const st=pv(Le);Qe=Math.round(21*st+32)}else{const st=pv(Le);Qe=Math.round(28*st),Ye=Number.POSITIVE_INFINITY}const ct=Math.max(1,Math.min(Qe,Ye));return it({kind:"code-block",height:Math.round(ct+($e?40:0)),contentHeight:ct,rendererKind:je},He&&je==="monaco"?{diffInline:D2((Oe=Fe.monacoOptions)!=null?Oe:{},(Pe=Fe.width)!=null?Pe:0)}:{})})(_,{rendererKind:we,monacoOptions:S.codeBlockMonacoOptions,showHeader:sx(),width:X})}return null}NA(()=>{if(Gf.value,Yf>0)return;const _=Be.value,H=Yt();if(!_.length||!It.value)return eo=[],ro=[],Ks=-1,Gs.clear(),void(Ii.value=Zt);const X=ne.value||vt("estimatedNodeHeights.clientWidth",()=>{var Oe;return((Oe=L.value)==null?void 0:Oe.clientWidth)||0});if(!Number.isFinite(X)||X<=0)return eo=[],ro=[],Ks=-1,Gs.clear(),void(Ii.value=Zt);const J=(function(Oe){return[Math.round(Oe),ui.value,Qt.value,j.value,S.codeBlockMonacoOptions,sx(),p.value,sn.value,dv.value]})(X),ce=eo.length<=_.length&&(Le=J,(we=ro).length===Le.length&&we.every((Oe,Pe)=>Object.is(Oe,Le[Pe])));var we,Le;const Fe=ce&&Ks===H?_.length:ce?b0(_.length):0,Ve=ce?Array.from(Gs):[];eo.length=_.length;for(let Oe=Fe;Oe<_.length;Oe++)eo[Oe]=ix(_[Oe],Oe,X);for(const Oe of Ve)Oe>=0&&Oe<_.length&&Oe<Fe&&(eo[Oe]=ix(_[Oe],Oe,X));Gs.clear(),ro=J,Ks=H,Ii.value=eo,$9(Ii)},{flush:"sync"});const lc=D(()=>Ii.value);el=(function(_){let H=!0,X=[0],J="";function ce(Pe){var je;const $e=_.nodeHeights[Pe];if(Number.isFinite($e)&&$e>0)return $e;const He=_.parsedNodes.value[Pe],Qe=He?.type,Ye=!!((je=_.hasCustomParagraphComponent)!=null&&je.call(_)),ct=_.estimatedNodeHeights.value[Pe],st=ct?.height;if(!(function(kt,Mt,Ct){return!!(Ct&&Mt?.kind==="simple-text"&&(kt==="paragraph"||kt==="list_item"||kt==="list"))})(Qe,ct,Ye)&&Number.isFinite(st)&&st>0)return st;const pt=tse(He,_.getContainerWidth()||640);return Qe==="heading"||Qe==="paragraph"&&pt<=28&&(function(kt,Mt){if(Mt)return!1;const Ct=kt.children;return!Array.isArray(Ct)||!Ct.length||Ct.every(uE)})(He,Ye)?pt:Math.max(_.averageNodeHeight.value,pt)}function we(){var Pe;const je=_.parsedNodes.value.length,$e=_.getPrefixCacheKeyParts().join(":");if(!H&&J===$e)return X;const He=new Array(je+1);He[0]=0;for(let Qe=0;Qe<je;Qe++)He[Qe+1]=He[Qe]+(_.heightEstimationActive.value?ce(Qe):(Pe=_.nodeHeights[Qe])!=null?Pe:_.averageNodeHeight.value);return X=He,J=$e,H=!1,He}function Le(Pe){var je,$e;const He=_.parsedNodes.value.length;if(He<=0||Pe<=0)return 0;const Qe=we();if(Pe>=((je=Qe[He])!=null?je:0))return He-1;let Ye=0,ct=He-1,st=He-1;for(;Ye<=ct;){const pt=Ye+ct>>1;(($e=Qe[pt+1])!=null?$e:0)>=Pe?(st=pt,ct=pt-1):Ye=pt+1}return st}function Fe(Pe,je){var $e,He;if(Pe>=je)return 0;if(_.heightEstimationActive.value)return(function(ct,st){var pt,kt;const Mt=_.parsedNodes.value.length,Ct=B4(Math.trunc(ct),0,Mt),Et=B4(Math.trunc(st),Ct,Mt);if(Ct>=Et)return 0;const qt=we();return((pt=qt[Et])!=null?pt:0)-((kt=qt[Ct])!=null?kt:0)})(Pe,je);if(_.heightTreeSize.value!==_.parsedNodes.value.length){let ct=0;for(let st=Pe;st<je;st++)ct+=($e=_.nodeHeights[st])!=null?$e:_.averageNodeHeight.value;return ct}const Qe=_.heightSumTree.value,Ye=_.heightKnownTree.value;if(!Qe.length||!Ye.length){let ct=0;for(let st=Pe;st<je;st++)ct+=(He=_.nodeHeights[st])!=null?He:_.averageNodeHeight.value;return ct}return _.fenwickRangeSum(Qe,Pe,je)+(je-Pe-_.fenwickRangeSum(Ye,Pe,je))*_.averageNodeHeight.value}function Ve(Pe){var je;if(Pe<=0)return 0;const $e=_.parsedNodes.value;if(_.heightEstimationActive.value)return Le(Pe);if(_.heightTreeSize.value===$e.length&&_.heightSumTree.value.length&&_.heightKnownTree.value.length){const Qe=_.averageNodeHeight.value,Ye=_.heightSumTree.value,ct=_.heightKnownTree.value,st=Ct=>Ct<=0?0:_.fenwickRangeSum(Ye,0,Ct)+(Ct-_.fenwickRangeSum(ct,0,Ct))*Qe;let pt=0,kt=$e.length-1,Mt=$e.length-1;for(;pt<=kt;){const Ct=pt+kt>>1;st(Ct+1)>=Pe?(Mt=Ct,kt=Ct-1):pt=Ct+1}return Mt}let He=Pe;for(let Qe=0;Qe<$e.length;Qe++){const Ye=(je=_.nodeHeights[Qe])!=null?je:_.averageNodeHeight.value;if(He<=Ye)return Qe;He-=Ye}return Math.max(0,$e.length-1)}function Oe(){if(!_.heightEstimationActive.value)return 0;let Pe=0;const je=_.estimatedNodeHeights.value;for(let $e=0;$e<je.length;$e++){if(!je[$e])continue;const He=_.nodeHeights[$e];Number.isFinite(He)&&He>0||Pe++}return Pe}return{markFallbackHeightPrefixDirty:function(){H=!0},getFallbackNodeHeight:ce,estimateHeightRange:Fe,estimateIndexForOffset:Ve,estimateIndexForOffsetFromEnd:function(Pe){var je,$e;const He=_.parsedNodes.value;if(!He.length)return 0;if(Pe<=0)return Math.max(0,He.length-1);if(_.heightEstimationActive.value){const Ye=(je=we()[He.length])!=null?je:0;return Le(Math.max(0,Ye-Pe))}if(_.heightTreeSize.value===He.length){const Ye=Fe(0,He.length);return Ve(Math.max(0,Ye-Pe))}let Qe=Pe;for(let Ye=He.length-1;Ye>=0;Ye--){const ct=($e=_.nodeHeights[Ye])!=null?$e:_.averageNodeHeight.value;if(Qe<=ct)return Ye;Qe-=ct}return 0},getEstimatedNodeHeightCount:Oe,buildVirtualHeightSummary:function(Pe){var je;const $e=_.parsedNodes.value.length;return{totalNodes:$e,measuredCount:_.heightStats.count,estimatedCount:Oe(),averageNodeHeight:_.averageNodeHeight.value,topSpacerHeight:Pe.topSpacerHeight,bottomSpacerHeight:Pe.bottomSpacerHeight,estimatedTotalHeight:Fe(0,$e),width:(je=Pe.width)!=null?je:_.getContainerWidth()}}}})({parsedNodes:Be,nodeHeights:sc,heightStats:pi,heightTreeSize:h0,heightSumTree:ZT,heightKnownTree:XT,averageNodeHeight:Rb,heightEstimationActive:io,estimatedNodeHeights:lc,getContainerWidth:Ni,hasCustomParagraphComponent:()=>!!sn.value.paragraph,getPrefixCacheKeyParts:()=>{var _;const H=fd(ne.value||vt("getFallbackHeightPrefix.clientWidth",()=>{var J;return((J=L.value)==null?void 0:J.clientWidth)||0})),X=((_=o.virtualScroll)==null?void 0:_.measurementKey)==null?"":String(o.virtualScroll.measurementKey);return[Be.value.length,pi.count,Math.round(pi.total),Math.round(100*Rb.value),X,H,io.value?1:0,dv.value,fe.value,sn.value.paragraph?1:0]},fenwickRangeSum:sN}),et(()=>Be.value.length,_=>{var H;hi(),_<=0?Qf():(_<h0.value&&(H=_,p0(),ic(()=>JT(H))),_!==h0.value&&Xf(_))},{immediate:!0});const hN=D(()=>{if(!zt.value)return Be.value.map((J,ce)=>({node:J,index:ce}));const _=Be.value.length,H=Vo(jo.start,0,_),X=Vo(jo.end,H,_);return Be.value.slice(H,X).map((J,ce)=>({node:J,index:H+ce}))}),_0=D(()=>zt.value?nc(0,Math.min(jo.start,Be.value.length)):0),S0=D(()=>{if(!zt.value)return 0;const _=Be.value.length;return nc(Math.min(jo.end,_),_)});function rx(){return el.buildVirtualHeightSummary({topSpacerHeight:_0.value,bottomSpacerHeight:S0.value,width:ea()})}function pN(){const _=Be.value,H=rx();return Ot(it({},H),{probe:{paragraphReady:!!j.value.paragraph,listItemReady:!!j.value.listItem,listWrapperOverhead:j.value.listWrapperOverhead,headingReadyLevels:Object.entries(j.value.headings).filter(([,X])=>!!X).map(([X])=>Number(X))},nodes:_.map((X,J)=>{var ce,we,Le,Fe,Ve,Oe,Pe,je,$e;return{index:J,type:X.type,estimateKind:(we=(ce=lc.value[J])==null?void 0:ce.kind)!=null?we:null,rendererKind:(Fe=(Le=lc.value[J])==null?void 0:Le.rendererKind)!=null?Fe:null,estimatedHeight:(Oe=(Ve=lc.value[J])==null?void 0:Ve.height)!=null?Oe:null,estimatedContentHeight:(je=(Pe=lc.value[J])==null?void 0:Pe.contentHeight)!=null?je:null,measuredHeight:($e=sc[J])!=null?$e:null}})})}function C0(){return o.indexKey!=null?String(o.indexKey):qo.value?`virtual-${no()}`:"markdown-renderer"}function lx(_){const H=String(_),X=`${C0()}-`;if(!H.startsWith(X))return null;const J=H.slice(X.length).match(/^(\d+)(?:$|-)/);if(!J)return null;const ce=Number(J[1]);return!Number.isInteger(ce)||ce<0||ce>=Be.value.length?null:ce}function no(){var _,H,X;const J=(_=o.virtualScroll)==null?void 0:_.sessionKey;return String(J!=null&&J!==""?J:(X=(H=o.indexKey)!=null?H:S.customId)!=null?X:Pn)}function bo(){var _;const H=(_=o.virtualScroll)==null?void 0:_.threadKey;return H==null||H===""?void 0:String(H)}const mN=D(()=>{var _,H,X;return(X=bo())!=null?X:String((H=(_=o.indexKey)!=null?_:S.customId)!=null?H:Pn)});function A0(_){var H;return(_??"")===((H=bo())!=null?H:"")}function br(){var _,H,X;return H=(_=o.virtualScroll)==null?void 0:_.measurementKey,X=(function(){const J=p.value;return(function(ce){var we,Le;const Fe=ce.renderer,Ve=Fe==="monaco"?ce.codeBlockMonacoOptions:void 0,Oe=ce.codeBlockProps,Pe=Fe==="shiki";return[ce.isDark?"dark":"light",Fe==="monaco"?"code-rich":Fe==="pre"?"code-pre":"code-shiki",ce.codeBlockStream===!1?"code-static":"code-stream",Do(ce.codeBlockMinWidth),Do(ce.codeBlockMaxWidth),...Pe?[qee((we=Oe?.themes)!=null?we:ce.themes,(Le=Oe?.langs)!=null?Le:ce.langs)]:[],Do(Ve?.fontSize),Do(Ve?.lineHeight),Do(Ve?.fontFamily),Do(Ve?.tabSize),Do(Ve?.MAX_HEIGHT),Do(Ve?.wordWrap),Do(Ve?.wrappingIndent),Do(Ve?.padding),Do(Oe?.showHeader),Do(Oe?.showCopyButton),Do(Oe?.showExpandButton),Do(Oe?.showPreviewButton),Do(Oe?.showCollapseButton),Do(Oe?.showFontSizeButtons)].join("\0")})({renderer:J,isDark:S.isDark,codeBlockStream:S.codeBlockStream,codeBlockMinWidth:S.codeBlockMinWidth,codeBlockMaxWidth:S.codeBlockMaxWidth,codeBlockMonacoOptions:J==="monaco"?S.codeBlockMonacoOptions:void 0,codeBlockProps:S.codeBlockProps,themes:J==="shiki"?S.themes:void 0,langs:J==="shiki"?S.langs:void 0})})(),[H==null?"":String(H),X].join("\0")}function ea(){return Ni()}const rh=D(()=>fd(ea())),Qs=D(()=>[br(),rh.value].join("\0")),gN=D(()=>{var _;return qo.value?["virtual",(_=bo())!=null?_:"",no(),Qs.value].join("\0"):o.indexKey});function ac(){Gb.value+=1}function M0(_){return!(!_||!Number.isInteger(_.index)||_.index<0||_.index>=Be.value.length||_.sessionKey!==no()||_.threadKey!==bo()||_.layoutEpochKey!==Qs.value)}function ax(_){const H=String(_),X=Qi.get(H);return X?M0(X)?X.index:null:lx(H)}function cx(_="async-node"){(Zs.size||Qi.size)&&(Zs.clear(),Qi.clear(),ac(),Gn(_))}const cc=Jt(Oy,null),E0={reportHeight(_,H){if(!tn.value)return;const X=ax(_);if(X==null)return;const J=Xi.get(X);if(!J)return;const ce=Number(H),we=zb(X,J);(function(Le,Fe,Ve={}){ic(()=>Wb(Le,Fe,Ve))})(X,Number.isFinite(ce)&&ce>0?Math.max(ce,we||0):we)},markPending(_){if(!tn.value)return;const H=lx(_);H!=null&&(function(X,J){var ce;const we=Qi.get(X);if(we&&M0(we))return Zs.set(X,Math.max(0,(ce=Zs.get(X))!=null?ce:0)+1),ac(),void Gn("async-node");Zs.set(X,1),Qi.set(X,(function(Le){return{index:Le,sessionKey:no(),threadKey:bo(),layoutEpochKey:Qs.value}})(J)),ac(),Gn("async-node")})(String(_),H)},markSettled(_){if(!tn.value)return;const H=String(_),X=ax(_);(X!=null||(function(J){return Zs.has(String(J))})(H))&&(function(J){var ce;const we=(ce=Zs.get(J))!=null?ce:0;return!(we<=0||(we<=1?(Zs.delete(J),Qi.delete(J)):Zs.set(J,we-1),ac(),we===1&&Gn("async-node"),0))})(H)&&X!=null&&xr()}};function vN(){let _=0;for(const H of Xi.values())_+=vt("getVisibleDomHeight.offsetHeight",()=>{var X;return(X=H?.offsetHeight)!=null?X:0});return Math.ceil(Math.max(0,_))}In(Oy,{reportHeight(_,H){E0.reportHeight(_,H),cc?.reportHeight(_,H)},markPending(_){E0.markPending(_),cc?.markPending(_)},markSettled(_){E0.markSettled(_),cc?.markSettled(_)}});let T0,N0=null,uc=null;function lh(_){return _!==!1&&_!=null&&_!==""}function ux(){return zt.value?(function(){if(!zt.value)return!0;const _=Be.value.length,H=Vo(jo.start,0,_),X=Vo(jo.end,H,_);if(H>=X)return!0;for(let J=H;J<X;J++)if(!cn.has(J)||dh(J)&&!Xi.has(J))return!1;return!0})():te.value>=eh.value}function I0(){return lt.value===!0&&!mt.value&&g0.value===0&&nl.size===0&&kr.size===0&&Xs==null&&ux()}function dx(){var _,H;if(((_=o.virtualScroll)==null?void 0:_.settleMode)!=="manual"||N0===no()&&T0===bo())return!0;const X=(H=o.virtualScroll)==null?void 0:H.settledToken;return!!lh(X)&&uc===Gu(X)}function L0(){return I0()&&dx()}function yN(_,H){return H.totalNodes<=0?_==="final"?"final":"estimate":H.measuredCount>=H.totalNodes?_==="final"?"final":"measured":H.measuredCount>0||H.estimatedCount>0?"mixed":"estimate"}function ta(_="manual",H){const X=rx(),J=(function(ce){return ce||(lt.value!==!0?Be.value.length>0?"streaming":"estimating":!ux()||kr.size>0||Xs!=null?"measuring":L0()?"settled":"settling")})(H);return{sessionKey:no(),threadKey:bo(),phase:J,nodeCount:X.totalNodes,liveRange:{start:jo.start,end:jo.end},renderedCount:te.value,measuredCount:X.measuredCount,estimatedCount:X.estimatedCount,averageNodeHeight:X.averageNodeHeight,topSpacerHeight:X.topSpacerHeight,bottomSpacerHeight:X.bottomSpacerHeight,visibleDomHeight:vN(),totalHeight:fx(),width:X.width,final:lt.value===!0,stable:L0(),confidence:yN(J,X),reason:_}}function Ou(){const _=Nu.value||ke(),H=L.value;if(!_||!H)return null;const X=_.ownerDocument||H.ownerDocument||document,J=_===X.documentElement||_===X.body||_===X.scrollingElement,ce=vt("getScrollBox.scrollTop",()=>qe(_,X,J)),we=vt("getScrollBox.scrollHeight",()=>{var Fe,Ve,Oe,Pe,je;return J?Math.max((Ve=(Fe=X.documentElement)==null?void 0:Fe.scrollHeight)!=null?Ve:0,(Pe=(Oe=X.body)==null?void 0:Oe.scrollHeight)!=null?Pe:0,(je=_.scrollHeight)!=null?je:0):_.scrollHeight}),Le=vt("getScrollBox.clientHeight",()=>{var Fe;return J?((Fe=X.documentElement)==null?void 0:Fe.clientHeight)||_.clientHeight||0:_.clientHeight});return{root:_,doc:X,isViewportRoot:J,scrollTop:ce,scrollHeight:we,clientHeight:Le}}function fx(){const _=Be.value.length,H=Math.max(0,nc(0,_)),X=vt("getRendererLogicalHeight.offsetHeight",()=>{var ce,we;return(we=(ce=L.value)==null?void 0:ce.offsetHeight)!=null?we:0}),J=Math.max(0,X>0?X:vt("getRendererLogicalHeight.scrollHeight",()=>{var ce,we;return(we=(ce=L.value)==null?void 0:ce.scrollHeight)!=null?we:0}));return _<=0?Math.ceil(X):zt.value?H>0?Math.max(1,Math.ceil(H),(function(){let ce=_0.value+S0.value;for(const we of cn.values())we&&(ce+=Math.max(0,vt("getVirtualizedDomLogicalHeight.offsetHeight",()=>we.offsetHeight||0)));return Math.ceil(Math.max(0,ce))})(),(function(ce,we){return ce<=0||we<=0?0:we<=ce+Math.max(512,.05*ce)?Math.ceil(we):0})(H,J)):Math.max(1,Math.ceil(J)):tn.value?H>0||pi.count>0||el.getEstimatedNodeHeightCount()>0?(us.value&&te.value,Math.max(1,Math.ceil(J),Math.ceil(H))):Math.ceil(J):Math.max(1,Math.ceil(J),Math.ceil(H))}function hx(_){const H=L.value;if(!H)return null;const X=vt("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>H.getBoundingClientRect());return(function(ce){return ce.isViewportRoot?ce.clientHeight:vt("getViewportBottomInRoot.getBoundingClientRect",()=>ce.root.getBoundingClientRect().bottom)})(_)-X.bottom}function kN(_={}){const H=_.requireViewport!==!1,X=(function(we=64){const Le=Ou(),Fe=L.value;if(!Le||!Fe)return!1;const Ve=(function(Pe){if(Pe.isViewportRoot)return{top:0,bottom:Pe.clientHeight};const je=vt("getVirtualViewportRect.getBoundingClientRect",()=>Pe.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Le),Oe=vt("isRendererNearVirtualViewport.getBoundingClientRect",()=>Fe.getBoundingClientRect());return Oe.bottom>=Ve.top-we&&Oe.top<=Ve.bottom+we})();if(H&&!X)return null;const J=(function(){const we=Ou(),Le=L.value;if(!we||!Le||Math.max(0,we.scrollHeight-we.scrollTop-we.clientHeight)>64)return null;const Fe=hx(we);return Fe==null?null:Fe>=-8&&Fe<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Fe)}:null})();if(J)return{anchor:J,captured:!0};const ce=Ob();if(ce)return{anchor:{type:"node",nodeIndex:ce.nodeIndex,offsetWithinNodePx:ce.offsetWithinNodePx},captured:X};if(_.allowFallback===!0){const we=(function(){const Le=Be.value.length;return Le<=0?null:{type:"node",nodeIndex:Vo(yr.value,0,Math.max(0,Le-1)),offsetWithinNodePx:0}})();return we?{anchor:we,captured:!1}:null}return null}function $0(_){let H=2166136261;for(let X=0;X<_.length;X++)H^=_.charCodeAt(X),H=Math.imul(H,16777619);return(H>>>0).toString(36)}function bN(_,H){let X=_;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X^=31,X=Math.imul(X,16777619),X}const xN=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function ah(_,H=new WeakSet,X=0){if(_==null||typeof _=="number"||typeof _=="boolean")return String(_);if(typeof _=="string")return`s:${(function(J){const ce=J.length>8192?`${J.slice(0,8192)}...${J.length}`:J;return`${J.length}:${$0(ce)}`})(_)}`;if(typeof _=="function")return"fn";if(typeof _!="object")return typeof _;if(H.has(_))return"cycle";if(X>=6)return"max-depth";H.add(_);try{if(Array.isArray(_)){if(_.length<=160){const Oe=[];for(let Pe=0;Pe<_.length;Pe++)Oe.push(ah(_[Pe],H,X+1));return`a:${_.length}:${Oe.join(",")}`}const we=[],Le=[],Fe=Math.max(0,_.length-32);let Ve=2166136261;for(let Oe=0;Oe<_.length;Oe++){const Pe=ah(_[Oe],H,X+1);Ve=bN(Ve,Pe),Oe<32&&we.push(Pe),Oe>=Fe&&Le.push(Pe)}return[`a:${_.length}`,`h=${we.join(",")}`,`t=${Le.join(",")}`,`all=${(Ve>>>0).toString(36)}`].join(":")}const J=_,ce=Object.keys(J).filter(we=>{const Le=J[we];return we!=="parent"&&we!=="el"&&we!=="component"&&(Le==null||typeof Le=="string"||typeof Le=="number"||typeof Le=="boolean"||xN.has(we))}).sort();return`o:${ce.length}:${ce.map(we=>`${we}=${ah(J[we],H,X+1)}`).join(";")}`}finally{H.delete(_)}}let F0=-1,O0="",na=[2166136261];function Bu(_){const H=Be.value[_];return H?$0(ah(H)):""}function wN(_,H){let X=_;for(let J=0;J<H.length;J++)X^=H.charCodeAt(J),X=Math.imul(X,16777619);return X>>>0}function B0(){var _,H;const X=fe.value;if(F0===X)return O0;const J=Be.value.length;let ce=b0(J);(F0!==X-1||ce>J||na.length<ce+1)&&(ce=0),ce===0?na=[2166136261]:na.length=ce+1;for(let we=ce;we<J;we++){const Le=Bu(we);na[we+1]=wN((_=na[we])!=null?_:2166136261,Le)}return na.length=J+1,O0=(((H=na[J])!=null?H:2166136261)>>>0).toString(36),F0=X,O0}function dc(_,H={}){var X;const J=H.includeHeightCache===!0,ce=(X=H.includeContentHash)!=null?X:J,we=J?(function(Fe){const Ve=(function(){var Ye,ct;const st=Number((ct=(Ye=o.virtualScroll)==null?void 0:Ye.heightCacheLimit)!=null?ct:5e3);return!Number.isFinite(st)||st<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(st))})();if(!Number.isFinite(Ve)||Fe.length<=Ve)return Fe;const Oe=new Map,Pe=Ye=>{!Ye||Oe.size>=Ve||Oe.set(Ye.index,Ye)},je=Be.value.length,$e=Vo(jo.start-2*ns.value,0,je),He=Vo(jo.end+2*ns.value,$e,je);for(const Ye of Fe)Ye.index>=$e&&Ye.index<He&&Pe(Ye);const Qe=Math.max(1,Math.ceil(Fe.length/Ve));for(let Ye=0;Ye<Fe.length&&Oe.size<Ve;Ye+=Qe)Pe(Fe[Ye]);for(let Ye=Fe.length-1;Ye>=0&&Oe.size<Ve;Ye-=Qe)Pe(Fe[Ye]);return Array.from(Oe.values()).sort((Ye,ct)=>Ye.index-ct.index).slice(0,Ve)})(nN().map(Fe=>{var Ve;const Oe=Be.value[Fe.index];return Oe?Ot(it({},Fe),{nodeType:String((Ve=Oe.type)!=null?Ve:""),signature:Bu(Fe.index)}):null}).filter(Fe=>!!Fe)):[],Le=kN({allowFallback:H.allowAnchorFallback===!0,requireViewport:H.requireViewport});return Le||we.length||H.includeEmptyState===!0?Ot(it({sessionKey:_.sessionKey,threadKey:_.threadKey},Le?{anchor:Le.anchor,anchorCaptured:Le.captured}:{anchorCaptured:!1}),{metrics:_,width:_.width,contentHash:ce?B0():void 0,measurementKey:br()||void 0,heightCache:we.length?we:void 0}):null}function R0(_){var H,X;const J=Ou();if(!J)return;const ce=(function(Fe){const Ve=L.value;if(!Ve)return null;const Oe=be(Ve,Fe.root),Pe=Be.value.length,je=vt("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Ve.offsetHeight||0),$e=Math.max(0,je>0?je:Pe>0?vt("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Ve.scrollHeight||0):0),He=fx();return Oe+Math.max($e,He)})(J);if(ce==null)return;const we=Math.max(0,_.distanceFromBottomPx),Le=Math.max(0,ce-J.clientHeight-we);(function(Fe){u0=Wu()+120,Iu=Fe})(Le),J.isViewportRoot?(X=(H=J.doc.defaultView)==null?void 0:H.scrollTo)==null||X.call(H,0,Le):$4(J.root,J.doc,Le,{isReverseFlexScrollRoot:Ne,getNormalizedScrollTop:qe})}const D0=[];function px(){if(P)for(Ql!=null&&(ge?.(Ql),Ql=null);D0.length;){const _=D0.pop();_!=null&&window.clearTimeout(_)}}function fc(_){const H=!!Ys.value;Ys.value=null,u0=0,Iu=null,px(),H&&_&&Gn(_)}function hc(){if(!Ys.value||!P||Ql!=null)return;const _=()=>{Ql=null;const H=Ys.value;H&&R0(H)};Ql=Te?Te(_):null,Ql==null&&_()}function mx(_,H={}){const X=Be.value.length;return X<=0?[]:_.filter(J=>!(!Number.isInteger(J.index)||J.index<0||J.index>=X)&&!(!Number.isFinite(J.height)||J.height<=0)&&!(H.requireSignature&&!J.signature)&&!(H.requireCompatibilityMetadata&&!J.nodeType&&!J.signature)&&(function(ce){var we;const Le=Be.value[ce.index];return!(!Le||ce.nodeType&&ce.nodeType!==String((we=Le.type)!=null?we:"")||ce.signature&&ce.signature!==Bu(ce.index))})(J))}function gx(_){const H=fd(ea()),X=fd(_);return H!==-1&&X!==-1&&H===X}function P0(_){var H;const X=Number(_?.width);if(Number.isFinite(X)&&X>0)return X;const J=Number((H=_?.metrics)==null?void 0:H.width);return Number.isFinite(J)&&J>0?J:null}function vx(_){var H;return _.sessionKey===no()&&!!A0(_.threadKey)&&((H=_.measurementKey)!=null?H:"")===br()&&!!gx(P0(_))&&!!(function(X){const J=X.heightCache;return!!J?.length&&(yx(X)?J.some(ce=>!!(ce.nodeType||ce.signature)):J.some(ce=>!!ce.signature))})(_)}function yx(_){return!!(_.contentHash&&_.contentHash===B0())}function _N(_){return!yx(_)}let oa=null,sa=null,ch=null,Ru=null,Du=null;function H0(_){var H;const X=_.map(ce=>{var we,Le;return[ce.index,Math.round(10*ce.height),(we=ce.nodeType)!=null?we:"",(Le=ce.signature)!=null?Le:""].join("")}).join(""),J=fd(ea());return[(H=bo())!=null?H:"",no(),br(),Be.value.length,J,_.length,$0(X)].join(":")}function kx(_=(H=>(H=o.virtualScroll)==null?void 0:H.heightCache)()){if(!tn.value||!_?.length||Be.value.length<=0||!gx((H=o.virtualScroll)==null?void 0:H.heightCacheWidth))return!1;var H;const X=mx(_,{requireSignature:!0});if(!X.length)return!1;const J=H0(X);return J===oa?(sa="standalone",!0):(Ub(X,{mode:"merge"}),hi(),oa=J,sa="standalone",Uu(),Gn("restore"),!0)}function W0(_,H={}){var X,J,ce;if(!tn.value||!_||_.sessionKey!==no()||!A0(_.threadKey)||Be.value.length<=0)return!1;const we=!!((X=_.heightCache)!=null&&X.length)&&!uh(),Le=!_.anchor||_.anchorCaptured===!1&&H.allowUncapturedAnchor!==!0?null:_.anchor,Fe=H.restoreAnchor===!0&&!!Le&&!uh()&&Number(P0(_))>0;let Ve=!1;if((J=_.heightCache)!=null&&J.length&&vx(_)){const Pe=mx(_.heightCache,{requireCompatibilityMetadata:!_.contentHash,requireSignature:_N(_)});Pe.length&&(Ub(Pe,{mode:"merge"}),hi(),oa=H0(Pe),sa="restore",Uu(),Ve=!0)}if(we||Fe)return!1;if(!H.restoreAnchor||!Le)return Ve&&Gn("restore"),!0;const Oe=(function(Pe,je){var $e;const He=Pe.anchor,Qe=He?He.type==="bottom"?`bottom:${Math.round(He.distanceFromBottomPx)}`:`node:${He.nodeIndex}:${Math.round(He.offsetWithinNodePx)}`:"none";return[($e=bo())!=null?$e:"",no(),br(),rh.value,je,Qe].join(":")})(_,(ce=H.restoreToken)!=null?ce:"imperative");return ch===Oe?(Ve&&Gn("restore"),!0):(ch=Oe,(function(Pe){const je=()=>{if(Pe.type==="node")return fc(),void Bb({nodeIndex:Pe.nodeIndex,offsetWithinNodePx:Pe.offsetWithinNodePx});if(Zf(),oc.value=null,Ys.value=Pe,px(),R0(Pe),P)for(const $e of[0,120,280,480])D0.push(window.setTimeout(()=>{const He=Ys.value;He&&R0(He)},$e))};(function($e){if(!zt.value)return!1;const He=Be.value.length;return!(He<=0||(yr.value=$e.type==="node"?Vo($e.nodeIndex,0,He-1):He-1,$u(),0))})(Pe)?yt(je):je()})(Le),Gn("restore"),!0)}function uh(){const _=ea();return Number.isFinite(_)&&_>0}function bx(_){var H;return _.sessionKey===no()&&!!A0(_.threadKey)&&(Be.value.length<=0||!(!((H=_.heightCache)!=null&&H.length)||uh())||!(!(_.anchor&&Number(P0(_))>0)||uh()))}function z0(){_t.clear();for(const _ of Object.keys(sc)){const H=Number(_);Number.isInteger(H)&&H>=0&&H<Be.value.length&&Hb(H)}}function Pu(){Xs!=null&&(ge?.(Xs),Xs=null),X0()}function xx(){return!P||ze?Promise.resolve():new Promise(_=>{let H=!1,X=null;const J=()=>{H||(H=!0,X!=null&&window.clearTimeout(X),_())};if(Te)return Te(J),void(X=window.setTimeout(J,50));X=window.setTimeout(J,0)})}function U0(_,H=bo(),X=Qs.value){return no()===_&&bo()===H&&Qs.value===X}function q0(){return Zn(this,arguments,function*(_={}){var H,X,J,ce,we;const Le=no(),Fe=bo(),Ve=Qs.value,Oe=(H=_.frames)!=null?H:2,Pe=(X=_.timeoutMs)!=null?X:120,je=(J=_.reason)!=null?J:"manual",$e=_.expectedSettledTokenKey,He=_.flushPendingTimers===!0,Qe=ta(je),Ye=()=>Ot(it({},Qe),{phase:Qe.final?"settling":Qe.phase,stable:!1,confidence:Qe.confidence==="final"?"mixed":Qe.confidence,reason:je}),ct=()=>U0(Le,Fe,Ve)&&($e==null||zu()===$e);for(let Mt=0;Mt<Oe;Mt++){if(yield yt(),!ct()||(yield xx(),!ct()))return Ye();xr(),Pu()}if(yield(function(Mt){return!P||Mt<=0?Promise.resolve():new Promise(Ct=>window.setTimeout(Ct,Mt))})(Pe),!ct()||(He&&Zb(),xr(),Pu(),!ct()))return Ye();const st=I0();st&&(N0=Le,T0=Fe,((ce=o.virtualScroll)==null?void 0:ce.settleMode)==="manual"&&$e!=null&&lh((we=o.virtualScroll)==null?void 0:we.settledToken)&&zu()===$e&&(uc=Gu(o.virtualScroll.settledToken)));const pt=ct()&&st&&dx(),kt=ta(je,pt?"final":void 0);return Y0(kt,!0),kt})}let j0="content",ia=null,ra=null,V0=0,Hu=null,pc=null,K0=null,G0=null;function Wu(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function wx(_){var H,X;const J=Hu;if(!J)return!0;const ce=(X=(H=o.virtualScroll)==null?void 0:H.heightDiffThresholdPx)!=null?X:1;return Math.abs(_.totalHeight-J.totalHeight)>ce||_.sessionKey!==J.sessionKey||_.phase!==J.phase||_.stable!==J.stable||_.final!==J.final||_.threadKey!==J.threadKey||_.nodeCount!==J.nodeCount||_.measuredCount!==J.measuredCount||_.width!==J.width}function zu(_=(H=>(H=o.virtualScroll)==null?void 0:H.settledToken)()){return Do(_)}function _x(_,H){var X,J;return[_,H.sessionKey,(X=H.threadKey)!=null?X:"",br(),B0(),Do((J=o.virtualScroll)==null?void 0:J.settledToken),Math.round(H.totalHeight),Math.round(H.width)].join("\0")}function Uu(){K0=null,G0=null,pc=null}function SN(_){const H=_.heightCache;return H?.length?H0(H):""}function qu(_){var H,X,J;const ce=_.metrics,we=_.anchor?(Le=_.anchor).type==="bottom"?`bottom:${Math.round(Le.distanceFromBottomPx)}`:`node:${Le.nodeIndex}:${Math.round(Le.offsetWithinNodePx)}`:"none";var Le;return[_.sessionKey,(H=_.threadKey)!=null?H:"",(X=_.measurementKey)!=null?X:br(),(J=_.contentHash)!=null?J:"",SN(_),we,_.anchorCaptured?1:0,ce.liveRange.start,ce.liveRange.end,ce.renderedCount,ce.nodeCount,Math.round(ce.totalHeight),Math.round(ce.width),ce.phase,ce.stable?1:0].join("\0")}function Y0(_,H=!1){if(!tn.value||(function(Le=!1){return!Le&&qo.value&&!qs.value})(H))return;const X=H||wx(_),J=(function(Le,Fe=!1){return Fe||Le.stable||Le.phase==="final"?{state:dc(Le,{includeHeightCache:!0})}:{state:dc(Le)}})(_,H),ce=J.state,we=!!(ce&&(X||(function(Le,Fe=!1){return!!Fe||qu(Le)!==pc})(ce,H)));if(X&&(R(_),Hu=_,V0=Wu()),ce&&we&&(z(ce),ce.anchor&&W(ce.anchor),pc=qu(ce)),_.stable){const Le=_x("settled",_);if(Le!==K0){K0=Le;const Fe=dc(_,{includeHeightCache:!0});Fe&&(z(Fe),pc=qu(Fe)),(function(Ve){s("render-settled",Ve)})(_)}}if(_.phase==="final"){const Le=_x("final",_);if(Le!==G0){G0=Le;const Fe=dc(_,{includeHeightCache:!0});Fe&&(z(Fe),pc=qu(Fe)),(function(Ve){s("render-final",Ve)})(_)}}}function Z0(){ia!=null&&(ge?.(ia),ia=null),ra!=null&&P&&(window.clearTimeout(ra),ra=null)}function Sx(){ia=null,ra=null,(function(_){if(kr.size>0||Xs!=null)return!0;switch(_){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(j0)&&(xr(),Pu()),Y0(ta(j0))}function Gn(_){var H,X;if(!tn.value||(j0=_,ia!=null||ra!=null))return;const J=Math.max(0,(X=(H=o.virtualScroll)==null?void 0:H.emitIntervalMs)!=null?X:32),ce=Math.max(0,J-(Wu()-V0)),we=()=>{ra=null,ia=Te?Te(Sx):null,ia==null&&Sx()};P&&ce>0?ra=window.setTimeout(we,ce):we()}function Cx(){Fb.value+=1}function dh(_){if(us.value&&_>=te.value){const H=Be.value[_],X=tt.value===!0&&lt.value!==!0&&_>=Be.value.length-2,J=H?.type==="code_block"||H?.type==="image"||H?.type==="mermaid"||H?.type==="infographic";if(!X||J)return!1}return!Zi.value||_<xn.value||y0.value.has(_)}function mc(_){const H=oh.get(_);H&&(H(),oh.delete(_));const X=rc.get(_);X&&(X.destroy(),rc.delete(_)),sh(_)}function fh(_,H){let X=!1;if(H){const we=cn.get(_);cn.set(_,H),we!==H&&(X=!0)}else cn.delete(_)&&(X=!0);if(X&&Cx(),H||sh(_),!qb.value||!le)return mc(_),void(H&&Zi.value&&ol(_,!0));if(!zt.value&&Zi.value&&!q.value&&rc.size>=re.value&&(q.value||(q.value=!0,k0()),!qb.value||!le))return mc(_),void(H&&ol(_,!0));if(_<xn.value&&!zt.value||y0.value.has(_))return mc(_),void ol(_,!0);if(!H)return void mc(_);mc(_);const J=le(H,{rootMargin:Ae.value});if(!J)return;rc.set(_,J),ol(_,J.isVisible.value),Zi.value&&(function(we){if(!P||!Zi.value)return;sh(we);const Le=we%17*23,Fe=window.setTimeout(()=>{if(Xb.delete(we),!Zi.value||y0.value.has(we))return;const Ve=cn.get(we);if(!Ve)return;const Oe=ke(Ve),Pe=Ve.ownerDocument||document,je=Pe.defaultView||window,$e=!Oe||Oe===Pe.documentElement||Oe===Pe.body,He=!$e&&Oe?vt("nodeVisibilityFallback.root.getBoundingClientRect",()=>Oe.getBoundingClientRect()):null,Qe=$e?0:He.top,Ye=$e?vt("nodeVisibilityFallback.clientHeight",()=>{var st,pt;return(pt=(st=je.innerHeight)!=null?st:Oe?.clientHeight)!=null?pt:0}):He.bottom,ct=vt("nodeVisibilityFallback.node.getBoundingClientRect",()=>Ve.getBoundingClientRect());ct.bottom>=Qe-500&&ct.top<=Ye+500&&ol(we,!0)},1800+Le);Xb.set(we,Fe)})(_);let ce=null;ce=et(()=>J.isVisible.value,we=>{if(we){sh(_),ol(_,!0),ce?.(),oh.delete(_),rc.get(_)===J&&rc.delete(_);try{J.destroy()}catch{}}},{immediate:!0}),oh.set(_,ce),zt.value&&Li()}function X0(){Xs=null,ic(()=>{let _=!1;for(const[H,X]of kr)kr.delete(H),Xi.get(H)===X.el&&Jl.get(H)===X.version&&(_=Wb(H,X.height,{allowShrink:X.allowShrink})||_);return _})}function gc(){Xs!=null&&(ge?.(Xs),Xs=null),kr.clear()}function hh(_,H){(function(X,J,ce){var we;if(!Number.isFinite(ce)||ce<=0||Xi.get(X)!==J)return;const Le=Jl.get(X);if(Le==null)return;const Fe=Be.value[X],Ve=mt.value&&lt.value!==!0&&!((we=o.nodes)!=null&&we.length)&&X>=Be.value.length-2,Oe=!(Fe?.loading===!0||Ve),Pe=kr.get(X),je=Pe?Pe.allowShrink&&Oe:Oe,$e=Pe&&!je?Math.max(Pe.height,ce):ce;kr.set(X,{height:$e,allowShrink:je,version:Le,el:J}),Xs==null&&(Xs=Te?Te(X0):null,Xs==null&&X0())})(_,H,zb(_,H))}function xr(){for(const[_,H]of Xi)H&&hh(_,H)}function Ax(){co?.disconnect(),co=null,Vt.clear()}function Q0(){for(;Jf.length;)nh(Jf.pop())}et(qs,_=>{_&&Gn("content")},{flush:"post"}),t({getVirtualMetrics:ta,captureVirtualState:function(_={}){var H;return dc(ta("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:_.allowFallbackAnchor===!0,requireViewport:_.requireViewport===!0,includeEmptyState:(H=_.includeEmptyState)==null||H})},restoreVirtualState:function(_,H={}){const X=H.restoreAnchor===!0,J=H.restoreToken==null?"imperative":String(H.restoreToken);Ru=_,Du={restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0},!W0(_,{restoreAnchor:X,restoreToken:J,allowUncapturedAnchor:H.allowUncapturedAnchor===!0})&&bx(_)||(Ru=null,Du=null)},forceMeasure:function(_="manual"){return Zn(this,null,function*(){yield yt(),yield xx(),xr(),Pu(),yield yt();const H=ta(_);return Y0(H,!0),H})},settle:q0,scrollToNode:function(_,H="start"){fc(),Zf();const X=Be.value.length;if(X<=0)return;const J=Vo(_,0,X-1),ce=()=>{var we;const Le=GT({nodeIndex:J,offsetWithinNodePx:0}),Fe=d0(J),Ve=Ou(),Oe=(we=Ve?.clientHeight)!=null?we:0,Pe=VT();let je=Le;if(H==="center")je=Le-Oe/2+Fe/2;else if(H==="end")je=Le-Oe+Fe;else if(H==="nearest"&&Pe!=null){if(Le>=Pe&&Le+Fe<=Pe+Oe)return;je=Le<Pe?Le:Le-Oe+Fe}KT(Math.max(0,je)),Li({immediate:!0}),zt.value&&(yr.value=J,$u())};if(zt.value)return yr.value=J,$u(),void yt(ce);ce()}}),et(()=>Ms.value,_=>{if(!_){Ax();for(const H of tl.values())for(const X of H)nh(X);tl.clear(),Jl.clear(),Q0(),gc()}},{immediate:!0}),et(lt,_=>{_&&(function(){if(P&&lt.value&&Xi.size){Q0();for(const H of[80,240,640]){const X=Yb(H,()=>{for(const[J,ce]of Xi)ce&&hh(J,ce)},"final");X!=null&&Jf.push(X)}}})(),Gn(_?"final":"content")});const CN=F4(()=>Gn("content"),16),AN=F4(()=>Gn("batch"),16);et([()=>Be.value.length,()=>te.value],()=>{Ys.value&&hc(),CN()},{flush:"post",immediate:!0}),et([()=>jo.start,()=>jo.end],()=>{AN()},{flush:"post"});const{cleanupBatchScheduler:MN}=(function(_){const{props:H,isClient:X,isTestEnv:J,parsedNodesIdentity:ce,parsedNodeCount:we,desiredRenderedCount:Le,datasetKey:Fe,batchingEnabled:Ve,incrementalRenderingActive:Oe,resolvedBatchSize:Pe,resolvedInitialBatch:je,renderedCount:$e,adaptiveBatchSize:He,previousRenderContext:Qe,previousBatchConfig:Ye,requestFrame:ct,cancelFrame:st,hasIdleCallback:pt,cleanupNodeVisibility:kt,onDatasetKeyChanged:Mt,onDatasetChanged:Ct}=_;let Et=null,qt="raf",Xt=null,Nn=0,Ko=!1,Ro=!1;const $i=new Set,Ji=new Set;function Ju(){if(X){Et!=null&&(qt==="raf"&&st?st(Et):qt==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Et):qt==="timeout"&&window.clearTimeout(Et),Et=null),Nn+=1;for(const os of $i)st&&st(os);for(const os of Ji)window.clearTimeout(os);$i.clear(),Ji.clear(),Xt=null,Ko=!1,Ro=!1}}function wh(){return typeof performance<"u"?performance.now():Date.now()}function qx(os){(function(wr){var il;if(!Oe.value)return;const _r=Math.max(2,(il=H.renderBatchBudgetMs)!=null?il:6),Sr=Math.max(1,Pe.value||1),Fi=Math.max(1,Math.floor(Sr/4));wr>1.5*_r?He.value=Math.max(Fi,Math.floor(.8*He.value)):wr<.6*_r&&He.value<Sr&&(He.value=Math.min(Sr,Math.ceil(1.2*He.value)))})(os),Ko=!1;const Ts=Ro||$e.value<Le.value;Ro=!1,Ts&&Kx()}function jx(os,Ts={}){var wr,il;if(!Oe.value)return;const _r=Le.value;if($e.value>=_r)return;const Sr=Math.max(1,os),Fi=()=>{const kc=wh();Et=null;const ed=Xt??Sr;Xt=null;const bc=wh();$e.value=Math.min(_r,$e.value+ed),kt($e.value),(function(ig,_h){if(!X)return void qx(_h);Ko=!0;const Gx=++Nn;yt().then(()=>{var Yx;if(Gx!==Nn)return;const GN=wh(),YN=Math.max(_h,GN-ig),Zx=()=>{Gx===Nn&&qx(YN)};if(ct){let aa=null,xc=null,Qx=!1;const Jx=()=>{Qx||(Qx=!0,aa!==null&&($i.delete(aa),aa=null),xc!==null&&(Ji.delete(xc),window.clearTimeout(xc),xc=null),Zx())};return aa=ct(()=>{Jx()}),$i.add(aa),xc=window.setTimeout(()=>{aa!==null&&st&&st(aa),Jx()},Math.max(32,(Yx=H.renderBatchIdleTimeoutMs)!=null?Yx:120)),void Ji.add(xc)}const Xx=window.setTimeout(()=>{Ji.delete(Xx),Zx()},0);Ji.add(Xx)})})(kc,wh()-bc)};if(!X||Ts.immediate)return void Fi();const rl=Math.max(0,(wr=H.renderBatchDelay)!=null?wr:16);if(Xt=Xt!=null?Math.max(Xt,Sr):Sr,Et==null){if(!J&&pt&&window.requestIdleCallback){const kc=Math.max(0,(il=H.renderBatchIdleTimeoutMs)!=null?il:120);return qt="idle",void(Et=window.requestIdleCallback(()=>Fi(),{timeout:kc}))}if(ct&&!J)return qt="raf",void(Et=ct(()=>{rl===0?Fi():(qt="timeout",Et=window.setTimeout(()=>Fi(),rl))}));qt="timeout",Et=window.setTimeout(()=>Fi(),rl)}}function Vx(os,Ts={}){Ko?Ro=!0:os==null?Kx():jx(os,Ts)}function Kx(){Oe.value&&jx(Ve.value?Math.max(1,Math.round(He.value)):Math.max(1,Pe.value))}return et([ce,we,Fe,Oe,Pe,je,()=>H.renderBatchDelay],()=>{var os;const Ts=we.value,wr=Qe.value,il=Fe.value,_r=!Object.is(il,wr.key),Sr=Ts!==wr.total,Fi=_r||Sr;Qe.value={key:il,total:Ts};const rl=Ye.value,kc=(os=H.renderBatchDelay)!=null?os:16,ed=rl.batchSize!==Pe.value||rl.initial!==je.value||rl.delay!==kc||rl.enabled!==Oe.value;Ye.value={batchSize:Pe.value,initial:je.value,delay:kc,enabled:Oe.value},_r&&Mt(Ts),(Fi||ed||!Oe.value)&&Ju(),(Fi||ed)&&(He.value=Math.max(1,Pe.value||1)),Fi&&Ct();const bc=Le.value;if(!Ts)return $e.value=0,void kt(0);if(!Oe.value)return $e.value=bc,void kt($e.value);const ig=_r||wr.total===0;$e.value=ig||ed?Math.min(bc,je.value):Math.min($e.value,bc);const _h=Math.max(1,je.value||Pe.value||Ts);$e.value<bc?Vx(_h,{immediate:!X}):kt($e.value)},{immediate:!0}),et(Le,(os,Ts)=>{Oe.value&&(typeof Ts=="number"&&os<=Ts||os>$e.value&&Vx())}),{cleanupBatchScheduler:Ju}})({props:S,isClient:P,isTestEnv:ze,parsedNodesIdentity:bn,parsedNodeCount:nn,desiredRenderedCount:eh,datasetKey:gN,batchingEnabled:go,incrementalRenderingActive:us,resolvedBatchSize:Ut,resolvedInitialBatch:xn,renderedCount:te,adaptiveBatchSize:Ee,previousRenderContext:Ce,previousBatchConfig:De,requestFrame:Te,cancelFrame:ge,hasIdleCallback:Me,cleanupNodeVisibility:uN,onDatasetKeyChanged:_=>{gc(),Qf(),hi(),Uu(),_>0&&Xf(_)},onDatasetChanged:()=>{zt.value&&Li({immediate:!0})}});et([jb,zt,()=>L.value,()=>Y()],([_,H])=>{if(!_)return Qb(),void v0();dN(),H?Li({immediate:!0}):v0()},{flush:"post",immediate:!0}),et([()=>Be.value.length,()=>zt.value],_=>Zn(null,[_],function*([H,X]){X&&H&&P&&(yield yt(),Li({immediate:!0}))}),{flush:"post"}),et(io,_=>{_&&(function(){var H;if(Vn.value&&Kn.value&&Jn.value&&((H=Oo.value)!=null&&H[1]))return;const X=gt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),J=gt({type:"list_item",children:[X],raw:"- Probe paragraph text"}),ce=gt({type:"list",ordered:!1,items:[J],raw:"- Probe paragraph text"});Vn.value=X,Kn.value=J,Jn.value=ce;const we={1:null,2:null,3:null,4:null,5:null,6:null};for(let Le=1;Le<=6;Le++)we[Le]=gt({type:"heading",level:Le,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Le)} Probe heading`});Oo.value=we})()},{immediate:!0}),et([()=>L.value,io],()=>{if(!io.value)return w0(),void(ne.value=0);ex(),w0(),io.value&&L.value&&typeof ResizeObserver<"u"&&(Fu=new ResizeObserver(()=>{ex(),oc.value&&Lu(),Ys.value&&hc(),Gn("resize")}),Fu.observe(L.value))},{immediate:!0}),et([io,di,Qs],()=>Zn(null,null,function*(){if(!io.value)return j.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void hi();yield yt(),(function(){if(!io.value||typeof window>"u")return j.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void hi();const _={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},H=Jb(x0(O.value),".paragraph-node");_.paragraph=mv(O.value,H,"pre-wrap");const X=x0(U.value),J=X?.querySelector(".paragraph-node");_.listItem=mv(U.value,J,"pre-wrap");const ce=vt("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Le,Fe;return(Fe=(Le=Z.value)==null?void 0:Le.offsetHeight)!=null?Fe:0}),we=vt("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Le,Fe;return(Fe=(Le=U.value)==null?void 0:Le.offsetHeight)!=null?Fe:0});_.listWrapperOverhead=Math.max(0,ce-we);for(let Le=1;Le<=6;Le++){const Fe=Jb(x0(ie[Le]),`h${Le}`);_.headings[Le]=mv(ie[Le],Fe,"pre-wrap")}j.value=_,hi()})()}),{flush:"post",immediate:!0}),et(()=>Be.value.length,()=>{zt.value&&Li({immediate:!0})}),et([io,ne],()=>{hi(),zt.value&&Li({immediate:!0}),oc.value&&Lu(),Ys.value&&hc(),Gn("resize")},{immediate:!1}),et(()=>Zi.value,_=>{if(_)for(const[H,X]of cn)fh(H,X);else if(k0(),zt.value)Li({immediate:!0});else for(const[H,X]of cn)X&&ol(H,!0)},{immediate:!1}),et([Ae,re,()=>Y()],()=>{var _;(_=le.refresh)==null||_.call(le);for(const[H,X]of cn)fh(H,X)},{immediate:!1}),et([()=>S.viewportPriority,()=>Be.value.length,re],([_,H,X])=>{if(_!==!1){if(q.value&&(H<=200||H<=X)){q.value=!1;for(const[J,ce]of cn)fh(J,ce)}}else q.value=!1}),et(()=>te.value,()=>{zt.value&&Li({immediate:!0})}),et([yr,ts,ns,()=>Be.value.length,zt],()=>{$u()},{immediate:!0});let ju=null,Vu=!1,vc=null;function Ku(){ju=null,N0=null,T0=void 0,uc=null,Uu()}function J0(){gc(),Qf(),hi(),_t.clear();const _=Be.value.length;_>0&&Xf(_),z0()}function eg(){Z0(),Zb(),Hu=null,oa=null,sa=null,ch=null,Ru=null,Du=null,Vu=!1,Ku(),cx("restore"),Zf(),fc()}function Gu(_){var H;return[(H=bo())!=null?H:"",no(),br(),rh.value,zu(_),Be.value.length,Math.round(nc(0,Be.value.length)),Math.round(ea()),pi.count,Math.round(pi.total)].join(":")}function Mx(){return Zn(this,null,function*(){var _,H,X,J;const ce=(_=o.virtualScroll)==null?void 0:_.settledToken,we=zu(ce),Le=no(),Fe=bo(),Ve=Qs.value;if(tn.value&&((H=o.virtualScroll)==null?void 0:H.settleMode)==="manual"&&lh(ce))if(I0()){if(Gu(ce)!==uc&&!Vu){Vu=!0;try{const Oe=yield q0({reason:"manual",expectedSettledTokenKey:we}),Pe=zu()===we;U0(Le,Fe,Ve)&&Oe.sessionKey===Le&&Oe.threadKey===Fe&&Pe&&Oe.stable&&Oe.phase==="final"&&(uc=Gu((X=o.virtualScroll)==null?void 0:X.settledToken))}finally{Vu=!1,yield yt();const Oe=(J=o.virtualScroll)==null?void 0:J.settledToken,Pe=lh(Oe)?Gu(Oe):"";U0(Le,Fe,Ve)&&Pe&&uc!==Pe&&Mx()}}}else Gn("manual")})}et(tn,(_,H)=>{if(_!==H){if(!_)return eg(),void Z0();eg(),J0(),vc=Qs.value,Gn("content")}},{flush:"post"}),et([tn,Qs],([_,H])=>{_?vc!=null?vc!==H&&(vc=H,(function(X="resize"){gc(),Qf(),hi(),_t.clear();const J=Be.value.length;J>0&&Xf(J),z0(),oa=null,sa=null,ch=null,Hu=null,Vu=!1,Ku(),kx(),yt(()=>{xr(),oc.value&&Lu(),Ys.value&&hc(),Gn(X)})})("resize")):vc=H:vc=null},{flush:"post",immediate:!0}),et([tn,()=>no(),()=>bo()],([_])=>{_&&(eg(),J0(),cx("content"),Gn("content"))}),et([tn,()=>no(),()=>bo(),Qs,()=>Be.value.length],([_])=>{_&&(function(H="async-node"){let X=!1;for(const[J,ce]of Array.from(Qi.entries()))M0(ce)||(Qi.delete(J),Zs.delete(J),X=!0);X&&(ac(),Gn(H))})("async-node")},{flush:"post"}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.sessionKey},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>o.indexKey,()=>fe.value],([_])=>{_&&(Uu(),(function(H="content"){if(!tn.value)return;const X=[],J=Be.value.length,ce=b0(J);for(const we of Array.from(_t.keys())){if(we>=J){X.push(we);continue}if(we<ce)continue;const Le=Bu(we),Fe=_t.get(we);Fe!=null&&Fe!==Le&&X.push(we),_t.set(we,Le)}for(const we of Array.from(_t.keys()))we>=J&&_t.delete(we);X.length&&((function(we,Le={}){const Fe=Array.from(we,Number);Pb(Fe);let Ve=0;if(ic(()=>(Ve=tN(Fe,Le),Ve>0)),Ve>0)(function(Oe){for(const Pe of Oe)_t.delete(Pe)})(Fe);else for(const Oe of Fe)Gs.delete(Oe)})(X,{notify:!1}),hi(),Ku(),oc.value&&Lu(),Ys.value&&hc(),Gn(H))})("content"))},{flush:"post",immediate:!0}),et([tn,()=>Be.value.length,()=>no(),()=>bo()],([_,H,X,J],[ce,we,Le,Fe])=>{_&&ce&&X===Le&&J===Fe&&H!==we&&Ku()},{flush:"post"}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.heightCache},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.heightCacheWidth},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>Be.value.length,()=>no(),ne],()=>{kx()},{flush:"post",immediate:!0}),et([tn,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreAnchor},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey},()=>Be.value.length,()=>no(),ne],_=>Zn(null,[_],function*([H,X]){if(!H||!X)return;yield yt();const J=(function(){var ce;const we=(ce=o.virtualScroll)==null?void 0:ce.restoreAnchor;return we==null||we===!1?null:we===!0?"true":String(we)})();W0(X,{restoreAnchor:J!=null,restoreToken:J??void 0})}),{flush:"post",immediate:!0}),et([tn,ne,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.restoreState},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.measurementKey}],([_])=>{var H;if(!_)return;const X=(H=o.virtualScroll)==null?void 0:H.restoreState;X&&oa&&sa==="restore"&&(vx(X)||(J0(),oa=null,sa=null,Gn("resize")))},{flush:"post"}),et([tn,()=>Be.value.length,()=>no(),ne],_=>Zn(null,[_],function*([H]){var X;const J=Ru,ce=Du;H&&J&&(yield yt(),!W0(J,{restoreAnchor:ce?.restoreAnchor===!0,restoreToken:(X=ce?.restoreToken)!=null?X:"imperative",allowUncapturedAnchor:ce?.allowUncapturedAnchor===!0})&&bx(J)||(Ru=null,Du=null))}),{flush:"post",immediate:!0}),et([tn,lt,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settleMode},()=>no(),()=>bo(),Qs,g0,Kb,()=>te.value,eh,()=>pi.count,()=>pi.total],([_,H,X])=>{if(!_||H!==!0||X==="manual"||!L0())return;const J=(function(){var ce;const we=Be.value.length;return[(ce=bo())!=null?ce:"",no(),br(),rh.value,we,Math.round(nc(0,we)),Math.round(ea()),pi.count,Math.round(pi.total)].join(":")})();ju!==J&&(ju=J,q0({reason:"final"}).then(ce=>{ce.stable||ju!==J||(ju=null)}))},{flush:"post",immediate:!0}),et([tn,lt,()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settleMode},()=>{var _;return(_=o.virtualScroll)==null?void 0:_.settledToken},()=>no(),()=>bo(),Qs,g0,Kb,()=>te.value,eh,()=>Be.value.length,()=>pi.count,()=>pi.total],()=>{Mx()},{flush:"post",immediate:!0}),et([()=>Be.value.length,zt,ts,ns,()=>jo.start,()=>jo.end],([_,H,X,J,ce,we])=>{me.value&&hn("virtualization",{nodes:_,virtualization:H,maxLiveNodes:X,buffer:J,focusIndex:yr.value,scroll:H?(()=>{const Le=Nu.value||ke();return Le?{reverse:Ne(Le),scrollTop:Math.round(Le.scrollTop),scrollTopAbs:Math.round(Math.abs(Le.scrollTop)),scrollHeight:Math.round(Le.scrollHeight),clientHeight:Math.round(Le.clientHeight)}:null})():null,liveRange:{start:ce,end:we},rendered:te.value})}),et([()=>S.customId],([_],H,X)=>{if(!_||ko)return;const J=(function(ce,we){return ce?(Lo.controllers[ce]=we,()=>{Lo.controllers[ce]===we&&delete Lo.controllers[ce]}):()=>{}})(_,{captureRestoreAnchor:Ob,restoreAnchor:Bb,getAnchorDrift:YT,getReport:pN});X(()=>{J()})},{immediate:!0}),ho(()=>{(function(){if(tn.value)try{xr(),Pu();const _=ta("manual");wx(_)&&(R(_),Hu=_,V0=Wu());const H=dc(_,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});H&&(z(H),H.anchor&&W(H.anchor),pc=qu(H))}catch{}})(),MN(),k0(),Pt(),Ax();for(const _ of tl.values())for(const H of _)nh(H);tl.clear(),Jl.clear(),_t.clear(),Q0(),gc(),w0(),Zf(),fc(),Z0(),Qb(),v0()});const EN=Cd("ViewportDeferredMermaidBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index11-BLlVIBCh.js"),__vite__mapDeps([7,5]))).default}catch(_){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',_),Fs}}),loadingComponent:G4,delay:0}),G4),TN=Cd("ViewportDeferredInfographicBlockNode",Hi({loader:()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index10-DPW9hHwA.js"),[])).default}catch(_){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',_),Fs}}),loadingComponent:K4,delay:0}),K4),NN=Cd("ViewportDeferredD2BlockNode",Hi(()=>Zn(null,null,function*(){try{return(yield vs(()=>import("./index8-rpBPk4Do.js"),[])).default}catch(_){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',_),Fs}})),Fs),Ex={text:mo,paragraph:Ha,heading:Y1,code_block:iv,list:du,list_item:uu,blockquote:Fp,table:Yd,definition_list:Op,footnote:Bp,footnote_reference:oi,footnote_anchor:Kd,admonition:Hp,vmr_container:Dp,hardbreak:Ol,link:_s,image:Fl,thematic_break:Rp,math_inline:Gi,math_block:sE,strong:xs,emphasis:Ss,strikethrough:ws,highlight:ii,insert:Ws,subscript:Hs,superscript:Ps,emoji:Ds,checkbox:ni,checkbox_input:ni,inline_code:as,html_inline:si,reference:bs,html_block:Gd},IN=D(()=>C0()),Tx=D(()=>L4(S.codeBlockProps)),LN=D(()=>L4(S.codeBlockProps,{omit:["langs"]})),Nx=D(()=>it(it({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,monacoOptions:S.codeBlockMonacoOptions,themes:S.themes,langs:p.value==="shiki"?S.langs:void 0,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ye.value=="boolean"?{showTooltips:ye.value}:{}),LN.value)),Ix=D(()=>it(Ot(it({},Nx.value),{langs:S.langs}),Tx.value));function Lx(_){return typeof _=="boolean"?_:void 0}const $N=D(()=>{const _=S.codeBlockProps||{},H={},X=Lx(_.showLineNumbers);X!==void 0&&(H.showLineNumbers=X);const J=Lx(_.diffInline);J!==void 0&&(H.diffInline=J);const ce=(function(we){const Le=Number(we);return Number.isFinite(Le)&&Le>0?Le:void 0})(_.reservedHeightPx);return ce!==void 0&&(H.reservedHeightPx=ce),H}),FN=D(()=>it(it({stream:S.codeBlockStream,darkTheme:S.codeBlockDarkTheme,lightTheme:S.codeBlockLightTheme,themes:S.themes,langs:S.langs,minWidth:S.codeBlockMinWidth,maxWidth:S.codeBlockMaxWidth},typeof ye.value=="boolean"?{showTooltips:ye.value}:{}),Tx.value)),ON=D(()=>it({},S.mermaidProps||{})),$x=D(()=>it({},S.d2Props||{})),BN=D(()=>it({},S.infographicProps||{})),Yu=D(()=>({typewriter:f.value,fade:S.fade,customHtmlTags:nt.value.customHtmlTags})),RN=D(()=>it(it({},Yu.value),typeof ye.value=="boolean"?{showTooltip:ye.value}:{})),DN=D(()=>it(it({},Yu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{})),PN=D(()=>it(it({},Yu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{})),HN=D(()=>it(it({},Yu.value),typeof ye.value=="boolean"?{showTooltips:ye.value}:{}));function WN(_){return Array.isArray(_.children)&&_.children.length>0}const ph=D(()=>hN.value.map(_=>{var H,X,J,ce,we,Le,Fe,Ve;let Oe=(function(st){var pt,kt,Mt,Ct,Et,qt,Xt;if(st.type!=="code_block")return st;const Nn=st,Ko=[String((pt=Nn.language)!=null?pt:""),String((kt=Nn.loading)!=null?kt:""),String((Mt=Nn.diff)!=null?Mt:""),String((Ct=Nn.code)!=null?Ct:""),String((Et=Nn.originalCode)!=null?Et:""),String((qt=Nn.updatedCode)!=null?qt:""),String((Xt=Nn.raw)!=null?Xt:"")].join("\0"),Ro=Nt.get(Nn);if(Ro&&Ro.signature===Ko)return Ro.node;const $i=it({},Nn);return Nt.set(Nn,{signature:Ko,node:$i}),$i})(_.node);const Pe=mh(Oe);let je=Rx(Oe,Pe);if((Oe.type==="html_block"||Oe.type==="html_inline")&&je===Ex[Oe.type]){const st=Oe,pt=String((H=st.tag)!=null?H:"").trim().toLowerCase()||I5(st.content);if(pt){const kt=sn.value[pt];if(es.value.has(pt)&&kt)je=kt,Oe=Ot(it({},st),{type:pt,tag:pt,content:CY(st.content,pt)});else if(L5((X=st.content)!=null?X:st.raw,pt)){const Mt=String((ce=(J=st.content)!=null?J:st.raw)!=null?ce:"");Oe.type==="html_inline"?(je=mo,Oe={type:"text",content:Mt,raw:Mt}):(je=Ha,Oe={type:"paragraph",children:[{type:"text",content:Mt,raw:Mt}],raw:Mt})}}}const $e=Oe.type==="code_block"&&p.value==="pre"&&je===Fs&&!tg(sn.value,Pe);let He=it({},(function(st,pt,kt){const Mt=pt??mh(st);if(st.type==="code_block"){const Ct=Mt?tg(sn.value,Mt):void 0;if(kt&&p.value==="pre"&&!Ct&&kt===Fs)return $N.value;if(kt&&Mt&&kt===Ct)return Mt==="mermaid"?Ox(st):Mt==="infographic"?Bx(st):Mt==="d2"||Mt==="d2lang"?$x.value:Ix.value;if(kt&&kt===sn.value.code_block)return Ix.value;if(nx(kt))return FN.value}return Mt==="mermaid"?Ox(st):Mt==="infographic"?Bx(st):Mt==="d2"||Mt==="d2lang"?$x.value:st.type==="link"?RN.value:st.type==="list"?DN.value:st.type==="blockquote"?PN.value:st.type==="table"?HN.value:st.type==="code_block"?Nx.value:Yu.value})(Oe,Pe,je));const Qe=io.value?lc.value[_.index]:null;Oe.type==="code_block"&&Qe?.kind==="code-block"&&(He=Ot(it({},He),$e?{reservedHeightPx:(we=Qe.height)!=null?we:Qe.contentHeight}:{estimatedHeightPx:Qe.height,estimatedContentHeightPx:Qe.contentHeight,estimatedDiffInline:Qe.diffInline})),$e||Oe.type!=="code_block"||Pe!=="mermaid"||Kc(He.estimatedPreviewHeightPx)!=null||(He=Ot(it({},He),{estimatedPreviewHeightPx:$m(Im(String((Le=Oe.code)!=null?Le:"")))})),$e||Oe.type!=="code_block"||Pe!=="infographic"||Kc(He.estimatedPreviewHeightPx)!=null||(He=Ot(it({},He),{estimatedPreviewHeightPx:Fm(Lm(String((Fe=Oe.code)!=null?Fe:"")))})),Oe.type==="math_block"&&(He=Ot(it({},He),{cacheScope:Qn}));const Ye=(function(st,pt){const kt=String(st.type);return!zf(kt)&&sn.value[kt]===pt})(Oe,je),ct=Ye?F2(Oe,de.value):void 0;return Ot(it({},_),{node:Oe,component:je,bindings:He,customBindings:it(it({},ct??{}),He),rendersCustomNode:Ye,hasSlotChildren:WN(Oe),slotContent:String((Ve=Oe.content)!=null?Ve:""),isCodeBlock:Oe.type==="code_block",indexKey:`${IN.value}-${_.index}`,vnodeKey:`${mN.value}\0${_.index}\0${Oe.type}`})}));function mh(_){var H;return _?.type==="code_block"?String((H=_.language)!=null?H:"").trim().toLowerCase():""}function tg(_,H){const X=H.trim().toLowerCase();if(X)for(const J of[X,V1(X),P8(X)]){const ce=J&&_[J];if(ce)return ce}}function Fx(_,H,X,J){var ce,we;const Le=it({},_.value);return Kc(Le.estimatedPreviewHeightPx)==null&&(Le.estimatedPreviewHeightPx=J(X(String((ce=H?.code)!=null?ce:"")),void 0,Le.maxHeight==="none"?null:(we=Kc(Le.maxHeight))!=null?we:void 0)),Le}function Ox(_){return Fx(ON,_,Im,$m)}function Bx(_){return Fx(BN,_,Lm,Fm)}function Rx(_,H){if(!_)return Ky;const X=sn.value,J=X[String(_.type)];if(_.type==="code_block"){const ce=H??mh(_),we=ce?tg(X,ce):void 0;return we||(p.value==="pre"?X.code_block||Fs:ce==="mermaid"?X.mermaid||EN:ce==="infographic"?X.infographic||TN:ce==="d2"||ce==="d2lang"?X.d2||NN:J||X.code_block||ox.value)}return J||Ex[String(_.type)]||Ky}function ng(_){s("click",_)}function zN(_){var H;(H=_.target)!=null&&H.closest("[data-node-index]")&&s("mouseover",_)}function UN(_){var H;(H=_.target)!=null&&H.closest("[data-node-index]")&&s("mouseout",_)}function Dx(_){s("mouseover",_)}function Px(_){s("mouseout",_)}const la=oe(null),Es=oe(!1),Zu=oe(null),qN=D(()=>!(S.domMode!=="minimal"||G.value||S.fade!==!1||f.value||Es.value||Xe.value||zt.value||Bo.value||As.value||Re.value||Object.keys(sn.value).length!==0));let Xu,yc=null,og=0,gh=0,vh=0;const Hx=["code_block","admonition","table","math_block","html_block","image","thematic_break"],jN=new Set(Hx),Wx=[".typewriter-cursor",".height-estimation-probes",...Hx.map(_=>`[data-node-type="${_}"]`),"script","style"].join(",");function zx(_){if(!_||typeof _!="object")return!1;const H=_.type;return typeof H=="string"&&jN.has(H)}function yh(_){var H,X;if(!_||typeof _!="object")return 0;const J=_,ce=(X=(H=J.raw)!=null?H:J.content)!=null?X:J.code;if(typeof ce=="string")return ce.length;const we=J.children;if(Array.isArray(we))return we.reduce((Fe,Ve)=>Fe+yh(Ve),0);const Le=J.items;return Array.isArray(Le)?Le.reduce((Fe,Ve)=>Fe+yh(Ve),0):0}function kh(){Xu&&(clearTimeout(Xu),Xu=void 0)}function sg(){og+=1,yc!=null&&(ge?.(yc),yc=null)}function Qu(){sg(),sl(),la.value&&(la.value.style.visibility="hidden")}function VN(_){var H;if(_.nodeType!==Node.TEXT_NODE||!((H=_.textContent)!=null?H:"").trim())return!1;const X=_.parentElement;return!!X&&!X.closest(Wx)}function KN(_){let H=_.lastChild;for(;H;){if(VN(H))return H;if(H.nodeType===Node.ELEMENT_NODE){const X=H;if(!X.matches(Wx)&&X.lastChild){H=X.lastChild;continue}}for(;H&&H!==_&&!H.previousSibling;)H=H.parentNode;if(!H||H===_)break;H=H.previousSibling}return null}function Ux(){const _=ph.value;for(let H=_.length-1;H>=0;H--){const X=_[H];if(!X||zx(X.node)||!dh(X.index))continue;const J=cn.get(X.index);if(!J)continue;const ce=KN(J);if(ce)return ce}return null}function sl(){Zu.value&&(Zu.value.classList.remove(Y4),Zu.value=null)}function bh(){if(d.value!=="simple"||!P||!Es.value||!L.value)return void sl();const _=Ux(),H=_?(function(X){var J;const ce=(J=X.parentElement)==null?void 0:J.closest(".text-node");return ce instanceof HTMLElement?ce:X.parentElement})(_):null;H!==Zu.value&&(sl(),H&&(H.classList.add(Y4),Zu.value=H))}function xh(){if(d.value!=="precise"||!P||!Es.value||yc!=null)return;const _=og,H=()=>{yc=null,_===og&&(function(){var X,J;if(d.value!=="precise"||!(P&&Es.value&&L.value&&la.value))return;const ce=L.value,we=la.value;we.style.visibility="hidden";const Le=Ux();if(!Le)return;let Fe=0,Ve=0,Oe=20,Pe=!1;if(Le?.textContent){const je=Le.textContent.length,$e=document.createRange();$e.setStart(Le,Math.max(0,je-1)),$e.setEnd(Le,je);const He=typeof $e.getClientRects=="function"?$e.getClientRects():void 0,Qe=(J=He?.[He.length-1])!=null?J:(X=Le.parentElement)==null?void 0:X.getBoundingClientRect();if(Qe){const Ye=vt("typewriterCursor.root.getBoundingClientRect",()=>ce.getBoundingClientRect());Fe=Qe.right-Ye.left+ce.scrollLeft,Ve=Qe.top-Ye.top+ce.scrollTop,Oe=Qe.height||Oe,Pe=!0}$e.detach()}Pe&&(we.style.transform=`translate(${Math.max(0,Fe)}px, ${Math.max(0,Ve)}px)`,we.style.height=`${Oe}px`,we.style.visibility="visible")})()};Te?yc=Te(H):H()}return et([Ze,()=>o.content,()=>o.nodes,()=>S.typewriter,lt],()=>Zn(null,null,function*(){var _,H;if(!P||G.value||!se.value)return;if(lt.value)return Es.value=!1,kh(),void Qu();if((_=o.nodes)!=null&&_.length)return Es.value=!1,kh(),Qu(),gh=((H=o.content)!=null?H:"").length,void(vh=Ze.value.length);const X=(function(){var Fe,Ve;return(Fe=o.nodes)!=null&&Fe.length?o.nodes.reduce((Oe,Pe)=>Oe+yh(Pe),0):((Ve=o.content)!=null?Ve:"").length})(),J=(function(){var Fe;return(Fe=o.nodes)!=null&&Fe.length?o.nodes.reduce((Ve,Oe)=>Ve+yh(Oe),0):Ze.value.length})(),ce=!zx(Be.value[Be.value.length-1]),we=X>gh,Le=J>vh;if(!f.value||!ce||!we&&!Le)return f.value&&ce||(Es.value=!1,Qu()),gh=X,void(vh=J);gh=X,vh=J,Es.value=!0,d.value==="precise"&&la.value&&(la.value.style.visibility="hidden"),kh(),yield yt(),d.value==="simple"?bh():(sl(),xh()),Xu=setTimeout(()=>{Xu=void 0,Es.value=!1},3e3)}),{flush:"post",immediate:!0}),et(Es,_=>Zn(null,null,function*(){_?(yield yt(),d.value!=="simple"?(sl(),d.value==="precise"&&xh()):bh()):Qu()}),{flush:"post"}),et(d,()=>Zn(null,null,function*(){if(P&&!G.value&&se.value&&Es.value){if(yield yt(),d.value==="simple")return sg(),void bh();sl(),d.value!=="precise"?Qu():xh()}}),{flush:"post"}),et([()=>te.value,()=>jo.start,()=>jo.end],()=>Zn(null,null,function*(){P&&!G.value&&se.value&&Es.value&&(yield yt(),d.value!=="simple"?(sl(),d.value==="precise"&&xh()):bh())}),{flush:"post"}),ho(()=>{kh(),sg(),sl(),Fn.clear()}),(_,H)=>{const X=xI("NodeRenderer",!0);return C(G)?(x(!0),E(We,{key:0},rt(ph.value,J=>(x(),E(We,{key:J.vnodeKey},[J.rendersCustomNode?(x(),Se(Ho(J.component),_n({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onClick:ng,onMouseover:Dx,onMouseout:Px,onCopy:H[0]||(H[0]=ce=>i(ce)),onHandleArtifactClick:H[1]||(H[1]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,_n({key:0,ref_for:!0},gn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,_n({key:1,ref_for:!0},gn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),_n({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onClick:ng,onMouseover:Dx,onMouseout:Px,onCopy:H[2]||(H[2]=ce=>i(ce)),onHandleArtifactClick:H[3]||(H[3]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(x(),E("div",{key:1,ref_key:"containerRef",ref:L,class:Ue(["markstream-vue markdown-renderer",[{dark:S.isDark},{virtualized:zt.value},{"virtual-scroll-coordinated":qs.value},{"stable-layout":rN.value},{"typewriter-simple-cursor":Es.value&&d.value==="simple"}]]),"data-custom-id":S.customId,onClick:ng,onMouseover:zN,onMouseout:UN},[js.value||zt.value?(x(),E(We,{key:0},[js.value?(x(),Se(bse,{key:0,width:di.value,"flow-root":zt.value||qs.value,"paragraph-node":Vn.value,"list-item-node":Kn.value,"list-node":Jn.value,"heading-nodes":Oo.value,"set-paragraph-wrapper":lN,"set-list-item-wrapper":aN,"set-list-wrapper":cN,"set-heading-wrapper":fN},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ue("",!0),zt.value?(x(),E("div",{key:1,class:"node-spacer",style:on({height:`${_0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],64)):ue("",!0),qN.value?(x(!0),E(We,{key:1},rt(ph.value,J=>(x(),E(We,{key:J.vnodeKey},[dh(J.index)?(x(),Se(Ho(J.component),_n({key:0,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onMouseover:H[4]||(H[4]=ce=>s("mouseover",ce)),onMouseout:H[5]||(H[5]=ce=>s("mouseout",ce)),onCopy:H[6]||(H[6]=ce=>i(ce)),onHandleArtifactClick:H[7]||(H[7]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ue("",!0)],64))),128)):(x(!0),E(We,{key:2},rt(ph.value,J=>(x(),E("div",{key:J.vnodeKey,ref_for:!0,ref:ce=>fh(J.index,ce),class:"node-slot","data-node-index":J.index,"data-node-type":J.node.type},[dh(J.index)?(x(),E("div",{key:0,ref_for:!0,ref:ce=>(function(we,Le){var Fe;Le||(function(je){const $e=`${C0()}-${je}`;let He=!1;for(const Qe of Array.from(Zs.keys())){const Ye=Qi.get(Qe);(Ye?.index===je||Qe===$e||Qe.startsWith(`${$e}-`))&&(Zs.delete(Qe),Qi.delete(Qe),He=!0)}He&&(ac(),Gn("async-node"))})(we),kr.delete(we),(function(je){var $e;const He=(($e=Jl.get(je))!=null?$e:0)+1;Jl.set(je,He)})(we);const Ve=tl.get(we);if(Ve){for(const je of Ve)nh(je);tl.delete(we)}if((function(je){const $e=Vt.get(je);$e&&(co?.unobserve($e),Hn.delete($e),Vt.delete(je))})(we),!Le||!Ms.value)return Xi.delete(we),void Jl.delete(we);Xi.set(we,Le);const Oe=()=>{hh(we,Le)};queueMicrotask(Oe);const Pe=(co||typeof ResizeObserver>"u"||(co=new ResizeObserver(je=>{if(je.length)for(const $e of je){const He=Hn.get($e.target),Qe=Vt.get(He??-1);He!=null&&Qe&&hh(He,Qe)}else xr()})),co);if(Pe&&(Vt.set(we,Le),Hn.set(Le,we),Pe.observe(Le)),typeof window<"u"){const je=((Fe=Be.value[we])==null?void 0:Fe.type)==="code_block"?[16,80,240,800]:lt.value?[80]:[];if(je.length){const $e=je.map(He=>Yb(He,Oe,"node-resize")).filter(He=>He!=null);$e.length&&tl.set(we,$e)}}})(J.index,ce),class:"node-content"},[J.isCodeBlock?J.rendersCustomNode?(x(),Se(Ho(J.component),_n({key:1,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[12]||(H[12]=ce=>i(ce)),onHandleArtifactClick:H[13]||(H[13]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,_n({key:0,ref_for:!0},gn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,_n({key:1,ref_for:!0},gn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),_n({key:2,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[14]||(H[14]=ce=>i(ce)),onHandleArtifactClick:H[15]||(H[15]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ua,{key:0,name:"fade",css:S.fade!==!1,appear:S.fade!==!1},{default:Ie(()=>[J.rendersCustomNode?(x(),Se(Ho(J.component),_n({key:0,ref_for:!0},J.customBindings,{node:J.node,loading:J.node.loading,"index-key":J.indexKey,"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[8]||(H[8]=ce=>i(ce)),onHandleArtifactClick:H[9]||(H[9]=ce=>s("handleArtifactClick",ce))}),{default:Ie(()=>[J.hasSlotChildren?(x(),Se(X,_n({key:0,ref_for:!0},gn.value,{nodes:J.node.children,"index-key":J.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):J.slotContent?(x(),Se(X,_n({key:1,ref_for:!0},gn.value,{content:J.slotContent,final:!J.node.loading,"index-key":`${J.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ue("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(x(),Se(Ho(J.component),_n({key:1,node:J.node,loading:J.node.loading,"index-key":J.indexKey},{ref_for:!0},J.bindings,{"custom-id":S.customId,"is-dark":S.isDark,onCopy:H[10]||(H[10]=ce=>i(ce)),onHandleArtifactClick:H[11]||(H[11]=ce=>s("handleArtifactClick",ce))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(x(),E("div",{key:1,class:"node-placeholder",style:on({height:`${d0(J.index)}px`})},null,4))],8,_se))),128)),Es.value&&d.value==="precise"?(x(),E("span",{key:3,ref_key:"typewriterCursorRef",ref:la,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ue("",!0),zt.value?(x(),E("div",{key:4,class:"node-spacer",style:on({height:`${S0.value}px`}),"aria-hidden":"true"},null,4)):ue("",!0)],42,wse))}}})),[["__scopeId","data-v-a9489508"]]),zs=yE;zs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",zs.__name,zs.name].filter(n=>!!n));for(const n of t)e.component(n,yE)};const G2=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"})),Sse={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Cse={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Ase={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Mse={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},Ese={class:"admonition-title"},Tse=["aria-expanded","aria-controls"],Nse=["id"],Hp=An(Je({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const o=e,s=t,i=D(()=>{if(o.node.title&&o.node.title.trim().length)return o.node.title;const c=o.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=oe(!!o.node.collapsible&&!((n=o.node.open)==null||n));function l(){o.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(x(),E("div",{class:Ue(["admonition",[`admonition-${o.node.kind}`]])},[w("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(x(),E("svg",Sse,[...u[1]||(u[1]=[w("circle",{cx:"12",cy:"12",r:"10"},null,-1),w("path",{d:"M12 16v-4"},null,-1),w("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(x(),E("svg",Cse,[...u[2]||(u[2]=[w("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),w("path",{d:"M9 18h6"},null,-1),w("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(x(),E("svg",Ase,[...u[3]||(u[3]=[w("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),w("path",{d:"M12 9v4"},null,-1),w("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(x(),E("svg",Mse,[...u[4]||(u[4]=[w("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),w("path",{d:"M12 8v4"},null,-1),w("path",{d:"M12 16h.01"},null,-1)])])):ue("",!0),w("span",Ese,B(i.value),1),o.node.collapsible?(x(),E("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(x(),E("svg",{style:on({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...u[5]||(u[5]=[w("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Tse)):ue("",!0)]),qn(w("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[ae(C(zs),{"index-key":`admonition-${e.indexKey}`,nodes:o.node.children,"custom-id":o.customId,typewriter:o.typewriter,fade:o.fade,onCopy:u[0]||(u[0]=d=>s("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,Nse),[[wi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Hp.install=e=>{e.component(Hp.__name,Hp)};const Qy=()=>vs(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let np=null,op=Qy,sp=null,Z4=!1,X4=!1;function n3e(){return Zn(this,null,function*(){if(np)return np;const e=op;return e?e===Qy&&Z4?null:sp||(sp=Zn(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===Qy)return e===op&&(Z4=!0,(function(o){X4||(X4=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',o))})(n)),null;throw n}finally{e===op&&(sp=null)}return e!==op?null:t?(np=(function(n){var o;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const s=(o=n.default)!=null?o:n;return typeof s=="function"?s:s?.D2&&typeof s.D2=="function"?s.D2:s})(t),np):null}),sp):null})}let ip=null,kE=null,rp=null;function o3e(){return typeof kE=="function"}function s3e(){return Zn(this,null,function*(){if(ip)return ip;const e=kE;return e?rp||(rp=Zn(null,null,function*(){const t=yield e(),n=(function(o){var s,i,r;if(!o)return null;const l=(s=o.default)!=null?s:o,a=typeof l=="function"&&typeof((i=l.prototype)==null?void 0:i.render)=="function"?l:(r=o.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(ip=n,ip):null}).finally(()=>{rp=null}),rp):null})}const i3e=Symbol("markstreamLanguageIconResolver"),lp=oe(!1);let Q4=!1;function gv(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ise(){return!Q4&&typeof window<"u"&&typeof document<"u"&&(Q4=!0,lp.value=gv(),new MutationObserver(()=>{lp.value=gv()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{lp.value=gv()})),lp}const bE=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],Lse=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Jy=[...bE].sort((e,t)=>t.length-e.length).join("|"),vv=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Jy}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Jy})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),xE=/[),.;!?,。;!?)]+$/;function $se(e){const t=e.toLowerCase();return bE.some(n=>t.endsWith(`.${n}`))}function Fse(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Jy}))["']`,"gi");let o;for(;(o=n.exec(e))!==null;){const s=o[1];if(!s)continue;const i=s.split("/").pop();i&&t.set(i,s)}return t}function Ose(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const o=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!o)return null;let s=(o[1]??"").replace(xE,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Lse.has(i),a=$se(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;s=d}const c=o[2]??o[3],u=c?Number(c):void 0;return{path:s,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function Bse(e,t={}){const n=[];vv.lastIndex=0;let o;for(;(o=vv.exec(e))!==null;){const s=o[0]??"",i=o[1]??"",r=s.indexOf(i);if(r<0)continue;const l=o[2]??o[3];let a=i+(l?s.slice(r+i.length):"");const c=a.replace(xE,""),u=a.length-c.length;a=c;const d=Ose(a,t);if(!d)continue;const f=o.index+r,h=f+a.length;n.push({...d,start:f,end:h,text:a}),u>0&&(vv.lastIndex-=u)}return n}const Rse=12e4,Dse=6e4,Pse=32,Hse=3e4,J4=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Wse(e){let t=0,n=0,o=0;J4.lastIndex=0;let s;for(;(s=J4.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Rse||n>=Dse||t>=Pse||o>=Hse?"pre":"shiki",codeFenceCount:t,codeChars:n}}function zse(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function Use(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const qse={key:1,class:"diff-wrap"},jse={class:"diff-bar"},Vse=["aria-label","onClick"],Kse={class:"diff-pre"},Gse={key:0,class:"diff-sign"},Yse={class:"diff-text"},Zse="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e3="github-light",t3="github-dark",Xse=Je({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){ite(),yte(),lte(),xte(),rte(new zse),bte(new Use);function t(z){return z.inline.ruler.disable("math"),z}const{t:n}=$t(),o=Jt("resolveImage"),s=oe(null),i=e,r=D(()=>!i.streaming),l=D(()=>Fse(i.text??"")),a=D(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Wse(i.text??"")),c=Ise(),u=D(()=>!i.streaming),d=zo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function m(z){return!/^(https?:|data:|blob:)/i.test(z)}function k(z){if(!o)return;const W=[];for(const L of[h,p]){L.lastIndex=0;let O;for(;(O=L.exec(z))!==null;)W.push(O[2]??"")}for(const L of W)!L||!m(L)||d.has(L)||f.has(L)||(f.add(L),o(L).then(O=>{d.set(L,O!==L?O:"")}).catch(()=>{d.set(L,"")}).finally(()=>{f.delete(L)}))}function y(z){if(!o)return z;const W=L=>{if(!m(L))return null;const O=d.get(L);return O===void 0?Zse:O===""?null:O};return z.replace(h,(L,O,U,Z)=>{const ie=W(U);return ie===null?L:`${O}${ie}${Z}`}).replace(p,(L,O,U,Z)=>{const ie=W(U);return ie===null?L:`${O}${ie}${Z}`})}et(()=>i.text,z=>k(z??""),{immediate:!0});function g(){if(!s.value||!i.openFile||i.streaming)return;const z=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),W=[];let L=z.nextNode();for(;L;){const O=L,U=O.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&O.data.trim().length>0&&W.push(O),L=z.nextNode()}for(const O of W){const U=Bse(O.data,{aliases:l.value});if(U.length===0||!O.parentNode)continue;const Z=document.createDocumentFragment();let ie=0;for(const q of U){q.start>ie&&Z.append(document.createTextNode(O.data.slice(ie,q.start)));const ee=document.createElement("button");ee.type="button",ee.className="md-file-link",ee.textContent=q.text,ee.title=q.line?`${q.path}:${q.line}`:q.path,ee.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:q.path,line:q.line})}),Z.append(ee),ie=q.end}ie<O.data.length&&Z.append(document.createTextNode(O.data.slice(ie))),O.parentNode.replaceChild(Z,O)}}function v(z){return!(!z||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(z))}function b(z){let W=z.length;for(const L of["#","?"]){const O=z.indexOf(L);O!==-1&&O<W&&(W=O)}return z.slice(0,W)}function A(){if(!s.value||!i.openFile||i.streaming)return;const z=s.value.querySelectorAll("a[href]");for(const W of z){if(W.dataset.mdLinkHandled==="true"||W.closest("svg"))continue;const L=W.getAttribute("href")??"";v(L)&&(W.dataset.mdLinkHandled="true",W.addEventListener("click",O=>{O.preventDefault(),O.stopPropagation(),i.openFile?.({path:b(L)})}))}}function I(){yt().then(()=>{g(),A()})}et(()=>i.text,I),et(()=>i.streaming,I);let T=null;Cn(()=>{I(),s.value&&(T=new MutationObserver(I),T.observe(s.value,{childList:!0,subtree:!0}))}),$n(()=>{T?.disconnect()});const M={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},$=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,N=D(()=>{const z=y(i.text??""),W=[];let L=0;$.lastIndex=0;let O;for(;(O=$.exec(z))!==null;){const Z=O[1]??"",ie=z.slice(L,O.index)+(Z||"");ie.trim()&&W.push({kind:"md",text:ie}),W.push({kind:"diff",code:O[2]??""}),L=$.lastIndex}const U=z.slice(L);return(U.trim()||W.length===0)&&W.push({kind:"md",text:U}),W});function F(z){return z.split(`
293
+ `).map(W=>W.startsWith("@@")?{type:"hunk",sign:"",text:W}:/^\+(?!\+\+)/.test(W)?{type:"add",sign:"+",text:W.slice(1)}:/^-(?!--)/.test(W)?{type:"del",sign:"-",text:W.slice(1)}:W.startsWith(" ")?{type:"ctx",sign:"",text:W.slice(1)}:{type:"ctx",sign:"",text:W})}const S=oe(null);function R(z,W){Jo(z).then(L=>{L&&(S.value=W,setTimeout(()=>{S.value=null},1400))})}return(z,W)=>(x(),E("div",{ref_key:"mdRef",ref:s,class:"md"},[(x(!0),E(We,null,rt(N.value,(L,O)=>(x(),E(We,{key:O},[L.kind==="md"?(x(),Se(C(zs),{key:0,content:L.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":e3,"code-block-dark-theme":t3,themes:[e3,t3],"code-block-props":M,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:C(dF)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(x(),E("div",qse,[w("div",jse,[W[0]||(W[0]=w("span",{class:"diff-lang"},"diff",-1)),ae(an,{text:C(n)("filePreview.copyCode")},{default:Ie(()=>[w("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:U=>R(L.code,O)},[ae(Ge,{name:S.value===O?"check":"copy",size:"sm"},null,8,["name"])],8,Vse)]),_:2},1032,["text"])]),w("pre",Kse,[w("code",null,[(x(!0),E(We,null,rt(F(L.code),(U,Z)=>(x(),E("span",{key:Z,class:Ue(["diff-line",`diff-${U.type}`])},[U.type!=="hunk"?(x(),E("span",Gse,B(U.sign),1)):ue("",!0),w("span",Yse,B(U.text),1)],2))),128))])])]))],64))),128))],512))}}),X1=dt(Xse,[["__scopeId","data-v-72f31a12"]]),Qse={class:"tc-anim"},Jse={class:"prev-anim"},eie={class:"prev"},tie=Je({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,o=t,s=D(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=D(()=>n.foldable&&s.value.length>1),r=D(()=>n.streaming||!i.value),l=D(()=>s.value.at(-1)??""),a=oe(null);return Cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),et(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||yt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(x(),E("div",{class:Ue(["think",{mob:e.mobile}])},[i.value?(x(),E("div",{key:0,class:Ue(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[w("div",Qse,[w("pre",{ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513)]),w("div",Jse,[w("span",eie,B(l.value),1)])],2)):(x(),E("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},B(e.text),513))],2))}}),nie=dt(tie,[["__scopeId","data-v-fdc551ea"]]),oie={class:"activity-notice",role:"status"},sie={"aria-hidden":"true"},iie={class:"an-label"},rie=Je({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(x(),E("div",oie,[w("span",sie,[ae(Us,{size:"sm"})]),w("span",iie,B(e.label),1)]))}}),lie=dt(rie,[["__scopeId","data-v-0d497074"]]);function aie(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const o=new Date,s=u=>String(u).padStart(2,"0"),i=`${s(n.getHours())}:${s(n.getMinutes())}`,r=n.getFullYear()===o.getFullYear(),l=n.getMonth()===o.getMonth(),a=n.getDate()===o.getDate();if(r&&l&&a)return i;const c=new Date(o);return c.setDate(o.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${i}`}catch{return e}}const cie=Je({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=$t(),o=oe(!1),s=D(()=>{const l=new Date(t.time);if(Number.isNaN(l.getTime()))return t.time;const a=c=>String(c).padStart(2,"0");return`${l.getFullYear()}-${a(l.getMonth()+1)}-${a(l.getDate())} ${a(l.getHours())}:${a(l.getMinutes())}`}),i=D(()=>o.value?s.value:aie(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(x(),E("button",{type:"button",class:"msg-time",onClick:St(r,["stop"])},B(i.value),1))}}),wE=dt(cie,[["__scopeId","data-v-9672fbd5"]]);function uie(e){return e.length===1?`0${e}`:e}function die(e,t){return`${String(Number(e))}:${uie(t)}`}const n3=e=>/^\d+$/.test(e);function fie(e,t){const n=e.trim().split(/\s+/);if(n.length!==5)return e;const[o,s,i,r,l]=n,a=i==="*"&&r==="*"&&l==="*",c=i==="*"&&r==="*";if(o==="*"&&s==="*"&&a)return t("conversation.cron.everyMinute");const u=/^\*\/(\d+)$/.exec(o);if(u&&s==="*"&&a)return u[1]==="1"?t("conversation.cron.everyMinute"):t("conversation.cron.everyNMinutes",{n:u[1]});if(o==="0"&&s==="*"&&a)return t("conversation.cron.everyHour");const d=/^\*\/(\d+)$/.exec(s);if(o==="0"&&d&&a)return t("conversation.cron.everyNHours",{n:d[1]});if(n3(o)&&n3(s)&&c){const f=die(s,o);if(l==="1-5")return t("conversation.cron.weekdaysAt",{time:f});if(l==="*")return t("conversation.cron.dailyAt",{time:f})}return e}const hie=["data-turn-id"],pie={class:"cn-bubble"},mie={class:"cn-title"},gie={key:0,class:"cn-prompt"},vie={class:"cn-meta"},yie={key:0,class:"cn-meta-item"},kie={key:1,class:"cn-meta-item"},bie=["aria-label"],xie=["title"],wie=Je({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=$t(),o=D(()=>t.cron),s=D(()=>o.value?.missedCount!==void 0),i=D(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=D(()=>{const u=o.value?.cron;return u?fie(u,n):""}),l=D(()=>s.value?"error":"ok"),a=D(()=>{const u=o.value;if(!u)return"";const d=[];return u.recurring===!1&&d.push(n("conversation.cron.oneShot")),typeof u.coalescedCount=="number"&&u.coalescedCount>1&&d.push(n("conversation.cron.coalesced",{n:u.coalescedCount})),u.missedCount!==void 0&&d.push(n("conversation.cron.missedCount",{n:u.missedCount})),u.stale===!0&&d.push(n("conversation.cron.finalDelivery")),d.join(" · ")}),c=D(()=>t.text??"");return(u,d)=>(x(),E("div",{class:Ue(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[w("div",pie,[w("span",mie,B(i.value),1),c.value?(x(),E("span",gie,B(c.value),1)):ue("",!0)]),w("div",vie,[ae(Ge,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(x(),E("span",yie,B(r.value),1)):ue("",!0),a.value?(x(),E("span",kie,B(a.value),1)):ue("",!0),w("span",{class:Ue(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):(x(),Se(Ge,{key:1,name:"close",size:"sm"}))],10,bie),o.value?.jobId?(x(),E("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},B(o.value.jobId),9,xie)):ue("",!0),e.createdAt?(x(),Se(wE,{key:3,time:e.createdAt},null,8,["time"])):ue("",!0)])],10,hie))}}),_ie=dt(wie,[["__scopeId","data-v-a62a6587"]]),Sie=["app:load:start","app:load:complete","export:start","export:accepted","export:failed","prompt:start","prompt:accepted","prompt:failed","session:snapshot:start","session:snapshot:accepted","session:snapshot:failed","operation:failed","window:error","window:unhandled-rejection","ws:connection","ws:error","ws:resync","ws:stale-reconnect"],_E=500,Um=256*1024,o3=200,yv=16384,kv=500,bv=50,xv=50,Cie=6,Aie=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Mie=/^[A-Za-z0-9+/=_-]{200,}$/;let wv=null;function Yi(){if(wv!==null)return wv;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}return e||(e=yo(Dt.debug)==="1"),wv=e,e}const Bl=[],Yc=[];let Ad=0;const Ca=[];let Md=0,Eie=1;const qm=new TextEncoder,Tie=new Set(Sie),Y2=oe(0),Ed=gr(!1);function Nie(){return Bl}function Iie(){Bl.length=0,Yc.length=0,Ad=0,Ca.length=0,Md=0,Y2.value++}function Jr(e){if(!Ed.value){try{const t={id:Eie++,ts:Date.now(),source:e.source,kind:String(fu(e.kind)),label:String(fu(e.label)),sessionId:e.sessionId===void 0?void 0:String(fu(e.sessionId)),method:e.method,path:e.path,eventType:e.eventType,seq:e.seq,offset:e.offset,status:e.status,code:e.code,requestId:e.requestId,durationMs:e.durationMs,detail:Zl(e.detail)},n=JSON.stringify(t),o=qm.encode(n).byteLength;if(o>Um)return;for(Bl.push(t),Yc.push(n),Ad+=o+(Yc.length>1?1:0);Bl.length>_E||Ad>Um;){const s=Yc.shift();Bl.shift(),s!==void 0&&(Ad-=qm.encode(s).byteLength,Yc.length>0&&(Ad-=1))}}catch{return}Y2.value++}}function va(e){if(typeof e=="string")return e.length<=o3?e:e.slice(0,o3)}function gi(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Lie(e,t){if(Tie.has(e))try{const n={ts:Date.now(),event:e,sessionId:va(t?.sessionId),status:va(t?.status),operation:va(t?.operation),seq:gi(t?.seq),durationMs:gi(t?.durationMs),messageCount:gi(t?.messageCount),contentCount:gi(t?.contentCount),mediaCount:gi(t?.mediaCount),sessionCount:gi(t?.sessionCount),workspaceCount:gi(t?.workspaceCount),promptId:va(t?.promptId),zipBytes:gi(t?.zipBytes),errorName:va(t?.errorName),errorCode:gi(t?.errorCode),requestId:va(t?.requestId),phase:va(t?.phase),httpStatus:gi(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:gi(t?.line),col:gi(t?.col)},o=JSON.stringify(n),s=qm.encode(o).byteLength;if(s>Um)return;for(Ca.push(o),Md+=s+(Ca.length>1?1:0);Ca.length>_E||Md>Um;){const i=Ca.shift();i!==void 0&&(Md-=qm.encode(i).byteLength,Ca.length>0&&(Md-=1))}}catch{return}}function fu(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const i=e;return Mie.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>kv?`${i.slice(0,kv)}… [+${i.length-kv} chars]`:i}if(n!=="object")return String(e);if(t>=Cie)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,bv).map(r=>fu(r,t+1));return e.length>bv&&i.push(`[+${e.length-bv} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,xv))o[i]=Aie.test(i)?"[redacted]":fu(r,t+1);return s.length>xv&&(o._truncatedKeys=s.length-xv),o}function Zl(e){if(e===void 0)return;const t=fu(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>yv)return{_truncated:`detail JSON was ${n.length} chars; first ${yv} kept`,preview:n.slice(0,yv)}}catch{return"[unserializable detail]"}return t}function ap(e){Yi()&&Jr({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:Zl(e.body)}})}function Ec(e){if(!Yi())return;const t=e.code!==0;Jr({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:Zl(e.data)}})}function pl(e){Yi()&&Jr({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Tc(e,t){Yi()&&Jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Zl(t)})}function $ie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=t.payload,s=typeof o?.session_id=="string"?o.session_id:void 0;Jr({source:"ws",kind:"ws:out",eventType:n,sessionId:s,label:`→ ${n}`,detail:Zl(e)})}function Fie(e){if(!Yi())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",o=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,s=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[o,s!==void 0?`seq=${s}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);Jr({source:"ws",kind:"ws:in",eventType:n,sessionId:o,seq:s,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:Zl(t.payload)})}const Oie={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Bie(e,t,n){Yi()&&Jr({source:"client",kind:`client:${e}`,label:`${Oie[e]} ${t}`,detail:Zl(n)})}function Rr(e,t){Yi()&&Jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Zl(t)})}function _o(e,t){Lie(e,t),Jr({source:"client",kind:"client:key",label:e,sessionId:typeof t?.sessionId=="string"?t.sessionId:void 0,seq:typeof t?.seq=="number"?t.seq:void 0,durationMs:typeof t?.durationMs=="number"?t.durationMs:void 0,detail:t})}let _v=!1,cp=null;function Rie(){if(_v)return()=>cp?.();_v=!0;const e=[];try{if(typeof window<"u"){const n=s=>{_o("window:error",{status:"failed",errorName:s.error instanceof Error?s.error.name:"Error",line:s.lineno,col:s.colno})},o=s=>{const i=s.reason;_o("window:unhandled-rejection",{status:"failed",errorName:i instanceof Error?i.name:typeof i})};window.addEventListener("error",n),window.addEventListener("unhandledrejection",o),e.push(()=>{window.removeEventListener("error",n)}),e.push(()=>{window.removeEventListener("unhandledrejection",o)})}}catch{}if(Yi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Bie(n,i.map(Die).join(" "),i.length>1?i:i[0])}catch{}o.apply(console,i)};console[n]=s,e.push(()=>{console[n]===s&&(console[n]=o)})}const t=()=>{if(cp===t){for(const n of e.toReversed())n();cp=null,_v=!1}};return cp=t,t}function Die(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function SE(e=Bl){if(typeof document>"u")return;const t=new Blob([Pie(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t);let o;try{o=document.createElement("a"),o.href=n,o.download=`kimi-web-log-${new Date().toISOString().replaceAll(/[:.]/g,"-")}.jsonl`,document.body.append(o),o.click()}finally{o?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(n)}catch{}},0)}}function Pie(e=Bl){return e===Bl?Yc.join(`
294
+ `):e.map(t=>JSON.stringify(t)).join(`
295
+ `)}function Hie(){return Ca.join(`
296
+ `)}function CE(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function ek(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Bi(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:CE(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Xd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function s3(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url,id:e.id}}function Z2(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:s3(e.source)};case"video":return{type:"video",source:s3(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function tk(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Z2),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Wie(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url,id:t.id},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function zie(e){return{content:e.content.map(Wie),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function Uie(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function AE(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function qie(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function jie(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(qie),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function ME(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(jie),createdAt:e.created_at}}function Vie(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function Kie(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=Vie(o);return{answers:t,method:e.method,note:e.note}}function Wp(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background??(e.kind==="subagent"?!0:void 0)}}function i3(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function ml(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Nc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function vi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function EE(e){if(!e||typeof e!="object")return null;const t=e,n=ml(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const o=t.budget,s=o&&typeof o=="object"?o:{};return{goalId:ml(t,"goalId")??ml(t,"goal_id")??"goal",objective:ml(t,"objective")??"",completionCriterion:ml(t,"completionCriterion")??ml(t,"completion_criterion"),status:n,turnsUsed:Nc(t,"turnsUsed")??Nc(t,"turns_used")??0,tokensUsed:Nc(t,"tokensUsed")??Nc(t,"tokens_used")??0,wallClockMs:Nc(t,"wallClockMs")??Nc(t,"wall_clock_ms")??0,terminalReason:ml(t,"terminalReason")??ml(t,"terminal_reason"),budget:{tokenBudget:vi(s,"tokenBudget")??vi(s,"token_budget"),remainingTokens:vi(s,"remainingTokens")??vi(s,"remaining_tokens"),turnBudget:vi(s,"turnBudget")??vi(s,"turn_budget"),remainingTurns:vi(s,"remainingTurns")??vi(s,"remaining_turns"),wallClockBudgetMs:vi(s,"wallClockBudgetMs")??vi(s,"wall_clock_budget_ms"),remainingWallClockMs:vi(s,"remainingWallClockMs")??vi(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function Gie(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Bi(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Bi(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Xd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Xd(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:CE(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=EE(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:tk(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Z2),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:AE(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:ME(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:Wp(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:nk(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Yie(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function r3(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function nk(e){const t={};for(const[n,o]of Object.entries(e.providers))t[n]={type:o.type,baseUrl:o.base_url,defaultModel:o.default_model,hasApiKey:o.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function Zie(e){return e.session_id}function Xie(e){return e.seq}const Qie="main",Jie=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function $r(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function ere(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function l3(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map,retryReuseMsgId:void 0}}function hs(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ba(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function yi(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function tre(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=hs(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=hs(t,"goalId")??hs(t,"goal_id")??"goal",r=hs(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:hs(t,"completionCriterion")??hs(t,"completion_criterion"),status:s,turnsUsed:ba(t,"turnsUsed")??ba(t,"turns_used")??0,tokensUsed:ba(t,"tokensUsed")??ba(t,"tokens_used")??0,wallClockMs:ba(t,"wallClockMs")??ba(t,"wall_clock_ms")??0,terminalReason:hs(t,"terminalReason")??hs(t,"terminal_reason"),budget:{tokenBudget:yi(o,"tokenBudget")??yi(o,"token_budget"),remainingTokens:yi(o,"remainingTokens")??yi(o,"remaining_tokens"),turnBudget:yi(o,"turnBudget")??yi(o,"turn_budget"),remainingTurns:yi(o,"remainingTurns")??yi(o,"remaining_turns"),wallClockBudgetMs:yi(o,"wallClockBudgetMs")??yi(o,"wall_clock_budget_ms"),remainingWallClockMs:yi(o,"remainingWallClockMs")??yi(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function Aa(e,t,n,o){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function nre(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=hs(t,"name")??hs(t,"toolName")??"tool",o=ec(ore(n)),s=sre(n,t.args??t.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const s=hs(n,"text");if(s)return Sv(s);const i=hs(n,"message");if(i)return Sv(i)}const o=hs(t,"message");if(o)return Sv(o)}return null}function ore(e){return e.replace(/_\d+$/,"")}const a3=2e3;function Sv(e){return e.length>a3?`${e.slice(0,a3)}…`:e}function sre(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return ff(e,n)}function ire(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=hs(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=Aa(e,t,n,{status:"running",subagentPhase:"working",startedAt:d?.startedAt??new Date().toISOString()}),h=[];return f&&h.push({type:"taskCreated",sessionId:t,task:f}),h.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:u,stream:"stdout",kind:"text"}),h}const r=nre(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=Aa(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function hd(e){return{...e,content:e.content.map(t=>({...t}))}}function c3(e,t,n){const o={id:$r("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function rre(e,t,n,o,s,i){const r={id:o,sessionId:t,role:"user",content:s,createdAt:i,promptId:n};return e.messages.push(r),r}function lre(e){return Array.isArray(e)?e.map(t=>Z2(t)):[]}function u3(e,t,n,o){const s=e.messages.find(r=>r.id===t);if(!s)return-1;const i=s.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=o:i.thinking+=o,s.content.length-1):(s.content.push(n==="text"?{type:"text",text:o}:{type:"thinking",thinking:o}),s.content.length-1)}function are(e,t,n,o,s,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:o,input:s,outputLines:i})}function cre(e){const t=e.update,n=t&&typeof t=="object"?t:null,s=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:s}:null}function d3(e,t){e.messages.find(n=>n.id===t)}function ure(e,t,n,o,s,i){const r={id:$r("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:o,isError:s}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function pd(e,t){return e.messages.find(n=>n.id===t)}function f3(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function dre(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=l3(),e.set(u,d)),d}function o(u){e.set(u,l3())}function s(u){t.add(u)}function i(u,d){const f=n(u);f.currentPromptId=d}function r(u,d){o(u);const f=n(u),h=d.promptId??$r("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=c3(f,u,h);d.thinkingText.length>0&&p.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&p.content.push({type:"text",text:d.assistantText});for(const m of d.runningTools){const k=typeof m.lastProgress?.text=="string"&&m.lastProgress.text.length>0?[m.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:m.toolCallId,toolName:m.name,input:m.args??{},outputLines:k}),f.toolStartTimes.set(m.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:hd(p)}]}function l(u,d,f,h){try{return c(u,d,f,h)}catch(p){return console.error("[agentProjector] Error projecting event:",u,p instanceof Error?p.message:p),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,f,h){const p=n(f),m=d,k=[],y=m?.agentId;if(typeof y=="string"&&y!==Qie){const g=t.has(y);if(g&&(u==="thinking.delta"||u==="assistant.delta")){const v=m?.delta??"";return v?[{type:"agentDelta",sessionId:f,agentId:y,delta:{[u==="thinking.delta"?"thinking":"text"]:v}}]:[]}if(g&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:y,reason:m?.reason}];if(Jie.has(u))return ire(p,f,y,u,m??{},t)}switch(u){case"session.meta.updated":{const g=m?.patch?.title??m?.title,v=m?.patch?.lastPrompt,b={};typeof g=="string"&&g.length>0&&(b.title=g),typeof v=="string"&&(b.lastPrompt=v),(b.title!==void 0||b.lastPrompt!==void 0)&&k.push({type:"sessionMetaUpdated",sessionId:f,...b});break}case"prompt.submitted":{const g=m?.promptId,v=m?.userMessageId;if(!g||!v)break;const b=lre(m?.content);if(b.length===0)break;p.currentPromptId=g;const A=rre(p,f,g,v,b,typeof m?.createdAt=="string"?m.createdAt:new Date().toISOString());k.push({type:"messageCreated",message:hd(A)});break}case"turn.started":{const g=m?.turnId,v=p.currentPromptId??$r("pr_");p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v),p.turnTextLen=0,p.turnThinkLen=0,k.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;if(v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,pd(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const b=c3(p,f,v);p.currentAssistantMsgId=b.id,k.push({type:"messageCreated",message:hd(b)});break}case"thinking.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const b=a(p.turnThinkLen,h?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=u3(p,g,"thinking",v);if(A<0)break;p.turnThinkLen+=v.length,k.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{thinking:v}});break}case"assistant.delta":{const g=p.currentAssistantMsgId;if(!g)break;const v=m?.delta??"";if(!v)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const b=a(p.turnTextLen,h?.offset);if(b==="skip")break;if(b==="gap"){k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=u3(p,g,"text",v);if(A<0)break;p.turnTextLen+=v.length,k.push({type:"assistantDelta",sessionId:f,messageId:g,contentIndex:A,delta:{text:v}});break}case"tool.use":case"tool.call.started":{const g=p.currentAssistantMsgId,v=m?.turnId,b=p.turnPromptId.get(v)??p.currentPromptId;if(!g||!b)break;const A=m?.toolCallId,I=m?.name??m?.toolName??"",T=m?.args??m?.input??{};are(p,g,A,I,T);const M=pd(p,g);M&&M.content.length-1,p.toolStartTimes.set(A,Date.now()),M&&k.push({type:"messageUpdated",sessionId:f,messageId:g,content:M.content.map($=>({...$})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const g=m?.toolCallId,v=cre(m??{});g&&v&&k.push({type:"toolOutput",sessionId:f,toolCallId:g,outputChunk:v.outputChunk,stream:v.stream});break}case"tool.result":{const g=m?.turnId;let v=p.turnPromptId.get(g)??p.currentPromptId;v||(v=$r("pr_"),p.currentPromptId=v,g!==void 0&&p.turnPromptId.set(g,v));const b=m?.toolCallId,A=m?.output,I=m?.isError??!1;p.toolStartTimes.get(b)??Date.now(),p.toolStartTimes.delete(b);const T=ure(p,f,b,A,I,v);k.push({type:"messageCreated",message:hd(T)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const g=p.currentAssistantMsgId,v=ere(m?.usage);if(p.totalInput+=v.input,p.totalOutput+=v.output,p.totalCacheRead+=v.cacheRead,p.totalCacheCreate+=v.cacheCreate,g){d3(p,g);const b=pd(p,g);b&&k.push({type:"messageUpdated",sessionId:f,messageId:g,content:b.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{m?.model&&(p.model=m.model),m?.contextTokens!==void 0&&(p.contextTokens=m.contextTokens),m?.maxContextTokens!==void 0&&(p.contextLimit=m.maxContextTokens),k.push({type:"sessionUsageUpdated",sessionId:f,usage:f3(p),model:p.model||void 0,swarmMode:m?.swarmMode===!0?!0:m?.swarmMode===!1?!1:void 0,planMode:m?.planMode===!0?!0:m?.planMode===!1?!1:void 0,thinking:typeof m?.thinkingEffort=="string"&&m.thinkingEffort.length>0?m.thinkingEffort:void 0});break}case"turn.ended":{const g=p.currentAssistantMsgId,v=m?.reason??"completed",b=ba(m??{},"durationMs");if(k.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:m?.reason}),g){d3(p,g);const I=pd(p,g);I&&k.push({type:"messageUpdated",sessionId:f,messageId:g,content:I.content.map(T=>({...T})),status:v==="failed"||v==="blocked"?"error":"completed",durationMs:b})}p.turnCount++;const A=f3(p);k.push({type:"sessionUsageUpdated",sessionId:f,usage:A}),p.currentAssistantMsgId=void 0,p.currentPromptId=void 0,p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId=void 0;break}case"prompt.completed":{const g=m?.promptId;typeof g=="string"&&g.length>0&&k.push({type:"promptCompleted",sessionId:f,promptId:g,reason:m?.reason??"completed"});break}case"prompt.aborted":{const g=m?.promptId;typeof g=="string"&&g.length>0&&k.push({type:"promptAborted",sessionId:f,promptId:g});break}case"turn.step.retrying":{const g=p.currentAssistantMsgId;if(g!==void 0){const v=pd(p,g);v!==void 0&&(v.content=v.content.filter(b=>b.type!=="text"&&b.type!=="thinking"&&b.type!=="toolUse"),k.push({type:"messageUpdated",sessionId:f,messageId:g,content:v.content.map(b=>({...b})),status:"pending"}),p.retryReuseMsgId=g)}p.turnTextLen=0,p.turnThinkLen=0,p.toolStartTimes.clear();break}case"turn.step.interrupted":{p.currentAssistantMsgId=void 0,p.retryReuseMsgId=void 0;break}case"subagent.spawned":{const v={id:typeof m?.subagentId=="string"&&m.subagentId.length>0?m.subagentId:$r("task_"),sessionId:f,kind:"subagent",description:typeof m?.description=="string"?m.description:m?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof m?.subagentName=="string"?m.subagentName:void 0,parentToolCallId:typeof m?.parentToolCallId=="string"?m.parentToolCallId:void 0,swarmIndex:typeof m?.swarmIndex=="number"?m.swarmIndex:void 0,runInBackground:m?.runInBackground===!0};p.subagentMeta.set(v.id,v),k.push({type:"taskCreated",sessionId:f,task:v});break}case"subagent.started":{const g=Aa(p,f,m?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});g&&k.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.suspended":{const g=Aa(p,f,m?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof m?.reason=="string"?m.reason:void 0});g&&k.push({type:"taskCreated",sessionId:f,task:g});break}case"subagent.completed":{const g=typeof m?.resultSummary=="string"?m.resultSummary:void 0,v=Aa(p,f,m?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:g});v&&k.push({type:"taskCreated",sessionId:f,task:v}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"completed",outputPreview:g});break}case"subagent.failed":{const g=typeof m?.error=="string"?m.error:void 0,v=Aa(p,f,m?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:g});v&&k.push({type:"taskCreated",sessionId:f,task:v}),k.push({type:"taskCompleted",sessionId:f,taskId:m?.subagentId??"",status:"failed",outputPreview:g});break}case"error":{k.push({type:"unknown",raw:{_agentError:!0,code:m?.code,message:m?.message,name:m?.name,details:m?.details,retryable:m?.retryable}});break}case"warning":{k.push({type:"unknown",raw:{_agentWarning:!0,message:m?.message}});break}case"task.started":{const g=m?.info??{},v=typeof g.startedAt=="number"?new Date(g.startedAt).toISOString():void 0,b=typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):$r("task_"),A=typeof g.description=="string"?g.description:typeof g.command=="string"?g.command:On.global.t("tasks.defaultDescription");if(g.kind==="agent"){const T=typeof g.agentId=="string"&&g.agentId.length>0?g.agentId:void 0;if(T!==void 0){const M=Aa(p,f,T,{description:A,backgroundTaskId:b,runInBackground:!0});M&&k.push({type:"taskCreated",sessionId:f,task:M})}else k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,subagentPhase:"queued",runInBackground:!0}});break}const I=typeof g.command=="string"?g.command:void 0;k.push({type:"taskCreated",sessionId:f,task:{id:b,sessionId:f,kind:"bash",description:A,command:I,status:"running",createdAt:v??new Date().toISOString(),startedAt:v,outputPreview:I!==void 0?`$ ${I}`:void 0}});break}case"task.terminated":{const g=m?.info??{},v=g.status==="failed"||typeof g.exitCode=="number"&&g.exitCode!==0;k.push({type:"taskCompleted",sessionId:f,taskId:typeof g.taskId=="string"?g.taskId:typeof g.taskId=="number"?String(g.taskId):"",status:v?"failed":"completed"});break}case"compaction.completed":{const g=m?.result??{};k.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof g.tokensBefore=="number"?g.tokensBefore:void 0,tokensAfter:typeof g.tokensAfter=="number"?g.tokensAfter:void 0,summary:typeof g.summary=="string"?g.summary:void 0}),k.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{k.push({type:"compactionStarted",sessionId:f,trigger:m?.trigger==="manual"?"manual":"auto",instruction:typeof m?.instruction=="string"?m.instruction:void 0});break}case"compaction.cancelled":{k.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const g=tre(m?.snapshot??null);k.push({type:"goalUpdated",sessionId:f,goal:g?.status==="complete"?null:g});break}case"cron.fired":{const g=m?.origin,v=hs(m??{},"prompt");if(g&&typeof g=="object"&&g.kind==="cron_job"&&v){const b={id:$r("cron_"),sessionId:f,role:"user",content:[{type:"text",text:v}],createdAt:new Date().toISOString(),metadata:{origin:g}};p.messages.push(b),k.push({type:"messageCreated",message:hd(b)})}break}}return k}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const fre=new Set(["server_hello","ack","ping","resync_required","error","pong"]),h3=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),hre=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),pre=new Set(["assistant.delta","thinking.delta"]);function mre(e,t){if(fre.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return pre.has(o)?gre(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?hre.has(o)?{route:"protocol"}:h3.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:h3.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function gre(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class Td extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class Nr extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}function _i(e){return e instanceof Td||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function X2(e){return e instanceof Nr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const Go="kimi-web.server-credential",vre="token",yre=10080*60*1e3;let fr;const ok=new Set;function kre(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(vre);if(!n)return;const o=new URL(window.location.href);return o.hash="",window.history.replaceState(window.history.state,"",`${o.pathname}${o.search}`),n}function sk(e){return{version:1,credential:e,expiresAt:Date.now()+yre}}function bre(e){return JSON.stringify(e)}function Q2(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function ik(e){globalThis.localStorage?.setItem(Go,bre(e))}function xre(){try{const e=globalThis.localStorage?.getItem(Go);if(e){const n=Q2(e);if(n===void 0){const o=sk(e);let s=!1;try{ik(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(Go)===e&&globalThis.localStorage?.removeItem(Go),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(Go)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(Go),globalThis.localStorage?.getItem(Go)===e&&globalThis.localStorage?.removeItem(Go);return}const t=globalThis.sessionStorage?.getItem(Go);if(t){const n=sk(t);let o=!1;try{ik(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(Go),o=!0}catch{}return o?n:void 0}return}catch{return}}function wre(){const e=kre();return e?(NE(e),!0):(fr=xre(),fr!==void 0)}function TE(){if(fr!==void 0){if(fr.expiresAt<=Date.now()){_re(fr);return}return fr.credential}}function _re(e){fr=void 0;try{globalThis.sessionStorage?.removeItem(Go);const t=globalThis.localStorage?.getItem(Go),n=t==null?void 0:Q2(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(Go)}catch{}}function NE(e){const t=sk(e);fr=t;try{ik(t)}catch{}try{globalThis.sessionStorage?.removeItem(Go)}catch{}}function Sre(){const e=fr;fr=void 0;try{const t=globalThis.localStorage?.getItem(Go),o=(t==null?void 0:Q2(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(Go),globalThis.sessionStorage?.removeItem(Go)}catch{}}function Cre(e){return ok.add(e),()=>{ok.delete(e)}}function Are(){Sre();for(const e of ok)try{e()}catch{}}const Pc=3e4,up=5*6e4,IE="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p3=500,LE=40101;function dp(e=Pc){try{return AbortSignal.timeout(e)}catch{return}}function Mre(e,t){let n="",o=e;for(let s=0;s<t;s++)n=IE[o%32]+n,o=Math.floor(o/32);return n}function Ere(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>IE[n%32]).join("")}function fp(){return`${Mre(Date.now(),10)}${Ere(16)}`}function Tre(e){try{const t=[];return e.forEach((n,o)=>{typeof n=="string"?t.push({field:o,value:n}):t.push({field:o,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Cv(e){try{const t=await e.text();return t?t.length>p3?`${t.slice(0,p3)}...`:t:void 0}catch{return}}class Nre{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t){const n=qc(this.origin,t),o=fp(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();ap({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:dp()})}catch(a){throw pl({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new Nr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return Ec({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:0,msg:""}),r.blob();let l;try{l=await r.clone().json()}catch{}throw this.checkAuthRequired(r,l?.code??0),Ec({method:"GET",path:t,requestId:o,status:r.status,durationMs:Date.now()-i,code:l?.code??r.status,msg:l?.msg??r.statusText,envelopeRequestId:l?.request_id}),new Td({code:l?.code??r.status,msg:l?.msg??r.statusText,requestId:l?.request_id??o,details:l?.details,timestamp:Date.now(),durationMs:Date.now()-i})}async post(t,n,o){return this.request("POST",t,n,void 0,o?.allowCodes)}async postZip(t,n,o){const s="POST",i=qc(this.origin,t),r=fp(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();ap({method:s,path:t,url:i,requestId:r,body:o});let c;try{c=await fetch(i,{method:s,headers:l,body:JSON.stringify(n),signal:dp(up)})}catch(h){throw pl({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Nr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:up,timestamp:Date.now(),durationMs:Date.now()-a})}const u=c.headers.get("content-type")??void 0,d=u?.split(";",1)[0]?.trim().toLowerCase();if(!c.ok||d!=="application/zip"){let h;try{h=await c.clone().json()}catch{}if(this.checkAuthRequired(c,h?.code??0),!c.ok||h!==void 0&&h.code!==0){const k=h?.code??c.status,y=h?.msg??c.statusText;throw Ec({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:k,msg:y,envelopeRequestId:h?.request_id}),new Td({code:k,msg:y,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),m=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:m}),new Nr({message:`Invalid ZIP response from ${s} ${t}`,cause:m,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:up,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await Cv(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw pl({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new Nr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:up,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return Ec({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:c.headers.get("content-disposition")??void 0}}async postForm(t,n){const o=qc(this.origin,t),s=fp(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();ap({method:"POST",path:t,url:o,requestId:s,body:Tre(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:dp()})}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new Nr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw pl({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new Nr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Pc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Cv(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(Ec({method:"POST",path:t,requestId:s,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),this.checkAuthRequired(l,a.code),a.code!==0)throw new Td({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details,timestamp:Date.now(),durationMs:Date.now()-r});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,o,s,i=[]){let r=qc(this.origin,n);if(s){const h=new URLSearchParams;for(const[m,k]of Object.entries(s))k!==void 0&&h.set(m,String(k));const p=h.toString();p&&(r=`${r}?${p}`)}const l=fp(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();ap({method:t,path:n,url:r,requestId:l,body:o});let u;try{u=await fetch(r,{method:t,headers:a,body:o!==void 0?JSON.stringify(o):void 0,signal:dp()})}catch(h){throw pl({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new Nr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:Pc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw pl({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new Nr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:Pc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Cv(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(Ec({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthRequired(u,d.code),d.code!==0&&!i.includes(d.code))throw new Td({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details,timestamp:Date.now(),durationMs:Date.now()-c});return d.data}addClientHeaders(t){const n=TE();n!==void 0&&(t.Authorization=`Bearer ${n}`),this.identity!==void 0&&(t["X-Kimi-Client-Id"]=this.identity.clientId,t["X-Kimi-Client-Name"]=this.identity.clientName,t["X-Kimi-Client-Version"]=this.identity.clientVersion,t["X-Kimi-Client-Ui-Mode"]=this.identity.clientUiMode)}checkAuthRequired(t,n){(t.status===401||n===LE)&&Are()}}const Ire="kimi-code.bearer.",Lre=3e4;class $re{constructor(t,n,o){this.wsUrl=t,this.clientId=n,this.handlers=o}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),Tc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=TE(),n=t!==void 0?[`${Ire}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{Tc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));Fie(i),this.handleFrame(i)}catch(i){Tc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{Tc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{Tc("close",s?{code:s.code,reason:s.reason,wasClean:s.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Tc("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const o=this.pendingSubscriptions.findIndex(s=>s.sessionId===t);o!==-1&&this.pendingSubscriptions.splice(o,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,o){const s=hp(t,n),i=this.terminalAttachments.get(s),r=o??i?.lastSeq??0;this.terminalAttachments.set(s,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,o){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:o}})}terminalResize(t,n,o,s){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:o,rows:s}})}terminalDetach(t,n){this.terminalAttachments.delete(hp(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(hp(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,Lre),o=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:o}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t;switch(t.type){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,i=n.seq,r=hp(o,s),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(o,s,a,i);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(o,s,r);break}default:{this.trackCursor(n);const o=n.type,s=mre(o,n.payload);if(s.route==="protocol"){this.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:s.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,o){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:o>0?o:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,o=t.seq;if(typeof n!="string"||typeof o!="number")return;const s=this.subscriptions.get(n);if(!s||o<=s.seq&&s.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:s.epoch;this.subscriptions.set(n,{seq:Math.max(o,s.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),$ie(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function hp(e,t){return`${e}\0${t}`}function Fre(e,t){if(e===void 0)return t;let n;const o=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(o!==void 0)try{n=decodeURIComponent(o.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function m3(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Av(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function g3(e){return e==="auto_compact"||e==="manual_compact"}class Ore{http;config;constructor(t){this.config=t,this.http=new Nre(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,backend:t.backend==="v2"?"v2":"v1"}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},o=await this.http.get("/sessions",n);return{items:o.items.map(Bi),hasMore:o.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const o=await this.http.post("/sessions",n);return Bi(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Bi(n)}async updateSession(t,n){const o={};n.title!==void 0&&(o.title=n.title),n.cwd!==void 0&&(o.metadata={cwd:n.cwd});const s={};n.model!==void 0&&(s.model=n.model),n.permissionMode!==void 0&&(s.permission_mode=n.permissionMode),n.planMode!==void 0&&(s.plan_mode=n.planMode),n.swarmMode!==void 0&&(s.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(s.goal_objective=n.goalObjective),n.goalControl!==void 0&&(s.goal_control=n.goalControl),n.thinking!==void 0&&(s.thinking=n.thinking),Object.keys(s).length>0&&(o.agent_config=s);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,o);return Bi(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return EE(n)}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Bi(n)}async listMessages(t,n){const o={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,o);return{items:s.items.map(tk),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();_o("session:snapshot:start",{sessionId:t});try{const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`),s={asOfSeq:o.as_of_seq,epoch:o.epoch,session:Bi(o.session),messages:o.messages.items.map(tk),hasMoreMessages:o.messages.has_more,inFlightTurn:o.in_flight_turn===null?null:{turnId:o.in_flight_turn.turn_id,assistantText:o.in_flight_turn.assistant_text,thinkingText:o.in_flight_turn.thinking_text,runningTools:o.in_flight_turn.running_tools.map(i=>({toolCallId:i.tool_call_id,name:i.name,args:i.args,description:i.description,lastProgress:i.last_progress})),promptId:o.in_flight_turn.current_prompt_id},pendingApprovals:o.pending_approvals.map(AE),pendingQuestions:o.pending_questions.map(ME),subagents:(o.subagents??[]).map(Wp)};return _o("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw _o("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...m3(o)}),o}}async exportSession(t,n){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(`
297
+ `).length,i=await this.http.postZip(`/sessions/${encodeURIComponent(t)}/export`,{web_log:n},{web_log_bytes:o,web_log_entries:s}),r=`${t}.zip`;return{blob:i.blob,fileName:Fre(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();_o("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(s=>s.type==="image"||s.type==="video"||s.type==="file").length});try{const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,zie(n));return _o("prompt:accepted",{sessionId:t,promptId:s.prompt_id,status:s.status,durationMs:Date.now()-o}),{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}catch(s){throw _o("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...m3(s)}),s}}async steerPrompts(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:o.steered,promptIds:o.prompt_ids}}async abortPrompt(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:o.aborted,atSeq:o.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,o);return Bi(s)}async createChildSession(t,n){const o={};n?.title!==void 0&&(o.title=n.title);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,o);return Bi(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Bi)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,Uie(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async respondQuestion(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,Kie(o));return{resolved:s.resolved,resolvedAt:s.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const o={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,o)).items.map(Wp)}async getTask(t,n,o){const s={with_output:o?.withOutput,output_bytes:o?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,s);return Wp(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Av)}async createTerminal(t,n={}){const o={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},s=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,o);return Av(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Av(o)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(o=>({name:o.name,description:o.description,source:o.source}))}async activateSkill(t,n,o){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,o!==void 0&&o.length>0?{args:o}:{});return{activated:s.activated,skillName:s.skill_name}}async listDirectory(t,n){const o={};n.path!==void 0&&(o.path=n.path),n.depth!==void 0&&(o.depth=n.depth),n.includeGitStatus!==void 0&&(o.include_git_status=n.includeGitStatus);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,o),i=s.children_by_path?Object.fromEntries(Object.entries(s.children_by_path).map(([r,l])=>[r,l.map(i3)])):void 0;return{items:s.items.map(i3),childrenByPath:i,truncated:s.truncated}}async readFile(t,n){const o={path:n.path};n.offset!==void 0&&(o.offset=n.offset),n.length!==void 0&&(o.length=n.length);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,o);return{path:s.path,content:s.content,encoding:s.encoding,size:s.size,truncated:s.truncated,etag:s.etag,mime:s.mime,languageId:s.language_id,lineCount:s.line_count,isBinary:s.is_binary}}async searchFiles(t,n){const o={query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,o);return{items:s.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const o={pattern:n.pattern};n.regex!==void 0&&(o.regex=n.regex),n.caseSensitive!==void 0&&(o.case_sensitive=n.caseSensitive);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,o);return{files:s.files,filesScanned:s.files_scanned,truncated:s.truncated,elapsedMs:s.elapsed_ms}}async getGitStatus(t,n){const o={};n!==void 0&&(o.paths=n);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,o);return{branch:s.branch,ahead:s.ahead,behind:s.behind,entries:s.entries,additions:s.additions,deletions:s.deletions,pullRequest:s.pullRequest??null}}async getFileDiff(t,n){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:o.path,diff:o.diff}}getFileDownloadUrl(t,n){const o=n.split("/").map(s=>encodeURIComponent(s)).join("/");return qc(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${o}:download`)}async openFile(t,n){const o={path:n.path};return n.line!==void 0&&(o.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,o)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,o,s){const i={app_id:n,path:o};s!==void 0&&(i.line=s),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Xd)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const o=await this.http.post("/workspaces",n);return Xd(o)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const o=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Xd(o)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(o=>({name:o.name,path:o.path,isDir:o.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Yie)}async listProviders(){return(await this.http.get("/providers")).items.map(r3)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const o=await this.http.post("/providers",n);return r3(o)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Mv(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return Mv(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return Mv(t)}async getConfig(){const t=await this.http.get("/config");return nk(t)}async setConfig(t){const n={},o={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=o[i];l!==void 0&&(n[l]=r)}const s=await this.http.post("/config",n);return nk(s)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return t.status==="authenticated"?{flowId:t.flow_id,provider:t.provider,status:"authenticated"}:{flowId:t.flow_id,provider:t.provider,status:"pending",verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const o=await this.http.postForm("/files",n);return{id:o.id,name:o.name,mediaType:o.media_type,size:o.size}}getFileUrl(t){return qc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=rF(this.config.serverHttpUrl,this.config.clientId),o=dre(),s=new $re(n,this.config.clientId,{onWireEvent:i=>{const r=Zie(i),l=Xie(i),a=Gie(i);a.type==="historyCompacted"&&!g3(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=o.project(r,c,a,{offset:u});for(const f of d){const h=c?.turnId,p=f.type==="assistantDelta"&&typeof h=="number"&&typeof u=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:u,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!g3(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:p})}},onResync:(i,r,l)=>{o.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return s.connect(),{subscribe(i,r){s.subscribe(i,r??{seq:0})},unsubscribe(i){s.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){o.reset(i);return}const l=o.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){o.bindNextPromptId(i,r)},abort(i,r){s.abort(i,r)},terminalAttach(i,r,l){s.terminalAttach(i,r,l)},terminalInput(i,r,l){s.terminalInput(i,r,l)},terminalResize(i,r,l,a){s.terminalResize(i,r,l,a)},terminalDetach(i,r){s.terminalDetach(i,r)},terminalClose(i,r){s.terminalClose(i,r)},markSideChannelAgent(i){o.markSideChannelAgent(i)},health(){return s.health()},reconnect(){s.reconnect()},close(){s.close()}}}}function Mv(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}let v3;function ht(){return v3??=new Ore(tF()),v3}const Bre=["src","controls","muted"],Rre=["src","alt"],$E=Je({__name:"AuthMedia",props:{url:{},kind:{},alt:{},fileId:{},mediaClass:{default:"u-img"},controls:{type:Boolean,default:!0},muted:{type:Boolean,default:!1}},setup(e){const t=e,n=oe(t.fileId?"":t.url),o=oe(null),s=oe(!t.fileId);let i=null,r=0,l=!1,a=null;function c(){i!==null&&(URL.revokeObjectURL(i),i=null)}async function u(){const d=++r;if(c(),!t.fileId){n.value=t.url;return}if(s.value)try{const f=await ht().getFileBlob(t.fileId),h=URL.createObjectURL(f);if(l||d!==r){URL.revokeObjectURL(h);return}i=h,n.value=i}catch{if(l||d!==r)return;n.value=t.url}}return et(()=>[t.fileId,t.url,s.value],u,{immediate:!0}),Cn(()=>{typeof IntersectionObserver=="function"&&o.value?(a=new IntersectionObserver(d=>{d[0]?.isIntersecting&&(s.value=!0,a?.disconnect(),a=null)},{rootMargin:"200px"}),a.observe(o.value)):s.value=!0}),ho(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(x(),E("video",{key:0,ref_key:"mediaEl",ref:o,class:Ue(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Bre)):(x(),E("img",{key:1,ref_key:"mediaEl",ref:o,class:Ue(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Rre))}}),Dre=["title","data-kind"],Pre=["aria-label"],Hre={class:"att-tile"},Wre={class:"att-name"},zre={key:1,class:"att-err"},Ure=["aria-label"],qre=Je({__name:"AttachmentChip",props:{kind:{},name:{},url:{},fileId:{},mediaType:{},size:{},uploading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},removeLabel:{}},emits:["activate","remove"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>{const d=n.name?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]??n.mediaType?.split("/")[1]?.split("+")[0];return d?d.toUpperCase():void 0}),r=D(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=D(()=>n.name?n.name:n.kind==="image"?s("composer.attachmentImage"):n.kind==="video"?s("composer.attachmentVideo"):s("composer.attachmentFile"));function a(u){return u<1024?`${u} B`:u<1024*1024?`${Math.round(u/1024)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}const c=D(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(x(),E("span",{class:Ue(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[w("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[w("span",Hre,[e.kind==="image"&&e.url?(x(),Se($E,{key:0,url:e.url,kind:"image",alt:e.name,"file-id":e.fileId,"media-class":"att-thumb"},null,8,["url","alt","file-id"])):e.kind==="video"?(x(),Se(Ge,{key:1,name:"play",size:"sm"})):e.kind==="image"?(x(),Se(Ge,{key:2,name:"image",size:"sm"})):(x(),Se(Ge,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),w("span",Wre,B(l.value),1),e.uploading?(x(),Se(Us,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(x(),E("span",zre,[ae(Ge,{name:"info",size:"sm"})])):ue("",!0)],8,Pre),e.removable?(x(),Se(an,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ie(()=>[w("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[ae(Ge,{name:"close",size:"sm"})],8,Ure)]),_:1},8,["text"])):ue("",!0)],10,Dre))}}),FE=dt(qre,[["__scopeId","data-v-12ec975b"]]),jre=["aria-label"],Vre=120,Kre=60,Gre=Je({__name:"MoonSpinner",props:{size:{default:"md"},fast:{type:Boolean},label:{default:"Waiting for response…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(o){return{"--moon-frame-delay":`${o*Vre}ms`,"--moon-frame-fast-delay":`${o*Kre}ms`}}return(o,s)=>(x(),E("span",{class:Ue(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(x(),E(We,null,rt(t,(i,r)=>w("span",{key:i,class:"ui-moon__frame",style:on(n(r)),"aria-hidden":"true"},B(i),5)),64))],10,jre))}}),OE=dt(Gre,[["__scopeId","data-v-a6b7ec07"]]),cr=oe(null),hu=oe(!1);function J2(e){const t=cr.value;!t||hu.value||(cr.value=null,t.resolve(e))}async function Yre(){const e=cr.value;if(!(!e||hu.value)){if(!e.action){J2(!0);return}hu.value=!0;try{await e.action(),cr.value===e&&(cr.value=null),e.resolve(!0)}catch(t){cr.value===e&&(cr.value=null),e.reject(t)}finally{hu.value=!1}}}function Zre(e){return hu.value?Promise.resolve(!1):(cr.value&&J2(!1),new Promise((t,n)=>{cr.value={...e,resolve:t,reject:n}}))}function Uf(){return{current:cr,busy:hu,confirm:Zre,settle:J2,runAction:Yre}}const Xre=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,Qre=/^(txt|md|markdown|log|json|ya?ml|csv|tsv|ts|mts|tsx|jsx|css|py|go|rs|java|c|h|cc|cpp|hpp|sh|zsh|sql|toml|ini|cfg|conf|vue)$/i,Jre=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,y3="text/plain;charset=utf-8";function ele(e,t){const n=(t??"").toLowerCase();if(Xre.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:y3;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:Qre.test(o)?y3:Jre.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function BE(e,t,n){const o=ele(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await ht().getFileBlob(e).catch(()=>null);if(i===null)return s?.close(),"failed";const r=URL.createObjectURL(new Blob([i],{type:o}));if(s!==null)s.location.href=r;else{const l=document.createElement("a");l.href=r,l.download=t??e,l.click()}return setTimeout(()=>{URL.revokeObjectURL(r)},6e4),"previewed"}const tle={class:"chat"},nle={key:0,class:"chat-loading"},ole={class:"chat-loading-text"},sle={key:1,class:"chat-empty"},ile={key:1,class:"top-sentinel-text"},rle={key:0,class:"u-turn"},lle=["data-turn-id"],ale={key:0,class:"u-atts"},cle={key:1,class:"skill-act"},ule={class:"skill-act-head"},dle={key:0,class:"skill-act-args"},fle={key:2,class:"skill-act"},hle={class:"skill-act-head"},ple={key:0,class:"skill-act-args"},mle={key:3,class:"u-text"},gle={key:0,class:"u-meta"},vle=["aria-label","onClick"],yle=["aria-label","onClick"],kle=["data-turn-id"],ble=["onClick"],xle={class:"cd-view"},wle={key:1,class:"cd-label"},_le=["data-turn-id"],Sle={key:1,class:"msg"},Cle={key:0,class:"a-msg-ft"},Ale={key:0,class:"a-duration"},Mle=["aria-label","onClick"],Ele={key:4,class:"sending-placeholder"},Tle={key:5,class:"q-stack"},Nle={class:"q-head"},Ile={class:"q-title"},Lle={class:"q-hint"},$le=["onDragover","onDrop"],Fle={class:"u-bub q-bub"},Ole=["title","onDragstart"],Ble=["title","onClick"],Rle={key:0,class:"u-text q-text"},Dle={key:1,class:"q-text q-text-placeholder"},Ple={key:0,class:"q-imgs"},Hle={key:0,class:"q-file"},Wle={key:1,class:"q-tag q-tag-next"},zle={key:2,class:"q-tag q-tag-idx"},Ule=["aria-label","onClick"],qle={key:0,class:"open-unsupported",role:"status"},jle=2500,Vle=Je({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},turnActive:{type:Boolean,default:!1},working:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1},toolDiffPanel:{type:Boolean,default:!1},queued:{default:()=>[]}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","openToolDiff","editMessage","loadOlderMessages","unqueue","editQueued","reorderQueue"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),{confirm:s}=Uf();$n(()=>{ie!==null&&(clearTimeout(ie),ie=null),R!==null&&(clearTimeout(R),R=null),$!==null&&(clearTimeout($),$=null),j!==null&&(clearTimeout(j),j=null)});const i=e,r=oe(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(he=>{he[0]?.isIntersecting&&i.hasMoreMessages&&!i.loadingMore&&!i.loadingMoreError&&!i.sessionLoading&&!i.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}Cn(a),$n(()=>{l?.disconnect(),l=null}),et(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{yt().then(a)});const c=D(()=>{if(!i.turnActive||i.turns.length===0)return null;const he=i.turns.at(-1);return he.role==="assistant"?he.id:null}),u=D(()=>i.working),d=n,f=oe(null),h=oe(null);function p(he){return(he.attachments?.length??0)>0}function m(he){d("editQueued",he)}function k(he,Ae){if(f.value=he,!Ae.dataTransfer)return;Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain",String(he));const re=Ae.currentTarget?.closest(".q-turn");re&&Ae.dataTransfer.setDragImage(re,24,24)}function y(he,Ae){if(f.value===null)return;Ae.preventDefault(),Ae.dataTransfer&&(Ae.dataTransfer.dropEffect="move");const re=Ae.currentTarget.getBoundingClientRect(),Y=Ae.clientY<re.top+re.height/2?"before":"after";h.value={index:he,position:Y}}function g(he,Ae){Ae.preventDefault();const re=f.value,Y=h.value?.position??"before";if(f.value=null,h.value=null,re===null)return;let Q=Y==="before"?he:he+1;re<Q&&(Q-=1),re!==Q&&d("reorderQueue",{from:re,to:Q})}function v(){f.value=null,h.value=null}const b=D(()=>{for(let he=i.turns.length-1;he>=0;he--)if(i.turns[he].role==="user")return i.turns[he].id;return null});function A(he){return he.role==="user"&&he.id===b.value&&!i.working&&!he.skillActivation&&!he.pluginCommand}function I(he){const Ae=he.compaction,re=Ae?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof Ae?.tokensBefore=="number"&&typeof Ae?.tokensAfter=="number"?re+o("conversation.compactedTokens",{before:pr(Ae.tokensBefore),after:pr(Ae.tokensAfter)}):re}const T=oe(null),M=oe(null);let $=null;async function N(he){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(he)}function F(he){M.value===null&&(M.value=he.id,d("editMessage",{text:he.text,attachments:he.attachments}),$=setTimeout(()=>{$=null,M.value=null},jle))}et(()=>i.turns,he=>{M.value!==null&&(he.some(Ae=>Ae.id===M.value)||(M.value=null,$!==null&&(clearTimeout($),$=null)))},{flush:"post"});const S=oe(!1);let R=null;function z(){if(i.turns.length===0)return;const he=[];for(const re of i.turns){if(re.role==="compaction"||re.role==="cron")continue;const Y=re.role==="user"?"User":"Assistant",Q=sq(re);Q.trim()&&he.push(`**${Y}**
298
+
299
+ ${Q}`)}const Ae=he.join(`
300
+
301
+ ---
302
+
303
+ `);Jo(Ae).then(re=>{re&&(S.value=!0,d("copyConversationCopied"),R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,S.value=!1},2e3))}).catch(()=>{})}function W(he){const Ae=[];for(let re=he;re>=0;re--){const Y=i.turns[re];if(!Y||Y.role!=="assistant")break;Ae.unshift(Y)}return Ae}function L(he){return W(he).map(Ae=>oq(Ae)).filter(Boolean).join(`
304
+
305
+ `)}function O(){for(let he=i.turns.length-1;he>=0;he-=1)if(i.turns[he]?.role==="assistant")return L(he);return""}function U(){const he=O();he.trim()&&Jo(he).then(Ae=>{Ae&&(S.value=!0,d("copyConversationCopied"),R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:z,copyFinalSummary:U});function Z(he){const Ae=i.turns[he];if(!Ae||Ae.role!=="assistant")return!1;const re=i.turns[he+1];return!re||re.role!=="assistant"}let ie=null;function q(he){const Ae=i.turns[he];if(!Ae)return;const re=L(he);re.trim()&&Jo(re).then(Y=>{Y&&(T.value=Ae.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function ee(he){const Ae=he.text;Ae.trim()&&Jo(Ae).then(re=>{re&&(T.value=he.id,ie!==null&&clearTimeout(ie),ie=setTimeout(()=>{ie=null,T.value=null},1400))}).catch(()=>{})}function fe(he){return{kind:he.kind==="video"?"video":"image",url:he.url,path:he.name,fileId:he.fileId}}const ne=oe(null);let j=null;function K(he){if(he.kind==="image"||he.kind==="video"){d("openMedia",fe(he));return}he.fileId!==void 0&&BE(he.fileId,he.name,he.mediaType).then(Ae=>{Ae==="unsupported"&&(ne.value=he.name??he.fileId??"",j!==null&&clearTimeout(j),j=setTimeout(()=>{j=null,ne.value=null},2400))})}function ve(he,Ae){return he.id!==c.value?!1:Ae.sourceIndex===N1(he).length-1}return(he,Ae)=>(x(),E(We,null,[w("div",tle,[e.sessionLoading?(x(),E("div",nle,[ae(Us,{size:"sm"}),w("span",ole,B(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(x(),E("div",sle)):ue("",!0),e.hasMoreMessages||e.loadingMore?(x(),E("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ue(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(x(),E("span",ile,[ae(Us,{size:"sm"}),ot(" "+B(C(o)("conversation.loadingOlder")),1)])):(x(),E("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ae[0]||(Ae[0]=re=>d("loadOlderMessages"))},B(C(o)("conversation.loadOlder")),1))],2)):ue("",!0),(x(!0),E(We,null,rt(e.turns,(re,Y)=>(x(),E(We,{key:re.id},[re.role==="user"?(x(),E("div",rle,[w("div",{class:Ue(["u-bub turn-anchor",{undoing:M.value===re.id}]),"data-turn-id":re.id},[re.attachments&&re.attachments.length>0?(x(),E("div",ale,[(x(!0),E(We,null,rt(re.attachments,(Q,P)=>(x(),Se(FE,{key:P,kind:Q.kind,name:Q.name,url:Q.url,"file-id":Q.fileId,"media-type":Q.mediaType,size:Q.size,onActivate:G=>K(Q)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ue("",!0),re.skillActivation?(x(),E("div",cle,[w("div",ule,[Ae[9]||(Ae[9]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,B(C(o)("conversation.activatedSkill",{name:re.skillActivation.name})),1)]),re.skillActivation.args?(x(),E("div",dle,B(re.skillActivation.args),1)):ue("",!0)])):re.pluginCommand?(x(),E("div",fle,[w("div",hle,[Ae[10]||(Ae[10]=w("span",{class:"skill-act-arrow"},"▶",-1)),w("span",null,"/"+B(re.pluginCommand.pluginId)+":"+B(re.pluginCommand.commandName),1)]),re.pluginCommand.args?(x(),E("div",ple,B(re.pluginCommand.args),1)):ue("",!0)])):(x(),E("div",mle,B(re.text),1))],10,lle),re.createdAt||A(re)?(x(),E("div",gle,[A(re)?(x(),E("div",{key:0,class:Ue(["u-edit-wrap",{undoing:M.value===re.id}])},[w("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:Q=>N(re)},[ae(Ge,{name:"undo",size:"sm"})],8,vle)],2)):ue("",!0),re.text.trim().length>0?(x(),E("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:St(Q=>ee(re),["stop"])},[T.value!==re.id?(x(),Se(Ge,{key:0,name:"copy",size:"sm"})):(x(),Se(Ge,{key:1,name:"check",size:"sm"}))],8,yle)):ue("",!0),re.createdAt?(x(),Se(wE,{key:2,time:re.createdAt},null,8,["time"])):ue("",!0)])):ue("",!0)])):re.role==="compaction"?(x(),E("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":re.id,role:"separator"},[Ae[11]||(Ae[11]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1)),re.text?(x(),E("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:Q=>d("openCompaction",{turnId:re.id})},[w("span",null,B(I(re)),1),w("span",xle,B(C(o)("conversation.viewSummary")),1)],8,ble)):(x(),E("span",wle,B(I(re)),1)),Ae[12]||(Ae[12]=w("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,kle)):re.role==="cron"?(x(),Se(_ie,{key:2,text:re.text,cron:re.cron,"turn-id":re.id,"created-at":re.createdAt},null,8,["text","cron","turn-id","created-at"])):(x(),E("div",{key:3,class:"a-msg turn-anchor","data-turn-id":re.id},[(x(!0),E(We,null,rt(C(nq)(re),(Q,P)=>(x(),E(We,{key:C(iq)(Q,P)},[Q.kind==="thinking"?(x(),Se(nie,{key:0,text:Q.thinking,mobile:"",streaming:ve(re,Q),onOpen:G=>d("openThinking",{turnId:re.id,blockIndex:Q.sourceIndex})},null,8,["text","streaming","onOpen"])):Q.kind==="text"&&Q.text?(x(),E("div",Sle,[ae(X1,{text:Q.text,streaming:ve(re,Q),"open-file":G=>d("openFile",G)},null,8,["text","streaming","open-file"])])):Q.kind==="tool-stack"?(x(),Se(fq,{key:2,tools:Q.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[1]||(Ae[1]=G=>d("openMedia",G)),onOpenFile:Ae[2]||(Ae[2]=G=>d("openFile",G)),onOpenToolDiff:Ae[3]||(Ae[3]=G=>d("openToolDiff",G)),onOpenAgent:Ae[4]||(Ae[4]=G=>d("openAgent",G))},null,8,["tools","tool-diff-panel"])):Q.kind==="tool"?(x(),Se(y6,{key:3,tool:Q.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[5]||(Ae[5]=G=>d("openMedia",G)),onOpenFile:Ae[6]||(Ae[6]=G=>d("openFile",G)),onOpenToolDiff:Ae[7]||(Ae[7]=G=>d("openToolDiff",G)),onOpenAgent:Ae[8]||(Ae[8]=G=>d("openAgent",G))},null,8,["tool","tool-diff-panel"])):ue("",!0)],64))),128)),re.id!==c.value&&Z(Y)&&(L(Y).trim().length>0||re.durationMs!==void 0)?(x(),E("div",Cle,[ae(an,{text:`${re.durationMs} ms`},{default:Ie(()=>[re.durationMs!==void 0?(x(),E("span",Ale,B(C(JU)(re.durationMs)),1)):ue("",!0)]),_:2},1032,["text"]),L(Y).trim().length>0?(x(),E("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:Q=>q(Y)},[T.value!==re.id?(x(),Se(Ge,{key:0,name:"copy",size:"sm"})):(x(),Se(Ge,{key:1,name:"check",size:"sm"}))],8,Mle)):ue("",!0)])):ue("",!0)],8,_le))],64))),128)),e.compaction?(x(),Se(lie,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ue("",!0),u.value?(x(),E("div",Ele,[ae(OE,{fast:e.fastMoon},null,8,["fast"])])):ue("",!0),e.queued.length>0?(x(),E("div",Tle,[w("div",Nle,[w("span",Ile,[ae(Ge,{name:"mail",size:"sm"}),ot(" "+B(C(o)("composer.queueLabel"))+" · ",1),w("b",null,B(e.queued.length),1)]),w("span",Lle,B(C(o)("composer.queueAutoDrain")),1)]),(x(!0),E(We,null,rt(e.queued,(re,Y)=>(x(),E("div",{key:Y,class:Ue(["u-turn q-turn",{"q-dragging":f.value===Y,"drop-before":h.value?.index===Y&&h.value.position==="before","drop-after":h.value?.index===Y&&h.value.position==="after"}]),onDragover:Q=>y(Y,Q),onDrop:Q=>g(Y,Q)},[w("div",Fle,[w("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:Q=>k(Y,Q),onDragend:v},[ae(Ge,{name:"grip",size:"sm"})],40,Ole),w("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:Q=>m(Y)},[re.text?(x(),E("span",Rle,B(re.text),1)):(x(),E("span",Dle,[ae(Ge,{name:"file",size:"sm"}),ot(" "+B(C(o)("composer.queuedAttachments",{n:re.attachments?.length??0})),1)]))],8,Ble),p(re)?(x(),E("div",Ple,[(x(!0),E(We,null,rt(re.attachments,(Q,P)=>(x(),E(We,{key:P},[Q.kind==="file"?(x(),E("span",Hle,[ae(Ge,{name:"file",size:"sm"}),ot(" "+B(Q.name??Q.fileId),1)])):(x(),Se($E,{key:1,url:Q.url,kind:Q.kind,"file-id":Q.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ue("",!0),Y===0?(x(),E("span",Wle,B(C(o)("composer.queueNext")),1)):(x(),E("span",zle,"#"+B(Y+1),1)),w("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:St(Q=>d("unqueue",Y),["stop"])},[ae(Ge,{name:"close",size:"sm"})],8,Ule)])],42,$le))),128))])):ue("",!0)]),ne.value!==null?(x(),E("div",qle,B(C(o)("composer.attachmentOpenUnsupported",{name:ne.value})),1)):ue("",!0)],64))}}),RE=dt(Vle,[["__scopeId","data-v-d2cc4eff"]]),Kle={class:"ch-id"},Gle={key:0,class:"ch-ws"},Yle={key:1,class:"ch-sep"},Zle=["onKeydown"],Xle={class:"ch-ses"},Qle={key:0,class:"ch-pill ch-sync-pill"},Jle={key:0,class:"ch-ahead"},eae={key:1,class:"ch-behind"},tae={key:1,class:"ch-pill ch-diff-pill"},nae={key:0,class:"ch-add"},oae={key:1,class:"ch-del"},sae=Je({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D(()=>o.ahead??0),r=D(()=>o.behind??0),l=D(()=>o.gitDiffStats?.totalAdditions??0),a=D(()=>o.gitDiffStats?.totalDeletions??0),c=D(()=>l.value>0||a.value>0),u={open:"header.prStatusOpen",closed:"header.prStatusClosed",merged:"header.prStatusMerged",draft:"header.prStatusDraft"};function d(Z){return Z.trim().toLowerCase().replaceAll("_","-")}function f(Z){const ie=d(Z);return u[ie]?`pr-${ie}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=oe(!1),m=oe(null),k=oe(null),y=oe({});function g(Z){const ie=Z.target;k.value?.el?.contains(ie)||m.value?.el?.contains(ie)||A()}function v(){A()}async function b(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",g),window.addEventListener("resize",v),await yt();const ie=m.value?.el,q=k.value?.el;if(!ie||!q)return;const ee=ie.getBoundingClientRect(),fe=4,ne=8,j=q.offsetWidth,K=q.offsetHeight;let ve=ee.bottom+fe;ve+K>window.innerHeight-ne&&(ve=Math.max(ne,ee.top-K-fe));let he=ee.left;he+j>window.innerWidth-ne&&(he=Math.max(ne,ee.right-j)),y.value={top:`${Math.round(ve)}px`,left:`${Math.round(he)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)}$n(()=>{document.removeEventListener("mousedown",g),window.removeEventListener("resize",v)});function I(){s("copyAll"),A()}function T(){s("copyFinalSummary"),A()}const M=oe(!1);function $(){o.sessionId&&Jo(o.sessionId).then(Z=>{Z&&(M.value=!0,setTimeout(()=>{M.value=!1},1200))})}const N=oe(!1),F=oe(""),S=oe(null);async function R(){if(A(),!!o.sessionId){N.value=!0,F.value=o.sessionTitle??"",await yt();try{S.value?.focus(),S.value?.select()}catch{}}}function z(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),N.value=!1}function W(){N.value=!1}function L(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function O(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function U(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,ie)=>(x(),E("header",{class:Ue(["chat-header",{"macos-desktop":C(su)}])},[w("div",Kle,[e.workspaceName?(x(),E("span",Gle,B(e.workspaceName),1)):ue("",!0),e.workspaceName&&e.sessionTitle?(x(),E("span",Yle,"/")):ue("",!0),N.value?qn((x(),E("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":ie[0]||(ie[0]=q=>F.value=q),class:"ch-rename",type:"text",onKeydown:[ur(St(z,["stop"]),["enter"]),ur(St(W,["stop"]),["esc"])],onBlur:z,onClick:ie[1]||(ie[1]=St(()=>{},["stop"]))},null,40,Zle)),[[Cs,F.value]]):e.sessionTitle?(x(),Se(an,{key:3,text:e.sessionTitle},{default:Ie(()=>[w("span",Xle,B(e.sessionTitle),1)]),_:1},8,["text"])):ue("",!0)]),ae(Xn,{ref_key:"kebabRef",ref:m,class:Ue(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:ie[2]||(ie[2]=St(q=>b(q),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(x(),Se(Ml,{key:0,ref_key:"menuRef",ref:k,class:"ch-menu",style:on(y.value),onClick:ie[3]||(ie[3]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{onClick:I},{default:Ie(()=>[ae(Ge,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+B(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),ae(En,{onClick:T},{default:Ie(()=>[ae(Ge,{name:"file-text",size:"sm"}),ot(" "+B(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(x(),E(We,{key:0},[ae(En,{separator:""}),ae(En,{onClick:$},{default:Ie(()=>[ae(Ge,{name:M.value?"check":"copy",size:"sm"},null,8,["name"]),ot(" "+B(M.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),ae(En,{onClick:R},{default:Ie(()=>[ae(Ge,{name:"pencil",size:"sm"}),ot(" "+B(C(n)("header.renameSession")),1)]),_:1}),ae(En,{onClick:L},{default:Ie(()=>[ae(Ge,{name:"git-fork",size:"sm"}),ot(" "+B(C(n)("header.forkSession")),1)]),_:1}),ae(En,{onClick:O},{default:Ie(()=>[ae(Ge,{name:"download",size:"sm"}),ot(" "+B(C(n)("header.exportSession")),1)]),_:1}),ae(En,{danger:"",onClick:U},{default:Ie(()=>[ae(Ge,{name:"archive",size:"sm"}),ot(" "+B(C(n)("header.archiveSession")),1)]),_:1})],64)):ue("",!0)]),_:1},8,["style"])):ue("",!0),ie[6]||(ie[6]=w("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(x(),E("button",{key:1,type:"button",class:"ch-git",onClick:ie[4]||(ie[4]=q=>s("openChanges"))},[w("span",{class:Ue(["ch-branch",{"ch-detached":!e.branch}])},B(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(x(),E("span",Qle,[i.value>0?(x(),E("span",Jle,"↑"+B(i.value),1)):ue("",!0),r.value>0?(x(),E("span",eae,"↓"+B(r.value),1)):ue("",!0)])):ue("",!0),c.value?(x(),E("span",tae,[l.value>0?(x(),E("span",nae,"+"+B(l.value),1)):ue("",!0),a.value>0?(x(),E("span",oae,"-"+B(a.value),1)):ue("",!0)])):ue("",!0)])):ue("",!0),e.pr?(x(),E("button",{key:2,type:"button",class:Ue(["ch-pill ch-pr",f(e.pr.state)]),onClick:ie[5]||(ie[5]=q=>e.pr&&s("openPr",e.pr.url))},[ae(Ge,{name:"git-pull-request",size:"sm"}),w("span",null,"PR #"+B(e.pr.number)+" · "+B(h(e.pr.state)),1)],2)):ue("",!0)],2))}}),iae=dt(sae,[["__scopeId","data-v-fa4451d4"]]),rae=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],k3=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function lae(e){if(e<=255)return rae[e];let t=0,n=k3.length-1;for(;t<=n;){const o=t+n>>1,s=k3[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function aae(e){const t=e.length;if(t===0)return null;const n=new Array(t);let o=!1;for(let c=0;c<t;){const u=e.charCodeAt(c);let d=u,f=1;if(u>=55296&&u<=56319&&c+1<t){const p=e.charCodeAt(c+1);p>=56320&&p<=57343&&(d=(u-55296<<10)+(p-56320)+65536,f=2)}const h=lae(d);(h==="R"||h==="AL"||h==="AN")&&(o=!0);for(let p=0;p<f;p++)n[c+p]=h;c+=f}if(!o)return null;let s=0;for(let c=0;c<t;c++){const u=n[c];if(u==="L"){s=0;break}if(u==="R"||u==="AL"){s=1;break}}const i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=s;const r=s&1?"R":"L",l=r;let a=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=a:a=n[c];a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(a=u)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let u;for(u=c-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=c+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let c=0;c<t;c++){const u=n[c];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[c]="ON")}a=l;for(let c=0;c<t;c++){const u=n[c];u==="EN"?n[c]=a==="L"?"L":"EN":(u==="R"||u==="L")&&(a=u)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let u=c+1;for(;u<t&&n[u]==="ON";)u++;const d=c>0?n[c-1]:l,f=u<t?n[u]:l,h=d!=="L"?"R":"L";if(h===(f!=="L"?"R":"L"))for(let m=c;m<u;m++)n[m]=h;c=u-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=r);for(let c=0;c<t;c++){const u=n[c];(i[c]&1)===0?u==="R"?i[c]++:(u==="AN"||u==="EN")&&(i[c]+=2):(u==="L"||u==="AN"||u==="EN")&&i[c]++}return i}function cae(e,t){const n=aae(e);if(n===null)return null;const o=new Int8Array(t.length);for(let s=0;s<t.length;s++)o[s]=n[t[s]];return o}const uae=/[ \t\n\r\f]+/g,dae=/[\t\n\r\f]| {2,}|^ | $/;function fae(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function hae(e){if(!dae.test(e))return e;let t=e.replace(uae," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function pae(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
306
+ `).replace(/[\r\f]/g,`
307
+ `):e}let Ev=null,mae;function gae(){return Ev===null&&(Ev=new Intl.Segmenter(mae,{granularity:"word"})),Ev}const vae=/\p{Script=Arabic}/u,Xl=/\p{M}/u,eb=/\p{Nd}/u;function b3(e){return vae.test(e)}function x3(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function mr(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const o=e.charCodeAt(t+1);if(o>=56320&&o<=57343){const s=(n-55296<<10)+(o-56320)+65536;if(x3(s))return!0;t++;continue}}if(x3(n))return!0}}return!1}function yae(e){const t=qf(e);return t!==null&&(tb.has(t)||Ga.has(t))}const kae=new Set([" "," ","⁠","\uFEFF"]),bae=new Set(["-","‐","–","—"]);function xae(e){const t=qf(e);return t!==null&&kae.has(t)}function wae(e){const t=qf(e);return t!==null&&bae.has(t)}function DE(e,t){return xae(e)?!1:t?!(yae(e)||wae(e)):!0}const tb=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Q1=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),nb=new Set(["'","’"]),Ga=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),_ae=new Set([":",".","،","؛"]),Sae=new Set(["၏"]),Cae=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Aae(e){if(ob(e))return!0;let t=!1;for(const n of e){if(Ga.has(n)||e0(n)){t=!0;continue}if(!(t&&Xl.test(n)))return!1}return t}function Mae(e){for(const t of e)if(!tb.has(t)&&!Ga.has(t))return!1;return e.length>0}function Eae(e){if(ob(e))return!0;for(const t of e)if(!Q1.has(t)&&!nb.has(t)&&!Xl.test(t)&&!e0(t))return!1;return e.length>0}function ob(e){let t=!1;for(const n of e)if(!(n==="\\"||Xl.test(n))){if(Q1.has(n)||Ga.has(n)||nb.has(n)){t=!0;continue}return!1}return t}function J1(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const o=e.charCodeAt(n);if(o<56320||o>57343)return n;const s=n-1;if(s<0)return n;const i=e.charCodeAt(s);return i>=55296&&i<=56319?s:n}function qf(e){if(e.length===0)return null;const t=J1(e,e.length);return e.slice(t)}function Tae(e){for(const t of e)if(!Xl.test(t))return t;return null}function Nae(e){for(let t=e.length;t>0;){const n=J1(e,t),o=e.slice(n,t);if(!Xl.test(o))return o;t=n}return null}const Iae=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function Lae(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function e0(e){const t=e.codePointAt(0);return t!==void 0&&Lae(t,Iae)}function $ae(e){const t=Nae(e);return t!==null&&e0(t)}function Fae(e){const t=Tae(e);return t!==null&&eb.test(t)}function Oae(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Xl.test(o)){n--;continue}if(Q1.has(o)||nb.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Bae(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function w3(e,t,n,o){const s=t[o],i=e[o];if(s==null)return i;const r=n[o];if(i.length===r)return i;const l=s.repeat(r);return e[o]=l,l}function _3(e,t){return e&&t!==null&&_ae.has(t)}function Rae(e){const t=qf(e);return t!==null&&Sae.has(t)}function Dae(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function rk(e){let t=e.length;for(;t>0;){const n=J1(e,t),o=e.slice(n,t);if(Cae.has(o))return!0;if(!Ga.has(o))return!1;t=n}return!1}function Pae(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
308
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Hae=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ji(e){return e.length===1?e[0]:e.join("")}function Wae(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),ji(n)}function zae(e,t,n,o){if(!Hae.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const s=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=Pae(u,o),f=d==="text"&&t;if(i!==null&&d===i&&f===a){r.push(u),c+=u.length;continue}i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=f,c+=u.length}return i!==null&&s.push({text:ji(r),isWordLike:a,kind:i,start:l}),s}function lk(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Uae=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function qae(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:Uae.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function jae(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Vae(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let r=0;r<e.len;r++){if(o[r]!=="text"||!qae(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!lk(o[a]);){l.push(t[a]),n[r]=!0;const c=t[a].includes("?");if(o[a]="text",t[a]="",a++,c)break}t[r]=ji(l)}let i=0;for(let r=0;r<t.length;r++){const l=t[r];l.length!==0&&(i!==r&&(t[i]=l,n[i]=n[r],o[i]=o[r],s[i]=s[r]),i++)}return t.length=i,n.length=i,o.length=i,s.length=i,{len:i,texts:t,isWordLike:n,kinds:o,starts:s}}function Kae(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i]),!jae(r))continue;const l=i+1;if(l>=e.len||lk(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!lk(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(ji(a)),n.push(!0),o.push("text"),s.push(c),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}const Gae=new Set([":","-","/","×",",",".","+","–","—"]),Yae=/[\p{P}\p{S}\p{Co}]/u,Zae=/\p{Emoji_Presentation}/u,Xae=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function Qae(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function PE(e){const t=e.charCodeAt(0);return t<128?Qae(t):!Xae.has(e)&&!Zae.test(e)&&Yae.test(e)}function S3(e){let t=!1;for(const n of e)if(!Xl.test(n)){if(!PE(n))return!1;t=!0}return t}function Jae(e){for(let t=e.length;t>0;){const n=J1(e,t),o=e.slice(n,t);if(Xl.test(o)){t=n;continue}return PE(o)||e0(o)}return!1}function ece(e,t,n,o){const s=!t&&S3(e),i=!o&&S3(n),r=$ae(e),l=(t||r)&&Jae(e);return!s&&!i&&!l||mr(e)||mr(n)?!1:(t||s||r)&&(o||i)}function HE(e){for(const t of e)if(eb.test(t))return!0;return!1}function jm(e){if(e.length===0)return!1;for(const t of e)if(!(eb.test(t)||Gae.has(t)))return!1;return!0}function tce(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i],l=e.kinds[i];if(l==="text"&&jm(r)&&HE(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&jm(e.texts[c]);)a.push(e.texts[c]),c++;t.push(ji(a)),n.push(!0),o.push("text"),s.push(e.starts[i]),i=c-1;continue}t.push(r),n.push(e.isWordLike[i]),o.push(l),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function nce(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=e.texts[i],l=e.kinds[i],a=e.isWordLike[i];if(l==="text"){const c=[r];let u=i+1,d=a;for(;u<e.len&&e.kinds[u]==="text"&&ece(e.texts[u-1],e.isWordLike[u-1],e.texts[u],e.isWordLike[u]);){const f=e.texts[u];c.push(f),d=d||e.isWordLike[u],u++}if(u>i+1){t.push(ji(c)),n.push(d),o.push("text"),s.push(e.starts[i]),i=u;continue}}t.push(r),n.push(a),o.push(l),s.push(e.starts[i]),i++}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function oce(e){const t=[],n=[],o=[],s=[];for(let i=0;i<e.len;i++){const r=e.texts[i];if(e.kinds[i]==="text"&&r.includes("-")){const l=r.split("-");let a=l.length>1;for(let c=0;c<l.length;c++){const u=l[c];if(!a)break;(u.length===0||!HE(u)||!jm(u))&&(a=!1)}if(a){let c=0;for(let u=0;u<l.length;u++){const d=l[u],f=u<l.length-1?`${d}-`:d;t.push(f),n.push(!0),o.push("text"),s.push(e.starts[i]+c),c+=f.length}continue}}t.push(r),n.push(e.isWordLike[i]),o.push(e.kinds[i]),s.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function sce(e){const t=[],n=[],o=[],s=[];let i=0;for(;i<e.len;){const r=[e.texts[i]];let l=e.isWordLike[i],a=e.kinds[i],c=e.starts[i];if(a==="glue"){const u=[r[0]],d=c;for(i++;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const f=ji(u);if(i<e.len&&e.kinds[i]==="text")r[0]=f,r.push(e.texts[i]),l=e.isWordLike[i],a="text",c=d,i++;else{t.push(f),n.push(!1),o.push("glue"),s.push(d);continue}}else i++;if(a==="text")for(;i<e.len&&e.kinds[i]==="glue";){const u=[];for(;i<e.len&&e.kinds[i]==="glue";)u.push(e.texts[i]),i++;const d=ji(u);if(i<e.len&&e.kinds[i]==="text"){r.push(d,e.texts[i]),l=l||e.isWordLike[i],i++;continue}r.push(d)}t.push(ji(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function ice(e){const t=e.texts.slice(),n=e.isWordLike.slice(),o=e.kinds.slice(),s=e.starts.slice();for(let i=0;i<t.length-1;i++){if(o[i]!=="text"||o[i+1]!=="text"||!mr(t[i])||!mr(t[i+1]))continue;const r=Oae(t[i]);r!==null&&(t[i]=r.head,t[i+1]=r.tail+t[i+1],s[i+1]=s[i]+r.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function rce(e,t,n){const o=gae();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],m=[],k=[];for(const I of o.segment(e))for(const T of zae(I.segment,I.isWordLike??!1,I.index,n)){let L=function(){u[W]!==null&&(r[W]=[w3(i,u,d,W)],u[W]=null),r[W].push(T.text),l[W]=l[W]||T.isWordLike,f[W]=f[W]||N,h[W]=h[W]||F,p[W]=R,m[W]=z,k[W]=_3(h[W],S)};const M=T.kind==="text",$=Bae(T.text,T.isWordLike,T.kind),N=mr(T.text),F=b3(T.text),S=qf(T.text),R=rk(T.text),z=Rae(T.text),W=s-1;t.carryCJKAfterClosingQuote&&M&&s>0&&a[W]==="text"&&N&&f[W]&&p[W]||M&&s>0&&a[W]==="text"&&Mae(T.text)&&f[W]||M&&s>0&&a[W]==="text"&&m[W]?L():M&&s>0&&a[W]==="text"&&T.isWordLike&&F&&k[W]?(L(),l[W]=!0):$!==null&&s>0&&a[W]==="text"&&u[W]===$?d[W]=(d[W]??1)+1:M&&!T.isWordLike&&s>0&&a[W]==="text"&&!f[W]&&(Aae(T.text)||T.text==="-"&&l[W])?L():(i[s]=T.text,r[s]=[T.text],l[s]=T.isWordLike,a[s]=T.kind,c[s]=T.start,u[s]=$,d[s]=$===null?0:1,f[s]=N,h[s]=F,p[s]=R,m[s]=z,k[s]=_3(F,S),s++)}for(let I=0;I<s;I++){if(u[I]!==null){i[I]=w3(i,u,d,I);continue}i[I]=ji(r[I])}for(let I=1;I<s;I++)a[I]==="text"&&!l[I]&&ob(i[I])&&a[I-1]==="text"&&!f[I-1]&&(i[I-1]+=i[I],l[I-1]=l[I-1]||l[I],i[I]="");const y=Array.from({length:s},()=>null);let g=-1;for(let I=s-1;I>=0;I--){const T=i[I];if(T.length!==0){if(a[I]==="text"&&!l[I]&&g>=0&&a[g]==="text"&&(Eae(T)||T==="-"&&Fae(i[g]))){const M=y[g]??[];M.push(T),y[g]=M,c[g]=c[I],i[I]="";continue}g=I}}for(let I=0;I<s;I++){const T=y[I];T!=null&&(i[I]=Wae(T,i[I]))}let v=0;for(let I=0;I<s;I++){const T=i[I];T.length!==0&&(v!==I&&(i[v]=T,l[v]=l[I],a[v]=a[I],c[v]=c[I]),v++)}i.length=v,l.length=v,a.length=v,c.length=v;const b=sce({len:v,texts:i,isWordLike:l,kinds:a,starts:c}),A=ice(nce(oce(tce(Kae(Vae(b))))));for(let I=0;I<A.len-1;I++){const T=Dae(A.texts[I]);T!==null&&(A.kinds[I]!=="space"&&A.kinds[I]!=="preserved-space"||A.kinds[I+1]!=="text"||!b3(A.texts[I+1])||(A.texts[I]=T.space,A.isWordLike[I]=!1,A.kinds[I]=A.kinds[I]==="preserved-space"?"preserved-space":"space",A.texts[I+1]=T.marks+A.texts[I+1],A.starts[I+1]=A.starts[I]+T.space.length))}return A}function lce(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let o=0;for(let s=0;s<e.len;s++)e.kinds[s]==="hard-break"&&(n.push({startSegmentIndex:o,endSegmentIndex:s,consumedEndSegmentIndex:s+1}),o=s+1);return o<e.len&&n.push({startSegmentIndex:o,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function ace(e,t,n){if(t.len<=1)return t;const o=[],s=[],i=[],r=[];let l=-1,a=!1;function c(f){o.push(t.texts[f]),s.push(t.isWordLike[f]),i.push("text"),r.push(t.starts[f])}function u(f,h){let p=!1;for(let y=f;y<h;y++)p=p||t.isWordLike[y];const m=t.starts[f],k=h<t.len?t.starts[h]:e.length;o.push(e.slice(m,k)),s.push(p),i.push("text"),r.push(m)}function d(f){if(!(l<0)){if(a)l+1===f?c(l):u(l,f);else for(let h=l;h<f;h++)c(h);l=-1,a=!1}}for(let f=0;f<t.len;f++){const h=t.texts[f],p=t.kinds[f];if(p==="text"){l>=0&&!DE(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||mr(h);continue}d(f),o.push(h),s.push(t.isWordLike[f]),i.push(p),r.push(t.starts[f])}return d(t.len),{len:o.length,texts:o,isWordLike:s,kinds:i,starts:r}}function cce(e,t,n="normal",o="normal"){const s=fae(n),i=s.mode==="pre-wrap"?pae(e):hae(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=rce(i,t,s),l=o==="keep-all"?ace(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:lce(l,s),...l}}let Ic=null;const C3=new Map;let Lc=null;const uce=96,dce=/\p{Emoji_Presentation}/u,fce=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Tv=null;const A3=new Map;function sb(){if(Ic!==null)return Ic;if(typeof OffscreenCanvas<"u")return Ic=new OffscreenCanvas(1,1).getContext("2d"),Ic;if(typeof document<"u")return Ic=document.createElement("canvas").getContext("2d"),Ic;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function hce(e){let t=C3.get(e);return t||(t=new Map,C3.set(e,t)),t}function Nl(e,t){let n=t.get(e);return n===void 0&&(n={width:sb().measureText(e).width,containsCJK:mr(e)},t.set(e,n)),n}function t0(){if(Lc!==null)return Lc;if(typeof navigator>"u")return Lc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Lc;const e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),o=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Lc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Lc}function pce(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function WE(){return Tv===null&&(Tv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Tv}function mce(e){return dce.test(e)||e.includes("️")}function gce(e){return fce.test(e)}function vce(e,t){let n=A3.get(e);if(n!==void 0)return n;const o=sb();o.font=e;const s=o.measureText("😀").width;if(n=0,s>t+.5&&typeof document<"u"&&document.body!==null){const i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="😀",document.body.appendChild(i);const r=i.getBoundingClientRect().width;document.body.removeChild(i),s-r>.5&&(n=s-r)}return A3.set(e,n),n}function yce(e){let t=0;const n=WE();for(const o of n.segment(e))mce(o.segment)&&t++;return t}function kce(e,t){return t.emojiCount===void 0&&(t.emojiCount=yce(e)),t.emojiCount}function La(e,t,n){return n===0?t.width:t.width-kce(e,t)*n}function bce(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=WE(),r=[];for(const u of i.segment(e))r.push(u.segment);if(r.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(s==="sum-graphemes"){const u=[];for(const d of r){const f=Nl(d,n);u.push(La(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>uce){const u=[];let d=null,f=0;for(const h of r){const p=Nl(h,n),m=La(h,p,o);if(d===null)u.push(m);else{const k=d+h,y=Nl(k,n);u.push(La(k,y,o)-f)}d=h,f=m}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=Nl(a,n),f=La(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function xce(e,t){const n=sb();n.font=e;const o=hce(e),s=pce(e),i=t?vce(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function wce(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function zE(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function UE(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!wce(o))break;t++}return t}function _ce(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Sce(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function ib(e,t){return t===0?0:e+t}function Cce(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Ace(e,t,n,o,s){const i=t==="tab"?s+Cce(e,n):e.lineEndFitAdvances[n];return ib(o,i)}function M3(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return ib(o,s)}function E3(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return ib(o,i)}function Mce(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ece(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Vm(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Tce(e,t,n,o,s){if(e.letterSpacing===0)return 0;if(s>0)return e.spacingGraphemeCounts[o]>0?e.letterSpacing:0;for(let i=o-1;i>=t;i--){const r=e.kinds[i];if(!(r==="space"||r==="zero-width-break"||r==="hard-break")){if(r==="soft-hyphen"){if(i===o-1)return 0;continue}return i===t&&n>0||e.spacingGraphemeCounts[i]>0?e.letterSpacing:0}}return 0}function Nce(e,t,n,o,s,i){return t+Tce(e,n,o,s,i)}function Ice(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=t0().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,m=0,k=0,y=-1,g=0;function v(){y=-1,g=0}function b(N=m,F=k,S=d){u++,n?.(S,h,p,N,F),d=0,f=!1,v()}function A(N,F){f=!0,h=N,p=0,m=N+1,k=0,d=F}function I(N,F,S){f=!0,h=N,p=F,m=N,k=F+1,d=S}function T(N,F){if(!f){A(N,F);return}d+=F,m=N+1,k=0}function M(N,F){const S=i[N],R=r[N]??null;let z=R===null?-1:Vm(R,0,F+1),W=-1,L=0,O=F;for(;O<S.length;){const U=S[O];if(!f)I(N,O,U);else if(d+U>c){if(R!==null&&W>F){b(N,W,L),O=W,z=Vm(R,z,O+1),W=-1,L=0;continue}b(),I(N,O,U)}else d+=U,m=N,k=O+1;const Z=O+1;R!==null&&R[z]===Z&&(W=Z,L=d,z++),O++}f&&m===N&&k===S.length&&(m=N+1,k=0)}let $=0;for(;$<o.length&&!(!f&&($=UE(e,$),$>=o.length));){const N=o[$],F=s[$],S=zE(F);if(!f){N>c&&i[$]!==null?M($,0):A($,N),S&&(y=$+1,g=d-N),$++;continue}if(d+N>c){if(S){T($,N),b($+1,0,d-N),$++;continue}if(y>=0){if(m>y||m===y&&k>0){b();continue}b(y,0,g);continue}if(N>c&&i[$]!==null){b(),M($,0),$++;continue}b();continue}T($,N),S&&(y=$+1,g=d-N),$++}return f&&b(),u}function Lce(e,t,n){if(e.simpleLineWalkFastPath)return Ice(e,t,n);const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r,discretionaryHyphenWidth:l,chunks:a}=e;if(o.length===0||a.length===0)return 0;const c=t0(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,m=0,k=0,y=0,g=0,v=-1,b=0,A=0,I=null;function T(){v=-1,b=0,A=0,I=null}function M(){return I==="soft-hyphen"&&v===y&&g===0?A:h}function $(L=y,O=g,U){f++,n!==void 0&&n(Nce(e,U??M(),m,k,L,O),m,k,L,O),h=0,p=!1,T()}function N(L,O){p=!0,m=L,k=0,y=L+1,g=0,h=O}function F(L,O,U){p=!0,m=L,k=O,y=L,g=O+1,h=U}function S(L,O){if(!p){N(L,O);return}h+=O,y=L+1,g=0}function R(L,O,U,Z,ie,q){if(!O)return;const ee=M3(e,L,U,ie),fe=E3(e,L,U,ie,Z);v=U+1,b=h-q+ee,A=h-q+fe,I=L}function z(L,O){const U=i[L],Z=r[L]??null;let ie=Z===null?-1:Vm(Z,0,O+1),q=-1,ee=0,fe=O;for(;fe<U.length;){const ne=U[fe];if(!p)F(L,fe,ne);else{const K=Mce(e,!0,ne),ve=h+K;if(Ece(e,ve)>d){if(Z!==null&&q>O){$(L,q,ee),fe=q,ie=Vm(Z,ie,fe+1),q=-1,ee=0;continue}$(),F(L,fe,ne)}else h=ve,y=L,g=fe+1}const j=fe+1;Z!==null&&Z[ie]===j&&(q=j,ee=h,ie++),fe++}p&&y===L&&g===U.length&&(y=L+1,g=0)}function W(L){f++,n?.(0,L.startSegmentIndex,0,L.consumedEndSegmentIndex,0),T()}for(let L=0;L<a.length;L++){const O=a[L];if(O.startSegmentIndex===O.endSegmentIndex){W(O);continue}p=!1,h=0,m=O.startSegmentIndex,k=0,y=O.startSegmentIndex,g=0,T();let U=O.startSegmentIndex;for(;U<O.endSegmentIndex&&!(!p&&(U=UE(e,U,O.endSegmentIndex),U>=O.endSegmentIndex));){const Z=s[U],ie=zE(Z),q=Sce(e,p,U),ee=Z==="tab"?_ce(h+q,e.tabStopAdvance):o[U],fe=q+ee,ne=Ace(e,Z,U,q,ee);if(Z==="soft-hyphen"){p&&(y=U+1,g=0,v=U+1,b=h+l,A=h+l,I=Z),U++;continue}if(!p){ne>d&&i[U]!==null?z(U,0):N(U,ee),R(Z,ie,U,ee,q,fe),U++;continue}if(h+ne>d){const K=h+M3(e,Z,U,q),ve=h+E3(e,Z,U,q,ee);if(I==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&b<=d){$(v,0,A);continue}if(ie&&K<=d){S(U,fe),$(U+1,0,ve),U++;continue}if(v>=0&&b<=d){if(y>v||y===v&&g>0){$();continue}const he=v;$(he,0,A),U=he;continue}if(ne>d&&i[U]!==null){$(),z(U,0),U++;continue}$();continue}S(U,fe),R(Z,ie,U,ee,q,fe),U++}if(p){const Z=v===O.consumedEndSegmentIndex?A:h;$(O.consumedEndSegmentIndex,0,Z)}}return f}let Nv=null;function rb(){return Nv===null&&(Nv=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Nv}function $ce(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function Fce(e,t){const n=[];let o=[],s=0,i=!1,r=!1,l=!1;function a(){o.length!==0&&(n.push({text:o.length===1?o[0]:o.join(""),start:s}),o=[],i=!1,r=!1,l=!1)}function c(d,f,h){o=[d],s=f,i=h,r=rk(d),l=Q1.has(d)}function u(d,f){o.push(d),i=i||f;const h=rk(d);d.length===1&&Ga.has(d)?r=r||h:r=h,l=!1}for(const d of rb().segment(e)){const f=d.segment,h=mr(f);if(o.length===0){c(f,d.index,h);continue}if(l||tb.has(f)||Ga.has(f)||t.carryCJKAfterClosingQuote&&h&&r){u(f,h);continue}if(!i&&!h){u(f,h);continue}a(),c(f,d.index,h)}return a(),n}function Oce(e,t,n){if(t.length<=1)return t;const o=[];let s=-1,i=!1;function r(a,c){const u=t[a].start,d=c<t.length?t[c].start:e.length;o.push({text:e.slice(u,d),start:u})}function l(a){if(!(s<0)){if(i)s+1===a?o.push(t[s]):r(s,a);else for(let c=s;c<a;c++)o.push(t[c]);s=-1,i=!1}}for(let a=0;a<t.length;a++){const c=t[a];s>=0&&!DE(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||mr(c.text)}return l(t.length),o}function T3(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const o=rb();for(const s of o.segment(e))n++;return n}function Bce(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Rce(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of rb().segment(e))n++,Bce(o.segment)&&t.push(n);return t.length===0?null:t}function Dce(e,t,n){return t>1?e+(t-1)*n:e}function Pce(e,t,n,o,s){const i=t0(),{cache:r,emojiCorrection:l}=xce(t,gce(e.normalized)),a=La("-",Nl("-",r),l)+(s===0?0:s*2),u=La(" ",Nl(" ",r),l)*8,d=s!==0;if(e.len===0)return $ce();const f=[],h=[],p=[],m=[];let k=e.chunks.length<=1&&!d;const y=n?[]:null,g=[],v=[],b=[],A=n?[]:null,I=Array.from({length:e.len});function T(F,S,R,z,W,L,O,U,Z){W!=="text"&&W!=="space"&&W!=="zero-width-break"&&(k=!1),f.push(S),h.push(R),p.push(z),m.push(W),y?.push(L),g.push(O),v.push(U),d&&b.push(Z),A!==null&&A.push(F)}function M(F,S,R,z,W){const L=Nl(F,r),O=d?T3(F,S):0,U=Dce(La(F,L,l),O,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,ie=Z===0?0:Z+(O>0?s:0),q=S==="space"||S==="zero-width-break"?0:U;if(W&&z&&F.length>1){let ee="sum-graphemes";s!==0?ee="segment-prefixes":jm(F)?ee="pair-context":i.preferPrefixWidthsForBreakableRuns&&(ee="segment-prefixes");const fe=bce(F,L,r,l,ee),ne=fe===null||o==="keep-all"?null:Rce(F);T(F,U,ie,q,S,R,fe,ne,O);return}T(F,U,ie,q,S,R,null,null,O)}for(let F=0;F<e.len;F++){I[F]=f.length;const S=e.texts[F],R=e.isWordLike[F],z=e.kinds[F],W=e.starts[F];if(z==="soft-hyphen"){T(S,0,a,a,z,W,null,null,0);continue}if(z==="hard-break"){T(S,0,0,0,z,W,null,null,0);continue}if(z==="tab"){T(S,0,0,0,z,W,null,null,d?T3(S,z):0);continue}const L=Nl(S,r);if(z==="text"&&L.containsCJK){const O=Fce(S,i),U=o==="keep-all"?Oce(S,O,i.breakKeepAllAfterPunctuation):O;for(let Z=0;Z<U.length;Z++){const ie=U[Z];M(ie.text,"text",W+ie.start,R,o==="keep-all"||!mr(ie.text))}continue}M(S,z,W,R,!0)}const $=Hce(e.chunks,I,f.length),N=y===null?null:cae(e.normalized,y);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:k,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:k,segLevels:N,breakableFitAdvances:g,breakablePreferredBreaks:v,letterSpacing:s,spacingGraphemeCounts:b,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:$}}function Hce(e,t,n){const o=[];for(let s=0;s<e.length;s++){const i=e[s],r=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,a=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;o.push({startSegmentIndex:r,endSegmentIndex:l,consumedEndSegmentIndex:a})}return o}function Wce(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=cce(e,t0(),o?.whiteSpace,s);return Pce(r,t,n,s,i)}function zce(e,t,n){return Wce(e,t,!0,n)}function Uce(e){let t=0;return Lce(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const qce={key:0,class:"slash-menu",role:"listbox"},jce=["aria-selected","onMouseenter","onMousedown"],Vce={class:"slash-name"},Kce={class:"slash-desc"},Gce=Je({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe([]);return et(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(x(),E("div",qce,[(x(!0),E(We,null,rt(e.items,(a,c)=>(x(),E("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Ue(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:St(u=>s("select",a),["prevent"])},[w("span",Vce,B(a.name),1),w("span",Kce,B(a.isSkill?a.desc:C(n)(a.desc)),1)],42,jce))),128))])):ue("",!0)}}),Yce=dt(Gce,[["__scopeId","data-v-f60b70d9"]]),Zce={class:"mention-menu",role:"listbox"},Xce={key:0,class:"mention-state dim"},Qce={key:1,class:"mention-state dim"},Jce=["aria-selected","onMouseenter","onMousedown"],eue=["innerHTML"],tue={class:"mention-name"},nue={class:"mention-path"},oue=Je({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=Rc("folder","sm"),r=Rc("code","sm"),l=Rc("file-text","sm"),a=Rc("image","sm"),c=Rc("file","sm"),u=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),d=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),f=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function h(p){const m=p.path;if(m.endsWith("/"))return i;const k=p.name||m.split("/").pop()||m,y=k.lastIndexOf("."),g=y>0?k.slice(y+1).toLowerCase():"";return g?u.has(g)?r:d.has(g)?l:f.has(g)?a:c:c}return(p,m)=>(x(),E("div",Zce,[n.loading?(x(),E("div",Xce,B(C(s)("mention.searching")),1)):n.items.length===0?(x(),E("div",Qce,B(C(s)("mention.noMatch")),1)):(x(!0),E(We,{key:2},rt(n.items,(k,y)=>(x(),E("div",{key:k.path,class:Ue(["mention-item",{active:y===n.activeIndex}]),role:"option","aria-selected":y===n.activeIndex,onMouseenter:g=>o("hover",y),onMousedown:St(g=>o("select",k),["prevent"])},[w("span",{class:"mention-icon",innerHTML:h(k),"aria-hidden":"true"},null,8,eue),w("span",tue,B(k.name),1),w("span",nue,B(k.path),1)],42,Jce))),128))]))}}),sue=dt(oue,[["__scopeId","data-v-f4d6b958"]]),qE=[{name:"/new",desc:"commands.new.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/export",desc:"commands.export.desc"},{name:"/status",desc:"commands.status.desc"}];function iue(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Km="skill:";function rue(e){return e.startsWith(Km)?e.slice(Km.length):e}function jE(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Km}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...qE,...t]}function lue(e,t=qE){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((o,s)=>{const i=o.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:o,index:s,score:r}}).filter(({score:o})=>o>0).sort((o,s)=>o.score!==s.score?s.score-o.score:o.index-s.index).map(({item:o})=>o)}function n0(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function VE(e){return e?.supportEfforts??[]}function aue(e){return e[Math.floor(e.length/2)]}function Sf(e){if(n0(e)==="unsupported")return"off";const t=VE(e);return t.length>0?e?.defaultEffort??aue(t):"on"}function o0(e){const t=VE(e),n=n0(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function ak(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function cue(e){return e!=="off"}function uue(e,t){return o0(e).includes(t)}function lb(e,t){return t==="off"?"off":t==="on"?Sf(e):t}function Gm(e,t){return t??Sf(e)}function due(e,t){if(e==="off")return{enabled:!1};if(e==="on")return{enabled:!0};const n=t?.at(-1);return n!==void 0&&e===n?{enabled:!0}:{enabled:!0,effort:e}}function fue(e,t,n){return!n||e===void 0?t:Sf(e)}const Ym=100;function hue(e){const t=M1(Dt.inputHistory);if(Array.isArray(t)){const n=t.filter(i=>typeof i=="string"&&i.length>0);if(!e||n.length===0)return{};const o=n.length>Ym?n.slice(-Ym):n,s={[e]:o};return Ff(Dt.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function pue(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=oe(hue(s())),r=D(()=>i.value[s()??""]??[]);let l=-1,a="";function c(y){const g=s();if(l=-1,!g)return;const v=y.trim();if(!v)return;const b=i.value[g]??[];if(b.at(-1)===v)return;const A=[...b,v],I=A.length>Ym?A.slice(-Ym):A;i.value={...i.value,[g]:I},Ff(Dt.inputHistory,i.value)}function u(){const y=n.value;return y?(y.selectionStart??0)===0:!1}function d(y){t.value=y,yt(()=>{const g=n.value;if(!g)return;o();const v=y.length;g.setSelectionRange(v,v)})}function f(){const y=r.value;if(y.length!==0){if(l===-1)a=t.value,l=y.length-1;else if(l>0)l-=1;else return;d(y[l])}}function h(){if(l===-1)return;const y=r.value;l<y.length-1?(l+=1,d(y[l])):(l=-1,d(a))}function p(){l=-1}function m(){return l!==-1}function k(){return r.value.length>0}return et(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:m,hasHistory:k}}function mue(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=oe(!1),c=oe([]),u=oe(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=lue(h,jE(s())),u.value=0,a.value=c.value.length>0):a.value=!1}function f(h){if(a.value=!1,h.acceptsInput){t.value=`${h.name} `,yt(()=>{const p=n.value;if(!p)return;const m=t.value.length;p.setSelectionRange(m,m),p.focus(),o()});return}t.value="",l?.(),r(h.name),i(h.name)}return{open:a,items:c,active:u,update:d,select:f}}function gue(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=oe(!1),r=oe([]),l=oe(0),a=oe(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let m=p-1;for(;m>=0&&!/\s/.test(h[m]);)m--;m++;const k=h.slice(m,p);return k.startsWith("@")?{token:k.slice(1),start:m,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const m=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(m)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const m=t.value;t.value=m.slice(0,p.start)+h.path+m.slice(p.end),i.value=!1,yt(()=>{const k=n.value;if(!k)return;const y=p.start+h.path.length;k.setSelectionRange(y,y),k.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function vue(e){const{sessionId:t}=e;function n(c){return yo(x_(c))??""}function o(c,u){const d=x_(c);u?To(d,u):qa(d)}const s=oe(n(t())),i=oe(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}et(s,c=>{yt(r),o(t(),c)}),et(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),yt(r))});function l(c){s.value=c,yt(()=>{const u=i.value;if(!u)return;u.focus();const d=c.length;u.setSelectionRange(d,d),r()})}function a(){o(t(),"")}return{text:s,textareaRef:i,autosize:r,loadForEdit:l,clearDraft:a}}function yue(e){const{uploadImage:t,sessionId:n}=e,o=oe({}),s=D(()=>o.value[n()??""]??[]),i=oe(null),r=oe(null),l=oe(!1);let a=0;function c(){return`att_${++a}`}function u(O,U){o.value={...o.value,[O]:U}}function d(O){if(O.previewUrl!==void 0)try{URL.revokeObjectURL(O.previewUrl)}catch{}}function f(O){return O.startsWith("image/")?"image":O.startsWith("video/")?"video":"file"}async function h(O){const U=t();if(!U)return;const Z=n()??"";if(O.length!==0)for(const ie of O){const q=f(ie.type),ee=c(),fe=q==="file"?void 0:URL.createObjectURL(ie),ne={localId:ee,name:ie.name,kind:q,previewUrl:fe,mediaType:ie.type||"application/octet-stream",size:ie.size,uploading:!0};u(Z,[...o.value[Z]??[],ne]),U(ie,ie.name).then(j=>{const K=o.value[Z]??[];u(Z,K.map(ve=>ve.localId===ee?{...ve,uploading:!1,fileId:j?.fileId,mediaType:j?.mediaType??ve.mediaType,error:j===null}:ve))}).catch(()=>{const j=o.value[Z]??[];u(Z,j.map(K=>K.localId===ee?{...K,uploading:!1,error:!0}:K))})}}function p(O){const U=n()??"",Z=o.value[U]??[],ie=Z.find(q=>q.localId===O);i.value?.localId===O&&(i.value=null),ie&&d(ie),u(U,Z.filter(q=>q.localId!==O))}function m(O){i.value=O}function k(){i.value=null}function y(){r.value?.click()}function g(O){const U=O.target,Z=Array.from(U.files??[]);h(Z),U.value=""}function v(O){if(!t())return;const U=O.clipboardData;if(!U)return;const Z=[],ie=new Set,q=(ee,fe)=>{const ne=`${ee.size}:${ee.type}:${fe}`;if(ie.has(ne))return;ie.add(ne);const j=ee.type.split("/")[1]??"png",K=fe.includes(".")?fe:`paste-${Date.now()}.${j}`;Z.push(ee instanceof File?ee:new File([ee],K,{type:ee.type}))};for(const ee of Array.from(U.items))if(ee.kind==="file"){const fe=ee.getAsFile();fe&&q(fe,fe.name||`paste-${Date.now()}.${ee.type.split("/")[1]??"png"}`)}for(const ee of Array.from(U.files))q(ee,ee.name);Z.length!==0&&(O.preventDefault(),h(Z))}let b=0;function A(O){!t()||!Array.from(O.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(O.preventDefault(),O.stopPropagation(),l.value=!0)}function I(){l.value=!1}function T(O){if(b=0,l.value=!1,!t())return;O.preventDefault(),O.stopPropagation();const U=Array.from(O.dataTransfer?.files??[]);h(U)}function M(O){return Array.from(O.dataTransfer?.items??[]).some(U=>U.kind==="file")}function $(O){!t()||!M(O)||(O.preventDefault(),b+=1,l.value=!0)}function N(O){!t()||!M(O)||O.preventDefault()}function F(O){!t()||!M(O)||(b=Math.max(0,b-1),b===0&&(l.value=!1))}function S(O){if(b=0,l.value=!1,!t())return;O.preventDefault();const U=Array.from(O.dataTransfer?.files??[]);h(U)}function R(){const O=n()??"";for(const U of o.value[O]??[])d(U);u(O,[])}function z(O,U,Z){const ie=o.value[O]??[];ie.some(q=>q.localId===U)&&u(O,ie.map(q=>q.localId===U?{...q,...Z}:q))}function W(O){return fetch(O).then(U=>{if(!U.ok)throw new Error(`fetch failed: ${U.status}`);return U.blob()})}function L(O){const U=n()??"";for(const Z of o.value[U]??[])d(Z);u(U,[]);for(const Z of O){const ie=c(),q=/^data:/i.test(Z.url),ee=/^blob:/i.test(Z.url),fe=Z.name??Z.kind;if(Z.fileId){const ne={localId:ie,name:fe,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(U,[...o.value[U]??[],ne]),Z.kind!=="file"&&!q&&!ee&&ht().getFileBlob(Z.fileId).then(j=>{const K=URL.createObjectURL(j);if(!(o.value[U]??[]).some(he=>he.localId===ie)){URL.revokeObjectURL(K);return}z(U,ie,{previewUrl:K})}).catch(()=>{})}else{if(!Z.url)continue;const ne=t();if(!ne)continue;const j={localId:ie,name:fe,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(U,[...o.value[U]??[],j]),W(Z.url).then(K=>{const ve=fe.includes(".")?fe:`${fe}.${K.type.split("/")[1]??"bin"}`;return ne(K,ve)}).then(K=>{if(K===null){const ve=o.value[U]??[];u(U,ve.filter(he=>he.localId!==ie));return}z(U,ie,{uploading:!1,fileId:K.fileId})}).catch(()=>{const K=o.value[U]??[];u(U,K.filter(ve=>ve.localId!==ie))})}}}return et(n,()=>{i.value=null}),Cn(()=>{document.addEventListener("paste",v),document.addEventListener("dragenter",$),document.addEventListener("dragover",N),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),$n(()=>{document.removeEventListener("paste",v),document.removeEventListener("dragenter",$),document.removeEventListener("dragover",N),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const O of Object.values(o.value))for(const U of O)d(U);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:m,closeAttachmentPreview:k,openFilePicker:y,handleFileInputChange:g,handleDragOver:A,handleDragLeave:I,handleDrop:T,clearAfterSubmit:R,loadAttachments:L}}const kue=["type","disabled"],bue={class:"ui-button__content"},xue=Je({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(x(),E("button",{class:Ue(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(x(),Se(Us,{key:0,size:"sm",class:"ui-button__spinner"})):ue("",!0),w("span",bue,[jn(t.$slots,"default",{},void 0,!0)])],10,kue))}}),jt=dt(xue,[["__scopeId","data-v-e58393a8"]]),wue={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},_ue=["stroke-dasharray","stroke-dashoffset"],Iv=7,Sue=Je({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*Iv;return(o,s)=>(x(),E("svg",wue,[w("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:Iv,fill:"none","stroke-width":"2.5"}),w("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:Iv,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,_ue)]))}}),Cue=dt(Sue,[["__scopeId","data-v-a364f1f1"]]),Aue={key:0,class:"att-strip"},Mue={class:"att-lightbox-card"},Eue=["src"],Tue=["src","alt"],Nue={class:"att-lightbox-name"},Iue={class:"composer-card"},Lue={class:"cin-wrap"},$ue={class:"input-row"},Fue=["placeholder","disabled"],Oue=["aria-label"],Bue={class:"toolbar-left"},Rue=["onKeydown"],Due=["onClick"],Pue={class:"pd-check"},Hue={class:"pd-info"},Wue={class:"pd-desc"},zue={class:"mode-label"},Uue={key:0,class:"mode-tag"},que={key:1,class:"mode-tag"},jue={key:2,class:"mode-tag"},Vue={class:"mode-row-icon"},Kue={class:"mode-row-info"},Gue={class:"mode-row-name"},Yue={class:"mode-row-desc"},Zue={class:"mode-row-icon"},Xue={class:"mode-row-info"},Que={class:"mode-row-name"},Jue={class:"mode-row-desc"},ede={class:"mode-row-icon"},tde={class:"mode-row-info"},nde={class:"mode-row-name"},ode={class:"mode-row-desc"},sde={key:0,class:"mode-row-actions"},ide={class:"toolbar-right"},rde=["aria-label"],lde=["onKeydown"],ade={key:0,class:"think-suffix"},cde=["aria-label"],ude=["aria-label","disabled"],dde={key:0,class:"md-section"},fde=["onClick"],hde={class:"md-check"},pde={class:"md-name"},mde={class:"md-provider"},gde={key:1,class:"md-divider"},vde={key:2,class:"md-section"},yde=["onClick"],kde={class:"md-check"},bde={class:"md-name"},xde={key:3,class:"md-divider"},wde={class:"md-name"},_de={key:0,class:"md-note"},Sde=["aria-label"],Cde=["disabled","onClick"],Ade={class:"md-cache-note"},Mde={class:"md-name"},Ede={class:"drop-card"},N3=36,Tde=Je({__name:"Composer",props:{running:{type:Boolean,default:!1},starting:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},goal:{},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const o=e,s=D(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=$t(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=vue({sessionId:()=>o.sessionId}),h=oe(!1);function p(){h.value=!h.value,yt(()=>{u(),g(),c.value?.focus()})}function m(){h.value&&(h.value=!1,yt(u))}function k(Ke){if(typeof getComputedStyle>"u")return N3;const Re=Number.parseFloat(getComputedStyle(Ke).minHeight);return Number.isFinite(Re)&&Re>0?Re:N3}const y=oe(!1);function g(){const Ke=c.value;y.value=!!Ke&&Ke.scrollHeight>k(Ke)}et(a,()=>{yt(g)}),et(()=>o.sessionId,()=>{h.value=!1});const v=pue({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:b,items:A,active:I,update:T,select:M}=mue({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ke=>i("command",Ke),historyPush:Ke=>v.push(Ke),clearDraft:f}),{open:$,items:N,active:F,loading:S,update:R,select:z}=gue({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function W(){v.resetBrowsing(),T(),R()}const{attachments:L,previewAttachment:O,fileInputRef:U,isDragOver:Z,removeAttachment:ie,openAttachmentPreview:q,closeAttachmentPreview:ee,openFilePicker:fe,handleFileInputChange:ne,handleDragOver:j,handleDragLeave:K,handleDrop:ve,clearAfterSubmit:he,loadAttachments:Ae}=yue({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});Cn(()=>{a.value&&yt(()=>{u(),g()})}),$n(()=>{document.removeEventListener("mousedown",nn),V()});function re(){c.value?.focus({preventScroll:!0})}function Y(Ke){Ae(Ke)}t({loadForEdit:d,loadAttachmentsForEdit:Y,focus:re});function Q(Ke){return{fileId:Ke.fileId,kind:Ke.kind,name:Ke.name,mediaType:Ke.mediaType,size:Ke.size}}function P(Ke){if(Ke.kind==="file"){Ke.fileId!==void 0&&BE(Ke.fileId,Ke.name,Ke.mediaType);return}q(Ke)}function G(){const Ke=a.value.trim();if(L.value.some(Te=>Te.uploading))return;const Re=L.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ke&&Re.length===0)return;if(v.push(Ke),Ke){const Te=iue(Ke),ge=Te?jE(o.skills).some(Me=>Me.name===Te.cmd||Me.name===`/${Km}${Te.cmd.slice(1)}`):!1;if(Te&&ge){a.value="",f(),b.value=!1,m(),i("command",Te.arg?`${Te.cmd} ${Te.arg}`:Te.cmd);return}}const le={text:Ke,attachments:Re.map(Te=>Q(Te))};O.value=null,he(),a.value="",f(),b.value=!1,$.value=!1,m(),i("submit",le)}function me(){if(!o.running||L.value.some(Te=>Te.uploading))return;const Ke=a.value.trim(),Re=L.value.filter(Te=>!Te.uploading&&!Te.error&&Te.fileId);if(!Ke&&Re.length===0&&o.queued.length===0)return;const le={text:Ke,attachments:Re.map(Te=>Q(Te))};he(),v.push(Ke),a.value="",f(),b.value=!1,$.value=!1,m(),i("steer",le)}let ye=!1,de=null;function V(){de!==null&&(clearTimeout(de),de=null)}function se(){V(),ye=!0}function pe(){V(),de=setTimeout(()=>{de=null,ye=!1},0)}function ke(Ke){return ye||Ke.isComposing||Ke.keyCode===229}function Ne(Ke){if(!ke(Ke)){if(Ke.key==="Escape"){if(xe.value){Ke.preventDefault(),ut();return}if(Ze.value){Ke.preventDefault(),Tt();return}}if(b.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),I.value=(I.value+1)%A.value.length;return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),I.value=(I.value-1+A.value.length)%A.value.length;return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Re=A.value[I.value];Re&&M(Re);return}if(Ke.key==="Escape"){Ke.preventDefault(),b.value=!1;return}}if($.value&&!S.value){if(Ke.key==="ArrowDown"){Ke.preventDefault(),F.value=(F.value+1)%Math.max(1,N.value.length);return}if(Ke.key==="ArrowUp"){Ke.preventDefault(),F.value=(F.value-1+Math.max(1,N.value.length))%Math.max(1,N.value.length);return}if(Ke.key==="Enter"||Ke.key==="Tab"){Ke.preventDefault();const Re=N.value[F.value];Re&&z(Re);return}if(Ke.key==="Escape"){Ke.preventDefault(),$.value=!1;return}}if(Ke.key==="s"&&(Ke.ctrlKey||Ke.metaKey)&&!Ke.shiftKey&&!Ke.altKey){o.running&&(Ke.preventDefault(),me());return}if(!h.value&&!b.value&&!$.value&&!Ke.shiftKey&&!Ke.altKey&&!Ke.metaKey&&!Ke.ctrlKey){const Re=v.isBrowsing();if(Ke.key==="ArrowUp"&&v.hasHistory()&&(Re||v.caretAtTextStart())){Ke.preventDefault(),v.recallOlder();return}if(Ke.key==="ArrowDown"&&Re){Ke.preventDefault(),v.recallNewer();return}}if(Ke.key==="Enter"&&!Ke.shiftKey){if(h.value&&!(Ke.metaKey||Ke.ctrlKey))return;Ke.preventDefault(),G()}}}const qe=D(()=>r("composer.send")),be=D(()=>!!o.uploadImage),xe=oe(!1),Ze=oe(!1),tt=oe(null);function lt(){xe.value=!xe.value,xe.value?(Ze.value=!1,bn(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function ut(){xe.value=!1,Ze.value||document.removeEventListener("click",wt,!0)}function mt(){Ze.value=!Ze.value,Ze.value?(xe.value=!1,bn(),document.addEventListener("click",wt,!0)):document.removeEventListener("click",wt,!0)}function Tt(){Ze.value=!1,xe.value||document.removeEventListener("click",wt,!0)}function wt(Ke){tt.value&&!tt.value.contains(Ke.target)&&(ut(),Tt())}$n(()=>{document.removeEventListener("click",wt,!0)});const Ft=D(()=>{const Ke=o.status?.ctxMax??0;return Ke<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ke*100)))}),en=D(()=>{const Ke=pr(o.status?.ctxUsed??0),Re=pr(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ke,max:Re,pct:Ft.value})}),Dn=D(()=>Ft.value>=80),Pt=D(()=>o.models?.find(Ke=>Ke.id===o.status?.modelId)),kn=D(()=>n0(Pt.value)),hn=D(()=>o0(Pt.value)),Kt=D(()=>Gm(Pt.value,o.thinking)),Tn=D(()=>hn.value.includes(Kt.value)?Kt.value:""),Gt=D(()=>cue(Kt.value)),Wt=D(()=>kn.value==="unsupported"||hn.value.length<=1),pn=D(()=>{if(!Gt.value)return"";const Ke=(Pt.value?.supportEfforts?.length??0)>0,Re=Kt.value;return Ke&&Re!=="on"?r("composer.thinkingSuffixEffort",{level:Re}):r("composer.thinkingSuffix")});function so(Ke){Wt.value||i("setThinking",lb(Pt.value,Ke))}function mn(Ke){return Ke==="on"?r("status.thinkingOn"):Ke==="off"?r("status.thinkingOff"):ak(Ke)}const to=D(()=>o.planMode===!0),vt=D(()=>o.swarmMode===!0),Pn=D(()=>o.goal?.status??o.activationBadges?.goal?.status??null),Fn=D(()=>Pn.value!==null&&Pn.value!=="complete"),Qn=D(()=>Fn.value||o.goalMode===!0),sn=D(()=>Pn.value==="active"),es=D(()=>Pn.value==="paused"||Pn.value==="blocked"),nt=oe(!1),Be=oe(null),Bt=oe(null),Yt=oe({}),gn=D(()=>to.value||vt.value||Qn.value);function bn(){nt.value=!1,document.removeEventListener("mousedown",nn)}function nn(Ke){const Re=Ke.target;Be.value?.contains(Re)||Bt.value?.contains(Re)||bn()}function Vn(){if(nt.value){bn();return}ut(),Tt();const Ke=Be.value?.getBoundingClientRect();Ke&&(Yt.value={left:`${Math.round(Ke.left)}px`,bottom:`${Math.round(window.innerHeight-Ke.top+8)}px`}),nt.value=!0,setTimeout(()=>document.addEventListener("mousedown",nn),0)}const Kn=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--color-warning)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--color-danger)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}],Jn=["status.planDesc","status.swarmDesc","status.goalDesc"],Oo=oe(null),ko=oe(""),ai=oe("");function Uo(Ke){const Re={};return Ke&&(Re["--composer-menu-desc-width"]=Ke),Re}const As=D(()=>Uo(ko.value)),cs=D(()=>Uo(ai.value)),qo=D(()=>({...Yt.value,...cs.value}));let Bo=null;function ci(Ke){const Re=Number.parseFloat(Ke);return Number.isFinite(Re)?Re:0}function tn(Ke){return`${Ke.fontStyle||"normal"} ${Ke.fontWeight||"400"} ${Ke.fontSize} ${Ke.fontFamily}`}function qs(Ke){return Ke.letterSpacing==="normal"?0:ci(Ke.letterSpacing)}function io(Ke,Re){if(!Ke)return 0;const le=zce(Ke,tn(Re),{letterSpacing:qs(Re)});return Uce(le)}function js(){const Ke=Oo.value?.querySelector(".pd-desc");if(!Ke)return;const Re=getComputedStyle(Ke),le=Math.max(0,...Kn.map(ge=>io(r(ge.descKey),Re))),Te=Math.max(0,...Jn.map(ge=>io(r(ge),Re)));ko.value=le>0?`${Math.ceil(le)}px`:"",ai.value=Te>0?`${Math.ceil(Te)}px`:""}function ui(){typeof window>"u"||(Bo!==null&&window.cancelAnimationFrame(Bo),yt(()=>{Bo=window.requestAnimationFrame(()=>{Bo=null,js()})}))}et(l,ui,{immediate:!0}),Cn(()=>{ui(),document.fonts?.ready.then(ui)}),$n(()=>{Bo!==null&&(window.cancelAnimationFrame(Bo),Bo=null)});function Ni(Ke){i("setPermission",Ke),Tt()}const di=D(()=>Kn.find(Ke=>Ke.mode===o.status?.permission)),Vs=D(()=>di.value?r(di.value.labelKey):""),ts=D(()=>Pt.value?.provider??""),ns=D(()=>!ts.value||!o.models?.length?[]:o.models.filter(Ke=>Ke.provider===ts.value)),zt=D(()=>new Set(o.starredIds??[]));function Ms(Ke){return zt.value.has(Ke)}const Io=D(()=>o.models?.length?o.models.filter(Ke=>Ms(Ke.id)&&Ke.provider!==ts.value):[]);function fi(Ke){i("selectModel",Ke),ut()}return(Ke,Re)=>(x(),E("div",{class:Ue(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Re[18]||(Re[18]=(...le)=>C(j)&&C(j)(...le)),onDragleave:Re[19]||(Re[19]=(...le)=>C(K)&&C(K)(...le)),onDrop:Re[20]||(Re[20]=(...le)=>C(ve)&&C(ve)(...le))},[C(L).length>0?(x(),E("div",Aue,[(x(!0),E(We,null,rt(C(L),le=>(x(),Se(FE,{key:le.localId,kind:le.kind,name:le.name,url:le.previewUrl,"file-id":le.fileId,"media-type":le.mediaType,size:le.size,uploading:le.uploading,error:le.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:le.name}),onActivate:Te=>P(le),onRemove:Te=>C(ie)(le.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ue("",!0),C(O)?(x(),E("div",{key:1,class:"att-lightbox",onClick:Re[1]||(Re[1]=St((...le)=>C(ee)&&C(ee)(...le),["self"]))},[w("div",Mue,[ae(an,{text:C(r)("model.close")},{default:Ie(()=>[w("button",{type:"button",class:"att-lightbox-close",onClick:Re[0]||(Re[0]=(...le)=>C(ee)&&C(ee)(...le))},"✕")]),_:1},8,["text"]),C(O).kind==="video"?(x(),E("video",{key:0,class:"att-lightbox-media",src:C(O).previewUrl,controls:"",playsinline:""},null,8,Eue)):(x(),E("img",{key:1,class:"att-lightbox-media",src:C(O).previewUrl,alt:C(O).name},null,8,Tue)),w("div",Nue,B(C(O).name),1)])])):ue("",!0),w("div",Iue,[w("div",Lue,[C(b)?(x(),Se(Yce,{key:0,items:C(A),"active-index":C(I),onSelect:C(M),onHover:Re[2]||(Re[2]=le=>I.value=le)},null,8,["items","active-index","onSelect"])):ue("",!0),C($)?(x(),Se(sue,{key:1,items:C(N),"active-index":C(F),loading:C(S),onSelect:C(z),onHover:Re[3]||(Re[3]=le=>F.value=le)},null,8,["items","active-index","loading","onSelect"])):ue("",!0),w("div",$ue,[qn(w("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Re[4]||(Re[4]=le=>vo(a)?a.value=le:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:Ne,onCompositionstart:se,onCompositionend:pe,onInput:W},null,40,Fue),[[Cs,C(a)]]),h.value||y.value?(x(),E("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(x(),Se(Ge,{key:0,name:"collapse",size:"sm"})):(x(),Se(Ge,{key:1,name:"expand",size:"sm"}))],8,Oue)):ue("",!0)])]),be.value?(x(),E("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",multiple:"",class:"file-input-hidden",onChange:Re[5]||(Re[5]=(...le)=>C(ne)&&C(ne)(...le))},null,544)):ue("",!0),w("div",{ref_key:"toolbarRef",ref:tt,class:"toolbar"},[w("div",{ref_key:"menuMeasureRef",ref:Oo,class:"menu-measure","aria-hidden":"true"},[...Re[21]||(Re[21]=[w("span",{class:"pd-desc"},null,-1)])],512),w("div",Bue,[be.value?(x(),Se(Xn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(fe)},{default:Ie(()=>[ae(Ge,{name:"attachment"})]),_:1},8,["label","onClick"])):ue("",!0),e.status?(x(),E("span",{key:1,class:Ue(["perm-pill",["perm-"+e.status.permission,{open:Ze.value}]]),role:"button",tabindex:"0",onClick:St(mt,["stop"]),onKeydown:[ur(mt,["enter"]),ur(St(mt,["prevent"]),["space"])]},B(Vs.value),43,Rue)):ue("",!0),Ze.value&&e.status?(x(),E("div",{key:2,class:"perm-dropdown",style:on(As.value),role:"menu",onClick:Re[6]||(Re[6]=St(()=>{},["stop"]))},[(x(),E(We,null,rt(Kn,le=>w("button",{key:le.mode,class:Ue(["pd-row",{"is-current":le.mode===e.status.permission}]),role:"menuitem",onClick:Te=>Ni(le.mode)},[w("span",Pue,[le.mode===e.status.permission?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",Hue,[w("span",{class:"pd-name",style:on({color:le.color})},B(C(r)(le.labelKey)),5),w("span",Wue,B(C(r)(le.descKey)),1)])],10,Due)),64))],4)):ue("",!0),e.status?(x(),E("div",{key:3,ref_key:"modesRef",ref:Be,class:"modes"},[w("button",{type:"button",class:Ue(["mode-pill",{on:gn.value,open:nt.value}]),onClick:St(Vn,["stop"])},[w("span",zue,B(C(r)("status.modesLabel")),1),to.value?(x(),E("span",Uue,B(C(r)("status.planLabel")),1)):ue("",!0),vt.value?(x(),E("span",que,B(C(r)("status.swarmLabel")),1)):ue("",!0),Qn.value?(x(),E("span",jue,B(C(r)("status.goalLabel")),1)):ue("",!0)],2),nt.value?(x(),E("div",{key:0,ref_key:"modesMenuRef",ref:Bt,class:"modes-menu",style:on(qo.value),role:"menu"},[w("button",{type:"button",class:Ue(["mode-row",{on:to.value}]),role:"menuitem",onClick:Re[7]||(Re[7]=le=>i("togglePlan"))},[w("span",Vue,[ae(Ge,{name:"file-edit",size:"sm"})]),w("span",Kue,[w("span",Gue,B(C(r)("status.planLabel")),1),w("span",Yue,B(C(r)("status.planDesc")),1)]),w("span",{class:Ue(["mode-switch",{on:to.value}])},[...Re[22]||(Re[22]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("button",{type:"button",class:Ue(["mode-row",{on:vt.value}]),role:"menuitem",onClick:Re[8]||(Re[8]=le=>i("toggleSwarm"))},[w("span",Zue,[ae(Ge,{name:"sparkles",size:"sm"})]),w("span",Xue,[w("span",Que,B(C(r)("status.swarmLabel")),1),w("span",Jue,B(C(r)("status.swarmDesc")),1)]),w("span",{class:Ue(["mode-switch",{on:vt.value}])},[...Re[23]||(Re[23]=[w("span",{class:"mode-knob"},null,-1)])],2)],2),w("div",{class:Ue(["mode-row mode-row-goal",{on:Fn.value||o.goalMode}])},[w("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Re[9]||(Re[9]=le=>Fn.value?i("focusGoal"):i("toggleGoal"))},[w("span",ede,[ae(Ge,{name:"target",size:"sm"})]),w("span",tde,[w("span",nde,B(C(r)("status.goalLabel")),1),w("span",ode,B(C(r)("status.goalDesc")),1)]),Fn.value?ue("",!0):(x(),E("span",{key:0,class:Ue(["mode-switch",{on:o.goalMode}])},[...Re[24]||(Re[24]=[w("span",{class:"mode-knob"},null,-1)])],2))]),Fn.value?(x(),E("div",sde,[sn.value?(x(),Se(jt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Re[10]||(Re[10]=le=>i("controlGoal","pause"))},{default:Ie(()=>[ae(Ge,{name:"pause",size:"sm"}),w("span",null,B(C(r)("status.goalPause")),1)]),_:1})):ue("",!0),es.value?(x(),Se(jt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Re[11]||(Re[11]=le=>i("controlGoal","resume"))},{default:Ie(()=>[ae(Ge,{name:"play",size:"sm"}),w("span",null,B(C(r)("status.goalResume")),1)]),_:1})):ue("",!0),ae(jt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Re[12]||(Re[12]=le=>i("controlGoal","cancel"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"}),w("span",null,B(C(r)("status.goalCancel")),1)]),_:1})])):ue("",!0)],2)],4)):ue("",!0)],512)):ue("",!0)]),w("div",ide,[Dn.value?(x(),E("button",{key:0,class:"compact-chip",onClick:Re[13]||(Re[13]=St(le=>i("compact"),["stop"]))},"/compact")):ue("",!0),ae(an,{text:en.value},{default:Ie(()=>[e.status&&!e.hideContext?(x(),E("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":en.value},[ae(Cue,{pct:Ft.value},null,8,["pct"])],8,rde)):ue("",!0)]),_:1},8,["text"]),e.status?(x(),E("span",{key:1,class:Ue(["model-pill",{open:xe.value}]),role:"button",tabindex:"0",onClick:St(lt,["stop"]),onKeydown:[ur(lt,["enter"]),ur(St(lt,["prevent"]),["space"])]},[w("b",null,B(e.status.model),1),pn.value?(x(),E("span",ade,B(pn.value),1)):ue("",!0),ae(Ge,{class:"cv",name:"chevron-down",size:"sm"})],42,lde)):ue("",!0),e.running?(x(),Se(an,{key:2,text:C(r)("composer.interruptTitle")},{default:Ie(()=>[w("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Re[14]||(Re[14]=le=>i("interrupt"))},[ae(Ge,{name:"stop",size:"sm"})],8,cde)]),_:1},8,["text"])):ue("",!0),w("button",{class:Ue(["send",{"is-starting":e.starting}]),"aria-label":qe.value,disabled:e.starting,onClick:Re[15]||(Re[15]=le=>G())},[e.starting?(x(),Se(Us,{key:0,size:"sm"})):(x(),Se(Ge,{key:1,name:"send",size:"sm"}))],10,ude)]),xe.value&&e.status?(x(),E("div",{key:0,class:"model-dropdown",role:"menu",onClick:Re[17]||(Re[17]=St(()=>{},["stop"]))},[Io.value.length>0?(x(),E("div",dde,B(C(r)("status.starredModels")),1)):ue("",!0),(x(!0),E(We,null,rt(Io.value,le=>(x(),E("button",{key:le.id,class:Ue(["md-row",{"is-current":le.id===e.status.modelId}]),role:"menuitem",onClick:Te=>fi(le.id)},[w("span",hde,[le.id===e.status.modelId?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",pde,B(le.displayName??le.model),1),w("span",mde,B(le.provider),1),ae(Ge,{class:"md-star",name:"star",size:"sm"})],10,fde))),128)),Io.value.length>0?(x(),E("div",gde)):ue("",!0),ns.value.length>0?(x(),E("div",vde,B(ts.value),1)):ue("",!0),(x(!0),E(We,null,rt(ns.value,le=>(x(),E("button",{key:le.id,class:Ue(["md-row",{"is-current":le.id===e.status.modelId}]),role:"menuitem",onClick:Te=>fi(le.id)},[w("span",kde,[le.id===e.status.modelId?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",bde,B(le.displayName??le.model),1),Ms(le.id)?(x(),Se(Ge,{key:0,class:"md-star",name:"star",size:"sm"})):ue("",!0)],10,yde))),128)),ns.value.length>0?(x(),E("div",xde)):ue("",!0),w("div",{class:Ue(["md-thinking",{"is-readonly":Wt.value}])},[w("span",wde,B(C(r)("status.thinkingLabel")),1),kn.value==="unsupported"?(x(),E("span",_de,B(C(r)("status.modeNotSupported")),1)):(x(),E("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(x(!0),E(We,null,rt(hn.value,le=>(x(),E("button",{key:le,type:"button",class:Ue(["effort-seg",{"is-active":le===Tn.value}]),disabled:Wt.value,onClick:Te=>so(le)},B(mn(le)),11,Cde))),128))],8,Sde))],2),Re[25]||(Re[25]=w("div",{class:"md-divider"},null,-1)),w("div",Ade,B(C(r)("status.cacheNote")),1),Re[26]||(Re[26]=w("div",{class:"md-divider"},null,-1)),w("button",{class:"md-row md-row-more",role:"menuitem",onClick:Re[16]||(Re[16]=le=>{ut(),i("pickModel")})},[w("span",Mde,B(C(r)("status.moreModels")),1)])])):ue("",!0)],512)]),w("div",{class:Ue(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[w("div",Ede,[ae(Ge,{name:"file-plus",size:"lg"}),w("span",null,B(C(r)("composer.dropToAttach")),1)])],2)],34))}}),KE=dt(Tde,[["__scopeId","data-v-a89f6a49"]]),Nde={key:0,class:"ui-card__head"},Ide={class:"ui-card__body"},Lde={key:1,class:"ui-card__foot"},$de=Je({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(x(),E("div",Nde,[jn(t.$slots,"head",{},void 0,!0)])):ue("",!0),w("div",Ide,[jn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(x(),E("div",Lde,[jn(t.$slots,"foot",{},void 0,!0)])):ue("",!0)],2))}}),ab=dt($de,[["__scopeId","data-v-9c9f9a9a"]]),Fde={class:"goal-kicker"},Ode={key:0,class:"goal-progress","aria-hidden":"true"},Bde={class:"goal-full"},Rde={key:0,class:"goal-criterion"},Dde=["inert","aria-hidden"],Pde={class:"goal-meta"},Hde={key:0},Wde={class:"goal-actions"},zde=Je({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),{confirm:i}=Uf(),r=oe(!1);et(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=D(()=>{const d=n.goal.budget.tokenBudget;return!d||d<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/d*100)))});function a(d){switch(d){case"active":return s("status.goalStatusActive");case"paused":return s("status.goalStatusPaused");case"blocked":return s("status.goalStatusBlocked");case"complete":return s("status.goalStatusComplete")}}function c(d){const f=Math.max(0,Math.round(d/1e3)),h=Math.floor(f/60),p=f%60;return h<=0?`${p}s`:h<60?`${h}m ${p}s`:`${Math.floor(h/60)}h ${h%60}m`}async function u(){await i({title:s("status.goalCancel"),message:s("status.goalCancelConfirm"),confirmLabel:s("status.goalCancelConfirmYes"),cancelLabel:s("status.goalCancelConfirmNo"),variant:"danger"})&&o("controlGoal","cancel")}return(d,f)=>(x(),Se(ab,{class:Ue(["goal-strip",{expanded:r.value}])},{head:Ie(()=>[w("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[ae(Ge,{class:"goal-icon",name:"target",size:"md"}),w("span",Fde,B(C(s)("status.goalLabel")),1),w("span",{class:Ue(["goal-objective",{"expanded-hidden":r.value}])},B(e.goal.objective),3),ae(qi,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ie(()=>[ot(B(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(x(),E("span",Ode,[w("span",{class:"goal-progress-fill",style:on({width:`${l.value}%`})},null,4)])):ue("",!0),ae(Ge,{class:Ue(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ie(()=>[w("div",Bde,B(e.goal.objective),1),e.goal.completionCriterion?(x(),E("div",Rde,[f[3]||(f[3]=w("span",null,"Done when",-1)),w("p",null,B(e.goal.completionCriterion),1)])):ue("",!0)]),foot:Ie(()=>[w("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[w("div",Pde,[w("span",null,B(e.goal.turnsUsed)+" turns",1),w("span",null,B(C(pr)(e.goal.tokensUsed))+" tokens",1),w("span",null,B(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(x(),E("span",Hde,B(l.value)+"% token budget",1)):ue("",!0)]),w("div",Wde,[e.goal.status==="active"?(x(),Se(jt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=St(h=>o("controlGoal","pause"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"pause",size:"md"}),w("span",null,B(C(s)("status.goalPause")),1)]),_:1})):ue("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(x(),Se(jt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=St(h=>o("controlGoal","resume"),["stop"]))},{default:Ie(()=>[ae(Ge,{name:"play",size:"md"}),w("span",null,B(C(s)("status.goalResume")),1)]),_:1})):ue("",!0),ae(jt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:St(u,["stop"])},{default:Ie(()=>[ae(Ge,{name:"close",size:"md"}),w("span",null,B(C(s)("status.goalCancel")),1)]),_:1})])],8,Dde)]),_:1},8,["class"]))}}),Ude=dt(zde,[["__scopeId","data-v-44bef30f"]]),qde={class:"qh"},jde={class:"qtitle"},Vde={key:0,class:"qstep"},Kde={key:1,class:"qmin-peek"},Gde={class:"qbody"},Yde=["aria-label"],Zde=["aria-selected","aria-label","onClick"],Xde={class:"qstep-num"},Qde={key:1,class:"qheader-chip"},Jde={class:"qtext"},efe={class:"qopts"},tfe=["onClick"],nfe={class:"qopt-key"},ofe={class:"qopt-glyph"},sfe={key:0,class:"chk"},ife={key:1,class:"rad"},rfe={class:"qopt-text"},lfe={class:"qopt-label"},afe={key:0,class:"qopt-desc"},cfe={class:"qopt-glyph"},ufe={key:0,class:"chk"},dfe={key:1,class:"rad"},ffe={class:"qopt-label"},hfe=["placeholder"],pfe={class:"qfoot"},mfe=Je({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=$t(),s=t,i=oe(0),r=oe(!1),l=D(()=>n.question.questions[i.value]),a=D(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(L){L>=0&&L<a.value&&(i.value=L)}function f(L){const O=p.value[L];return O?O.kind==="multi"?O.optionIds.length>0:O.kind==="multiWithOther"?O.optionIds.length>0||O.otherText.trim().length>0:O.kind==="other"?O.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=oe({});function m(L){return L.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${L.label} ${L.description??""}`.toLowerCase())}function k(){const L={...p.value};let O=!1;for(const U of n.question.questions){if(L[U.id])continue;const Z=U.options.filter(m);Z.length!==0&&(L[U.id]=U.multiSelect?{kind:"multi",optionIds:Z.map(ie=>ie.id)}:{kind:"single",optionId:Z[0].id},O=!0)}O&&(p.value=L)}et(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},v.value={}}),et(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),k()},{immediate:!0,deep:!0});function y(L,O){const U=p.value[L];if(U&&U.kind==="single"&&U.optionId===O){const Z={...p.value};delete Z[L],p.value=Z}else p.value={...p.value,[L]:{kind:"single",optionId:O}}}function g(L,O){const U=p.value[L],Z=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],ie=Z.indexOf(O);ie>=0?Z.splice(ie,1):Z.push(O);const q=p.value[L],ee=q&&q.kind==="multiWithOther"?q.otherText:"";ee?p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:Z,otherText:ee}}:p.value={...p.value,[L]:{kind:"multi",optionIds:Z}}}const v=oe({}),b=oe(null);function A(L){const O=n.question.questions.find(Z=>Z.id===L),U=v.value[L]??"";if(O.multiSelect){const Z=p.value[L],ie=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[L]:{kind:"multiWithOther",optionIds:ie,otherText:U}}}else p.value={...p.value,[L]:{kind:"other",text:U}}}function I(L){A(L),yt(()=>b.value?.focus())}function T(L,O){const U=p.value[L];return U?U.kind==="single"?U.optionId===O:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(O):!1:!1}function M(L){const O=p.value[L];return!!(O&&(O.kind==="other"||O.kind==="multiWithOther"))}function $(){return n.question.questions.every(L=>f(L.id))}const N=D(()=>n.busyKind==="answer"),F=D(()=>n.busyKind==="dismiss"),S=D(()=>!!n.busyKind);function R(){if(S.value||!$())return;const L={answers:p.value,method:"click"};s("answer",n.question.questionId,L)}function z(){S.value||s("dismiss",n.question.questionId)}function W(L){const O=(document.activeElement?.tagName??"").toLowerCase(),U=O==="input"||O==="textarea";if(S.value)return;if(L.key==="Enter"){if(L.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():$()&&R();return}if(U)return;if(L.key==="Escape"){L.preventDefault(),z();return}if(r.value)return;const Z=parseInt(L.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){L.preventDefault();const ie=l.value,q=Z-1,ee=ie.options[q];ee&&(ie.multiSelect?g(ie.id,ee.id):y(ie.id,ee.id))}}return Cn(()=>document.addEventListener("keydown",W)),$n(()=>document.removeEventListener("keydown",W)),(L,O)=>(x(),Se(ab,{class:Ue(["qcard",{minimized:r.value}])},zA({head:Ie(()=>[w("div",qde,[O[5]||(O[5]=w("span",{class:"qh-ic"},"?",-1)),w("span",jde,B(C(o)("question.title")),1),a.value>1&&!r.value?(x(),E("span",Vde,B(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ue("",!0),r.value?(x(),E("span",Kde,B(l.value.question),1)):ue("",!0),ae(Xn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:O[0]||(O[0]=U=>r.value=!r.value)},{default:Ie(()=>[r.value?(x(),Se(Ge,{key:0,name:"chevron-up",size:"md"})):(x(),Se(Ge,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ie(()=>[w("div",Gde,[a.value>1?(x(),E("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(x(!0),E(We,null,rt(n.question.questions,(U,Z)=>(x(),E("button",{key:U.id,type:"button",class:Ue(["qstep-dot",{active:Z===i.value,answered:f(U.id)}]),"aria-selected":Z===i.value,"aria-label":C(o)("question.step",{current:Z+1,total:a.value}),onClick:ie=>d(Z)},[w("span",Xde,B(Z+1),1)],10,Zde))),128))],8,Yde)):ue("",!0),l.value.header?(x(),E("div",Qde,[ae(qi,{variant:"neutral",size:"sm"},{default:Ie(()=>[ot(B(l.value.header),1)]),_:1})])):ue("",!0),w("div",Jde,B(l.value.question),1),l.value.body?(x(),Se(X1,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ue("",!0),w("div",efe,[(x(!0),E(We,null,rt(l.value.options,(U,Z)=>(x(),E("label",{key:U.id,class:Ue(["qopt",{selected:T(l.value.id,U.id)}]),onClick:St(ie=>l.value.multiSelect?g(l.value.id,U.id):y(l.value.id,U.id),["prevent"])},[w("span",nfe,B(Z+1),1),w("span",ofe,[l.value.multiSelect?(x(),E("span",sfe,B(T(l.value.id,U.id)?"■":"□"),1)):(x(),E("span",ife,B(T(l.value.id,U.id)?"●":"○"),1))]),w("span",rfe,[w("span",lfe,B(U.label),1),U.description?(x(),E("span",afe,B(U.description),1)):ue("",!0)])],10,tfe))),128)),l.value.allowOther?(x(),E("label",{key:0,class:Ue(["qopt",{selected:M(l.value.id)}]),onClick:O[4]||(O[4]=St(U=>I(l.value.id),["prevent"]))},[O[6]||(O[6]=w("span",{class:"qopt-key"},null,-1)),w("span",cfe,[l.value.multiSelect?(x(),E("span",ufe,B(M(l.value.id)?"■":"□"),1)):(x(),E("span",dfe,B(M(l.value.id)?"●":"○"),1))]),w("span",ffe,B(l.value.otherLabel??C(o)("question.otherDefault")),1),qn(w("input",{ref_key:"otherInputEl",ref:b,"onUpdate:modelValue":O[1]||(O[1]=U=>v.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:O[2]||(O[2]=U=>A(l.value.id)),onFocus:O[3]||(O[3]=U=>A(l.value.id))},null,40,hfe),[[Cs,v.value[l.value.id]]])],2)):ue("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ie(()=>[w("div",pfe,[i.value<a.value-1?(x(),Se(jt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ie(()=>[ot(B(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(x(),Se(jt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!$(),loading:N.value,onClick:R},{default:Ie(()=>[ot(B(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(x(),Se(jt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ie(()=>[ot(B(C(o)("question.back")),1)]),_:1},8,["disabled"])):ue("",!0),ae(jt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:z},{default:Ie(()=>[ot(B(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),gfe=dt(mfe,[["__scopeId","data-v-14c58ac1"]]),vfe={class:"ah"},yfe={class:"akind"},kfe={class:"apath"},bfe={class:"ah-path"},xfe={key:1,class:"diff"},wfe={class:"dg"},_fe={class:"dc"},Sfe={key:2,class:"body-shell"},Cfe={class:"shell-cmd"},Afe={key:0,class:"shell-cwd"},Mfe={key:1,class:"shell-danger"},Efe={key:3,class:"body-file"},Tfe={class:"file-bar"},Nfe={class:"file-lang"},Ife={class:"file-content"},Lfe={class:"file-ln"},$fe={class:"file-text"},Ffe={key:4,class:"body-chip"},Ofe={class:"chip-label"},Bfe={class:"chip-value"},Rfe={key:0,class:"chip-detail"},Dfe={key:5,class:"body-chip"},Pfe={key:0,class:"chip-label"},Hfe={class:"chip-value"},Wfe={key:6,class:"body-chip"},zfe={class:"chip-label"},Ufe={class:"chip-value"},qfe={key:0,class:"chip-detail"},jfe={key:7,class:"body-chip"},Vfe={class:"chip-label"},Kfe={class:"chip-value"},Gfe={key:0,class:"chip-detail"},Yfe={key:8,class:"body-todo"},Zfe={class:"todo-glyph"},Xfe={key:9,class:"body-plan"},Qfe={key:10,class:"body-generic"},Jfe={class:"gen-text"},ehe={key:11,class:"feedback-wrap"},the=["placeholder"],nhe={class:"feedback-hint"},ohe={key:0,class:"plan-actions"},she={key:1,class:"abtn"},ihe=Je({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>{const N=n.block;return N.kind!=="plan_review"?null:{plan:N.plan,path:N.path,options:N.options??[]}}),r=oe(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const N=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${N}`)}const c=oe(!1),u=oe(""),d=oe(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const N=u.value.trim();i.value?y("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:N||void 0}):y("feedback",{decision:"rejected",feedback:N||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function m(N){N.key==="Enter"&&!N.shiftKey?(N.preventDefault(),h()):N.key==="Escape"&&(N.preventDefault(),p())}const k=oe(null);et(()=>n.busy,N=>{N||(k.value=null)});function y(N,F){n.busy||(k.value=N,o("decide",F))}function g(){y("approve",{decision:"approved"})}function v(){y("approveSession",{decision:"approved",scope:"session"})}function b(){y("reject",{decision:"rejected"})}function A(){y("approvePlan",{decision:"approved"})}function I(N){y(`option:${N}`,{decision:"approved",selectedLabel:N})}function T(){n.busy||f()}function M(){y("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function $(N){const F=(document.activeElement?.tagName??"").toLowerCase();if(F==="input"||F==="textarea"||n.busy||r.value)return;const S=i.value;if(S){if(S.options.length===0){N.key==="1"?(N.preventDefault(),A()):N.key==="2"?(N.preventDefault(),T()):N.key==="3"&&(N.preventDefault(),M());return}N.key==="1"&&S.options[0]?(N.preventDefault(),I(S.options[0].label)):N.key==="2"&&S.options[1]?(N.preventDefault(),I(S.options[1].label)):N.key==="3"&&S.options[2]&&(N.preventDefault(),I(S.options[2].label));return}N.key==="1"?(N.preventDefault(),g()):N.key==="2"?(N.preventDefault(),v()):N.key==="3"?(N.preventDefault(),b()):N.key==="4"&&(N.preventDefault(),f())}return Cn(()=>document.addEventListener("keydown",$)),$n(()=>document.removeEventListener("keydown",$)),(N,F)=>(x(),Se(ab,{class:Ue(["appr",{minimized:r.value}])},zA({head:Ie(()=>[w("div",vfe,[F[2]||(F[2]=w("span",{class:"ah-ic"},"!",-1)),w("span",yfe,B(a()),1),w("span",kfe,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(x(),E(We,{key:0},[ot(B(e.block.path),1)],64)):e.block.kind==="shell"?(x(),E(We,{key:1},[ot(B(e.block.command),1)],64)):e.block.kind==="url"?(x(),E(We,{key:2},[ot(B(e.block.url),1)],64)):e.block.kind==="search"?(x(),E(We,{key:3},[ot(B(e.block.query),1)],64)):e.block.kind==="invocation"?(x(),E(We,{key:4},[ot(B(e.block.name),1)],64)):e.block.kind==="generic"?(x(),E(We,{key:5},[ot(B(e.block.summary),1)],64)):ue("",!0)]),e.agentName&&!r.value?(x(),Se(qi,{key:0,variant:"neutral",size:"sm"},{default:Ie(()=>[ot(B(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ue("",!0),r.value?ue("",!0):(x(),Se(qi,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ie(()=>[ot(B(C(s)("approval.required")),1)]),_:1})),ae(Xn,{class:"amin",size:"sm",label:r.value?C(s)("question.expand"):C(s)("question.minimize"),onClick:F[0]||(F[0]=S=>r.value=!r.value)},{default:Ie(()=>[r.value?(x(),Se(Ge,{key:0,name:"chevron-up",size:"md"})):(x(),Se(Ge,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ie(()=>[e.block.kind==="plan_review"&&e.block.path?(x(),Se(an,{key:0,text:e.block.path},{default:Ie(()=>[w("div",bfe,B(e.block.path),1)]),_:1},8,["text"])):ue("",!0),e.block.kind==="diff"?(x(),E("div",xfe,[(x(!0),E(We,null,rt(e.block.diff,(S,R)=>(x(),E("div",{key:R,class:Ue(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[w("span",wfe,B(S.gutter),1),w("span",_fe,B(S.text),1)],2))),128))])):e.block.kind==="shell"?(x(),E("div",Sfe,[w("div",Cfe,[F[3]||(F[3]=w("span",{class:"shell-dollar"},"$",-1)),ot(" "+B(e.block.command),1)]),e.block.cwd?(x(),E("div",Afe,"cwd: "+B(e.block.cwd),1)):ue("",!0),e.block.danger?(x(),E("div",Mfe,B(C(s)("approval.danger",{detail:e.block.danger})),1)):ue("",!0)])):e.block.kind==="file"?(x(),E("div",Efe,[w("div",Tfe,[w("span",Nfe,B(e.block.language??""),1)]),w("div",Ife,[(x(!0),E(We,null,rt(e.block.content.split(`
309
+ `),(S,R)=>(x(),E("div",{key:R,class:"file-line"},[w("span",Lfe,B(R+1),1),w("span",$fe,B(S),1)]))),128))])])):e.block.kind==="fileop"?(x(),E("div",Ffe,[w("span",Ofe,B(e.block.op),1),w("span",Bfe,B(e.block.path),1),e.block.detail?(x(),E("span",Rfe,B(e.block.detail),1)):ue("",!0)])):e.block.kind==="url"?(x(),E("div",Dfe,[e.block.method?(x(),E("span",Pfe,B(e.block.method),1)):ue("",!0),w("span",Hfe,B(e.block.url),1)])):e.block.kind==="search"?(x(),E("div",Wfe,[w("span",zfe,B(C(s)("approval.searchQueryLabel")),1),w("span",Ufe,B(e.block.query),1),e.block.scope?(x(),E("span",qfe,B(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ue("",!0)])):e.block.kind==="invocation"?(x(),E("div",jfe,[w("span",Vfe,B(e.block.kind2),1),w("span",Kfe,B(e.block.name),1),e.block.description?(x(),E("span",Gfe,B(e.block.description),1)):ue("",!0)])):e.block.kind==="todo"?(x(),E("div",Yfe,[(x(!0),E(We,null,rt(e.block.items,(S,R)=>(x(),E("div",{key:R,class:"todo-item"},[w("span",Zfe,B(S.status==="done"||S.status==="completed"?"✓":"○"),1),w("span",{class:Ue(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},B(S.title),3)]))),128))])):e.block.kind==="plan_review"?(x(),E("div",Xfe,[ae(X1,{text:e.block.plan},null,8,["text"])])):(x(),E("div",Qfe,[w("span",Jfe,B(e.block.summary),1)])),c.value?(x(),E("div",ehe,[qn(w("textarea",{ref_key:"feedbackRef",ref:d,"onUpdate:modelValue":F[1]||(F[1]=S=>u.value=S),class:"feedback-ta",placeholder:C(s)("approval.feedbackPlaceholder"),rows:"2",onKeydown:m},null,40,the),[[Cs,u.value]]),w("div",nhe,B(C(s)("approval.feedbackHint")),1)])):ue("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ie(()=>[i.value?(x(),E("div",ohe,[i.value.options.length>0?(x(!0),E(We,{key:0},rt(i.value.options,(S,R)=>(x(),Se(an,{key:R,text:S.description},{default:Ie(()=>[ae(jt,{class:"kbtn",size:"sm",variant:"primary",loading:k.value===`option:${S.label}`,disabled:e.busy,onClick:z=>I(S.label)},{default:Ie(()=>[ot(B(S.label),1),ae(Er,{class:"k",keys:[String(R+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(x(),Se(jt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:k.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ie(()=>[ot(B(C(s)("approval.approvePlan")),1),ae(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:T},{default:Ie(()=>[ot(B(C(s)("approval.revise")),1),i.value.options.length===0?(x(),Se(Er,{key:0,class:"k",keys:["2"]})):ue("",!0)]),_:1},8,["disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:k.value==="rejectAndExit",disabled:e.busy,onClick:M},{default:Ie(()=>[ot(B(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(x(),Se(Er,{key:0,class:"k",keys:["3"]})):ue("",!0)]),_:1},8,["loading","disabled"])])):(x(),E("div",she,[ae(jt,{class:"kbtn",size:"sm",variant:"primary",loading:k.value==="approve",disabled:e.busy,onClick:g},{default:Ie(()=>[ot(B(C(s)("approval.approve")),1),ae(Er,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:k.value==="approveSession",disabled:e.busy,onClick:v},{default:Ie(()=>[ot(B(C(s)("approval.approveSession")),1),ae(Er,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",loading:k.value==="reject",disabled:e.busy,onClick:b},{default:Ie(()=>[ot(B(C(s)("approval.reject")),1),ae(Er,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),ae(jt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ie(()=>[ot(B(C(s)("approval.feedback")),1),ae(Er,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),rhe=dt(ihe,[["__scopeId","data-v-458a9d7d"]]),lhe=Je({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(x(),E("span",{class:Ue(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},B(n[t.status]),3))}}),GE=dt(lhe,[["__scopeId","data-v-f595d935"]]),ahe={class:"taskspane"},che={class:"tp-head"},uhe={class:"tp-title"},dhe={class:"tp-count"},fhe={class:"tp-list"},hhe={key:0,class:"tp-empty"},phe=["role","onClick"],mhe={class:"tp-name"},ghe={class:"tp-time"},vhe=["onClick"],yhe={key:0,class:"tp-detail"},khe={key:0,class:"tp-codebox"},bhe=["onClick"],xhe={class:"tp-pre"},whe={class:"tp-cmd"},_he={key:1,class:"tp-codebox"},She=["onClick"],Che={class:"tp-pre"},Ahe=Je({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=$t(),s=zo(new Set),i=zo(new Set),r=zo(new Set);function l(p){return!!(p.output&&p.output.length>0||p.meta)}function a(p){if(p.kind==="subagent"){n("open",p.id);return}l(p)&&(s.has(p.id)?s.delete(p.id):s.add(p.id))}function c(p){return p.kind==="subagent"||l(p)}function u(p){return p==="run"||p==="done"||p==="fail"?p:"pending"}async function d(p,m,k){await Jo(p)&&(k.add(m),setTimeout(()=>k.delete(m),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const m=p.output?.join(`
310
+ `)??"";m&&await d(m,p.id,r)}return(p,m)=>(x(),E("div",ahe,[w("div",che,[w("span",uhe,B(C(o)("tasks.tag")),1),w("span",dhe,B(e.tasks.length),1)]),w("div",fhe,[e.tasks.length===0?(x(),E("div",hhe,B(C(o)("tasks.emptyTasks")),1)):(x(!0),E(We,{key:1},rt(e.tasks,k=>(x(),E("div",{key:k.id,class:Ue(["tp-row",{done:k.state==="done",fail:k.state==="fail",expandable:c(k)}])},[w("div",{class:"tp-main",role:c(k)?"button":void 0,onClick:y=>a(k)},[ae(GE,{status:u(k.state)},null,8,["status"]),w("span",mhe,B(k.name),1),ae(qi,{variant:"neutral",size:"sm"},{default:Ie(()=>[ot(B(k.kind),1)]),_:2},1024),w("span",ghe,B(k.timing),1),k.state==="run"?(x(),E("button",{key:0,class:"tp-stop",onClick:St(y=>n("cancel",k.id),["stop"])},B(C(o)("tasks.stop")),9,vhe)):ue("",!0),k.kind==="subagent"?(x(),Se(Ge,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(k)?(x(),Se(Ge,{key:2,class:Ue(["tp-chevron",{open:s.has(k.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ue("",!0)],8,phe),s.has(k.id)&&l(k)?(x(),E("div",yhe,[k.meta?(x(),E("div",khe,[w("button",{class:Ue(["tp-copy",{copied:i.has(k.id)}]),onClick:St(y=>f(k),["stop"])},B(i.has(k.id)?"已复制":"复制"),11,bhe),w("pre",xhe,[w("code",null,[w("span",whe,B(k.meta),1)])])])):ue("",!0),k.output&&k.output.length>0?(x(),E("div",_he,[w("button",{class:Ue(["tp-copy",{copied:r.has(k.id)}]),onClick:St(y=>h(k),["stop"])},B(r.has(k.id)?"已复制":"复制"),11,She),w("pre",Che,[w("code",null,[m[0]||(m[0]=ot(`
311
+ `,-1)),(x(!0),E(We,null,rt(k.output,(y,g)=>(x(),E("span",{key:g,class:"tp-line"},B(y),1))),128)),m[1]||(m[1]=ot(`
312
+ `,-1))])])])):ue("",!0)])):ue("",!0)],2))),128))])]))}}),I3=dt(Ahe,[["__scopeId","data-v-28fd5fc0"]]),Mhe={class:"todo-card"},Ehe={key:0,class:"tc-empty"},The={class:"tc-name"},Nhe=Je({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=$t();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(x(),E("div",Mhe,[t.todos.length===0?(x(),E("div",Ehe,[i[0]||(i[0]=w("svg",{class:"tc-empty-ico",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M9 11l2 2 4-4"}),w("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),w("span",null,B(C(n)("tasks.emptyTodo")),1)])):ue("",!0),(x(!0),E(We,null,rt(t.todos,(r,l)=>(x(),E("div",{key:l,class:Ue(["tc-row",`s-${r.status}`])},[ae(GE,{status:o(r.status)},null,8,["status"]),w("span",The,B(r.title),1)],2))),128))]))}}),Ihe=dt(Nhe,[["__scopeId","data-v-01c65735"]]),Lhe={class:"dock-work-head"},$he={key:0,class:"dock-work-tab static"},Fhe={key:1,class:"dock-work-tab static"},Ohe={key:2,class:"dock-work-tab static"},Bhe={class:"dock-work-body"},Rhe={class:"dw-count"},Dhe={class:"dw-count"},Phe={class:"dw-count"},Hhe=Je({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},starting:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},questionBusyKind:{},pendingApproval:{},approvalBusy:{type:Boolean},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel","openAgent"],setup(e,{expose:t,emit:n}){const o=e,s=n,{t:i}=$t(),r=oe(null),l=oe(null),a=oe(null),c=oe(null);function u(k){return r.value?(r.value.loadForEdit(k),!0):!1}function d(k){r.value?.loadAttachmentsForEdit(k)}function f(){r.value?.focus()}function h(k){if(!o.dockPanel)return;const y=k.target;y&&(l.value?.contains(y)||a.value?.contains(y)||s("close-dock-panel"))}et(()=>o.dockPanel,k=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),k&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function m(){const k=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${k}px`)}return Cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(m),p.observe(c.value),m())}),$n(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(k,y)=>(x(),E("div",{ref_key:"dockRef",ref:c,class:Ue(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:y[28]||(y[28]=St(()=>{},["stop"]))},[ae(Ua,{name:"dock-panel"},{default:Ie(()=>[e.dockPanel?(x(),E("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:y[3]||(y[3]=St(()=>{},["stop"]))},[w("div",Lhe,[e.dockPanel==="bash"?(x(),E("span",$he,B(C(i)("tasks.dockBash"))+" · "+B(e.bashRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(x(),E("span",Fhe,B(C(i)("tasks.dockSubagent"))+" · "+B(e.subagentRunning)+" "+B(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(x(),E("span",Ohe,B(C(i)("tasks.dockTodos"))+" · "+B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1)):ue("",!0)]),w("div",Bhe,[e.dockPanel==="bash"?(x(),Se(I3,{key:0,tasks:e.bashTasks,onCancel:y[0]||(y[0]=g=>s("cancelTask",g))},null,8,["tasks"])):e.dockPanel==="subagent"?(x(),Se(I3,{key:1,tasks:e.subagentTasks,onCancel:y[1]||(y[1]=g=>s("cancelTask",g)),onOpen:y[2]||(y[2]=g=>s("openAgent",g))},null,8,["tasks"])):e.dockPanel==="todos"?(x(),Se(Ihe,{key:2,todos:e.todos??[]},null,8,["todos"])):ue("",!0)])],512)):ue("",!0)]),_:1}),e.goal?(x(),Se(Ude,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:y[4]||(y[4]=g=>s("controlGoal",g))},null,8,["goal","force-expanded"])):ue("",!0),e.hasDockWork?(x(),E("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(x(),Se(xp,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:y[5]||(y[5]=g=>s("toggle-dock-panel","bash"))},{default:Ie(()=>[ae(Ge,{name:"clock",size:"md"}),w("span",null,B(C(i)("tasks.dockBash")),1),w("span",Rhe,[y[29]||(y[29]=ot("(",-1)),w("b",null,B(e.bashTasks.length),1),y[30]||(y[30]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),e.subagentTasks.length>0?(x(),Se(xp,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:y[6]||(y[6]=g=>s("toggle-dock-panel","subagent"))},{default:Ie(()=>[ae(Ge,{name:"sparkles",size:"md"}),w("span",null,B(C(i)("tasks.dockSubagent")),1),w("span",Dhe,[y[31]||(y[31]=ot("(",-1)),w("b",null,B(e.subagentTasks.length),1),y[32]||(y[32]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0),(e.todos?.length??0)>0?(x(),Se(xp,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:y[7]||(y[7]=g=>s("toggle-dock-panel","todos"))},{default:Ie(()=>[ae(Ge,{name:"check-list",size:"md"}),w("span",null,B(C(i)("tasks.dockTodos")),1),w("span",Phe,[y[33]||(y[33]=ot("(",-1)),w("b",null,B(e.todoDoneCount)+"/"+B(e.todos?.length??0),1),y[34]||(y[34]=ot(")",-1))])]),_:1},8,["active","aria-pressed"])):ue("",!0)],512)):ue("",!0),e.pendingQuestion?(x(),Se(gfe,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:y[8]||(y[8]=(g,v)=>s("answer",g,v)),onDismiss:y[9]||(y[9]=g=>s("dismiss",g))},null,8,["question","busy-kind"])):e.pendingApproval?(x(),Se(rhe,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:y[10]||(y[10]=g=>s("approval",e.pendingApproval.approvalId,g))},null,8,["block","agent-name","busy"])):(x(),Se(KE,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,onSubmit:y[11]||(y[11]=g=>s("submit",g)),onSteer:y[12]||(y[12]=g=>s("steer",g)),onCommand:y[13]||(y[13]=g=>s("command",g)),onInterrupt:y[14]||(y[14]=g=>s("interrupt")),onSetPermission:y[15]||(y[15]=g=>s("setPermission",g)),onSetThinking:y[16]||(y[16]=g=>s("setThinking",g)),onTogglePlan:y[17]||(y[17]=g=>s("togglePlan")),onToggleSwarm:y[18]||(y[18]=g=>s("toggleSwarm")),onToggleGoal:y[19]||(y[19]=g=>s("toggleGoal")),onOpenBtw:y[20]||(y[20]=g=>s("openBtw")),onCreateGoal:y[21]||(y[21]=g=>s("createGoal",g)),onControlGoal:y[22]||(y[22]=g=>s("controlGoal",g)),onFocusGoal:y[23]||(y[23]=g=>s("focusGoal")),onFocusSwarm:y[24]||(y[24]=g=>s("focusSwarm")),onCompact:y[25]||(y[25]=g=>s("compact")),onPickModel:y[26]||(y[26]=g=>s("pickModel")),onSelectModel:y[27]||(y[27]=g=>s("selectModel",g))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]))],2))}}),Whe=dt(Hhe,[["__scopeId","data-v-9e5ec0f2"]]),zhe=["aria-label","aria-hidden"],Uhe={class:"toc-scroll"},qhe=["onClick"],jhe={class:"toc-label"},Vhe=240,Khe=Je({__name:"ConversationToc",props:{items:{},activeTurnId:{},mobile:{type:Boolean},sessionLoading:{type:Boolean},occluded:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=oe(null),r=oe(!0);let l=null;function a(){const u=i.value,d=u?.offsetParent;if(!u||!d)return;const f=u.getBoundingClientRect().left,h=d.getBoundingClientRect().right;r.value=h-f>=Vhe}const c=D(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return et(c,u=>{l?.disconnect(),l=null,u&&yt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),ho(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(x(),E("nav",{key:0,ref_key:"navRef",ref:i,class:Ue(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[w("div",Uhe,[(x(!0),E(We,null,rt(e.items,f=>(x(),E("button",{key:f.id,type:"button",class:Ue(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=w("span",{class:"toc-bar"},null,-1)),w("span",jhe,B(f.title),1)],10,qhe))),128))])],10,zhe)):ue("",!0)}}),Ghe=dt(Khe,[["__scopeId","data-v-3f1c1f66"]]),Yhe=5;function Zhe(e,t,n,o=Yhe){if(n||e.length<=o)return e;const s=e.slice(0,o);if(t&&!s.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(s[o-1]=i)}return s}const Xhe={class:"chat-layout"},Qhe={class:"empty-hint"},Jhe={key:0,class:"empty-hint-text"},epe={key:1,class:"ws-pick"},tpe={class:"ws-pick-name"},npe={key:1,class:"ws-pick-menu"},ope=["onClick"],spe={class:"ws-pick-item-name"},ipe={class:"ws-pick-item-path"},rpe=["aria-label"],lpe={key:0,class:"abort-toast",role:"status","aria-live":"polite"},ape={class:"abort-toast-text"},Lv=80,L3=1e3,cpe=420,upe=3e3,dpe=Je({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},pendingQuestionActions:{},pendingApprovalActions:{},running:{type:Boolean},turnActive:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},working:{type:Boolean},starting:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},conversationToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","reorderQueue","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openToolDiff","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession","exportSession"],setup(e,{expose:t,emit:n}){const{t:o}=$t(),s=e,i=n,r=oe(!1),l=oe(!1),a=D(()=>s.workspaces?.find(Me=>Me.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=D(()=>(s.workspaces?.length??0)>0),u=D(()=>Zhe(s.workspaces??[],s.activeWorkspaceId,l.value)),d=D(()=>(s.workspaces?.length??0)-u.value.length);et(r,ge=>{ge||(l.value=!1)});function f(ge){r.value=!1,ge!==s.activeWorkspaceId&&i("selectWorkspace",ge)}qa(Dt.contentAlign);const h=oe(null),p=oe(null),m=oe(null),k=oe(!1),y=oe(0);let g=null;function v(ge,Me){const ze=m.value??p.value;return!ze||ze.loadForEdit(ge)===!1?!1:(ze.loadAttachmentsForEdit(Me??[]),!0)}function b(){k.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,k.value=!1},2e3)}function A(){y.value++}const I=D(()=>s.tasks.filter(ge=>ge.kind!=="subagent")),T=D(()=>s.tasks.filter(ge=>ge.kind==="subagent"&&ge.runInBackground)),M=D(()=>I.value.filter(ge=>ge.state==="run").length),$=D(()=>T.value.filter(ge=>ge.state==="run").length);function N(ge){const Me=s.tasks,ze=Me.find(Ut=>Ut.id===ge)??Me.find(Ut=>Ut.parentToolCallId===ge);if(ze)return ze.id;const Ht=Me.filter(Ut=>Ut.kind==="subagent"&&!Ut.parentToolCallId);if(Ht.length===1)return Ht[0].id}In("resolveAgentTaskId",N),In("pinScroll",to);const F=D(()=>(s.todos??[]).filter(ge=>ge.status==="done").length),S=D(()=>I.value.length>0||T.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),R=oe(null),z=D(()=>s.gitInfo?s.changes?.length??0:0);function W(ge){R.value=R.value===ge?null:ge}function L(){R.value=null}et(S,ge=>{ge||L()});function O(ge){if(ge.role==="compaction")return o("conversation.compactedPlain");if(ge.role==="user"){if(ge.skillActivation)return`/${ge.skillActivation.name}`;if(ge.pluginCommand)return`/${ge.pluginCommand.pluginId}:${ge.pluginCommand.commandName}`;const ze=ge.text.trim().replaceAll(/\s+/g," ");return ze.length>0?ze:"user"}const Me=(ge.text||ge.thinking||"").trim().replaceAll(/\s+/g," ");return Me.length>0?Me:(ge.tools?.length??0)>0?`${ge.tools.length} tools`:"kimi"}const U=D(()=>s.turns.filter(ge=>ge.role==="user").map((ge,Me)=>({id:ge.id,role:ge.role,no:Me+1,title:O(ge)}))),Z=oe(null);function ie(){const ge=Ae.value;if(!ge)return;const Me=ge.querySelectorAll(".turn-anchor[data-turn-id]");if(Me.length===0)return;const ze=U.value;if(ze.length===0)return;const Ht=new Set(ze.map(us=>us.id));if(pe()<=Lv){Z.value=ze[ze.length-1].id;return}const Ut=ge.getBoundingClientRect(),xn=Ut.height/2;let go=null;Me.forEach(us=>{const te=us.dataset.turnId;if(!te||!Ht.has(te))return;us.getBoundingClientRect().top-Ut.top<=xn&&(go=te)}),Z.value=go??ze[0].id}const q=oe(!1);let ee=0;function fe(){ee||(ee=Kt(()=>{ee=0,ne()}))}function ne(){const ge=Ae.value,Me=!s.mobile&&s.conversationToc&&ge?ge.closest(".con")?.querySelector(".conversation-toc"):null,ze=Me?.querySelector(".toc-bar");let Ht=!1;if(ge&&Me&&ze){const Ut=ze.getBoundingClientRect(),xn=Me.getBoundingClientRect(),go=Ut.left+Ut.width/2;Ht=Array.from(ge.querySelectorAll(".table-node-wrapper")).some(us=>{const te=us.getBoundingClientRect();return te.left<=go&&go<=te.right&&te.top<xn.bottom&&te.bottom>xn.top})}q.value!==Ht&&(q.value=Ht)}const j=D(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),K=D(()=>{const ge=j.value;if(ge)return s.pendingQuestionActions?.[ge.questionId]}),ve=D(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),he=D(()=>{const ge=ve.value;return ge?!!s.pendingApprovalActions?.[ge.approvalId]:!1}),Ae=oe(null),re=oe(null),Y=oe(0),Q=oe(0),P=D(()=>({"--panes-scrollbar-width":`${Y.value}px`}));function G(ge){return ge instanceof HTMLElement?ge:ge&&"$el"in ge&&ge.$el instanceof HTMLElement?ge.$el:null}function me(){const ge=Ae.value;Y.value=ge?Math.max(0,ge.offsetWidth-ge.clientWidth):0,Q.value=re.value?.offsetHeight??0}function ye(ge){const Me=G(ge);Ae.value=Me,Me&&ts()}function de(ge){const Me=G(ge);re.value=Me??null,ge&&"loadForEdit"in ge&&typeof ge.loadForEdit=="function"&&"focus"in ge&&typeof ge.focus=="function"?m.value={loadForEdit:ge.loadForEdit.bind(ge),loadAttachmentsForEdit:"loadAttachmentsForEdit"in ge&&typeof ge.loadAttachmentsForEdit=="function"?ge.loadAttachmentsForEdit.bind(ge):()=>{},focus:ge.focus.bind(ge)}:m.value=null,Vs()}const V=oe(!0),se=oe(!1);function pe(){const ge=Ae.value;return ge?ge.scrollHeight-ge.scrollTop-ge.clientHeight:0}let ke=0,Ne=0,qe=0,be=0,xe=0,Ze=0;function tt(){return Date.now()<Ne}function lt(){fe();const ge=Ae.value;if(!ge)return;const Me=ge.scrollTop;if(mn()){ke=Me;return}if(performance.now()-qe<100){ke=Me;return}const ze=pe();if(tt()){V.value=!0,se.value=!1,ke=Me;return}Me<ke-1&&ze>1?(V.value=!1,se.value=!0):ze<=Lv&&Me>ke+1&&(V.value=!0,se.value=!1),ke=Me,ie()}function ut(ge=!1){const Me=Ae.value;V.value=!0,se.value=!1,Me&&(!ge&&performance.now()<be||(ge&&typeof Me.scrollTo=="function"?(qe=performance.now(),be=performance.now()+cpe,Me.scrollTo({top:Me.scrollHeight,behavior:"smooth"})):Me.scrollTop=Me.scrollHeight,ke=Me.scrollTop))}function mt(ge,Me){return(Me.closest("[inert]")?.closest(".tool-group")??Me).getBoundingClientRect().top-ge.getBoundingClientRect().top+ge.scrollTop}function Tt(ge,Me){const ze=Array.from(ge.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(xn=>({node:xn,top:mt(ge,xn)})),Ht=ze.findIndex(xn=>xn.top>=Me),Ut=Ht<0?Math.max(0,ze.length-1):Ht;return ze.slice(Ut,Ut+2).flatMap(xn=>{const go=xn.node.dataset.scrollAnchorId,us=go??xn.node.dataset.turnId;return us?[{kind:go?"tool":"turn",id:us,top:xn.top}]:[]})}const wt=new Map;function Ft(ge,Me){for(const ze of Me.anchors){const Ht=ze.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Ut=ge.querySelector(`[${Ht}="${Pt(ze.id)}"]`);if(Ut)return mt(ge,Ut)-ze.top}return ge.scrollHeight-Me.oldHeight}function en(ge,Me,ze=ge.scrollTop){return ge.scrollTop=ze+Ft(ge,Me),ke=ge.scrollTop,ge.scrollTop}async function Dn(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Uo.value||!s.hasMoreMessages)return;const ge=s.sessionId,Me=Ae.value,ze=Me?.scrollTop??0,Ht={anchors:Me?Tt(Me,ze):[],oldHeight:Me?.scrollHeight??0};As(ge,!0),qo();try{if(await yt(),await s.loadOlderMessages(ge),await yt(),s.sessionId!==ge){wt.set(ge,Ht);return}const Ut=Ae.value;if(!Ut)return;en(Ut,Ht),wt.delete(ge)}finally{As(ge,!1)}}function Pt(ge){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ge):ge.replaceAll(/["\\]/g,"\\$&")}function kn(ge){const Me=Ae.value;if(!Me)return;const ze=Me.querySelector(`.turn-anchor[data-turn-id="${Pt(ge)}"]`);ze&&(Bo(),V.value=!1,se.value=pe()>Lv,ze.scrollIntoView({behavior:"smooth",block:"center"}))}function hn(){const ge=Ae.value;if(!ge)return"none";const Me=ge.firstElementChild,ze=Me instanceof HTMLElement?Me.offsetHeight:0,Ht=re.value?.offsetHeight??0;return`${ge.scrollHeight}:${ge.clientHeight}:${ze}:${Ht}`}function Kt(ge){return typeof requestAnimationFrame=="function"?requestAnimationFrame(ge):setTimeout(ge,16)}function Tn(ge){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(ge):clearTimeout(ge)}let Gt=0,Wt=0,pn=null,so=0;function mn(){return performance.now()<Gt}function to(ge,Me=260){const ze=Ae.value;if(!ze||(pn=ge,so=ge.getBoundingClientRect().top,Gt=performance.now()+Me,Wt))return;const Ht=()=>{if(Wt=0,performance.now()>=Gt||!pn){pn=null;return}const Ut=pn.getBoundingClientRect().top-so;Ut&&(ze.scrollTop+=Ut),Wt=Kt(Ht)};Wt=Kt(Ht)}function vt(ge=36){if(!V.value&&!tt())return;const Me=++Ze;let ze="",Ht=0,Ut=0;xe&&(Tn(xe),xe=0);const xn=()=>{if(xe=0,Me!==Ze||!V.value&&!tt())return;ut(!1);const go=hn();Ht=go===ze?Ht+1:0,ze=go,Ut++,Ht<3&&Ut<ge&&(xe=Kt(xn))};xe=Kt(xn)}function Pn(ge,Me){return ge!==void 0&&ge.length>0&&Me.length>=ge.length&&ge.firstId!==Me.firstId&&ge.lastId===Me.lastId&&ge.lastTextLen===Me.lastTextLen&&ge.lastThinkingLen===Me.lastThinkingLen&&ge.lastToolsLen===Me.lastToolsLen&&ge.approvalIds===Me.approvalIds}const Fn=D(()=>{const ge=(s.approvals??[]).map(xn=>xn.approvalId).join(","),Me=s.turns,ze=Me.at(-1),Ht=ze?.thinking?.length??0,Ut=ze?.tools?.reduce((xn,go)=>xn+go.name.length+(go.arg?.length??0)+(go.output?.join("").length??0),0)??0;return{length:Me.length,firstId:Me[0]?.id??"",lastId:ze?.id??"",lastTextLen:ze?.text.length??0,lastThinkingLen:Ht,lastToolsLen:Ut,approvalIds:ge}});et(Fn,async(ge,Me)=>{if(Uo.value&&Pn(Me,ge)){ie();return}await yt(),V.value||tt()?ut(ge.length<Me.length):se.value=!0,ie()}),et(re,()=>{Vs()}),et(()=>s.mobile,async()=>{await yt(),me()});const Qn=new Map;et(()=>s.fileReloadKey,async(ge,Me)=>{const ze=Ae.value;Me&&ze&&Qn.set(String(Me),{top:ze.scrollTop,following:V.value}),Bo(),await yt();const Ht=Ae.value,Ut=ge?Qn.get(String(ge)):void 0;if(Ut&&Ht){const xn=wt.get(String(ge)),go=xn?en(Ht,xn,Ut.top):Ut.top;xn&&wt.delete(String(ge)),V.value=Ut.following,Ht.scrollTop=go,ke=Ht.scrollTop,se.value=!Ut.following&&pe()>1,Ut.following&&vt()}else V.value=!0,ke=0,ut(!1),vt();ie()}),et(()=>s.sessionLoading,async(ge,Me)=>{ge||!Me||(V.value=!0,await yt(),vt(),ie())}),et(()=>s.turnActive,async(ge,Me)=>{ge||!Me||!V.value&&!tt()||(await yt(),vt(48),ie())});function sn(){V.value=!0,se.value=!1,Ne=Date.now()+L3,yt(()=>{ut(!0),vt(16)})}function es(ge){sn(),i("submit",ge)}function nt(ge){V.value=!0,se.value=!1,Ne=Date.now()+L3,i("editMessage",ge)}function Be(ge){const Me=s.queued?.[ge],ze=Me?.text??"";v(ze,Me?.attachments)&&i("editQueued",ge)}function Bt(ge){i("reorderQueue",ge)}function Yt(ge,Me){sn(),i("answer",ge,Me)}function gn(ge,Me){!ge||!Me||i("approval",ge,Me)}let bn=null,nn=null,Vn=null,Kn=null,Jn=0,Oo=0,ko=0;const ai=oe(new Set),Uo=D(()=>!!s.sessionId&&ai.value.has(s.sessionId));function As(ge,Me){const ze=new Set(ai.value);Me?ze.add(ge):ze.delete(ge),ai.value=ze}function cs(){Uo.value||ko||(ko=Kt(()=>{ko=0,!Uo.value&&(mn()||(V.value||tt())&&ut(!1))}))}function qo(){Ze++,xe&&(Tn(xe),xe=0),ko&&(Tn(ko),ko=0)}function Bo(){const ge=Ae.value;if(Ne=0,qo(),Gt=0,pn=null,ge){const Me=ge.scrollTop;typeof ge.scrollTo=="function"?ge.scrollTo({top:Me,behavior:"auto"}):ge.scrollTop=Me}be=0,qe=Number.NEGATIVE_INFINITY,ge&&(ke=ge.scrollTop)}function ci(){const ge=Ae.value;!ge||ge.scrollHeight-ge.clientHeight<=1&&!s.hasMoreMessages||(V.value=!1,Bo(),ge.scrollHeight-ge.clientHeight>1&&(se.value=!0))}function tn(ge){const Me=Ae.value;if(!Me)return!1;for(const ze of ge.composedPath()){if(ze===Me)return!1;if(ze instanceof HTMLElement&&ze.scrollHeight>ze.clientHeight+1&&ze.scrollTop>1)return!0}return!1}function qs(ge){ge.defaultPrevented||ge.ctrlKey||ge.shiftKey||ge.deltaY>=0||tn(ge)||ci()}function io(ge){const Me=Ae.value;if(!Me||ge.defaultPrevented||ge.button!==0||ge.pointerType==="touch")return;const ze=Me.getBoundingClientRect(),Ht=Me.offsetWidth-Me.clientWidth,Ut=Ht>0?Ht:12;ge.target===Me&&ge.clientX>=ze.right-Ut&&ci()}let js=null;function ui(ge){js=ge.touches.length===1?ge.touches[0].clientY:null}function Ni(ge){const Me=ge.touches.length===1?ge.touches[0].clientY:null;Me!==null&&js!==null&&Me>js+2&&!tn(ge)&&ci(),js=Me}function di(){if(!nn)return;const ge=Ae.value?.firstElementChild??null;ge!==Vn&&(Vn&&nn.unobserve(Vn),Vn=ge,ge&&nn.observe(ge))}function Vs(){if(!nn)return;const ge=re.value;ge!==Kn&&(Kn&&nn.unobserve(Kn),Kn=ge,ge&&nn.observe(ge))}function ts(){const ge=Ae.value;me(),bn&&(bn.disconnect(),ge&&bn.observe(ge,{childList:!0,subtree:!0,characterData:!0})),nn&&(nn.disconnect(),Vn=null,Kn=null,ge&&nn.observe(ge),di(),Vs()),Jn=ge?.scrollHeight??0,Oo=ge?.clientHeight??0,fe()}function ns(){di(),cs(),fe()}function zt(){typeof document>"u"||document.visibilityState==="visible"&&V.value&&vt()}const Ms=oe(!1);let Io=null;function fi(){Ms.value=!0,Io!==null&&clearTimeout(Io),Io=setTimeout(()=>{Ms.value=!1},upe)}function Ke(){fi(),i("interrupt")}function Re(ge){ge.key==="Escape"&&(s.running||s.working)&&(ge.preventDefault(),Ke())}function le(){V.value&&cs()}Cn(()=>{yt(()=>{typeof MutationObserver=="function"&&(bn=new MutationObserver(ns)),typeof ResizeObserver=="function"&&(nn=new ResizeObserver(()=>{fe(),me();const ge=Ae.value;if(!ge)return;const{scrollHeight:Me,clientHeight:ze}=ge,Ht=Me>Jn+1,Ut=ze<Oo-1;Jn=Me,Oo=ze,!mn()&&(Ht||Ut)&&cs()})),ts(),vt(48),ie(),typeof document<"u"&&(document.addEventListener("visibilitychange",zt),document.addEventListener("keydown",Re)),window.visualViewport?.addEventListener("resize",le)})}),$n(()=>{bn&&bn.disconnect(),nn&&nn.disconnect(),ko&&Tn(ko),xe&&Tn(xe),Wt&&Tn(Wt),ee&&Tn(ee),Io!==null&&clearTimeout(Io),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",zt),document.removeEventListener("keydown",Re)),window.visualViewport?.removeEventListener("resize",le)});function Te(){(m.value??p.value)?.focus()}return t({loadComposerForEdit:v,focusComposer:Te}),(ge,Me)=>(x(),E("section",{class:Ue(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(x(),Se(iae,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":z.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:k.value,onOpenChanges:Me[0]||(Me[0]=ze=>i("openChanges")),onCopyAll:Me[1]||(Me[1]=ze=>h.value?.copyConversation()),onCopyFinalSummary:Me[2]||(Me[2]=ze=>h.value?.copyFinalSummary()),onOpenPr:Me[3]||(Me[3]=ze=>e.pr&&i("openPr",e.pr.url)),onRenameSession:Me[4]||(Me[4]=(ze,Ht)=>i("renameSession",ze,Ht)),onForkSession:Me[5]||(Me[5]=ze=>i("forkSession",ze)),onArchiveSession:Me[6]||(Me[6]=ze=>i("archiveSession",ze)),onExportSession:Me[7]||(Me[7]=ze=>i("exportSession",ze))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ue("",!0),e.conversationToc?(x(),Se(Ghe,{key:1,items:U.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:q.value,onSelect:kn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ue("",!0),w("div",Xhe,[w("div",{ref:ye,class:Ue(["panes chat-scroll",{"is-following":V.value,"history-prepending":Uo.value}]),onScrollPassive:lt,onWheelPassive:qs,onPointerdownPassive:io,onTouchstartPassive:ui,onTouchmovePassive:Ni},[w("div",{class:Ue(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(x(),E(We,{key:0},[Me[55]||(Me[55]=w("div",{class:"empty-spacer"},null,-1)),w("div",Qhe,[w("span",{class:Ue(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(x(),Se(Us,{key:0,size:"sm"})):ue("",!0),w("span",null,B(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ue("",!0):(x(),E("span",Jhe,B(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(x(),E("div",epe,[ae(an,{text:C(o)("conversation.switchWorkspace")},{default:Ie(()=>[w("button",{type:"button",class:"ws-pick-btn",onClick:Me[8]||(Me[8]=St(ze=>r.value=!r.value,["stop"]))},[ae(Ge,{name:"folder",size:"sm"}),w("span",tpe,B(a.value),1),ae(Ge,{class:Ue(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(x(),E("div",{key:0,class:"ws-pick-backdrop",onClick:Me[9]||(Me[9]=ze=>r.value=!1)})):ue("",!0),r.value?(x(),E("div",npe,[(x(!0),E(We,null,rt(u.value,ze=>(x(),E("button",{key:ze.id,type:"button",class:Ue(["ws-pick-item",{on:ze.id===e.activeWorkspaceId}]),onClick:St(Ht=>f(ze.id),["stop"])},[w("span",spe,B(ze.name),1),w("span",ipe,B(ze.shortPath),1)],10,ope))),128)),d.value>0?(x(),E("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:Me[10]||(Me[10]=St(ze=>l.value=!l.value,["stop"]))},[w("span",null,B(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ue("",!0),Me[54]||(Me[54]=w("div",{class:"ws-pick-divider"},null,-1)),w("button",{type:"button",class:"ws-pick-action",onClick:Me[11]||(Me[11]=St(ze=>{r.value=!1,i("addWorkspace")},["stop"]))},[ae(Ge,{name:"plus",size:"sm"}),w("span",null,B(C(o)("conversation.addWorkspace")),1)])])):ue("",!0)])):e.starting?ue("",!0):(x(),E("button",{key:2,type:"button",class:"empty-add-workspace",onClick:Me[12]||(Me[12]=ze=>i("addWorkspace"))},[ae(Ge,{name:"folder-plus",size:"sm"}),w("span",null,B(C(o)("conversation.addWorkspace")),1)]))]),ae(KE,{ref_key:"emptyComposerRef",ref:p,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,goal:e.goal,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,starting:e.starting,"hide-context":"",onSubmit:es,onSteer:Me[13]||(Me[13]=ze=>i("steer",ze)),onCommand:Me[14]||(Me[14]=ze=>i("command",ze)),onInterrupt:Ke,onUnqueue:Me[15]||(Me[15]=ze=>i("unqueue",ze)),onEditQueued:Me[16]||(Me[16]=ze=>i("editQueued",ze)),onSetPermission:Me[17]||(Me[17]=ze=>i("setPermission",ze)),onSetThinking:Me[18]||(Me[18]=ze=>i("setThinking",ze)),onTogglePlan:Me[19]||(Me[19]=ze=>i("togglePlan")),onToggleSwarm:Me[20]||(Me[20]=ze=>i("toggleSwarm")),onToggleGoal:Me[21]||(Me[21]=ze=>i("toggleGoal")),onOpenBtw:Me[22]||(Me[22]=ze=>i("command","/btw")),onCreateGoal:Me[23]||(Me[23]=ze=>i("createGoal",ze)),onControlGoal:Me[24]||(Me[24]=ze=>i("controlGoal",ze)),onFocusGoal:A,onCompact:Me[25]||(Me[25]=ze=>i("compact")),onPickModel:Me[26]||(Me[26]=ze=>i("pickModel")),onSelectModel:Me[27]||(Me[27]=ze=>i("selectModel",ze))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","goal","activation-badges","models","starred-ids","skills","starting"]),Me[56]||(Me[56]=w("div",{class:"empty-spacer"},null,-1))],64)):(x(),Se(RE,{ref_key:"chatPaneRef",ref:h,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,"turn-active":e.turnActive,working:e.working,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":V.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:Me[28]||(Me[28]=ze=>i("openFile",ze)),onOpenMedia:Me[29]||(Me[29]=ze=>i("openMedia",ze)),onCopyConversationCopied:b,onOpenThinking:Me[30]||(Me[30]=ze=>i("openThinking",ze)),onOpenCompaction:Me[31]||(Me[31]=ze=>i("openCompaction",ze)),onOpenAgent:Me[32]||(Me[32]=ze=>i("openAgent",ze)),onOpenToolDiff:Me[33]||(Me[33]=ze=>i("openToolDiff",ze)),onEditMessage:nt,onLoadOlderMessages:Dn,onUnqueue:Me[34]||(Me[34]=ze=>i("unqueue",ze)),onEditQueued:Be,onReorderQueue:Bt},null,8,["turns","approvals","turn-active","working","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following","queued"]))],2)],34),e.turns.length===0&&!e.sessionLoading?ue("",!0):(x(),Se(Whe,{key:0,ref:de,style:on(P.value),"session-id":e.sessionId,running:e.running,starting:e.starting,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":y.value,"dock-panel":R.value,"bash-tasks":I.value,"subagent-tasks":T.value,"bash-running":M.value,"subagent-running":$.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":j.value,"question-busy-kind":K.value,"pending-approval":ve.value,"approval-busy":he.value,mobile:e.mobile,onToggleDockPanel:Me[35]||(Me[35]=ze=>W(ze)),onCloseDockPanel:Me[36]||(Me[36]=ze=>L()),onOpenAgent:Me[37]||(Me[37]=ze=>i("openAgent",ze)),onAnswer:Yt,onDismiss:Me[38]||(Me[38]=ze=>i("dismiss",ze)),onApproval:gn,onCancelTask:Me[39]||(Me[39]=ze=>i("cancelTask",ze)),onControlGoal:Me[40]||(Me[40]=ze=>i("controlGoal",ze)),onSubmit:es,onSteer:Me[41]||(Me[41]=ze=>i("steer",ze)),onCommand:Me[42]||(Me[42]=ze=>i("command",ze)),onInterrupt:Ke,onSetPermission:Me[43]||(Me[43]=ze=>i("setPermission",ze)),onSetThinking:Me[44]||(Me[44]=ze=>i("setThinking",ze)),onTogglePlan:Me[45]||(Me[45]=ze=>i("togglePlan")),onToggleSwarm:Me[46]||(Me[46]=ze=>i("toggleSwarm")),onToggleGoal:Me[47]||(Me[47]=ze=>i("toggleGoal")),onOpenBtw:Me[48]||(Me[48]=ze=>i("command","/btw")),onCreateGoal:Me[49]||(Me[49]=ze=>i("createGoal",ze)),onFocusGoal:A,onCompact:Me[50]||(Me[50]=ze=>i("compact")),onPickModel:Me[51]||(Me[51]=ze=>i("pickModel")),onSelectModel:Me[52]||(Me[52]=ze=>i("selectModel",ze))},null,8,["style","session-id","running","starting","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","question-busy-kind","pending-approval","approval-busy","mobile"]))]),ae(Ua,{name:"pill"},{default:Ie(()=>[se.value?(x(),E("button",{key:0,class:"newmsg-pill",style:on({bottom:`${Q.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:Me[53]||(Me[53]=ze=>ut(!0))},[ae(Ge,{class:"pill-chevron",name:"chevron-down",size:"md"}),ot(" "+B(C(o)("conversation.newMessages")),1)],12,rpe)):ue("",!0)]),_:1}),ae(Ua,{name:"abort-toast"},{default:Ie(()=>[Ms.value?(x(),E("div",lpe,[w("span",ape,B(C(o)("conversation.manuallyAborted")),1)])):ue("",!0)]),_:1})],2))}}),fpe=dt(dpe,[["__scopeId","data-v-68f9dafd"]]),hpe=["aria-selected","onClick"],ppe=Je({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("div",{class:Ue(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(x(!0),E(We,null,rt(e.options,i=>(x(),E("button",{key:i.value,class:Ue(["ui-seg__item",{"is-on":i.value===e.modelValue}]),type:"button",role:"tab","aria-selected":i.value===e.modelValue,onClick:r=>n("update:modelValue",i.value)},B(i.label),11,hpe))),128))],2))}}),ys=dt(ppe,[["__scopeId","data-v-d1aaccd7"]]),mpe={class:"ui-panel-header__title"},gpe={key:0,class:"ui-panel-header__sub"},vpe=Je({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-panel-header",{wrap:e.wrap}])},[w("span",mpe,B(e.title),1),ae(an,{text:e.subtitle},{default:Ie(()=>[e.subtitle?(x(),E("span",gpe,B(e.subtitle),1)):ue("",!0)]),_:1},8,["text"]),jn(t.$slots,"default",{},void 0,!0),e.closable?(x(),Se(Xn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"})]),_:1},8,["label"])):ue("",!0)],2))}}),Ya=dt(vpe,[["__scopeId","data-v-c47879ad"]]),ype={key:0,class:"fp-empty fp-error"},kpe={key:1,class:"fp-empty"},bpe={key:2,class:"fp-loading"},xpe={class:"fp-path"},wpe={class:"fp-meta"},_pe={key:0,class:"fp-lines"},Spe={class:"fp-size"},Cpe={key:3,class:"fp-search"},Ape=["placeholder"],Mpe={key:0,class:"fp-search-count"},Epe=["href","aria-label"],Tpe={key:1,class:"fp-code"},Npe={class:"fp-line-table"},Ipe=["data-line"],Lpe={class:"fp-gutter"},$pe=["innerHTML"],Fpe={key:1,class:"fp-body fp-code"},Ope={class:"fp-line-table"},Bpe=["data-line"],Rpe={class:"fp-gutter"},Dpe=["innerHTML"],Ppe={key:2,class:"fp-body"},Hpe=["srcdoc","title"],Wpe={key:1,class:"fp-code"},zpe={class:"fp-line-table"},Upe=["data-line"],qpe={class:"fp-gutter"},jpe=["innerHTML"],Vpe={key:3,class:"fp-body fp-pdf-wrap"},Kpe=["src","title"],Gpe={key:1,class:"fp-binary-card"},Ype={class:"fp-binary-label"},Zpe={key:4,class:"fp-body fp-table-wrap"},Xpe={class:"fp-table"},Qpe=["data-line"],Jpe={key:5,class:"fp-body fp-image-wrap"},eme=["src","alt"],tme={key:1,class:"fp-binary-card"},nme={class:"fp-binary-icon"},ome={class:"fp-binary-label"},sme={key:6,class:"fp-body fp-image-wrap"},ime=["src"],rme={key:1,class:"fp-binary-card"},lme={class:"fp-binary-icon"},ame={class:"fp-binary-label"},cme={key:7,class:"fp-body fp-code"},ume={class:"fp-line-table"},dme=["data-line"],fme={class:"fp-gutter"},hme=["innerHTML"],pme={key:8,class:"fp-body fp-binary-wrap"},mme={class:"fp-binary-card"},gme={class:"fp-binary-icon"},vme={class:"fp-binary-label"},yme=Je({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=$t();function o(re,Y){const Q=Y?Y.split("/").filter(Boolean):[];for(const P of re.split("/"))P===""||P==="."||(P===".."?Q.pop():Q.push(P));return Q.join("/")}const s=Jt("resolveImage",async re=>re),i=D(()=>{const re=c.file?.path??"",Y=re.lastIndexOf("/");return Y>0?re.slice(0,Y):""});function r(re){if(/^(https?:|data:|blob:)/i.test(re)||re.startsWith("/"))return re;const Y=i.value;return Y?o(re,Y):re}async function l(re){const Y=r(re);return s?s(Y):Y}In("resolveImage",l);function a(re){let Y=re.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(Y)||Y.startsWith("/"))return re;for(const P of["#","?"]){const G=Y.indexOf(P);G!==-1&&(Y=Y.slice(0,G))}const Q=i.value;return{...re,path:o(Y,Q)}}const c=e,u=t;function d(re){c.openFile?.(a(re))}const f=oe(null),h=D(()=>{const re=c.file;if(!re)return"binary";const Y=re.mime??"",Q=re.languageId??"",P=re.path.toLowerCase();return Y==="text/markdown"||Q==="markdown"||Q==="md"||P.endsWith(".mdx")?"markdown":Y==="application/json"||Q==="json"?"json":Y==="text/html"||Q==="html"||P.endsWith(".html")||P.endsWith(".htm")?"html":Y==="application/pdf"||P.endsWith(".pdf")?"pdf":Y==="text/csv"||Q==="csv"||P.endsWith(".csv")?"csv":Y.startsWith("image/")?"image":Y.startsWith("video/")?"video":re.isBinary?"binary":Y.startsWith("text/")||Q!==""?"text":"binary"});function p(re){const Y=atob(re),Q=Uint8Array.from(Y,P=>P.charCodeAt(0));return new TextDecoder().decode(Q)}const m=D(()=>{const re=c.file;if(!re)return"";if(re.encoding==="base64")try{return p(re.content)}catch{return re.content}return re.content}),k=D(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(m.value),null,2)}catch{return m.value}}),y=D(()=>c.file?(h.value==="json"?k.value:m.value).split(`
313
+ `):[]),g=D(()=>c.file?h.value==="json"?k.value:m.value:""),v=oe(""),b=oe(0),A=D(()=>{const re=v.value.trim().toLowerCase();if(!re)return[];const Y=[];return y.value.forEach((Q,P)=>{Q.toLowerCase().includes(re)&&Y.push(P+1)}),Y});et(v,()=>{b.value=0});function I(re,Y=!1){re&&yt(()=>{const Q=f.value?.querySelector(".fp-body"),P=Q?.querySelector(`[data-line="${re}"]`);if(!Q||!P)return;Y&&(Q.scrollTop=0);const G=Q.getBoundingClientRect(),me=P.getBoundingClientRect(),ye=me.top-G.top+Q.scrollTop;Q.scrollTop=ye-Q.clientHeight/2+me.height/2})}et(()=>[c.file?.path,c.line],()=>I(c.line,!0),{immediate:!0});function T(re){const Y=A.value;Y.length!==0&&(b.value=(b.value+re+Y.length)%Y.length,I(Y[b.value]))}function M(re){const Y=A.value;return{target:c.line===re,hit:Y.includes(re),active:Y[b.value]===re}}function $(re){return re<1024?`${re} B`:re<1024*1024?`${(re/1024).toFixed(1)} KB`:`${(re/(1024*1024)).toFixed(1)} MB`}const N=oe(!1),F=oe(!1);function S(){c.file&&Jo(g.value).then(re=>{re&&(N.value=!0,setTimeout(()=>{N.value=!1},1400))})}function R(){c.file&&Jo(c.file.path).then(re=>{re&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const z=oe("preview"),W=oe("preview"),L=oe("fit");function O(re){z.value=re}function U(re){W.value=re}function Z(re){L.value=re}et(h,re=>{z.value=re==="html"?"preview":"source",W.value="preview",L.value="fit"});const ie=D(()=>{const re=c.file;return!re||h.value!=="image"?null:re.sourceUrl?re.sourceUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:re.mime==="image/svg+xml"?`data:${re.mime};charset=utf-8,${encodeURIComponent(re.content)}`:null}),q=D(()=>{const re=c.file;return!re||h.value!=="video"?null:re.sourceUrl?re.sourceUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:null}),ee=D(()=>{const re=c.file;return!re||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:re.encoding==="base64"?`data:${re.mime};base64,${re.content}`:null}),fe=D(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,m.value].join(""):"");function ne(re){const Y=[];let Q="",P=!1;for(let G=0;G<re.length;G++){const me=re[G];me==='"'&&re[G+1]==='"'?(Q+='"',G++):me==='"'?P=!P:me===","&&!P?(Y.push(Q),Q=""):Q+=me}return Y.push(Q),Y}const j=D(()=>y.value.slice(0,200).map(ne));function K(re){return re.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function ve(){const re=c.file;if(!re)return"";const Y=re.languageId?.toLowerCase();return Y||(re.path.split(".").pop()?.toLowerCase()??"")}function he(re){const Y=ve();let Q=K(re);return h.value==="json"||Y==="json"||Y==="jsonc"?(Q=Q.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),Q=Q.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),Q=Q.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),Q=Q.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),Q):h.value==="html"||Y==="html"||Y==="xml"||Y==="svg"?(Q=Q.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),Q=Q.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),Q):(Q=Q.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),Q=Q.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),Q=Q.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),Q)}function Ae(re,Y=55){return!re||re.length<=Y?re:"…"+re.slice(re.length-Y+1)}return(re,Y)=>(x(),E("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(x(),E("div",ype,[w("span",null,B(e.error),1),e.closable?(x(),Se(jt,{key:0,variant:"secondary",size:"sm",onClick:Y[0]||(Y[0]=Q=>u("close"))},{default:Ie(()=>[ot(B(C(n)("filePreview.close")),1)]),_:1})):ue("",!0)])):!e.file&&!e.loading?(x(),E("div",kpe,B(C(n)("filePreview.empty")),1)):e.loading?(x(),E("div",bpe,[Y[7]||(Y[7]=w("span",{class:"spinner"},null,-1)),w("span",null,B(C(n)("filePreview.loading")),1)])):e.file?(x(),E(We,{key:3},[ae(Ya,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:Y[6]||(Y[6]=Q=>u("close"))},{default:Ie(()=>[ae(an,{text:e.file.path},{default:Ie(()=>[w("span",xpe,B(Ae(e.file.path)),1)]),_:1},8,["text"]),w("span",wpe,[e.file.lineCount?(x(),E("span",_pe,B(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ue("",!0),w("span",Spe,B($(e.file.size)),1)]),h.value==="html"?(x(),Se(ys,{key:0,"model-value":z.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":O},null,8,["model-value","options"])):ue("",!0),h.value==="markdown"?(x(),Se(ys,{key:1,"model-value":W.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":U},null,8,["model-value","options"])):ue("",!0),h.value==="image"?(x(),Se(ys,{key:2,"model-value":L.value,size:"sm",options:[{value:"fit",label:C(n)("filePreview.fit")},{value:"actual",label:C(n)("filePreview.actual")}],"onUpdate:modelValue":Z},null,8,["model-value","options"])):ue("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(x(),E("div",Cpe,[qn(w("input",{"onUpdate:modelValue":Y[1]||(Y[1]=Q=>v.value=Q),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Ape),[[Cs,v.value]]),v.value.trim()?(x(),E("span",Mpe,B(A.value.length),1)):ue("",!0),ae(Xn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:Y[2]||(Y[2]=Q=>T(-1))},{default:Ie(()=>[ae(Ge,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),ae(Xn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:Y[3]||(Y[3]=Q=>T(1))},{default:Ie(()=>[ae(Ge,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ue("",!0),ae(Xn,{size:"sm",class:Ue({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:R},{default:Ie(()=>[F.value?(x(),Se(Ge,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Se(Ge,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(x(),Se(Xn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:Y[4]||(Y[4]=Q=>u("openExternal"))},{default:Ie(()=>[ae(Ge,{name:"external-link",size:"md"})]),_:1},8,["label"])):ue("",!0),e.externalActions?(x(),Se(Xn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:Y[5]||(Y[5]=Q=>u("reveal"))},{default:Ie(()=>[ae(Ge,{name:"folder",size:"md"})]),_:1},8,["label"])):ue("",!0),e.downloadUrl?(x(),E("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[ae(Ge,{name:"download",size:"md"})],8,Epe)):ue("",!0),!e.file.isBinary&&h.value!=="image"?(x(),Se(Xn,{key:7,size:"sm",class:Ue({copied:N.value}),label:N.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ie(()=>[N.value?(x(),Se(Ge,{key:1,class:"fp-check",name:"check",size:"md"})):(x(),Se(Ge,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ue("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(x(),E("div",{key:0,class:Ue(["fp-body",{"fp-markdown":W.value==="preview"}])},[W.value==="preview"?(x(),Se(X1,{key:0,text:m.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(x(),E("div",Tpe,[w("div",Npe,[(x(!0),E(We,null,rt(y.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",Lpe,B(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,$pe)],10,Ipe))),128))])]))],2)):h.value==="json"?(x(),E("div",Fpe,[w("div",Ope,[(x(!0),E(We,null,rt(y.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",Rpe,B(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,Dpe)],10,Bpe))),128))])])):h.value==="html"?(x(),E("div",Ppe,[z.value==="preview"?(x(),E("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:fe.value,title:e.file.path},null,8,Hpe)):(x(),E("div",Wpe,[w("div",zpe,[(x(!0),E(We,null,rt(y.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",qpe,B(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,jpe)],10,Upe))),128))])]))])):h.value==="pdf"?(x(),E("div",Vpe,[ee.value?(x(),E("iframe",{key:0,class:"fp-pdf-frame",src:ee.value,title:e.file.path},null,8,Kpe)):(x(),E("div",Gpe,[w("span",Ype,B(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(x(),E("div",Zpe,[w("table",Xpe,[w("tbody",null,[(x(!0),E(We,null,rt(j.value,(Q,P)=>(x(),E("tr",{key:P,class:Ue(M(P+1)),"data-line":P+1},[w("th",null,B(P+1),1),(x(!0),E(We,null,rt(Q,(G,me)=>(x(),E("td",{key:me},B(G),1))),128))],10,Qpe))),128))])])])):h.value==="image"?(x(),E("div",Jpe,[ie.value?(x(),E("img",{key:0,src:ie.value,alt:e.file.path,class:Ue(["fp-image",{actual:L.value==="actual"}])},null,10,eme)):(x(),E("div",tme,[w("span",nme,[ae(Ge,{name:"image-off",size:"lg"})]),w("span",ome,B(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="video"?(x(),E("div",sme,[q.value?(x(),E("video",{key:0,src:q.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,ime)):(x(),E("div",rme,[w("span",lme,[ae(Ge,{name:"image-off",size:"lg"})]),w("span",ame,B(C(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:$(e.file.size)})),1)]))])):h.value==="text"?(x(),E("div",cme,[w("div",ume,[(x(!0),E(We,null,rt(y.value,(Q,P)=>(x(),E("div",{key:P,class:Ue(["fp-line-row",M(P+1)]),"data-line":P+1},[w("span",fme,B(P+1),1),w("span",{class:"fp-line-text",innerHTML:he(Q)},null,8,hme)],10,dme))),128))])])):(x(),E("div",pme,[w("div",mme,[w("span",gme,[ae(Ge,{name:"file-off",size:"lg"})]),w("span",vme,B(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:$(e.file.size)})),1)])]))],64)):ue("",!0)],512))}}),kme=dt(yme,[["__scopeId","data-v-ded222d2"]]),bme={class:"tp"},xme=Je({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=oe(null);return et(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||yt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(x(),E("div",bme,[ae(Ya,{title:C(s)("common.preview"),subtitle:e.subtitle??C(s)("thinking.panelTitle"),"close-label":C(s)("thinking.close"),onClose:l[0]||(l[0]=a=>o("close"))},null,8,["title","subtitle","close-label"]),w("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},B(e.text),513)]))}}),$3=dt(xme,[["__scopeId","data-v-cf9c560b"]]),wme={class:"ap"},_me={key:0,class:"ap-type"},Sme={key:1,class:"ap-reason"},Cme={key:2,class:"ap-field"},Ame={class:"ap-field-body"},Mme={key:3,class:"ap-field"},Eme={class:"ap-field-body ap-live"},Tme={key:4,class:"ap-field"},Nme={class:"ap-field-body ap-progress"},Ime={key:0,class:"ap-call"},Lme={key:1,class:"ap-output"},$me=["onClick"],Fme={key:5,class:"ap-field"},Ome={class:"ap-field-body"},Bme=8,F3=5,O3=2,Rme=Je({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>(n.member.outputLines??[]).map(m=>m.trimEnd()).filter(m=>m.length>0)),r=D(()=>(n.member.text??"").trimEnd());function l(m){const k=[];let y=null,g=0;for(const v of m)v.startsWith("Calling ")?(y={key:`g${g++}`,call:v,output:[]},k.push(y)):y?y.output.push(v):(y={key:`g${g++}`,call:"",output:[v]},k.push(y));return k}const a=D(()=>l(i.value)),c=oe(new Set);function u(m){return c.value.has(m)}function d(m){const k=new Set(c.value);k.has(m)?k.delete(m):k.add(m),c.value=k}function f(m){return m.output.length-F3-O3}function h(m){switch(m){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=oe(null);return et(()=>i.value.length+r.value.length,()=>{const m=p.value;!m||!(m.scrollHeight-m.scrollTop-m.clientHeight<24)||yt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(m,k)=>(x(),E("div",wme,[ae(Ya,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:k[0]||(k[0]=y=>o("close"))},{default:Ie(()=>[ae(qi,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ie(()=>[ot(B(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(x(),E("div",_me,B(e.member.subagentType),1)):ue("",!0),e.member.suspendedReason?(x(),E("div",Sme,B(e.member.suspendedReason),1)):ue("",!0),e.member.prompt?(x(),E("div",Cme,[k[1]||(k[1]=w("span",{class:"ap-field-label"},"Task",-1)),w("div",Ame,B(e.member.prompt),1)])):ue("",!0),r.value?(x(),E("div",Mme,[k[2]||(k[2]=w("span",{class:"ap-field-label"},"Output",-1)),w("div",Eme,B(r.value),1)])):ue("",!0),a.value.length>0?(x(),E("div",Tme,[k[4]||(k[4]=w("span",{class:"ap-field-label"},"Progress",-1)),w("div",Nme,[(x(!0),E(We,null,rt(a.value,y=>(x(),E("div",{key:y.key,class:"ap-group"},[y.call?(x(),E("div",Ime,[k[3]||(k[3]=w("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),ot(" "+B(y.call),1)])):ue("",!0),y.output.length>0?(x(),E("div",Lme,[y.output.length<=Bme||u(y.key)?(x(!0),E(We,{key:0},rt(y.output,(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},B(g),1))),128)):(x(),E(We,{key:1},[(x(!0),E(We,null,rt(y.output.slice(0,F3),(g,v)=>(x(),E("div",{key:v,class:"ap-out-line"},B(g),1))),128)),w("button",{type:"button",class:"ap-fold",onClick:g=>d(y.key)}," … ("+B(f(y))+" more) ",9,$me),(x(!0),E(We,null,rt(y.output.slice(-O3),(g,v)=>(x(),E("div",{key:"t"+v,class:"ap-out-line"},B(g),1))),128))],64))])):ue("",!0)]))),128))])])):ue("",!0),e.member.summary?(x(),E("div",Fme,[k[5]||(k[5]=w("span",{class:"ap-field-label"},"Result",-1)),w("div",Ome,B(e.member.summary),1)])):ue("",!0)],512)]))}}),Dme=dt(Rme,[["__scopeId","data-v-715bd93e"]]),Pme={class:"diff-lines"},Hme={key:0,class:"hunk-text"},Wme={class:"dl-gutter old"},zme={class:"dl-gutter new"},Ume={class:"dl-sign"},qme={class:"dl-text"},jme=Je({__name:"DiffLines",props:{lines:{}},setup(e){function t(s){return s.oldNo!==void 0?String(s.oldNo):""}function n(s){return s.newNo!==void 0?String(s.newNo):""}function o(s){return`dl-${s.type}`}return(s,i)=>(x(),E("div",Pme,[(x(!0),E(We,null,rt(e.lines,(r,l)=>(x(),E("div",{key:l,class:Ue(["dl",o(r)])},[r.type==="hunk"?(x(),E("span",Hme,B(r.text),1)):(x(),E(We,{key:1},[w("span",Wme,B(t(r)),1),w("span",zme,B(n(r)),1),w("span",Ume,B(r.type==="add"?"+":r.type==="del"?"-":" "),1),w("span",qme,B(r.text),1)],64))],2))),128))]))}}),YE=dt(jme,[["__scopeId","data-v-2f6bc1cc"]]),Vme={class:"tdp"},Kme={class:"tdp-body"},Gme={key:1,class:"tdp-output"},Yme={key:2,class:"tdp-empty"},Zme=Je({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=$t();return(s,i)=>(x(),E("div",Vme,[ae(Ya,{title:e.target.title,subtitle:e.target.path,"close-label":C(o)("thinking.close"),onClose:i[0]||(i[0]=r=>n("close"))},null,8,["title","subtitle","close-label"]),w("div",Kme,[e.target.lines&&e.target.lines.length>0?(x(),Se(YE,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(x(),E("div",Gme,[(x(!0),E(We,null,rt(e.target.output,(r,l)=>(x(),E("div",{key:l},B(r),1))),128))])):(x(),E("div",Yme,B(C(o)("diff.noDiff")),1))])]))}}),Xme=dt(Zme,[["__scopeId","data-v-76f2fbca"]]),Qme={class:"sc"},Jme={key:0,class:"sc-empty"},e1e={key:2,class:"sc-loading","aria-hidden":"true"},t1e={class:"sc-composer"},n1e=["placeholder"],o1e=["disabled"],s1e=Je({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t(),i=D(()=>n.turns.find(g=>g.role==="user")?.text?.trim()??""),r=D(()=>n.title?.trim()||s("sideChat.title")),l=D(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=oe(""),c=oe(null),u=oe(null);function d(){const y=a.value.trim();y&&(o("send",y),a.value="",yt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const y=u.value;y&&(y.scrollTop=y.scrollHeight)}const h=D(()=>{const y=n.turns;if(y.length===0)return"0";const g=y.at(-1),v=g.thinking?.length??0,b=g.tools?.reduce((A,I)=>A+I.name.length+(I.arg?.length??0)+(I.output?.join("").length??0),0)??0;return`${y.length}:${g.text.length}:${v}:${b}`});et(h,async()=>{!n.running&&!n.sending||(await yt(),f())});const p=D(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function m(y){y.key==="Enter"&&!y.shiftKey&&!y.isComposing&&(y.preventDefault(),d())}function k(){const y=c.value;y&&(y.style.height="auto",y.style.height=`${Math.min(y.scrollHeight,160)}px`)}return(y,g)=>(x(),E("div",Qme,[ae(Ya,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:g[0]||(g[0]=v=>o("close"))},null,8,["title","subtitle","close-label"]),w("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(x(),E("div",Jme,B(C(s)("sideChat.empty")),1)):(x(),Se(RE,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(x(),E("div",e1e,[ae(OE)])):ue("",!0)],512),w("div",t1e,[qn(w("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":g[1]||(g[1]=v=>a.value=v),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:k,onKeydown:m},null,40,n1e),[[Cs,a.value]]),ae(an,{text:C(s)("sideChat.send")},{default:Ie(()=>[w("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[ae(Ge,{name:"arrow-right",size:"sm"})],8,o1e)]),_:1},8,["text"])])]))}}),i1e=dt(s1e,[["__scopeId","data-v-f973798f"]]),r1e={class:"changes-pane"},l1e={class:"dv-path"},a1e={class:"diff-head"},c1e={class:"back-label"},u1e={key:0,class:"empty-state"},d1e={key:1,class:"dv-lines-wrap"},f1e={key:2,class:"empty-state"},h1e={class:"dv-change-count"},p1e={class:"ch-head"},m1e={class:"br-label"},g1e={class:"br-name"},v1e={key:0,class:"sync-info"},y1e={key:0,class:"ahead"},k1e={key:0,class:"behind"},b1e={key:1,class:"empty-head"},x1e={key:0,class:"ch-list"},w1e=["onClick"],_1e={class:"fpath"},S1e={key:1,class:"ch-list ch-tree"},C1e={class:"tree-list"},A1e=["onClick"],M1e={class:"tree-name"},E1e=["onClick"],T1e={class:"tree-name"},N1e={key:2,class:"empty-state"},I1e={key:3,class:"empty-state"},L1e=Je({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(F){const S=F.toLowerCase();return S==="modified"?"modified":S==="added"?"added":S==="deleted"?"deleted":S==="renamed"?"renamed":S==="untracked"?"untracked":S==="conflicted"?"conflicted":S==="ignored"?"ignored":S==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(F){return r[i(F)]??"?"}function a(F,S=60){return F.length<=S?F:"…"+F.slice(F.length-S+1)}const c=D(()=>o.gitInfo!==null),u=D(()=>o.changes.length>0),d=D(()=>(o.selectedDiffPath??null)!==null),f=D(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=D(()=>o.fileDiff??[]),p=D(()=>o.fileDiffLoading===!0);function m(F){s("open",F)}function k(){s("back")}function y(){s("close")}const g=oe("list");function v(F){g.value=F}function b(F){const S={children:[]},R=[...F].sort((z,W)=>z.path.localeCompare(W.path));for(const z of R){const W=z.path.split("/");let L=S;for(let O=0;O<W.length;O++){const U=W[O],Z=O===W.length-1,ie=W.slice(0,O+1).join("/");let q=L.children.find(ee=>ee.name===U&&ee.kind===(Z?"file":"folder"));q||(q={name:U,path:ie,kind:Z?"file":"folder",status:Z?z.status:void 0,children:[]},L.children.push(q)),L=q}}return S.children}const A=D(()=>b(o.changes)),I=oe(new Set);function T(F){return!I.value.has(F)}const M=D(()=>{const F=[];function S(R,z){for(const W of R)F.push({node:W,depth:z}),W.kind==="folder"&&T(W.path)&&S(W.children,z+1)}return S(A.value,0),F});function $(F){const S=new Set(I.value);S.has(F.path)?S.delete(F.path):S.add(F.path),I.value=S}function N(F){return`${16+F*16}px`}return(F,S)=>(x(),E("div",r1e,[f.value?(x(),E(We,{key:0},[ae(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:y},{default:Ie(()=>[ae(an,{text:e.selectedDiffPath??""},{default:Ie(()=>[w("span",l1e,B(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),w("div",a1e,[e.hideBack?ue("",!0):(x(),Se(jt,{key:0,variant:"ghost",size:"sm",onClick:k},{default:Ie(()=>[S[0]||(S[0]=w("span",{"aria-hidden":"true"},"←",-1)),w("span",c1e,B(C(n)("diff.back")),1)]),_:1}))]),p.value?(x(),E("div",u1e,B(C(n)("diff.loading")),1)):h.value.length>0?(x(),E("div",d1e,[ae(YE,{lines:h.value},null,8,["lines"])])):(x(),E("div",f1e,B(C(n)("diff.noDiff")),1))],64)):(x(),E(We,{key:1},[ae(Ya,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:y},{default:Ie(()=>[w("span",h1e,B(C(n)("diff.changeCount",{count:e.changes.length})),1),ae(ys,{"model-value":g.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":v},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),w("div",p1e,[c.value?(x(),E(We,{key:0},[w("span",m1e,B(C(n)("diff.branch")),1),w("span",g1e,B(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(x(),E("span",v1e,[ae(an,{text:C(n)("diff.aheadTitle")},{default:Ie(()=>[e.gitInfo.ahead>0?(x(),E("span",y1e,"↑"+B(e.gitInfo.ahead),1)):ue("",!0)]),_:1},8,["text"]),ae(an,{text:C(n)("diff.behindTitle")},{default:Ie(()=>[e.gitInfo.behind>0?(x(),E("span",k1e,"↓"+B(e.gitInfo.behind),1)):ue("",!0)]),_:1},8,["text"])])):ue("",!0)],64)):(x(),E("span",b1e,B(C(n)("diff.empty")),1))]),u.value&&g.value==="list"?(x(),E("div",x1e,[(x(!0),E(We,null,rt(e.changes,R=>(x(),Se(an,{key:R.path,text:R.path},{default:Ie(()=>[w("button",{type:"button",class:"ch-row",onClick:z=>m(R.path)},[w("span",{class:Ue(["badge",i(R.status)])},B(l(R.status)),3),w("span",_1e,B(a(R.path)),1)],8,w1e)]),_:2},1032,["text"]))),128))])):u.value&&g.value==="tree"?(x(),E("div",S1e,[w("ul",C1e,[(x(!0),E(We,null,rt(M.value,({node:R,depth:z})=>(x(),E("li",{key:R.path,class:"tree-node"},[R.kind==="folder"?(x(),E("button",{key:0,type:"button",class:"tree-row tree-folder",style:on({paddingLeft:N(z)}),onClick:W=>$(R)},[ae(Ge,{class:"tree-icon",name:"folder-solid",size:"sm"}),w("span",M1e,B(R.name),1)],12,A1e)):(x(),Se(an,{key:1,text:R.path},{default:Ie(()=>[w("button",{type:"button",class:"tree-row tree-file",style:on({paddingLeft:N(z)}),onClick:W=>m(R.path)},[w("span",{class:Ue(["badge",i(R.status)])},B(l(R.status)),3),w("span",T1e,B(R.name),1)],12,E1e)]),_:2},1032,["text"]))]))),128))])])):c.value?(x(),E("div",N1e,B(C(n)("diff.clean")),1)):(x(),E("div",I1e,B(C(n)("diff.empty")),1))],64))]))}}),$1e=dt(L1e,[["__scopeId","data-v-7778610a"]]);function cb(e,t){let n=null;Cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,yt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),ho(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const F1e=["type","value","placeholder","disabled","readonly"],O1e=Je({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const o=n,s=oe();function i(a){o("update:modelValue",a.target.value)}function r(){s.value?.focus()}function l(){s.value?.select()}return t({focus:r,select:l,el:s}),(a,c)=>(x(),E("input",{ref_key:"el",ref:s,class:Ue(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:i,onFocus:c[0]||(c[0]=u=>a.$emit("focus",u)),onBlur:c[1]||(c[1]=u=>a.$emit("blur",u))},null,42,F1e))}}),pu=dt(O1e,[["__scopeId","data-v-340f0da2"]]),B1e={class:"search-wrap"},R1e={key:0,class:"tab-strip"},D1e={key:1,class:"state-row"},P1e={key:2,class:"state-row unavail"},H1e={key:3,class:"model-list"},W1e=["aria-selected","onClick","onMouseenter"],z1e={class:"check"},U1e={class:"model-main"},q1e={class:"model-name"},j1e={class:"model-id"},V1e={key:0,class:"caps"},K1e={class:"model-provider"},G1e={class:"model-ctx"},Y1e={key:0,class:"empty"},Z1e={class:"footer-hint"},X1e=Je({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D(()=>new Set(o.starredIds??[]));function r(v){return i.value.has(v)}const l=oe(""),a=oe(null),c=oe(null),u=oe("all");cb(c,a);const d=D(()=>{const v=new Set,b=[{id:"all",label:n("model.allTab")}];for(const A of o.models)v.has(A.provider)||(v.add(A.provider),b.push({id:A.provider,label:A.provider}));return b}),f=D(()=>{const v=l.value.toLowerCase().trim(),b=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const I=(A.displayName??A.model).toLowerCase().includes(v),T=A.provider.toLowerCase().includes(v),M=A.id.toLowerCase().includes(v);return!v||I||T||M});return u.value!=="all"?b:b.sort((A,I)=>{const T=r(A.id)?1:0;return(r(I.id)?1:0)-T})}),h=D(()=>f.value),p=oe(0);et([l,u],()=>{p.value=0}),et(d,v=>{v.some(b=>b.id===u.value)||(u.value="all")}),et(h,v=>{p.value=Math.min(p.value,Math.max(v.length-1,0))});function m(v){if(v.key==="Escape"){s("close");return}if(v.key==="ArrowDown")v.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(v.key==="ArrowUp")v.preventDefault(),p.value=Math.max(p.value-1,0);else if(v.key==="Enter"){const b=h.value[p.value];b&&s("select",b.id)}}Cn(()=>{document.addEventListener("keydown",m)}),$n(()=>{document.removeEventListener("keydown",m)});function k(v){s("select",v)}function y(v){return h.value.indexOf(v)}function g(v){u.value=v}return(v,b)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:b[1]||(b[1]=A=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:c,class:"mp"},[w("div",B1e,[ae(pu,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":b[0]||(b[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(x(),E("div",R1e,[(x(!0),E(We,null,rt(d.value,A=>(x(),Se(jt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:I=>g(A.id)},{default:Ie(()=>[ot(B(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ue("",!0),e.loading?(x(),E("div",D1e,[ae(Us,{size:"sm"}),w("span",null,B(C(n)("model.loading")),1)])):e.unavailable?(x(),E("div",P1e,[ae(Ge,{name:"alert-triangle",size:"lg"}),w("span",null,B(C(n)("model.unavailable")),1)])):(x(),E("div",H1e,[(x(!0),E(We,null,rt(h.value,A=>(x(),E("div",{key:A.id,class:Ue(["model-row",{"is-current":A.id===e.current,"is-selected":y(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:I=>k(A.id),onMouseenter:I=>p.value=y(A)},[w("span",z1e,[A.id===e.current?(x(),Se(Ge,{key:0,name:"check",size:"sm"})):ue("",!0)]),w("span",U1e,[w("span",q1e,B(A.displayName??A.model),1),w("span",j1e,B(A.id),1),A.capabilities&&A.capabilities.length>0?(x(),E("span",V1e,[(x(!0),E(We,null,rt(A.capabilities,I=>(x(),Se(qi,{key:I,variant:"info",size:"sm"},{default:Ie(()=>[ot(B(I),1)]),_:2},1024))),128))])):ue("",!0)]),w("span",K1e,B(A.provider),1),w("span",G1e,B(C(n)("model.contextSuffix",{size:C(pr)(A.maxContextSize)})),1),ae(Xn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:St(I=>s("toggle-star",A.id),["stop"])},{default:Ie(()=>[r(A.id)?(x(),Se(Ge,{key:0,name:"star",size:"md"})):(x(),Se(Ge,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,W1e))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(x(),E("div",Y1e,B(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ue("",!0)])),w("div",Z1e,B(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),Q1e=dt(X1e,[["__scopeId","data-v-56cefe51"]]),J1e={key:0,class:"ui-field__label"},e0e={key:1,class:"ui-field__error"},t0e={key:2,class:"ui-field__hint"},n0e=Je({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-field",{"has-error":!!e.error}])},[e.label?(x(),E("label",J1e,B(e.label),1)):ue("",!0),jn(t.$slots,"default",{},void 0,!0),e.error?(x(),E("span",e0e,B(e.error),1)):e.hint?(x(),E("span",t0e,B(e.hint),1)):ue("",!0)],2))}}),pp=dt(n0e,[["__scopeId","data-v-49bce958"]]),o0e=["value","disabled"],s0e=Je({__name:"Select",props:{modelValue:{},size:{default:"md"},disabled:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function o(s){n("update:modelValue",s.target.value)}return(s,i)=>(x(),E("select",{class:Ue(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[jn(s.$slots,"default",{},void 0,!0)],42,o0e))}}),ck=dt(s0e,[["__scopeId","data-v-92a040fd"]]),i0e={class:"prov-list"},r0e={key:0,class:"state-row"},l0e={key:1,class:"state-row unavail"},a0e={key:2,class:"empty"},c0e={class:"prov-info"},u0e={class:"prov-type"},d0e={key:0,class:"prov-url"},f0e={class:"prov-meta"},h0e={key:0},p0e={class:"prov-actions"},m0e={key:0,class:"add-section"},g0e={key:0,class:"add-btns"},v0e={key:1,class:"add-form"},y0e=["value"],k0e={key:0,class:"add-error"},b0e={class:"form-btns"},x0e={class:"footer-hint"},w0e=Je({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=$t(),o=oe(null);cb(o);const s=t;function i(k){s("delete",k)}const r=oe(!1),l=zo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=oe(""),c=["moonshot","anthropic","openai","custom"];function u(){l.type="moonshot",l.apiKey="",l.baseUrl="",l.defaultModel="",a.value="",r.value=!0}function d(){r.value=!1}function f(){if(!l.apiKey.trim()){a.value=n("providers.apiKeyRequired");return}a.value="",s("add",{type:l.type,apiKey:l.apiKey.trim()||void 0,baseUrl:l.baseUrl.trim()||void 0,defaultModel:l.defaultModel.trim()||void 0}),r.value=!1}function h(k){if(k.key==="Escape"){if(r.value){d();return}s("close")}}Cn(()=>document.addEventListener("keydown",h)),$n(()=>document.removeEventListener("keydown",h));function p(k){return k==="connected"?"var(--color-success)":k==="error"?"var(--color-danger)":"var(--color-text-faint)"}function m(k){return n(k==="connected"?"providers.status.connected":k==="error"?"providers.status.error":"providers.status.unconfigured")}return(k,y)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:y[6]||(y[6]=g=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:o,class:"pm"},[w("div",i0e,[e.loading?(x(),E("div",r0e,[ae(Us,{size:"sm"}),w("span",null,B(C(n)("providers.loading")),1)])):e.unavailable?(x(),E("div",l0e,[ae(Ge,{name:"alert-triangle",size:"md"}),w("span",null,B(C(n)("providers.unavailable")),1)])):e.providers.length===0?(x(),E("div",a0e,B(C(n)("providers.empty")),1)):(x(!0),E(We,{key:3},rt(e.providers,g=>(x(),E("div",{key:g.id,class:"prov-row"},[ae(an,{text:m(g.status)},{default:Ie(()=>[w("span",{class:Ue(["status-dot",{"status-dot--empty":g.status!=="connected"&&g.status!=="error"}]),style:on(g.status==="connected"||g.status==="error"?{background:p(g.status)}:void 0)},null,6)]),_:2},1032,["text"]),w("div",c0e,[w("span",u0e,B(g.type),1),g.baseUrl?(x(),E("span",d0e,B(g.baseUrl),1)):ue("",!0),w("span",f0e,[ae(qi,{variant:g.hasApiKey?"success":"neutral",size:"sm"},{default:Ie(()=>[ot(B(g.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),g.models&&g.models.length>0?(x(),E("span",h0e," · "+B(C(n)("providers.modelCount",{count:g.models.length})),1)):ue("",!0)])]),w("div",p0e,[ae(an,{text:C(n)("providers.refreshTitle",{type:g.type})},{default:Ie(()=>[ae(jt,{variant:"secondary",size:"sm",onClick:v=>s("refresh",g.id)},{default:Ie(()=>[ot(B(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),ae(an,{text:C(n)("providers.deleteTitle",{type:g.type})},{default:Ie(()=>[ae(jt,{variant:"danger-soft",size:"sm",onClick:v=>i(g.id)},{default:Ie(()=>[ot(B(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ue("",!0):(x(),E("div",m0e,[r.value?(x(),E("div",v0e,[ae(pp,{label:C(n)("providers.fieldType")},{default:Ie(()=>[ae(ck,{modelValue:l.type,"onUpdate:modelValue":y[2]||(y[2]=g=>l.type=g)},{default:Ie(()=>[(x(),E(We,null,rt(c,g=>w("option",{key:g,value:g},B(g),9,y0e)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),ae(pp,{label:C(n)("providers.fieldApiKey")},{default:Ie(()=>[ae(pu,{modelValue:l.apiKey,"onUpdate:modelValue":y[3]||(y[3]=g=>l.apiKey=g),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),ae(pp,{label:C(n)("providers.fieldBaseUrl")},{default:Ie(()=>[ae(pu,{modelValue:l.baseUrl,"onUpdate:modelValue":y[4]||(y[4]=g=>l.baseUrl=g),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),ae(pp,{label:C(n)("providers.fieldDefaultModel")},{default:Ie(()=>[ae(pu,{modelValue:l.defaultModel,"onUpdate:modelValue":y[5]||(y[5]=g=>l.defaultModel=g),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(x(),E("div",k0e,B(a.value),1)):ue("",!0),w("div",b0e,[ae(jt,{variant:"primary",size:"sm",onClick:f},{default:Ie(()=>[ot(B(C(n)("providers.add")),1)]),_:1}),ae(jt,{variant:"secondary",size:"sm",onClick:d},{default:Ie(()=>[ot(B(C(n)("common.cancel")),1)]),_:1})])])):(x(),E("div",g0e,[ae(jt,{variant:"secondary",size:"sm",onClick:y[0]||(y[0]=g=>s("openLogin","moonshot"))},{default:Ie(()=>[ae(Ge,{name:"user",size:"sm"}),ot(" "+B(C(n)("providers.loginKimi")),1)]),_:1}),ae(jt,{variant:"secondary",size:"sm",onClick:y[1]||(y[1]=g=>s("openLogin","anthropic"))},{default:Ie(()=>[ae(Ge,{name:"user",size:"sm"}),ot(" "+B(C(n)("providers.loginAnthropic")),1)]),_:1}),ae(jt,{variant:"primary",size:"sm",onClick:u},{default:Ie(()=>[ae(Ge,{name:"plus",size:"sm"}),ot(" "+B(C(n)("providers.enterApiKey")),1)]),_:1})]))])),w("div",x0e,B(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),_0e=dt(w0e,[["__scopeId","data-v-cf73278e"]]),S0e={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},C0e={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},A0e={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},$v=Je({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(x(),E("svg",S0e,[...n[0]||(n[0]=[w("circle",{cx:"18",cy:"18",r:"15"},null,-1),w("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(x(),E("svg",C0e,[...n[1]||(n[1]=[w("circle",{cx:"14",cy:"14",r:"12"},null,-1),w("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),w("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(x(),E("svg",A0e,[...n[2]||(n[2]=[w("path",{d:"M14 3 L26 24 H2 Z"},null,-1),w("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),w("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),M0e={key:0,class:"center-body"},E0e={class:"center-text"},T0e={key:1,class:"nb"},N0e={class:"nb-lead"},I0e=["href"],L0e={class:"nb-or"},$0e={class:"nb-fallback"},F0e={class:"nb-fb-text"},O0e=["href"],B0e={class:"nb-code-row"},R0e={class:"nb-code"},D0e={class:"nb-status"},P0e={class:"nb-status-text"},H0e={class:"nb-countdown"},W0e={key:2,class:"center-body"},z0e={class:"center-text success-text"},U0e={class:"center-hint"},q0e={class:"center-body"},j0e={class:"center-text err-text"},V0e={class:"center-hint"},K0e={class:"actions"},G0e={class:"center-body"},Y0e={class:"center-text warn-text"},Z0e={class:"center-hint"},X0e={class:"actions"},Q0e=3,J0e=Je({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=$t(),o=oe(!0),s=t,i=e,r=oe("starting"),l=oe(!1),a=oe(null),c=oe(0),u=oe(!1);let d=null,f=null,h=0;Cn(async()=>{await p()}),$n(()=>{y()});async function p(){y(),a.value=null,l.value=!1,h=0,r.value="starting";const I=await i.onStartOAuthLogin();if(!I){r.value="error";return}if(I.status==="authenticated"){y(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:I.flowId,verificationUri:I.verificationUri,verificationUriComplete:I.verificationUriComplete,userCode:I.userCode,expiresIn:I.expiresIn,interval:I.interval},c.value=I.expiresIn,r.value="device-code",m(),k(I.interval)}function m(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function k(I){d&&clearTimeout(d),d=setTimeout(async()=>{const T=await i.onPollOAuthLogin();if(T===null){if(h+=1,h>=Q0e){y(),l.value=!0,r.value="error";return}k(I);return}h=0,T.status==="authenticated"?(y(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):T.status==="expired"||T.status==="cancelled"?(y(),r.value="expired"):k(I)},I*1e3)}function y(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function g(){await p()}async function v(){!a.value||!await Jo(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function b(){y(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A(I){const T=Math.floor(I/60),M=I%60;return`${T}:${String(M).padStart(2,"0")}`}return(I,T)=>(x(),Se(Qr,{open:o.value,"onUpdate:open":T[0]||(T[0]=M=>o.value=M),title:C(n)("login.title"),"close-on-overlay":!1,onClose:b},{default:Ie(()=>[r.value==="starting"?(x(),E("div",M0e,[ae(Us,{size:"md"}),w("span",E0e,B(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(x(),E("div",T0e,[w("div",N0e,B(C(n)("login.lead")),1),w("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ot(B(C(n)("login.authorizeInBrowser"))+" ",1),ae(Ge,{name:"external-link",size:"sm"})],8,I0e),w("div",L0e,B(C(n)("login.orDivider")),1),w("div",$0e,[w("div",F0e,[ot(B(C(n)("login.fallbackPrefix")),1),w("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},B(a.value.verificationUri),9,O0e),ot(B(C(n)("login.fallbackSuffix")),1)]),w("div",B0e,[w("span",R0e,B(a.value.userCode),1),ae(jt,{class:Ue(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:v},{default:Ie(()=>[u.value?(x(),E(We,{key:0},[ae(Ge,{name:"check",size:"sm"}),ot(" "+B(C(n)("login.copied")),1)],64)):(x(),E(We,{key:1},[ae(Ge,{name:"copy",size:"sm"}),ot(" "+B(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),w("div",D0e,[ae(Us,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),w("span",P0e,B(C(n)("login.waitingAutoClose")),1),w("span",H0e,B(A(c.value)),1)])])):r.value==="success"?(x(),E("div",W0e,[ae($v,{kind:"success"}),w("span",z0e,B(C(n)("login.success")),1),w("span",U0e,B(C(n)("login.successHint")),1)])):r.value==="expired"?(x(),E(We,{key:3},[w("div",q0e,[ae($v,{kind:"expired"}),w("span",j0e,B(C(n)("login.expiredTitle")),1),w("span",V0e,B(C(n)("login.expiredHint")),1)]),w("div",K0e,[ae(jt,{variant:"primary",onClick:g},{default:Ie(()=>[ot(B(C(n)("login.retry")),1)]),_:1}),ae(jt,{variant:"secondary",onClick:b},{default:Ie(()=>[ot(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(x(),E(We,{key:4},[w("div",G0e,[ae($v,{kind:"error"}),w("span",Y0e,B(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),w("span",Z0e,B(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),w("div",X0e,[ae(jt,{variant:"primary",onClick:g},{default:Ie(()=>[ot(B(C(n)("login.retry")),1)]),_:1}),ae(jt,{variant:"secondary",onClick:b},{default:Ie(()=>[ot(B(C(n)("login.closeBtn")),1)]),_:1})])],64)):ue("",!0)]),_:1},8,["open","title"]))}}),ege=dt(J0e,[["__scopeId","data-v-8308a28f"]]);function tge(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const nge=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function zi(e){const t=e.replaceAll("\\","/"),n=nge.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function oge(e,t){const n=zi(t.cwd);return e.find(o=>zi(o.root)===n)?.id??t.workspaceId??t.cwd}function sge(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(zi)),r=new Map;for(const d of t){const f=zi(d.root);i.has(f)||r.has(f)||r.set(f,{...d})}for(const d of n){const f=d.cwd;if(!f)continue;const h=zi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:tge(f),sessionCount:0})}const l=new Map;for(const d of n){const f=oge(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=zi(d.root);!i.has(f)&&!a.includes(f)&&a.push(f)}const c=[...r.keys()].filter(d=>!a.includes(d));c.sort((d,f)=>r.get(d).root.localeCompare(r.get(f).root));const u=[];for(const d of[...a,...c]){const f=r.get(d),h=l.get(f.id)??l.get(f.root)??0,p=s[f.id]===!1?h:Math.max(f.sessionCount,h);u.push({...f,sessionCount:p})}return u}function ige(e,t){if(t.length===0||e.length===0)return t;const n=Date.parse(t[0].createdAt);if(Number.isNaN(n))return t;const o=new Set(t.map(r=>r.id)),s=new Set(t.filter(r=>r.role==="user").map(r=>r.id)),i=e.filter(r=>{const l=Date.parse(r.createdAt);return!(Number.isNaN(l)||l>=n||o.has(r.id)||r.role==="user"&&r.promptId!==void 0&&s.has(r.promptId))});return i.length>0?[...i,...t]:t}function B3(e,t){const n=new Set(e.map(a=>a.id)),o=t.filter(a=>a.kind==="subagent"&&!n.has(a.id));if(o.length===0)return e;const s=new Map(e.map(a=>[a.id,a])),i=new Set,r=o.map(a=>{const c=a.backgroundTaskId!==void 0?s.get(a.backgroundTaskId):void 0;if(c===void 0)return a;i.add(c.id);const u=a.status==="running"&&c.status!=="running";return{...a,status:a.status==="running"?c.status:a.status,subagentPhase:u?c.status==="completed"?"completed":"failed":a.subagentPhase,completedAt:a.completedAt??c.completedAt,outputPreview:c.outputPreview??a.outputPreview,outputBytes:c.outputBytes??a.outputBytes}});return[...e.filter(a=>!i.has(a.id)),...r]}function rge(e,t){if(e.length===0)return t;const n=new Map(t.map(r=>[r.id,r])),o=new Set(e.map(r=>r.id)),s=e.map(r=>{const l=n.get(r.id);return l?{...r,outputLines:l.outputLines,text:l.text}:r}),i=t.filter(r=>!o.has(r.id));return i.length===0?s:[...s,...i]}function lge(e){const t=new Map,n=new Set;function o(i){const r=t.get(i);if(r!==void 0)return r;const l=(async()=>e(i))().finally(()=>{t.delete(i),n.delete(i)&&o(i)});return t.set(i,l),l}function s(i){if(t.has(i)){n.add(i);return}o(i)}return{run:o,request:s}}const age=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function cge(e){return age.has(e.type)}const uge=50,dge=100,uk=32*1024,fge={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,uge)},cancelTask(e){clearTimeout(e)}};function hge(e,t,n={}){const o=n.scheduler??fge,s=Math.max(1,Math.floor(n.maxItemsPerSlice??dge)),i=[];let r=0,l=null,a=null,c=0,u=!1;const d=()=>i.length-r,f=()=>{c+=1,l!==null&&(o.cancelFrame(l),l=null),a!==null&&(o.cancelTask(a),a=null)},h=()=>{r===i.length?(i.length=0,r=0):r>=1024&&(i.splice(0,r),r=0)};let p;const m=()=>{if(u||l!==null||a!==null||d()===0)return;const y=++c,g=()=>{y===c&&p()};l=o.requestFrame(g),a=o.requestTask(g)};p=()=>{f();let y=0;for(;!u&&y<s&&r<i.length;){const g=i[r++];e(g),y+=1}h(),m()};const k=(y=>{if(!u){if(t(y)){const g=i.length>r?i.at(-1):void 0,v=g===void 0?void 0:n.coalesce?.(g,y);v===void 0?i.push(y):i[i.length-1]=v,m();return}if(d()===0){e(y);return}i.push(y),p()}});return k.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},k.discard=y=>{if(u||d()===0)return;let g=r;for(let v=r;v<i.length;v+=1){const b=i[v];y(b)||(i[g++]=b)}i.length=g,h(),d()===0?f():m()},k.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},k}function dk(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function pge(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=dk(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=uk)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+uk,o.value.length);r<o.value.length&&r>i&&/[\uD800-\uDBFF]/u.test(o.value[r-1])&&/[\uDC00-\uDFFF]/u.test(o.value[r])&&(r-=1);const l=o.value.slice(i,r);s.push({appEvent:{...t,delta:o.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+i}}}),i=r}return s}function mge(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=dk(e.appEvent),i=dk(t.appEvent);if(n===void 0||o===void 0||s===void 0||i===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==o.turnId||n.kind!==o.kind||s.kind!==i.kind||n.kind!==s.kind||o.kind!==i.kind||o.offset!==n.offset+s.value.length||s.value.length+i.value.length>uk)return;const r=s.value+i.value;return{appEvent:{...e.appEvent,delta:s.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}const ZE=["blue","mono"],XE=["light","dark","system"],QE=14,gge=12,vge=20;function yge(){const e=yo(Dt.accent);return e&&ZE.includes(e)?e:"blue"}function kge(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function bge(){const e=yo(Dt.colorScheme);return e&&XE.includes(e)?e:"system"}function xge(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(o=>{const i=(o.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";o.setAttribute("content",n??i)})}function ub(e){return Number.isFinite(e)?Math.min(vge,Math.max(gge,Math.round(e))):QE}function wge(){const e=yo(Dt.uiFontSize);return e===null?QE:ub(Number(e))}function _ge(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${ub(e)}px`)}const db=oe(bge()),fb=oe(yge()),hb=oe(wge());et(db,xge,{immediate:!0});et(fb,kge,{immediate:!0});et(hb,_ge,{immediate:!0});function Sge(e){XE.includes(e)&&(db.value=e,To(Dt.colorScheme,e))}function Cge(e){ZE.includes(e)&&(fb.value=e,To(Dt.accent,e))}function Age(e){const t=ub(e);hb.value=t,To(Dt.uiFontSize,String(t))}const Mge=600,Ege=250,s0=250,Tge=1e3,Nge=160,Zm=oe(!1);let Ma=[],$a=null,Xm=-s0;function Ige(){Ma=[],Xm=-s0,Zm.value=!1,$a!==null&&(clearTimeout($a),$a=null)}function Lge(){Zm.value=!0,$a!==null&&clearTimeout($a),$a=setTimeout(()=>{$a=null,Ma=[],Xm=-s0,Zm.value=!1},Tge)}function $ge(e){if(e<=0)return;const t=Date.now();Ma.push({time:t,chars:e});const n=t-Mge;if(Ma=Ma.filter(l=>l.time>=n),t-Xm<s0)return;Xm=t;const o=Ma[0]?.time??t,s=Math.max(t-o,Ege);Ma.reduce((l,a)=>l+a.chars,0)/s*1e3>=Nge&&Lge()}function JE(){return{colorScheme:db,accent:fb,uiFontSize:hb,fastMoon:Zm,setColorScheme:Sge,setAccent:Cge,setUiFontSize:Age,resetFastMoon:Ige,recordMoonDelta:$ge}}function Fge(e,t,n){return e==="idle"&&!t&&!n}function pb(e,t){const n=yo(e);return n===null?t:n==="1"}const mb=oe(pb(Dt.notifyOnComplete,!0)),gb=oe(pb(Dt.notifyOnQuestion,!1)),vb=oe(pb(Dt.notifyOnApproval,!1)),yb=oe(typeof Notification<"u"?Notification.permission:"denied"),Oge="/favicon.ico";async function kb(e,t,n){if(!n){e.value=!1,To(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}yb.value=o,o==="granted"&&(e.value=!0,To(t,"1"))}function Bge(e){return kb(mb,Dt.notifyOnComplete,e)}function Rge(e){return kb(gb,Dt.notifyOnQuestion,e)}function Dge(e){return kb(vb,Dt.notifyOnApproval,e)}function bb(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Pge(e){return{title:On.global.t("settings.notifyTitle"),body:bb(e,On.global.t("settings.notifyFallback"))}}function Hge(e,t){return{title:On.global.t("settings.notifyQuestionTitle"),body:bb(t,e,On.global.t("settings.notifyQuestionFallback"))}}function Wge(e,t){return{title:On.global.t("settings.notifyApprovalTitle"),body:bb(t,e,On.global.t("settings.notifyApprovalFallback"))}}function xb(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{yb.value=i,i==="granted"&&R3(t,n,o)});return}R3(t,n,o)}}function R3(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Oge});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function zge(e,t){xb(mb.value,t,Pge(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function Uge(e){xb(gb.value,e,Hge(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function qge(e){xb(vb.value,e,Wge(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function jge(){return{notifyOnComplete:mb,notifyOnQuestion:gb,notifyOnApproval:vb,notifyPermission:yb,setNotifyOnComplete:Bge,setNotifyOnQuestion:Rge,setNotifyOnApproval:Dge,maybeNotifyCompletion:zge,maybeNotifyQuestion:Uge,maybeNotifyApproval:qge}}function Vge(){return yo(Dt.soundOnComplete)==="1"}const Tu=oe(Vge());function Kge(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let Fv=null;function eT(){const e=Kge();if(!e)return null;if(Fv===null)try{Fv=new e}catch{return null}return Fv}function tT(){if(!Tu.value)return;const e=eT();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Rr("sound: audio context resumed",{state:e.state})},t=>{Rr("sound: audio context resume rejected",{error:String(t)})})}let D3=!1;function Gge(){if(D3||typeof window>"u")return;D3=!0;const e=()=>{tT()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}Gge();function Yge(e){Tu.value=e,To(Dt.soundOnComplete,e?"1":"0"),e&&tT()}function P3(e,t,n,o,s){const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.value=t,i.connect(r),r.connect(e.destination);const l=e.currentTime+n;r.gain.setValueAtTime(1e-4,l),r.gain.exponentialRampToValueAtTime(s,l+.01),r.gain.exponentialRampToValueAtTime(1e-4,l+o),i.start(l),i.stop(l+o+.02)}function wb(){const e=eT();if(e===null){Rr("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Rr("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Rr("sound: context resumed for next time",{state:e.state})},t=>{Rr("sound: resume rejected",{error:String(t)})});return}try{P3(e,880,0,.16,.18),P3(e,1320,.1,.22,.16),Rr("sound: chime scheduled",{state:e.state})}catch(t){Rr("sound: failed to play",{error:String(t)})}}function Zge(){Tu.value&&wb()}function Xge(){Tu.value&&wb()}function Qge(){Tu.value&&wb()}function Jge(){return{soundOnComplete:Tu,setSoundOnComplete:Yge,maybePlayCompletionSound:Zge,maybePlayQuestionSound:Xge,maybePlayApprovalSound:Qge}}const eve=1e3,tve=4096,H3=32*1024;function nve(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await ht().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:B3(p,e.tasksBySession[f]??[])},await r(f,p)}catch{}}async function r(f,h){if(e.activeSessionId!==f)return;const p=h??e.tasksBySession[f]??[],m=ht(),k=new Map;if(await Promise.all(p.map(async g=>{if((g.status==="completed"||g.status==="failed"||g.status==="cancelled")&&!s.has(g.id)&&!((g.outputLines?.length??0)>0))try{const b=await m.getTask(f,g.id,{withOutput:!0,outputBytes:H3});b.outputPreview!==void 0&&k.set(g.id,{preview:b.outputPreview,bytes:b.outputBytes}),s.add(g.id)}catch{}})),k.size===0)return;const y=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:y.map(g=>{const v=k.get(g.id)??(g.backgroundTaskId!==void 0?k.get(g.backgroundTaskId):void 0);return v?{...g,outputPreview:v.preview,outputBytes:v.bytes}:g})}}async function l(f){if(e.activeSessionId!==f)return;const h=ht();let p;try{p=await h.listTasks(f)}catch{return}const m=new Map;await Promise.all(p.map(async v=>{const b=v.status==="running",A=v.status==="completed"||v.status==="failed"||v.status==="cancelled";if(!(!b&&!A)&&!(A&&(s.has(v.id)||(v.outputLines?.length??0)>0)))try{const I=await h.getTask(f,v.id,{withOutput:!0,outputBytes:b?tve:H3});I.outputPreview!==void 0&&m.set(v.id,{preview:I.outputPreview,bytes:I.outputBytes}),A&&s.add(v.id)}catch{}}));const k=e.tasksBySession[f]??[],y=new Map(k.map(v=>[v.id,v])),g=p.map(v=>{const b=y.get(v.id),A=m.get(v.id);return{...v,outputLines:b?.outputLines,text:b?.text,outputPreview:A?.preview??b?.outputPreview,outputBytes:A?.bytes??b?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:B3(g,k)}}function a(f){n!==null&&o===f||(c(),o=f,l(f),n=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(e.activeSessionId===f?l(f):c())},eve))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=oe(0);let d=null;return et(()=>t.value.some(f=>f.status==="running"),f=>{f&&d===null?d=setInterval(()=>{u.value=(u.value+1)%Number.MAX_SAFE_INTEGER},1e3):!f&&d!==null&&(clearInterval(d),d=null)},{immediate:!0}),et(()=>{const f=e.activeSessionId;if(!f)return{sid:void 0,hasRunning:!1};const h=e.tasksBySession[f]??[];return{sid:f,hasRunning:h.some(p=>p.status==="running")}},({sid:f,hasRunning:h},p,m)=>{let k;h&&f!==void 0?a(f):f!==void 0?k=setTimeout(()=>{(e.tasksBySession[f]??[]).some(g=>g.status==="running")||c()},1500):c(),m(()=>{k!==void 0&&clearTimeout(k)})},{deep:!0,immediate:!0}),{taskClock:D(()=>u.value),loadTasksForSession:i}}function ove(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function sve(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
314
+ `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&ove(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),o=Number.parseInt(a[2],10)),s=!0,t.push({type:"hunk",text:i});continue}if(!s||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:o}),o+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:o}),n+=1,o+=1)}return t}const fk="/sessions/";function W3(e){const{pathname:t}=e;if(!t.startsWith(fk))return;const n=t.slice(fk.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function ive(e){return e===void 0||e.length===0?"/":`${fk}${encodeURIComponent(e)}`}const rve=50,hk=5,lve=40402,ave=40410,cve=40902,uve=2e3;function Ov(e){return _i(e)&&e.code===cve}const dve=40904;function fve(e){return _i(e)&&e.code===dve}const ya=zo({}),mp=zo({}),Bv=zo({}),or=zo(new Set),i0=new Map,Za=new Map,Qm=new Map;let hve=0;const xa=new Map,pve=3;let z3=0;function mve(){return z3+=1,`${Date.now().toString(36)}-${z3}`}function gve(e){return{generation:i0.get(e)??0,pending:(Za.get(e)?.size??0)>0}}function pk(e){const t=++hve;i0.set(e,t);const n=Za.get(e)??new Set;return n.add(t),Za.set(e,n),t}function mk(e,t){const n=Za.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Za.delete(e);const o=Qm.get(e);Qm.delete(e),o?.()}function vve(e){i0.delete(e),Za.delete(e),Qm.delete(e),xa.delete(e)}function yve(e,t){return!t.pending&&t.generation===(i0.get(e)??0)}function kve(e,t){if((Za.get(e)?.size??0)===0){t();return}Qm.set(e,t)}function bve(e,t){const{t:n}=On.global,{confirm:o}=Uf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:m,updateSessionMessages:k,nextOptimisticMsgId:y,getEventConn:g,syncSessionFromSnapshot:v,reopenSession:b,hasLoadedMessages:A,refreshSessionStatus:I,refreshSessionGoal:T,persistSessionProfile:M,mergedWorkspaces:$,workspacesView:N,status:F,workspaceIdForSession:S,savePermissionToStorage:R,savePlanModeToStorage:z,saveSwarmModeToStorage:W,saveGoalModeToStorage:L,draftModes:O,saveUnread:U,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:ie,goalErrorMessage:q,resetFastMoon:ee,initialized:fe,connectIssue:ne,selectedDiffPath:j,fileDiffLines:K,fileDiffLoading:ve}=t;let he=!1;async function Ae(te){if(e.messagesLoadingMoreBySession[te])return;const Ce=e.messagesBySession[te];if(!Ce||Ce.length===0)return;const Ee=Ce[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!1};try{const De=await ht().listMessages(te,{beforeId:Ee,pageSize:rve}),Xe=[...De.items].reverse();k(te,at=>[...Xe,...at]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[te]:De.hasMore}}catch(De){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[te]:!0},l("loadOlderMessages",De,{sessionId:te})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[te]:!1}}}function re(te){s.loadTasksForSession(te),P(te),I(te),T(te),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,te)||r.loadSkillsForSession(te)}async function Y(te){const Ce=e.activeSessionId;if(Ce){j.value=te,K.value=[],ve.value=!0;try{const De=await ht().getFileDiff(Ce,te);if(j.value!==te)return;K.value=sve(De.diff)}catch(Ee){j.value===te&&(K.value=[]),console.warn("[loadFileDiff] diff unavailable for",te,Ee)}finally{j.value===te&&(ve.value=!1)}}}function Q(){j.value=null,K.value=[],ve.value=!1}async function P(te){try{const Ee=await ht().getGitStatus(te);e.gitStatusBySession={...e.gitStatusBySession,[te]:Ee}}catch{}}async function G(){try{const Ce=await ht().getAuth();return e.authReady=Ce.ready,e.defaultModel=Ce.defaultModel,e.managedProviderStatus=Ce.managedProvider?.status??null,ne.value=null,"proceed"}catch(te){return _i(te)&&(te.code===401||te.code===LE)?(ne.value=null,"server-auth-required"):(ne.value=(te instanceof Error?te.message:String(te)).slice(0,140),"retry")}}async function me(){let te=!0;for(;;){const Ce=await G();if(Ce!=="retry")return Ce;te&&(ne.value=null,te=!1),await new Promise(Ee=>{setTimeout(Ee,uve)})}}async function ye(){try{const te=ht();e.config=await te.getConfig()}catch{}}async function de(te){try{const Ee=await ht().setConfig(te);return e.config=Ee,e.defaultModel=Ee.defaultModel??null,!0}catch(Ce){return l("setConfig",Ce),!1}}const V=100,se=30,pe=720*60*1e3;async function ke(){const te=ht(),Ce=[];let Ee,De;for(;;){let Xe;try{Xe=await te.listSessions({pageSize:V,beforeId:Ee,excludeEmpty:!0})}catch(at){if(Ce.length===0)throw at;De=at;break}if(Ce.push(...Xe.items),!Xe.hasMore||Xe.items.length===0)break;Ee=Xe.items[Xe.items.length-1].id}return{sessions:Ce,error:De}}function Ne(te){const Ce=new Map(e.sessions.map(Ee=>[Ee.id,Ee.usage]));u(te.map(Ee=>{const De=Ce.get(Ee.id);return De!==void 0&&ek(Ee.usage)&&!ek(De)?{...Ee,usage:De}:Ee}))}function qe(te){const Ce=[...te],Ee=new Set(Ce.map(De=>De.id));for(const De of e.sessions)Ee.has(De.id)||(Ce.push(De),Ee.add(De.id));return Ce.sort((De,Xe)=>new Date(Xe.updatedAt).getTime()-new Date(De.updatedAt).getTime()),Ce}async function be(te){const Ce=ht(),Ee=[],De=Date.now(),Xe=Vt=>De-new Date(Vt.updatedAt).getTime();let at,It=!1,Qt=!0,cn;for(;;){let Vt;try{Vt=await Ce.listSessions({workspaceId:te,pageSize:hk,beforeId:at,excludeEmpty:!0})}catch(Nt){if(Qt)throw Nt;cn=Nt,It=!0;break}if(It=Vt.hasMore,Vt.items.length===0)break;const Hn=Vt.items[Vt.items.length-1],co=Xe(Hn)>=pe;if(!Qt&&co){const Nt=Vt.items.findIndex(Zt=>Xe(Zt)>=pe),_t=Nt>=0?Nt+1:Vt.items.length;Ee.push(...Vt.items.slice(0,_t)),It=Vt.hasMore||_t<Vt.items.length;break}if(Ee.push(...Vt.items),Qt=!1,!Vt.hasMore||co)break;at=Hn.id}return{workspaceId:te,page:{items:Ee,hasMore:It},error:cn}}async function xe(){const te=e.workspaces;if(te.length===0){const Nt=await ke(),_t=Nt.error===void 0?Nt.sessions:qe(Nt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Nt.error===void 0,Nt.error!==void 0&&l("load",Nt.error),_t}const Ce=await Promise.allSettled(te.map(Nt=>be(Nt.id))),Ee=[],De=new Set,Xe=new Map,at=new Set;let It;for(let Nt=0;Nt<Ce.length;Nt++){const _t=Ce[Nt];if(_t.status==="fulfilled"){Xe.set(_t.value.workspaceId,_t.value.page),_t.value.error!==void 0&&(at.size===0&&(It=_t.value.error),at.add(_t.value.workspaceId));for(const Zt of _t.value.page.items)De.has(Zt.id)||(Ee.push(Zt),De.add(Zt.id));continue}at.size===0&&(It=_t.reason),at.add(te[Nt].id)}if(Xe.size===0){l("load",It);return}const Qt=new Set(te.filter(Nt=>at.has(Nt.id)).map(Nt=>Nt.root)),cn=new Set(te.map(Nt=>Nt.id));for(const Nt of e.sessions)!(Nt.workspaceId!==void 0&&cn.has(Nt.workspaceId)?at.has(Nt.workspaceId):Qt.has(Nt.cwd)||at.has(S(Nt)))||De.has(Nt.id)||(Ee.push(Nt),De.add(Nt.id));const Vt={},Hn={},co={};for(const{id:Nt}of te){const _t=Xe.get(Nt);if(_t===void 0){const Zt=e.sessionsHasMoreByWorkspace[Nt],eo=e.sessionsCursorByWorkspace[Nt],ro=e.sessionsInitialCountByWorkspace[Nt];Zt!==void 0&&(Vt[Nt]=Zt),eo!==void 0&&(Hn[Nt]=eo),ro!==void 0&&(co[Nt]=ro);continue}Vt[Nt]=_t.hasMore,Hn[Nt]=_t.items.length>0?_t.items[_t.items.length-1].id:void 0,co[Nt]=Math.max(_t.items.length,hk)}return e.sessionsHasMoreByWorkspace=Vt,e.sessionsCursorByWorkspace=Hn,e.sessionsInitialCountByWorkspace=co,e.sessionsFullyLoaded=!1,Ee.sort((Nt,_t)=>new Date(_t.updatedAt).getTime()-new Date(Nt.updatedAt).getTime()),at.size>0&&l("load",It),Ee}async function Ze(te){if(e.sessionsLoadingMoreByWorkspace[te]||e.sessionsHasMoreByWorkspace[te]===!1)return;const Ce=e.sessionsCursorByWorkspace[te];if(Ce!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!0};try{const Ee=await ht().listSessions({workspaceId:te,pageSize:se,beforeId:Ce,excludeEmpty:!0}),De=new Set(e.sessions.map(at=>at.id)),Xe=Ee.items.filter(at=>!De.has(at.id));Xe.length>0&&u([...e.sessions,...Xe]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[te]:Ee.items.length>0?Ee.items[Ee.items.length-1].id:Ce},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[te]:Ee.hasMore}}catch(Ee){l("loadMoreSessions",Ee)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[te]:!1}}}}async function tt(){if(e.sessionsFullyLoaded)return;const te=await ke().catch(De=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",De),null));if(te===null)return;const Ce=te.error===void 0?te.sessions:qe(te.sessions);if(Ne(Ce),e.sessionsFullyLoaded=te.error===void 0,te.error!==void 0)return;const Ee={};for(const De of e.workspaces)Ee[De.id]=!1;e.sessionsHasMoreByWorkspace=Ee}async function lt(){const te=await ht().getMeta().catch(()=>null);te!==null&&(e.serverVersion=te.serverVersion,e.availableOpenInApps=te.openInApps,e.dangerousBypassAuth=te.dangerousBypassAuth,e.backend=te.backend)}async function ut(){const te=Date.now();let Ce="accepted";_o("app:load:start"),e.loading=!0;const Ee=!fe.value;let De=!0;try{if(Ee&&await me()==="server-auth-required"){De=!1,Ce="auth-required";return}const Xe=ht();await Promise.all([Xe.getHealth().catch(()=>null),lt(),r.loadModels()]),Ee||await G(),await ye(),await mt();const at=await xe(),It=at??e.sessions;at!==void 0&&Ne(at);const Qt=It[0],cn=e.activeWorkspaceId;!(cn!==null&&$.value.some(co=>co.id===cn))&&Qt&&wt(S(Qt)),Fn();const Hn=typeof window<"u"?W3(window.location):void 0;!e.activeSessionId&&Hn!==void 0&&(e.sessions.some(Nt=>Nt.id===Hn)||await to(Hn))&&await Qn(Hn,{urlMode:"replace"}),!e.activeSessionId&&It.length>0&&await Qn(It[0].id,{urlMode:"replace"})}catch(Xe){Ce="failed",l("load",Xe)}finally{e.loading=!1,De&&(fe.value=!0),_o("app:load:complete",{status:Ce,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-te})}}async function mt(){try{const te=ht(),[Ce,Ee]=await Promise.all([te.listWorkspaces().catch(()=>[]),te.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Tt(Ce),e.fsHome=Ee.home||null,e.recentRoots=Ee.recentRoots}catch{}}function Tt(te){const Ce=Rh();return Object.keys(Ce).length===0?te:te.map(Ee=>{const De=Ce[Ee.root];return De!==void 0?{...Ee,name:De}:Ee})}function wt(te){e.activeWorkspaceId=te,Z(te)}function Ft(te){wt(te);const Ce=e.sessions.filter(Ee=>S(Ee)===te);if(Ce.length>0){const Ee=Ce[0];Ee&&Ee.id!==e.activeSessionId&&Qn(Ee.id)}else m(void 0),mn(void 0,"push")}function en(te){const Ce=Rh()[te.root],Ee=Ce!==void 0?{...te,name:Ce}:te,De=zi(Ee.root);e.hiddenWorkspaceRoots.some(It=>zi(It)===De)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(It=>zi(It)!==De),ie(e.hiddenWorkspaceRoots));const Xe=e.workspaces.findIndex(It=>It.id===Ee.id||It.root===Ee.root);if(Xe===-1){e.workspaces=[Ee,...e.workspaces];return}const at=[...e.workspaces];at[Xe]=Ee,e.workspaces=at}function Dn(te){if(te.type==="workspaceCreated"||te.type==="workspaceUpdated"){en(te.workspace);return}const Ce=e.workspaces.find(De=>De.id===te.workspaceId)?.root??te.root;if(Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],ie(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(De=>De.id!==te.workspaceId&&De.root!==Ce),e.activeWorkspaceId===te.workspaceId||e.activeWorkspaceId===Ce){const De=N.value[0]?.id??null;if(e.activeWorkspaceId=De,De)Z(De);else try{qa(Dt.activeWorkspace)}catch{}m(void 0),e.sessionLoading=!1,Q(),mn(void 0,"replace")}}function Pt(){m(void 0),mn(void 0,"push")}function kn(te){wt(te),Pt(),Q()}async function hn(te){const Ce=$.value.find(Hn=>Hn.id===te);if(!Ce)return null;const Ee=e.thinking,De=ht();let Xe,at=Ce.root;try{const Hn=await De.addWorkspace({root:Ce.root});Xe=Hn.id,at=Hn.root,en(Hn)}catch{}const It=r.draftModel.value??void 0,Qt=await De.createSession({workspaceId:Xe,cwd:at,model:It});r.draftModel.value=null;const cn=It!==void 0&&(!Qt.model||Qt.model.length===0)?{...Qt,model:It}:Qt;f(cn),wt(Qt.workspaceId??Xe??te),await Qn(Qt.id);const Vt=Qt.id;return Ee!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[Vt]:Ee}),O.planMode&&(e.planModeBySession={...e.planModeBySession,[Vt]:!0},z()),O.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[Vt]:!0},W()),O.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[Vt]:!0},L()),O.planMode=!1,O.swarmMode=!1,O.goalMode=!1,Vt}async function Kt(te,Ce,Ee){if(!or.has(te)){or.add(te);try{const De=await hn(te);if(!De)return;await sn(De,Ce,Ee)}catch(De){l("startSessionAndSendPrompt",De)}finally{or.delete(te)}}}async function Tn(te,Ce,Ee){if(!or.has(te)){or.add(te);try{const De=await hn(te);if(!De)return;const Xe=e.planModeBySession[De]??!1,at=e.swarmModeBySession[De]??!1,It=e.sessions.find(Vt=>Vt.id===De),Qt=(It?.model&&It.model.length>0?It.model:e.defaultModel)??void 0;if(!await M({model:Qt,planMode:Xe,swarmMode:at,permissionMode:e.permission},De))return;await r.activateSkill(Ce,Ee,De)}catch(De){l("startSessionAndActivateSkill",De)}finally{or.delete(te)}}}async function Gt(te,Ce){if(!or.has(te)){or.add(te);try{const Ee=await hn(te);if(!Ee)return;await i.openSideChatOn(Ee,Ce)}catch(Ee){l("startSessionAndOpenSideChat",Ee)}finally{or.delete(te)}}}async function Wt(te){const Ce=te.trim();if(!Ce)return!1;const Ee=ht();try{const De=await Ee.addWorkspace({root:Ce});return en(De),kn(De.id),!0}catch(De){return console.warn("[kimi-web] addWorkspaceByPath failed for",Ce,De),!1}}async function pn(te){try{return await ht().browseFs(te)}catch{return{path:"",parent:null,entries:[]}}}async function so(){try{return await ht().getFsHome()}catch{return{home:"",recentRoots:[]}}}function mn(te,Ce){if(Ce==="none"||typeof window>"u"||!window.history)return;const Ee=ive(te);if(window.location.pathname!==Ee)try{Ce==="push"?window.history.pushState(null,"",Ee):window.history.replaceState(null,"",Ee)}catch{}}async function to(te){try{const Ce=await ht().getSession(te);return e.sessions.some(Ee=>Ee.id===Ce.id)||h(Ce),!0}catch{return!1}}function vt(){const te=W3(window.location);if(te===void 0){m(void 0);return}if(te!==e.activeSessionId){if(e.sessions.some(Ce=>Ce.id===te)){Qn(te,{urlMode:"none"});return}(async()=>{if(await to(te)){await Qn(te,{urlMode:"none"});return}const Ce=e.sessions[0];Ce?await Qn(Ce.id,{urlMode:"replace"}):(m(void 0),mn(void 0,"replace"))})()}}let Pn=!1;function Fn(){Pn||typeof window>"u"||(Pn=!0,window.addEventListener("popstate",vt))}async function Qn(te,Ce){const Ee=A(te),De=!Ee&&c.has(te);c.delete(te);try{mn(te,Ce?.urlMode??"push"),e.sessionLoading=!Ee&&!De,m(te),ee(),e.unreadBySession[te]&&(e.unreadBySession={...e.unreadBySession,[te]:!1},U({[te]:!1})),Q();const Xe=e.sessions.find(at=>at.id===te);if(Xe){const at=S(Xe);e.activeWorkspaceId!==at&&wt(at)}if(Ee){if(await b(te)==="not-found")return}else if(await v(te)==="not-found")return;re(te)}catch(Xe){l("selectSession",Xe,{sessionId:te})}finally{e.activeSessionId===te&&(e.sessionLoading=!1)}}async function sn(te,Ce,Ee){const De=pk(te);e.inFlightBySession={...e.inFlightBySession,[te]:!0};const Xe=y();try{const at=ht(),It=[];Ce&&It.push({type:"text",text:Ce});for(const Zt of Ee??[])Zt.kind==="video"?It.push({type:"video",source:{kind:"file",fileId:Zt.fileId}}):Zt.kind==="file"?It.push({type:"file",fileId:Zt.fileId,name:Zt.name??"",mediaType:Zt.mediaType||"application/octet-stream",size:Zt.size??0}):It.push({type:"image",source:{kind:"file",fileId:Zt.fileId}});if(It.length===0)return e.inFlightBySession={...e.inFlightBySession,[te]:!1},"rejected";const Qt={id:Xe,sessionId:te,role:"user",content:It,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(te,Zt=>[...Zt,Qt]);const cn=e.sessions.find(Zt=>Zt.id===te),Vt=(cn?.model&&cn.model.length>0?cn.model:e.defaultModel)??void 0,Hn=e.planModeBySession[te]??!1,co=e.swarmModeBySession[te]??!1,Nt=e.goalModeBySession[te]??!1;if(Nt&&Ce)try{await at.updateSession(te,{goalObjective:Ce.trim()})}catch(Zt){return l("createGoal",Zt,{sessionId:te}),e.inFlightBySession={...e.inFlightBySession,[te]:!1},k(te,eo=>eo.some(ro=>ro.id===Xe)?eo.filter(ro=>ro.id!==Xe):eo),"rejected"}const _t=await at.submitPrompt(te,{content:It,model:Vt,thinking:await r.resolveThinkingForPrompt(te,Vt)??e.thinking,permissionMode:e.permission,planMode:Hn,swarmMode:co});return Nt&&(e.goalModeBySession={...e.goalModeBySession,[te]:!1},L()),e.promptIdBySession={...e.promptIdBySession,[te]:_t.promptId},k(te,Zt=>{const eo=Zt.findIndex(Ks=>Ks.id===Xe);if(eo===-1)return Zt;const ro=[...Zt];return ro[eo]={...ro[eo],promptId:ro[eo].promptId??_t.promptId},ro}),g()?.bindNextPromptId(te,_t.promptId),"ok"}catch(at){return e.inFlightBySession={...e.inFlightBySession,[te]:!1},k(te,It=>It.some(Qt=>Qt.id===Xe)?It.filter(Qt=>Qt.id!==Xe):It),l("sendPrompt",at,{sessionId:te}),_i(at)?"rejected":"uncertain"}finally{mk(te,De)}}async function es(te,Ce){const Ee=e.activeSessionId;if(Ee){if(a.value!=="idle"||e.inFlightBySession[Ee]){Bt(te,Ce);return}if((e.queuedBySession[Ee]?.length??0)>0){Bt(te,Ce),Yt(Ee);return}await sn(Ee,te,Ce)}}async function nt(te,Ce){const Ee=e.activeSessionId;if(!Ee)return;const De=e.queuedBySession[Ee]??[],Xe=[],at=[];for(const _t of De){const Zt=_t.text.trim();Zt&&Xe.push(Zt),_t.attachments?.length&&at.push(..._t.attachments)}const It=te.trim();if(It&&Xe.push(It),Ce?.length&&at.push(...Ce),Xe.length===0&&at.length===0)return;De.length>0&&(e.queuedBySession={...e.queuedBySession,[Ee]:[]});const Qt=Xe.join(`
315
+
316
+ `),cn=()=>{if(De.length===0)return;const _t=e.queuedBySession[Ee]??[];e.queuedBySession={...e.queuedBySession,[Ee]:[...De,..._t]}};if(a.value==="idle"&&!e.inFlightBySession[Ee]){await sn(Ee,Qt,at)==="rejected"&&cn();return}const Vt=[];Qt&&Vt.push({type:"text",text:Qt});for(const _t of at)_t.kind==="video"?Vt.push({type:"video",source:{kind:"file",fileId:_t.fileId}}):_t.kind==="file"?Vt.push({type:"file",fileId:_t.fileId,name:_t.name??"",mediaType:_t.mediaType||"application/octet-stream",size:_t.size??0}):Vt.push({type:"image",source:{kind:"file",fileId:_t.fileId}});const Hn=y(),co={id:Hn,sessionId:Ee,role:"user",content:Vt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};k(Ee,_t=>[..._t,co]);const Nt=pk(Ee);try{const _t=ht(),Zt=e.sessions.find(Ks=>Ks.id===Ee),eo=(Zt?.model&&Zt.model.length>0?Zt.model:e.defaultModel)??void 0,ro=await _t.submitPrompt(Ee,{content:Vt,model:eo,thinking:await r.resolveThinkingForPrompt(Ee,eo)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[Ee]??!1,swarmMode:e.swarmModeBySession[Ee]??!1});if(k(Ee,Ks=>{const Ii=Ks.findIndex(Gf=>Gf.id===Hn);if(Ii===-1)return Ks;const Gs=[...Ks];return Gs[Ii]={...Gs[Ii],promptId:Gs[Ii].promptId??ro.promptId},Gs}),ro.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[Ee]:ro.promptId},g()?.bindNextPromptId(Ee,ro.promptId);return}try{await _t.steerPrompts(Ee,[ro.promptId])}catch{}}catch(_t){k(Ee,Zt=>Zt.filter(eo=>eo.id!==Hn)),_i(_t)&&cn(),l("steer",_t,{sessionId:Ee})}finally{mk(Ee,Nt)}}async function Be(te,Ce){try{const De=await ht().uploadFile({file:te,name:Ce});return{fileId:De.id,name:De.name,mediaType:De.mediaType}}catch(Ee){return l("uploadImage",Ee),null}}function Bt(te,Ce){const Ee=e.activeSessionId;if(!Ee)return;const De=e.queuedBySession[Ee]??[],Xe={text:te,attachments:Ce,id:mve()};e.queuedBySession={...e.queuedBySession,[Ee]:[...De,Xe]}}function Yt(te){const[Ce,...Ee]=e.queuedBySession[te]??[];Ce!==void 0&&(e.queuedBySession={...e.queuedBySession,[te]:Ee},sn(te,Ce.text,Ce.attachments).then(De=>{if(De==="ok"){xa.delete(te);return}if(De==="uncertain"){xa.delete(te);return}if(!e.sessions.some(cn=>cn.id===te)){xa.delete(te);return}const Xe=Ce.id??Ce.text,at=xa.get(te),It=at!==void 0&&at.key===Xe?at.count+1:1;if(It>=pve){xa.delete(te),(e.queuedBySession[te]?.length??0)>0&&Yt(te);return}xa.set(te,{key:Xe,count:It});const Qt=e.queuedBySession[te]??[];e.queuedBySession={...e.queuedBySession,[te]:[Ce,...Qt]}}))}function gn(te,Ce){const Ee=e.inFlightBySession[te]===!0;if(e.inFlightBySession={...e.inFlightBySession,[te]:!1},e.promptIdBySession[te]!==void 0){const Xe={...e.promptIdBySession};delete Xe[te],e.promptIdBySession=Xe}return te===e.activeSessionId&&ee(),(Ee||Ce?.turnWasActive===!0||(e.turnActiveBySession[te]??!1))&&Yt(te),Ee}function bn(te,Ce){Ce.inFlightTurn!==null&&Ce.busy||gn(te)}async function nn(){const te=e.activeSessionId;if(!te)return;const Ce=e.sessions.find(Xe=>Xe.id===te);let Ee=e.promptIdBySession[te];if(Ee===void 0){const Xe=Ce?.currentPromptId;Xe!==void 0&&Xe.length>0&&!Xe.startsWith("pr_")&&(Ee=Xe)}const De=ht();if(Ee!==void 0)try{if((await De.abortPrompt(te,Ee)).aborted)return;const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}catch(Xe){if(_i(Xe)&&Xe.code===lve){const at={...e.promptIdBySession};delete at[te],e.promptIdBySession=at}else{l("abortCurrentPrompt",Xe,{sessionId:te});return}}try{await De.abortSession(te)}catch(Xe){l("abortCurrentPrompt",Xe,{sessionId:te})}}function Vn(te,Ce){const Ee=e.approvalsBySession[te]??[];e.approvalsBySession={...e.approvalsBySession,[te]:Ee.filter(De=>De.approvalId!==Ce)}}function Kn(te,Ce){const Ee=e.questionsBySession[te]??[];e.questionsBySession={...e.questionsBySession,[te]:Ee.filter(De=>De.questionId!==Ce)}}async function Jn(te,Ce){const Ee=e.activeSessionId;if(Ee&&!mp[te]){mp[te]=!0;try{const De=ht(),Xe={decision:Ce.decision,scope:Ce.scope,feedback:Ce.feedback,selectedLabel:Ce.selectedLabel};await De.respondApproval(Ee,te,Xe),Vn(Ee,te)}catch(De){Ov(De)?Vn(Ee,te):l("respondApproval",De,{sessionId:Ee})}finally{delete mp[te]}}}async function Oo(te,Ce){const Ee=e.activeSessionId;if(Ee&&!ya[te]){ya[te]="answer";try{await ht().respondQuestion(Ee,te,Ce),Kn(Ee,te)}catch(De){Ov(De)?Kn(Ee,te):l("respondQuestion",De,{sessionId:Ee})}finally{delete ya[te]}}}async function ko(te){const Ce=e.activeSessionId;if(Ce&&!ya[te]){ya[te]="dismiss";try{await ht().dismissQuestion(Ce,te),Kn(Ce,te)}catch(Ee){Ov(Ee)?Kn(Ce,te):l("dismissQuestion",Ee,{sessionId:Ce})}finally{delete ya[te]}}}async function ai(te){const Ce=e.activeSessionId;if(Ce&&!Bv[te]){Bv[te]=!0;try{const Ee=ht(),De=(e.tasksBySession[Ce]??[]).find(at=>at.id===te)?.backgroundTaskId;await Ee.cancelTask(Ce,De??te);const Xe=e.tasksBySession[Ce]??[];e.tasksBySession={...e.tasksBySession,[Ce]:Xe.map(at=>at.id===te?{...at,status:"cancelled"}:at)}}catch(Ee){fve(Ee)||l("cancelTask",Ee,{sessionId:Ce})}finally{delete Bv[te]}}}function Uo(te){const Ce=e.activeSessionId;Ce?(e.planModeBySession={...e.planModeBySession,[Ce]:te},z(),M({planMode:te})):O.planMode=te}function As(){const te=e.activeSessionId,Ce=te?e.planModeBySession[te]??!1:O.planMode;Uo(!Ce)}function cs(te){const Ce=e.activeSessionId;Ce?(e.swarmModeBySession={...e.swarmModeBySession,[Ce]:te},W(),M({swarmMode:te})):O.swarmMode=te}async function qo(){const te=e.activeSessionId,Ee=!(te?e.swarmModeBySession[te]??!1:O.swarmMode);Ee&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||cs(Ee)}function Bo(te){const Ce=e.activeSessionId;Ce?(e.goalModeBySession={...e.goalModeBySession,[Ce]:te},L()):O.goalMode=te}function ci(){const te=e.activeSessionId,Ce=te?e.goalModeBySession[te]??!1:O.goalMode;Bo(!Ce)}async function tn(te){const Ce=te.trim();if(!Ce||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:Ce}),variant:"primary"}))return;let Ee=e.activeSessionId;if(!Ee){const De=e.activeWorkspaceId,Xe=De&&N.value.some(at=>at.id===De)?De:N.value[0]?.id??null;if(!Xe)return;try{Ee=await hn(Xe)??void 0}catch(at){l("createGoal",at);return}if(!Ee)return}try{await ht().updateSession(Ee,{goalObjective:Ce})}catch(De){l("createGoal",De,{sessionId:Ee,message:q(De)});return}e.goalModeBySession[Ee]&&(e.goalModeBySession={...e.goalModeBySession,[Ee]:!1},L()),e.activeSessionId===Ee?await es(Ce):await sn(Ee,Ce)}function qs(te){const Ce=e.activeSessionId;Ce&&Promise.resolve(ht().updateSession(Ce,{goalControl:te})).catch(Ee=>{l("controlGoal",Ee,{sessionId:Ce,message:q(Ee)})})}function io(te){e.permission=te,R(te),M({permissionMode:te})}function js(te){const Ce=[...e.warnings];Ce.splice(te,1),e.warnings=Ce}async function ui(te,Ce){try{await ht().updateSession(te,{title:Ce}),d(te,De=>({...De,title:Ce}))}catch(Ee){l("renameSession",Ee,{sessionId:te})}}async function Ni(te,Ce){const Ee=e.workspaces.find(Xe=>Xe.id===te)?.root,De=()=>{e.workspaces=e.workspaces.map(Xe=>Xe.id===te?{...Xe,name:Ce}:Xe)};try{if(await ht().updateWorkspace(te,{name:Ce}),Ee!==void 0){const Xe=Rh();Ee in Xe&&(delete Xe[Ee],w_(Xe))}De()}catch(Xe){if(Ee!==void 0&&_i(Xe)&&Xe.code===ave){w_({...Rh(),[Ee]:Ce}),De();return}l("renameWorkspace",Xe)}}async function di(te){const Ce=e.workspaces.find(at=>at.id===te)?.root??$.value.find(at=>at.id===te)?.root??te,Ee=e.activeSessionId?e.sessions.find(at=>at.id===e.activeSessionId):void 0,De=e.activeWorkspaceId===te||e.activeWorkspaceId===Ce,Xe=!!(Ee&&(Ee.cwd===Ce||Ee.workspaceId===te||S(Ee)===te));Ce&&!e.hiddenWorkspaceRoots.includes(Ce)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,Ce],ie(e.hiddenWorkspaceRoots));try{await ht().deleteWorkspace(te)}catch(at){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",te,at)}if(e.workspaces=e.workspaces.filter(at=>at.id!==te&&at.root!==Ce),De||Xe){const at=N.value[0]?.id??null;if(e.activeWorkspaceId=at,at)Z(at);else try{qa(Dt.activeWorkspace)}catch{}}(De||Xe)&&(m(void 0),e.sessionLoading=!1,Q(),mn(void 0,"replace"))}async function Vs(te){try{await ht().archiveSession(te),p(te),i.clearSideChatForSession(te);const{[te]:Ee,...De}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=De,e.activeSessionId===te){const Xe=e.sessions[0];Xe?await Qn(Xe.id,{urlMode:"replace"}):(m(void 0),mn(void 0,"replace"))}}catch(Ce){l("archiveSession",Ce,{sessionId:te})}}async function ts(te){if(he)return;const Ce=te??e.activeSessionId;if(!Ce){const De=n("commands.export.noSession");_o("export:failed",{status:"no-session"}),l("exportSession",new Error(De),{message:De});return}he=!0;const Ee=Date.now();_o("export:start",{sessionId:Ce});try{const De=Hie(),{blob:Xe,fileName:at}=await ht().exportSession(Ce,De);if(typeof document>"u")throw new Error("Document is unavailable");const It=URL.createObjectURL(Xe);let Qt;try{Qt=document.createElement("a"),Qt.href=It,Qt.download=at,document.body.append(Qt),Qt.click()}finally{Qt?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(It)}catch{}},0)}_o("export:accepted",{sessionId:Ce,status:"accepted",zipBytes:Xe.size,durationMs:Date.now()-Ee})}catch(De){const Xe=typeof De=="object"&&De!==null?De:void 0;_o("export:failed",{sessionId:Ce,status:"failed",durationMs:Date.now()-Ee,errorName:typeof Xe?.name=="string"?Xe.name:typeof De,errorCode:typeof Xe?.code=="number"?Xe.code:void 0,requestId:typeof Xe?.requestId=="string"?Xe.requestId:void 0,phase:typeof Xe?.phase=="string"?Xe.phase:void 0,httpStatus:typeof Xe?.status=="number"?Xe.status:void 0}),l("exportSession",De,{sessionId:Ce})}finally{he=!1}}async function ns(te){try{const Ce=await ht().restoreSession(te);return f(Ce),!0}catch(Ce){return l("restoreSession",Ce,{sessionId:te}),!1}}function zt(te){return ht().listSessions({archivedOnly:!0,beforeId:te?.beforeId,pageSize:te?.pageSize??50})}async function Ms(){try{await ht().logout(),await G(),await ut()}catch(te){l("logout",te)}}function Io(te){const Ce=e.activeSessionId;Ce&&ht().compactSession(Ce,te).catch(Ee=>{l("compact",Ee,{sessionId:Ce})})}async function fi(te){const Ce=te??e.activeSessionId;if(Ce)try{const Ee=await ht().forkSession(Ce);f(Ee),await Qn(Ee.id)}catch(Ee){l("fork",Ee,{sessionId:Ce})}}async function Ke(te=1){const Ce=e.activeSessionId;if(!Ce)return null;const Ee=(()=>{const De=e.messagesBySession[Ce]??[];for(let Xe=De.length-1;Xe>=0;Xe--){const at=De[Xe];if(at.role==="user"&&!(at.metadata?.origin&&at.metadata.origin.kind!=="user"))return at.content.filter(It=>It.type==="text").map(It=>It.text).join(`
317
+ `)}return null})();try{return await ht().undoSession(Ce,te),await v(Ce),Ee}catch(De){return l("undo",De,{sessionId:Ce}),null}}function Re(te){const Ce=e.activeSessionId;if(!Ce)return;const Ee=e.queuedBySession[Ce]??[];if(te<0||te>=Ee.length)return;const De=[...Ee];De.splice(te,1),e.queuedBySession={...e.queuedBySession,[Ce]:De}}function le(te,Ce){const Ee=e.activeSessionId;if(!Ee)return;const De=e.queuedBySession[Ee]??[];if(te===Ce||te<0||te>=De.length||Ce<0||Ce>=De.length)return;const Xe=[...De],[at]=Xe.splice(te,1);at!==void 0&&(Xe.splice(Ce,0,at),e.queuedBySession={...e.queuedBySession,[Ee]:Xe})}async function Te(te){const Ce=e.activeSessionId;if(!Ce)return[];try{return(await ht().listDirectory(Ce,{path:te,includeGitStatus:!0})).items}catch{return[]}}async function ge(te){const Ce=e.activeSessionId;if(!Ce)return null;try{const De=await ht().readFile(Ce,{path:te});return{path:De.path,content:De.content,encoding:De.encoding,mime:De.mime,languageId:De.languageId,isBinary:De.isBinary,size:De.size,lineCount:De.lineCount}}catch(Ee){return console.warn("[kimi-web] readFileContent failed for",te,Ee),null}}const Me=10485760;function ze(te){const Ce=e.activeSessionId;return Ce?ht().getFileDownloadUrl(Ce,te):null}async function Ht(te,Ce){const Ee=e.activeSessionId;if(!Ee)return!1;try{return await ht().openFile(Ee,{path:te,line:Ce}),!0}catch(De){return l("openFile",De,{sessionId:Ee}),!1}}async function Ut(te){const Ce=e.activeSessionId;if(!Ce)return;const Ee=F.value.cwd||".";try{await ht().openInApp(Ce,te,Ee)}catch(De){l("openInApp",De,{sessionId:Ce})}}async function xn(te){const Ce=e.activeSessionId;if(!Ce)return!1;try{return await ht().revealFile(Ce,{path:te}),!0}catch(Ee){return l("revealFile",Ee,{sessionId:Ce}),!1}}async function go(te){if(/^(https?:|data:|blob:)/i.test(te))return te;const Ce=e.activeSessionId;if(!Ce)return te;let Ee=te;if(Ee.startsWith("/")){const De=e.sessions.find(Xe=>Xe.id===Ce)?.cwd;if(De&&(Ee===De||Ee.startsWith(De.endsWith("/")?De:`${De}/`))){if(Ee=Ee.slice(De.length).replace(/^\//,""),!Ee)return te}else return te}try{const Xe=await ht().readFile(Ce,{path:Ee,length:Me});return!Xe.isBinary||Xe.encoding!=="base64"||Xe.truncated?te:`data:${Xe.mime};base64,${Xe.content}`}catch{return te}}async function us(te){const Ce=e.activeSessionId;if(!Ce)return[];try{return(await ht().searchFiles(Ce,{query:te,limit:20})).items.map(Xe=>({path:Xe.path,name:Xe.name}))}catch{return[]}}return{loadFileDiff:Y,clearFileDiff:Q,loadGitStatus:P,checkAuth:G,loadConfig:ye,updateConfig:de,listAllSessionsGlobal:ke,load:ut,refreshServerMeta:lt,loadWorkspaces:mt,loadMoreSessions:Ze,loadAllSessions:tt,selectWorkspace:wt,openWorkspace:Ft,upsertWorkspacePreserveOrder:en,applyWorkspaceEvent:Dn,clearActiveSession:Pt,openWorkspaceDraft:kn,startSessionAndSendPrompt:Kt,startSessionAndActivateSkill:Tn,startSessionAndOpenSideChat:Gt,addWorkspaceByPath:Wt,browseFs:pn,getFsHome:so,writeSessionUrl:mn,fetchSessionIntoList:to,onSessionRoutePopState:vt,bindSessionRoute:Fn,selectSession:Qn,submitPromptInternal:sn,finishPromptLocal:gn,localTurnStartState:gve,isLocalTurnSnapshotCurrent:yve,afterLocalTurnStartsSettle:kve,handleSessionSnapshot:bn,sendPrompt:es,steerPrompt:nt,uploadImage:Be,enqueue:Bt,unqueue:Re,reorderQueue:le,abortCurrentPrompt:nn,respondApproval:Jn,respondQuestion:Oo,dismissQuestion:ko,pendingQuestionActions:ya,pendingApprovalActions:mp,cancelTask:ai,setPlanMode:Uo,togglePlanMode:As,setSwarmMode:cs,toggleSwarmMode:qo,setGoalMode:Bo,toggleGoalMode:ci,createGoal:tn,controlGoal:qs,setPermission:io,dismissWarning:js,renameSession:ui,renameWorkspace:Ni,deleteWorkspace:di,archiveSession:Vs,exportSession:ts,restoreSession:ns,loadArchivedSessions:zt,logout:Ms,compact:Io,forkSession:fi,undo:Ke,listDir:Te,readFileContent:ge,getFileDownloadUrl:ze,openWorkspaceFile:Ht,openInApp:Ut,revealWorkspaceFile:xn,resolveImageUrl:go,searchFiles:us,loadOlderMessages:Ae,refreshSessionSidecars:re,isStartingFirstPrompt:()=>or.size>0}}const nT=Dt.starredModels,U3=new Error("profile persist failed");function xve(){try{const e=yo(nT);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function wve(e){try{To(nT,JSON.stringify(e))}catch{}}function _ve(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=oe([]),c=oe(xve()),u=oe({}),d=oe({}),f=oe([]),h=oe(null);function p(q){if(!(q==null||q.length===0))return a.value.find(ee=>ee.id===q)??a.value.find(ee=>ee.model===q)}function m(){const q=e.activeSessionId?e.sessions.find(fe=>fe.id===e.activeSessionId):void 0,ee=q===void 0?h.value??e.defaultModel:q.model||e.defaultModel;return p(ee)?.id??ee??void 0}function k(q){if(q===void 0)return;const ee=p(q);return ee===void 0?void 0:Sf(ee)}function y(q,ee){const fe=q==null?void 0:e.thinkingBySession[q];return fe!==void 0&&uue(ee,fe)?fe:Sf(ee)}function g(q,ee){if(ee===void 0)return;const fe=p(ee);return fe===void 0?void 0:y(q,fe)}async function v(q,ee){return q!=null&&e.thinkingBySession[q]===void 0&&await o(q),g(q,ee)}function b(q){e.thinking=q;const ee=e.activeSessionId;return q!==void 0&&ee!==null&&ee!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:q}),q}et([()=>e.activeSessionId,()=>m(),()=>{const q=e.activeSessionId;return q==null?void 0:e.thinkingBySession[q]}],()=>{const q=p(m());q!==void 0&&(e.thinking=y(e.activeSessionId,q))});function A(q){ht().setConfig({thinking:due(q,p(m())?.supportEfforts)}).catch(ee=>n("setConfig",ee))}async function I(q){try{const fe=await ht().listSkills(q);u.value={...u.value,[q]:fe}}catch{}}async function T(q){try{const fe=await ht().listSkillsForWorkspace(q);d.value={...d.value,[q]:fe}}catch{}}async function M(){try{const q=ht();a.value=await q.listModels();const ee=p(m());ee!==void 0&&(e.thinking=y(e.activeSessionId,ee))}catch(q){n("loadModels",q)}}async function $(){try{const q=ht();f.value=await q.listProviders()}catch(q){n("loadProviders",q)}}async function N(q){const ee=e.activeSessionId,fe=p(q),ne=e.thinking,j=ee?e.sessions.find(he=>he.id===ee)?.model:void 0,K=m()!==(fe?.id??q),ve=fue(fe,ne,K);if(!ee)return h.value=q,e.thinking=ve,ve!==ne&&ve!==void 0&&A(ve),!0;r(ee,he=>({...he,model:q})),ve!==ne&&(e.thinking=ve,ve!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:ve}));try{await ht().updateSession(ee,{model:q,thinking:ve!==ne?ve:void 0})}catch(he){return r(ee,Ae=>({...Ae,model:j??Ae.model})),ve!==ne&&(e.thinking=ne,ne!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[ee]:ne})),n("setModel",he,{sessionId:ee}),!1}return ve!==ne&&ve!==void 0&&A(ve),await o(ee),!0}function F(q){const ee=new Set(c.value);ee.has(q)?ee.delete(q):ee.add(q),c.value=Array.from(ee),wve(c.value)}async function S(q,ee,fe){const ne=fe??e.activeSessionId;if(!ne)return;const j=i.value==="idle"&&!e.inFlightBySession[ne],K=`msg_skill_opt_${Date.now().toString(36)}`,ve=j?pk(ne):void 0;if(j){e.inFlightBySession={...e.inFlightBySession,[ne]:!0};const he={id:K,sessionId:ne,role:"user",content:[{type:"text",text:`/${q}${ee?` ${ee}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:q,skillArgs:ee}}};l(ne,Ae=>[...Ae,he])}try{const he=e.sessions.find(Y=>Y.id===ne)?.model,Ae=(he&&he.length>0?he:e.defaultModel)??void 0;if(!await s({thinking:await v(ne,Ae)??e.thinking},ne))throw U3;await ht().activateSkill(ne,q,ee)}catch(he){j&&(e.inFlightBySession={...e.inFlightBySession,[ne]:!1},l(ne,Ae=>Ae.filter(re=>re.id!==K))),he!==U3&&n("activateSkill",he,{sessionId:ne})}finally{ve!==void 0&&mk(ne,ve)}}async function R(q){try{await ht().addProvider(q),await Promise.all([$(),M()])}catch(ee){n("addProvider",ee)}}async function z(q){try{await ht().deleteProvider(q),await Promise.all([$(),M()])}catch(ee){n("deleteProvider",ee)}}async function W(q){try{const ee=await ht().refreshProvider(q);for(const fe of ee.failed)n("refreshProvider",new Error(fe.reason),{message:fe.provider});await Promise.all([$(),M()])}catch(ee){n("refreshProvider",ee)}}async function L(){try{const q=await ht().refreshAllProviders();for(const ee of q.failed)n("refreshAllProviders",new Error(ee.reason),{message:ee.provider});await Promise.all([$(),M()])}catch(q){n("refreshAllProviders",q)}}async function O(){try{return await ht().startOAuthLogin()}catch{return null}}async function U(){try{return await ht().pollOAuthLogin()}catch(q){return console.warn("[kimi-web] pollOAuthLogin failed",q),null}}async function Z(){try{await ht().cancelOAuthLogin()}catch{}}function ie(q){const ee=b(q);s({thinking:ee}),ee!==void 0&&A(ee)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:I,loadSkillsForWorkspace:T,loadModels:M,loadProviders:$,setModel:N,thinkingLevelForModelId:k,thinkingLevelForSessionId:g,resolveThinkingForPrompt:v,toggleStarModel:F,activateSkill:S,addProvider:R,deleteProvider:z,refreshProvider:W,refreshAllProviders:L,startOAuthLogin:O,pollOAuthLogin:U,cancelOAuthLogin:Z,setThinking:ie}}const oT="kimiWeb.compaction",Sve=/^read[_-]?media(?:file)?$/i,Cve=/^data:([^;]+);base64,(.*)$/s,Ave=/^<(image|video|audio)\s+path="([^"]+)">$/,Mve=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Eve=/Mime type:\s*([^.\s]+)/i,Tve=/Size:\s*(\d+)\s*bytes/i,Nve=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Ive="<system>Image compressed to fit model limits:",Lve=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function $ve(e){return e.includes(Ive)?e.replace(Lve,""):e}function Fve(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Ove(e){const t=Mve.exec(e.trim());return t?{kind:t[1],path:Fve(t[2])}:null}const sT=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Bve=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Rve(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return sT.test(o)?o:void 0}const Dve=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Pve(e){const t=Dve.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Bve.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&sT.test(o)?o:void 0}}function Hve(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function Wve(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function zve(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const s=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof s!="object"||s===null)return null;const i=s.url;return typeof i=="string"?{kind:n,url:i}:null}function Uve(e,t){if(!Sve.test(e))return;const n=Wve(t);if(n===null)return;let o,s,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const h=d.text,p=Ave.exec(h);p&&(s=p[1],o=p[2]);const m=Eve.exec(h);m?.[1]&&(i=m[1]);const k=Tve.exec(h);k?.[1]&&(r=Number(k[1]));const y=Nve.exec(h);y?.[1]&&y[2]&&(l=`${y[1]}x${y[2]}`);continue}const f=zve(d);f&&(a=f)}if(a===null)return;const c=Cve.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Hve(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function qve(e){if(e!=null){if(typeof e=="string")return e.split(`
318
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
319
+ `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
320
+ `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
321
+ `)):o.type==="image_url"||o.type==="image"?t.push("[image]"):typeof o.type=="string"?t.push(`[${o.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function jve(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function Vve(e,t){const n=e.split(`
322
+ `),o=t.split(`
323
+ `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function Kve(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:Vve(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command")return{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0};if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function Gve(e){const t=`<prompt>
324
+ `,n=`
325
+ </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):Yve(e)}function Yve(e){const t=e.split(`
326
+ `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
327
+ `):e}function Zve(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function Xve(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
328
+ `);return Gve(t)}function Qve(e,t){const n=e.metadata?.origin??{},o=Xve(e);return t==="cron_missed"?{text:o,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:o,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function Jve(e,t,n){const{text:o,cron:s}=Qve(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function eye(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function tye(e){return e.metadata?.origin?.kind==="compaction_summary"}function nye(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function oye(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function sye(e){let t="",n="";const o=[],s=[];for(const i of e)i.type==="text"?t+=i.text:i.type==="thinking"?n+=i.thinking:i.type==="toolUse"?o.push(i.toolCallId):s.push(JSON.stringify(i));return o.sort(),s.sort(),{text:t,thinking:n,toolIds:o,rest:s}}function iye(e,t){return t.text!==""&&t.text!==e.text||t.thinking!==""&&t.thinking!==e.thinking?!1:t.toolIds.every(n=>e.toolIds.includes(n))&&t.rest.every(n=>e.rest.includes(n))}function iT(e,t,n,o=!0,s={}){const i=[];let r=1;const l=new Map;for(const h of t)l.set(h.toolCallId,h);let a=null;function c(h=!1){if(!a)return;const p=a;if(a=null,!h||!o)for(let m=0;m<p.tools.length;m++){const k=p.tools[m];if(k.status!=="running")continue;const y={...k,status:"ok"};p.tools[m]=y;const g=p.blocks.find(v=>v.kind==="tool"&&v.tool.id===y.id);g&&g.kind==="tool"&&(g.tool=y)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
329
+ `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
330
+ `):void 0,tools:p.tools.length>0?p.tools:void 0,blocks:p.blocks.length>0?p.blocks:void 0,approval:p.approval,approvalId:p.approvalId,durationMs:p.durationMs})}function u(h,p){for(const m of p)if(m.type==="text"){if(m.text){h.textParts.push(m.text);const k=h.blocks.at(-1);k&&k.kind==="text"?k.text+=`
331
+ `+m.text:h.blocks.push({kind:"text",text:m.text})}}else if(m.type==="thinking"){if(m.thinking){h.thinkingParts.push(m.thinking);const k=h.blocks.at(-1);k&&k.kind==="thinking"?k.thinking+=`
332
+ `+m.thinking:h.blocks.push({kind:"thinking",thinking:m.thinking})}}else if(m.type==="toolUse"){const k=l.get(m.toolCallId),y={id:m.toolCallId,name:m.toolName,arg:typeof m.input=="string"?m.input:JSON.stringify(m.input),status:"running",output:m.outputLines,planPath:m.toolName==="ExitPlanMode"?s[m.toolCallId]?.path:void 0};h.tools.push(y),h.blocks.push({kind:"tool",tool:y}),k&&(h.approval=Kve(k),h.approvalId=k.approvalId)}else if(m.type==="toolResult"){const k=h.tools.findIndex(y=>y.id===m.toolCallId);if(k!==-1){const y=h.tools[k],g={...y,status:m.isError?"error":"ok",output:qve(m.output),media:m.isError?void 0:Uve(y.name,m.output)};g.name==="ExitPlanMode"&&!g.planPath&&(g.planPath=oye(g.output)),h.tools[k]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}}function d(h,p){for(const m of p){if(m.type!=="toolUse"||!m.outputLines?.length)continue;const k=h.tools.findIndex(b=>b.id===m.toolCallId);if(k===-1)continue;const y=h.tools[k];if(y.output!==void 0)continue;const g={...y,output:m.outputLines};h.tools[k]=g;const v=h.blocks.find(b=>b.kind==="tool"&&b.tool.id===m.toolCallId);v&&v.kind==="tool"&&(v.tool=g)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,m=h.source;if(m.kind==="url")return{url:m.url,kind:p};if(m.kind==="base64")return{url:`data:${m.mediaType};base64,${m.data}`,kind:p};if(m.kind==="file"&&n)return{url:n(m.fileId),kind:p,fileId:m.fileId}}if(h.type==="file"&&n){if(h.mediaType.startsWith("image/"))return{url:n(h.fileId),kind:"image",fileId:h.fileId};if(h.mediaType.startsWith("video/"))return{url:n(h.fileId),kind:"video",fileId:h.fileId}}}for(const h of e){if(h.role==="system")continue;if(tye(h)){c();const g=h.metadata?.[oT];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(v=>v.type==="text").map(v=>v.text).join(`
333
+ `),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(h.role==="user"){const g=Zve(h);if(c(),g!==void 0){i.push(Jve(h,r++,g));continue}if(!eye(h))continue;const v=h.metadata?.origin,b=v?.kind==="skill_activation"&&v?.trigger==="user-slash",A=v?.kind==="plugin_command"&&v?.trigger==="user-slash",I=[],T=[];for(const M of h.content){if(M.type==="text")if(b)I.push(v.skillArgs??"");else if(A)I.push(v.commandArgs??"");else{const N=Ove(M.text);if(N&&(N.kind==="video"||N.kind==="image")&&n){const R=Rve(N.path);if(R){T.push({url:n(R),kind:N.kind,fileId:R});continue}}const F=Pve(M.text);if(F){T.push({kind:"file",url:F.fileId&&n?n(F.fileId):"",fileId:F.fileId,name:F.name,mediaType:F.mediaType,size:F.size});continue}const S=$ve(M.text);if(S!==M.text&&S.trim().length===0)continue;I.push(S)}const $=f(M);if($){T.push({url:$.url,kind:$.kind,name:M.type==="file"?M.name:void 0,fileId:$.fileId});continue}M.type==="file"&&n&&T.push({kind:"file",url:n(M.fileId),fileId:M.fileId,name:M.name,mediaType:M.mediaType||void 0,size:M.size})}i.push({id:h.id,role:"user",no:r++,text:I.join(`
334
+ `),attachments:T.length>0?T:void 0,skillActivation:b?{name:v.skillName,args:v.skillArgs}:void 0,pluginCommand:A?{pluginId:v.pluginId,commandName:v.commandName,args:v.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;nye(a,p)?a!==null&&a.promptId===void 0&&p!==void 0&&(a.promptId=p):(c(),a={id:h.id,promptId:p,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,foldedSigs:[],durationMs:h.durationMs});const k=a;if(k===null)continue;const y=sye(h.content);if(k.promptId!==void 0&&k.foldedSigs.some(g=>iye(g,y))){d(k,h.content);continue}k.foldedSigs.push(y),u(k,h.content)}return c(!0),i}function rye(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=oe({}),a=D(()=>{const N=e.activeSessionId;if(!N)return null;const F=l.value[N];return F?{parentId:N,agentId:F.agentId}:null}),c=D(()=>a.value?.parentId??null),u=D(()=>a.value!==null),d=D(()=>{const N=a.value;return N?!!e.sideChatSendingByAgent[N.agentId]:!1}),f=D(()=>{const N=a.value;return N?e.sideChatSendingByAgent[N.agentId]?!0:(e.tasksBySession[N.parentId]??[]).some(F=>F.id===N.agentId&&F.status==="running"):!1}),h=D(()=>{const N=a.value;if(!N)return[];const F=e.sideChatMessagesByAgent[N.agentId]??[];return iT(F,[],S=>ht().getFileUrl(S),f.value)});function p(N,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[N]:F(e.sideChatMessagesByAgent[N]??[])}}function m(N,F){p(N,S=>[...S,F])}function k(N){p(N,F=>{const S=[...F].reverse().findIndex(z=>z.role==="user");if(S===-1)return F;const R=F.length-1-S;return F.filter((z,W)=>W!==R)})}function y(N,F){p(N,S=>{const R=[...S];for(let z=R.length-1;z>=0;z-=1){const W=R[z];if(W.role==="user")return R[z]={...W,promptId:W.promptId??F},R}return S})}function g(N,F,S){S&&p(N,R=>{const z=R.at(-1);if(z?.role==="assistant"){const W=z.content[0],L=W?.type==="text"?W.text:"";return[...R.slice(0,-1),{...z,content:[{type:"text",text:`${L}${S}`}]}]}return[...R,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function v(N,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[N]:!1},!S)return;const z=(e.sideChatMessagesByAgent[N]??[]).at(-1);(z?.role==="assistant"&&z.content[0]?.type==="text"?z.content[0].text:"").trim().length>0||g(N,F,S)}async function b(N){const F=e.activeSessionId;F&&await A(F,N)}async function A(N,F){if(!l.value[N]){let S;try{({agentId:S}=await ht().startBtw(N))}catch(R){n("openSideChat",R,{sessionId:N});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[N]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await I(N,F.trim())}async function I(N,F){const S=l.value[N],R=F.trim();if(!S||!R)return;const z=N,W=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[W]:!0};const L={id:o(),sessionId:z,role:"user",content:[{type:"text",text:R}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};m(W,L);try{const O=e.sessions.find(ie=>ie.id===z),U=(O?.model&&O.model.length>0?O.model:e.defaultModel)??void 0,Z=await ht().submitPrompt(z,{content:[{type:"text",text:R}],agentId:W,model:U,thinking:await r(z,U)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[z]??!1,swarmMode:e.swarmModeBySession[z]??!1});y(W,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[z]:[...e.sideChatUserMessageIdsBySession[z]??[],Z.userMessageId]}}catch(O){n("sendSideChatPrompt",O,{sessionId:z}),k(W),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[W]:!1}}}function T(){const N=e.activeSessionId;if(!N)return;const{[N]:F,...S}=l.value;l.value=S}async function M(N){const F=a.value;F&&await I(F.parentId,N)}function $(N){if(!l.value[N])return;const{[N]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:g,finishSideChatAgent:v,openSideChat:b,openSideChatOn:A,closeSideChat:T,sendSideChatPrompt:M,clearSideChatForSession:$}}const lye="kimiWeb.optimisticUserMessage",q3="Sub Agent";function aye(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function cye(e){return{...e,sessions:e.sessions,messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function uye(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const o=e.lastSeqBySession[t]??0;n>o&&(e.lastSeqBySession[t]=n)}}function Rv(e){return e.role==="user"&&e.metadata?.[lye]===!0}function dye(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function fye(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const hye=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function j3(e){let t="",n=0;for(const o of e.content)o.type==="text"?hye.test(o.text.trim())?n+=1:t+=o.text:(o.type==="image"||o.type==="video"||o.type==="file")&&(n+=1);return{text:t,media:n}}function pye(e,t){const n=j3(e),o=j3(t);return n.text===o.text&&n.media===o.media}function mye(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&fye(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(Rv(s)&&pye(s,t))return o}return-1}function gye(e,t,n){let o=!1;const s=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(o=!0,{...i,content:l}):i});return o?s:e}const vye={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function yye(e){const t=On.global.t,n=[],o=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};o(t("warnings.details.code"),e.code);const s=e.details??{};o(t("warnings.details.status"),s.statusCode),o(t("warnings.details.requestId"),s.requestId),o(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(s))r==="statusCode"||r==="requestId"||o(r,l);const i=(e.code!==void 0?vye[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function kye(e,t,n){const o=cye(e);switch(uye(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(i=>i.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?t.session:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(i=>i.id!==s),delete o.messagesBySession[s],delete o.tasksBySession[s],delete o.goalBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{o.sessions=o.sessions.map(s=>s.id!==t.sessionId?s:{...s,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?s.mainTurnActive:!1),pendingInteraction:t.pendingInteraction??s.pendingInteraction,lastTurnReason:t.lastTurnReason}),t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&delete o.turnActiveBySession[t.sessionId];break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const i=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,i=o.compactionBySession[s],{[s]:r,...l}=o.compactionBySession;if(o.compactionBySession=l,Object.prototype.hasOwnProperty.call(o.messagesBySession,s)){const a=o.messagesBySession[s]??[],c=`compaction_${s}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};o.messagesBySession[s]=[...a,{id:c,sessionId:s,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[oT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:s,...i}=o.compactionBySession;o.compactionBySession=i;break}case"messageCreated":{const s=t.message.sessionId,i=t.message.createdAt;o.sessions=o.sessions.map(a=>a.id===s&&i>a.updatedAt?{...a,updatedAt:i}:a);const r=o.messagesBySession[s]??[];if(!r.some(a=>a.id===t.message.id)){if(t.message.role==="user"&&!dye(t.message)){const a=mye(r,t.message);if(a!==-1){const c=[...r],u=c[a];c[a]={...t.message,id:u.id,promptId:t.message.promptId??u.promptId,metadata:{...t.message.metadata,...u.metadata}},o.messagesBySession[s]=c;break}}o.messagesBySession[s]=[...r,t.message]}break}case"messageUpdated":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const s=t.sessionId,i=o.messagesBySession[s]??[];o.messagesBySession[s]=gye(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const s=t.sessionId,i=o.approvalsBySession[s]??[];i.some(a=>a.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...i,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,i=t.approvalId,r=o.approvalsBySession[s]??[];o.approvalsBySession[s]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const s=t.sessionId,i=o.questionsBySession[s]??[];i.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,i=t.questionId,r=o.questionsBySession[s]??[];o.questionsBySession[s]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const s=t.sessionId,i=o.tasksBySession[s]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)o.tasksBySession[s]=[...i,t.task];else{const l=[...i],a=i[r];l[r]={...t.task,outputLines:a.outputLines,text:a.text,description:t.task.description===q3&&a.description!==q3?a.description:t.task.description,swarmIndex:t.task.swarmIndex??a.swarmIndex,parentToolCallId:t.task.parentToolCallId??a.parentToolCallId,subagentType:t.task.subagentType??a.subagentType,runInBackground:t.task.runInBackground??a.runInBackground,backgroundTaskId:t.task.backgroundTaskId??a.backgroundTaskId},o.tasksBySession[s]=l}break}case"taskProgress":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>{if(r.id!==t.taskId)return r;if(r.kind==="subagent"&&t.kind==="text")return{...r,text:(r.text??"")+t.outputChunk};const l=r.outputLines??[];if(l.at(-1)===t.outputChunk)return r;const a=[...l,t.outputChunk];return{...r,outputLines:r.kind==="subagent"?a:a.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,i=o.tasksBySession[s]??[];o.tasksBySession[s]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active?o.turnActiveBySession[t.sessionId]=!0:delete o.turnActiveBySession[t.sessionId];break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError)o.warnings=[...o.warnings,yye(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${On.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function bye(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function xye(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let o=n.content.length-1;o>=0;o--){const s=n.content[o];if(s.type!=="toolUse"||Ja(s.toolName)!=="todo")continue;let i=s.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:bye(a.status)}]:[]})}}return[]}const wye=["queued","working","suspended","completed","failed"];function rT(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function _ye(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function Sye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const o=n.parentToolCallId??"swarm",s=t.get(o)??[];s.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:rT(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(o,s)}return[...t.entries()].map(([n,o])=>{const s=o.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=_ye();for(const r of s)i[r.phase]++;return{id:n,members:s,counts:i}}).filter(n=>n.members.length>1).toSorted((n,o)=>{const s=n.members.at(0)?.swarmIndex??0,i=o.members.at(0)?.swarmIndex??0;return s!==i?s-i:n.id.localeCompare(o.id)})}function Cye(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of wye)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function Aye(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const o=t.get(n.parentToolCallId)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:rT(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,o)}for(const[n,o]of t)t.set(n,o.toSorted((s,i)=>s.swarmIndex-i.swarmIndex||s.id.localeCompare(i.id)));return t}const Fr=JE(),lr=jge(),Cf=Jge(),lT=Dt.permission,aT=Dt.activeWorkspace,cT=Dt.planMode,uT=Dt.swarmMode,dT=Dt.goalMode,V3=40401,fT=Dt.onboarded;qa(Dt.codeFont);qa(Dt.theme);qa(Dt.thinking);function Mye(){try{const e=yo(lT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Eye(e){try{To(lT,e)}catch{}}function Dv(e){const t=yo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const o={};for(const[s,i]of Object.entries(n))i===!0&&(o[s]=!0);return o}catch{return{}}}function _b(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);To(e,JSON.stringify(n))}catch{}}function hT(){_b(cT,_e.planModeBySession)}function pT(){_b(uT,_e.swarmModeBySession)}function mT(){_b(dT,_e.goalModeBySession)}function Tye(){try{return yo(aT)}catch{return null}}const gT=Dt.hiddenWorkspaces;function Nye(){try{const e=yo(gT);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Iye(e){try{To(gT,JSON.stringify(e))}catch{}}function Lye(e){try{To(aT,e)}catch{}}function $ye(e,t){if(t&&e.startsWith(t)){const o=e.slice(t.length);return o?`~${o}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const _e=zo({...aye(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:Mye(),thinking:void 0,thinkingBySession:{},planModeBySession:Dv(cT),swarmModeBySession:Dv(uT),goalModeBySession:Dv(dT),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Xk(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:Tye(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:Nye(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),r0=zo({planMode:!1,swarmMode:!1,goalMode:!1});function vT(e){_e.sessions=e}function l0(e,t){_e.sessions=_e.sessions.map(n=>n.id===e?t(n):n)}function Fye(e){_e.sessions=[e,..._e.sessions.filter(t=>t.id!==e.id)]}function Oye(e){_e.sessions=[..._e.sessions,e]}function Bye(e){_e.sessions=_e.sessions.filter(t=>t.id!==e)}function yT(){const e=_e.activeSessionId;e&&_e.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!1},Qk({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Dt.unread&&(_e.unreadBySession=Xk(),yT())});function gk(){if(Mi===null||!Mi.health().stale)return;_o("ws:stale-reconnect",{sessionId:_e.activeSessionId,status:"stale"}),Rr("ws: stale socket on focus, reconnecting",{activeSessionId:_e.activeSessionId}),Mi.reconnect();const e=_e.activeSessionId;e&&t1.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(yT(),gk())});typeof window<"u"&&(window.addEventListener("focus",gk),window.addEventListener("online",gk));function Sb(e){_e.activeSessionId=e}function Rye(e){_e.messagesBySession=e}function Dye(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t}}function kT(e,t){_e.messagesBySession={..._e.messagesBySession,[e]:t(_e.messagesBySession[e]??[])}}function Pye(e){const{[e]:t,...n}=_e.messagesBySession;_e.messagesBySession=n}function bT(e){Mi?.unsubscribe(e),cke(e),Jm.discard(({meta:t})=>t.sessionId===e),Bye(e),Pye(e),delete _e.approvalsBySession[e],delete _e.questionsBySession[e],delete _e.tasksBySession[e],delete _e.goalBySession[e],delete _e.gitStatusBySession[e],delete _e.lastSeqBySession[e],delete _e.compactionBySession[e],delete _e.messagesLoadingMoreBySession[e],delete _e.messagesHasMoreBySession[e],delete _e.messagesLoadMoreErrorBySession[e],delete vk[e],e1.delete(e),zp.delete(e),LT.delete(e),vve(e),delete _e.queuedBySession[e],delete _e.promptIdBySession[e],delete _e.inFlightBySession[e],delete _e.turnActiveBySession[e],delete _e.planModeBySession[e],delete _e.swarmModeBySession[e],delete _e.goalModeBySession[e],delete _e.thinkingBySession[e],hT(),pT(),mT()}const xT=oe(null),wT=oe([]),_T=oe(!1),ST=oe(!1),CT=oe(null);async function jf(e){let t;try{t=await ht().getSessionStatus(e)}catch{return}l0(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),_e.swarmModeBySession={..._e.swarmModeBySession,[e]:t.swarmMode},_e.planModeBySession={..._e.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(_e.thinkingBySession={..._e.thinkingBySession,[e]:t.thinkingEffort})}async function Hye(e){const t=_e.goalVersionBySession[e]??0;let n;try{n=await ht().getSessionGoal(e)}catch{return}if((_e.goalVersionBySession[e]??0)!==t)return;const o={..._e.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,_e.goalBySession=o}function AT(e,t){const n=t??_e.activeSessionId;return n?Promise.resolve(ht().updateSession(n,e)).then(()=>jf(n)).then(()=>!0).catch(o=>(Vf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const MT=Dt.conversationToc;function Wye(){try{const e=yo(MT);return e===null?!0:e==="true"}catch{return!0}}function zye(e){try{To(MT,e?"true":"false")}catch{}}const ET=oe(Wye());function Uye(e){ET.value=e,zye(e)}function qye(e){try{return yo(e)??""}catch{return""}}const TT=oe(qye(fT)==="1");function jye(e){TT.value=e;try{To(fT,e?"1":"0")}catch{}}let Mi=null,K3=0;function NT(){return K3+=1,`msg_opt_${Date.now().toString(36)}_${K3}`}function Vye(e,t,n){const o={sessions:_e.sessions,activeSessionId:_e.activeSessionId,messagesBySession:_e.messagesBySession,approvalsBySession:_e.approvalsBySession,planReviewByToolCallId:_e.planReviewByToolCallId,questionsBySession:_e.questionsBySession,tasksBySession:_e.tasksBySession,goalBySession:_e.goalBySession,goalVersionBySession:_e.goalVersionBySession,lastSeqBySession:_e.lastSeqBySession,turnActiveBySession:_e.turnActiveBySession,compactionBySession:_e.compactionBySession,config:_e.config,warnings:_e.warnings},s=kye(o,e,{sessionId:t,seq:n});vT(s.sessions),Sb(s.activeSessionId),Rye(s.messagesBySession),_e.approvalsBySession=s.approvalsBySession,_e.planReviewByToolCallId=s.planReviewByToolCallId,_e.questionsBySession=s.questionsBySession,_e.tasksBySession=s.tasksBySession,_e.goalBySession=s.goalBySession,_e.goalVersionBySession=s.goalVersionBySession,_e.lastSeqBySession=s.lastSeqBySession,_e.turnActiveBySession=s.turnActiveBySession,_e.compactionBySession=s.compactionBySession,_e.config=s.config??null,_e.warnings=s.warnings,e.type==="configChanged"&&(_e.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(zn.loadModels(),zn.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(_e.swarmModeBySession={..._e.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(_e.planModeBySession={..._e.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(_e.thinkingBySession={..._e.thinkingBySession,[e.sessionId]:e.thinking}))}function Kye(e,t){const n=_e.lastSeqBySession[t.sessionId]??0,o=_e.turnActiveBySession[t.sessionId]??!1;Vye(e,t.sessionId,t.seq);const s=ps.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&ps.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?ps.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?ps.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&ps.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;_e.promptIdBySession[i]!==e.message.promptId&&(_e.promptIdBySession={..._e.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===_e.activeSessionId&&Fr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;m2e(e.sessionId,i==="cancelled"||i==="failed"||i==="blocked"?"aborted":"idle",o)}e.type==="sessionWorkChanged"&&(e.mainTurnActive===!1&&o||e.mainTurnActive===void 0&&!e.busy)&&t.seq>n&&p2e(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&_e.promptIdBySession[e.sessionId]===e.promptId&&ft.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&g2e(e.sessionId,e.question),e.type==="approvalRequested"&&v2e(e.sessionId,e.approval)}const Jm=hge(({appEvent:e,meta:t})=>Kye(e,t),({appEvent:e})=>cge(e),{coalesce:mge});function IT(){if(Mi!==null||typeof WebSocket>"u")return;_o("ws:connection",{status:"connecting"}),_e.connection="connecting",Mi=ht().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ft.applyWorkspaceEvent(t);return}for(const o of pge({appEvent:t,meta:n}))Jm(o)},onResync(t,n,o){_o("ws:resync",{sessionId:t,status:"required",seq:n}),Jm.flush(),e1.add(t),t1.request(t)},onError(t,n,o){_o("ws:error",{status:"failed",errorCode:t,fatal:o}),Cb({severity:"error",title:On.global.t("warnings.wsTitle"),message:n,details:[lo("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){_o("ws:connection",{status:t?"connected":"disconnected"}),_e.connected=t,_e.connection=t?"connected":"disconnected",t&&(tke(),ft.refreshServerMeta())}})}const vk={},e1=new Set,zp=new Set,LT=new Set;function Gye(e){return _i(e)&&e.code===V3?!0:typeof e=="object"&&e!==null&&e.code===V3}function lo(e,t){if(!(t==null||t===""))return{label:On.global.t(`warnings.details.${e}`),value:$T(t)}}function $T(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Yye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function Zye(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function Xye(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function Qye(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function G3(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function Jye(e,t,n){const o=X2(t),s=_i(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[lo("operation",e),lo("sessionId",n??_e.activeSessionId),lo("connection",_e.connection),lo("timestamp",Qye(i??Date.now()))];return o?l.push(lo("duration",G3(r)),lo("request",`${t.method} ${t.path}`),lo("endpoint",t.url),lo("requestId",t.requestId),lo("phase",t.phase),lo("timeout",`${t.timeoutMs}ms`),lo("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),lo("contentType",t.contentType),lo("responsePreview",t.bodyPreview),lo("cause",t.cause)):s?l.push(lo("duration",G3(r)),lo("code",t.code),lo("requestId",t.requestId),lo("message",t.message),lo("details",t.details)):l.push(lo("errorName",Yye(t)),lo("message",Zye(t)??$T(t)),lo("stack",Xye(t))),l.filter(a=>a!==void 0)}function eke(e,t,n={}){const o=X2(t),s=_i(t),i=n.title??(o?On.global.t("warnings.daemonNetworkTitle"):s?On.global.t("warnings.daemonApiTitle"):On.global.t("warnings.operationFailedTitle")),r=n.message??(o?On.global.t("warnings.daemonNetworkMessage"):s?t.message:On.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:Jye(e,t,n.sessionId)}}function Cb(e){_e.warnings=[..._e.warnings,e]}function tke(){const e=On.global.t("warnings.wsTitle"),t=_e.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==_e.warnings.length&&(_e.warnings=t)}function Vf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=_i(t),s=X2(t);_o("operation:failed",{sessionId:n?.sessionId,status:"failed",operation:e,errorName:t instanceof Error?t.name:typeof t,errorCode:o?t.code:void 0,requestId:o||s?t.requestId:void 0,phase:s?t.phase:void 0,httpStatus:s?t.status:void 0}),Cb(eke(e,t,n))}const nke={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function oke(e){if(!_i(e))return;const t=nke[e.code];return t?On.global.t(t):void 0}async function ske(e){if(bT(e),_e.activeSessionId!==e)return;const t=_e.sessions[0];t?await ft.selectSession(t.id,{urlMode:"replace"}):(Sb(void 0),_e.sessionLoading=!1,ft.writeSessionUrl(void 0,"replace"))}const Y3=new Set;async function ike(e){if(!Y3.has(e)){Y3.add(e);try{const t=await ht().getSessionWarnings(e),n=On.global.t("warnings.noteLabel");for(const o of t)Cb(`${n}: ${o.message}`)}catch{}}}async function Ab(e){const t=ft.localTurnStartState(e);try{const o=await ht().getSessionSnapshot(e);if(!_e.sessions.some(a=>a.id===e))return"ok";Jm.flush();const s=_e.lastSeqBySession[e]??0,i=vk[e];if(!(e1.has(e)||n1.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return zp.delete(e)||(zp.add(e),t1.request(e)),"ok";if(!ft.isLocalTurnSnapshotCurrent(e,t))return ft.afterLocalTurnStartsSettle(e,()=>{t1.request(e)}),"ok";const l=ek(o.session.usage);l0(e,a=>({...o.session,model:o.session.model&&o.session.model.length>0?o.session.model:a.model,usage:l?a.usage:o.session.usage})),Dye(e,ige(_e.messagesBySession[e]??[],o.messages)),_e.tasksBySession={..._e.tasksBySession,[e]:rge(o.subagents,_e.tasksBySession[e]??[])},_e.messagesHasMoreBySession={..._e.messagesHasMoreBySession,[e]:o.hasMoreMessages},_e.approvalsBySession={..._e.approvalsBySession,[e]:o.pendingApprovals};for(const a of o.pendingApprovals){const c=a.display;c?.kind==="plan_review"&&typeof c.plan=="string"&&c.plan.length>0&&(_e.planReviewByToolCallId={..._e.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}_e.questionsBySession={..._e.questionsBySession,[e]:o.pendingQuestions},_e.lastSeqBySession={..._e.lastSeqBySession,[e]:o.asOfSeq},vk[e]=o.epoch,e1.delete(e),zp.delete(e),ft.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={..._e.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],_e.turnActiveBySession=a}return IT(),Mi&&(Mi.seedSnapshot(e,o),Mi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),ake(e)),n1.delete(e),l&&jf(e),ike(e),"ok"}catch(n){return Gye(n)?(await ske(e),"not-found"):(Vf("getSessionSnapshot",n,{title:On.global.t("warnings.sessionSnapshotTitle"),message:On.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const t1=lge(Ab);function rke(e){return Object.prototype.hasOwnProperty.call(_e.messagesBySession,e)}const lke=4,Or=[],n1=new Set;function ake(e){const t=Or.indexOf(e);for(t!==-1&&Or.splice(t,1),Or.unshift(e);Or.length>lke;){let n=-1;for(let s=Or.length-1;s>=0;s--)if(Or[s]!==_e.activeSessionId){n=s;break}if(n===-1)break;const[o]=Or.splice(n,1);if(o===void 0)break;Mi?.unsubscribe(o),n1.add(o)}}function cke(e){const t=Or.indexOf(e);t!==-1&&Or.splice(t,1),n1.delete(e)}async function uke(e){return Ab(e)}function Mb(e,t){return(_e.inFlightBySession[e]??!1)||(_e.turnActiveBySession[e]??!1)||(t??_e.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function Eb(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return On.global.t("sessions.justNow");if(s<1)return`${Math.round(o/6e4)}m`;if(s<24)return`${Math.round(s)}h`;const i=o/864e5;return i<7?`${Math.round(i)}d`:i<30?`${Math.round(i/7)}w`:i<365?`${Math.round(i/30)}mo`:`${Math.round(i/365)}y`}catch{return e}}const dke=3e4,Af=oe(0);let Pv=null;function fke(){Pv===null&&(Pv=setInterval(()=>{Af.value=(Af.value+1)%Number.MAX_SAFE_INTEGER},dke),Pv.unref?.())}function hke(e,t){const n=e.split(`
335
+ `),o=t.split(`
336
+ `),s=[];return n.forEach((i,r)=>{s.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),o.forEach((i,r)=>{s.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),s}function pke(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const o=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:o,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:o,diff:hke(t.old_text,t.new_text)}:{kind:"diff",path:o,diff:[]}}if(n==="shell"||n==="command"){const o=typeof t.command=="string"?t.command:e.action,s=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:o,cwd:s,danger:i}}if(n==="file_content"||n==="file"){const o=typeof t.path=="string"?t.path:"",s=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:o,content:s,language:i}}if(n==="file_op"||n==="fileop"){const o=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,s=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o,path:s,detail:i}}if(n==="url_fetch"||n==="url"){const o=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:o}}if(n==="search"){const o=typeof t.query=="string"?t.query:e.action,s=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:o,scope:s}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const o=typeof t.kind=="string"?t.kind:n,s=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:o,name:s,description:i}}if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const o=typeof t.plan=="string"?t.plan:"",s=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},c=typeof a.label=="string"?a.label:"";if(!c)return null;const u=typeof a.description=="string"?a.description:void 0;return{label:c,description:u}}).filter(l=>l!==null);return{kind:"plan_review",plan:o,path:s,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function mke(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function gke(e){const t=_e.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const s of t)if(s.role==="assistant")for(const i of s.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const o=`task_id: ${e.id}`;for(const s of t)if(s.role==="tool")for(const i of s.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(o)){const l=n.get(i.toolCallId);if(l)return l}}}function vke(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=On.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=On.global.t("tasks.timingDone",{sec:r})}else n=e.status;const o=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,s=e.command??gke(e),i=e.kind==="bash"&&s?`$ ${s}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:o,runInBackground:e.runInBackground,parentToolCallId:e.parentToolCallId}}const yke=D(()=>{const e=_e.sessions.find(n=>n.id===_e.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:_e.workspaceName,branch:t}}),kke=D(()=>(Af.value,_e.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Eb(e.updatedAt),busy:Mb(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),bke=D(()=>_e.activeSessionId??""),xke=D(()=>{const e=_e.activeSessionId;if(e)return zn.skillsBySession.value[e]??[];const t=c0.value;return t?zn.skillsByWorkspace.value[t]??[]:[]}),Tb=D(()=>{const e=_e.activeSessionId;return e?_e.inFlightBySession[e]??!1:!1}),wke=D(()=>ft.isStartingFirstPrompt()),ps=rye(_e,{pushOperationFailure:Vf,nextOptimisticMsgId:NT,connectEventsIfNeeded:IT,getEventConn:()=>Mi,resolveThinkingForPrompt:(e,t)=>zn.resolveThinkingForPrompt(e,t)}),Kf=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=ps.sideChatTargetBySession.value[e]?.agentId;return(_e.tasksBySession[e]??[]).filter(n=>n.id!==t)}),FT=nve(_e,Kf),_ke=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=new Set(_e.sideChatUserMessageIdsBySession[e]??[]),n=(_e.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=_e.approvalsBySession[e]??[];return iT(n,o,s=>ht().getFileUrl(s),a0.value,_e.planReviewByToolCallId)}),a0=D(()=>{const e=_e.activeSessionId;return e?(_e.turnActiveBySession[e]??!1)||(_e.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),Ske=D(()=>Tb.value||a0.value),Cke=D(()=>(FT.taskClock.value,Kf.value.map(vke))),OT=D(()=>Sye(Kf.value)),Ake=D(()=>Aye(Kf.value)),Hc=D(()=>{const e=_e.activeSessionId;return e?_e.goalBySession[e]??null:null}),Mke=D(()=>{const e=_e.activeSessionId;return e?xye(_e.messagesBySession[e]??[]):[]}),Eke=D(()=>{const e=_e.activeSessionId;return e?_e.compactionBySession[e]??null:null}),Tke=D(()=>_e.connection),Nke=D(()=>_e.loading),Ike=D(()=>_e.sessionLoading),Lke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadingMoreBySession[e]??!1:!1}),$ke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesHasMoreBySession[e]??!1:!1}),Fke=D(()=>{const e=_e.activeSessionId;return e?_e.messagesLoadMoreErrorBySession[e]??!1:!1}),Oke=D(()=>_e.serverVersion),Bke=D(()=>_e.backend),Rke=D(()=>_e.dangerousBypassAuth);function Dke(){_e.dangerousBypassAuth=!1}const Pke=D(()=>_e.permission),Hke=D(()=>_e.thinking),BT=D(()=>{const e=_e.activeSessionId;return e?_e.planModeBySession[e]??!1:r0.planMode}),Wke=D(()=>{const e=_e.activeSessionId;return e?_e.swarmModeBySession[e]??!1:r0.swarmMode}),zke=D(()=>{const e=_e.activeSessionId;return e?_e.goalModeBySession[e]??!1:r0.goalMode}),Uke=D(()=>{const e=Cye(OT.value);return{plan:BT.value,goal:Hc.value&&Hc.value.status!=="complete"?{status:Hc.value.status,turnsUsed:Hc.value.turnsUsed,elapsedMs:Hc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),qke=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=ht();return(_e.queuedBySession[e]??[]).map(n=>({text:n.text,attachmentCount:n.attachments?.length??0,attachments:n.attachments?.map(o=>({fileId:o.fileId,kind:o.kind,url:t.getFileUrl(o.fileId),name:o.name}))}))}),jke=D(()=>_e.warnings),Vke=D(()=>{const e=_e.activeSessionId;return e?(_e.questionsBySession[e]??[]).map(mke):[]}),Kke=D(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:pke(t),agentName:t.agentName})):[]}),Nb=D(()=>{const e=_e.activeSessionId;return e?(_e.approvalsBySession[e]??[]).length>0?"awaiting-approval":(_e.questionsBySession[e]??[]).length>0?"awaiting-question":Tb.value||a0.value?"running":"idle":"idle"}),zn=_ve(_e,{pushOperationFailure:Vf,refreshSessionStatus:jf,persistSessionProfile:AT,activity:Nb,updateSession:l0,updateSessionMessages:kT}),yk=D(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),Gke=D(()=>{const e=_e.activeSessionId;return e?_e.gitStatusBySession[e]?.pullRequest??null:null}),Yke=D(()=>{const e=_e.activeSessionId;if(!e)return[];const t=_e.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),Zke=D(()=>{const e=_e.activeSessionId;if(!e)return null;const t=_e.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),RT=D(()=>{const e=_e.sessions.find(r=>r.id===_e.activeSessionId),t=yk.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?zn.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??_e.defaultModel)??"—",s=zn.models.value.find(r=>r.id===o)??zn.models.value.find(r=>r.model===o);return{model:s?.displayName||s?.model||(o.includes("/")?o.split("/").pop():o),modelId:s?.id??o,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:_e.permission,branch:t,cwd:e?.cwd??"",isGitRepo:yk.value!==null}}),Xke=D(()=>wT.value),Qke=D(()=>_e.sessions.find(t=>t.id===_e.activeSessionId)?.usage.totalCostUsd??0),Jke=D(()=>_e.authReady),e2e=D(()=>_e.defaultModel),t2e=D(()=>_e.managedProviderStatus),n2e=D(()=>_e.config),o2e=D(()=>{const e=_e.activeSessionId;if(!e)return{};const t=_e.gitStatusBySession[e];return t?{...t.entries}:{}});function xu(e){const t=zi(e.cwd);return _e.workspaces.find(n=>zi(n.root)===t)?.id??e.workspaceId??e.cwd}const Ib=D(()=>sge({workspaces:_e.workspaces,sessions:_e.sessions,hiddenWorkspaceRoots:_e.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:_e.sessionsHasMoreByWorkspace})),o1=oe(X$()),wu=oe(Q$()==="manual"?"manual":"recent");et(()=>[Ib.value.map(e=>e.id).join("\0"),_e.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=hF(n,o1.value);o!==null&&(o1.value=o,a6(o))});const Xa=D(()=>{const e=Ib.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:$ye(t.root,_e.fsHome),sessionCount:t.sessionCount}));if(wu.value==="recent"){const t=new Map;for(const n of _e.sessions){if(n.parentSessionId)continue;const o=xu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return gF(e,t)}return pF(e,o1.value)}),c0=D(()=>{const e=_e.activeWorkspaceId,t=Xa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});et(c0,e=>{e&&(Object.prototype.hasOwnProperty.call(zn.skillsByWorkspace.value,e)||zn.loadSkillsForWorkspace(e))},{immediate:!0});const s2e=D(()=>{const e=c0.value;return e?Xa.value.find(t=>t.id===e)??null:null}),i2e=D(()=>{Af.value;const e=new Set(Xa.value.map(n=>n.id)),t=new Map(Xa.value.map(n=>[n.id,n.name]));return _e.sessions.filter(n=>!n.parentSessionId&&e.has(xu(n))).map(n=>{const o=xu(n);return{id:n.id,title:n.title,time:Eb(n.updatedAt),busy:Mb(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),r2e=D(()=>{Af.value;const e=new Map;for(const t of _e.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=xu(t),o={id:t.id,title:t.title,time:Eb(t.updatedAt),busy:Mb(t.id,t.mainTurnActive),pendingInteraction:t.pendingInteraction,lastTurnReason:t.lastTurnReason,updatedAt:t.updatedAt},s=e.get(n)??[];s.push(o),e.set(n,s)}return Xa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:_e.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:_e.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:_e.sessionsInitialCountByWorkspace[t.id]??hk}))});function l2e(e){o1.value=e,a6(e),wu.value!=="manual"&&(wu.value="manual",c6("manual"))}function a2e(e){wu.value!==e&&(wu.value=e,c6(e))}const DT=D(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),c2e=D(()=>{const e={};for(const[t,n]of Object.entries(_e.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(_e.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),u2e=D(()=>{const e={};for(const[t,n]of Object.entries(_e.unreadBySession))n&&(e[t]=!0);return e}),d2e=D(()=>{const e={},t=DT.value;for(const n of _e.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=xu(n);e[s]=(e[s]??0)+o}return e}),f2e=D(()=>_e.recentRoots),h2e=D(()=>_e.availableOpenInApps),ft=bve(_e,{taskPoller:FT,sideChat:ps,modelProvider:zn,pushOperationFailure:Vf,activity:Nb,sessionsKnownEmpty:LT,setSessions:vT,updateSession:l0,upsertSessionFront:Fye,appendSession:Oye,forgetSession:bT,setActiveSessionId:Sb,updateSessionMessages:kT,nextOptimisticMsgId:NT,getEventConn:()=>Mi,syncSessionFromSnapshot:Ab,reopenSession:uke,hasLoadedMessages:rke,refreshSessionStatus:jf,refreshSessionGoal:Hye,persistSessionProfile:AT,mergedWorkspaces:Ib,workspacesView:Xa,status:RT,workspaceIdForSession:xu,savePermissionToStorage:Eye,savePlanModeToStorage:hT,saveSwarmModeToStorage:pT,saveGoalModeToStorage:mT,draftModes:r0,saveUnread:Qk,saveActiveWorkspaceToStorage:Lye,saveHiddenWorkspacesToStorage:Iye,goalErrorMessage:oke,resetFastMoon:Fr.resetFastMoon,initialized:ST,connectIssue:CT,selectedDiffPath:xT,fileDiffLines:wT,fileDiffLoading:_T});function Lb(e){return e===_e.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function p2e(e){if(_e.turnActiveBySession[e]){const t={..._e.turnActiveBySession};delete t[e],_e.turnActiveBySession=t}_e.inFlightBySession[e]&&(_e.inFlightBySession={..._e.inFlightBySession,[e]:!1})}function m2e(e,t,n){const o=_e.promptIdBySession[e];ft.finishPromptLocal(e,{turnWasActive:n}),e===_e.activeSessionId?(ft.loadGitStatus(e),jf(e)):t==="idle"&&(_e.unreadBySession={..._e.unreadBySession,[e]:!0},Qk({[e]:!0}));const s=(_e.approvalsBySession[e]??[]).length>0,i=(_e.questionsBySession[e]??[]).length>0;Fge(t,s,i)&&lr.maybeNotifyCompletion(e,{isUserWatching:Lb(e),sessionTitle:_e.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ft.selectSession(e)}}),t==="idle"&&Cf.maybePlayCompletionSound()}function g2e(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;lr.maybeNotifyQuestion({isUserWatching:Lb(e),sessionTitle:_e.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ft.selectSession(e)}}),Cf.maybePlayQuestionSound()}function v2e(e,t){lr.maybeNotifyApproval({isUserWatching:Lb(e),sessionTitle:_e.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ft.selectSession(e)}}),Cf.maybePlayApprovalSound()}function $b(){return fke(),{workspace:yke,sessions:kke,activeSessionId:bke,workspacesView:Xa,workspaceSortMode:wu,visibleWorkspace:s2e,activeWorkspaceId:c0,sessionsForView:i2e,workspaceGroups:r2e,attentionBySession:DT,pendingBySession:c2e,attentionByWorkspace:d2e,unreadBySession:u2e,recentRoots:f2e,turns:_ke,tasks:Cke,activeAppTasks:Kf,todos:Mke,goal:Hc,swarms:OT,swarmMembersByToolCallId:Ake,activationBadges:Uke,compaction:Eke,status:RT,sessionCost:Qke,fileDiff:Xke,selectedDiffPath:xT,fileDiffLoading:_T,changes:Yke,gitInfo:yk,gitDiffStats:Zke,activePullRequest:Gke,changesByPath:o2e,pendingApprovals:Kke,availableOpenInApps:h2e,connection:Tke,loading:Nke,sessionLoading:Ike,loadingMoreMessages:Lke,hasMoreMessages:$ke,loadMoreMessagesError:Fke,serverVersion:Oke,backend:Bke,dangerousBypassAuth:Rke,clearDangerousBypassAuth:Dke,initialized:ST,connectIssue:CT,permission:Pke,thinking:Hke,planMode:BT,swarmMode:Wke,goalMode:zke,queued:qke,warnings:jke,questions:Vke,activity:Nb,turnActive:a0,inFlight:Tb,working:Ske,isStartingFirstPrompt:wke,fastMoon:Fr.fastMoon,models:zn.models,starredModelIds:zn.starredModelIds,providers:zn.providers,uiFontSize:Fr.uiFontSize,setUiFontSize:Fr.setUiFontSize,conversationToc:ET,setConversationToc:Uye,colorScheme:Fr.colorScheme,setColorScheme:Fr.setColorScheme,accent:Fr.accent,setAccent:Fr.setAccent,notifyOnComplete:lr.notifyOnComplete,notifyOnQuestion:lr.notifyOnQuestion,notifyOnApproval:lr.notifyOnApproval,notifyPermission:lr.notifyPermission,setNotifyOnComplete:lr.setNotifyOnComplete,setNotifyOnQuestion:lr.setNotifyOnQuestion,setNotifyOnApproval:lr.setNotifyOnApproval,soundOnComplete:Cf.soundOnComplete,setSoundOnComplete:Cf.setSoundOnComplete,onboarded:TT,setOnboarded:jye,load:ft.load,selectSession:ft.selectSession,clearActiveSession:ft.clearActiveSession,loadOlderMessages:ft.loadOlderMessages,loadWorkspaces:ft.loadWorkspaces,loadMoreSessions:ft.loadMoreSessions,loadAllSessions:ft.loadAllSessions,selectWorkspace:ft.selectWorkspace,openWorkspace:ft.openWorkspace,openWorkspaceDraft:ft.openWorkspaceDraft,startSessionAndSendPrompt:ft.startSessionAndSendPrompt,startSessionAndActivateSkill:ft.startSessionAndActivateSkill,startSessionAndOpenSideChat:ft.startSessionAndOpenSideChat,addWorkspaceByPath:ft.addWorkspaceByPath,browseFs:ft.browseFs,getFsHome:ft.getFsHome,sendPrompt:ft.sendPrompt,steerPrompt:ft.steerPrompt,sideChatVisible:ps.sideChatVisible,sideChatSessionId:ps.sideChatSessionId,sideChatTurns:ps.sideChatTurns,sideChatRunning:ps.sideChatRunning,sideChatSending:ps.sideChatSending,openSideChat:ps.openSideChat,closeSideChat:ps.closeSideChat,sendSideChatPrompt:ps.sendSideChatPrompt,uploadImage:ft.uploadImage,abortCurrentPrompt:ft.abortCurrentPrompt,respondApproval:ft.respondApproval,respondQuestion:ft.respondQuestion,dismissQuestion:ft.dismissQuestion,pendingQuestionActions:ft.pendingQuestionActions,pendingApprovalActions:ft.pendingApprovalActions,cancelTask:ft.cancelTask,setPermission:ft.setPermission,setThinking:zn.setThinking,setPlanMode:ft.setPlanMode,togglePlanMode:ft.togglePlanMode,setSwarmMode:ft.setSwarmMode,toggleSwarmMode:ft.toggleSwarmMode,setGoalMode:ft.setGoalMode,toggleGoalMode:ft.toggleGoalMode,createGoal:ft.createGoal,controlGoal:ft.controlGoal,enqueue:ft.enqueue,dismissWarning:ft.dismissWarning,renameSession:ft.renameSession,renameWorkspace:ft.renameWorkspace,deleteWorkspace:ft.deleteWorkspace,reorderWorkspaces:l2e,setWorkspaceSortMode:a2e,archiveSession:ft.archiveSession,exportSession:ft.exportSession,restoreSession:ft.restoreSession,loadArchivedSessions:ft.loadArchivedSessions,compact:ft.compact,forkSession:ft.forkSession,undo:ft.undo,unqueue:ft.unqueue,reorderQueue:ft.reorderQueue,searchFiles:ft.searchFiles,loadGitStatus:ft.loadGitStatus,loadFileDiff:ft.loadFileDiff,clearFileDiff:ft.clearFileDiff,listDir:ft.listDir,readFileContent:ft.readFileContent,getFileDownloadUrl:ft.getFileDownloadUrl,openWorkspaceFile:ft.openWorkspaceFile,openInApp:ft.openInApp,revealWorkspaceFile:ft.revealWorkspaceFile,resolveImageUrl:ft.resolveImageUrl,loadModels:zn.loadModels,loadProviders:zn.loadProviders,skills:xke,activateSkill:zn.activateSkill,setModel:zn.setModel,toggleStarModel:zn.toggleStarModel,addProvider:zn.addProvider,deleteProvider:zn.deleteProvider,refreshProvider:zn.refreshProvider,refreshAllProviders:zn.refreshAllProviders,authReady:Jke,defaultModel:e2e,managedProviderStatus:t2e,config:n2e,updateConfig:ft.updateConfig,checkAuth:ft.checkAuth,startOAuthLogin:zn.startOAuthLogin,pollOAuthLogin:zn.pollOAuthLogin,cancelOAuthLogin:zn.cancelOAuthLogin,logout:ft.logout}}const PT=Je({__name:"LanguageSwitcher",setup(e){const{locale:t}=$t(),n=f6.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&h6(s)}return(s,i)=>(x(),Se(ys,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),y2e=["aria-checked","aria-label","disabled"],k2e=Je({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(x(),E("button",{class:Ue(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:s[0]||(s[0]=i=>n("update:modelValue",!e.modelValue))},[...s[1]||(s[1]=[w("span",{class:"ui-switch__thumb"},null,-1)])],10,y2e))}}),Mr=dt(k2e,[["__scopeId","data-v-dbe22dc4"]]),b2e=["aria-label"],x2e=["aria-selected","onClick"],w2e={class:"body"},_2e={class:"panel"},S2e={class:"sec"},C2e={class:"sec-title"},A2e={class:"row"},M2e={class:"rlabel"},E2e={class:"row"},T2e={class:"rlabel"},N2e={class:"row"},I2e={class:"rlabel"},L2e={class:"num-field"},$2e=["value","aria-label"],F2e={class:"row"},O2e={class:"rlabel"},B2e={class:"row"},R2e={class:"rlabel"},D2e={class:"hint"},P2e={class:"sec"},H2e={class:"sec-title"},W2e={class:"row"},z2e={class:"rlabel"},U2e={key:0,class:"hint"},q2e={class:"row"},j2e={class:"rlabel"},V2e={key:0,class:"hint"},K2e={class:"row"},G2e={class:"rlabel"},Y2e={key:0,class:"hint"},Z2e={class:"row"},X2e={class:"rlabel"},Q2e={class:"panel"},J2e={class:"sec"},ebe={class:"sec-title"},tbe={class:"row"},nbe={class:"rlabel"},obe={key:0,class:"rvalue"},sbe={class:"actions"},ibe={class:"panel"},rbe={class:"sec"},lbe={class:"sec-head"},abe={class:"sec-title"},cbe={key:0,class:"saving"},ube={class:"row"},dbe={class:"rlabel"},fbe={class:"hint"},hbe={key:0,class:"select-wrap"},pbe={key:0,value:"",disabled:""},mbe=["label"],gbe=["value"],vbe={key:1,class:"rvalue mono"},ybe={class:"row"},kbe={class:"rlabel"},bbe={class:"hint"},xbe={class:"row"},wbe={class:"rlabel"},_be={class:"hint"},Sbe={class:"row"},Cbe={class:"rlabel"},Abe={class:"hint"},Mbe={class:"row"},Ebe={class:"rlabel"},Tbe={class:"hint"},Nbe={key:1,class:"empty-config"},Ibe={class:"panel"},Lbe={class:"sec"},$be={class:"sec-title"},Fbe={class:"row"},Obe={class:"rlabel"},Bbe={class:"rvalue mono"},Rbe={class:"row"},Dbe={class:"rlabel"},Pbe={class:"rvalue mono"},Hbe={class:"row"},Wbe={class:"rlabel"},zbe={class:"rvalue mono"},Ube={key:0,class:"row"},qbe={class:"rlabel"},jbe={class:"hint"},Vbe={class:"hint"},Kbe={class:"row"},Gbe={class:"rlabel"},Ybe={key:0,class:"hint"},Zbe={class:"panel"},Xbe={class:"panel-head"},Qbe={class:"panel-title"},Jbe={class:"panel-desc"},exe={class:"archive-toolbar"},txe={class:"archive-search"},nxe=["placeholder"],oxe={value:"all"},sxe=["value"],ixe={key:0,class:"archive-empty"},rxe={key:0,class:"archive-list"},lxe={class:"archive-workspace"},axe={class:"path"},cxe={class:"count"},uxe={class:"setting-card"},dxe={class:"archive-meta"},fxe={class:"archive-name"},hxe={class:"archive-time"},pxe={key:1,class:"archive-empty"},mxe=100,gxe=Je({__name:"SettingsDialog",props:{colorScheme:{},accent:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyQuestion:{type:Boolean},notifyApproval:{type:Boolean},notifyPermission:{},sound:{type:Boolean},conversationToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{},backend:{}},emits:["setColorScheme","setAccent","setUiFontSize","setNotify","setNotifyQuestion","setNotifyApproval","setSound","setConversationToc","login","logout","openOnboarding","openProviders","updateConfig","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"account",labelKey:"settings.tabs.account"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"archived",labelKey:"settings.tabs.archived"}],l=iF(),a=D(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=oe(null);cb(d);function f(ne){ne.key==="Escape"&&s("close")}Cn(()=>document.addEventListener("keydown",f)),$n(()=>document.removeEventListener("keydown",f));function h(){SE()}const p=D(()=>{const ne=new Map;for(const j of o.models??[])ne.set(j.id,{id:j.id,label:j.displayName??j.model??j.id,provider:j.provider});for(const[j,K]of Object.entries(o.config?.models??{})){if(ne.has(j))continue;const ve=y(K);ne.set(j,{id:j,label:g(j,K,ve),provider:ve??j})}return Array.from(ne.values())}),m=D(()=>{const ne=new Map;for(const j of p.value){const K=ne.get(j.provider)??[];K.push(j),ne.set(j.provider,K)}for(const j of ne.values())j.sort((K,ve)=>K.label.localeCompare(ve.label));return Array.from(ne.entries()).toSorted(([j],[K])=>j.localeCompare(K)).map(([j,K])=>({provider:j,options:K}))}),k=D(()=>{const ne=o.config?.defaultPermissionMode;return ne==="auto"||ne==="yolo"||ne==="manual"?ne:"manual"});function y(ne){if(!ne||typeof ne!="object")return;const j=ne;return typeof j.provider=="string"?j.provider:void 0}function g(ne,j,K){if(!j||typeof j!="object")return ne;const ve=j,he=typeof ve.model=="string"?ve.model:void 0,Ae=K??y(j);return he&&Ae?`${ne} (${Ae}/${he})`:he?`${ne} (${he})`:ne}function v(ne){return ne===!0}function b(ne){!ne||ne===o.config?.defaultModel||s("updateConfig",{defaultModel:ne})}function A(ne){ne!==k.value&&s("updateConfig",{defaultPermissionMode:ne})}function I(ne){const j=o.config?.[ne];s("updateConfig",{[ne]:!v(j)})}function T(){const ne=o.config?.thinking;return!ne||typeof ne!="object"?!0:ne.enabled!==!1}function M(){s("updateConfig",{thinking:{enabled:!T()}})}function $(){const ne=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!ne})}function N(ne){i.value=ne}const F=$b(),S=oe([]),R=oe(!1),z=oe(!1),W=oe(""),L=oe("all"),O=oe("archived-desc");async function U(){if(!(R.value||z.value)){R.value=!0;try{const ne=[];let j;for(;;){const K=await F.loadArchivedSessions({beforeId:j,pageSize:mxe});if(ne.push(...K.items),!K.hasMore||K.items.length===0)break;const ve=K.items.at(-1)?.id;if(ve===void 0)break;j=ve}S.value=ne,z.value=!0}catch(ne){console.warn("loadAllArchived failed",ne)}finally{R.value=!1}}}et(i,ne=>{ne==="archived"&&!z.value&&U()});const Z=D(()=>{const ne=new Set;for(const j of S.value)ne.add(j.cwd);return Array.from(ne).sort((j,K)=>j.localeCompare(K))}),ie=D(()=>{const ne=W.value.trim().toLowerCase();let j=S.value.filter(K=>K.archived===!0);return L.value!=="all"&&(j=j.filter(K=>K.cwd===L.value)),ne&&(j=j.filter(K=>K.title.toLowerCase().includes(ne))),j=j.slice(),O.value==="archived-desc"?j.sort((K,ve)=>ve.updatedAt.localeCompare(K.updatedAt)):O.value==="created-desc"?j.sort((K,ve)=>ve.createdAt.localeCompare(K.createdAt)):j.sort((K,ve)=>K.title.localeCompare(ve.title,"zh")),j}),q=D(()=>{const ne=new Map;for(const j of ie.value){const K=ne.get(j.cwd)??[];K.push(j),ne.set(j.cwd,K)}return Array.from(ne.entries()).map(([j,K])=>({cwd:j,items:K}))});async function ee(ne){await F.restoreSession(ne)&&(S.value=S.value.filter(K=>K.id!==ne))}function fe(ne){const j=new Date(ne);if(Number.isNaN(j.getTime()))return ne;const K=ve=>String(ve).padStart(2,"0");return`${j.getFullYear()}-${K(j.getMonth()+1)}-${K(j.getDate())} ${K(j.getHours())}:${K(j.getMinutes())}`}return(ne,j)=>(x(),Se(Qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:j[19]||(j[19]=K=>s("close"))},{default:Ie(()=>[w("div",{ref_key:"dialogRef",ref:d,class:"sd"},[w("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(x(),E(We,null,rt(r,K=>w("button",{key:K.id,type:"button",class:Ue(["tab",{on:i.value===K.id}]),role:"tab","aria-selected":i.value===K.id,onClick:ve=>N(K.id)},B(C(n)(K.labelKey)),11,x2e)),64))],8,b2e),w("div",w2e,[qn(w("section",_2e,[w("section",S2e,[w("h3",C2e,B(C(n)("settings.appearance")),1),w("div",A2e,[w("span",M2e,B(C(n)("theme.colorSchemeLabel")),1),ae(ys,{"model-value":e.colorScheme,options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":j[0]||(j[0]=K=>s("setColorScheme",K))},null,8,["model-value","options"])]),w("div",E2e,[w("span",T2e,B(C(n)("theme.accentLabel")),1),ae(ys,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":j[1]||(j[1]=K=>s("setAccent",K))},null,8,["model-value","options"])]),w("div",N2e,[w("span",I2e,B(C(n)("settings.uiFontSize")),1),w("label",L2e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:j[2]||(j[2]=K=>s("setUiFontSize",Number(K.target.value)))},null,40,$2e),j[20]||(j[20]=w("span",{class:"num-unit"},"px",-1))])]),w("div",F2e,[w("span",O2e,B(C(n)("sidebar.language")),1),ae(PT)]),w("div",B2e,[w("span",R2e,[ot(B(C(n)("settings.conversationToc"))+" ",1),w("span",D2e,B(C(n)("settings.conversationTocHint")),1)]),ae(Mr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":j[3]||(j[3]=K=>s("setConversationToc",K))},null,8,["model-value","label"])])]),w("section",P2e,[w("h3",H2e,B(C(n)("settings.notifications")),1),w("div",W2e,[w("span",z2e,[ot(B(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",U2e,B(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":j[4]||(j[4]=K=>s("setNotify",K))},null,8,["model-value","disabled","label"])]),w("div",q2e,[w("span",j2e,[ot(B(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",V2e,B(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":j[5]||(j[5]=K=>s("setNotifyQuestion",K))},null,8,["model-value","disabled","label"])]),w("div",K2e,[w("span",G2e,[ot(B(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(x(),E("span",Y2e,B(C(n)("settings.notifyDenied")),1)):ue("",!0)]),ae(Mr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":j[6]||(j[6]=K=>s("setNotifyApproval",K))},null,8,["model-value","disabled","label"])]),w("div",Z2e,[w("span",X2e,B(C(n)("settings.soundOnComplete")),1),ae(Mr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":j[7]||(j[7]=K=>s("setSound",K))},null,8,["model-value","label"])])])],512),[[wi,i.value==="general"]]),qn(w("section",Q2e,[w("section",J2e,[w("h3",ebe,B(C(n)("settings.account")),1),w("div",tbe,[w("span",nbe,B(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),ae(an,{text:e.accountModel},{default:Ie(()=>[e.authReady&&e.accountModel?(x(),E("span",obe,B(e.accountModel),1)):ue("",!0)]),_:1},8,["text"])]),w("div",sbe,[ae(jt,{variant:"secondary",size:"sm",onClick:j[8]||(j[8]=K=>{s("openOnboarding"),s("close")})},{default:Ie(()=>[ot(B(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(x(),Se(jt,{key:0,variant:"danger-soft",size:"sm",onClick:j[9]||(j[9]=K=>s("logout"))},{default:Ie(()=>[ot(B(C(n)("sidebar.signOut")),1)]),_:1})):(x(),Se(jt,{key:1,variant:"primary",size:"sm",onClick:j[10]||(j[10]=K=>s("login"))},{default:Ie(()=>[ot(B(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[wi,i.value==="account"]]),qn(w("section",ibe,[w("section",rbe,[w("div",lbe,[w("h3",abe,B(C(n)("settings.agentDefaults")),1),e.configSaving?(x(),E("span",cbe,B(C(n)("settings.saving")),1)):ue("",!0)]),e.config?(x(),E(We,{key:0},[w("div",ube,[w("span",dbe,[ot(B(C(n)("settings.defaultModel"))+" ",1),w("span",fbe,B(C(n)("settings.defaultModelHint")),1)]),m.value.length>0?(x(),E("div",hbe,[ae(ck,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":b},{default:Ie(()=>[e.config.defaultModel?ue("",!0):(x(),E("option",pbe,B(C(n)("settings.noDefaultModel")),1)),(x(!0),E(We,null,rt(m.value,K=>(x(),E("optgroup",{key:K.provider,label:K.provider},[(x(!0),E(We,null,rt(K.options,ve=>(x(),E("option",{key:ve.id,value:ve.id},B(ve.label),9,gbe))),128))],8,mbe))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(x(),E("span",vbe,B(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),w("div",ybe,[w("span",kbe,[ot(B(C(n)("settings.defaultPermission"))+" ",1),w("span",bbe,B(C(n)("settings.defaultPermissionHint")),1)]),ae(ys,{"model-value":k.value,options:c.map(K=>({value:K,label:C(n)(u[K])})),"onUpdate:modelValue":j[11]||(j[11]=K=>A(K))},null,8,["model-value","options"])]),w("div",xbe,[w("span",wbe,[ot(B(C(n)("settings.defaultThinking"))+" ",1),w("span",_be,B(C(n)("settings.defaultThinkingHint")),1)]),ae(Mr,{"model-value":T(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":j[12]||(j[12]=K=>M())},null,8,["model-value","disabled","label"])]),w("div",Sbe,[w("span",Cbe,[ot(B(C(n)("settings.defaultPlanMode"))+" ",1),w("span",Abe,B(C(n)("settings.defaultPlanModeHint")),1)]),ae(Mr,{"model-value":v(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":j[13]||(j[13]=K=>I("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),w("div",Mbe,[w("span",Ebe,[ot(B(C(n)("settings.mergeSkills"))+" ",1),w("span",Tbe,B(C(n)("settings.mergeSkillsHint")),1)]),ae(Mr,{"model-value":v(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":j[14]||(j[14]=K=>I("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(x(),E("div",Nbe,B(C(n)("settings.configUnavailable")),1))])],512),[[wi,i.value==="agent"]]),qn(w("section",Ibe,[w("section",Lbe,[w("h3",$be,B(C(n)("settings.advanced")),1),w("div",Fbe,[w("span",Obe,B(C(n)("sidebar.daemon")),1),w("span",Bbe,B(C(l)),1)]),w("div",Rbe,[w("span",Dbe,B(C(n)("settings.backend")),1),w("span",Pbe,B(a.value),1)]),w("div",Hbe,[w("span",Wbe,B(C(n)("settings.serverVersion")),1),w("span",zbe,B(e.serverVersion||"-"),1)]),e.config?(x(),E("div",Ube,[w("span",qbe,[ot(B(C(n)("settings.telemetry"))+" ",1),w("span",jbe,B(C(n)("settings.telemetryHint")),1),w("span",Vbe,B(C(n)("settings.telemetryRestartHint")),1)]),ae(Mr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":j[15]||(j[15]=K=>$())},null,8,["model-value","disabled","label"])])):ue("",!0),w("div",Kbe,[w("span",Gbe,[ot(B(C(n)("settings.exportLog"))+" ",1),C(Yi)()?ue("",!0):(x(),E("span",Ybe,B(C(n)("settings.logHint")),1))]),ae(jt,{variant:"secondary",size:"sm",onClick:h},{default:Ie(()=>[ot(B(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[wi,i.value==="advanced"]]),qn(w("section",Zbe,[w("div",Xbe,[j[21]||(j[21]=w("div",{class:"panel-kicker"},"Archived sessions",-1)),w("h4",Qbe,B(C(n)("settings.archivedTitle")),1),w("p",Jbe,B(C(n)("settings.archivedDesc")),1)]),w("div",exe,[w("label",txe,[j[22]||(j[22]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("circle",{cx:"11",cy:"11",r:"7"}),w("path",{d:"m21 21-4.3-4.3"})],-1)),qn(w("input",{"onUpdate:modelValue":j[16]||(j[16]=K=>W.value=K),placeholder:C(n)("settings.archivedSearch")},null,8,nxe),[[Cs,W.value]])]),ae(ck,{"model-value":L.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":j[17]||(j[17]=K=>L.value=K)},{default:Ie(()=>[w("option",oxe,B(C(n)("settings.archivedAllWorkspaces")),1),(x(!0),E(We,null,rt(Z.value,K=>(x(),E("option",{key:K,value:K},B(K),9,sxe))),128))]),_:1},8,["model-value","aria-label"]),ae(ys,{size:"sm","model-value":O.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":j[18]||(j[18]=K=>O.value=K)},null,8,["model-value","options"])]),R.value?(x(),E("div",ixe,B(C(n)("settings.archivedLoadingAll")),1)):(x(),E(We,{key:1},[q.value.length>0?(x(),E("div",rxe,[(x(!0),E(We,null,rt(q.value,K=>(x(),E("section",{key:K.cwd,class:"archive-card"},[w("div",lxe,[j[23]||(j[23]=w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[w("path",{d:"M3 7h6l2 2h10v9H3z"}),w("path",{d:"M3 7V5h6l2 2"})],-1)),w("span",axe,B(K.cwd),1),w("span",cxe,B(C(n)("settings.archivedSessionsCount",{count:K.items.length})),1)]),w("div",uxe,[(x(!0),E(We,null,rt(K.items,ve=>(x(),E("div",{key:ve.id,class:"archive-row"},[w("div",dxe,[w("div",fxe,B(ve.title),1),w("div",hxe,B(C(n)("settings.archivedAt",{time:fe(ve.updatedAt)})),1)]),ae(jt,{variant:"secondary",size:"sm",onClick:he=>ee(ve.id)},{default:Ie(()=>[ot(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(x(),E("div",pxe,B(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[wi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),vxe=dt(gxe,[["__scopeId","data-v-2377814f"]]),yxe=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,HT=/^[A-Za-z]:[\\/]/,kxe=/^\/\/(?!\/)/;function Hv(e){return yxe.test(e.trim())}function bxe(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function xxe(e){return kxe.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function wxe(e){return HT.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function _xe(e){return HT.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function kk(e,t){let n=xxe(bxe(e.trim(),t));const o=wxe(n),s=n==="/"||n==="//"||n==="\\\\"||/^[A-Za-z]:[\\/]$/.test(n),i=o?/[\\/]$/.test(n):n.endsWith("/");!s&&i&&(n=n.slice(0,-1));const r=n.lastIndexOf("/"),l=o?n.lastIndexOf("\\"):-1,a=Math.max(r,l),c=l>r?"\\":"/",u=_xe(n),d=a<u?n.slice(0,u)||"/":n.slice(0,a)||"/";return{target:n,parent:d,base:n.slice(a+1),separator:c}}function Sxe(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Cxe(e,t,n){if(n===null)return null;const{target:o}=kk(e,t);return o===n?n:null}const Axe={class:"aw"},Mxe={key:0,class:"crumbbar"},Exe={class:"crumbs"},Txe={key:0,class:"crumb-sep"},Nxe=["onClick"],Ixe=["placeholder"],Lxe={key:2,class:"folder-list"},$xe={key:0,class:"fl-loading"},Fxe={key:0,class:"fl-loading"},Oxe={key:0,class:"fl-note"},Bxe=["onClick"],Rxe={class:"folder-name"},Dxe={key:1,class:"fl-empty fl-error"},Pxe={key:2,class:"fl-empty fl-error"},Hxe=["onClick"],Wxe={class:"folder-name search-rel"},zxe={key:0,class:"fl-empty"},Uxe={key:1,class:"fl-loading"},qxe=["onClick"],jxe={class:"folder-name"},Vxe={key:0,class:"fl-empty"},Kxe={key:3,class:"degraded-hint"},Gxe={key:4,class:"add-error",role:"alert"},Yxe={class:"actions"},Zxe={class:"footer-hint"},Xxe=600,Qxe=6,Z3=150,Jxe=Je({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=oe(!1),l=oe(!1),a=oe(""),c=oe(null),u=oe([]),d=oe(""),f=oe(!1),h=oe([]),p=D(()=>d.value.trim().length>0);let m=0,k=null;const y=D(()=>Hv(d.value)),g=oe("idle"),v=oe(""),b=oe("/"),A=oe([]),I=oe(""),T=oe(null),M=oe(null),$=D(()=>g.value!=="valid"?null:Cxe(d.value,I.value,M.value));let N=0,F=null;function S(j,K){const ve=j.toLowerCase(),he=K.toLowerCase();let Ae=0;for(let re=0;re<he.length&&Ae<ve.length;re++)he[re]===ve[Ae]&&Ae++;return Ae===ve.length}async function R(j){const K=a.value,ve=j.trim();if(!K||ve===""){h.value=[],f.value=!1;return}const he=++m;f.value=!0;const Ae=[],re=[{path:K,depth:0}];let Y=0;for(;re.length>0&&Y<Xxe&&Ae.length<Z3;){if(he!==m)return;const Q=re.shift();Y++;let P;try{P=await o.browseFs(Q.path)}catch{continue}if(he!==m)return;for(const G of P.entries){if(!G.isDir)continue;const me=G.path.startsWith(K)?G.path.slice(K.length).replace(/^\/+/,""):G.path;if(S(ve,me||G.name)&&(Ae.push({path:G.path,name:G.name,rel:me||G.name}),Ae.length>=Z3))break;Q.depth+1<Qxe&&re.push({path:G.path,depth:Q.depth+1})}he===m&&(h.value=[...Ae])}he===m&&(f.value=!1)}et(d,j=>{k&&clearTimeout(k),F&&clearTimeout(F),N++,g.value="idle",A.value=[],M.value=null;const K=j.trim();if(K===""){m++,h.value=[],f.value=!1;return}if(Hv(K)){if(m++,h.value=[],f.value=!1,l.value)return;g.value="checking",F=setTimeout(()=>void z(K),150);return}k=setTimeout(()=>void R(j),220)});async function z(j){const K=++N;g.value="checking",M.value=null;const ve=kk(j,I.value),{target:he}=ve;try{const re=await o.browseFs(he);if(K!==N)return;if(re.path){g.value="valid",A.value=[],M.value=he,a.value=re.path,c.value=re.parent,u.value=re.entries,l.value=!1;return}}catch{}if(K!==N)return;const Ae=ve.base.toLowerCase();v.value=ve.parent,b.value=ve.separator;try{const re=await o.browseFs(ve.parent);if(K!==N)return;if(re.path){A.value=re.entries.filter(Y=>Y.isDir&&Y.name.toLowerCase().startsWith(Ae)),g.value="not-found";return}}catch{}K===N&&(A.value=[],g.value="bad-parent")}function W(j){d.value=Sxe(v.value,j,b.value),T.value?.focus()}const L=D(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),O=D(()=>l.value?n("workspace.degradedHint"):y.value&&g.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function U(j){if(j.key==="Escape"){d.value?d.value="":s("close");return}if(j.key!=="Enter")return;const K=d.value.trim();if(Hv(K)){if(j.preventDefault(),l.value){const{target:ve}=kk(K,I.value);ve&&s("add",ve);return}g.value==="valid"?ne():g.value==="not-found"&&A.value[0]&&W(A.value[0].name)}}const Z=D(()=>{const j=a.value;if(!j)return[];const K=j.split("/").filter(Boolean),ve=[{label:"/",path:"/"}];let he="";for(const Ae of K)he+=`/${Ae}`,ve.push({label:Ae,path:he});return ve}),ie=D(()=>!(a.value.length===0||y.value&&$.value===null));async function q(j){r.value=!0;try{const K=await o.browseFs(j);if(!K.path){l.value=!0;return}a.value=K.path,c.value=K.parent,u.value=K.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function ee(j){j.isDir&&q(j.path)}function fe(){c.value&&q(c.value)}function ne(){ie.value&&s("add",$.value??a.value)}return Cn(async()=>{r.value=!0;try{const j=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(j.home&&(I.value=j.home),o.defaultPath&&(await q(o.defaultPath),!l.value))return;I.value?await q(I.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),$n(()=>{k&&clearTimeout(k),F&&clearTimeout(F)}),(j,K)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":K[2]||(K[2]=ve=>i.value=ve),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:K[3]||(K[3]=ve=>s("close"))},{default:Ie(()=>[w("div",Axe,[l.value?ue("",!0):(x(),E("div",Mxe,[ae(Xn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Ie(()=>[ae(Ge,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),w("div",Exe,[(x(!0),E(We,null,rt(Z.value,(ve,he)=>(x(),E(We,{key:ve.path},[he>1?(x(),E("span",Txe,"/")):ue("",!0),w("button",{class:Ue(["crumb",{last:he===Z.value.length-1}]),onClick:Ae=>q(ve.path)},B(ve.label),11,Nxe)],64))),128))])])),!r.value||l.value?(x(),E("div",{key:1,class:Ue(["filterbar",{"has-error":g.value==="not-found"||g.value==="bad-parent"}])},[ae(Ge,{class:"filter-icon",name:"search",size:"md"}),qn(w("input",{ref_key:"filterEl",ref:T,"onUpdate:modelValue":K[0]||(K[0]=ve=>d.value=ve),class:"filter-input",type:"text",placeholder:L.value,autocomplete:"off",spellcheck:"false",onKeydown:St(U,["stop"])},null,40,Ixe),[[Cs,d.value]]),f.value||g.value==="checking"?(x(),Se(Us,{key:0,size:"sm"})):ue("",!0)],2)):ue("",!0),l.value?(x(),E("div",Kxe,B(C(n)("workspace.degradedHint")),1)):(x(),E("div",Lxe,[r.value?(x(),E("div",$xe,B(C(n)("workspace.browsing")),1)):y.value&&g.value!=="valid"?(x(),E(We,{key:1},[g.value==="checking"?(x(),E("div",Fxe,B(C(n)("workspace.checkingPath")),1)):g.value==="not-found"?(x(),E(We,{key:1},[A.value.length>0?(x(),E("div",Oxe,B(C(n)("workspace.pathPickHint")),1)):ue("",!0),(x(!0),E(We,null,rt(A.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>W(ve.name)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Rxe,B(ve.name),1)],8,Bxe))),128)),A.value.length===0?(x(),E("div",Dxe,B(C(n)("workspace.noPathMatch",{parent:v.value})),1)):ue("",!0)],64)):g.value==="bad-parent"?(x(),E("div",Pxe,B(C(n)("workspace.badParent",{parent:v.value})),1)):ue("",!0)],64)):p.value&&!y.value?(x(),E(We,{key:2},[(x(!0),E(We,null,rt(h.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>q(ve.path)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",Wxe,B(ve.rel),1)],8,Hxe))),128)),!f.value&&h.value.length===0?(x(),E("div",zxe,B(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(x(),E("div",Uxe,B(C(n)("workspace.searching")),1)):ue("",!0)],64)):(x(),E(We,{key:3},[(x(!0),E(We,null,rt(u.value,ve=>(x(),E("button",{key:ve.path,class:"folder-row",onClick:he=>ee(ve)},[ae(Ge,{class:"dir-icon",name:"folder-closed",size:"sm"}),w("span",jxe,B(ve.name),1)],8,qxe))),128)),u.value.length===0?(x(),E("div",Vxe,B(C(n)("workspace.noSubfolders")),1)):ue("",!0)],64))])),e.error?(x(),E("div",Gxe,B(e.error),1)):ue("",!0),w("div",Yxe,[ae(an,{text:a.value},{default:Ie(()=>[l.value?ue("",!0):(x(),Se(jt,{key:0,variant:"primary",disabled:!ie.value,onClick:ne},{default:Ie(()=>[ot(B(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),ae(jt,{variant:"secondary",onClick:K[1]||(K[1]=ve=>s("close"))},{default:Ie(()=>[ot(B(C(n)("workspace.cancel")),1)]),_:1})]),w("div",Zxe,B(O.value),1)])]),_:1},8,["open","title"]))}}),ewe=dt(Jxe,[["__scopeId","data-v-07cbb13d"]]),twe={key:0,class:"confirm-dialog__message"},nwe=Je({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmLabel:{},cancelLabel:{},variant:{default:"danger"},loading:{type:Boolean}},emits:["update:open","confirm","cancel"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t();function i(){n.loading||(o("update:open",!1),o("cancel"))}function r(l){if(l.key!=="Enter"||!n.open||n.loading)return;const a=l.target;a instanceof HTMLButtonElement||a instanceof HTMLAnchorElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLInputElement||(l.preventDefault(),o("confirm"))}return typeof window<"u"&&window.addEventListener("keydown",r),ho(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(x(),Se(Qr,{open:e.open,title:e.title,height:"auto","initial-focus":".confirm-dialog__confirm","close-on-esc":!e.loading,"close-on-overlay":!e.loading,"onUpdate:open":a[1]||(a[1]=c=>o("update:open",c)),onClose:i},{foot:Ie(()=>[ae(jt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ie(()=>[ot(B(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),ae(jt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ie(()=>[ot(B(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ie(()=>[e.message?(x(),E("p",twe,B(e.message),1)):ue("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),owe=dt(nwe,[["__scopeId","data-v-2e719024"]]),swe=Je({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=Uf();function i(){s()}return(r,l)=>(x(),Se(owe,{open:C(t)!==null,title:C(t)?.title??"",message:C(t)?.message,"confirm-label":C(t)?.confirmLabel,"cancel-label":C(t)?.cancelLabel,variant:C(t)?.variant,loading:C(n),onConfirm:i,onCancel:l[0]||(l[0]=a=>C(o)(!1))},null,8,["open","title","message","confirm-label","cancel-label","variant","loading"]))}}),iwe={class:"rows"},rwe={class:"row"},lwe={class:"row"},awe={class:"row"},cwe={class:"row"},uwe={class:"row"},dwe={class:"row"},fwe={class:"ctx-text"},hwe={key:0,class:"bar"},pwe={class:"row"},mwe=Je({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=oe(!0),r=D(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=D(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:pr(o.status.ctxUsed),max:pr(o.status.ctxMax),pct:r.value}):n("status.statusNone"));function a(p){return n(p==="yolo"?"status.permissionYolo":p==="auto"?"status.permissionAuto":"status.permissionManual")}const c=D(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=D(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=D(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=D(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=D(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,m)=>(x(),Se(Qr,{open:i.value,"onUpdate:open":m[0]||(m[0]=k=>i.value=k),title:C(n)("status.statusPanelTitle"),onClose:m[1]||(m[1]=k=>s("close"))},{default:Ie(()=>[w("dl",iwe,[w("div",rwe,[w("dt",null,B(C(n)("status.statusModel")),1),w("dd",null,B(e.status.model),1)]),w("div",lwe,[w("dt",null,B(C(n)("status.statusThinking")),1),w("dd",null,B(e.thinking),1)]),w("div",awe,[w("dt",null,B(C(n)("status.statusPermission")),1),w("dd",{style:on({color:c.value})},B(a(e.status.permission)),5)]),w("div",cwe,[w("dt",null,B(C(n)("status.statusPlanMode")),1),w("dd",{class:Ue({"plan-on":e.planMode})},B(u.value),3)]),w("div",uwe,[w("dt",null,B(C(n)("status.statusSwarmMode")),1),w("dd",{class:Ue({"swarm-on":e.swarmMode})},B(d.value),3)]),w("div",dwe,[w("dt",null,B(C(n)("status.statusContext")),1),w("dd",null,[w("span",fwe,B(l.value),1),e.status.ctxMax>0?(x(),E("span",hwe,[w("i",{style:on({width:r.value+"%"})},null,4)])):ue("",!0)])]),w("div",pwe,[w("dt",null,B(C(n)("status.statusCost")),1),w("dd",null,B(h.value),1)])])]),_:1},8,["open","title"]))}}),gwe=dt(mwe,[["__scopeId","data-v-39844d89"]]),vwe={class:"ui-toast__icon","aria-hidden":"true"},ywe={class:"ui-toast__body"},kwe={class:"ui-toast__title"},bwe={key:0,class:"ui-toast__msg"},xwe=Je({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(x(),E("div",{class:Ue(["ui-toast",`ui-toast--${e.variant}`])},[w("span",vwe,[jn(t.$slots,"icon",{},()=>[e.variant==="success"?(x(),Se(Ge,{key:0,name:"check"})):e.variant==="danger"?(x(),Se(Ge,{key:1,name:"close"})):e.variant==="warning"?(x(),Se(Ge,{key:2,name:"alert-triangle"})):(x(),Se(Ge,{key:3,name:"info"}))],!0)]),w("div",ywe,[w("div",kwe,B(e.title),1),e.message?(x(),E("div",bwe,B(e.message),1)):ue("",!0),jn(t.$slots,"default",{},void 0,!0)]),ae(Xn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ie(()=>[ae(Ge,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),wwe=dt(xwe,[["__scopeId","data-v-adc6f346"]]),_we={key:0,class:"actions"},Swe=["onClick"],Cwe=["onClick"],Awe={key:1,class:"details"},Mwe=Je({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=$t();function i(M){return typeof M=="object"&&M!==null}function r(M){return i(M)?M.title:M}function l(M){return i(M)?M.message??"":""}function a(M){return i(M)?M.details:void 0}function c(M){return i(M)?M.severity==="error":M.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(M)}function u(M){return i(M)?`notice:${M.severity}:${M.title}:${M.message??""}:${JSON.stringify(M.details??[])}`:`text:${M}`}function d(M){if(!i(M))return M;const $=[M.title];M.message&&$.push(M.message);const N=M.details??[];if(N.length>0){$.push("",`${s("warnings.diagnostics")}:`);for(const F of N)$.push(`${F.label}: ${F.value}`)}return $.join(`
337
+ `)}let f=1;const h=oe([]),p=new Map,m=new Map;function k(M){const $=c(M)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?$+5e3:$}function y(M,$){const N=p.get(M)??{handle:null,deadline:0,remaining:0};N.handle=setTimeout(()=>T(M),$),N.deadline=Date.now()+$,p.set(M,N)}function g(M){const $=p.get(M);$&&$.handle!==null&&clearTimeout($.handle),p.delete(M)}function v(M){const $=p.get(M);!$||$.handle===null||(clearTimeout($.handle),$.handle=null,$.remaining=Math.max(0,$.deadline-Date.now()))}function b(M){if(h.value.find(F=>F.id===M)?.detailsOpen)return;const N=p.get(M);!N||N.handle!==null||y(M,N.remaining)}function A(M){M.detailsOpen=!M.detailsOpen,M.detailsOpen?v(M.id):b(M.id)}async function I(M){if(!await Jo(d(M.warning)))return;M.copied=!0;const N=m.get(M.id);N&&clearTimeout(N),m.set(M.id,setTimeout(()=>{M.copied=!1,m.delete(M.id)},1400))}function T(M){g(M);const $=m.get(M);$&&clearTimeout($),m.delete(M);const N=h.value.findIndex(F=>F.id===M);N!==-1&&(h.value=h.value.filter(F=>F.id!==M),o("dismiss",N))}return et(()=>n.warnings,M=>{const $=[...h.value];h.value=M.map(N=>{const F=u(N),S=$.findIndex(W=>W.key===F),R=S===-1?void 0:$.splice(S,1)[0];if(R)return R.warning=N,R;const z={id:f++,key:F,warning:N,detailsOpen:!1,copied:!1};return y(z.id,k(N)),z});for(const N of $){g(N.id);const F=m.get(N.id);F&&clearTimeout(F),m.delete(N.id)}},{immediate:!0,flush:"post"}),$n(()=>{p.forEach(M=>{M.handle!==null&&clearTimeout(M.handle)}),p.clear(),m.forEach(M=>clearTimeout(M)),m.clear()}),(M,$)=>(x(),Se(L7,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ie(()=>[(x(!0),E(We,null,rt(h.value,N=>(x(),Se(wwe,{key:N.id,variant:c(N.warning)?"danger":"warning",title:r(N.warning),message:l(N.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>T(N.id),onPointerenter:F=>v(N.id),onPointerleave:F=>b(N.id)},{default:Ie(()=>[a(N.warning)?.length?(x(),E("div",_we,[w("button",{class:"link",type:"button",onClick:F=>A(N)},B(N.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Swe),w("button",{class:"link",type:"button",onClick:F=>I(N)},B(N.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Cwe)])):ue("",!0),N.detailsOpen&&a(N.warning)?.length?(x(),E("dl",Awe,[(x(!0),E(We,null,rt(a(N.warning),F=>(x(),E("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[w("dt",null,B(F.label),1),w("dd",null,B(F.value),1)]))),128))])):ue("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Ewe=dt(Mwe,[["__scopeId","data-v-6cc72bd4"]]),Twe={class:"topbar"},Nwe={class:"wsq"},Iwe=["aria-label"],Lwe={class:"tb-path"},$we={class:"ws"},Fwe={class:"se"},Owe={class:"tb-sub"},Bwe=Je({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t,i=D(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=D(()=>o.workspace?.name??n("workspace.noWorkspace")),l=D(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(x(),E("div",Twe,[w("span",Nwe,B(i.value),1),w("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[w("span",Lwe,[w("span",$we,B(r.value),1),e.sessionTitle?(x(),E(We,{key:0},[c[2]||(c[2]=w("span",{class:"sl"},"/",-1)),w("span",Fwe,B(e.sessionTitle),1)],64)):ue("",!0),c[3]||(c[3]=w("span",{class:"cv"},"⌄",-1))]),w("span",Owe,[w("span",{class:Ue(["rd",{on:e.running}])},null,2),w("span",null,B(l.value),1),e.branch?(x(),E(We,{key:0},[ot(" · "+B(e.branch),1)],64)):ue("",!0),e.sessionCount>0?(x(),E(We,{key:1},[ot(" · "+B(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ue("",!0)])],8,Iwe),ae(Xn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ie(()=>[ae(Ge,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Rwe=dt(Bwe,[["__scopeId","data-v-6b4b901f"]]),Dwe={key:0,class:"sheet-root"},Pwe=["aria-label"],Hwe=["aria-label"],Wwe={key:0,class:"sheet-head"},zwe={class:"sheet-title"},Uwe={class:"sheet-body"},qwe=Je({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return et(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),$n(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(x(),Se(Ua,{name:"sheet"},{default:Ie(()=>[e.modelValue?(x(),E("div",Dwe,[w("div",{class:"sheet-scrim",onClick:i}),w("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[w("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Hwe),e.title?(x(),E("div",Wwe,[w("span",zwe,B(e.title),1)])):ue("",!0),w("div",Uwe,[jn(l.$slots,"default",{},void 0,!0)])],8,Pwe)])):ue("",!0)]),_:3}))}}),WT=dt(qwe,[["__scopeId","data-v-745ee5a2"]]),jwe={class:"mlist"},Vwe={key:0,class:"mempty"},Kwe=["onClick"],Gwe={class:"mgh-main"},Ywe={class:"mgh-name"},Zwe={class:"mgh-path"},Xwe={key:2,class:"att"},Qwe={key:0,class:"mempty small"},Jwe=["onClick"],e_e={class:"m"},t_e={class:"s"},n_e={key:0,class:"att"},o_e=["disabled","onClick"],s_e=["onClick"],i_e=Je({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace","loadMore"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(){s("update:modelValue",!1)}function r(F){s("select",F),i()}function l(F){s("createInWorkspace",F),i()}function a(){s("create"),i()}function c(){s("addWorkspace"),i()}const u=oe(new Set);function d(F){return u.value.has(F)}function f(F){const S=new Set(u.value);S.has(F)?S.delete(F):S.add(F),u.value=S,v.value=null,T.value=null}const h=oe(new Set);function p(F){return h.value.has(F)}function m(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function k(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(R=>R.id===o.activeId)){const R=F.sessions.find(z=>z.id===o.activeId);if(R)return[...S,R]}return S}function y(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function g(F){return o.attentionByWorkspace[F]??0}const v=oe(null);function b(F){v.value=v.value===F?null:F,T.value=null}function A(F){v.value=null;const R=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();R&&s("rename",F.id,R)}function I(F){v.value=null,s("archive",F)}const T=oe(null);function M(F){T.value=T.value===F?null:F,v.value=null}function $(F){Jo(F.root),T.value=null}function N(F){T.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(x(),Se(WT,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=R=>s("update:modelValue",R))},{default:Ie(()=>[w("button",{type:"button",class:"newrow",onClick:a},[ae(Ge,{name:"message",size:"sm"}),ot(" "+B(C(n)("sidebar.newChat")),1)]),w("button",{type:"button",class:"newrow secondary",onClick:c},[ae(Ge,{name:"folder",size:"sm"}),ot(" "+B(C(n)("sidebar.newWorkspace")),1)]),w("div",jwe,[e.groups.length===0?(x(),E("div",Vwe,B(C(n)("workspace.noWorkspace")),1)):ue("",!0),(x(!0),E(We,null,rt(e.groups,R=>(x(),E("div",{key:R.workspace.id,class:"mgroup"},[w("div",{class:Ue(["mgh",{on:R.workspace.id===e.activeWorkspaceId}]),onClick:z=>f(R.workspace.id)},[d(R.workspace.id)?(x(),Se(Ge,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(x(),Se(Ge,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),w("div",Gwe,[w("span",Ywe,B(R.workspace.name),1),ae(an,{text:R.workspace.root},{default:Ie(()=>[w("span",Zwe,B(R.workspace.shortPath),1)]),_:2},1032,["text"])]),d(R.workspace.id)&&g(R.workspace.id)>0?(x(),E("span",Xwe,B(g(R.workspace.id)),1)):ue("",!0),ae(Xn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:St(z=>M(R.workspace.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),ae(Xn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:St(z=>l(R.workspace.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),T.value===R.workspace.id?(x(),Se(Ml,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{size:"lg",onClick:z=>$(R.workspace)},{default:Ie(()=>[ot(B(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),ae(En,{size:"lg",danger:"",onClick:z=>N(R.workspace)},{default:Ie(()=>[ot(B(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,Kwe),qn(w("div",null,[R.sessions.length===0?(x(),E("div",Qwe,B(C(n)("sidebar.noSessions")),1)):ue("",!0),(x(!0),E(We,null,rt(k(R),z=>(x(),E("div",{key:z.id,class:Ue(["srow",{cur:z.id===e.activeId}]),onClick:W=>r(z.id)},[w("div",e_e,[w("div",{class:Ue(["t",{run:z.busy,aborted:!z.busy&&(e.attentionBySession[z.id]??0)===0&&(z.lastTurnReason==="cancelled"||z.lastTurnReason==="failed")}])},B(z.title),3),w("div",t_e,B(z.time),1)]),(e.attentionBySession[z.id]??0)>0?(x(),E("span",n_e,B(e.attentionBySession[z.id]),1)):ue("",!0),ae(Xn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:St(W=>b(z.id),["stop"])},{default:Ie(()=>[ae(Ge,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),v.value===z.id?(x(),Se(Ml,{key:1,class:"kmenu",onClick:S[1]||(S[1]=St(()=>{},["stop"]))},{default:Ie(()=>[ae(En,{size:"lg",onClick:W=>A(z)},{default:Ie(()=>[ot(B(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),ae(En,{size:"lg",danger:"",onClick:W=>I(z.id)},{default:Ie(()=>[ot(B(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ue("",!0)],10,Jwe))),128)),R.hasMore||R.loadingMore?(x(),E("button",{key:1,type:"button",class:"mshow-more",disabled:R.loadingMore,onClick:St(z=>y(R.workspace.id),["stop"])},B(R.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,R.workspace.sessionCount-R.sessions.length)})),9,o_e)):ue("",!0),R.sessions.length>R.initialCount?(x(),E("button",{key:2,type:"button",class:"mshow-more",onClick:St(z=>m(R.workspace.id),["stop"])},B(p(R.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:R.sessions.length-R.initialCount})),9,s_e)):ue("",!0)],512),[[wi,!d(R.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),r_e=dt(i_e,[["__scopeId","data-v-df277098"]]),l_e={class:"group-title"},a_e={class:"srow-main"},c_e={class:"srow-label"},u_e={class:"srow-sub"},d_e={class:"srow read-only"},f_e={class:"srow-main"},h_e={class:"srow-label"},p_e={key:0,class:"srow-sub"},m_e={class:"cache-note"},g_e={class:"srow-main"},v_e={class:"srow-label"},y_e={class:"srow-sub"},k_e=["aria-checked"],b_e={class:"srow-main"},x_e={class:"srow-label"},w_e={class:"srow-sub"},__e=["aria-checked"],S_e={class:"srow-main"},C_e={class:"srow-label"},A_e={class:"srow read-only"},M_e={class:"srow-main"},E_e={class:"srow-label"},T_e={class:"srow-sub"},N_e=["aria-label"],I_e={class:"group-title"},L_e={class:"srow-main"},$_e={class:"srow-label"},F_e={class:"srow-sub"},O_e={class:"srow read-only pref"},B_e={class:"srow-main"},R_e={class:"srow-label"},D_e={class:"srow read-only pref"},P_e={class:"srow-main"},H_e={class:"srow-label"},W_e={class:"srow read-only pref"},z_e={class:"srow-main"},U_e={class:"srow-label"},q_e={class:"num-field"},j_e=["value","aria-label"],V_e={class:"srow-main"},K_e={class:"srow-label"},G_e={class:"srow-sub"},Y_e=["aria-checked"],Z_e={class:"srow-main"},X_e={class:"srow-label"},Q_e={class:"srow-main"},J_e={class:"srow-label"},eSe={key:2,class:"srow read-only"},tSe={class:"srow-main"},nSe={class:"srow-label"},oSe={class:"srow-val dim"},sSe={class:"arch-subhead"},iSe={class:"arch-count"},rSe={class:"arch-tools"},lSe={key:0,class:"arch-empty"},aSe={class:"arch-meta"},cSe={class:"arch-name"},uSe={class:"arch-time"},dSe={key:2,class:"arch-empty"},fSe=100,hSe=Je({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},conversationToc:{type:Boolean},serverVersion:{default:""},models:{default:()=>[]}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setColorScheme","setUiFontSize","setConversationToc","login","logout"],setup(e,{emit:t}){const{t:n}=$t(),o=e,s=t;function i(q){s("setColorScheme",q)}const r=["manual","auto","yolo"],l=D(()=>o.models?.find(q=>q.id===o.status?.modelId)),a=D(()=>n0(l.value)),c=D(()=>o0(l.value)),u=D(()=>Gm(l.value,o.thinking)),d=D(()=>c.value.includes(u.value)?u.value:""),f=D(()=>c.value.map(q=>({value:q,label:ak(q)}))),h=D(()=>o.planMode===!0),p=D(()=>o.swarmMode===!0),m=D(()=>{const q=o.status.permission;return q==="yolo"?"var(--color-danger)":q==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),k=D(()=>{const q=o.status.permission,ee=n(q==="yolo"?"mobile.permYoloSub":q==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${q} · ${ee}`}),y=D(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),g=D(()=>o.status.ctxMax>0?`${pr(o.status.ctxUsed)}/${pr(o.status.ctxMax)}`:n("status.statusNone"));function v(q){s("setThinking",lb(l.value,q))}function b(){const q=r.indexOf(o.status.permission),ee=r[(q+1)%r.length];s("setPermission",ee)}function A(){s("pickModel"),s("update:modelValue",!1)}function I(){s("login"),s("update:modelValue",!1)}function T(){s("logout"),s("update:modelValue",!1)}const M=$b(),$=oe("main"),N=oe([]),F=oe(!1),S=oe(!1),R=oe(""),z=oe("archived-desc");async function W(){if(!F.value){F.value=!0,S.value=!1;try{const q=[];let ee;for(;;){const fe=await M.loadArchivedSessions({beforeId:ee,pageSize:fSe});if(q.push(...fe.items),!fe.hasMore||fe.items.length===0)break;const ne=fe.items.at(-1)?.id;if(ne===void 0)break;ee=ne}N.value=q,S.value=!0}catch(q){console.warn("loadAllArchived failed",q)}finally{F.value=!1}}}function L(){$.value="archived",R.value="",W()}function O(){$.value="main"}const U=D(()=>{const q=R.value.trim().toLowerCase();let ee=N.value.filter(fe=>fe.archived===!0);return q&&(ee=ee.filter(fe=>fe.title.toLowerCase().includes(q))),ee=ee.slice(),z.value==="archived-desc"?ee.sort((fe,ne)=>ne.updatedAt.localeCompare(fe.updatedAt)):z.value==="created-desc"?ee.sort((fe,ne)=>ne.createdAt.localeCompare(fe.createdAt)):ee.sort((fe,ne)=>fe.title.localeCompare(ne.title,"zh")),ee});async function Z(q){await M.restoreSession(q)&&(N.value=N.value.filter(fe=>fe.id!==q))}function ie(q){const ee=new Date(q);if(Number.isNaN(ee.getTime()))return q;const fe=ne=>String(ne).padStart(2,"0");return`${ee.getFullYear()}-${fe(ee.getMonth()+1)}-${fe(ee.getDate())} ${fe(ee.getHours())}:${fe(ee.getMinutes())}`}return et(()=>o.modelValue,q=>{q||($.value="main")}),(q,ee)=>(x(),Se(WT,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":ee[6]||(ee[6]=fe=>s("update:modelValue",fe))},{default:Ie(()=>[$.value==="main"?(x(),E(We,{key:0},[w("div",l_e,B(C(n)("mobile.groupSession")),1),w("button",{type:"button",class:"srow",onClick:A},[w("span",a_e,[w("span",c_e,B(C(n)("status.statusModel")),1),w("span",u_e,B(e.status.model),1)]),ee[7]||(ee[7]=w("span",{class:"chev"},"›",-1))]),w("div",d_e,[w("span",f_e,[w("span",h_e,B(C(n)("status.statusThinking")),1),a.value==="unsupported"?(x(),E("span",p_e,B(C(n)("status.modeNotSupported")),1)):ue("",!0)]),c.value.length>1?(x(),Se(ys,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":v},null,8,["model-value","options"])):(x(),E("span",{key:1,class:Ue(["srow-val",{dim:u.value==="off"}])},B(u.value==="off"?C(n)("status.planOff"):C(ak)(u.value)),3))]),w("div",m_e,B(C(n)("status.cacheNote")),1),w("button",{type:"button",class:"srow",onClick:ee[0]||(ee[0]=fe=>s("togglePlan"))},[w("span",g_e,[w("span",v_e,B(C(n)("status.statusPlanMode")),1),w("span",y_e,B(C(n)("mobile.planModeSub")),1)]),w("span",{class:Ue(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,k_e)]),w("button",{type:"button",class:"srow",onClick:ee[1]||(ee[1]=fe=>s("toggleSwarm"))},[w("span",b_e,[w("span",x_e,B(C(n)("status.statusSwarmMode")),1),w("span",w_e,B(C(n)("mobile.swarmModeSub")),1)]),w("span",{class:Ue(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,__e)]),w("button",{type:"button",class:"srow",onClick:b},[w("span",S_e,[w("span",C_e,B(C(n)("status.statusPermission")),1),w("span",{class:"srow-sub",style:on({color:m.value})},B(k.value),5)]),ee[8]||(ee[8]=w("span",{class:"chev"},"›",-1))]),w("div",A_e,[w("span",M_e,[w("span",E_e,B(C(n)("status.statusContext")),1),w("span",T_e,B(g.value),1)]),w("span",{class:"ctx-meter","aria-label":g.value},[w("i",{style:on({width:y.value+"%"})},null,4)],8,N_e)]),w("div",I_e,B(C(n)("mobile.groupApp")),1),w("button",{type:"button",class:"srow",onClick:L},[w("span",L_e,[w("span",$_e,B(C(n)("mobile.archivedSessions")),1),w("span",F_e,B(C(n)("mobile.archivedSessionsSub")),1)]),ee[9]||(ee[9]=w("span",{class:"chev"},"›",-1))]),w("div",O_e,[w("span",B_e,[w("span",R_e,B(C(n)("theme.colorSchemeLabel")),1)]),ae(ys,{"model-value":e.colorScheme??"system",options:[{value:"light",label:C(n)("theme.light")},{value:"dark",label:C(n)("theme.dark")},{value:"system",label:C(n)("theme.system")}],"onUpdate:modelValue":i},null,8,["model-value","options"])]),w("div",D_e,[w("span",P_e,[w("span",H_e,B(C(n)("sidebar.language")),1)]),ae(PT)]),w("div",W_e,[w("span",z_e,[w("span",U_e,B(C(n)("settings.uiFontSize")),1)]),w("label",q_e,[w("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ee[2]||(ee[2]=fe=>s("setUiFontSize",Number(fe.target.value)))},null,40,j_e),ee[10]||(ee[10]=w("span",{class:"num-unit"},"px",-1))])]),w("button",{type:"button",class:"srow",onClick:ee[3]||(ee[3]=fe=>s("setConversationToc",!e.conversationToc))},[w("span",V_e,[w("span",K_e,B(C(n)("settings.conversationToc")),1),w("span",G_e,B(C(n)("settings.conversationTocHint")),1)]),w("span",{class:Ue(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,Y_e)]),e.authReady?(x(),E("button",{key:0,type:"button",class:"srow acct out",onClick:T},[w("span",Z_e,[w("span",X_e,B(C(n)("sidebar.signOut")),1)])])):(x(),E("button",{key:1,type:"button",class:"srow acct in",onClick:I},[w("span",Q_e,[w("span",J_e,B(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(x(),E("div",eSe,[w("span",tSe,[w("span",nSe,B(C(n)("settings.serverVersion")),1)]),w("span",oSe,B(e.serverVersion),1)])):ue("",!0)],64)):(x(),E(We,{key:1},[w("div",sSe,[w("button",{type:"button",class:"arch-back",onClick:O},[ee[11]||(ee[11]=w("span",{class:"chev back"},"‹",-1)),ot(" "+B(C(n)("mobile.archivedBack")),1)]),w("span",iSe,B(C(n)("mobile.sessionCount",{n:U.value.length})),1)]),w("div",rSe,[ae(pu,{class:"arch-search-input","model-value":R.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":ee[4]||(ee[4]=fe=>R.value=fe)},null,8,["model-value","placeholder"]),ae(ys,{size:"sm","model-value":z.value,options:[{value:"archived-desc",label:C(n)("settings.archivedSortArchived")},{value:"created-desc",label:C(n)("settings.archivedSortCreated")},{value:"name-asc",label:C(n)("settings.archivedSortName")}],"onUpdate:modelValue":ee[5]||(ee[5]=fe=>z.value=fe)},null,8,["model-value","options"])]),F.value?(x(),E("div",lSe,B(C(n)("settings.archivedLoadingAll")),1)):U.value.length>0?(x(!0),E(We,{key:1},rt(U.value,fe=>(x(),E("div",{key:fe.id,class:"arch-row"},[w("div",aSe,[w("div",cSe,B(fe.title),1),w("div",uSe,B(C(n)("settings.archivedAt",{time:ie(fe.updatedAt)})),1)]),ae(jt,{variant:"secondary",size:"sm",onClick:ne=>Z(fe.id)},{default:Ie(()=>[ot(B(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(x(),E("div",dSe,B(N.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),pSe=dt(hSe,[["__scopeId","data-v-c244b2fe"]]),mSe={class:"ob-brand"},gSe={class:"ob-brand-text"},vSe={class:"ob-title"},ySe={class:"ob-sub"},kSe={class:"ob-sec"},bSe={class:"ob-label"},xSe={class:"ob-sec"},wSe={class:"ob-label"},_Se={class:"ob-sec"},SSe={class:"ob-label"},CSe=Je({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=$t(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=JE();function c(d){s.value!==d&&h6(d)}function u(){n("complete")}return(d,f)=>(x(),Se(Qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ie(()=>[w("div",mSe,[f[4]||(f[4]=w("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[w("defs",null,[w("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[w("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),w("g",{class:"ob-eyes",fill:"#000"},[w("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),w("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),w("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),w("div",gSe,[w("div",vSe,B(C(o)("onboarding.title")),1),w("div",ySe,B(C(o)("onboarding.subtitle")),1)])])]),default:Ie(()=>[w("section",kSe,[w("div",bSe,B(C(o)("onboarding.languageLabel")),1),ae(ys,{"model-value":C(s),options:C(f6).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),w("section",xSe,[w("div",wSe,B(C(o)("theme.colorSchemeLabel")),1),ae(ys,{"model-value":C(i),options:[{value:"light",label:C(o)("theme.light")},{value:"dark",label:C(o)("theme.dark")},{value:"system",label:C(o)("theme.system")}],"onUpdate:modelValue":f[1]||(f[1]=h=>C(l)(h))},null,8,["model-value","options"])]),w("section",_Se,[w("div",SSe,B(C(o)("theme.accentLabel")),1),ae(ys,{"model-value":C(r),options:[{value:"blue",label:C(o)("theme.accentBlue")},{value:"mono",label:C(o)("theme.accentBlack")}],"onUpdate:modelValue":f[2]||(f[2]=h=>C(a)(h))},null,8,["model-value","options"])]),ae(jt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ie(()=>[ot(B(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),ASe=dt(CSe,[["__scopeId","data-v-fbdd3eab"]]),MSe=["aria-label"],ESe={class:"gload-box"},TSe={class:"gload-text"},NSe={key:0,class:"gload-issue"},ISe={class:"gload-issue-detail"},LSe=Je({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=$t();return(n,o)=>(x(),E("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[w("div",ESe,[o[0]||(o[0]=Pk('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-0b6dec6a><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-0b6dec6a></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-0b6dec6a></path></svg>',1)),ae(Us,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),w("div",TSe,B(C(t)("app.connecting")),1),e.issue?(x(),E("div",NSe,[w("div",null,B(C(t)("app.connectRetrying")),1),w("div",ISe,B(e.issue),1)])):ue("",!0)])],8,MSe))}}),$Se=dt(LSe,[["__scopeId","data-v-0b6dec6a"]]),FSe={class:"kap-root"},OSe={class:"kap-head"},BSe={class:"kap-count"},RSe={class:"kap-head-actions"},DSe={class:"kap-filters"},PSe=["value"],HSe={class:"kap-check"},WSe={class:"kap-check"},zSe={class:"kap-view-toggle",role:"group"},USe={key:0,class:"kap-empty"},qSe=["onClick"],jSe={class:"kap-ts"},VSe={class:"kap-label"},KSe={key:0,class:"kap-detail"},GSe={class:"kap-detail-actions"},YSe=["onClick"],ZSe={key:1,class:"kap-agg"},XSe={class:"mono"},QSe={class:"mono"},JSe={class:"num"},eCe={class:"num"},tCe={key:0},nCe={class:"mono"},oCe={class:"num"},sCe={class:"num"},iCe={key:0},rCe=Je({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=oe("all"),s=oe(""),i=oe(""),r=oe(!1),l=oe("timeline"),a=D(()=>(Y2.value,[...Nie()])),c=D(()=>{const $=new Set;for(const N of a.value)N.sessionId&&$.add(N.sessionId);return[...$].sort()});function u($){return $.kind==="rest:error"||$.code!==void 0&&$.code!==0||$.eventType==="error"||$.eventType==="parse-error"}const d=D(()=>{const $=s.value.trim().toLowerCase();return a.value.filter(N=>!(o.value!=="all"&&N.source!==o.value||i.value&&N.sessionId!==i.value||r.value&&!u(N)||$&&!`${N.label} ${N.kind} ${N.eventType??""} ${N.sessionId??""} ${N.requestId??""}`.toLowerCase().includes($)))}),f=D(()=>{const $=new Map;for(const N of d.value){if(N.kind!=="ws:in"&&N.kind!=="ws:out")continue;const F=N.kind==="ws:in"?"←":"→",S=`${F} ${N.eventType??"?"} @ ${N.sessionId??"-"}`,R=$.get(S)??{key:S,sessionId:N.sessionId??"-",eventType:N.eventType??"?",dir:F,count:0};R.count++,N.seq!==void 0&&(R.lastSeq=N.seq),$.set(S,R)}return[...$.values()].sort((N,F)=>F.count-N.count)}),h=D(()=>{const $=new Map;for(const N of d.value){if(N.source!=="rest"||N.kind==="rest:request")continue;const F=`${N.method??"?"} ${N.path??"?"}`,S=$.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(N)&&S.errors++,N.durationMs!==void 0&&(S.totalMs+=N.durationMs,S.timed++),$.set(F,S)}return[...$.entries()].map(([N,F])=>({key:N,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((N,F)=>F.count-N.count)}),p=oe(null),m=oe(!0),k=oe(null),y=oe(null);et(()=>d.value.length,async()=>{if(!m.value||l.value!=="timeline")return;await yt();const $=k.value;$&&($.scrollTop=$.scrollHeight)});function g($){p.value=p.value===$?null:$}function v($){const N=new Date($),F=(S,R=2)=>String(S).padStart(R,"0");return`${F(N.getHours())}:${F(N.getMinutes())}:${F(N.getSeconds())}.${F(N.getMilliseconds(),3)}`}function b($){return JSON.stringify($,null,2)}async function A($){await Jo(b($))&&(y.value=$.id,setTimeout(()=>{y.value===$.id&&(y.value=null)},1500))}function I(){SE(d.value)}function T($){return u($)||$.source==="client"?"b-err":$.source==="rest"?"b-rest":$.kind==="ws:lifecycle"?"b-life":$.kind==="ws:out"?"b-out":"b-in"}function M($){return $.source==="rest"?"REST":$.source==="client"?"APP":"WS"}return($,N)=>(x(),E("section",FSe,[w("header",OSe,[N[11]||(N[11]=w("strong",null,"KAP debug",-1)),w("span",BSe,B(d.value.length)+"/"+B(a.value.length),1),w("div",RSe,[w("button",{type:"button",class:Ue({on:C(Ed)}),onClick:N[0]||(N[0]=F=>Ed.value=!C(Ed))},B(C(Ed)?"resume":"pause"),3),w("button",{type:"button",onClick:N[1]||(N[1]=F=>C(Iie)())},"clear"),w("button",{type:"button",onClick:N[2]||(N[2]=F=>I())},"export jsonl"),ae(an,{text:"Close window"},{default:Ie(()=>[w("button",{type:"button",onClick:N[3]||(N[3]=F=>n("close"))},"✕")]),_:1})])]),w("div",DSe,[qn(w("select",{"onUpdate:modelValue":N[4]||(N[4]=F=>o.value=F),"aria-label":"Source filter"},[...N[12]||(N[12]=[w("option",{value:"all"},"rest + ws + app",-1),w("option",{value:"rest"},"rest",-1),w("option",{value:"ws"},"ws",-1),w("option",{value:"client"},"app errors",-1)])],512),[[ry,o.value]]),qn(w("select",{"onUpdate:modelValue":N[5]||(N[5]=F=>i.value=F),"aria-label":"Session filter"},[N[13]||(N[13]=w("option",{value:""},"all sessions",-1)),(x(!0),E(We,null,rt(c.value,F=>(x(),E("option",{key:F,value:F},B(F),9,PSe))),128))],512),[[ry,i.value]]),qn(w("input",{"onUpdate:modelValue":N[6]||(N[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[Cs,s.value]]),w("label",HSe,[qn(w("input",{"onUpdate:modelValue":N[7]||(N[7]=F=>r.value=F),type:"checkbox"},null,512),[[rm,r.value]]),N[14]||(N[14]=ot(" errors",-1))]),w("label",WSe,[qn(w("input",{"onUpdate:modelValue":N[8]||(N[8]=F=>m.value=F),type:"checkbox"},null,512),[[rm,m.value]]),N[15]||(N[15]=ot(" follow",-1))]),w("div",zSe,[w("button",{type:"button",class:Ue({on:l.value==="timeline"}),onClick:N[9]||(N[9]=F=>l.value="timeline")},"timeline",2),w("button",{type:"button",class:Ue({on:l.value==="aggregate"}),onClick:N[10]||(N[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(x(),E("div",{key:0,ref_key:"listRef",ref:k,class:"kap-list"},[d.value.length===0?(x(),E("div",USe," No trace entries yet. REST calls and WS frames will appear here. ")):ue("",!0),(x(!0),E(We,null,rt(d.value,F=>(x(),E("div",{key:F.id,class:"kap-row-wrap"},[w("button",{type:"button",class:Ue(["kap-row",{expanded:p.value===F.id}]),onClick:S=>g(F.id)},[w("span",jSe,B(v(F.ts)),1),w("span",{class:Ue(["kap-badge",T(F)])},B(M(F)),3),w("span",VSe,B(F.label),1)],10,qSe),p.value===F.id?(x(),E("div",KSe,[w("div",GSe,[w("button",{type:"button",onClick:S=>A(F)},B(y.value===F.id?"copied ✓":"copy json"),9,YSe)]),w("pre",null,B(b(F)),1)])):ue("",!0)]))),128))],512)):(x(),E("div",ZSe,[N[20]||(N[20]=w("h4",null,"WS frames by session / type",-1)),w("table",null,[N[17]||(N[17]=w("thead",null,[w("tr",null,[w("th",null,"dir"),w("th",null,"type"),w("th",null,"session"),w("th",null,"count"),w("th",null,"last seq")])],-1)),w("tbody",null,[(x(!0),E(We,null,rt(f.value,F=>(x(),E("tr",{key:F.key},[w("td",null,B(F.dir),1),w("td",XSe,B(F.eventType),1),w("td",QSe,B(F.sessionId),1),w("td",JSe,B(F.count),1),w("td",eCe,B(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(x(),E("tr",tCe,[...N[16]||(N[16]=[w("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ue("",!0)])]),N[21]||(N[21]=w("h4",null,"REST by endpoint",-1)),w("table",null,[N[19]||(N[19]=w("thead",null,[w("tr",null,[w("th",null,"endpoint"),w("th",null,"count"),w("th",null,"errors"),w("th",null,"avg ms")])],-1)),w("tbody",null,[(x(!0),E(We,null,rt(h.value,F=>(x(),E("tr",{key:F.key},[w("td",nCe,B(F.key),1),w("td",oCe,B(F.count),1),w("td",{class:Ue(["num",{err:F.errors>0}])},B(F.errors),3),w("td",sCe,B(F.avgMs),1)]))),128)),h.value.length===0?(x(),E("tr",iCe,[...N[18]||(N[18]=[w("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ue("",!0)])])]))]))}}),lCe=dt(rCe,[["__scopeId","data-v-3cda6fe3"]]),aCe=Je({__name:"DebugPanel",setup(e){const t=oe(!1);let n=null,o=null,s=null;const i=["data-color-scheme","data-accent"];function r(u){const d=document.documentElement,f=u.documentElement;for(const h of i){const p=d.getAttribute(h);p!==null?f.setAttribute(h,p):f.removeAttribute(h)}}function l(u){const d=u.document;d.title="KAP debug";const f=d.createElement("base");f.href=location.href,d.head.appendChild(f);for(const p of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(p.cloneNode(!0));r(d),d.body.style.margin="0";const h=d.createElement("div");return h.style.height="100vh",d.body.appendChild(h),h}function a(){s?.disconnect(),s=null;try{o?.unmount()}catch{}o=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),f=lm(lCe,{onClose:()=>u.close()});f.mount(d),o=f,t.value=!0,s=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),s.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return Cn(()=>{c()}),ho(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(x(),Se(an,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ie(()=>[w("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),cCe=dt(aCe,[["__scopeId","data-v-21346738"]]);function uCe({client:e,authLogoRef:t}){const n=D(()=>e.authReady.value),o=D(()=>e.initialized.value&&!n.value),s="/login",i=oe(null);let r=null;function l(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function a(u){typeof window>"u"||window.history.replaceState(window.history.state,"",u)}et(o,u=>{if(!(typeof window>"u")){if(u){window.location.pathname!==s&&(i.value=l(),a(s));return}window.location.pathname===s&&(a(i.value??"/"),i.value=null)}},{immediate:!0});function c(){const u=t.value;u&&(u.classList.remove("blink-now"),u.getBoundingClientRect(),u.classList.add("blink-now"),r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,u.classList.remove("blink-now")},300))}return $n(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function dCe({running:e,showAuthGate:t}){const{t:n}=$t(),o=["◐","◓","◑","◒"],s=oe(0);let i=null;function r(){i===null&&(s.value=0,i=setInterval(()=>{s.value=(s.value+1)%o.length},250))}function l(){i!==null&&(clearInterval(i),i=null),s.value=0}et(e,c=>{c?r():l()},{immediate:!0});const a=D(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});NA(()=>{typeof document<"u"&&(document.title=a.value)}),$n(()=>{l()})}const zT=oe(typeof window>"u"?0:window.innerWidth);let gp=0,s1=!1;function bk(){zT.value=window.innerWidth}function fCe(){s1||typeof window>"u"||(window.addEventListener("resize",bk),s1=!0,bk())}function hCe(){!s1||typeof window>"u"||(window.removeEventListener("resize",bk),s1=!1)}function UT(e,t,n){return Math.max(t,e-n)}function xk(e,t,n){return Math.min(n,Math.max(t,e))}function qT(){return Cn(()=>{gp+=1,fCe()}),ho(()=>{gp=Math.max(0,gp-1),gp===0&&hCe()}),{viewportWidth:zT}}const pCe="kimi-web.file-preview-width",Wc=320;function mCe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=qT(),i=D(()=>Math.max(0,s.value-t.value)),r=D(()=>UT(i.value,Wc,Wc));function l(Q){return xk(Math.round(Q),Wc,r.value)}function a(){return l(i.value/2)}const c=D(()=>a()),u=oe(c.value),d=D(()=>xk(u.value,Wc,r.value)),f=oe(null),h=D(()=>{const Q=f.value;if(!Q)return null;const G=e.turns.value.find(me=>me.id===Q.turnId)?.blocks?.[Q.blockIndex];return G?.kind==="thinking"?G.thinking:null}),p=D(()=>h.value!==null);function m(Q){const P=f.value;if(P&&P.turnId===Q.turnId&&P.blockIndex===Q.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=Q}function k(){f.value=null,n.value==="thinking"&&(n.value=null)}const y=oe(null),g=D(()=>{const Q=y.value;if(!Q)return null;const P=e.turns.value.find(G=>G.id===Q.turnId);return P?.role==="compaction"&&P.text?P.text:null}),v=D(()=>g.value!==null);function b(Q){if(y.value?.turnId===Q.turnId){y.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",y.value=Q}function A(){y.value=null,n.value==="compaction"&&(n.value=null)}const I=oe(null);function T(Q){const P=e.activeAppTasks.value,G=P.find(ye=>ye.id===Q)??P.find(ye=>ye.parentToolCallId===Q);if(G)return G.id;const me=P.filter(ye=>ye.kind==="subagent"&&!ye.parentToolCallId);if(me.length===1)return me[0].id}const M=D(()=>{const Q=I.value;if(!Q)return null;const P=e.activeAppTasks.value.find(G=>G.id===Q.subagentId);return P?jve(P):null}),$=D(()=>M.value!==null);function N(Q){const P=T(Q);if(P){if(I.value?.subagentId===P){I.value=null,n.value==="agent"&&(n.value=null);return}I.value={subagentId:P},n.value="agent"}}function F(){I.value=null,n.value==="agent"&&(n.value=null)}const S=oe(null),R=D(()=>{const Q=S.value;if(!Q)return null;const P=Zz(e.turns.value,Q);return P?{id:Q,title:ec(P.name),path:Yz(P.arg),lines:P.status==="error"?null:g6(P),output:P.output}:null}),z=D(()=>R.value!==null);function W(Q){if(n.value==="toolDiff"&&S.value===Q){L();return}n.value="toolDiff",S.value=Q}function L(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const O=oe("list"),U=oe(null);function Z(){if(n.value==="diff"){ie();return}n.value="diff",O.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function ie(){n.value==="diff"&&(n.value=null),O.value="list",U.value=null,e.clearFileDiff()}async function q(Q){O.value="detail",U.value=Q,await e.loadFileDiff(Q)}async function ee(Q){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,Q):await e.openSideChat(Q),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function ne(){n.value==="btw"&&(n.value=null)}const j=D(()=>e.sideChatVisible.value),K=D(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||v.value)&&(n.value!=="agent"||$.value)&&(n.value!=="toolDiff"||z.value)&&(n.value!=="btw"||j.value)),ve=oe(!1),he=oe({});function Ae(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return y.value?{kind:"compaction",...y.value}:null;case"agent":return I.value?{kind:"agent",...I.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function re(Q){if(Q)switch(Q.kind){case"thinking":f.value={turnId:Q.turnId,blockIndex:Q.blockIndex},n.value="thinking";break;case"compaction":y.value={turnId:Q.turnId},n.value="compaction";break;case"agent":I.value={subagentId:Q.subagentId},n.value="agent";break;case"toolDiff":S.value=Q.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function Y(){return n.value==="thinking"&&p.value?(k(),!0):n.value==="compaction"&&v.value?(A(),!0):n.value==="agent"&&$.value?(F(),!0):n.value==="toolDiff"&&z.value?(L(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(ie(),!0):n.value==="btw"?(fe(),!0):!1}return et(e.activeSessionId,(Q,P)=>{if(P){const G=Ae();G?he.value[P]=G:delete he.value[P]}o(),k(),A(),F(),L(),ie(),ne(),Q&&re(he.value[Q])}),{PREVIEW_WIDTH_KEY:pCe,PREVIEW_MIN:Wc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:m,closeThinkingPanel:k,compactionPanelText:g,compactionPanelVisible:v,openCompactionPanel:b,closeCompactionPanel:A,agentPanelMember:M,agentPanelVisible:$,openAgentPanel:N,closeAgentPanel:F,toolDiffTarget:R,toolDiffVisible:z,openToolDiff:W,closeToolDiff:L,detailDiffMode:O,detailDiffPath:U,openDiffDetail:Z,closeDiffDetail:ie,selectDiffFile:q,btwVisible:j,openSideChatTab:ee,closeSideChat:fe,hideSideChatPanel:ne,sidePanelVisible:K,panelDragging:ve,closeOpenSidePanel:Y}}const gCe=Dt.sidebarWidth,X3=Dt.sidebarCollapsed,Q3=270,Wv=170,vCe=480,yCe=320;function kCe(e={}){const{viewportWidth:t}=qT(),n=oe(Q3),o=oe(!1),s=oe(!1),i=D(()=>{const u=yCe+(wA(e.previewOpen)?Wc:0);return Math.min(vCe,UT(t.value,Wv,u))}),r=D(()=>xk(n.value,Wv,i.value));function l(){try{o.value=yo(X3)==="true"}catch{o.value=!1}}function a(){try{To(X3,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:gCe,SIDEBAR_DEFAULT:Q3,SIDEBAR_MIN:Wv,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function bCe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function xCe({client:e,detailTarget:t}){const{t:n}=$t(),o=oe(null),s=oe(null),i=oe(!1),r=oe(null),l=oe(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=D(()=>{const T=l.value;return T?e.getFileDownloadUrl(T):null}),f=D(()=>o.value!==null);function h(T){return T.length>1?T.replace(/\/+$/,""):T}function p(T){const M=[];for(const $ of T.split(/[\\/]+/))if(!(!$||$===".")){if($===".."){M.pop();continue}M.push($)}return M.join("/")}function m(T){const M=T.trim();if(!M)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(M))return{error:n("filePreview.errors.unsupportedPath")};if(M.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const $=h(e.status.value.cwd);if(M.startsWith("/")){if(!$||M!==$&&!M.startsWith(`${$}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=M===$?"":M.slice($.length+1);if(F.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const S=p(F);return S?{path:S}:{error:n("filePreview.errors.isDirectory")}}if(M.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const N=p(M);return N?{path:N}:{error:n("filePreview.errors.emptyPath")}}async function k(T){const M=o.value;if(t.value==="file"&&M&&M.path===T.path&&M.line===T.line){b();return}const $=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=T,l.value=null;const N=m(T.path);if("error"in N){i.value=!1,r.value=N.error;return}l.value=N.path;try{const F=await e.readFileContent(N.path);if($!==a)return;F?s.value={...F,path:F.path||N.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if($!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{$===a&&(i.value=!1)}}function y(T){return/^data:([^;,]+)/i.exec(T)?.[1]}function g(T){if(T.kind!=="image"&&T.kind!=="video")return;const M=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const $=T.kind==="video",N={path:T.path??($?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:T.mimeType??y(T.url)??($?"video/*":"image/*"),isBinary:!0,size:T.bytes??0};T.fileId?(i.value=!0,s.value=N,ht().getFileBlob(T.fileId).then(F=>{if(M===a){if(t.value!=="file"||!s.value){i.value=!1;return}c=URL.createObjectURL(F),s.value={...s.value,sourceUrl:c},i.value=!1}}).catch(()=>{M===a&&(s.value&&(s.value={...s.value,sourceUrl:T.url}),i.value=!1)})):(i.value=!1,s.value=bCe(T.url)?{...N,sourceUrl:T.url}:N)}function v(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function b(){v(),t.value==="file"&&(t.value=null)}et(t,(T,M)=>{M==="file"&&T!=="file"&&v()});function A(){const T=s.value?.path??o.value?.path;T&&e.openWorkspaceFile(T,o.value?.line)}function I(){const T=s.value?.path??o.value?.path;T&&e.revealWorkspaceFile(T)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:k,openMediaPreview:g,closeFilePreview:b,openPreviewInEditor:A,revealPreviewFile:I}}const wCe=640,_Ce=`(max-width: ${wCe}px)`;function SCe(){const e=oe(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(_Ce);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),$n(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),$n(()=>t.removeListener(n))),e}const CCe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},ACe={class:"server-auth-card"},MCe={class:"server-auth-body"},ECe={class:"server-auth-foot"},TCe=Je({__name:"ServerAuthDialog",setup(e){const t=oe(""),n=oe(null),o=oe(!1);Cn(()=>{yt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,NE(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(x(),E("div",CCe,[w("div",ACe,[l[1]||(l[1]=w("div",{class:"server-auth-head"},[w("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),w("p",{class:"server-auth-hint"},[ot(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),w("code",null,"KIMI_CODE_PASSWORD"),ot("). ")])],-1)),w("div",MCe,[ae(pu,{ref_key:"inputRef",ref:n,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=a=>t.value=a),type:"password",autocomplete:"current-password",placeholder:"Token",disabled:o.value,onKeydown:i},null,8,["modelValue","disabled"])]),w("div",ECe,[ae(jt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ie(()=>[ot(B(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),NCe=dt(TCe,[["__scopeId","data-v-6f624612"]]),ICe=["aria-label"],LCe=Je({__name:"InternalBuildBanner",setup(e){const{t}=$t(),n=hH;return(o,s)=>C(n)?(x(),E("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=w("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[w("path",{d:"M8 2 14 13H2L8 2Z"}),w("path",{d:"M8 6v3.5"}),w("path",{d:"M8 11.5h.01"})],-1)),w("span",null,B(C(t)("app.internalBuildBanner")),1)],8,ICe)):ue("",!0)}}),$Ce=dt(LCe,[["__scopeId","data-v-166b3735"]]),FCe={class:"app-shell"},OCe={key:1,class:"auth-page"},BCe={class:"auth-page-inner"},RCe={class:"auth-page-copy"},DCe=["aria-label","aria-hidden"],PCe=Je({__name:"App",setup(e){wre();const t=oe(!1);let n=null;const o=$b(),s=D(()=>!o.dangerousBypassAuth.value&&t.value);In("resolveImage",o.resolveImageUrl),In("resolveSwarmMembers",Re=>o.swarmMembersByToolCallId.value.get(Re)??[]);const{t:i}=$t(),{confirm:r}=Uf(),l=Yi(),a=SCe(),c=oe(!1),u=oe(!1),d=D(()=>{const Re=o.activeSessionId.value;return o.sessions.value.find(le=>le.id===Re)?.title??""}),f=D(()=>o.visibleWorkspace.value?.sessionCount??0),h=D(()=>o.activity.value!=="idle"),p=oe(null),{showAuthGate:m,blinkAuthLogo:k}=uCe({client:o,authLogoRef:p});dCe({running:h,showAuthGate:m});function y(Re){const le=o.models.value.find(ze=>ze.id===o.status.value.modelId),Te=o0(le),ge=Te.indexOf(Gm(le,Re)),Me=Te[(ge+1)%Te.length]??Te[0]??"off";return lb(le,Me)}const g=D(()=>{const Re=o.models.value.find(le=>le.id===o.status.value.modelId);return Gm(Re,o.thinking.value)}),v=oe(!o.onboarded.value);function b(){o.setOnboarded(!0),v.value=!1}function A(){v.value=!0}let I=0;function T(){const Re=window.visualViewport,le=document.documentElement.style;le.setProperty("--app-height",`${Re?.height??window.innerHeight}px`),le.setProperty("--app-top",`${Re?.offsetTop??0}px`)}function M(){I||(I=requestAnimationFrame(()=>{I=0,T()}))}Cn(()=>{n=Cre(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),Q(),T(),window.visualViewport?.addEventListener("resize",M),window.visualViewport?.addEventListener("scroll",M),window.addEventListener("resize",M),document.addEventListener("keydown",$,!0)}),$n(()=>{document.removeEventListener("keydown",$,!0),window.visualViewport?.removeEventListener("resize",M),window.visualViewport?.removeEventListener("scroll",M),window.removeEventListener("resize",M),I&&(cancelAnimationFrame(I),I=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function $(Re){Re.key==="Escape"&&(Be.value||so()&&(Re.stopPropagation(),Re.preventDefault()))}const N=oe(null),F=oe(!1);et(o.activeSessionId,()=>{F.value=!0,yt(()=>{F.value=!1})});const{previewTarget:S,previewFile:R,previewLoading:z,previewError:W,previewDownloadUrl:L,previewExternalActions:O,openFilePreview:U,openMediaPreview:Z,closeFilePreview:ie,openPreviewInEditor:q,revealPreviewFile:ee}=xCe({client:o,detailTarget:N}),fe=D(()=>N.value!==null),{SIDEBAR_WIDTH_KEY:ne,SIDEBAR_DEFAULT:j,SIDEBAR_MIN:K,sidebarMax:ve,sessionColWidth:he,sidebarCollapsed:Ae,sidebarDragging:re,sideWidth:Y,loadSidebarCollapsed:Q,toggleSidebarCollapse:P}=kCe({previewOpen:fe}),{PREVIEW_WIDTH_KEY:G,PREVIEW_MIN:me,previewDefaultWidth:ye,previewMax:de,previewWidth:V,previewPanelWidth:se,thinkingPanelText:pe,thinkingVisible:ke,openThinkingPanel:Ne,closeThinkingPanel:qe,compactionPanelText:be,compactionPanelVisible:xe,openCompactionPanel:Ze,closeCompactionPanel:tt,agentPanelMember:lt,openAgentPanel:ut,closeAgentPanel:mt,toolDiffTarget:Tt,openToolDiff:wt,closeToolDiff:Ft,detailDiffMode:en,detailDiffPath:Dn,openDiffDetail:Pt,closeDiffDetail:kn,selectDiffFile:hn,btwVisible:Kt,openSideChatTab:Tn,closeSideChat:Gt,sidePanelVisible:Wt,panelDragging:pn,closeOpenSidePanel:so}=mCe({client:o,sideWidth:Y,detailTarget:N,closeFilePreview:ie}),mn=oe(null),to=oe(!1),vt=oe(!1),Pn=oe(!1),Fn=oe(!1),Qn=oe(!1),sn=oe(!1),es=oe(null),nt=oe(null),Be=D(()=>Bc.value>0||to.value||vt.value||Pn.value||Fn.value||Qn.value||sn.value||v.value||c.value||u.value),Bt=oe(!1),Yt=oe(!1),gn=oe(!1),bn=oe(!1),nn=oe(!1);async function Vn(){Bt.value=!0,Yt.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Yt.value=!0}finally{Bt.value=!1}}async function Kn(){gn.value=!0,bn.value=!1,vt.value=!0;try{await o.loadProviders()}catch{bn.value=!0}finally{gn.value=!1}}function Jn(){Pn.value=!0}async function Oo(Re){to.value=!1,await ko(Re)}async function ko(Re){await o.setModel(Re)&&Re!==o.defaultModel.value&&o.updateConfig({defaultModel:Re})}async function ai(Re){await o.addProvider(Re)}async function Uo(Re){await o.refreshProvider(Re)}async function As(Re){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Re)})}async function cs(Re){const le=o.workspacesView.value.find(Te=>Te.id===Re)?.name??Re;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:le}),variant:"danger",action:()=>o.deleteWorkspace(Re)})}async function qo(Re){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Re)})}async function Bo(Re){nn.value=!0;try{await o.updateConfig(Re)&&await o.checkAuth()}finally{nn.value=!1}}async function ci(){return o.startOAuthLogin()}async function tn(){return o.pollOAuthLogin()}async function qs(){return o.cancelOAuthLogin()}async function io(){Pn.value=!1,await o.checkAuth(),await o.load()}async function js(Re){await o.undo(1),await yt(),mn.value?.loadComposerForEdit(Re.text,Re.attachments)}function ui(Re){if(Re==="/compact"||Re.startsWith("/compact ")){o.compact(Re.slice(8).trim()||void 0);return}if(Re==="/swarm"||Re.startsWith("/swarm ")){const le=Re.slice(6).trim();le==="on"?o.setSwarmMode(!0):le==="off"?o.setSwarmMode(!1):le?(o.setSwarmMode(!0),o.sendPrompt(le)):o.toggleSwarmMode();return}if(Re==="/goal"||Re.startsWith("/goal ")){const le=Re.slice(5).trim();le==="pause"||le==="resume"||le==="cancel"?o.controlGoal(le):le?o.createGoal(le):o.toggleGoalMode();return}if(Re==="/btw"||Re.startsWith("/btw ")){const le=Re.slice(4).trim();!le&&o.sideChatVisible.value?Gt():Tn(le||void 0);return}switch(Re){case"/new":case"/clear":Io();break;case"/fork":o.forkSession();break;case"/export":o.exportSession();break;case"/undo":o.undo();break;case"/plan":o.togglePlanMode();break;case"/auto":o.setPermission("auto");break;case"/yolo":o.setPermission("yolo");break;case"/thinking":o.setThinking(y(o.thinking.value));break;case"/status":Qn.value=!0;break;case"/login":Jn();break;default:{const le=Re.indexOf(" "),Te=rue((le===-1?Re:Re.slice(0,le)).slice(1)),ge=le===-1?void 0:Re.slice(le+1).trim()||void 0;if(!Te)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Te,ge):o.activateSkill(Te,ge);break}}}function Ni(Re){o.unqueue(Re)}function di(Re){o.unqueue(Re)}function Vs(Re){o.reorderQueue(Re.from,Re.to)}async function ts(Re){const le=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&le){await o.startSessionAndSendPrompt(le,Re.text,Re.attachments);return}if(!o.activeSessionId.value&&!le){es.value=Re,Fn.value=!0;return}o.sendPrompt(Re.text,Re.attachments)}async function ns(Re){if(nt.value=null,!await o.addWorkspaceByPath(Re)){nt.value=i("workspace.addFailed");return}Fn.value=!1;const Te=es.value;es.value=null;const ge=o.activeWorkspaceId.value;Te&&ge&&await o.startSessionAndSendPrompt(ge,Te.text,Te.attachments)}function zt(){es.value=null,nt.value=null,Fn.value=!1}function Ms(){yt(()=>{mn.value?.focusComposer()})}function Io(){const Re=o.activeWorkspaceId.value;Re?o.openWorkspaceDraft(Re):o.clearActiveSession(),Ms()}function fi(Re){o.openWorkspaceDraft(Re),Ms()}function Ke(Re){Re&&window.open(Re,"_blank","noopener")}return(Re,le)=>(x(),E("div",FCe,[s.value?(x(),Se(NCe,{key:0})):ue("",!0),C(m)?(x(),E("section",OCe,[w("div",BCe,[(x(),E("svg",{ref_key:"authLogoRef",ref:p,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code",onMousedown:le[0]||(le[0]=St(()=>{},["prevent"])),onClick:le[1]||(le[1]=(...Te)=>C(k)&&C(k)(...Te))},[...le[98]||(le[98]=[Pk('<defs data-v-8cd3196b><mask id="authKimiEyes" maskUnits="userSpaceOnUse" data-v-8cd3196b><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-8cd3196b></rect><g class="ch-eyes" fill="#000" data-v-8cd3196b><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-8cd3196b></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authKimiEyes)" data-v-8cd3196b></rect>',2)])],544)),w("div",RCe,[w("h1",null,B(C(i)("app.authPageTitle")),1),w("p",null,B(C(i)("app.authPageMessage")),1)]),ae(jt,{class:"auth-page-btn",variant:"primary",onClick:Jn},{default:Ie(()=>[ae(Ge,{name:"log-in",size:"md"}),w("span",null,B(C(i)("app.authPageLogin")),1)]),_:1})])])):(x(),E("div",{key:2,class:Ue(["app",{mobile:C(a),"sidebar-collapsed":C(Ae)&&!C(a),"macos-desktop":C(su)}]),style:on({"--preview-w":C(se)+"px"})},[C(a)?(x(),Se(Rwe,{key:1,workspace:C(o).visibleWorkspace.value,"session-title":d.value,running:h.value,branch:C(o).status.value.branch,"session-count":f.value,onOpenSwitcher:le[19]||(le[19]=Te=>c.value=!0),onOpenSettings:le[20]||(le[20]=Te=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(x(),E(We,{key:0},[ae(BH,{collapsed:C(Ae),dragging:C(re),"col-width":C(Y),"active-workspace":C(o).visibleWorkspace.value,"active-workspace-id":C(o).activeWorkspaceId.value,sessions:C(o).sessionsForView.value,groups:C(o).workspaceGroups.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"pending-by-session":C(o).pendingBySession.value,"unread-by-session":C(o).unreadBySession.value,"workspace-sort-mode":C(o).workspaceSortMode.value,backend:C(o).backend.value,onSelect:le[2]||(le[2]=Te=>C(o).selectSession(Te)),onCreate:Io,onCreateInWorkspace:le[3]||(le[3]=Te=>fi(Te)),onSelectWorkspace:le[4]||(le[4]=Te=>C(o).openWorkspace(Te)),onAddWorkspace:le[5]||(le[5]=Te=>Fn.value=!0),onRename:le[6]||(le[6]=(Te,ge)=>C(o).renameSession(Te,ge)),onArchive:le[7]||(le[7]=Te=>As(Te)),onFork:le[8]||(le[8]=Te=>C(o).forkSession(Te)),onExport:le[9]||(le[9]=Te=>C(o).exportSession(Te)),onRenameWorkspace:le[10]||(le[10]=(Te,ge)=>C(o).renameWorkspace(Te,ge)),onDeleteWorkspace:le[11]||(le[11]=Te=>cs(Te)),onReorderWorkspaces:le[12]||(le[12]=Te=>C(o).reorderWorkspaces(Te)),onSetWorkspaceSortMode:le[13]||(le[13]=Te=>C(o).setWorkspaceSortMode(Te)),onLoadMoreSessions:le[14]||(le[14]=Te=>void C(o).loadMoreSessions(Te)),onLoadAllSessions:le[15]||(le[15]=Te=>void C(o).loadAllSessions()),onOpenSettings:le[16]||(le[16]=Te=>sn.value=!0),onCollapse:C(P)},null,8,["collapsed","dragging","col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session","workspace-sort-mode","backend","onCollapse"]),qn(ae(F_,{class:"side-handle","storage-key":C(ne),"default-width":C(j),min:C(K),max:C(ve),"onUpdate:width":le[17]||(le[17]=Te=>he.value=Te),"onUpdate:dragging":le[18]||(le[18]=Te=>re.value=Te)},null,8,["storage-key","default-width","min","max"]),[[wi,!C(Ae)]])],64)),ae(fpe,{ref_key:"conversationPaneRef",ref:mn,mobile:C(a),turns:C(o).turns.value,"session-id":C(o).activeSessionId.value,approvals:C(o).pendingApprovals.value,changes:C(o).changes.value,"git-info":C(o).gitInfo.value,tasks:C(o).tasks.value,todos:C(o).todos.value,goal:C(o).goal.value,"activation-badges":C(o).activationBadges.value,status:C(o).status.value,thinking:C(o).thinking.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"goal-mode":C(o).goalMode.value,models:C(o).models.value,"starred-ids":C(o).starredModelIds.value,skills:C(o).skills.value,questions:C(o).questions.value,"pending-question-actions":C(o).pendingQuestionActions,"pending-approval-actions":C(o).pendingApprovalActions,running:h.value,"turn-active":C(o).turnActive.value,queued:C(o).queued.value,"search-files":C(o).searchFiles,"upload-image":C(o).uploadImage,working:C(o).working.value,starting:C(o).isStartingFirstPrompt.value,"fast-moon":C(o).fastMoon.value,"file-reload-key":C(o).activeSessionId.value,"session-loading":C(o).sessionLoading.value,compaction:C(o).compaction.value,"has-more-messages":C(o).hasMoreMessages.value,"loading-more":C(o).loadingMoreMessages.value,"loading-more-error":C(o).loadMoreMessagesError.value,"load-older-messages":C(o).loadOlderMessages,"workspace-name":C(o).visibleWorkspace.value?.name,"workspace-root":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,"git-diff-stats":C(o).gitDiffStats.value,workspaces:C(o).workspacesView.value,"active-workspace-id":C(o).activeWorkspaceId.value,"session-title":d.value,pr:C(o).activePullRequest.value,"conversation-toc":C(o).conversationToc.value,onOpenChanges:le[21]||(le[21]=Te=>C(Pt)()),onSelectWorkspace:le[22]||(le[22]=Te=>fi(Te)),onAddWorkspace:le[23]||(le[23]=Te=>Fn.value=!0),onOpenPr:Ke,onSubmit:le[24]||(le[24]=Te=>ts(Te)),onSteer:le[25]||(le[25]=Te=>C(o).steerPrompt(Te.text,Te.attachments)),onApproval:le[26]||(le[26]=(Te,ge)=>C(o).respondApproval(Te,ge)),onCancelTask:le[27]||(le[27]=Te=>C(o).cancelTask(Te)),onAnswer:le[28]||(le[28]=(Te,ge)=>C(o).respondQuestion(Te,ge)),onDismiss:le[29]||(le[29]=Te=>C(o).dismissQuestion(Te)),onCommand:ui,onInterrupt:le[30]||(le[30]=Te=>C(o).abortCurrentPrompt()),onUnqueue:Ni,onEditQueued:di,onReorderQueue:Vs,onSetPermission:le[31]||(le[31]=Te=>C(o).setPermission(Te)),onSetThinking:le[32]||(le[32]=Te=>C(o).setThinking(Te)),onTogglePlan:le[33]||(le[33]=Te=>C(o).togglePlanMode()),onToggleSwarm:le[34]||(le[34]=Te=>C(o).toggleSwarmMode()),onToggleGoal:le[35]||(le[35]=Te=>C(o).toggleGoalMode()),onCreateGoal:le[36]||(le[36]=Te=>C(o).createGoal(Te)),onControlGoal:le[37]||(le[37]=Te=>C(o).controlGoal(Te)),onRefreshGitStatus:le[38]||(le[38]=Te=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:le[39]||(le[39]=(Te,ge)=>C(o).renameSession(Te,ge)),onForkSession:le[40]||(le[40]=Te=>C(o).forkSession(Te)),onArchiveSession:le[41]||(le[41]=Te=>As(Te)),onExportSession:le[42]||(le[42]=Te=>C(o).exportSession(Te)),onCompact:le[43]||(le[43]=Te=>C(o).compact()),onPickModel:le[44]||(le[44]=Te=>Vn()),onSelectModel:le[45]||(le[45]=Te=>ko(Te)),onOpenFile:le[46]||(le[46]=Te=>C(U)(Te)),onOpenMedia:le[47]||(le[47]=Te=>C(Z)(Te)),onOpenThinking:le[48]||(le[48]=Te=>C(Ne)(Te)),onOpenCompaction:le[49]||(le[49]=Te=>C(Ze)(Te)),onOpenAgent:le[50]||(le[50]=Te=>C(ut)(Te)),onOpenToolDiff:le[51]||(le[51]=Te=>C(wt)(Te)),onEditMessage:js},null,8,["mobile","turns","session-id","approvals","changes","git-info","tasks","todos","goal","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","pending-question-actions","pending-approval-actions","running","turn-active","queued","search-files","upload-image","working","starting","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","conversation-toc"]),!C(a)&&(C(su)||C(Ae))?(x(),Se(Xn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Ae)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(P)},{default:Ie(()=>[ae(Ge,{name:C(Ae)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ue("",!0),C(Wt)&&!C(a)?(x(),Se(F_,{key:3,class:"preview-handle","storage-key":C(G),"default-width":C(ye),min:C(me),max:C(de),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":le[52]||(le[52]=Te=>V.value=Te),"onUpdate:dragging":le[53]||(le[53]=Te=>pn.value=Te)},null,8,["storage-key","default-width","min","max","aria-label"])):ue("",!0),!C(a)||C(Wt)?(x(),E("aside",{key:4,class:Ue(["global-preview",{open:C(Wt),mobile:C(a),"no-anim":C(pn)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Wt)},[N.value==="thinking"&&C(ke)?(x(),Se($3,{key:0,text:C(pe)??"",onClose:C(qe)},null,8,["text","onClose"])):N.value==="compaction"&&C(xe)?(x(),Se($3,{key:1,text:C(be)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(tt)},null,8,["text","subtitle","onClose"])):N.value==="agent"&&C(lt)?(x(),Se(Dme,{key:2,member:C(lt),onClose:C(mt)},null,8,["member","onClose"])):N.value==="btw"&&C(Kt)?(x(),Se(i1e,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:le[54]||(le[54]=Te=>C(o).sendSideChatPrompt(Te)),onClose:C(Gt)},null,8,["turns","running","sending","onClose"])):N.value==="diff"?(x(),Se($1e,{key:4,mode:C(en),changes:C(o).changes.value,"git-info":C(o).gitInfo.value,"file-diff":C(o).fileDiff.value,"selected-diff-path":C(o).selectedDiffPath.value,"file-diff-loading":C(o).fileDiffLoading.value,closable:"",onOpen:C(hn),onBack:le[55]||(le[55]=Te=>{en.value="list",Dn.value=null,C(o).clearFileDiff()}),onClose:C(kn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):N.value==="toolDiff"&&C(Tt)?(x(),Se(Xme,{key:5,target:C(Tt),onClose:C(Ft)},null,8,["target","onClose"])):N.value==="file"?(x(),Se(kme,{key:6,file:C(R),loading:C(z),error:C(W),line:C(S)?.line,"download-url":C(L),closable:"","external-actions":C(O),"open-file":C(U),onClose:C(ie),onOpenExternal:C(q),onReveal:C(ee)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ue("",!0)],10,DCe)):ue("",!0),ae($Ce,{class:"internal-build-fab"}),to.value?(x(),Se(Q1e,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:Bt.value,unavailable:Yt.value,onSelect:le[56]||(le[56]=Te=>Oo(Te)),onToggleStar:le[57]||(le[57]=Te=>C(o).toggleStarModel(Te)),onClose:le[58]||(le[58]=Te=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ue("",!0),sn.value?(x(),Se(vxe,{key:6,"color-scheme":C(o).colorScheme.value,accent:C(o).accent.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"account-model":C(o).defaultModel.value,notify:C(o).notifyOnComplete.value,"notify-question":C(o).notifyOnQuestion.value,"notify-approval":C(o).notifyOnApproval.value,"notify-permission":C(o).notifyPermission.value,sound:C(o).soundOnComplete.value,"conversation-toc":C(o).conversationToc.value,config:C(o).config.value,models:C(o).models.value,"config-saving":nn.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:le[59]||(le[59]=Te=>C(o).setColorScheme(Te)),onSetAccent:le[60]||(le[60]=Te=>C(o).setAccent(Te)),onSetUiFontSize:le[61]||(le[61]=Te=>C(o).setUiFontSize(Te)),onSetNotify:le[62]||(le[62]=Te=>C(o).setNotifyOnComplete(Te)),onSetNotifyQuestion:le[63]||(le[63]=Te=>C(o).setNotifyOnQuestion(Te)),onSetNotifyApproval:le[64]||(le[64]=Te=>C(o).setNotifyOnApproval(Te)),onSetSound:le[65]||(le[65]=Te=>C(o).setSoundOnComplete(Te)),onSetConversationToc:le[66]||(le[66]=Te=>C(o).setConversationToc(Te)),onUpdateConfig:le[67]||(le[67]=Te=>Bo(Te)),onLogin:le[68]||(le[68]=()=>{sn.value=!1,Jn()}),onLogout:C(o).logout,onOpenOnboarding:le[69]||(le[69]=()=>{sn.value=!1,A()}),onOpenProviders:le[70]||(le[70]=()=>{sn.value=!1,Kn()}),onClose:le[71]||(le[71]=Te=>sn.value=!1)},null,8,["color-scheme","accent","ui-font-size","auth-ready","account-model","notify","notify-question","notify-approval","notify-permission","sound","conversation-toc","config","models","config-saving","server-version","backend","onLogout"])):ue("",!0),vt.value?(x(),Se(_0e,{key:7,providers:C(o).providers.value,loading:gn.value,unavailable:bn.value,onAdd:le[72]||(le[72]=Te=>ai(Te)),onRefresh:le[73]||(le[73]=Te=>Uo(Te)),onDelete:le[74]||(le[74]=Te=>qo(Te)),onOpenLogin:le[75]||(le[75]=()=>{vt.value=!1,Jn()}),onClose:le[76]||(le[76]=Te=>vt.value=!1)},null,8,["providers","loading","unavailable"])):ue("",!0),Qn.value?(x(),Se(gwe,{key:8,status:C(o).status.value,thinking:g.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:le[77]||(le[77]=Te=>Qn.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ue("",!0),Fn.value?(x(),Se(ewe,{key:9,"browse-fs":C(o).browseFs,"get-fs-home":C(o).getFsHome,"default-path":C(o).visibleWorkspace.value?.root??C(o).status.value.cwd,error:nt.value,onAdd:le[78]||(le[78]=Te=>ns(Te)),onClose:zt},null,8,["browse-fs","get-fs-home","default-path","error"])):ue("",!0),ae(Ua,{name:"gload-fade"},{default:Ie(()=>[C(o).initialized.value?ue("",!0):(x(),Se($Se,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&v.value&&!C(m)?(x(),Se(ASe,{key:10,onComplete:b,onSkip:b})):ue("",!0),ae(Ewe,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(x(),Se(cCe,{key:11})):ue("",!0),ae(swe),C(a)?(x(),Se(r_e,{key:12,modelValue:c.value,"onUpdate:modelValue":le[79]||(le[79]=Te=>c.value=Te),groups:C(o).workspaceGroups.value,"active-workspace-id":C(o).activeWorkspaceId.value,"active-id":C(o).activeSessionId.value,"attention-by-session":C(o).attentionBySession.value,"attention-by-workspace":C(o).attentionByWorkspace.value,onSelect:le[80]||(le[80]=Te=>C(o).selectSession(Te)),onCreate:Io,onCreateInWorkspace:le[81]||(le[81]=Te=>fi(Te)),onAddWorkspace:le[82]||(le[82]=Te=>Fn.value=!0),onRename:le[83]||(le[83]=(Te,ge)=>C(o).renameSession(Te,ge)),onArchive:le[84]||(le[84]=Te=>As(Te)),onDeleteWorkspace:le[85]||(le[85]=Te=>cs(Te)),onLoadMore:le[86]||(le[86]=Te=>void C(o).loadMoreSessions(Te))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ue("",!0),C(a)?(x(),Se(pSe,{key:13,modelValue:u.value,"onUpdate:modelValue":le[87]||(le[87]=Te=>u.value=Te),status:C(o).status.value,thinking:C(o).thinking.value,models:C(o).models.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"color-scheme":C(o).colorScheme.value,"ui-font-size":C(o).uiFontSize.value,"auth-ready":C(o).authReady.value,"conversation-toc":C(o).conversationToc.value,"server-version":C(o).serverVersion.value,onPickModel:le[88]||(le[88]=Te=>Vn()),onSetThinking:le[89]||(le[89]=Te=>C(o).setThinking(Te)),onTogglePlan:le[90]||(le[90]=Te=>C(o).togglePlanMode()),onToggleSwarm:le[91]||(le[91]=Te=>C(o).toggleSwarmMode()),onSetPermission:le[92]||(le[92]=Te=>C(o).setPermission(Te)),onSetColorScheme:le[93]||(le[93]=Te=>C(o).setColorScheme(Te)),onSetUiFontSize:le[94]||(le[94]=Te=>C(o).setUiFontSize(Te)),onSetConversationToc:le[95]||(le[95]=Te=>C(o).setConversationToc(Te)),onLogin:le[96]||(le[96]=()=>{u.value=!1,Jn()}),onLogout:C(o).logout},null,8,["modelValue","status","thinking","models","plan-mode","swarm-mode","color-scheme","ui-font-size","auth-ready","conversation-toc","server-version","onLogout"])):ue("",!0)],6)),Pn.value?(x(),Se(ege,{key:3,"on-start-o-auth-login":ci,"on-poll-o-auth-login":tn,"on-cancel-o-auth-login":qs,onSuccess:io,onClose:le[97]||(le[97]=Te=>Pn.value=!1)})):ue("",!0)]))}}),HCe=dt(PCe,[["__scopeId","data-v-8cd3196b"]]);Rie();lm(HCe).use(On).mount("#app");export{f9 as $,zA as A,nI as B,So as C,R4e as D,iA as E,We as F,Pk as G,ot as H,ae as I,B9 as J,a4e as K,Hi as L,Je as M,M7 as N,f4e as O,h4e as P,g4e as Q,qp as R,nu as S,b1 as T,p4e as U,Wk as V,d4e as W,P4e as X,m4e as Y,L4e as Z,WCe as _,OA as a,Ho as a$,Eo as a0,Sk as a1,GCe as a2,Tk as a3,fM as a4,Lt as a5,Su as a6,e4e as a7,z4e as a8,s4e as a9,HA as aA,hI as aB,kI as aC,Cn as aD,yI as aE,vI as aF,Ef as aG,gI as aH,$n as aI,Ik as aJ,W9 as aK,x as aL,S7 as aM,QCe as aN,In as aO,_A as aP,XCe as aQ,Gp as aR,zo as aS,jv as aT,oe as aU,A4e as aV,U7 as aW,rt as aX,jn as aY,xI as aZ,c4e as a_,l4e as aa,r4e as ab,i4e as ac,E4e as ad,U4e as ae,Jt as af,o7 as ag,y1 as ah,Il as ai,Gr as aj,vo as ak,M4e as al,ti as am,Dl as an,gt as ao,k4e as ap,b4e as aq,_n as ar,yt as as,a7 as at,Ue as au,l9 as av,on as aw,fI as ax,mI as ay,ho as az,ZCe as b,qte as b$,O4e as b0,nf as b1,em as b2,$4e as b3,Rl as b4,I9 as b5,UCe as b6,gr as b7,G9 as b8,F4e as b9,Cs as bA,wi as bB,s7 as bC,N4e as bD,et as bE,NA as bF,t4e as bG,Z9 as bH,w4e as bI,Ie as bJ,v4e as bK,qn as bL,ur as bM,T4e as bN,St as bO,JCe as bP,An as bQ,vs as bR,Y4e as bS,Z4e as bT,q8 as bU,X4e as bV,cte as bW,U8 as bX,Oy as bY,t3e as bZ,Kte as b_,zCe as ba,B as bb,vp as bc,u4e as bd,dn as be,jCe as bf,qCe as bg,wA as bh,C4e as bi,$9 as bj,C as bk,Lf as bl,W4e as bm,D4e as bn,T7 as bo,n4e as bp,_4e as bq,Y9 as br,H4e as bs,y4e as bt,o4e as bu,FA as bv,rm as bw,D7 as bx,EM as by,ry as bz,I4e as c,R2 as c0,O2 as c1,B2 as c2,o3e as c3,Fm as c4,Kc as c5,Lm as c6,Hte as c7,Wte as c8,s3e as c9,n3e as ca,V4e as cb,i3e as cc,V1 as cd,Fs as ce,one as cf,nne as cg,nte as ch,G4e as ci,Qee as cj,Jee as ck,K4e as cl,D2 as cm,sne as cn,p4 as co,GC as cp,dte as cq,$m as cr,Im as cs,Q4e as ct,e3e as cu,j4e as cv,J4e as cw,Ge as cx,q4e as cy,dt as cz,S4e as d,Ll as e,VCe as f,Ua as g,L7 as h,KCe as i,YCe as j,Ei as k,Tf as l,Fo as m,u1 as n,Yr as o,B4e as p,D as q,lm as r,Se as s,ue as t,E as u,w as v,UI as w,x4e as x,zI as y,q7 as z};