@moonshot-ai/kimi-code 0.29.2 → 0.31.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 +99855 -86513
  2. package/dist-web/assets/CodeBlockNode-Doj0S5Qm.js +28 -0
  3. package/dist-web/assets/{DesignSystemView-BnyYC1m0.js → DesignSystemView-vhCcqafK.js} +1 -1
  4. package/dist-web/assets/{Tooltip-CsrTX-eT.js → Tooltip-BoDrXlWQ.js} +1 -1
  5. package/dist-web/assets/arc-HbtY4z3B.js +1 -0
  6. package/dist-web/assets/{architectureDiagram-3BPJPVTR-bSps5znF.js → architectureDiagram-3BPJPVTR-BAmuBHqF.js} +1 -1
  7. package/dist-web/assets/{blockDiagram-GPEHLZMM-CilEmNW0.js → blockDiagram-GPEHLZMM-DB3vN4xE.js} +1 -1
  8. package/dist-web/assets/{c4Diagram-AAUBKEIU-DjQbQYqy.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-BlbqWzB_.js → chunk-2J33WTMH-BscD-1Bg.js} +1 -1
  11. package/dist-web/assets/{chunk-4BX2VUAB-Bjjry6OZ.js → chunk-4BX2VUAB-CFKKaSjy.js} +1 -1
  12. package/dist-web/assets/{chunk-55IACEB6-mUr9lxTD.js → chunk-55IACEB6-DbBsFQ-y.js} +1 -1
  13. package/dist-web/assets/{chunk-727SXJPM-hp-BfASB.js → chunk-727SXJPM-DYO-4Meq.js} +1 -1
  14. package/dist-web/assets/{chunk-AQP2D5EJ-DbRpkGly.js → chunk-AQP2D5EJ-D6jF8sjg.js} +1 -1
  15. package/dist-web/assets/{chunk-FMBD7UC4-_3v8zWlF.js → chunk-FMBD7UC4-DsHK87xk.js} +1 -1
  16. package/dist-web/assets/{chunk-ND2GUHAM-D-Pih1kA.js → chunk-ND2GUHAM-DIwTtEns.js} +1 -1
  17. package/dist-web/assets/{chunk-QZHKN3VN-Dyzf1Pwd.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-FADnp6Lk.js → cose-bilkent-S5V4N54A-Bp0vQcJ1.js} +1 -1
  21. package/dist-web/assets/{dagre-BM42HDAG-D1rsVyHJ.js → dagre-BM42HDAG-bItLk1GT.js} +1 -1
  22. package/dist-web/assets/{diagram-2AECGRRQ-BSy9xCZO.js → diagram-2AECGRRQ-BHyt2Sg_.js} +1 -1
  23. package/dist-web/assets/{diagram-5GNKFQAL-BsckzYNE.js → diagram-5GNKFQAL-BBCo61BE.js} +1 -1
  24. package/dist-web/assets/{diagram-KO2AKTUF-C4GWXOE2.js → diagram-KO2AKTUF-DoHEBKBQ.js} +1 -1
  25. package/dist-web/assets/{diagram-LMA3HP47-WWKSVuAU.js → diagram-LMA3HP47-DBz0dyT9.js} +1 -1
  26. package/dist-web/assets/{diagram-OG6HWLK6-B6TtcB01.js → diagram-OG6HWLK6-DFrLnVp0.js} +1 -1
  27. package/dist-web/assets/{erDiagram-TEJ5UH35-BiQkmfSz.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-ChzNYmSi.js → flowDiagram-I6XJVG4X-BtzrctJW.js} +1 -1
  30. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DQcybq4U.js → ganttDiagram-6RSMTGT7-Rct-HdJu.js} +1 -1
  31. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-XdaI0ZOj.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-B1S64SqR.js → infoDiagram-5YYISTIA-Bhpn0mW8.js} +1 -1
  41. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-O5IEMrWO.js → ishikawaDiagram-YF4QCWOH-DAOuLEX-.js} +1 -1
  42. package/dist-web/assets/{journeyDiagram-JHISSGLW-BhwFOFOc.js → journeyDiagram-JHISSGLW-yHUiaaDQ.js} +1 -1
  43. package/dist-web/assets/{kanban-definition-UN3LZRKU-Dh0udSeO.js → kanban-definition-UN3LZRKU-B3kDKb1C.js} +1 -1
  44. package/dist-web/assets/{linear-JZGc9yht.js → linear--OXOnpnD.js} +1 -1
  45. package/dist-web/assets/{mermaid.core-zKrc8Ye9.js → mermaid.core-DAOd3KoM.js} +5 -5
  46. package/dist-web/assets/{mindmap-definition-RKZ34NQL-B2x0JCB3.js → mindmap-definition-RKZ34NQL-ChCxAI9W.js} +1 -1
  47. package/dist-web/assets/{pieDiagram-4H26LBE5-DA34Bt67.js → pieDiagram-4H26LBE5-CrPFtitk.js} +2 -2
  48. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-DToe-wqP.js → quadrantDiagram-W4KKPZXB-C_gARk7v.js} +1 -1
  49. package/dist-web/assets/{requirementDiagram-4Y6WPE33-CgOSnyR8.js → requirementDiagram-4Y6WPE33-D_o55gu8.js} +1 -1
  50. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DBhf2qeh.js → sankeyDiagram-5OEKKPKP-wKm43hSH.js} +1 -1
  51. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-BwZabocW.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-DRsCTcc3.js → timeline-definition-PNZ67QCA-Dg7etDfW.js} +1 -1
  55. package/dist-web/assets/{vennDiagram-CIIHVFJN-B95s0NJK.js → vennDiagram-CIIHVFJN-Cb4wNSt1.js} +1 -1
  56. package/dist-web/assets/{vue.runtime.esm-bundler-DNukiHq4.js → vue.runtime.esm-bundler-DivoU6l0.js} +1 -1
  57. package/dist-web/assets/{wardley-L42UT6IY-gSV1j6uw.js → wardley-L42UT6IY-DUKkueSc.js} +1 -1
  58. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-CnvLrs5Q.js → wardleyDiagram-YWT4CUSO-CxO_ve6G.js} +1 -1
  59. package/dist-web/assets/{xychartDiagram-2RQKCTM6-zsCch4aR.js → xychartDiagram-2RQKCTM6-Da49nivv.js} +1 -1
  60. package/dist-web/index.html +2 -2
  61. package/package.json +11 -11
  62. package/dist-web/assets/CodeBlockNode-BZ3nIcUJ.js +0 -22
  63. package/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.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-DtCnpCZe.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-Bt325_7a.js +0 -1
  102. package/dist-web/assets/clarity-D53aC0YG.js +0 -1
  103. package/dist-web/assets/classDiagram-4FO5ZUOK-DpkPh8gn.js +0 -1
  104. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-DpkPh8gn.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-BsKKzRv6.js +0 -9
  194. package/dist-web/assets/index-ByWw02oy.css +0 -1
  195. package/dist-web/assets/index-COMYI0Oj.js +0 -153
  196. package/dist-web/assets/index-Cm9Q4xVi.js +0 -3
  197. package/dist-web/assets/index-DtRfJ0vw.js +0 -325
  198. package/dist-web/assets/index10-DTJJNuIm.js +0 -2
  199. package/dist-web/assets/index11-CwW_hjK7.js +0 -8
  200. package/dist-web/assets/index5-D6hAiKdZ.js +0 -1
  201. package/dist-web/assets/index6-BXVNgB_e.js +0 -1
  202. package/dist-web/assets/index7-XmRlMUpI.js +0 -1
  203. package/dist-web/assets/index8-BSZNwbg_.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-BJcdTFrX.js +0 -1
  333. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DpW8Zeth.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
@@ -1,325 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DesignSystemView-BnyYC1m0.js","assets/DesignSystemView-CuTwm3PV.css","assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/CodeBlockNode-BZ3nIcUJ.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-CdMaGbWN.js","assets/index8-BSZNwbg_.js","assets/index11-CwW_hjK7.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 Zp(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},Nc=[],ki=()=>{},f4=()=>!1,zd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Qp=e=>e.startsWith("onUpdate:"),kn=Object.assign,ay=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},vE=Object.prototype.hasOwnProperty,ln=(e,t)=>vE.call(e,t),xt=Array.isArray,Ic=e=>ou(e)==="[object Map]",Ra=e=>ou(e)==="[object Set]",Lb=e=>ou(e)==="[object Date]",yE=e=>ou(e)==="[object RegExp]",$t=e=>typeof e=="function",Cn=e=>typeof e=="string",Js=e=>typeof e=="symbol",an=e=>e!==null&&typeof e=="object",cy=e=>(an(e)||$t(e))&&$t(e.then)&&$t(e.catch),h4=Object.prototype.toString,ou=e=>h4.call(e),kE=e=>ou(e).slice(8,-1),Xp=e=>ou(e)==="[object Object]",Jp=e=>Cn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,wa=Zp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),em=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},bE=/-\w/g,No=em(e=>e.replace(bE,t=>t.slice(1).toUpperCase())),xE=/\B([A-Z])/g,Is=em(e=>e.replace(xE,"-$1").toLowerCase()),tm=em(e=>e.charAt(0).toUpperCase()+e.slice(1)),mh=em(e=>e?`on${tm(e)}`:""),qo=(e,t)=>!Object.is(e,t),Lc=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},p4=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},nm=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Dh=e=>{const t=Cn(e)?Number(e):NaN;return isNaN(t)?e:t};let $b;const om=()=>$b||($b=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),wE="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",_E=Zp(wE);function Yt(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=Cn(o)?ME(o):Yt(o);if(s)for(const i in s)t[i]=s[i]}return t}else if(Cn(e)||an(e))return e}const SE=/;(?![^(]*\))/g,CE=/:([^]+)/,AE=/\/\*[^]*?\*\//g;function ME(e){const t={};return e.replace(AE,"").split(SE).forEach(n=>{if(n){const o=n.split(CE);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(Cn(e))t=e;else if(xt(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(an(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Xxe(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Cn(t)&&(e.class=We(t)),n&&(e.style=Yt(n)),e}const EE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",TE=Zp(EE);function m4(e){return!!e||e===""}function NE(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Br(e[o],t[o]);return n}function Br(e,t){if(e===t)return!0;let n=Lb(e),o=Lb(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=Js(e),o=Js(t),n||o)return e===t;if(n=xt(e),o=xt(t),n||o)return n&&o?NE(e,t):!1;if(n=an(e),o=an(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||!Br(e[r],t[r]))return!1}}return String(e)===String(t)}function sm(e,t){return e.findIndex(n=>Br(n,t))}const g4=e=>!!(e&&e.__v_isRef===!0),O=e=>Cn(e)?e:e==null?"":xt(e)||an(e)&&(e.toString===h4||!$t(e.toString))?g4(e)?O(e.value):JSON.stringify(e,v4,2):String(e),v4=(e,t)=>g4(t)?v4(e,t.value):Ic(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,s],i)=>(n[Y1(o,i)+" =>"]=s,n),{})}:Ra(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Y1(n))}:Js(t)?Y1(t):an(t)&&!xt(t)&&!Xp(t)?String(t):t,Y1=(e,t="")=>{var n;return Js(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function IE(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 To;class y4{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&&To&&(To.active?(this.parent=To,this.index=(To.scopes||(To.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=To;try{return To=this,t()}finally{To=n}}}on(){++this._on===1&&(this.prevScope=To,To=this)}off(){if(this._on>0&&--this._on===0){if(To===this)To=this.prevScope;else{let t=To;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 LE(e){return new y4(e)}function uy(){return To}function dy(e,t=!1){To&&To.cleanups.push(e)}let Dn;const Z1=new WeakSet;class Ph{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,To&&(To.active?To.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Z1.has(this)&&(Z1.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||b4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Fb(this),x4(this);const t=Dn,n=Oi;Dn=this,Oi=!0;try{return this.fn()}finally{w4(this),Dn=t,Oi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)py(t);this.deps=this.depsTail=void 0,Fb(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Z1.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Mg(this)&&this.run()}get dirty(){return Mg(this)}}let k4=0,Zu,Qu;function b4(e,t=!1){if(e.flags|=8,t){e.next=Qu,Qu=e;return}e.next=Zu,Zu=e}function fy(){k4++}function hy(){if(--k4>0)return;if(Qu){let t=Qu;for(Qu=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Zu;){let t=Zu;for(Zu=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 x4(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function w4(e){let t,n=e.depsTail,o=n;for(;o;){const s=o.prevDep;o.version===-1?(o===n&&(n=s),py(o),$E(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=s}e.deps=t,e.depsTail=n}function Mg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_4(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _4(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===md)||(e.globalVersion=md,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Mg(e))))return;e.flags|=2;const t=e.dep,n=Dn,o=Oi;Dn=e,Oi=!0;try{x4(e);const s=e.fn(e._value);(t.version===0||qo(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Dn=n,Oi=o,w4(e),e.flags&=-3}}function py(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)py(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $E(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Jxe(e,t){e.effect instanceof Ph&&(e=e.effect.fn);const n=new Ph(e);t&&kn(n,t);try{n.run()}catch(s){throw n.stop(),s}const o=n.run.bind(n);return o.effect=n,o}function ewe(e){e.effect.stop()}let Oi=!0;const S4=[];function Dr(){S4.push(Oi),Oi=!1}function Pr(){const e=S4.pop();Oi=e===void 0?!0:e}function Fb(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dn;Dn=void 0;try{t()}finally{Dn=n}}}let md=0;class FE{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 im{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(!Dn||!Oi||Dn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dn)n=this.activeLink=new FE(Dn,this),Dn.deps?(n.prevDep=Dn.depsTail,Dn.depsTail.nextDep=n,Dn.depsTail=n):Dn.deps=Dn.depsTail=n,C4(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=Dn.depsTail,n.nextDep=void 0,Dn.depsTail.nextDep=n,Dn.depsTail=n,Dn.deps===n&&(Dn.deps=o)}return n}trigger(t){this.version++,md++,this.notify(t)}notify(t){fy();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{hy()}}}function C4(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)C4(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Hh=new WeakMap,_a=Symbol(""),Eg=Symbol(""),gd=Symbol("");function Jo(e,t,n){if(Oi&&Dn){let o=Hh.get(e);o||Hh.set(e,o=new Map);let s=o.get(n);s||(o.set(n,s=new im),s.map=o,s.key=n),s.track()}}function Tr(e,t,n,o,s,i){const r=Hh.get(e);if(!r){md++;return}const l=a=>{a&&a.trigger()};if(fy(),t==="clear")r.forEach(l);else{const a=xt(e),c=a&&Jp(n);if(a&&n==="length"){const u=Number(o);r.forEach((d,f)=>{(f==="length"||f===gd||!Js(f)&&f>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(gd)),t){case"add":a?c&&l(r.get("length")):(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"delete":a||(l(r.get(_a)),Ic(e)&&l(r.get(Eg)));break;case"set":Ic(e)&&l(r.get(_a));break}}hy()}function OE(e,t){const n=Hh.get(e);return n&&n.get(t)}function oc(e){const t=en(e);return t===e?t:(Jo(t,"iterate",gd),Ks(e)?t:t.map(Di))}function rm(e){return Jo(e=en(e),"iterate",gd),e}function er(e,t){return Hr(e)?Gc(_l(e)?Di(t):t):Di(t)}const RE={__proto__:null,[Symbol.iterator](){return Q1(this,Symbol.iterator,e=>er(this,e))},concat(...e){return oc(this).concat(...e.map(t=>xt(t)?oc(t):t))},entries(){return Q1(this,"entries",e=>(e[1]=er(this,e[1]),e))},every(e,t){return gr(this,"every",e,t,void 0,arguments)},filter(e,t){return gr(this,"filter",e,t,n=>n.map(o=>er(this,o)),arguments)},find(e,t){return gr(this,"find",e,t,n=>er(this,n),arguments)},findIndex(e,t){return gr(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gr(this,"findLast",e,t,n=>er(this,n),arguments)},findLastIndex(e,t){return gr(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gr(this,"forEach",e,t,void 0,arguments)},includes(...e){return X1(this,"includes",e)},indexOf(...e){return X1(this,"indexOf",e)},join(e){return oc(this).join(e)},lastIndexOf(...e){return X1(this,"lastIndexOf",e)},map(e,t){return gr(this,"map",e,t,void 0,arguments)},pop(){return Tu(this,"pop")},push(...e){return Tu(this,"push",e)},reduce(e,...t){return Ob(this,"reduce",e,t)},reduceRight(e,...t){return Ob(this,"reduceRight",e,t)},shift(){return Tu(this,"shift")},some(e,t){return gr(this,"some",e,t,void 0,arguments)},splice(...e){return Tu(this,"splice",e)},toReversed(){return oc(this).toReversed()},toSorted(e){return oc(this).toSorted(e)},toSpliced(...e){return oc(this).toSpliced(...e)},unshift(...e){return Tu(this,"unshift",e)},values(){return Q1(this,"values",e=>er(this,e))}};function Q1(e,t,n){const o=rm(e),s=o[t]();return o!==e&&!Ks(e)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const BE=Array.prototype;function gr(e,t,n,o,s,i){const r=rm(e),l=r!==e&&!Ks(e),a=r[t];if(a!==BE[t]){const d=a.apply(e,i);return l?Di(d):d}let c=n;r!==e&&(l?c=function(d,f){return n.call(this,er(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 Ob(e,t,n,o){const s=rm(e),i=s!==e&&!Ks(e);let r=n,l=!1;s!==e&&(i?(l=o.length===0,r=function(c,u,d){return l&&(l=!1,c=er(e,c)),n.call(this,c,er(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?er(e,a):a}function X1(e,t,n){const o=en(e);Jo(o,"iterate",gd);const s=o[t](...n);return(s===-1||s===!1)&&cm(n[0])?(n[0]=en(n[0]),o[t](...n)):s}function Tu(e,t,n=[]){Dr(),fy();const o=en(e)[t].apply(e,n);return hy(),Pr(),o}const DE=Zp("__proto__,__v_isRef,__isVue"),A4=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Js));function PE(e){Js(e)||(e=String(e));const t=en(this);return Jo(t,"has",e),t.hasOwnProperty(e)}class M4{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?$4:L4:i?I4:N4).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=xt(t);if(!s){let a;if(r&&(a=RE[n]))return a;if(n==="hasOwnProperty")return PE}const l=Reflect.get(t,n,ho(t)?t:o);if((Js(n)?A4.has(n):DE(n))||(s||Jo(t,"get",n),i))return l;if(ho(l)){const a=r&&Jp(n)?l:l.value;return s&&an(a)?Wh(a):a}return an(l)?s?Wh(l):Bo(l):l}}class E4 extends M4{constructor(t=!1){super(!1,t)}set(t,n,o,s){let i=t[n];const r=xt(t)&&Jp(n);if(!this._isShallow){const c=Hr(i);if(!Ks(o)&&!Hr(o)&&(i=en(i),o=en(o)),!r&&ho(i)&&!ho(o))return c||(i.value=o),!0}const l=r?Number(n)<t.length:ln(t,n),a=Reflect.set(t,n,o,ho(t)?t:s);return t===en(s)&&(l?qo(o,i)&&Tr(t,"set",n,o):Tr(t,"add",n,o)),a}deleteProperty(t,n){const o=ln(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&o&&Tr(t,"delete",n,void 0),s}has(t,n){const o=Reflect.has(t,n);return(!Js(n)||!A4.has(n))&&Jo(t,"has",n),o}ownKeys(t){return Jo(t,"iterate",xt(t)?"length":_a),Reflect.ownKeys(t)}}class T4 extends M4{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const HE=new E4,WE=new T4,zE=new E4(!0),UE=new T4(!0),Tg=e=>e,Tf=e=>Reflect.getPrototypeOf(e);function qE(e,t,n){return function(...o){const s=this.__v_raw,i=en(s),r=Ic(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=s[e](...o),u=n?Tg:t?Gc:Di;return!t&&Jo(i,"iterate",a?Eg:_a),kn(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 Nf(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jE(e,t){const n={get(s){const i=this.__v_raw,r=en(i),l=en(s);e||(qo(s,l)&&Jo(r,"get",s),Jo(r,"get",l));const{has:a}=Tf(r),c=t?Tg:e?Gc:Di;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&&Jo(en(s),"iterate",_a),s.size},has(s){const i=this.__v_raw,r=en(i),l=en(s);return e||(qo(s,l)&&Jo(r,"has",s),Jo(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=en(l),c=t?Tg:e?Gc:Di;return!e&&Jo(a,"iterate",_a),l.forEach((u,d)=>s.call(i,c(u),c(d),r))}};return kn(n,e?{add:Nf("add"),set:Nf("set"),delete:Nf("delete"),clear:Nf("clear")}:{add(s){const i=en(this),r=Tf(i),l=en(s),a=!t&&!Ks(s)&&!Hr(s)?l:s;return r.has.call(i,a)||qo(s,a)&&r.has.call(i,s)||qo(l,a)&&r.has.call(i,l)||(i.add(a),Tr(i,"add",a,a)),this},set(s,i){!t&&!Ks(i)&&!Hr(i)&&(i=en(i));const r=en(this),{has:l,get:a}=Tf(r);let c=l.call(r,s);c||(s=en(s),c=l.call(r,s));const u=a.call(r,s);return r.set(s,i),c?qo(i,u)&&Tr(r,"set",s,i):Tr(r,"add",s,i),this},delete(s){const i=en(this),{has:r,get:l}=Tf(i);let a=r.call(i,s);a||(s=en(s),a=r.call(i,s)),l&&l.call(i,s);const c=i.delete(s);return a&&Tr(i,"delete",s,void 0),c},clear(){const s=en(this),i=s.size!==0,r=s.clear();return i&&Tr(s,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=qE(s,e,t)}),n}function lm(e,t){const n=jE(e,t);return(o,s,i)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(ln(n,s)&&s in o?n:o,s,i)}const VE={get:lm(!1,!1)},KE={get:lm(!1,!0)},GE={get:lm(!0,!1)},YE={get:lm(!0,!0)},N4=new WeakMap,I4=new WeakMap,L4=new WeakMap,$4=new WeakMap;function ZE(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Bo(e){return Hr(e)?e:am(e,!1,HE,VE,N4)}function QE(e){return am(e,!1,zE,KE,I4)}function Wh(e){return am(e,!0,WE,GE,L4)}function twe(e){return am(e,!0,UE,YE,$4)}function am(e,t,n,o,s){if(!an(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=ZE(kE(e));if(r===0)return e;const l=new Proxy(e,r===2?o:n);return s.set(e,l),l}function _l(e){return Hr(e)?_l(e.__v_raw):!!(e&&e.__v_isReactive)}function Hr(e){return!!(e&&e.__v_isReadonly)}function Ks(e){return!!(e&&e.__v_isShallow)}function cm(e){return e?!!e.__v_raw:!1}function en(e){const t=e&&e.__v_raw;return t?en(t):e}function pt(e){return!ln(e,"__v_skip")&&Object.isExtensible(e)&&p4(e,"__v_skip",!0),e}const Di=e=>an(e)?Bo(e):e,Gc=e=>an(e)?Wh(e):e;function ho(e){return e?e.__v_isRef===!0:!1}function X(e){return F4(e,!1)}function Ba(e){return F4(e,!0)}function F4(e,t){return ho(e)?e:new XE(e,t)}class XE{constructor(t,n){this.dep=new im,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:en(t),this._value=n?t:Di(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||Ks(t)||Hr(t);t=o?t:en(t),qo(t,n)&&(this._rawValue=t,this._value=o?t:Di(t),this.dep.trigger())}}function nwe(e){e.dep&&e.dep.trigger()}function C(e){return ho(e)?e.value:e}function O4(e){return $t(e)?e():C(e)}const JE={get:(e,t,n)=>t==="__v_raw"?e:C(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const s=e[t];return ho(s)&&!ho(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}};function R4(e){return _l(e)?e:new Proxy(e,JE)}class eT{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new im,{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 tT(e){return new eT(e)}function owe(e){const t=xt(e)?new Array(e.length):{};for(const n in e)t[n]=B4(e,n);return t}class nT{constructor(t,n,o){this._object=t,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._key=Js(n)?n:String(n),this._raw=en(t);let s=!0,i=t;if(!xt(t)||Js(this._key)||!Jp(this._key))do s=!cm(i)||Ks(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&&ho(this._raw[this._key])){const n=this._object[this._key];if(ho(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return OE(this._raw,this._key)}}class oT{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 swe(e,t,n){return ho(e)?e:$t(e)?new oT(e):an(e)&&arguments.length>1?B4(e,t,n):X(e)}function B4(e,t,n){return new nT(e,t,n)}class sT{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new im(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=md-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Dn!==this)return b4(this,!0),!0}get value(){const t=this.dep.track();return _4(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function iT(e,t,n=!1){let o,s;return $t(e)?o=e:(o=e.get,s=e.set),new sT(o,s,n)}const iwe={GET:"get",HAS:"has",ITERATE:"iterate"},rwe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},If={},zh=new WeakMap;let hl;function lwe(){return hl}function rT(e,t=!1,n=hl){if(n){let o=zh.get(n);o||zh.set(n,o=[]),o.push(e)}}function lT(e,t,n=Qt){const{immediate:o,deep:s,once:i,scheduler:r,augmentJob:l,call:a}=n,c=k=>s?k:Ks(k)||s===!1||s===0?Nr(k,1):Nr(k);let u,d,f,h,p=!1,g=!1;if(ho(e)?(d=()=>e.value,p=Ks(e)):_l(e)?(d=()=>c(e),p=!0):xt(e)?(g=!0,p=e.some(k=>_l(k)||Ks(k)),d=()=>e.map(k=>{if(ho(k))return k.value;if(_l(k))return c(k);if($t(k))return a?a(k,2):k()})):$t(e)?t?d=a?()=>a(e,2):e:d=()=>{if(f){Dr();try{f()}finally{Pr()}}const k=hl;hl=u;try{return a?a(e,3,[h]):e(h)}finally{hl=k}}:d=ki,t&&s){const k=d,A=s===!0?1/0:s;d=()=>Nr(k(),A)}const b=uy(),v=()=>{u.stop(),b&&b.active&&ay(b.effects,u)};if(i&&t){const k=t;t=(...A)=>{k(...A),v()}}let m=g?new Array(e.length).fill(If):If;const y=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const A=u.run();if(s||p||(g?A.some(($,N)=>qo($,m[N])):qo(A,m))){f&&f();const $=hl;hl=u;try{const N=[A,m===If?void 0:g&&m[0]===If?[]:m,h];m=A,a?a(t,3,N):t(...N)}finally{hl=$}}}else u.run()};return l&&l(y),u=new Ph(d),u.scheduler=r?()=>r(y,!1):y,h=k=>rT(k,!1,u),f=u.onStop=()=>{const k=zh.get(u);if(k){if(a)a(k,4);else for(const A of k)A();zh.delete(u)}},t?o?y(!0):m=u.run():r?r(y.bind(null,!0),!0):u.run(),v.pause=u.pause.bind(u),v.resume=u.resume.bind(u),v.stop=v,v}function Nr(e,t=1/0,n){if(t<=0||!an(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ho(e))Nr(e.value,t,n);else if(xt(e))for(let o=0;o<e.length;o++)Nr(e[o],t,n);else if(Ra(e)||Ic(e))e.forEach(o=>{Nr(o,t,n)});else if(Xp(e)){for(const o in e)Nr(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Nr(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 D4=[];function aT(e){D4.push(e)}function cT(){D4.pop()}function awe(e,t){}const cwe={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"},uT={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 Ud(e,t,n,o){try{return o?e(...o):e()}catch(s){su(s,t,n)}}function wi(e,t,n,o){if($t(e)){const s=Ud(e,t,n,o);return s&&cy(s)&&s.catch(i=>{su(i,t,n)}),s}if(xt(e)){const s=[];for(let i=0;i<e.length;i++)s.push(wi(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||Qt;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){Dr(),Ud(i,null,10,[e,a,c]),Pr();return}}dT(e,n,s,o,r)}function dT(e,t,n,o=!0,s=!1){if(s)throw e;console.error(e)}const ps=[];let Qi=-1;const $c=[];let pl=null,pc=0;const P4=Promise.resolve();let Uh=null;function mt(e){const t=Uh||P4;return e?t.then(this?e.bind(this):e):t}function fT(e){let t=Qi+1,n=ps.length;for(;t<n;){const o=t+n>>>1,s=ps[o],i=vd(s);i<e||i===e&&s.flags&2?t=o+1:n=o}return t}function my(e){if(!(e.flags&1)){const t=vd(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=vd(n)?ps.push(e):ps.splice(fT(t),0,e),e.flags|=1,H4()}}function H4(){Uh||(Uh=P4.then(W4))}function qh(e){xt(e)?$c.push(...e):pl&&e.id===-1?pl.splice(pc+1,0,e):e.flags&1||($c.push(e),e.flags|=1),H4()}function Rb(e,t,n=Qi+1){for(;n<ps.length;n++){const o=ps[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;ps.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function jh(e){if($c.length){const t=[...new Set($c)].sort((n,o)=>vd(n)-vd(o));if($c.length=0,pl){pl.push(...t);return}for(pl=t,pc=0;pc<pl.length;pc++){const n=pl[pc];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}pl=null,pc=0}}const vd=e=>e.id==null?e.flags&2?-1:1/0:e.id;function W4(e){try{for(Qi=0;Qi<ps.length;Qi++){const t=ps[Qi];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ud(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qi<ps.length;Qi++){const t=ps[Qi];t&&(t.flags&=-2)}Qi=-1,ps.length=0,jh(),Uh=null,(ps.length||$c.length)&&W4()}}let mc,Lf=[];function z4(e,t){var n,o;mc=e,mc?(mc.enabled=!0,Lf.forEach(({event:s,args:i})=>mc.emit(s,...i)),Lf=[]):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=>{z4(i,t)}),setTimeout(()=>{mc||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Lf=[])},3e3)):Lf=[]}let Ko=null,um=null;function yd(e){const t=Ko;return Ko=e,um=e&&e.type.__scopeId||null,t}function uwe(e){um=e}function dwe(){um=null}const fwe=e=>Ee;function Ee(e,t=Ko,n){if(!t||e._n)return e;const o=(...s)=>{o._d&&Zh(-1);const i=yd(t);let r;try{r=e(...s)}finally{yd(i),o._d&&Zh(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function Fn(e,t){if(Ko===null)return e;const n=Kd(Ko),o=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[i,r,l,a=Qt]=t[s];i&&($t(i)&&(i={mounted:i,updated:i}),i.deep&&Nr(r),o.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Xi(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&&(Dr(),wi(a,n,8,[e.el,l,e,t]),Pr())}}function Ln(e,t){if(Vo){let n=Vo.provides;const o=Vo.parent&&Vo.parent.provides;o===n&&(n=Vo.provides=Object.create(o)),n[e]=t}}function Kt(e,t,n=!1){const o=Yo();if(o||Sa){let s=Sa?Sa._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&&$t(t)?t.call(o&&o.proxy):t}}function hwe(){return!!(Yo()||Sa)}const hT=Symbol.for("v-scx"),pT=()=>Kt(hT);function mT(e,t){return qd(e,null,t)}function pwe(e,t){return qd(e,null,{flush:"post"})}function gT(e,t){return qd(e,null,{flush:"sync"})}function Qe(e,t,n){return qd(e,t,n)}function qd(e,t,n=Qt){const{immediate:o,deep:s,flush:i,once:r}=n,l=kn({},n),a=t&&o||!t&&i!=="post";let c;if(Ta){if(i==="sync"){const h=pT();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!a){const h=()=>{};return h.stop=ki,h.resume=ki,h.pause=ki,h}}const u=Vo;l.call=(h,p,g)=>wi(h,u,p,g);let d=!1;i==="post"?l.scheduler=h=>{vo(h,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(h,p)=>{p?h():my(h)}),l.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=lT(e,t,l);return Ta&&(c?c.push(f):a&&f()),f}function vT(e,t,n){const o=this.proxy,s=Cn(e)?e.includes(".")?U4(o,e):()=>o[e]:e.bind(o,o);let i;$t(t)?i=t:(i=t.handler,n=t);const r=iu(this),l=qd(s,i.bind(o),n);return r(),l}function U4(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 ul=new WeakMap,q4=Symbol("_vte"),j4=e=>e.__isTeleport,fa=e=>e&&(e.disabled||e.disabled===""),yT=e=>e&&(e.defer||e.defer===""),Bb=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Db=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ng=(e,t)=>{const n=e&&e.to;return Cn(n)?t?t(n):null:n},kT={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:g,createComment:b,parentNode:v}}=c,m=fa(t.props);let{dynamicChildren:y}=t;const k=(N,x,I)=>{N.shapeFlag&16&&u(N.children,x,I,s,i,r,l,a)},A=(N=t)=>{const x=fa(N.props),I=N.target=Ng(N.props,p),E=Ig(I,N,g,h);I&&(r!=="svg"&&Bb(I)?r="svg":r!=="mathml"&&Db(I)&&(r="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(I),x||(k(N,I,E),Hu(N,!1)))},$=N=>{const x=()=>{if(ul.get(N)===x){if(ul.delete(N),fa(N.props)){const I=v(N.el)||n;k(N,I,N.anchor),Hu(N,!0)}A(N)}};ul.set(N,x),vo(x,i)};if(e==null){const N=t.el=g(""),x=t.anchor=g("");if(h(N,n,o),h(x,n,o),yT(t.props)||i&&i.pendingBranch){$(t);return}m&&(k(t,n,x),Hu(t,!0)),A()}else{t.el=e.el;const N=t.anchor=e.anchor,x=ul.get(e);if(x){x.flags|=8,ul.delete(e),$(t);return}t.targetStart=e.targetStart;const I=t.target=e.target,E=t.targetAnchor=e.targetAnchor,F=fa(e.props),S=F?n:I,L=F?N:E;if(r==="svg"||Bb(I)?r="svg":(r==="mathml"||Db(I))&&(r="mathml"),y?(f(e.dynamicChildren,y,S,s,i,r,l),Cy(e,t,!0)):a||d(e,t,S,L,s,i,r,l,!1),m)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):$f(t,n,N,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const R=t.target=Ng(t.props,p);R&&$f(t,R,null,c,0)}else F&&$f(t,I,E,c,1);Hu(t,m)}},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||!fa(f),p=ul.get(e);if(p&&(p.flags|=8,ul.delete(e)),d&&(s(c),s(u)),i&&s(a),!p&&r&16)for(let g=0;g<l.length;g++){const b=l[g];o(b,t,n,h,!!b.dynamicChildren)}},move:$f,hydrate:bT};function $f(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),!ul.has(e)&&(!d||fa(u))&&a&16)for(let f=0;f<c.length;f++)s(c[f],t,n,2);d&&o(l,t,n)}function bT(e,t,n,o,s,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function f(b,v){let m=v;for(;m;){if(m&&m.nodeType===8){if(m.data==="teleport start anchor")t.targetStart=m;else if(m.data==="teleport anchor"){t.targetAnchor=m,b._lpa=t.targetAnchor&&r(t.targetAnchor);break}}m=r(m)}}function h(b,v){v.anchor=d(r(b),v,l(b),n,o,s,i)}const p=t.target=Ng(t.props,a),g=fa(t.props);if(p){const b=p._lpa||p.firstChild;t.shapeFlag&16&&(g?(h(e,t),f(p,b),t.targetAnchor||Ig(p,t,u,c,l(e)===p?e:null)):(t.anchor=r(e),f(p,b),t.targetAnchor||Ig(p,t,u,c),d(b&&r(b),t,p,n,o,s,i))),Hu(t,g)}else g&&t.shapeFlag&16&&(h(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const dm=kT;function Hu(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 Ig(e,t,n,o,s=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[q4]=r,e&&(o(i,e,s),o(r,e,s)),r}const fi=Symbol("_leaveCb"),Nu=Symbol("_enterCb");function V4(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cn(()=>{e.isMounted=!0}),po(()=>{e.isUnmounting=!0}),e}const ri=[Function,Array],K4={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ri,onEnter:ri,onAfterEnter:ri,onEnterCancelled:ri,onBeforeLeave:ri,onLeave:ri,onAfterLeave:ri,onLeaveCancelled:ri,onBeforeAppear:ri,onAppear:ri,onAfterAppear:ri,onAppearCancelled:ri},G4=e=>{const t=e.subTree;return t.component?G4(t.component):t},xT={name:"BaseTransition",props:K4,setup(e,{slots:t}){const n=Yo(),o=V4();return()=>{const s=t.default&&gy(t.default(),!0),i=s&&s.length?Y4(s):n.subTree?ae():void 0;if(!i)return;const r=en(e),{mode:l}=r;if(o.isLeaving)return J1(i);const a=Pb(i);if(!a)return J1(i);let c=kd(a,r,o,n,d=>c=d);a.type!==bo&&Tl(a,c);let u=n.subTree&&Pb(n.subTree);if(u&&u.type!==bo&&!Ii(u,a)&&G4(n).type!==bo){let d=kd(u,r,o,n);if(Tl(u,d),l==="out-in"&&a.type!==bo)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},J1(i);l==="in-out"&&a.type!==bo?d.delayLeave=(f,h,p)=>{const g=Z4(o,u);g[String(u.key)]=u,f[fi]=()=>{h(),f[fi]=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 Y4(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==bo){t=n;break}}return t}const wT=xT;function Z4(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 kd(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:g,onBeforeAppear:b,onAppear:v,onAfterAppear:m,onAppearCancelled:y}=t,k=String(e.key),A=Z4(n,e),$=(I,E)=>{I&&wi(I,o,9,E)},N=(I,E)=>{const F=E[1];$(I,E),xt(I)?I.every(S=>S.length<=1)&&F():I.length<=1&&F()},x={mode:r,persisted:l,beforeEnter(I){let E=a;if(!n.isMounted)if(i)E=b||a;else return;I[fi]&&I[fi](!0);const F=A[k];F&&Ii(e,F)&&F.el[fi]&&F.el[fi](),$(E,[I])},enter(I){if(A[k]===e)return;let E=c,F=u,S=d;if(!n.isMounted)if(i)E=v||c,F=m||u,S=y||d;else return;let L=!1;I[Nu]=D=>{L||(L=!0,D?$(S,[I]):$(F,[I]),x.delayedLeave&&x.delayedLeave(),I[Nu]=void 0)};const R=I[Nu].bind(null,!1);E?N(E,[I,R]):R()},leave(I,E){const F=String(e.key);if(I[Nu]&&I[Nu](!0),n.isUnmounting)return E();$(f,[I]);let S=!1;I[fi]=R=>{S||(S=!0,E(),R?$(g,[I]):$(p,[I]),I[fi]=void 0,A[F]===e&&delete A[F])};const L=I[fi].bind(null,!1);A[F]=e,h?N(h,[I,L]):L()},clone(I){const E=kd(I,t,n,o,s);return s&&s(E),E}};return x}function J1(e){if(jd(e))return e=Wr(e),e.children=null,e}function Pb(e){if(!jd(e))return j4(e.type)&&e.children?Y4(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&&$t(n.default))return n.default()}}function Tl(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Tl(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 gy(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===Pe?(r.patchFlag&128&&s++,o=o.concat(gy(r.children,t,l))):(t||r.type!==bo)&&o.push(l!=null?Wr(r,{key:l}):r)}if(s>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function Ze(e,t){return $t(e)?kn({name:e.name},t,{setup:e}):e}function mwe(){const e=Yo();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function vy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function gwe(e){const t=Yo(),n=Ba(null);if(t){const s=t.refs===Qt?t.refs={}:t.refs;Object.defineProperty(s,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function Hb(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vh=new WeakMap;function Fc(e,t,n,o,s=!1){if(xt(e)){e.forEach((g,b)=>Fc(g,t&&(xt(t)?t[b]:t),n,o,s));return}if(Or(o)&&!s){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Fc(e,t,n,o.component.subTree);return}const i=o.shapeFlag&4?Kd(o.component):o.el,r=s?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Qt?l.refs={}:l.refs,d=l.setupState,f=en(d),h=d===Qt?f4:g=>Hb(u,g)?!1:ln(f,g),p=(g,b)=>!(b&&Hb(u,b));if(c!=null&&c!==a){if(Wb(t),Cn(c))u[c]=null,h(c)&&(d[c]=null);else if(ho(c)){const g=t;p(c,g.k)&&(c.value=null),g.k&&(u[g.k]=null)}}if($t(a))Ud(a,l,12,[r,u]);else{const g=Cn(a),b=ho(a);if(g||b){const v=()=>{if(e.f){const m=g?h(a)?d[a]:u[a]:p()||!e.k?a.value:u[e.k];if(s)xt(m)&&ay(m,i);else if(xt(m))m.includes(i)||m.push(i);else if(g)u[a]=[i],h(a)&&(d[a]=u[a]);else{const y=[i];p(a,e.k)&&(a.value=y),e.k&&(u[e.k]=y)}}else g?(u[a]=r,h(a)&&(d[a]=r)):b&&(p(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const m=()=>{v(),Vh.delete(e)};m.id=-1,Vh.set(e,m),vo(m,n)}else Wb(e),v()}}}function Wb(e){const t=Vh.get(e);t&&(t.flags|=8,Vh.delete(e))}let zb=!1;const sc=()=>{zb||(console.error("Hydration completed but contains mismatches."),zb=!0)},_T=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",ST=e=>e.namespaceURI.includes("MathML"),Ff=e=>{if(e.nodeType===1){if(_T(e))return"svg";if(ST(e))return"mathml"}},wc=e=>e.nodeType===8;function CT(e){const{mt:t,p:n,o:{patchProp:o,createText:s,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(y,k)=>{if(!k.hasChildNodes()){n(null,y,k),jh(),k._vnode=y;return}d(k.firstChild,y,null,null,null),jh(),k._vnode=y},d=(y,k,A,$,N,x=!1)=>{x=x||!!k.dynamicChildren;const I=wc(y)&&y.data==="[",E=()=>g(y,k,A,$,N,I),{type:F,ref:S,shapeFlag:L,patchFlag:R}=k;let D=y.nodeType;k.el=y,R===-2&&(x=!1,k.dynamicChildren=null);let z=null;switch(F){case Sl:D!==3?k.children===""?(a(k.el=s(""),r(y),y),z=y):z=E():(y.data!==k.children&&(sc(),y.data=k.children),z=i(y));break;case bo:m(y)?(z=i(y),v(k.el=y.content.firstChild,y,A)):D!==8||I?z=E():z=i(y);break;case Rc:if(I&&(y=i(y),D=y.nodeType),D===1||D===3){z=y;const H=!k.children.length;for(let U=0;U<k.staticCount;U++)H&&(k.children+=z.nodeType===1?z.outerHTML:z.data),U===k.staticCount-1&&(k.anchor=z),z=i(z);return I?i(z):z}else E();break;case Pe:I?z=p(y,k,A,$,N,x):z=E();break;default:if(L&1)(D!==1||k.type.toLowerCase()!==y.tagName.toLowerCase())&&!m(y)?z=E():z=f(y,k,A,$,N,x);else if(L&6){k.slotScopeIds=N;const H=r(y);if(I?z=b(y):wc(y)&&y.data==="teleport start"?z=b(y,y.data,"teleport end"):z=i(y),t(k,H,null,A,$,Ff(H),x),Or(k)&&!k.type.__asyncResolved){let U;I?(U=re(Pe),U.anchor=z?z.previousSibling:H.lastChild):U=y.nodeType===3?Je(""):re("div"),U.el=y,k.component.subTree=U}}else L&64?D!==8?z=E():z=k.type.hydrate(y,k,A,$,N,x,e,h):L&128&&(z=k.type.hydrate(y,k,A,$,Ff(r(y)),N,x,e,d))}return S!=null&&Fc(S,null,$,k),z},f=(y,k,A,$,N,x)=>{x=x||!!k.dynamicChildren;const{type:I,props:E,patchFlag:F,shapeFlag:S,dirs:L,transition:R}=k,D=I==="input"||I==="option";if(D||F!==-1){L&&Xi(k,null,A,"created");let z=!1;if(m(y)){z=g3(null,R)&&A&&A.vnode.props&&A.vnode.props.appear;const U=y.content.firstChild;if(z){const Z=U.getAttribute("class");Z&&(U.$cls=Z),R.beforeEnter(U)}v(U,y,A),k.el=y=U}if(S&16&&!(E&&(E.innerHTML||E.textContent))){let U=h(y.firstChild,k,y,A,$,N,x);for(U&&!Of(y,1)&&sc();U;){const Z=U;U=U.nextSibling,l(Z)}}else if(S&8){let U=k.children;U[0]===`
15
- `&&(y.tagName==="PRE"||y.tagName==="TEXTAREA")&&(U=U.slice(1));const{textContent:Z}=y;Z!==U&&Z!==U.replace(/\r\n|\r/g,`
16
- `)&&(Of(y,0)||sc(),y.textContent=k.children)}if(E){if(D||!x||F&48){const U=y.tagName.includes("-");for(const Z in E)(D&&(Z.endsWith("value")||Z==="indeterminate")||zd(Z)&&!wa(Z)||Z[0]==="."||U&&!wa(Z))&&o(y,Z,null,E[Z],void 0,A)}else if(E.onClick)o(y,"onClick",null,E.onClick,void 0,A);else if(F&4&&_l(E.style))for(const U in E.style)E.style[U]}let H;(H=E&&E.onVnodeBeforeMount)&&Es(H,A,k),L&&Xi(k,null,A,"beforeMount"),((H=E&&E.onVnodeMounted)||L||z)&&b3(()=>{H&&Es(H,A,k),z&&R.enter(y),L&&Xi(k,null,A,"mounted")},$)}return y.nextSibling},h=(y,k,A,$,N,x,I)=>{I=I||!!k.dynamicChildren;const E=k.children,F=E.length;let S=!1;for(let L=0;L<F;L++){const R=I?E[L]:E[L]=Ns(E[L]),D=R.type===Sl;y?(D&&!I&&L+1<F&&Ns(E[L+1]).type===Sl&&(a(s(y.data.slice(R.children.length)),A,i(y)),y.data=R.children),y=d(y,R,$,N,x,I)):D&&!R.children?a(R.el=s(""),A):(S||(S=!0,Of(A,1)||sc()),n(null,R,A,null,$,N,Ff(A),x))}return y},p=(y,k,A,$,N,x)=>{const{slotScopeIds:I}=k;I&&(N=N?N.concat(I):I);const E=r(y),F=h(i(y),k,E,A,$,N,x);return F&&wc(F)&&F.data==="]"?i(k.anchor=F):(sc(),a(k.anchor=c("]"),E,F),F)},g=(y,k,A,$,N,x)=>{if(Of(y.parentElement,1)||sc(),k.el=null,x){const F=b(y);for(;;){const S=i(y);if(S&&S!==F)l(S);else break}}const I=i(y),E=r(y);return l(y),n(null,k,E,I,A,$,Ff(E),N),A&&(A.vnode.el=k.el,pm(A,k.el)),I},b=(y,k="[",A="]")=>{let $=0;for(;y;)if(y=i(y),y&&wc(y)&&(y.data===k&&$++,y.data===A)){if($===0)return i(y);$--}return y},v=(y,k,A)=>{const $=k.parentNode;$&&$.replaceChild(y,k);let N=A;for(;N;)N.vnode.el===k&&(N.vnode.el=N.subTree.el=y),N=N.parent},m=y=>y.nodeType===1&&y.tagName==="TEMPLATE";return[u,d]}const Ub="data-allow-mismatch",AT={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Of(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Ub);)e=e.parentElement;const n=e&&e.getAttribute(Ub);if(n==null)return!1;if(n==="")return!0;{const o=n.split(",");return t===0&&o.includes("children")?!0:o.includes(AT[t])}}const MT=om().requestIdleCallback||(e=>setTimeout(e,1)),ET=om().cancelIdleCallback||(e=>clearTimeout(e)),vwe=(e=1e4)=>t=>{const n=MT(t,{timeout:e});return()=>ET(n)};function TT(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 ywe=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(TT(s))return t(),o.disconnect(),!1;o.observe(s)}}),()=>o.disconnect()},kwe=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},bwe=(e=[])=>(t,n)=>{Cn(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 NT(e,t){if(wc(e)&&e.data==="["){let n=1,o=e.nextSibling;for(;o;){if(o.nodeType===1){if(t(o)===!1)break}else if(wc(o))if(o.data==="]"){if(--n===0)break}else o.data==="["&&n++;o=o.nextSibling}}else t(e)}const Or=e=>!!e.type.__asyncLoader;function Li(e){$t(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(g=>{if(g=g instanceof Error?g:new Error(String(g)),a)return new Promise((b,v)=>{a(g,()=>b(f()),()=>v(g),d+1)});throw g}).then(g=>p!==c&&c?c:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),u=g,g)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(p,g,b){let v=!1;(g.bu||(g.bu=[])).push(()=>v=!0);const m=()=>{v||b()},y=i?()=>{const k=i(m,A=>NT(p,A));k&&(g.bum||(g.bum=[])).push(k)}:m;u?y():h().then(()=>!g.isUnmounted&&y())},get __asyncResolved(){return u},setup(){const p=Vo;if(vy(p),u)return()=>Rf(u,p);const g=y=>{c=null,su(y,p,13,!o)};if(l&&p.suspense||Ta)return h().then(y=>()=>Rf(y,p)).catch(y=>(g(y),()=>o?re(o,{error:y}):null));const b=X(!1),v=X(),m=X(!!s);return s&&setTimeout(()=>{m.value=!1},s),r!=null&&setTimeout(()=>{if(!b.value&&!v.value){const y=new Error(`Async component timed out after ${r}ms.`);g(y),v.value=y}},r),h().then(()=>{b.value=!0,p.parent&&jd(p.parent.vnode)&&p.parent.update()}).catch(y=>{g(y),v.value=y}),()=>{if(b.value&&u)return Rf(u,p);if(v.value&&o)return re(o,{error:v.value});if(n&&!m.value)return Rf(n,p)}}})}function Rf(e,t){const{ref:n,props:o,children:s,ce:i}=t.vnode,r=re(e,o,s);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const jd=e=>e.type.__isKeepAlive,IT={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Yo(),o=n.ctx;if(!o.renderer)return()=>{const m=t.default&&t.default();return m&&m.length===1?m[0]:m};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=(m,y,k,A,$)=>{const N=m.component;c(m,y,k,0,l),a(N.vnode,m,y,k,N,l,A,m.slotScopeIds,$),vo(()=>{N.isDeactivated=!1,N.a&&Lc(N.a);const x=m.props&&m.props.onVnodeMounted;x&&Es(x,N.parent,m)},l)},o.deactivate=m=>{const y=m.component;Gh(y.m),Gh(y.a),c(m,f,null,1,l),vo(()=>{y.da&&Lc(y.da);const k=m.props&&m.props.onVnodeUnmounted;k&&Es(k,y.parent,m),y.isDeactivated=!0},l)};function h(m){e0(m),u(m,n,l,!0)}function p(m){s.forEach((y,k)=>{const A=Hg(Or(y)?y.type.__asyncResolved||{}:y.type);A&&!m(A)&&g(k)})}function g(m){const y=s.get(m);y&&(!r||!Ii(y,r))?h(y):r&&e0(r),s.delete(m),i.delete(m)}Qe(()=>[e.include,e.exclude],([m,y])=>{m&&p(k=>Wu(m,k)),y&&p(k=>!Wu(y,k))},{flush:"post",deep:!0});let b=null;const v=()=>{b!=null&&(Yh(n.subTree.type)?vo(()=>{s.set(b,Bf(n.subTree))},n.subTree.suspense):s.set(b,Bf(n.subTree)))};return cn(v),yy(v),po(()=>{s.forEach(m=>{const{subTree:y,suspense:k}=n,A=Bf(y);if(m.type===A.type&&m.key===A.key){e0(A);const $=A.component.da;$&&vo($,k);return}h(m)})}),()=>{if(b=null,!t.default)return r=null;const m=t.default(),y=m[0];if(m.length>1)return r=null,m;if(!Nl(y)||!(y.shapeFlag&4)&&!(y.shapeFlag&128))return r=null,y;let k=Bf(y);if(k.type===bo)return r=null,k;const A=k.type,$=Hg(Or(k)?k.type.__asyncResolved||{}:A),{include:N,exclude:x,max:I}=e;if(N&&(!$||!Wu(N,$))||x&&$&&Wu(x,$))return k.shapeFlag&=-257,r=k,y;const E=k.key==null?A:k.key,F=s.get(E);return k.el&&(k=Wr(k),y.shapeFlag&128&&(y.ssContent=k)),b=E,F?(k.el=F.el,k.component=F.component,k.transition&&Tl(k,k.transition),k.shapeFlag|=512,i.delete(E),i.add(E)):(i.add(E),I&&i.size>parseInt(I,10)&&g(i.values().next().value)),k.shapeFlag|=256,r=k,Yh(y.type)?y:k}}},xwe=IT;function Wu(e,t){return xt(e)?e.some(n=>Wu(n,t)):Cn(e)?e.split(",").includes(t):yE(e)?(e.lastIndex=0,e.test(t)):!1}function LT(e,t){Q4(e,"a",t)}function $T(e,t){Q4(e,"da",t)}function Q4(e,t,n=Vo){const o=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(fm(t,o,n),n){let s=n.parent;for(;s&&s.parent;)jd(s.parent.vnode)&&FT(o,t,n,s),s=s.parent}}function FT(e,t,n,o){const s=fm(t,e,o,!0);bn(()=>{ay(o[t],s)},n)}function e0(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Bf(e){return e.shapeFlag&128?e.ssContent:e}function fm(e,t,n=Vo,o=!1){if(n){const s=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Dr();const l=iu(n),a=wi(t,n,e,r);return l(),Pr(),a});return o?s.unshift(i):s.push(i),i}}const Ur=e=>(t,n=Vo)=>{(!Ta||e==="sp")&&fm(e,(...o)=>t(...o),n)},OT=Ur("bm"),cn=Ur("m"),X4=Ur("bu"),yy=Ur("u"),po=Ur("bum"),bn=Ur("um"),RT=Ur("sp"),BT=Ur("rtg"),DT=Ur("rtc");function PT(e,t=Vo){fm("ec",e,t)}const ky="components",HT="directives";function WT(e,t){return by(ky,e,!0,t)||e}const J4=Symbol.for("v-ndc");function jo(e){return Cn(e)?by(ky,e,!1)||e:e||J4}function wwe(e){return by(HT,e)}function by(e,t,n=!0,o=!1){const s=Ko||Vo;if(s){const i=s.type;if(e===ky){const l=Hg(i,!1);if(l&&(l===t||l===No(t)||l===tm(No(t))))return i}const r=qb(s[e]||i[e],t)||qb(s.appContext[e],t);return!r&&o?i:r}}function qb(e,t){return e&&(e[t]||e[No(t)]||e[tm(No(t))])}function ot(e,t,n,o){let s;const i=n&&n[o],r=xt(e);if(r||Cn(e)){const l=r&&_l(e);let a=!1,c=!1;l&&(a=!Ks(e),c=Hr(e),e=rm(e)),s=new Array(e.length);for(let u=0,d=e.length;u<d;u++)s[u]=t(a?c?Gc(Di(e[u])):Di(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(an(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 e3(e,t){for(let n=0;n<t.length;n++){const o=t[n];if(xt(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 On(e,t,n={},o,s){if(Ko.ce||Ko.parent&&Or(Ko.parent)&&Ko.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),xe(Pe,null,[re("slot",n,o&&o())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),w();const r=i&&xy(i(n)),l=n.key||r&&r.key,a=xe(Pe,{key:(l&&!Js(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 xy(e){return e.some(t=>Nl(t)?!(t.type===bo||t.type===Pe&&!xy(t.children)):!0)?e:null}function _we(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:mh(o)]=e[o];return n}const Lg=e=>e?C3(e)?Kd(e):Lg(e.parent):null,Xu=kn(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=>Lg(e.parent),$root:e=>Lg(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wy(e),$forceUpdate:e=>e.f||(e.f=()=>{my(e.update)}),$nextTick:e=>e.n||(e.n=mt.bind(e.proxy)),$watch:e=>vT.bind(e)}),t0=(e,t)=>e!==Qt&&!e.__isScriptSetup&&ln(e,t),$g={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(t0(o,t))return r[t]=1,o[t];if(s!==Qt&&ln(s,t))return r[t]=2,s[t];if(ln(i,t))return r[t]=3,i[t];if(n!==Qt&&ln(n,t))return r[t]=4,n[t];Fg&&(r[t]=0)}}const c=Xu[t];let u,d;if(c)return t==="$attrs"&&Jo(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Qt&&ln(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,ln(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:s,ctx:i}=e;return t0(s,t)?(s[t]=n,!0):o!==Qt&&ln(o,t)?(o[t]=n,!0):ln(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!==Qt&&l[0]!=="$"&&ln(e,l)||t0(t,l)||ln(i,l)||ln(o,l)||ln(Xu,l)||ln(s.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ln(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},zT=kn({},$g,{get(e,t){if(t!==Symbol.unscopables)return $g.get(e,t,e)},has(e,t){return t[0]!=="_"&&!_E(t)}});function Swe(){return null}function Cwe(){return null}function Awe(e){}function Mwe(e){}function Ewe(){return null}function Twe(){}function Nwe(e,t){return null}function Iwe(){return t3().slots}function Vd(){return t3().attrs}function t3(e){const t=Yo();return t.setupContext||(t.setupContext=E3(t))}function bd(e){return xt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Lwe(e,t){const n=bd(e);for(const o in t){if(o.startsWith("__skip"))continue;let s=n[o];s?xt(s)||$t(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 $we(e,t){return!e||!t?e||t:xt(e)&&xt(t)?e.concat(t):kn({},bd(e),bd(t))}function Fwe(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function Owe(e){const t=Yo(),n=Ta;let o=e();wd(),n&&Bc(!1);const s=()=>{iu(t),n&&Bc(!0)},i=()=>{Yo()!==t&&t.scope.off(),wd(),n&&Bc(!1)};return cy(o)&&(o=o.catch(r=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[o,()=>{s(),Promise.resolve().then(i)}]}let Fg=!0;function UT(e){const t=wy(e),n=e.proxy,o=e.ctx;Fg=!1,t.beforeCreate&&jb(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:g,deactivated:b,beforeDestroy:v,beforeUnmount:m,destroyed:y,unmounted:k,render:A,renderTracked:$,renderTriggered:N,errorCaptured:x,serverPrefetch:I,expose:E,inheritAttrs:F,components:S,directives:L,filters:R}=t;if(c&&qT(c,o,null),r)for(const H in r){const U=r[H];$t(U)&&(o[H]=U.bind(n))}if(s){const H=s.call(n,n);an(H)&&(e.data=Bo(H))}if(Fg=!0,i)for(const H in i){const U=i[H],Z=$t(U)?U.bind(n,n):$t(U.get)?U.get.bind(n,n):ki,K=!$t(U)&&$t(U.set)?U.set.bind(n):ki,V=B({get:Z,set:K});Object.defineProperty(o,H,{enumerable:!0,configurable:!0,get:()=>V.value,set:J=>V.value=J})}if(l)for(const H in l)n3(l[H],o,n,H);if(a){const H=$t(a)?a.call(n):a;Reflect.ownKeys(H).forEach(U=>{Ln(U,H[U])})}u&&jb(u,e,"c");function z(H,U){xt(U)?U.forEach(Z=>H(Z.bind(n))):U&&H(U.bind(n))}if(z(OT,d),z(cn,f),z(X4,h),z(yy,p),z(LT,g),z($T,b),z(PT,x),z(DT,$),z(BT,N),z(po,m),z(bn,k),z(RT,I),xt(E))if(E.length){const H=e.exposed||(e.exposed={});E.forEach(U=>{Object.defineProperty(H,U,{get:()=>n[U],set:Z=>n[U]=Z,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===ki&&(e.render=A),F!=null&&(e.inheritAttrs=F),S&&(e.components=S),L&&(e.directives=L),I&&vy(e)}function qT(e,t,n=ki){xt(e)&&(e=Og(e));for(const o in e){const s=e[o];let i;an(s)?"default"in s?i=Kt(s.from||o,s.default,!0):i=Kt(s.from||o):i=Kt(s),ho(i)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[o]=i}}function jb(e,t,n){wi(xt(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function n3(e,t,n,o){let s=o.includes(".")?U4(n,o):()=>n[o];if(Cn(e)){const i=t[e];$t(i)&&Qe(s,i)}else if($t(e))Qe(s,e.bind(n));else if(an(e))if(xt(e))e.forEach(i=>n3(i,t,n,o));else{const i=$t(e.handler)?e.handler.bind(n):t[e.handler];$t(i)&&Qe(s,i,e)}}function wy(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=>Kh(a,c,r,!0)),Kh(a,t,r)),an(t)&&i.set(t,a),a}function Kh(e,t,n,o=!1){const{mixins:s,extends:i}=t;i&&Kh(e,i,n,!0),s&&s.forEach(r=>Kh(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=jT[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const jT={data:Vb,props:Kb,emits:Kb,methods:zu,computed:zu,beforeCreate:cs,created:cs,beforeMount:cs,mounted:cs,beforeUpdate:cs,updated:cs,beforeDestroy:cs,beforeUnmount:cs,destroyed:cs,unmounted:cs,activated:cs,deactivated:cs,errorCaptured:cs,serverPrefetch:cs,components:zu,directives:zu,watch:KT,provide:Vb,inject:VT};function Vb(e,t){return t?e?function(){return kn($t(e)?e.call(this,this):e,$t(t)?t.call(this,this):t)}:t:e}function VT(e,t){return zu(Og(e),Og(t))}function Og(e){if(xt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function cs(e,t){return e?[...new Set([].concat(e,t))]:t}function zu(e,t){return e?kn(Object.create(null),e,t):t}function Kb(e,t){return e?xt(e)&&xt(t)?[...new Set([...e,...t])]:kn(Object.create(null),bd(e),bd(t??{})):t}function KT(e,t){if(!e)return t;if(!t)return e;const n=kn(Object.create(null),e);for(const o in t)n[o]=cs(e[o],t[o]);return n}function o3(){return{app:null,config:{isNativeTag:f4,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 GT=0;function YT(e,t){return function(o,s=null){$t(o)||(o=kn({},o)),s!=null&&!an(s)&&(s=null);const i=o3(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:GT++,_component:o,_props:s,_container:null,_context:i,_instance:null,version:C9,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&$t(u.install)?(r.add(u),u.install(c,...d)):$t(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||re(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,Kd(h.component)}},onUnmount(u){l.push(u)},unmount(){a&&(wi(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=Sa;Sa=c;try{return u()}finally{Sa=d}}};return c}}let Sa=null;function Rwe(e,t,n=Qt){const o=Yo(),s=No(t),i=Is(t),r=s3(e,s),l=tT((a,c)=>{let u,d=Qt,f;return gT(()=>{const h=e[s];qo(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(!qo(p,u)&&!(d!==Qt&&qo(h,d)))return;const g=o.vnode.props;g&&(t in g||s in g||i in g)&&(`onUpdate:${t}`in g||`onUpdate:${s}`in g||`onUpdate:${i}`in g)||(u=h,c()),o.emit(`update:${t}`,p),qo(h,p)&&qo(h,d)&&!qo(p,f)&&c(),d=h,f=p}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Qt:l,done:!1}:{done:!0}}}},l}const s3=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${No(t)}Modifiers`]||e[`${Is(t)}Modifiers`];function ZT(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Qt;let s=n;const i=t.startsWith("update:"),r=i&&s3(o,t.slice(7));r&&(r.trim&&(s=n.map(u=>Cn(u)?u.trim():u)),r.number&&(s=n.map(nm)));let l,a=o[l=mh(t)]||o[l=mh(No(t))];!a&&i&&(a=o[l=mh(Is(t))]),a&&wi(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,wi(c,e,6,s)}}const QT=new WeakMap;function i3(e,t,n=!1){const o=n?QT:t.emitsCache,s=o.get(e);if(s!==void 0)return s;const i=e.emits;let r={},l=!1;if(!$t(e)){const a=c=>{const u=i3(c,t,!0);u&&(l=!0,kn(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(an(e)&&o.set(e,null),null):(xt(i)?i.forEach(a=>r[a]=null):kn(r,i),an(e)&&o.set(e,r),r)}function hm(e,t){return!e||!zd(t)?!1:(t=t.slice(2).replace(/Once$/,""),ln(e,t[0].toLowerCase()+t.slice(1))||ln(e,Is(t))||ln(e,t))}function gh(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:g}=e,b=yd(e);let v,m;try{if(n.shapeFlag&4){const k=s||o,A=k;v=Ns(c.call(A,k,u,d,h,f,p)),m=l}else{const k=t;v=Ns(k.length>1?k(d,{attrs:l,slots:r,emit:a}):k(d,null)),m=t.props?l:JT(l)}}catch(k){Ju.length=0,su(k,e,1),v=re(bo)}let y=v;if(m&&g!==!1){const k=Object.keys(m),{shapeFlag:A}=y;k.length&&A&7&&(i&&k.some(Qp)&&(m=e9(m,i)),y=Wr(y,m,!1,!0))}return n.dirs&&(y=Wr(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&Tl(y,n.transition),v=y,yd(b),v}function XT(e,t=!0){let n;for(let o=0;o<e.length;o++){const s=e[o];if(Nl(s)){if(s.type!==bo||s.children==="v-if"){if(n)return;n=s}}else return}return n}const JT=e=>{let t;for(const n in e)(n==="class"||n==="style"||zd(n))&&((t||(t={}))[n]=e[n]);return t},e9=(e,t)=>{const n={};for(const o in e)(!Qp(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function t9(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?Gb(o,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(r3(r,o,f)&&!hm(c,f))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Gb(o,r,c):!0:!!r;return!1}function Gb(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(r3(t,e,i)&&!hm(n,i))return!0}return!1}function r3(e,t,n){const o=e[n],s=t[n];return n==="style"&&an(o)&&an(s)?!Br(o,s):o!==s}function pm({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 l3={},a3=()=>Object.create(l3),c3=e=>Object.getPrototypeOf(e)===l3;function n9(e,t,n,o=!1){const s={},i=a3();e.propsDefaults=Object.create(null),u3(e,t,s,i);for(const r in e.propsOptions[0])r in s||(s[r]=void 0);n?e.props=o?s:QE(s):e.type.props?e.props=s:e.props=i,e.attrs=i}function o9(e,t,n,o){const{props:s,attrs:i,vnode:{patchFlag:r}}=e,l=en(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(hm(e.emitsOptions,f))continue;const h=t[f];if(a)if(ln(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const p=No(f);s[p]=Rg(a,l,p,h,e,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{u3(e,t,s,i)&&(c=!0);let u;for(const d in l)(!t||!ln(t,d)&&((u=Is(d))===d||!ln(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(s[d]=Rg(a,l,d,void 0,e,!0)):delete s[d]);if(i!==l)for(const d in i)(!t||!ln(t,d))&&(delete i[d],c=!0)}c&&Tr(e.attrs,"set","")}function u3(e,t,n,o){const[s,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(wa(a))continue;const c=t[a];let u;s&&ln(s,u=No(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:hm(e.emitsOptions,a)||(!(a in o)||c!==o[a])&&(o[a]=c,r=!0)}if(i){const a=en(n),c=l||Qt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=Rg(s,a,d,c[d],e,!ln(c,d))}}return r}function Rg(e,t,n,o,s,i){const r=e[n];if(r!=null){const l=ln(r,"default");if(l&&o===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&$t(a)){const{propsDefaults:c}=s;if(n in c)o=c[n];else{const u=iu(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===Is(n))&&(o=!0))}return o}const s9=new WeakMap;function d3(e,t,n=!1){const o=n?s9:t.propsCache,s=o.get(e);if(s)return s;const i=e.props,r={},l=[];let a=!1;if(!$t(e)){const u=d=>{a=!0;const[f,h]=d3(d,t,!0);kn(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 an(e)&&o.set(e,Nc),Nc;if(xt(i))for(let u=0;u<i.length;u++){const d=No(i[u]);Yb(d)&&(r[d]=Qt)}else if(i)for(const u in i){const d=No(u);if(Yb(d)){const f=i[u],h=r[d]=xt(f)||$t(f)?{type:f}:kn({},f),p=h.type;let g=!1,b=!0;if(xt(p))for(let v=0;v<p.length;++v){const m=p[v],y=$t(m)&&m.name;if(y==="Boolean"){g=!0;break}else y==="String"&&(b=!1)}else g=$t(p)&&p.name==="Boolean";h[0]=g,h[1]=b,(g||ln(h,"default"))&&l.push(d)}}const c=[r,l];return an(e)&&o.set(e,c),c}function Yb(e){return e[0]!=="$"&&!wa(e)}const _y=e=>e==="_"||e==="_ctx"||e==="$stable",Sy=e=>xt(e)?e.map(Ns):[Ns(e)],i9=(e,t,n)=>{if(t._n)return t;const o=Ee((...s)=>Sy(t(...s)),n);return o._c=!1,o},f3=(e,t,n)=>{const o=e._ctx;for(const s in e){if(_y(s))continue;const i=e[s];if($t(i))t[s]=i9(s,i,o);else if(i!=null){const r=Sy(i);t[s]=()=>r}}},h3=(e,t)=>{const n=Sy(t);e.slots.default=()=>n},p3=(e,t,n)=>{for(const o in t)(n||!_y(o))&&(e[o]=t[o])},r9=(e,t,n)=>{const o=e.slots=a3();if(e.vnode.shapeFlag&32){const s=t._;s?(p3(o,t,n),n&&p4(o,"_",s,!0)):f3(t,o)}else t&&h3(e,t)},l9=(e,t,n)=>{const{vnode:o,slots:s}=e;let i=!0,r=Qt;if(o.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:p3(s,t,n):(i=!t.$stable,f3(t,s)),r=t}else t&&(h3(e,t),r={default:1});if(i)for(const l in s)!_y(l)&&r[l]==null&&delete s[l]},vo=b3;function a9(e){return m3(e)}function c9(e){return m3(e,CT)}function m3(e,t){const n=om();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=ki,insertStaticContent:p}=e,g=(q,ee,ge,de=null,ve=null,j=null,te=void 0,pe=null,Ce=!!ee.dynamicChildren)=>{if(q===ee)return;q&&!Ii(q,ee)&&(de=Se(q),J(q,ve,j,!0),q=null),ee.patchFlag===-2&&(Ce=!1,ee.dynamicChildren=null);const{type:$e,ref:De,shapeFlag:me}=ee;switch($e){case Sl:b(q,ee,ge,de);break;case bo:v(q,ee,ge,de);break;case Rc:q==null&&m(ee,ge,de,te);break;case Pe:S(q,ee,ge,de,ve,j,te,pe,Ce);break;default:me&1?A(q,ee,ge,de,ve,j,te,pe,Ce):me&6?L(q,ee,ge,de,ve,j,te,pe,Ce):(me&64||me&128)&&$e.process(q,ee,ge,de,ve,j,te,pe,Ce,P)}De!=null&&ve?Fc(De,q&&q.ref,j,ee||q,!ee):De==null&&q&&q.ref!=null&&Fc(q.ref,null,j,q,!0)},b=(q,ee,ge,de)=>{if(q==null)o(ee.el=l(ee.children),ge,de);else{const ve=ee.el=q.el;ee.children!==q.children&&c(ve,ee.children)}},v=(q,ee,ge,de)=>{q==null?o(ee.el=a(ee.children||""),ge,de):ee.el=q.el},m=(q,ee,ge,de)=>{[q.el,q.anchor]=p(q.children,ee,ge,de,q.el,q.anchor)},y=({el:q,anchor:ee},ge,de)=>{let ve;for(;q&&q!==ee;)ve=f(q),o(q,ge,de),q=ve;o(ee,ge,de)},k=({el:q,anchor:ee})=>{let ge;for(;q&&q!==ee;)ge=f(q),s(q),q=ge;s(ee)},A=(q,ee,ge,de,ve,j,te,pe,Ce)=>{if(ee.type==="svg"?te="svg":ee.type==="math"&&(te="mathml"),q==null)$(ee,ge,de,ve,j,te,pe,Ce);else{const $e=q.el&&q.el._isVueCE?q.el:null;try{$e&&$e._beginPatch(),I(q,ee,ve,j,te,pe,Ce)}finally{$e&&$e._endPatch()}}},$=(q,ee,ge,de,ve,j,te,pe)=>{let Ce,$e;const{props:De,shapeFlag:me,transition:Ie,dirs:et}=q;if(Ce=q.el=r(q.type,j,De&&De.is,De),me&8?u(Ce,q.children):me&16&&x(q.children,Ce,null,de,ve,n0(q,j),te,pe),et&&Xi(q,null,de,"created"),N(Ce,q,q.scopeId,te,de),De){for(const _t in De)_t!=="value"&&!wa(_t)&&i(Ce,_t,null,De[_t],j,de);"value"in De&&i(Ce,"value",null,De.value,j),($e=De.onVnodeBeforeMount)&&Es($e,de,q)}et&&Xi(q,null,de,"beforeMount");const rt=g3(ve,Ie);rt&&Ie.beforeEnter(Ce),o(Ce,ee,ge),(($e=De&&De.onVnodeMounted)||rt||et)&&vo(()=>{try{$e&&Es($e,de,q),rt&&Ie.enter(Ce),et&&Xi(q,null,de,"mounted")}finally{}},ve)},N=(q,ee,ge,de,ve)=>{if(ge&&h(q,ge),de)for(let j=0;j<de.length;j++)h(q,de[j]);if(ve){let j=ve.subTree;if(ee===j||Yh(j.type)&&(j.ssContent===ee||j.ssFallback===ee)){const te=ve.vnode;N(q,te,te.scopeId,te.slotScopeIds,ve.parent)}}},x=(q,ee,ge,de,ve,j,te,pe,Ce=0)=>{for(let $e=Ce;$e<q.length;$e++){const De=q[$e]=pe?Mr(q[$e]):Ns(q[$e]);g(null,De,ee,ge,de,ve,j,te,pe)}},I=(q,ee,ge,de,ve,j,te)=>{const pe=ee.el=q.el;let{patchFlag:Ce,dynamicChildren:$e,dirs:De}=ee;Ce|=q.patchFlag&16;const me=q.props||Qt,Ie=ee.props||Qt;let et;if(ge&&na(ge,!1),(et=Ie.onVnodeBeforeUpdate)&&Es(et,ge,ee,q),De&&Xi(ee,q,ge,"beforeUpdate"),ge&&na(ge,!0),(me.innerHTML&&Ie.innerHTML==null||me.textContent&&Ie.textContent==null)&&u(pe,""),$e?E(q.dynamicChildren,$e,pe,ge,de,n0(ee,ve),j):te||U(q,ee,pe,null,ge,de,n0(ee,ve),j,!1),Ce>0){if(Ce&16)F(pe,me,Ie,ge,ve);else if(Ce&2&&me.class!==Ie.class&&i(pe,"class",null,Ie.class,ve),Ce&4&&i(pe,"style",me.style,Ie.style,ve),Ce&8){const rt=ee.dynamicProps;for(let _t=0;_t<rt.length;_t++){const gt=rt[_t],It=me[gt],Ut=Ie[gt];(Ut!==It||gt==="value")&&i(pe,gt,It,Ut,ve,ge)}}Ce&1&&q.children!==ee.children&&u(pe,ee.children)}else!te&&$e==null&&F(pe,me,Ie,ge,ve);((et=Ie.onVnodeUpdated)||De)&&vo(()=>{et&&Es(et,ge,ee,q),De&&Xi(ee,q,ge,"updated")},de)},E=(q,ee,ge,de,ve,j,te)=>{for(let pe=0;pe<ee.length;pe++){const Ce=q[pe],$e=ee[pe],De=Ce.el&&(Ce.type===Pe||!Ii(Ce,$e)||Ce.shapeFlag&198)?d(Ce.el):ge;g(Ce,$e,De,null,de,ve,j,te,!0)}},F=(q,ee,ge,de,ve)=>{if(ee!==ge){if(ee!==Qt)for(const j in ee)!wa(j)&&!(j in ge)&&i(q,j,ee[j],null,ve,de);for(const j in ge){if(wa(j))continue;const te=ge[j],pe=ee[j];te!==pe&&j!=="value"&&i(q,j,pe,te,ve,de)}"value"in ge&&i(q,"value",ee.value,ge.value,ve)}},S=(q,ee,ge,de,ve,j,te,pe,Ce)=>{const $e=ee.el=q?q.el:l(""),De=ee.anchor=q?q.anchor:l("");let{patchFlag:me,dynamicChildren:Ie,slotScopeIds:et}=ee;et&&(pe=pe?pe.concat(et):et),q==null?(o($e,ge,de),o(De,ge,de),x(ee.children||[],ge,De,ve,j,te,pe,Ce)):me>0&&me&64&&Ie&&q.dynamicChildren&&q.dynamicChildren.length===Ie.length?(E(q.dynamicChildren,Ie,ge,ve,j,te,pe),(ee.key!=null||ve&&ee===ve.subTree)&&Cy(q,ee,!0)):U(q,ee,ge,De,ve,j,te,pe,Ce)},L=(q,ee,ge,de,ve,j,te,pe,Ce)=>{ee.slotScopeIds=pe,q==null?ee.shapeFlag&512?ve.ctx.activate(ee,ge,de,te,Ce):R(ee,ge,de,ve,j,te,Ce):D(q,ee,Ce)},R=(q,ee,ge,de,ve,j,te)=>{const pe=q.component=S3(q,de,ve);if(jd(q)&&(pe.ctx.renderer=P),A3(pe,!1,te),pe.asyncDep){if(ve&&ve.registerDep(pe,z,te),!q.el){const Ce=pe.subTree=re(bo);v(null,Ce,ee,ge),q.placeholder=Ce.el}}else z(pe,q,ee,ge,ve,j,te)},D=(q,ee,ge)=>{const de=ee.component=q.component;if(t9(q,ee,ge))if(de.asyncDep&&!de.asyncResolved){H(de,ee,ge);return}else de.next=ee,de.update();else ee.el=q.el,de.vnode=ee},z=(q,ee,ge,de,ve,j,te)=>{const pe=()=>{if(q.isMounted){let{next:me,bu:Ie,u:et,parent:rt,vnode:_t}=q;{const un=v3(q);if(un){me&&(me.el=_t.el,H(q,me,te)),un.asyncDep.then(()=>{vo(()=>{q.isUnmounted||$e()},ve)});return}}let gt=me,It;na(q,!1),me?(me.el=_t.el,H(q,me,te)):me=_t,Ie&&Lc(Ie),(It=me.props&&me.props.onVnodeBeforeUpdate)&&Es(It,rt,me,_t),na(q,!0);const Ut=gh(q),ht=q.subTree;q.subTree=Ut,g(ht,Ut,d(ht.el),Se(ht),q,ve,j),me.el=Ut.el,gt===null&&pm(q,Ut.el),et&&vo(et,ve),(It=me.props&&me.props.onVnodeUpdated)&&vo(()=>Es(It,rt,me,_t),ve)}else{let me;const{el:Ie,props:et}=ee,{bm:rt,m:_t,parent:gt,root:It,type:Ut}=q,ht=Or(ee);if(na(q,!1),rt&&Lc(rt),!ht&&(me=et&&et.onVnodeBeforeMount)&&Es(me,gt,ee),na(q,!0),Ie&&ne){const un=()=>{q.subTree=gh(q),ne(Ie,q.subTree,q,ve,null)};ht&&Ut.__asyncHydrate?Ut.__asyncHydrate(Ie,q,un):un()}else{It.ce&&It.ce._hasShadowRoot()&&It.ce._injectChildStyle(Ut,q.parent?q.parent.type:void 0);const un=q.subTree=gh(q);g(null,un,ge,de,q,ve,j),ee.el=un.el}if(_t&&vo(_t,ve),!ht&&(me=et&&et.onVnodeMounted)){const un=ee;vo(()=>Es(me,gt,un),ve)}(ee.shapeFlag&256||gt&&Or(gt.vnode)&&gt.vnode.shapeFlag&256)&&q.a&&vo(q.a,ve),q.isMounted=!0,ee=ge=de=null}};q.scope.on();const Ce=q.effect=new Ph(pe);q.scope.off();const $e=q.update=Ce.run.bind(Ce),De=q.job=Ce.runIfDirty.bind(Ce);De.i=q,De.id=q.uid,Ce.scheduler=()=>my(De),na(q,!0),$e()},H=(q,ee,ge)=>{ee.component=q;const de=q.vnode.props;q.vnode=ee,q.next=null,o9(q,ee.props,de,ge),l9(q,ee.children,ge),Dr(),Rb(q),Pr()},U=(q,ee,ge,de,ve,j,te,pe,Ce=!1)=>{const $e=q&&q.children,De=q?q.shapeFlag:0,me=ee.children,{patchFlag:Ie,shapeFlag:et}=ee;if(Ie>0){if(Ie&128){K($e,me,ge,de,ve,j,te,pe,Ce);return}else if(Ie&256){Z($e,me,ge,de,ve,j,te,pe,Ce);return}}et&8?(De&16&&ue($e,ve,j),me!==$e&&u(ge,me)):De&16?et&16?K($e,me,ge,de,ve,j,te,pe,Ce):ue($e,ve,j,!0):(De&8&&u(ge,""),et&16&&x(me,ge,de,ve,j,te,pe,Ce))},Z=(q,ee,ge,de,ve,j,te,pe,Ce)=>{q=q||Nc,ee=ee||Nc;const $e=q.length,De=ee.length,me=Math.min($e,De);let Ie;for(Ie=0;Ie<me;Ie++){const et=ee[Ie]=Ce?Mr(ee[Ie]):Ns(ee[Ie]);g(q[Ie],et,ge,null,ve,j,te,pe,Ce)}$e>De?ue(q,ve,j,!0,!1,me):x(ee,ge,de,ve,j,te,pe,Ce,me)},K=(q,ee,ge,de,ve,j,te,pe,Ce)=>{let $e=0;const De=ee.length;let me=q.length-1,Ie=De-1;for(;$e<=me&&$e<=Ie;){const et=q[$e],rt=ee[$e]=Ce?Mr(ee[$e]):Ns(ee[$e]);if(Ii(et,rt))g(et,rt,ge,null,ve,j,te,pe,Ce);else break;$e++}for(;$e<=me&&$e<=Ie;){const et=q[me],rt=ee[Ie]=Ce?Mr(ee[Ie]):Ns(ee[Ie]);if(Ii(et,rt))g(et,rt,ge,null,ve,j,te,pe,Ce);else break;me--,Ie--}if($e>me){if($e<=Ie){const et=Ie+1,rt=et<De?ee[et].el:de;for(;$e<=Ie;)g(null,ee[$e]=Ce?Mr(ee[$e]):Ns(ee[$e]),ge,rt,ve,j,te,pe,Ce),$e++}}else if($e>Ie)for(;$e<=me;)J(q[$e],ve,j,!0),$e++;else{const et=$e,rt=$e,_t=new Map;for($e=rt;$e<=Ie;$e++){const Wt=ee[$e]=Ce?Mr(ee[$e]):Ns(ee[$e]);Wt.key!=null&&_t.set(Wt.key,$e)}let gt,It=0;const Ut=Ie-rt+1;let ht=!1,un=0;const dn=new Array(Ut);for($e=0;$e<Ut;$e++)dn[$e]=0;for($e=et;$e<=me;$e++){const Wt=q[$e];if(It>=Ut){J(Wt,ve,j,!0);continue}let Hn;if(Wt.key!=null)Hn=_t.get(Wt.key);else for(gt=rt;gt<=Ie;gt++)if(dn[gt-rt]===0&&Ii(Wt,ee[gt])){Hn=gt;break}Hn===void 0?J(Wt,ve,j,!0):(dn[Hn-rt]=$e+1,Hn>=un?un=Hn:ht=!0,g(Wt,ee[Hn],ge,null,ve,j,te,pe,Ce),It++)}const ns=ht?u9(dn):Nc;for(gt=ns.length-1,$e=Ut-1;$e>=0;$e--){const Wt=rt+$e,Hn=ee[Wt],lo=ee[Wt+1],it=Wt+1<De?lo.el||y3(lo):de;dn[$e]===0?g(null,Hn,ge,it,ve,j,te,pe,Ce):ht&&(gt<0||$e!==ns[gt]?V(Hn,ge,it,2):gt--)}}},V=(q,ee,ge,de,ve=null)=>{const{el:j,type:te,transition:pe,children:Ce,shapeFlag:$e}=q;if($e&6){V(q.component.subTree,ee,ge,de);return}if($e&128){q.suspense.move(ee,ge,de);return}if($e&64){te.move(q,ee,ge,P);return}if(te===Pe){o(j,ee,ge);for(let me=0;me<Ce.length;me++)V(Ce[me],ee,ge,de);o(q.anchor,ee,ge);return}if(te===Rc){y(q,ee,ge);return}if(de!==2&&$e&1&&pe)if(de===0)pe.persisted&&!j[fi]?o(j,ee,ge):(pe.beforeEnter(j),o(j,ee,ge),vo(()=>pe.enter(j),ve));else{const{leave:me,delayLeave:Ie,afterLeave:et}=pe,rt=()=>{q.ctx.isUnmounted?s(j):o(j,ee,ge)},_t=()=>{const gt=j._isLeaving||!!j[fi];j._isLeaving&&j[fi](!0),pe.persisted&&!gt?rt():me(j,()=>{rt(),et&&et()})};Ie?Ie(j,rt,_t):_t()}else o(j,ee,ge)},J=(q,ee,ge,de=!1,ve=!1)=>{const{type:j,props:te,ref:pe,children:Ce,dynamicChildren:$e,shapeFlag:De,patchFlag:me,dirs:Ie,cacheIndex:et,memo:rt}=q;if(me===-2&&(ve=!1),pe!=null&&(Dr(),Fc(pe,null,ge,q,!0),Pr()),et!=null&&(ee.renderCache[et]=void 0),De&256){ee.ctx.deactivate(q);return}const _t=De&1&&Ie,gt=!Or(q);let It;if(gt&&(It=te&&te.onVnodeBeforeUnmount)&&Es(It,ee,q),De&6)ce(q.component,ge,de);else{if(De&128){q.suspense.unmount(ge,de);return}_t&&Xi(q,null,ee,"beforeUnmount"),De&64?q.type.remove(q,ee,ge,P,de):$e&&!$e.hasOnce&&(j!==Pe||me>0&&me&64)?ue($e,ee,ge,!1,!0):(j===Pe&&me&384||!ve&&De&16)&&ue(Ce,ee,ge),de&&fe(q)}const Ut=rt!=null&&et==null;(gt&&(It=te&&te.onVnodeUnmounted)||_t||Ut)&&vo(()=>{It&&Es(It,ee,q),_t&&Xi(q,null,ee,"unmounted"),Ut&&(q.el=null)},ge)},fe=q=>{const{type:ee,el:ge,anchor:de,transition:ve}=q;if(ee===Pe){oe(ge,de);return}if(ee===Rc){k(q);return}const j=()=>{s(ge),ve&&!ve.persisted&&ve.afterLeave&&ve.afterLeave()};if(q.shapeFlag&1&&ve&&!ve.persisted){const{leave:te,delayLeave:pe}=ve,Ce=()=>te(ge,j);pe?pe(q.el,j,Ce):Ce()}else j()},oe=(q,ee)=>{let ge;for(;q!==ee;)ge=f(q),s(q),q=ge;s(ee)},ce=(q,ee,ge)=>{const{bum:de,scope:ve,job:j,subTree:te,um:pe,m:Ce,a:$e}=q;Gh(Ce),Gh($e),de&&Lc(de),ve.stop(),j&&(j.flags|=8,J(te,q,ee,ge)),pe&&vo(pe,ee),vo(()=>{q.isUnmounted=!0},ee)},ue=(q,ee,ge,de=!1,ve=!1,j=0)=>{for(let te=j;te<q.length;te++)J(q[te],ee,ge,de,ve)},Se=q=>{if(q.shapeFlag&6)return Se(q.component.subTree);if(q.shapeFlag&128)return q.suspense.next();const ee=f(q.anchor||q.el),ge=ee&&ee[q4];return ge?f(ge):ee};let Te=!1;const Ae=(q,ee,ge)=>{let de;q==null?ee._vnode&&(J(ee._vnode,null,null,!0),de=ee._vnode.component):g(ee._vnode||null,q,ee,null,null,null,ge),ee._vnode=q,Te||(Te=!0,Rb(de),jh(),Te=!1)},P={p:g,um:J,m:V,r:fe,mt:R,mc:x,pc:U,pbc:E,n:Se,o:e};let le,ne;return t&&([le,ne]=t(P)),{render:Ae,hydrate:le,createApp:YT(Ae,le)}}function n0({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 na({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function g3(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Cy(e,t,n=!1){const o=e.children,s=t.children;if(xt(o)&&xt(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]=Mr(s[i]),l.el=r.el),!n&&l.patchFlag!==-2&&Cy(r,l)),l.type===Sl&&(l.patchFlag===-1&&(l=s[i]=Mr(l)),l.el=r.el),l.type===bo&&!l.el&&(l.el=r.el)}}function u9(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 v3(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:v3(t)}function Gh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function y3(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?y3(t.subTree):null}const Yh=e=>e.__isSuspense;let Bg=0;const d9={name:"Suspense",__isSuspense:!0,process(e,t,n,o,s,i,r,l,a,c){if(e==null)f9(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}h9(e,t,n,o,s,r,l,a,c)}},hydrate:p9,normalize:m9},Bwe=d9;function xd(e,t){const n=e.props&&e.props[t];$t(n)&&n()}function f9(e,t,n,o,s,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),f=e.suspense=k3(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?(xd(e,"onPending"),xd(e,"onFallback"),c(null,e.ssFallback,t,n,o,null,i,r),Oc(f,e.ssFallback)):f.resolve(!1,!0)}function h9(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:g,isInFallback:b,isHydrating:v}=d;if(g)d.pendingBranch=f,Ii(g,f)?(a(g,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0?d.resolve():b&&(v||(a(p,h,n,o,s,null,i,r,l),Oc(d,h)))):(d.pendingId=Bg++,v?(d.isHydrating=!1,d.activeBranch=g):c(g,s,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),b?(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),Oc(d,h))):p&&Ii(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&&Ii(p,f))a(p,f,n,o,s,d,i,r,l),Oc(d,f);else if(xd(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Bg++,a(null,f,d.hiddenContainer,null,s,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:m,pendingId:y}=d;m>0?setTimeout(()=>{d.pendingId===y&&d.fallback(h)},m):m===0&&d.fallback(h)}}function k3(e,t,n,o,s,i,r,l,a,c,u=!1){const{p:d,m:f,um:h,n:p,o:{parentNode:g,remove:b}}=c;let v;const m=g9(e);m&&t&&t.pendingBranch&&(v=t.pendingId,t.deps++);const y=e.props?Dh(e.props.timeout):void 0,k=i,A={vnode:e,parent:t,parentComponent:n,namespace:r,container:o,hiddenContainer:s,deps:0,pendingId:Bg++,timeout:typeof y=="number"?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,N=!1){const{vnode:x,activeBranch:I,pendingBranch:E,pendingId:F,effects:S,parentComponent:L,container:R,isInFallback:D}=A;let z=!1;if(A.isHydrating)A.isHydrating=!1;else if(!$){z=I&&E.transition&&E.transition.mode==="out-in";let Z=!1;z&&(I.transition.afterLeave=()=>{F===A.pendingId&&(f(E,R,i===k&&!Z?p(I):i,0),qh(S),D&&x.ssFallback&&(x.ssFallback.el=null))}),I&&!A.isFallbackMountPending&&(g(I.el)===R&&(i=p(I),Z=!0),h(I,L,A,!0),!z&&D&&x.ssFallback&&vo(()=>x.ssFallback.el=null,A)),z||f(E,R,i,0)}A.isFallbackMountPending=!1,Oc(A,E),A.pendingBranch=null,A.isInFallback=!1;let H=A.parent,U=!1;for(;H;){if(H.pendingBranch){H.effects.push(...S),U=!0;break}H=H.parent}!U&&!z&&qh(S),A.effects=[],m&&t&&t.pendingBranch&&v===t.pendingId&&(t.deps--,t.deps===0&&!N&&t.resolve()),xd(x,"onResolve")},fallback($){if(!A.pendingBranch)return;const{vnode:N,activeBranch:x,parentComponent:I,container:E,namespace:F}=A;xd(N,"onFallback");const S=p(x),L=()=>{A.isFallbackMountPending=!1,A.isInFallback&&(d(null,$,E,S,I,null,F,l,a),Oc(A,$))},R=$.transition&&$.transition.mode==="out-in";R&&(A.isFallbackMountPending=!0,x.transition.afterLeave=L),A.isInFallback=!0,h(x,I,null,!0),R||L()},move($,N,x){A.activeBranch&&f(A.activeBranch,$,N,x),A.container=$},next(){return A.activeBranch&&p(A.activeBranch)},registerDep($,N,x){const I=!!A.pendingBranch;I&&A.deps++;const E=$.vnode.el;$.asyncDep.catch(F=>{su(F,$,0)}).then(F=>{if($.isUnmounted||A.isUnmounted||A.pendingId!==$.suspenseId)return;wd(),$.asyncResolved=!0;const{vnode:S}=$;Dg($,F,!1),E&&(S.el=E);const L=!E&&$.subTree.el;N($,S,g(E||$.subTree.el),E?null:p($.subTree),A,r,x),L&&(S.placeholder=null,b(L)),pm($,S.el),I&&--A.deps===0&&A.resolve()})},unmount($,N){A.isUnmounted=!0,A.activeBranch&&h(A.activeBranch,n,$,N),A.pendingBranch&&h(A.pendingBranch,n,$,N)}};return A}function p9(e,t,n,o,s,i,r,l,a){const c=t.suspense=k3(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 m9(e){const{shapeFlag:t,children:n}=e,o=t&32;e.ssContent=Zb(o?n.default:n),e.ssFallback=o?Zb(n.fallback):re(bo)}function Zb(e){let t;if($t(e)){const n=Ea&&e._c;n&&(e._d=!1,w()),e=e(),n&&(e._d=!0,t=es,x3())}return xt(e)&&(e=XT(e)),e=Ns(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function b3(e,t){t&&t.pendingBranch?xt(e)?t.effects.push(...e):t.effects.push(e):qh(e)}function Oc(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,pm(o,s))}function g9(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Pe=Symbol.for("v-fgt"),Sl=Symbol.for("v-txt"),bo=Symbol.for("v-cmt"),Rc=Symbol.for("v-stc"),Ju=[];let es=null;function w(e=!1){Ju.push(es=e?null:[])}function x3(){Ju.pop(),es=Ju[Ju.length-1]||null}let Ea=1;function Zh(e,t=!1){Ea+=e,e<0&&es&&t&&(es.hasOnce=!0)}function w3(e){return e.dynamicChildren=Ea>0?es||Nc:null,x3(),Ea>0&&es&&es.push(e),e}function T(e,t,n,o,s,i){return w3(_(e,t,n,o,s,i,!0))}function xe(e,t,n,o,s){return w3(re(e,t,n,o,s,!0))}function Nl(e){return e?e.__v_isVNode===!0:!1}function Ii(e,t){return e.type===t.type&&e.key===t.key}function Dwe(e){}const _3=({key:e})=>e??null,vh=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Cn(e)||ho(e)||$t(e)?{i:Ko,r:e,k:t,f:!!n}:e:null);function _(e,t=null,n=null,o=0,s=null,i=e===Pe?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_3(t),ref:t&&vh(t),scopeId:um,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:Ko};return l?(My(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Cn(n)?8:16),Ea>0&&!r&&es&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&es.push(a),a}const re=v9;function v9(e,t=null,n=null,o=0,s=null,i=!1){if((!e||e===J4)&&(e=bo),Nl(e)){const l=Wr(e,t,!0);return n&&My(l,n),Ea>0&&!i&&es&&(l.shapeFlag&6?es[es.indexOf(e)]=l:es.push(l)),l.patchFlag=-2,l}if(_9(e)&&(e=e.__vccOpts),t){t=y9(t);let{class:l,style:a}=t;l&&!Cn(l)&&(t.class=We(l)),an(a)&&(cm(a)&&!xt(a)&&(a=kn({},a)),t.style=Yt(a))}const r=Cn(e)?1:Yh(e)?128:j4(e)?64:an(e)?4:$t(e)?2:0;return _(e,t,n,o,s,r,i,!0)}function y9(e){return e?cm(e)||c3(e)?kn({},e):e:null}function Wr(e,t,n=!1,o=!1){const{props:s,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?yn(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&_3(c),ref:t&&t.ref?n&&i?xt(i)?i.concat(vh(t)):[i,vh(t)]:vh(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!==Pe?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&&Wr(e.ssContent),ssFallback:e.ssFallback&&Wr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&o&&Tl(u,a.clone(u)),u}function Je(e=" ",t=0){return re(Sl,null,e,t)}function Ay(e,t){const n=re(Rc,null,e);return n.staticCount=t,n}function ae(e="",t=!1){return t?(w(),xe(bo,null,e)):re(bo,null,e)}function Ns(e){return e==null||typeof e=="boolean"?re(bo):xt(e)?re(Pe,null,e.slice()):Nl(e)?Mr(e):re(Sl,null,String(e))}function Mr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Wr(e)}function My(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(xt(t))n=16;else if(typeof t=="object")if(o&65){const s=t.default;s&&(s._c&&(s._d=!1),My(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!c3(t)?t._ctx=Ko:s===3&&Ko&&(Ko.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else $t(t)?(t={default:t,_ctx:Ko},n=32):(t=String(t),o&64?(n=16,t=[Je(t)]):n=8);e.children=t,e.shapeFlag|=n}function yn(...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=We([t.class,o.class]));else if(s==="style")t.style=Yt([t.style,o.style]);else if(zd(s)){const i=t[s],r=o[s];r&&i!==r&&!(xt(i)&&i.includes(r))?t[s]=i?[].concat(i,r):r:r==null&&i==null&&!Qp(s)&&(t[s]=r)}else s!==""&&(t[s]=o[s])}return t}function Es(e,t,n,o=null){wi(e,t,7,[n,o])}const k9=o3();let b9=0;function S3(e,t,n){const o=e.type,s=(t?t.appContext:e.appContext)||k9,i={uid:b9++,vnode:e,type:o,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new y4(!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:d3(o,s),emitsOptions:i3(o,s),emit:null,emitted:null,propsDefaults:Qt,inheritAttrs:o.inheritAttrs,ctx:Qt,data:Qt,props:Qt,attrs:Qt,slots:Qt,refs:Qt,setupState:Qt,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=ZT.bind(null,i),e.ce&&e.ce(i),i}let Vo=null;const Yo=()=>Vo||Ko;let Qh,Bc;{const e=om(),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)}};Qh=t("__VUE_INSTANCE_SETTERS__",n=>Vo=n),Bc=t("__VUE_SSR_SETTERS__",n=>Ta=n)}const iu=e=>{const t=Vo;return Qh(e),e.scope.on(),()=>{e.scope.off(),Qh(t)}},wd=()=>{Vo&&Vo.scope.off(),Qh(null)};function C3(e){return e.vnode.shapeFlag&4}let Ta=!1;function A3(e,t=!1,n=!1){t&&Bc(t);const{props:o,children:s}=e.vnode,i=C3(e);n9(e,o,i,t),r9(e,s,n||t);const r=i?x9(e,t):void 0;return t&&Bc(!1),r}function x9(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$g);const{setup:o}=n;if(o){Dr();const s=e.setupContext=o.length>1?E3(e):null,i=iu(e),r=Ud(o,e,0,[e.props,s]),l=cy(r);if(Pr(),i(),(l||e.sp)&&!Or(e)&&vy(e),l){if(r.then(wd,wd),t)return r.then(a=>{Dg(e,a,t)}).catch(a=>{su(a,e,0)});e.asyncDep=r}else Dg(e,r,t)}else M3(e,t)}function Dg(e,t,n){$t(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:an(t)&&(e.setupState=R4(t)),M3(e,n)}let Xh,Pg;function Pwe(e){Xh=e,Pg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,zT))}}const Hwe=()=>!Xh;function M3(e,t,n){const o=e.type;if(!e.render){if(!t&&Xh&&!o.render){const s=o.template||wy(e).template;if(s){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=o,c=kn(kn({isCustomElement:i,delimiters:l},r),a);o.render=Xh(s,c)}}e.render=o.render||ki,Pg&&Pg(e)}{const s=iu(e);Dr();try{UT(e)}finally{Pr(),s()}}}const w9={get(e,t){return Jo(e,"get",""),e[t]}};function E3(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,w9),slots:e.slots,emit:e.emit,expose:t}}function Kd(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(R4(pt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Xu)return Xu[n](e)},has(t,n){return n in t||n in Xu}})):e.proxy}function Hg(e,t=!0){return $t(e)?e.displayName||e.name:e.name||t&&e.__name}function _9(e){return $t(e)&&"__vccOpts"in e}const B=(e,t)=>iT(e,t,Ta);function mn(e,t,n){try{Zh(-1);const o=arguments.length;return o===2?an(t)&&!xt(t)?Nl(t)?re(e,null,[t]):re(e,t):re(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Nl(n)&&(n=[n]),re(e,t,n))}finally{Zh(1)}}function Wwe(){}function zwe(e,t,n,o){const s=n[o];if(s&&S9(s,e))return s;const i=t();return i.memo=e.slice(),i.cacheIndex=o,n[o]=i}function S9(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(qo(n[o],t[o]))return!1;return Ea>0&&es&&es.push(e),!0}const C9="3.5.35",Uwe=ki,qwe=uT,jwe=mc,Vwe=z4,A9={createComponentInstance:S3,setupComponent:A3,renderComponentRoot:gh,setCurrentRenderingInstance:yd,isVNode:Nl,normalizeVNode:Ns,getComponentPublicInstance:Kd,ensureValidVNode:xy,pushWarningContext:aT,popWarningContext:cT},Kwe=A9,Gwe=null,Ywe=null,Zwe=null;/**
17
- * @vue/runtime-dom v3.5.35
18
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
- * @license MIT
20
- **/let Wg;const Qb=typeof window<"u"&&window.trustedTypes;if(Qb)try{Wg=Qb.createPolicy("vue",{createHTML:e=>e})}catch{}const T3=Wg?e=>Wg.createHTML(e):e=>e,M9="http://www.w3.org/2000/svg",E9="http://www.w3.org/1998/Math/MathML",wr=typeof document<"u"?document:null,Xb=wr&&wr.createElement("template"),T9={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"?wr.createElementNS(M9,e):t==="mathml"?wr.createElementNS(E9,e):n?wr.createElement(e,{is:n}):wr.createElement(e);return e==="select"&&o&&o.multiple!=null&&s.setAttribute("multiple",o.multiple),s},createText:e=>wr.createTextNode(e),createComment:e=>wr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wr.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{Xb.innerHTML=T3(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Xb.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]}},tl="transition",Iu="animation",Yc=Symbol("_vtc"),N3={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},I3=kn({},K4,N3),N9=e=>(e.displayName="Transition",e.props=I3,e),Il=N9((e,{slots:t})=>mn(wT,L3(e),t)),oa=(e,t=[])=>{xt(e)?e.forEach(n=>n(...t)):e&&e(...t)},Jb=e=>e?xt(e)?e.some(t=>t.length>1):e.length>1:!1;function L3(e){const t={};for(const S in e)S in N3||(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=I9(s),g=p&&p[0],b=p&&p[1],{onBeforeEnter:v,onEnter:m,onEnterCancelled:y,onLeave:k,onLeaveCancelled:A,onBeforeAppear:$=v,onAppear:N=m,onAppearCancelled:x=y}=t,I=(S,L,R,D)=>{S._enterCancelled=D,dl(S,L?u:l),dl(S,L?c:r),R&&R()},E=(S,L)=>{S._isLeaving=!1,dl(S,d),dl(S,h),dl(S,f),L&&L()},F=S=>(L,R)=>{const D=S?N:m,z=()=>I(L,S,R);oa(D,[L,z]),ex(()=>{dl(L,S?a:i),Zi(L,S?u:l),Jb(D)||tx(L,o,g,z)})};return kn(t,{onBeforeEnter(S){oa(v,[S]),Zi(S,i),Zi(S,r)},onBeforeAppear(S){oa($,[S]),Zi(S,a),Zi(S,c)},onEnter:F(!1),onAppear:F(!0),onLeave(S,L){S._isLeaving=!0;const R=()=>E(S,L);Zi(S,d),S._enterCancelled?(Zi(S,f),zg(S)):(zg(S),Zi(S,f)),ex(()=>{S._isLeaving&&(dl(S,d),Zi(S,h),Jb(k)||tx(S,o,b,R))}),oa(k,[S,R])},onEnterCancelled(S){I(S,!1,void 0,!0),oa(y,[S])},onAppearCancelled(S){I(S,!0,void 0,!0),oa(x,[S])},onLeaveCancelled(S){E(S),oa(A,[S])}})}function I9(e){if(e==null)return null;if(an(e))return[o0(e.enter),o0(e.leave)];{const t=o0(e);return[t,t]}}function o0(e){return Dh(e)}function Zi(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Yc]||(e[Yc]=new Set)).add(t)}function dl(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[Yc];n&&(n.delete(t),n.size||(e[Yc]=void 0))}function ex(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let L9=0;function tx(e,t,n,o){const s=e._endId=++L9,i=()=>{s===e._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=$3(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 $3(e,t){const n=window.getComputedStyle(e),o=p=>(n[p]||"").split(", "),s=o(`${tl}Delay`),i=o(`${tl}Duration`),r=nx(s,i),l=o(`${Iu}Delay`),a=o(`${Iu}Duration`),c=nx(l,a);let u=null,d=0,f=0;t===tl?r>0&&(u=tl,d=r,f=i.length):t===Iu?c>0&&(u=Iu,d=c,f=a.length):(d=Math.max(r,c),u=d>0?r>c?tl:Iu:null,f=u?u===tl?i.length:a.length:0);const h=u===tl&&/\b(?:transform|all)(?:,|$)/.test(o(`${tl}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function nx(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>ox(n)+ox(e[o])))}function ox(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function zg(e){return(e?e.ownerDocument:document).body.offsetHeight}function $9(e,t,n){const o=e[Yc];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Jh=Symbol("_vod"),F3=Symbol("_vsh"),mi={name:"show",beforeMount(e,{value:t},{transition:n}){e[Jh]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Lu(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),Lu(e,!0),o.enter(e)):o.leave(e,()=>{Lu(e,!1)}):Lu(e,t))},beforeUnmount(e,{value:t}){Lu(e,t)}};function Lu(e,t){e.style.display=t?e[Jh]:"none",e[F3]=!t}function F9(){mi.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const O3=Symbol("");function Qwe(e){const t=Yo();if(!t)return;const n=t.ut=(s=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>ep(i,s))},o=()=>{const s=e(t.proxy);t.ce?ep(t.ce,s):Ug(t.subTree,s),n(s)};X4(()=>{qh(o)}),cn(()=>{Qe(o,ki,{flush:"post"});const s=new MutationObserver(o);s.observe(t.subTree.el.parentNode,{childList:!0}),bn(()=>s.disconnect())})}function Ug(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Ug(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ep(e.el,t);else if(e.type===Pe)e.children.forEach(n=>Ug(n,t));else if(e.type===Rc){let{el:n,anchor:o}=e;for(;n&&(ep(n,t),n!==o);)n=n.nextSibling}}function ep(e,t){if(e.nodeType===1){const n=e.style;let o="";for(const s in t){const i=IE(t[s]);n.setProperty(`--${s}`,i),o+=`--${s}: ${i};`}n[O3]=o}}const O9=/(?:^|;)\s*display\s*:/;function R9(e,t,n){const o=e.style,s=Cn(n);let i=!1;if(n&&!s){if(t)if(Cn(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Uu(o,l,"")}else for(const r in t)n[r]==null&&Uu(o,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?D9(e,r,!Cn(t)&&t?t[r]:void 0,l)||Uu(o,r,l):Uu(o,r,"")}}else if(s){if(t!==n){const r=o[O3];r&&(n+=";"+r),o.cssText=n,i=O9.test(n)}}else t&&e.removeAttribute("style");Jh in e&&(e[Jh]=i?o.display:"",e[F3]&&(o.display="none"))}const sx=/\s*!important$/;function Uu(e,t,n){if(xt(n))n.forEach(o=>Uu(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=B9(e,t);sx.test(n)?e.setProperty(Is(o),n.replace(sx,""),"important"):e[o]=n}}const ix=["Webkit","Moz","ms"],s0={};function B9(e,t){const n=s0[t];if(n)return n;let o=No(t);if(o!=="filter"&&o in e)return s0[t]=o;o=tm(o);for(let s=0;s<ix.length;s++){const i=ix[s]+o;if(i in e)return s0[t]=i}return t}function D9(e,t,n,o){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Cn(o)&&n===o}const rx="http://www.w3.org/1999/xlink";function lx(e,t,n,o,s,i=TE(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(rx,t.slice(6,t.length)):e.setAttributeNS(rx,t,n):n==null||i&&!m4(n)?e.removeAttribute(t):e.setAttribute(t,i?"":Js(n)?String(n):n)}function ax(e,t,n,o,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?T3(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=m4(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 Ir(e,t,n,o){e.addEventListener(t,n,o)}function P9(e,t,n,o){e.removeEventListener(t,n,o)}const cx=Symbol("_vei");function H9(e,t,n,o,s=null){const i=e[cx]||(e[cx]={}),r=i[t];if(o&&r)r.value=o;else{const[l,a]=W9(t);if(o){const c=i[t]=q9(o,s);Ir(e,l,c,a)}else r&&(P9(e,l,r,a),i[t]=void 0)}}const ux=/(?:Once|Passive|Capture)$/;function W9(e){let t;if(ux.test(e)){t={};let o;for(;o=e.match(ux);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Is(e.slice(2)),t]}let i0=0;const z9=Promise.resolve(),U9=()=>i0||(z9.then(()=>i0=0),i0=Date.now());function q9(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const s=n.value;if(xt(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&&wi(c,t,5,l)}}else wi(s,t,5,[o])};return n.value=e,n.attached=U9(),n}const dx=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,j9=(e,t,n,o,s,i)=>{const r=s==="svg";t==="class"?$9(e,o,r):t==="style"?R9(e,n,o):zd(t)?Qp(t)||H9(e,t,n,o,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):V9(e,t,o,r))?(ax(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&lx(e,t,o,r,i,t!=="value")):e._isVueCE&&(K9(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Cn(o)))?ax(e,No(t),o,i,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),lx(e,t,o,r))};function V9(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&dx(t)&&$t(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 dx(t)&&Cn(n)?!1:t in e}function K9(e,t){const n=e._def.props;if(!n)return!1;const o=No(t);return Array.isArray(n)?n.some(s=>No(s)===o):Object.keys(n).some(s=>No(s)===o)}const fx={};function G9(e,t,n){let o=Ze(e,t);Xp(o)&&(o=kn({},o,t));class s extends Ey{constructor(r){super(o,r,n)}}return s.def=o,s}const Xwe=((e,t)=>G9(e,t,dN)),Y9=typeof HTMLElement<"u"?HTMLElement:class{};class Ey extends Y9{constructor(t,n={},o=op){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!==op?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(kn({},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 Ey){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,mt(()=>{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&&!xt(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Dh(this._props[a])),(l||(l=Object.create(null)))[No(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)ln(this,o)||Object.defineProperty(this,o,{get:()=>C(n[o])})}_resolveProps(t){const{props:n}=t,o=xt(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(No))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):fx;const s=No(t);n&&this._numberProps&&this._numberProps[s]&&(o=Dh(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===fx?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(Is(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Is(t),n+""):n||this.removeAttribute(Is(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),uN(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=re(this._def,kn(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,Xp(r[0])?kn({detail:r},r[0]):{detail:r}))};o.emit=(i,...r)=>{s(i,r),Is(i)!==i&&s(Is(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 Z9(e){const t=Yo(),n=t&&t.ce;return n||null}function Jwe(){const e=Z9();return e&&e.shadowRoot}function e_e(e="$style"){{const t=Yo();if(!t)return Qt;const n=t.type.__cssModules;if(!n)return Qt;const o=n[e];return o||Qt}}const R3=new WeakMap,B3=new WeakMap,tp=Symbol("_moveCb"),hx=Symbol("_enterCb"),Q9=e=>(delete e.props.mode,e),X9=Q9({name:"TransitionGroup",props:kn({},I3,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yo(),o=V4();let s,i;return yy(()=>{if(!s.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!oN(s[0].el,n.vnode.el,r)){s=[];return}s.forEach(eN),s.forEach(tN);const l=s.filter(nN);zg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Zi(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[tp]=f=>{f&&f.target!==c||(!f||f.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[tp]=null,dl(c,r))};c.addEventListener("transitionend",d)}),s=[]}),()=>{const r=en(e),l=L3(r);let a=r.tag||Pe;if(s=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(s.push(u),Tl(u,kd(u,l,o,n)),R3.set(u,D3(u.el)))}i=t.default?gy(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&Tl(u,kd(u,l,o,n))}return re(a,null,i)}}}),J9=X9;function eN(e){const t=e.el;t[tp]&&t[tp](),t[hx]&&t[hx]()}function tN(e){B3.set(e,D3(e.el))}function nN(e){const t=R3.get(e),n=B3.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 D3(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function oN(e,t,n){const o=e.cloneNode(),s=e[Yc];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}=$3(o);return i.removeChild(o),r}const Ll=e=>{const t=e.props["onUpdate:modelValue"]||!1;return xt(t)?n=>Lc(t,n):t};function sN(e){e.target.composing=!0}function px(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const bi=Symbol("_assign");function mx(e,t,n){return t&&(e=e.trim()),n&&(e=nm(e)),e}const _s={created(e,{modifiers:{lazy:t,trim:n,number:o}},s){e[bi]=Ll(s);const i=o||s.props&&s.props.type==="number";Ir(e,t?"change":"input",r=>{r.target.composing||e[bi](mx(e.value,n,i))}),(n||i)&&Ir(e,"change",()=>{e.value=mx(e.value,n,i)}),t||(Ir(e,"compositionstart",sN),Ir(e,"compositionend",px),Ir(e,"change",px))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:s,number:i}},r){if(e[bi]=Ll(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?nm(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)}},np={deep:!0,created(e,t,n){e[bi]=Ll(n),Ir(e,"change",()=>{const o=e._modelValue,s=Zc(e),i=e.checked,r=e[bi];if(xt(o)){const l=sm(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(Ra(o)){const l=new Set(o);i?l.add(s):l.delete(s),r(l)}else r(H3(e,i))})},mounted:gx,beforeUpdate(e,t,n){e[bi]=Ll(n),gx(e,t,n)}};function gx(e,{value:t,oldValue:n},o){e._modelValue=t;let s;if(xt(t))s=sm(t,o.props.value)>-1;else if(Ra(t))s=t.has(o.props.value);else{if(t===n)return;s=Br(t,H3(e,!0))}e.checked!==s&&(e.checked=s)}const P3={created(e,{value:t},n){e.checked=Br(t,n.props.value),e[bi]=Ll(n),Ir(e,"change",()=>{e[bi](Zc(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[bi]=Ll(o),t!==n&&(e.checked=Br(t,o.props.value))}},qg={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const s=Ra(t);Ir(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?nm(Zc(r)):Zc(r));e[bi](e.multiple?s?new Set(i):i:i[0]),e._assigning=!0,mt(()=>{e._assigning=!1})}),e[bi]=Ll(o)},mounted(e,{value:t}){vx(e,t)},beforeUpdate(e,t,n){e[bi]=Ll(n)},updated(e,{value:t}){e._assigning||vx(e,t)}};function vx(e,t){const n=e.multiple,o=xt(t);if(!(n&&!o&&!Ra(t))){for(let s=0,i=e.options.length;s<i;s++){const r=e.options[s],l=Zc(r);if(n)if(o){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=sm(t,l)>-1}else r.selected=t.has(l);else if(Br(Zc(r),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zc(e){return"_value"in e?e._value:e.value}function H3(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const iN={created(e,t,n){Df(e,t,n,null,"created")},mounted(e,t,n){Df(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Df(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Df(e,t,n,o,"updated")}};function W3(e,t){switch(e){case"SELECT":return qg;case"TEXTAREA":return _s;default:switch(t){case"checkbox":return np;case"radio":return P3;default:return _s}}}function Df(e,t,n,o,s){const r=W3(e.tagName,n.props&&n.props.type)[s];r&&r(e,t,n,o)}function rN(){_s.getSSRProps=({value:e})=>({value:e}),P3.getSSRProps=({value:e},t)=>{if(t.props&&Br(t.props.value,e))return{checked:!0}},np.getSSRProps=({value:e},t)=>{if(xt(e)){if(t.props&&sm(e,t.props.value)>-1)return{checked:!0}}else if(Ra(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},iN.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=W3(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const lN=["ctrl","shift","alt","meta"],aN={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)=>lN.some(n=>e[`${n}Key`]&&!t.includes(n))},bt=(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=aN[t[r]];if(l&&l(s,t))return}return e(s,...i)}))},cN={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},nr=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=(s=>{if(!("key"in s))return;const i=Is(s.key);if(t.some(r=>r===i||cN[r]===i))return e(s)}))},z3=kn({patchProp:j9},T9);let ed,yx=!1;function U3(){return ed||(ed=a9(z3))}function q3(){return ed=yx?ed:c9(z3),yx=!0,ed}const uN=((...e)=>{U3().render(...e)}),t_e=((...e)=>{q3().hydrate(...e)}),op=((...e)=>{const t=U3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(!s)return;const i=t._component;!$t(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const r=n(s,!1,j3(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),r},t}),dN=((...e)=>{const t=q3().createApp(...e),{mount:n}=t;return t.mount=o=>{const s=V3(o);if(s)return n(s,!0,j3(s))},t});function j3(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function V3(e){return Cn(e)?document.querySelector(e):e}let kx=!1;const n_e=()=>{kx||(kx=!0,rN(),F9())};/*!
21
- * shared v11.4.5
22
- * (c) 2026 kazuya kawaguchi
23
- * Released under the MIT License.
24
- */function fN(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const sp=typeof window<"u",Bl=(e,t=!1)=>t?Symbol.for(e):Symbol(e),hN=(e,t,n)=>pN({l:e,k:t,s:n}),pN=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),wo=e=>typeof e=="number"&&isFinite(e),K3=e=>Ny(e)==="[object Date]",Qc=e=>Ny(e)==="[object RegExp]",mm=e=>Jt(e)&&Object.keys(e).length===0,_o=Object.assign,mN=Object.create,Sn=(e=null)=>mN(e);let bx;const ya=()=>bx||(bx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Sn());function xx(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 gN(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 vN=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,yN=/^(?:href|src|action|formaction)$/i;function Ty(e){return vN.test(e)}function kN(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+=Ty(d)?"url(about:blank)":e.slice(i,l+1),o=l+1}return n+e.slice(o)}function wx(e,t){if(yN.test(e)&&Ty(t))return"about:blank";const n=e.toLowerCase()==="style"?kN(t):t;return gN(n)}function bN(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,o,s)=>`${o}="${wx(o,s)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,o,s)=>`${o}='${wx(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)=>Ty(s)?`${o}about:blank`:n),e}const xN=Object.prototype.hasOwnProperty;function yi(e,t){return xN.call(e,t)}const io=Array.isArray,Kn=e=>typeof e=="function",yt=e=>typeof e=="string",nn=e=>typeof e=="boolean",on=e=>e!==null&&typeof e=="object",wN=e=>on(e)&&Kn(e.then)&&Kn(e.catch),G3=Object.prototype.toString,Ny=e=>G3.call(e),Jt=e=>Ny(e)==="[object Object]",_N=e=>e==null?"":io(e)||Jt(e)&&e.toString===G3?JSON.stringify(e,null,2):String(e);function Iy(e,t=""){return e.reduce((n,o,s)=>s===0?n+o:n+t+o,"")}const Pf=e=>!on(e)||io(e);function yh(e,t){if(Pf(e)||Pf(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__"&&(on(o[i])&&!on(s[i])&&(s[i]=Array.isArray(o[i])?[]:Sn()),Pf(s[i])||Pf(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 SN(e,t,n){return{line:e,column:t,offset:n}}function jg(e,t,n){return{start:e,end:t}}const hn={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},CN=17;function gm(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 AN(e){throw e}const Ki=" ",MN="\r",Qo=`
29
- `,EN="\u2028",TN="\u2029";function NN(e){const t=e;let n=0,o=1,s=1,i=0;const r=N=>t[N]===MN&&t[N+1]===Qo,l=N=>t[N]===Qo,a=N=>t[N]===TN,c=N=>t[N]===EN,u=N=>r(N)||l(N)||a(N)||c(N),d=()=>n,f=()=>o,h=()=>s,p=()=>i,g=N=>r(N)||a(N)||c(N)?Qo:t[N],b=()=>g(n),v=()=>g(n+i);function m(){return i=0,u(n)&&(o++,s=0),r(n)&&n++,n++,s++,t[n]}function y(){return r(n+i)&&i++,i++,t[n+i]}function k(){n=0,o=1,s=1,i=0}function A(N=0){i=N}function $(){const N=n+i;for(;N!==n;)m();i=0}return{index:d,line:f,column:h,peekOffset:p,charAt:g,currentChar:b,currentPeek:v,next:m,peek:y,reset:k,resetPeek:A,skipToPeek:$}}const vr=void 0,IN=".",_x="'",LN="tokenizer";function $N(e,t={}){const n=t.location!==!1,o=NN(e),s=()=>o.index(),i=()=>SN(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(j,te,pe,...Ce){const $e=c();if(te.column+=pe,te.offset+=pe,u){const De=n?jg($e.startLoc,te):null,me=gm(j,De,{domain:LN,args:Ce});u(me)}}function f(j,te,pe){j.endLoc=i(),j.currentType=te;const Ce={type:te};return n&&(Ce.loc=jg(j.startLoc,j.endLoc)),pe!=null&&(Ce.value=pe),Ce}const h=j=>f(j,13);function p(j,te){return j.currentChar()===te?(j.next(),te):(d(hn.EXPECTED_TOKEN,i(),0,te),"")}function g(j){let te="";for(;j.currentPeek()===Ki||j.currentPeek()===Qo;)te+=j.currentPeek(),j.peek();return te}function b(j){const te=g(j);return j.skipToPeek(),te}function v(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te===95}function m(j){if(j===vr)return!1;const te=j.charCodeAt(0);return te>=48&&te<=57}function y(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=v(j.currentPeek());return j.resetPeek(),Ce}function k(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=j.currentPeek()==="-"?j.peek():j.currentPeek(),$e=m(Ce);return j.resetPeek(),$e}function A(j,te){const{currentType:pe}=te;if(pe!==2)return!1;g(j);const Ce=j.currentPeek()===_x;return j.resetPeek(),Ce}function $(j,te){const{currentType:pe}=te;if(pe!==7)return!1;g(j);const Ce=j.currentPeek()===".";return j.resetPeek(),Ce}function N(j,te){const{currentType:pe}=te;if(pe!==8)return!1;g(j);const Ce=v(j.currentPeek());return j.resetPeek(),Ce}function x(j,te){const{currentType:pe}=te;if(!(pe===7||pe===11))return!1;g(j);const Ce=j.currentPeek()===":";return j.resetPeek(),Ce}function I(j,te){const{currentType:pe}=te;if(pe!==9)return!1;const Ce=()=>{const De=j.currentPeek();return De==="{"?v(j.peek()):De==="@"||De==="|"||De===":"||De==="."||De===Ki||!De?!1:De===Qo?(j.peek(),Ce()):F(j,!1)},$e=Ce();return j.resetPeek(),$e}function E(j){g(j);const te=j.currentPeek()==="|";return j.resetPeek(),te}function F(j,te=!0){const pe=($e=!1,De="")=>{const me=j.currentPeek();return me==="{"||me==="@"||!me?$e:me==="|"?!(De===Ki||De===Qo):me===Ki?(j.peek(),pe(!0,Ki)):me===Qo?(j.peek(),pe(!0,Qo)):!0},Ce=pe();return te&&j.resetPeek(),Ce}function S(j,te){const pe=j.currentChar();return pe===vr?vr:te(pe)?(j.next(),pe):null}function L(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36}function R(j){return S(j,L)}function D(j){const te=j.charCodeAt(0);return te>=97&&te<=122||te>=65&&te<=90||te>=48&&te<=57||te===95||te===36||te===45}function z(j){return S(j,D)}function H(j){const te=j.charCodeAt(0);return te>=48&&te<=57}function U(j){return S(j,H)}function Z(j){const te=j.charCodeAt(0);return te>=48&&te<=57||te>=65&&te<=70||te>=97&&te<=102}function K(j){return S(j,Z)}function V(j){let te="",pe="";for(;te=U(j);)pe+=te;return pe}function J(j){let te="";for(;;){const pe=j.currentChar();if(pe==="\\"){const Ce=j.peek();Ce==="{"||Ce==="}"||Ce==="@"||Ce==="|"||Ce==="\\"?(te+=pe+Ce,j.next(),j.next()):(j.resetPeek(),te+=pe,j.next())}else{if(pe==="{"||pe==="}"||pe==="@"||pe==="|"||!pe)break;if(pe===Ki||pe===Qo)if(F(j))te+=pe,j.next();else{if(E(j))break;te+=pe,j.next()}else te+=pe,j.next()}}return te}function fe(j){b(j);let te="",pe="";for(;te=z(j);)pe+=te;const Ce=j.currentChar();if(Ce&&Ce!=="}"&&Ce!==vr&&Ce!==Ki&&Ce!==Qo&&Ce!==" "){const $e=P(j);return d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe+$e),pe+$e}return j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe}function oe(j){b(j);let te="";return j.currentChar()==="-"?(j.next(),te+=`-${V(j)}`):te+=V(j),j.currentChar()===vr&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function ce(j){return j!==_x&&j!==Qo}function ue(j){b(j),p(j,"'");let te="",pe="";for(;te=S(j,ce);)te==="\\"?pe+=Se(j):pe+=te;const Ce=j.currentChar();return Ce===Qo||Ce===vr?(d(hn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ce===Qo&&(j.next(),p(j,"'")),pe):(p(j,"'"),pe)}function Se(j){const te=j.currentChar();switch(te){case"\\":case"'":return j.next(),`\\${te}`;case"u":return Te(j,te,4);case"U":return Te(j,te,6);default:return d(hn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,te),""}}function Te(j,te,pe){p(j,te);let Ce="";for(let $e=0;$e<pe;$e++){const De=K(j);if(!De){d(hn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${te}${Ce}${j.currentChar()}`);break}Ce+=De}return`\\${te}${Ce}`}function Ae(j){return j!=="{"&&j!=="}"&&j!==Ki&&j!==Qo}function P(j){b(j);let te="",pe="";for(;te=S(j,Ae);)pe+=te;return pe}function le(j){let te="",pe="";for(;te=R(j);)pe+=te;return pe}function ne(j){const te=pe=>{const Ce=j.currentChar();return Ce==="{"||Ce==="@"||Ce==="|"||Ce==="("||Ce===")"||!Ce||Ce===Ki?pe:(pe+=Ce,j.next(),te(pe))};return te("")}function q(j){b(j);const te=p(j,"|");return b(j),te}function ee(j,te){let pe=null;switch(j.currentChar()){case"{":return te.braceNest>=1&&d(hn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),j.next(),pe=f(te,2,"{"),b(j),te.braceNest++,pe;case"}":return te.braceNest>0&&te.currentType===2&&d(hn.EMPTY_PLACEHOLDER,i(),0),j.next(),pe=f(te,3,"}"),te.braceNest--,te.braceNest>0&&b(j),te.inLinked&&te.braceNest===0&&(te.inLinked=!1),pe;case"@":return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=ge(j,te)||h(te),te.braceNest=0,pe;default:{let $e=!0,De=!0,me=!0;if(E(j))return te.braceNest>0&&d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(te.braceNest>0&&(te.currentType===4||te.currentType===5||te.currentType===6))return d(hn.UNTERMINATED_CLOSING_BRACE,i(),0),te.braceNest=0,de(j,te);if($e=y(j,te))return pe=f(te,4,fe(j)),b(j),pe;if(De=k(j,te))return pe=f(te,5,oe(j)),b(j),pe;if(me=A(j,te))return pe=f(te,6,ue(j)),b(j),pe;if(!$e&&!De&&!me)return pe=f(te,12,P(j)),d(hn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,pe.value),b(j),pe;break}}return pe}function ge(j,te){const{currentType:pe}=te;let Ce=null;const $e=j.currentChar();switch((pe===7||pe===8||pe===11||pe===9)&&($e===Qo||$e===Ki)&&d(hn.INVALID_LINKED_FORMAT,i(),0),$e){case"@":return j.next(),Ce=f(te,7,"@"),te.inLinked=!0,Ce;case".":return b(j),j.next(),f(te,8,".");case":":return b(j),j.next(),f(te,9,":");default:return E(j)?(Ce=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,Ce):$(j,te)||x(j,te)?(b(j),ge(j,te)):N(j,te)?(b(j),f(te,11,le(j))):I(j,te)?(b(j),$e==="{"?ee(j,te)||Ce:f(te,10,ne(j))):(pe===7&&d(hn.INVALID_LINKED_FORMAT,i(),0),te.braceNest=0,te.inLinked=!1,de(j,te))}}function de(j,te){let pe={type:13};if(te.braceNest>0)return ee(j,te)||h(te);if(te.inLinked)return ge(j,te)||h(te);switch(j.currentChar()){case"{":return ee(j,te)||h(te);case"}":return d(hn.UNBALANCED_CLOSING_BRACE,i(),0),j.next(),f(te,3,"}");case"@":return ge(j,te)||h(te);default:{if(E(j))return pe=f(te,1,q(j)),te.braceNest=0,te.inLinked=!1,pe;if(F(j))return f(te,0,J(j));break}}return pe}function ve(){const{currentType:j,offset:te,startLoc:pe,endLoc:Ce}=a;return a.lastType=j,a.lastOffset=te,a.lastStartLoc=pe,a.lastEndLoc=Ce,a.offset=s(),a.startLoc=i(),o.currentChar()===vr?f(a,13):de(o,a)}return{nextToken:ve,currentOffset:s,currentPosition:i,context:c}}const FN="parser",ON=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,RN=/\\([\\@{}|])/g;function BN(e,t){return t}function DN(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 PN(e={}){const t=e.location!==!1,{onError:n}=e;function o(v,m,y,k,...A){const $=v.currentPosition();if($.offset+=k,$.column+=k,n){const N=t?jg(y,$):null,x=gm(m,N,{domain:FN,args:A});n(x)}}function s(v,m,y){const k={type:v};return t&&(k.start=m,k.end=m,k.loc={start:y,end:y}),k}function i(v,m,y,k){t&&(v.end=m,v.loc&&(v.loc.end=y))}function r(v,m){const y=v.context(),k=s(3,y.offset,y.startLoc);return k.value=m.replace(RN,BN),i(k,v.currentOffset(),v.currentPosition()),k}function l(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(5,k,A);return $.index=parseInt(m,10),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function a(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(4,k,A);return $.key=m,v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function c(v,m){const y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(9,k,A);return $.value=m.replace(ON,DN),v.nextToken(),i($,v.currentOffset(),v.currentPosition()),$}function u(v){const m=v.nextToken(),y=v.context(),{lastOffset:k,lastStartLoc:A}=y,$=s(8,k,A);return m.type!==11?(o(v,hn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),$.value="",i($,k,A),{nextConsumeToken:m,node:$}):(m.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(m)),$.value=m.value||"",i($,v.currentOffset(),v.currentPosition()),{node:$})}function d(v,m){const y=v.context(),k=s(7,y.offset,y.startLoc);return k.value=m,i(k,v.currentOffset(),v.currentPosition()),k}function f(v){const m=v.context(),y=s(6,m.offset,m.startLoc);let k=v.nextToken();if(k.type===8){const A=u(v);y.modifier=A.node,k=A.nextConsumeToken||v.nextToken()}switch(k.type!==9&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),k=v.nextToken(),k.type===2&&(k=v.nextToken()),k.type){case 10:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=d(v,k.value||"");break;case 4:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=a(v,k.value||"");break;case 5:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=l(v,k.value||"");break;case 6:k.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(k)),y.key=c(v,k.value||"");break;default:{o(v,hn.UNEXPECTED_EMPTY_LINKED_KEY,m.lastStartLoc,0);const A=v.context(),$=s(7,A.offset,A.startLoc);return $.value="",i($,A.offset,A.startLoc),y.key=$,i(y,A.offset,A.startLoc),{nextConsumeToken:k,node:y}}}return i(y,v.currentOffset(),v.currentPosition()),{node:y}}function h(v){const m=v.context(),y=m.currentType===1?v.currentOffset():m.offset,k=m.currentType===1?m.endLoc:m.startLoc,A=s(2,y,k);A.items=[];let $=null;do{const I=$||v.nextToken();switch($=null,I.type){case 0:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(r(v,I.value||""));break;case 5:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(l(v,I.value||""));break;case 4:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(a(v,I.value||""));break;case 6:I.value==null&&o(v,hn.UNEXPECTED_LEXICAL_ANALYSIS,m.lastStartLoc,0,Gi(I)),A.items.push(c(v,I.value||""));break;case 7:{const E=f(v);A.items.push(E.node),$=E.nextConsumeToken||null;break}}}while(m.currentType!==13&&m.currentType!==1);const N=m.currentType===1?m.lastOffset:v.currentOffset(),x=m.currentType===1?m.lastEndLoc:v.currentPosition();return i(A,N,x),A}function p(v,m,y,k){const A=v.context();let $=k.items.length===0;const N=s(1,m,y);N.cases=[],N.cases.push(k);do{const x=h(v);$||($=x.items.length===0),N.cases.push(x)}while(A.currentType!==13);return $&&o(v,hn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),i(N,v.currentOffset(),v.currentPosition()),N}function g(v){const m=v.context(),{offset:y,startLoc:k}=m,A=h(v);return m.currentType===13?A:p(v,y,k,A)}function b(v){const m=$N(v,_o({},e)),y=m.context(),k=s(0,y.offset,y.startLoc);return t&&k.loc&&(k.loc.source=v),k.body=g(m),e.onCacheKey&&(k.cacheKey=e.onCacheKey(v)),y.currentType!==13&&o(m,hn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,v[y.offset]||""),i(k,m.currentOffset(),m.currentPosition()),k}return{parse:b}}function Gi(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 HN(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Sx(e,t){for(let n=0;n<e.length;n++)Ly(e[n],t)}function Ly(e,t){switch(e.type){case 1:Sx(e.cases,t),t.helper("plural");break;case 2:Sx(e.items,t);break;case 6:{Ly(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 WN(e,t={}){const n=HN(e);n.helper("normalize"),e.body&&Ly(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function zN(e){const t=e.body;return t.type===2?Cx(t):t.cases.forEach(n=>Cx(n)),e}function Cx(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=Iy(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 gc(e){switch(e.t=e.type,e.type){case 0:{const t=e;gc(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++)gc(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++)gc(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;gc(t.key),t.k=t.key,delete t.key,t.modifier&&(gc(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 UN(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(g,b){r.code+=g}function c(g,b=!0){const v=b?o:"";a(s?v+" ".repeat(g):v)}function u(g=!0){const b=++r.indentLevel;g&&c(b)}function d(g=!0){const b=--r.indentLevel;g&&c(b)}function f(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function qN(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Xc(e,t.key),t.modifier?(e.push(", "),Xc(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function jN(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&&(Xc(e,t.items[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}function VN(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&&(Xc(e,t.cases[i]),i!==s-1);i++)e.push(", ");e.deindent(o()),e.push("])")}}function KN(e,t){t.body?Xc(e,t.body):e.push("null")}function Xc(e,t){const{helper:n}=e;switch(t.type){case 0:KN(e,t);break;case 1:VN(e,t);break;case 2:jN(e,t);break;case 6:qN(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 GN=(e,t={})=>{const n=yt(t.mode)?t.mode:"normal",o=yt(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=UN(e,{filename:o,breakLineCode:s,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${Iy(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),Xc(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 YN(e,t={}){const n=_o({},t),o=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,l=PN(n).parse(e);return o?(i&&zN(l),s&&gc(l),{ast:l,code:""}):(WN(l,n),GN(l,n))}/*!
31
- * core-base v11.4.5
32
- * (c) 2026 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */function ZN(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function sr(e){return on(e)&&$y(e)===0&&(yi(e,"b")||yi(e,"body"))}const Y3=["b","body"];function QN(e){return Dl(e,Y3)}const Z3=["c","cases"];function XN(e){return Dl(e,Z3,[])}const Q3=["s","static"];function JN(e){return Dl(e,Q3)}const X3=["i","items"];function e7(e){return Dl(e,X3,[])}const J3=["t","type"];function $y(e){return Dl(e,J3)}const eA=["v","value"];function Hf(e,t){const n=Dl(e,eA);if(n!=null)return n;throw _d(t)}const tA=["m","modifier"];function t7(e){return Dl(e,tA)}const nA=["k","key"];function n7(e){const t=Dl(e,nA);if(t)return t;throw _d(6)}function Dl(e,t,n){for(let o=0;o<t.length;o++){const s=t[o];if(yi(e,s)&&e[s]!=null)return e[s]}return n}const oA=[...Y3,...Z3,...Q3,...X3,...nA,...tA,...eA,...J3];function _d(e){return new Error(`unhandled node type: ${e}`)}function r0(e){return n=>o7(n,e)}function o7(e,t){const n=QN(t);if(n==null)throw _d(0);if($y(n)===1){const i=XN(n);return e.plural(i.reduce((r,l)=>[...r,Ax(e,l)],[]))}else return Ax(e,n)}function Ax(e,t){const n=JN(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=e7(t).reduce((s,i)=>[...s,Vg(e,i)],[]);return e.normalize(o)}}function Vg(e,t){const n=$y(t);switch(n){case 3:return Hf(t,n);case 9:return Hf(t,n);case 4:{const o=t;if(yi(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(yi(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw _d(n)}case 5:{const o=t;if(yi(o,"i")&&wo(o.i))return e.interpolate(e.list(o.i));if(yi(o,"index")&&wo(o.index))return e.interpolate(e.list(o.index));throw _d(n)}case 6:{const o=t,s=t7(o),i=n7(o);return e.linked(Vg(e,i),s?Vg(e,s):void 0,e.type)}case 7:return Hf(t,n);case 8:return Hf(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const s7=e=>e;let Wf=Sn();function i7(e,t={}){let n=!1;const o=t.onError||AN;return t.onError=s=>{n=!0,o(s)},{...YN(e,t),detectError:n}}function r7(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yt(e)){nn(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||s7)(e),s=Wf[o];if(s)return s;const{ast:i,detectError:r}=i7(e,{...t,location:!1,jit:!0}),l=r0(i);return r?l:Wf[o]=l}else{const n=e.cacheKey;if(n){const o=Wf[n];return o||(Wf[n]=r0(e))}else return r0(e)}}let Sd=null;function l7(e){Sd=e}function a7(e,t,n){Sd&&Sd.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const c7=u7("function:translate");function u7(e){return t=>Sd&&Sd.emit(e,t)}const Lr={INVALID_ARGUMENT:CN,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},d7=24;function $r(e){return gm(e,null,void 0)}function Fy(e,t){return t.locale!=null?Mx(t.locale):Mx(e.locale)}let l0;function Mx(e){if(yt(e))return e;if(Kn(e)){if(e.resolvedOnce&&l0!=null)return l0;if(e.constructor.name==="Function"){const t=e();if(wN(t))throw $r(Lr.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return l0=t}else throw $r(Lr.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw $r(Lr.NOT_SUPPORT_LOCALE_TYPE)}function f7(e,t,n){return[...new Set([n,...io(t)?t:on(t)?Object.keys(t):yt(t)?[t]:[n]])]}function Kg(e,t,n){const o=yt(n)?n:Cd,s=e;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(o);if(!i){i=[];let r=[n];for(;io(r);)r=Ex(i,r,t);const l=io(t)||!Jt(t)?t:t.default?t.default:null;r=yt(l)?[l]:l,io(r)&&Ex(i,r,!1),s.__localeChainCache.set(o,i)}return i}function Ex(e,t,n){let o=!0;for(let s=0;s<t.length&&nn(o);s++){const i=t[s];yt(i)&&(o=h7(e,t[s],n))}return o}function h7(e,t,n){let o;const s=t.split("-");do{const i=s.join("-");o=p7(e,i,n),s.splice(-1,1)}while(s.length&&o===!0);return o}function p7(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),(io(n)||Jt(n))&&n[s]&&(o=n[s])}return o}const Pl=[];Pl[0]={w:[0],i:[3,0],"[":[4],o:[7]};Pl[1]={w:[1],".":[2],"[":[4],o:[7]};Pl[2]={w:[2],i:[3,0],0:[3,0]};Pl[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Pl[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Pl[5]={"'":[4,0],o:8,l:[5,0]};Pl[6]={'"':[4,0],o:8,l:[6,0]};const m7=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function g7(e){return m7.test(e)}function v7(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 y7(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 k7(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:g7(t)?v7(t):"*"+t}function b7(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=k7(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=y7(i),d=Pl[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 Tx=new Map;function x7(e,t){return on(e)?e[t]:null}function w7(e,t){if(!on(e))return null;let n=Tx.get(t);if(n||(n=b7(t),n&&Tx.set(t,n)),!n)return null;const o=n.length;let s=e,i=0;for(;i<o;){const r=n[i];if(oA.includes(r)&&sr(s)||!on(s)||!yi(s,r))return null;const l=s[r];if(l===void 0||Kn(s))return null;s=l,i++}return s}const _7="11.4.5",vm=-1,Cd="en-US",ip="",Nx=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function S7(){return{upper:(e,t)=>t==="text"&&yt(e)?e.toUpperCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yt(e)?e.toLowerCase():t==="vnode"&&on(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yt(e)?Nx(e):t==="vnode"&&on(e)&&"__v_isVNode"in e?Nx(e.children):e}}let sA;function C7(e){sA=e}let iA;function A7(e){iA=e}let rA;function M7(e){rA=e}let lA=null;const E7=e=>{lA=e},T7=()=>lA;let aA=null;const Ix=e=>{aA=e},N7=()=>aA;let Lx=0;function I7(e={}){const t=Kn(e.onWarn)?e.onWarn:fN,n=yt(e.version)?e.version:_7,o=yt(e.locale)||Kn(e.locale)?e.locale:Cd,s=Kn(o)?Cd:o,i=io(e.fallbackLocale)||Jt(e.fallbackLocale)||yt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s,r=Jt(e.messages)?e.messages:a0(s),l=Jt(e.datetimeFormats)?e.datetimeFormats:a0(s),a=Jt(e.numberFormats)?e.numberFormats:a0(s),c=_o(Sn(),e.modifiers,S7()),u=e.pluralRules||Sn(),d=Kn(e.missing)?e.missing:null,f=nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,g=!!e.unresolving,b=Kn(e.postTranslation)?e.postTranslation:null,v=Jt(e.processor)?e.processor:null,m=nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,k=Kn(e.messageCompiler)?e.messageCompiler:sA,A=Kn(e.messageResolver)?e.messageResolver:iA||x7,$=Kn(e.localeFallbacker)?e.localeFallbacker:rA||f7,N=on(e.fallbackContext)?e.fallbackContext:void 0,x=e,I=on(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,E=on(x.__numberFormatters)?x.__numberFormatters:new Map,F=on(x.__meta)?x.__meta:{};Lx++;const S={version:n,cid:Lx,locale:o,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:p,unresolving:g,postTranslation:b,processor:v,warnHtmlMessage:m,escapeParameter:y,messageCompiler:k,messageResolver:A,localeFallbacker:$,fallbackContext:N,onWarn:t,__meta:F};return S.datetimeFormats=l,S.numberFormats=a,S.__datetimeFormatters=I,S.__numberFormatters=E,__INTLIFY_PROD_DEVTOOLS__&&a7(S,n,F),S}const a0=e=>({[e]:Sn()});function Oy(e,t,n,o,s){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,s);return yt(l)?l:t}else return t}function $u(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function L7(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function $7(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(L7(e,t[o]))return!0;return!1}function $x(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!yt(t[0])&&!K3(t[0])&&!wo(t[0]))return ip;const[a,c,u,d]=Gg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Fy(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.DateTimeFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="datetime format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)Oy(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?vm:a;let k=`${v}__${a}`;mm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.DateTimeFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const cA=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Gg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn(),l;if(yt(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw $r(Lr.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 $r(Lr.INVALID_ISO_DATE_ARGUMENT)}}else if(K3(t)){if(isNaN(t.getTime()))throw $r(Lr.INVALID_DATE_ARGUMENT);l=t}else if(wo(t))l=t;else throw $r(Lr.INVALID_ARGUMENT);return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{cA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Fx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__datetimeFormatters.has(i)&&o.__datetimeFormatters.delete(i)}}function Ox(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:s,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!wo(t[0]))return ip;const[a,c,u,d]=Yg(...t),f=nn(u.missingWarn)?u.missingWarn:e.missingWarn;nn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const h=!!u.part,p=Fy(e,u),g=r(e,s,p);if(!yt(a)||a===""){const $=new Intl.NumberFormat(p.replace(/!/g,""),d);return h?$.formatToParts(c):$.format(c)}let b={},v,m=null;const y="number format";for(let $=0;$<g.length&&(v=g[$],b=n[v]||{},m=b[a],!Jt(m));$++)Oy(e,a,v,f,y);if(!Jt(m)||!yt(v))return o?vm:a;let k=`${v}__${a}`;mm(d)||(k=`${k}__${JSON.stringify(d)}`);let A=l.get(k);return A||(A=new Intl.NumberFormat(v,_o({},m,d)),l.set(k,A)),h?A.formatToParts(c):A.format(c)}const uA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Yg(...e){const[t,n,o,s]=e,i=Sn();let r=Sn();if(!wo(t))throw $r(Lr.INVALID_ARGUMENT);const l=t;return yt(n)?i.key=n:Jt(n)&&Object.keys(n).forEach(a=>{uA.includes(a)?r[a]=n[a]:i[a]=n[a]}),yt(o)?i.locale=o:Jt(o)&&(r=o),Jt(s)&&(r=s),[i.key||"",l,i,r]}function Rx(e,t,n){const o=e;for(const s in n){const i=`${t}__${s}`;o.__numberFormatters.has(i)&&o.__numberFormatters.delete(i)}}const F7=e=>e,O7=e=>"",R7="text",B7=e=>e.length===0?"":Iy(e),D7=_N;function c0(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function P7(e){const t=wo(e.pluralIndex)?e.pluralIndex:-1;return wo(e.named?.count)?e.named.count:wo(e.named?.n)?e.named.n:t}function H7(e={}){const t=e.locale,n=P7(e),o=yt(t)&&Kn(e.pluralRules?.[t])?e.pluralRules[t]:c0,s=o===c0?void 0:c0,i=v=>v[o(n,v.length,s)],r=e.list||[],l=v=>r[v],a=e.named||Sn();wo(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=v=>a[v];function u(v,m){const y=Kn(e.messages)?e.messages(v,!!m):on(e.messages)?e.messages[v]:!1;return y||(e.parent?e.parent.message(v):O7)}const d=v=>e.modifiers?e.modifiers[v]:F7,f=Kn(e.processor?.normalize)?e.processor.normalize:B7,h=Kn(e.processor?.interpolate)?e.processor.interpolate:D7,p=yt(e.processor?.type)?e.processor.type:R7,b={list:l,named:c,plural:i,linked:(v,...m)=>{const[y,k]=m;let A="text",$="";m.length===1?on(y)?($=y.modifier||$,A=y.type||A):yt(y)&&($=y||$):m.length===2&&(yt(y)&&($=y||$),yt(k)&&(A=k||A));const N=u(v,!0)(b),x=N===""||N===void 0?v:N,I=A==="vnode"&&io(x)&&$?x[0]:x;return $?d($)(I,A):I},message:u,type:p,interpolate:h,normalize:f,values:_o(Sn(),r,a)};return b}const Bx=()=>"",hi=e=>Kn(e);function Dx(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:s,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=Zg(...t),u=nn(c.missingWarn)?c.missingWarn:e.missingWarn,d=nn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=nn(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,p=yt(c.default)||nn(c.default)?nn(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,g=n||p!=null&&(yt(p)||Kn(p)),b=Fy(e,c);f&&W7(c);let[v,m,y]=h?[a,b,l[b]||Sn()]:dA(e,a,b,r,d,u),k=v,A=a;if(!h&&!(yt(k)||sr(k)||hi(k))&&g&&(k=p,A=k),!h&&(!(yt(k)||sr(k)||hi(k))||!yt(m)))return s?vm:a;let $=!1;const N=()=>{$=!0},x=hi(k)?k:fA(e,a,m,k,A,N);if($)return k;const I=q7(e,m,y,c),E=H7(I),F=z7(e,x,E);let S=o?o(F,a):F;if(f&&yt(S)&&(S=bN(S)),__INTLIFY_PROD_DEVTOOLS__){const L={timestamp:Date.now(),key:yt(a)?a:hi(k)?k.key:"",locale:m||(hi(k)?k.locale:""),format:yt(k)?k:hi(k)?k.source:"",message:S};L.meta=_o({},e.__meta,T7()||{}),c7(L)}return S}function W7(e){io(e.list)?e.list=e.list.map(t=>yt(t)?xx(t):t):on(e.named)&&Object.keys(e.named).forEach(t=>{yt(e.named[t])&&(e.named[t]=xx(e.named[t]))})}function dA(e,t,n,o,s,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,o,n);let d=Sn(),f,h=null;const p="translate";for(let g=0;g<u.length&&(f=u[g],d=r[f]||Sn(),(h=a(d,t))===null&&(h=d[t]),!(yt(h)||sr(h)||hi(h)));g++)if(!$7(f,u)){const b=Oy(e,t,f,i,p);b!==t&&(h=b)}return[h,f,d]}function fA(e,t,n,o,s,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(hi(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,U7(e,n,s,o,l,i));return a.locale=n,a.key=t,a.source=o,a}function z7(e,t,n){return t(n)}function Zg(...e){const[t,n,o]=e,s=Sn();if(!yt(t)&&!wo(t)&&!hi(t)&&!sr(t))throw $r(Lr.INVALID_ARGUMENT);const i=wo(t)?String(t):(hi(t),t);return wo(n)?s.plural=n:yt(n)?s.default=n:Jt(n)&&!mm(n)?s.named=n:io(n)&&(s.list=n),wo(o)?s.plural=o:yt(o)?s.default=o:Jt(o)&&_o(s,o),[i,s]}function U7(e,t,n,o,s,i){return{locale:t,key:n,warnHtmlMessage:s,onError:r=>{throw i&&i(r),r},onCacheKey:r=>hN(t,n,r)}}function q7(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 g=r(n,h);if(g==null&&(u||p)){const[b,,v]=dA(u||e,h,t,l,a,c);g=b??r(v,h)}if(yt(g)||sr(g)){let b=!1;const m=fA(e,h,t,g,h,()=>{b=!0});return b?Bx:m}else return hi(g)?g:Bx}};return e.processor&&(f.processor=e.processor),o.list&&(f.list=o.list),o.named&&(f.named=o.named),wo(o.plural)&&(f.pluralIndex=o.plural),f}ZN();/*!
35
- * vue-i18n v11.4.5
36
- * (c) 2026 kazuya kawaguchi
37
- * Released under the MIT License.
38
- */const j7="11.4.5";function V7(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ya().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ya().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ya().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ya().__INTLIFY_PROD_DEVTOOLS__=!1)}const vs={UNEXPECTED_RETURN_TYPE:d7,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 Ls(e,...t){return gm(e,null,void 0)}const Qg=Bl("__translateVNode"),Xg=Bl("__datetimeParts"),Jg=Bl("__numberParts"),hA=Bl("__setPluralRules"),pA=Bl("__injectWithOption"),_c=Bl("__dispose");function Ad(e){if(!on(e)||sr(e))return e;for(const t in e)if(yi(e,t))if(!t.includes("."))on(e[t])&&Ad(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]]=Sn()),!on(s[n[r]])){i=!0;break}s=s[n[r]]}if(i||(sr(s)?oA.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!sr(s)){const r=s[n[o]];on(r)&&Ad(r)}}return e}function Ry(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:i}=t,r=Jt(n)?n:io(o)?Sn():{[e]:Sn()};if(io(o)&&o.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Sn(),yh(c,r[a])):yh(c,r)}else yt(l)&&yh(JSON.parse(l),r)}),s==null&&i)for(const l in r)yi(r,l)&&Ad(r[l]);return r}function mA(e){return e.type}function gA(e,t,n){let o=on(t.messages)?t.messages:Sn();"__i18nGlobal"in n&&(o=Ry(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(i=>{e.mergeLocaleMessage(i,o[i])});{if(on(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(on(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function Px(e){return re(Sl,null,e,0)}function Md(){return Yo()}const Hx="__INTLIFY_META__",Wx=()=>[],K7=()=>!1;let zx=0;function Ux(e){return((t,n,o,s)=>e(n,o,Md()||void 0,s))}const G7=()=>{const e=Md();let t=null;return e&&(t=mA(e)[Hx])?{[Hx]:t}:null};function rp(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,s=e.flatJson,i=sp?X:Ba;let r=nn(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:yt(e.locale)?e.locale:Cd),a=i(t&&r?t.fallbackLocale.value:yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Ry(l.value,e)),u=i(Jt(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(Jt(e.numberFormats)?e.numberFormats:{[l.value]:{}});let f=t?t.missingWarn:nn(e.missingWarn)||Qc(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:nn(e.fallbackWarn)||Qc(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:nn(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,b=Kn(e.missing)?e.missing:null,v=Kn(e.missing)?Ux(e.missing):null,m=Kn(e.postTranslation)?e.postTranslation:null,y=t?t.warnHtmlMessage:nn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,k=!!e.escapeParameter;const A=t?t.modifiers:Jt(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,N;N=(()=>{o&&Ix(null);const me={version:j7,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:A,pluralRules:$,missing:v===null?void 0:v,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:m===null?void 0:m,warnHtmlMessage:y,escapeParameter:k,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};me.datetimeFormats=u.value,me.numberFormats=d.value,me.__datetimeFormatters=Jt(N)?N.__datetimeFormatters:void 0,me.__numberFormatters=Jt(N)?N.__numberFormatters:void 0;const Ie=I7(me);return o&&Ix(Ie),Ie})(),$u(N,l.value,a.value);function I(){return[l.value,a.value,c.value,u.value,d.value]}const E=B({get:()=>l.value,set:me=>{N.locale=me,l.value=me}}),F=B({get:()=>a.value,set:me=>{N.fallbackLocale=me,a.value=me,$u(N,l.value,me)}}),S=B(()=>c.value),L=B(()=>u.value),R=B(()=>d.value);function D(){return Kn(m)?m:null}function z(me){m=me,N.postTranslation=me}function H(){return b}function U(me){me!==null&&(v=Ux(me)),b=me,N.missing=v}const Z=(me,Ie,et,rt,_t,gt)=>{I();let It;try{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=t?N7():void 0),It=me(N)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(N.fallbackContext=void 0)}if(et!=="translate exists"&&wo(It)&&It===vm||et==="translate exists"&&!It){const[Ut,ht]=Ie();return t&&p?rt(t):_t(Ut)}else{if(gt(It))return It;throw Ls(vs.UNEXPECTED_RETURN_TYPE)}};function K(...me){return Z(Ie=>Reflect.apply(Dx,null,[Ie,...me]),()=>Zg(...me),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...me]),Ie=>Ie,Ie=>yt(Ie))}function V(...me){const[Ie,et,rt]=me;if(rt&&!on(rt))throw Ls(vs.INVALID_ARGUMENT);return K(Ie,et,_o({resolvedMessage:!0},rt||{}))}function J(...me){return Z(Ie=>Reflect.apply($x,null,[Ie,...me]),()=>Gg(...me),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...me]),()=>ip,Ie=>yt(Ie)||io(Ie))}function fe(...me){return Z(Ie=>Reflect.apply(Ox,null,[Ie,...me]),()=>Yg(...me),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...me]),()=>ip,Ie=>yt(Ie)||io(Ie))}function oe(me){return me.map(Ie=>yt(Ie)||wo(Ie)||nn(Ie)?Px(String(Ie)):Ie)}const ue={normalize:oe,interpolate:me=>me,type:"vnode"};function Se(...me){return Z(Ie=>{let et;const rt=Ie;try{rt.processor=ue,et=Reflect.apply(Dx,null,[rt,...me])}finally{rt.processor=null}return et},()=>Zg(...me),"translate",Ie=>Ie[Qg](...me),Ie=>[Px(Ie)],Ie=>io(Ie))}function Te(...me){return Z(Ie=>Reflect.apply(Ox,null,[Ie,...me]),()=>Yg(...me),"number format",Ie=>Ie[Jg](...me),Wx,Ie=>yt(Ie)||io(Ie))}function Ae(...me){return Z(Ie=>Reflect.apply($x,null,[Ie,...me]),()=>Gg(...me),"datetime format",Ie=>Ie[Xg](...me),Wx,Ie=>yt(Ie)||io(Ie))}function P(me){$=me,N.pluralRules=$}function le(me,Ie){return Z(()=>{if(!me)return!1;const et=yt(Ie)?Ie:l.value,rt=yt(Ie)?[et]:Kg(N,a.value,et);for(let _t=0;_t<rt.length;_t++){const gt=ee(rt[_t]);let It=N.messageResolver(gt,me);if(It===null&&(It=gt[me]),sr(It)||hi(It)||yt(It))return!0}return!1},()=>[me],"translate exists",et=>Reflect.apply(et.te,et,[me,Ie]),K7,et=>nn(et))}function ne(me){let Ie=null;const et=Kg(N,a.value,l.value);for(let rt=0;rt<et.length;rt++){const _t=c.value[et[rt]]||{},gt=N.messageResolver(_t,me);if(gt!=null){Ie=gt;break}}return Ie}function q(me){const Ie=ne(me);return Ie??(t?t.tm(me)||{}:{})}function ee(me){return c.value[me]||{}}function ge(me,Ie){if(s){const et={[me]:Ie};for(const rt in et)yi(et,rt)&&Ad(et[rt]);Ie=et[me]}c.value[me]=Ie,N.messages=c.value}function de(me,Ie){c.value[me]=c.value[me]||{};const et={[me]:Ie};if(s)for(const rt in et)yi(et,rt)&&Ad(et[rt]);Ie=et[me],yh(Ie,c.value[me]),N.messages=c.value}function ve(me){return u.value[me]||{}}function j(me,Ie){u.value[me]=Ie,N.datetimeFormats=u.value,Fx(N,me,Ie)}function te(me,Ie){u.value[me]=_o(u.value[me]||{},Ie),N.datetimeFormats=u.value,Fx(N,me,Ie)}function pe(me){return d.value[me]||{}}function Ce(me,Ie){d.value[me]=Ie,N.numberFormats=d.value,Rx(N,me,Ie)}function $e(me,Ie){d.value[me]=_o(d.value[me]||{},Ie),N.numberFormats=d.value,Rx(N,me,Ie)}zx++,t&&sp&&(Qe(t.locale,me=>{r&&(l.value=me,N.locale=me,$u(N,l.value,a.value))}),Qe(t.fallbackLocale,me=>{r&&(a.value=me,N.fallbackLocale=me,$u(N,l.value,a.value))}));const De={id:zx,locale:E,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(me){r=me,me&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,$u(N,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:S,get modifiers(){return A},get pluralRules(){return $||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(me){f=me,N.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(me){h=me,N.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(me){p=me},get fallbackFormat(){return g},set fallbackFormat(me){g=me,N.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(me){y=me,N.warnHtmlMessage=me},get escapeParameter(){return k},set escapeParameter(me){k=me,N.escapeParameter=me},t:K,getLocaleMessage:ee,setLocaleMessage:ge,mergeLocaleMessage:de,getPostTranslationHandler:D,setPostTranslationHandler:z,getMissingHandler:H,setMissingHandler:U,[hA]:P};return De.datetimeFormats=L,De.numberFormats=R,De.rt=V,De.te=le,De.tm=q,De.d=J,De.n=fe,De.getDateTimeFormat=ve,De.setDateTimeFormat=j,De.mergeDateTimeFormat=te,De.getNumberFormat=pe,De.setNumberFormat=Ce,De.mergeNumberFormat=$e,De[pA]=n,De[Qg]=Se,De[Xg]=Ae,De[Jg]=Te,De}function Y7(e){const t=yt(e.locale)?e.locale:Cd,n=yt(e.fallbackLocale)||io(e.fallbackLocale)||Jt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Kn(e.missing)?e.missing:void 0,s=nn(e.silentTranslationWarn)||Qc(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=nn(e.silentFallbackWarn)||Qc(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=nn(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=Jt(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Kn(e.postTranslation)?e.postTranslation:void 0,d=yt(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=nn(e.sync)?e.sync:!0;let p=e.messages;if(Jt(e.sharedMessages)){const A=e.sharedMessages;p=Object.keys(A).reduce((N,x)=>{const I=N[x]||(N[x]={});return _o(I,A[x]),N},p||{})}const{__i18n:g,__root:b,__injectWithOption:v}=e,m=e.datetimeFormats,y=e.numberFormats,k=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:k,datetimeFormats:m,numberFormats:y,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:g,__root:b,__injectWithOption:v}}function ev(e={}){const t=rp(Y7(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 nn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=nn(s)?!s:s},get silentFallbackWarn(){return nn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=nn(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 Z7(e,t,n){return{beforeCreate(){const o=Md();if(!o)throw Ls(vs.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=qx(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=ev(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=qx(e,s);else{this.$i18n=ev({__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&&gA(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=Md();if(!o)throw Ls(vs.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 qx(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[hA](t.pluralizationRules||e.pluralizationRules);const n=Ry(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 By={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Q7({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pe?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},Sn())}function vA(){return Pe}const X7=Ze({name:"i18n-t",props:_o({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>wo(e)||!isNaN(e)}},By),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Sn();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=yt(e.plural)?+e.plural:e.plural);const u=Q7(t,a);return s[Qg](e.keypath,u,c)},r=_o(Sn(),o),l=yt(e.tag)||on(e.tag)?e.tag:vA();return on(l)?mn(l,r,{default:i}):mn(l,r,i())}}}),jx=X7;function J7(e){return io(e)&&!yt(e[0])}function yA(e,t,n,o){const{slots:s,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Sn();e.locale&&(c.locale=e.locale),yt(e.format)?c.key=e.format:on(e.format)&&(yt(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((h,p)=>n.includes(p)?_o(Sn(),h,{[p]:e.format[p]}):h,Sn()));const d=o(e.value,c,u);let f=[c.key];return io(d)?f=d.map((h,p)=>{const g=s[h.type],b=g?g({[h.type]:h.value,index:p,parts:d}):[h.value];return J7(b)&&(b[0].key=`${h.type}-${p}`),b}):yt(d)&&(f=[d]),f},l=_o(Sn(),i),a=yt(e.tag)||on(e.tag)?e.tag:vA();return on(a)?mn(a,l,{default:r}):mn(a,l,r())}}const eI=Ze({name:"i18n-n",props:_o({value:{type:Number,required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,uA,(...o)=>n[Jg](...o))}}),Vx=eI;function tI(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 nI(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Ls(vs.UNEXPECTED_ERROR);const c=tI(e,l.$),u=Kx(a);return[Reflect.apply(c.t,c,[...Gx(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);sp&&(r.__i18nWatcher=Qe(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{sp&&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=Kx(l);r.textContent=Reflect.apply(a.t,a,[...Gx(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Kx(e){if(yt(e))return{path:e};if(Jt(e)){if(!("path"in e))throw Ls(vs.REQUIRED_VALUE,"path");return e}else throw Ls(vs.INVALID_VALUE)}function Gx(e){const{path:t,locale:n,args:o,choice:s,plural:i}=e,r={},l=o||{};return yt(n)&&(r.locale=n),wo(s)&&(r.plural=s),wo(i)&&(r.plural=i),[t,l,r]}function oI(e,t,...n){const o=Jt(n[0])?n[0]:{};(nn(o.globalInstall)?o.globalInstall:!0)&&([jx.name,"I18nT"].forEach(i=>e.component(i,jx)),[Vx.name,"I18nN"].forEach(i=>e.component(i,Vx)),[Qx.name,"I18nD"].forEach(i=>e.component(i,Qx))),e.directive("t",nI(t))}const sI=Bl("global-vue-i18n");function iI(e={}){const t=__VUE_I18N_LEGACY_API__&&nn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=nn(e.globalInjection)?e.globalInjection:!0,o=new Map,[s,i]=rI(e,t),r=Bl("");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),Jt(f[0])){const g=f[0];u.__composerExtend=g.__composerExtend,u.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=hI(d,u.global)),__VUE_I18N_FULL_INSTALL__&&oI(d,u,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(Z7(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 Tt(e={}){const t=Md();if(t==null)throw Ls(vs.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ls(vs.NOT_INSTALLED);const n=lI(t),o=cI(n),s=mA(t),i=aI(e,s);if(i==="global")return gA(o,e,s),o;if(i==="parent"){let a=Yx(n,t,e.__useComponent);return a==null&&(a=o),a}if(i==="isolated"){if(n.mode!=="composition")throw Ls(vs.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=_o({},e),u=Yx(n,t);c.__root=u||o;const d=rp(c);return a.__composerExtend&&(d[_c]=a.__composerExtend(d)),uy()&&dy(()=>{const h=d[_c];h&&(h(),delete d[_c])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=_o({},e);"__i18n"in s&&(a.__i18n=s.__i18n),o&&(a.__root=o),l=rp(a),r.__composerExtend&&(l[_c]=r.__composerExtend(l)),dI(r,t,l),r.__setInstance(t,l)}return l}function rI(e,t){const n=LE(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>ev(e)):n.run(()=>rp(e));if(o==null)throw Ls(vs.UNEXPECTED_ERROR);return[n,o]}function lI(e){const t=Kt(e.isCE?sI:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ls(e.isCE?vs.NOT_INSTALLED_WITH_PROVIDE:vs.UNEXPECTED_ERROR);return t}function aI(e,t){return mm(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function cI(e){return e.mode==="composition"?e.global:e.global.__composer}function Yx(e,t,n=!1){let o=null;const s=t.root;let i=uI(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[pA]&&(o=null))}if(o!=null||s===i)break;i=i.parent}return o}function uI(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function dI(e,t,n){cn(()=>{},t),bn(()=>{const o=n;e.__deleteInstance(t);const s=o[_c];s&&(s(),delete o[_c])},t)}const fI=["locale","fallbackLocale","availableLocales"],Zx=["t","rt","d","n","tm","te"];function hI(e,t){const n=Object.create(null);return fI.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i)throw Ls(vs.UNEXPECTED_ERROR);const r=ho(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,Zx.forEach(s=>{const i=Object.getOwnPropertyDescriptor(t,s);if(!i||!i.value)throw Ls(vs.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,i)}),()=>{delete e.config.globalProperties.$i18n,Zx.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}const pI=Ze({name:"i18n-d",props:_o({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},By),setup(e,t){const n=e.i18n||Tt({useScope:e.scope,__useComponent:!0});return yA(e,t,cA,(...o)=>n[Xg](...o))}}),Qx=pI;V7();C7(r7);A7(w7);M7(Kg);if(__INTLIFY_PROD_DEVTOOLS__){const e=ya();e.__INTLIFY__=!0,l7(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const mI="modulepreload",gI=function(e){return"/"+e},Xx={},ms=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=gI(c),c in Xx)return;Xx[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":mI,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)})},Ft={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 Jx(e){return`kimi-web.draft.${e&&e.length>0?e:"__new__"}`}function mo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function So(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Na(e){try{globalThis.localStorage.removeItem(e)}catch{}}function ym(e){const t=mo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function Gd(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Dy(){const e=mo(Ft.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 Py(e){const n={...Dy()};for(const[o,s]of Object.entries(e))s?n[o]=!0:delete n[o];So(Ft.unread,JSON.stringify(n))}function vI(){const e=ym(Ft.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function u0(e){Gd(Ft.collapsedWorkspaces,Array.from(e))}function yI(){const e=ym(Ft.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function kA(e){Gd(Ft.workspaceOrder,Array.from(e))}function zf(){const e=ym(Ft.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 ew(e){Gd(Ft.workspaceNameOverrides,e)}function kI(){return mo(Ft.workspaceSort)}function bA(e){So(Ft.workspaceSort,e)}const tw=Ft.clientId,bI="kimi-code-web",xI="web";function wI(){return{serverHttpUrl:SI(),clientId:EI(),clientName:bI,clientVersion:TI(),clientUiMode:xI}}function _I(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function SI(e){const t=_I(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function CI(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function AI(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return CI(e)}function Sc(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function MI(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 EI(){const e=mo(tw);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return So(tw,t),t}function TI(){return"0.1.2".trim()?"0.1.2":"0.0.0-dev"}async function NI(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 II(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}async function Go(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 $I(e)}function LI(e){if(typeof e!="string")return;const t=typeof navigator<"u"?navigator.clipboard:void 0;t&&typeof t.writeText=="function"||Go(e)}function $I(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 FI(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 OI(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 RI(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 BI(e,t){return e.toSorted((n,o)=>(t.get(o.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}const DI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function nw(e){return e.replace(/[&<>"']/g,t=>DI[t]??t)}function PI(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function HI(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 ow(o,n*2);const i=o.toLowerCase().indexOf(s.toLowerCase());if(i<0)return ow(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 ow(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function d0(e,t){const n=nw(e),o=t.trim();if(o.length===0)return n;const s=new RegExp(PI(nw(o)),"gi");return n.replace(s,i=>`<mark>${i}</mark>`)}const vc=X(0),WI=["type","disabled","aria-label"],zI=Ze({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},type:{default:"button"}},setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(w(),T("button",{ref_key:"el",ref:n,class:We(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[On(o.$slots,"default",{},void 0,!0)],10,WI))}}),ct=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Pn=ct(zI,[["__scopeId","data-v-c9e67023"]]),UI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qI(e,t){return w(),T("svg",UI,[...t[0]||(t[0]=[_("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),_("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 jI=pt({name:"kimi-add-conversation",render:qI}),VI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KI(e,t){return w(),T("svg",VI,[...t[0]||(t[0]=[_("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 GI=pt({name:"kimi-folder",render:KI}),YI={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZI=["clip-path"],QI=["id"];function XI(e,t){return w(),T("svg",YI,[_("g",{"clip-path":"url(#"+e.idMap.clip0_4626_2033+")"},[...t[0]||(t[0]=[_("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,ZI),_("defs",null,[_("clipPath",{id:e.idMap.clip0_4626_2033},[...t[1]||(t[1]=[_("rect",{width:"24",height:"24",fill:"white"},null,-1)])],8,QI)])])}const JI=pt({name:"kimi-folder-open",render:XI,setup(){return{idMap:{clip0_4626_2033:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),eL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function tL(e,t){return w(),T("svg",eL,[...t[0]||(t[0]=[_("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),_("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),_("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 nL=pt({name:"kimi-more",render:tL}),oL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sL(e,t){return w(),T("svg",oL,[...t[0]||(t[0]=[_("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 iL=pt({name:"kimi-search",render:sL}),rL={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function lL(e,t){return w(),T("svg",rL,[...t[0]||(t[0]=[_("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),_("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 aL=pt({name:"kimi-setting",render:lL}),cL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uL(e,t){return w(),T("svg",cL,[...t[0]||(t[0]=[_("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"})],-1)])])}const dL=pt({name:"tabler-layout-sidebar-left-collapse",render:uL}),fL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hL(e,t){return w(),T("svg",fL,[...t[0]||(t[0]=[_("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"})],-1)])])}const pL=pt({name:"tabler-layout-sidebar-left-expand",render:hL}),mL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gL(e,t){return w(),T("svg",mL,[...t[0]||(t[0]=[_("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 vL=pt({name:"tabler-paperclip",render:gL}),yL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kL(e,t){return w(),T("svg",yL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const bL=pt({name:"ri-add-line",render:kL}),xL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wL(e,t){return w(),T("svg",xL,[...t[0]||(t[0]=[_("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 _L=pt({name:"ri-alert-line",render:wL}),SL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CL(e,t){return w(),T("svg",SL,[...t[0]||(t[0]=[_("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 AL=pt({name:"ri-archive-line",render:CL}),ML={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EL(e,t){return w(),T("svg",ML,[...t[0]||(t[0]=[_("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 TL=pt({name:"ri-arrow-down-line",render:EL}),NL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IL(e,t){return w(),T("svg",NL,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"m12 13.171l4.95-4.95l1.414 1.415L12 16L5.636 9.636L7.05 8.222z"},null,-1)])])}const LL=pt({name:"ri-arrow-down-s-line",render:IL}),$L={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FL(e,t){return w(),T("svg",$L,[...t[0]||(t[0]=[_("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 OL=pt({name:"ri-arrow-go-back-line",render:FL}),RL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BL(e,t){return w(),T("svg",RL,[...t[0]||(t[0]=[_("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 DL=pt({name:"ri-arrow-right-line",render:BL}),PL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HL(e,t){return w(),T("svg",PL,[...t[0]||(t[0]=[_("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 WL=pt({name:"ri-arrow-right-s-line",render:HL}),zL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UL(e,t){return w(),T("svg",zL,[...t[0]||(t[0]=[_("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 sw=pt({name:"ri-arrow-up-line",render:UL}),qL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jL(e,t){return w(),T("svg",qL,[...t[0]||(t[0]=[_("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 VL=pt({name:"ri-arrow-up-s-line",render:jL}),KL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function GL(e,t){return w(),T("svg",KL,[...t[0]||(t[0]=[_("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 YL=pt({name:"ri-braces-line",render:GL}),ZL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QL(e,t){return w(),T("svg",ZL,[...t[0]||(t[0]=[_("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 XL=pt({name:"ri-calendar-close-line",render:QL}),JL={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e$(e,t){return w(),T("svg",JL,[...t[0]||(t[0]=[_("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 t$=pt({name:"ri-calendar-schedule-line",render:e$}),n$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o$(e,t){return w(),T("svg",n$,[...t[0]||(t[0]=[_("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 s$=pt({name:"ri-calendar-todo-line",render:o$}),i$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r$(e,t){return w(),T("svg",i$,[...t[0]||(t[0]=[_("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 l$=pt({name:"ri-check-line",render:r$}),a$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c$(e,t){return w(),T("svg",a$,[...t[0]||(t[0]=[_("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 u$=pt({name:"ri-close-line",render:c$}),d$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f$(e,t){return w(),T("svg",d$,[...t[0]||(t[0]=[_("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 h$=pt({name:"ri-code-line",render:f$}),p$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m$(e,t){return w(),T("svg",p$,[...t[0]||(t[0]=[_("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 g$=pt({name:"ri-collapse-diagonal-line",render:m$}),v$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y$(e,t){return w(),T("svg",v$,[...t[0]||(t[0]=[_("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 k$=pt({name:"ri-download-line",render:y$}),b$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x$(e,t){return w(),T("svg",b$,[...t[0]||(t[0]=[_("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 w$=pt({name:"ri-draggable",render:x$}),_$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S$(e,t){return w(),T("svg",_$,[...t[0]||(t[0]=[_("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 C$=pt({name:"ri-equalizer-line",render:S$}),A$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M$(e,t){return w(),T("svg",A$,[...t[0]||(t[0]=[_("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 E$=pt({name:"ri-expand-diagonal-line",render:M$}),T$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N$(e,t){return w(),T("svg",T$,[...t[0]||(t[0]=[_("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 I$=pt({name:"ri-external-link-line",render:N$}),L$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $$(e,t){return w(),T("svg",L$,[...t[0]||(t[0]=[_("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 F$=pt({name:"ri-file-add-line",render:$$}),O$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R$(e,t){return w(),T("svg",O$,[...t[0]||(t[0]=[_("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 B$=pt({name:"ri-file-copy-line",render:R$}),D$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P$(e,t){return w(),T("svg",D$,[...t[0]||(t[0]=[_("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 H$=pt({name:"ri-file-edit-line",render:P$}),W$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z$(e,t){return w(),T("svg",W$,[...t[0]||(t[0]=[_("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 iw=pt({name:"ri-file-line",render:z$}),U$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q$(e,t){return w(),T("svg",U$,[...t[0]||(t[0]=[_("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 j$=pt({name:"ri-file-text-line",render:q$}),V$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K$(e,t){return w(),T("svg",V$,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M13 9h8L11 24v-9H4l9-15zm-2 2V7.22L7.532 13H13v4.394L17.263 11z"},null,-1)])])}const G$=pt({name:"ri-flashlight-line",render:K$}),Y$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z$(e,t){return w(),T("svg",Y$,[...t[0]||(t[0]=[_("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 Q$=pt({name:"ri-folder-add-line",render:Z$}),X$={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J$(e,t){return w(),T("svg",X$,[...t[0]||(t[0]=[_("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 eF=pt({name:"ri-folder-fill",render:J$}),tF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nF(e,t){return w(),T("svg",tF,[...t[0]||(t[0]=[_("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 oF=pt({name:"ri-git-fork-line",render:nF}),sF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iF(e,t){return w(),T("svg",sF,[...t[0]||(t[0]=[_("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 rF=pt({name:"ri-git-pull-request-line",render:iF}),lF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aF(e,t){return w(),T("svg",lF,[...t[0]||(t[0]=[_("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 cF=pt({name:"ri-global-line",render:aF}),uF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dF(e,t){return w(),T("svg",uF,[...t[0]||(t[0]=[_("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 rw=pt({name:"ri-image-line",render:dF}),fF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hF(e,t){return w(),T("svg",fF,[...t[0]||(t[0]=[_("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 pF=pt({name:"ri-information-line",render:hF}),mF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gF(e,t){return w(),T("svg",mF,[...t[0]||(t[0]=[_("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 vF=pt({name:"ri-links-line",render:gF}),yF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kF(e,t){return w(),T("svg",yF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M8 4h13v2H8zm-5-.5h3v3H3zm0 7h3v3H3zm0 7h3v3H3zM8 11h13v2H8zm0 7h13v2H8z"},null,-1)])])}const bF=pt({name:"ri-list-check",render:kF}),xF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wF(e,t){return w(),T("svg",xF,[...t[0]||(t[0]=[_("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 _F=pt({name:"ri-list-unordered",render:wF}),SF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CF(e,t){return w(),T("svg",SF,[...t[0]||(t[0]=[_("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 AF=pt({name:"ri-login-box-line",render:CF}),MF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function EF(e,t){return w(),T("svg",MF,[...t[0]||(t[0]=[_("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 TF=pt({name:"ri-mail-line",render:EF}),NF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IF(e,t){return w(),T("svg",NF,[...t[0]||(t[0]=[_("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 LF=pt({name:"ri-message-line",render:IF}),$F={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function FF(e,t){return w(),T("svg",$F,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M6 5h2v14H6zm10 0h2v14h-2z"},null,-1)])])}const OF=pt({name:"ri-pause-fill",render:FF}),RF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function BF(e,t){return w(),T("svg",RF,[...t[0]||(t[0]=[_("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 DF=pt({name:"ri-pencil-line",render:BF}),PF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function HF(e,t){return w(),T("svg",PF,[...t[0]||(t[0]=[_("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 WF=pt({name:"ri-play-fill",render:HF}),zF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function UF(e,t){return w(),T("svg",zF,[...t[0]||(t[0]=[_("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 qF=pt({name:"ri-question-line",render:UF}),jF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function VF(e,t){return w(),T("svg",jF,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M20 4v12h3l-4 5l-4-5h3V4zm-8 14v2H3v-2zm2-7v2H3v-2zm0-7v2H3V4z"},null,-1)])])}const KF=pt({name:"ri-sort-desc",render:VF}),GF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function YF(e,t){return w(),T("svg",GF,[...t[0]||(t[0]=[_("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 ZF=pt({name:"ri-sparkling-line",render:YF}),QF={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function XF(e,t){return w(),T("svg",QF,[...t[0]||(t[0]=[_("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 JF=pt({name:"ri-star-fill",render:XF}),eO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tO(e,t){return w(),T("svg",eO,[...t[0]||(t[0]=[_("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 nO=pt({name:"ri-star-line",render:tO}),oO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sO(e,t){return w(),T("svg",oO,[...t[0]||(t[0]=[_("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 iO=pt({name:"ri-stop-fill",render:sO}),rO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lO(e,t){return w(),T("svg",rO,[...t[0]||(t[0]=[_("path",{fill:"currentColor",d:"M5 11v2h14v-2z"},null,-1)])])}const aO=pt({name:"ri-subtract-line",render:lO}),cO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uO(e,t){return w(),T("svg",cO,[...t[0]||(t[0]=[_("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 dO=pt({name:"ri-target-line",render:uO}),fO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hO(e,t){return w(),T("svg",fO,[...t[0]||(t[0]=[_("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 pO=pt({name:"ri-terminal-box-line",render:hO}),mO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gO(e,t){return w(),T("svg",mO,[...t[0]||(t[0]=[_("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 vO=pt({name:"ri-time-line",render:gO}),yO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function kO(e,t){return w(),T("svg",yO,[...t[0]||(t[0]=[_("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 bO=pt({name:"ri-tools-line",render:kO}),xO={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wO(e,t){return w(),T("svg",xO,[...t[0]||(t[0]=[_("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 _O=pt({name:"ri-user-line",render:wO}),SO=`<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
- `,CO=`<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
- `,AO=`<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
- `,MO=`<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
- `,EO=`<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
- `,TO=`<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
- `,NO='<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>',IO='<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>',LO='<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>',$O='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></svg>',FO='<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>',OO='<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>',RO='<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>',BO='<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>',DO='<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>',PO='<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>',HO='<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>',lw='<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>',WO='<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>',zO='<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>',UO='<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>',qO='<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>',jO='<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>',VO='<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>',KO='<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>',GO='<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>',YO='<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>',ZO='<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>',QO='<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>',XO='<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>',JO='<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>',eR='<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>',tR='<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>',nR='<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>',oR='<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>',aw='<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>',sR='<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>',iR='<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>',rR='<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>',lR='<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>',aR='<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>',cR='<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>',uR='<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>',cw='<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>',dR='<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>',fR='<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>',hR='<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>',pR='<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>',mR='<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>',gR='<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>',vR='<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>',yR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M6 5h2v14H6zm10 0h2v14h-2z"/></svg>',kR='<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>',bR='<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>',xR='<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>',wR='<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>',_R='<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>',SR='<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>',CR='<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>',AR='<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>',MR='<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M5 11v2h14v-2z"/></svg>',ER='<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>',TR='<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>',NR='<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>',IR='<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>',LR='<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>',xA={sm:14,md:16,lg:20};function vt(e,t){return{component:e,svg:t}}const wA={plus:vt(bL,$O),"chat-new":vt(jI,SO),"calendar-close":vt(XL,UO),"calendar-schedule":vt(t$,qO),"calendar-todo":vt(s$,jO),close:vt(u$,KO),check:vt(l$,VO),archive:vt(AL,OO),search:vt(iL,EO),copy:vt(B$,nR),link:vt(vF,fR),"external-link":vt(I$,eR),download:vt(k$,ZO),undo:vt(OL,DO),send:vt(sw,lw),image:vt(rw,cw),settings:vt(aL,TO),sliders:vt(C$,XO),"log-in":vt(AF,mR),"chevron-down":vt(LL,BO),"chevron-right":vt(WL,HO),"chevron-up":vt(VL,WO),"arrow-up":vt(sw,lw),"arrow-down":vt(TL,RO),"arrow-right":vt(DL,PO),minus:vt(aO,MR),"panel-collapse":vt(dL,NO),"panel-expand":vt(pL,IO),expand:vt(E$,JO),collapse:vt(g$,YO),list:vt(_F,pR),sort:vt(KF,wR),grip:vt(w$,QO),folder:vt(JI,AO),"folder-closed":vt(GI,CO),"folder-plus":vt(Q$,rR),"folder-solid":vt(eF,lR),file:vt(iw,aw),"file-text":vt(j$,sR),"file-edit":vt(H$,oR),"file-plus":vt(F$,tR),"file-off":vt(iw,aw),attachment:vt(vL,LO),"image-off":vt(rw,cw),code:vt(h$,GO),terminal:vt(pO,TR),pencil:vt(DF,kR),tool:vt(bO,IR),glob:vt(YL,zO),globe:vt(cF,uR),"check-list":vt(bF,hR),bolt:vt(G$,iR),"git-fork":vt(oF,aR),"git-pull-request":vt(rF,cR),message:vt(LF,vR),mail:vt(TF,gR),user:vt(_O,LR),info:vt(pF,dR),"help-circle":vt(qF,xR),"alert-triangle":vt(_L,FO),clock:vt(vO,NR),sparkles:vt(ZF,_R),target:vt(dO,ER),pause:vt(OF,yR),play:vt(WF,bR),stop:vt(iO,AR),star:vt(JF,SR),"star-outline":vt(nO,CR),"dots-horizontal":vt(nL,MO)};function $R(e){return wA[e]}function FR(e,t){return e.replace(/\s(?:width|height)="[^"]*"/g,"").replace(/^<svg\b/,`<svg class="kw-icon" width="${t}" height="${t}" aria-hidden="true"`)}function yc(e,t="md"){const n=wA[e];return n?FR(n.svg,xA[t]):""}const o_e=[["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"]]],Ve=Ze({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=B(()=>$R(t.name)),o=B(()=>xA[t.size]);return(s,i)=>n.value?(w(),xe(jo(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"])):ae("",!0)}}),OR={key:0,class:"ui-dialog__head"},RR={class:"ui-dialog__titles"},BR={key:0,class:"ui-dialog__title"},DR={key:1,class:"ui-dialog__desc"},PR={class:"ui-dialog__body"},HR={key:1,class:"ui-dialog__foot"},WR='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',zR=Ze({__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=X(null);let i=null;function r(){o("update:open",!1),o("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(WR)):[]}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 g=document.activeElement;d.shiftKey&&g===h?(d.preventDefault(),p.focus()):!d.shiftKey&&g===p&&(d.preventDefault(),h.focus())}function u(d){n.closeOnOverlay&&d.target===d.currentTarget&&r()}return Qe(()=>n.open,async d=>{if(d){vc.value+=1,i=document.activeElement,await mt();const f=a(),h=l();(f??h[0]??s.value)?.focus()}else vc.value=Math.max(0,vc.value-1),i instanceof HTMLElement&&(i.focus(),i=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),po(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(vc.value=Math.max(0,vc.value-1))}),(d,f)=>(w(),xe(dm,{to:"body"},[e.open?(w(),T("div",{key:0,class:"ui-dialog__overlay",onMousedown:u},[_("div",{ref_key:"panel",ref:s,class:We(["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?(w(),T("div",OR,[On(d.$slots,"head",{},()=>[_("div",RR,[e.title?(w(),T("div",BR,O(e.title),1)):ae("",!0),e.description?(w(),T("div",DR,O(e.description),1)):ae("",!0)])],!0),re(Pn,{class:"ui-dialog__close",size:"sm",label:"Close",onClick:r},{default:Ee(()=>[re(Ve,{name:"close",size:"md"})]),_:1})])):ae("",!0),_("div",PR,[On(d.$slots,"default",{},void 0,!0)]),d.$slots.foot?(w(),T("div",HR,[On(d.$slots,"foot",{},void 0,!0)])):ae("",!0)],2)],32)):ae("",!0)]))}}),qr=ct(zR,[["__scopeId","data-v-3dce23a4"]]),UR={class:"sd-head"},qR=["placeholder","aria-label"],jR=["aria-selected","onClick","onMousemove"],VR={class:"sd-meta"},KR=["innerHTML"],GR={class:"sd-time"},YR=["innerHTML"],ZR=["innerHTML"],QR={key:1,class:"sd-empty"},XR={class:"sd-hint"},JR=200,eB=Ze({__name:"SearchSessionsDialog",props:{sessions:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(""),l=X(null),a=X(null),c=B(()=>{const v=r.value.trim().toLowerCase(),m=[];for(const y of o.sessions){const k=y.title??"",A=y.lastPrompt??"",$=y.workspaceName??"",N=v.length>0&&k.toLowerCase().includes(v),x=v.length>0&&A.toLowerCase().includes(v),I=v.length>0&&$.toLowerCase().includes(v);if(!(v.length>0&&!N&&!x&&!I)&&(m.push({session:y,inTitle:N,inWorkspace:I,snippetText:A?HI(A,r.value):""}),m.length>=JR))break}return m}),u=X(0);Qe(r,()=>{u.value=0});function d(v){const m=c.value.length;return m===0?0:Math.max(0,Math.min(m-1,v))}async function f(){await mt(),a.value?.querySelector('[aria-selected="true"]')?.scrollIntoView({block:"nearest"})}function h(v){u.value=d(u.value+v),f()}function p(v){s("select",v),s("close")}function g(){const v=c.value[u.value];v&&p(v.session.id)}function b(v){v.key==="ArrowDown"?(v.preventDefault(),h(1)):v.key==="ArrowUp"?(v.preventDefault(),h(-1)):v.key==="Enter"&&(v.preventDefault(),g())}return cn(()=>{l.value?.focus()}),(v,m)=>(w(),xe(qr,{open:i.value,"onUpdate:open":m[1]||(m[1]=y=>i.value=y),size:"lg",height:"fixed",padded:!1,onClose:m[2]||(m[2]=y=>s("close"))},{head:Ee(()=>[_("div",UR,[re(Ve,{class:"sd-search-icon",name:"search",size:"md"}),Fn(_("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":m[0]||(m[0]=y=>r.value=y),class:"sd-input",type:"text",placeholder:C(n)("sidebar.searchPlaceholder"),"aria-label":C(n)("sidebar.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:b},null,40,qR),[[_s,r.value]])])]),foot:Ee(()=>[_("span",XR,O(C(n)("sidebar.searchHint")),1)]),default:Ee(()=>[_("div",{ref_key:"listRef",ref:a,class:"sd-list",role:"listbox"},[c.value.length>0?(w(!0),T(Pe,{key:0},ot(c.value,(y,k)=>(w(),T("button",{key:y.session.id,class:We(["sd-row",{on:k===u.value,active:y.session.id===e.activeId}]),role:"option","aria-selected":k===u.value,onClick:A=>p(y.session.id),onMousemove:A=>u.value=k},[_("span",VR,[re(Ve,{class:"sd-folder",name:"folder-closed",size:"sm"}),_("span",{class:"sd-ws",innerHTML:C(d0)(y.session.workspaceName??y.session.workspaceId??"",y.inWorkspace?r.value:"")},null,8,KR),_("span",GR,O(y.session.time),1)]),_("span",{class:"sd-title",innerHTML:C(d0)(y.session.title,y.inTitle?r.value:"")},null,8,YR),y.snippetText?(w(),T("span",{key:0,class:"sd-snippet",innerHTML:C(d0)(y.snippetText,r.value)},null,8,ZR)):ae("",!0)],42,jR))),128)):(w(),T("div",QR,O(C(n)("sidebar.searchNoResults")),1))],512)]),_:1},8,["open"]))}}),tB=ct(eB,[["__scopeId","data-v-a678f802"]]),nB=["aria-label"],oB=Ze({__name:"Spinner",props:{size:{default:"md"},label:{default:"Loading"}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label},[...n[0]||(n[0]=[_("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[_("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),_("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,nB))}}),Ds=ct(oB,[["__scopeId","data-v-e5c5b17d"]]),sB={key:0,class:"ui-badge__dot","aria-hidden":"true"},iB=Ze({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(w(),T("span",{class:We(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(w(),T("span",sB)):ae("",!0),On(t.$slots,"default",{},void 0,!0)],2))}}),Ri=ct(iB,[["__scopeId","data-v-5bc5cd6d"]]),rB=Ze({__name:"Menu",setup(e,{expose:t}){const n=X();return t({el:n}),(o,s)=>(w(),T("div",{ref_key:"el",ref:n,class:"ui-menu",role:"menu"},[On(o.$slots,"default",{},void 0,!0)],512))}}),kl=ct(rB,[["__scopeId","data-v-60e6cd8d"]]),lB={key:0,class:"ui-menu-sep",role:"separator"},aB=["disabled"],cB=Ze({__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?(w(),T("div",lB)):(w(),T("button",{key:1,class:We(["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))},[On(t.$slots,"default",{},void 0,!0)],10,aB))}}),pn=ct(cB,[["__scopeId","data-v-f940771a"]]),nl=6,ol=8,uB=150,dB=Ze({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=X(),o=X(),s=X(!1),i=X(!1),r=X({maxWidth:`${t.maxWidth}px`});let l,a=null,c;function u(){const g=o.value;if(!a||!g)return;const b=a.getBoundingClientRect(),v=g.offsetWidth,m=g.offsetHeight,y=window.innerWidth,k=window.innerHeight;let A=t.placement;A==="top"&&b.top-nl-m<ol?A="bottom":A==="bottom"&&b.bottom+nl+m>k-ol?A="top":A==="left"&&b.left-nl-v<ol?A="right":A==="right"&&b.right+nl+v>y-ol&&(A="left");let $=0,N=0;A==="top"?($=b.top-nl-m,N=b.left+b.width/2-v/2):A==="bottom"?($=b.bottom+nl,N=b.left+b.width/2-v/2):A==="left"?($=b.top+b.height/2-m/2,N=b.left-nl-v):($=b.top+b.height/2-m/2,N=b.right+nl),N=Math.min(Math.max(N,ol),y-ol-v),$=Math.min(Math.max($,ol),k-ol-m),r.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round($)}px`,left:`${Math.round(N)}px`}}function d(){t.text&&(window.clearTimeout(l),l=window.setTimeout(()=>{s.value=!0,i.value=!1,mt(()=>{u(),i.value=!0})},uB))}function f(){window.clearTimeout(l),s.value=!1,i.value=!1}function h(){s.value&&f()}function p(g){g!==a&&(a&&(a.removeEventListener("mouseenter",d),a.removeEventListener("mouseleave",f),a.removeEventListener("focusin",d),a.removeEventListener("focusout",f)),a=g,a&&(a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",f),a.addEventListener("focusin",d),a.addEventListener("focusout",f)))}return cn(()=>{const g=n.value??null;p(g?.firstElementChild??g),g&&(c=new MutationObserver(()=>{const b=g.firstElementChild??null;b!==a&&(f(),p(b??g))}),c.observe(g,{childList:!0})),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h)}),po(()=>{window.clearTimeout(l),c?.disconnect(),p(null),window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}),(g,b)=>(w(),T(Pe,null,[_("span",{ref_key:"trigger",ref:n,class:"ui-tip"},[On(g.$slots,"default",{},void 0,!0)],512),(w(),xe(dm,{to:"body"},[Fn(_("div",{ref_key:"bubble",ref:o,class:We(["ui-tip__bubble",{positioned:i.value}]),style:Yt([r.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},O(e.text),7),[[mi,s.value]])]))],64))}}),Xt=ct(dB,[["__scopeId","data-v-4c261eb6"]]),fB={class:"row"},hB={class:"lead","aria-hidden":"true"},pB={key:1,class:"unread-dot"},mB={class:"left"},gB=["onKeydown"],vB={class:"act"},yB={class:"ts"},kB={class:"menu-time"},bB=Ze({__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}=Tt(),s=e,i=n;function r(S){const L=new Date(S);if(Number.isNaN(L.getTime()))return S;const R=D=>String(D).padStart(2,"0");return`${L.getFullYear()}-${R(L.getMonth()+1)}-${R(L.getDate())} ${R(L.getHours())}:${R(L.getMinutes())}`}const l=B(()=>s.session.updatedAt?r(s.session.updatedAt):s.session.time),a=X(!1),c=X(null),u=X(null),d=X({});function f(S){const L=S.target;u.value?.el?.contains(L)||c.value?.el?.contains(L)||g()}function h(){const S=c.value?.el;if(!S)return;const L=u.value?.el,R=S.getBoundingClientRect(),D=4,z=8,H=L?.offsetHeight??0,U=L?.offsetWidth??0;let Z=R.bottom+D;Z+H>window.innerHeight-z&&(Z=Math.max(z,R.top-H-D));let K=R.right-U;K<z&&(K=z),d.value={top:`${Math.round(Z)}px`,left:`${Math.round(K)}px`}}async function p(S){if(S.stopPropagation(),a.value){g();return}a.value=!0,setTimeout(()=>document.addEventListener("mousedown",f),0),window.addEventListener("resize",g),await mt(),h()}function g(){a.value=!1,document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)}bn(()=>{document.removeEventListener("mousedown",f),window.removeEventListener("resize",g)});const b=X(!1),v=X(""),m=X(null);async function y(){g(),b.value=!0,v.value=s.session.title,await mt();try{m.value?.focus(),m.value?.select()}catch{}}function k(){const S=v.value.trim();S&&i("rename",s.session.id,S),b.value=!1}function A(){b.value=!1}const $=X(!1),N=X(!1);async function x(){const S=await Go(s.session.id);$.value=S,N.value=!S,setTimeout(()=>{$.value=!1,N.value=!1,g()},1500)}function I(){g(),i("fork",s.session.id)}function E(){g(),i("export",s.session.id)}function F(){g(),i("archive",s.session.id)}return t({closeMenu:g}),(S,L)=>(w(),T("div",{class:We(["se",{on:e.active}]),onClick:L[4]||(L[4]=R=>i("select",e.session.id))},[_("div",fB,[_("span",hB,[e.session.busy?(w(),xe(Ds,{key:0,size:"sm"})):e.unread?(w(),T("span",pB)):ae("",!0)]),_("div",mB,[b.value?Fn((w(),T("input",{key:0,ref_key:"renameInputRef",ref:m,"onUpdate:modelValue":L[0]||(L[0]=R=>v.value=R),class:"rename-input",onClick:L[1]||(L[1]=bt(()=>{},["stop"])),onKeydown:[nr(bt(k,["stop"]),["enter"]),nr(bt(A,["stop"]),["esc"])],onBlur:k},null,40,gB)),[[_s,v.value]]):(w(),T("span",{key:1,class:"t",onDblclick:bt(y,["stop"])},O(e.session.title),33))]),re(Xt,{text:C(o)("workspace.awaitingAnswerTitle")},{default:Ee(()=>[!b.value&&(e.questionCount>0||e.session.pendingInteraction==="question")?(w(),xe(Ri,{key:0,variant:"info",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingAnswer")),1)]),_:1})):ae("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.awaitingPermissionTitle")},{default:Ee(()=>[!b.value&&(e.approvalCount>0||e.session.pendingInteraction==="approval")?(w(),xe(Ri,{key:0,variant:"warning",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.awaitingPermission")),1)]),_:1})):ae("",!0)]),_:1},8,["text"]),re(Xt,{text:C(o)("workspace.abortedTitle")},{default:Ee(()=>[!b.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")?(w(),xe(Ri,{key:0,variant:"danger",size:"sm"},{default:Ee(()=>[Je(O(C(o)("workspace.aborted")),1)]),_:1})):ae("",!0)]),_:1},8,["text"]),_("span",vB,[_("span",yB,O(e.session.time),1),b.value?ae("",!0):(w(),xe(Pn,{key:0,ref_key:"kebabRef",ref:c,class:We(["kebab",{open:a.value}]),size:"sm",label:C(o)("sidebar.options"),onClick:L[2]||(L[2]=bt(R=>p(R),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label"]))])]),(w(),xe(dm,{to:"body"},[a.value?(w(),xe(kl,{key:0,ref_key:"menuRef",ref:u,class:"menu",style:Yt(d.value),onClick:L[3]||(L[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{danger:N.value,onClick:x},{default:Ee(()=>[re(Ve,{name:$.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(N.value?C(o)("sidebar.copyFailed"):$.value?C(o)("sidebar.copied"):C(o)("sidebar.copySessionId")),1)]),_:1},8,["danger"]),re(pn,{separator:""}),re(pn,{onClick:y},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(o)("sidebar.rename")),1)]),_:1}),re(pn,{onClick:I},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(o)("sidebar.fork")),1)]),_:1}),re(pn,{onClick:E},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(o)("sidebar.export")),1)]),_:1}),re(pn,{danger:"",onClick:F},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(o)("sidebar.archive")),1)]),_:1}),re(pn,{separator:""}),_("div",kB,O(l.value),1)]),_:1},8,["style"])):ae("",!0)]))],2))}}),xB=ct(bB,[["__scopeId","data-v-c1a3c877"]]),wB={class:"gh-top"},_B={class:"gh-name"},SB=["inert"],CB=["disabled"],AB={class:"show-more-label"},MB={class:"show-more-label"},EB={key:2,class:"group-empty"},TB=Ze({__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}=Tt(),o=e,s=t,i=B({get:()=>o.renameValue,set:f=>s("updateRenameValue",f)}),r=B(()=>{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=B(()=>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)=>(w(),T("div",{class:We(["group",{dragging:e.dragging}])},[_("div",{class:We(["gh",{on:e.group.workspace.id===e.activeWorkspaceId,collapsed:e.isCollapsed(e.group.workspace.id)}]),draggable:"true",onClick:h[7]||(h[7]=bt(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"))},[_("div",wB,[e.isCollapsed(e.group.workspace.id)?(w(),xe(Ve,{key:0,class:"gh-folder",name:"folder-closed"})):(w(),xe(Ve,{key:1,class:"gh-folder",name:"folder"})),e.renamingId!==e.group.workspace.id?(w(),xe(Xt,{key:2,text:e.group.workspace.root},{default:Ee(()=>[_("span",_B,O(e.group.workspace.name),1)]),_:1},8,["text"])):Fn((w(),T("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]=nr(p=>s("confirmRename"),["enter"])),h[2]||(h[2]=nr(p=>s("cancelRename"),["esc"]))],onBlur:h[3]||(h[3]=p=>s("cancelRename")),onClick:h[4]||(h[4]=bt(()=>{},["stop"]))},null,544)),[[_s,i.value]]),e.renamingId!==e.group.workspace.id?(w(),T("div",{key:4,class:We(["gh-actions",{open:e.wsMenuOpenId===e.group.workspace.id}])},[re(Pn,{class:We(["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]=bt(p=>s("toggleWsMenu",e.group.workspace,p),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["class","label","aria-expanded"]),re(Pn,{class:"gh-add",size:"sm",label:C(n)("workspace.newInGroup"),onClick:h[6]||(h[6]=bt(p=>s("createInWorkspace",e.group.workspace.id),["stop"]))},{default:Ee(()=>[re(Ve,{name:"chat-new"})]),_:1},8,["label"])],2)):ae("",!0)])],34),_("div",{class:We(["group-sessions",{collapsed:e.isCollapsed(e.group.workspace.id)}]),inert:e.isCollapsed(e.group.workspace.id)},[(w(!0),T(Pe,null,ot(r.value,p=>(w(),xe(xB,{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]=g=>s("selectSession",g)),onRename:h[11]||(h[11]=(g,b)=>s("renameSession",g,b)),onArchive:h[12]||(h[12]=g=>s("archiveSession",g)),onFork:h[13]||(h[13]=g=>s("forkSession",g)),onExport:h[14]||(h[14]=g=>s("exportSession",g))},null,8,["session","active","approval-count","question-count","unread"]))),128)),e.group.hasMore||e.group.loadingMore?(w(),T("button",{key:0,class:"show-more",disabled:e.group.loadingMore,onClick:h[15]||(h[15]=bt(p=>s("loadMore",e.group.workspace.id),["stop"]))},[h[17]||(h[17]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",AB,O(e.group.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:a()})),1)],8,CB)):ae("",!0),l.value?(w(),T("button",{key:1,class:"show-more",onClick:h[16]||(h[16]=bt(p=>s("toggleExpand",e.group.workspace.id),["stop"]))},[h[18]||(h[18]=_("span",{class:"show-more-lead","aria-hidden":"true"},null,-1)),_("span",MB,O(e.isExpanded(e.group.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:c()})),1)])):ae("",!0),e.group.sessions.length===0?(w(),T("div",EB,O(C(n)("sidebar.noSessions")),1)):ae("",!0)],10,SB)],2))}}),NB=ct(TB,[["__scopeId","data-v-cdac739a"]]),IB="kimi_desktop",LB="platform",uw="kimi-desktop",dw="kimi-desktop-platform";function $B(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(IB)?(sessionStorage.setItem(uw,"1"),e=!0):e=e||sessionStorage.getItem(uw)==="1";const o=n.get(LB);o?(sessionStorage.setItem(dw,o),t=o):t=sessionStorage.getItem(dw)}catch{}return{isDesktop:e,platform:t}}const tv=$B(),FB=tv.isDesktop,Dc=tv.isDesktop&&tv.platform==="darwin",OB={class:"ui-kbd"},RB=Ze({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(w(),T("span",OB,[(w(!0),T(Pe,null,ot(e.keys,o=>(w(),T("kbd",{key:o,class:"ui-kbd__key"},O(o),1))),128))]))}}),kr=ct(RB,[["__scopeId","data-v-32292ed8"]]),BB=["disabled","aria-pressed"],DB=Ze({__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?(w(),T("button",{key:0,class:We(["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))},[On(t.$slots,"default",{},void 0,!0)],10,BB)):(w(),T("span",{key:1,class:We(["ui-pill",{"is-active":e.active}])},[On(t.$slots,"default",{},void 0,!0)],2))}}),kh=ct(DB,[["__scopeId","data-v-317ace1a"]]),PB={class:"ch"},HB={class:"ch-brand"},WB={class:"ch-backend-ep"},zB={class:"btn-wrap"},UB={class:"search-input"},qB={key:0,class:"empty"},jB={class:"side-section-label"},VB={class:"side-section-title"},KB={class:"side-section-actions"},GB=["onDragover","onDrop"],YB={class:"side-footer"},ZB={class:"section-menu-check"},QB={class:"section-menu-check"},XB={class:"section-menu-check"},JB={class:"backend-menu-name"},eD={class:"backend-menu-url"},tD=1e3,nD=Ze({__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}=Tt(),o=!1,s=X(null),i=B(()=>""),r=["default","multi"];function l(ze){const Xe=s.value?.presets[ze]??"";return Xe?II(Xe):""}function a(ze){const Xe=s.value;return Xe!==null&&Xe.current===Xe.presets[ze]}const c=e,u=t,d=X(!1),f=g()?["⌘","K"]:["Ctrl","K"];function h(){u("loadAllSessions"),d.value=!0}function p(ze){(ze.metaKey||ze.ctrlKey)&&ze.key.toLowerCase()==="k"&&(ze.preventDefault(),h())}cn(()=>window.addEventListener("keydown",p)),po(()=>window.removeEventListener("keydown",p));function g(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const ze=navigator.userAgentData;return ze?.platform==="macOS"||ze?.platform==="iOS"}const b=X(!1);function v(ze){b.value=ze.target.scrollTop>0}const m=X(new Set(vI()));function y(ze){return m.value.has(ze)}function k(ze){const Xe=new Set(m.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),m.value=Xe,u0(Xe)}function A(){const ze=new Set(c.groups.map(Xe=>Xe.workspace.id));m.value=ze,u0(ze)}function $(){const ze=new Set;m.value=ze,u0(ze)}const N=B(()=>c.groups.length>0&&c.groups.every(ze=>m.value.has(ze.workspace.id))),x=X(new Set);function I(ze){return x.value.has(ze)}function E(ze){const Xe=new Set(x.value);Xe.has(ze)?Xe.delete(ze):Xe.add(ze),x.value=Xe}function F(ze){if(!x.value.has(ze)){const Xe=new Set(x.value);Xe.add(ze),x.value=Xe}u("loadMoreSessions",ze)}const S=X(null),L=X(null);function R(ze){S.value=ze}function D(){S.value=null,L.value=null}function z(ze){const Xe=ze.currentTarget.getBoundingClientRect();return ze.clientY<Xe.top+Xe.height/2?"before":"after"}function H(ze,Xe){S.value===null||S.value===Xe||(ze.preventDefault(),ze.dataTransfer&&(ze.dataTransfer.dropEffect="move"),L.value={id:Xe,position:z(ze)})}function U(ze){const Xe=S.value,kt=L.value?.id===ze?L.value.position:"before";if(L.value=null,S.value=null,!Xe||Xe===ze)return;const Ht=RI(c.groups.map(Rn=>Rn.workspace.id),Xe,ze,kt);u("reorderWorkspaces",Ht)}function Z(ze,Xe){Xe.target.closest(".gh-more, .gh-add")||k(ze)}function K(ze){u("select",ze)}const V=X(null),J=X(""),fe=X(null);function oe(){return fe}function ce(ze,Xe){V.value=ze,J.value=Xe,mt().then(()=>fe.value?.focus())}function ue(){const ze=V.value,Xe=J.value.trim();ze&&Xe&&u("renameWorkspace",ze,Xe),V.value=null}function Se(){V.value=null}function Te(ze){J.value=ze}const Ae=X(!1),P=X(null),le=X({}),ne=X(null);function q(ze){ne.value?.el&&!ne.value.el.contains(ze.target)&&ge()}function ee(ze,Xe){Xe.preventDefault(),Xe.stopPropagation(),P.value=ze,le.value={top:`${Xe.clientY}px`,left:`${Xe.clientX}px`},Ae.value=!0,document.addEventListener("mousedown",q,!0)}function ge(){Ae.value=!1,document.removeEventListener("mousedown",q,!0),P.value=null}function de(){P.value&&Go(P.value.root),ge()}function ve(){P.value&&ce(P.value.id,P.value.name),ge()}function j(){const ze=P.value;ze&&(ge(),u("deleteWorkspace",ze.id))}const te=X(null),pe=X(null),Ce=X({}),$e=X(null);function De(ze){const Xe=ze.target;Xe.closest(".gh-more")||Xe.closest(".ws-menu")||Ie()}async function me(ze,Xe){if(te.value===ze.id){Ie();return}const kt=Xe.currentTarget;pe.value=ze,te.value=ze.id,document.addEventListener("mousedown",De),window.addEventListener("resize",Ie),await mt();const Ht=$e.value?.el,Rn=kt.getBoundingClientRect(),sn=4,Gt=8,Wn=Ht?.offsetHeight??0,En=Ht?.offsetWidth??0;let St=Rn.bottom+sn;St+Wn>window.innerHeight-Gt&&(St=Math.max(Gt,Rn.top-Wn-sn));let Po=Rn.right-En;Po<Gt&&(Po=Gt),Ce.value={top:`${Math.round(St)}px`,left:`${Math.round(Po)}px`}}function Ie(){te.value=null,pe.value=null,document.removeEventListener("mousedown",De),window.removeEventListener("resize",Ie)}function et(ze){Go(ze.root),Ie()}function rt(ze){ce(ze.id,ze.name),Ie()}function _t(ze){Ie(),u("deleteWorkspace",ze.id)}const gt=X(!1),It=X({}),Ut=X(null);function ht(ze){const Xe=ze.target;Xe.closest(".side-section-kebab")||Xe.closest(".section-menu")||dn()}async function un(ze){if(gt.value){dn();return}const Xe=ze.currentTarget;gt.value=!0,document.addEventListener("mousedown",ht),window.addEventListener("resize",dn),await mt();const kt=Ut.value?.el,Ht=Xe.getBoundingClientRect(),Rn=4,sn=8,Gt=kt?.offsetHeight??0,Wn=kt?.offsetWidth??0;let En=Ht.bottom+Rn;En+Gt>window.innerHeight-sn&&(En=Math.max(sn,Ht.top-Gt-Rn));let St=Ht.right-Wn;St<sn&&(St=sn),It.value={top:`${Math.round(En)}px`,left:`${Math.round(St)}px`}}function dn(){gt.value=!1,document.removeEventListener("mousedown",ht),window.removeEventListener("resize",dn)}function ns(ze){u("setWorkspaceSortMode",ze),dn()}const Wt=X(!1),Hn=X({}),lo=X(null);function it(ze){const Xe=ze.target;Xe.closest(".ch-backend")||Xe.closest(".backend-menu")||ao()}async function Gn(ze){if(s.value===null)return;if(Wt.value){ao();return}const Xe=ze.currentTarget;Wt.value=!0,document.addEventListener("mousedown",it),window.addEventListener("resize",ao),await mt();const kt=lo.value?.el,Ht=Xe.getBoundingClientRect(),Rn=4,sn=8,Gt=kt?.offsetHeight??0;let Wn=Ht.bottom+Rn;Wn+Gt>window.innerHeight-sn&&(Wn=Math.max(sn,Ht.top-Gt-Rn)),Hn.value={top:`${Math.round(Wn)}px`,left:`${Math.round(Math.max(sn,Ht.left))}px`}}function ao(){Wt.value=!1,document.removeEventListener("mousedown",it),window.removeEventListener("resize",ao)}async function Yn(ze){if(a(ze)){ao();return}if(await NI(ze)===null){console.warn("[kimi-web] dev backend switch failed:",ze),ao();return}window.location.reload()}po(()=>{document.removeEventListener("mousedown",q,!0),document.removeEventListener("mousedown",De),document.removeEventListener("mousedown",ht),document.removeEventListener("mousedown",it),window.removeEventListener("resize",Ie),window.removeEventListener("resize",dn),window.removeEventListener("resize",ao)});const go=X(null);let os;function qn(){const ze=go.value;ze&&(ze.classList.remove("blink-now"),ze.getBoundingClientRect(),ze.classList.add("blink-now"),clearTimeout(os),os=setTimeout(()=>ze.classList.remove("blink-now"),300))}const to=Li(()=>ms(()=>import("./DesignSystemView-BnyYC1m0.js"),__vite__mapDeps([0,1]))),vn=X(!1);let Zn,xn=!1;function An(ze){xn=!1,clearTimeout(Zn),ze.currentTarget.setPointerCapture?.(ze.pointerId),Zn=setTimeout(()=>{xn=!0,vn.value=!0},tD)}function Mn(ze){clearTimeout(Zn);const Xe=ze.currentTarget;Xe.hasPointerCapture?.(ze.pointerId)&&Xe.releasePointerCapture(ze.pointerId)}function Do(){if(xn){xn=!1;return}qn()}return po(()=>{clearTimeout(Zn)}),(ze,Xe)=>(w(),T("aside",{class:We(["side",{"macos-desktop":C(Dc),collapsed:e.collapsed,"no-anim":e.dragging}]),style:Yt({width:e.collapsed?"0px":e.colWidth+"px"})},[_("div",{class:"col",style:Yt({width:e.colWidth+"px"})},[_("div",PB,[_("div",HB,[C(Dc)?ae("",!0):(w(),T(Pe,{key:0},[(w(),T("svg",{ref_key:"logoRef",ref:go,class:We(["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:Do,onPointerdown:An,onPointerup:Mn,onPointercancel:Mn},[...Xe[22]||(Xe[22]=[Ay('<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)),Xe[23]||(Xe[23]=_("span",{class:"ch-name"},"Kimi Code",-1)),C(o)?(w(),xe(kh,{key:0,class:"ch-backend",clickable:s.value!==null,title:C(n)("sidebar.backendTitle",{backend:e.backend,endpoint:i.value}),onClick:Gn},{default:Ee(()=>[_("span",{class:We(["ch-backend-kind",`is-${e.backend}`])},O(e.backend),3),_("span",WB," · "+O(i.value),1),s.value!==null?(w(),xe(Ve,{key:0,name:"chevron-down",size:"sm"})):ae("",!0)]),_:1},8,["clickable","title"])):ae("",!0)],64))]),C(Dc)?ae("",!0):(w(),xe(Pn,{key:0,class:"ch-collapse",size:"sm",label:C(n)("sidebar.collapseSidebar"),onClick:Xe[0]||(Xe[0]=bt(kt=>u("collapse"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"panel-collapse"})]),_:1},8,["label"]))]),_("div",zB,[_("button",{class:"btn-new-chat",type:"button",onClick:Xe[1]||(Xe[1]=bt(kt=>u("create"),["stop"]))},[re(Ve,{name:"chat-new"}),_("span",null,O(C(n)("sidebar.newChat")),1)]),ae("",!0)]),_("div",{class:We(["search-wrap",{"search-wrap--scrolled":b.value}])},[_("button",{class:"search",type:"button",onClick:h},[re(Ve,{class:"search-icon",name:"search"}),_("span",UB,O(C(n)("sidebar.search")),1),re(kr,{keys:C(f)},null,8,["keys"])])],2),_("div",{class:"sessions",onScroll:v},[e.groups.length===0?(w(),T("div",qB,O(C(n)("workspace.noWorkspace")),1)):(w(),T(Pe,{key:1},[_("div",jB,[_("span",VB,O(C(n)("sidebar.workspaces")),1),_("div",KB,[re(Pn,{class:"side-section-toggle",size:"sm",label:N.value?C(n)("sidebar.expandAll"):C(n)("sidebar.collapseAll"),onClick:Xe[3]||(Xe[3]=bt(kt=>N.value?$():A(),["stop"]))},{default:Ee(()=>[N.value?(w(),xe(Ve,{key:0,name:"expand"})):(w(),xe(Ve,{key:1,name:"collapse"}))]),_:1},8,["label"]),re(Pn,{class:"side-section-toggle side-section-kebab",size:"sm",label:C(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":gt.value,onClick:Xe[4]||(Xe[4]=bt(kt=>un(kt),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal"})]),_:1},8,["label","aria-expanded"])])]),(w(!0),T(Pe,null,ot(e.groups,kt=>(w(),T("div",{key:kt.workspace.id,class:We(["ws-drop-target",{"drop-before":L.value?.id===kt.workspace.id&&L.value.position==="before","drop-after":L.value?.id===kt.workspace.id&&L.value.position==="after"}]),onDragover:Ht=>H(Ht,kt.workspace.id),onDrop:Ht=>U(kt.workspace.id)},[re(NB,{group:kt,"active-workspace-id":e.activeWorkspaceId,"active-id":e.activeId,"renaming-id":V.value,"rename-value":J.value,"rename-input-ref":oe(),"pending-by-session":e.pendingBySession,"unread-by-session":e.unreadBySession,"ws-menu-open-id":te.value,dragging:S.value===kt.workspace.id,"is-collapsed":y,"is-expanded":I,onGroupClick:Z,onGroupContextmenu:ee,onToggleWsMenu:me,onCreateInWorkspace:Xe[5]||(Xe[5]=Ht=>u("createInWorkspace",Ht)),onSelectSession:K,onRenameSession:Xe[6]||(Xe[6]=(Ht,Rn)=>u("rename",Ht,Rn)),onArchiveSession:Xe[7]||(Xe[7]=Ht=>u("archive",Ht)),onForkSession:Xe[8]||(Xe[8]=Ht=>u("fork",Ht)),onExportSession:Xe[9]||(Xe[9]=Ht=>u("export",Ht)),onLoadMore:F,onToggleExpand:E,onConfirmRename:ue,onCancelRename:Se,onUpdateRenameValue:Te,onWsDragstart:R,onWsDragend:D},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,GB))),128))],64))],32),_("div",YB,[_("button",{class:"btn-settings",type:"button",onClick:Xe[10]||(Xe[10]=bt(kt=>u("openSettings"),["stop"]))},[re(Ve,{name:"settings"}),_("span",null,O(C(n)("settings.title")),1)])])],4),Ae.value?(w(),xe(kl,{key:0,ref_key:"ghMenuRef",ref:ne,class:"gh-menu",style:Yt(le.value),onClick:Xe[11]||(Xe[11]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:de},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{onClick:ve},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{danger:"",onClick:j},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ae("",!0),te.value!==null&&pe.value?(w(),xe(kl,{key:1,ref_key:"wsMenuRef",ref:$e,class:"ws-menu",style:Yt(Ce.value),onClick:Xe[15]||(Xe[15]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[12]||(Xe[12]=kt=>et(pe.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1}),re(pn,{separator:""}),re(pn,{onClick:Xe[13]||(Xe[13]=kt=>rt(pe.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1}),re(pn,{separator:""}),re(pn,{danger:"",onClick:Xe[14]||(Xe[14]=kt=>_t(pe.value))},{default:Ee(()=>[Je(O(C(n)("sidebar.removeWorkspace")),1)]),_:1})]),_:1},8,["style"])):ae("",!0),gt.value?(w(),xe(kl,{key:2,ref_key:"sectionMenuRef",ref:Ut,class:"section-menu",style:Yt(It.value),onClick:Xe[18]||(Xe[18]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:Xe[16]||(Xe[16]=kt=>ns("manual"))},{default:Ee(()=>[_("span",ZB,[e.workspaceSortMode==="manual"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),Je(" "+O(C(n)("sidebar.sortManual")),1)]),_:1}),re(pn,{onClick:Xe[17]||(Xe[17]=kt=>ns("recent"))},{default:Ee(()=>[_("span",QB,[e.workspaceSortMode==="recent"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),Je(" "+O(C(n)("sidebar.sortRecent")),1)]),_:1})]),_:1},8,["style"])):ae("",!0),Wt.value?(w(),xe(kl,{key:3,ref_key:"backendMenuRef",ref:lo,class:"backend-menu",style:Yt(Hn.value),onClick:Xe[19]||(Xe[19]=bt(()=>{},["stop"]))},{default:Ee(()=>[(w(),T(Pe,null,ot(r,kt=>re(pn,{key:kt,onClick:Ht=>Yn(kt)},{default:Ee(()=>[_("span",XB,[a(kt)?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",JB,O(kt),1),_("span",eD,O(l(kt)),1)]),_:2},1032,["onClick"])),64))]),_:1},8,["style"])):ae("",!0),d.value?(w(),xe(tB,{key:4,sessions:e.sessions,"active-id":e.activeId,onSelect:K,onClose:Xe[20]||(Xe[20]=kt=>d.value=!1)},null,8,["sessions","active-id"])):ae("",!0),(w(),xe(dm,{to:"body"},[vn.value?(w(),xe(C(to),{key:0,onClose:Xe[21]||(Xe[21]=kt=>vn.value=!1)})):ae("",!0)]))],6))}}),oD=ct(nD,[["__scopeId","data-v-1b04ce05"]]);function sD(e){try{const t=mo(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function iD(e,t){try{So(e,String(t))}catch{}}function rD(e){const{storageKey:t,defaultWidth:n,min:o,max:s,reverse:i=!1}=e;function r(v){return Number.isFinite(v)?Math.min(O4(s),Math.max(o,Math.round(v))):n}const l=X(r(sD(t)??n)),a=X(!1);function c(v){const m=r(v);l.value=m,iD(t,m)}let u=0,d=0,f=null,h=-1;function p(v){if(!a.value)return;const m=v.clientX-u;c(d+(i?-m:m))}function g(){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",g),f.removeEventListener("pointercancel",g)}f=null,h=-1}}function b(v){v.preventDefault(),a.value=!0,u=v.clientX,d=r(l.value),f=v.currentTarget,h=v.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",g),f.addEventListener("pointercancel",g)}return po(g),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:b}}const lD=["aria-label"],aD=Ze({__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}=Tt(),{width:i,dragging:r,onPointerDown:l}=rD({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:()=>n.max,reverse:n.reverse});return o("update:width",i.value),Qe(i,a=>o("update:width",a)),Qe(r,a=>o("update:dragging",a)),(a,c)=>(w(),T("div",{class:We(["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]=[_("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,lD))}}),fw=ct(aD,[["__scopeId","data-v-48fd0a6d"]]),cD={preview:"Preview",confirm:"Confirm",cancel:"Cancel"},uD={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"},dD={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"},fD={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"},hD={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"}},pD={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"},mD={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}"},gD={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."},vD={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"},yD={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"},kD={justNow:"just now"},bD={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"},xD={title:"Question",step:"Q{current}/{total}",back:"‹ Back",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},wD={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"},_D={panelTitle:"Thinking",close:"Close"},SD={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"},CD={},AD={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"}},MD={searching:"Searching…",noMatch:"No matches"},ED={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."}},TD={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"}},ND={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)"}},ID={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},LD={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"},$D={colorSchemeLabel:"Light/Dark",light:"Moon Bright",dark:"Moon Dark",system:"System",accentLabel:"Accent",accentBlue:"Blue",accentBlack:"Black"},FD={preview:"预览",confirm:"确认",cancel:"取消"},OD={authBannerMessage:"未登录 · 需要登录 Kimi Code 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 Kimi Code",authPageMessage:"先连接 Kimi Code 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",connectRetrying:"无法连接服务器,正在重试…",internalBuildBanner:"仅供内部测试"},RD={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:"没有匹配的会话"},BD={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:"此会话在完成前被中断"},DD={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:"收起"}},PD={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:"进行中"},HD={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}"},WD={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 进程后重试"},zD={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 关闭"},UD={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size} ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},qD={justNow:"刚刚"},jD={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:"拒绝并退出"},VD={title:"提问",step:"Q{current}/{total}",back:"‹ 返回",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},KD={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:"展开"},GD={panelTitle:"思考过程",close:"关闭"},YD={title:"改动",branch:"分支",aheadTitle:"领先远程",behindTitle:"落后远程",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},ZD={},QD={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:"无法读取这个文件"}},XD={searching:"搜索中…",noMatch:"无匹配"},JD={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:"目标描述太长了,请精简后重试。"}},eP={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:"撤销上一条消息"}},tP={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} 个)"}},nP={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},oP={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",groupSession:"当前会话",groupApp:"应用偏好",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"完全自主,不再提问",permYoloSub:"自动批准工具,仍可能提问",planModeSub:"计划模式",swarmModeSub:"Swarm 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回"},sP={colorSchemeLabel:"明暗",light:"月之亮面",dark:"月之暗面",system:"跟随系统",accentLabel:"主题色",accentBlue:"蓝色",accentBlack:"黑色"},iP={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"},rP={title:"欢迎来使用 Kimi Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},lP={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…"},aP={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:"正在加载全部归档会话…"},cP={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"},uP={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:"导出会话"},dP={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"},fP={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},hP={en:{common:cD,app:uD,sidebar:dD,workspace:fD,conversation:hD,status:pD,composer:mD,login:gD,providers:vD,model:yD,sessions:kD,approval:bD,question:xD,tasks:wD,thinking:_D,diff:SD,fileTree:CD,filePreview:AD,mention:MD,warnings:ED,commands:TD,tools:ND,layout:ID,mobile:LD,theme:$D,onboarding:iP,settings:lP,header:cP,sideChat:dP},zh:{common:FD,app:OD,sidebar:RD,workspace:BD,conversation:DD,status:PD,composer:HD,login:WD,providers:zD,model:UD,sessions:qD,approval:jD,question:VD,tasks:KD,thinking:GD,diff:YD,fileTree:ZD,filePreview:QD,mention:XD,warnings:JD,commands:eP,tools:tP,layout:nP,mobile:oP,theme:sP,onboarding:rP,settings:aP,header:uP,sideChat:fP}},_A=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function pP(){const e=mo(Ft.locale);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const _n=iI({legacy:!1,locale:pP(),fallbackLocale:"en",messages:hP});function SA(e){_n.global.locale.value=e,So(Ft.locale,e)}const Xo=_n.global.t,mP={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"},gP={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 Da(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return gP[t]??t}function Pa(e){const t=mP[Da(e)];return t?Xo(t):e}const vP={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 km(e){const t=Da(e);let n=vP[t];return!n&&(e??"").trim().toLowerCase().includes("skill")&&(n="bolt"),n||(n="tool"),yc(n,"sm")}const CA=80;function yP(e,t=CA){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function kP(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function bP(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 Zt(e){return typeof e=="string"&&e.length>0?e:void 0}function fl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function xP(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 f0(e){return Zt(e.path)??Zt(e.file_path)??Zt(e.filePath)??Zt(e.filename)}const wP={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function _P(e){const t=Zt(e);if(!t)return;const n=wP[t];return n?Xo(n):t}function SP(e){const t=fl(e.value),n=Zt(e.unit);if(!(t===void 0||!n))switch(n){case"turns":return Xo("tools.goal.turns",{value:t});case"tokens":return Xo("tools.goal.tokens",{value:t});case"milliseconds":return Xo("tools.goal.milliseconds",{value:t});case"seconds":return Xo("tools.goal.seconds",{value:t});case"minutes":return Xo("tools.goal.minutes",{value:t});case"hours":return Xo("tools.goal.hours",{value:t});default:return Xo("tools.goal.budget",{value:t,unit:n})}}const CP=64;function Ed(e,t,n=!1){const o=(s,i=CA)=>n?s.trim():yP(s,i);try{const s=bP(t);if(!n&&kP(t,s))return"";const i=()=>o(t.replace(/^·\s*/,""));if(!s)return i();switch(Da(e)){case"read":{const r=f0(s);if(!r)return i();const l=fl(s.offset)??fl(s.line_start)??fl(s.start_line),a=fl(s.limit)??fl(s.length),c=fl(s.line_end)??fl(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=f0(s);return r?o(`${r} ${Xo("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=f0(s);return r?o(r):i()}case"bash":{const r=Zt(s.command)??Zt(s.cmd)??Zt(s.script);return r?o(r,CP):i()}case"grep":case"search":{const r=Zt(s.pattern)??Zt(s.query)??Zt(s.regex),l=Zt(s.path)??Zt(s.glob)??Zt(s.include);return r&&l?o(`${r} in ${l}`):r?o(r):i()}case"glob":{const r=Zt(s.pattern)??Zt(s.glob)??Zt(s.query),l=Zt(s.path)??Zt(s.cwd);return r&&l?o(`${r} in ${l}`):r?o(r):Zt(s.path)?o(Zt(s.path)):i()}case"ls":{const r=Zt(s.path)??Zt(s.dir)??Zt(s.directory)??Zt(s.cwd);return r?o(r):i()}case"web_fetch":{const r=Zt(s.url)??Zt(s.uri);return r?o(xP(r)):i()}case"todo":case"task":{const r=Zt(s.description)??Zt(s.title)??Zt(s.prompt)??Zt(s.name)??Zt(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(Xo("tools.chip.todos",{count:l.length})):i()}case"creategoal":{if(n)return i();const r=Zt(s.objective),l=Zt(s.completionCriterion);return r&&l?o(Xo("tools.goal.objectiveWithCriterion",{objective:r,criterion:l})):r?o(r):i()}case"getgoal":return n?i():"";case"setgoalbudget":{if(n)return i();const r=SP(s);return r?o(r):i()}case"updategoal":{if(n)return i();const r=_P(s.status);return r?o(Xo("tools.goal.status",{status:r})):i()}default:return i()}}catch{return t}}function AP(e){try{switch(Da(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return Xo("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 Xo("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?Xo("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const MP=Ze({__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=B(()=>n(t.status));return(s,i)=>(w(),T("span",{class:We(["kw-dot",`kw-dot--${o.value}`]),"aria-hidden":"true"},null,2))}}),Td=ct(MP,[["__scopeId","data-v-e36198e5"]]),EP=["innerHTML"],TP={class:"bh-text"},NP={class:"a"},IP={key:0,class:"p"},LP={class:"rt"},$P=["aria-label"],FP={key:0,class:"tm"},OP=["inert"],RP={class:"bb-pad"},BP=Ze({__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=Kt("pinScroll",()=>{}),s=X(null);function i(){n("toggle");const r=s.value;r&&mt(()=>o(r))}return(r,l)=>(w(),T("div",{class:We(["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"}])},[_("div",{class:"bh",ref_key:"bhEl",ref:s,onClick:i},[e.icon?(w(),T("span",{key:0,class:"gl",innerHTML:e.icon,"aria-hidden":"true"},null,8,EP)):ae("",!0),_("span",TP,[_("span",NP,O(e.name),1),re(Xt,{text:e.arg},{default:Ee(()=>[e.arg?(w(),T("span",IP,O(e.arg),1)):ae("",!0)]),_:1},8,["text"])]),_("span",LP,[_("span",{class:We(["status",e.status]),role:"status","aria-label":e.status},[e.status==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):e.status==="error"?(w(),xe(Ve,{key:1,name:"close",size:"sm"})):e.status==="suspended"?(w(),xe(Td,{key:2,status:"suspended"})):(w(),xe(Td,{key:3,status:"running"}))],10,$P),On(r.$slots,"trailing"),e.time?(w(),T("span",FP,O(e.time),1)):ae("",!0)]),e.expandable?(w(),xe(Ve,{key:1,class:"car",name:e.open?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])):ae("",!0)],512),_("div",{class:We(["bb",{open:e.open}]),inert:!e.open},[_("div",RP,[On(r.$slots,"default")])],10,OP)],2))}}),bm=ct(BP,[["__scopeId","data-v-fef8aad2"]]),DP={key:0,class:"at-type"},PP={key:1,class:"at-task"},HP={key:2,class:"bb-code"},WP=Ze({__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}=Tt(),o=e,s=t;function i(v){if(!v)return{};try{const m=JSON.parse(v);return{description:typeof m.description=="string"?m.description:void 0,subagentType:typeof m.subagent_type=="string"?m.subagent_type:void 0,prompt:typeof m.prompt=="string"?m.prompt:void 0}}catch{return{}}}const r=B(()=>i(o.tool.arg)),l=B(()=>!!o.tool.output&&o.tool.output.length>0),a=B(()=>!!r.value.prompt||!!r.value.subagentType||l.value),c=X(o.tool.defaultExpanded===!0&&a.value),u=B(()=>o.tool.status),d=B(()=>Pa(o.tool.name)),f=B(()=>km(o.tool.name)),h=B(()=>r.value.description||r.value.subagentType||""),p=Kt("resolveAgentTaskId"),g=B(()=>p?p(o.tool.id)!==void 0:!0);function b(){a.value&&(c.value=!c.value)}return Qe(()=>[o.tool.defaultExpanded,o.tool.output?.length,o.tool.status],()=>{o.tool.defaultExpanded===!0&&a.value&&(c.value=!0)}),(v,m)=>(w(),xe(bm,{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:b},{trailing:Ee(()=>[g.value?(w(),T("button",{key:0,type:"button",class:"at-open",onClick:m[0]||(m[0]=bt(y=>s("openAgent",e.tool.id),["stop"]))},O(C(n)("tasks.openDetail")),1)):ae("",!0)]),default:Ee(()=>[r.value.subagentType?(w(),T("div",DP,O(r.value.subagentType),1)):ae("",!0),r.value.prompt?(w(),T("div",PP,O(r.value.prompt),1)):ae("",!0),l.value?(w(),T("div",HP,[(w(!0),T(Pe,null,ot(e.tool.output??[],(y,k)=>(w(),T("div",{key:k},O(y),1))),128))])):ae("",!0)]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),zP=ct(WP,[["__scopeId","data-v-14ef8750"]]);function UP(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 Uf={recognized:!1,answers:{},note:""};function qP(e){const t=e?.[0];if(!t)return Uf;let n;try{n=JSON.parse(t)}catch{return Uf}if(!n||typeof n!="object"||Array.isArray(n))return Uf;const o=n.answers;if(!o||typeof o!="object"||Array.isArray(o))return Uf;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 jP(e,t,n){return e[t]??e[`q_${n}`]}const VP=/^opt_\d+_(\d+)$/;function KP(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=VP.exec(l);c?s.add(Number(c[1])):l.length>0&&i.push(l)}return{selected:s,otherText:i.join(", "),indeterminate:!1}}const GP={key:0,class:"chip"},YP={key:0,class:"au-dismissed"},ZP={key:1,class:"au-list"},QP={class:"au-q"},XP={key:0,class:"au-hdr"},JP={class:"au-qtext"},eH={class:"au-opts"},tH={class:"au-glyph"},nH={class:"au-label"},oH={key:0,class:"au-desc"},sH={key:0,class:"au-opt sel"},iH={class:"au-glyph"},rH={class:"au-label"},lH={key:1,class:"au-opt sel"},aH={class:"au-label"},cH={key:2,class:"au-raw"},uH=80,dH=Ze({__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}=Tt();function o(N,x=uH){const I=N.trim();return I.length>x?I.slice(0,x-1)+"…":I}const s=B(()=>UP(t.tool.arg)),i=B(()=>qP(t.tool.output)),r=B(()=>i.value.recognized),l=B(()=>r.value&&Object.keys(i.value.answers).length===0&&i.value.note.length>0),a=B(()=>s.value.map((N,x)=>KP(jP(i.value.answers,N.question,x),N.options))),c=B(()=>Object.keys(i.value.answers).length);function u(N,x){return a.value[N]?.selected.has(x)??!1}function d(N){return a.value[N]?.otherText??""}function f(N){return a.value[N]?.indeterminate??!1}function h(N,x){return N?x?"■":"□":x?"●":"○"}const p=B(()=>{if(!r.value)return o(t.tool.output?.[0]??"");if(l.value)return n("tools.ask.dismissed");const N=s.value[0]?.question??"",x=o(N);return s.value.length<=1?x:`${x} ${n("tools.ask.more",{count:s.value.length-1})}`}),g=B(()=>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}):""),b=B(()=>!!t.tool.output&&t.tool.output.length>0),v=B(()=>r.value&&(s.value.length>0||l.value)||b.value),m=X(t.tool.defaultExpanded===!0&&v.value),y=B(()=>t.tool.status),k=B(()=>Pa(t.tool.name)),A=B(()=>km(t.tool.name));function $(){v.value&&(m.value=!m.value)}return Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status],()=>{t.tool.defaultExpanded===!0&&v.value&&(m.value=!0)}),(N,x)=>(w(),xe(bm,{status:y.value,icon:A.value,name:k.value,arg:m.value?"":p.value,time:e.tool.timing,open:m.value,expandable:v.value,stacked:e.stackPosition!=="single","stack-position":e.stackPosition,onToggle:$},{trailing:Ee(()=>[g.value?(w(),T("span",GP,O(g.value),1)):ae("",!0)]),default:Ee(()=>[l.value?(w(),T("div",YP,O(i.value.note),1)):r.value?(w(),T("div",ZP,[(w(!0),T(Pe,null,ot(s.value,(I,E)=>(w(),T("div",{key:E,class:"au-block"},[_("div",QP,[I.header?(w(),T("span",XP,O(I.header),1)):ae("",!0),_("span",JP,O(I.question),1)]),_("div",eH,[(w(!0),T(Pe,null,ot(I.options,(F,S)=>(w(),T("div",{key:S,class:We(["au-opt",{sel:u(E,S)}])},[_("span",tH,O(h(I.multiSelect,u(E,S))),1),_("span",nH,O(F.label),1),F.description?(w(),T("span",oH,O(F.description),1)):ae("",!0)],2))),128)),d(E)?(w(),T("div",sH,[_("span",iH,O(h(I.multiSelect,!0)),1),_("span",rH,O(d(E)),1)])):ae("",!0),f(E)?(w(),T("div",lH,[x[0]||(x[0]=_("span",{class:"au-glyph"},"●",-1)),_("span",aH,O(C(n)("tools.ask.answered")),1)])):ae("",!0)])]))),128))])):(w(),T("div",cH,[(w(!0),T(Pe,null,ot(e.tool.output??[],(I,E)=>(w(),T("div",{key:E},O(I),1))),128))]))]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),fH=ct(dH,[["__scopeId","data-v-a9a0f259"]]),hH=1e6,hw=5e3;function pw(e){if(e==="")return[];const t=e.split(`
68
- `);return t.at(-1)===""&&t.pop(),t}function pH(e,t){const n=pw(e),o=pw(t),s=n.length,i=o.length;if(s===0&&i===0)return[];if(s>hw||i>hw||(s+1)*(i+1)>hH)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 mH(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 AA(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 MA(e){const t=Da(e.name);if(t!=="edit"&&t!=="write")return null;const n=AA(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:pH(o,s)}return null}function gH(e){const t=AA(e);return t&&typeof t.path=="string"?t.path:void 0}function vH(e,t){for(const n of e){const o=n.tools?.find(s=>s.id===t);if(o)return o}}const yH={key:0,class:"bb-empty"},mw=50,kH=Ze({__name:"ToolOutputBlock",props:{lines:{},emptyText:{}},setup(e){const t=e,n=B(()=>t.lines??[]),o=B(()=>n.value.length>mw),s={"--tool-output-visible-lines":String(mw)};return(i,r)=>(w(),T("div",{class:We(["bb-code tool-output-block",{scroll:o.value}]),style:s},[n.value.length===0&&e.emptyText?(w(),T("div",yH,O(e.emptyText),1)):ae("",!0),(w(!0),T(Pe,null,ot(n.value,(l,a)=>(w(),T("div",{key:a},O(l),1))),128))],2))}}),EA=ct(kH,[["__scopeId","data-v-262bbea0"]]),bH={key:0,class:"chip"},xH={key:0,class:"bb-summary"},wH=Ze({__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=B(()=>n.tool.status),i=B(()=>Pa(n.tool.name)),r=B(()=>km(n.tool.name)),l=B(()=>Ed(n.tool.name,n.tool.arg)),a=B(()=>Ed(n.tool.name,n.tool.arg,!0)),c=B(()=>MA(n.tool)),u=B(()=>{const g=c.value;if(g&&n.tool.status!=="error"){const{added:b,removed:v}=mH(g);if(b||v)return`+${b} −${v}`}return""}),d=B(()=>!!n.tool.output&&n.tool.output.length>0),f=X(!1),h=B(()=>d.value&&!n.toolDiffPanel);function p(){if(n.toolDiffPanel){o("openToolDiff",n.tool.id);return}d.value&&(f.value=!f.value)}return(g,b)=>(w(),xe(bm,{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:Ee(()=>[u.value?(w(),T("span",bH,O(u.value),1)):ae("",!0)]),default:Ee(()=>[a.value?(w(),T("div",xH,O(a.value),1)):ae("",!0),re(EA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),_H=ct(wH,[["__scopeId","data-v-74e1da99"]]),SH={key:0,class:"chip"},CH={key:0,class:"bb-summary"},AH=Ze({__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=B(()=>t.tool.status==="running"&&/^bash$/i.test(t.tool.name)),o=B(()=>!!t.tool.output&&t.tool.output.length>0),s=B(()=>o.value||n.value),i=X(t.tool.defaultExpanded===!0&&s.value),r=B(()=>t.tool.status),l=B(()=>Pa(t.tool.name)),a=B(()=>km(t.tool.name)),c=B(()=>Ed(t.tool.name,t.tool.arg)),u=B(()=>Ed(t.tool.name,t.tool.arg,!0)),d=B(()=>AP({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 Qe(()=>[t.tool.defaultExpanded,t.tool.output?.length,t.tool.status,t.tool.name],()=>{t.tool.defaultExpanded===!0&&s.value&&(i.value=!0)}),(h,p)=>(w(),xe(bm,{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:Ee(()=>[d.value?(w(),T("span",SH,O(d.value),1)):ae("",!0)]),default:Ee(()=>[u.value?(w(),T("div",CH,O(u.value),1)):ae("",!0),re(EA,{lines:e.tool.output,"empty-text":"Waiting for output…"},null,8,["lines"])]),_:1},8,["status","icon","name","arg","time","open","expandable","stacked","stack-position"]))}}),MH=ct(AH,[["__scopeId","data-v-aa4edcb0"]]),EH={class:"media-title"},TH=["src","alt"],NH=["src"],IH=["src"],LH=Ze({__name:"MediaTool",props:{tool:{},mobile:{type:Boolean,default:!1}},emits:["openMedia"],setup(e,{emit:t}){const n=e,o=t,s=B(()=>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=B(()=>{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?(w(),T("div",{key:0,class:We(["media-tool",{mob:e.mobile}])},[re(Xt,{text:s.value.path||l.value},{default:Ee(()=>[_("div",EH,O(l.value),1)]),_:1},8,["text"]),s.value.kind==="image"?(w(),xe(Xt,{key:0,text:s.value.path||l.value},{default:Ee(()=>[_("button",{type:"button",class:"media-image-button",onClick:a},[_("img",{class:"media-image",src:s.value.url,alt:s.value.path?i(s.value.path):l.value,loading:"lazy"},null,8,TH)])]),_:1},8,["text"])):s.value.kind==="video"?(w(),T("video",{key:1,class:"media-video",src:s.value.url,controls:"",preload:"metadata"},null,8,NH)):(w(),T("audio",{key:2,class:"media-audio",src:s.value.url,controls:""},null,8,IH))],2)):ae("",!0)}}),$H=ct(LH,[["__scopeId","data-v-c05c114a"]]),FH=/<summary>([\s\S]*?)<\/summary>/,OH=/<resume_hint>([\s\S]*?)<\/resume_hint>/,h0=/<subagent\b([^>]*)>|<\/subagent>/g,RH="</subagent>",gw=/(completed|failed|aborted):\s*(\d+)/g,vw=/([a-z_]+)="([^"]*)"/g;function BH(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function DH(e){const t={};vw.lastIndex=0;let n;for(;(n=vw.exec(e))!==null;)t[n[1]]=BH(n[2]);return t}function PH(e){const t={completed:0,failed:0,aborted:0};gw.lastIndex=0;let n;for(;(n=gw.exec(e))!==null;){const o=n[1];t[o]=Number(n[2])}return t}function HH(e,t){const n=DH(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function WH(e){const t=[],n=[];h0.lastIndex=0;let o;for(;(o=h0.exec(e))!==null;)if(o[0]===RH){if(n.length===0)continue;const s=n.pop();s&&n.length===0&&t.push(HH(s.attrs,e.slice(s.bodyStart,o.index)))}else n.length===0?n.push({attrs:o[1]??"",bodyStart:h0.lastIndex}):n.push(null);return t}function zH(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=FH.exec(t)?.[1]?.trim()??"",{completed:o,failed:s,aborted:i}=PH(n),r=OH.exec(t)?.[1]?.trim(),l=WH(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 yw(e){return e?e.split(`
70
- `).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function UH(e){return e.suspendedReason||yw(e.text)||yw(e.outputLines?.join(`
71
- `))||e.summary||""}function qH(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(`
72
- `):e.summary??""}function jH(e){return e==="completed"?"completed":e==="failed"||e==="aborted"?"failed":"working"}function kw(e,t){return{id:e.agentId??e.item??`result-${t}`,name:e.item??`subagent ${t+1}`,activity:e.body.split(`
73
- `)[0]??"",phase:jH(e.outcome),body:e.body}}function VH(e,t){return!!(t.agentId&&e.id===t.agentId||t.item&&e.name.includes(t.item))}function KH(e,t){const n=e.map(s=>({id:s.id,name:s.name,activity:UH(s),phase:s.phase,body:qH(s)}));if(!t)return n;const o=t.subagents.filter(s=>(s.outcome==="aborted"||s.state==="not_started")&&!e.some(i=>VH(i,s))).map((s,i)=>kw(s,i));return n.length>0?[...n,...o]:t.subagents.map((s,i)=>kw(s,i))}const GH=["aria-expanded"],YH={class:"title"},ZH={key:0,class:"meta"},QH={key:1,class:"sum-txt"},XH={class:"rt"},JH={class:"status"},eW={key:0,class:"chip"},tW={key:1,class:"tm"},nW={class:"body"},oW={class:"overview"},sW={class:"overview-line"},iW={class:"big"},rW={key:0,class:"lbl"},lW={key:1,class:"lbl"},aW={key:2,class:"lbl"},cW={key:0,class:"seg","aria-hidden":"true"},uW={key:1,class:"legend"},dW=["aria-expanded","onClick"],fW={class:"mname"},hW={class:"mact"},pW={class:"mphase"},mW={key:1,class:"fallback-output"},gW={key:2,class:"waiting"},vW=Ze({__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}=Tt(),n=e;function o(E){if(!E)return{};try{const F=JSON.parse(E),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=Kt("resolveSwarmMembers"),i=B(()=>o(n.tool.arg)),r=B(()=>Pa(n.tool.name)),l=B(()=>i.value.description??""),a=B(()=>s?.(n.tool.id)??[]),c=B(()=>zH(n.tool.output)),u=B(()=>n.tool.status),d=B(()=>u.value==="running"?"running":u.value==="error"||(c.value?.failed??0)>0||(c.value?.aborted??0)>0?"error":"ok"),f=B(()=>KH(a.value,c.value)),h=B(()=>{const E={completed:0,working:0,suspended:0,queued:0,failed:0};for(const F of f.value)E[F.phase]++;return E}),p=B(()=>f.value.length||i.value.itemCount||0),g=B(()=>h.value.completed+h.value.failed),b=B(()=>h.value.working+h.value.suspended+h.value.queued),v=[{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"}],m=B(()=>v.map(({phase:E,cls:F})=>({phase:E,count:h.value[E],cls:F})).filter(E=>E.count>0)),y=X(u.value==="running"||b.value>0);function k(){y.value=!y.value}const A=B(()=>f.value.length>0||c.value||u.value==="running"?"":(n.tool.output??[]).join(`
74
- `).trim()),$=X(new Set);function N(E){const F=new Set($.value);F.has(E)?F.delete(E):F.add(E),$.value=F}function x(E){return $.value.has(E)}function I(E){return t(`tools.swarm.phase${E[0].toUpperCase()}${E.slice(1)}`)}return(E,F)=>(w(),T("div",{class:We(["swarm-card",{open:y.value,err:d.value==="error",stacked:e.stackPosition!=="single"}])},[_("button",{class:"head",type:"button","aria-expanded":y.value,onClick:k},[re(Ve,{class:"ic",name:"git-pull-request",size:"sm"}),_("span",YH,O(r.value),1),l.value?(w(),T("span",ZH,"·")):ae("",!0),l.value?(w(),T("span",QH,O(l.value),1)):ae("",!0),_("span",XH,[_("span",JH,[d.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):d.value==="error"?(w(),xe(Ve,{key:1,name:"close",size:"sm"})):(w(),xe(Td,{key:2,status:"running"}))]),g.value>0||p.value>0?(w(),T("span",eW,O(g.value)+" / "+O(p.value),1)):ae("",!0),e.tool.timing?(w(),T("span",tW,O(e.tool.timing),1)):ae("",!0)]),re(Ve,{class:"car",name:y.value?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,GH),Fn(_("div",nW,[_("div",oW,[_("div",sW,[_("span",iW,O(C(t)("tools.swarm.progress",{done:g.value,total:p.value})),1),d.value==="running"&&p.value>0?(w(),T("span",rW,O(C(t)("tools.swarm.runningSub",{count:b.value})),1)):c.value?(w(),T("span",lW,O(C(t)("tools.swarm.doneSub",{completed:c.value.completed,failed:c.value.failed+c.value.aborted})),1)):(w(),T("span",aW,O(C(t)("tools.swarm.waiting")),1))]),p.value>0&&m.value.length>0?(w(),T("div",cW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase,class:We(S.cls),style:Yt({flex:S.count})},null,6))),128))])):ae("",!0),m.value.length>1?(w(),T("div",uW,[(w(!0),T(Pe,null,ot(m.value,S=>(w(),T("span",{key:S.phase},[_("i",{class:We(["lg-dot",S.cls])},null,2),Je(O(I(S.phase))+" "+O(S.count),1)]))),128))])):ae("",!0)]),f.value.length>0?(w(!0),T(Pe,{key:0},ot(f.value,S=>(w(),T("div",{key:S.id,class:We(["member",[`phase-${S.phase}`,{open:x(S.id)}]])},[_("button",{class:"member-head",type:"button","aria-expanded":x(S.id),onClick:L=>N(S.id)},[re(Td,{class:"row-dot",status:S.phase},null,8,["status"]),re(Xt,{text:S.name},{default:Ee(()=>[_("span",fW,O(S.name),1)]),_:2},1032,["text"]),S.activity?(w(),xe(Xt,{key:0,text:S.activity},{default:Ee(()=>[_("span",hW,O(S.activity),1)]),_:2},1032,["text"])):ae("",!0),_("span",pW,O(I(S.phase)),1),re(Ve,{class:"mcar",name:x(S.id)?"chevron-down":"chevron-right",size:"sm"},null,8,["name"])],8,dW),Fn(_("div",{class:"member-body"},O(S.body),513),[[mi,x(S.id)]])],2))),128)):A.value?(w(),T("div",mW,O(A.value),1)):(w(),T("div",gW,O(C(t)("tools.swarm.waiting")),1))],512),[[mi,y.value]])],2))}}),yW=ct(vW,[["__scopeId","data-v-4b58e128"]]);function kW(e){if(e.media&&e.status==="ok")return $H;const t=Da(e.name);return t==="edit"||t==="write"||t==="multi_edit"?_H:t==="task"?zP:t==="agentswarm"?yW:t==="askuserquestion"?fH:MH}const TA=Ze({__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=B(()=>kW(n.tool));return(i,r)=>(w(),xe(jo(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 ir(e){if(e>=1024*1024)return`${bw(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):bw(t)}k`}return String(e)}function bw(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function bW(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 xm(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 xW(e){return!(e.tool.status==="ok"&&e.tool.media)}function wW(e,t){return t<=1?"single":e===0?"first":e===t-1?"last":"middle"}function _W(e){const t=xm(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(xW(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 SW(e){return xm(e).flatMap(t=>t.kind==="text"&&t.text?[t.text]:[]).join(`
75
-
76
- `)}function CW(e){const t=[];for(const n of xm(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 NA(e){return e.tool.id||`tool-${e.sourceIndex}`}function AW(e,t){return e.kind==="tool-stack"?`tool-stack-${e.tools[0]?.sourceIndex??t}`:e.kind==="tool"?NA({tool:e.tool,sourceIndex:e.sourceIndex}):`${e.kind}-${e.sourceIndex}`}const MW=["aria-expanded"],EW={class:"tg-title"},TW={class:"tg-meta"},NW=["inert"],IW={class:"tool-group-body-inner"},LW=Ze({__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=X(!0),i=B(()=>n.tools.length),r=B(()=>n.tools.some(h=>h.tool.status==="running")?"running":n.tools.some(h=>h.tool.status==="error")?"error":"done"),{t:l}=Tt(),a=B(()=>{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=Kt("pinScroll",()=>{}),d=X(null);function f(){c();const h=d.value;h&&mt(()=>u(h))}return(h,p)=>(w(),T("div",{class:We(["tool-group",{open:s.value}])},[_("button",{class:"tool-group-head",ref_key:"headEl",ref:d,type:"button","aria-expanded":s.value,onClick:f},[re(Td,{status:r.value},null,8,["status"]),re(Ve,{class:"tg-ic",name:"list",size:"sm"}),_("span",EW,O(C(l)("tools.group.title",i.value)),1),_("span",TW,"· "+O(a.value),1),re(Ve,{class:"tg-car",name:"chevron-right",size:"sm"})],8,MW),_("div",{class:We(["tool-group-body",{open:s.value}]),inert:!s.value},[_("div",IW,[(w(!0),T(Pe,null,ot(e.tools,(g,b)=>(w(),xe(TA,{key:C(NA)(g),tool:g.tool,mobile:e.mobile,"stack-position":C(wW)(b,e.tools.length),"tool-diff-panel":e.toolDiffPanel,onOpenMedia:p[0]||(p[0]=v=>o("openMedia",v)),onOpenFile:p[1]||(p[1]=v=>o("openFile",v)),onOpenToolDiff:p[2]||(p[2]=v=>o("openToolDiff",v)),onOpenAgent:p[3]||(p[3]=v=>o("openAgent",v))},null,8,["tool","mobile","stack-position","tool-diff-panel"]))),128))])],10,NW)],2))}}),$W=ct(LW,[["__scopeId","data-v-37eb334f"]]);var FW=Object.create,Hy=Object.defineProperty,OW=Object.getOwnPropertyDescriptor,IA=Object.getOwnPropertyNames,RW=Object.getPrototypeOf,BW=Object.prototype.hasOwnProperty,LA=(e,t)=>function(){return t||(0,e[IA(e)[0]])((t={exports:{}}).exports,t),t.exports},$A=e=>{let t={};for(var n in e)Hy(t,n,{get:e[n],enumerable:!0});return t},DW=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=IA(t),i=0,r=s.length,l;i<r;i++)l=s[i],!BW.call(e,l)&&l!==n&&Hy(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(o=OW(t,l))||o.enumerable});return e},FA=(e,t,n)=>(n=e!=null?FW(RW(e)):{},DW(Hy(n,"default",{value:e,enumerable:!0}),e));function PW(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 HW(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function WW(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 zW(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 UW(){return`</ol>
90
- </section>
91
- `}function qW(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 jW(){return`</li>
92
- `}function VW(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 KW(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=WW,e.renderer.rules.footnote_block_open=zW,e.renderer.rules.footnote_block_close=UW,e.renderer.rules.footnote_open=qW,e.renderer.rules.footnote_close=jW,e.renderer.rules.footnote_anchor=VW,e.renderer.rules.footnote_caption=HW,e.renderer.rules.footnote_anchor_name=PW;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 g=new l.Token("footnote_reference_open","",1);g.meta={label:p},g.level=l.level++,l.tokens.push(g);const b=l.bMarks[a],v=l.tShift[a],m=l.sCount[a],y=l.parentType,k=h,A=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let $=A;for(;h<f;){const x=l.src.charCodeAt(h);if(n(x))x===9?$+=4-$%4:$++;else break;h++}l.tShift[a]=h-k,l.sCount[a]=$-A,l.bMarks[a]=k,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=y,l.blkIndent-=4,l.tShift[a]=v,l.sCount[a]=m,l.bMarks[a]=b;const N=new l.Token("footnote_reference_close","",-1);return N.level=--l.level,l.tokens.push(N),!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 g=l.push("footnote_ref","",0);g.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 g=l.push("footnote_ref","",0);g.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,g=h.length;p<g;p++){const b=new l.Token("footnote_open","",1);if(b.meta={id:p,label:h[p].label},l.tokens.push(b),h[p].tokens){a=[];const y=new l.Token("paragraph_open","p",1);y.block=!0,a.push(y);const k=new l.Token("inline","",0);k.children=h[p].tokens,k.content=h[p].content,a.push(k);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 v;l.tokens[l.tokens.length-1].type==="paragraph_close"?v=l.tokens.pop():v=null;const m=h[p].count>0?h[p].count:1;for(let y=0;y<m;y++){const k=new l.Token("footnote_anchor","",0);k.meta={id:p,subId:y,label:h[p].label},l.tokens.push(k)}v&&l.tokens.push(v),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 GW(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 YW(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 ZW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function QW(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(ZW,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function XW(e){e.inline.ruler.after("emphasis","sub",QW)}const JW=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function ez(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(JW,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function tz(e){e.inline.ruler.after("emphasis","sup",ez)}var nz=LA({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(g,b){b=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},b),g.core.ruler.after("inline","github-task-lists",function(v){for(var m=v.tokens,y=0,k=2;k<m.length;k++)s(m,k)&&(i(m[k],y,b,v.Token),y+=1,n(m[k-2],"class",b.liClass),n(m[o(m,k-2)],"class",b.ulClass))})};function n(g,b,v){var m=g.attrIndex(b),y=[b,v];m<0?g.attrPush(y):g.attrs[m]=y}function o(g,b){for(var v=g[b].level-1,m=b-1;m>=0;m--)if(g[m].level===v)return m;return-1}function s(g,b){return d(g[b])&&f(g[b-1])&&h(g[b-2])&&p(g[b])}function i(g,b,v,m){var y=v.idPrefix+b;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(y,m)),g.children.push(a(m)),g.children.unshift(r(g,y,v,m)),v.divWrap&&(g.children.unshift(c(v,m)),g.children.push(u(m)))}function r(g,b,v,m){var y=new m("checkbox_input","input",0);return y.attrs=[["type","checkbox"],["id",b]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&y.attrs.push(["checked","true"]),v.disabled===!0&&y.attrs.push(["disabled","true"]),y}function l(g,b){var v=new b("label_open","label",1);return v.attrs=[["for",g]],v}function a(g){return new g("label_close","label",-1)}function c(g,b){var v=new b("checkbox_open","div",0);return v.attrs=[["class",g.divClass]],v}function u(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function p(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})}),oz=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))),sz=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),p0;const iz=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]]),rz=(p0=String.fromCodePoint)!==null&&p0!==void 0?p0: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 lz(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=iz.get(e))!==null&&t!==void 0?t:e}var Ro;(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"})(Ro||(Ro={}));const az=32;var bl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(bl||(bl={}));function nv(e){return e>=Ro.ZERO&&e<=Ro.NINE}function cz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_F||e>=Ro.LOWER_A&&e<=Ro.LOWER_F}function uz(e){return e>=Ro.UPPER_A&&e<=Ro.UPPER_Z||e>=Ro.LOWER_A&&e<=Ro.LOWER_Z||nv(e)}function dz(e){return e===Ro.EQUALS||uz(e)}var Oo;(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"})(Oo||(Oo={}));var vl;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vl||(vl={}));var fz=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Oo.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vl.Strict}startEntity(e){this.decodeMode=e,this.state=Oo.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Oo.EntityStart:return e.charCodeAt(t)===Ro.NUM?(this.state=Oo.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Oo.NamedEntity,this.stateNamedEntity(e,t));case Oo.NumericStart:return this.stateNumericStart(e,t);case Oo.NumericDecimal:return this.stateNumericDecimal(e,t);case Oo.NumericHex:return this.stateNumericHex(e,t);case Oo.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|az)===Ro.LOWER_X?(this.state=Oo.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Oo.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(nv(o)||cz(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(nv(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===Ro.SEMI)this.consumed+=1;else if(this.decodeMode===vl.Strict)return 0;return this.emitCodePoint(lz(this.result),this.consumed),this.errors&&(e!==Ro.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&bl.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=hz(n,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===vl.Attribute&&(s===0||dz(i))?0:this.emitNotTerminatedNamedEntity();if(o=n[this.treeIndex],s=(o&bl.VALUE_LENGTH)>>14,s!==0){if(i===Ro.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==vl.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]&bl.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]&~bl.VALUE_LENGTH:o[e+1],n),t===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case Oo.NamedEntity:return this.result!==0&&(this.decodeMode!==vl.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Oo.NumericDecimal:return this.emitNumericEntity(0,2);case Oo.NumericHex:return this.emitNumericEntity(0,3);case Oo.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Oo.EntityStart:return 0}}};function OA(e){let t="";const n=new fz(e,o=>t+=rz(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 hz(e,t,n,o){const s=(t&bl.BRANCH_LENGTH)>>7,i=t&bl.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 pz=OA(oz);OA(sz);function Wy(e,t=vl.Legacy){return pz(e,t)}var mz=FA(nz());const xw={};function gz(e){let t=xw[e];if(t)return t;t=xw[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 wm(e,t){typeof t!="string"&&(t=wm.defaultChars);const n=gz(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})}wm.defaultChars=";/?:@&=+$,#";wm.componentChars="";var ov=wm;const ww={};function vz(e){let t=ww[e];if(t)return t;t=ww[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 _m(e,t,n){typeof t!="string"&&(n=t,t=_m.defaultChars),typeof n>"u"&&(n=!0);const o=vz(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}_m.defaultChars=";/?:@&=+$,-_.!~*'()#";_m.componentChars="-_.!~*'()";var RA=_m;function zy(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 lp(){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 yz=/^([a-z0-9.+-]+:)/i,kz=/:[0-9]*$/,bz=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,xz=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
93
- `," "]),wz=["'"].concat(xz),_w=["%","/","?",";","#"].concat(wz),Sw=["/","?","#"],_z=255,Cw=/^[+a-z0-9A-Z_-]{0,63}$/,Sz=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Aw={javascript:!0,"javascript:":!0},Mw={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Cz(e,t){if(e&&e instanceof lp)return e;const n=new lp;return n.parse(e,t),n}lp.prototype.parse=function(e,t){let n,o,s,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=bz.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=yz.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&&Aw[r])&&(i=i.substr(2),this.slashes=!0)),!Aw[r]&&(s||r&&!Mw[r])){let c=-1;for(let p=0;p<Sw.length;p++)o=i.indexOf(Sw[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<_w.length;p++)o=i.indexOf(_w[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 g=0,b=p.length;g<b;g++){const v=p[g];if(v&&!v.match(Cw)){let m="";for(let y=0,k=v.length;y<k;y++)v.charCodeAt(y)>127?m+="x":m+=v[y];if(!m.match(Cw)){const y=p.slice(0,g),k=p.slice(g+1),A=v.match(Sz);A&&(y.push(A[1]),k.unshift(A[2])),k.length&&(i=k.join(".")+i),this.hostname=y.join(".");break}}}}this.hostname.length>_z&&(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),Mw[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lp.prototype.parseHost=function(e){let t=kz.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 Uy=Cz,BA=$A({decode:()=>ov,encode:()=>RA,format:()=>zy,parse:()=>Uy}),DA=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PA=/[\0-\x1F\x7F-\x9F]/,Az=/[\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]/,HA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,Mz=/[\$\+<->\^`\|~\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]/,WA=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Ez=$A({Any:()=>DA,Cc:()=>PA,Cf:()=>Az,P:()=>HA,S:()=>Mz,Z:()=>WA}),Tz=Object.defineProperty,zA=e=>{let t={};for(var n in e)Tz(t,n,{get:e[n],enumerable:!0});return t},xo=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}`}},Nz=zA({arrayReplaceAt:()=>Bz,assign:()=>Oz,countLines:()=>so,escapeHtml:()=>Vz,escapeRE:()=>Gz,fromCodePoint:()=>Id,has:()=>Fz,isMdAsciiPunct:()=>up,isPunctChar:()=>cp,isPunctCode:()=>sv,isSpace:()=>Rz,isString:()=>Lz,isValidEntityCode:()=>Cm,isWhiteSpace:()=>Nd,lib:()=>Yz,mdurl:()=>BA,normalizeReference:()=>Sm,ucmicro:()=>ap,unescapeAll:()=>Ld,unescapeMd:()=>Wz});const ap=Ez;function Iz(e){return Object.prototype.toString.call(e)}function Lz(e){return Iz(e)==="[object String]"}const $z=Object.prototype.hasOwnProperty;function Fz(e,t){return $z.call(e,t)}function Oz(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 Rz(e){return e===9||e===32}function Nd(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 cp(e){return ap.P.test(e)||ap.S.test(e)}const Ew=new Map;function sv(e){if(up(e))return!0;const t=Ew.get(e);if(t!==void 0)return t;const n=cp(String.fromCharCode(e));return Ew.set(e,n),n}function up(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 Sm(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Bz(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Cm(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 Id(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 UA=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,Dz=new RegExp(`${UA.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Pz=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Hz(e,t){if(t.charCodeAt(0)===35&&Pz.test(t)){const o=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Cm(o)?Id(o):e}const n=Wy(e);return n!==e?n:e}function Wz(e){return e.includes("\\")?e.replace(UA,"$1"):e}function Ld(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Dz,(t,n,o)=>n||Hz(t,o))}const zz=/[&<>"]/,Uz=/[&<>"]/g,qz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function jz(e){return qz[e]}function Vz(e){return zz.test(e)?e.replace(Uz,jz):e}const Kz=/[.?*+^$[\]\\(){}|-]/g;function Gz(e){return e.replace(Kz,"\\$&")}const Yz={mdurl:BA,ucmicro:ap};function so(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
94
- `,n+1))!==-1;)t++;return t}const Zz=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Qz=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Xz=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,qy=["references","footnotes","abbreviations","abbr","abbrs"],jy=Symbol.for("markdown-it-ts.global-state"),Vy=Object.prototype.hasOwnProperty;function Tw(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function $i(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Cl(e){if(Array.isArray(e))return e.map(t=>Cl(t));if($i(e)){const t={};for(const n of Object.keys(e))t[n]=Cl(e[n]);return t}return e}function dp(e){return Array.isArray(e)?e.map((t,n)=>String(n)):$i(e)?Object.keys(e):[]}function iv(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(!iv(e[n],t[n]))return!1;return!0}if($i(e)||$i(t)){if(!$i(e)||!$i(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(!Vy.call(t,s)||!iv(e[s],t[s]))return!1;return!0}return Object.is(e,t)}function qA(e,t){if(Array.isArray(e))return e[Number(t)];if($i(e))return e[t]}function Jz(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Cl(t[n]);return e}if($i(e)&&$i(t)){for(const n of Object.keys(e))Vy.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=Cl(t[n]);return e}return Cl(t)}function eU(e,t,n){const o=n.ownedKeys??[],s=e[t];if($i(s)||Array.isArray(s)){const i=new Set(dp(n.value));for(const r of o)n.existed&&i.has(r)?s[r]=Cl(qA(n.value,r)):delete s[r];!n.existed&&dp(s).length===0&&delete e[t];return}n.existed?e[t]=Cl(n.value):delete e[t]}function Ky(e){const t=e[jy];return Tw(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Tw(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function tU(e,t){Object.defineProperty(e,jy,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ts(e){return!e||!e.includes("]:")&&!e.includes("*[")?null:Zz.test(e)?"footnote-definition":Qz.test(e)?"abbreviation-definition":Xz.test(e)?"reference-definition":null}function Yd(e){return Ky(e)?.reason??null}function Pc(e,t,n){if(Yd(e)&&zr(e),!t)return n();Gy(e,t);try{const o=n();return Yy(e),o}catch(o){throw zr(e),o}}function Gy(e,t){try{zr(e);const n={};for(const o of qy)n[o]=Vy.call(e,o)?{existed:!0,value:Cl(e[o])}:{existed:!1};tU(e,{reason:t,snapshot:n})}catch{}}function Yy(e){const t=Ky(e);if(t)for(const n of qy){const o=t.snapshot[n];if(!o)continue;o.ownedKeys=[];const s=e[n];if(!$i(s)&&!Array.isArray(s))continue;const i=new Set(dp(o.existed?o.value:void 0));o.ownedKeys=dp(s).filter(r=>i.has(r)?!iv(s[r],qA(o.value,r)):!0)}}function zr(e){const t=Ky(e);if(t){for(const n of qy){const o=t.snapshot[n];if(!o){delete e[n];continue}if(o.ownedKeys){eU(e,n,o);continue}o.existed?e[n]=Jz(e[n],o.value):delete e[n]}delete e[jy]}}const rv=Symbol.for("markdown-it-ts.diagnostics");function Am(e,t){if(e)try{const n=e[rv];if(n&&typeof n=="object")return n;if(!t)return;const o={};return e[rv]=o,o}catch{return}}function _r(e){return Am(e,!1)}function nU(e){if(e)try{const t=e[rv];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable)}catch{}}function us(e){nU(e)}function yo(e,t){const n=Am(e,!0);n&&(n.strategy=t)}function m0(e,t){const n=Am(e,!0);n&&(n.chunk=t)}function jA(e,t){const n=Am(e,!0);n&&(n.unbounded=t)}function oU(e){const t={};e=e||{},t.src_Any=DA.source,t.src_Cc=PA.source,t.src_Z=WA.source,t.src_P=HA.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 lv(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Mm(e){return Object.prototype.toString.call(e)}function sU(e){return Mm(e)==="[object String]"}function iU(e){return Mm(e)==="[object Object]"}function rU(e){return Mm(e)==="[object RegExp]"}function Nw(e){return Mm(e)==="[object Function]"}function lU(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const VA={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function aU(e){return Object.keys(e||{}).reduce(function(t,n){return t||VA.hasOwnProperty(n)},!1)}const cU={"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}}},uU="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]",dU="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function fU(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function Iw(){return function(e,t){t.normalize(e)}}function fp(e){const t=e.re=oU(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(uU),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,iU(a)){rU(a.validate)?c.validate=fU(a.validate):Nw(a.validate)?c.validate=a.validate:i(l,a),Nw(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Iw();return}if(sU(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:Iw()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(lU).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 KA(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 ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||aU(e)&&(t=e,e={}),this.__opts__=lv({},VA,t),this.__schemas__=lv({},cU,e),this.__compiled__={},this.__tlds__=dU,this.__tlds_replaced__=!1,this.re={},fp(this)}ei.prototype.add=function(t,n){return this.__schemas__[t]=n,fp(this),this};ei.prototype.set=function(t){return this.__opts__=lv(this.__opts__,t),this};ei.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)};ei.prototype.pretest=function(t){return this.re.pretest.test(t)};ei.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};ei.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 KA(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};ei.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 KA(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[s.schema].normalize(s,this),s};ei.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(),fp(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,fp(this),this)};ei.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};ei.prototype.onCompile=function(){};var GA=ei,hU=LA({"../../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"},g=35,b=Math.floor,v=String.fromCharCode;function m(D){throw new RangeError(p[D])}function y(D,z){const H=[];let U=D.length;for(;U--;)H[U]=z(D[U]);return H}function k(D,z){const H=D.split("@");let U="";H.length>1&&(U=H[0]+"@",D=H[1]),D=D.replace(h,".");const Z=y(D.split("."),z).join(".");return U+Z}function A(D){const z=[];let H=0;const U=D.length;for(;H<U;){const Z=D.charCodeAt(H++);if(Z>=55296&&Z<=56319&&H<U){const K=D.charCodeAt(H++);(K&64512)==56320?z.push(((Z&1023)<<10)+(K&1023)+65536):(z.push(Z),H--)}else z.push(Z)}return z}const $=D=>String.fromCodePoint(...D),N=function(D){return D>=48&&D<58?26+(D-48):D>=65&&D<91?D-65:D>=97&&D<123?D-97:36},x=function(D,z){return D+22+75*(D<26)-((z!=0)<<5)},I=function(D,z,H){let U=0;for(D=H?b(D/700):D>>1,D+=b(D/z);D>g*26>>1;U+=36)D=b(D/g);return b(U+(g+1)*D/(D+38))},E=function(D){const z=[],H=D.length;let U=0,Z=128,K=72,V=D.lastIndexOf("-");V<0&&(V=0);for(let J=0;J<V;++J)D.charCodeAt(J)>=128&&m("not-basic"),z.push(D.charCodeAt(J));for(let J=V>0?V+1:0;J<H;){const fe=U;for(let ce=1,ue=36;;ue+=36){J>=H&&m("invalid-input");const Se=N(D.charCodeAt(J++));Se>=36&&m("invalid-input"),Se>b((2147483647-U)/ce)&&m("overflow"),U+=Se*ce;const Te=ue<=K?1:ue>=K+26?26:ue-K;if(Se<Te)break;const Ae=36-Te;ce>b(2147483647/Ae)&&m("overflow"),ce*=Ae}const oe=z.length+1;K=I(U-fe,oe,fe==0),b(U/oe)>2147483647-Z&&m("overflow"),Z+=b(U/oe),U%=oe,z.splice(U++,0,Z)}return String.fromCodePoint(...z)},F=function(D){const z=[];D=A(D);const H=D.length;let U=128,Z=0,K=72;for(const fe of D)fe<128&&z.push(v(fe));const V=z.length;let J=V;for(V&&z.push("-");J<H;){let fe=2147483647;for(const ce of D)ce>=U&&ce<fe&&(fe=ce);const oe=J+1;fe-U>b((2147483647-Z)/oe)&&m("overflow"),Z+=(fe-U)*oe,U=fe;for(const ce of D)if(ce<U&&++Z>2147483647&&m("overflow"),ce===U){let ue=Z;for(let Se=36;;Se+=36){const Te=Se<=K?1:Se>=K+26?26:Se-K;if(ue<Te)break;const Ae=ue-Te,P=36-Te;z.push(v(x(Te+Ae%P,0))),ue=b(Ae/P)}z.push(v(x(ue,0))),K=I(Z,oe,J===V),Z=0,++J}++Z,++U}return z.join("")},R={version:"2.3.1",ucs2:{decode:A,encode:$},decode:E,encode:F,toASCII:function(D){return k(D,function(z){return f.test(z)?"xn--"+F(z):z})},toUnicode:function(D){return k(D,function(z){return d.test(z)?E(z.slice(4).toLowerCase()):z})}};t.exports=R})}),YA=FA(hU());function Zy(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=Ld(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=Ld(e.slice(t,s)),i.pos=s,i.ok=!0),i}var ZA=Zy;const bh=-2;function pU(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 bh}i++;continue}if(r===92){i+=2;continue}if(r===96||r===60||r===33&&i+1<n&&e.charCodeAt(i+1)===91)return bh;if(r===91){s++,i++;continue}i++}return-1}function Qy(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=pU(l,t,a,n);if(f!==bh)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 hp=Qy;function Xy(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+=Ld(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+=Ld(e.slice(t,i)),r}var QA=Xy;function Em(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 Jy(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function mU(e,t,n){const o=Em(e,t),s=[t,n];o<0?Jy(e,s):e.attrs[o]=s}function gU(e,t){const n=Em(e,t);return n>=0?e.attrs[n][1]:null}function vU(e,t,n){const o=Em(e,t);o<0?Jy(e,[t,n]):e.attrs[o][1]=`${e.attrs[o][1]} ${n}`}var yU=zA({attrGet:()=>gU,attrIndex:()=>Em,attrJoin:()=>vU,attrPush:()=>Jy,attrSet:()=>mU,parseLinkDestination:()=>Zy,parseLinkLabel:()=>Qy,parseLinkTitle:()=>Xy});function kU(e){return e.includes("\r")||e.includes("\0")}function XA(e){return typeof e=="string"?e:e.toString()}function bU(e){if(e.inlineMode){const t=new xo("inline","",0);t.content=XA(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 xU=/^([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])?)*)$/,wU=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function _U(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(wU.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(xU.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 SU=_U;function CU(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 AU=CU;function Lw(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 MU(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lw(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Lw(t[o].delimiters)}var EU=MU;function TU(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const s=e.scanDelims(e.pos,o===42);if(!s||s.length===0)return!1;for(let i=0;i<s.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close})}return e.pos+=s.length,!0}function $w(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const s=t[o];if(s.marker!==95&&s.marker!==42||s.end===-1)continue;const i=t[s.end],r=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===s.marker&&t[o-1].token===s.token-1&&t[s.end+1].token===i.token+1,l=String.fromCharCode(s.marker),a=e.tokens[s.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[s.end+1].token].content="",o--)}}function NU(e){const t=e.tokens_meta,n=e.tokens_meta.length;$w(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&$w(e,t[o].delimiters)}const Fw={tokenize:TU,postProcess:NU};function JA(e){return Wy(e)}function ek(e){return e>=48&&e<=57}function IU(e){const t=e|32;return ek(e)||t>=97&&t<=102}function e6(e){const t=e|32;return t>=97&&t<=122}function LU(e){return e6(e)||ek(e)}function $U(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?IU(l):ek(l)))break;o++}return o===r||o>=n||e.charCodeAt(o)!==59?null:e.slice(t,o+1)}function FU(e,t,n){let o=t+1;if(o>=n||!e6(e.charCodeAt(o)))return null;for(o++;o<n&&o-t-1<32&&LU(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 JA(s)!==s?s:null}function OU(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=$U(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=Cm(i)?Id(i):Id(65533),r.markup=s,r.info="entity"}return e.pos+=s.length,!0}}else{const s=FU(e.src,n,o);if(s){const i=JA(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 RU=OU;const t6=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),av=new Array(128),n6=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);av[e]=`\\${t}`,n6[e]=t6[e]?t:av[e]}function Ow(e,t,n){e.pending&&e.pushPending();const o=new xo("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 BU(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):(Ow(e,n6[i],av[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 Ow(e,i<256&&t6[i]?r:l,l),e.pos=n+1,!0}var DU=BU;function PU(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 HU=PU;const o6=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,s6="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",WU=new RegExp(`^(?:${o6}|${s6}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),zU=new RegExp(`^(?:${o6}|${s6})`);function i6(e){return e===32||e===9||e===10||e===12||e===13}function UU(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||i6(t)}function qU(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(!i6(n))return!1}return!1}function jU(e){const t=e|32;return t>=97&&t<=122}function VU(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&&!jU(i))return!1;const r=s.slice(o).match(WU);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,UU(l)&&e.linkLevel++,qU(l)&&e.linkLevel--}return e.pos+=l.length,!0}var KU=VU;function GU(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=hp(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=ZA(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=QA(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=hp(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[Sm(s)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){o=e.src.slice(h,p);const g=[];e.md.inline.parse(o,e.md,e.env,g);const b=e.push("image","img",0);b.attrs=[["src",u],["alt",""]],b.children=g,b.content=o,a&&b.attrs.push(["title",a])}return e.pos=i,e.posMax=f,!0}var YU=GU;function ZU(e,t){let n,o,s,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,f=e.pos+1,h=hp(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(c=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(p>=d)return!1;if(s=ZA(e.src,p,e.posMax),s.ok){for(r=e.md.normalizeLink(s.str),e.md.validateLink(r)?p=s.pos:r="",a=p;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);if(s=QA(e.src,p,e.posMax),p<d&&a!==p&&s.ok)for(l=s.str,p=s.pos;p<d&&(n=e.src.charCodeAt(p),!(n!==32&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(c=!0),p++}if(c){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(a=p+1,p=hp(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[Sm(o)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=f,e.posMax=h;const g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,l&&b.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}var QU=ZU;function r6(e){const t=e|32;return t>=97&&t<=122}function XU(e){return e>=48&&e<=57}function JU(e){return r6(e)||XU(e)||e===43||e===45||e===46}function eq(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&JU(e.charCodeAt(t));)t--;return t++,t>=e.length||!r6(e.charCodeAt(t))?null:e.slice(t)}function tq(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 nq(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=eq(e.pending);if(!s)return!1;const i=tq(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 oq(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 sq=oq;function iq(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 Rw(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 rq(e){const t=e.delimiters;Rw(e,t);const n=e.tokens_meta;if(n)for(let o=0;o<n.length;o++)n[o]&&n[o].delimiters&&Rw(e,n[o].delimiters)}const Bw={tokenize:iq,postProcess:rq};function Dw(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 lq(e,t){const n=e.src,o=e.pos,s=e.posMax;if(o>=s||Dw(n.charCodeAt(o)))return!1;let i=o+1;for(;i<s&&!Dw(n.charCodeAt(i));)i++;return t||(e.pending+=i===o+1?n.charAt(o):n.slice(o,i)),e.pos=i,!0}var aq=lq;function tk(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function cq(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 uq(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 l6(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:tk(),records:Object.create(null)};return t.__mdtsRuleProfile=o,o}function Hc(e,t,n,o,s,i){const r=l6(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=uq(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=tk()}function dq(e){const t=l6(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=cq(s.samples)}return t.completedAt=tk(),t}var Pw=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}},a6=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 xo("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 xo(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 xo(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=Nd(l),u=Nd(a),d=sv(l),f=sv(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}}};a6.prototype.Token=xo;const fq=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function c6(e){return!fq.test(e)}var hq=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Pw,this.ruler2=new Pw,this.ruler.push("text",aq),this.ruler.push("linkify",nq),this.ruler.push("newline",sq),this.ruler.push("escape",DU),this.ruler.push("backticks",AU),this.ruler.push("strikethrough",Bw.tokenize),this.ruler.push("emphasis",Fw.tokenize),this.ruler.push("link",QU),this.ruler.push("image",YU),this.ruler.push("autolink",SU),this.ruler.push("html_inline",KU),this.ruler.push("entity",RU),this.ruler2.push("balance_pairs",EU),this.ruler2.push("strikethrough",Bw.postProcess),this.ruler2.push("emphasis",Fw.postProcess),this.ruler2.push("fragments_join",HU),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(Hc(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(Hc(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()&&c6(e)){const a=new xo("text","",0);a.content=e,o.push(a);return}const s=new a6(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();Hc(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 pq(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&&c6(i.content)){const r=new xo("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const mq=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,gq=/[0-9a-z]/i;function vq(e){return/^<a[>\s]/i.test(e)}function yq(e){return/^<\/a\s*>/i.test(e)}function kq(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(!mq.test(o)||!gq.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 bq(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"&&(vq(l.content)&&i>0&&i--,yq(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=>kq(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],g=e.md.normalizeLink(p.url);if(!e.md.validateLink(g))continue;let b=p.text;p.schema?p.schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText(`mailto:${b}`).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText(`http://${b}`).replace(/^http:\/\//,"");const v=p.index;if(v>f){const A=new xo("text","",0);A.content=a.slice(f,v),A.level=d,u.push(A)}const m=new xo("link_open","a",1);m.attrs=[["href",g]],m.level=d++,m.markup="linkify",m.info="auto",u.push(m);const y=new xo("text","",0);y.content=b,y.level=d,u.push(y);const k=new xo("link_close","a",-1);k.level=--d,k.markup="linkify",k.info="auto",u.push(k),f=p.lastIndex}if(f!==0){if(f<a.length){const h=new xo("text","",0);h.content=a.slice(f),h.level=d,u.push(h)}s.splice(r,1,...u)}}}}const xq=/\r\n?|\n/g,wq=/\0/g;function _q(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(xq,`
96
- `)),o&&(s=s.replace(wq,"�")),e.src=s}const u6=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Sq=/\((?:c|tm|r)\)/i,Cq=/\((c|tm|r)\)/gi,Aq={c:"©",r:"®",tm:"™"};function Mq(e,t){return Aq[t.toLowerCase()]}function Eq(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(Cq,Mq)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function Tq(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&u6.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 Nq(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(""):"");Sq.test(o)&&Eq(n.children||[]),u6.test(o)&&Tq(n.children||[])}}var Iq=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 Lq=/['"]/,Hw=/['"]/g,Ww="’";function qf(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function $q(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;){Hw.lastIndex=c;const d=Hw.exec(a);if(!d)break;let f=!0,h=!0;c=d.index+1;const p=d[0]==="'";let g=32;if(d.index-1>=0)g=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){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<u)b=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}const v=up(g)||cp(String.fromCharCode(g)),m=up(b)||cp(String.fromCharCode(b)),y=Nd(g),k=Nd(b);if(k?f=!1:m&&(y||v||(f=!1)),y?h=!1:v&&(k||m||(h=!1)),b===34&&d[0]==='"'&&g>=48&&g<=57&&(h=f=!1),f&&h&&(f=v,h=m),!f&&!h){p&&(r.content=qf(r.content,d.index,Ww));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 $,N;p?($=s[2]||"‘",N=s[3]||"’"):($=s[0]||"“",N=s[1]||"”"),r.content=qf(r.content,d.index,N),e[A.token].content=qf(e[A.token].content,A.pos,$),c+=N.length-1,A.token===i&&(c+=$.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=qf(r.content,d.index,Ww))}}}function Fq(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("");!Lq.test(o)||!n.children||$q(n.children,e)}}function Oq(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 Rq=/^(?:vbscript|javascript|file|data):/,Bq=/^data:image\/(?:gif|png|jpeg|webp);/,d6=["http:","https:","mailto:"];function f6(e){const t=e.trim().toLowerCase();return Rq.test(t)?Bq.test(t):!0}function h6(e){const t=Uy(e,!0);if(t.hostname&&(!t.protocol||d6.includes(t.protocol)))try{t.hostname=YA.default.toASCII(t.hostname)}catch{}return RA(zy(t))}function p6(e){const t=Uy(e,!0);if(t.hostname&&(!t.protocol||d6.includes(t.protocol)))try{t.hostname=YA.default.toUnicode(t.hostname)}catch{}return ov(zy(t),`${ov.defaultChars}%`)}function Dq(e){switch(e){case 9:case 32:return!0}return!1}function Pq(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=[],g=[],b=[],v=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.parentType;e.parentType="blockquote";let y=!1,k;for(k=t;k<n;k++){const I=a[k]<e.blkIndent;if(u=i[k]+l[k],d=r[k],u>=d)break;if(s.charCodeAt(u++)===62&&!I){let F=a[k]+1,S,L;s.charCodeAt(u)===32?(u++,F++,L=!1,S=!0):s.charCodeAt(u)===9?(S=!0,(c[k]+F)%4===3?(u++,F++,L=!1):L=!0):S=!1;let R=F;for(h.push(i[k]),i[k]=u;u<d;){const D=s.charCodeAt(u);if(Dq(D))D===9?R+=4-(R+c[k]+(L?1:0))%4:R++;else break;u++}y=u>=d,p.push(c[k]),c[k]=a[k]+1+(S?1:0),g.push(a[k]),a[k]=R-F,b.push(l[k]),l[k]=u-i[k];continue}if(y)break;let E=!1;for(let F=0,S=v.length;F<S;F++)if(v[F](e,k,n,!0)){E=!0;break}if(E){e.lineMax=k,e.blkIndent!==0&&(h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]-=e.blkIndent);break}h.push(i[k]),p.push(c[k]),b.push(l[k]),g.push(a[k]),a[k]=-1}const A=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const N=[t,0];$.map=N,e.md.block.tokenize(e,t,k);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=f,e.parentType=m,N[1]=e.line;for(let I=0;I<b.length;I++)i[I+t]=h[I],l[I+t]=b[I],a[I+t]=g[I],c[I+t]=p[I];return e.blkIndent=A,!0}function Hq(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 Wq(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 zw=["","h1","h2","h3","h4","h5","h6"],Uw=["","#","##","###","####","#####","######"];function qw(e){switch(e){case 9:case 32:return!0}return!1}function zq(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&&!qw(u))return!1;if(o)return!0;c=e.skipSpacesBack(c,a);const f=e.skipCharsBack(c,35,a);f>a&&qw(s.charCodeAt(f-1))&&(c=f),e.line=t+1;const h=e.push("heading_open",zw[d],1);h.markup=Uw[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 g=e.push("heading_close",zw[d],-1);return g.markup=Uw[d],!0}function Uq(e){switch(e){case 9:case 32:return!0}return!1}function qq(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&&!Uq(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 ic=[[/^<(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(`${zU.source}\\s*$`),/^$/,!1]];function jq(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<ic.length&&!ic[l][0].test(r);l++);if(l===ic.length)return!1;if(o)return ic[l][2];let a=t+1;if(!ic[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),ic[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 jw(e){switch(e){case 9:case 32:return!0}return!1}const td={Pipe:1,ParagraphTerminator:2};function Vq(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 m6=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|=td.Pipe|td.ParagraphTerminator),!a)if(jw(f)){i++,f===9?r+=4-r%4:r++;continue}else a=!0,Vq(f)&&(c|=td.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 xo(e,t,0);return s.block=!0,s.level=this.level,this.tokens.push(s),s}const o=new xo(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 g=this.src,b=this.bsCount,v=this.tShift;for(;f<h&&p<n;){const m=g.charCodeAt(f);if(m===9||m===32)m===9?p+=4-(p+b[u])%4:p++;else if(f-d<v[u])p++;else break;f++}return p>n?new Array(p-n+1).join(" ")+g.slice(f,h):g.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,g;for(d+1<t||o?g=l[d]+1:g=l[d];p<g&&f<n;){const b=i.charCodeAt(p);if(jw(b))b===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,g):s[u]=i.slice(p,g)}return s.join("")}};m6.prototype.Token=xo;function Kq(e,t,n){for(let o=t;o<n;o++)if(e.charCodeAt(o)===124)return!0;return!1}function g6(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function v6(e,t,n,o,s){if(e.lineFlags&&(e.lineFlags[t]&td.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:Kq(n,o,s)}const Vw=["","h1","h2"];function Gq(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=g6(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 k=i[p]+r[p],A=l[p];if(k>=A)break;if(a[p]-c>3)continue;if(a[p]>=c&&(h=s.charCodeAt(k),h===45||h===61)){let N=k+1,x=N;for(;N<A&&s.charCodeAt(N)===h;)N++;for(x=N;N<A;){const I=s.charCodeAt(N);if(I!==9&&I!==32)break;N++}if(N>=A){f=h===61?1:2;break}if(x-k>1)continue}if(a[p]<0||u&&!v6(e,p,s,k,A))continue;let $=!1;for(let N=0,x=o.length;N<x;N++)if(o[N](e,p,n,!0)){$=!0;break}if($)break}if(!f)return!1;let g;if(p===t+1){const k=i[t]+r[t];let A=l[t];for(;A>k;){const $=s.charCodeAt(A-1);if($!==9&&$!==32)break;A--}g=s.slice(k,A)}else g=e.getLines(t,p,c,!1).trim();e.line=p+1;const b=h===61?"=":"-",v=e.push("heading_open",Vw[f],1);v.markup=b,v.map=[t,e.line];const m=e.push("inline","",0);m.content=g,m.map=[t,e.line-1],m.children=[];const y=e.push("heading_close",Vw[f],-1);return y.markup=b,e.parentType=d,!0}function y6(e){switch(e){case 9:case 32:return!0}return!1}function Kw(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&&!y6(i.charCodeAt(l))?-1:l}function Gw(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),!y6(c))?-1:a}function Yq(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 Zq=["0","1","2","3","4","5","6","7","8","9"];function Qq(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 Xq(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,g=e.tShift,b=e.eMarks,v=e.sCount,m=e.bsCount,y=p[l]+g[l];if(y>=b[l])return!1;const k=h.charCodeAt(y);if(k>=48&&k<=57){if(f=Gw(e,l),f<0||(u=!0,r=y,d=Yq(e,l,f),c&&d!==1))return!1}else if(k===42||k===45||k===43){if(f=Kw(e,l),f<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(f)>=b[l])return!1;if(o)return!0;const A=h.charCodeAt(f-1),$=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 N=[l,0];e.tokens[e.tokens.length-1].map=N,e.tokens[e.tokens.length-1].markup=$;let x=!1;const I=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";l<n;){i=f,s=b[l];const S=v[l]+f-(p[l]+g[l]);let L=S;for(;i<s;){const oe=h.charCodeAt(i);if(oe===9)L+=4-(L+m[l])%4;else if(oe===32)L++;else break;i++}const R=i;let D;R>=s?D=1:D=L-S,D>4&&(D=1);const z=S+D,H=e.push("list_item_open","li",1);H.markup=$;const U=[l,0];H.map=U,u&&(H.info=f-r-1===1?Zq[h.charCodeAt(r)-48]:h.slice(r,f-1));const Z=e.tight,K=e.tShift[l],V=e.sCount[l],J=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=z,e.tight=!0,e.tShift[l]=R-p[l],e.sCount[l]=L,R>=s&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||x)&&(a=!1),x=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=J,e.tShift[l]=K,e.sCount[l]=V,e.tight=Z,e.push("list_item_close","li",-1).markup=$,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 oe=0,ce=E.length;oe<ce;oe++)if(E[oe](e,l,n,!0)){fe=!0;break}if(fe)break;if(u){if(f=Gw(e,l),f<0)break;r=p[l]+g[l]}else if(f=Kw(e,l),f<0)break;if(A!==h.charCodeAt(f-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,N[1]=l,e.line=l,e.parentType=F,a&&Qq(e,I),!0}function Yw(e){return e===9||e===32}function Jq(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=g6(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 y=r[f]+l[f],k=a[f];if(y<k){const A=i.charCodeAt(y);if(A===42||A===45||A===43){if(y+1>=k||Yw(i.charCodeAt(y+1)))break}else if(A>=48&&A<=57&&y+1<k){let $=y+1;for(;;){if($>=k){$=-1;break}const N=i.charCodeAt($++);if(N>=48&&N<=57){if($-y>=10){$=-1;break}continue}if((N===41||N===46)&&($>=k||Yw(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const b=r[f]+l[f],v=a[f];if(d&&!v6(e,f,i,b,v))continue;let m=!1;for(let y=0,k=o.length;y<k;y++)if(o[y](e,f,n,!0)){m=!0;break}if(m)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 g=e.push("inline","",0);return g.content=h,g.map=[t,e.line],g.children=[],e.push("paragraph_close","p",-1),e.parentType=s,!0}function jf(e){switch(e){case 9:case 32:return!0}return!1}function ej(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(y){const k=e.lineMax;if(y>=k||e.isEmpty(y))return null;let A=!1;if(e.sCount[y]-e.blkIndent>3&&(A=!0),e.sCount[y]<0&&(A=!0),!A){const x=e.parentType;e.parentType="reference";let I=!1;for(let E=0,F=l.length;E<F;E++)if(l[E](e,y,k,!0)){I=!0;break}if(e.parentType=x,I)return null}const $=e.bMarks[y]+e.tShift[y],N=e.eMarks[y];return e.src.slice($,N+1)}let c=e.src.slice(s,i+1);i=c.length;let u=-1;for(s=1;s<i;s++){const y=c.charCodeAt(s);if(y===91)return!1;if(y===93){u=s;break}else if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(y===92&&(s++,s<i&&c.charCodeAt(s)===10)){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(s=u+2;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!jf(y))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,g=s;for(;s<i;s++){const y=c.charCodeAt(s);if(y===10){const k=a(r);k!==null&&(c+=k,i=c.length,r++)}else if(!jf(y))break}let b=e.md.helpers.parseLinkTitle(c,s,i);for(;b.can_continue;){const y=a(r);if(y===null)break;c+=y,s=i,i=c.length,r++,b=e.md.helpers.parseLinkTitle(c,s,i,b)}let v;for(s<i&&g!==s&&b.ok?(v=b.str,s=b.pos):(v="",s=h,r=p);s<i&&jf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10&&v)for(v="",s=h,r=p;s<i&&jf(c.charCodeAt(s));)s++;if(s<i&&c.charCodeAt(s)!==10)return!1;const m=Sm(c.slice(1,u));return m?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[m]>"u"&&(e.env.references[m]={title:v,href:f}),e.line=r),!0):!1}function g0(e){switch(e){case 9:case 32:return!0}return!1}const tj=65536;function v0(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function nj(e,t){if(e.lineFlags)return(e.lineFlags[t]&td.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 Zw(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 oj(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&&!g0(l)||r===45&&g0(l)||!nj(e,t))return!1;for(;i<e.eMarks[s];){const k=e.src.charCodeAt(i);if(k!==124&&k!==45&&k!==58&&!g0(k))return!1;i++}let a=v0(e,t+1),c=a.split("|");const u=[];for(let k=0;k<c.length;k++){const A=c[k].trim();if(!A){if(k===0||k===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=v0(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=Zw(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),g=[t,0];p.map=g;const b=e.push("thead_open","thead",1);b.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let k=0;k<c.length;k++){const A=e.push("th_open","th",1);u[k]&&(A.attrs=[["style",`text-align:${u[k]}`]]);const $=e.push("inline","",0);$.content=c[k].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let m,y=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let k=!1;for(let $=0,N=h.length;$<N;$++)if(h[$](e,s,n,!0)){k=!0;break}if(k||(a=v0(e,s).trim(),!a)||e.sCount[s]-e.blkIndent>=4||(c=Zw(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),y+=d-c.length,y>tj))break;if(s===t+2){const $=e.push("tbody_open","tbody",1);$.map=m=[t+2,0]}const A=e.push("tr_open","tr",1);A.map=[s,s+1];for(let $=0;$<d;$++){const N=e.push("td_open","td",1);u[$]&&(N.attrs=[["style",`text-align:${u[$]}`]]);const x=e.push("inline","",0);x.content=c[$]?c[$].trim():"",x.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return m&&(e.push("tbody_close","tbody",-1),m[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=f,e.line=s,!0}var sj=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 Hc(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 Vf=[["table",oj,["paragraph","reference"]],["code",Hq],["fence",Wq,["paragraph","reference","blockquote","list"]],["blockquote",Pq,["paragraph","reference","blockquote","list"]],["hr",qq,["paragraph","reference","blockquote","list"]],["list",Xq,["paragraph","reference","blockquote"]],["reference",ej],["html_block",jq,["paragraph","reference","blockquote"]],["heading",zq,["paragraph","reference","blockquote"]],["lheading",Gq],["paragraph",Jq]];var ij=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new sj;for(let e=0;e<Vf.length;e++)this.ruler.push(Vf[e][0],Vf[e][1],{alt:(Vf[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 g=0;g<s;g++)if(p=o[g](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 g=0;g<s;g++){const b=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();p=f[g].fn(e,u,n,!1);const v=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(Hc(e.env,"block",f[g].name,v-b,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 m6(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}},k6=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}};k6.prototype.Token=xo;const Qw=[["normalize",_q],["block",bU],["inline",pq],["linkify",bq],["replacements",Nq],["smartquotes",Fq],["text_join",Oq]],rj={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},lj={parseLinkLabel:Qy,parseLinkDestination:Zy,parseLinkTitle:Xy};function aj(){return{...rj}}function cj(){return{...lj}}var uj=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new ij,this.inline=new hq,this.ruler=new Iq;for(let e=0;e<Qw.length;e++){const[t,n]=Qw[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:aj(),helpers:cj(),normalizeLink:h6,normalizeLinkText:p6,validateLink:f6,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new GA),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 k6(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();Hc(e.env,"core",t[n].name,s-o,!0,!1)}dq(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&kU(e))return this.parse(XA(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 dj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function pp(e){return!dj.test(e)}function qu(e,t){const n=e.indexOf(`
98
- `,t);return n===-1?e.length:n}function xh(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 Xw(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function y0(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function fj(e){if(e.length>3)return pp(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 hj=["","h1","h2","h3","h4","h5","h6"],pj=["","#","##","###","####","#####","######"],Jw=0,k0=1,b0=2;function Vs(e,t,n,o){const s=new xo(e,t,n);return s.level=o,s.block=!0,s}function b6(e,t,n){const o=Vs("inline","",0,n);o.map=[t,t+1],o.content=e;const s=new xo("text","",0);return s.content=e,o.children=[s],o}function mj(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(!pp(u))return!1;const d=hj[i],f=pj[i],h=Vs("heading_open",d,1,0);h.map=[s,s+1],h.markup=f,e.push(h),e.push(b6(u,s,1));const p=Vs("heading_close",d,-1,0);return p.markup=f,e.push(p),!0}function gj(e,t,n){const o=Vs("paragraph_open","p",1,0);o.map=[n,n+1],e.push(o),e.push(b6(t,n,1)),e.push(Vs("paragraph_close","p",-1,0))}function vj(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function x0(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function yj(e,t){const n=Vs("bullet_list_open","ul",1,0);return n.map=[t,t],n.markup="-",e.push(n),n}function kj(e,t,n){const o=Vs("list_item_open","li",1,1);o.map=[n,n+1],o.markup="-",e.push(o);const s=Vs("paragraph_open","p",1,2);s.map=[n,n+1],s.hidden=!0,e.push(s);const i=Vs("inline","",0,3);i.map=[n,n+1],i.content=t;const r=new xo("text","",0);r.content=t,i.children=[r],e.push(i);const l=Vs("paragraph_close","p",-1,2);l.hidden=!0,e.push(l);const a=Vs("list_item_close","li",-1,1);return a.markup="-",e.push(a),o}function bj(e){const t=Vs("bullet_list_close","ul",-1,0);t.markup="-",e.push(t)}function xj(e,t,n,o){if(!Xw(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=qu(e,l);if(Xw(e,l,c)&&xh(e,l+3,c)){const u=Vs("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 wj(e){if(e.length===0)return[];if(e.includes("\r")||e.includes("\0"))return null;const t=[];let n=e.length>=1e5?Jw:b0,o="",s=!1,i=!1,r=0,l=0;for(;r<e.length;){const a=qu(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(!xh(e,r,a))return null;r=a<e.length?a+1:a,l++;continue}if(c===35){if(!mj(t,e,r,a,l))return null;const h=a<e.length?a+1:a;r=x0(e,h),l+=1+r-h;continue}if(c===45){if(!y0(e,r,a))return null;const h=l;let p=r,g=l,b=null,v=null;for(;p<e.length;){const k=qu(e,p);if(!y0(e,p,k))break;const A=p+2,$=k===A+1?e[A]:e.slice(A,k);if(!fj($))return null;b===null&&(b=yj(t,h)),v=kj(t,$,g),p=k<e.length?k+1:k,g++}if(b===null||v===null)return null;let m=p,y=g;for(;m<e.length;){if(e.charCodeAt(m)===10){m++,y++;continue}const k=qu(e,m);if(!xh(e,m,k)){if(y0(e,m,k))return null;break}m=k<e.length?k+1:k,y++}b.map[1]=y,v.map[1]=y,bj(t),r=m,l=y;continue}if(c===96){const h=xj(e,r,a,l);if(!h)return null;t.push(h.token),r=x0(e,h.nextPos),l=h.nextLine+r-h.nextPos;continue}const u=vj(e,r,a);let d;if(n===b0?d=pp(u):n===k0&&u===o?d=s:(d=pp(u),n===Jw?(i&&(n=u===o?k0:b0),o=u,s=d,i=!0):n===k0&&(o=u,s=d)),!d)return null;const f=a<e.length?a+1:a;if(f<e.length&&e.charCodeAt(f)!==10&&!xh(e,f,qu(e,f)))return null;gj(t,u,l),r=x0(e,f),l+=1+r-f}return t}const _j=/[&<>"]/,e_=/[&<>"]/g,Sj=/&/g,Cj=/[<>"]/g,Aj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function w0(e){return Aj[e]||e}function $n(e){if(e.length===0)return"";if(e.length<32)return _j.test(e)?e.replace(e_,w0):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(Sj,"&amp;"):t?e.replace(e_,w0):e.replace(Cj,w0)}const Mj=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ej=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function x6(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Mj,(t,n,o)=>{if(n)return n;if(Ej.test(o)){const i=o[1].toLowerCase()==="x"?Number.parseInt(o.slice(2),16):Number.parseInt(o.slice(1),10);return Cm(i)?Id(i):"�"}const s=Wy(t);return s!==t?s:t})}const Tj=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Nj=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Ij=/"/g;function Cc(e,t){const n=e.indexOf(`
99
- `,t);return n===-1?e.length:n}function mp(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 Kf(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function Lj(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!mp(e,t,Cc(e,t))}function t_(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function $j(e,t,n){const o=e.charCodeAt(n-1);return o===32||o===9?e.slice(t,n).trim():e.slice(t,n)}function nk(e){return Nj.test(e)?Tj.test(e)?null:e.replace(Ij,"&quot;"):e}function Fj(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=nk(e.slice(i,r));return a===null?null:`<h${o}>${a}</h${o}>
100
- `}function n_(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Oj(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 Rj(e,t,n){const o=t+2;if(n===o+1)return Oj(e,o);const s=nk(e.slice(t+2,n));return s===null?null:`<li>${s}</li>
103
- `}function Bj(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 Dj(e,t,n,o){if(!t_(e,t,n))return null;const s=Bj(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=Cc(e,l);if(t_(e,l,a)&&mp(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-${$n(s)}">`:"<pre><code>",o.lang=s,o.open=u),{html:`${u}${$n(c)}</code></pre>
104
- `,nextPos:a<e.length?a+1:a}}l=a<e.length?a+1:a,r=l}return null}function o_(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=Cc(e,t);if(t===u){t=u<e.length?u+1:u;continue}const d=e.charCodeAt(t);if(d===32||d===9){if(!mp(e,t,u))return null;t=u<e.length?u+1:u;continue}if(d===35){const g=Fj(e,t,u);if(g===null)return null;o?s.push(g):n+=g,t=Kf(e,u<e.length?u+1:u);continue}if(d===45){let g=t;for(;g<e.length;){const y=Cc(e,g);if(!n_(e,g,y))break;g=y<e.length?y+1:y}if(g===t)return null;const b=e.slice(t,g);let v;if(b===r)v=l;else{let y=t;for(v=`<ul>
105
- `;y<g;){const k=Cc(e,y),A=Rj(e,y,k);if(A===null)return null;v+=A,y=k<e.length?k+1:k}v+=`</ul>
106
- `,r=b,l=v}let m=Kf(e,g);for(;m<e.length;){if(e.charCodeAt(m)===10){m++;continue}const y=Cc(e,m);if(!mp(e,m,y)){if(n_(e,m,y))return null;break}m=y<e.length?y+1:y}o?s.push(v):n+=v,t=m;continue}if(d===96){const g=Dj(e,t,u,i);if(!g)return null;o?s.push(g.html):n+=g.html,t=Kf(e,g.nextPos);continue}const f=$j(e,t,u);let h;if(f===a)h=c;else{const g=nk(f);if(g===null)return null;h=`<p>${g}</p>
107
- `,a=f,c=h}const p=u<e.length?u+1:u;if(p<e.length&&e.charCodeAt(p)!==10&&Lj(e,p))return null;o?s.push(h):n+=h,t=Kf(e,p)}return o?s.join(""):n}const Pj={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function gp(e,t,n={},o){us(n);const s={...Pj,...o||{}},i=Ts(t);if(s.fallbackOnGlobalState!==!1&&i)return m0(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Pc(n,i,()=>e.core.parse(t,n,e).tokens);let r=wh(t,s);if(s.maxChunks&&r.length>s.maxChunks&&(r=Uj(r,s.maxChunks)),_h(t,r))return m0(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines}),Pc(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return m0(n,{count:r.length,maxChunkChars:s.maxChunkChars,maxChunkLines:s.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:s.fallbackOnGlobalState===!1&&!!i}),Pc(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&&Wj(f,l),zj(a,f),l+=u.lineCount}return a})}function wh(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 g=qj(e,f,h);if(t.fenceAware){let m=f;for(;m<h;){const k=e.charCodeAt(m);if(k===32||k===9)m++;else break}const y=e[m];if(y==="`"||y==="~"){let k=m;for(;k<h&&e[k]===y;)k++;const A=k-m;A>=3&&(u?u.marker===y&&A>=u.length&&(u=null):u={marker:y,length:A})}}const b=p-f;s+=b,i+=1,l+=1,g?(a=0,c=0):(a+=1,c+=b);const v=g;if((s>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(v)d(p);else{const m=Math.max(10,Math.floor(t.maxChunkLines*.5)),y=Math.max(t.maxChunkChars,8e3);(a>=m||c>=y)&&d(p)}f=p}return n&&d(e.length),o}function _h(e,t,n={rangesCoverWholeSource:!0}){const o=n.rangesCoverWholeSource?t.length-1:t.length;for(let s=0;s<o;s++)if(!Hj(e,t[s].end))return!0;return!1}function Hj(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 Wj(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 zj(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Uj(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 qj(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 w6=4e6,_6=8e4,jj=1e4,Vj=200,Kj=1e4,Gj=200;function S6(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Yj(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 sl(e){return e.length===0?0:so(e)+(e.charCodeAt(e.length-1)===10?0:1)}function Zj(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 Qj(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 Xj(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 Zj(e,n+1,e.length-1)?!Qj(e,t):!1}function Jj(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??Kj:e.options.fullChunkSizeChars??jj),l=o.maxChunkLines??(s==="stream"?e.options.streamChunkSizeLines??Gj:e.options.fullChunkSizeLines??Vj);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 Zd=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=sl(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const o=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!o.length)return this.updateEnvDiagnostics(e,t,n),null;if(_h(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,sl(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!Xj(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const n=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,sl(this.pending)),null;const o=_h(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(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=wh(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const o=_h(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:sl(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:sl(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+sl(this.pending);return Jj(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Yd(e)&&zr(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=Ts(t);n&&(Gy(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&&Yj(r,a),this.options.retainTokens!==!1&&S6(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&&Yy(t),n}catch(o){throw this.markedGlobalStateReason&&(zr(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),o}}updateEnvDiagnostics(e,t,n){jA(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 eV(e,t,n={},o={}){us(n);const s=new Zd(e,{mode:"full",...o});for(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}async function tV(e,t,n={},o={}){us(n);const s=new Zd(e,{mode:"full",...o});for await(const i of t)s.feed(i),s.flushAvailable(n);return s.flushForce(n)}function nV(e,t,n,o={},s={}){us(o);const i=new Zd(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 oV(e,t,n,o={},s={}){us(o);const i=new Zd(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 C6(e,t,n){if(e.options.autoUnbounded===!1)return!1;const o=e.options.autoUnboundedThresholdChars??w6,s=e.options.autoUnboundedThresholdLines??_6;return t>=o||n>=s}function A6(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??w6))return"yes";const o=e.options.autoUnboundedThresholdLines??_6;return n!==void 0?n>=o?"yes":"no":t+1<o?"no":"need-lines"}function nd(e,t,n={},o={}){us(n);const s=Ts(t);if(Yd(n)&&zr(n),o.fallbackOnGlobalState!==!1&&s)return jA(n,{mode:"full",fallback:!0,fallbackReason:s,committedChars:t.length,committedLines:so(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:s}),Pc(n,s,()=>e.core.parse(t,n,e).tokens);const i=[],r=new Zd(e,{mode:"full",...o,retainTokens:!1,onChunkTokens(l){S6(i,l)}});if(s&&Gy(n,s),r.feed(t),r.flushForce(n),s&&(Yy(n),o.fallbackOnGlobalState===!1)){const l=_r(n)?.unbounded;l&&(l.globalStateDetected=s,l.globalStateFallbackDisabled=!0)}return i}const Wc=(e,t,n)=>e<t?t:e>n?n:e;function M6(e){return e.experimental?{...e,...e.experimental}:e}const s_=[{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"}],i_=[{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 E6(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function sV(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.fullChunkFenceAware??!0,i=o.fullChunkTargetChunks??8,r=o.fullChunkAdaptive!==!1;for(let l=0;l<s_.length;l++){const a=s_[l];if(e<=a.max){if(a.strategy!=="adaptive")return E6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(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 r_(e,t=Math.max(0,e/40|0),n={}){const o=M6(n),s=o.streamChunkFenceAware??!0,i=o.streamChunkTargetChunks??8,r=o.streamChunkAdaptive!==!1;for(let l=0;l<i_.length;l++){const a=i_[l];if(e<=a.max){if(a.strategy!=="adaptive")return E6(s,a);break}}return e>5e6?{strategy:"plain",fenceAware:s,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Wc(Math.ceil(e/i),8e3,64e3),maxChunkLines:Wc(Math.ceil(t/i),150,700),maxChunks:Wc(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 iV={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"]}}},rV={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},lV={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 Tm(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Sh(e,t){if(Tm(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const l_=e=>Tm(e)?e:Promise.resolve(e);function od(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 $n(e)}}function $l(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${od(t[0])}="${$n(t[1])}"`;for(let o=1;o<e.length;o++){const s=e[o];n+=` ${od(s[0])}="${$n(s[1])}"`}return n}function T6(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 sd(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="${$n(`${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${$l(r)}>${t}</code></pre>
112
- `}return`<pre><code${$l(e.attrs)}>${t}</code></pre>
113
- `}function vp(e){return!e.attrs||e.attrs.length===0?`<code>${$n(e.content)}</code>`:`<code${$l(e.attrs)}>${$n(e.content)}</code>`}function cv(e){const t=$n(e.content);return e.attrs?`<pre${$l(e.attrs)}><code>${t}</code></pre>
114
- `:`<pre><code>${t}</code></pre>
115
- `}function aV(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="${$n(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${$n(n[0][1])}">`}return null}function a_(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${od(t[0][0])}="${$n(t[0][1])}">`:t.length===2?`<a ${od(t[0][0])}="${$n(t[0][1])}" ${od(t[1][0])}="${$n(t[1][1])}">`:`<a${$l(t)}>`}function cV(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 c_(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 yp(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+$l(n);return o===0&&t&&(i+=" /"),`${i}>`}const uV={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Gf=Object.prototype.hasOwnProperty,Nn={code_inline(e,t){return vp(e[t])},code_block(e,t){return cv(e[t])},fence(e,t,n,o,s){const i=e[t],r=i.info?x6(i.info).trim():"",{langName:l,langAttrs:a}=T6(r),c=n.highlight,u=$n(i.content);if(!c)return sd(i,u,r,l,n);const d=c(i.content,l,a);return Tm(d)?d.then(f=>sd(i,f||u,r,l,n)):sd(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]],yp(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 $n(e[t].content)},text_special(e,t){return $n(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function u_(e,t,n){const o=e.info?x6(e.info).trim():"",{langName:s,langAttrs:i}=T6(o),r=t.highlight,l=$n(e.content);if(!r)return sd(e,l,o,s,t);const a=r(e.content,s,i);if(Tm(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return sd(e,a||l,o,s,t)}function Yf(e,t,n,o,s,i,r){const l=e[0];switch(l.type){case"text":if(s.text===Nn.text)return l.content.length===0?"":$n(l.content);break;case"text_special":if(s.text_special===Nn.text_special)return l.content.length===0?"":$n(l.content);break;case"softbreak":if(s.softbreak===Nn.softbreak)return r;break;case"hardbreak":if(s.hardbreak===Nn.hardbreak)return i;break;case"html_inline":if(s.html_inline===Nn.html_inline)return l.content;break;case"code_inline":if(s.code_inline===Nn.code_inline)return vp(l);break}const a=s[l.type];if(!a)return yp(l,t.xhtmlOut===!0);const c=a(e,0,t,n,o);return typeof c=="string"?c:Sh(c,l.type)}var dV=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Nn}}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="",g=!1,b="";for(let v=0;v<e.length;v++){const m=e[v],y=m.type,k=v>0&&e[v-1].hidden?`
121
- `:"";if(y==="list_item_open"&&(!m.attrs||m.attrs.length===0)&&v+3<e.length){const N=e[v+1],x=e[v+2],I=e[v+3];if(N.type==="paragraph_open"&&N.hidden&&x.type==="inline"&&I.type==="paragraph_close"&&I.hidden){b+=`${k}<li>${this.renderInlineTokens(x.children||[],o,s)}`,v+=3;continue}}if(v+2<e.length){const N=e[v+1],x=e[v+2];if(N.type==="inline"&&x.nesting===-1&&x.tag===m.tag&&!x.hidden){const I=aV(m,k);if(I!==null){b+=`${I+this.renderInlineTokens(N.children||[],o,s)}</${m.tag}>
122
- `,v+=2;continue}}}if(y==="inline"){const N=m.children||[];if(N.length===1){g||(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
- `,g=!0);const x=N[0];switch(x.type){case"text":if(l===Nn.text){b+=$n(x.content);continue}break;case"text_special":if(a===Nn.text_special){b+=$n(x.content);continue}break;case"softbreak":if(c===Nn.softbreak){b+=p;continue}break;case"hardbreak":if(u===Nn.hardbreak){b+=h;continue}break;case"html_inline":if(d===Nn.html_inline){b+=x.content;continue}break;case"code_inline":if(f===Nn.code_inline){b+=vp(x);continue}break}}b+=this.renderInlineTokens(N,o,s);continue}const A=i[y];if(!A){const N=m.attrs;if(!m.hidden){if(!N||N.length===0)switch(y){case"hr":b+=r?`<hr />
126
- `:`<hr>
127
- `;continue;case"heading_open":b+=`<${m.tag}>`;continue;case"heading_close":b+=`</${m.tag}>
128
- `;continue;case"paragraph_open":b+=`${k}<p>`;continue;case"paragraph_close":b+=`</p>
129
- `;continue;case"list_item_open":{const x=e[v+1];b+=k+(x&&(x.type==="inline"||x.hidden||x.nesting===-1&&x.tag==="li")?"<li>":`<li>
130
- `);continue}case"list_item_close":b+=`</li>
131
- `;continue;case"bullet_list_open":b+=`${k}<ul>
132
- `;continue;case"bullet_list_close":b+=`</ul>
133
- `;continue;case"blockquote_open":b+=k+(e[v+1]&&e[v+1].nesting===-1&&e[v+1].tag==="blockquote"?"<blockquote>":`<blockquote>
134
- `);continue;case"blockquote_close":b+=`</blockquote>
135
- `;continue;case"ordered_list_open":b+=`${k}<ol>
136
- `;continue;case"ordered_list_close":b+=`</ol>
137
- `;continue;case"table_open":b+=`${k}<table>
138
- `;continue;case"table_close":b+=`</table>
139
- `;continue;case"thead_open":b+=`${k}<thead>
140
- `;continue;case"thead_close":b+=`</thead>
141
- `;continue;case"tbody_open":b+=`${k}<tbody>
142
- `;continue;case"tbody_close":b+=`</tbody>
143
- `;continue;case"tr_open":b+=`${k}<tr>
144
- `;continue;case"tr_close":b+=`</tr>
145
- `;continue;case"td_open":b+=`${k}<td>`;continue;case"td_close":b+=`</td>
146
- `;continue;case"th_open":b+=`${k}<th>`;continue;case"th_close":b+=`</th>
147
- `;continue}else if(N.length===1){const x=N[0];if(y==="ordered_list_open"&&x[0]==="start"){b+=`${k}<ol start="${$n(x[1])}">
148
- `;continue}if(y==="td_open"&&x[0]==="style"){b+=`${k}<td style="${$n(x[1])}">`;continue}if(y==="th_open"&&x[0]==="style"){b+=`${k}<th style="${$n(x[1])}">`;continue}}}b+=this.renderToken(e,v,o);continue}if(y==="code_block"&&A===Nn.code_block){b+=cv(m);continue}if(y==="fence"&&A===Nn.fence){b+=u_(m,o);continue}if(y==="html_block"&&A===Nn.html_block){b+=m.content;continue}const $=A(e,v,o,s,this);typeof $=="string"?b+=$:b+=Sh($,m.type)}return b}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 l_(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 $l(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+$l(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(Gf.call(e,"highlight")&&e.highlight!==t.highlight&&(o().highlight=e.highlight),Gf.call(e,"langPrefix")){const s=e.langPrefix;s!==t.langPrefix&&(o().langPrefix=s)}if(Gf.call(e,"xhtmlOut")){const s=e.xhtmlOut;s!==t.xhtmlOut&&(o().xhtmlOut=s)}if(Gf.call(e,"breaks")){const s=e.breaks;s!==t.breaks&&(o().breaks=s)}return n||t}buildNormalizedBase(){return Object.freeze({...uV,...this.baseOptions})}renderSingleToken(e,t,n,o){const s=this.rules,i=t.type;if(i==="code_block"&&s.code_block===Nn.code_block)return cv(t);if(i==="html_block"&&s.html_block===Nn.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):yp(t,r.xhtmlOut===!0);if(i==="fence"&&a===Nn.fence)return u_(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Sh(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,g=o.strong_close,b=t.xhtmlOut===!0,v=b?`<br />
151
- `:`<br>
152
- `,m=t.breaks?v:`
153
- `;if(e.length===1)return Yf(e,t,n,this,o,v,m);let y="";for(let k=0;k<e.length;k++){const A=e[k];if(A.type==="link_open"&&!u&&!d&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="link_close"&&cV(x)){const I=`${a_(A)+Yf([x],t,n,this,o,v,m)}</a>`;if(r===Nn.softbreak&&k+3<e.length&&e[k+3].type==="softbreak"){y+=I+m,k+=3;continue}y+=I,k+=2;continue}}if(A.type==="link_open"&&!u&&!d&&k+1<e.length&&e[k+1].type==="link_close"){y+=`${a_(A)}</a>`,k+=1;continue}if(A.type==="em_open"&&!f&&!h&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="em_close"&&c_(x)){y+=`<em>${Yf([x],t,n,this,o,v,m)}</em>`,k+=2;continue}}if(A.type==="strong_open"&&!p&&!g&&k+2<e.length){const x=e[k+1];if(e[k+2].type==="strong_close"&&c_(x)){y+=`<strong>${Yf([x],t,n,this,o,v,m)}</strong>`,k+=2;continue}}switch(A.type){case"text":if(s===Nn.text){const x=A.content.length===0?"":$n(A.content);if(a===Nn.html_inline&&k+1<e.length&&e[k+1].type==="html_inline"){for(y+=x+e[++k].content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}y+=x;continue}break;case"text_special":if(i===Nn.text_special){A.content.length!==0&&(y+=$n(A.content));continue}break;case"softbreak":if(r===Nn.softbreak){y+=m;continue}break;case"hardbreak":if(l===Nn.hardbreak){y+=v;continue}break;case"html_inline":if(a===Nn.html_inline){for(y+=A.content;k+1<e.length&&e[k+1].type==="html_inline";)y+=e[++k].content;continue}break;case"code_inline":if(c===Nn.code_inline){y+=vp(A);continue}break}const $=o[A.type];if(!$){y+=A.block?this.renderToken(e,k,t):yp(A,b);continue}const N=$(e,k,t,n,this);typeof N=="string"?y+=N:y+=Sh(N,A.type)}return y}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 l_(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}},fV=dV;const hV=[],_0=4096;function pV(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 mV(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 gV(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(!N6(e[n],t[n]))return!1;return!0}function N6(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||!mV(e.attrs,t.attrs)||!gV(e.children,t.children)?!1:(e.content||"")===(t.content||"")}function d_(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var vV=class{core;cache=null;stats=d_();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=d_(),this.stats.resets=e}parse(e,t,n){const o=t,s=this.cache;if(us(o??s?.env),!s||o&&o!==s.env){const L=o??{},R=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,z=!!n.options?.streamChunkedFallback,H=!R&&D,U=z||H,Z=n.options?.streamChunkAdaptive!==!1,K=n.options?.streamChunkTargetChunks??8,V=n.options?.streamChunkSizeChars,J=n.options?.streamChunkSizeLines,fe=n.options?.streamChunkMaxChunks,oe=!!n.__explicitStreamChunkConfig,ce=n.options?.autoTuneChunks!==!1,ue=n.options?.streamChunkFenceAware??!0,Se=n.options?.streamLargeCachePolicy??"retain",Te=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,Ae=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let P,le=!1;if(Se==="skip"&&(le=e.length>=Te,!le&&Ae!==void 0&&(P=so(e),le=P>=Ae)),le){const q=this.parseFullDocument(e,L,n,P,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!_r(L)?.unbounded}),q.tokens}else if(U){const q=(pe,Ce,$e)=>pe<Ce?Ce:pe>$e?$e:pe;P===void 0&&(P=so(e));const ee=ce&&!oe?r_(e.length,P,n.options):null,ge=ee?.maxChunkChars??(Z?q(Math.ceil(e.length/K),8e3,64e3):V??1e4),de=ee?.maxChunkLines??(Z?q(Math.ceil(P/K),150,700):J??200),ve=ee?.maxChunks??(Z?q(Math.ceil(e.length/64e3),K,32):fe),j=e.length>0&&e.charCodeAt(e.length-1)===10,te=H&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&ee?.strategy!=="plain";if((z||te)&&(e.length>=ge*2||P>=de*2)&&j){const pe=gp(n,e,L,{maxChunkChars:ge,maxChunkLines:de,fenceAware:ee?.fenceAware??ue,maxChunks:ve});return this.cache={src:e,tokens:pe,env:L,lineCount:P,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,P),this.recordChunkedParseResult(L,z?"explicit-initial-large-doc":"default-initial-large-doc"),pe}}const ne=this.parseFullDocument(e,L,n,P);return P=ne.lineCount,this.cache={src:e,tokens:ne.tokens,env:L,lineCount:P,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!_r(L)?.unbounded}),ne.tokens}if(e===s.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",yo(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=Ts(s.src),s.globalStateReason=r);const l=r?null:i!==null?this.detectGlobalStateForAppend(s,i):Ts(e),a=r||l;if(a){const L=o??s.env;zr(L);const R=Ts(e),D=this.parseFullDocument(e,L,n),z=D.tokens,H=D.lineCount;return this.cache={src:e,tokens:z,env:L,lineCount:H,lastSegment:void 0,globalStateReason:R},this.updateCacheLineCount(this.cache,H),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!_r(L)?.unbounded}),z}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 L=o??s.env,R=this.parseFullDocument(e,L,n),D=R.tokens,z=R.lineCount;return this.cache={src:e,tokens:D,env:L,lineCount:z,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,z),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(L,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!_r(L)?.unbounded}),D}const u=this.getAppendedSegment(s.src,e,i);if(u&&!this.shouldPreferTailReparseForAppend(s)){const L=s.lineCount??so(s.src);let R=3;u.length>5e3?R=8:u.length>1e3?R=6:u.length>200&&(R=4),R=Math.min(R,L);let D=null;const z=n.options?.streamContextParseStrategy??"chars",H=n.options?.streamContextParseMinChars??200,U=n.options?.streamContextParseMinLines??2;let Z;const K=()=>(Z===void 0&&(Z=so(u)),Z),V=this.canDirectlyParseAppend(s),J=V&&this.shouldUseUnboundedAppend(e,s,u);let fe=!1;if(!V)switch(z){case"lines":fe=K()>=U;break;case"constructs":if(u.length>=H){fe=!0;break}if(pV(u)){fe=!0;break}fe=K()>=U;break;case"chars":default:fe=u.length>=H}if(R>0&&fe){const ue=this.getTailLines(s.src,R)+u;try{const Se=this.core.parse(ue,s.env,n).tokens,Te=Se.findIndex(Ae=>Ae.map&&typeof Ae.map[1]=="number"&&Ae.map[1]>R);if(Te!==-1){const Ae=Se.slice(Te),P=L-R;P!==0&&this.shiftTokenLines(Ae,P),D={tokens:Ae}}}catch{D=null}}else D=null;if(!D){const ue=L;if(J)D={tokens:nd(n,u,s.env,{mode:"stream"})},ue>0&&this.shiftTokenLines(D.tokens,ue);else{const Se=this.core.parse(u,s.env,n);ue>0&&this.shiftTokenLines(Se.tokens,ue),D=Se}}let oe=0;if(s.tokens.length>0&&D.tokens.length>0){const ue=s.tokens[s.tokens.length-1],Se=D.tokens[0];try{ue.type==="inline"&&Se.type==="inline"&&(Se.children&&Se.children.length>0&&(ue.children||(ue.children=[]),this.appendTokens(ue.children,Se.children)),ue.content=(ue.content||"")+(Se.content||""),oe=1)}catch{oe=0}}const ce=s.tokens.length;if(D.tokens.length>oe){const ue=s.tokens,Se=D.tokens,Te=Math.min(ue.length,Se.length-oe);let Ae=0;for(let P=Te;P>0;P--){let le=!0;for(let ne=0;ne<P;ne++){const q=ue[ue.length-P+ne],ee=Se[oe+ne];if(!N6(q,ee)){le=!1;break}}if(le){Ae=P;break}}Ae>0&&(oe+=Ae),Se.length>oe&&this.appendTokens(s.tokens,Se,oe)}if(s.src=e,s.globalStateReason=null,s.lineCount=L+(Z??K()),s.tokens.length>ce){const ue=this.getLastSegment(s.tokens,e,ce,s.tokens.length,e.length-u.length,L);ue?s.lastSegment=ue:s.lastSegment=void 0}else s.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,J&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",yo(s.env,{area:"stream",path:J?"stream-unbounded-append":"stream-append",reason:J?"large-delta":"safe-append",unbounded:J}),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",yo(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,p=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,b=!h&&!u&&p,v=g||b,m=n.options?.streamChunkAdaptive!==!1,y=n.options?.streamChunkTargetChunks??8,k=n.options?.streamChunkSizeChars,A=n.options?.streamChunkSizeLines,$=n.options?.streamChunkMaxChunks,N=!!n.__explicitStreamChunkConfig,x=n.options?.autoTuneChunks!==!1,I=n.options?.streamChunkFenceAware??!0;let E=u&&s.lineCount!==void 0?s.lineCount+so(u):void 0;if(v){E===void 0&&(E=so(e));const L=(K,V,J)=>K<V?V:K>J?J:K,R=x&&!N?r_(e.length,E,n.options):null,D=R?.maxChunkChars??(m?L(Math.ceil(e.length/y),8e3,64e3):k??1e4),z=R?.maxChunkLines??(m?L(Math.ceil(E/y),150,700):A??200),H=R?.maxChunks??(m?L(Math.ceil(e.length/64e3),y,32):$),U=e.length>0&&e.charCodeAt(e.length-1)===10,Z=b&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&R?.strategy!=="plain";if((g||Z)&&(e.length>=D*2||E>=z*2)&&U){const K=gp(n,e,d,{maxChunkChars:D,maxChunkLines:z,fenceAware:R?.fenceAware??I,maxChunks:H});return this.cache={src:e,tokens:K,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),K}}const F=this.parseFullDocument(e,d,n,E),S=F.tokens;return E=F.lineCount,this.cache={src:e,tokens:S,env:d,lineCount:E,lastSegment:void 0,globalStateReason:Ts(e)},this.updateCacheLineCount(this.cache,E),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",yo(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!_r(d)?.unbounded}),S}recordChunkedParseResult(e,t){const n=_r(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",yo(e,{area:"stream",path:"stream-full",reason:`global-state:${o}`,unbounded:!!_r(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",yo(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,o,s=!0){const i=Ts(e);Yd(t)&&zr(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?A6(n,e.length,o):"no";if(r==="yes"){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:o??(s?so(e):0)}}let l=o;if(r==="need-lines"&&(l=so(e),C6(n,e.length,l))){const a=nd(n,e,t);return yo(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=s?so(e):0),{tokens:Pc(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:so(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+so(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??hV}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??so(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(-_0))+t,o=Ts(n);return e.globalStateCarry=n.length>_0?n.slice(n.length-_0):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??so(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 g=f+so(i);t.lineCount=g;const b=this.getDocLineCount(e,g);return r.map&&(r.map[1]=b),t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:b,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 g=s.lineEnd-2;g!==0&&this.shiftTokenLines(p,g);const b=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,v=t.lineCount??so(t.src);t.tokens.splice(b,0,...p),t.src=e,t.env=n,t.globalStateReason=null;const m=v+so(i);t.lineCount=m;const y=this.getDocLineCount(e,m);if(r.map&&(r.map[1]=y),h.tbodyOpenIndex>=0){const k=t.tokens[h.tbodyOpenIndex];k?.map&&(k.map[1]=y)}return t.lastSegment={tokenStart:s.tokenStart,tokenEnd:t.tokens.length,lineStart:s.lineStart,lineEnd:y,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=so(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 f_={default:rV,zero:lV,commonmark:iV};function yV(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function kV(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 h_(e){return e.experimental?{...e,...e.experimental}:e}function ui(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 p_(e,t,n){for(let o=0;o<n.length;o++){const s=n[o];if(ui(t,s)||ui(e,s))return!0}return!1}function m_(e,t,n){return ui(t,n)||ui(e,n)}function g_(e,t){const n=_r(e)?.chunk;if(n?.fallback){yo(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}yo(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function bV(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=f_[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=h_(n),typeof n.quotes=="string"){const x=n.quotes;x.length>=4?n.quotes=[x[0],x[1],x[2],x[3]]:n.quotes=["“","”","‘","’"]}let r=p_(i?.options,s,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=p_(i?.options,s,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=m_(i?.options,s,"fullChunkedFallback"),c=m_(i?.options,s,"streamChunkedFallback"),u=!1,d=null,f=null;const h=new uj;let p=null;const g=()=>(p||(p=new fV(n)),p);let b=null;const v=()=>(b||(b=new vV(h)),b);let m=null;const y=()=>(m||(m=new GA),m),k=x=>!u&&!!d&&!kV(x,d),A=(x,I)=>o==="default"&&!u&&p===null&&f!==null&&x.parse===f&&k(x)&&!x.stream.enabled&&I<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.xhtmlOut===!1&&x.options.breaks===!1&&x.options.langPrefix==="language-"&&x.options.linkify===!1&&x.options.typographer===!1&&x.options.highlight===null,$=(x,I)=>o==="default"&&!u&&k(x)&&!x.stream.enabled&&!x.options.fullChunkedFallback&&I<(x.options.autoUnboundedThresholdChars??4e6)&&x.options.html===!1&&x.options.linkify===!1&&x.options.typographer===!1,N={core:h,block:h.block,inline:h.inline,get linkify(){const x=y();return Object.defineProperty(this,"linkify",{value:x,writable:!0,configurable:!0}),x},get renderer(){const x=g();return Object.defineProperty(this,"renderer",{value:x,writable:!0,configurable:!0}),x},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return k(this)},set(x){const I=h_(x);return this.options={...this.options,...I},(ui(x,"fullChunkSizeChars")||ui(x,"fullChunkSizeLines")||ui(x,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(ui(x,"streamChunkSizeChars")||ui(x,"streamChunkSizeLines")||ui(x,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),ui(x,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),ui(x,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),p&&p.set(I),typeof I.stream=="boolean"&&(this.stream.enabled=I.stream,b&&(b.reset(),b.resetStats())),this},configure(x){const I=typeof x=="string"?f_[x]:x;if(!I)throw new Error("Wrong `markdown-it` preset, can't be empty");if(I.options&&this.set(I.options),I.components){const E=I.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(x,I){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const L of F){if(!L)continue;const R=L.enable(E,!0);for(let D=0;D<R.length;D++)S.add(R[D])}if(!I){const L=E.filter(R=>!S.has(R));if(L.length)throw new Error(`Rules manager: invalid rule name ${L.join(", ")}`)}return this},disable(x,I){const E=Array.isArray(x)?x:[x],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],S=new Set;for(const L of F){if(!L)continue;const R=L.disable(E,!0);for(let D=0;D<R.length;D++)S.add(R[D])}if(!I){const L=E.filter(R=>!S.has(R));if(L.length)throw new Error(`Rules manager: invalid rule name ${L.join(", ")}`)}return this},use(x,...I){const E=typeof x=="function"?x:x&&typeof x.default=="function"?x.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...I],S=x;return u=!0,E.apply(S,F),this},render(x,I){if(A(this,x.length)){I!==void 0&&us(I);const S=o_(x);if(S!==null)return I!==void 0&&yo(I,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=I??{},F=this.parse(x,E);return g().render(F,this.options,E)},async renderAsync(x,I){if(A(this,x.length)){I!==void 0&&us(I);const S=o_(x);if(S!==null)return I!==void 0&&yo(I,{area:"render",path:"stock-fast",reason:"stock-subset"}),S}const E=I??{},F=this.parse(x,E);return g().renderAsync(F,this.options,E)},renderIterable(x,I={}){const E=this.parseIterable(x,I);return g().render(E,this.options,I)},async renderAsyncIterable(x,I={}){const E=await this.parseAsyncIterable(x,I);return g().renderAsync(E,this.options,I)},renderInline(x,I={}){const E=this.parseInline(x,I);return g().render(E,this.options,I)},validateLink:f6,normalizeLink:h6,normalizeLinkText:p6,utils:Nz,helpers:{...yU},parse(x,I){if(typeof x!="string")throw new TypeError("Input data should be a String");if(I!==void 0&&us(I),$(this,x.length)){const L=wj(x);if(L!==null)return I!==void 0&&yo(I,{area:"parse",path:"stock-fast",reason:"stock-subset"}),L}const E=I??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&k(this)){const L=A6(this,x.length);if(L==="yes"){const R=nd(this,x,E);return yo(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),R}L==="need-lines"&&(F=so(x))}if(!this.stream.enabled){const L=x.length,R=this.options.autoTuneChunks!==!1,D=r,z=!a&&k(this),H=!!this.options.fullChunkedFallback,U=z&&L>=2e5;let Z;(H||U||F!==void 0)&&(Z=F??so(x));const K=(H||U)&&R&&!D?sV(L,Z,this.options):null;if(H||U){const V=Z??0;if(H?L>=(this.options.fullChunkThresholdChars??2e4)||V>=(this.options.fullChunkThresholdLines??400):U){if(K&&K.strategy!=="plain"){const J=gp(this,x,E,{maxChunkChars:K.maxChunkChars,maxChunkLines:K.maxChunkLines,fenceAware:K.fenceAware,maxChunks:K.maxChunks});return I&&g_(I,H?"explicit-full-chunk":"default-large-string"),J}if(H){const J=(le,ne,q)=>le<ne?ne:le>q?q:le,fe=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,ce=J(Math.ceil(L/oe),8e3,64e3),ue=J(Math.ceil(V/oe),150,700),Se=fe?ce:this.options.fullChunkSizeChars??1e4,Te=fe?ue:this.options.fullChunkSizeLines??200,Ae=fe?J(Math.ceil(L/64e3),oe,32):this.options.fullChunkMaxChunks,P=gp(this,x,E,{maxChunkChars:Se,maxChunkLines:Te,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:Ae});return I&&g_(I,"explicit-full-chunk"),P}}}if(F!==void 0&&k(this)&&C6(this,L,Z??F)){const V=nd(this,x,E);return yo(I,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),V}}const S=Ts(x);return yo(I,{area:"parse",path:"plain",reason:"default-plain"}),Pc(E,S,()=>h.parse(x,E,this).tokens)},parseIterable(x,I={}){return us(I),eV(this,x,I)},parseAsyncIterable(x,I={}){return us(I),tV(this,x,I)},parseIterableToSink(x,I,E={}){return us(E),nV(this,x,I,E)},parseAsyncIterableToSink(x,I,E={}){return us(E),oV(this,x,I,E)},parseInline(x,I={}){if(typeof x!="string")throw new TypeError("Input data should be a String");us(I),Yd(I)&&zr(I);const E=h.createState(x,I,this);return E.inlineMode=!0,h.process(E),E.tokens}};if(N.stream={enabled:!!n.stream,parse(x,I){return N.stream.enabled?v().parse(x,I,N):N.parse(x,I??{})},reset(){v().reset()},peek(){return b?b.peek():[]},stats(){return b?b.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){b&&b.resetStats()}},i?.components){const x=i.components;x.core?.rules&&N.core.ruler.enableOnly(x.core.rules),x.block?.rules&&N.block.ruler.enableOnly(x.block.rules),x.inline?.rules&&N.inline.ruler.enableOnly(x.inline.rules),x.inline2?.rules&&N.inline.ruler2.enableOnly(x.inline2.rules)}return d=yV(N),f=N.parse,N}var xV=bV;const I6=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],wV=["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"],L6=["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"],_V=["svg","g","path"],SV=["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"],CV=["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","srcdoc","ping"],AV=["action","data","href","src","srcset","poster","xlink:href","formaction"],MV=["script"],EV=["pre","iframe","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Ha=new Set(I6),TV=new Set(L6),$d=new Set([...I6,...wV,...L6,..._V]),$6=new Set([...$d,...SV]),NV=new Set(CV),IV=new Set(AV),Qd=new Set(MV),F6=new Set(EV);function O6(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 LV={amp:"&",bsol:"\\",colon:":",newline:`
163
- `,sol:"/",tab:" "};function R6(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 LV[String(s??"").toLowerCase()]??t})}const Zf=new Set(["http","https","mailto","tel"]),$V=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),sa=new Set(["http","https"]);function B6(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function FV(e,t,n){if(!id(t,n)||!e.startsWith("file:///"))return!1;const o=e.charAt(8);return o!=="/"&&o!=="\\"}function id(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function OV(e,t){return t==="href"||t==="xlink:href"?id(e,t)?Zf:sa:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?sa:(id(e,t),Zf)}function Ca(e,t={}){const n=O6(R6(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=B6(n);return i?i==="file"?!FV(n,o,s):id(o,s)?$V.has(i):!OV(o,s).has(i):!1}function RV(e){const t=R6(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=B6(O6(t).toLowerCase());return n==="http"||n==="https"}function BV(e,t={}){const n=String(e??"").trim();return n?Ca(n,t)?"":n:""}function v_(e){return BV(e,{tagName:"img",attrName:"src"})}function DV(e,t,n){function o(f){return f.trim().split(" ",2)[0]===t}function s(f,h,p,g,b){return f[h].nesting===1&&f[h].attrJoin("class",t),b.renderToken(f,h,p,g,b)}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,g){let b,v=!1,m=f.bMarks[h]+f.tShift[h],y=f.eMarks[h];if(l!==f.src.charCodeAt(m))return!1;for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);const k=Math.floor((b-m)/a);if(k<i)return!1;b-=(b-m)%a;const A=f.src.slice(m,b),$=f.src.slice(b,y);if(!c($,A))return!1;if(g)return!0;let N=h;for(;N++,!(N>=p||(m=f.bMarks[N]+f.tShift[N],y=f.eMarks[N],m<y&&f.sCount[N]<f.blkIndent));)if(l===f.src.charCodeAt(m)&&!(f.sCount[N]-f.blkIndent>=4)){for(b=m+1;b<=y&&r[(b-m)%a]===f.src[b];b++);if(!(Math.floor((b-m)/a)<k)&&(b-=(b-m)%a,b=f.skipSpaces(b),!(b<y))){v=!0;break}}const x=f.parentType,I=f.lineMax;f.parentType="container",f.lineMax=N;const E=f.push("container_"+t+"_open","div",1);E.markup=A,E.block=!0,E.info=$,E.map=[h,N],f.md.block.tokenize(f,h+1,N);const F=f.push("container_"+t+"_close","div",-1);return F.markup=f.src.slice(m,b),F.block=!0,f.parentType=x,f.lineMax=I,f.line=N+(v?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 PV(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 b=0;b<a.length;b++){const v=a[b];if(v==="\\"){b++;continue}if(!u&&v==="'"){c=!c;continue}if(!c&&v==='"'){u=!u;continue}if(!c&&!u&&v===":"){d=b;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 g;if(!h)g="";else if(h.startsWith('"')&&h.endsWith('"')||h.startsWith("'")&&h.endsWith("'"))try{g=JSON.parse(h.replace(/^'/,'"').replace(/'$/,'"'))}catch{g=h}else/^-?\d+(?:\.\d+)?$/.test(h)?g=Number(h):h==="true"||h==="false"?g=h==="true":h==="null"?g=null:g=h;l[p]=g}return l}function HV(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(DV,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("{"),g=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,g?.startsWith("{")){let A=0,$=-1;for(let N=0;N<g.length;N++)if(g[N]==="{"?A++:g[N]==="}"&&A--,A===0){$=N+1;break}$>0&&(h=g.slice(0,$))}h||(f=d||void 0)}if(s)return!0;const b=!!i.env.__markstreamFinal;let v=n+1,m=!1;for(;v<=o;){const A=i.bMarks[v]+i.tShift[v],$=i.eMarks[v];if(i.src.slice(A,$).trim()===":::"){m=!0;break}v++}m||(v=o);const y=i.push("vmr_container_open","div",1);if(y.attrSet("class",`vmr-container vmr-container-${u}`),y.meta={...y.meta??{},unclosed:!m&&!b},f&&y.attrSet("data-args",f),h)try{const A=JSON.parse(h);for(const[$,N]of Object.entries(A)){const x=N!=null&&typeof N=="object";y.attrSet(`data-${$}`,x?JSON.stringify(N):String(N))}}catch{const A=PV(h);if(A)for(const[$,N]of Object.entries(A)){const x=N!=null&&typeof N=="object";y.attrSet(`data-${$}`,x?JSON.stringify(N):String(N))}else y.attrSet("data-attrs",h)}const k=[];for(let A=n+1;A<v;A++){const $=i.bMarks[A]+i.tShift[A],N=i.eMarks[A];k.push(i.src.slice($,N))}if(k.some(A=>A.trim().length>0)){let A=k.join(`
165
- `);A.endsWith(`
166
- `)||(A+=`
167
- `),A.endsWith(`
168
-
169
- `)||(A+=`
170
- `);const $=i.tokens[i.tokens.length-1];$&&($.raw=A);const N=[];i.md.block.parse(A,i.md,i.env,N),i.tokens.push(...N)}return m&&i.push("vmr_container_close","div",-1),i.line=m?v+1:v,!0},{alt:["paragraph","reference","blockquote","list"]})}function Gs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jn(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 Nm(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 WV=/^[a-z][a-z0-9_-]*$/;function y_(e){return WV.test(String(e??"").trim().toLowerCase())}function _i(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return y_(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)?"":y_(s)?s:""}function ru(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const o of e){const s=_i(o);!s||t.has(s)||(t.add(s),n.push(s))}return n}function zV(...e){const t=new Set,n=[];for(const o of e)for(const s of ru(o))t.has(s)||(t.add(s),n.push(s));return n}function UV(e){const t=ru(e);return{key:t.join(","),tags:t}}function D6(e){return _i(e)}function qV(e,t){const n=String(e??""),o=_i(t);if(!o)return!1;const s=Gs(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 P6(e,t){const n=_i(t);return!!n&&!$d.has(n)&&!qV(e,n)}function jV(e,t){const n=String(e??""),o=_i(t);if(!o)return n;const s=Gs(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 H6=Ha,VV=$d,W6=new Set(TV);W6.delete("details");const KV=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,GV=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,uv=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,YV=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function kp(e){return(e.match(uv)?.[1]??"").toLowerCase()}function ok(e){return/^\s*<\s*\//.test(e)}function sk(e,t){return H6.has(t)||/\/\s*>\s*$/.test(e)}function ZV(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=kp(i);if(r===t){if(ok(i)){if(n===0)return o;n--;continue}sk(i,r)||n++}}return-1}function QV(e,t){let n=0;for(const o of e){if(!o||o.type!=="html_inline")continue;const s=String(o.content??""),i=kp(s);if(i===t){if(ok(s)){n>0&&n--;continue}sk(s,i)||n++}}return n}function k_(e,t,n=0){const o=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 XV(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Gs(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 bp(e){const t=e;return String(t.raw??t.content??t.markup??"")}function JV(e){const t=e;return t.meta||(t.meta={}),t.meta}function S0(e,t,n){const o=JV(e);o.markstreamCustomHtmlRaw=t,o.markstreamCustomHtmlInner=n}function eK(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Gs(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 g=0;g<o.length;g++)o[g].raw+=h,g<o.length-1&&(o[g].inner+=h);const p=o.pop();S0(p.token,p.raw,p.inner)},u=h=>{const p=o[o.length-1]?.tag;if(!p)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Gs(p)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!u(h),f=(h,p,g)=>{const b=g??(h.type==="html_inline"?kp(p):"");if(!(b&&t.has(b))){r(p);return}const v=ok(p),m=!v&&sk(p,b);if(v){if(!o.length||o[o.length-1].tag!==b){r(p);return}c(p);return}if(r(p),m){S0(h,p,"");return}o.push({tag:b,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 g=0,b=!0;for(const v of h.children){const m=bp(v),y=v.type==="html_inline"?kp(m):"",k=y&&t.has(y);let A=m;if(b&&p&&m&&(o.length||k)){const $=p.indexOf(m,g);if($!==-1)a(p.slice(g,$)),A=p.slice($,$+m.length),g=$+m.length;else{if(o.length&&!k)continue;b=!1}}f(v,A,y)}b&&p&&g<p.length&&o.length&&a(p.slice(g)),s=o.length>0;continue}if(o.length&&typeof h.content=="string"){const p=bp(h),g=h.type==="html_block"?u(p):null;if(g){c(`${s?`
172
- `:""}${g}`),s=o.length>0;continue}if(!h.content)continue;l(),r(h.content),s=!0}}for(const h of o)S0(h.token,h.raw,h.inner)}function tK(e){return/^\s*<\s*[!?]/.test(e)}function nK(e){const t=new Set(VV);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 b_(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function oK(e,t){let n=null;for(const i of e.matchAll(KV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();b_(l,t)&&Jn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(GV)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();b_(l,t)&&Jn(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 sK(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function iK(e,t){if(!e.length)return{children:e};const n=[];let o=null,s=null;function i(a,c){a&&(c?n.push(sK(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(uv);if(!h){i("<",c),u=d+1;continue}const p=Jn(f);if(p===-1){i("<",c),u=d+1;continue}const g=f.slice(0,p+1),b=(h[1]??"").toLowerCase();t.has(b)?n.push({type:"html_inline",tag:"",content:g,raw:g}):i(g,c),u=d+g.length}}function l(a,c){if(!a)return;const u=oK(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+=bp(a),s=o.buffer;const c=Jn(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=bp(a),u=(c.match(uv)?.[1]??"").toLowerCase();if(u&&t.has(u)&&Jn(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 rK=["a","span","strong","em","b","i","u"];function lK(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const f of t.customHtmlTags){const h=_i(f);h&&n.add(h)}const o=f=>{const h=f,p=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const y of g){const k=_i(String(y??""));k&&p.add(k)}const b=nK(Array.from(p)),v=new Set(rK);for(const y of p)v.add(y);return{autoCloseInlineTagSet:v,commonHtmlTags:b,customTagSet:p,shouldMergeHtmlBlockTag:y=>p.has(y)||!b.has(y)||W6.has(y)}},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 g=p.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const b={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},b,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[b]},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:g}=o(f);for(const b of h){const v=b;if(v.type!=="inline"||!Array.isArray(v.children))continue;const m=String(v.content??""),y=v.children.length?v.children:m.includes("<")?[{type:"text",content:m,raw:m}]:null;if(y)try{const k=iK(y,p);if(v.children=k.children,k.pendingBuffer){const A=m.lastIndexOf(k.pendingBuffer);if(A!==-1){const $=m.slice(0,A);v.content=$,typeof v.raw=="string"&&(v.raw=$)}}}catch(k){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",k)}}eK(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:p,customTagSet:g,shouldMergeHtmlBlockTag:b}=o(f),v=[];for(let m=0;m<h.length;m++){const y=h[m];if(v.length>0){const[A,$]=v[v.length-1];if(m!==$){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const N=String(y.content??y.raw??"");if(N){const x=h[$],I=`${String(x.content||"")}
173
- ${N}`,E=Jn(I),F=E===-1?null:k_(I,A,E+1);if(F){const S=I.slice(0,F.end),L=I.slice(F.end);x.content=S,x.loading=!1,h.splice(m,1),v.pop();const R=d(x,L)?[]:c(L,u(h,m,"paragraph"));R.length&&h.splice(m,0,...R),m--;continue}x.content=I,x.loading!==!1&&(x.loading=!0)}h.splice(m,1),m--;continue}}const k=s(y);if(k){if(tK(k))continue;const A=(k.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(k);if(!A||!b(A))continue;if(i(y,k),!$)A&&!new RegExp(`^\\s*<\\s*${A}\\b[^>]*\\/\\s*>`,"i").test(k)&&XV(k,A)>0&&v.push([A,m]);else if(v.length>0&&A&&v[v.length-1][0]===A){const[,N]=v[v.length-1],x=h[N];x.content=`${String(x.content||"")}
174
- ${k}`,x.loading=!1,v.pop(),h.splice(m,1),m--}continue}else if(v.length>0){if(y.type==="paragraph_open"||y.type==="paragraph_close"){h.splice(m,1),m--;continue}const A=y.content||"",$=new RegExp(`<\\s*\\/\\s*${v[v.length-1][0]}\\s*>`,"i").test(A);if(A){const[,N]=v[v.length-1],x=h[N];x.content=`${x.content||""}
175
- ${A}`,x.loading!==!1&&(x.loading=!$)}$&&v.pop(),h.splice(m,1),m--}else continue}if(g.size>0){const m=new Map,y=new Map,k=N=>{let x=m.get(N);return x||(x=new RegExp(`<\\s*${N}\\b`,"i"),m.set(N,x)),x},A=N=>{let x=y.get(N);return x||(x=new RegExp(`<\\s*\\/\\s*${N}\\s*>`,"i"),y.set(N,x)),x},$=[];for(let N=0;N<h.length;N++){const x=h[N],I=String(x.content??"");if($.length>0){const F=$[$.length-1],S=h[F.index],L=x.type==="html_block"?A(F.tag).exec(I):null;if(L){const z=L.index+L[0].length,H=I.slice(0,z),U=I.slice(z);S.content=`${String(S.content??"")}
176
- ${H}`,Array.isArray(S.children)&&S.children.push({type:"html_inline",content:`</${F.tag}>`,raw:`</${F.tag}>`}),$.pop();const Z=d(S,U)?[]:c(U,u(h,N,"paragraph"));Z.length?h.splice(N,1,...Z):(h.splice(N,1),N--);continue}if(x.type!=="inline")continue;const R=Array.isArray(x.children)?x.children:[],D=ZV(R,F.tag);if(D!==-1){const z=R.slice(0,D+1),H=R.slice(D+1),U=z.map(Z=>String(Z?.content??Z?.raw??"")).join("");if(S.content=`${String(S.content??"")}
177
- ${U}`,Array.isArray(S.children)&&S.children.push(...z),H.length){const Z=H.map(K=>String(K.content??K.raw??"")).join("");if(Z.trim()){const K=Z.replace(/^\s+/,"");if(d(S,Z))h.splice(N,1),N--;else if(K.startsWith("<"))h.splice(N,1,{type:"html_block",content:K});else{const V=c(Z,u(h,N,"paragraph"));h.splice(N,1,...V)}}else h.splice(N,1),N--}else h.splice(N,1),N--;$.pop();continue}S.content=`${String(S.content??"")}
178
- ${I}`,Array.isArray(S.children)&&S.children.push(...R),h.splice(N,1),N--;continue}if(x.type!=="inline")continue;const E=Array.isArray(x.children)?x.children:[];for(const F of g)if((E.length?QV(E,F):k(F).test(I)&&!A(F).test(I)?1:0)>0){$.push({tag:F,index:N});break}}}{let m=0;for(let y=0;y<h.length;y++){const k=h[y];if(k.type==="paragraph_open"){m++;continue}k.type==="paragraph_close"&&(m>0?m--:(h.splice(y,1),y--))}}for(let m=0;m<h.length;m++){const y=h[m];if(y.type==="html_block"){const x=(y.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(x.startsWith("!")||x.startsWith("?")){y.loading=!1;continue}if(g.has(x)){const D=String(y.content??""),z=Jn(D),H=z===-1?null:k_(D,x,z+1);y.loading=H?!1:y.loading!==void 0?y.loading:!0;const U=H?.start??-1,Z=H?H.end-H.start:0;if(U!==-1){const K=D.slice(0,U+Z);let V="";z!==-1&&z<U&&(V=D.slice(z+1,U)),y.children=[{type:x,content:V,raw:K,attrs:[],tag:x,loading:!1}],y.content=K,y.raw=K;const J=c(D.slice(U+Z)||"","text");J.length&&h.splice(m+1,0,...J)}else y.children=[{type:x,content:"",raw:D,attrs:[],tag:x,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(x))continue;y.type="inline";const I=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let E;for(;(E=I.exec(y.content||""))!==null;)E[1],E[2]||E[3]||E[4];const F=String(y.content??""),S=new RegExp(`<\\/\\s*${x}\\s*>`,"i").exec(F),L=S?S.index:-1,R=S?S[0].length:0;if(L!==-1){const D=F.slice(0,L+R),z=(F.slice(L+R)||"").replace(/^\s+/,"");y.children=[{type:"html_block",content:D,tag:x,loading:!1}],y.content=D,y.raw=D,z&&h.splice(m+1,0,z.startsWith("<")?{type:"html_block",content:z}:{type:"text",content:z,raw:z})}else y.children=[{type:"html_block",content:y.content,tag:x,loading:!0}];continue}if(!y||y.type!=="inline")continue;if(y.children.length===2&&y.children[0].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),I=y.children[1],E=String(I?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(I?.type==="html_inline"&&E===x)continue;p.has(x)?(y.children[0].loading=!0,y.children[0].tag=x,y.children.push({type:"html_inline",tag:x,loading:!0,content:`</${x}>`})):y.children=[{type:"html_block",loading:!0,tag:x,content:String(y.children[0]?.content??"")+String(y.children[1]?.content??"")}];continue}else if(y.children.length===3&&y.children[0].type==="html_inline"&&y.children[2].type==="html_inline"){const x=(y.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(p.has(x))continue;y.children=[{type:"html_block",loading:!1,tag:x,content:y.children.map(I=>I.content).join("")}];continue}if(!y.content?.startsWith("<")||y.children?.length!==1)continue;const k=String(y.content),A=y,$=A.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(k)&&(A.children.length=0);continue}const N=String($.content??k).match(YV)?.[1]?.toLowerCase()??"";if(N){if(/\/\s*>\s*$/.test(k)||H6.has(N)){A.children=[{type:"html_inline",content:k}];continue}A.children.length=0}}})}function aK(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 cK(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&&!aK(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 z6=/\.([a-z0-9]{1,15})$/i,uK=/[_()[\]{}<>]/u,dK=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,fK=/[?#@]/u,hK=/[\\/]/u,pK=/^[\p{L}\p{N}./\\-]+$/u,mK=/^[A-Za-z0-9-]{1,63}$/u,gK=/^xn--[a-z0-9-]{2,59}$/i,vK=/^(?:[A-Z]{1,6}|\d{1,8})$/u,yK=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,kK=/文件名\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,bK=/文件名\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,xK=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,wK=new Set(["ai","md","py","rs","sh","zip"]),U6=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),_K=new Set([...U6,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),SK=new Set(["com","dev","io","page","site"]),CK=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),AK=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"]);function Fd(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function C0(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Fd(n)?n:void 0}function x_(e,t){if(!Fd(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 w_(e){const t=Xd(e);return Fd(t)?t:void 0}function MK(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function __(e,t){if(!Fd(t))return;const n=String(e??"").trim().split(/\s+/u).map(MK).filter(Boolean);if(n.length===0)return;const o={};return t?.filename&&n.every(s=>xp(s,{filename:!0,explicitFilename:t.explicitFilename}))&&(o.filename=!0),t?.explicitFilename&&o.filename&&(o.explicitFilename=!0),t?.marketTicker&&n.every(s=>xp(s,{marketTicker:!0}))&&(o.marketTicker=!0),Fd(o)?o:void 0}function Hl(e,t=!1){let n;return{options(o){return t||o==null?x_(e,n):x_(e,C0(w_(o),__(o,n)))},remember(o){const s=w_(o);n=t?C0(n,s):C0(s,__(o,n))},reset(){n=void 0}}}function S_(e){return mK.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function EK(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return S_(n)||gK.test(n)?t.every(S_):!1}function q6(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function TK(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function NK(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function j6(e,t,n){const o=TK(t);return q6(e)&&NK(o)&&String(n??"").toLowerCase().includes(o.toLowerCase())}function Xd(e){const t=String(e??"");return{explicitFilename:kK.test(t),filename:bK.test(t),marketTicker:xK.test(t)}}function IK(e){return EK(e.split(/[\\/]/)[0]??"")}function LK(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function $K(e){if(uK.test(e)||!pK.test(e))return!0;if(hK.test(e))return!IK(e);const t=e.replace(z6,"");return q6(t)?!0:t.split(".").filter(Boolean).some(LK)}function FK(e,t,n){if(!(n?_K:U6).has(t))return!1;const o=e.slice(0,-(t.length+1));return o===""?e.startsWith("."):(n?yK:vK).test(o)}function xp(e,t={}){if(!e||dK.test(e)||fK.test(e))return!1;const n=e.match(z6);if(!n)return!1;const o=String(n[1]??"").toLowerCase();return FK(e,o,t.marketTicker===!0)?!0:AK.has(o)?!wK.has(o)||t.filename?!0:$K(e):!!(t.explicitFilename&&SK.has(o)||t.filename&&CK.has(o))}const C_=["!"];function Ms(e){return{type:"text",content:e,raw:e}}function ia(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 ra(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 il(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 OK(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(Ms(t))}}function A_(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 RK(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function BK(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 DK(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 PK(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=HK(s.children,typeof s.content=="string"?s.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function HK(e,t){if(e.length<3||e.some(o=>o.type==="code_inline"))return e;const n=Xd(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=DK(e,o,i),l=RK(s);if(s.markup==="linkify"&&r&&!j6(r,l,t)&&xp(r,n)){e.splice(o,i-o+1,Ms(r));continue}const a=A_(l,C_);for(let c=o+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=A_(u.content,C_);if(d===-1)continue;const f=u.content[d],h=u.content.slice(0,d);let p=u.content.slice(d);for(let v=c+1;v<i;v++){const m=e[v];m?.type==="text"&&typeof m.content=="string"&&(p+=m.content)}u.content=h,u.raw=h;const g=i-(c+1);g>0&&(e.splice(c+1,g),i=c+1);let b=l;if(a!==-1)b=l.slice(0,a);else if(p){const v=encodeURI(p);if(v&&l.endsWith(v))b=l.slice(0,l.length-v.length);else{const m=f?encodeURI(f):"",y=m?l.indexOf(m):-1;y!==-1&&(b=l.slice(0,y))}}b!==l&&BK(s,b),p&&e.splice(i+1,0,Ms(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(Ms(r));const c=i[1],u=l[1].length;ia(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(il(c,d,!e[o+4]?.content?.startsWith(")"))),ra(a,u),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)\**/,"");f&&a.push(Ms(f)),e.splice(o,5,...a)}else e.splice(o,4,...a)}else{r&&a.push(Ms(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=""),ia(a,f),a.push(il(c,h,!e[o+4]?.content?.startsWith(")"))),ra(a,f),e[o+4]?.type==="text"){const p=e[o+4].content?.replace(/^\)/,"");p&&a.push(Ms(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(il(c,d,!e[o+4]?.content?.startsWith(")"))),e[o+4]?.type==="text"){const f=e[o+4].content?.replace(/^\)/,"");f&&a.push(Ms(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(il(r,l,c));const u=e[o+3].content?.replace(/^\)\**/,"");u&&i.push(Ms(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;ia(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 g=d?d[1].length:e[o-3].markup.length,b=e[p];if(g===1&&b.type==="em_close")break;if(g===2&&b.type==="strong_close")break;if(g===3&&(b.type==="em_close"||b.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;ra(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(Ms(l)),ia(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(il(a,c,u)),ra(r,i),e[o+1]?.type==="text"){const d=e[o+1].content?.replace(/^\)\**/,"");d&&r.push(Ms(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(Ms(r)),ia(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(il(l,a,c)),ra(i,2),e[o+1]?.type==="text"){const u=e[o+1].content?.replace(/^\)\**/,"");u&&i.push(Ms(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(Ms(r)),ia(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(il(a,c,d)),ra(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=[];ia(a,2),a.push(il(r,l,!1)),ra(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;OK(s,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(o+1,1)}return e}function WK(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=zK(s.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function zK(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 UK(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=qK(s.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function qK(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 g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="__"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.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 g=e[p];let b=u+1;for(;b<e.length&&e[b].type==="text"&&e[b].content==="";)b++;const v=e[b];h==="_"&&(g?.content?.endsWith("_")||v?.content?.startsWith("_")||v?.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=jK(l),l}function jK(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=VK(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 VK(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 KK(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const o=JK(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 M_(){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 E_(){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 T_(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 V6(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 A0(e){return V6(e)!==null}function K6(e){return/^:?-+:?$/.test(e.trim())}function GK(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(K6)}function YK(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function ZK(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(K6)&&YK(n)}function QK(e){return e==="|"||e==="|:"}function XK(e){const t=V6(e);return t!==null&&t.every(n=>!n.includes(":"))}function JK(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)&&A0(r);if(!t&&(r.includes(`
183
- `)&&u.length===0&&A0(a)&&ZK(c)||d)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else if(r.includes(`
184
- `)&&u.length===0&&A0(a)&&GK(c)){const f=l.slice(1,-1).split("|").map(p=>p.trim()).flatMap(p=>T_(p)),h=[...M_(),...f,...E_()];o.splice(s-1,3,...h)}else r.includes(`
185
- `)&&u.length===0&&XK(a)&&QK(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return o}function eG(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 tG=eG;const nG=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],wp=nG.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),oG=/\\[a-z]+/i,G6="(?:\\\\|\\u0008)",sG=new RegExp(String.raw`${G6}(?:${wp})\s*\{[^}]+\}`,"i"),iG=new RegExp(String.raw`(?:${G6})?(?:${wp})\s*\{`,"i"),rG=/\\(?:text|frac|left|right|times)/,lG=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,aG=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,cG=/[A-Z]+\s*\([^)]+\)/i,uG=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,dG=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,fG=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,hG={"\b":"\\b","\v":"\\v","\f":"\\f"};function pG(e){let t="";for(const n of e)t+=hG[n]??n;return t}function Ac(e){if(!e)return!1;const t=pG(e),n=t.trim();if(fG.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const o=oG.test(t),s=sG.test(t),i=iG.test(t),r=rG.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=lG.test(t)&&!aG.test(t),c=cG.test(t),u=uG.test(n),d=dG.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 Y6="__markstreamMathPluginApplied",dv=80,Z6=2e4,N_=Z6+4096;function Q6(e){return!!e[Y6]}function mG(e){e[Y6]=!0}const X6=["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"],gG=["cdot","mathbf{","partial","mu_{"],J6=X6.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),eM="[ \r\b\f\v]",vG=new RegExp(`([^\\\\])(${gG.map(e=>e).join("|")})+`,"g"),yG=/span\{([^}]+)\}/,kG=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,bG=/(^|[^\\])\\\r?\n/g,xG=/(^|[^\\])\\$/g,wG=new RegExp(`(${eM})|(${J6})\\b`,"g"),I_=new Map,L_=new Map;function _G(e){if(!e)return wG;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),o=I_.get(n);if(o)return o;const s=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${eM})|(${s})\\b`,"g");return I_.set(n,i),i}function SG(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const o=e?"__default__":n.join(""),s=L_.get(o);if(s)return s;const i=e?[wp,J6].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),wp].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return L_.set(o,r),r}const $_={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function F_(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function O_(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 rl(e,t){const n=t?.commands??X6,o=t?.escapeExclamation??!0,s=t?.commands==null,i=_G(s?void 0:n);let r=e.replace(i,(c,u,d,f,h)=>{if(u!==void 0&&$_[u]!==void 0)return`\\${$_[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=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=SG(s,s?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(yG,"span\\{$1\\}").replace(kG,"\\operatorname{span}\\{$1\\}"),l=l.replace(bG,`$1\\\\
186
- `),l=l.replace(xG,"$1\\\\"),l=l.replace(vG,"$1\\$2"),l}function R_(e){const t=e.trim();return!(!Ac(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 tM(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 _p(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function CG(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 Jd(e,t){let n=t-1,o=0;for(;n>=0&&e[n]==="\\";)o++,n--;return o%2===1}function fv(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("$",n);if(o===-1)return-1;if(Jd(e,o)){n=o+1;continue}return o}return-1}function M0(e,t){let n=t;for(;n<e.length;){const o=fv(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 ju(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(!Jd(e,s))return s;o=s+Math.max(1,t.length)}return-1}function B_(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=_p(s,a);if(c){r=Math.max(a+Math.max(1,t.length),c[1]);continue}Jd(e,a)||i++,r=a+Math.max(1,t.length)}return i}function ik(e,t,n){const o=Rd(String(e??""));if(!o.endsWith(t))return-1;const s=o.length-t.length;if(s<=0||!Rd(o.slice(0,s)).trim()||Jd(o,s))return-1;const i=tM(o);if(_p(i,s))return-1;const r=B_(o,t,0,s,i);if(t==="$$"){if(r%2===1)return-1}else if(r>B_(o,n,0,s,i))return-1;return s}function Od(e){return e===" "||e===" "}function Rd(e){let t=e.length;for(;t>0&&Od(e[t-1]);)t--;return e.slice(0,t)}function D_(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
187
- `&&t++;return t}function P_(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function AG(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(!Od(s))return!1}return n>=3}function MG(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 EG(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(MG)}function TG(e){let t=0;if(!P_(e[t]))return!1;for(;P_(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Od(e[t+1])}function nM(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&&Od(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Od(t[1])||TG(t)||AG(t)||EG(t))}function H_(e,t){return e?t?`${e}
188
- ${t}`:e:t}function hv(e){const t=String(e??"").trim();return t?Ac(t):!1}function W_(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function oM(e){if(e.length<=N_)return{source:e,lineOffset:0};let t=e.length-N_;const n=e.indexOf(`
189
- `,t);return n===-1?{source:"",lineOffset:D_(e)}:(t=n+1,{source:e.slice(t),lineOffset:D_(e.slice(0,t))})}function sM(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return!1;const{source:n}=oM(t);if(!n)return!1;const o=n.split(/\r?\n/),s=Math.max(0,o.length-dv-2),i=[["$$","$$"],["\\[","\\]"]];for(let r=s;r<o.length;r++){const l=Rd(o[r]);if(l&&!nM(l)){for(const[a,c]of i)if(ik(l,a,c)!==-1)return!0}}return!1}function NG(e){const t=String(e??"");if(!t||!t.includes("$$")&&!t.includes("\\["))return null;const{source:n,lineOffset:o}=oM(t);if(!n)return null;const s=n.split(/\r?\n/),i=Math.max(0,s.length-dv-2),r=[["$$","$$"],["\\[","\\]"]];for(let l=i;l<s.length-1;l++){const a=Rd(s[l]);for(const[c,u]of r){const d=ik(a,c,u);if(d===-1)continue;let f="",h=!1;for(let p=l+1;p<s.length;p++){if(p-l>dv){h=!0;break}const g=s[p],b=ju(g,u);if(b!==-1){const v=H_(f,g.slice(0,b));if(!hv(v)){h=!0;break}const m=g.slice(b+u.length),y=m.trim()?`suffix:${W_(m)}`:"nosuffix";return["closed",c,o+l,d,o+p,b,W_(v),y].join(":")}if(nM(g)){h=!0;break}if(f=H_(f,g),f.length>Z6){h=!0;break}}if(!h&&hv(f))return["pending",c,o+l,d].join(":")}}return null}function E0(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function IG(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 T0(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function LG(e,t){mG(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=(m,y)=>{let k=y;for(;k<m.length&&(m[k]===" "||m[k]===" ");)k++;if(k===y||!(m[k]===`
190
- `||m[k]==="\r"&&m[k+1]===`
191
- `))return y;const A=m.slice(y,k),$=a.push("text","",0);return $.content=A,k};if(/^\*[^*]+/.test(a.src))return!1;if(a.src[a.pos]==="$"){let m=a.pos+1;for(;a.src[m]==="$";)m++;const y=m-a.pos,k=a.src[m];if(y>=3&&(!k||/\s/.test(k))){const A=a.push("text","",0);return A.content=a.src.slice(a.pos,m),a.pos=m,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),p=Math.max(0,a.pos-h.length);let g=p,b=p;const v=p;for(const[m,y]of f){const k=a.src,A=tM(k),$=CG(k,u);let N=!1;m==="$$"&&g!==v&&(g=v);let x=-1,I=-1,E=0;const F=S=>{if((S==="undefined"||S==null)&&(S=""),S==="\\"){a.pos=a.pos+S.length,g=a.pos;return}if(S==="\\)"||S==="\\("){const D=a.push("text_special","",0);D.content=S==="\\)"?")":"(",D.markup=S,a.pos=a.pos+S.length,g=a.pos;return}if(!S)return;if(m==="$$"&&S.includes("$")){let D=0;for(;D<S.length;){const z=fv(S,D);if(z===-1){const ue=S.slice(D);if(ue){const Se=a.push("text","",0);Se.content=ue,a.pos=a.pos+ue.length,g=a.pos}break}if(z>0&&S[z-1]==="$"||z+1<S.length&&S[z+1]==="$"){const ue=S.slice(D,z+1);if(ue){const Se=a.push("text","",0);Se.content=ue,a.pos=a.pos+ue.length,g=a.pos}D=z+1;continue}const H=S.slice(D,z);if(H){const ue=a.push("text","",0);ue.content=H,a.pos=a.pos+H.length,g=a.pos}const U=M0(S,z+1);if(U===-1){const ue=S.slice(z),Se=a.push("text","",0);Se.content=ue,a.pos=a.pos+ue.length,g=a.pos;break}const Z=S.slice(z+1,U),K=Z.includes("`"),V=!Z||!Z.trim(),J=S[U+1],fe=E0(Z,J),oe=T0(Z);if(!K&&!V&&!fe&&!oe){const ue=a.push("math_inline","math",0);ue.content=rl(Z,t),ue.markup="$",ue.raw=`$${Z}$`,ue.loading=!1,a.pos=a.pos+(U-z+1),g=a.pos,D=U+1;continue}const ce=a.push("text","",0);ce.content="$",a.pos=a.pos+1,g=a.pos,D=z+1}return}const L=S.indexOf("![");if(L!==-1){if(L>0){const H=S.slice(0,L),U=a.push("text","",0);U.content=H,a.pos=a.pos+H.length,g=a.pos}const D=S.slice(L).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(D){const[,H,U]=D,Z=U.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),K=Z?Z[1]:U,V=Z&&Z[2]?Z[2]:null,J=a.push("image","img",0);J.attrs=[["src",K],["alt",H]],V&&J.attrs.push(["title",V]),J.content=H,J.children=[{type:"text",content:H,tag:""}],a.pos=a.pos+D[0].length,g=a.pos;const fe=S.slice(L+D[0].length);fe&&F(fe);return}const z=a.push("text","",0);z.content=S,a.pos=a.pos+S.length,g=a.pos;return}const R=a.push("text","",0);R.content=S,a.pos=a.pos+S.length,g=a.pos};for(;!(g>=k.length);){const S=k.indexOf(m,g);if(S===-1)break;if(Jd(k,S)){g=S+Math.max(1,m.length);continue}const L=_p(A,S);if(L){g=L[1];continue}const R=_p($,S);if(R){g=R[1];continue}if(S===x&&g===I){if(E++,E>2){g=S+Math.max(1,m.length);continue}}else E=0,x=S,I=g;if(m==="("&&S>0){let fe=S-1;for(;fe>=0&&k[fe]===" ";)fe--;if(fe>=0&&k[fe]==="]"){g=S+m.length;continue}}if(m==="$"&&S>0&&k[S-1]==="$"){g=S+1;continue}if(m==="$"&&S<k.length-1&&k[S+1]==="$"){g=S+2;continue}const D=m==="$"?M0(k,S+m.length):tG(k,S+m.length,m,y);if(D===-1){const fe=k.slice(S+m.length);if(fe.includes(m)){g=k.indexOf(m,S+m.length);continue}if(D===-1){const oe=m==="$"&&IG(fe);if(u&&!c&&!oe&&Ac(fe)&&!fe.includes("`")){if(g=S+m.length,N=!0,!l){a.pending="";const ce=b?k.slice(b,g):k.slice(0,g),ue=F_(ce)%2===1;if(b)F(k.slice(b,g));else{let Se=k.slice(0,g);Se.endsWith(m)&&(Se=Se.slice(0,Se.length-m.length)),F(Se)}if(ue){const Se=O_(ce)?.marker??"**",Te=a.push("strong_open","",0);Te.markup=Se;const Ae=a.push("math_inline","math",0);Ae.content=rl(fe,t),Ae.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ae.raw=`${m}${fe}${y}`,Ae.loading=!0,Te.content=fe,a.push("strong_close","",0)}else{const Se=a.push("math_inline","math",0);Se.content=rl(fe,t),Se.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Se.raw=`${m}${fe}${y}`,Se.loading=!0}a.pos=k.length}g=k.length,b=g}break}}const z=k.slice(S+m.length,D),H=z.includes("`"),U=!z||!z.trim(),Z=m==="$",K=k[D+y.length],V=Z&&E0(z,K),J=Z&&T0(z);if(c?H||U||V||J:H||U||V||J||!Z&&!Ac(z)){g=D+y.length;const fe=k.slice(a.pos,g);a.pending||(F(fe),b=g);continue}if(N=!0,!l){const fe=k.slice(a.pos-(a.pending??"").length,S);let oe=k.slice(0,g)?k.slice(b,S):fe;const ce=F_(oe)%2===1;S!==a.pos&&ce&&(oe=a.pending+k.slice(a.pos,S));const ue=ce?O_(oe):null,Se=ue?.marker??"**";if(a.pending!==oe)if(a.pending="",ce)if(ue){const Te=oe.slice(ue.index+Se.length);F(oe.slice(0,ue.index));const Ae=a.push("strong_open","",0);Ae.markup=Se;const P=a.push("text","",0);P.content=Te,a.push("strong_close","",0)}else F(oe);else F(oe);if(ce){const Te=a.push("strong_open","",0);Te.markup=Se;const Ae=a.push("math_inline","math",0);Ae.content=rl(z,t),Ae.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Ae.raw=`${m}${z}${y}`,Ae.loading=!1;const P=k.slice(D+y.length).startsWith(Se);return P&&a.push("strong_close","",0),a.pos=d(k,D+y.length),g=a.pos,b=g,P||a.push("strong_close","",0),!0}else{const Te=a.push("math_inline","math",0);Te.content=rl(z,t),Te.markup=m==="$$"?"$$":m==="\\("?"\\(\\)":m==="$"?"$":"()",Te.raw=`${m}${z}${y}`,Te.loading=!1}}return g=d(k,D+y.length),b=g,a.pos=g,!0}if(N){if(l)a.pos=g;else{if(m==="$$"&&g<k.length&&k.slice(g).includes("$")){let S=g;for(;!(S>=k.length);){const L=fv(k,S);if(L===-1)break;if(L+1<k.length&&k[L+1]==="$"){S=L+2;continue}if(L>0&&k[L-1]==="$"){S=L+1;continue}const R=M0(k,L+1);if(R===-1)break;const D=k.slice(L+1,R),z=D.includes("`"),H=!D||!D.trim(),U=k[R+1],Z=E0(D,U),K=T0(D);if(!z&&!H&&!Z&&!K){const V=k.slice(g,L);V&&F(V);const J=a.push("math_inline","math",0);J.content=rl(D,t),J.markup="$",J.raw=`$${D}$`,J.loading=!1,g=R+1,S=R+1}else F("$"),S=L+1}S<k.length&&F(k.slice(S))}else g<k.length&&F(k.slice(g));a.pos=k.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 g=u.src.slice(p,u.eMarks[l]).trim(),b=!1,v="",m="",y=!1,k="",A=!1;for(const[V,J]of h)if(g.startsWith(V))if(V.includes("["))if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=J;break}continue}}else if(g.replace("\\","")==="["){if(l+1<a){b=!0,v=V,m=J;break}continue}else{const fe=u.tokens[u.tokens.length-1];if(fe&&fe.type==="list_item_open"&&fe.mark==="-"&&g.slice(V.length,g.indexOf("]")).trim()==="x")continue;if(g.replace("\\","").startsWith("[")&&!g.includes("](")){const oe=g.indexOf("]");if(g.slice(oe).trim()!=="]")continue;const ce=g.slice(V.length,oe);if(V==="["?R_(ce):Ac(ce)){b=!0,v=V,m=J;break}continue}}else{b=!0,v=V,m=J;break}else if((V==="$$"||V==="\\[")&&g.endsWith(V)&&l+1<a){const fe=ik(g,V,J);if(fe===-1)continue;k=Rd(g.slice(0,fe)),A=!0;const oe=u.bMarks[l+1]+u.tShift[l+1];g=u.src.slice(oe,u.eMarks[l+1]).trim(),y=!0,b=!0,v=V,m=J;break}if(!b)return!1;if(c&&!A)return!0;const $=g.indexOf(v),N=$+v.length,x=!f&&v==="["?g.indexOf("\\]",N):-1,I=x>=0?"\\]":m,E=x>=0?x:ju(g,m,N);if(!y&&E>v.length){const V=g.slice($+v.length,E),J=u.push("math_block","math",0);J.content=rl(V),J.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",J.map=[l,l+1],J.raw=`${v}${V}${I}`,J.block=!0,J.loading=!1,u.line=l+1;const fe=g.slice(E+I.length);return fe.trim()&&n(u,fe,l),!0}let F=l,S="",L=!1,R="",D=l;const z=y?g:g===v?"":g.slice(v.length),H=!f&&v==="\\["?"]":"",U=ju(z,m);if(U!==-1){const V=U;S=z.slice(0,V),R=z.slice(V+m.length),D=y?l+1:l,L=!0,F=D}else for(z&&!y&&(S=z),F=l+1;F<a;F++){const V=u.bMarks[F]+u.tShift[F],J=u.eMarks[F],fe=u.src.slice(V,J),oe=fe.trim();if(!f&&v==="["&&oe==="\\]"){m="\\]",L=!0;break}if(H&&fe.trim()===H){m=H,L=!0;break}if(oe===m){L=!0;break}else if(!f&&v==="["&&fe.includes("\\]")){L=!0;const ce=fe.indexOf("\\]");m="\\]";const ue=fe.slice(0,ce);ue&&(S+=(S?`
192
- `:"")+ue),R=fe.slice(ce+m.length),D=F;break}else if(ju(fe,m)!==-1){L=!0;const ce=ju(fe,m),ue=fe.slice(0,ce);ue&&(S+=(S?`
193
- `:"")+ue),R=fe.slice(ce+m.length),D=F;break}S+=(S?`
194
- `:"")+fe}if((!d||f)&&!L)return!1;const Z=/^\s*!\[/.test(S);if(!(A?!Z&&hv(S):v==="$$"?!Z:v==="["?R_(S):Ac(S)))return!1;if(c)return!0;k&&n(u,k,l);const K=u.push("math_block","math",0);return K.content=rl(S),K.markup=v==="$$"?"$$":v==="["?"[]":"\\[\\]",K.raw=`${v}${S}${S.startsWith(`
195
- `)?`
196
- `:""}${m}`,K.map=[l,F+1],K.block=!0,K.loading=!L,u.line=F+1,R.trim()&&n(u,R,D),!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 $G(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>`})}function FG(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 xV({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:o,...n}});return s||i.set({validateLink:r=>!Ca(r,{tagName:"a",attrName:"href"})}),(e.enableMath??!0)&&LG(i,{...e.mathOptions??{}}),(e.enableContainers??!0)&&HV(i),e.enableFixIndentedCodeBlock!==!1&&cK(i),PK(i),UK(i),WK(i),KK(i),$G(i),lK(i,{customHtmlTags:e.customHtmlTags}),i}function Aa(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=>Aa(n))),t}function OG(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function RG(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 BG(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Qf(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(...eo(r,void 0,void 0,n)),{node:{type:"emphasis",children:o,raw:`*${s}*`},nextIndex:i<e.length?i+1:e.length}}const z_=/\r?\n[ \t]*`+\s*$/,iM=["diff ","index ","--- ","+++ ","@@ "],DG=/\r?\n/;function PG(e){const t=String(e??"");return t?iM.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function U_(e,t,n,o){n.length>0&&e.push(...n),o.length>0&&t.push(...o),n.length=0,o.length=0}function HG(e,t){const n=[],o=[],s=[],i=[],r=e.split(DG),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),c=h=>{const p=h;if(!iM.some(g=>p.startsWith(g)))if(p.startsWith("-")){const g=p.slice(1);s.push(!a&&g.startsWith(" ")?` ${g}`:g)}else if(p.startsWith("+")){const g=p.slice(1);i.push(!a&&g.startsWith(" ")?` ${g}`:g)}else{U_(n,o,s,i);const g=a&&p.startsWith(" ")?p.slice(1):p;n.push(g),o.push(g)}},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&&PG(p)||c(p)}(t||s.length>0||i.length>0)&&U_(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 rk(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(z_.test(a)&&(a=a.replace(z_,"")),r){const{original:c,updated:u}=HG(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 WG(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function zG(){return{type:"hardbreak",raw:`\\
201
- `}}function UG(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(...eo(r,void 0,void 0,n)),{node:{type:"highlight",children:o,raw:`==${s}==`},nextIndex:i<e.length?i+1:e.length}}let N0=null;const I0=new WeakMap;function q_(){return N0||(N0={customTagSet:null,allowedTagSet:$m()}),N0}function rM(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function lM(e){return/^<\s*\//.test(e)}function aM(e,t){return/\/\s*>\s*$/.test(t)||Ha.has(e)}function qG(e){if(!e||e.length===0)return q_();const t=I0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=q_();return I0.set(e,s),s}const o={customTagSet:new Set(n),allowedTagSet:$m({customHtmlTags:e})};return I0.set(e,o),o}function cM(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function jG(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,o=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof o=="string"?{raw:n,inner:o}:null}function Sp(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 VG(e,t,n){const o=e.slice();return Sp(o,"href")||o.push(["href",t]),n!=null&&!Sp(o,"title")&&o.push(["title",n]),o}function pv(e){return e.map(cM).join("")}function Ch(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:Ch(o.children)});continue}t.push(o)}return t}function KG(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=rM(r),a=lM(r),c=aM(l,r);if(!a&&!c&&l===n){o++;continue}if(a&&l===n){if(o===0)return s;o--}}return-1}function L0(e,t,n){const o=[e[t]];let s=[],i=t+1,r=!1;const l=n?KG(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:pv(o),innerTokens:s,nextIndex:i}}function GG(e,t,n,o,s,i,r){const l=String(e.content??""),a=rM(l),{customTagSet:c,allowedTagSet:u}=qG(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!L0(t,n,a).closed){const A=cM(e);return[{type:"text",content:A,raw:A},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=lM(l),f=aM(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const A=L0(t,n,a),$=Nm(l),N=A.innerTokens,x=String(Sp($,"href")??""),I=Sp($,"title"),E=I==null?null:String(I),F=VG($,x,E),S=Ch(N.length?o(N,s,i,r):[]),L=N.length?pv(N):x||"";return!S.length&&L&&S.push({type:"text",content:L,raw:L}),[{type:"link",href:x,title:E,text:L,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=L0(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ch(h.innerTokens.length?o(h.innerTokens,s,i,r):[]),raw:h.html},h.nextIndex];const p=Ch(h.innerTokens.length?o(h.innerTokens,s,i,r):[]);let g=h.html||l,b=!h.closed,v=!1;if(!h.closed){const A=`</${a}>`;g.toLowerCase().includes(A.toLowerCase())||(g+=A),v=!0,b=!0}const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(l))!==null;){const A=k[1],$=k[2]||k[3]||k[4]||"";m.push([A,$])}if(c?.has(a)){const A=jG(e);return[{type:a,tag:a,attrs:m,content:A?A.inner:h.innerTokens.length?pv(h.innerTokens):"",children:h.innerTokens.length?o(h.innerTokens,s,i,r):[],raw:A?.raw??g,loading:e.loading||b,autoClosed:v},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:m,content:g,children:p,raw:g,loading:b,autoClosed:v},h.nextIndex]}function uM(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=>uM(t)).join(""):String(e.content??"")}function YG(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>uM(t)).join("")}function j_(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=YG(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 ZG(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function QG(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(...eo(r,void 0,void 0,n)),{node:{type:"insert",children:o,raw:`++${String(s)}++`},nextIndex:i<e.length?i+1:e.length}}function XG(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 Cp(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 JG(e,t,n){const o=e.slice();return Cp(o,"href")||o.push(["href",t]),n!=null&&!Cp(o,"title")&&o.push(["title",n]),o}function Xf(e,t,n){const o=e[t],s=XG(o.attrs),i=String(Cp(s,"href")??""),r=Cp(s,"title"),l=r==null?null:String(r),a=JG(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(b=>b.type==="strong_open")){const b=String(h.content??""),v=String(h.raw??b),m=Aa(h);m.content=b.slice(0,-2),m.raw=v.replace(/\*\*$/,""),f=u.slice(),f[f.length-1]=m}const p=eo(f,void 0,void 0,n),g=p.map(b=>{const v=b;return"content"in b?String(v.content??""):String(v.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:g,children:p,raw:`[${g}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function V_(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 eY(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function K_(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(...eo(r,void 0,void 0,n)),{node:{type:"strikethrough",children:o,raw:`~~${s}~~`},nextIndex:i<e.length?i+1:e.length}}const tY=/\\([\\()[\]`$|*_\-!])/g;function nY(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(tY,"$1")===t))return n}function Fu(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(...eo(l,nY(n,i),void 0,c)),{node:{type:"strong",children:s,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function oY(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(...eo(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 sY(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(...eo(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 iY(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const rY=/[^~]*~{2,}[^~]+/,lY=/\*\*/,aY=/[[_*^~]/,cY=/\\([\\()[\]`$|*_\-!])/g,lk=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),uY=/\s/u,dY=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,fY=/\p{P}/u,hY=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,pY=/:\/\//;function mY(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 dM(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&&lk.has(i)){if(i==="*"&&n>=t){n++,o++;continue}n++,o++;continue}if(s==="*"&&n>=t)return n;n++}return-1}function Fl(e){return!!e&&uY.test(e)}function Ol(e){return!!e&&(dY.test(e)||fY.test(e))}function gY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function vY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+1];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function yY(e,t,n=0){let o=n,s=!1;for(;o<t.length;){const i=e?dM(e,o):t.indexOf("*",o);if(i===-1)break;if(vY(t,i))return{index:i,sawInvalidClose:s};s=!0,o=i+1}return{index:-1,sawInvalidClose:s}}function kY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!o||Fl(o)?!1:!(Ol(o)&&n&&!Fl(n)&&!Ol(n))}function bY(e,t){const n=t>0?e[t-1]:void 0,o=e[t+2];return!n||Fl(n)?!1:!(Ol(n)&&o&&!Fl(o)&&!Ol(o))}function xY(e,t=0){let n=t,o=!1;for(;n<e.length;){const s=e.indexOf("**",n);if(s===-1)break;if(bY(e,s))return{index:s,sawInvalidClose:o};o=!0,n=s+2}return{index:-1,sawInvalidClose:o}}function wY(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&&lk.has(s)){t+=s,n+=o+1;continue}t+="\\"}n+=o}return t}function _Y(e,t){let n=0;for(let o=0;o<e.length;o++){const s=e[o],i=e[o+1];if(s==="\\"&&i&&lk.has(i)){if(n===t)return o+1;n++,o++;continue}if(n===t)return o;n++}return-1}function SY(e,t,n){const o=_Y(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 CY=/[\p{L}\p{N}]/u,AY=/^[\p{L}\p{N}]+$/u;function mv(e){return e?CY.test(e):!1}function fM(e){return e?AY.test(e):!1}function rd(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:mv(o)&&mv(s)}}function MY(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const o=rd(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(!fM(e.slice(o.end,s.start)))return s.end}return-1}function EY(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function TY(e,t){let n=t;for(;n<e.length;){const o=e.indexOf("***",n);if(o===-1)return-1;const s=rd(e,o);if(s.len>=3)return o;n=o+s.len}return-1}function NY(e){return e?hY.test(e)||pY.test(e):!1}function IY(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function eo(e,t,n,o){if(!e||e.length===0)return[];const s=o?.__linkifyDemotionContext,i=Xd(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 g(P,le){const ne=e.length===1?t:String(le.content??""),q=[],ee=MY(P);if(ee!==-1){A(P.slice(0,ee),P.slice(0,ee));const de=P.slice(ee);return de&&(E({type:"text",content:de,raw:de}),u--),u++,!0}if(rY.test(P)){const de=P.indexOf("~~");de!==-1&&q.push({type:"strikethrough",index:de})}if(lY.test(P)){const de=P.indexOf("**");de!==-1&&q.push({type:"strong",index:de})}if(/[^*]*\*[^*]+/.test(P)){const de=ne?dM(ne,0):P.indexOf("*");if(ne&&de===-1)return!1;de!==-1&&q.push({type:"emphasis",index:de})}q.sort((de,ve)=>de.index!==ve.index?de.index-ve.index:de.type===ve.type?0:de.type==="strong"?-1:ve.type==="strong"?1:0);const ge=q[0];if(!ge)return!1;if(ge.type==="strikethrough"){const de=ge.index,ve=de>-1?P.slice(0,de):"";if(ve&&A(ve,ve),de===-1)return u++,!0;const j=P.indexOf("~~",de+2),te=j===-1?P.slice(de+2):P.slice(de+2,j),pe=j===-1?"":P.slice(j+2),{node:Ce}=K_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:te,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,o);return p(),k(Ce),pe&&(E({type:"text",content:pe,raw:pe}),u--),u++,!0}if(ge.type==="strong"){const de=ge.index,ve=de>-1?P.slice(0,de):"";if(ve&&A(ve,ve),de===-1)return u++,!0;if(t&&de===0){let De=!1,me=0;for(;me<P.length&&P[me]==="*";)me++;if(t.startsWith("\\*")&&(De=!0),De){let Ie=0,et=0;for(;et<t.length&&Ie<me;)if(t[et]==="\\"&&et+1<t.length&&t[et+1]==="*")Ie+=1,et+=2;else{if(t[et]==="*")break;et++}if(Ie>=2)return A(P,P),u++,!0}}if(t&&(P.match(/\*/g)||[]).length>mY(t))return A(P.slice(ve.length),P.slice(ve.length)),u++,!0;const j=rd(P,de);if(j.len>=3){const De=TY(P,de+j.len);if(De!==-1){const me=P.slice(de+j.len,De);if(EY(me)){const{node:Ie}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:me,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(),k(Ie);const et=P.slice(De+3);return et&&(E({type:"text",content:et,raw:et}),u--),u++,!0}}}if(!kY(P,de)){const De=P.slice(de,de+j.len);A(De,De);const me=P.slice(de+j.len);return me&&(E({type:"text",content:me,raw:me}),u--),u++,!0}const te=xY(P,de+2);let pe="",Ce="";if(te.index!==-1){pe=P.slice(de+2,te.index),Ce=P.slice(te.index+2);const De=te.index,me=rd(P,De);if(j.intraword&&me.intraword&&!fM(pe)||!pe&&j.len>=4&&j.intraword)return A(P.slice(ve.length),P.slice(ve.length)),u++,!0}else{if(d||te.sawInvalidClose||j.intraword)return A(P.slice(ve.length),P.slice(ve.length)),u++,!0;pe=P.slice(de+2),Ce=""}if(!pe&&/^\*+$/.test(Ce))return A(P,P),u++,!0;const{node:$e}=Fu([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:pe,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,o);return p(),k($e),Ce&&(E({type:"text",content:Ce,raw:Ce}),u--),u++,!0}if(ge.type==="emphasis"){let de=ge.index;de===-1&&(de=0);const ve=P.slice(0,de);if(ve&&A(ve,ve),!gY(P,de)){A(P[de],P[de]);const De=P.slice(de+1);return De&&(E({type:"text",content:De,raw:De}),u--),u++,!0}const j=rd(P,de),te=yY(ne,P,de+1),pe=te.index,Ce=e[u+1];if(o?.final&&Ce?.type==="em_open"&&pe!==-1&&P.slice(de+1,pe).trim()!==P.slice(de+1,pe)||pe===-1&&(te.sawInvalidClose||o?.final||j.intraword||!mv(P[de+1])))return A(P.slice(de),P.slice(de)),u++,!0;const{node:$e}=Qf([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:pe>-1?P.slice(de+1,pe):P.slice(de+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,o);if(p(),k($e),pe!==-1&&pe<P.length-1){const De=P.slice(pe+1);De&&(E({type:"text",content:De,raw:De}),u--)}return u++,!0}return!1}function b(P,le){if(!P.includes("`"))return!1;const q=(Ce=>{for(let $e=0;$e<Ce.length;$e++){if(Ce[$e]!=="`")continue;let De=0;for(let me=$e-1;me>=0&&Ce[me]==="\\";me--)De++;if(De%2===0)return $e}return-1})(P);if(q===-1)return!1;let ee=1;for(let Ce=q+1;Ce<P.length&&P[Ce]==="`";Ce++)ee++;const ge="`".repeat(ee),de=q+ee,ve=P.indexOf(ge,de);if(ve===-1){if(ee===1){const $e=P.slice(0,q),De=P.slice(q+1);return $e&&(g($e,le)?u--:A($e,$e)),m({type:"inline_code",code:De,raw:String(De)}),u++,!0}let Ce=P;for(let $e=u+1;$e<e.length;$e++)Ce+=String((e[$e].content??"")+(e[$e].markup??""));return u=e.length-1,A(Ce,Ce),u++,!0}p();const j=P.slice(0,q),te=P.slice(q+ee,ve),pe=P.slice(ve+ee);return j&&(g(j,le)?u--:A(j,j)),m({type:"inline_code",code:te,raw:String(te??"")}),pe&&(E({type:"text",content:pe,raw:pe}),u--),u++,!0}function v(P){const le=l?.__markdownIt;if(!le||e.length<=1||!e.some(ge=>ge?.type==="math_inline")||!aY.test(P))return null;const ne=le.parseInline(P,{__markstreamFinal:!!o?.final});if(!Array.isArray(ne)||ne.length===0)return null;const q=(ne.find(ge=>ge?.type==="inline")?.children??[]).filter(ge=>!(ge?.type==="text"&&String(ge.content??"")===""));if(!q.length||!q.some(ge=>ge?.type!=="text")||q.length===1&&q[0]?.type==="text"&&String(q[0].content??"")===P)return null;const ee=eo(q,P,n,o);return ee.length?ee:null}function m(P){p(),a.push(P)}function y(P){p();const le=Aa(P);a.push(le)}function k(P){m(P)}function A(P,le){c?(c.content+=P,c.raw+=le??P):(c={type:"text",content:String(P??""),raw:String(le??P??"")},a.push(c))}function $(P,le){if(!P)return;const ne=eo([{...le,type:"text",content:P,raw:P}],P,n,o);if(ne.length===1&&ne[0]?.type==="text"){const q=ne[0];A(String(q.content??""),String(q.raw??q.content??""));return}for(const q of ne)k(q)}function N(P,le){return String(P.markup??"").startsWith(le)}function x(P){return P.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 I(P,le){let ne=P;const q=String(le.content??"");return ne.endsWith("\\")&&!N(le,"\\\\")&&!q.endsWith("\\\\")&&(ne=ne.slice(0,-1)),ne.endsWith("(")&&!N(le,"\\(")&&!q.endsWith("\\(")&&(ne=ne.slice(0,-1)),/\*+$/.test(ne)&&!N(le,"\\*")&&!q.endsWith("\\*")&&(ne=ne.replace(/\*+$/,"")),ne}for(;u<e.length;){const P=e[u];E(P)}function E(P){switch(P.type){case"text":S(P);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":k(ZG(P)),u++;break;case"html_inline":{const[le,ne]=GG(P,e,u,eo,t,n,o);k(le),u=ne;break}case"link_open":L(P);break;case"image":fe(P)||(p(),k(j_(P)),u++);break;case"strong_open":{p();const{node:le,nextIndex:ne}=Fu(e,u,P.content,o);k(le),u=ne;break}case"em_open":{p();const{node:le,nextIndex:ne}=Qf(e,u,o);k(le),u=ne;break}case"s_open":{p();const{node:le,nextIndex:ne}=K_(e,u,o);k(le),u=ne;break}case"mark_open":{p();const{node:le,nextIndex:ne}=UG(e,u,o);k(le),u=ne;break}case"ins_open":{p();const{node:le,nextIndex:ne}=QG(e,u,o);k(le),u=ne;break}case"sub_open":{p();const{node:le,nextIndex:ne}=oY(e,u,o);k(le),u=ne;break}case"sup_open":{p();const{node:le,nextIndex:ne}=sY(e,u,o);k(le),u=ne;break}case"sub":p(),k({type:"subscript",children:[{type:"text",content:String(P.content??""),raw:String(P.content??"")}],raw:`~${String(P.content??"")}~`}),u++;break;case"sup":p(),k({type:"superscript",children:[{type:"text",content:String(P.content??""),raw:String(P.content??"")}],raw:`^${String(P.content??"")}^`}),u++;break;case"emoji":{p();const le=e[u-1];le?.type==="text"&&/\|:-+/.test(String(le.content??""))?A("",""):k(BG(P)),u++;break}case"checkbox":p(),k(OG(P)),u++;break;case"checkbox_input":p(),k(RG(P)),u++;break;case"footnote_ref":p(),k(WG(P)),u++;break;case"footnote_anchor":{p();const le=P.meta??{};m({type:"footnote_anchor",id:String(le.label??P.content??""),raw:String(P.content??"")}),u++;break}case"hardbreak":p(),k(zG()),u++;break;case"fence":p(),k(rk(e[u])),u++;break;case"math_inline":p(),!P.content&&P.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(k(V_({...P,content:e[u+1].content})),u+=2):k(V_(P)),u++;break;case"reference":D(P);break;case"text_special":A(String(P.content??""),String(P.content??"")),u++;break;default:{const le=P;if(P.type==="link"&&le.href!=null&&o?.validateLink&&!o.validateLink(String(le.href))){p();const ne=String(le.text??"");A(ne,ne),u++}else oe(P)||H(P)||Z(P)||z(P)||y(P),u++;break}}}function F(P,le,ne,q){const ee=iY({...le,content:P});if(c){c.content+=I(ee.content,le),c.raw+=ee.raw;return}const ge=ne?.tag==="br"&&e[u-2]?.content==="[";q||(ee.content=I(ee.content,le)),c=ee,c.center=ge,a.push(c)}function S(P){const le=String(P.content??""),ne=e.length===1&&le.includes("\\")&&typeof t=="string"?String(t):"";let q=ne?wY(ne):le.replace(cY,"$1");if(P.content==="<"||q==="1"&&e[u-1]?.tag==="br"){u++;return}const ee=q.indexOf("$");ee!==-1&&ee===q.lastIndexOf("$")&&q.endsWith("$")&&(q=q.slice(0,-1)),q.endsWith("undefined")&&!t?.endsWith("undefined")&&(q=q.slice(0,-9));let ge=a.length,de="";for(let pe=a.length-1;pe>=0;pe--){const Ce=a[pe];if(Ce.type!=="text")break;ge=pe,de=String(Ce.content??"")+de}ge<a.length&&(q.startsWith(de)?(c=null,a.length=ge):c=a[a.length-1]);const ve=e[u+1];if((q==="`"||q==="|"||q==="$")&&!N(P,`\\${q}`)||/^\*+$/.test(q)&&!N(P,"\\*")){u++;return}if(!ve&&/[^\]]\s*\(\s*$/.test(q)&&(q=q.replace(/\(\s*$/,"")),!q){u++;return}if(J(q)||ce(q))return;if(!(q.includes("*")||q.includes("_")||q.includes("~")||q.includes("`")||q.includes("[")||q.includes("!")||q.includes("$")||q.includes("|")||q.includes("("))){F(q,P,e[u-1],ve),u++;return}if(Ae(q))return;const j=e[u-1];if(q==="["&&!ve?.markup?.includes("*")&&!N(P,"\\[")||q==="]"&&!j?.markup?.includes("*")&&!N(P,"\\]")){u++;return}if(b(le,P)||Te(q)||(e[u+1]?.type!=="link_open"||x(q))&&Se(q,P))return;const te=v(le);if(te){p();for(const pe of te)k(pe);u++;return}g(q,P)||(F(q,P,j,ve),u++)}function L(P){if(R(P))return;if(ue()){const{node:ve,nextIndex:j}=Xf(e,u,o),te=String(ve.text||ve.href||"");A(te,te),u=j;return}p();const{node:le,nextIndex:ne}=Xf(e,u,o);u=ne;const q=le.text||le.href||"";if(P.markup==="linkify"&&!j6(q,le.href,t)&&xp(q,l?.__linkifyDemotionContext)){A(q,q);return}const ee=le.children.length===1&&le.children[0]?.type==="text";if(le.loading&&t&&le.text===le.href&&ee){const ve=IY(t,le.href);ve&&(le.text=ve,le.children=[{type:"text",content:ve,raw:ve}],le.raw=`[${ve}](${le.href}${le.title?` "${le.title}"`:""})`)}if(o?.validateLink&&!o.validateLink(le.href)){A(le.text,le.text);return}const ge=P.attrs?.find(([ve])=>ve==="href")?.[1],de=String(ge??"");if(t&&de){const ve=t.indexOf("](");if(ve!==-1){const j=t.indexOf(")",ve+2);j===-1?le.loading=!0:le.loading&&t.slice(ve+2,j).includes(de)&&(le.loading=!1)}}z(le)||m(le)}function R(P){if(P.markup!=="linkify")return!1;const{node:le,nextIndex:ne}=Xf(e,u,o);return U(le,ne)?(u=ne,!0):!1}function D(P){p(),k(eY(P)),u++}function z(P){if(P.type!=="link")return!1;const le=a[a.length-1];if(!le||le.type!=="text")return!1;const ne=String(le.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!ne)return!1;const q=P,ee=String(q.href??""),ge=String(q.text??""),de=String(ne[2]??""),ve=ee.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ee||!(ge===ee||ge===ve||NY(ge)))return!1;const j=String(ne[1]??"");return j?(le.content=j,le.raw=j):a.pop(),m({...P,text:de,children:[{type:"text",content:de,raw:de}],raw:`[${de}](${ee}${q.title?` "${q.title}"`:""})`}),!0}function H(P){if(P.type!=="link")return!1;const le=P,ne=String(le.href??"");return ne?U({href:ne,title:le.title==null||le.title===""?null:String(le.title),loading:!!le.loading},u+1):!1}function U(P,le){const ne=a[a.length-1];if(ne?.type!=="image"||ne.src||!ne.loading||!String(ne.raw??"").endsWith("]("))return!1;const q=e[le],ee=String(q?.content??"");if(q?.type!=="text"||!ee.startsWith(")"))return!1;a.pop(),c=null;const ge=String(ne.alt??"");m({type:"image",src:P.href,alt:ge,title:P.title,raw:`![${ge}](${P.href}${P.title?` "${P.title}"`:""})`,loading:!!P.loading});const de=ee.slice(1),ve=Aa(q);return ve.content=de,ve.raw=de,h()[le]=ve,!0}function Z(P){if(P.type!=="link")return!1;const le=a[a.length-1],ne=e[u-1];if(!le||le.type!=="text"||ne?.type!=="text")return!1;const q=String(le.content??""),ee=String(ne.content??"");if(!q.endsWith("!")||!ee.endsWith("!")||N(ne,"\\!"))return!1;const ge=q.slice(0,-1);ge?(le.content=ge,le.raw=ge,c=le):(a.pop(),c=null);const de=P,ve=String(de.text??de.children?.map(pe=>String(pe?.content??pe?.raw??"")).join("")??""),j=String(de.href??""),te=de.title==null||de.title===""?null:String(de.title);return m({type:"image",src:j,alt:ve,title:te,raw:`![${ve}](${j}${te?` "${te}"`:""})`,loading:!!de.loading}),!0}function K(P,le="",ne=null){const q=String(P.alt??P.raw??"");return{type:"link",href:le,title:ne,text:q,children:[P],raw:`[${q}](${le}${ne?` "${ne}"`:""})`,loading:!0}}function V(P){const le=P.startsWith("![")?P:`![${P}`,ne=le.slice(2),q=ne.indexOf("](");return{type:"image",src:"",alt:q===-1?ne.replace(/\]$/,""):ne.slice(0,q),title:null,raw:le,loading:!0}}function J(P){const le=P.indexOf("[![");if(le===-1||typeof t=="string"&&e.length===1&&SY(t,le,"["))return!1;const ne=P.slice(0,le);return ne&&A(ne,ne),m(K(V(P.slice(le+1)))),u++,!0}function fe(P){if(o?.final)return!1;const le=e[u-1];if(le?.type!=="text"||!String(le.content??"").endsWith("[")||N(le,"\\["))return!1;const ne=a[a.length-1];if(ne?.type==="text"&&ne.content.endsWith("[")){const q=ne.content.slice(0,-1);q?(ne.content=q,ne.raw=q,c=ne):(a.pop(),c=null)}return m(K(j_(P))),u++,!0}function oe(P){if(P.type!=="link")return!1;const le=P,ne=String(le.raw??""),q=String(le.text??"");if(!ne.startsWith("[![")&&!q.startsWith("!["))return!1;const ee=le.title==null||le.title===""?null:String(le.title);return m(K({type:"image",src:String(le.href??""),alt:q.replace(/^!\[/,"").replace(/\]$/,""),title:ee,raw:ne.startsWith("[![")?ne.slice(1):ne,loading:!0})),!0}function ce(P){if(!P.startsWith("]("))return!1;const le=e[u-2];if(le?.type==="text"&&String(le.content??"").endsWith("[")&&N(le,"\\["))return!1;const ne=a[a.length-1];if(ne?.type!=="image"&&ne?.type!=="link")return!1;const q=ne,ee=ne?.type==="link"&&Array.isArray(q.children)&&q.children.length===1&&q.children[0]?.type==="image"?a.pop():null,ge=ee?ee.children[0]:a.pop();if(!ge||ge.type!=="image")return!1;const de=e[u+1];let ve=String(ee?.href??""),j=ee?.title==null?null:String(ee.title),te=!0;if(de?.type==="link_open"){const{node:Ce,nextIndex:$e}=Xf(e,u+1,o);ve=Ce.href,j=Ce.title,te=!0,u=$e}else{if(ve=P.slice(2),ve.includes('"')){const Ce=ve.split('"');ve=String(Ce[0]??"").trim(),j=Ce[1]==null?null:String(Ce[1]).trim()}u++}const pe=K(ge,ve,j);return pe.loading=te,m(pe),!0}function ue(){const P=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&P?.type==="text"&&String(P.content??"").endsWith("[")&&N(P,"\\[")}function Se(P,le){const ne=P.indexOf("[");if(ne===-1)return!1;let q=P.slice(0,ne);const ee=P.indexOf("](",ne);if(ee!==-1){const ge=e[u+2];let de=P.slice(ne+1,ee);if(de.includes("[")){const De=de.indexOf("[");q+=P.slice(0,ne+De+1);const me=ne+De+1;de=P.slice(me+1,ee)}const ve=e[u+1];if(P.endsWith("](")&&ve?.type==="link_open"&&ge){const De=e[u+4];let me=4,Ie=!0;if(De?.type==="text"){const rt=String(De.content??"");if(rt.startsWith(")")){Ie=!1;const _t=rt.slice(1);if(_t){const gt=Aa(De);gt.content=_t,gt.raw=_t,h()[u+4]=gt}else me++}else rt==="."&&me++}$(q,le);const et=String(ge.content??"");return o?.validateLink&&!o.validateLink(et)?A(de,de):m({type:"link",href:et,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:Ie}),u+=me,!0}const j=P.indexOf(")",ee),te=j!==-1?P.slice(ee+2,j):"",pe=j===-1;let Ce=q.match(/\*+$/);if(Ce&&(q=q.replace(/\*+$/,"")),$(q,le),Ce||(Ce=de.match(/^\*+/)),!d&&Ce){const De=Ce[0].length;de=de.replace(/^\*+/,"").replace(/\*+$/,"");const me=[];if(De===1?me.push({type:"em_open",tag:"em",nesting:1}):De===2?me.push({type:"strong_open",tag:"strong",nesting:1}):De===3&&(me.push({type:"strong_open",tag:"strong",nesting:1}),me.push({type:"em_open",tag:"em",nesting:1})),me.push({type:"link",href:te,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:pe}),De===1){me.push({type:"em_close",tag:"em",nesting:-1});const{node:Ie}=Qf(me,0,o);k(Ie)}else if(De===2){me.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Fu(me,0,void 0,o);k(Ie)}else if(De===3){me.push({type:"em_close",tag:"em",nesting:-1}),me.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ie}=Fu(me,0,void 0,o);k(Ie)}else{const{node:Ie}=Qf(me,0,o);k(Ie)}}else o?.validateLink&&!o.validateLink(te)?A(de,de):m({type:"link",href:te,title:null,text:de,children:[{type:"text",content:de,raw:de}],loading:pe});const $e=j!==-1?P.slice(j+1):"";return $e&&(E({type:"text",content:$e,raw:$e}),u--),u++,!0}return!1}function Te(P){const le=P.indexOf("![");if(le===-1)return!1;const ne=P.slice(0,le);return ne&&!c?c={type:"text",content:ne,raw:ne}:ne&&c&&(c.content+=ne),c&&(a.push(c),c=null),m(V(P.slice(le))),u++,!0}function Ae(P){if(!(P?.startsWith("[")&&n?.type==="list_item_open"))return!1;const le=P.slice(1).match(/[^\s\]]/);if(le===null)return u++,!0;if(le&&/x/i.test(le[0])){const ne=le[0]==="x"||le[0]==="X";return m({type:"checkbox_input",checked:ne,raw:ne?"[x]":"[ ]"}),u++,!0}return!1}return a}function LY(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 $Y(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 FY(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function lu(e,t,n){const o=e[t],s=[],i=Hl(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 l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=FY(c)?Aa(c):c,d=e[a-1];u!==c&&($Y(u),LY(u));const f=String(u.content??"");l.push({type:"paragraph",children:eo(u.children||[],f,d,i.options()),raw:f}),i.remember(f),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=au(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=lu(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=ck(e,a,i.options(),ak);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}s.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:o.type==="ordered_list_open",start:(()=>{if(o.attrs&&o.attrs.length){const l=o.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:s,raw:s.map(l=>l.raw).join(`
206
- `)},r+1]}function OY(e,t,n,o){const s=String(n[1]??"note"),i=String(n[2]??s.charAt(0).toUpperCase()+s.slice(1)),r=[],l=Hl(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:eo(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};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]=lu(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=au(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=Im(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}
207
- ${r.map(c=>c.raw).join(`
208
- `)}
209
- :::`},a+1]}const RY=new Set(["warning","info","note","tip","danger","caution"]);function BY(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 RY.has(s)?{kind:s,title:o===-1?"":n.slice(o).trim()}:null}function DY(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=BY(String(o.info??"").trim());d&&(s=d.kind,i=d.title)}i||(i=s.charAt(0).toUpperCase()+s.slice(1));const l=[],a=Hl(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 g=f.length-1;g>=0;g--){const b=f[g];if(b.type==="text"&&/:+/.test(b.content)){h=g;break}}const p={type:"paragraph",children:eo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};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]=lu(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else if(e[c].type==="blockquote_open"){const[d,f]=au(e,c,a.options());l.push(d),a.remember(d.raw),c=f}else{const d=Im(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}
210
- ${l.map(d=>d.raw).join(`
211
- `)}
212
- :::`},c+1]}const PY=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function HY(e,t,n){const o=e[t];if(o.type!=="container_open")return null;const s=PY.exec(String(o.info??""));return s?OY(e,t,s,n):null}const ak={parseContainer:(e,t,n)=>DY(e,t,n),matchAdmonition:HY};function au(e,t,n){const o=[],s=Hl(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:eo(r.children||[],String(r.content??""),void 0,s.options()),raw:String(r.content??"")};o.push(l),s.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=lu(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=au(e,i,s.options());o.push(r),s.remember(r.raw),i=l;break}default:{const r=ck(e,i,s.options(),ak);r?(o.push(r[0]),s.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:o,raw:o.map(r=>r.raw).join(`
213
- `)},i+1]}function WY(e){if(e.info?.startsWith("diff"))return rk(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 zY(e,t,n){const o=[];let s=t+1,i=[],r=[];const l=Hl(n,!0);for(;s<e.length&&e[s].type!=="dl_close";)if(e[s].type==="dt_open"){const a=e[s+1];i=eo(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:eo(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(`
214
- `)}`}),i=[]),s=a+1}else s++;return[{type:"definition_list",items:o,raw:o.map(a=>a.raw).join(`
215
- `)},s+1]}function UY(e,t,n){const o=e[t].meta??{},s=String(o?.label??"0"),i=[],r=Hl(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:eo(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(`
216
- `)}`},l+1]}function qY(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:eo(a.children||[],c,void 0,n),raw:c}}function jY(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=Jn(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=Jn(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 hM(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=Jn(t),s=o===-1?t:t.slice(0,o+1),i=o!==-1&&/\/\s*>$/.test(s),r=Ha.has(n),l=Nm(s),a=(o===-1?-1:jY(t,n,o+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
217
- </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function VY(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 KY(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 pM(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function mM(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return pM(n)?n:void 0}function GY(e,t,n){const o=mM(Xd(t),n);if(!pM(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 YY(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??""),g=KY(e[c].attrs),b=a.length,v=!f&&!r,m=v?s?.cells[b]?.raw:void 0;a.push({type:"table_cell",header:f||r,children:eo(h.children||[],p,void 0,GY(n,m,v?u:void 0)),raw:p,align:g}),v&&(u=mM(u,Xd(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(`
218
- `)},o+1]}function ZY(){return{type:"thematic_break",raw:"---"}}let $0=null;const F0=new WeakMap;function G_(){return $0||($0={allowedTagSet:$m(),customTagSet:null}),$0}function QY(e){if(!e||e.length===0)return G_();const t=F0.get(e);if(t)return t;const n=e.map(_i).filter(Boolean);if(!n.length){const s=G_();return F0.set(e,s),s}const o={allowedTagSet:$m({customHtmlTags:e}),customTagSet:new Set(n)};return F0.set(e,o),o}function XY(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 g=p.match(/(?:\s|^)vmr-container-(\S+)/);g&&(i=g[1])}else if(h.startsWith("data-")){const g=h.slice(5);try{r[g]=JSON.parse(p)}catch{r[g]=p}}}const l=[],a=Hl(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:eo(h.children||[],void 0,void 0,a.options()),raw:String(h.content??"")};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]=lu(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else if(e[c].type==="blockquote_open"){const[h,p]=au(e,c,a.options());l.push(h),a.remember(h.raw),c=p}else{const h=Im(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||!!n?.final;let f=`::: ${i}`;return Object.keys(r).length>0&&(f+=` ${JSON.stringify(r)}`),f+=`
219
- `,l.length>0&&(f+=o.raw??l.map(h=>h.raw).join(`
220
- `),f+=`
221
- `),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 JY(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function eZ(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function tZ(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Gs(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=Jn(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=Jn(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 nZ(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=Jn(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),end:p}}let u=1,d=c+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${o}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${o}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),end:e.length};if(h(p)){const g=e.indexOf(">",p);if(g===-1)return null;if(u--,u===0){const b=g+1;return{raw:e.slice(r,b),end:b}}d=g+1;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),end:e.length}}function gv(e){return Number.isFinite(e)&&e>0?e:0}function oZ(e,t){const n=gv(t);if(!e||n<=0)return 0;let o=0;for(let s=0;s<e.length;s++)if(e[s]===`
222
- `&&(o++,o===n))return s+1;return e.length}function Im(e,t,n){const o=e[t];switch(o.type){case"heading_open":return[qY(e,t,n),t+3];case"code_block":return[WY(o),t+1];case"fence":return[rk(o),t+1];case"math_block":return[VY(o),t+1];case"html_block":{const s=hM(o),i=s.tag?QY(n?.customHtmlTags):null;if(s.tag&&s.loading&&i&&!i.allowedTagSet.has(s.tag)){const r=String(o.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(s.tag&&i?.customTagSet?.has(s.tag)){const r=s.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(o.map)?oZ(l,Number(o.map?.[0]??0)):0,u=nZ(l,r,Math.max(gv(a),gv(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??s.raw??""),f=Jn(d),h=f!==-1?d.slice(0,f+1):d,p=f!==-1&&/\/\s*>\s*$/.test(h),g=f===-1?null:tZ(d,r,f+1),b=g?.start??-1;let v="";f!==-1&&(b!==-1&&f<b?v=d.slice(f+1,b):v=d.slice(f+1)),b===-1&&(v=eZ(v,r));const m=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let k;for(;(k=y.exec(h))!==null;){const $=k[1];if(!$||$.toLowerCase()===r)continue;const N=k[2]||k[3]||k[4]||"";m.push([$,N])}const A=!n?.final&&!p&&g==null;return[{type:r,tag:r,content:JY(v),raw:String(u?.raw??s.raw??d),loading:A,attrs:m.length?m:void 0},t+1]}return[s,t+1]}case"table_open":{const[s,i]=YY(e,t,n);return[s,i]}case"dl_open":{const[s,i]=zY(e,t,n);return[s,i]}case"footnote_open":{const[s,i]=UY(e,t,n);return[s,i]}case"hr":return[ZY(),t+1]}return null}function ck(e,t,n,o){const s=Im(e,t,n);if(s)return s;switch(e[t].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)return o.parseContainer(e,t,n);break;case"container_open":if(o?.matchAdmonition){const i=o.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return XY(e,t,n)}return null}function sZ(){return{type:"hardbreak",raw:`\\
223
- `}}function iZ(e,t,n){const o=e[t+1],s=String(o.content??"");return{type:"paragraph",children:eo(o.children||[],s,void 0,n),raw:s}}const Y_=new WeakMap,Lm=new WeakMap,rZ=["$$","\\["];function Jc(){return typeof performance<"u"?performance.now():Date.now()}function uk(e,t,n){e&&(e[t]=(e[t]??0)+n)}function gM(e){return e.__timing}function O0(e,t,n){return t&&uk(t,"parseMarkdownToStructureTotalMs",Jc()-n),e}function Z_(e,t,n){if(!n)return sS(e,t);const o=Jc(),s=sS(e,t);return uk(n,"processTokensMs",Jc()-o),s}function lZ(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=ru(t);return n.length?new Set(n):null}function aZ(e,t){const n=e;let o=Y_.get(n);o||(o=new Map,Y_.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 cZ(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Jf(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]=ha(s.value,n))}}function ha(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(ha(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(ha(l,t),ha(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(ha(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),Jf(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),Jf(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),Jf(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!cZ(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Jf(n,r,t),r}const s={};t.set(n,s);const i=e;for(const r of Object.keys(i))s[r]=ha(i[r],t);return s}function vM(e,t=!0){if(!t)return Aa(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=>vM(a,t)):t&&r&&typeof r=="object"&&(l=ha(r,o)),Object.defineProperty(n,s,{...i,value:l})}return n}function Q_(e,t=!0){return e.map(n=>vM(n,t))}function yM(e,t){const n=t,o=e.stream,s=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(s===!0||s==="auto"&&t.final!==!0)&&o?.enabled===!0&&typeof o.parse=="function"}function uZ(e,t){const n=t,o=t.streamParse??"auto",s=e.stream;return t.final===!0&&o==="auto"&&n.__disableStreamParse!==!0&&s?.enabled===!0&&typeof s.reset=="function"}function dZ(e){Lm.delete(e)}function fZ(e,t,n){Lm.set(e,{source:t,key:n,pendingCandidate:n===null&&sM(t)})}function hZ(e){return e.endsWith("$")||e.endsWith("\\")}function pZ(e){const t=Math.max(e.lastIndexOf(`
224
- `)+1,0),n=e.slice(t).replace(/[\t ]+$/,"");return rZ.some(o=>n.endsWith(o))}function mZ(e,t){return t?!!(t.includes("$$")||t.includes("\\[")||t.includes("\\]")||e.endsWith("$")&&t[0]==="$"||e.endsWith("\\")&&(t[0]==="["||t[0]==="]")||pZ(e)&&/[\r\n]/.test(t)):!1}function gZ(e,t){if(!Q6(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const o=e,s=Lm.get(o);if(s?.source===t)return;if(s&&t.startsWith(s.source)){const l=t.slice(s.source.length);if(s.key===null&&s.pendingCandidate===!1&&!mZ(s.source,l)&&!hZ(t)){s.source=t;return}}const i=NG(t),r=s?!t.startsWith(s.source):!1;(s&&(r||s.key!==i)||!s&&i)&&n.reset(),fZ(e,t,i)}function vZ(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function yZ(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 R0(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&&yZ(e,t)}function X_(e,t){return e[t]?.type==="paragraph_open"&&e[t+1]?.type==="inline"&&e[t+2]?.type==="paragraph_close"}function kZ(e){for(let t=0;t+5<e.length;t++)if(X_(e,t)&&X_(e,t+3)&&R0(e[t],e[t+3])&&R0(e[t+1],e[t+4])&&R0(e[t+2],e[t+5]))return!0;return!1}function bZ(e,t,n){return Q6(e)&&sM(t)&&kZ(n)}function xZ(e){const t=Lm.get(e);return typeof t?.key=="string"&&t.key.startsWith("pending:")}function J_(e,t,n,o){if(o.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=o.customHtmlTags),!yM(e,o)||(gZ(e,t),xZ(e)))return e.parse(t,n);const s=e.stream.parse(t,aZ(e,n));if(bZ(e,t,s))return e.stream?.reset?.(),e.parse(t,n);if(!vZ(o))return s;const i=gM(o);if(!i)return Q_(s,!0);const r=Jc(),l=Q_(s,!0);return uk(i,"tokenCloneMs",Jc()-r),l}function $m(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return $d;const n=new Set($d);for(const o of ru(t))o&&n.add(o);return n}function wZ(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 eS(e){return{type:"paragraph",children:e,raw:e.map(wZ).join("")}}function tS(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=lZ(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(eS(r)),a.push(l);const c=o.slice(i+1);return c.length&&a.push(eS(c)),a}function _Z(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 ld(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function SZ(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*${Gs(t)}\s*>\s*$`,"i").test(n)}function dk(e,t,n){if(!e||!t)return null;const o=t.toLowerCase(),s=new RegExp(String.raw`<\s*${Gs(o)}(?=\s|>|/)`,"gi");s.lastIndex=Math.max(0,n);const i=s.exec(e);if(!i||i.index==null)return null;const r=i.index,l=Jn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(Ha.has(o)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const f=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*${Gs(o)}(?=\s|>|/)`,"i").test(g)},h=p=>{const g=e.slice(p);return new RegExp(String.raw`^<\s*\/\s*${Gs(o)}(?=\s|>)`,"i").test(g)};for(;d<e.length;){const p=e.indexOf("<",d);if(p===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(h(p)){const g=Jn(e.slice(p));if(g===-1)return null;u--;const b=p+g+1;if(u===0)return{raw:e.slice(r,b),start:r,end:b,closed:!0};d=b;continue}if(f(p)){const g=Jn(e.slice(p));if(g===-1)return null;const b=e.slice(p,p+g+1);/\/\s*>$/.test(b)||u++,d=p+g+1;continue}d=p+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function CZ(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]===`
225
- `){n++;continue}return-1}return o===t.length?n:-1}function AZ(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
226
- </${t}>`}function nS(e){return e.replace(/\r\n/g,`
227
- `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function MZ(e,t,n){return n?e.includes(n,t)?!0:nS(e.slice(Math.max(0,t))).includes(nS(n)):!1}function EZ(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
228
- `&&n++,n):e[n]===`
229
- `?n+1:t}function oS(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 TZ(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function fk(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Gs(t)}(?=\s|>)`,"gi");let o=-1,s;for(;(s=n.exec(e))!==null;)o=s.index;return o}function kM(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const NZ=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),IZ=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function LZ(e){return/\n\s*\n/.test(e)||IZ.test(e)}function $Z(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(o=>NZ.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(!LZ(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function FZ(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"||F6.has(r)||Array.isArray(i.children))return s;const l=String(s.raw??i.content??"");if(!l)return s;const a=Jn(l);if(a===-1)return s;const c=fk(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return s;const d=ad(u,t,kM(n,o));return $Z(u,d)?{...s,children:d}:s})}function ad(e,t,n){return e.trim()?xM(e,t,{...n,__disableStreamParse:!0}):[]}function OZ(e,t,n){const o=ad(e,t,n),s=o[0];return o.length===1&&s?.type==="paragraph"&&Array.isArray(s.children)?s.children:o}function RZ(e,t,n){const o=hM({content:e}),s=Jn(e),i=fk(e,"summary");if(s!==-1&&i!==-1&&i>=s+1){const r=OZ(e.slice(s+1,i),t,n);r.length>0&&(o.children=r)}return o.raw=e,o}function BZ(e,t,n){const o=Jn(e);if(o===-1)return[];const s=e.slice(o+1);if(!s.trim())return[];const i=dk(s,"summary",0);if(!i)return ad(s,t,n);const r=s.slice(0,i.start),l=s.slice(i.end);return[...ad(r,t,n),RZ(i.raw,t,n),...ad(l,t,n)]}function bM(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=ld(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!oS(c)){r.push(c);continue}const f=String(c.raw??ld(c)??""),h=d!==-1?d:t.indexOf(f,Math.max(0,l-f.length));if(h===-1){r.push(c);continue}let p=1,g=-1;for(let Z=a+1;Z<e.length;Z++){const K=e[Z];if(oS(K)){p++;continue}if(TZ(K)&&(p--,p===0)){g=Z;break}}const b=dk(t,"details",h),v=g===-1&&b?.closed===!0,m=v?(()=>{const Z=fk(f,"details");return Z!==-1?f.slice(0,Z):f})():f,[y]=bM(v?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,o,s,h+f.length),k=BZ(m,n,kM(o,s)),A=g===-1?"</details>":String(e[g].raw??ld(e[g])??"</details>"),$=v||g!==-1&&b?.closed===!0,N=A.replace(/[\t\r\n ]+$/,""),x=$?(()=>{const Z=(b?.raw??"").lastIndexOf(N);return Z===-1?t.length:h+Z})():t.length,I=Jn(f),E=v&&I!==-1?h+I+1:h+f.length,F=t.slice(E,x===-1?t.length:x),S=n.parse(F,{__markstreamFinal:s}),L=n.renderer.render(S,n.options,{__markstreamFinal:s}),R=x+N.length,D=$?Math.max(x+A.length,EZ(t,R)):t.length,z=$?t.slice(x,D):A,H=$?t.slice(h,D):t.slice(h),U=v&&I!==-1?f.slice(0,I+1):f;if(r.push({...c,tag:"details",attrs:Nm(f.slice(0,I+1)),raw:H,content:`${U}${L}${z}`,children:[...k,...y],loading:!s&&!$}),l=$?D:t.length,g===-1&&!v)break;g!==-1&&(a=g)}return[r,l]}function DZ(e,t,n){if(!n)return e;const o=e.slice();let s=0;for(let i=0;i<o.length;i++){const r=o[i],l=ld(r),a=l?n.indexOf(l,s):-1;if(r?.type!=="html_block"){a!==-1&&(s=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(s=a+l.length);continue}const u=dk(n,c,a!==-1?a:s);if(!u)continue;s=u.end;const d=String(r.content??l),f=String(r.raw??d),h=AZ(u.raw,c,u.closed),p=!t&&!u.closed,g=d!==h||f!==u.raw||!!r.loading!==p,b=Jn(u.raw),v=b===-1?"":u.raw.slice(0,b+1),m=v?Nm(v):[];if(r.content=h,r.raw=u.raw,r.loading=p,r.attrs=m.length?m:void 0,!g)continue;let y=CZ(u.raw,f);y===-1&&(y=0);const k=i+1;for(;k<o.length;){if(u.closed&&SZ(o[k],c)){o.splice(k,1);continue}const A=ld(o[k]);if(!A)break;const $=u.raw.indexOf(A,y);if($===-1){if(MZ(n,u.end,A))break;o.splice(k,1);continue}y=$+A.length,o.splice(k,1)}}return o}function PZ(e){const t=l=>l===" "||l===" "||l===`
230
- `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=g=>{const b=g.charCodeAt(0);return b>=65&&b<=90||b>=97&&b<=122},u=g=>{const b=g.charCodeAt(0);return b>=48&&b<=57},d=g=>g==="!"||c(g),f=g=>c(g)||u(g)||g===":"||g==="-",h=g=>c(g)||u(g)||g==="_"||g==="."||g===":"||g==="-",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 g=l[a];if(g==='"'||g==="'"){for(a++;a<l.length&&l[a]!==g;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const b=l[a];if(t(b)||b==="<"||b===">"||b==='"'||b==="'"||b==="`")break;a++}if(a>=l.length)return!0}}}return!0},o=(l,a)=>{let c=!1,u="",d=0;const f=m=>m===" "||m===" ",h=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;const k=m[y];if(k!=="`"&&k!=="~")return null;let A=y;for(;A<m.length&&m[A]===k;)A++;const $=A-y;return $<3?null:{markerChar:k,markerLen:$,rest:m.slice(A)}},p=m=>{let y=0;for(;y<m.length&&f(m[y]);)y++;let k=!1;for(;y<m.length&&m[y]===">";)for(k=!0,y++;y<m.length&&f(m[y]);)y++;return k?m.slice(y):null},g=m=>{const y=h(m);if(y)return y;const k=p(m);return k==null?null:h(k)};let b=0;const v=l.split(/\r?\n/);for(const m of v){const y=b,k=b+m.length;if(a<y)break;const A=g(m);if(A){const $=A.markerChar,N=A.markerLen;c?$===u&&N>=d&&/^\s*$/.test(A.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=N)}if(a<=k)break;b=k+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===`
231
- `||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]===`
232
- `||r[1]==="\r")||!n(r)?s:s.slice(0,i)}function HZ(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 g=p.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||p==="_"||p==="-"||p===":"},i=p=>{if(!p)return!1;if(p[0]===" ")return!0;let g=0;for(let b=0;b<p.length;b++){const v=p[b];if(v===" "){if(g++,g>=4)return!0;continue}if(v===" ")return!0;break}return!1},r=p=>{let g=!1,b=!1;for(let v=0;v<p.length;v++){const m=p[v];if(m==="\\"){v++;continue}if(!b&&m==="'"){g=!g;continue}if(!g&&m==='"'){b=!b;continue}if(!g&&!b&&m===">")return v}return-1},l=p=>{let g=0;for(;g<p.length&&o(p[g]);)g++;const b=p[g];if(b!=="`"&&b!=="~")return null;let v=g;for(;v<p.length&&p[v]===b;)v++;const m=v-g;return m<3?null:{markerChar:b,markerLen:m,rest:p.slice(v)}},a=(p,g)=>{if(i(p))return-1;const b=p.replace(/^[ \t]+/,"");if(!b||b.startsWith(">")||b.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(b))return-1;let v=!1,m=0;for(;m<p.length;){const y=p[m];if(y!=="<"){o(y)||(v=!0),m++;continue}const k=r(p.slice(m));if(k===-1){v=!0,m++;continue}const A=p.slice(m,m+k+1);let $=1;for(;$<A.length&&o(A[$]);)$++;if($>=A.length){v=!0,m++;continue}const N=A[$];if(N==="!"||N==="?"){v=!0,m+=k+1;continue}if(N==="/"){v=!0,m+=k+1;continue}const x=$;for(;$<A.length&&s(A[$]);)$++;if($===x){v=!0,m++;continue}const I=A.slice(x,$).toLowerCase(),E=A[$];if(E&&E!==" "&&E!==" "&&E!==">"&&E!=="/"){v=!0,m++;continue}const F=new RegExp(String.raw`<\s*\/\s*${I}\s*>`,"i"),S=/\/\s*>$/.test(A),L=F.test(p.slice(m+k+1)),R=F.test(e.slice(g+m+k+1)),D=/[\r\n]/.test(e.slice(g+m+k+1));if(v&&n.has(I)&&!S&&!L&&(R||D))return m;v=!0,m+=k+1}return-1};let c=!1,u="",d=0,f="",h=0;for(;h<e.length;){const p=e.indexOf(`
233
- `,h),g=p!==-1,b=g&&p>h&&e[p-1]==="\r",v=g?b?p-1:p:e.length,m=e.slice(h,v),y=g?b?`\r
234
- `:`
235
- `:"",k=l(m);let A=m;if(!c&&!k){const $=a(m,h);if($!==-1){const N=y||`
236
- `;A=`${m.slice(0,$).replace(/[ \t]+$/,"")}${N}${N}${m.slice($).replace(/^[ \t]+/,"")}`}}f+=A,f+=y,k&&(c?k.markerChar===u&&k.markerLen>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=k.markerChar,d=k.markerLen)),h=g?p+1:e.length}return f}function WZ(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 g=d[p];if(g==="\\"){p++;continue}if(!h&&g==="'"){f=!f;continue}if(!f&&g==='"'){h=!h;continue}if(!f&&!h&&g===">")return p}return-1},l=(d,f,h)=>{const p=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let b=g+1;for(;b<d.length&&o(d[b]);)b++;if(b>=d.length||d[b]!=="/"){g=d.indexOf("<",g+1);continue}for(b++;b<d.length&&o(d[b]);)b++;if(b+p.length>d.length){g=d.indexOf("<",g+1);continue}let v=!0;for(let y=0;y<p.length;y++){const k=d[b+y];if((k>="A"&&k<="Z"?String.fromCharCode(k.charCodeAt(0)+32):k)!==p[y]){v=!1;break}}if(!v){g=d.indexOf("<",g+1);continue}let m=b+p.length;if(m<d.length&&s(d[m])){g=d.indexOf("<",g+1);continue}for(;m<d.length&&o(d[m]);)m++;if(m<d.length&&d[m]===">")return!0;g=d.indexOf("<",g+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 g=r(d.slice(f));if(g===-1)return d;const b=f+g;if(l(d,b+1,p))return d;const v=i(d.slice(b+1));return v?`${d.slice(0,b+1)}
237
- ${v}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
238
- `,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
239
- `:`
240
- `,u=d+1}return c}function zZ(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,g=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++;g=h}return p?{prefix:f.slice(0,g),content:f.slice(g)}:null},i=f=>{let h=0;for(;h<f.length&&o(f[h]);)h++;const p=f[h];if(p!=="`"&&p!=="~")return null;let g=h;for(;g<f.length&&f[g]===p;)g++;const b=g-h;return b<3?null:{markerChar:p,markerLen:b,rest:f.slice(g)}},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(`
241
- `,d),h=f!==-1,p=h&&f>d&&e[f-1]==="\r",g=h?p?f-1:f:e.length,b=e.slice(d,g),v=h?p?`\r
242
- `:`
243
- `:"",m=s(b),y=m?.prefix??"",k=m?.content??b,A=i(k);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 $=k;if(!l&&$.includes("</"))for(const N of r)$=$.replace(N,(x,I,E,F)=>{if(F.replace(/^[\t ]+/,"").startsWith("|"))return x;const S=F.slice(0,E).replace(/^[\t ]+/,"");if(S.length>0){const L=I.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",R=S.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!L||!R||L!==R)return x}return`${I}
244
-
245
- `});if(y){const N=y+$.split(`
246
- `).join(`
247
- ${y}`);u+=N}else u+=$;u+=v,d=h?f+1:e.length}return u}function UZ(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 L=0;for(let R=0;R<S.length;R++){const D=S[R];if(D===" "){if(L++,L>=4)return!0;continue}if(D===" ")return!0;break}return!1},i=S=>{const L=S.charCodeAt(0);return L>=65&&L<=90||L>=97&&L<=122||L>=48&&L<=57||S==="_"||S==="-"||S===":"},r=S=>{let L=0;for(;L<S.length&&o(S[L]);)L++;return S.slice(L)},l=S=>{let L=0,R=!1,D=0;for(;L<S.length;){for(;L<S.length&&o(S[L]);)L++;if(L>=S.length||S[L]!==">")break;for(R=!0,L++;L<S.length&&o(S[L]);)L++;D=L}if(!R)return null;const z=S.slice(0,D);return{prefix:z,key:z.replace(/[ \t]+$/,""),content:S.slice(D)}},a=S=>r(S).startsWith("<"),c=S=>{for(let L=0;L<S.length;L++){const R=S[L];if(R!==" "&&R!==" ")return!1}return!0},u=S=>{if(s(S))return"";const L=r(S);if(!L.startsWith("<"))return"";let R=1;for(;R<L.length&&o(L[R]);)R++;if(R>=L.length||L[R]==="/"||L[R]==="!"||L[R]==="?")return"";const D=R;for(;R<L.length&&i(L[R]);)R++;if(R===D)return"";const z=L.slice(D,R).toLowerCase();if(!n.has(z))return"";const H=L[R];return H&&H!==" "&&H!==" "&&H!==">"&&H!=="/"?"":z},d=S=>{if(s(S))return null;const L=r(S);if(!L.startsWith("<"))return null;let R=1;for(;R<L.length&&o(L[R]);)R++;if(R>=L.length)return null;const D=L[R]==="/";if(D)for(R++;R<L.length&&o(L[R]);)R++;const z=L[R];if(!z||z==="!"||z==="?")return null;const H=R;for(;R<L.length&&i(L[R]);)R++;if(R===H)return null;const U=L.slice(H,R).toLowerCase();if(!n.has(U))return null;const Z=L[R];if(Z&&Z!==" "&&Z!==" "&&Z!==">"&&Z!=="/")return null;if(D)return{type:"close",name:U};if(/\/\s*>\s*$/.test(L))return{type:"open",name:U,complete:!0};const K=L.indexOf(">",R);if(K!==-1){const V=L.slice(K+1);if(new RegExp(`<\\s*\\/\\s*${U}\\s*>`,"i").test(V))return{type:"open",name:U,complete:!0}}return{type:"open",name:U,complete:!1}},f=S=>{if(s(S))return null;const L=r(S).replace(/[ \t]+$/,"");if(!L.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(L))return null;const R=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(R?.[1])return R[1].toLowerCase();const D=L.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!D?.[1]||!D[2])return null;const z=D[1].toLowerCase();return z===D[2].toLowerCase()?z:null};let h=!1,p="",g=0;const b=S=>{let L=0;for(;L<S.length&&o(S[L]);)L++;const R=S[L];if(R!=="`"&&R!=="~")return null;let D=L;for(;D<S.length&&S[D]===R;)D++;const z=D-L;return z<3?null:{markerChar:R,markerLen:z,rest:S.slice(D)}},v=S=>b(S),m=S=>{const L=r(S);return L?s(S)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(L):!1},y=(S,L,R)=>{let D=S,z=0;for(;D<e.length;){const H=e.indexOf(`
248
- `,D),U=H!==-1,Z=U&&H>D&&e[H-1]==="\r",K=U?Z?H-1:H:e.length,V=e.slice(D,K),J=l(V),fe=J?.key??"";if(z>0&&L&&fe!==L)break;const oe=J?.content??V,ce=d(oe);if(ce?.name===R){if(ce.type==="open")ce.complete||z++;else if(z>0&&(z--,z===0))return!1}else if(z>0&&(c(oe)||m(oe)))return!0;if(U)D=H+1;else break}return!1};let k="",A=0,$=!0,N=!1,x=!1,I=`
249
- `;const E=[];let F="";for(;A<e.length;){const S=e.indexOf(`
250
- `,A),L=S!==-1,R=L&&S>A&&e[S-1]==="\r",D=L?R?S-1:S:e.length,z=e.slice(A,D),H=L?R?`\r
251
- `:`
252
- `:"",U=l(z),Z=U?.key??"",K=U?.content??z,V=v(K);V&&(h?V.markerChar===p&&V.markerLen>=g&&/^\s*$/.test(V.rest)&&(h=!1,p="",g=0):(h=!0,p=V.markerChar,g=V.markerLen));const J=E.length>0;if(!h&&!J){const oe=u(K),ce=!!oe&&!$&&N&&x&&y(A,Z,oe);oe&&!$&&(!N||ce)&&(Z&&F&&Z===F?k+=`${Z}${I}`:Z||(k+=I))}if(k+=z,k+=H,H&&(I=H),!h){const oe=d(K);if(oe){if(oe.type==="open")oe.complete||E.push(oe.name);else for(let ce=E.length-1;ce>=0;ce--)if(E[ce]===oe.name){E.length=ce;break}}}const fe=c(K);$=fe,N=!fe&&a(K),x=!fe&&!!f(K),F=Z,A=L?S+1:e.length}return k}function xM(e,t,n={}){const o=gM(n),s=o?Jc():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(uZ(t,n)&&(t.stream.reset(),dZ(t)),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,b=>b.startsWith(`
253
- `)?`
254
- `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,b=>b.startsWith(`
255
- `)?`
256
- `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,b=>b.startsWith(`
257
- `)?`
258
- `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
259
- `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,b=>b.startsWith(`
260
- `)?`
261
- `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(b,v,m)=>`${v}${m.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,b=>b.startsWith(`
262
- `)?`
263
- `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
264
- `))),n.customHtmlTags?.length&&r.includes("<")){const b=ru(n.customHtmlTags);if(b.length&&(r=HZ(r,b),r=WZ(r,b),r=UZ(r,b),r=zZ(r,b),r.includes("</")))for(const v of b){const m=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${v}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(m,"$1$2$2")}}i||(r=PZ(r));const l=_Z(r);if(l){const b=n.preTransformTokens,v=n.postTransformTokens;if(yM(t,n)||typeof b=="function"||typeof v=="function"){const m=J_(t,r,{__markstreamFinal:i},n),y=typeof b=="function"&&b(m)||m;typeof v=="function"&&v(y)}return O0(l,o,s)}const a=J_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return O0([],o,s);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const f=t,h=n.validateLink??f.options?.validateLink??(typeof f.validateLink=="function"?f.validateLink:void 0),p={...n,validateLink:h,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let g=Z_(d,p,o);if(u&&typeof u=="function"){const b=u(d);if(Array.isArray(b)){const v=b[0],m=v?.type;v&&typeof m=="string"?g=Z_(b,void 0,o):g=b}}if(g=DZ(g,i,r),g=bM(g,r,t,n,i)[0],g=FZ(g,t,n,i),i){const b=new WeakSet,v=m=>{if(!m||typeof m!="object"||b.has(m))return;if(b.add(m),Array.isArray(m)){for(const k of m)v(k);return}const y=m;y.type==="html_block"&&y.loading===!0&&(y.loading=!1);for(const k of Object.values(y))v(k)};v(g)}return n.debug&&console.log("Parsed Markdown Tree Structure:",g),O0(g,o,s)}function sS(e,t){if(!e||!Array.isArray(e))return[];const n=[],o=Hl(t);let s=0;for(;s<e.length;){const i=ck(e,s,o.options(),ak);if(i){n.push(i[0]),o.remember(i[0].raw),s=i[1];continue}const r=e[s];switch(r.type){case"paragraph_open":{const l=String(e[s+1]?.content??""),a=iZ(e,s,o.options(l)),c=tS(a,t);c?n.push(...c):n.push(a),o.remember(a.raw),s+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=lu(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"blockquote_open":{const[l,a]=au(e,s,o.options());n.push(l),o.remember(l.raw),s=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),o.remember(String(r.content??"")),s++;break}case"hardbreak":n.push(sZ()),o.reset(),s++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),o.remember(l),s++;break}case"inline":{const l=String(r.content??""),a=eo(r.children||[],l,void 0,o.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=tS(c,t);u?n.push(...u):n.push(c)}o.remember(l)}s+=1;break;default:s+=1;break}}return n}const qZ=new Set([...Qd,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),jZ=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","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),iS=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function rS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function VZ(e){return typeof e=="string"?e:e==null?"":String(e)}function wM(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function yl(e){return VZ(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _M(e){return yl(e).replace(/`/g,"&#96;")}function Fm(e){return String(e??"").trim().toLowerCase()}function hk(e,t="safe"){const n=Fm(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):!jZ.has(n):!1}function SM(e,t="safe"){const n=Fm(e);return n?t==="escape"?!0:t==="trusted"?Qd.has(n):qZ.has(n):!1}function lS(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,o])=>o===""?` ${n}`:` ${n}="${_M(o)}"`).join("")}function KZ(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||Ca(s,{tagName:t,attrName:"srcset"})})}function CM(e,t,n,o){return NV.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?KZ(t,o):!!(IV.has(e)&&t&&Ca(t,{tagName:o,attrName:e}))}function pa(e,t){const n=t.toLowerCase();return Object.keys(e).find(o=>o.toLowerCase()===n)}function AM(e,t,n,o=!1){if(t!=="safe"||Fm(n)!=="a")return e;const s=pa(e,"href");if(o&&(!s||!e[s])){const a=pa(e,"target"),c=pa(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=pa(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=pa(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 aS(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!wM(r)||CM(l,i,t,n)||(o[r]=i)}return AM(o,t,n,!!pa(e,"href"))}function MM(e,t){const n=e.toLowerCase();return $6.has(n)?!1:rS(t,n)||rS(t,e)}function pk(e,t="safe",n){const o={};for(const[s,i]of Object.entries(e)){const r=s.trim(),l=r.toLowerCase();!r||!wM(r)||CM(l,i,t,n)||(o[r]=i)}return AM(o,t,n,!!pa(e,"href"))}function Ap(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 vv(e,t="safe",n){const o=pk(Ap(e),t,n),s=Object.entries(o).map(([i,r])=>[i,r]);return s.length>0?s:void 0}function GZ(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 YZ(e){const t={};for(const[n,o]of Object.entries(e))t[n]=GZ(o,n);return t}function cS(e){return e.trim().length>0}function ZZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const o=e.indexOf("<",n);if(o===-1){if(n<e.length){const a=e.slice(n);cS(a)&&t.push({type:"text",content:a})}break}if(o>n){const a=e.slice(n,o);cS(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",o+1)){const a=e.indexOf("]]>",o);if(a!==-1){t.push({type:"text",content:e.slice(o,a+3)}),n=a+3;continue}break}if(e.startsWith("!",o+1)){const a=e.indexOf(">",o);if(a!==-1){n=a+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=s+1}return t}function QZ(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const f=e.indexOf("-->",n);if(f!==-1){n=f+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 f=e.indexOf("]]>",o);if(f!==-1){t.push({type:"text",content:e.slice(o,f+3)}),n=f+3;continue}break}if(e.startsWith("!",o+1)){const f=e.indexOf(">",o);if(f!==-1){n=f+1;continue}break}const s=e.indexOf(">",o);if(s===-1)break;const i=e.slice(o+1,s).trim();if(!i){n=s+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const f=i.slice(1).trim();t.push({type:"tag_close",tagName:f}),n=s+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const f=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let h;for(;(h=f.exec(u))!==null;){const p=h[1],g=h[2]??h[3]??h[4]??"";p&&!p.endsWith("/")&&(d[p]=g)}}t.push({type:l||Ha.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=s+1}return t}function XZ(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${yl(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([o,s])=>s===""?` ${yl(o)}`:` ${yl(o)}="${_M(s)}"`).join("");return e.type==="self_closing"?`&lt;${yl(t)}${n} /&gt;`:`&lt;${yl(t)}${n}&gt;`}function JZ(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;iS.lastIndex=0;let n;for(;(n=iS.exec(e))!==null;)if(MM(n[1],t))return!0;return!1}function zc(e,t="safe"){if(!e)return"";if(t==="escape")return yl(e);const n=QZ(e),o=[],s=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&s.push(yl(r.content??""));continue}const l=Fm(r.tagName);if(!l)continue;if(SM(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"&&hk(l,t)){s.push(XZ(r));continue}if(r.type==="self_closing"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){s.push(`<${l}${lS(aS(r.attrs??{},t,l))}>`),Ha.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 eQ=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],uS="http://www.w3.org/2000/svg",tQ=new Set(["script","style","iframe","object","embed","link","meta"]),nQ=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"]),oQ=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),sQ=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),iQ=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function rQ(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function lQ(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function aQ(e){const t=e.nodeName.toLowerCase();return t==="use"?rQ(e):t==="image"?lQ(e):t==="text"||t==="tspan"?!!e.textContent?.trim():iQ.has(t)}function cQ(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 uQ(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")?Ca(i,{tagName:"a",attrName:"href"})?"":i:o==="image"&&(s==="href"||s==="xlink:href"||s==="src")?Ca(i,{tagName:"img",attrName:"src"})?"":i:s==="href"||s==="xlink:href"?i.startsWith("#")?i:"":Ca(i,{tagName:o,attrName:s})?"":i:""}function dQ(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 EM(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 TM(e){const t=EM(e),n=t.toLowerCase();let o=0;for(;o<n.length;){const s=n.indexOf("url(",o);if(s===-1)return!1;const i=dQ(t,s);if(o=Math.max(i.next,s+4),!i.url.trim().startsWith("#"))return!0}return!1}function dS(e){const t=EM(e);return eQ.some(n=>n.test(t))||TM(t)}function fQ(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 eh(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function NM(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(!tQ.has(o)){if(o==="br"){t.push(`
265
- `);return}for(const s of Array.from(n.childNodes))NM(s,t)}}function hQ(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];NM(t,n);const o=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!o.length){t.remove();continue}const s=eh(t.getAttribute("width")),i=eh(t.getAttribute("height")),r=eh(t.getAttribute("x")),l=eh(t.getAttribute("y")),a=e.ownerDocument.createElementNS(uS,"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(uS,"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 pQ(e){hQ(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const o=n.tagName.toLowerCase();if(!nQ.has(o)){n.remove();continue}if(o==="style"&&dS(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&&dS(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(oQ.has(r)&&i.value){const l=uQ(o,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(sQ.has(r)&&i.value&&TM(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=cQ(i.value);l!==i.value&&n.setAttribute(i.name,l)}}fQ(n)}}function s_e(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 pQ(n),mQ(n)?null:n}catch{return null}}function mQ(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){aQ(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 fS=[];function B0(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function gQ(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function vQ(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function hS(e=`editor-${Date.now()}`,t={}){const n=FG(t),o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const f=t.i18n;s=h=>f[h]??o[h]??h}else s=f=>o[f]??f;if(Array.isArray(t.plugin))for(const f of t.plugin){const h=f;if(Array.isArray(h)){const[p,...g]=h;typeof p=="function"&&n.use(p,...g)}else typeof h=="function"&&n.use(h)}if(Array.isArray(t.apply))for(const f of t.apply)try{f(n)}catch(h){console.error("[getMarkdown] apply function threw an error",h)}if(fS.length)for(const f of fS)if(Array.isArray(f)){const[h,...p]=f;typeof h=="function"&&n.use(h,...p)}else typeof f=="function"&&n.use(f);n.use(XW),n.use(tz),n.use(YW);const i=mz,r=i.default??i;n.use(r),n.use(GW),n.use(KW),n.core.ruler.after("block","mark_fence_closed",f=>{const h=f,p=h.src,g=!!h.env?.__markstreamFinal,b=p.split(/\r?\n/);for(const v of h.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const m=v.map[0],y=v.map[1],k=v.markup,A=k[0],$=k.length,N=b[Math.max(0,y-1)]??"";let x=0;for(;x<N.length&&(N[x]===" "||N[x]===" ");)x++;let I=0;for(;x+I<N.length&&N[x+I]===A;)I++;let E=x+I;for(;E<N.length&&(N[E]===" "||N[E]===" ");)E++;const F=g?!0:y>m+1&&I>=$&&E===N.length,S=v;S.meta=S.meta??{},S.meta.unclosed=!F,S.meta.closed=!!F}});const l=(f,h)=>{const p=f,g=p.pos;if(p.src[g]!=="~")return!1;const b=p.src[g-1],v=p.src[g+1];if(/\d/.test(b)&&/\d/.test(v)){if(!h){const m=p.push("text","",0);m.content="~"}return p.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(f,h)=>{const p=f[h],g=String(p.info??"").trim(),b=String(p.content??""),v=btoa(unescape(encodeURIComponent(b))),m=gQ(g),y=B0(m),k=vQ(`editor-${e}-${h}-${m}`),A=B0(s("common.copy"));return`<div class="code-block" data-code="${v}" data-lang="${y}" id="${k}">
266
- <div class="code-header">
267
- <span class="code-lang">${B0(m.toUpperCase())}</span>
268
- <button class="copy-button" data-code="${v}">${A}</button>
269
- </div>
270
- <div class="code-editor"></div>
271
- </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=f=>{if(!f.startsWith("["))return!1;const h=c.exec(f);if(!h)return f!=="["&&!/^\[\d+$/.test(f);const p=String(h[1]??"");return f.slice(h[0].length).startsWith("(")?!1:!/^\d+$/.test(p)},d=(f,h)=>{const p=f;if(p.src[p.pos]!=="[")return!1;const g=a.exec(p.src.slice(p.pos));if(!g)return!1;const b=p.src.slice(Math.max(0,p.pos-120),p.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=p.src.slice(p.pos+g[0].length);if(v.startsWith("](")||v.startsWith("(")||u(v))return!1;if(!h){const m=g[1],y=p.push("reference","span",0);y.content=m,y.markup=g[0],y.raw=g[0]}return p.pos+=g[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(f,h)=>{const g=String(f[h].content??"");return`<span class="reference-link" data-reference-id="${g}" role="button" tabindex="0" title="Click to view reference">${g}</span>`},n}function yQ({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 IM({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}:yQ({nextContent:e,previousContent:t??i,typewriterEnabled:o}):{settledContent:e,streamedDelta:"",appended:!1}}const pS=new WeakMap;function kQ(e){let t=pS.get(e);return t||(t={inFlight:new Map,completed:new Set,registeredAllLangs:!1,registeredThemes:[],registeredLangs:[],tail:Promise.resolve()},pS.set(e,t)),t}function mS(e,t){if(!t?.length)return[...e];const n=[...e],o=new Set(n);for(const s of t)o.has(s)||(o.add(s),n.push(s));return n}function mk(e){return!!(e.themes?.length||e.langs?.length)}function LM(e,t){if(!t?.length)return!0;const n=new Set(e);return t.every(o=>n.has(o))}function bQ(e,t){return!t?.length||e.registeredAllLangs?!0:LM(e.registeredLangs,t)}function D0(e,t){return mk(t)&&LM(e.registeredThemes,t.themes)&&bQ(e,t.langs)}function xQ(e,t){if(!mk(t))return t;const n=mS(e.registeredThemes,t.themes),o=e.registeredAllLangs?[]:mS(e.registeredLangs,t.langs);return{...n.length?{themes:n}:{},...o.length?{langs:o}:{}}}const wQ={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 _Q(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function $M(e){const t=_Q(e);return wQ[t]??t}function FM(e){if(!Array.isArray(e))return;const t=e.filter(o=>typeof o=="string").map(o=>$M(o)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function OM(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 SQ(e){return OM(e)?.join("\0")??""}function RM(e,t){const n=OM(e),o=FM(t);return{...n?.length?{themes:n}:{},...o?.length?{langs:o}:{}}}function Mp(e,t){return`${SQ(e)}\0\0${FM(t)?.join("\0")??""}`}function i_e(e,t,n={hasRegisterHighlight:!0,hasCreateRenderer:!0}){const o=RM(e,t),s={...o},i=!!(s.langs?.length&&n.hasCreateRenderer&&!n.hasRegisterHighlight);return i&&(delete o.langs,delete s.langs),{key:Mp(s.themes,s.langs),registerOptions:o,rendererOptions:s,ignoredLangs:i}}async function r_e(e,t={},n){if(!e)return"ready";const o=RM(t.themes,t.langs),s=Mp(o.themes,o.langs),i=n&&n===s?n:s,r=kQ(e);if(r.completed.has(i))return"ready";if(D0(r,o))return r.completed.add(i),"ready";const l=r.inFlight.get(i);if(l)return l;const a=r.tail.catch(()=>{}).then(()=>{if(r.completed.has(i)||D0(r,o))return r.completed.add(i),"ready";const c=xQ(r,o),u=Mp(c.themes,c.langs);return r.completed.has(u)||D0(r,c)?(r.completed.add(i),r.completed.add(u),"ready"):Promise.resolve(e(c)).then(()=>(mk(c)?(r.registeredThemes=c.themes?[...c.themes]:r.registeredThemes,r.registeredLangs=c.langs?[...c.langs]:r.registeredLangs):r.registeredAllLangs=!0,r.completed.add(u),"ready"))}).then(()=>(r.completed.add(i),"ready")).finally(()=>{r.inFlight.get(i)===a&&r.inFlight.delete(i)});return r.inFlight.set(i,a),r.tail=a.catch(()=>{}),a}function rc(e,t,n=1){const o=Number(e);return Number.isFinite(o)?Math.max(n,o):t}function gS(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var CQ=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=vS();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=vS();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,g=p>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,b=TQ(p/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(b-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const v=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),m=EQ(this.source.slice(this.visible.length),v,this.segmenter);m.text&&(this.visible+=m.text,this.charBudget=Math.max(0,this.charBudget-m.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=rc(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,rc(o,1e3,1)),this.normalizedTargetLatencyMs=rc(s,900,1),this.normalizedCatchUpLatencyMs=rc(i,350,1),this.normalizedCatchUpThreshold=gS(r,600),this.normalizedStartDelayMs=gS(a,80),this.maxCommitFps=Math.trunc(rc(l,30,1)),this.maxCharsPerCommit=Math.trunc(rc(c,80,1)),this.flushOnFinish=u,this.segmenter=MQ(),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 AQ(e={},t){const n=new CQ(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 MQ(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function EQ(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 vS(){return typeof performance<"u"?performance.now():Date.now()}function TQ(e,t,n){return Math.min(n,Math.max(t,e))}var NQ=(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 yv=Symbol.for("markstream-vue:node-lifecycle"),yS='<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>',kS='<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>',IQ={id:"material",core:{"":kS,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:kS,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:yS,csharp:yS,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:()=>ms(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},kv=new Map;let bS="material";const Mc=new Map,xS=new Map;let bv=null;function LQ(e){kv.set(e.id,e)}function $Q(e){return NQ(this,null,function*(){var t,n,o;if(Mc.has(e.id))return(t=Mc.get(e.id))!=null?t:null;let s=xS.get(e.id);return s||(s=((o=(n=e.loadExtended)==null?void 0:n.call(e))!=null?o:Promise.resolve(null)).then(i=>(Mc.set(e.id,i),bv?.(),i)).catch(()=>(Mc.set(e.id,null),null)),xS.set(e.id,s)),s})}const FQ=Ba(0);bv=()=>{FQ.value++},LQ(IQ);const OQ={"":"",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 gk(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=OQ[n])!=null?t:n}function l_e(e){const t=gk(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function a_e(e){return(function(o){const s=kv.get(bS);if(!s)return;const i=s.core[o];if(i)return i;const r=Mc.get(s.id);if(r){const l=r[o];if(l)return l}s.loadExtended&&!Mc.has(s.id)&&$Q(s)})(gk(e))||((n=(t=kv.get(bS))==null?void 0:t.fallback)!=null?n:"");var t,n}const c_e={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"};let BM=!1;function u_e(){return BM}function d_e(){BM=!0}var Om=(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 js=null,Ah=!1,Rm=yk;function Bm(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function vk(){try{const e=globalThis;return Bm(e?.katex)}catch{return null}}function yk(){return Om(null,null,function*(){const e=vk();if(e)return e;const t=yield ms(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ms(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([2,3]))}catch{}return Bm(t)})}function RQ(e){Rm=e,js=null,Ah=!1}function BQ(e){RQ(yk)}function DM(){return typeof Rm=="function"}function f_e(){var e;const t=Rm;if(!t||t===yk)return null;if(js)return js;const n=vk();if(n)return js=n,js;try{const o=t();return o&&typeof o?.then!="function"?(js=(e=Bm(o))!=null?e:o,js):null}catch{return null}}function kk(){return Om(this,null,function*(){var e;const t=vk();if(t)return js=t,js;if(js)return js;if(Ah)return null;const n=Rm;if(!n)return Ah=!0,null;try{const o=yield n();if(o)return js=(e=Bm(o))!=null?e:o,js}catch{}return Ah=!0,null})}function PM(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let xl=null,ml=null;const pi=new Map,Fr=new Map;let Ep=5;const ka=new Set;function Bd(){if(pi.size<Ep&&ka.size){const e=Array.from(ka);ka.clear();for(const t of e)try{t()}catch{}}}function DQ(e){xl=e,ml=null,xl.onmessage=t=>{const{id:n,html:o,error:s}=t.data,i=pi.get(n);if(i)if(pi.delete(n),clearTimeout(i.timeoutId),Bd(),s)i.reject(new Error(s));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Fr.set(a,o),Fr.size>200){const c=Fr.keys().next().value;Fr.delete(c)}}i.resolve(o)}},xl.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,o]of pi.entries())clearTimeout(o.timeoutId),o.reject(new Error(`Worker error: ${t.message}`));pi.clear(),Bd()}}function PQ(){var e;xl&&((e=xl.terminate)==null||e.call(xl)),xl=null,ml=null}function HQ(e,t=!0,n=2e3,o){return Om(this,null,function*(){performance.now();const s=PM(e);if(!DM()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(ml)return Promise.reject(ml);const i=`${t?"d":"i"}:${s}`,r=Fr.get(i);if(r)return Promise.resolve(r);const l=xl||(ml=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),ml.name="WorkerInitError",ml.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(ml);if(pi.size>=Ep){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=pi.size,a.max=Ep,Promise.reject(a)}return new Promise((a,c)=>{if(o?.aborted){const p=new Error("Aborted");return p.name="AbortError",void c(p)}const u=Math.random().toString(36).slice(2),d=globalThis.setTimeout(()=>{pi.delete(u);const p=new Error("Worker render timed out");p.name="WorkerTimeout",p.code="WORKER_TIMEOUT",c(p),Bd()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(d),pi.has(u)&&pi.delete(u);const p=new Error("Aborted");p.name="AbortError",c(p),Bd()},{once:!0});const f=a,h=c;pi.set(u,{resolve:p=>{f(p)},reject:p=>{h(p)},timeoutId:d}),l.postMessage({id:u,content:s,displayMode:t})})})}function h_e(e,t=!0,n){const o=`${t?"d":"i"}:${PM(e)}`;if(Fr.set(o,n),Fr.size>200){const s=Fr.keys().next().value;Fr.delete(s)}}const WQ="WORKER_BUSY";function zQ(e=2e3,t){return pi.size<Ep?Promise.resolve():new Promise((n,o)=>{let s,i=!1;const r=()=>{i||(i=!0,s&&globalThis.clearTimeout(s),ka.delete(r),n())};if(ka.add(r),s=globalThis.setTimeout(()=>{if(i)return;i=!0,ka.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",o(l)},e),queueMicrotask(()=>Bd()),t){const l=()=>{if(i)return;i=!0,s&&globalThis.clearTimeout(s),ka.delete(r);const a=new Error("Aborted");a.name="AbortError",o(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ou={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function p_e(e){return Om(this,arguments,function*(t,n=!0,o={}){var s,i,r,l;if(!DM()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(s=o.timeout)!=null?s:Ou.timeout,c=(i=o.waitTimeout)!=null?i:Ou.waitTimeout,u=(r=o.backoffMs)!=null?r:Ou.backoffMs,d=(l=o.maxRetries)!=null?l:Ou.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ou.maxRetries,h=o.signal;let p=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield HQ(t,n,a,h)}catch(g){if(g?.code!==WQ||p>=f)throw g;if(p++,yield zQ(c,h).catch(()=>{}),h?.aborted){const b=new Error("Aborted");throw b.name="AbortError",b}u>0&&(yield new Promise(b=>globalThis.setTimeout(b,u*p)))}}})}function Ec(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function UQ(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 xv(e){const t=e.split(/\r?\n/).map(s=>s.trim()).filter(s=>s&&!s.startsWith("%%")),n=Math.max(1,t.length),o=UQ(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 wv(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 HM(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function _v(e,t=360,n=500){return HM(e,t,n)}function Sv(e,t=360,n=500){return HM(e,t,n)}var qQ=Object.defineProperty,jQ=Object.defineProperties,VQ=Object.getOwnPropertyDescriptors,wS=Object.getOwnPropertySymbols,KQ=Object.prototype.hasOwnProperty,GQ=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WM=(e,t)=>{for(var n in t||(t={}))KQ.call(t,n)&&_S(e,n,t[n]);if(wS)for(var n of wS(t))GQ.call(t,n)&&_S(e,n,t[n]);return e},bk=(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 xk=()=>ms(()=>import("./mermaid.core-zKrc8Ye9.js").then(e=>e.bn),[]);let br=null,wk=xk;function YQ(e){wk=e,br=null}function ZQ(e){YQ(xk)}function QQ(){return typeof wk=="function"}function SS(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=WM({},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},jQ(n,VQ(o))}var n,o;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function CS(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const o=WM({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 m_e(){return bk(this,null,function*(){if(br)return br;const e=(function(){try{const o=globalThis;return SS(o?.mermaid)}catch{return null}})();if(e)return br=e,CS(br),br;const t=wk;if(!t)return null;let n;try{n=yield t()}catch(o){throw t===xk?new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.'):o}return n?(br=SS(n),CS(br),br):null})}let hs=null,gl=null;const Uo=new Map;let AS=5,MS=!1;const XQ="WORKER_BUSY",JQ="MERMAID_DISABLED";function eX(e){hs=e,gl=null;const t=e;hs.onmessage=n=>{if(hs!==t)return;const{id:o,ok:s,result:i,error:r}=n.data,l=Uo.get(o);l&&(s===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(i))},hs.onerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error(`Worker error: ${n.message}`));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},hs.onmessageerror=n=>{var o,s;if(hs===t)if(Uo.size!==0){try{MS?console.error("[mermaidWorkerClient] Worker messageerror:",n):(s=console.debug)==null||s.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}for(const[i,r]of Uo.entries())r.reject(new Error("Worker messageerror"));Uo.clear()}else(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function tX(){var e;if(hs)try{for(const[t,n]of Uo.entries())n.reject(new Error("Worker cleared"));Uo.clear(),(e=hs.terminate)==null||e.call(hs)}catch{}hs=null,gl=null}function zM(e,t,n=1400){if(!QQ()){const s=new Error("Mermaid rendering disabled");return s.name="MermaidDisabled",s.code=JQ,Promise.reject(s)}if(gl)return Promise.reject(gl);const o=hs||(gl=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),gl.name="WorkerInitError",gl.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(gl);if(Uo.size>=AS){const s=new Error("Worker busy");return s.name="WorkerBusy",s.code=XQ,s.inFlight=Uo.size,s.max=AS,Promise.reject(s)}return new Promise((s,i)=>{const r=Math.random().toString(36).slice(2);let l,a=!1;const c=()=>{a||(a=!0,l!=null&&globalThis.clearTimeout(l),Uo.delete(r))},u={resolve:d=>{c(),s(d)},reject:d=>{c(),i(d)}};Uo.set(r,u);try{o.postMessage({id:r,action:e,payload:t})}catch(d){return Uo.delete(r),void i(d)}l=globalThis.setTimeout(()=>{const d=new Error("Worker call timed out");d.name="WorkerTimeout",d.code="WORKER_TIMEOUT";const f=Uo.get(r);f&&f.reject(d)},n)})}function g_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("canParse",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function v_e(e,t,n=1400){return bk(this,null,function*(){try{return yield zM("findPrefix",{code:e,theme:t},n)}catch(o){return Promise.reject(o)}})}function y_e(){if(hs)try{for(const[e,t]of Uo.entries())t.reject(new Error("Worker terminated"));Uo.clear(),hs.terminate()}finally{hs=null}}var nX=Object.defineProperty,oX=Object.defineProperties,sX=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,iX=Object.prototype.hasOwnProperty,rX=Object.prototype.propertyIsEnumerable,TS=(e,t,n)=>t in e?nX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lt=(e,t)=>{for(var n in t||(t={}))iX.call(t,n)&&TS(e,n,t[n]);if(ES)for(var n of ES(t))rX.call(t,n)&&TS(e,n,t[n]);return e},Pt=(e,t)=>oX(e,sX(t)),Xn=(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 lX="__global__",P0="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",Cv=(()=>{const e=globalThis;if(e[P0])return e[P0];const t={scopedCustomComponents:{},revision:Ba(0)};return e[P0]=t,t})(),NS=Cv.revision,aX=Symbol("markstreamCustomComponents"),cX=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 ef(e){return cX.has(String(e).trim().toLowerCase())}function uX(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function H0(e={}){const t={};for(const[n,o]of Object.entries(e))if(o!=null){t[n]=o;for(const s of new Set([_i(n),_i(uX(n))]))!s||ef(s)||Object.prototype.hasOwnProperty.call(t,s)||(t[s]=o)}return t}function Co(e){const t=Kt(aX,null);return B(()=>{var n;return NS.value,(function(o,s={}){return NS.value,lt(lt(lt({},H0(Cv.scopedCustomComponents[lX]||{})),H0(s)),H0((function(i){return i&&Cv.scopedCustomComponents[i]||{}})(o)))})(e?.(),(n=t?.value)!=null?n:{})})}const dX=["aria-label"],fX={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"},hX={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"},gn=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Ys=gn(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(w(),T("svg",hX,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(w(),T("svg",fX,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,dX))}),[["__scopeId","data-v-be21ab83"]]);Ys.install=e=>{e.component(Ys.__name,Ys)};const pX={class:"emoji-node"},$s=gn(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("span",pX,O(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);$s.install=e=>{e.component($s.__name,$s)};const mX=["id"],gX=["title"],Zs=gn(Ze({__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)=>(w(),T("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+O(e.node.id)+"]",9,gX)],8,mX))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const UM=(()=>{try{return!1}catch{}return!1})();function W0(e){UM&&console.warn(e)}function IS(e,t="safe",n){return pk(e,t,n)}function qM(e){return YZ(e)}function z0(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function _k(e,t="safe"){const n=String(e.tag||e.type||"").trim(),o=vv((s=e.attrs)?Array.isArray(s)?s.every(Array.isArray)?s.map(([r,l])=>[String(r),z0(l)]):s.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),z0(r.value)]):Object.entries(s).map(([r,l])=>[r,z0(l)]):null,t,n);var s;if(!o)return;const i=qM(Ap(o));return Object.keys(i).length>0?i:void 0}function LS(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 Ru(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function U0(e,t,n,o,s,i,r=!1){const l=(function(d,f){return MM(d,f)})(e,o);if(Qd.has(e.toLowerCase())||!l&&SM(e,i))return null;if(!l&&hk(e,i))return r?[LS(e,t,!0)]:[LS(e,t),...n,`</${e}>`];const a=pk(t,i,e),c=a.key,u=c!=null&&c!==""?c:s;if(l){const d=o[e]||o[e.toLowerCase()],f=qM(a);return mn(d,Pt(lt({},f),{key:u}),n.length>0?n:void 0)}return mn(e,Pt(lt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function jM(e,t){return JZ(e,t)}function Tp(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=U0(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Ru(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(),g=U0(p.tagName,p.attrs||{},p.children,r,p.autoKey,l);c.length>0?Ru(c[c.length-1].children,g):Ru(u,g),p.tagName.toLowerCase()!==f&&c.length>h&&W0(`Auto-closing unclosed tag: <${p.tagName}>`)}else W0(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),f=U0(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?Ru(c[c.length-1].children,f):Ru(u,f),W0(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(ZZ(e),t,n)}catch(s){return o=s,UM&&console.error("Failed to parse HTML to VNodes:",o),null}var o}const vX=["innerHTML"],Qs=gn(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=B(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),s=Co(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=B(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:zc(l,o.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Tp(l,s.value,o.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!jM(l,s.value))return{mode:"html",content:zc(l,o.value)};const a=Tp(l,s.value,o.value);return a===null?{mode:"html",content:zc(l,o.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(w(),T("span",{key:0,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[re(C(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(w(),T("span",{key:1,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},O(r.value.content),3)):(w(),T("span",{key:2,class:We(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,vX))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const yX={class:"inline-code"},kX={key:0},ts=gn(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=Vd(),o=Kt("markstreamFade",void 0),s=Kt("markstreamTextStreamState",void 0),i=Kt("markstreamStreamVersion",void 0),r=B(()=>{const m=n.fade;return m===""||m===!0||m==="true"||m!==!1&&m!=="false"&&void 0}),l=B(()=>typeof r.value=="boolean"?r.value:typeof o?.value!="boolean"||o.value),a=B(()=>{var m;return String((m=t.node.code)!=null?m:"")}),c=B(()=>!l.value),u=B(()=>{var m;const y=(m=n["index-key"])!=null?m:n.indexKey;return y==null||y===""?"":String(y)}),d=X(t.node.code),f=X("");let h=i?.value;const p=X(0);function g(){return d.value+f.value}function b(){f.value&&(d.value=g(),f.value="")}Qe([()=>t.node.code,u,l,()=>i?.value],([m,y,k,A])=>{const $=String(m??""),N=u.value,x=A!==h;h=A;const I=IM({nextContent:$,persistedContent:N?s?.get(N):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value,streamRenderVersionChanged:x});d.value=I.settledContent,f.value=I.streamedDelta,I.appended&&(p.value+=1),N&&s?.set(N,$)},{immediate:!0}),Qe(l,m=>{var y;m||(y=g(),d.value=y,f.value="")});const v=B(()=>p.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(m,y)=>(w(),T("code",yX,[c.value?(w(),T(Pe,{key:0},[Je(O(a.value),1)],64)):(w(),T(Pe,{key:1},[d.value?(w(),T("span",kX,O(d.value),1)):ae("",!0),f.value?(w(),T("span",{key:1,class:We(["inline-code-stream-delta",[v.value]]),onAnimationend:b},O(f.value),35)):ae("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);ts.install=e=>{e.component(ts.__name,ts)};const Av=X(!1),$S=X(""),FS=X("top"),cd=X(null),ud=X(null),Mv=X(null),Ev=X(null),OS=X(null);let Mh=null,Eh=null,Tv=0;function VM(){Mh&&(clearTimeout(Mh),Mh=null),Eh&&(clearTimeout(Eh),Eh=null)}let th=!1,nh=null,RS=!1;function bX(e,t,n="top",o=!1,s,i){if(!e)return;const r=++Tv;VM();const l=()=>Xn(null,null,function*(){var a,c;if(yield(function(){return Xn(this,null,function*(){if(!th&&!RS&&typeof document<"u"){nh!=null||(nh=Xn(null,null,function*(){const[{createApp:u,h:d},{default:f}]=yield Promise.all([ms(()=>import("./vue.runtime.esm-bundler-DNukiHq4.js"),[]),ms(()=>import("./Tooltip-CsrTX-eT.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),u({setup:()=>()=>{var p;return d(f,{visible:Av.value,"anchor-el":cd.value,content:$S.value,placement:FS.value,id:ud.value,originX:Mv.value,originY:Ev.value,isDark:(p=OS.value)!=null?p:void 0})}}).mount(h),th=!0}));try{yield nh}catch(u){th=!1,nh=null,RS=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),th&&r===Tv){ud.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,cd.value=e,$S.value=t,FS.value=n,Mv.value=(a=s?.x)!=null?a:null,Ev.value=(c=s?.y)!=null?c:null,OS.value=typeof i=="boolean"?i:null,Av.value=!0;try{e.setAttribute("aria-describedby",ud.value)}catch{}}});o?l():Mh=setTimeout(l,80)}function xX(e=!1){Tv+=1,VM();const t=()=>{if(cd.value&&ud.value)try{cd.value.removeAttribute("aria-describedby")}catch{}Av.value=!1,cd.value=null,ud.value=null,Mv.value=null,Ev.value=null};e?t():Eh=setTimeout(t,120)}const Nv={"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..."},Iv=e=>{var t;return(t=Nv[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function BS(e){return{t(t){if(e.te&&Nv[t]&&!e.te(t))return Iv(t);const n=e.t(t);return n===t&&Nv[t]?Iv(t):n}}}function wX(){const e=(function(){var t,n;try{const o=Yo(),s=o?.proxy,i=s?.$t;if(typeof i=="function"){const a=s?.$te;return{t:i.bind(s),te:typeof a=="function"?a.bind(s):void 0}}const r=(n=(t=o?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return BS(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return BS({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Iv}}function _X(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 SX=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],CX={key:1,class:"image-placeholder"},AX={key:1,class:"image-node__raw-text"},MX={key:0,class:"image-shimmer-overlay"},EX={key:1,class:"image-node__raw-text"},TX={key:2,class:"image-error"},Al=gn(Ze({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=t,s=X(!1),i=X(!1),r=X(""),l=X("primary"),a=X(null),c=Vd(),u=Kt(yv,null);let d="",f=null;const h=B(()=>v_(n.node.src)),p=B(()=>v_(n.fallbackSrc)),g=B(()=>r.value),b=B(()=>!n.lazy),v=B(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),m=B(()=>l.value==="failed"),y=B(()=>!b.value&&!s.value&&!i.value&&l.value!=="failed"&&r.value.length>0),k=B(()=>_X(n,c));function A(R=k.value){R&&a.value&&u?.reportHeight(R,a.value.offsetHeight)}function $(R=k.value){R&&mt(()=>{A(R)})}function N(){f&&(clearTimeout(f),f=null)}function x(){const R=k.value;R&&d!==R&&(d&&u?.markSettled(d),N(),d=R,u?.markPending(R),typeof window<"u"&&(f=window.setTimeout(()=>{d===R&&($(R),I())},8e3)))}function I(){return Xn(this,null,function*(){const R=d;R&&(N(),d="",yield mt(),A(R),u?.markSettled(R))})}function E(){if(l.value==="primary"&&p.value&&p.value!==r.value)return l.value="fallback",r.value=p.value,s.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,o("error",r.value),$()}function F(){s.value=!0,i.value=!1,o("load",g.value),$()}function S(R){R.preventDefault(),s.value&&!i.value&&o("click",[R,g.value])}const{t:L}=wX();return Qe([h,p,()=>n.node.loading],()=>(s.value=!1,i.value=!1,n.node.loading||h.value?(r.value=h.value,void(l.value="primary")):p.value?(r.value=p.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Qe([v,s,i,g,()=>n.lazy],([R,D,z,H,U])=>R&&H&&!z?D?(I(),void $()):U?(x(),void $()):void(D||z||x()):(I(),void $()),{flush:"post",immediate:!0}),po(()=>{(function(){const R=d;R&&(N(),d="",u?.markSettled(R))})()}),(R,D)=>{var z,H,U,Z,K;return w(),T("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[v.value?(w(),T("img",{key:0,src:g.value,alt:String((H=(z=n.node.alt)!=null?z:n.node.title)!=null?H:""),title:String((Z=(U=n.node.title)!=null?U:n.node.alt)!=null?Z:""),class:We(["image-node__img",{"is-loading":!b.value&&!s.value,"is-loaded":b.value||s.value,"has-natural-size":s.value,"cursor-pointer":s.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:b.value?"high":void 0,decoding:b.value?"sync":"async",tabindex:s.value?0:-1,"aria-label":(K=n.node.alt)!=null?K:C(L)("image.preview"),onError:E,onLoad:F,onClick:S},null,42,SX)):ae("",!0),e.node.loading&&!i.value?(w(),T("span",CX,[n.usePlaceholder?On(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[0]||(D[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",AX,O(e.node.raw),1))])):ae("",!0),re(Il,{name:"shimmer-fade"},{default:Ee(()=>[y.value&&!e.node.loading?(w(),T("span",MX,[n.usePlaceholder?On(R.$slots,"placeholder",{key:0,node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[1]||(D[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(w(),T("span",EX,O(e.node.raw),1))])):ae("",!0)]),_:3}),m.value?(w(),T("span",TX,[On(R.$slots,"error",{node:n.node,displaySrc:g.value,imageLoaded:s.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[D[2]||(D[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("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)),_("span",null,O(C(L)("image.loadError")),1)],!0)])):ae("",!0)],512)}}}),[["__scopeId","data-v-cbb5c63e"]]);Al.install=e=>{e.component(Al.__name,Al)};const NX={key:2},lr=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamNestedRendererProps",void 0),i=B(()=>{var p;return(p=o?.value)!=null?p:"safe"}),r=B(()=>{var p,g;const b=(p=s?.value)!=null?p:{};return Pt(lt({},b),{customId:(g=t.customId)!=null?g:b.customId,htmlPolicy:i.value})}),l=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),a=B(()=>t.components[String(t.node.type)]),c=B(()=>!!(a.value&&n.value[t.node.type]&&!ef(String(t.node.type)))),u=B(()=>c.value?_k(t.node,i.value):void 0),d=B(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=B(()=>{var p;return String((p=t.node.content)!=null?p:"")}),h=B(()=>{var p,g;return String((g=(p=t.node.content)!=null?p:t.node.raw)!=null?g:"")});return(p,g)=>a.value&&c.value?(w(),xe(jo(a.value),yn({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:Ee(()=>[d.value?(w(),xe(C(l),yn({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?(w(),xe(C(l),yn({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"])):ae("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(w(),xe(jo(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(w(),T("span",NX,O(h.value),1)):ae("",!0)}}),IX=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],LX={key:0,translate:"no",class:"markstream-pre__diff-code"},$X={class:"markstream-pre__diff-number","aria-hidden":"true"},FX={class:"markstream-pre__diff-content"},OX={class:"markstream-pre__diff-content-inner"},RX={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},BX=["textContent"],qs=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=B(()=>{var S,L,R;const D=String((L=(S=t.node)==null?void 0:S.language)!=null?L:"");return String((R=String(D).split(/\s+/g)[0])!=null?R:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=B(()=>`language-${n.value}`),s=B(()=>{var S,L,R,D,z;return((S=t.node)==null?void 0:S.diff)===!0?String((R=(L=t.node)==null?void 0:L.code)!=null?R:""):(function(H,U){const Z=String(H??"");return U?Z:Z.replace(/\r\n$|\n$|\r$/,"")})((D=t.node)==null?void 0:D.code,((z=t.node)==null?void 0:z.loading)===!0)}),i=B(()=>s.value.split(/\r\n|\n|\r/)),r=B(()=>Array.from({length:Math.max(1,i.value.length)},(S,L)=>L+1)),l=B(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),a=B(()=>l.value&&t.diffInline===!0),c=B(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const L=`${Math.ceil(S)}px`;return{height:L,minHeight:L,maxHeight:L,overflow:"auto"}});function u(S){return String(S??"").trim().length===0}function d(S,L="context",R={}){const D=u(S);return{code:S,kind:D&&L!=="hunk"&&!R.preserveBlankKind?"context":L,empty:D}}function f(S){const L=String(S??"");return L?L.split(/\r\n|\n|\r/):[]}function h(S,L){return!u(S[L])||L<S.length-1}function p(S){return S.startsWith("-")&&!S.startsWith("---")}function g(S){return S.startsWith("+")&&!S.startsWith("+++")}function b(S,L){const R=f(S),D=f(L),z=(function(J,fe){const oe=J.length,ce=fe.length;if((oe+1)*(ce+1)>15e5)return null;const ue=ce+1,Se=new Uint32Array((oe+1)*(ce+1));for(let le=1;le<=oe;le++)for(let ne=1;ne<=ce;ne++){const q=le*ue+ne;if(J[le-1]===fe[ne-1])Se[q]=Se[(le-1)*ue+(ne-1)]+1;else{const ee=Se[(le-1)*ue+ne],ge=Se[le*ue+(ne-1)];Se[q]=ee>=ge?ee:ge}}const Te=[];let Ae=oe,P=ce;for(;Ae>0&&P>0;)J[Ae-1]===fe[P-1]?(Te.push({originalIndex:Ae-1,modifiedIndex:P-1}),Ae--,P--):Se[(Ae-1)*ue+P]>=Se[Ae*ue+(P-1)]?Ae--:P--;return Te.reverse(),Te})(R,D);if(z){const J=[];let fe=0,oe=0;for(const ce of z){for(;fe<ce.originalIndex;)J.push(Pt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<ce.modifiedIndex;)J.push(Pt(lt({},d(D[oe],"added",{preserveBlankKind:h(D,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;J.push(Pt(lt({},d(D[ce.modifiedIndex])),{key:`inline-context-source-${ce.originalIndex}-${ce.modifiedIndex}`,number:ce.modifiedIndex+1})),fe=ce.originalIndex+1,oe=ce.modifiedIndex+1}for(;fe<R.length;)J.push(Pt(lt({},d(R[fe],"removed",{preserveBlankKind:h(R,fe)})),{key:`inline-removed-source-${fe}`,number:""})),fe++;for(;oe<D.length;)J.push(Pt(lt({},d(D[oe],"added",{preserveBlankKind:h(D,oe)})),{key:`inline-added-source-${oe}`,number:oe+1})),oe++;return J}const H=[];let U=0,Z=R.length-1,K=D.length-1;for(;U<=Z&&U<=K&&R[U]===D[U];)H.push(Pt(lt({},d(D[U])),{key:`inline-prefix-${U}`,number:U+1})),U++;const V=[];for(;Z>=U&&K>=U&&R[Z]===D[K];)V.unshift(Pt(lt({},d(D[K])),{key:`inline-suffix-${K}`,number:K+1})),Z--,K--;for(let J=U;J<=Z;J++)H.push(Pt(lt({},d(R[J],"removed",{preserveBlankKind:h(R,J)})),{key:`inline-removed-source-${J}`,number:""}));for(let J=U;J<=K;J++)H.push(Pt(lt({},d(D[J],"added",{preserveBlankKind:h(D,J)})),{key:`inline-added-source-${J}`,number:J+1}));return H.concat(V)}const v=B(()=>{var S,L,R,D;const z=(function(K){const V=K.some(fe=>p(fe)),J=K.some(fe=>g(fe));return V&&J||(function(){var fe,oe,ce,ue;if(n.value==="diff")return!0;const Se=(ue=(ce=String((oe=(fe=t.node)==null?void 0:fe.raw)!=null?oe:"").split(/\r?\n/,1)[0])==null?void 0:ce.trim())!=null?ue:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Se)})()&&(V||J)})(i.value),H=(function(){var K,V;return((K=t.node)==null?void 0:K.originalCode)!=null||((V=t.node)==null?void 0:V.updatedCode)!=null})();if(a.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:z?(function(K){const V=[];let J=1;for(const[fe,oe]of K.entries())if(oe.startsWith("@@"))V.push(Pt(lt({},d(oe,"hunk")),{key:`inline-hunk-${fe}`,number:""}));else if(p(oe))V.push(Pt(lt({},d(oe.slice(1),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${fe}`,number:""}));else if(g(oe))V.push(Pt(lt({},d(oe.slice(1),"added",{preserveBlankKind:!0})),{key:`inline-added-${fe}`,number:J++}));else{const ce=oe.startsWith(" ")?oe.slice(1):oe;V.push(Pt(lt({},d(ce)),{key:`inline-context-${fe}`,number:J})),J++}return V})(i.value):b((S=t.node)==null?void 0:S.originalCode,(L=t.node)==null?void 0:L.updatedCode)}];if(!z&&H){const K=f((R=t.node)==null?void 0:R.originalCode),V=f((D=t.node)==null?void 0:D.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:K.map((J,fe)=>{const oe=V[fe]===J?"context":"removed";return Pt(lt({},d(J,oe,{preserveBlankKind:h(K,fe)})),{key:`original-${fe}`,number:fe+1})})},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:V.map((J,fe)=>{const oe=K[fe]===J?"context":"added";return Pt(lt({},d(J,oe,{preserveBlankKind:h(V,fe)})),{key:`modified-${fe}`,number:fe+1})})}]}const U=[],Z=[];for(const K of i.value)if(K.startsWith("@@"))U.push(d(K,"hunk")),Z.push(d(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))U.push(d(K.slice(1),"removed",{preserveBlankKind:!0}));else if(K.startsWith("+")&&!K.startsWith("+++"))Z.push(d(K.slice(1),"added",{preserveBlankKind:!0}));else{const V=K.startsWith(" ")?K.slice(1):K;U.push(d(V)),Z.push(d(V))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:U.map((K,V)=>Pt(lt({},K),{key:`original-${V}`,number:V+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:Z.map((K,V)=>Pt(lt({},K),{key:`modified-${V}`,number:V+1}))}]}),m=B(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),y=X(null),k=X([]);let A=null,$=null;function N(S){const L=Number.parseFloat(String(S??""));return Number.isFinite(L)&&L>0?L:0}function x(S,L){var R;if(!S)return L;const D=S.querySelector(".markstream-pre__diff-content"),z=D?.getBoundingClientRect(),H=(R=z?.height)!=null?R:0;return Math.max(L,Math.ceil(H))}function I(){typeof window<"u"&&(A!=null&&window.cancelAnimationFrame(A),A=window.requestAnimationFrame(()=>{(function(){var S,L;A=null;const R=y.value;if(!R||!l.value)return void(k.value.length&&(k.value=[]));const D=(function(J){const fe=window.getComputedStyle(J),oe=N(fe.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const ce=N(fe.lineHeight);return ce>0?ce:18})(R),z=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),H=Array.from(R.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),U=Math.max(z.length,H.length),Z=[];for(let J=0;J<U;J++){const fe=x((S=z[J])!=null?S:null,D),oe=x((L=H[J])!=null?L:null,D),ce=Math.max(D,fe,oe);Z.push({rowHeight:ce,originalHeight:fe,modifiedHeight:oe})}var K,V;K=k.value,V=Z,K.length===V.length&&K.every((J,fe)=>{const oe=V[fe];return oe&&Math.abs(J.rowHeight-oe.rowHeight)<=.5&&Math.abs(J.originalHeight-oe.originalHeight)<=.5&&Math.abs(J.modifiedHeight-oe.modifiedHeight)<=.5})||(k.value=Z)})()}))}function E(S){$?.disconnect(),$=null,S&&l.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{I()}),$.observe(S))}function F(S,L){const R=k.value[S];if(!R)return;const D=L==="original"?R.originalHeight:R.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(R.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(D)}px`}}return Qe(y,S=>{E(S),mt(()=>I())},{flush:"post"}),Qe([l,v],()=>{E(y.value),mt(()=>I())},{flush:"post",immediate:!0}),po(()=>{A!=null&&(window.cancelAnimationFrame(A),A=null),$?.disconnect(),$=null}),(S,L)=>(w(),T("pre",{ref_key:"preRef",ref:y,style:Yt(c.value),class:We([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":l.value,"markstream-pre--diff-inline":a.value}]),"aria-busy":e.node.loading===!0,"aria-label":m.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[l.value?(w(),T("code",LX,[(w(!0),T(Pe,null,ot(v.value,R=>(w(),T("span",{key:R.key,class:We(["markstream-pre__diff-pane",R.className])},[(w(!0),T(Pe,null,ot(R.lines,(D,z)=>(w(),T("span",{key:D.key,class:We(["markstream-pre__diff-line",[`markstream-pre__diff-line--${D.kind}`,{"markstream-pre__diff-line--empty":D.empty}]]),style:Yt(F(z,R.key))},[L[0]||(L[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",$X,O(D.number),1),_("span",FX,[_("span",OX,O(D.code),1)])],6))),128))],2))),128))])):(w(),T(Pe,{key:1},[t.showLineNumbers?(w(),T("span",RX,[(w(!0),T(Pe,null,ot(r.value,R=>(w(),T("span",{key:R,class:"markstream-pre__line-number"},O(R),1))),128))])):ae("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:O(s.value)},null,8,BX)],64))],14,IX))}});qs.install=e=>{e.component(qs.__name,qs)};const q0=Ba(!1);let DS=null;const DX={key:0},ro=gn(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(DS||(DS=kk().then(v=>{q0.value=!!v}).catch(()=>{q0.value=!1})),Wh(q0)),o=Vd(),s=Kt("markstreamFade",void 0),i=Kt("markstreamTextStreamState",void 0),r=Kt("markstreamStreamVersion",void 0),l=B(()=>{const v=o.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=B(()=>typeof l.value=="boolean"?l.value:typeof s?.value!="boolean"||s.value),c=B(()=>{var v;const m=(v=o["index-key"])!=null?v:o.indexKey;return m==null||m===""?"":String(m)}),u=X(t.node.content),d=X("");let f=r?.value;const h=X(0);function p(){return u.value+d.value}function g(){d.value&&(u.value=p(),d.value="")}Qe([()=>t.node.content,c,a,()=>r?.value],([v,m,y,k])=>{const A=String(v??""),$=c.value,N=k!==f;f=k;const x=IM({nextContent:A,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:N});u.value=x.settledContent,d.value=x.streamedDelta,x.appended&&(h.value+=1),$&&i?.set($,A)},{immediate:!0}),Qe(a,v=>{var m;v||(m=p(),u.value=m,d.value="")});const b=B(()=>h.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(v,m)=>(w(),T("span",{class:We([[C(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(w(),T("span",DX,O(u.value),1)):ae("",!0),d.value?(w(),T("span",{key:1,class:We(["text-node-stream-delta",[b.value]]),onAnimationend:g},O(d.value),35)):ae("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);ro.install=e=>{e.component(ro.__name,ro)};const KM=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var o;return mn(qs,Pt(lt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(o=n.estimatedHeightPx)!=null?o:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),j0=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./CodeBlockNode-BZ3nIcUJ.js"),__vite__mapDeps([4,5,6]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),qs}}),loadingComponent:KM,delay:0,suspensible:!1}),Pi=Li(()=>Xn(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 mn(ro,Pt(lt({},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{if(yield kk())return(yield ms(()=>import("./index6-BXVNgB_e.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 mn(ro,Pt(lt({},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:""}$`}}))}})),GM=Li(()=>Xn(null,null,function*(){try{if(yield kk())return(yield ms(()=>import("./index5-D6hAiKdZ.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 mn(ro,Pt(lt({},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:""}$$`}}))}})),ys=gn(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(w(),T("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))},O(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);ys.install=e=>{e.component(ys.__name,ys)};const PX={class:"superscript-node"},Fs=gn(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sup",PX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Fs.install=e=>{e.component(Fs.__name,Fs)};const HX={class:"subscript-node"},Os=gn(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,footnote_reference:Zs,strikethrough:bs,highlight:Xs,insert:Rs,superscript:Fs,emoji:$s,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("sub",HX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Os.install=e=>{e.component(Os.__name,Os)};const WX={class:"strong-node"},ks=gn(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("strong",WX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);ks.install=e=>{e.component(ks.__name,ks)};const zX={class:"strikethrough-node"},bs=gn(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("del",zX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);bs.install=e=>{e.component(bs.__name,bs)};const UX=["href","title","aria-label","aria-hidden","target","rel"],qX=["aria-hidden"],jX={class:"link-text-wrapper relative inline-flex"},VX={class:"leading-[normal] link-text"},xs=gn(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Kt("markstreamShowTooltips",void 0),o=B(()=>{const v=n?.value;return typeof v=="boolean"?v:t.showTooltip}),s=B(()=>{var v,m,y,k,A;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",N=(v=t.animationOpacity)!=null?v:.35,x=Math.max(.12,Math.min(.5*N,N)),I={"--underline-height":`${(m=t.underlineHeight)!=null?m:2}px`,"--underline-bottom":$,"--underline-opacity":String(N),"--underline-rest-opacity":String(x),"--underline-duration":`${(y=t.animationDuration)!=null?y:1.6}s`,"--underline-timing":(k=t.animationTiming)!=null?k:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(A=t.animationIteration)!=null?A:"infinite"};return t.color&&(I["--link-color"]=t.color),I}),i=Co(()=>t.customId),r=B(()=>lt({text:ro,strong:ks,strikethrough:bs,emphasis:ws,image:Al,html_inline:Qs,inline_code:ts},i.value)),l=Vd(),a=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.attrs;if(!y||typeof y!="object")return{};const k={};if(Array.isArray(y))for(const A of y)Array.isArray(A)&&A[0]&&(k[String(A[0])]=String((m=A[1])!=null?m:""));else for(const[A,$]of Object.entries(y))A&&$!=null&&$!==!1&&(k[A]=$===!0?"":String($));return IS(k,"safe","a")}),c=B(()=>lt(lt({},l),a.value)),u=B(()=>{var v,m;return IS({href:String((m=(v=t.node)==null?void 0:v.href)!=null?m:"")},"safe","a").href}),d=B(()=>{if(!u.value)return;const v=c.value.target;return(typeof v=="string"?v.trim():String(v??"").trim())||(RV(u.value)?"_blank":void 0)}),f=B(()=>{var v;return String((v=d.value)!=null?v:"").trim().toLowerCase()==="_blank"}),h=B(()=>{if(!u.value)return;const v=c.value.rel,m=new Set((typeof v=="string"?v:String(v??"")).split(/\s+/).filter(Boolean)),y=new Set(Array.from(m).filter(k=>k.toLowerCase()!=="opener"));return f.value&&(y.add("noopener"),y.add("noreferrer")),y.size>0?Array.from(y).join(" "):void 0}),p=B(()=>{const v=lt({},c.value);return delete v.title,delete v.href,delete v.target,delete v.rel,v});function g(){o.value&&xX()}const b=B(()=>{var v,m;const y=(v=t.node)==null?void 0:v.title;return typeof y=="string"&&y.trim().length>0?y:String((m=u.value)!=null?m:"")});return(v,m)=>{var y,k;return e.node.loading?(w(),T("span",yn({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},C(l),{style:s.value}),[_("span",jX,[_("span",VX,[re(C(ro),{class:"leading-[normal] link-text",node:{type:"text",content:String((y=e.node.text)!=null?y:""),raw:String((k=e.node.text)!=null?k:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),m[1]||(m[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,qX)):(w(),T("a",yn({key:0,class:"link-node",href:u.value,title:o.value?"":b.value,"aria-label":`Link: ${b.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},p.value,{style:s.value,onMouseenter:m[0]||(m[0]=A=>(function($){var N,x,I,E;if(!o.value)return;const F=$,S=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,L=((N=t.node)==null?void 0:N.title)||((x=u.value)!=null&&x.includes("xn--")&&((E=(I=t.node)==null?void 0:I.text)!=null&&E.includes("://"))?t.node.text:u.value)||"";bX($.currentTarget,L,"top",!1,S)})(A)),onMouseleave:g}),[(w(!0),T(Pe,null,ot(e.node.children,(A,$)=>(w(),xe(C(lr),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:A,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,UX))}}}),[["__scopeId","data-v-367e6ca4"]]);xs.install=e=>{e.component(xs.__name,xs)};const KX={class:"insert-node"},Rs=gn(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("ins",KX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Rs.install=e=>{e.component(Rs.__name,Rs)};const GX={class:"highlight-node"},Xs=gn(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("mark",GX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const YX={class:"emphasis-node"},ws=gn(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>lt({text:ro,inline_code:ts,link:xs,html_inline:Qs,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,footnote_reference:Zs,math_inline:Pi,reference:ys},n.value));return(s,i)=>(w(),T("em",YX,[(w(!0),T(Pe,null,ot(e.node.children,(r,l)=>(w(),xe(C(lr),{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"]]);ws.install=e=>{e.component(ws.__name,ws)};const ZX={class:"hard-break"},Ml=gn(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(w(),T("br",ZX))}),[["__scopeId","data-v-50c58f70"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const Dd=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=pt({checkbox:Ys,checkbox_input:Ys,emoji:$s,emphasis:ws,hardbreak:Ml,highlight:Xs,inline_code:ts,insert:Rs,link:xs,reference:ys,strikethrough:bs,strong:ks,subscript:Os,superscript:Fs,text:ro}),o=Co(()=>t.customId),s=B(()=>{const i=o.value;return Object.keys(i).length>0?lt(lt({},n),i):n});return(i,r)=>(w(!0),T(Pe,null,ot(e.nodes,(l,a)=>(w(),xe(C(lr),{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 Lv(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(Lv)}function Np(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Lv))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(Lv)?s:null}function eu(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 QX=["cite"],XX={key:0,dir:"auto",class:"paragraph-node"},JX=["custom-id"],Th=gn(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Co(()=>t.customId),o=B(()=>!!n.value.paragraph),s=B(()=>!!n.value.text),i=B(()=>Np(t.node.children,!o.value)),r=B(()=>t.fade!==!1||s.value?null:eu(i.value));return Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade)),(l,a)=>(w(),T("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(w(),T("p",XX,[r.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(r.value),9,JX)):(w(),xe(C(Dd),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(w(),xe(C(Bs),{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,QX))}}),[["__scopeId","data-v-abfecebc"]]);Th.install=e=>{e.component(Th.__name,Th)};const eJ={class:"definition-list"},tJ={class:"definition-term"},nJ={class:"definition-desc"},Nh=gn(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("dl",eJ,[(w(!0),T(Pe,null,ot(t.node.items,(s,i)=>(w(),T(Pe,{key:i},[_("dt",tJ,[re(C(Bs),{"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"])]),_("dd",nJ,[re(C(Bs),{"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"]]);Nh.install=e=>{e.component(Nh.__name,Nh)};const oJ=["href","title"],dd=gn(Ze({__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)=>(w(),T("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,oJ))}}),[["__scopeId","data-v-e1eb37b6"]]);dd.install=e=>{e.component(dd.__name,dd)};const sJ=["id"],iJ={class:"flex-1"},Ih=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,o)=>(w(),T("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",iJ,[re(C(Bs),{"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,sJ))}});Ih.install=e=>{e.component(Ih.__name,Ih)};const rJ=["custom-id"],$v=gn(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamFade",void 0),s=B(()=>o?.value!==!1||n.value.text?null:eu(t.node.children)),i=B(()=>lt({text:ro,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,footnote_reference:Zs,hardbreak:Ml,math_inline:Pi,reference:ys},n.value));return(r,l)=>(w(),xe(jo(`h${e.node.level}`),yn({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:Ee(()=>[s.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(s.value),9,rJ)):(w(!0),T(Pe,{key:1},ot(e.node.children,(a,c)=>(w(),xe(C(lr),{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"]]),Ip=$v;Ip.install=e=>{e.component($v.__name,$v)};const lJ={key:0,dir:"auto",class:"paragraph-node"},aJ=["custom-id"],cJ={dir:"auto",class:"paragraph-node"},uJ=["custom-id"],Uc=gn(Ze({__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=B(()=>{var h;return(h=t.node)!=null?h:t.item}),o=Co(()=>t.customId),s=B(()=>!!o.value.paragraph),i=B(()=>!!o.value.text),r=B(()=>{var h;return Np((h=n.value)==null?void 0:h.children,!s.value)}),l=B(()=>{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 g=p[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const b=p.slice(1);if(!b.every(m=>m?.type==="list"))return null;const v=Np([g]);return v?{paragraphChildren:v,nestedLists:b}:null});function a(){return t.fade===!1&&!i.value}const c=B(()=>a()?eu(r.value):null),u=B(()=>{var h;return a()?eu((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=B(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade)),(h,p)=>{var g,b;return w(),T("li",yn({class:"list-item",dir:"auto"},f.value),[r.value?(w(),T("p",lJ,[c.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(c.value),9,aJ)):(w(),xe(C(Dd),{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?(w(),T(Pe,{key:1},[_("p",cJ,[u.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(u.value),9,uJ)):(w(),xe(C(Dd),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(w(!0),T(Pe,null,ot(l.value.nestedLists,(v,m)=>(w(),xe(C(Bs),{key:m,nodes:[v],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${m}`,"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]=y=>h.$emit("copy",y))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(w(),xe(C(Bs),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(b=(g=n.value)==null?void 0:g.children)!=null?b:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:p[1]||(p[1]=v=>h.$emit("copy",v))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Uc.install=e=>{e.component(Uc.__name,Uc)};const qc=gn(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Co(()=>e.customId),n=B(()=>t.value.list_item||Uc);return(o,s)=>(w(),xe(jo(e.node.ordered?"ol":"ul"),{class:We(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:Ee(()=>[(w(!0),T(Pe,null,ot(e.node.items,(i,r)=>{var l;return w(),xe(jo(n.value),yn({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"]]);qc.install=e=>{e.component(qc.__name,qc)};const YM=Symbol("ViewportPriority");function dJ(e,t){var n,o;const s=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?X(t):t,r=s?(n=window.requestIdleCallback)!=null?n:m=>window.setTimeout(()=>m({didTimeout:!0,timeRemaining:()=>0}),16):null,l=s?(o=window.cancelIdleCallback)!=null?o:m=>window.clearTimeout(m):null;let a=null,c=null;const u=new Map,d=new Set;let f=null;function h(){if(f!=null){try{l?.(f)}catch{}f=null}}function p(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||h()}}function g(m){const y=u.get(m);if(y){if(!y.visible.value){y.visible.value=!0;try{y.resolve()}catch{}}try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()}}function b(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&f==null&&d.size&&(f=r(()=>{f=null;const m=d.values().next().value;m&&(d.delete(m),g(m),d.size&&b())},{timeout:1200}))}Qe(i,m=>{if(!m){for(const y of Array.from(u.keys()))g(y);h()}},{flush:"sync"});const v=(m,y)=>{const k=X(!1);let A,$=!1;const N=new Promise(E=>{A=()=>{$||($=!0,E())}}),x=()=>{try{a?.unobserve(m)}catch{}u.delete(m),d.delete(m),p()};if(!s||!i.value)return k.value=!0,A(),{isVisible:k,whenVisible:N,destroy:x};const I=(function(E,F){if(!s)return a;if(typeof IntersectionObserver>"u")return null;const S=(function(D,z){var H,U,Z;return{root:(H=e?.(D??null))!=null?H:null,rootMargin:(U=z?.rootMargin)!=null?U:"300px",threshold:(Z=z?.threshold)!=null?Z:0}})(E,F);if(a&&(R=S,(L=c)&&L.root===R.root&&L.rootMargin===R.rootMargin&&L.threshold===R.threshold))return a;var L,R;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(D=>{for(const z of D)(z.isIntersecting||z.intersectionRatio>0)&&g(z.target)},{root:S.root,rootMargin:S.rootMargin,threshold:S.threshold}),c=S;for(const D of u.keys())a.observe(D);return a})(m,y);return I?(u.set(m,{resolve:A,visible:k}),I.observe(m),d.add(m),b(),{isVisible:k,whenVisible:N,destroy:x}):(k.value=!0,A(),{isVisible:k,whenVisible:N,destroy:x})};return Ln(YM,v),v}function fJ(){var e,t;const n=Kt(YM,void 0);if(n)return n;const o=new WeakMap;let s=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:f=>window.setTimeout(()=>f({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:f=>window.clearTimeout(f):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=f=>{const h=o.get(f);if(h){if(!h.visible.value){h.visible.value=!0;try{h.resolve()}catch{}}try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()}},d=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&i.size&&(r=l(()=>{r=null;const f=i.values().next().value;f&&(i.delete(f),u(f),i.size&&d())},{timeout:1200}))};return f=>{const h=X(!1);let p,g=!1;const b=new Promise(y=>{p=()=>{g||(g=!0,y())}}),v=()=>{try{s?.unobserve(f)}catch{}o.delete(f),i.delete(f),i.size||c()},m=s||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(s=new IntersectionObserver(y=>{for(const k of y)(k.isIntersecting||k.intersectionRatio>0)&&u(k.target)},{root:null,rootMargin:"300px",threshold:0}),s));return m?(o.set(f,{resolve:p,visible:h}),m.observe(f),i.add(f),d(),{isVisible:h,whenVisible:b,destroy:v}):(h.value=!0,p(),{isVisible:h,whenVisible:b,destroy:v})}}const hJ={key:2,class:"html-block-node__raw"},pJ=["innerHTML"],mJ={key:1,class:"html-block-node__placeholder"},fd=gn(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Kt("markstreamHtmlPolicy",void 0),o=Kt("markstreamNestedRendererProps",void 0),s=B(()=>{var $,N;return(N=($=t.htmlPolicy)!=null?$:n?.value)!=null?N:"safe"}),i=B(()=>{var $,N;const x=($=o?.value)!=null?$:{};return Pt(lt({},x),{customId:(N=t.customId)!=null?N:x.customId,htmlPolicy:s.value})}),r=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1}),l=B(()=>{const $=vv(t.node.attrs,s.value);if(!$)return;const N=Ap($);return Object.keys(N).length>0?N:void 0}),a=B(()=>{const $=String(t.node.tag||"").trim(),N=vv(t.node.attrs,s.value,$);if(!N)return;const x=Ap(N);return Object.keys(x).length>0?x:void 0}),c=Co(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=X(null),f=X(typeof window>"u"),h=X(t.node.content),p=B(()=>Array.isArray(t.node.children)?t.node.children:[]),g=B(()=>String(t.node.tag||"div")),b=B(()=>{const $=g.value.trim().toLowerCase();return F6.has($)||hk($,s.value)}),v=B(()=>p.value.length>0&&!!t.node.tag&&!b.value),m=B(()=>{var $,N,x;if(v.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:($=h.value)!=null?$:""};const I=(N=h.value)!=null?N:t.node.content;if(!I)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:zc(I,s.value)};if(t.node.loading){const F=Tp(I,c.value,s.value);return F===null?{mode:"text",content:(x=t.node.raw)!=null?x:I}:{mode:"dynamic",nodes:F}}if(!jM(I,c.value))return{mode:"html",content:zc(I,s.value)};const E=Tp(I,c.value,s.value);return E===null?{mode:"html",content:zc(I,s.value)}:{mode:"dynamic",nodes:E}}),y=fJ(),k=X(null),A=!!t.node.loading;return typeof window<"u"?(Qe(d,$=>{var N,x;if((x=(N=k.value)==null?void 0:N.destroy)==null||x.call(N),k.value=null,!A)return f.value=!0,void(h.value=t.node.content);if(!$)return void(f.value=!1);const I=y($,{rootMargin:"400px"});k.value=I,f.value=I.isVisible.value,I.whenVisible.then(()=>{f.value=!0})},{immediate:!0}),Qe(()=>t.node.content,$=>{A&&!f.value||(h.value=$)})):f.value=!0,po(()=>{var $,N;(N=($=k.value)==null?void 0:$.destroy)==null||N.call($),k.value=null}),($,N)=>(w(),xe(jo(v.value?g.value:"div"),yn({ref_key:"htmlRef",ref:d,class:"html-block-node"},v.value?a.value:void 0),{default:Ee(()=>[f.value?(w(),T(Pe,{key:0},[m.value.mode==="structured"?(w(),xe(C(r),yn({key:0},i.value,{nodes:p.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):m.value.mode==="dynamic"?(w(),xe(C(u),{key:1,nodes:m.value.nodes},null,8,["nodes"])):m.value.mode==="text"?(w(),T("pre",hJ,O(m.value.content),1)):(w(),T("div",yn({key:3},l.value,{innerHTML:m.value.content}),null,16,pJ))],64)):(w(),T("div",mJ,[On($.$slots,"placeholder",{node:e.node},()=>[N[0]||(N[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),N[1]||(N[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),N[2]||(N[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);fd.install=e=>{e.component(fd.__name,fd)};const gJ={dir:"auto",class:"paragraph-node"},vJ=["custom-id"],Ma=gn(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Co(()=>t.customId),o=Kt("markstreamHtmlPolicy",void 0),s=Kt("markstreamFade",void 0),i=Kt("markstreamParseOptions",void 0),r=Kt("markstreamCustomMarkdownIt",void 0),l=Kt("markstreamNestedRendererProps",void 0),a=B(()=>{var x;return(x=o?.value)!=null?x:"safe"}),c=B(()=>{var x;return(x=t.parseOptions)!=null?x:i?.value}),u=B(()=>{var x;return(x=t.customMarkdownIt)!=null?x:r?.value}),d=B(()=>{var x,I;return(I=t.customHtmlTags)!=null?I:(x=l?.value)==null?void 0:x.customHtmlTags}),f=B(()=>{var x,I;const E=(x=l?.value)!=null?x:{};return Pt(lt({},E),{customId:(I=t.customId)!=null?I:E.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),h=Li({loader:()=>Promise.resolve().then(()=>Nk),suspensible:!1});function p(x){var I;return x.type==="text"&&String((I=x.content)!=null?I:"").trim()===""}const g=B(()=>t.node.children.filter(x=>!p(x))),b=B(()=>g.value.length>0&&g.value.every(x=>x.type==="image"||(function(I){var E;const F=(function(S){return S.type==="link"&&Array.isArray(S.children)?S.children.filter(L=>!p(L)):[]})(I);return F.length===1&&((E=F[0])==null?void 0:E.type)==="image"})(x))),v=B(()=>new Set(ru(d.value))),m=B(()=>{if(!b.value||g.value.length<=1)return t.node.children;const x=[];for(let I=0;I<t.node.children.length;I++){const E=t.node.children[I];if(!p(E)){x.push(E);continue}const F=x.length>0,S=t.node.children.slice(I+1).some(L=>!p(L));F&&S&&x.push(Pt(lt({},E),{content:" ",raw:" "}))}return x}),y=B(()=>s?.value===!1&&!n.value.text),k=B(()=>y.value?eu(m.value):null);function A(x,I){return{node:x,"index-key":`${t.indexKey}-${I}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=B(()=>lt({inline_code:ts,image:Al,link:xs,hardbreak:Ml,emphasis:ws,strong:ks,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,html_inline:Qs,html_block:fd,emoji:$s,checkbox:Ys,math_inline:Pi,checkbox_input:Ys,reference:ys,footnote_anchor:dd,footnote_reference:Zs,text:ro},n.value)),N=B(()=>m.value.map((x,I)=>{var E;const F=(function(S){var L,R,D,z;if(S.type==="html_block"||S.type==="html_inline"){const H=String((L=S.tag)!=null?L:"").trim().toLowerCase()||D6(S.content);if(H&&!v.value.has(H)&&P6((R=S.content)!=null?R:S.raw,H)){const U=String((z=(D=S.content)!=null?D:S.raw)!=null?z:"");return{child:{type:"text",content:U,raw:U},component:ro,isCustomComponent:!1}}}return{child:S,component:$.value[S.type],isCustomComponent:!!(n.value[S.type]&&!ef(String(S.type)))}})(x);return Pt(lt({},F),{index:I,key:`${t.indexKey||"paragraph"}-${I}`,customAttrs:F.isCustomComponent?_k(F.child,a.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((E=F.child.content)!=null?E:""),originalChild:x})}));return(x,I)=>(w(),T("p",gJ,[k.value!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(k.value),9,vJ)):(w(!0),T(Pe,{key:1},ot(N.value,E=>{return w(),T(Pe,{key:E.key},[b.value&&p(E.originalChild)?(w(),T(Pe,{key:0},[Je(O((F=E.originalChild,String((S=F.content)!=null?S:""))),1)],64)):E.isCustomComponent?(w(),xe(jo(E.component),yn({key:1,ref_for:!0},E.customAttrs,{node:E.child,loading:E.child.loading,"index-key":E.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:Ee(()=>[E.hasSlotChildren?(w(),xe(C(h),yn({key:0,ref_for:!0},f.value,{nodes:E.child.children,"index-key":E.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):E.slotContent?(w(),xe(C(h),yn({key:1,ref_for:!0},f.value,{content:E.slotContent,final:!E.child.loading,"index-key":`${E.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(w(),xe(jo(E.component),yn({key:2,ref_for:!0},A(E.child,E.index)),null,16))],64);var F,S}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Ma.install=e=>{e.component(Ma.__name,Ma)};const yJ={class:"table-node-wrapper"},kJ=["aria-busy"],bJ={key:0},xJ=["custom-id"],wJ=["aria-label","onPointerdown"],_J=["custom-id"],SJ={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},hd=gn(Ze({__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=B(()=>{var v;return(v=t.node.loading)!=null&&v}),o=B(()=>{var v;return(v=t.node.rows)!=null?v:[]}),s=X(null),i=X([]);let r=null;const l=B(()=>t.node.header.cells.length),a=B(()=>i.value.some(v=>Number.isFinite(v)&&v>0)),c=B(()=>a.value?i.value.map(v=>v>0?{width:`${v}px`}:void 0):[]);Ln("markstreamShowTooltips",B(()=>t.showTooltips)),Ln("markstreamFade",B(()=>t.fade));const u=Co(()=>t.customId),d=B(()=>!!u.value.text),f=B(()=>!!u.value.paragraph),h=new WeakMap;function p(v){const m=t.fade===!1&&!d.value,y=!f.value,k=h.get(v);if(k?.children===v.children&&k.textFastPath===m&&k.paragraphFastPath===y)return k.info;const A=Np(v.children,y,!0),$={simpleChildren:A,plainText:A&&m?eu(A):null};return h.set(v,{children:v.children,textFastPath:m,paragraphFastPath:y,info:$}),$}function g(v){if(!r)return;v.preventDefault();const m=r.startWidth+r.nextStartWidth,y=Math.min(48,Math.floor(m/2)),k=Math.max(y,Math.min(m-y,Math.round(r.startWidth+v.clientX-r.startX))),A=[...r.widths];A[r.index]=k,A[r.index+1]=m-k,i.value=A}function b(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),r=null)}return Qe(l,()=>{b(),i.value=[]}),po(b),(v,m)=>(w(),T("div",yJ,[_("table",{ref_key:"tableRef",ref:s,class:We(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(w(),T("colgroup",bJ,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("col",{key:k,style:Yt(c.value[k])},null,4))),128))])):ae("",!0),_("thead",null,[_("tr",null,[(w(!0),T(Pe,null,ot(e.node.header.cells,(y,k)=>(w(),T("th",{key:k,dir:"auto",class:We([y.align==="right"?"text-right":y.align==="center"?"text-center":"text-left"])},[p(y).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(y).plainText),9,xJ)):p(y).simpleChildren?(w(),xe(C(Dd),{key:1,nodes:p(y).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${k}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{key:2,nodes:y.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:m[0]||(m[0]=A=>v.$emit("copy",A))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),k<e.node.header.cells.length-1?(w(),T("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${k+1} and ${k+2}`,onPointerdown:A=>(function($,N){if(N.button!==0)return;const x=(function(){var F;const S=(F=s.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(S??[],L=>Math.round(L.getBoundingClientRect().width))})(),I=x[$],E=x[$+1];I&&E&&(N.preventDefault(),r={index:$,startX:N.clientX,startWidth:I,nextStartWidth:E,widths:x},i.value=x,window.addEventListener("pointermove",g),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",b))})(k,A)},null,40,wJ)):ae("",!0)],2))),128))])]),_("tbody",null,[(w(!0),T(Pe,null,ot(o.value,(y,k)=>(w(),T("tr",{key:k},[(w(!0),T(Pe,null,ot(y.cells,(A,$)=>(w(),T("td",{key:$,class:We([A.align==="right"?"text-right":A.align==="center"?"text-center":"text-left"]),dir:"auto"},[p(A).plainText!==null?(w(),T("span",{key:0,class:"text-node","custom-id":t.customId},O(p(A).plainText),9,_J)):p(A).simpleChildren?(w(),xe(C(Dd),{key:1,nodes:p(A).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${k}-${$}`},null,8,["nodes","custom-id","index-key"])):(w(),xe(C(Bs),{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:m[1]||(m[1]=N=>v.$emit("copy",N))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,kJ),re(Il,{name:"table-node-fade"},{default:Ee(()=>[n.value?(w(),T("div",SJ,[On(v.$slots,"loading",{isLoading:n.value},()=>[m[2]||(m[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),m[3]||(m[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):ae("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);hd.install=e=>{e.component(hd.__name,hd)};const CJ={class:"hr-node"},Lh=gn({},[["render",function(e,t){return w(),T("hr",CJ)}],["__scopeId","data-v-39b2349c"]]);Lh.install=e=>{e.component(Lh.__name,Lh)};const AJ={class:"unknown-node"},Fv=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(w(),T("div",AJ,O(e.node.raw),1))}),$h=gn(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=B(()=>`vmr-container vmr-container-${t.node.name}`),o=Co(()=>t.customId),s=B(()=>lt({text:ro,paragraph:Ma,heading:Ip,inline_code:ts,link:xs,image:Al,strong:ks,emphasis:ws,strikethrough:bs,insert:Rs,subscript:Os,superscript:Fs,checkbox:Ys,checkbox_input:Ys,hardbreak:Ml,math_inline:Pi,reference:ys,list:qc,math_block:GM,table:hd},o.value));return(i,r)=>(w(),T("div",yn({class:n.value},e.node.attrs),[(w(!0),T(Pe,null,ot(e.node.children,(l,a)=>{return w(),xe(jo((c=l.type,s.value[c]||Fv)),{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"]]);$h.install=e=>{e.component($h.__name,$h)};const MJ=["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"],PS=[[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 EJ(e){if(e<=255)return MJ[e];let t=0,n=PS.length-1;for(;t<=n;){const o=t+n>>1,s=PS[o];if(e<s[0])n=o-1;else{if(!(e>s[1]))return s[2];t=o+1}}return"L"}const TJ=/[ \t\n\r\f]+/g,NJ=/[\t\n\r\f]| {2,}|^ | $/;let V0=null;const IJ=new RegExp("\\p{Script=Arabic}","u"),Dm=new RegExp("\\p{M}","u"),ZM=new RegExp("\\p{Nd}","u");function HS(e){return IJ.test(e)}function WS(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Rr(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(WS(o-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(WS(n))return!0}}return!1}const LJ=new Set([" "," ","⁠","\uFEFF"]);function $J(e){return Rr(e)}function Ov(e){return!(function(t){const n=Lp(t);return n!==null&&(Sk.has(n)||Ia.has(n))})(e)&&!(function(t){const n=Lp(t);return n!==null&&LJ.has(n)})(e)}const Sk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Pm=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ck=new Set(["'","’"]),Ia=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),FJ=new Set([":",".","،","؛"]),OJ=new Set(["၏"]),RJ=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function BJ(e){if(Ak(e))return!0;let t=!1;for(const n of e)if(Ia.has(n))t=!0;else if(!t||!Dm.test(n))return!1;return t}function DJ(e){for(const t of e)if(!Sk.has(t)&&!Ia.has(t))return!1;return e.length>0}function PJ(e){if(Ak(e))return!0;for(const t of e)if(!Pm.has(t)&&!Ck.has(t)&&!Dm.test(t))return!1;return e.length>0}function Ak(e){let t=!1;for(const n of e)if(n!=="\\"&&!Dm.test(n)){if(!(Pm.has(n)||Ia.has(n)||Ck.has(n)))return!1;t=!0}return t}function QM(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 Lp(e){if(e.length===0)return null;const t=QM(e,e.length);return e.slice(t)}function HJ(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(Dm.test(o))n--;else{if(!Pm.has(o)&&!Ck.has(o))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function WJ(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function zS(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 US(e,t){return e&&t!==null&&FJ.has(t)}function zJ(e){const t=Lp(e);return t!==null&&OJ.has(t)}function UJ(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 Rv(e){let t=e.length;for(;t>0;){const n=QM(e,t),o=e.slice(n,t);if(RJ.has(o))return!0;if(!Ia.has(o))return!1;t=n}return!1}function qJ(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
272
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const jJ=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function di(e){return e.length===1?e[0]:e.join("")}function VJ(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),di(n)}function KJ(e,t,n,o){if(!jJ.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=qJ(u,o),f=d==="text"&&t;i===null||d!==i||f!==a?(i!==null&&s.push({text:di(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:di(r),isWordLike:a,kind:i,start:l}),s}function K0(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const GJ=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function YJ(e,t){const n=e.texts[t];return!!n.startsWith("www.")||GJ.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function ZJ(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const QJ=new Set([":","-","/","×",",",".","+","–","—"]),qS=/^[A-Za-z0-9_]+[,:;]*$/,jS=/[,:;]+$/;function VS(e){for(const t of e)if(ZM.test(t))return!0;return!1}function Fh(e){if(e.length===0)return!1;for(const t of e)if(!ZM.test(t)&&!QJ.has(t))return!1;return!0}function KS(e,t,n){var o,s,i;const r=(V0===null&&(V0=new Intl.Segmenter(void 0,{granularity:"word"})),V0);let l=0;const a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[],v=[],m=[],y=[];for(const x of r.segment(e))for(const I of KJ(x.segment,(o=x.isWordLike)!=null&&o,x.index,n)){let E=function(){h[U]!==null&&(c[U]=[zS(a,h,p,U)],h[U]=null),c[U].push(I.text),u[U]=u[U]||I.isWordLike,g[U]=g[U]||L,b[U]=b[U]||R,v[U]=z,m[U]=H,y[U]=US(b[U],D)};const F=I.kind==="text",S=WJ(I.text,I.isWordLike,I.kind),L=Rr(I.text),R=HS(I.text),D=Lp(I.text),z=Rv(I.text),H=zJ(I.text),U=l-1;t.carryCJKAfterClosingQuote&&F&&l>0&&d[U]==="text"&&L&&g[U]&&v[U]||F&&l>0&&d[U]==="text"&&DJ(I.text)&&g[U]||F&&l>0&&d[U]==="text"&&m[U]?E():F&&l>0&&d[U]==="text"&&I.isWordLike&&R&&y[U]?(E(),u[U]=!0):S!==null&&l>0&&d[U]==="text"&&h[U]===S?p[U]=((s=p[U])!=null?s:1)+1:F&&!I.isWordLike&&l>0&&d[U]==="text"&&(BJ(I.text)||I.text==="-"&&u[U])?E():(a[l]=I.text,c[l]=[I.text],u[l]=I.isWordLike,d[l]=I.kind,f[l]=I.start,h[l]=S,p[l]=S===null?0:1,g[l]=L,b[l]=R,v[l]=z,m[l]=H,y[l]=US(R,D),l++)}for(let x=0;x<l;x++)h[x]===null?a[x]=di(c[x]):a[x]=zS(a,h,p,x);for(let x=1;x<l;x++)d[x]==="text"&&!u[x]&&Ak(a[x])&&d[x-1]==="text"&&(a[x-1]+=a[x],u[x-1]=u[x-1]||u[x],a[x]="");const k=Array.from({length:l},()=>null);let A=-1;for(let x=l-1;x>=0;x--){const I=a[x];if(I.length!==0){if(d[x]==="text"&&!u[x]&&PJ(I)&&A>=0&&d[A]==="text"){const E=(i=k[A])!=null?i:[];E.push(I),k[A]=E,f[A]=f[x],a[x]="";continue}A=x}}for(let x=0;x<l;x++){const I=k[x];I!=null&&(a[x]=VJ(I,a[x]))}let $=0;for(let x=0;x<l;x++){const I=a[x];I.length!==0&&($!==x&&(a[$]=I,u[$]=u[x],d[$]=d[x],f[$]=f[x]),$++)}a.length=$,u.length=$,d.length=$,f.length=$;const N=(function(x){const I=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let L=0;L<I.length-1;L++){if(F[L]!=="text"||F[L+1]!=="text"||!Rr(I[L])||!Rr(I[L+1]))continue;const R=HJ(I[L]);R!==null&&(I[L]=R.head,I[L+1]=R.tail+I[L+1],S[L+1]=S[L]+R.head.length)}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=[],E=[],F=[],S=[];for(let L=0;L<x.len;L++){const R=x.texts[L],D=x.kinds[L],z=x.isWordLike[L];if(D==="text"&&z&&qS.test(R)){const H=[R];let U=jS.test(R),Z=L+1;for(;U&&Z<x.len&&x.kinds[Z]==="text"&&x.isWordLike[Z]&&qS.test(x.texts[Z]);){const K=x.texts[Z];H.push(K),U=jS.test(K),Z++}I.push(di(H)),E.push(!0),F.push("text"),S.push(x.starts[L]),L=Z-1;continue}I.push(R),E.push(z),F.push(D),S.push(x.starts[L])}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=[],E=[],F=[],S=[];for(let L=0;L<x.len;L++){const R=x.texts[L];if(x.kinds[L]==="text"&&R.includes("-")){const D=R.split("-");let z=D.length>1;for(let H=0;H<D.length;H++){const U=D[H];if(!z)break;U.length!==0&&VS(U)&&Fh(U)||(z=!1)}if(z){let H=0;for(let U=0;U<D.length;U++){const Z=D[U],K=U<D.length-1?`${Z}-`:Z;I.push(K),E.push(!0),F.push("text"),S.push(x.starts[L]+H),H+=K.length}continue}}I.push(R),E.push(x.isWordLike[L]),F.push(x.kinds[L]),S.push(x.starts[L])}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=[],E=[],F=[],S=[];for(let L=0;L<x.len;L++){const R=x.texts[L],D=x.kinds[L];if(D==="text"&&Fh(R)&&VS(R)){const z=[R];let H=L+1;for(;H<x.len&&x.kinds[H]==="text"&&Fh(x.texts[H]);)z.push(x.texts[H]),H++;I.push(di(z)),E.push(!0),F.push("text"),S.push(x.starts[L]),L=H-1;continue}I.push(R),E.push(x.isWordLike[L]),F.push(D),S.push(x.starts[L])}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=[],E=[],F=[],S=[];for(let L=0;L<x.len;L++){const R=x.texts[L];if(I.push(R),E.push(x.isWordLike[L]),F.push(x.kinds[L]),S.push(x.starts[L]),!ZJ(R))continue;const D=L+1;if(D>=x.len||K0(x.kinds[D]))continue;const z=[],H=x.starts[D];let U=D;for(;U<x.len&&!K0(x.kinds[U]);)z.push(x.texts[U]),U++;z.length>0&&(I.push(di(z)),E.push(!0),F.push("text"),S.push(H),L=U-1)}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=x.texts.slice(),E=x.isWordLike.slice(),F=x.kinds.slice(),S=x.starts.slice();for(let R=0;R<x.len;R++){if(F[R]!=="text"||!YJ(x,R))continue;const D=[I[R]];let z=R+1;for(;z<x.len&&!K0(F[z]);){D.push(I[z]),E[R]=!0;const H=I[z].includes("?");if(F[z]="text",I[z]="",z++,H)break}I[R]=di(D)}let L=0;for(let R=0;R<I.length;R++){const D=I[R];D.length!==0&&(L!==R&&(I[L]=D,E[L]=E[R],F[L]=F[R],S[L]=S[R]),L++)}return I.length=L,E.length=L,F.length=L,S.length=L,{len:L,texts:I,isWordLike:E,kinds:F,starts:S}})((function(x){const I=[],E=[],F=[],S=[];let L=0;for(;L<x.len;){const R=[x.texts[L]];let D=x.isWordLike[L],z=x.kinds[L],H=x.starts[L];if(z==="glue"){const U=[R[0]],Z=H;for(L++;L<x.len&&x.kinds[L]==="glue";)U.push(x.texts[L]),L++;const K=di(U);if(!(L<x.len&&x.kinds[L]==="text")){I.push(K),E.push(!1),F.push("glue"),S.push(Z);continue}R[0]=K,R.push(x.texts[L]),D=x.isWordLike[L],z="text",H=Z,L++}else L++;if(z==="text")for(;L<x.len&&x.kinds[L]==="glue";){const U=[];for(;L<x.len&&x.kinds[L]==="glue";)U.push(x.texts[L]),L++;const Z=di(U);L<x.len&&x.kinds[L]==="text"?(R.push(Z,x.texts[L]),D=D||x.isWordLike[L],L++):R.push(Z)}I.push(di(R)),E.push(D),F.push(z),S.push(H)}return{len:I.length,texts:I,isWordLike:E,kinds:F,starts:S}})({len:$,texts:a,isWordLike:u,kinds:d,starts:f})))))));for(let x=0;x<N.len-1;x++){const I=UJ(N.texts[x]);I!==null&&(N.kinds[x]!=="space"&&N.kinds[x]!=="preserved-space"||N.kinds[x+1]!=="text"||!HS(N.texts[x+1])||(N.texts[x]=I.space,N.isWordLike[x]=!1,N.kinds[x]=N.kinds[x]==="preserved-space"?"preserved-space":"space",N.texts[x+1]=I.marks+N.texts[x+1],N.starts[x+1]=N.starts[x]+I.space.length))}return N}function XJ(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}let lc=null;const GS=new Map;let ac=null;const JJ=new RegExp("\\p{Emoji_Presentation}","u"),eee=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let G0=null;const YS=new Map;function Bv(){if(lc!==null)return lc;if(typeof OffscreenCanvas<"u")return lc=new OffscreenCanvas(1,1).getContext("2d"),lc;if(typeof document<"u")return lc=document.createElement("canvas").getContext("2d"),lc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function ll(e,t){let n=t.get(e);return n===void 0&&(n={width:Bv().measureText(e).width,containsCJK:Rr(e)},t.set(e,n)),n}function Hm(){if(ac!==null)return ac;if(typeof navigator>"u")return ac={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},ac;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 ac={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},ac}function XM(){return G0===null&&(G0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),G0}function tee(e){return JJ.test(e)||e.includes("️")}function la(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=XM();for(const a of l.segment(i))tee(a.segment)&&r++;return r})(o)),s.emojiCount})(e,t)*n}function nee(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function oee(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function ZS(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i}=e;if(o.length===0)return 0;const r=t+Hm().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,f=-1,h=0;function p(k=u,A=d,$=a){l++,a=0,c=!1,f=-1,h=0}function g(k,A){c=!0,u=k+1,d=0,a=A}function b(k,A,$){c=!0,u=k,d=A+1,a=$}function v(k,A){c?(a+=A,u=k+1,d=0):g(k,A)}function m(k,A){const $=i[k];for(let N=A;N<$.length;N++){const x=$[N];c?a+x>r?(p(),b(k,N,x)):(a+=x,u=k,d=N+1):b(k,N,x)}c&&u===k&&d===$.length&&(u=k+1,d=0)}let y=0;for(;y<o.length&&(c||(y=nee(e,y),!(y>=o.length)));){const k=o[y],A=s[y],$=A==="space"||A==="preserved-space"||A==="tab"||A==="zero-width-break"||A==="soft-hyphen";if(c)if(a+k>r){if($){v(y,k),p(y+1,0,a-k),y++;continue}if(f>=0){if(u>f||u===f&&d>0){p();continue}p(f,0,h);continue}if(k>t&&i[y]!==null){p(),m(y,0),y++;continue}p()}else v(y,k),$&&(f=y+1,h=a-k),y++;else k>t&&i[y]!==null?m(y,0):g(y,k),$&&(f=y+1,h=a-k),y++}return c&&p(),l}let Y0=null;function see(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=Rv(d),l=Pm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Rv(d);r=d.length===1&&Ia.has(d)&&r||h,l=!1}for(const d of(Y0===null&&(Y0=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Y0).segment(e)){const f=d.segment,h=Rr(f);o.length!==0?l||Sk.has(f)||Ia.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 iee(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],o=e[0].start,s=Rr(e[0].text),i=Ov(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:o})}for(let l=1;l<e.length;l++){const a=e[l],c=Rr(a.text),u=Ov(a.text);s&&i?(n.push(a.text),s=s||c,i=u):(r(),n=[a.text],o=a.start,s=c,i=u)}return r(),t}function ree(e,t,n,o){const s=Hm(),{cache:i,emojiCorrection:r}=(function(N,x){Bv().font=N;const I=(function(S){let L=GS.get(S);return L||(L=new Map,GS.set(S,L)),L})(N),E=(function(S){const L=S.match(/(\d+(?:\.\d+)?)\s*px/);return L?parseFloat(L[1]):16})(N),F=x?(function(S,L){let R=YS.get(S);if(R!==void 0)return R;const D=Bv();D.font=S;const z=D.measureText("😀").width;if(R=0,z>L+.5&&typeof document<"u"&&document.body!==null){const H=document.createElement("span");H.style.font=S,H.style.display="inline-block",H.style.visibility="hidden",H.style.position="absolute",H.textContent="😀",document.body.appendChild(H);const U=H.getBoundingClientRect().width;document.body.removeChild(H),z-U>.5&&(R=z-U)}return YS.set(S,R),R})(N,E):0;return{cache:I,fontSize:E,emojiCorrection:F}})(t,(l=e.normalized,eee.test(l)));var l;const a=la("-",ll("-",i),r),c=8*la(" ",ll(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],f=[],h=[];let p=e.chunks.length<=1;const g=null,b=[],v=n?[]:null,m=Array.from({length:e.len});function y(N,x,I,E,F,S,L){F!=="text"&&F!=="space"&&F!=="zero-width-break"&&(p=!1),u.push(x),d.push(I),f.push(E),h.push(F),b.push(L),v!==null&&v.push(N)}function k(N,x,I,E,F){const S=ll(N,i),L=la(N,S,r),R=x==="space"||x==="preserved-space"||x==="zero-width-break"?0:L,D=x==="space"||x==="zero-width-break"?0:L;if(F&&E&&N.length>1){let z="sum-graphemes";Fh(N)?z="pair-context":s.preferPrefixWidthsForBreakableRuns&&(z="segment-prefixes");const H=(function(U,Z,K,V,J){if(Z.breakableFitAdvances!==void 0)return Z.breakableFitAdvances;const fe=XM(),oe=[];for(const Te of fe.segment(U))oe.push(Te.segment);if(oe.length<=1)return Z.breakableFitAdvances=null,Z.breakableFitAdvances;if(J==="sum-graphemes"){const Te=[];for(const Ae of oe){const P=ll(Ae,K);Te.push(la(Ae,P,V))}return Z.breakableFitAdvances=Te,Z.breakableFitAdvances}if(J==="pair-context"||oe.length>96){const Te=[];let Ae=null,P=0;for(const le of oe){const ne=la(le,ll(le,K),V);if(Ae===null)Te.push(ne);else{const q=Ae+le,ee=ll(q,K);Te.push(la(q,ee,V)-P)}Ae=le,P=ne}return Z.breakableFitAdvances=Te,Z.breakableFitAdvances}const ce=[];let ue="",Se=0;for(const Te of oe){ue+=Te;const Ae=la(ue,ll(ue,K),V);ce.push(Ae-Se),Se=Ae}return Z.breakableFitAdvances=ce,Z.breakableFitAdvances})(N,S,i,r,z);return void y(N,L,R,D,x,I,H)}y(N,L,R,D,x,I,null)}for(let N=0;N<e.len;N++){m[N]=u.length;const x=e.texts[N],I=e.isWordLike[N],E=e.kinds[N],F=e.starts[N];if(E==="soft-hyphen"){y(x,0,a,a,E,F,null);continue}if(E==="hard-break"){y(x,0,0,0,E,F,null);continue}if(E==="tab"){y(x,0,0,0,E,F,null);continue}const S=ll(x,i);if(E==="text"&&S.containsCJK){const L=see(x,s),R=o==="keep-all"?iee(L):L;for(let D=0;D<R.length;D++){const z=R[D];k(z.text,"text",F+z.start,I,o==="keep-all"||!Rr(z.text))}continue}k(x,E,F,I,!0)}const A=(function(N,x,I){const E=[];for(let F=0;F<N.length;F++){const S=N[F],L=S.startSegmentIndex<x.length?x[S.startSegmentIndex]:I,R=S.endSegmentIndex<x.length?x[S.endSegmentIndex]:I,D=S.consumedEndSegmentIndex<x.length?x[S.consumedEndSegmentIndex]:I;E.push({startSegmentIndex:L,endSegmentIndex:R,consumedEndSegmentIndex:D})}return E})(e.chunks,m,u.length),$=g===null?null:(function(N,x){const I=(function(F){const S=F.length;if(S===0)return null;const L=new Array(S);let R=!1;for(let K=0;K<S;){const V=F.charCodeAt(K);let J=V,fe=1;if(V>=55296&&V<=56319&&K+1<S){const ce=F.charCodeAt(K+1);ce>=56320&&ce<=57343&&(J=ce-56320+(V-55296<<10)+65536,fe=2)}const oe=EJ(J);oe!=="R"&&oe!=="AL"&&oe!=="AN"||(R=!0);for(let ce=0;ce<fe;ce++)L[K+ce]=oe;K+=fe}if(!R)return null;let D=0;for(let K=0;K<S;K++){const V=L[K];if(V==="L"){D=0;break}if(V==="R"||V==="AL"){D=1;break}}const z=new Int8Array(S);for(let K=0;K<S;K++)z[K]=D;const H=1&D?"R":"L",U=H;let Z=U;for(let K=0;K<S;K++)L[K]==="NSM"?L[K]=Z:Z=L[K];Z=U;for(let K=0;K<S;K++){const V=L[K];V==="EN"?L[K]=Z==="AL"?"AN":"EN":V!=="R"&&V!=="L"&&V!=="AL"||(Z=V)}for(let K=0;K<S;K++)L[K]==="AL"&&(L[K]="R");for(let K=1;K<S-1;K++)L[K]==="ES"&&L[K-1]==="EN"&&L[K+1]==="EN"&&(L[K]="EN"),L[K]!=="CS"||L[K-1]!=="EN"&&L[K-1]!=="AN"||L[K+1]!==L[K-1]||(L[K]=L[K-1]);for(let K=0;K<S;K++){if(L[K]!=="EN")continue;let V;for(V=K-1;V>=0&&L[V]==="ET";V--)L[V]="EN";for(V=K+1;V<S&&L[V]==="ET";V++)L[V]="EN"}for(let K=0;K<S;K++){const V=L[K];V!=="WS"&&V!=="ES"&&V!=="ET"&&V!=="CS"||(L[K]="ON")}Z=U;for(let K=0;K<S;K++){const V=L[K];V==="EN"?L[K]=Z==="L"?"L":"EN":V!=="R"&&V!=="L"||(Z=V)}for(let K=0;K<S;K++){if(L[K]!=="ON")continue;let V=K+1;for(;V<S&&L[V]==="ON";)V++;const J=(K>0?L[K-1]:U)!=="L"?"R":"L";if(J===((V<S?L[V]:U)!=="L"?"R":"L"))for(let fe=K;fe<V;fe++)L[fe]=J;K=V-1}for(let K=0;K<S;K++)L[K]==="ON"&&(L[K]=H);for(let K=0;K<S;K++){const V=L[K];1&z[K]?V!=="L"&&V!=="AN"&&V!=="EN"||z[K]++:V==="R"?z[K]++:V!=="AN"&&V!=="EN"||(z[K]+=2)}return z})(N);if(I===null)return null;const E=new Int8Array(x.length);for(let F=0;F<x.length;F++)E[F]=I[x[F]];return E})(e.normalized,g);return v!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A,segments:v}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:f,kinds:h,simpleLineWalkFastPath:p,segLevels:$,breakableFitAdvances:b,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:A}}function lee(e,t,n){return(function(o,s,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return ree((function(c,u,d="normal",f="normal"){const h=(function(b){const v=b??"normal";return v==="pre-wrap"?{mode:v,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:v,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),p=h.mode==="pre-wrap"?(function(b){return/[\r\f]/.test(b)?b.replace(/\r\n/g,`
273
- `).replace(/[\r\f]/g,`
274
- `):b.replace(/\r\n/g,`
275
- `)})(c):(function(b){if(!NJ.test(b))return b;let v=b.replace(TJ," ");return v.charCodeAt(0)===32&&(v=v.slice(1)),v.length>0&&v.charCodeAt(v.length-1)===32&&(v=v.slice(0,-1)),v})(c);if(p.length===0)return{normalized:p,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const g=f==="keep-all"?(function(b){if(b.len<=1)return b;const v=[],m=[],y=[],k=[];let A=null,$=!1,N=0,x=!1,I=!1;function E(){A!==null&&(v.push(di(A)),m.push($),y.push("text"),k.push(N),A=null)}for(let F=0;F<b.len;F++){const S=b.texts[F],L=b.kinds[F],R=b.isWordLike[F],D=b.starts[F];if(L==="text"){const z=$J(S),H=Ov(S);if(A!==null&&x&&I){A.push(S),$=$||R,x=x||z,I=H;continue}E(),A=[S],$=R,N=D,x=z,I=H;continue}E(),v.push(S),m.push(R),y.push(L),k.push(D)}return E(),{len:v.length,texts:v,isWordLike:m,kinds:y,starts:k}})(KS(p,u,h)):KS(p,u,h);return lt({normalized:p,chunks:XJ(g,h)},g)})(o,Hm(),r?.whiteSpace,a),s,!1,a)})(e,t,0,n)}const Z0="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",Eo=(()=>{const e=globalThis;if(e[Z0])return e[Z0];const t={configs:{},controllers:{},revision:Ba(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Z0]=t,t})();let Bu=null;const QS=Eo.revision;function XS(e){var t;return e&&(t=Eo.configs[e])!=null?t:null}function JS(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function aee(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Q0(e){var t,n,o;if(!Array.isArray(e)||e.length===0)return null;let s="";for(const i of e){if(!aee(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+=`
276
- `)}return s.length>0?s:null}function X0(e,t,n){var o,s;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(Bu!=null)return Bu;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bu=!!((i=r.getContext)!=null&&i.call(r,"2d")),Bu}catch{return Bu=!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=Eo.blockEstimateCache.get(r);if(l)return Eo.blockEstimateCache.delete(r),Eo.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,g){const b=`${g}\0${p}\0${h}`,v=Eo.preparedCache.get(b);if(v)return Eo.preparedCache.delete(b),Eo.preparedCache.set(b,v),v.prepared;const m=lee(h,p,{whiteSpace:g});for(Eo.preparedCache.set(b,{prepared:m});Eo.preparedCache.size>240;){const y=Eo.preparedCache.keys().next().value;if(!y)break;Eo.preparedCache.delete(y)}return m})(e,n.font,a),u=(function(h,p,g){const b=(function(v,m){return v.simpleLineWalkFastPath?ZS(v,m):(function(y,k){if(y.simpleLineWalkFastPath)return ZS(y,k);const{widths:A,lineEndFitAdvances:$,lineEndPaintAdvances:N,kinds:x,breakableFitAdvances:I,discretionaryHyphenWidth:E,tabStopAdvance:F,chunks:S}=y;if(A.length===0||S.length===0)return 0;const L=Hm(),R=L.lineFitEpsilon,D=k+R;let z=0,H=0,U=!1,Z=0,K=0,V=-1,J=0,fe=0,oe=null;function ce(){V=-1,J=0,fe=0,oe=null}function ue(ee=Z,ge=K,de=H){z++,H=0,U=!1,ce()}function Se(ee,ge){U=!0,Z=ee+1,K=0,H=ge}function Te(ee,ge,de){U=!0,Z=ee,K=ge+1,H=de}function Ae(ee,ge){U?(H+=ge,Z=ee+1,K=0):Se(ee,ge)}function P(ee,ge,de,ve){if(!ge)return;const j=ee==="tab"?0:$[de],te=ee==="tab"?ve:N[de];V=de+1,J=H-ve+j,fe=H-ve+te,oe=ee}function le(ee,ge){const de=I[ee];for(let ve=ge;ve<de.length;ve++){const j=de[ve];U?H+j>D?(ue(),Te(ee,ve,j)):(H+=j,Z=ee,K=ve+1):Te(ee,ve,j)}U&&Z===ee&&K===de.length&&(Z=ee+1,K=0)}function ne(ee){if(oe!=="soft-hyphen")return!1;const ge=I[ee];if(ge==null)return!1;const{fitCount:de,fittedWidth:ve}=(function(j,te,pe,Ce,$e){let De=0,me=te;for(;De<j.length;){const Ie=me+j[De];if((De+1<j.length?Ie+$e:Ie)>pe+Ce)break;me=Ie,De++}return{fitCount:De,fittedWidth:me}})(ge,H,k,R,E);return de!==0&&(H=ve,Z=ee,K=de,ce(),de===ge.length?(Z=ee+1,K=0,!0):(ue(ee,de,ve+E),le(ee,de),!0))}function q(ee){z++,ce()}for(let ee=0;ee<S.length;ee++){const ge=S[ee];if(ge.startSegmentIndex===ge.endSegmentIndex){q();continue}U=!1,H=0,ge.startSegmentIndex,Z=ge.startSegmentIndex,K=0,ce();let de=ge.startSegmentIndex;for(;de<ge.endSegmentIndex;){const ve=x[de],j=ve==="space"||ve==="preserved-space"||ve==="tab"||ve==="zero-width-break"||ve==="soft-hyphen",te=ve==="tab"?oee(H,F):A[de];if(ve!=="soft-hyphen")if(U){if(H+te>D){const pe=H+(ve==="tab"?0:$[de]),Ce=H+(ve==="tab"?te:N[de]);if(oe==="soft-hyphen"&&L.preferEarlySoftHyphenBreak&&J<=D){ue(V,0,fe);continue}if(oe==="soft-hyphen"&&ne(de)){de++;continue}if(j&&pe<=D){Ae(de,te),ue(de+1,0,Ce),de++;continue}if(V>=0&&J<=D){if(Z>V||Z===V&&K>0){ue();continue}const $e=V;ue($e,0,fe),de=$e;continue}if(te>k&&I[de]!==null){ue(),le(de,0),de++;continue}ue();continue}Ae(de,te),P(ve,j,de,te),de++}else te>k&&I[de]!==null?le(de,0):Se(de,te),P(ve,j,de,te),de++;else U&&(Z=de+1,K=0,V=de+1,J=H+E,fe=H+E,oe=ve),de++}if(U){const ve=V===ge.consumedEndSegmentIndex?fe:H;ue(ge.consumedEndSegmentIndex,0,ve)}}return z})(v,m)})(h,p);return{lineCount:b,height:b*g}})(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(Eo.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Eo.blockEstimateCache.size>4e3;){const h=Eo.blockEstimateCache.keys().next().value;if(!h)break;Eo.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function JM(e,t,n){var o,s;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Q0(e.children);return i&&n.paragraph?X0(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Q0(e.children),l=n.headings[i];return r&&l?X0(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=Q0((s=i[0])==null?void 0:s.children);return r?X0(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=JM(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 oh(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function cee(e,t){var n;if(!e||e.type!=="code_block")return null;const o=t.rendererKind,s=t.showHeader!==!1,i=(function(u){var d,f,h;return u.diff?Math.max(oh(String((d=u.originalCode)!=null?d:"")),oh(String((f=u.updatedCode)!=null?f:"")),oh(String((h=u.code)!=null?h:""))):oh((function(p,g){const b=String(p??"");return g?b:b.replace(/\r\n$|\n$|\r$/,"")})(u.code,u.loading===!0))})(e),r=!!e.diff;let l=0,a=500;if(o==="monaco"){const u=(n=t.monacoOptions)!=null?n:{},d=(function(h,p){const g=typeof h?.fontSize=="number"&&h.fontSize>0?h.fontSize:p?13:12;return typeof h?.lineHeight=="number"&&h.lineHeight>0?h.lineHeight:p?30:Math.round(1.5*g)})(u,r),f=(function(h,p){var g,b;if(!p)return 0;const v=typeof((g=h?.padding)==null?void 0:g.top)=="number"?h.padding.top:10,m=typeof((b=h?.padding)==null?void 0:b.bottom)=="number"?h.padding.bottom:22;return Math.max(0,v)+Math.max(0,m)})(u,r);a=typeof u.MAX_HEIGHT=="number"&&u.MAX_HEIGHT>0?u.MAX_HEIGHT:500,l=Math.round(r?i*d+f:i*(d+1.5))}else o==="markdown"?l=Math.round(21*i+32):(l=Math.round(21*i+32),a=Number.POSITIVE_INFINITY);const c=Math.max(1,Math.min(l,a));return{kind:"code-block",height:Math.round(c+(s?40:0)),contentHeight:c,rendererKind:o}}function uee(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function J0(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const o=window.getComputedStyle(t),s=e.offsetHeight,i=JS(o.lineHeight,1.5*JS(o.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:uee(o),lineHeight:i,wrapperOverhead:Math.max(0,s-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const dee=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function eC(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))dee.has(r)||s.has(r)||l.enumerable&&"value"in l&&(o[r]=l.value);return o}const fee=!1;function k_e(){return fee}function tC(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)}const e5=Symbol("MarkstreamMathBlockMinHeightCache");function b_e(){return Kt(e5,null)}const hee=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],pee=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],mee=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),t5=["raw","content","code","originalCode","updatedCode"],nC=new WeakMap,oC=new WeakMap;let gee=1;function Ti(){return typeof performance<"u"?performance.now():Date.now()}function sC(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function gi(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=nC.get(t);return n||(n=gee++,nC.set(t,n)),String(n)}function iC(e,t,n,o={}){var s,i;const r=o.includeFinal!==!1,l={md:gi(t),customMarkdownIt:gi(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(s=e.customHtmlTags)!=null?s:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:gi(e.validateLink),preTransformTokens:gi(e.preTransformTokens),postTransformTokens:gi(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function rC(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
277
- `,t-1)+1;return e.slice(n,t).trim()}function lC(e){const t=n5(e);return t.length>=2&&t.every(n=>{const o=n.trim();return o.length>=1&&o.replace(/^:/,"").replace(/:$/,"").split("").every(s=>s==="-")})}function n5(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function o5(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 Mk(e){const t=String(e??"");return`${t.length}:${o5(t)}`}function Dv(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?Mk(r):`${r.length}:${o5(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${gi(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:${gi(o)}`;const i=gi(o);if(t.set(o,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>Dv(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}:${Dv(r[c],t,n+1)}`).join(";")}`}return typeof e}function $p(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function s5(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(o=>$p(o)?Rl(o,t,n+1):s5(o,t,n+1)).join(",")}`:$p(e)?Rl(e,t,n):Dv(e,t,n)}function vee(e,t,n){return Object.keys(e).sort().filter(o=>o!=="children"&&!t5.includes(o)).map(o=>{const s=e[o];return typeof s=="string"?`${o}=s:${Mk(s)}`:typeof s=="number"||typeof s=="boolean"||s==null?`${o}=${String(s)}`:typeof s=="function"?`${o}=fn:${gi(s)}`:mee.has(o)&&(Array.isArray(s)||typeof s=="object")?`${o}=${s5(s,t,n+1)}`:s&&typeof s=="object"?`${o}=object:${gi(s)}`:""}).filter(Boolean).join(";")}function yee(e){return t5.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Mk(n)}`:""}).filter(Boolean).join(";")}function Rl(e,t=new WeakMap,n=0){const o=oC.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}:${gi(s)}`;const r=gi(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=>Rl(p,c,u+1)).join("|"):"";return[a.type,yee(d),vee(d,c,u),f.length,h].join(":")})(e,t,n);return oC.set(s,l),l}function i5(e,t){return Rl(e)===Rl(t)}function Ek(e,t,n){const o=Ti(),s=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Ti()-o,e[s]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function aC(e,t,n){return Ek(t,n,()=>Rl(e))}function r5(e,t,n){return aC(e,n,"stabilizeSignatureMs")===aC(t,n,"stabilizeSignatureMs")}function eg(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function cC(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function kee(e,t){return e.length===t.length&&e===t}function Tk(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"||!kee(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(!$p(d)||!$p(f))return null;const h=Tk(d,f,n+1);if(h==null)return null;if(!h)return!1}return!0}function bee(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Tk(e,t);return n??i5(e,t)}function xee(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let o=null;return Ek(n,"stabilizeSignatureMs",()=>{o=Tk(e,t)}),o??r5(e,t,n)}function wee(e,t){const n={};for(const o of hee){const s=e[o],i=t?.[o];typeof s=="number"&&(n[o]=s-(typeof i=="number"?i:0))}return n}function _ee(e,t){var n;const o=hS(t.instanceMsgId),s=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:B(()=>!1),r=X(t.renderContent.value);let l,a=[],c="",u="",d="",f=0,h=0,p=Ti();function g(){l&&(clearTimeout(l),l=void 0)}function b(){g();const I=t.renderContent.value;r.value!==I&&(r.value=I),p=Ti()}Qe([t.renderContent,t.effectiveFinal,i],([I,E,F])=>{r.value!==I&&(!F||E||(function(S,L){if(!S&&L||L.length<=80||L.length<S.length||!L.startsWith(S))return!0;const R=L.slice(S.length);return!!R&&(!!lC(rC(L))||!(!R.includes(`
278
-
279
- `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(R))||R.endsWith(`
280
- `)&&!(function(D){const z=rC(D);if(lC(z))return!1;const H=n5(z);return H.length>=2&&H.some(U=>U.trim())})(L))})(r.value,I)?b():(function(){if(h+=1,l)return;const S=Math.max(0,(function(L){const R=L.parseCoalesceMs;return typeof R=="number"&&Number.isFinite(R)&&R>=0?R:80})(e)-(Ti()-p));S<=0?b():l=setTimeout(b,S)})())},{flush:"sync",immediate:!0}),dy(g);const v=B(()=>{var I,E,F,S;return zV(e.customHtmlTags,(I=e.parseOptions)==null?void 0:I.customHtmlTags,(S=(F=(E=t.customComponentsMap)==null?void 0:E.value)!=null?F:{},Object.entries(S).map(([L,R])=>{const D=_i(L);return R==null||!D||ef(D)||$6.has(D)||Qd.has(D)?"":D}).filter(Boolean)))}),m=B(()=>{const{key:I,tags:E}=UV(v.value);if(!I)return o;const F=s.get(I);if(F)return F;const S=hS(t.instanceMsgId,{customHtmlTags:E});return s.set(I,S),S}),y=B(()=>{const I=m.value;return e.customMarkdownIt?e.customMarkdownIt(I):I}),k=B(()=>{var I,E;const F=(I=e.parseOptions)!=null?I:{},S=t.effectiveFinal.value,L=v.value,R=S!=null,D=L.length>0;return R||D||F.streamParse==null?lt(lt(Pt(lt({},F),{streamParse:(E=F.streamParse)==null||E}),R?{final:S}:{}),D?{customHtmlTags:L}:{}):F}),A=B(()=>{var I;return new Set(((I=k.value.customHtmlTags)!=null?I:[]).map(E=>String(E).trim().toLowerCase()).filter(Boolean))}),$=B(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!0})),N=B(()=>iC(k.value,y.value,e.customMarkdownIt,{includeFinal:!1}));Qe([$,N],([I,E],[F,S])=>{F&&(I===F&&E===S||(b(),E!==S&&(a=[],d="")))},{flush:"sync"});const x=B(()=>{var I,E,F,S,L,R,D,z;if((I=e.nodes)!=null&&I.length)return a=[],d="",pt(e.nodes.slice());const H=r.value;if(!H)return a=[],d="",[];const U=t.debugPerformanceEnabled.value,Z=U?Ti():0,K=y.value,V=$.value,J=N.value;c&&V!==c&&(function(ge){var de,ve;(ve=(de=ge.stream)==null?void 0:de.reset)==null||ve.call(de)})(K),u&&J!==u&&(a=[],d="");const fe=a.length>0&&H.startsWith(d)&&J===u,oe=U?sC(K):null,ce=U?{}:void 0,ue=ce?Pt(lt({},k.value),{__timing:ce}):k.value,Se=xM(H,K,ue),Te=U?Ti():0,Ae=U?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let P,le=U?eg(Se.length):void 0,ne=0,q=0;if(fe){const ge=U?Ti():0;if(Ae){const de=(function(ve,j,te){if(!j.length)return{nodes:ve,metrics:eg(ve.length)};const pe=(function(De,me,Ie){const et=Math.min(De.length,me.length);for(let rt=0;rt<et;rt++)if(!xee(me[rt],De[rt],Ie))return rt;return De.length===me.length?-1:et})(ve,j,te);if(pe<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:pe,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const Ce=ve.slice();let $e=pe;for(let De=0;De<pe;De++)Ce[De]=j[De];for(let De=pe;De<ve.length;De++){const me=j[De],Ie=ve[De];me&&r5(me,Ie,te)&&(Ce[De]=me,$e+=1)}return{nodes:Ce,metrics:{reusedNodeCount:$e,dirtyStartIndex:pe,stablePrefixNodeCount:pe,dirtyTailNodeCount:cC(pe,ve,j)}}})(Se,a,Ae);P=de.nodes,le=de.metrics}else{const de=(function(ve,j){if(!j.length)return{nodes:ve,metrics:eg(ve.length)};const te=(function($e,De){const me=Math.min($e.length,De.length);for(let Ie=0;Ie<me;Ie++)if(!bee(De[Ie],$e[Ie]))return Ie;return $e.length===De.length?-1:me})(ve,j);if(te<0)return{nodes:j,metrics:{reusedNodeCount:ve.length,dirtyStartIndex:te,stablePrefixNodeCount:ve.length,dirtyTailNodeCount:0}};const pe=ve.slice();let Ce=te;for(let $e=0;$e<te;$e++)pe[$e]=j[$e];for(let $e=te;$e<ve.length;$e++){const De=j[$e],me=ve[$e];De&&i5(De,me)&&(pe[$e]=De,Ce+=1)}return{nodes:pe,metrics:{reusedNodeCount:Ce,dirtyStartIndex:te,stablePrefixNodeCount:te,dirtyTailNodeCount:cC(te,ve,j)}}})(Se,a);P=de.nodes,le=de.metrics}ne=U?Ti()-ge:0,q=le?.dirtyStartIndex==null||le.dirtyStartIndex<0?P.length:le.dirtyStartIndex}else P=Se;Ae?(function(ge,de,ve=0){for(let j=Math.max(0,ve);j<ge.length;j++)Ek(de,"primeSignatureMs",()=>Rl(ge[j]))})(P,Ae,q):(function(ge,de=0){for(let ve=Math.max(0,de);ve<ge.length;ve++)Rl(ge[ve])})(P,q);const ee=U?Ti()-Te:0;if(f+=1,d=H,c=V,u=J,a=P,U){const ge=sC(K),de=typeof ge?.total=="number"&&ge.total>((E=oe?.total)!=null?E:0);t.logPerf(de?"parse(stream)":"parse(sync)",lt(lt(lt({rendererId:t.instanceMsgId,ms:Math.round(Ti()-Z),nodes:P.length,contentLength:H.length,parseCommitCount:f,parseCoalescedCount:h,nodeReuseMs:ee,signatureMs:(F=Ae?.signatureMs)!=null?F:0,stabilizeSignatureMs:(S=Ae?.stabilizeSignatureMs)!=null?S:0,primeSignatureMs:(L=Ae?.primeSignatureMs)!=null?L:0,signatureCallCount:(R=Ae?.signatureCallCount)!=null?R:0,stabilizeSignatureCallCount:(D=Ae?.stabilizeSignatureCallCount)!=null?D:0,primeSignatureCallCount:(z=Ae?.primeSignatureCallCount)!=null?z:0,stabilizeMs:ne},le??{}),ce?Object.fromEntries(pee.map(ve=>{var j;return[ve,(j=ce[ve])!=null?j:0]})):{}),ge?{streamMode:ge.lastMode,streamDelta:wee(ge,oe),streamStats:ge}:{}))}return pt(P)});return{effectiveCustomHtmlTags:v,effectiveCustomHtmlTagsSet:A,mdBase:m,mdInstance:y,mergedParseOptions:k,parsedNodes:x}}function See(e){const{isClient:t}=e,n=X(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((g=(p=e.shouldTrackVisibleNodeIndices)==null?void 0:p.call(e))!=null&&!g)return;var p,g;const b=n.value,v=b.has(f);if(h){if(v)return;const y=new Set(b);return y.add(f),void(n.value=y)}if(!v)return;const m=new Set(b);m.delete(f),n.value=m})(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 Cee(e={}){const t=X(""),n=X(""),o=X(!1),s=AQ(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=B(()=>Math.max(0,t.value.length-n.value.length)),a=B(()=>l.value===0),c=B(()=>o.value&&a.value);return uy()&&dy(()=>{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 uC=/auto|scroll|overlay/i;function Aee(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return uC.test(t)||uC.test(n)}function Mee(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 Eee=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return Sv((o=Ec(e.estimatedPreviewHeightPx))!=null?o:wv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),mn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),mn("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},()=>mn("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,mn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[mn("div",{class:"absolute inset-0"},[mn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),Tee=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=B(()=>{var n,o;return _v((o=Ec(e.estimatedPreviewHeightPx))!=null?o:xv(String((n=e.node.code)!=null?n:"")))});return()=>mn("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?mn("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)"}},[mn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[mn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),mn("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},()=>mn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[mn("span",{class:"action-icon block"})])))]):null,mn("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)"}},[mn("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"}})])])}}),Nee=["data-custom-id"],Iee={class:"m-0 p-0"},Lee=["data-probe"],$ee=["data-node-index","data-node-type"],l5=gn(Ze(Pt(lt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},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,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","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,i=Yo(),r=Kt("markstreamNestedRendererProps",void 0);function l(M){var W,G;const Y=o[M];return(function(ie){const _e=i?.vnode.props;return!!_e&&(Object.prototype.hasOwnProperty.call(_e,ie)||Object.prototype.hasOwnProperty.call(_e,String(ie).replace(/[A-Z]/g,Me=>`-${Me.toLowerCase()}`)))})(M)?Y:(G=(W=r?.value)==null?void 0:W[M])!=null?G:Y}const a={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:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},c=B(()=>{return(M=l("mode"))==="chat"||M==="minimal"||M==="docs"?M:"docs";var M}),u=B(()=>{const M=l("renderCodeBlocksAsPre"),W=l("codeRenderer");return M===!0?"pre":W==="pre"||W==="shiki"||W==="monaco"?W:M===!1||c.value==="docs"?"monaco":"pre"}),d=B(()=>a[c.value]),f=B(()=>{var M;return(M=l("showTooltips"))!=null?M:d.value.showTooltips}),h=B(()=>{var M;return(M=l("fade"))!=null?M:d.value.fade}),p=B(()=>{var M;return(M=l("batchRendering"))!=null?M:d.value.batchRendering}),g=B(()=>{var M;return(M=l("initialRenderBatchSize"))!=null?M:d.value.initialRenderBatchSize}),b=B(()=>{var M;return(M=l("renderBatchSize"))!=null?M:d.value.renderBatchSize}),v=B(()=>{var M;return(M=l("renderBatchDelay"))!=null?M:d.value.renderBatchDelay}),m=B(()=>{var M;return(M=l("renderBatchBudgetMs"))!=null?M:d.value.renderBatchBudgetMs}),y=B(()=>{var M;return(M=l("renderBatchIdleTimeoutMs"))!=null?M:d.value.renderBatchIdleTimeoutMs}),k=B(()=>{var M;return(M=l("deferNodesUntilVisible"))!=null?M:d.value.deferNodesUntilVisible}),A=B(()=>{var M;return(M=l("maxLiveNodes"))!=null?M:d.value.maxLiveNodes}),$=B(()=>{var M;return(M=l("liveNodeBuffer"))!=null?M:d.value.liveNodeBuffer}),N=B(()=>{var M;return(M=l("nodeVirtual"))!=null?M:d.value.nodeVirtual}),x={get content(){return o.content},get nodes(){return o.nodes},get final(){return o.final},get parseOptions(){return l("parseOptions")},get customMarkdownIt(){return l("customMarkdownIt")},get debugPerformance(){return o.debugPerformance},get customHtmlTags(){return l("customHtmlTags")},get mode(){return l("mode")},get htmlPolicy(){return l("htmlPolicy")},get viewportPriority(){return l("viewportPriority")},get codeBlockStream(){return l("codeBlockStream")},get codeBlockDarkTheme(){return l("codeBlockDarkTheme")},get codeBlockLightTheme(){return l("codeBlockLightTheme")},get codeBlockMonacoOptions(){return l("codeBlockMonacoOptions")},get codeRenderer(){return l("codeRenderer")},get renderCodeBlocksAsPre(){return l("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return l("codeBlockMinWidth")},get codeBlockMaxWidth(){return l("codeBlockMaxWidth")},get codeBlockProps(){return l("codeBlockProps")},get mermaidProps(){return l("mermaidProps")},get d2Props(){return l("d2Props")},get infographicProps(){return l("infographicProps")},get showTooltips(){return f.value},get themes(){return l("themes")},get langs(){return l("langs")},get isDark(){return l("isDark")},get customId(){return l("customId")},get indexKey(){return o.indexKey},get typewriter(){return l("typewriter")},get smoothStreaming(){return o.smoothStreaming},get smoothStreamingOptions(){return l("smoothStreamingOptions")},get parseCoalesceMs(){return l("parseCoalesceMs")},get fade(){return h.value},get batchRendering(){return p.value},get initialRenderBatchSize(){return g.value},get renderBatchSize(){return b.value},get renderBatchDelay(){return v.value},get renderBatchBudgetMs(){return m.value},get renderBatchIdleTimeoutMs(){return y.value},get deferNodesUntilVisible(){return k.value},get maxLiveNodes(){return A.value},get liveNodeBuffer(){return $.value},get nodeVirtual(){return N.value},get virtualScroll(){return o.virtualScroll},get renderAsFragment(){return o.renderAsFragment}};function I(M){s("height-change",M)}function E(M){s("virtual-state-change",M)}function F(M){s("anchor-change",M)}const S=X(),L=X(null),R=X(null),D=X(null),z=Bo({1:null,2:null,3:null,4:null,5:null,6:null}),H=X(!1),U=new Map,Z=X(0),K=X(0),V=X({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function J(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.enabled)!==!0)return null;const G=(W=o.virtualScroll)==null?void 0:W.scrollRoot;return fe(typeof G=="function"?G():G)}function fe(M){return M?typeof HTMLElement<"u"&&M instanceof HTMLElement?M:typeof M=="object"&&"value"in M?fe(M.value):typeof M=="object"&&"$el"in M?fe(M.$el):null:null}const{isClient:oe,renderAsFragment:ce,debugPerformanceEnabled:ue,resolvedShowTooltips:Se,resolvedHtmlPolicy:Te,inheritedSmoothStreaming:Ae,ownsTypewriterCursor:P}=(function(M){const W=typeof window<"u",G=Vd(),Y=Kt("markstreamHtmlPolicy",void 0),ie=Kt("markstreamTypewriterCursor",void 0),_e=Kt("markstreamSmoothStreaming",void 0),Me=B(()=>M.renderAsFragment===!0),Le=B(()=>!!(M.debugPerformance&&W&&typeof console<"u")),qe=B(()=>{var je;if(typeof M.showTooltips=="boolean")return M.showTooltips;const Be=(je=G.showTooltips)!=null?je:G["show-tooltips"];return Be===""||Be===!0||Be==="true"||Be!==!1&&Be!=="false"&&void 0}),Re=B(()=>{var je,Be;return(Be=(je=M.htmlPolicy)!=null?je:Y?.value)!=null?Be:"safe"}),Ge=B(()=>ie?.value!==!0);return{isClient:W,renderAsFragment:Me,debugPerformanceEnabled:Le,resolvedShowTooltips:qe,resolvedHtmlPolicy:Re,inheritedSmoothStreaming:_e,inheritedTypewriterCursor:ie,ownsTypewriterCursor:Ge}})(x),{resolveViewportRoot:le,resolveScrollContainer:ne,isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ge}=(function(M,W){function G(){var Le,qe;return(qe=(Le=W.scrollRoot)==null?void 0:Le.call(W))!=null?qe:null}function Y(Le){if(typeof window>"u")return null;const qe=G();if(qe)return qe;const Re=Le??M.value;if(!Re)return null;const Ge=Re.ownerDocument||document,je=Ge.scrollingElement||Ge.documentElement;let Be=Re;for(;Be&&Be!==Ge.body&&Be!==je;){if(Aee(window.getComputedStyle(Be))&&Mee(Be))return Be;Be=Be.parentElement}return null}function ie(Le){if(!W.isClient)return!1;try{const qe=window.getComputedStyle(Le);return!!(qe.display||"").toLowerCase().includes("flex")&&(qe.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function _e(Le,qe,Re){var Ge,je;if(Re)return Me(qe);const Be=Le.scrollTop;if(!ie(Le))return Be;const Ke=Be<0?-Be:Be;return Math.max(0,((Ge=Le.scrollHeight)!=null?Ge:0)-((je=Le.clientHeight)!=null?je:0))-Ke}function Me(Le){var qe,Re,Ge,je,Be;const Ke=Number((qe=Le.scrollingElement)==null?void 0:qe.scrollTop),tt=Number((Ge=(Re=Le.documentElement)==null?void 0:Re.scrollTop)!=null?Ge:0),nt=Number((Be=(je=Le.body)==null?void 0:je.scrollTop)!=null?Be:0);return Math.max(0,Number.isFinite(Ke)?Ke:0,Number.isFinite(tt)?tt:0,Number.isFinite(nt)?nt:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(Le){var qe,Re,Ge,je;const Be=G();if(Be)return Be;const Ke=Y((qe=Le??M.value)!=null?qe:null);if(Ke)return Ke;const tt=(je=(Ge=Le?.ownerDocument)!=null?Ge:(Re=M.value)==null?void 0:Re.ownerDocument)!=null?je:typeof document<"u"?document:null;return tt?.scrollingElement||tt?.documentElement||null},isReverseFlexScrollRoot:ie,getNormalizedScrollTop:_e,getOffsetTopWithinRoot:function(Le,qe){const Re=qe.ownerDocument||Le.ownerDocument||document;if((function(Ke,tt){return Ke===tt.documentElement||Ke===tt.body||Ke===tt.scrollingElement})(qe,Re))return Le.getBoundingClientRect().top+Me(Re);const Ge=qe.getBoundingClientRect(),je=Le.getBoundingClientRect(),Be=_e(qe,Re,!1);return je.top-Ge.top+Be}}})(S,{isClient:oe,scrollRoot:J});Ln("markstreamShowTooltips",Se),Ln("markstreamHtmlPolicy",Te),Ln("markstreamTypewriter",B(()=>x.typewriter!==!1)),Ln("markstreamFade",B(()=>x.fade!==!1)),Ln("markstreamTypewriterCursor",B(()=>!0)),Ln("markstreamTextStreamState",U),Ln("markstreamStreamVersion",Z),Ln("markstreamParseOptions",B(()=>x.parseOptions)),Ln("markstreamCustomMarkdownIt",B(()=>x.customMarkdownIt));const{smoothStreamingEnabled:de,renderContent:ve,effectiveFinal:j}=(function(M,W){const G=Cee(M.smoothStreamingOptions),Y=B(()=>{var Re,Ge,je;return M.smoothStreaming!==!1&&!((Re=M.nodes)!=null&&Re.length)&&(M.smoothStreaming===!0||!((Ge=W.inheritedSmoothStreaming)!=null&&Ge.value))&&(M.smoothStreaming===!0||M.typewriter===!0||((je=M.maxLiveNodes)!=null?je:0)<=0)}),ie=X(!W.isClient||M.smoothStreaming===!0);cn(()=>{ie.value=!0});const _e=B(()=>ie.value&&Y.value),Me=B(()=>{var Re;return _e.value?G.visible.value:(Re=M.content)!=null?Re:""}),Le=B(()=>{var Re,Ge;const je=(Re=M.parseOptions)!=null?Re:{};return(Ge=M.final)!=null?Ge:je.final}),qe=B(()=>{const Re=Le.value;return _e.value&&Re!=null?!!Re&&G.caughtUp.value:Re});return Qe([()=>M.content,()=>M.nodes,_e,Le],([Re,Ge,je,Be])=>{if(Ge?.length)return void G.reset("");const Ke=Re??"";if(!je)return G.reset(Ke),void(Be&&G.finish({flush:!0}));const tt=G.source.value;Ke?Ke===tt||(Ke.startsWith(tt)?G.enqueue(Ke.slice(tt.length)):G.reset(Ke)):G.reset(""),Be&&G.finish()},{immediate:!0}),{smoothStream:G,smoothStreamingEligible:Y,smoothStreamingEnabled:_e,renderContent:Me,requestedFinal:Le,effectiveFinal:qe}})(x,{isClient:oe,inheritedSmoothStreaming:Ae});Ln("markstreamSmoothStreaming",de);const te=X(!1);let pe="",Ce=!1,$e=null;function De(){oe&&$e!=null&&(window.clearTimeout($e),$e=null)}function me(){te.value=!1,De()}function Ie(M,W){if(!ue.value)return;const G=(function(){if(!ue.value)return null;const Y=It(et),ie=It(rt),_e=Math.max(gt,ie);if(Y<=0&&_e<=0)return null;const Me={total:Y,maxPerFrame:_e,byLabel:(Le=et,Object.fromEntries(Array.from(Le.entries()).sort((qe,Re)=>Re[1]-qe[1]||qe[0].localeCompare(Re[0]))))};var Le;return et.clear(),rt.clear(),gt=0,Me})();console.info(`[markstream-vue][perf] ${M}`,G?Pt(lt({},W),{layoutReads:G}):W)}Qe([ve,()=>o.nodes,j],([M,W,G])=>{const Y=M??"";return W?.length||G===!0?(me(),pe=Y,void(Ce=!0)):Ce?(pe&&Y.length>pe.length&&Y.startsWith(pe)?(te.value=!0,oe&&(De(),$e=window.setTimeout(()=>{var ie;$e=null,j.value===!0||(ie=o.nodes)!=null&&ie.length||(Qa(),te.value=!1,dr())},1200))):(Y.length<pe.length||!Y.startsWith(pe))&&me(),void(pe=Y)):(pe=Y,void(Ce=!0))},{flush:"sync",immediate:!0});const et=new Map,rt=new Map;let _t=!1,gt=0;function It(M){let W=0;for(const G of M.values())W+=G;return W}function Ut(){gt=Math.max(gt,It(rt)),rt.clear(),_t=!1}function ht(M,W){return(function(G){var Y,ie;ue.value&&(et.set(G,((Y=et.get(G))!=null?Y:0)+1),rt.set(G,((ie=rt.get(G))!=null?ie:0)+1),_t||(_t=!0,oe&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(Ut):typeof queueMicrotask!="function"?setTimeout(Ut,0):queueMicrotask(Ut)))})(M),W()}const un=x.customId?`renderer-${x.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,dn=(function(M){const W=new Map;return{scope:M,cache:W,clear:()=>W.clear()}})(un),ns=B(()=>`${un}:${Z.value}`);Ln(e5,dn);const Wt=Co(()=>x.customId),{effectiveCustomHtmlTagsSet:Hn,mergedParseOptions:lo,parsedNodes:it}=_ee(x,{instanceMsgId:un,renderContent:ve,effectiveFinal:j,smoothStreamingEnabled:de,debugPerformanceEnabled:ue,customComponentsMap:Wt,logPerf:Ie});Qe(it,()=>{dn.clear(),Z.value+=1},{immediate:!0});const Gn=B(()=>({customId:x.customId,customHtmlTags:lo.value.customHtmlTags,parseOptions:x.parseOptions,customMarkdownIt:x.customMarkdownIt,htmlPolicy:Te.value,viewportPriority:x.viewportPriority,mode:c.value,codeRenderer:u.value,codeBlockStream:x.codeBlockStream,codeBlockDarkTheme:x.codeBlockDarkTheme,codeBlockLightTheme:x.codeBlockLightTheme,codeBlockMonacoOptions:x.codeBlockMonacoOptions,renderCodeBlocksAsPre:x.renderCodeBlocksAsPre,codeBlockMinWidth:x.codeBlockMinWidth,codeBlockMaxWidth:x.codeBlockMaxWidth,codeBlockProps:x.codeBlockProps,mermaidProps:x.mermaidProps,d2Props:x.d2Props,infographicProps:x.infographicProps,showTooltips:Se.value,themes:x.themes,langs:x.langs,isDark:x.isDark,typewriter:x.typewriter,smoothStreamingOptions:x.smoothStreamingOptions,parseCoalesceMs:x.parseCoalesceMs,fade:x.fade}));Ln("markstreamNestedRendererProps",Gn);const ao=B(()=>it.value),Yn=B(()=>it.value.length),go=X(null),os=X(null),qn=X(null),to=X(null),vn=o.indexKey!=null&&String(o.indexKey).startsWith("list-item-"),Zn=!vn&&x.customId?XS(x.customId):null,xn=B(()=>Zn?(QS.value,XS(x.customId)):null),An=B(()=>{var M;return!!(oe&&!ce.value&&x.customId&&!vn&&((M=xn.value)!=null&&M.enabled))}),Mn=B(()=>{var M;return!!(!ce.value&&((M=o.virtualScroll)!=null&&M.enabled))}),Do=X(!1);cn(()=>{Do.value=!0});const ze=B(()=>!!(oe&&Mn.value));Ln("markstreamHostScrollManaged",ze);const Xe=B(()=>!!(Do.value&&ze.value)),kt=B(()=>An.value||ze.value),Ht=B(()=>An.value||Xe.value),Rn=B(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.textEstimation)!==!1}),sn=B(()=>{var M;return kt.value&&((M=xn.value)==null?void 0:M.codeBlockEstimation)!==!1});function Gt(){const M=K.value||ht("getMeasuredContainerWidth.clientWidth",()=>{var W;return((W=S.value)==null?void 0:W.clientWidth)||0});return Number.isFinite(M)&&M>0?M:0}const Wn=B(()=>{const M=Gt();return M>0?Math.max(1,Math.round(M)):640}),En=B(()=>{var M;return Math.max(1,(M=x.maxLiveNodes)!=null?M:320)}),St=B(()=>{var M;return!ce.value&&x.nodeVirtual!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&(x.nodeVirtual===!0?it.value.length>0:it.value.length>En.value)}),Po=B(()=>St.value||An.value||ze.value),Ao=B(()=>x.viewportPriority!==!1&&!H.value),ss=dJ(M=>{var W;return le((W=M??S.value)!=null?W:null)},Ao),{requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,isTestEnv:ti}=(function(M){const W=M.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,G=M.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=M.isClient&&typeof window.requestIdleCallback=="function",ie=(function(){var _e;if(typeof globalThis>"u"||!("process"in globalThis))return;const Me=(_e=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:_e.value;return Me?.env})();return{requestFrame:W,cancelFrame:G,hasIdleCallback:Y,isTestEnv:ie?.NODE_ENV==="test"}})({isClient:oe}),{resolvedBatchSize:Io,resolvedInitialBatch:Ss,batchingEnabled:Wi,incrementalRenderingActive:Si,renderedCount:co,previousRenderContext:ni,adaptiveBatchSize:Ci,previousBatchConfig:ar}=(function(M,W){var G;const Y=B(()=>{var je;const Be=Math.trunc((je=M.renderBatchSize)!=null?je:80);return Number.isFinite(Be)?Math.max(0,Be):0}),ie=B(()=>{var je;const Be=Math.trunc((je=M.initialRenderBatchSize)!=null?je:Y.value);return Number.isFinite(Be)?Math.max(0,Be):Y.value}),_e=B(()=>!W.renderAsFragment.value&&M.batchRendering!==!1&&Y.value>0&&W.isClient&&!W.isTestEnv),Me=X(0),Le=X({key:M.indexKey,total:0}),qe=X(Math.max(1,Y.value||1)),Re=B(()=>{var je;return _e.value&&((je=M.maxLiveNodes)!=null?je:0)<=0}),Ge=X({batchSize:Y.value,initial:ie.value,delay:(G=M.renderBatchDelay)!=null?G:16,enabled:Re.value});return{resolvedBatchSize:Y,resolvedInitialBatch:ie,batchingEnabled:_e,incrementalRenderingActive:Re,renderedCount:Me,previousRenderContext:Le,adaptiveBatchSize:qe,previousBatchConfig:Ge}})(x,{isClient:oe,isTestEnv:ti,renderAsFragment:ce}),no=new Map,is=new Map,rs=new WeakMap;let Lo=null;const Ai=new WeakMap,zn=new Map,$o=X(0),oi=B(()=>($o.value,Array.from(no.entries()).sort((M,W)=>M[0]-W[0]))),Ue=X(null),Fe=X(null);let se=null,Ne=0,he=null;const{activeRestoreAnchor:we,getRelativeScrollTopWithinContainer:He,setRelativeScrollTopWithinContainer:Rt,resolveAnchorOffset:Dt,clearRestoreReconcile:rn,scheduleRestoreReconcile:Un,captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:be}=(function(M){const{isClient:W,containerRef:G,parsedNodeCount:Y,requestFrame:ie,cancelFrame:_e,resolveScrollContainer:Me,getNormalizedScrollTop:Le,getOffsetTopWithinRoot:qe,isReverseFlexScrollRoot:Re,estimateIndexForOffset:Ge,estimateHeightRange:je,getFallbackNodeHeight:Be,clamp:Ke}=M,tt=X(null);let nt=null,wt=[];function at(){const Lt=Me(),qt=G.value;if(!Lt||!qt)return null;const zt=Lt.ownerDocument||qt.ownerDocument||document;if(Lt===zt.documentElement||Lt===zt.body||Lt===zt.scrollingElement){const fn=qt.getBoundingClientRect();return Math.max(0,-fn.top)}return Math.max(0,Le(Lt,zt,!1)-qe(qt,Lt))}function ft(Lt){var qt;const zt=Me(),fn=G.value;if(!zt||!fn)return;const Us=Math.max(0,Lt),as=zt.ownerDocument||fn.ownerDocument||document,Mi=as.defaultView||(typeof window<"u"?window:null);if(zt===as.documentElement||zt===as.body||zt===as.scrollingElement){const Qr=Le(zt,as,!0)+fn.getBoundingClientRect().top;return void((qt=Mi?.scrollTo)==null||qt.call(Mi,0,Math.max(0,Qr+Us)))}tC(zt,as,qe(fn,zt)+Us,{isReverseFlexScrollRoot:Qr=>{var Xr;return(Xr=Re?.(Qr))!=null&&Xr},getNormalizedScrollTop:Le})}function Et(Lt){const qt=Y.value,zt=Ke(Lt.nodeIndex,0,Math.max(0,qt-1));return je(0,zt)+Math.max(0,Lt.offsetWithinNodePx)}function At(){if(nt!=null&&(_e?.(nt),nt=null),W)for(const Lt of wt)window.clearTimeout(Lt);wt=[]}function tn(Lt){const qt=Et(Lt),zt=at();zt!=null&&Math.abs(zt-qt)<=.5||ft(qt)}return{activeRestoreAnchor:tt,getRelativeScrollTopWithinContainer:at,setRelativeScrollTopWithinContainer:ft,resolveAnchorOffset:Et,clearRestoreReconcile:At,applyRestoreAnchor:tn,scheduleRestoreReconcile:function(){tt.value&&W&&nt==null&&(nt=ie?ie(()=>{nt=null,tt.value&&tn(tt.value)}):null,nt==null&&tt.value&&tn(tt.value))},captureRestoreAnchor:function(){const Lt=at(),qt=Y.value;if(Lt==null||qt<=0)return null;const zt=Ke(Ge(Lt+1),0,qt-1),fn=je(0,zt),Us=Be(zt);return{nodeIndex:zt,offsetWithinNodePx:Ke(Lt-fn,0,Math.max(0,Us-1))}},restoreAnchor:function(Lt){const qt=Y.value;if(tt.value={nodeIndex:Ke(Lt.nodeIndex,0,Math.max(0,qt-1)),offsetWithinNodePx:Math.max(0,Lt.offsetWithinNodePx)},At(),tn(tt.value),W)for(const zt of[0,120,280,480])wt.push(window.setTimeout(()=>{tt.value&&tn(tt.value)},zt))},getAnchorDrift:function(Lt){const qt=at();return qt==null?null:qt-Et(Lt)}}})({isClient:oe,containerRef:S,parsedNodeCount:Yn,requestFrame:Tn,cancelFrame:jn,resolveScrollContainer:()=>Ue.value||ne(),getNormalizedScrollTop:ee,getOffsetTopWithinRoot:ge,isReverseFlexScrollRoot:q,estimateIndexForOffset:R1,estimateHeightRange:Zr,getFallbackNodeHeight:pf,clamp:Wo}),{nodeHeights:ke,heightStats:Oe,heightTreeSize:Ye,heightSumTree:st,heightKnownTree:Ct,averageNodeHeight:Ot,resetHeightMeasurements:uo,pruneHeightMeasurements:jt,rebuildHeightTrees:wn,recordNodeHeight:ls,removeNodeHeights:Mt,exportHeightCache:Nt,importHeightCache:Vt,fenwickRangeSum:fo}=(function(M={}){const W=Bo({}),G=Bo({total:0,count:0}),Y=X(0),ie=X([]),_e=X([]);function Me(){for(const Be of Object.keys(W))delete W[Number(Be)];G.total=0,G.count=0,Y.value=0,ie.value=[],_e.value=[]}function Le(Be,Ke,tt){for(let nt=Ke+1;nt<Be.length;nt+=nt&-nt)Be[nt]+=tt}function qe(Be,Ke){let tt=0;for(let nt=Ke+1;nt>0;nt-=nt&-nt)tt+=Be[nt];return tt}function Re(Be){Y.value=Be;const Ke=new Array(Be+1).fill(0),tt=new Array(Be+1).fill(0);for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0||(Le(Ke,at,ft),Le(tt,at,1))}ie.value=Ke,_e.value=tt}function Ge(Be){if(!Number.isInteger(Be)||Be<0)return!1;const Ke=W[Be];if(!Number.isFinite(Ke)||Ke<=0)return!1;if(delete W[Be],G.total=Math.max(0,G.total-Ke),G.count=Math.max(0,G.count-1),Y.value>Be){const tt=ie.value,nt=_e.value;tt.length&&nt.length&&(Le(tt,Be,-Ke),Le(nt,Be,-1))}return!0}const je=B(()=>G.count>0?Math.max(12,G.total/G.count):32);return{nodeHeights:W,heightStats:G,heightTreeSize:Y,heightSumTree:ie,heightKnownTree:_e,averageNodeHeight:je,resetHeightMeasurements:Me,pruneHeightMeasurements:function(Be){if(Be<=0)return void Me();let Ke=0,tt=0;for(const[nt,wt]of Object.entries(W)){const at=Number(nt),ft=Number(wt);!Number.isFinite(at)||at<0||at>=Be||!Number.isFinite(ft)||ft<=0?delete W[at]:(Ke+=ft,tt++)}G.total=Ke,G.count=tt},rebuildHeightTrees:Re,recordNodeHeight:function(Be,Ke,tt={}){(function(nt,wt,at={}){var ft;if(!Number.isFinite(wt)||wt<=0)return!1;const Et=W[nt];if(Et&&(at.allowShrink===!1&&wt<Et||Math.abs(wt-Et)<=1))return!1;if(W[nt]=wt,Et?G.total+=wt-Et:(G.total+=wt,G.count++),Y.value>nt){const At=ie.value,tn=_e.value;if(At.length&&tn.length)if(Et){const Lt=wt-Et;Lt!==0&&Le(At,nt,Lt)}else Le(At,nt,wt),Le(tn,nt,1)}at.notify!==!1&&((ft=M.onHeightRecorded)==null||ft.call(M))})(Be,Ke,Pt(lt({},tt),{notify:!0}))},removeNodeHeight:function(Be,Ke={}){var tt;const nt=Ge(Be);return nt&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},removeNodeHeights:function(Be,Ke={}){var tt;let nt=0;for(const wt of Be)Ge(Number(wt))&&nt++;return nt>0&&Ke.notify!==!1&&((tt=M.onHeightRecorded)==null||tt.call(M)),nt},exportHeightCache:function(){return Object.entries(W).map(([Be,Ke])=>({index:Number(Be),height:Number(Ke)})).filter(Be=>Number.isFinite(Be.index)&&Be.index>=0&&Number.isFinite(Be.height)&&Be.height>0).sort((Be,Ke)=>Be.index-Ke.index)},importHeightCache:function(Be,Ke={}){var tt;if(!Array.isArray(Be))return;const nt=Y.value;let wt=!1;if(Ke.mode!=="merge"){const at=Object.keys(W);if(at.length>0){for(const ft of at)delete W[Number(ft)];wt=!0}}for(const at of Be){const ft=Number(at.index),Et=Number(at.height);if(!Number.isInteger(ft)||ft<0||nt>0&&ft>=nt||!Number.isFinite(Et)||Et<=0)continue;const At=W[ft];At&&Math.abs(At-Et)<=1||(W[ft]=Et,wt=!0)}wt&&((function(){let at=0,ft=0;const Et=Y.value;for(const[At,tn]of Object.entries(W)){const Lt=Number(At),qt=Number(tn);!Number.isFinite(Lt)||Lt<0||Et>0&&Lt>=Et||!Number.isFinite(qt)||qt<=0?delete W[Lt]:(at+=qt,ft++)}G.total=at,G.count=ft})(),nt>0&&Re(nt),(tt=M.onHeightRecorded)==null||tt.call(M))},fenwickRangeSum:function(Be,Ke,tt){if(tt<=Ke)return 0;const nt=qe(Be,tt-1);return Ke<=0?nt:nt-qe(Be,Ke-1)}}})({onHeightRecorded:()=>{ii(),ze.value&&Cu(),we.value&&Un(),Fe.value&&Ga(),Bn("node-resize")}});function oo(){uo(),zn.clear()}function zi(M){!Number.isInteger(M)||M<0||M>=it.value.length||zn.set(M,pu(M))}function Ul(M,W,G={}){const Y=ke[M];ls(M,W,G);const ie=ke[M];ie&&ie>0?zi(M):Y&&zn.delete(M)}function ql(M,W){const G=ht("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,ie;return(ie=(Y=no.get(M))==null?void 0:Y.offsetHeight)!=null?ie:0});return G>0?G:ht("getNodeLayoutHeight.content.offsetHeight",()=>W.offsetHeight)}function lf(M,W={}){Vt(M,W),M1()}const Vr=B(()=>{var M;return!ce.value&&x.deferNodesUntilVisible!==!1&&!(((M=x.maxLiveNodes)!=null?M:0)<=0)&&!St.value&&!(it.value.length>900)&&Ao.value}),g2=B(()=>!!ss&&(Vr.value||St.value)),v2=B(()=>St.value||ze.value),{liveNodeBufferResolved:uu,focusIndex:si,liveRange:Ho,updateLiveRange:jl}=(function(M,W){const{parsedNodeCount:G,virtualizationEnabled:Y,maxLiveNodesResolved:ie,clamp:_e}=W,Me=B(()=>{var Re;return Math.max(0,(Re=M.liveNodeBuffer)!=null?Re:60)}),Le=X(0),qe=Bo({start:0,end:0});return{liveNodeBufferResolved:Me,focusIndex:Le,liveRange:qe,updateLiveRange:function(){const Re=G.value;if(!Y.value||Re===0)return qe.start=0,void(qe.end=Re);const Ge=Math.min(ie.value,Re),je=Me.value,Be=_e(Le.value-je,0,Math.max(0,Re-Ge));qe.start=Be,qe.end=Math.min(Re,Be+Ge)}}})(x,{parsedNodeCount:Yn,virtualizationEnabled:St,maxLiveNodesResolved:En,clamp:Wo}),Ui=new Map,Vl=new Map,Kr=new Map,af=[],cr=new Map,Gr=new Set,y2=X(0);let e1=!1;const k2=B(()=>(y2.value,Gr.size)),Hs=new Map,qi=new Map,b2=X(0),t1=B(()=>{b2.value;let M=0;for(const W of Hs.values())M+=Math.max(0,W);return M});let Ws=null,n1=!0,x2=[0],w2="";function ii(){n1=!0}const cf=B(()=>{if(!St.value)return it.value.length;const M=uu.value,W=Math.max(Ho.end+M,Ss.value),G=Math.min(it.value.length,W);return Math.max(co.value,G)});function uf(){e1||(e1=!0,queueMicrotask(()=>{e1=!1,y2.value+=1}))}function _2(M,W,G="node-resize"){if(!oe||typeof window>"u")return null;const Y=window.setTimeout(()=>{Gr.delete(Y)&&uf();try{W()}finally{Bn(G)}},Math.max(0,M));return Gr.add(Y),uf(),Y}function df(M){oe&&M!=null&&(Gr.delete(M)&&uf(),window.clearTimeout(M))}function S2(){if(oe&&typeof window<"u")for(const M of Gr)window.clearTimeout(M);Gr.size&&(Gr.clear(),uf()),af.length=0,Kr.clear()}function F8(M){var W,G;return(G=(W=to.value)==null?void 0:W[M])!=null?G:null}const{cancelScheduledFocusSync:o1,scheduleFocusSync:ji}=(function(M){const{isClient:W,containerRef:G,virtualizationEnabled:Y,requestFrame:ie,cancelFrame:_e,syncFocusToScroll:Me}=M;let Le=null;function qe(){var Ge,je,Be;return(Be=(je=(Ge=G.value)==null?void 0:Ge.ownerDocument)==null?void 0:je.defaultView)!=null?Be:typeof window<"u"?window:null}function Re(){if(!Le)return;const Ge=qe();Le.viaTimeout?Ge?Ge.clearTimeout(Le.id):clearTimeout(Le.id):_e?.(Le.id),Le=null}return{cancelScheduledFocusSync:Re,scheduleFocusSync:function(Ge={}){if(!Y.value)return;if(!W)return void Me(!0);if(Ge.immediate)return Re(),void Me(!0);if(Le)return;const je=()=>{Le=null,Me()};if(ie)return void(Le={id:ie(je),viaTimeout:!1});const Be=qe();Le={id:Be?Be.setTimeout(je,16):setTimeout(je,16),viaTimeout:!0}}}})({isClient:oe,containerRef:S,virtualizationEnabled:St,requestFrame:Tn,cancelFrame:jn,syncFocusToScroll:function(M=!1){var W;if(!St.value)return;const G=Ue.value||ne();if(!G)return;const Y=G.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,ie=Y?.defaultView||(typeof window<"u"?window:null),_e=G===Y?.documentElement||G===Y?.body,Me=it.value.length;if(!_e&&Me>0&&q(G)){const tt=ht("syncFocusToScroll.clientHeight",()=>G.clientHeight||0),nt=ht("syncFocusToScroll.scrollTop",()=>G.scrollTop),wt=nt<0?-nt:nt,at=(function(Et){var At,tn;const Lt=it.value;if(!Lt.length)return 0;if(Et<=0)return Math.max(0,Lt.length-1);if(kt.value){const zt=(At=a1()[Lt.length])!=null?At:0;return L2(Math.max(0,zt-Et))}if(Ye.value===Lt.length){const zt=Zr(0,Lt.length);return R1(Math.max(0,zt-Et))}let qt=Et;for(let zt=Lt.length-1;zt>=0;zt--){const fn=(tn=ke[zt])!=null?tn:Ot.value;if(qt<=fn)return zt;qt-=fn}return 0})(Math.max(0,wt)+.5*Math.max(0,tt)),ft=Wo(at,0,Math.max(0,Me-1));return void((M||Math.abs(ft-si.value)>1)&&(si.value=ft,jl()))}const Le=_e?null:ht("syncFocusToScroll.root.getBoundingClientRect",()=>G.getBoundingClientRect()),qe=_e?0:Le.top,Re=_e?ht("syncFocusToScroll.viewport.clientHeight",()=>{var tt,nt;return(nt=(tt=ie?.innerHeight)!=null?tt:G.clientHeight)!=null?nt:0}):Le.bottom,Ge=oi.value;let je=null,Be=null;for(const[tt,nt]of Ge){if(!nt)continue;const wt=ht("syncFocusToScroll.slot.getBoundingClientRect",()=>nt.getBoundingClientRect());wt.bottom<=qe||wt.top>=Re||(je==null&&(je=tt),Be=tt)}if(je==null||Be==null){const tt=S.value;if(!tt)return;const nt=_e?{top:0}:ht("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>G.getBoundingClientRect()),wt=ht("syncFocusToScroll.fallback.scrollTop",()=>ee(G,Y,_e)),at=_e?(()=>{const At=ht("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>tt.getBoundingClientRect()),tn=(_e?0:nt.top)-At.top;return Math.max(0,tn)})():(()=>{const At=ge(tt,G);return Math.max(0,wt-At)})(),ft=_e?ht("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var At,tn,Lt,qt;return(qt=(Lt=(tn=ie?.innerHeight)!=null?tn:(At=Y?.documentElement)==null?void 0:At.clientHeight)!=null?Lt:G.clientHeight)!=null?qt:0}):ht("syncFocusToScroll.fallback.root.clientHeight",()=>G.clientHeight),Et=R1(at+.5*Math.max(0,ft));return si.value=Wo(Et,0,Math.max(0,it.value.length-1)),void jl()}const Ke=Math.round((je+Be)/2);!M&&Math.abs(Ke-si.value)<=1||(si.value=Wo(Ke,0,Math.max(0,it.value.length-1)),jl())}}),{visibleNodeIndices:s1,nodeVisibilityHandles:Wa,nodeVisibilityWatchStops:ff,nodeVisibilityFallbackTimers:C2,clearVisibilityFallback:hf,markNodeVisible:Yr,cleanupNodeVisibility:O8,destroyNodeVisibilityState:i1}=See({isClient:oe,shouldTrackVisibleNodeIndices:()=>Vr.value,shouldCleanupNodeVisibility:()=>St.value,onNodeMarkedVisible:M=>{St.value?ji():si.value=Wo(M,0,Math.max(0,it.value.length-1))},onNodeVisibilityCleaned:M=>{no.delete(M)&&eb()}}),{cleanupScrollListener:A2,setupScrollListener:R8}=(function(M){const{isClient:W,virtualizationEnabled:G,listenerEnabled:Y,scrollRootElement:ie,resolveScrollContainer:_e,scheduleFocusSync:Me,onScroll:Le}=M;let qe=null,Re=null;function Ge(){qe&&(qe(),qe=null),Re=null,ie.value=null}function je(Be){const Ke=M.getScrollTop?M.getScrollTop(Be):Be.scrollTop;return Math.max(0,Number.isFinite(Ke)?Math.abs(Ke):0)}return{cleanupScrollListener:Ge,setupScrollListener:function(){if(!W)return;if(!((Be=Y?.value)!=null?Be:G.value))return void Ge();var Be;const Ke=_e();if(!Ke)return void Ge();if(ie.value===Ke&&qe)return;Ge(),Re=je(Ke);const tt=()=>{if(Le?.(),G.value){const nt=(function(wt){const at=je(wt),ft=Re;Re=at;const Et=Math.max(480,.75*(wt.clientHeight||0));return ft==null?at>Et?{immediate:!0}:void 0:Math.abs(at-ft)>Et?{immediate:!0}:void 0})(Ke);nt?Me(nt):Me()}};Ke.addEventListener("scroll",tt,{passive:!0}),ie.value=Ke,qe=()=>{Ke.removeEventListener("scroll",tt)}}}})({isClient:oe,virtualizationEnabled:St,listenerEnabled:v2,scrollRootElement:Ue,resolveScrollContainer:ne,scheduleFocusSync:ji,onScroll:function(){const M=Fe.value;if(!M)return;const W=hu();if(!W||(function(Y){if(ku()>=Ne)return he=null,!1;const ie=he;if(ie==null)return!0;const _e=Math.abs(Y.scrollTop-ie)<=2;return _e||(he=null),_e})(W))return;const G=W2(W);G!=null?(G<-32||Math.abs(Math.max(0,G)-Math.max(0,M.distanceFromBottomPx))>32)&&Ka("restore"):Ka("restore")},getScrollTop:M=>{var W;const G=M.ownerDocument||((W=S.value)==null?void 0:W.ownerDocument)||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement;return ht("scrollListener.getScrollTop",()=>ee(M,G,Y))}});function Wo(M,W,G){return Math.min(Math.max(M,W),G)}function r1(M){return M?.firstElementChild}function M2(M,W){var G;return M?(G=M.matches)!=null&&G.call(M,W)?M:M.querySelector(W):null}function E2(){if(!kt.value)return void(K.value=0);const M=ht("updateExperimentContainerWidth.clientWidth",()=>{var W,G;return(G=(W=S.value)==null?void 0:W.clientWidth)!=null?G:0});K.value=M>0?M:0}let du=null;function l1(){du?.disconnect(),du=null}const T2=Li({loader:()=>Xn(null,null,function*(){return(yield ms(()=>import("./index8-BSZNwbg_.js"),__vite__mapDeps([7,6]))).default}),loadingComponent:KM,delay:0,suspensible:!1});function N2(M){return M===T2}const I2=B(()=>u.value==="pre"?qs:u.value==="shiki"?T2:j0),Kl=B(()=>{const M=it.value;if(!M.length||!kt.value)return M.map(()=>null);const W=K.value||ht("estimatedNodeHeights.clientWidth",()=>{var G;return((G=S.value)==null?void 0:G.clientWidth)||0});return!Number.isFinite(W)||W<=0?M.map(()=>null):M.map((G,Y)=>{const ie=ke[Y],_e=typeof ie=="number"&&ie>0;if(Rn.value&&!_e){const Le=JM(G,W,V.value);if(Le)return Le}if(sn.value&&G.type==="code_block"){const Le=(function(qe){if(qe.type!=="code_block")return null;const Re=hb(qe,xf(qe));return N2(Re)?"markdown":Re===qs?"pre":Re===I2.value||Re===j0?"monaco":null})(G);if(Le==="monaco"||Le==="markdown"||Le==="pre")return cee(G,{rendererKind:Le,monacoOptions:x.codeBlockMonacoOptions,showHeader:((Me=x.codeBlockProps)==null?void 0:Me.showHeader)!==!1})}var Me;return null})});function pf(M){var W;const G=ke[M];if(Number.isFinite(G)&&G>0)return G;const Y=(W=Kl.value[M])==null?void 0:W.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Ot.value,(function(ie){var _e,Me,Le,qe,Re,Ge,je,Be,Ke,tt,nt,wt,at;const ft=it.value[ie];if(!ft||typeof ft!="object")return 32;const Et=String((_e=ft.type)!=null?_e:""),At=Gt()||640;switch(Et){case"heading":return 44;case"paragraph":return za(String((Le=(Me=ft.raw)!=null?Me:ft.content)!=null?Le:""),At,34);case"list":{const tn=Array.isArray(ft.items)?ft.items.length:1;return Math.max(48,30*tn+12)}case"list_item":return za(String((Re=(qe=ft.raw)!=null?qe:ft.content)!=null?Re:""),At,34);case"blockquote":return za(String((je=(Ge=ft.raw)!=null?Ge:ft.content)!=null?je:""),At,56);case"table":{const tn=Array.isArray(ft.rows)?ft.rows.length:Array.isArray(ft.children)?ft.children.length:3;return Math.max(120,38*tn+48)}case"code_block":return za(String((Ke=(Be=ft.code)!=null?Be:ft.raw)!=null?Ke:""),At,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return za(String((nt=(tt=ft.raw)!=null?tt:ft.content)!=null?nt:""),At,96);case"thematic_break":return 24;default:return za(String((at=(wt=ft.raw)!=null?wt:ft.content)!=null?at:""),At,40)}})(M))}function za(M,W,G,Y=22){const ie=String(M??"");if(!ie)return G;const _e=Math.max(18,Math.floor(Math.max(320,W)/8)),Me=ie.split(/\r?\n/).length,Le=Math.ceil(ie.length/_e),qe=Math.max(1,Me,Le);return Math.max(G,Math.ceil(qe*Y+12))}function fu(M){const W=Number(M);return!Number.isFinite(W)||W<=0?-1:Math.round(W/32)}function a1(){var M,W;const G=it.value.length,Y=fu(K.value||ht("getFallbackHeightPrefix.clientWidth",()=>{var Le;return((Le=S.value)==null?void 0:Le.clientWidth)||0})),ie=((M=o.virtualScroll)==null?void 0:M.measurementKey)==null?"":String(o.virtualScroll.measurementKey),_e=[G,Oe.count,Math.round(Oe.total),Math.round(100*Ot.value),ie,Y,kt.value?1:0,QS.value,Z.value].join(":");if(!n1&&w2===_e)return x2;const Me=new Array(G+1);Me[0]=0;for(let Le=0;Le<G;Le++)Me[Le+1]=Me[Le]+(kt.value?pf(Le):(W=ke[Le])!=null?W:Ot.value);return x2=Me,w2=_e,n1=!1,Me}function L2(M){var W,G;const Y=it.value.length;if(Y<=0||M<=0)return 0;const ie=a1();if(M>=((W=ie[Y])!=null?W:0))return Y-1;let _e=0,Me=Y-1,Le=Y-1;for(;_e<=Me;){const qe=_e+Me>>1;((G=ie[qe+1])!=null?G:0)>=M?(Le=qe,Me=qe-1):_e=qe+1}return Le}function Zr(M,W){var G,Y;if(M>=W)return 0;if(kt.value)return(function(Me,Le){var qe,Re;const Ge=it.value.length,je=Wo(Math.trunc(Me),0,Ge),Be=Wo(Math.trunc(Le),je,Ge);if(je>=Be)return 0;const Ke=a1();return((qe=Ke[Be])!=null?qe:0)-((Re=Ke[je])!=null?Re:0)})(M,W);if(Ye.value!==it.value.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(G=ke[Le])!=null?G:Ot.value;return Me}const ie=st.value,_e=Ct.value;if(!ie.length||!_e.length){let Me=0;for(let Le=M;Le<W;Le++)Me+=(Y=ke[Le])!=null?Y:Ot.value;return Me}return fo(ie,M,W)+(W-M-fo(_e,M,W))*Ot.value}Qe(()=>it.value.length,M=>{ii(),M<=0?oo():(M<Ye.value&&jt(M),M!==Ye.value&&wn(M))},{immediate:!0});const B8=B(()=>{if(!St.value)return it.value.map((Y,ie)=>({node:Y,index:ie}));const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);return it.value.slice(W,G).map((Y,ie)=>({node:Y,index:W+ie}))}),c1=B(()=>St.value?Zr(0,Math.min(Ho.start,it.value.length)):0),u1=B(()=>{if(!St.value)return 0;const M=it.value.length;return Zr(Math.min(Ho.end,M),M)});function $2(){if(!kt.value)return 0;let M=0;const W=Kl.value;for(let G=0;G<W.length;G++){if(!W[G])continue;const Y=ke[G];Number.isFinite(Y)&&Y>0||M++}return M}function F2(){const M=it.value.length;return{totalNodes:M,measuredCount:Oe.count,estimatedCount:$2(),averageNodeHeight:Ot.value,topSpacerHeight:c1.value,bottomSpacerHeight:u1.value,estimatedTotalHeight:Zr(0,M),width:Gl()}}function D8(){const M=it.value,W=F2();return Pt(lt({},W),{probe:{paragraphReady:!!V.value.paragraph,listItemReady:!!V.value.listItem,listWrapperOverhead:V.value.listWrapperOverhead,headingReadyLevels:Object.entries(V.value.headings).filter(([,G])=>!!G).map(([G])=>Number(G))},nodes:M.map((G,Y)=>{var ie,_e,Me,Le,qe,Re,Ge,je,Be;return{index:Y,type:G.type,estimateKind:(_e=(ie=Kl.value[Y])==null?void 0:ie.kind)!=null?_e:null,rendererKind:(Le=(Me=Kl.value[Y])==null?void 0:Me.rendererKind)!=null?Le:null,estimatedHeight:(Re=(qe=Kl.value[Y])==null?void 0:qe.height)!=null?Re:null,estimatedContentHeight:(je=(Ge=Kl.value[Y])==null?void 0:Ge.contentHeight)!=null?je:null,measuredHeight:(Be=ke[Y])!=null?Be:null}})})}function d1(){return o.indexKey!=null?String(o.indexKey):Mn.value?`virtual-${Vn()}`:"markdown-renderer"}function O2(M){const W=String(M),G=`${d1()}-`;if(!W.startsWith(G))return null;const Y=W.slice(G.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const ie=Number(Y[1]);return!Number.isInteger(ie)||ie<0||ie>=it.value.length?null:ie}function Vn(){var M,W,G;const Y=(M=o.virtualScroll)==null?void 0:M.sessionKey;return String(Y!=null&&Y!==""?Y:(G=(W=o.indexKey)!=null?W:x.customId)!=null?G:un)}function Mo(){var M;const W=(M=o.virtualScroll)==null?void 0:M.threadKey;return W==null||W===""?void 0:String(W)}function f1(M){var W;return(M??"")===((W=Mo())!=null?W:"")}function P8(){var M;const W=(M=o.virtualScroll)==null?void 0:M.measurementKey;return W==null?"":String(W)}function H8(){var M,W;const G=u.value,Y=G==="monaco"?x.codeBlockMonacoOptions:void 0,ie=x.codeBlockProps,_e=G==="shiki";return[x.isDark?"dark":"light",G==="monaco"?"code-rich":G==="pre"?"code-pre":"code-shiki",x.codeBlockStream===!1?"code-static":"code-stream",Fo(x.codeBlockMinWidth),Fo(x.codeBlockMaxWidth),..._e?[Mp((M=ie?.themes)!=null?M:x.themes,(W=ie?.langs)!=null?W:x.langs)]:[],Fo(Y?.fontSize),Fo(Y?.lineHeight),Fo(Y?.fontFamily),Fo(Y?.tabSize),Fo(Y?.MAX_HEIGHT),Fo(Y?.wordWrap),Fo(Y?.wrappingIndent),Fo(Y?.padding),Fo(ie?.showHeader),Fo(ie?.showCopyButton),Fo(ie?.showExpandButton),Fo(ie?.showPreviewButton),Fo(ie?.showCollapseButton),Fo(ie?.showFontSizeButtons)].join("\0")}function ur(){return[P8(),H8()].join("\0")}function Gl(){return Gt()}const mf=B(()=>fu(Gl())),zs=B(()=>[ur(),mf.value].join("\0")),W8=B(()=>{var M;return Mn.value?["virtual",(M=Mo())!=null?M:"",Vn(),zs.value].join("\0"):o.indexKey});function Ua(){b2.value+=1}function h1(M){return!(!M||!Number.isInteger(M.index)||M.index<0||M.index>=it.value.length||M.sessionKey!==Vn()||M.threadKey!==Mo()||M.layoutEpochKey!==zs.value)}function R2(M){const W=String(M),G=qi.get(W);return G?h1(G)?G.index:null:O2(W)}function B2(M="async-node"){(Hs.size||qi.size)&&(Hs.clear(),qi.clear(),Ua(),Bn(M))}const qa=Kt(yv,null),p1={reportHeight(M,W){if(!ze.value)return;const G=R2(M);if(G==null)return;const Y=Ui.get(G);if(!Y)return;const ie=Number(W),_e=ql(G,Y);Ul(G,Number.isFinite(ie)&&ie>0?Math.max(ie,_e||0):_e)},markPending(M){if(!ze.value)return;const W=O2(M);W!=null&&(function(G,Y){var ie;const _e=qi.get(G);if(_e&&h1(_e))return Hs.set(G,Math.max(0,(ie=Hs.get(G))!=null?ie:0)+1),Ua(),void Bn("async-node");Hs.set(G,1),qi.set(G,(function(Me){return{index:Me,sessionKey:Vn(),threadKey:Mo(),layoutEpochKey:zs.value}})(Y)),Ua(),Bn("async-node")})(String(M),W)},markSettled(M){if(!ze.value)return;const W=String(M),G=R2(M);(G!=null||(function(Y){return Hs.has(String(Y))})(W))&&(function(Y){var ie;const _e=(ie=Hs.get(Y))!=null?ie:0;return!(_e<=0||(_e<=1?(Hs.delete(Y),qi.delete(Y)):Hs.set(Y,_e-1),Ua(),_e===1&&Bn("async-node"),0))})(W)&&G!=null&&dr()}};function z8(){let M=0;for(const W of Ui.values())M+=ht("getVisibleDomHeight.offsetHeight",()=>{var G;return(G=W?.offsetHeight)!=null?G:0});return Math.ceil(Math.max(0,M))}Ln(yv,{reportHeight(M,W){p1.reportHeight(M,W),qa?.reportHeight(M,W)},markPending(M){p1.markPending(M),qa?.markPending(M)},markSettled(M){p1.markSettled(M),qa?.markSettled(M)}});let m1,g1=null,ja=null;function gf(M){return M!==!1&&M!=null&&M!==""}function D2(){return St.value?(function(){if(!St.value)return!0;const M=it.value.length,W=Wo(Ho.start,0,M),G=Wo(Ho.end,W,M);if(W>=G)return!0;for(let Y=W;Y<G;Y++)if(!no.has(Y)||B1(Y)&&!Ui.has(Y))return!1;return!0})():co.value>=cf.value}function v1(){return j.value===!0&&!te.value&&t1.value===0&&Gr.size===0&&cr.size===0&&Ws==null&&D2()}function P2(){var M,W;if(((M=o.virtualScroll)==null?void 0:M.settleMode)!=="manual"||g1===Vn()&&m1===Mo())return!0;const G=(W=o.virtualScroll)==null?void 0:W.settledToken;return!!gf(G)&&ja===Au(G)}function y1(){return v1()&&P2()}function U8(M,W){return W.totalNodes<=0?M==="final"?"final":"estimate":W.measuredCount>=W.totalNodes?M==="final"?"final":"measured":W.measuredCount>0||W.estimatedCount>0?"mixed":"estimate"}function Yl(M="manual",W){const G=F2(),Y=(function(ie){return ie||(j.value!==!0?it.value.length>0?"streaming":"estimating":!D2()||cr.size>0||Ws!=null?"measuring":y1()?"settled":"settling")})(W);return{sessionKey:Vn(),threadKey:Mo(),phase:Y,nodeCount:G.totalNodes,liveRange:{start:Ho.start,end:Ho.end},renderedCount:co.value,measuredCount:G.measuredCount,estimatedCount:G.estimatedCount,averageNodeHeight:G.averageNodeHeight,topSpacerHeight:G.topSpacerHeight,bottomSpacerHeight:G.bottomSpacerHeight,visibleDomHeight:z8(),totalHeight:H2(),width:G.width,final:j.value===!0,stable:y1(),confidence:U8(Y,G),reason:M}}function hu(){const M=Ue.value||ne(),W=S.value;if(!M||!W)return null;const G=M.ownerDocument||W.ownerDocument||document,Y=M===G.documentElement||M===G.body||M===G.scrollingElement,ie=ht("getScrollBox.scrollTop",()=>ee(M,G,Y)),_e=ht("getScrollBox.scrollHeight",()=>{var Le,qe,Re,Ge,je;return Y?Math.max((qe=(Le=G.documentElement)==null?void 0:Le.scrollHeight)!=null?qe:0,(Ge=(Re=G.body)==null?void 0:Re.scrollHeight)!=null?Ge:0,(je=M.scrollHeight)!=null?je:0):M.scrollHeight}),Me=ht("getScrollBox.clientHeight",()=>{var Le;return Y?((Le=G.documentElement)==null?void 0:Le.clientHeight)||M.clientHeight||0:M.clientHeight});return{root:M,doc:G,isViewportRoot:Y,scrollTop:ie,scrollHeight:_e,clientHeight:Me}}function H2(){const M=it.value.length,W=Math.max(0,Zr(0,M)),G=ht("getRendererLogicalHeight.offsetHeight",()=>{var ie,_e;return(_e=(ie=S.value)==null?void 0:ie.offsetHeight)!=null?_e:0}),Y=Math.max(0,G>0?G:ht("getRendererLogicalHeight.scrollHeight",()=>{var ie,_e;return(_e=(ie=S.value)==null?void 0:ie.scrollHeight)!=null?_e:0}));return M<=0?Math.ceil(G):St.value?W>0?Math.max(1,Math.ceil(W),(function(){let ie=c1.value+u1.value;for(const _e of no.values())_e&&(ie+=Math.max(0,ht("getVirtualizedDomLogicalHeight.offsetHeight",()=>_e.offsetHeight||0)));return Math.ceil(Math.max(0,ie))})(),(function(ie,_e){return ie<=0||_e<=0?0:_e<=ie+Math.max(512,.05*ie)?Math.ceil(_e):0})(W,Y)):Math.max(1,Math.ceil(Y)):ze.value?W>0||Oe.count>0||$2()>0?(Si.value&&co.value,Math.max(1,Math.ceil(Y),Math.ceil(W))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(W))}function W2(M){const W=S.value;if(!W)return null;const G=ht("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>W.getBoundingClientRect());return(function(ie){return ie.isViewportRoot?ie.clientHeight:ht("getViewportBottomInRoot.getBoundingClientRect",()=>ie.root.getBoundingClientRect().bottom)})(M)-G.bottom}function q8(M={}){const W=M.requireViewport!==!1,G=(function(_e=64){const Me=hu(),Le=S.value;if(!Me||!Le)return!1;const qe=(function(Ge){if(Ge.isViewportRoot)return{top:0,bottom:Ge.clientHeight};const je=ht("getVirtualViewportRect.getBoundingClientRect",()=>Ge.root.getBoundingClientRect());return{top:je.top,bottom:je.bottom}})(Me),Re=ht("isRendererNearVirtualViewport.getBoundingClientRect",()=>Le.getBoundingClientRect());return Re.bottom>=qe.top-_e&&Re.top<=qe.bottom+_e})();if(W&&!G)return null;const Y=(function(){const _e=hu(),Me=S.value;if(!_e||!Me||Math.max(0,_e.scrollHeight-_e.scrollTop-_e.clientHeight)>64)return null;const Le=W2(_e);return Le==null?null:Le>=-8&&Le<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,Le)}:null})();if(Y)return{anchor:Y,captured:!0};const ie=Cs();if(ie)return{anchor:{type:"node",nodeIndex:ie.nodeIndex,offsetWithinNodePx:ie.offsetWithinNodePx},captured:G};if(M.allowFallback===!0){const _e=(function(){const Me=it.value.length;return Me<=0?null:{type:"node",nodeIndex:Wo(si.value,0,Math.max(0,Me-1)),offsetWithinNodePx:0}})();return _e?{anchor:_e,captured:!1}:null}return null}function k1(M){let W=2166136261;for(let G=0;G<M.length;G++)W^=M.charCodeAt(G),W=Math.imul(W,16777619);return(W>>>0).toString(36)}function j8(M,W){let G=M;for(let Y=0;Y<W.length;Y++)G^=W.charCodeAt(Y),G=Math.imul(G,16777619);return G^=31,G=Math.imul(G,16777619),G}const V8=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function vf(M,W=new WeakSet,G=0){if(M==null||typeof M=="number"||typeof M=="boolean")return String(M);if(typeof M=="string")return`s:${(function(Y){const ie=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${k1(ie)}`})(M)}`;if(typeof M=="function")return"fn";if(typeof M!="object")return typeof M;if(W.has(M))return"cycle";if(G>=6)return"max-depth";W.add(M);try{if(Array.isArray(M)){if(M.length<=160){const Re=[];for(let Ge=0;Ge<M.length;Ge++)Re.push(vf(M[Ge],W,G+1));return`a:${M.length}:${Re.join(",")}`}const _e=[],Me=[],Le=Math.max(0,M.length-32);let qe=2166136261;for(let Re=0;Re<M.length;Re++){const Ge=vf(M[Re],W,G+1);qe=j8(qe,Ge),Re<32&&_e.push(Ge),Re>=Le&&Me.push(Ge)}return[`a:${M.length}`,`h=${_e.join(",")}`,`t=${Me.join(",")}`,`all=${(qe>>>0).toString(36)}`].join(":")}const Y=M,ie=Object.keys(Y).filter(_e=>{const Me=Y[_e];return _e!=="parent"&&_e!=="el"&&_e!=="component"&&(Me==null||typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"||V8.has(_e))}).sort();return`o:${ie.length}:${ie.map(_e=>`${_e}=${vf(Y[_e],W,G+1)}`).join(";")}`}finally{W.delete(M)}}let z2=-1,b1="";function pu(M){const W=it.value[M];return W?k1(vf(W)):""}function x1(){const M=Z.value;if(z2===M)return b1;let W=2166136261;for(let G=0;G<it.value.length;G++){const Y=pu(G);for(let ie=0;ie<Y.length;ie++)W^=Y.charCodeAt(ie),W=Math.imul(W,16777619)}return b1=(W>>>0).toString(36),z2=M,b1}function Va(M,W={}){var G;const Y=W.includeHeightCache===!0,ie=(G=W.includeContentHash)!=null?G:Y,_e=Y?(function(Le){const qe=(function(){var nt,wt;const at=Number((wt=(nt=o.virtualScroll)==null?void 0:nt.heightCacheLimit)!=null?wt:5e3);return!Number.isFinite(at)||at<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(at))})();if(!Number.isFinite(qe)||Le.length<=qe)return Le;const Re=new Map,Ge=nt=>{!nt||Re.size>=qe||Re.set(nt.index,nt)},je=it.value.length,Be=Wo(Ho.start-2*uu.value,0,je),Ke=Wo(Ho.end+2*uu.value,Be,je);for(const nt of Le)nt.index>=Be&&nt.index<Ke&&Ge(nt);const tt=Math.max(1,Math.ceil(Le.length/qe));for(let nt=0;nt<Le.length&&Re.size<qe;nt+=tt)Ge(Le[nt]);for(let nt=Le.length-1;nt>=0&&Re.size<qe;nt-=tt)Ge(Le[nt]);return Array.from(Re.values()).sort((nt,wt)=>nt.index-wt.index).slice(0,qe)})(Nt().map(Le=>{var qe;const Re=it.value[Le.index];return Re?Pt(lt({},Le),{nodeType:String((qe=Re.type)!=null?qe:""),signature:pu(Le.index)}):null}).filter(Le=>!!Le)):[],Me=q8({allowFallback:W.allowAnchorFallback===!0,requireViewport:W.requireViewport});return Me||_e.length||W.includeEmptyState===!0?Pt(lt({sessionKey:M.sessionKey,threadKey:M.threadKey},Me?{anchor:Me.anchor,anchorCaptured:Me.captured}:{anchorCaptured:!1}),{metrics:M,width:M.width,contentHash:ie?x1():void 0,measurementKey:ur()||void 0,heightCache:_e.length?_e:void 0}):null}function w1(M){var W,G;const Y=hu();if(!Y)return;const ie=(function(Le){const qe=S.value;if(!qe)return null;const Re=ge(qe,Le.root),Ge=it.value.length,je=ht("getRendererBottomOffsetWithinRoot.offsetHeight",()=>qe.offsetHeight||0),Be=Math.max(0,je>0?je:Ge>0?ht("getRendererBottomOffsetWithinRoot.scrollHeight",()=>qe.scrollHeight||0):0),Ke=H2();return Re+Math.max(Be,Ke)})(Y);if(ie==null)return;const _e=Math.max(0,M.distanceFromBottomPx),Me=Math.max(0,ie-Y.clientHeight-_e);(function(Le){Ne=ku()+120,he=Le})(Me),Y.isViewportRoot?(G=(W=Y.doc.defaultView)==null?void 0:W.scrollTo)==null||G.call(W,0,Me):tC(Y.root,Y.doc,Me,{isReverseFlexScrollRoot:q,getNormalizedScrollTop:ee})}const _1=[];function U2(){if(oe)for(se!=null&&(jn?.(se),se=null);_1.length;){const M=_1.pop();M!=null&&window.clearTimeout(M)}}function Ka(M){const W=!!Fe.value;Fe.value=null,Ne=0,he=null,U2(),W&&M&&Bn(M)}function Ga(){if(!Fe.value||!oe||se!=null)return;const M=()=>{se=null;const W=Fe.value;W&&w1(W)};se=Tn?Tn(M):null,se==null&&M()}function q2(M,W={}){const G=it.value.length;return G<=0?[]:M.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=G)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(W.requireSignature&&!Y.signature)&&!(W.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(ie){var _e;const Me=it.value[ie.index];return!(!Me||ie.nodeType&&ie.nodeType!==String((_e=Me.type)!=null?_e:"")||ie.signature&&ie.signature!==pu(ie.index))})(Y))}function j2(M){const W=fu(Gl()),G=fu(M);return W!==-1&&G!==-1&&W===G}function S1(M){var W;const G=Number(M?.width);if(Number.isFinite(G)&&G>0)return G;const Y=Number((W=M?.metrics)==null?void 0:W.width);return Number.isFinite(Y)&&Y>0?Y:null}function V2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&((W=M.measurementKey)!=null?W:"")===ur()&&!!j2(S1(M))&&!!(function(G){const Y=G.heightCache;return!!Y?.length&&(K2(G)?Y.some(ie=>!!(ie.nodeType||ie.signature)):Y.some(ie=>!!ie.signature))})(M)}function K2(M){return!!(M.contentHash&&M.contentHash===x1())}function K8(M){return!K2(M)}let Zl=null,Ql=null,yf=null,mu=null,gu=null;function C1(M){var W;const G=M.map(ie=>{var _e,Me;return[ie.index,Math.round(10*ie.height),(_e=ie.nodeType)!=null?_e:"",(Me=ie.signature)!=null?Me:""].join("")}).join(""),Y=fu(Gl());return[(W=Mo())!=null?W:"",Vn(),ur(),it.value.length,Y,M.length,k1(G)].join(":")}function G2(M=(W=>(W=o.virtualScroll)==null?void 0:W.heightCache)()){if(!ze.value||!M?.length||it.value.length<=0||!j2((W=o.virtualScroll)==null?void 0:W.heightCacheWidth))return!1;var W;const G=q2(M,{requireSignature:!0});if(!G.length)return!1;const Y=C1(G);return Y===Zl?(Ql="standalone",!0):(lf(G,{mode:"merge"}),ii(),Zl=Y,Ql="standalone",xu(),Bn("restore"),!0)}function A1(M,W={}){var G,Y,ie;if(!ze.value||!M||M.sessionKey!==Vn()||!f1(M.threadKey)||it.value.length<=0)return!1;const _e=!!((G=M.heightCache)!=null&&G.length)&&!kf(),Me=!M.anchor||M.anchorCaptured===!1&&W.allowUncapturedAnchor!==!0?null:M.anchor,Le=W.restoreAnchor===!0&&!!Me&&!kf()&&Number(S1(M))>0;let qe=!1;if((Y=M.heightCache)!=null&&Y.length&&V2(M)){const Ge=q2(M.heightCache,{requireCompatibilityMetadata:!M.contentHash,requireSignature:K8(M)});Ge.length&&(lf(Ge,{mode:"merge"}),ii(),Zl=C1(Ge),Ql="restore",xu(),qe=!0)}if(_e||Le)return!1;if(!W.restoreAnchor||!Me)return qe&&Bn("restore"),!0;const Re=(function(Ge,je){var Be;const Ke=Ge.anchor,tt=Ke?Ke.type==="bottom"?`bottom:${Math.round(Ke.distanceFromBottomPx)}`:`node:${Ke.nodeIndex}:${Math.round(Ke.offsetWithinNodePx)}`:"none";return[(Be=Mo())!=null?Be:"",Vn(),ur(),mf.value,je,tt].join(":")})(M,(ie=W.restoreToken)!=null?ie:"imperative");return yf===Re?(qe&&Bn("restore"),!0):(yf=Re,(function(Ge){const je=()=>{if(Ge.type==="node")return Ka(),void Q({nodeIndex:Ge.nodeIndex,offsetWithinNodePx:Ge.offsetWithinNodePx});if(rn(),we.value=null,Fe.value=Ge,U2(),w1(Ge),oe)for(const Be of[0,120,280,480])_1.push(window.setTimeout(()=>{const Ke=Fe.value;Ke&&w1(Ke)},Be))};(function(Be){if(!St.value)return!1;const Ke=it.value.length;return!(Ke<=0||(si.value=Be.type==="node"?Wo(Be.nodeIndex,0,Ke-1):Ke-1,jl(),0))})(Ge)?mt(je):je()})(Me),Bn("restore"),!0)}function kf(){const M=Gl();return Number.isFinite(M)&&M>0}function Y2(M){var W;return M.sessionKey===Vn()&&!!f1(M.threadKey)&&(it.value.length<=0||!(!((W=M.heightCache)!=null&&W.length)||kf())||!(!(M.anchor&&Number(S1(M))>0)||kf()))}function M1(){zn.clear();for(const M of Object.keys(ke)){const W=Number(M);Number.isInteger(W)&&W>=0&&W<it.value.length&&zi(W)}}function vu(){Ws!=null&&(jn?.(Ws),Ws=null),D1()}function Z2(){return!oe||ti?Promise.resolve():new Promise(M=>{let W=!1,G=null;const Y=()=>{W||(W=!0,G!=null&&window.clearTimeout(G),M())};if(Tn)return Tn(Y),void(G=window.setTimeout(Y,50));G=window.setTimeout(Y,0)})}function E1(M,W=Mo(),G=zs.value){return Vn()===M&&Mo()===W&&zs.value===G}function T1(){return Xn(this,arguments,function*(M={}){var W,G,Y,ie,_e;const Me=Vn(),Le=Mo(),qe=zs.value,Re=(W=M.frames)!=null?W:2,Ge=(G=M.timeoutMs)!=null?G:120,je=(Y=M.reason)!=null?Y:"manual",Be=M.expectedSettledTokenKey,Ke=M.flushPendingTimers===!0,tt=Yl(je),nt=()=>Pt(lt({},tt),{phase:tt.final?"settling":tt.phase,stable:!1,confidence:tt.confidence==="final"?"mixed":tt.confidence,reason:je}),wt=()=>E1(Me,Le,qe)&&(Be==null||bu()===Be);for(let At=0;At<Re;At++){if(yield mt(),!wt()||(yield Z2(),!wt()))return nt();dr(),vu()}if(yield(function(At){return!oe||At<=0?Promise.resolve():new Promise(tn=>window.setTimeout(tn,At))})(Ge),!wt()||(Ke&&S2(),dr(),vu(),!wt()))return nt();const at=v1();at&&(g1=Me,m1=Le,((ie=o.virtualScroll)==null?void 0:ie.settleMode)==="manual"&&Be!=null&&gf((_e=o.virtualScroll)==null?void 0:_e.settledToken)&&bu()===Be&&(ja=Au(o.virtualScroll.settledToken)));const ft=wt()&&at&&P2(),Et=Yl(je,ft?"final":void 0);return F1(Et,!0),Et})}let N1="content",Xl=null,Jl=null,I1=0,yu=null,Ya=null,L1=null,$1=null;function ku(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Q2(M){var W,G;const Y=yu;if(!Y)return!0;const ie=(G=(W=o.virtualScroll)==null?void 0:W.heightDiffThresholdPx)!=null?G:1;return Math.abs(M.totalHeight-Y.totalHeight)>ie||M.sessionKey!==Y.sessionKey||M.phase!==Y.phase||M.stable!==Y.stable||M.final!==Y.final||M.threadKey!==Y.threadKey||M.nodeCount!==Y.nodeCount||M.measuredCount!==Y.measuredCount||M.width!==Y.width}function Fo(M){if(M==null)return"";if(typeof M=="string"||typeof M=="number"||typeof M=="boolean")return String(M);try{return JSON.stringify(M)}catch{return String(M)}}function bu(M=(W=>(W=o.virtualScroll)==null?void 0:W.settledToken)()){return Fo(M)}function X2(M,W){var G,Y;return[M,W.sessionKey,(G=W.threadKey)!=null?G:"",ur(),x1(),Fo((Y=o.virtualScroll)==null?void 0:Y.settledToken),Math.round(W.totalHeight),Math.round(W.width)].join("\0")}function xu(){L1=null,$1=null,Ya=null}function G8(M){const W=M.heightCache;return W?.length?C1(W):""}function wu(M){var W,G,Y;const ie=M.metrics,_e=M.anchor?(Me=M.anchor).type==="bottom"?`bottom:${Math.round(Me.distanceFromBottomPx)}`:`node:${Me.nodeIndex}:${Math.round(Me.offsetWithinNodePx)}`:"none";var Me;return[M.sessionKey,(W=M.threadKey)!=null?W:"",(G=M.measurementKey)!=null?G:ur(),(Y=M.contentHash)!=null?Y:"",G8(M),_e,M.anchorCaptured?1:0,ie.liveRange.start,ie.liveRange.end,ie.renderedCount,ie.nodeCount,Math.round(ie.totalHeight),Math.round(ie.width),ie.phase,ie.stable?1:0].join("\0")}function F1(M,W=!1){if(!ze.value||(function(Me=!1){return!Me&&Mn.value&&!Xe.value})(W))return;const G=W||Q2(M),Y=(function(Me,Le=!1){return Le||Me.stable||Me.phase==="final"?{state:Va(Me,{includeHeightCache:!0})}:{state:Va(Me)}})(M,W),ie=Y.state,_e=!!(ie&&(G||(function(Me,Le=!1){return!!Le||wu(Me)!==Ya})(ie,W)));if(G&&(I(M),yu=M,I1=ku()),ie&&_e&&(E(ie),ie.anchor&&F(ie.anchor),Ya=wu(ie)),M.stable){const Me=X2("settled",M);if(Me!==L1){L1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-settled",qe)})(M)}}if(M.phase==="final"){const Me=X2("final",M);if(Me!==$1){$1=Me;const Le=Va(M,{includeHeightCache:!0});Le&&(E(Le),Ya=wu(Le)),(function(qe){s("render-final",qe)})(M)}}}function O1(){Xl!=null&&(jn?.(Xl),Xl=null),Jl!=null&&oe&&(window.clearTimeout(Jl),Jl=null)}function J2(){Xl=null,Jl=null,(function(M){if(cr.size>0||Ws!=null)return!0;switch(M){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(N1)&&(dr(),vu()),F1(Yl(N1))}function Bn(M){var W,G;if(!ze.value||(N1=M,Xl!=null||Jl!=null))return;const Y=Math.max(0,(G=(W=o.virtualScroll)==null?void 0:W.emitIntervalMs)!=null?G:32),ie=Math.max(0,Y-(ku()-I1)),_e=()=>{Jl=null,Xl=Tn?Tn(J2):null,Xl==null&&J2()};oe&&ie>0?Jl=window.setTimeout(_e,ie):_e()}function R1(M){var W;if(M<=0)return 0;const G=it.value;if(kt.value)return L2(M);if(Ye.value===G.length&&st.value.length&&Ct.value.length){const ie=Ot.value,_e=st.value,Me=Ct.value,Le=je=>je<=0?0:fo(_e,0,je)+(je-fo(Me,0,je))*ie;let qe=0,Re=G.length-1,Ge=G.length-1;for(;qe<=Re;){const je=qe+Re>>1;Le(je+1)>=M?(Ge=je,Re=je-1):qe=je+1}return Ge}let Y=M;for(let ie=0;ie<G.length;ie++){const _e=(W=ke[ie])!=null?W:Ot.value;if(Y<=_e)return ie;Y-=_e}return Math.max(0,G.length-1)}function eb(){$o.value+=1}function B1(M){return!(Si.value&&M>=co.value)&&(!Vr.value||M<Ss.value||s1.value.has(M))}function Za(M){const W=ff.get(M);W&&(W(),ff.delete(M));const G=Wa.get(M);G&&(G.destroy(),Wa.delete(M)),hf(M)}function tb(M,W){let G=!1;if(W){const _e=no.get(M);no.set(M,W),_e!==W&&(G=!0)}else no.delete(M)&&(G=!0);if(G&&eb(),W||hf(M),!g2.value||!ss||!St.value&&Vr.value&&!H.value&&Wa.size>=640&&(H.value||(H.value=!0,i1()),!g2.value||!ss))return Za(M),void(W&&Yr(M,!0));if(M<Ss.value&&!St.value||s1.value.has(M))return Za(M),void Yr(M,!0);if(!W)return void Za(M);Za(M);const Y=ss(W,{rootMargin:"400px"});if(!Y)return;Wa.set(M,Y),Yr(M,Y.isVisible.value),Vr.value&&(function(_e){if(!oe||!Vr.value)return;hf(_e);const Me=_e%17*23,Le=window.setTimeout(()=>{if(C2.delete(_e),!Vr.value||s1.value.has(_e))return;const qe=no.get(_e);if(!qe)return;const Re=ne(qe),Ge=qe.ownerDocument||document,je=Ge.defaultView||window,Be=!Re||Re===Ge.documentElement||Re===Ge.body,Ke=!Be&&Re?ht("nodeVisibilityFallback.root.getBoundingClientRect",()=>Re.getBoundingClientRect()):null,tt=Be?0:Ke.top,nt=Be?ht("nodeVisibilityFallback.clientHeight",()=>{var at,ft;return(ft=(at=je.innerHeight)!=null?at:Re?.clientHeight)!=null?ft:0}):Ke.bottom,wt=ht("nodeVisibilityFallback.node.getBoundingClientRect",()=>qe.getBoundingClientRect());wt.bottom>=tt-500&&wt.top<=nt+500&&Yr(_e,!0)},1800+Me);C2.set(_e,Le)})(M);let ie=null;ie=Qe(()=>Y.isVisible.value,_e=>{if(_e){hf(M),Yr(M,!0),ie?.(),ff.delete(M),Wa.get(M)===Y&&Wa.delete(M);try{Y.destroy()}catch{}}},{immediate:!0}),ff.set(M,ie),St.value&&ji()}function D1(){Ws=null;for(const[M,W]of cr)cr.delete(M),Ui.get(M)===W.el&&Vl.get(M)===W.version&&Ul(M,W.height,{allowShrink:W.allowShrink})}function Qa(){Ws!=null&&(jn?.(Ws),Ws=null),cr.clear()}function bf(M,W){(function(G,Y,ie){var _e;if(!Number.isFinite(ie)||ie<=0||Ui.get(G)!==Y)return;const Me=Vl.get(G);if(Me==null)return;const Le=it.value[G],qe=te.value&&j.value!==!0&&!((_e=o.nodes)!=null&&_e.length)&&G>=it.value.length-2,Re=!(Le?.loading===!0||qe),Ge=cr.get(G),je=Ge?Ge.allowShrink&&Re:Re,Be=Ge&&!je?Math.max(Ge.height,ie):ie;cr.set(G,{height:Be,allowShrink:je,version:Me,el:Y}),Ws==null&&(Ws=Tn?Tn(D1):null,Ws==null&&D1())})(M,W,ql(M,W))}function dr(){for(const[M,W]of Ui)W&&bf(M,W)}function nb(){Lo?.disconnect(),Lo=null,is.clear()}function P1(){for(;af.length;)df(af.pop())}Qe(Xe,M=>{M&&Bn("content")},{flush:"post"}),t({getVirtualMetrics:Yl,captureVirtualState:function(M={}){var W;return Va(Yl("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:M.allowFallbackAnchor===!0,requireViewport:M.requireViewport===!0,includeEmptyState:(W=M.includeEmptyState)==null||W})},restoreVirtualState:function(M,W={}){const G=W.restoreAnchor===!0,Y=W.restoreToken==null?"imperative":String(W.restoreToken);mu=M,gu={restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0},!A1(M,{restoreAnchor:G,restoreToken:Y,allowUncapturedAnchor:W.allowUncapturedAnchor===!0})&&Y2(M)||(mu=null,gu=null)},forceMeasure:function(M="manual"){return Xn(this,null,function*(){yield mt(),yield Z2(),dr(),vu(),yield mt();const W=Yl(M);return F1(W,!0),W})},settle:T1,scrollToNode:function(M,W="start"){Ka(),rn();const G=it.value.length;if(G<=0)return;const Y=Wo(M,0,G-1),ie=()=>{var _e;const Me=Dt({nodeIndex:Y,offsetWithinNodePx:0}),Le=pf(Y),qe=hu(),Re=(_e=qe?.clientHeight)!=null?_e:0,Ge=He();let je=Me;if(W==="center")je=Me-Re/2+Le/2;else if(W==="end")je=Me-Re+Le;else if(W==="nearest"&&Ge!=null){if(Me>=Ge&&Me+Le<=Ge+Re)return;je=Me<Ge?Me:Me-Re+Le}Rt(Math.max(0,je)),ji({immediate:!0}),St.value&&(si.value=Y,jl())};if(St.value)return si.value=Y,jl(),void mt(ie);ie()}}),Qe(()=>Po.value,M=>{if(!M){nb();for(const W of Kr.values())for(const G of W)df(G);Kr.clear(),Vl.clear(),P1(),Qa()}},{immediate:!0}),Qe(j,M=>{M&&(function(){if(oe&&j.value&&Ui.size){P1();for(const W of[80,240,640]){const G=_2(W,()=>{for(const[Y,ie]of Ui)ie&&bf(Y,ie)},"final");G!=null&&af.push(G)}}})(),Bn(M?"final":"content")}),Qe([()=>it.value.length,()=>co.value],()=>{Fe.value&&Ga(),Bn("content")},{flush:"post",immediate:!0}),Qe([()=>Ho.start,()=>Ho.end],()=>{Bn("batch")},{flush:"post"});const{cleanupBatchScheduler:Y8}=(function(M){const{props:W,isClient:G,isTestEnv:Y,parsedNodesIdentity:ie,parsedNodeCount:_e,desiredRenderedCount:Me,datasetKey:Le,batchingEnabled:qe,incrementalRenderingActive:Re,resolvedBatchSize:Ge,resolvedInitialBatch:je,renderedCount:Be,adaptiveBatchSize:Ke,previousRenderContext:tt,previousBatchConfig:nt,requestFrame:wt,cancelFrame:at,hasIdleCallback:ft,cleanupNodeVisibility:Et,onDatasetKeyChanged:At,onDatasetChanged:tn}=M;let Lt=null,qt=null,zt=!1,fn=null,Us=null,as=0,Mi=!1,Qr=!1;const Xr=new Set,ta=new Set;function bb(){if(G){Lt!=null&&(at?.(Lt),Lt=null),qt!=null&&(window.clearTimeout(qt),qt=null),Us!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(Us),Us=null),as+=1;for(const Zo of Xr)at?.(Zo);Xr.clear();for(const Zo of ta)window.clearTimeout(Zo);ta.clear(),zt=!1,fn=null,Mi=!1,Qr=!1}}function Mf(){return typeof performance<"u"?performance.now():Date.now()}function xb(Zo){(function(fr){var Jr;if(!Re.value)return;const hr=Math.max(2,(Jr=W.renderBatchBudgetMs)!=null?Jr:6),pr=Math.max(1,Ge.value||1),Ei=Math.max(1,Math.floor(pr/4));fr>1.2*hr?Ke.value=Math.max(Ei,Math.floor(.7*Ke.value)):fr<.5*hr&&Ke.value<pr&&(Ke.value=Math.min(pr,Math.ceil(1.2*Ke.value)))})(Zo),Mi=!1;const As=Qr||Be.value<Me.value;Qr=!1,As&&Sb()}function wb(Zo,As={}){var fr,Jr;if(!Re.value)return;const hr=Me.value;if(Be.value>=hr)return;const pr=Math.max(1,Zo),Ei=()=>{const ec=Mf();let tc=0;Lt=null,qt=null,Us=null,zt=!1;const nc=fn??pr;fn=null;const K1=Mf();Be.value=Math.min(hr,Be.value+nc),Et(Be.value),tc=Mf()-K1,(function(G1,Cb){if(!G)return void xb(Cb);Mi=!0;const Ab=++as;mt().then(()=>{var Mb;if(Ab!==as)return;const mE=Mf(),gE=Math.max(Cb,mE-G1),Eb=()=>{Ab===as&&xb(gE)};if(wt){let Nb=!1,mr=null;const Ib=()=>{Nb||(Nb=!0,Eb())},Ef=wt(()=>{Xr.delete(Ef),mr!=null&&(window.clearTimeout(mr),ta.delete(mr),mr=null),Ib()});return Xr.add(Ef),mr=window.setTimeout(()=>{mr!=null&&ta.delete(mr),mr=null,at?.(Ef),Xr.delete(Ef),Ib()},Math.max(32,(Mb=W.renderBatchIdleTimeoutMs)!=null?Mb:120)),void ta.add(mr)}const Tb=window.setTimeout(()=>{ta.delete(Tb),Eb()},0);ta.add(Tb)})})(ec,tc)};if(!G||As.immediate)return void Ei();const el=Math.max(0,(fr=W.renderBatchDelay)!=null?fr:16);if(fn=fn!=null?Math.max(fn,pr):pr,!zt){if(zt=!0,!Y&&ft&&window.requestIdleCallback){const ec=Math.max(0,(Jr=W.renderBatchIdleTimeoutMs)!=null?Jr:120);return void(Us=window.requestIdleCallback(()=>Ei(),{timeout:ec}))}wt&&!Y?Lt=wt(()=>{el!==0?qt=window.setTimeout(()=>Ei(),el):Ei()}):qt=window.setTimeout(()=>Ei(),el)}}function _b(Zo,As={}){Mi?Qr=!0:Zo==null?Sb():wb(Zo,As)}function Sb(){Re.value&&wb(qe.value?Math.max(1,Math.round(Ke.value)):Math.max(1,Ge.value))}return Qe([ie,_e,Le,Re,Ge,je,()=>W.renderBatchDelay],()=>{var Zo;const As=_e.value,fr=tt.value,Jr=Le.value,hr=!Object.is(Jr,fr.key),pr=As!==fr.total,Ei=hr||pr;tt.value={key:Jr,total:As};const el=nt.value,ec=(Zo=W.renderBatchDelay)!=null?Zo:16,tc=el.batchSize!==Ge.value||el.initial!==je.value||el.delay!==ec||el.enabled!==Re.value;nt.value={batchSize:Ge.value,initial:je.value,delay:ec,enabled:Re.value},hr&&At(As),(Ei||tc||!Re.value)&&bb(),(Ei||tc)&&(Ke.value=Math.max(1,Ge.value||1)),Ei&&tn();const nc=Me.value;if(!As)return Be.value=0,void Et(0);if(!Re.value)return Be.value=nc,void Et(Be.value);const K1=hr||fr.total===0;Be.value=K1||tc?Math.min(nc,je.value):Math.min(Be.value,nc);const G1=Math.max(1,je.value||Ge.value||As);Be.value<nc?_b(G1,{immediate:!G}):Et(Be.value)},{immediate:!0}),Qe(Me,(Zo,As)=>{Re.value&&(typeof As=="number"&&Zo<=As||Zo>Be.value&&_b())}),{cleanupBatchScheduler:bb}})({props:x,isClient:oe,isTestEnv:ti,parsedNodesIdentity:ao,parsedNodeCount:Yn,desiredRenderedCount:cf,datasetKey:W8,batchingEnabled:Wi,incrementalRenderingActive:Si,resolvedBatchSize:Io,resolvedInitialBatch:Ss,renderedCount:co,adaptiveBatchSize:Ci,previousRenderContext:ni,previousBatchConfig:ar,requestFrame:Tn,cancelFrame:jn,hasIdleCallback:Ps,cleanupNodeVisibility:O8,onDatasetKeyChanged:M=>{Qa(),oo(),ii(),xu(),M>0&&wn(M)},onDatasetChanged:()=>{St.value&&ji({immediate:!0})}});Qe([v2,St,()=>S.value,()=>J()],([M,W])=>{if(!M)return A2(),void o1();R8(),W?ji({immediate:!0}):o1()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,()=>St.value],M=>Xn(null,[M],function*([W,G]){G&&W&&oe&&(yield mt(),ji({immediate:!0}))}),{flush:"post"}),Qe(kt,M=>{M&&(function(){var W;if(go.value&&os.value&&qn.value&&((W=to.value)!=null&&W[1]))return;const G=pt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=pt({type:"list_item",children:[G],raw:"- Probe paragraph text"}),ie=pt({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});go.value=G,os.value=Y,qn.value=ie;const _e={1:null,2:null,3:null,4:null,5:null,6:null};for(let Me=1;Me<=6;Me++)_e[Me]=pt({type:"heading",level:Me,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Me)} Probe heading`});to.value=_e})()},{immediate:!0}),Qe([()=>S.value,kt],()=>{if(!kt.value)return l1(),void(K.value=0);E2(),l1(),kt.value&&S.value&&typeof ResizeObserver<"u"&&(du=new ResizeObserver(()=>{E2(),we.value&&Un(),Fe.value&&Ga(),Bn("resize")}),du.observe(S.value))},{immediate:!0}),Qe([kt,Wn,zs],()=>Xn(null,null,function*(){if(!kt.value)return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();yield mt(),(function(){if(!kt.value||typeof window>"u")return V.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ii();const M={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},W=M2(r1(L.value),".paragraph-node");M.paragraph=J0(L.value,W,"pre-wrap");const G=r1(R.value),Y=G?.querySelector(".paragraph-node");M.listItem=J0(R.value,Y,"pre-wrap");const ie=ht("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Me,Le;return(Le=(Me=D.value)==null?void 0:Me.offsetHeight)!=null?Le:0}),_e=ht("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Me,Le;return(Le=(Me=R.value)==null?void 0:Me.offsetHeight)!=null?Le:0});M.listWrapperOverhead=Math.max(0,ie-_e);for(let Me=1;Me<=6;Me++){const Le=M2(r1(z[Me]),`h${Me}`);M.headings[Me]=J0(z[Me],Le,"pre-wrap")}V.value=M,ii()})()}),{flush:"post",immediate:!0}),Qe(()=>it.value.length,()=>{St.value&&ji({immediate:!0})}),Qe([kt,K],()=>{ii(),St.value&&ji({immediate:!0}),we.value&&Un(),Fe.value&&Ga(),Bn("resize")},{immediate:!1}),Qe(()=>Vr.value,M=>{if(M)for(const[W,G]of no)tb(W,G);else{i1();for(const[W,G]of no)G&&Yr(W,!0)}},{immediate:!1}),Qe([()=>x.viewportPriority,()=>it.value.length],([M,W])=>{M!==!1?H.value&&W<=200&&(H.value=!1):H.value=!1}),Qe(()=>co.value,()=>{St.value&&ji({immediate:!0})}),Qe([si,En,uu,()=>it.value.length,St],()=>{jl()},{immediate:!0});let _u=null,Su=!1,Xa=null;function Cu(){_u=null,g1=null,m1=void 0,ja=null,xu()}function H1(){Qa(),oo(),ii(),zn.clear();const M=it.value.length;M>0&&wn(M),M1()}function W1(){O1(),S2(),yu=null,Zl=null,Ql=null,yf=null,mu=null,gu=null,Su=!1,Cu(),B2("restore"),rn(),Ka()}function Au(M){var W;return[(W=Mo())!=null?W:"",Vn(),ur(),mf.value,bu(M),it.value.length,Math.round(Zr(0,it.value.length)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")}function ob(){return Xn(this,null,function*(){var M,W,G,Y;const ie=(M=o.virtualScroll)==null?void 0:M.settledToken,_e=bu(ie),Me=Vn(),Le=Mo(),qe=zs.value;if(ze.value&&((W=o.virtualScroll)==null?void 0:W.settleMode)==="manual"&&gf(ie))if(v1()){if(Au(ie)!==ja&&!Su){Su=!0;try{const Re=yield T1({reason:"manual",expectedSettledTokenKey:_e}),Ge=bu()===_e;E1(Me,Le,qe)&&Re.sessionKey===Me&&Re.threadKey===Le&&Ge&&Re.stable&&Re.phase==="final"&&(ja=Au((G=o.virtualScroll)==null?void 0:G.settledToken))}finally{Su=!1,yield mt();const Re=(Y=o.virtualScroll)==null?void 0:Y.settledToken,Ge=gf(Re)?Au(Re):"";E1(Me,Le,qe)&&Ge&&ja!==Ge&&ob()}}}else Bn("manual")})}Qe(ze,(M,W)=>{if(M!==W){if(!M)return W1(),void O1();W1(),H1(),Xa=zs.value,Bn("content")}},{flush:"post"}),Qe([ze,zs],([M,W])=>{M?Xa!=null?Xa!==W&&(Xa=W,(function(G="resize"){Qa(),oo(),ii(),zn.clear();const Y=it.value.length;Y>0&&wn(Y),M1(),Zl=null,Ql=null,yf=null,yu=null,Su=!1,Cu(),G2(),mt(()=>{dr(),we.value&&Un(),Fe.value&&Ga(),Bn(G)})})("resize")):Xa=W:Xa=null},{flush:"post",immediate:!0}),Qe([ze,()=>Vn(),()=>Mo()],([M])=>{M&&(W1(),H1(),B2("content"),Bn("content"))}),Qe([ze,()=>Vn(),()=>Mo(),zs,()=>it.value.length],([M])=>{M&&(function(W="async-node"){let G=!1;for(const[Y,ie]of Array.from(qi.entries()))h1(ie)||(qi.delete(Y),Hs.delete(Y),G=!0);G&&(Ua(),Bn(W))})("async-node")},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.sessionKey},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>o.indexKey,()=>Z.value],([M])=>{M&&(xu(),(function(W="content"){if(!ze.value)return;const G=[],Y=it.value.length;for(const ie of Array.from(zn.keys())){if(ie>=Y){G.push(ie);continue}const _e=pu(ie),Me=zn.get(ie);Me!=null&&Me!==_e&&G.push(ie),zn.set(ie,_e)}for(const ie of Array.from(zn.keys()))ie>=Y&&zn.delete(ie);G.length&&((function(ie,_e={}){const Me=Array.from(ie,Number);Mt(Me,_e)>0&&(function(qe){for(const Re of qe)zn.delete(Re)})(Me)})(G,{notify:!1}),ii(),Cu(),we.value&&Un(),Fe.value&&Ga(),Bn(W))})("content"))},{flush:"post",immediate:!0}),Qe([ze,()=>it.value.length,()=>Vn(),()=>Mo()],([M,W,G,Y],[ie,_e,Me,Le])=>{M&&ie&&G===Me&&Y===Le&&W!==_e&&Cu()},{flush:"post"}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCache},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.heightCacheWidth},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],()=>{G2()},{flush:"post",immediate:!0}),Qe([ze,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreAnchor},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey},()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W,G]){if(!W||!G)return;yield mt();const Y=(function(){var ie;const _e=(ie=o.virtualScroll)==null?void 0:ie.restoreAnchor;return _e==null||_e===!1?null:_e===!0?"true":String(_e)})();A1(G,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Qe([ze,K,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.restoreState},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.measurementKey}],([M])=>{var W;if(!M)return;const G=(W=o.virtualScroll)==null?void 0:W.restoreState;G&&Zl&&Ql==="restore"&&(V2(G)||(H1(),Zl=null,Ql=null,Bn("resize")))},{flush:"post"}),Qe([ze,()=>it.value.length,()=>Vn(),K],M=>Xn(null,[M],function*([W]){var G;const Y=mu,ie=gu;W&&Y&&(yield mt(),!A1(Y,{restoreAnchor:ie?.restoreAnchor===!0,restoreToken:(G=ie?.restoreToken)!=null?G:"imperative",allowUncapturedAnchor:ie?.allowUncapturedAnchor===!0})&&Y2(Y)||(mu=null,gu=null))}),{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>Oe.count,()=>Oe.total],([M,W,G])=>{if(!M||W!==!0||G==="manual"||!y1())return;const Y=(function(){var ie;const _e=it.value.length;return[(ie=Mo())!=null?ie:"",Vn(),ur(),mf.value,_e,Math.round(Zr(0,_e)),Math.round(Gl()),Oe.count,Math.round(Oe.total)].join(":")})();_u!==Y&&(_u=Y,T1({reason:"final"}).then(ie=>{ie.stable||_u!==Y||(_u=null)}))},{flush:"post",immediate:!0}),Qe([ze,j,()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settleMode},()=>{var M;return(M=o.virtualScroll)==null?void 0:M.settledToken},()=>Vn(),()=>Mo(),zs,t1,k2,()=>co.value,cf,()=>it.value.length,()=>Oe.count,()=>Oe.total],()=>{ob()},{flush:"post",immediate:!0}),Qe([()=>it.value.length,St,En,uu,()=>Ho.start,()=>Ho.end],([M,W,G,Y,ie,_e])=>{ue.value&&Ie("virtualization",{nodes:M,virtualization:W,maxLiveNodes:G,buffer:Y,focusIndex:si.value,scroll:W?(()=>{const Me=Ue.value||ne();return Me?{reverse:q(Me),scrollTop:Math.round(Me.scrollTop),scrollTopAbs:Math.round(Math.abs(Me.scrollTop)),scrollHeight:Math.round(Me.scrollHeight),clientHeight:Math.round(Me.clientHeight)}:null})():null,liveRange:{start:ie,end:_e},rendered:co.value})}),Qe([()=>x.customId],([M],W,G)=>{if(!M||vn)return;const Y=(function(ie,_e){return ie?(Eo.controllers[ie]=_e,()=>{Eo.controllers[ie]===_e&&delete Eo.controllers[ie]}):()=>{}})(M,{captureRestoreAnchor:Cs,restoreAnchor:Q,getAnchorDrift:be,getReport:D8});G(()=>{Y()})},{immediate:!0}),po(()=>{(function(){if(ze.value)try{dr(),vu();const M=Yl("manual");Q2(M)&&(I(M),yu=M,I1=ku());const W=Va(M,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});W&&(E(W),W.anchor&&F(W.anchor),Ya=wu(W))}catch{}})(),Y8(),i1(),De(),nb();for(const M of Kr.values())for(const W of M)df(W);Kr.clear(),Vl.clear(),zn.clear(),P1(),Qa(),l1(),rn(),Ka(),O1(),A2(),o1()});const Z8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index11-CwW_hjK7.js"),__vite__mapDeps([8,5]))).default}catch(M){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".',M),qs}}),loadingComponent:Tee,delay:0}),Q8=Li({loader:()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index10-DTJJNuIm.js"),[])).default}catch(M){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.',M),qs}}),loadingComponent:Eee,delay:0}),X8=Li(()=>Xn(null,null,function*(){try{return(yield ms(()=>import("./index7-XmRlMUpI.js"),[])).default}catch(M){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".',M),qs}})),sb={text:ro,paragraph:Ma,heading:Ip,code_block:j0,list:qc,list_item:Uc,blockquote:Th,table:hd,definition_list:Nh,footnote:Ih,footnote_reference:Zs,footnote_anchor:dd,admonition:Oh,vmr_container:$h,hardbreak:Ml,link:xs,image:Al,thematic_break:Lh,math_inline:Pi,math_block:GM,strong:ks,emphasis:ws,strikethrough:bs,highlight:Xs,insert:Rs,subscript:Os,superscript:Fs,emoji:$s,checkbox:Ys,checkbox_input:Ys,inline_code:ts,html_inline:Qs,reference:ys,html_block:fd},J8=B(()=>d1()),ib=B(()=>eC(x.codeBlockProps)),eE=B(()=>eC(x.codeBlockProps,{omit:["langs"]})),rb=B(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,monacoOptions:x.codeBlockMonacoOptions,themes:x.themes,langs:u.value==="shiki"?x.langs:void 0,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),eE.value)),lb=B(()=>lt(Pt(lt({},rb.value),{langs:x.langs}),ib.value));function ab(M){return typeof M=="boolean"?M:void 0}const tE=B(()=>{const M=x.codeBlockProps||{},W={},G=ab(M.showLineNumbers);G!==void 0&&(W.showLineNumbers=G);const Y=ab(M.diffInline);Y!==void 0&&(W.diffInline=Y);const ie=(function(_e){const Me=Number(_e);return Number.isFinite(Me)&&Me>0?Me:void 0})(M.reservedHeightPx);return ie!==void 0&&(W.reservedHeightPx=ie),W}),nE=B(()=>lt(lt({stream:x.codeBlockStream,darkTheme:x.codeBlockDarkTheme,lightTheme:x.codeBlockLightTheme,themes:x.themes,langs:x.langs,minWidth:x.codeBlockMinWidth,maxWidth:x.codeBlockMaxWidth},typeof Se.value=="boolean"?{showTooltips:Se.value}:{}),ib.value)),oE=B(()=>lt({},x.mermaidProps||{})),cb=B(()=>lt({},x.d2Props||{})),sE=B(()=>lt({},x.infographicProps||{})),Mu=B(()=>({typewriter:x.typewriter,fade:x.fade,customHtmlTags:lo.value.customHtmlTags})),iE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltip:Se.value}:{})),rE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),lE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{})),aE=B(()=>lt(lt({},Mu.value),typeof Se.value=="boolean"?{showTooltips:Se.value}:{}));function cE(M){return Array.isArray(M.children)&&M.children.length>0}const z1=B(()=>B8.value.map(M=>{var W,G,Y,ie,_e,Me,Le,qe;let Re=(function(at){var ft,Et,At,tn,Lt,qt,zt;if(at.type!=="code_block")return at;const fn=at,Us=[String((ft=fn.language)!=null?ft:""),String((Et=fn.loading)!=null?Et:""),String((At=fn.diff)!=null?At:""),String((tn=fn.code)!=null?tn:""),String((Lt=fn.originalCode)!=null?Lt:""),String((qt=fn.updatedCode)!=null?qt:""),String((zt=fn.raw)!=null?zt:"")].join("\0"),as=Ai.get(fn);if(as&&as.signature===Us)return as.node;const Mi=lt({},fn);return Ai.set(fn,{signature:Us,node:Mi}),Mi})(M.node);const Ge=xf(Re);let je=hb(Re,Ge);if((Re.type==="html_block"||Re.type==="html_inline")&&je===sb[Re.type]){const at=Re,ft=String((W=at.tag)!=null?W:"").trim().toLowerCase()||D6(at.content);if(ft){const Et=Wt.value[ft];if(Hn.value.has(ft)&&Et)je=Et,Re=Pt(lt({},at),{type:ft,tag:ft,content:jV(at.content,ft)});else if(P6((G=at.content)!=null?G:at.raw,ft)){const At=String((ie=(Y=at.content)!=null?Y:at.raw)!=null?ie:"");Re.type==="html_inline"?(je=ro,Re={type:"text",content:At,raw:At}):(je=Ma,Re={type:"paragraph",children:[{type:"text",content:At,raw:At}],raw:At})}}}const Be=Re.type==="code_block"&&u.value==="pre"&&je===qs&&!U1(Wt.value,Ge);let Ke=lt({},(function(at,ft,Et){const At=ft??xf(at);if(at.type==="code_block"){const tn=At?U1(Wt.value,At):void 0;if(Et&&u.value==="pre"&&!tn&&Et===qs)return tE.value;if(Et&&At&&Et===tn)return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:lb.value;if(Et&&Et===Wt.value.code_block)return lb.value;if(N2(Et))return nE.value}return At==="mermaid"?db(at):At==="infographic"?fb(at):At==="d2"||At==="d2lang"?cb.value:at.type==="link"?iE.value:at.type==="list"?rE.value:at.type==="blockquote"?lE.value:at.type==="table"?aE.value:at.type==="code_block"?rb.value:Mu.value})(Re,Ge,je));const tt=Kl.value[M.index];Re.type==="code_block"&&tt?.kind==="code-block"&&(Ke=Pt(lt({},Ke),Be?{reservedHeightPx:(_e=tt.height)!=null?_e:tt.contentHeight}:{estimatedHeightPx:tt.height,estimatedContentHeightPx:tt.contentHeight})),Be||Re.type!=="code_block"||Ge!=="mermaid"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:_v(xv(String((Me=Re.code)!=null?Me:"")))})),Be||Re.type!=="code_block"||Ge!=="infographic"||Ec(Ke.estimatedPreviewHeightPx)!=null||(Ke=Pt(lt({},Ke),{estimatedPreviewHeightPx:Sv(wv(String((Le=Re.code)!=null?Le:"")))})),Re.type==="math_block"&&(Ke=Pt(lt({},Ke),{cacheScope:ns.value}));const nt=(function(at,ft){const Et=String(at.type);return!ef(Et)&&Wt.value[Et]===ft})(Re,je),wt=nt?_k(Re,Te.value):void 0;return Pt(lt({},M),{node:Re,component:je,bindings:Ke,customBindings:lt(lt({},wt??{}),Ke),rendersCustomNode:nt,hasSlotChildren:cE(Re),slotContent:String((qe=Re.content)!=null?qe:""),isCodeBlock:Re.type==="code_block",indexKey:`${J8.value}-${M.index}`})}));function xf(M){var W;return M?.type==="code_block"?String((W=M.language)!=null?W:"").trim().toLowerCase():""}function U1(M,W){const G=W.trim().toLowerCase();if(G)for(const Y of[G,gk(G),$M(G)]){const ie=Y&&M[Y];if(ie)return ie}}function ub(M,W,G,Y){var ie,_e;const Me=lt({},M.value);return Ec(Me.estimatedPreviewHeightPx)==null&&(Me.estimatedPreviewHeightPx=Y(G(String((ie=W?.code)!=null?ie:"")),void 0,Me.maxHeight==="none"?null:(_e=Ec(Me.maxHeight))!=null?_e:void 0)),Me}function db(M){return ub(oE,M,xv,_v)}function fb(M){return ub(sE,M,wv,Sv)}function hb(M,W){if(!M)return Fv;const G=Wt.value,Y=G[String(M.type)];if(M.type==="code_block"){const ie=W??xf(M),_e=ie?U1(G,ie):void 0;return _e||(u.value==="pre"?G.code_block||qs:ie==="mermaid"?G.mermaid||Z8:ie==="infographic"?G.infographic||Q8:ie==="d2"||ie==="d2lang"?G.d2||X8:Y||G.code_block||I2.value)}return Y||sb[String(M.type)]||Fv}function q1(M){s("click",M)}function uE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseover",M)}function dE(M){var W;(W=M.target)!=null&&W.closest("[data-node-index]")&&s("mouseout",M)}function pb(M){s("mouseover",M)}function mb(M){s("mouseout",M)}const ea=X(null),Vi=X(!1);let Eu,Ja=null,j1=0,wf=0,_f=0;const gb=["code_block","admonition","table","math_block","html_block","image","thematic_break"],fE=new Set(gb),vb=[".typewriter-cursor",".height-estimation-probes",...gb.map(M=>`[data-node-type="${M}"]`),"script","style"].join(",");function yb(M){if(!M||typeof M!="object")return!1;const W=M.type;return typeof W=="string"&&fE.has(W)}function Sf(M){var W,G;if(!M||typeof M!="object")return 0;const Y=M,ie=(G=(W=Y.raw)!=null?W:Y.content)!=null?G:Y.code;if(typeof ie=="string")return ie.length;const _e=Y.children;if(Array.isArray(_e))return _e.reduce((Le,qe)=>Le+Sf(qe),0);const Me=Y.items;return Array.isArray(Me)?Me.reduce((Le,qe)=>Le+Sf(qe),0):0}function Cf(){Eu&&(clearTimeout(Eu),Eu=void 0)}function kb(){j1+=1,Ja!=null&&(jn?.(Ja),Ja=null)}function Af(){kb(),ea.value&&(ea.value.style.visibility="hidden")}function hE(M){var W;if(M.nodeType!==Node.TEXT_NODE||!((W=M.textContent)!=null?W:"").trim())return!1;const G=M.parentElement;return!!G&&!G.closest(vb)}function pE(M){let W=M.lastChild;for(;W;){if(hE(W))return W;if(W.nodeType===Node.ELEMENT_NODE){const G=W;if(!G.matches(vb)&&G.lastChild){W=G.lastChild;continue}}for(;W&&W!==M&&!W.previousSibling;)W=W.parentNode;if(!W||W===M)break;W=W.previousSibling}return null}function V1(){if(!oe||!Vi.value||Ja!=null)return;const M=j1,W=()=>{Ja=null,M===j1&&(function(){var G,Y;if(!(oe&&Vi.value&&S.value&&ea.value))return;const ie=S.value,_e=ea.value;_e.style.visibility="hidden";const Me=(function(){const je=z1.value;for(let Be=je.length-1;Be>=0;Be--){const Ke=je[Be];if(!Ke||yb(Ke.node)||!B1(Ke.index))continue;const tt=no.get(Ke.index);if(!tt)continue;const nt=pE(tt);if(nt)return nt}return null})();if(!Me)return;let Le=0,qe=0,Re=20,Ge=!1;if(Me?.textContent){const je=Me.textContent.length,Be=document.createRange();Be.setStart(Me,Math.max(0,je-1)),Be.setEnd(Me,je);const Ke=typeof Be.getClientRects=="function"?Be.getClientRects():void 0,tt=(Y=Ke?.[Ke.length-1])!=null?Y:(G=Me.parentElement)==null?void 0:G.getBoundingClientRect();if(tt){const nt=ht("typewriterCursor.root.getBoundingClientRect",()=>ie.getBoundingClientRect());Le=tt.right-nt.left+ie.scrollLeft,qe=tt.top-nt.top+ie.scrollTop,Re=tt.height||Re,Ge=!0}Be.detach()}Ge&&(_e.style.transform=`translate(${Math.max(0,Le)}px, ${Math.max(0,qe)}px)`,_e.style.height=`${Re}px`,_e.style.visibility="visible")})()};Tn?Ja=Tn(W):W()}return Qe([ve,()=>o.content,()=>o.nodes,()=>x.typewriter,j],()=>Xn(null,null,function*(){var M,W;if(!oe||ce.value||!P.value)return;if(j.value)return Vi.value=!1,Cf(),void Af();if((M=o.nodes)!=null&&M.length)return Vi.value=!1,Cf(),Af(),wf=((W=o.content)!=null?W:"").length,void(_f=ve.value.length);const G=(function(){var Le,qe;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((Re,Ge)=>Re+Sf(Ge),0):((qe=o.content)!=null?qe:"").length})(),Y=(function(){var Le;return(Le=o.nodes)!=null&&Le.length?o.nodes.reduce((qe,Re)=>qe+Sf(Re),0):ve.value.length})(),ie=!yb(it.value[it.value.length-1]),_e=G>wf,Me=Y>_f;if(x.typewriter===!1||!ie||!_e&&!Me)return x.typewriter!==!1&&ie||(Vi.value=!1,Af()),wf=G,void(_f=Y);wf=G,_f=Y,Vi.value=!0,ea.value&&(ea.value.style.visibility="hidden"),Cf(),yield mt(),V1(),Eu=setTimeout(()=>{Eu=void 0,Vi.value=!1},3e3)}),{flush:"post",immediate:!0}),Qe(Vi,M=>Xn(null,null,function*(){M?(yield mt(),V1()):Af()}),{flush:"post"}),Qe([()=>co.value,()=>Ho.start,()=>Ho.end],()=>Xn(null,null,function*(){oe&&!ce.value&&P.value&&Vi.value&&(yield mt(),V1())}),{flush:"post"}),po(()=>{Cf(),kb(),dn.clear()}),(M,W)=>{const G=WT("NodeRenderer",!0);return C(ce)?(w(!0),T(Pe,{key:0},ot(z1.value,Y=>(w(),T(Pe,{key:Y.index},[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[0]||(W[0]=ie=>s("copy",ie)),onHandleArtifactClick:W[1]||(W[1]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onClick:q1,onMouseover:pb,onMouseout:mb,onCopy:W[2]||(W[2]=ie=>s("copy",ie)),onHandleArtifactClick:W[3]||(W[3]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(w(),T("div",{key:1,ref_key:"containerRef",ref:S,class:We(["markstream-vue markdown-renderer",[{dark:x.isDark},{virtualized:St.value},{"virtual-scroll-coordinated":Xe.value}]]),"data-custom-id":x.customId,onClick:q1,onMouseover:uE,onMouseout:dE},[Ht.value||St.value?(w(),T(Pe,{key:0},[Ht.value?(w(),T("div",{key:0,class:"height-estimation-probes",style:Yt({width:`${Wn.value}px`}),"aria-hidden":"true"},[_("div",{ref_key:"paragraphProbeWrapperRef",ref:L,class:"node-content","data-probe":"paragraph"},[re(C(Ma),{node:go.value,"index-key":"probe-paragraph"},null,8,["node"])],512),_("div",{ref_key:"listItemProbeWrapperRef",ref:R,class:"node-content","data-probe":"list-item"},[_("ul",Iee,[re(C(Uc),{node:os.value,"index-key":"probe-list-item"},null,8,["node"])])],512),_("div",{ref_key:"listProbeWrapperRef",ref:D,class:"node-content","data-probe":"list"},[re(C(qc),{node:qn.value,"index-key":"probe-list"},null,8,["node"])],512),(w(),T(Pe,null,ot(6,Y=>_("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:ie=>(function(_e,Me){_e<1||_e>6||(z[_e]=Me)})(Y,ie),class:"node-content","data-probe":`heading-${Y}`},[re(C(Ip),{node:F8(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,Lee)),64))],4)):ae("",!0),St.value?(w(),T("div",{key:1,class:"node-spacer",style:Yt({height:`${c1.value}px`}),"aria-hidden":"true"},null,4)):ae("",!0)],64)):ae("",!0),(w(!0),T(Pe,null,ot(z1.value,Y=>(w(),T("div",{key:Y.index,ref_for:!0,ref:ie=>tb(Y.index,ie),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[B1(Y.index)?(w(),T("div",{key:0,ref_for:!0,ref:ie=>(function(_e,Me){var Le;Me||(function(je){const Be=`${d1()}-${je}`;let Ke=!1;for(const tt of Array.from(Hs.keys())){const nt=qi.get(tt);(nt?.index===je||tt===Be||tt.startsWith(`${Be}-`))&&(Hs.delete(tt),qi.delete(tt),Ke=!0)}Ke&&(Ua(),Bn("async-node"))})(_e),cr.delete(_e),(function(je){var Be;const Ke=((Be=Vl.get(je))!=null?Be:0)+1;Vl.set(je,Ke)})(_e);const qe=Kr.get(_e);if(qe){for(const je of qe)df(je);Kr.delete(_e)}if((function(je){const Be=is.get(je);Be&&(Lo?.unobserve(Be),rs.delete(Be),is.delete(je))})(_e),!Me||!Po.value)return Ui.delete(_e),void Vl.delete(_e);Ui.set(_e,Me);const Re=()=>{bf(_e,Me)};queueMicrotask(Re);const Ge=(Lo||typeof ResizeObserver>"u"||(Lo=new ResizeObserver(je=>{if(je.length)for(const Be of je){const Ke=rs.get(Be.target),tt=is.get(Ke??-1);Ke!=null&&tt&&bf(Ke,tt)}else dr()})),Lo);if(Ge&&(is.set(_e,Me),rs.set(Me,_e),Ge.observe(Me)),typeof window<"u"){const je=((Le=it.value[_e])==null?void 0:Le.type)==="code_block"?[16,80,240,800]:j.value?[80]:[];if(je.length){const Be=je.map(Ke=>_2(Ke,Re,"node-resize")).filter(Ke=>Ke!=null);Be.length&&Kr.set(_e,Be)}}})(Y.index,ie),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[8]||(W[8]=ie=>s("copy",ie)),onHandleArtifactClick:W[9]||(W[9]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[10]||(W[10]=ie=>s("copy",ie)),onHandleArtifactClick:W[11]||(W[11]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(Il,{key:0,name:"fade",css:x.fade!==!1,appear:x.fade!==!1},{default:Ee(()=>[Y.rendersCustomNode?(w(),xe(jo(Y.component),yn({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[4]||(W[4]=ie=>s("copy",ie)),onHandleArtifactClick:W[5]||(W[5]=ie=>s("handleArtifactClick",ie))}),{default:Ee(()=>[Y.hasSlotChildren?(w(),xe(G,yn({key:0,ref_for:!0},Gn.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(w(),xe(G,yn({key:1,ref_for:!0},Gn.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ae("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(w(),xe(jo(Y.component),yn({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":x.customId,"is-dark":x.isDark,onCopy:W[6]||(W[6]=ie=>s("copy",ie)),onHandleArtifactClick:W[7]||(W[7]=ie=>s("handleArtifactClick",ie))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(w(),T("div",{key:1,class:"node-placeholder",style:Yt({height:`${pf(Y.index)}px`})},null,4))],8,$ee))),128)),Vi.value?(w(),T("span",{key:1,ref_key:"typewriterCursorRef",ref:ea,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ae("",!0),St.value?(w(),T("div",{key:2,class:"node-spacer",style:Yt({height:`${u1.value}px`}),"aria-hidden":"true"},null,4)):ae("",!0)],42,Nee))}}})),[["__scopeId","data-v-2e8e6e17"]]),Bs=l5;Bs.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Bs.__name,Bs.name].filter(n=>!!n));for(const n of t)e.component(n,l5)};const Nk=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"})),Fee={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"},Oee={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"},Ree={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"},Bee={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"},Dee={class:"admonition-title"},Pee=["aria-expanded","aria-controls"],Hee=["id"],Oh=gn(Ze({__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=B(()=>{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=X(!!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)=>(w(),T("div",{class:We(["admonition",[`admonition-${o.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[o.node.kind==="note"||o.node.kind==="info"?(w(),T("svg",Fee,[...u[1]||(u[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):o.node.kind==="tip"?(w(),T("svg",Oee,[...u[2]||(u[2]=[_("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),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):o.node.kind==="warning"||o.node.kind==="caution"?(w(),T("svg",Ree,[...u[3]||(u[3]=[_("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),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):o.node.kind==="danger"||o.node.kind==="error"?(w(),T("svg",Bee,[...u[4]||(u[4]=[_("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),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):ae("",!0),_("span",Dee,O(i.value),1),o.node.collapsible?(w(),T("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(w(),T("svg",{style:Yt({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]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,Pee)):ae("",!0)]),Fn(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[re(C(Bs),{"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,Hee),[[mi,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Oh.install=e=>{e.component(Oh.__name,Oh)};const a5=()=>ms(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let sh=null,Wee=a5;function x_e(){return Xn(this,null,function*(){if(sh)return sh;const e=Wee;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===a5?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(sh=(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),sh):null})}function w_e(){return!1}function __e(){return Xn(this,null,function*(){return null})}const ih=X(!1);let dC=!1;function tg(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function zee(){return!dC&&typeof window<"u"&&typeof document<"u"&&(dC=!0,ih.value=tg(),new MutationObserver(()=>{ih.value=tg()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{ih.value=tg()})),ih}const c5=["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"],Uee=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),Pv=[...c5].sort((e,t)=>t.length-e.length).join("|"),ng=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${Pv}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${Pv})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),u5=/[),.;!?,。;!?)]+$/;function qee(e){const t=e.toLowerCase();return c5.some(n=>t.endsWith(`.${n}`))}function jee(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${Pv}))["']`,"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 Vee(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(u5,"");if(!s)return null;const i=s.split("/").pop()??s,r=s.includes("/"),l=Uee.has(i),a=qee(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 Kee(e,t={}){const n=[];ng.lastIndex=0;let o;for(;(o=ng.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(u5,""),u=a.length-c.length;a=c;const d=Vee(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&&(ng.lastIndex-=u)}return n}const Gee=12e4,Yee=6e4,Zee=32,Qee=3e4,fC=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function Xee(e){let t=0,n=0,o=0;fC.lastIndex=0;let s;for(;(s=fC.exec(e))!==null;){const r=s[3]??"";t+=1,n+=r.length,o=Math.max(o,r.length)}return{codeRenderer:e.length>=Gee||n>=Yee||t>=Zee||o>=Qee?"pre":"shiki",codeFenceCount:t,codeChars:n}}function Jee(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function ete(e){return new Worker("/assets/mermaidParser.worker-Dx4jPi9z.js",{type:"module",name:e?.name})}const tte={key:1,class:"diff-wrap"},nte={class:"diff-bar"},ote=["aria-label","onClick"],ste={class:"diff-pre"},ite={key:0,class:"diff-sign"},rte={class:"diff-text"},lte="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hC="github-light",pC="github-dark",ate=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){BQ(),ZQ(),PQ(),tX(),DQ(new Jee),eX(new ete);function t(R){return R.inline.ruler.disable("math"),R}const{t:n}=Tt(),o=Kt("resolveImage"),s=X(null),i=e,r=B(()=>!i.streaming),l=B(()=>jee(i.text??"")),a=B(()=>i.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:Xee(i.text??"")),c=zee(),u=B(()=>!i.streaming),d=Bo(new Map),f=new Set,h=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,p=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function g(R){return!/^(https?:|data:|blob:)/i.test(R)}function b(R){if(!o)return;const D=[];for(const z of[h,p]){z.lastIndex=0;let H;for(;(H=z.exec(R))!==null;)D.push(H[2]??"")}for(const z of D)!z||!g(z)||d.has(z)||f.has(z)||(f.add(z),o(z).then(H=>{d.set(z,H!==z?H:"")}).catch(()=>{d.set(z,"")}).finally(()=>{f.delete(z)}))}function v(R){if(!o)return R;const D=z=>{if(!g(z))return null;const H=d.get(z);return H===void 0?lte:H===""?null:H};return R.replace(h,(z,H,U,Z)=>{const K=D(U);return K===null?z:`${H}${K}${Z}`}).replace(p,(z,H,U,Z)=>{const K=D(U);return K===null?z:`${H}${K}${Z}`})}Qe(()=>i.text,R=>b(R??""),{immediate:!0});function m(){if(!s.value||!i.openFile||i.streaming)return;const R=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),D=[];let z=R.nextNode();for(;z;){const H=z,U=H.parentElement;U&&!U.closest("a, pre, .md-file-link, svg")&&H.data.trim().length>0&&D.push(H),z=R.nextNode()}for(const H of D){const U=Kee(H.data,{aliases:l.value});if(U.length===0||!H.parentNode)continue;const Z=document.createDocumentFragment();let K=0;for(const V of U){V.start>K&&Z.append(document.createTextNode(H.data.slice(K,V.start)));const J=document.createElement("button");J.type="button",J.className="md-file-link",J.textContent=V.text,J.title=V.line?`${V.path}:${V.line}`:V.path,J.addEventListener("click",fe=>{fe.preventDefault(),fe.stopPropagation(),i.openFile?.({path:V.path,line:V.line})}),Z.append(J),K=V.end}K<H.data.length&&Z.append(document.createTextNode(H.data.slice(K))),H.parentNode.replaceChild(Z,H)}}function y(R){return!(!R||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(R))}function k(R){let D=R.length;for(const z of["#","?"]){const H=R.indexOf(z);H!==-1&&H<D&&(D=H)}return R.slice(0,D)}function A(){if(!s.value||!i.openFile||i.streaming)return;const R=s.value.querySelectorAll("a[href]");for(const D of R){if(D.dataset.mdLinkHandled==="true"||D.closest("svg"))continue;const z=D.getAttribute("href")??"";y(z)&&(D.dataset.mdLinkHandled="true",D.addEventListener("click",H=>{H.preventDefault(),H.stopPropagation(),i.openFile?.({path:k(z)})}))}}function $(){mt().then(()=>{m(),A()})}Qe(()=>i.text,$),Qe(()=>i.streaming,$);let N=null;cn(()=>{$(),s.value&&(N=new MutationObserver($),N.observe(s.value,{childList:!0,subtree:!0}))}),bn(()=>{N?.disconnect()});const x={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},I=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,E=B(()=>{const R=v(i.text??""),D=[];let z=0;I.lastIndex=0;let H;for(;(H=I.exec(R))!==null;){const Z=H[1]??"",K=R.slice(z,H.index)+(Z||"");K.trim()&&D.push({kind:"md",text:K}),D.push({kind:"diff",code:H[2]??""}),z=I.lastIndex}const U=R.slice(z);return(U.trim()||D.length===0)&&D.push({kind:"md",text:U}),D});function F(R){return R.split(`
281
- `).map(D=>D.startsWith("@@")?{type:"hunk",sign:"",text:D}:/^\+(?!\+\+)/.test(D)?{type:"add",sign:"+",text:D.slice(1)}:/^-(?!--)/.test(D)?{type:"del",sign:"-",text:D.slice(1)}:D.startsWith(" ")?{type:"ctx",sign:"",text:D.slice(1)}:{type:"ctx",sign:"",text:D})}const S=X(null);function L(R,D){Go(R).then(z=>{z&&(S.value=D,setTimeout(()=>{S.value=null},1400))})}return(R,D)=>(w(),T("div",{ref_key:"mdRef",ref:s,class:"md"},[(w(!0),T(Pe,null,ot(E.value,(z,H)=>(w(),T(Pe,{key:H},[z.kind==="md"?(w(),xe(C(Bs),{key:0,content:z.text,"custom-markdown-it":t,mode:"chat","code-renderer":a.value.codeRenderer,"is-dark":C(c),"code-block-light-theme":hC,"code-block-dark-theme":pC,themes:[hC,pC],"code-block-props":x,final:r.value,"smooth-streaming":e.streaming,"batch-rendering":u.value,"defer-nodes-until-visible":!1,onCopy:C(LI)},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering","onCopy"])):(w(),T("div",tte,[_("div",nte,[D[0]||(D[0]=_("span",{class:"diff-lang"},"diff",-1)),re(Xt,{text:C(n)("filePreview.copyCode")},{default:Ee(()=>[_("button",{class:"diff-copy","aria-label":C(n)("filePreview.copyCode"),onClick:U=>L(z.code,H)},[re(Ve,{name:S.value===H?"check":"copy",size:"sm"},null,8,["name"])],8,ote)]),_:2},1032,["text"])]),_("pre",ste,[_("code",null,[(w(!0),T(Pe,null,ot(F(z.code),(U,Z)=>(w(),T("span",{key:Z,class:We(["diff-line",`diff-${U.type}`])},[U.type!=="hunk"?(w(),T("span",ite,O(U.sign),1)):ae("",!0),_("span",rte,O(U.text),1)],2))),128))])])]))],64))),128))],512))}}),Wm=ct(ate,[["__scopeId","data-v-72f31a12"]]),cte={class:"tc-anim"},ute={class:"prev-anim"},dte={class:"prev"},fte=Ze({__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=B(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=B(()=>n.foldable&&s.value.length>1),r=B(()=>n.streaming||!i.value),l=B(()=>s.value.at(-1)??""),a=X(null);return cn(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Qe(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||mt(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(w(),T("div",{class:We(["think",{mob:e.mobile}])},[i.value?(w(),T("div",{key:0,class:We(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>o("open"))},[_("div",cte,[_("pre",{ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513)]),_("div",ute,[_("span",dte,O(l.value),1)])],2)):(w(),T("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},O(e.text),513))],2))}}),hte=ct(fte,[["__scopeId","data-v-fdc551ea"]]),pte={class:"activity-notice",role:"status"},mte={"aria-hidden":"true"},gte={class:"an-label"},vte=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){return(t,n)=>(w(),T("div",pte,[_("span",mte,[re(Ds,{size:"sm"})]),_("span",gte,O(e.label),1)]))}}),yte=ct(vte,[["__scopeId","data-v-0d497074"]]);function kte(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 bte=Ze({__name:"MessageTime",props:{time:{}},setup(e){const t=e,{t:n}=Tt(),o=X(!1),s=B(()=>{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=B(()=>o.value?s.value:kte(t.time,n("conversation.yesterday")));function r(){o.value=!o.value}return(l,a)=>(w(),T("button",{type:"button",class:"msg-time",onClick:bt(r,["stop"])},O(i.value),1))}}),d5=ct(bte,[["__scopeId","data-v-9672fbd5"]]);function xte(e){return e.length===1?`0${e}`:e}function wte(e,t){return`${String(Number(e))}:${xte(t)}`}const mC=e=>/^\d+$/.test(e);function _te(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(mC(o)&&mC(s)&&c){const f=wte(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 Ste=["data-turn-id"],Cte={class:"cn-bubble"},Ate={class:"cn-title"},Mte={key:0,class:"cn-prompt"},Ete={class:"cn-meta"},Tte={key:0,class:"cn-meta-item"},Nte={key:1,class:"cn-meta-item"},Ite=["aria-label"],Lte=["title"],$te=Ze({__name:"CronNotice",props:{text:{},cron:{},turnId:{},createdAt:{}},setup(e){const t=e,{t:n}=Tt(),o=B(()=>t.cron),s=B(()=>o.value?.missedCount!==void 0),i=B(()=>s.value?n("conversation.cron.missed"):n("conversation.cron.fired")),r=B(()=>{const u=o.value?.cron;return u?_te(u,n):""}),l=B(()=>s.value?"error":"ok"),a=B(()=>{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=B(()=>t.text??"");return(u,d)=>(w(),T("div",{class:We(["cn cron-notice",{"turn-anchor":!!e.turnId}]),"data-turn-id":e.turnId,role:"status"},[_("div",Cte,[_("span",Ate,O(i.value),1),c.value?(w(),T("span",Mte,O(c.value),1)):ae("",!0)]),_("div",Ete,[re(Ve,{name:"clock",size:"sm",class:"cn-meta-ico","aria-hidden":"true"}),r.value?(w(),T("span",Tte,O(r.value),1)):ae("",!0),a.value?(w(),T("span",Nte,O(a.value),1)):ae("",!0),_("span",{class:We(["cn-status",l.value]),"aria-label":l.value},[l.value==="ok"?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):(w(),xe(Ve,{key:1,name:"close",size:"sm"}))],10,Ite),o.value?.jobId?(w(),T("span",{key:2,class:"cn-meta-item cn-id",title:C(n)("conversation.cron.job",{id:o.value.jobId})},O(o.value.jobId),9,Lte)):ae("",!0),e.createdAt?(w(),xe(d5,{key:3,time:e.createdAt},null,8,["time"])):ae("",!0)])],10,Ste))}}),Fte=ct($te,[["__scopeId","data-v-a62a6587"]]),Ote=["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"],f5=500,Fp=256*1024,gC=200,og=16384,sg=500,ig=50,rg=50,Rte=6,Bte=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,Dte=/^[A-Za-z0-9+/=_-]{200,}$/;let lg=null;function Hi(){if(lg!==null)return lg;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=mo(Ft.debug)==="1"),lg=e,e}const El=[],Tc=[];let Vu=0;const ma=[];let Ku=0,Pte=1;const Op=new TextEncoder,Hte=new Set(Ote),Ik=X(0),Gu=Ba(!1);function Wte(){return El}function zte(){El.length=0,Tc.length=0,Vu=0,ma.length=0,Ku=0,Ik.value++}function jr(e){if(!Gu.value){try{const t={id:Pte++,ts:Date.now(),source:e.source,kind:String(jc(e.kind)),label:String(jc(e.label)),sessionId:e.sessionId===void 0?void 0:String(jc(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:Wl(e.detail)},n=JSON.stringify(t),o=Op.encode(n).byteLength;if(o>Fp)return;for(El.push(t),Tc.push(n),Vu+=o+(Tc.length>1?1:0);El.length>f5||Vu>Fp;){const s=Tc.shift();El.shift(),s!==void 0&&(Vu-=Op.encode(s).byteLength,Tc.length>0&&(Vu-=1))}}catch{return}Ik.value++}}function aa(e){if(typeof e=="string")return e.length<=gC?e:e.slice(0,gC)}function li(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Ute(e,t){if(Hte.has(e))try{const n={ts:Date.now(),event:e,sessionId:aa(t?.sessionId),status:aa(t?.status),operation:aa(t?.operation),seq:li(t?.seq),durationMs:li(t?.durationMs),messageCount:li(t?.messageCount),contentCount:li(t?.contentCount),mediaCount:li(t?.mediaCount),sessionCount:li(t?.sessionCount),workspaceCount:li(t?.workspaceCount),promptId:aa(t?.promptId),zipBytes:li(t?.zipBytes),errorName:aa(t?.errorName),errorCode:li(t?.errorCode),requestId:aa(t?.requestId),phase:aa(t?.phase),httpStatus:li(t?.httpStatus),fatal:typeof t?.fatal=="boolean"?t.fatal:void 0,line:li(t?.line),col:li(t?.col)},o=JSON.stringify(n),s=Op.encode(o).byteLength;if(s>Fp)return;for(ma.push(o),Ku+=s+(ma.length>1?1:0);ma.length>f5||Ku>Fp;){const i=ma.shift();i!==void 0&&(Ku-=Op.encode(i).byteLength,ma.length>0&&(Ku-=1))}}catch{return}}function jc(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 Dte.test(i)?`[base64-like, ${i.length} chars omitted]`:i.length>sg?`${i.slice(0,sg)}… [+${i.length-sg} chars]`:i}if(n!=="object")return String(e);if(t>=Rte)return"[max depth]";if(Array.isArray(e)){const i=e.slice(0,ig).map(r=>jc(r,t+1));return e.length>ig&&i.push(`[+${e.length-ig} more items]`),i}const o={},s=Object.entries(e);for(const[i,r]of s.slice(0,rg))o[i]=Bte.test(i)?"[redacted]":jc(r,t+1);return s.length>rg&&(o._truncatedKeys=s.length-rg),o}function Wl(e){if(e===void 0)return;const t=jc(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>og)return{_truncated:`detail JSON was ${n.length} chars; first ${og} kept`,preview:n.slice(0,og)}}catch{return"[unserializable detail]"}return t}function rh(e){Hi()&&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:Wl(e.body)}})}function cc(e){if(!Hi())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:Wl(e.data)}})}function al(e){Hi()&&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 uc(e,t){Hi()&&jr({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:Wl(t)})}function qte(e){if(!Hi())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:Wl(e)})}function jte(e){if(!Hi())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:Wl(t.payload)})}const Vte={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Kte(e,t,n){Hi()&&jr({source:"client",kind:`client:${e}`,label:`${Vte[e]} ${t}`,detail:Wl(n)})}function Er(e,t){Hi()&&jr({source:"client",kind:"client:event",label:`· ${e}`,detail:Wl(t)})}function ko(e,t){Ute(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 ag=!1,lh=null;function Gte(){if(ag)return()=>lh?.();ag=!0;const e=[];try{if(typeof window<"u"){const n=s=>{ko("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;ko("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(Hi())for(const n of["error","warn","log","info","debug"]){const o=console[n];if(typeof o!="function")continue;const s=(...i)=>{try{Kte(n,i.map(Yte).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(lh===t){for(const n of e.toReversed())n();lh=null,ag=!1}};return lh=t,t}function Yte(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 h5(e=El){if(typeof document>"u")return;const t=new Blob([Zte(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 Zte(e=El){return e===El?Tc.join(`
282
- `):e.map(t=>JSON.stringify(t)).join(`
283
- `)}function Qte(){return ma.join(`
284
- `)}function p5(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 Hv(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Ni(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:p5(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 pd(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function vC(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 Lk(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:vC(e.source)};case"video":return{type:"video",source:vC(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 Wv(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Lk),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Xte(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 Jte(e){return{content:e.content.map(Xte),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 ene(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function m5(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 tne(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function nne(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(tne),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function g5(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(nne),createdAt:e.created_at}}function one(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 sne(e){const t={};for(const[n,o]of Object.entries(e.answers))t[n]=one(o);return{answers:t,method:e.method,note:e.note}}function Rh(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 yC(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 cl(e,t){const n=e[t];return typeof n=="string"?n:void 0}function dc(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ai(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function v5(e){if(!e||typeof e!="object")return null;const t=e,n=cl(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:cl(t,"goalId")??cl(t,"goal_id")??"goal",objective:cl(t,"objective")??"",completionCriterion:cl(t,"completionCriterion")??cl(t,"completion_criterion"),status:n,turnsUsed:dc(t,"turnsUsed")??dc(t,"turns_used")??0,tokensUsed:dc(t,"tokensUsed")??dc(t,"tokens_used")??0,wallClockMs:dc(t,"wallClockMs")??dc(t,"wall_clock_ms")??0,terminalReason:cl(t,"terminalReason")??cl(t,"terminal_reason"),budget:{tokenBudget:ai(s,"tokenBudget")??ai(s,"token_budget"),remainingTokens:ai(s,"remainingTokens")??ai(s,"remaining_tokens"),turnBudget:ai(s,"turnBudget")??ai(s,"turn_budget"),remainingTurns:ai(s,"remainingTurns")??ai(s,"remaining_turns"),wallClockBudgetMs:ai(s,"wallClockBudgetMs")??ai(s,"wall_clock_budget_ms"),remainingWallClockMs:ai(s,"remainingWallClockMs")??ai(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function ine(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Ni(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Ni(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:pd(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:pd(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:p5(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=v5(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:Wv(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Lk),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:m5(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:g5(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:Rh(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:zv(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 rne(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 kC(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 zv(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 lne(e){return e.session_id}function ane(e){return e.seq}const cne="main",une=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 Sr(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 dne(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 bC(){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 ds(e,t){const n=e[t];return typeof n=="string"?n:void 0}function ua(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ci(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function fne(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,o=n&&typeof n=="object"?n:{},s=ds(t,"status");if(s!=="active"&&s!=="paused"&&s!=="blocked"&&s!=="complete")return null;const i=ds(t,"goalId")??ds(t,"goal_id")??"goal",r=ds(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ds(t,"completionCriterion")??ds(t,"completion_criterion"),status:s,turnsUsed:ua(t,"turnsUsed")??ua(t,"turns_used")??0,tokensUsed:ua(t,"tokensUsed")??ua(t,"tokens_used")??0,wallClockMs:ua(t,"wallClockMs")??ua(t,"wall_clock_ms")??0,terminalReason:ds(t,"terminalReason")??ds(t,"terminal_reason"),budget:{tokenBudget:ci(o,"tokenBudget")??ci(o,"token_budget"),remainingTokens:ci(o,"remainingTokens")??ci(o,"remaining_tokens"),turnBudget:ci(o,"turnBudget")??ci(o,"turn_budget"),remainingTurns:ci(o,"remainingTurns")??ci(o,"remaining_turns"),wallClockBudgetMs:ci(o,"wallClockBudgetMs")??ci(o,"wall_clock_budget_ms"),remainingWallClockMs:ci(o,"remainingWallClockMs")??ci(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function ga(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 hne(e,t){if(e==="turn.step.started")return null;if(e==="tool.use"||e==="tool.call.started"){const n=ds(t,"name")??ds(t,"toolName")??"tool",o=Pa(pne(n)),s=mne(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=ds(n,"text");if(s)return cg(s);const i=ds(n,"message");if(i)return cg(i)}const o=ds(t,"message");if(o)return cg(o)}return null}function pne(e){return e.replace(/_\d+$/,"")}const xC=2e3;function cg(e){return e.length>xC?`${e.slice(0,xC)}…`:e}function mne(e,t){if(t==null)return"";const n=typeof t=="string"?t:JSON.stringify(t);return Ed(e,n)}function gne(e,t,n,o,s,i){if(i.has(n)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const u=ds(s,"delta");if(!u)return[];const d=e.subagentMeta.get(n),f=ga(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=hne(o,s);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=ga(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 Du(e){return{...e,content:e.content.map(t=>({...t}))}}function wC(e,t,n){const o={id:Sr("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(o),o}function vne(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 yne(e){return Array.isArray(e)?e.map(t=>Lk(t)):[]}function _C(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 kne(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 bne(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 SC(e,t){e.messages.find(n=>n.id===t)}function xne(e,t,n,o,s,i){const r={id:Sr("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 Pu(e,t){return e.messages.find(n=>n.id===t)}function CC(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 wne(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=bC(),e.set(u,d)),d}function o(u){e.set(u,bC())}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??Sr("pr_");f.currentPromptId=h,f.turnPromptId.set(d.turnId,h);const p=wC(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 g of d.runningTools){const b=typeof g.lastProgress?.text=="string"&&g.lastProgress.text.length>0?[g.lastProgress.text]:void 0;p.content.push({type:"toolUse",toolCallId:g.toolCallId,toolName:g.name,input:g.args??{},outputLines:b}),f.toolStartTimes.set(g.toolCallId,Date.now())}return f.currentAssistantMsgId=p.id,f.turnTextLen=d.assistantText.length,f.turnThinkLen=d.thinkingText.length,[{type:"messageCreated",message:Du(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),g=d,b=[],v=g?.agentId;if(typeof v=="string"&&v!==cne){const m=t.has(v);if(m&&(u==="thinking.delta"||u==="assistant.delta")){const y=g?.delta??"";return y?[{type:"agentDelta",sessionId:f,agentId:v,delta:{[u==="thinking.delta"?"thinking":"text"]:y}}]:[]}if(m&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:f,agentId:v,reason:g?.reason}];if(une.has(u))return gne(p,f,v,u,g??{},t)}switch(u){case"session.meta.updated":{const m=g?.patch?.title??g?.title,y=g?.patch?.lastPrompt,k={};typeof m=="string"&&m.length>0&&(k.title=m),typeof y=="string"&&(k.lastPrompt=y),(k.title!==void 0||k.lastPrompt!==void 0)&&b.push({type:"sessionMetaUpdated",sessionId:f,...k});break}case"prompt.submitted":{const m=g?.promptId,y=g?.userMessageId;if(!m||!y)break;const k=yne(g?.content);if(k.length===0)break;p.currentPromptId=m;const A=vne(p,f,m,y,k,typeof g?.createdAt=="string"?g.createdAt:new Date().toISOString());b.push({type:"messageCreated",message:Du(A)});break}case"turn.started":{const m=g?.turnId,y=p.currentPromptId??Sr("pr_");p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y),p.turnTextLen=0,p.turnThinkLen=0,b.push({type:"turnActiveChanged",sessionId:f,active:!0});break}case"turn.step.started":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;if(y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y)),p.turnTextLen=0,p.turnThinkLen=0,p.retryReuseMsgId!==void 0){const A=p.retryReuseMsgId;if(p.retryReuseMsgId=void 0,Pu(p,A)!==void 0){p.currentAssistantMsgId=A;break}}const k=wC(p,f,y);p.currentAssistantMsgId=k.id,b.push({type:"messageCreated",message:Du(k)});break}case"thinking.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnThinkLen>0&&(p.turnThinkLen=0);const k=a(p.turnThinkLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"thinking",y);if(A<0)break;p.turnThinkLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{thinking:y}});break}case"assistant.delta":{const m=p.currentAssistantMsgId;if(!m)break;const y=g?.delta??"";if(!y)break;h?.offset===0&&p.turnTextLen>0&&(p.turnTextLen=0);const k=a(p.turnTextLen,h?.offset);if(k==="skip")break;if(k==="gap"){b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"delta_gap"});break}const A=_C(p,m,"text",y);if(A<0)break;p.turnTextLen+=y.length,b.push({type:"assistantDelta",sessionId:f,messageId:m,contentIndex:A,delta:{text:y}});break}case"tool.use":case"tool.call.started":{const m=p.currentAssistantMsgId,y=g?.turnId,k=p.turnPromptId.get(y)??p.currentPromptId;if(!m||!k)break;const A=g?.toolCallId,$=g?.name??g?.toolName??"",N=g?.args??g?.input??{};kne(p,m,A,$,N);const x=Pu(p,m);x&&x.content.length-1,p.toolStartTimes.set(A,Date.now()),x&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:x.content.map(I=>({...I})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const m=g?.toolCallId,y=bne(g??{});m&&y&&b.push({type:"toolOutput",sessionId:f,toolCallId:m,outputChunk:y.outputChunk,stream:y.stream});break}case"tool.result":{const m=g?.turnId;let y=p.turnPromptId.get(m)??p.currentPromptId;y||(y=Sr("pr_"),p.currentPromptId=y,m!==void 0&&p.turnPromptId.set(m,y));const k=g?.toolCallId,A=g?.output,$=g?.isError??!1;p.toolStartTimes.get(k)??Date.now(),p.toolStartTimes.delete(k);const N=xne(p,f,k,A,$,y);b.push({type:"messageCreated",message:Du(N)}),p.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const m=p.currentAssistantMsgId,y=dne(g?.usage);if(p.totalInput+=y.input,p.totalOutput+=y.output,p.totalCacheRead+=y.cacheRead,p.totalCacheCreate+=y.cacheCreate,m){SC(p,m);const k=Pu(p,m);k&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:k.content.map(A=>({...A})),status:"completed"})}break}case"agent.status.updated":{g?.model&&(p.model=g.model),g?.contextTokens!==void 0&&(p.contextTokens=g.contextTokens),g?.maxContextTokens!==void 0&&(p.contextLimit=g.maxContextTokens),b.push({type:"sessionUsageUpdated",sessionId:f,usage:CC(p),model:p.model||void 0,swarmMode:g?.swarmMode===!0?!0:g?.swarmMode===!1?!1:void 0,planMode:g?.planMode===!0?!0:g?.planMode===!1?!1:void 0,thinking:typeof g?.thinkingEffort=="string"&&g.thinkingEffort.length>0?g.thinkingEffort:void 0});break}case"turn.ended":{const m=p.currentAssistantMsgId,y=g?.reason??"completed",k=ua(g??{},"durationMs");if(b.push({type:"turnActiveChanged",sessionId:f,active:!1,reason:g?.reason}),m){SC(p,m);const $=Pu(p,m);$&&b.push({type:"messageUpdated",sessionId:f,messageId:m,content:$.content.map(N=>({...N})),status:y==="failed"||y==="blocked"?"error":"completed",durationMs:k})}p.turnCount++;const A=CC(p);b.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 m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptCompleted",sessionId:f,promptId:m,reason:g?.reason??"completed"});break}case"prompt.aborted":{const m=g?.promptId;typeof m=="string"&&m.length>0&&b.push({type:"promptAborted",sessionId:f,promptId:m});break}case"turn.step.retrying":{const m=p.currentAssistantMsgId;if(m!==void 0){const y=Pu(p,m);y!==void 0&&(y.content=y.content.filter(k=>k.type!=="text"&&k.type!=="thinking"&&k.type!=="toolUse"),b.push({type:"messageUpdated",sessionId:f,messageId:m,content:y.content.map(k=>({...k})),status:"pending"}),p.retryReuseMsgId=m)}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 y={id:typeof g?.subagentId=="string"&&g.subagentId.length>0?g.subagentId:Sr("task_"),sessionId:f,kind:"subagent",description:typeof g?.description=="string"?g.description:g?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof g?.subagentName=="string"?g.subagentName:void 0,parentToolCallId:typeof g?.parentToolCallId=="string"?g.parentToolCallId:void 0,swarmIndex:typeof g?.swarmIndex=="number"?g.swarmIndex:void 0,runInBackground:g?.runInBackground===!0};p.subagentMeta.set(y.id,y),b.push({type:"taskCreated",sessionId:f,task:y});break}case"subagent.started":{const m=ga(p,f,g?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.suspended":{const m=ga(p,f,g?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof g?.reason=="string"?g.reason:void 0});m&&b.push({type:"taskCreated",sessionId:f,task:m});break}case"subagent.completed":{const m=typeof g?.resultSummary=="string"?g.resultSummary:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"completed",outputPreview:m});break}case"subagent.failed":{const m=typeof g?.error=="string"?g.error:void 0,y=ga(p,f,g?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:m});y&&b.push({type:"taskCreated",sessionId:f,task:y}),b.push({type:"taskCompleted",sessionId:f,taskId:g?.subagentId??"",status:"failed",outputPreview:m});break}case"error":{b.push({type:"unknown",raw:{_agentError:!0,code:g?.code,message:g?.message,name:g?.name,details:g?.details,retryable:g?.retryable}});break}case"warning":{b.push({type:"unknown",raw:{_agentWarning:!0,message:g?.message}});break}case"task.started":{const m=g?.info??{},y=typeof m.startedAt=="number"?new Date(m.startedAt).toISOString():void 0,k=typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):Sr("task_"),A=typeof m.description=="string"?m.description:typeof m.command=="string"?m.command:_n.global.t("tasks.defaultDescription");if(m.kind==="agent"){const N=typeof m.agentId=="string"&&m.agentId.length>0?m.agentId:void 0;if(N!==void 0){const x=ga(p,f,N,{description:A,backgroundTaskId:k,runInBackground:!0});x&&b.push({type:"taskCreated",sessionId:f,task:x})}else b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"subagent",description:A,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,subagentPhase:"queued",runInBackground:!0}});break}const $=typeof m.command=="string"?m.command:void 0;b.push({type:"taskCreated",sessionId:f,task:{id:k,sessionId:f,kind:"bash",description:A,command:$,status:"running",createdAt:y??new Date().toISOString(),startedAt:y,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"task.terminated":{const m=g?.info??{},y=m.status==="failed"||typeof m.exitCode=="number"&&m.exitCode!==0;b.push({type:"taskCompleted",sessionId:f,taskId:typeof m.taskId=="string"?m.taskId:typeof m.taskId=="number"?String(m.taskId):"",status:y?"failed":"completed"});break}case"compaction.completed":{const m=g?.result??{};b.push({type:"compactionCompleted",sessionId:f,tokensBefore:typeof m.tokensBefore=="number"?m.tokensBefore:void 0,tokensAfter:typeof m.tokensAfter=="number"?m.tokensAfter:void 0,summary:typeof m.summary=="string"?m.summary:void 0}),b.push({type:"historyCompacted",sessionId:f,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{b.push({type:"compactionStarted",sessionId:f,trigger:g?.trigger==="manual"?"manual":"auto",instruction:typeof g?.instruction=="string"?g.instruction:void 0});break}case"compaction.cancelled":{b.push({type:"compactionCancelled",sessionId:f});break}case"goal.updated":{const m=fne(g?.snapshot??null);b.push({type:"goalUpdated",sessionId:f,goal:m?.status==="complete"?null:m});break}case"cron.fired":{const m=g?.origin,y=ds(g??{},"prompt");if(m&&typeof m=="object"&&m.kind==="cron_job"&&y){const k={id:Sr("cron_"),sessionId:f,role:"user",content:[{type:"text",text:y}],createdAt:new Date().toISOString(),metadata:{origin:m}};p.messages.push(k),b.push({type:"messageCreated",message:Du(k)})}break}}return b}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:o,markSideChannelAgent:s}}const _ne=new Set(["server_hello","ack","ping","resync_required","error","pong"]),AC=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"]),Sne=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"]),Cne=new Set(["assistant.delta","thinking.delta"]);function Ane(e,t){if(_ne.has(e))return{route:"ignore"};const n=e.startsWith("event."),o=n?e.slice(6):e;return Cne.has(o)?Mne(t)?{route:"agent",agentType:o}:{route:"protocol"}:n?Sne.has(o)?{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"protocol"}:AC.has(o)?{route:"agent",agentType:o}:{route:"agent",agentType:o}}function Mne(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 Yu 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 xr 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 vi(e){return e instanceof Yu||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function $k(e){return e instanceof xr||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const zo="kimi-web.server-credential",Ene="token",Tne=10080*60*1e3;let or;const Uv=new Set;function Nne(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(Ene);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 qv(e){return{version:1,credential:e,expiresAt:Date.now()+Tne}}function Ine(e){return JSON.stringify(e)}function Fk(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 jv(e){globalThis.localStorage?.setItem(zo,Ine(e))}function Lne(){try{const e=globalThis.localStorage?.getItem(zo);if(e){const n=Fk(e);if(n===void 0){const o=qv(e);let s=!1;try{jv(o),s=!0}catch{}if(!s)try{globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo),s=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}return s?o:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(zo),globalThis.localStorage?.getItem(zo)===e&&globalThis.localStorage?.removeItem(zo);return}const t=globalThis.sessionStorage?.getItem(zo);if(t){const n=qv(t);let o=!1;try{jv(n),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(zo),o=!0}catch{}return o?n:void 0}return}catch{return}}function $ne(){const e=Nne();return e?(k5(e),!0):(or=Lne(),or!==void 0)}function y5(){if(or!==void 0){if(or.expiresAt<=Date.now()){Fne(or);return}return or.credential}}function Fne(e){or=void 0;try{globalThis.sessionStorage?.removeItem(zo);const t=globalThis.localStorage?.getItem(zo),n=t==null?void 0:Fk(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(zo)}catch{}}function k5(e){const t=qv(e);or=t;try{jv(t)}catch{}try{globalThis.sessionStorage?.removeItem(zo)}catch{}}function One(){const e=or;or=void 0;try{const t=globalThis.localStorage?.getItem(zo),o=(t==null?void 0:Fk(t))?.credential??t;e!==void 0&&o===e.credential&&globalThis.localStorage?.removeItem(zo),globalThis.sessionStorage?.removeItem(zo)}catch{}}function Rne(e){return Uv.add(e),()=>{Uv.delete(e)}}function Bne(){One();for(const e of Uv)try{e()}catch{}}const kc=3e4,ah=5*6e4,b5="0123456789ABCDEFGHJKMNPQRSTVWXYZ",MC=500,x5=40101;function ch(e=kc){try{return AbortSignal.timeout(e)}catch{return}}function Dne(e,t){let n="",o=e;for(let s=0;s<t;s++)n=b5[o%32]+n,o=Math.floor(o/32);return n}function Pne(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=>b5[n%32]).join("")}function uh(){return`${Dne(Date.now(),10)}${Pne(16)}`}function Hne(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 ug(e){try{const t=await e.text();return t?t.length>MC?`${t.slice(0,MC)}...`:t:void 0}catch{return}}class Wne{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=Sc(this.origin,t),o=uh(),s={"X-Request-Id":o};this.addClientHeaders(s);const i=Date.now();rh({method:"GET",path:t,url:n,requestId:o});let r;try{r=await fetch(n,{method:"GET",headers:s,signal:ch()})}catch(a){throw al({method:"GET",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-i,error:a}),new xr({message:`Network error calling GET ${t}`,cause:a,method:"GET",path:t,url:n,requestId:o,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-i})}if(r.ok)return cc({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),cc({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 Yu({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=Sc(this.origin,t),r=uh(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();rh({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:ch(ah)})}catch(h){throw al({method:s,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new xr({message:`Network error calling ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"fetch",timeoutMs:ah,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 b=h?.code??c.status,v=h?.msg??c.statusText;throw cc({method:s,path:t,requestId:r,status:c.status,durationMs:Date.now()-a,code:b,msg:v,envelopeRequestId:h?.request_id}),new Yu({code:b,msg:v,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const p=c.clone(),g=new TypeError(`Expected application/zip, received ${u??"no content type"}`);throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:g}),new xr({message:`Invalid ZIP response from ${s} ${t}`,cause:g,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,bodyPreview:await ug(p),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await c.blob()}catch(h){throw al({method:s,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:c.status,error:h}),new xr({message:`Failed to read ZIP response from ${s} ${t}`,cause:h,method:s,path:t,url:i,requestId:r,phase:"parse",timeoutMs:ah,status:c.status,statusText:c.statusText,contentType:u,timestamp:Date.now(),durationMs:Date.now()-a})}return cc({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=Sc(this.origin,t),s=uh(),i={"X-Request-Id":s};this.addClientHeaders(i);const r=Date.now();rh({method:"POST",path:t,url:o,requestId:s,body:Hne(n)});let l;try{l=await fetch(o,{method:"POST",headers:i,body:n,signal:ch()})}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-r,error:u}),new xr({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-r})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw al({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new xr({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:kc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await ug(c),timestamp:Date.now(),durationMs:Date.now()-r})}if(cc({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 Yu({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=Sc(this.origin,n);if(s){const h=new URLSearchParams;for(const[g,b]of Object.entries(s))b!==void 0&&h.set(g,String(b));const p=h.toString();p&&(r=`${r}?${p}`)}const l=uh(),a={"X-Request-Id":l};this.addClientHeaders(a),o!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();rh({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:ch()})}catch(h){throw al({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:h}),new xr({message:`Network error calling ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:kc,timestamp:Date.now(),durationMs:Date.now()-c})}let d;const f=u.clone();try{d=await u.json()}catch(h){throw al({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:h}),new xr({message:`Failed to parse JSON response from ${t} ${n}`,cause:h,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:kc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await ug(f),timestamp:Date.now(),durationMs:Date.now()-c})}if(cc({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 Yu({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=y5();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===x5)&&Bne()}}const zne="kimi-code.bearer.",Une=3e4;class qne{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(),uc("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=y5(),n=t!==void 0?[`${zne}${t}`]:void 0,o=new WebSocket(this.wsUrl,n);this.ws=o,o.onopen=()=>{uc("open")},o.onmessage=s=>{this.lastActivityAt=Date.now();try{const i=JSON.parse(String(s.data));jte(i),this.handleFrame(i)}catch(i){uc("parse-error",{error:String(i)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(i)}`,!1)}},o.onerror=()=>{uc("error"),this.handlers.onError(0,"WebSocket error",!1)},o.onclose=s=>{uc("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,uc("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=dh(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(dh(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(dh(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,Une),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=dh(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=Ane(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)),qte(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function dh(e,t){return`${e}\0${t}`}function jne(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 EC(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 dg(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 TC(e){return e==="auto_compact"||e==="manual_compact"}class Vne{http;config;constructor(t){this.config=t,this.http=new Wne(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(Ni),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 Ni(o)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Ni(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 Ni(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 v5(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 Ni(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(Wv),hasMore:s.has_more}}async getSessionSnapshot(t){const n=Date.now();ko("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:Ni(o.session),messages:o.messages.items.map(Wv),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(m5),pendingQuestions:o.pending_questions.map(g5),subagents:(o.subagents??[]).map(Rh)};return ko("session:snapshot:accepted",{sessionId:t,busy:s.session.busy,seq:s.asOfSeq,messageCount:s.messages.length,durationMs:Date.now()-n}),s}catch(o){throw ko("session:snapshot:failed",{sessionId:t,status:"failed",durationMs:Date.now()-n,...EC(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(`
285
- `).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:jne(i.contentDisposition,r)}}async submitPrompt(t,n){const o=Date.now();ko("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`,Jte(n));return ko("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 ko("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-o,...EC(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 Ni(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 Ni(s)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Ni)}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)}`,ene(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)}`,sne(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(Rh)}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 Rh(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(dg)}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 dg(s)}async getTerminal(t,n){const o=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return dg(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(yC)])):void 0;return{items:s.items.map(yC),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 Sc(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(pd)}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 pd(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 pd(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(rne)}async listProviders(){return(await this.http.get("/providers")).items.map(kC)}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 kC(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 fg(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return fg(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return fg(t)}async getConfig(){const t=await this.http.get("/config");return zv(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 zv(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 Sc(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=MI(this.config.serverHttpUrl,this.config.clientId),o=wne(),s=new qne(n,this.config.clientId,{onWireEvent:i=>{const r=lne(i),l=ane(i),a=ine(i);a.type==="historyCompacted"&&!TC(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"&&!TC(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 fg(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 NC;function dt(){return NC??=new Vne(wI()),NC}const Kne=["src","controls","muted"],Gne=["src","alt"],w5=Ze({__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=X(t.fileId?"":t.url),o=X(null),s=X(!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 dt().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 Qe(()=>[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}),po(()=>{l=!0,a?.disconnect(),a=null,c()}),(d,f)=>e.kind==="video"?(w(),T("video",{key:0,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,controls:e.controls,muted:e.muted,playsinline:"",preload:"metadata"},null,10,Kne)):(w(),T("img",{key:1,ref_key:"mediaEl",ref:o,class:We(e.mediaClass),src:n.value||void 0,alt:e.alt||"",loading:"lazy"},null,10,Gne))}}),Yne=["title","data-kind"],Zne=["aria-label"],Qne={class:"att-tile"},Xne={class:"att-name"},Jne={key:1,class:"att-err"},eoe=["aria-label"],toe=Ze({__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}=Tt(),i=B(()=>{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=B(()=>{const u=i.value??"";return/^(txt|md|doc|docx|rtf|log)$/i.test(u)?"file-text":"file"}),l=B(()=>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=B(()=>{const u=[l.value];return n.size!==void 0&&u.push(a(n.size)),u.join(" · ")});return(u,d)=>(w(),T("span",{class:We(["att-chip",{"is-error":e.error,uploading:e.uploading}]),title:c.value,"data-kind":e.kind},[_("button",{type:"button",class:"att-activate","aria-label":c.value,onClick:d[0]||(d[0]=f=>o("activate"))},[_("span",Qne,[e.kind==="image"&&e.url?(w(),xe(w5,{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"?(w(),xe(Ve,{key:1,name:"play",size:"sm"})):e.kind==="image"?(w(),xe(Ve,{key:2,name:"image",size:"sm"})):(w(),xe(Ve,{key:3,name:r.value,size:"sm"},null,8,["name"]))]),_("span",Xne,O(l.value),1),e.uploading?(w(),xe(Ds,{key:0,size:"sm",label:C(s)("composer.uploading")},null,8,["label"])):e.error?(w(),T("span",Jne,[re(Ve,{name:"info",size:"sm"})])):ae("",!0)],8,Zne),e.removable?(w(),xe(Xt,{key:0,text:e.removeLabel??C(s)("composer.remove")},{default:Ee(()=>[_("button",{type:"button",class:"att-rm","aria-label":e.removeLabel??C(s)("composer.remove"),onClick:d[1]||(d[1]=f=>o("remove"))},[re(Ve,{name:"close",size:"sm"})],8,eoe)]),_:1},8,["text"])):ae("",!0)],10,Yne))}}),_5=ct(toe,[["__scopeId","data-v-12ec975b"]]),noe=["aria-label"],ooe=120,soe=60,ioe=Ze({__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*ooe}ms`,"--moon-frame-fast-delay":`${o*soe}ms`}}return(o,s)=>(w(),T("span",{class:We(["ui-moon",[`ui-moon--${e.size}`,{"ui-moon--fast":e.fast}]]),"aria-label":e.label,role:"img"},[(w(),T(Pe,null,ot(t,(i,r)=>_("span",{key:i,class:"ui-moon__frame",style:Yt(n(r)),"aria-hidden":"true"},O(i),5)),64))],10,noe))}}),S5=ct(ioe,[["__scopeId","data-v-a6b7ec07"]]),tr=X(null),Vc=X(!1);function Ok(e){const t=tr.value;!t||Vc.value||(tr.value=null,t.resolve(e))}async function roe(){const e=tr.value;if(!(!e||Vc.value)){if(!e.action){Ok(!0);return}Vc.value=!0;try{await e.action(),tr.value===e&&(tr.value=null),e.resolve(!0)}catch(t){tr.value===e&&(tr.value=null),e.reject(t)}finally{Vc.value=!1}}}function loe(e){return Vc.value?Promise.resolve(!1):(tr.value&&Ok(!1),new Promise((t,n)=>{tr.value={...e,resolve:t,reject:n}}))}function tf(){return{current:tr,busy:Vc,confirm:loe,settle:Ok,runAction:roe}}const aoe=/^(application\/pdf|image\/(png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)|video\/[\w.+-]+|audio\/[\w.+-]+)$/i,coe=/^(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,uoe=/^(png|jpe?g|gif|webp|avif|bmp|ico)$/i,IC="text/plain;charset=utf-8";function doe(e,t){const n=(t??"").toLowerCase();if(aoe.test(n))return n;if(n.startsWith("text/"))return n==="text/html"?null:IC;const o=e?.match(/\.([A-Za-z0-9]{1,8})$/)?.[1]?.toLowerCase();return o===void 0?null:coe.test(o)?IC:uoe.test(o)?`image/${o==="jpg"?"jpeg":o==="ico"?"x-icon":o}`:o==="pdf"?"application/pdf":null}async function C5(e,t,n){const o=doe(t,n);if(o===null)return"unsupported";const s=window.open("","_blank");s!==null&&(s.opener=null);const i=await dt().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 foe={class:"chat"},hoe={key:0,class:"chat-loading"},poe={class:"chat-loading-text"},moe={key:1,class:"chat-empty"},goe={key:1,class:"top-sentinel-text"},voe={key:0,class:"u-turn"},yoe=["data-turn-id"],koe={key:0,class:"u-atts"},boe={key:1,class:"skill-act"},xoe={class:"skill-act-head"},woe={key:0,class:"skill-act-args"},_oe={key:2,class:"skill-act"},Soe={class:"skill-act-head"},Coe={key:0,class:"skill-act-args"},Aoe={key:3,class:"u-text"},Moe={key:0,class:"u-meta"},Eoe=["aria-label","onClick"],Toe=["aria-label","onClick"],Noe=["data-turn-id"],Ioe=["onClick"],Loe={class:"cd-view"},$oe={key:1,class:"cd-label"},Foe=["data-turn-id"],Ooe={key:1,class:"msg"},Roe={key:0,class:"a-msg-ft"},Boe={key:0,class:"a-duration"},Doe=["aria-label","onClick"],Poe={key:4,class:"sending-placeholder"},Hoe={key:5,class:"q-stack"},Woe={class:"q-head"},zoe={class:"q-title"},Uoe={class:"q-hint"},qoe=["onDragover","onDrop"],joe={class:"u-bub q-bub"},Voe=["title","onDragstart"],Koe=["title","onClick"],Goe={key:0,class:"u-text q-text"},Yoe={key:1,class:"q-text q-text-placeholder"},Zoe={key:0,class:"q-imgs"},Qoe={key:0,class:"q-file"},Xoe={key:1,class:"q-tag q-tag-next"},Joe={key:2,class:"q-tag q-tag-idx"},ese=["aria-label","onClick"],tse={key:0,class:"open-unsupported",role:"status"},nse=2500,ose=Ze({__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}=Tt(),{confirm:s}=tf();bn(()=>{K!==null&&(clearTimeout(K),K=null),L!==null&&(clearTimeout(L),L=null),I!==null&&(clearTimeout(I),I=null),ce!==null&&(clearTimeout(ce),ce=null)});const i=e,r=X(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(Te=>{Te[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),bn(()=>{l?.disconnect(),l=null}),Qe(()=>[i.hasMoreMessages,i.loadingMore,i.loadingMoreError],()=>{mt().then(a)});const c=B(()=>{if(!i.turnActive||i.turns.length===0)return null;const Te=i.turns.at(-1);return Te.role==="assistant"?Te.id:null}),u=B(()=>i.working),d=n,f=X(null),h=X(null);function p(Te){return(Te.attachments?.length??0)>0}function g(Te){d("editQueued",Te)}function b(Te,Ae){if(f.value=Te,!Ae.dataTransfer)return;Ae.dataTransfer.effectAllowed="move",Ae.dataTransfer.setData("text/plain",String(Te));const P=Ae.currentTarget?.closest(".q-turn");P&&Ae.dataTransfer.setDragImage(P,24,24)}function v(Te,Ae){if(f.value===null)return;Ae.preventDefault(),Ae.dataTransfer&&(Ae.dataTransfer.dropEffect="move");const P=Ae.currentTarget.getBoundingClientRect(),le=Ae.clientY<P.top+P.height/2?"before":"after";h.value={index:Te,position:le}}function m(Te,Ae){Ae.preventDefault();const P=f.value,le=h.value?.position??"before";if(f.value=null,h.value=null,P===null)return;let ne=le==="before"?Te:Te+1;P<ne&&(ne-=1),P!==ne&&d("reorderQueue",{from:P,to:ne})}function y(){f.value=null,h.value=null}const k=B(()=>{for(let Te=i.turns.length-1;Te>=0;Te--)if(i.turns[Te].role==="user")return i.turns[Te].id;return null});function A(Te){return Te.role==="user"&&Te.id===k.value&&!i.working&&!Te.skillActivation&&!Te.pluginCommand}function $(Te){const Ae=Te.compaction,P=Ae?.trigger==="auto"?o("conversation.compactedAuto"):o("conversation.compactedPlain");return typeof Ae?.tokensBefore=="number"&&typeof Ae?.tokensAfter=="number"?P+o("conversation.compactedTokens",{before:ir(Ae.tokensBefore),after:ir(Ae.tokensAfter)}):P}const N=X(null),x=X(null);let I=null;async function E(Te){await s({title:o("conversation.undo"),message:o("conversation.undoConfirm"),variant:"primary"})&&F(Te)}function F(Te){x.value===null&&(x.value=Te.id,d("editMessage",{text:Te.text,attachments:Te.attachments}),I=setTimeout(()=>{I=null,x.value=null},nse))}Qe(()=>i.turns,Te=>{x.value!==null&&(Te.some(Ae=>Ae.id===x.value)||(x.value=null,I!==null&&(clearTimeout(I),I=null)))},{flush:"post"});const S=X(!1);let L=null;function R(){if(i.turns.length===0)return;const Te=[];for(const P of i.turns){if(P.role==="compaction"||P.role==="cron")continue;const le=P.role==="user"?"User":"Assistant",ne=CW(P);ne.trim()&&Te.push(`**${le}**
286
-
287
- ${ne}`)}const Ae=Te.join(`
288
-
289
- ---
290
-
291
- `);Go(Ae).then(P=>{P&&(S.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,S.value=!1},2e3))}).catch(()=>{})}function D(Te){const Ae=[];for(let P=Te;P>=0;P--){const le=i.turns[P];if(!le||le.role!=="assistant")break;Ae.unshift(le)}return Ae}function z(Te){return D(Te).map(Ae=>SW(Ae)).filter(Boolean).join(`
292
-
293
- `)}function H(){for(let Te=i.turns.length-1;Te>=0;Te-=1)if(i.turns[Te]?.role==="assistant")return z(Te);return""}function U(){const Te=H();Te.trim()&&Go(Te).then(Ae=>{Ae&&(S.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,S.value=!1},2e3))}).catch(()=>{})}t({copyConversation:R,copyFinalSummary:U});function Z(Te){const Ae=i.turns[Te];if(!Ae||Ae.role!=="assistant")return!1;const P=i.turns[Te+1];return!P||P.role!=="assistant"}let K=null;function V(Te){const Ae=i.turns[Te];if(!Ae)return;const P=z(Te);P.trim()&&Go(P).then(le=>{le&&(N.value=Ae.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,N.value=null},1400))}).catch(()=>{})}function J(Te){const Ae=Te.text;Ae.trim()&&Go(Ae).then(P=>{P&&(N.value=Te.id,K!==null&&clearTimeout(K),K=setTimeout(()=>{K=null,N.value=null},1400))}).catch(()=>{})}function fe(Te){return{kind:Te.kind==="video"?"video":"image",url:Te.url,path:Te.name,fileId:Te.fileId}}const oe=X(null);let ce=null;function ue(Te){if(Te.kind==="image"||Te.kind==="video"){d("openMedia",fe(Te));return}Te.fileId!==void 0&&C5(Te.fileId,Te.name,Te.mediaType).then(Ae=>{Ae==="unsupported"&&(oe.value=Te.name??Te.fileId??"",ce!==null&&clearTimeout(ce),ce=setTimeout(()=>{ce=null,oe.value=null},2400))})}function Se(Te,Ae){return Te.id!==c.value?!1:Ae.sourceIndex===xm(Te).length-1}return(Te,Ae)=>(w(),T(Pe,null,[_("div",foe,[e.sessionLoading?(w(),T("div",hoe,[re(Ds,{size:"sm"}),_("span",poe,O(C(o)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(w(),T("div",moe)):ae("",!0),e.hasMoreMessages||e.loadingMore?(w(),T("div",{key:2,ref_key:"topSentinelRef",ref:r,class:We(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(w(),T("span",goe,[re(Ds,{size:"sm"}),Je(" "+O(C(o)("conversation.loadingOlder")),1)])):(w(),T("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:Ae[0]||(Ae[0]=P=>d("loadOlderMessages"))},O(C(o)("conversation.loadOlder")),1))],2)):ae("",!0),(w(!0),T(Pe,null,ot(e.turns,(P,le)=>(w(),T(Pe,{key:P.id},[P.role==="user"?(w(),T("div",voe,[_("div",{class:We(["u-bub turn-anchor",{undoing:x.value===P.id}]),"data-turn-id":P.id},[P.attachments&&P.attachments.length>0?(w(),T("div",koe,[(w(!0),T(Pe,null,ot(P.attachments,(ne,q)=>(w(),xe(_5,{key:q,kind:ne.kind,name:ne.name,url:ne.url,"file-id":ne.fileId,"media-type":ne.mediaType,size:ne.size,onActivate:ee=>ue(ne)},null,8,["kind","name","url","file-id","media-type","size","onActivate"]))),128))])):ae("",!0),P.skillActivation?(w(),T("div",boe,[_("div",xoe,[Ae[9]||(Ae[9]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,O(C(o)("conversation.activatedSkill",{name:P.skillActivation.name})),1)]),P.skillActivation.args?(w(),T("div",woe,O(P.skillActivation.args),1)):ae("",!0)])):P.pluginCommand?(w(),T("div",_oe,[_("div",Soe,[Ae[10]||(Ae[10]=_("span",{class:"skill-act-arrow"},"▶",-1)),_("span",null,"/"+O(P.pluginCommand.pluginId)+":"+O(P.pluginCommand.commandName),1)]),P.pluginCommand.args?(w(),T("div",Coe,O(P.pluginCommand.args),1)):ae("",!0)])):(w(),T("div",Aoe,O(P.text),1))],10,yoe),P.createdAt||A(P)?(w(),T("div",Moe,[A(P)?(w(),T("div",{key:0,class:We(["u-edit-wrap",{undoing:x.value===P.id}])},[_("button",{type:"button",class:"u-edit","aria-label":C(o)("conversation.undoTooltip"),onClick:ne=>E(P)},[re(Ve,{name:"undo",size:"sm"})],8,Eoe)],2)):ae("",!0),P.text.trim().length>0?(w(),T("button",{key:1,type:"button",class:"u-copy","aria-label":C(o)("filePreview.copy"),onClick:bt(ne=>J(P),["stop"])},[N.value!==P.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Toe)):ae("",!0),P.createdAt?(w(),xe(d5,{key:2,time:P.createdAt},null,8,["time"])):ae("",!0)])):ae("",!0)])):P.role==="compaction"?(w(),T("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":P.id,role:"separator"},[Ae[11]||(Ae[11]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1)),P.text?(w(),T("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:ne=>d("openCompaction",{turnId:P.id})},[_("span",null,O($(P)),1),_("span",Loe,O(C(o)("conversation.viewSummary")),1)],8,Ioe)):(w(),T("span",$oe,O($(P)),1)),Ae[12]||(Ae[12]=_("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,Noe)):P.role==="cron"?(w(),xe(Fte,{key:2,text:P.text,cron:P.cron,"turn-id":P.id,"created-at":P.createdAt},null,8,["text","cron","turn-id","created-at"])):(w(),T("div",{key:3,class:"a-msg turn-anchor","data-turn-id":P.id},[(w(!0),T(Pe,null,ot(C(_W)(P),(ne,q)=>(w(),T(Pe,{key:C(AW)(ne,q)},[ne.kind==="thinking"?(w(),xe(hte,{key:0,text:ne.thinking,mobile:"",streaming:Se(P,ne),onOpen:ee=>d("openThinking",{turnId:P.id,blockIndex:ne.sourceIndex})},null,8,["text","streaming","onOpen"])):ne.kind==="text"&&ne.text?(w(),T("div",Ooe,[re(Wm,{text:ne.text,streaming:Se(P,ne),"open-file":ee=>d("openFile",ee)},null,8,["text","streaming","open-file"])])):ne.kind==="tool-stack"?(w(),xe($W,{key:2,tools:ne.tools,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[1]||(Ae[1]=ee=>d("openMedia",ee)),onOpenFile:Ae[2]||(Ae[2]=ee=>d("openFile",ee)),onOpenToolDiff:Ae[3]||(Ae[3]=ee=>d("openToolDiff",ee)),onOpenAgent:Ae[4]||(Ae[4]=ee=>d("openAgent",ee))},null,8,["tools","tool-diff-panel"])):ne.kind==="tool"?(w(),xe(TA,{key:3,tool:ne.tool,mobile:"","tool-diff-panel":e.toolDiffPanel,onOpenMedia:Ae[5]||(Ae[5]=ee=>d("openMedia",ee)),onOpenFile:Ae[6]||(Ae[6]=ee=>d("openFile",ee)),onOpenToolDiff:Ae[7]||(Ae[7]=ee=>d("openToolDiff",ee)),onOpenAgent:Ae[8]||(Ae[8]=ee=>d("openAgent",ee))},null,8,["tool","tool-diff-panel"])):ae("",!0)],64))),128)),P.id!==c.value&&Z(le)&&(z(le).trim().length>0||P.durationMs!==void 0)?(w(),T("div",Roe,[re(Xt,{text:`${P.durationMs} ms`},{default:Ee(()=>[P.durationMs!==void 0?(w(),T("span",Boe,O(C(bW)(P.durationMs)),1)):ae("",!0)]),_:2},1032,["text"]),z(le).trim().length>0?(w(),T("button",{key:0,class:"a-cpbtn","aria-label":C(o)("filePreview.copy"),onClick:ne=>V(le)},[N.value!==P.id?(w(),xe(Ve,{key:0,name:"copy",size:"sm"})):(w(),xe(Ve,{key:1,name:"check",size:"sm"}))],8,Doe)):ae("",!0)])):ae("",!0)],8,Foe))],64))),128)),e.compaction?(w(),xe(yte,{key:3,label:C(o)("conversation.compacting")},null,8,["label"])):ae("",!0),u.value?(w(),T("div",Poe,[re(S5,{fast:e.fastMoon},null,8,["fast"])])):ae("",!0),e.queued.length>0?(w(),T("div",Hoe,[_("div",Woe,[_("span",zoe,[re(Ve,{name:"mail",size:"sm"}),Je(" "+O(C(o)("composer.queueLabel"))+" · ",1),_("b",null,O(e.queued.length),1)]),_("span",Uoe,O(C(o)("composer.queueAutoDrain")),1)]),(w(!0),T(Pe,null,ot(e.queued,(P,le)=>(w(),T("div",{key:le,class:We(["u-turn q-turn",{"q-dragging":f.value===le,"drop-before":h.value?.index===le&&h.value.position==="before","drop-after":h.value?.index===le&&h.value.position==="after"}]),onDragover:ne=>v(le,ne),onDrop:ne=>m(le,ne)},[_("div",joe,[_("span",{class:"q-grip",title:C(o)("composer.queueDragTitle"),draggable:"true",onDragstart:ne=>b(le,ne),onDragend:y},[re(Ve,{name:"grip",size:"sm"})],40,Voe),_("button",{type:"button",class:"q-body",title:C(o)("composer.editQueued"),onClick:ne=>g(le)},[P.text?(w(),T("span",Goe,O(P.text),1)):(w(),T("span",Yoe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(C(o)("composer.queuedAttachments",{n:P.attachments?.length??0})),1)]))],8,Koe),p(P)?(w(),T("div",Zoe,[(w(!0),T(Pe,null,ot(P.attachments,(ne,q)=>(w(),T(Pe,{key:q},[ne.kind==="file"?(w(),T("span",Qoe,[re(Ve,{name:"file",size:"sm"}),Je(" "+O(ne.name??ne.fileId),1)])):(w(),xe(w5,{key:1,url:ne.url,kind:ne.kind,"file-id":ne.fileId,"media-class":"q-img",controls:!1,muted:""},null,8,["url","kind","file-id"]))],64))),128))])):ae("",!0),le===0?(w(),T("span",Xoe,O(C(o)("composer.queueNext")),1)):(w(),T("span",Joe,"#"+O(le+1),1)),_("button",{type:"button",class:"q-rm","aria-label":C(o)("composer.remove"),onClick:bt(ne=>d("unqueue",le),["stop"])},[re(Ve,{name:"close",size:"sm"})],8,ese)])],42,qoe))),128))])):ae("",!0)]),oe.value!==null?(w(),T("div",tse,O(C(o)("composer.attachmentOpenUnsupported",{name:oe.value})),1)):ae("",!0)],64))}}),A5=ct(ose,[["__scopeId","data-v-d2cc4eff"]]),sse={class:"ch-id"},ise={key:0,class:"ch-ws"},rse={key:1,class:"ch-sep"},lse=["onKeydown"],ase={class:"ch-ses"},cse={key:0,class:"ch-pill ch-sync-pill"},use={key:0,class:"ch-ahead"},dse={key:1,class:"ch-behind"},fse={key:1,class:"ch-pill ch-diff-pill"},hse={key:0,class:"ch-add"},pse={key:1,class:"ch-del"},mse=Ze({__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}=Tt(),o=e,s=t,i=B(()=>o.ahead??0),r=B(()=>o.behind??0),l=B(()=>o.gitDiffStats?.totalAdditions??0),a=B(()=>o.gitDiffStats?.totalDeletions??0),c=B(()=>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 K=d(Z);return u[K]?`pr-${K}`:"pr-unknown"}function h(Z){return n(u[d(Z)]??"header.prStatusUnknown")}const p=X(!1),g=X(null),b=X(null),v=X({});function m(Z){const K=Z.target;b.value?.el?.contains(K)||g.value?.el?.contains(K)||A()}function y(){A()}async function k(Z){if(Z.stopPropagation(),p.value){A();return}p.value=!0,document.addEventListener("mousedown",m),window.addEventListener("resize",y),await mt();const K=g.value?.el,V=b.value?.el;if(!K||!V)return;const J=K.getBoundingClientRect(),fe=4,oe=8,ce=V.offsetWidth,ue=V.offsetHeight;let Se=J.bottom+fe;Se+ue>window.innerHeight-oe&&(Se=Math.max(oe,J.top-ue-fe));let Te=J.left;Te+ce>window.innerWidth-oe&&(Te=Math.max(oe,J.right-ce)),v.value={top:`${Math.round(Se)}px`,left:`${Math.round(Te)}px`}}function A(){p.value=!1,document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)}bn(()=>{document.removeEventListener("mousedown",m),window.removeEventListener("resize",y)});function $(){s("copyAll"),A()}function N(){s("copyFinalSummary"),A()}const x=X(!1);function I(){o.sessionId&&Go(o.sessionId).then(Z=>{Z&&(x.value=!0,setTimeout(()=>{x.value=!1},1200))})}const E=X(!1),F=X(""),S=X(null);async function L(){if(A(),!!o.sessionId){E.value=!0,F.value=o.sessionTitle??"",await mt();try{S.value?.focus(),S.value?.select()}catch{}}}function R(){const Z=F.value.trim();Z&&o.sessionId&&Z!==(o.sessionTitle??"").trim()&&s("renameSession",o.sessionId,Z),E.value=!1}function D(){E.value=!1}function z(){o.sessionId&&(A(),s("forkSession",o.sessionId))}function H(){o.sessionId&&(A(),s("exportSession",o.sessionId))}function U(){o.sessionId&&(A(),s("archiveSession",o.sessionId))}return(Z,K)=>(w(),T("header",{class:We(["chat-header",{"macos-desktop":C(Dc)}])},[_("div",sse,[e.workspaceName?(w(),T("span",ise,O(e.workspaceName),1)):ae("",!0),e.workspaceName&&e.sessionTitle?(w(),T("span",rse,"/")):ae("",!0),E.value?Fn((w(),T("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":K[0]||(K[0]=V=>F.value=V),class:"ch-rename",type:"text",onKeydown:[nr(bt(R,["stop"]),["enter"]),nr(bt(D,["stop"]),["esc"])],onBlur:R,onClick:K[1]||(K[1]=bt(()=>{},["stop"]))},null,40,lse)),[[_s,F.value]]):e.sessionTitle?(w(),xe(Xt,{key:3,text:e.sessionTitle},{default:Ee(()=>[_("span",ase,O(e.sessionTitle),1)]),_:1},8,["text"])):ae("",!0)]),re(Pn,{ref_key:"kebabRef",ref:g,class:We(["ch-act-more",{open:p.value}]),label:C(n)("header.options"),"aria-expanded":p.value,"aria-haspopup":"menu",onClick:K[2]||(K[2]=bt(V=>k(V),["stop"]))},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["class","label","aria-expanded"]),p.value?(w(),xe(kl,{key:0,ref_key:"menuRef",ref:b,class:"ch-menu",style:Yt(v.value),onClick:K[3]||(K[3]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{onClick:$},{default:Ee(()=>[re(Ve,{name:e.copied?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(e.copied?C(n)("header.copied"):C(n)("header.copyAll")),1)]),_:1}),re(pn,{onClick:N},{default:Ee(()=>[re(Ve,{name:"file-text",size:"sm"}),Je(" "+O(C(n)("header.copyFinalSummary")),1)]),_:1}),e.sessionId?(w(),T(Pe,{key:0},[re(pn,{separator:""}),re(pn,{onClick:I},{default:Ee(()=>[re(Ve,{name:x.value?"check":"copy",size:"sm"},null,8,["name"]),Je(" "+O(x.value?C(n)("header.copied"):C(n)("header.copySessionId")),1)]),_:1}),re(pn,{onClick:L},{default:Ee(()=>[re(Ve,{name:"pencil",size:"sm"}),Je(" "+O(C(n)("header.renameSession")),1)]),_:1}),re(pn,{onClick:z},{default:Ee(()=>[re(Ve,{name:"git-fork",size:"sm"}),Je(" "+O(C(n)("header.forkSession")),1)]),_:1}),re(pn,{onClick:H},{default:Ee(()=>[re(Ve,{name:"download",size:"sm"}),Je(" "+O(C(n)("header.exportSession")),1)]),_:1}),re(pn,{danger:"",onClick:U},{default:Ee(()=>[re(Ve,{name:"archive",size:"sm"}),Je(" "+O(C(n)("header.archiveSession")),1)]),_:1})],64)):ae("",!0)]),_:1},8,["style"])):ae("",!0),K[6]||(K[6]=_("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(w(),T("button",{key:1,type:"button",class:"ch-git",onClick:K[4]||(K[4]=V=>s("openChanges"))},[_("span",{class:We(["ch-branch",{"ch-detached":!e.branch}])},O(e.branch||C(n)("header.detached")),3),i.value>0||r.value>0?(w(),T("span",cse,[i.value>0?(w(),T("span",use,"↑"+O(i.value),1)):ae("",!0),r.value>0?(w(),T("span",dse,"↓"+O(r.value),1)):ae("",!0)])):ae("",!0),c.value?(w(),T("span",fse,[l.value>0?(w(),T("span",hse,"+"+O(l.value),1)):ae("",!0),a.value>0?(w(),T("span",pse,"-"+O(a.value),1)):ae("",!0)])):ae("",!0)])):ae("",!0),e.pr?(w(),T("button",{key:2,type:"button",class:We(["ch-pill ch-pr",f(e.pr.state)]),onClick:K[5]||(K[5]=V=>e.pr&&s("openPr",e.pr.url))},[re(Ve,{name:"git-pull-request",size:"sm"}),_("span",null,"PR #"+O(e.pr.number)+" · "+O(h(e.pr.state)),1)],2)):ae("",!0)],2))}}),gse=ct(mse,[["__scopeId","data-v-fa4451d4"]]),vse=["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"],LC=[[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 yse(e){if(e<=255)return vse[e];let t=0,n=LC.length-1;for(;t<=n;){const o=t+n>>1,s=LC[o];if(e<s[0]){n=o-1;continue}if(e>s[1]){t=o+1;continue}return s[2]}return"L"}function kse(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=yse(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 g=c;g<u;g++)n[g]=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 bse(e,t){const n=kse(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 xse=/[ \t\n\r\f]+/g,wse=/[\t\n\r\f]| {2,}|^ | $/;function _se(e){const t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Sse(e){if(!wse.test(e))return e;let t=e.replace(xse," ");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 Cse(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
294
- `).replace(/[\r\f]/g,`
295
- `):e}let hg=null,Ase;function Mse(){return hg===null&&(hg=new Intl.Segmenter(Ase,{granularity:"word"})),hg}const Ese=/\p{Script=Arabic}/u,zl=/\p{M}/u,Rk=/\p{Nd}/u;function $C(e){return Ese.test(e)}function FC(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 rr(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(FC(s))return!0;t++;continue}}if(FC(n))return!0}}return!1}function Tse(e){const t=nf(e);return t!==null&&(Bk.has(t)||La.has(t))}const Nse=new Set([" "," ","⁠","\uFEFF"]),Ise=new Set(["-","‐","–","—"]);function Lse(e){const t=nf(e);return t!==null&&Nse.has(t)}function $se(e){const t=nf(e);return t!==null&&Ise.has(t)}function M5(e,t){return Lse(e)?!1:t?!(Tse(e)||$se(e)):!0}const Bk=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),zm=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Dk=new Set(["'","’"]),La=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),Fse=new Set([":",".","،","؛"]),Ose=new Set(["၏"]),Rse=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function Bse(e){if(Pk(e))return!0;let t=!1;for(const n of e){if(La.has(n)||qm(n)){t=!0;continue}if(!(t&&zl.test(n)))return!1}return t}function Dse(e){for(const t of e)if(!Bk.has(t)&&!La.has(t))return!1;return e.length>0}function Pse(e){if(Pk(e))return!0;for(const t of e)if(!zm.has(t)&&!Dk.has(t)&&!zl.test(t)&&!qm(t))return!1;return e.length>0}function Pk(e){let t=!1;for(const n of e)if(!(n==="\\"||zl.test(n))){if(zm.has(n)||La.has(n)||Dk.has(n)){t=!0;continue}return!1}return t}function Um(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 nf(e){if(e.length===0)return null;const t=Um(e,e.length);return e.slice(t)}function Hse(e){for(const t of e)if(!zl.test(t))return t;return null}function Wse(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(!zl.test(o))return o;t=n}return null}const zse=[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 Use(e,t){for(let n=0;n<t.length;n+=2)if(e>=t[n]&&e<=t[n+1])return!0;return!1}function qm(e){const t=e.codePointAt(0);return t!==void 0&&Use(t,zse)}function qse(e){const t=Wse(e);return t!==null&&qm(t)}function jse(e){const t=Hse(e);return t!==null&&Rk.test(t)}function Vse(e){const t=Array.from(e);let n=t.length;for(;n>0;){const o=t[n-1];if(zl.test(o)){n--;continue}if(zm.has(o)||Dk.has(o)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Kse(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="—"?e:null}function OC(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 RC(e,t){return e&&t!==null&&Fse.has(t)}function Gse(e){const t=nf(e);return t!==null&&Ose.has(t)}function Yse(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 Vv(e){let t=e.length;for(;t>0;){const n=Um(e,t),o=e.slice(n,t);if(Rse.has(o))return!0;if(!La.has(o))return!1;t=n}return!1}function Zse(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
296
- `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const Qse=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Bi(e){return e.length===1?e[0]:e.join("")}function Xse(e,t){const n=[];for(let o=e.length-1;o>=0;o--)n.push(e[o]);return n.push(t),Bi(n)}function Jse(e,t,n,o){if(!Qse.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=Zse(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:Bi(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:Bi(r),isWordLike:a,kind:i,start:l}),s}function Kv(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const eie=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function tie(e,t){const n=e.texts[t];return n.startsWith("www.")?!0:eie.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function nie(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function oie(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"||!tie(e,r))continue;const l=[t[r]];let a=r+1;for(;a<e.len&&!Kv(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]=Bi(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 sie(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]),!nie(r))continue;const l=i+1;if(l>=e.len||Kv(e.kinds[l]))continue;const a=[],c=e.starts[l];let u=l;for(;u<e.len&&!Kv(e.kinds[u]);)a.push(e.texts[u]),u++;a.length>0&&(t.push(Bi(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 iie=new Set([":","-","/","×",",",".","+","–","—"]),rie=/[\p{P}\p{S}\p{Co}]/u,lie=/\p{Emoji_Presentation}/u,aie=new Set(["?","֊","-","‐","‒","–","—","…","‼","‽","⁉"]);function cie(e){return e>=33&&e<=47&&e!==45||e>=58&&e<=64&&e!==63||e>=91&&e<=96||e>=123&&e<=126}function E5(e){const t=e.charCodeAt(0);return t<128?cie(t):!aie.has(e)&&!lie.test(e)&&rie.test(e)}function BC(e){let t=!1;for(const n of e)if(!zl.test(n)){if(!E5(n))return!1;t=!0}return t}function uie(e){for(let t=e.length;t>0;){const n=Um(e,t),o=e.slice(n,t);if(zl.test(o)){t=n;continue}return E5(o)||qm(o)}return!1}function die(e,t,n,o){const s=!t&&BC(e),i=!o&&BC(n),r=qse(e),l=(t||r)&&uie(e);return!s&&!i&&!l||rr(e)||rr(n)?!1:(t||s||r)&&(o||i)}function T5(e){for(const t of e)if(Rk.test(t))return!0;return!1}function Rp(e){if(e.length===0)return!1;for(const t of e)if(!(Rk.test(t)||iie.has(t)))return!1;return!0}function fie(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"&&Rp(r)&&T5(r)){const a=[r];let c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Rp(e.texts[c]);)a.push(e.texts[c]),c++;t.push(Bi(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 hie(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"&&die(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(Bi(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 pie(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||!T5(u)||!Rp(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 mie(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=Bi(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=Bi(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(Bi(r)),n.push(l),o.push(a),s.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:o,starts:s}}function gie(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"||!rr(t[i])||!rr(t[i+1]))continue;const r=Vse(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 vie(e,t,n){const o=Mse();let s=0;const i=[],r=[],l=[],a=[],c=[],u=[],d=[],f=[],h=[],p=[],g=[],b=[];for(const $ of o.segment(e))for(const N of Jse($.segment,$.isWordLike??!1,$.index,n)){let z=function(){u[D]!==null&&(r[D]=[OC(i,u,d,D)],u[D]=null),r[D].push(N.text),l[D]=l[D]||N.isWordLike,f[D]=f[D]||E,h[D]=h[D]||F,p[D]=L,g[D]=R,b[D]=RC(h[D],S)};const x=N.kind==="text",I=Kse(N.text,N.isWordLike,N.kind),E=rr(N.text),F=$C(N.text),S=nf(N.text),L=Vv(N.text),R=Gse(N.text),D=s-1;t.carryCJKAfterClosingQuote&&x&&s>0&&a[D]==="text"&&E&&f[D]&&p[D]||x&&s>0&&a[D]==="text"&&Dse(N.text)&&f[D]||x&&s>0&&a[D]==="text"&&g[D]?z():x&&s>0&&a[D]==="text"&&N.isWordLike&&F&&b[D]?(z(),l[D]=!0):I!==null&&s>0&&a[D]==="text"&&u[D]===I?d[D]=(d[D]??1)+1:x&&!N.isWordLike&&s>0&&a[D]==="text"&&!f[D]&&(Bse(N.text)||N.text==="-"&&l[D])?z():(i[s]=N.text,r[s]=[N.text],l[s]=N.isWordLike,a[s]=N.kind,c[s]=N.start,u[s]=I,d[s]=I===null?0:1,f[s]=E,h[s]=F,p[s]=L,g[s]=R,b[s]=RC(F,S),s++)}for(let $=0;$<s;$++){if(u[$]!==null){i[$]=OC(i,u,d,$);continue}i[$]=Bi(r[$])}for(let $=1;$<s;$++)a[$]==="text"&&!l[$]&&Pk(i[$])&&a[$-1]==="text"&&!f[$-1]&&(i[$-1]+=i[$],l[$-1]=l[$-1]||l[$],i[$]="");const v=Array.from({length:s},()=>null);let m=-1;for(let $=s-1;$>=0;$--){const N=i[$];if(N.length!==0){if(a[$]==="text"&&!l[$]&&m>=0&&a[m]==="text"&&(Pse(N)||N==="-"&&jse(i[m]))){const x=v[m]??[];x.push(N),v[m]=x,c[m]=c[$],i[$]="";continue}m=$}}for(let $=0;$<s;$++){const N=v[$];N!=null&&(i[$]=Xse(N,i[$]))}let y=0;for(let $=0;$<s;$++){const N=i[$];N.length!==0&&(y!==$&&(i[y]=N,l[y]=l[$],a[y]=a[$],c[y]=c[$]),y++)}i.length=y,l.length=y,a.length=y,c.length=y;const k=mie({len:y,texts:i,isWordLike:l,kinds:a,starts:c}),A=gie(hie(pie(fie(sie(oie(k))))));for(let $=0;$<A.len-1;$++){const N=Yse(A.texts[$]);N!==null&&(A.kinds[$]!=="space"&&A.kinds[$]!=="preserved-space"||A.kinds[$+1]!=="text"||!$C(A.texts[$+1])||(A.texts[$]=N.space,A.isWordLike[$]=!1,A.kinds[$]=A.kinds[$]==="preserved-space"?"preserved-space":"space",A.texts[$+1]=N.marks+A.texts[$+1],A.starts[$+1]=A.starts[$]+N.space.length))}return A}function yie(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 kie(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 v=f;v<h;v++)p=p||t.isWordLike[v];const g=t.starts[f],b=h<t.len?t.starts[h]:e.length;o.push(e.slice(g,b)),s.push(p),i.push("text"),r.push(g)}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&&!M5(t.texts[f-1],n)&&d(f),l<0&&(l=f),a=a||rr(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 bie(e,t,n="normal",o="normal"){const s=_se(n),i=s.mode==="pre-wrap"?Cse(e):Sse(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=vie(i,t,s),l=o==="keep-all"?kie(i,r,t.breakKeepAllAfterPunctuation):r;return{normalized:i,chunks:yie(l,s),...l}}let fc=null;const DC=new Map;let hc=null;const xie=96,wie=/\p{Emoji_Presentation}/u,_ie=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let pg=null;const PC=new Map;function Hk(){if(fc!==null)return fc;if(typeof OffscreenCanvas<"u")return fc=new OffscreenCanvas(1,1).getContext("2d"),fc;if(typeof document<"u")return fc=document.createElement("canvas").getContext("2d"),fc;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Sie(e){let t=DC.get(e);return t||(t=new Map,DC.set(e,t)),t}function wl(e,t){let n=t.get(e);return n===void 0&&(n={width:Hk().measureText(e).width,containsCJK:rr(e)},t.set(e,n)),n}function jm(){if(hc!==null)return hc;if(typeof navigator>"u")return hc={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},hc;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 hc={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:o,breakKeepAllAfterPunctuation:!n,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},hc}function Cie(e){const t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function N5(){return pg===null&&(pg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),pg}function Aie(e){return wie.test(e)||e.includes("️")}function Mie(e){return _ie.test(e)}function Eie(e,t){let n=PC.get(e);if(n!==void 0)return n;const o=Hk();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 PC.set(e,n),n}function Tie(e){let t=0;const n=N5();for(const o of n.segment(e))Aie(o.segment)&&t++;return t}function Nie(e,t){return t.emojiCount===void 0&&(t.emojiCount=Tie(e)),t.emojiCount}function ba(e,t,n){return n===0?t.width:t.width-Nie(e,t)*n}function Iie(e,t,n,o,s){if(t.breakableFitAdvances!==void 0&&t.breakableFitMode===s)return t.breakableFitAdvances;t.breakableFitMode=s;const i=N5(),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=wl(d,n);u.push(ba(d,f,o))}return t.breakableFitAdvances=u,t.breakableFitAdvances}if(s==="pair-context"||r.length>xie){const u=[];let d=null,f=0;for(const h of r){const p=wl(h,n),g=ba(h,p,o);if(d===null)u.push(g);else{const b=d+h,v=wl(b,n);u.push(ba(b,v,o)-f)}d=h,f=g}return t.breakableFitAdvances=u,t.breakableFitAdvances}const l=[];let a="",c=0;for(const u of r){a+=u;const d=wl(a,n),f=ba(a,d,o);l.push(f-c),c=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function Lie(e,t){const n=Hk();n.font=e;const o=Sie(e),s=Cie(e),i=t?Eie(e,s):0;return{cache:o,fontSize:s,emojiCorrection:i}}function $ie(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function I5(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function L5(e,t,n=e.widths.length){for(;t<n;){const o=e.kinds[t];if(!$ie(o))break;t++}return t}function Fie(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Oie(e,t,n){return e.letterSpacing!==0&&t&&e.spacingGraphemeCounts[n]>0?e.letterSpacing:0}function Wk(e,t){return t===0?0:e+t}function Rie(e,t){return e.letterSpacing!==0&&e.spacingGraphemeCounts[t]>0?e.letterSpacing:0}function Bie(e,t,n,o,s){const i=t==="tab"?s+Rie(e,n):e.lineEndFitAdvances[n];return Wk(o,i)}function HC(e,t,n,o){const s=t==="tab"?0:e.lineEndFitAdvances[n];return Wk(o,s)}function WC(e,t,n,o,s){const i=t==="tab"?s:e.lineEndPaintAdvances[n];return Wk(o,i)}function Die(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Pie(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Bp(e,t,n){let o=t;for(;o<e.length&&e[o]<n;)o++;return o}function Hie(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 Wie(e,t,n,o,s,i){return t+Hie(e,n,o,s,i)}function zie(e,t,n){const{widths:o,kinds:s,breakableFitAdvances:i,breakablePreferredBreaks:r}=e;if(o.length===0)return 0;const a=jm().lineFitEpsilon,c=t+a;let u=0,d=0,f=!1,h=0,p=0,g=0,b=0,v=-1,m=0;function y(){v=-1,m=0}function k(E=g,F=b,S=d){u++,n?.(S,h,p,E,F),d=0,f=!1,y()}function A(E,F){f=!0,h=E,p=0,g=E+1,b=0,d=F}function $(E,F,S){f=!0,h=E,p=F,g=E,b=F+1,d=S}function N(E,F){if(!f){A(E,F);return}d+=F,g=E+1,b=0}function x(E,F){const S=i[E],L=r[E]??null;let R=L===null?-1:Bp(L,0,F+1),D=-1,z=0,H=F;for(;H<S.length;){const U=S[H];if(!f)$(E,H,U);else if(d+U>c){if(L!==null&&D>F){k(E,D,z),H=D,R=Bp(L,R,H+1),D=-1,z=0;continue}k(),$(E,H,U)}else d+=U,g=E,b=H+1;const Z=H+1;L!==null&&L[R]===Z&&(D=Z,z=d,R++),H++}f&&g===E&&b===S.length&&(g=E+1,b=0)}let I=0;for(;I<o.length&&!(!f&&(I=L5(e,I),I>=o.length));){const E=o[I],F=s[I],S=I5(F);if(!f){E>c&&i[I]!==null?x(I,0):A(I,E),S&&(v=I+1,m=d-E),I++;continue}if(d+E>c){if(S){N(I,E),k(I+1,0,d-E),I++;continue}if(v>=0){if(g>v||g===v&&b>0){k();continue}k(v,0,m);continue}if(E>c&&i[I]!==null){k(),x(I,0),I++;continue}k();continue}N(I,E),S&&(v=I+1,m=d-E),I++}return f&&k(),u}function Uie(e,t,n){if(e.simpleLineWalkFastPath)return zie(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=jm(),u=c.lineFitEpsilon,d=t+u;let f=0,h=0,p=!1,g=0,b=0,v=0,m=0,y=-1,k=0,A=0,$=null;function N(){y=-1,k=0,A=0,$=null}function x(){return $==="soft-hyphen"&&y===v&&m===0?A:h}function I(z=v,H=m,U){f++,n!==void 0&&n(Wie(e,U??x(),g,b,z,H),g,b,z,H),h=0,p=!1,N()}function E(z,H){p=!0,g=z,b=0,v=z+1,m=0,h=H}function F(z,H,U){p=!0,g=z,b=H,v=z,m=H+1,h=U}function S(z,H){if(!p){E(z,H);return}h+=H,v=z+1,m=0}function L(z,H,U,Z,K,V){if(!H)return;const J=HC(e,z,U,K),fe=WC(e,z,U,K,Z);y=U+1,k=h-V+J,A=h-V+fe,$=z}function R(z,H){const U=i[z],Z=r[z]??null;let K=Z===null?-1:Bp(Z,0,H+1),V=-1,J=0,fe=H;for(;fe<U.length;){const oe=U[fe];if(!p)F(z,fe,oe);else{const ue=Die(e,!0,oe),Se=h+ue;if(Pie(e,Se)>d){if(Z!==null&&V>H){I(z,V,J),fe=V,K=Bp(Z,K,fe+1),V=-1,J=0;continue}I(),F(z,fe,oe)}else h=Se,v=z,m=fe+1}const ce=fe+1;Z!==null&&Z[K]===ce&&(V=ce,J=h,K++),fe++}p&&v===z&&m===U.length&&(v=z+1,m=0)}function D(z){f++,n?.(0,z.startSegmentIndex,0,z.consumedEndSegmentIndex,0),N()}for(let z=0;z<a.length;z++){const H=a[z];if(H.startSegmentIndex===H.endSegmentIndex){D(H);continue}p=!1,h=0,g=H.startSegmentIndex,b=0,v=H.startSegmentIndex,m=0,N();let U=H.startSegmentIndex;for(;U<H.endSegmentIndex&&!(!p&&(U=L5(e,U,H.endSegmentIndex),U>=H.endSegmentIndex));){const Z=s[U],K=I5(Z),V=Oie(e,p,U),J=Z==="tab"?Fie(h+V,e.tabStopAdvance):o[U],fe=V+J,oe=Bie(e,Z,U,V,J);if(Z==="soft-hyphen"){p&&(v=U+1,m=0,y=U+1,k=h+l,A=h+l,$=Z),U++;continue}if(!p){oe>d&&i[U]!==null?R(U,0):E(U,J),L(Z,K,U,J,V,fe),U++;continue}if(h+oe>d){const ue=h+HC(e,Z,U,V),Se=h+WC(e,Z,U,V,J);if($==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&k<=d){I(y,0,A);continue}if(K&&ue<=d){S(U,fe),I(U+1,0,Se),U++;continue}if(y>=0&&k<=d){if(v>y||v===y&&m>0){I();continue}const Te=y;I(Te,0,A),U=Te;continue}if(oe>d&&i[U]!==null){I(),R(U,0),U++;continue}I();continue}S(U,fe),L(Z,K,U,J,V,fe),U++}if(p){const Z=y===H.consumedEndSegmentIndex?A:h;I(H.consumedEndSegmentIndex,0,Z)}}return f}let mg=null;function zk(){return mg===null&&(mg=new Intl.Segmenter(void 0,{granularity:"grapheme"})),mg}function qie(e){return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}}function jie(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=Vv(d),l=zm.has(d)}function u(d,f){o.push(d),i=i||f;const h=Vv(d);d.length===1&&La.has(d)?r=r||h:r=h,l=!1}for(const d of zk().segment(e)){const f=d.segment,h=rr(f);if(o.length===0){c(f,d.index,h);continue}if(l||Bk.has(f)||La.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 Vie(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&&!M5(t[a-1].text,n)&&l(a),s<0&&(s=a),i=i||rr(c.text)}return l(t.length),o}function zC(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=zk();for(const s of o.segment(e))n++;return n}function Kie(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Gie(e){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(e))return null;const t=[];let n=0;for(const o of zk().segment(e))n++,Kie(o.segment)&&t.push(n);return t.length===0?null:t}function Yie(e,t,n){return t>1?e+(t-1)*n:e}function Zie(e,t,n,o,s){const i=jm(),{cache:r,emojiCorrection:l}=Lie(t,Mie(e.normalized)),a=ba("-",wl("-",r),l)+(s===0?0:s*2),u=ba(" ",wl(" ",r),l)*8,d=s!==0;if(e.len===0)return qie();const f=[],h=[],p=[],g=[];let b=e.chunks.length<=1&&!d;const v=n?[]:null,m=[],y=[],k=[],A=n?[]:null,$=Array.from({length:e.len});function N(F,S,L,R,D,z,H,U,Z){D!=="text"&&D!=="space"&&D!=="zero-width-break"&&(b=!1),f.push(S),h.push(L),p.push(R),g.push(D),v?.push(z),m.push(H),y.push(U),d&&k.push(Z),A!==null&&A.push(F)}function x(F,S,L,R,D){const z=wl(F,r),H=d?zC(F,S):0,U=Yie(ba(F,z,l),H,s),Z=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,K=Z===0?0:Z+(H>0?s:0),V=S==="space"||S==="zero-width-break"?0:U;if(D&&R&&F.length>1){let J="sum-graphemes";s!==0?J="segment-prefixes":Rp(F)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");const fe=Iie(F,z,r,l,J),oe=fe===null||o==="keep-all"?null:Gie(F);N(F,U,K,V,S,L,fe,oe,H);return}N(F,U,K,V,S,L,null,null,H)}for(let F=0;F<e.len;F++){$[F]=f.length;const S=e.texts[F],L=e.isWordLike[F],R=e.kinds[F],D=e.starts[F];if(R==="soft-hyphen"){N(S,0,a,a,R,D,null,null,0);continue}if(R==="hard-break"){N(S,0,0,0,R,D,null,null,0);continue}if(R==="tab"){N(S,0,0,0,R,D,null,null,d?zC(S,R):0);continue}const z=wl(S,r);if(R==="text"&&z.containsCJK){const H=jie(S,i),U=o==="keep-all"?Vie(S,H,i.breakKeepAllAfterPunctuation):H;for(let Z=0;Z<U.length;Z++){const K=U[Z];x(K.text,"text",D+K.start,L,o==="keep-all"||!rr(K.text))}continue}x(S,R,D,L,!0)}const I=Qie(e.chunks,$,f.length),E=v===null?null:bse(e.normalized,v);return A!==null?{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:I,segments:A}:{widths:f,lineEndFitAdvances:h,lineEndPaintAdvances:p,kinds:g,simpleLineWalkFastPath:b,segLevels:E,breakableFitAdvances:m,breakablePreferredBreaks:y,letterSpacing:s,spacingGraphemeCounts:k,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:I}}function Qie(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 Xie(e,t,n,o){const s=o?.wordBreak??"normal",i=o?.letterSpacing??0,r=bie(e,jm(),o?.whiteSpace,s);return Zie(r,t,n,s,i)}function Jie(e,t,n){return Xie(e,t,!0,n)}function ere(e){let t=0;return Uie(e,Number.POSITIVE_INFINITY,n=>{n>t&&(t=n)}),t}const tre={key:0,class:"slash-menu",role:"listbox"},nre=["aria-selected","onMouseenter","onMousedown"],ore={class:"slash-name"},sre={class:"slash-desc"},ire=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X([]);return Qe(()=>o.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(w(),T("div",tre,[(w(!0),T(Pe,null,ot(e.items,(a,c)=>(w(),T("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:We(["slash-item",{active:c===o.activeIndex}]),role:"option","aria-selected":c===o.activeIndex,onMouseenter:u=>s("hover",c),onMousedown:bt(u=>s("select",a),["prevent"])},[_("span",ore,O(a.name),1),_("span",sre,O(a.isSkill?a.desc:C(n)(a.desc)),1)],42,nre))),128))])):ae("",!0)}}),rre=ct(ire,[["__scopeId","data-v-f60b70d9"]]),lre={class:"mention-menu",role:"listbox"},are={key:0,class:"mention-state dim"},cre={key:1,class:"mention-state dim"},ure=["aria-selected","onMouseenter","onMousedown"],dre=["innerHTML"],fre={class:"mention-name"},hre={class:"mention-path"},pre=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=yc("folder","sm"),r=yc("code","sm"),l=yc("file-text","sm"),a=yc("image","sm"),c=yc("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 g=p.path;if(g.endsWith("/"))return i;const b=p.name||g.split("/").pop()||g,v=b.lastIndexOf("."),m=v>0?b.slice(v+1).toLowerCase():"";return m?u.has(m)?r:d.has(m)?l:f.has(m)?a:c:c}return(p,g)=>(w(),T("div",lre,[n.loading?(w(),T("div",are,O(C(s)("mention.searching")),1)):n.items.length===0?(w(),T("div",cre,O(C(s)("mention.noMatch")),1)):(w(!0),T(Pe,{key:2},ot(n.items,(b,v)=>(w(),T("div",{key:b.path,class:We(["mention-item",{active:v===n.activeIndex}]),role:"option","aria-selected":v===n.activeIndex,onMouseenter:m=>o("hover",v),onMousedown:bt(m=>o("select",b),["prevent"])},[_("span",{class:"mention-icon",innerHTML:h(b),"aria-hidden":"true"},null,8,dre),_("span",fre,O(b.name),1),_("span",hre,O(b.path),1)],42,ure))),128))]))}}),mre=ct(pre,[["__scopeId","data-v-f4d6b958"]]),$5=[{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 gre(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 Dp="skill:";function vre(e){return e.startsWith(Dp)?e.slice(Dp.length):e}function F5(e=[]){const t=e.map(n=>({name:n.source==="builtin"?`/${n.name}`:`/${Dp}${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...$5,...t]}function yre(e,t=$5){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 Vm(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 O5(e){return e?.supportEfforts??[]}function kre(e){return e[Math.floor(e.length/2)]}function Pd(e){if(Vm(e)==="unsupported")return"off";const t=O5(e);return t.length>0?e?.defaultEffort??kre(t):"on"}function Km(e){const t=O5(e),n=Vm(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Gv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function bre(e){return e!=="off"}function xre(e,t){return Km(e).includes(t)}function Uk(e,t){return t==="off"?"off":t==="on"?Pd(e):t}function Pp(e,t){return t??Pd(e)}function wre(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 _re(e,t,n){return!n||e===void 0?t:Pd(e)}const Hp=100;function Sre(e){const t=ym(Ft.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>Hp?n.slice(-Hp):n,s={[e]:o};return Gd(Ft.inputHistory,s),s}return t&&typeof t=="object"?t:{}}function Cre(e){const{text:t,textareaRef:n,autosize:o,sessionId:s}=e,i=X(Sre(s())),r=B(()=>i.value[s()??""]??[]);let l=-1,a="";function c(v){const m=s();if(l=-1,!m)return;const y=v.trim();if(!y)return;const k=i.value[m]??[];if(k.at(-1)===y)return;const A=[...k,y],$=A.length>Hp?A.slice(-Hp):A;i.value={...i.value,[m]:$},Gd(Ft.inputHistory,i.value)}function u(){const v=n.value;return v?(v.selectionStart??0)===0:!1}function d(v){t.value=v,mt(()=>{const m=n.value;if(!m)return;o();const y=v.length;m.setSelectionRange(y,y)})}function f(){const v=r.value;if(v.length!==0){if(l===-1)a=t.value,l=v.length-1;else if(l>0)l-=1;else return;d(v[l])}}function h(){if(l===-1)return;const v=r.value;l<v.length-1?(l+=1,d(v[l])):(l=-1,d(a))}function p(){l=-1}function g(){return l!==-1}function b(){return r.value.length>0}return Qe(s,()=>{l=-1}),{push:c,caretAtTextStart:u,recallOlder:f,recallNewer:h,resetBrowsing:p,isBrowsing:g,hasHistory:b}}function Are(e){const{text:t,textareaRef:n,autosize:o,skills:s,emitCommand:i,historyPush:r,clearDraft:l}=e,a=X(!1),c=X([]),u=X(0);function d(){const h=t.value;h.startsWith("/")&&!h.includes(" ")?(c.value=yre(h,F5(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} `,mt(()=>{const p=n.value;if(!p)return;const g=t.value.length;p.setSelectionRange(g,g),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 Mre(e){const{text:t,textareaRef:n,autosize:o,searchFiles:s}=e,i=X(!1),r=X([]),l=X(0),a=X(!1);let c=null;function u(){const h=t.value,p=n.value?.selectionStart??h.length;let g=p-1;for(;g>=0&&!/\s/.test(h[g]);)g--;g++;const b=h.slice(g,p);return b.startsWith("@")?{token:b.slice(1),start:g,end:p}:null}function d(){const h=u(),p=s();if(!h||!p){i.value=!1;return}const g=h.token;c!==null&&clearTimeout(c),c=setTimeout(async()=>{a.value=!0,i.value=!0,l.value=0;try{r.value=await p(g)}catch{r.value=[]}finally{a.value=!1}},200)}function f(h){const p=u();if(!p)return;const g=t.value;t.value=g.slice(0,p.start)+h.path+g.slice(p.end),i.value=!1,mt(()=>{const b=n.value;if(!b)return;const v=p.start+h.path.length;b.setSelectionRange(v,v),b.focus(),o()})}return{open:i,items:r,active:l,loading:a,update:d,select:f}}function Ere(e){const{sessionId:t}=e;function n(c){return mo(Jx(c))??""}function o(c,u){const d=Jx(c);u?So(d,u):Na(d)}const s=X(n(t())),i=X(null);function r(){const c=i.value;c&&(c.style.height="auto",c.style.height=`${c.scrollHeight}px`)}Qe(s,c=>{mt(r),o(t(),c)}),Qe(t,(c,u)=>{c!==u&&(o(u,s.value),s.value=n(c),mt(r))});function l(c){s.value=c,mt(()=>{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 Tre(e){const{uploadImage:t,sessionId:n}=e,o=X({}),s=B(()=>o.value[n()??""]??[]),i=X(null),r=X(null),l=X(!1);let a=0;function c(){return`att_${++a}`}function u(H,U){o.value={...o.value,[H]:U}}function d(H){if(H.previewUrl!==void 0)try{URL.revokeObjectURL(H.previewUrl)}catch{}}function f(H){return H.startsWith("image/")?"image":H.startsWith("video/")?"video":"file"}async function h(H){const U=t();if(!U)return;const Z=n()??"";if(H.length!==0)for(const K of H){const V=f(K.type),J=c(),fe=V==="file"?void 0:URL.createObjectURL(K),oe={localId:J,name:K.name,kind:V,previewUrl:fe,mediaType:K.type||"application/octet-stream",size:K.size,uploading:!0};u(Z,[...o.value[Z]??[],oe]),U(K,K.name).then(ce=>{const ue=o.value[Z]??[];u(Z,ue.map(Se=>Se.localId===J?{...Se,uploading:!1,fileId:ce?.fileId,mediaType:ce?.mediaType??Se.mediaType,error:ce===null}:Se))}).catch(()=>{const ce=o.value[Z]??[];u(Z,ce.map(ue=>ue.localId===J?{...ue,uploading:!1,error:!0}:ue))})}}function p(H){const U=n()??"",Z=o.value[U]??[],K=Z.find(V=>V.localId===H);i.value?.localId===H&&(i.value=null),K&&d(K),u(U,Z.filter(V=>V.localId!==H))}function g(H){i.value=H}function b(){i.value=null}function v(){r.value?.click()}function m(H){const U=H.target,Z=Array.from(U.files??[]);h(Z),U.value=""}function y(H){if(!t())return;const U=H.clipboardData;if(!U)return;const Z=[],K=new Set,V=(J,fe)=>{const oe=`${J.size}:${J.type}:${fe}`;if(K.has(oe))return;K.add(oe);const ce=J.type.split("/")[1]??"png",ue=fe.includes(".")?fe:`paste-${Date.now()}.${ce}`;Z.push(J instanceof File?J:new File([J],ue,{type:J.type}))};for(const J of Array.from(U.items))if(J.kind==="file"){const fe=J.getAsFile();fe&&V(fe,fe.name||`paste-${Date.now()}.${J.type.split("/")[1]??"png"}`)}for(const J of Array.from(U.files))V(J,J.name);Z.length!==0&&(H.preventDefault(),h(Z))}let k=0;function A(H){!t()||!Array.from(H.dataTransfer?.items??[]).some(Z=>Z.kind==="file")||(H.preventDefault(),H.stopPropagation(),l.value=!0)}function $(){l.value=!1}function N(H){if(k=0,l.value=!1,!t())return;H.preventDefault(),H.stopPropagation();const U=Array.from(H.dataTransfer?.files??[]);h(U)}function x(H){return Array.from(H.dataTransfer?.items??[]).some(U=>U.kind==="file")}function I(H){!t()||!x(H)||(H.preventDefault(),k+=1,l.value=!0)}function E(H){!t()||!x(H)||H.preventDefault()}function F(H){!t()||!x(H)||(k=Math.max(0,k-1),k===0&&(l.value=!1))}function S(H){if(k=0,l.value=!1,!t())return;H.preventDefault();const U=Array.from(H.dataTransfer?.files??[]);h(U)}function L(){const H=n()??"";for(const U of o.value[H]??[])d(U);u(H,[])}function R(H,U,Z){const K=o.value[H]??[];K.some(V=>V.localId===U)&&u(H,K.map(V=>V.localId===U?{...V,...Z}:V))}function D(H){return fetch(H).then(U=>{if(!U.ok)throw new Error(`fetch failed: ${U.status}`);return U.blob()})}function z(H){const U=n()??"";for(const Z of o.value[U]??[])d(Z);u(U,[]);for(const Z of H){const K=c(),V=/^data:/i.test(Z.url),J=/^blob:/i.test(Z.url),fe=Z.name??Z.kind;if(Z.fileId){const oe={localId:K,name:fe,kind:Z.kind,previewUrl:Z.kind==="file"?void 0:Z.url,uploading:!1,fileId:Z.fileId};u(U,[...o.value[U]??[],oe]),Z.kind!=="file"&&!V&&!J&&dt().getFileBlob(Z.fileId).then(ce=>{const ue=URL.createObjectURL(ce);if(!(o.value[U]??[]).some(Te=>Te.localId===K)){URL.revokeObjectURL(ue);return}R(U,K,{previewUrl:ue})}).catch(()=>{})}else{if(!Z.url)continue;const oe=t();if(!oe)continue;const ce={localId:K,name:fe,kind:Z.kind,previewUrl:Z.url,uploading:!0};u(U,[...o.value[U]??[],ce]),D(Z.url).then(ue=>{const Se=fe.includes(".")?fe:`${fe}.${ue.type.split("/")[1]??"bin"}`;return oe(ue,Se)}).then(ue=>{if(ue===null){const Se=o.value[U]??[];u(U,Se.filter(Te=>Te.localId!==K));return}R(U,K,{uploading:!1,fileId:ue.fileId})}).catch(()=>{const ue=o.value[U]??[];u(U,ue.filter(Se=>Se.localId!==K))})}}}return Qe(n,()=>{i.value=null}),cn(()=>{document.addEventListener("paste",y),document.addEventListener("dragenter",I),document.addEventListener("dragover",E),document.addEventListener("dragleave",F),document.addEventListener("drop",S)}),bn(()=>{document.removeEventListener("paste",y),document.removeEventListener("dragenter",I),document.removeEventListener("dragover",E),document.removeEventListener("dragleave",F),document.removeEventListener("drop",S);for(const H of Object.values(o.value))for(const U of H)d(U);i.value=null}),{attachments:s,previewAttachment:i,fileInputRef:r,isDragOver:l,removeAttachment:p,openAttachmentPreview:g,closeAttachmentPreview:b,openFilePicker:v,handleFileInputChange:m,handleDragOver:A,handleDragLeave:$,handleDrop:N,clearAfterSubmit:L,loadAttachments:z}}const Nre=["type","disabled"],Ire={class:"ui-button__content"},Lre=Ze({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(w(),T("button",{class:We(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(w(),xe(Ds,{key:0,size:"sm",class:"ui-button__spinner"})):ae("",!0),_("span",Ire,[On(t.$slots,"default",{},void 0,!0)])],10,Nre))}}),Bt=ct(Lre,[["__scopeId","data-v-e58393a8"]]),$re={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Fre=["stroke-dasharray","stroke-dashoffset"],gg=7,Ore=Ze({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*gg;return(o,s)=>(w(),T("svg",$re,[_("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5"}),_("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:gg,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Fre)]))}}),Rre=ct(Ore,[["__scopeId","data-v-a364f1f1"]]),Bre={key:0,class:"att-strip"},Dre={class:"att-lightbox-card"},Pre=["src"],Hre=["src","alt"],Wre={class:"att-lightbox-name"},zre={class:"composer-card"},Ure={class:"cin-wrap"},qre={class:"input-row"},jre=["placeholder","disabled"],Vre=["aria-label"],Kre={class:"toolbar-left"},Gre=["onKeydown"],Yre=["onClick"],Zre={class:"pd-check"},Qre={class:"pd-info"},Xre={class:"pd-desc"},Jre={class:"mode-label"},ele={key:0,class:"mode-tag"},tle={key:1,class:"mode-tag"},nle={key:2,class:"mode-tag"},ole={class:"mode-row-icon"},sle={class:"mode-row-info"},ile={class:"mode-row-name"},rle={class:"mode-row-desc"},lle={class:"mode-row-icon"},ale={class:"mode-row-info"},cle={class:"mode-row-name"},ule={class:"mode-row-desc"},dle={class:"mode-row-icon"},fle={class:"mode-row-info"},hle={class:"mode-row-name"},ple={class:"mode-row-desc"},mle={key:0,class:"mode-row-actions"},gle={class:"toolbar-right"},vle=["aria-label"],yle=["onKeydown"],kle={key:0,class:"think-suffix"},ble=["aria-label"],xle=["aria-label","disabled"],wle={key:0,class:"md-section"},_le=["onClick"],Sle={class:"md-check"},Cle={class:"md-name"},Ale={class:"md-provider"},Mle={key:1,class:"md-divider"},Ele={key:2,class:"md-section"},Tle=["onClick"],Nle={class:"md-check"},Ile={class:"md-name"},Lle={key:3,class:"md-divider"},$le={class:"md-name"},Fle={key:0,class:"md-note"},Ole=["aria-label"],Rle=["disabled","onClick"],Ble={class:"md-cache-note"},Dle={class:"md-name"},Ple={class:"drop-card"},UC=36,Hle=Ze({__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=B(()=>o.starting?r("composer.starting"):o.running?r("composer.placeholderRunning"):o.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r,locale:l}=Tt(),{text:a,textareaRef:c,autosize:u,loadForEdit:d,clearDraft:f}=Ere({sessionId:()=>o.sessionId}),h=X(!1);function p(){h.value=!h.value,mt(()=>{u(),m(),c.value?.focus()})}function g(){h.value&&(h.value=!1,mt(u))}function b(Ue){if(typeof getComputedStyle>"u")return UC;const Fe=Number.parseFloat(getComputedStyle(Ue).minHeight);return Number.isFinite(Fe)&&Fe>0?Fe:UC}const v=X(!1);function m(){const Ue=c.value;v.value=!!Ue&&Ue.scrollHeight>b(Ue)}Qe(a,()=>{mt(m)}),Qe(()=>o.sessionId,()=>{h.value=!1});const y=Cre({text:a,textareaRef:c,autosize:u,sessionId:()=>o.sessionId}),{open:k,items:A,active:$,update:N,select:x}=Are({text:a,textareaRef:c,autosize:u,skills:()=>o.skills,emitCommand:Ue=>i("command",Ue),historyPush:Ue=>y.push(Ue),clearDraft:f}),{open:I,items:E,active:F,loading:S,update:L,select:R}=Mre({text:a,textareaRef:c,autosize:u,searchFiles:()=>o.searchFiles});function D(){y.resetBrowsing(),N(),L()}const{attachments:z,previewAttachment:H,fileInputRef:U,isDragOver:Z,removeAttachment:K,openAttachmentPreview:V,closeAttachmentPreview:J,openFilePicker:fe,handleFileInputChange:oe,handleDragOver:ce,handleDragLeave:ue,handleDrop:Se,clearAfterSubmit:Te,loadAttachments:Ae}=Tre({uploadImage:()=>o.uploadImage,sessionId:()=>o.sessionId});cn(()=>{a.value&&mt(()=>{u(),m()})}),bn(()=>{document.removeEventListener("mousedown",Gt),j()});function P(){c.value?.focus({preventScroll:!0})}function le(Ue){Ae(Ue)}t({loadForEdit:d,loadAttachmentsForEdit:le,focus:P});function ne(Ue){return{fileId:Ue.fileId,kind:Ue.kind,name:Ue.name,mediaType:Ue.mediaType,size:Ue.size}}function q(Ue){if(Ue.kind==="file"){Ue.fileId!==void 0&&C5(Ue.fileId,Ue.name,Ue.mediaType);return}V(Ue)}function ee(){const Ue=a.value.trim();if(z.value.some(Ne=>Ne.uploading))return;const Fe=z.value.filter(Ne=>!Ne.uploading&&!Ne.error&&Ne.fileId);if(!Ue&&Fe.length===0)return;if(y.push(Ue),Ue){const Ne=gre(Ue),he=Ne?F5(o.skills).some(we=>we.name===Ne.cmd||we.name===`/${Dp}${Ne.cmd.slice(1)}`):!1;if(Ne&&he){a.value="",f(),k.value=!1,g(),i("command",Ne.arg?`${Ne.cmd} ${Ne.arg}`:Ne.cmd);return}}const se={text:Ue,attachments:Fe.map(Ne=>ne(Ne))};H.value=null,Te(),a.value="",f(),k.value=!1,I.value=!1,g(),i("submit",se)}function ge(){if(!o.running||z.value.some(Ne=>Ne.uploading))return;const Ue=a.value.trim(),Fe=z.value.filter(Ne=>!Ne.uploading&&!Ne.error&&Ne.fileId);if(!Ue&&Fe.length===0&&o.queued.length===0)return;const se={text:Ue,attachments:Fe.map(Ne=>ne(Ne))};Te(),y.push(Ue),a.value="",f(),k.value=!1,I.value=!1,g(),i("steer",se)}let de=!1,ve=null;function j(){ve!==null&&(clearTimeout(ve),ve=null)}function te(){j(),de=!0}function pe(){j(),ve=setTimeout(()=>{ve=null,de=!1},0)}function Ce(Ue){return de||Ue.isComposing||Ue.keyCode===229}function $e(Ue){if(!Ce(Ue)){if(Ue.key==="Escape"){if(Ie.value){Ue.preventDefault(),gt();return}if(et.value){Ue.preventDefault(),Ut();return}}if(k.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),$.value=($.value+1)%A.value.length;return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),$.value=($.value-1+A.value.length)%A.value.length;return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=A.value[$.value];Fe&&x(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),k.value=!1;return}}if(I.value&&!S.value){if(Ue.key==="ArrowDown"){Ue.preventDefault(),F.value=(F.value+1)%Math.max(1,E.value.length);return}if(Ue.key==="ArrowUp"){Ue.preventDefault(),F.value=(F.value-1+Math.max(1,E.value.length))%Math.max(1,E.value.length);return}if(Ue.key==="Enter"||Ue.key==="Tab"){Ue.preventDefault();const Fe=E.value[F.value];Fe&&R(Fe);return}if(Ue.key==="Escape"){Ue.preventDefault(),I.value=!1;return}}if(Ue.key==="s"&&(Ue.ctrlKey||Ue.metaKey)&&!Ue.shiftKey&&!Ue.altKey){o.running&&(Ue.preventDefault(),ge());return}if(!h.value&&!k.value&&!I.value&&!Ue.shiftKey&&!Ue.altKey&&!Ue.metaKey&&!Ue.ctrlKey){const Fe=y.isBrowsing();if(Ue.key==="ArrowUp"&&y.hasHistory()&&(Fe||y.caretAtTextStart())){Ue.preventDefault(),y.recallOlder();return}if(Ue.key==="ArrowDown"&&Fe){Ue.preventDefault(),y.recallNewer();return}}if(Ue.key==="Enter"&&!Ue.shiftKey){if(h.value&&!(Ue.metaKey||Ue.ctrlKey))return;Ue.preventDefault(),ee()}}}const De=B(()=>r("composer.send")),me=B(()=>!!o.uploadImage),Ie=X(!1),et=X(!1),rt=X(null);function _t(){Ie.value=!Ie.value,Ie.value?(et.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function gt(){Ie.value=!1,et.value||document.removeEventListener("click",ht,!0)}function It(){et.value=!et.value,et.value?(Ie.value=!1,sn(),document.addEventListener("click",ht,!0)):document.removeEventListener("click",ht,!0)}function Ut(){et.value=!1,Ie.value||document.removeEventListener("click",ht,!0)}function ht(Ue){rt.value&&!rt.value.contains(Ue.target)&&(gt(),Ut())}bn(()=>{document.removeEventListener("click",ht,!0)});const un=B(()=>{const Ue=o.status?.ctxMax??0;return Ue<=0?0:Math.min(100,Math.max(0,Math.ceil((o.status?.ctxUsed??0)/Ue*100)))}),dn=B(()=>{const Ue=ir(o.status?.ctxUsed??0),Fe=ir(o.status?.ctxMax??0);return r("status.ctxTooltip",{used:Ue,max:Fe,pct:un.value})}),ns=B(()=>un.value>=80),Wt=B(()=>o.models?.find(Ue=>Ue.id===o.status?.modelId)),Hn=B(()=>Vm(Wt.value)),lo=B(()=>Km(Wt.value)),it=B(()=>Pp(Wt.value,o.thinking)),Gn=B(()=>lo.value.includes(it.value)?it.value:""),ao=B(()=>bre(it.value)),Yn=B(()=>Hn.value==="unsupported"||lo.value.length<=1),go=B(()=>{if(!ao.value)return"";const Ue=(Wt.value?.supportEfforts?.length??0)>0,Fe=it.value;return Ue&&Fe!=="on"?r("composer.thinkingSuffixEffort",{level:Fe}):r("composer.thinkingSuffix")});function os(Ue){Yn.value||i("setThinking",Uk(Wt.value,Ue))}function qn(Ue){return Ue==="on"?r("status.thinkingOn"):Ue==="off"?r("status.thinkingOff"):Gv(Ue)}const to=B(()=>o.planMode===!0),vn=B(()=>o.swarmMode===!0),Zn=B(()=>o.goal?.status??o.activationBadges?.goal?.status??null),xn=B(()=>Zn.value!==null&&Zn.value!=="complete"),An=B(()=>xn.value||o.goalMode===!0),Mn=B(()=>Zn.value==="active"),Do=B(()=>Zn.value==="paused"||Zn.value==="blocked"),ze=X(!1),Xe=X(null),kt=X(null),Ht=X({}),Rn=B(()=>to.value||vn.value||An.value);function sn(){ze.value=!1,document.removeEventListener("mousedown",Gt)}function Gt(Ue){const Fe=Ue.target;Xe.value?.contains(Fe)||kt.value?.contains(Fe)||sn()}function Wn(){if(ze.value){sn();return}gt(),Ut();const Ue=Xe.value?.getBoundingClientRect();Ue&&(Ht.value={left:`${Math.round(Ue.left)}px`,bottom:`${Math.round(window.innerHeight-Ue.top+8)}px`}),ze.value=!0,setTimeout(()=>document.addEventListener("mousedown",Gt),0)}const En=[{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"}],St=["status.planDesc","status.swarmDesc","status.goalDesc"],Po=X(null),Ao=X(""),ss=X("");function Tn(Ue){const Fe={};return Ue&&(Fe["--composer-menu-desc-width"]=Ue),Fe}const jn=B(()=>Tn(Ao.value)),Ps=B(()=>Tn(ss.value)),ti=B(()=>({...Ht.value,...Ps.value}));let Io=null;function Ss(Ue){const Fe=Number.parseFloat(Ue);return Number.isFinite(Fe)?Fe:0}function Wi(Ue){return`${Ue.fontStyle||"normal"} ${Ue.fontWeight||"400"} ${Ue.fontSize} ${Ue.fontFamily}`}function Si(Ue){return Ue.letterSpacing==="normal"?0:Ss(Ue.letterSpacing)}function co(Ue,Fe){if(!Ue)return 0;const se=Jie(Ue,Wi(Fe),{letterSpacing:Si(Fe)});return ere(se)}function ni(){const Ue=Po.value?.querySelector(".pd-desc");if(!Ue)return;const Fe=getComputedStyle(Ue),se=Math.max(0,...En.map(he=>co(r(he.descKey),Fe))),Ne=Math.max(0,...St.map(he=>co(r(he),Fe)));Ao.value=se>0?`${Math.ceil(se)}px`:"",ss.value=Ne>0?`${Math.ceil(Ne)}px`:""}function Ci(){typeof window>"u"||(Io!==null&&window.cancelAnimationFrame(Io),mt(()=>{Io=window.requestAnimationFrame(()=>{Io=null,ni()})}))}Qe(l,Ci,{immediate:!0}),cn(()=>{Ci(),document.fonts?.ready.then(Ci)}),bn(()=>{Io!==null&&(window.cancelAnimationFrame(Io),Io=null)});function ar(Ue){i("setPermission",Ue),Ut()}const no=B(()=>En.find(Ue=>Ue.mode===o.status?.permission)),is=B(()=>no.value?r(no.value.labelKey):""),rs=B(()=>Wt.value?.provider??""),Lo=B(()=>!rs.value||!o.models?.length?[]:o.models.filter(Ue=>Ue.provider===rs.value)),Ai=B(()=>new Set(o.starredIds??[]));function zn(Ue){return Ai.value.has(Ue)}const $o=B(()=>o.models?.length?o.models.filter(Ue=>zn(Ue.id)&&Ue.provider!==rs.value):[]);function oi(Ue){i("selectModel",Ue),gt()}return(Ue,Fe)=>(w(),T("div",{class:We(["composer",{"drag-over":C(Z),expanded:h.value}]),onDragover:Fe[18]||(Fe[18]=(...se)=>C(ce)&&C(ce)(...se)),onDragleave:Fe[19]||(Fe[19]=(...se)=>C(ue)&&C(ue)(...se)),onDrop:Fe[20]||(Fe[20]=(...se)=>C(Se)&&C(Se)(...se))},[C(z).length>0?(w(),T("div",Bre,[(w(!0),T(Pe,null,ot(C(z),se=>(w(),xe(_5,{key:se.localId,kind:se.kind,name:se.name,url:se.previewUrl,"file-id":se.fileId,"media-type":se.mediaType,size:se.size,uploading:se.uploading,error:se.error,removable:"","remove-label":C(r)("composer.removeNamed",{name:se.name}),onActivate:Ne=>q(se),onRemove:Ne=>C(K)(se.localId)},null,8,["kind","name","url","file-id","media-type","size","uploading","error","remove-label","onActivate","onRemove"]))),128))])):ae("",!0),C(H)?(w(),T("div",{key:1,class:"att-lightbox",onClick:Fe[1]||(Fe[1]=bt((...se)=>C(J)&&C(J)(...se),["self"]))},[_("div",Dre,[re(Xt,{text:C(r)("model.close")},{default:Ee(()=>[_("button",{type:"button",class:"att-lightbox-close",onClick:Fe[0]||(Fe[0]=(...se)=>C(J)&&C(J)(...se))},"✕")]),_:1},8,["text"]),C(H).kind==="video"?(w(),T("video",{key:0,class:"att-lightbox-media",src:C(H).previewUrl,controls:"",playsinline:""},null,8,Pre)):(w(),T("img",{key:1,class:"att-lightbox-media",src:C(H).previewUrl,alt:C(H).name},null,8,Hre)),_("div",Wre,O(C(H).name),1)])])):ae("",!0),_("div",zre,[_("div",Ure,[C(k)?(w(),xe(rre,{key:0,items:C(A),"active-index":C($),onSelect:C(x),onHover:Fe[2]||(Fe[2]=se=>$.value=se)},null,8,["items","active-index","onSelect"])):ae("",!0),C(I)?(w(),xe(mre,{key:1,items:C(E),"active-index":C(F),loading:C(S),onSelect:C(R),onHover:Fe[3]||(Fe[3]=se=>F.value=se)},null,8,["items","active-index","loading","onSelect"])):ae("",!0),_("div",qre,[Fn(_("textarea",{ref_key:"textareaRef",ref:c,"onUpdate:modelValue":Fe[4]||(Fe[4]=se=>ho(a)?a.value=se:null),class:"ph",placeholder:s.value,disabled:e.starting,rows:"1",onKeydown:$e,onCompositionstart:te,onCompositionend:pe,onInput:D},null,40,jre),[[_s,C(a)]]),h.value||v.value?(w(),T("button",{key:0,class:"expand-btn",type:"button","aria-label":h.value?C(r)("composer.collapseTitle"):C(r)("composer.expandTitle"),onClick:p},[h.value?(w(),xe(Ve,{key:0,name:"collapse",size:"sm"})):(w(),xe(Ve,{key:1,name:"expand",size:"sm"}))],8,Vre)):ae("",!0)])]),me.value?(w(),T("input",{key:0,ref_key:"fileInputRef",ref:U,type:"file",multiple:"",class:"file-input-hidden",onChange:Fe[5]||(Fe[5]=(...se)=>C(oe)&&C(oe)(...se))},null,544)):ae("",!0),_("div",{ref_key:"toolbarRef",ref:rt,class:"toolbar"},[_("div",{ref_key:"menuMeasureRef",ref:Po,class:"menu-measure","aria-hidden":"true"},[...Fe[21]||(Fe[21]=[_("span",{class:"pd-desc"},null,-1)])],512),_("div",Kre,[me.value?(w(),xe(Pn,{key:0,size:"md",label:C(r)("composer.attachFile"),onClick:C(fe)},{default:Ee(()=>[re(Ve,{name:"attachment"})]),_:1},8,["label","onClick"])):ae("",!0),e.status?(w(),T("span",{key:1,class:We(["perm-pill",["perm-"+e.status.permission,{open:et.value}]]),role:"button",tabindex:"0",onClick:bt(It,["stop"]),onKeydown:[nr(It,["enter"]),nr(bt(It,["prevent"]),["space"])]},O(is.value),43,Gre)):ae("",!0),et.value&&e.status?(w(),T("div",{key:2,class:"perm-dropdown",style:Yt(jn.value),role:"menu",onClick:Fe[6]||(Fe[6]=bt(()=>{},["stop"]))},[(w(),T(Pe,null,ot(En,se=>_("button",{key:se.mode,class:We(["pd-row",{"is-current":se.mode===e.status.permission}]),role:"menuitem",onClick:Ne=>ar(se.mode)},[_("span",Zre,[se.mode===e.status.permission?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Qre,[_("span",{class:"pd-name",style:Yt({color:se.color})},O(C(r)(se.labelKey)),5),_("span",Xre,O(C(r)(se.descKey)),1)])],10,Yre)),64))],4)):ae("",!0),e.status?(w(),T("div",{key:3,ref_key:"modesRef",ref:Xe,class:"modes"},[_("button",{type:"button",class:We(["mode-pill",{on:Rn.value,open:ze.value}]),onClick:bt(Wn,["stop"])},[_("span",Jre,O(C(r)("status.modesLabel")),1),to.value?(w(),T("span",ele,O(C(r)("status.planLabel")),1)):ae("",!0),vn.value?(w(),T("span",tle,O(C(r)("status.swarmLabel")),1)):ae("",!0),An.value?(w(),T("span",nle,O(C(r)("status.goalLabel")),1)):ae("",!0)],2),ze.value?(w(),T("div",{key:0,ref_key:"modesMenuRef",ref:kt,class:"modes-menu",style:Yt(ti.value),role:"menu"},[_("button",{type:"button",class:We(["mode-row",{on:to.value}]),role:"menuitem",onClick:Fe[7]||(Fe[7]=se=>i("togglePlan"))},[_("span",ole,[re(Ve,{name:"file-edit",size:"sm"})]),_("span",sle,[_("span",ile,O(C(r)("status.planLabel")),1),_("span",rle,O(C(r)("status.planDesc")),1)]),_("span",{class:We(["mode-switch",{on:to.value}])},[...Fe[22]||(Fe[22]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("button",{type:"button",class:We(["mode-row",{on:vn.value}]),role:"menuitem",onClick:Fe[8]||(Fe[8]=se=>i("toggleSwarm"))},[_("span",lle,[re(Ve,{name:"sparkles",size:"sm"})]),_("span",ale,[_("span",cle,O(C(r)("status.swarmLabel")),1),_("span",ule,O(C(r)("status.swarmDesc")),1)]),_("span",{class:We(["mode-switch",{on:vn.value}])},[...Fe[23]||(Fe[23]=[_("span",{class:"mode-knob"},null,-1)])],2)],2),_("div",{class:We(["mode-row mode-row-goal",{on:xn.value||o.goalMode}])},[_("button",{type:"button",class:"mode-row-main",role:"menuitem",onClick:Fe[9]||(Fe[9]=se=>xn.value?i("focusGoal"):i("toggleGoal"))},[_("span",dle,[re(Ve,{name:"target",size:"sm"})]),_("span",fle,[_("span",hle,O(C(r)("status.goalLabel")),1),_("span",ple,O(C(r)("status.goalDesc")),1)]),xn.value?ae("",!0):(w(),T("span",{key:0,class:We(["mode-switch",{on:o.goalMode}])},[...Fe[24]||(Fe[24]=[_("span",{class:"mode-knob"},null,-1)])],2))]),xn.value?(w(),T("div",mle,[Mn.value?(w(),xe(Bt,{key:0,size:"sm",variant:"secondary",class:"mode-row-action",onClick:Fe[10]||(Fe[10]=se=>i("controlGoal","pause"))},{default:Ee(()=>[re(Ve,{name:"pause",size:"sm"}),_("span",null,O(C(r)("status.goalPause")),1)]),_:1})):ae("",!0),Do.value?(w(),xe(Bt,{key:1,size:"sm",variant:"primary",class:"mode-row-action",onClick:Fe[11]||(Fe[11]=se=>i("controlGoal","resume"))},{default:Ee(()=>[re(Ve,{name:"play",size:"sm"}),_("span",null,O(C(r)("status.goalResume")),1)]),_:1})):ae("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"mode-row-action",onClick:Fe[12]||(Fe[12]=se=>i("controlGoal","cancel"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"}),_("span",null,O(C(r)("status.goalCancel")),1)]),_:1})])):ae("",!0)],2)],4)):ae("",!0)],512)):ae("",!0)]),_("div",gle,[ns.value?(w(),T("button",{key:0,class:"compact-chip",onClick:Fe[13]||(Fe[13]=bt(se=>i("compact"),["stop"]))},"/compact")):ae("",!0),re(Xt,{text:dn.value},{default:Ee(()=>[e.status&&!e.hideContext?(w(),T("span",{key:0,class:"ctx-group",role:"img",tabindex:"0","aria-label":dn.value},[re(Rre,{pct:un.value},null,8,["pct"])],8,vle)):ae("",!0)]),_:1},8,["text"]),e.status?(w(),T("span",{key:1,class:We(["model-pill",{open:Ie.value}]),role:"button",tabindex:"0",onClick:bt(_t,["stop"]),onKeydown:[nr(_t,["enter"]),nr(bt(_t,["prevent"]),["space"])]},[_("b",null,O(e.status.model),1),go.value?(w(),T("span",kle,O(go.value),1)):ae("",!0),re(Ve,{class:"cv",name:"chevron-down",size:"sm"})],42,yle)):ae("",!0),e.running?(w(),xe(Xt,{key:2,text:C(r)("composer.interruptTitle")},{default:Ee(()=>[_("button",{class:"stop","aria-label":C(r)("composer.interrupt"),onClick:Fe[14]||(Fe[14]=se=>i("interrupt"))},[re(Ve,{name:"stop",size:"sm"})],8,ble)]),_:1},8,["text"])):ae("",!0),_("button",{class:We(["send",{"is-starting":e.starting}]),"aria-label":De.value,disabled:e.starting,onClick:Fe[15]||(Fe[15]=se=>ee())},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):(w(),xe(Ve,{key:1,name:"send",size:"sm"}))],10,xle)]),Ie.value&&e.status?(w(),T("div",{key:0,class:"model-dropdown",role:"menu",onClick:Fe[17]||(Fe[17]=bt(()=>{},["stop"]))},[$o.value.length>0?(w(),T("div",wle,O(C(r)("status.starredModels")),1)):ae("",!0),(w(!0),T(Pe,null,ot($o.value,se=>(w(),T("button",{key:se.id,class:We(["md-row",{"is-current":se.id===e.status.modelId}]),role:"menuitem",onClick:Ne=>oi(se.id)},[_("span",Sle,[se.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Cle,O(se.displayName??se.model),1),_("span",Ale,O(se.provider),1),re(Ve,{class:"md-star",name:"star",size:"sm"})],10,_le))),128)),$o.value.length>0?(w(),T("div",Mle)):ae("",!0),Lo.value.length>0?(w(),T("div",Ele,O(rs.value),1)):ae("",!0),(w(!0),T(Pe,null,ot(Lo.value,se=>(w(),T("button",{key:se.id,class:We(["md-row",{"is-current":se.id===e.status.modelId}]),role:"menuitem",onClick:Ne=>oi(se.id)},[_("span",Nle,[se.id===e.status.modelId?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",Ile,O(se.displayName??se.model),1),zn(se.id)?(w(),xe(Ve,{key:0,class:"md-star",name:"star",size:"sm"})):ae("",!0)],10,Tle))),128)),Lo.value.length>0?(w(),T("div",Lle)):ae("",!0),_("div",{class:We(["md-thinking",{"is-readonly":Yn.value}])},[_("span",$le,O(C(r)("status.thinkingLabel")),1),Hn.value==="unsupported"?(w(),T("span",Fle,O(C(r)("status.modeNotSupported")),1)):(w(),T("div",{key:1,class:"effort-segments",role:"group","aria-label":C(r)("status.thinkingLabel")},[(w(!0),T(Pe,null,ot(lo.value,se=>(w(),T("button",{key:se,type:"button",class:We(["effort-seg",{"is-active":se===Gn.value}]),disabled:Yn.value,onClick:Ne=>os(se)},O(qn(se)),11,Rle))),128))],8,Ole))],2),Fe[25]||(Fe[25]=_("div",{class:"md-divider"},null,-1)),_("div",Ble,O(C(r)("status.cacheNote")),1),Fe[26]||(Fe[26]=_("div",{class:"md-divider"},null,-1)),_("button",{class:"md-row md-row-more",role:"menuitem",onClick:Fe[16]||(Fe[16]=se=>{gt(),i("pickModel")})},[_("span",Dle,O(C(r)("status.moreModels")),1)])])):ae("",!0)],512)]),_("div",{class:We(["drop-overlay",{show:C(Z)}]),"aria-hidden":"true"},[_("div",Ple,[re(Ve,{name:"file-plus",size:"lg"}),_("span",null,O(C(r)("composer.dropToAttach")),1)])],2)],34))}}),R5=ct(Hle,[["__scopeId","data-v-a89f6a49"]]),Wle={key:0,class:"ui-card__head"},zle={class:"ui-card__body"},Ule={key:1,class:"ui-card__foot"},qle=Ze({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(w(),T("div",Wle,[On(t.$slots,"head",{},void 0,!0)])):ae("",!0),_("div",zle,[On(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(w(),T("div",Ule,[On(t.$slots,"foot",{},void 0,!0)])):ae("",!0)],2))}}),qk=ct(qle,[["__scopeId","data-v-9c9f9a9a"]]),jle={class:"goal-kicker"},Vle={key:0,class:"goal-progress","aria-hidden":"true"},Kle={class:"goal-full"},Gle={key:0,class:"goal-criterion"},Yle=["inert","aria-hidden"],Zle={class:"goal-meta"},Qle={key:0},Xle={class:"goal-actions"},Jle=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),{confirm:i}=tf(),r=X(!1);Qe(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(r.value=!0)});const l=B(()=>{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)=>(w(),xe(qk,{class:We(["goal-strip",{expanded:r.value}])},{head:Ee(()=>[_("button",{class:"goal-row",type:"button",onClick:f[0]||(f[0]=h=>r.value=!r.value)},[re(Ve,{class:"goal-icon",name:"target",size:"md"}),_("span",jle,O(C(s)("status.goalLabel")),1),_("span",{class:We(["goal-objective",{"expanded-hidden":r.value}])},O(e.goal.objective),3),re(Ri,{variant:e.goal.status==="active"?"success":e.goal.status==="blocked"?"danger":e.goal.status==="paused"?"warning":"neutral",size:"sm",class:"goal-status"},{default:Ee(()=>[Je(O(a(e.goal.status)),1)]),_:1},8,["variant"]),e.goal.budget.tokenBudget!==null?(w(),T("span",Vle,[_("span",{class:"goal-progress-fill",style:Yt({width:`${l.value}%`})},null,4)])):ae("",!0),re(Ve,{class:We(["goal-chevron",{open:r.value}]),name:"chevron-right",size:"md"},null,8,["class"])])]),default:Ee(()=>[_("div",Kle,O(e.goal.objective),1),e.goal.completionCriterion?(w(),T("div",Gle,[f[3]||(f[3]=_("span",null,"Done when",-1)),_("p",null,O(e.goal.completionCriterion),1)])):ae("",!0)]),foot:Ee(()=>[_("div",{class:"goal-footer",inert:!r.value,"aria-hidden":!r.value},[_("div",Zle,[_("span",null,O(e.goal.turnsUsed)+" turns",1),_("span",null,O(C(ir)(e.goal.tokensUsed))+" tokens",1),_("span",null,O(c(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(w(),T("span",Qle,O(l.value)+"% token budget",1)):ae("",!0)]),_("div",Xle,[e.goal.status==="active"?(w(),xe(Bt,{key:0,size:"sm",variant:"secondary",class:"goal-action",onClick:f[1]||(f[1]=bt(h=>o("controlGoal","pause"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"pause",size:"md"}),_("span",null,O(C(s)("status.goalPause")),1)]),_:1})):ae("",!0),e.goal.status==="paused"||e.goal.status==="blocked"?(w(),xe(Bt,{key:1,size:"sm",variant:"primary",class:"goal-action",onClick:f[2]||(f[2]=bt(h=>o("controlGoal","resume"),["stop"]))},{default:Ee(()=>[re(Ve,{name:"play",size:"md"}),_("span",null,O(C(s)("status.goalResume")),1)]),_:1})):ae("",!0),re(Bt,{size:"sm",variant:"danger-soft",class:"goal-action",onClick:bt(u,["stop"])},{default:Ee(()=>[re(Ve,{name:"close",size:"md"}),_("span",null,O(C(s)("status.goalCancel")),1)]),_:1})])],8,Yle)]),_:1},8,["class"]))}}),eae=ct(Jle,[["__scopeId","data-v-44bef30f"]]),tae={class:"qh"},nae={class:"qtitle"},oae={key:0,class:"qstep"},sae={key:1,class:"qmin-peek"},iae={class:"qbody"},rae=["aria-label"],lae=["aria-selected","aria-label","onClick"],aae={class:"qstep-num"},cae={key:1,class:"qheader-chip"},uae={class:"qtext"},dae={class:"qopts"},fae=["onClick"],hae={class:"qopt-key"},pae={class:"qopt-glyph"},mae={key:0,class:"chk"},gae={key:1,class:"rad"},vae={class:"qopt-text"},yae={class:"qopt-label"},kae={key:0,class:"qopt-desc"},bae={class:"qopt-glyph"},xae={key:0,class:"chk"},wae={key:1,class:"rad"},_ae={class:"qopt-label"},Sae=["placeholder"],Cae={class:"qfoot"},Aae=Ze({__name:"QuestionCard",props:{question:{},busyKind:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:o}=Tt(),s=t,i=X(0),r=X(!1),l=B(()=>n.question.questions[i.value]),a=B(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}function d(z){z>=0&&z<a.value&&(i.value=z)}function f(z){const H=p.value[z];return H?H.kind==="multi"?H.optionIds.length>0:H.kind==="multiWithOther"?H.optionIds.length>0||H.otherText.trim().length>0:H.kind==="other"?H.text.trim().length>0:!0:!1}function h(){return f(l.value.id)}const p=X({});function g(z){return z.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${z.label} ${z.description??""}`.toLowerCase())}function b(){const z={...p.value};let H=!1;for(const U of n.question.questions){if(z[U.id])continue;const Z=U.options.filter(g);Z.length!==0&&(z[U.id]=U.multiSelect?{kind:"multi",optionIds:Z.map(K=>K.id)}:{kind:"single",optionId:Z[0].id},H=!0)}H&&(p.value=z)}Qe(()=>n.question.questionId,()=>{i.value=0,r.value=!1,p.value={},y.value={}}),Qe(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),b()},{immediate:!0,deep:!0});function v(z,H){const U=p.value[z];if(U&&U.kind==="single"&&U.optionId===H){const Z={...p.value};delete Z[z],p.value=Z}else p.value={...p.value,[z]:{kind:"single",optionId:H}}}function m(z,H){const U=p.value[z],Z=U&&(U.kind==="multi"||U.kind==="multiWithOther")?U.kind==="multi"?[...U.optionIds]:[...U.optionIds]:[],K=Z.indexOf(H);K>=0?Z.splice(K,1):Z.push(H);const V=p.value[z],J=V&&V.kind==="multiWithOther"?V.otherText:"";J?p.value={...p.value,[z]:{kind:"multiWithOther",optionIds:Z,otherText:J}}:p.value={...p.value,[z]:{kind:"multi",optionIds:Z}}}const y=X({}),k=X(null);function A(z){const H=n.question.questions.find(Z=>Z.id===z),U=y.value[z]??"";if(H.multiSelect){const Z=p.value[z],K=Z&&(Z.kind==="multi"||Z.kind==="multiWithOther")?Z.kind==="multi"?[...Z.optionIds]:[...Z.optionIds]:[];p.value={...p.value,[z]:{kind:"multiWithOther",optionIds:K,otherText:U}}}else p.value={...p.value,[z]:{kind:"other",text:U}}}function $(z){A(z),mt(()=>k.value?.focus())}function N(z,H){const U=p.value[z];return U?U.kind==="single"?U.optionId===H:U.kind==="multi"||U.kind==="multiWithOther"?U.optionIds.includes(H):!1:!1}function x(z){const H=p.value[z];return!!(H&&(H.kind==="other"||H.kind==="multiWithOther"))}function I(){return n.question.questions.every(z=>f(z.id))}const E=B(()=>n.busyKind==="answer"),F=B(()=>n.busyKind==="dismiss"),S=B(()=>!!n.busyKind);function L(){if(S.value||!I())return;const z={answers:p.value,method:"click"};s("answer",n.question.questionId,z)}function R(){S.value||s("dismiss",n.question.questionId)}function D(z){const H=(document.activeElement?.tagName??"").toLowerCase(),U=H==="input"||H==="textarea";if(S.value)return;if(z.key==="Enter"){if(z.preventDefault(),r.value)return;i.value<a.value-1&&h()?u():I()&&L();return}if(U)return;if(z.key==="Escape"){z.preventDefault(),R();return}if(r.value)return;const Z=parseInt(z.key,10);if(!isNaN(Z)&&Z>=1&&Z<=9){z.preventDefault();const K=l.value,V=Z-1,J=K.options[V];J&&(K.multiSelect?m(K.id,J.id):v(K.id,J.id))}}return cn(()=>document.addEventListener("keydown",D)),bn(()=>document.removeEventListener("keydown",D)),(z,H)=>(w(),xe(qk,{class:We(["qcard",{minimized:r.value}])},e3({head:Ee(()=>[_("div",tae,[H[5]||(H[5]=_("span",{class:"qh-ic"},"?",-1)),_("span",nae,O(C(o)("question.title")),1),a.value>1&&!r.value?(w(),T("span",oae,O(C(o)("question.step",{current:i.value+1,total:a.value})),1)):ae("",!0),r.value?(w(),T("span",sae,O(l.value.question),1)):ae("",!0),re(Pn,{class:"qmin",size:"sm",label:r.value?C(o)("question.expand"):C(o)("question.minimize"),onClick:H[0]||(H[0]=U=>r.value=!r.value)},{default:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[_("div",iae,[a.value>1?(w(),T("div",{key:0,class:"qsteps",role:"tablist","aria-label":C(o)("question.step",{current:i.value+1,total:a.value})},[(w(!0),T(Pe,null,ot(n.question.questions,(U,Z)=>(w(),T("button",{key:U.id,type:"button",class:We(["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:K=>d(Z)},[_("span",aae,O(Z+1),1)],10,lae))),128))],8,rae)):ae("",!0),l.value.header?(w(),T("div",cae,[re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(l.value.header),1)]),_:1})])):ae("",!0),_("div",uae,O(l.value.question),1),l.value.body?(w(),xe(Wm,{key:2,text:l.value.body,class:"qmdbody"},null,8,["text"])):ae("",!0),_("div",dae,[(w(!0),T(Pe,null,ot(l.value.options,(U,Z)=>(w(),T("label",{key:U.id,class:We(["qopt",{selected:N(l.value.id,U.id)}]),onClick:bt(K=>l.value.multiSelect?m(l.value.id,U.id):v(l.value.id,U.id),["prevent"])},[_("span",hae,O(Z+1),1),_("span",pae,[l.value.multiSelect?(w(),T("span",mae,O(N(l.value.id,U.id)?"■":"□"),1)):(w(),T("span",gae,O(N(l.value.id,U.id)?"●":"○"),1))]),_("span",vae,[_("span",yae,O(U.label),1),U.description?(w(),T("span",kae,O(U.description),1)):ae("",!0)])],10,fae))),128)),l.value.allowOther?(w(),T("label",{key:0,class:We(["qopt",{selected:x(l.value.id)}]),onClick:H[4]||(H[4]=bt(U=>$(l.value.id),["prevent"]))},[H[6]||(H[6]=_("span",{class:"qopt-key"},null,-1)),_("span",bae,[l.value.multiSelect?(w(),T("span",xae,O(x(l.value.id)?"■":"□"),1)):(w(),T("span",wae,O(x(l.value.id)?"●":"○"),1))]),_("span",_ae,O(l.value.otherLabel??C(o)("question.otherDefault")),1),Fn(_("input",{ref_key:"otherInputEl",ref:k,"onUpdate:modelValue":H[1]||(H[1]=U=>y.value[l.value.id]=U),class:"other-input",type:"text",placeholder:l.value.otherLabel??C(o)("question.otherDefault"),onInput:H[2]||(H[2]=U=>A(l.value.id)),onFocus:H[3]||(H[3]=U=>A(l.value.id))},null,40,Sae),[[_s,y.value[l.value.id]]])],2)):ae("",!0)])])]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[_("div",Cae,[i.value<a.value-1?(w(),xe(Bt,{key:0,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!h(),onClick:u},{default:Ee(()=>[Je(O(C(o)("question.nextQuestion")),1)]),_:1},8,["disabled"])):(w(),xe(Bt,{key:1,class:"qfoot-btn qfoot-main",size:"sm",variant:"primary",disabled:!I(),loading:E.value,onClick:L},{default:Ee(()=>[Je(O(C(o)("question.submit")),1)]),_:1},8,["disabled","loading"])),a.value>1?(w(),xe(Bt,{key:2,class:"qfoot-btn",size:"sm",variant:"secondary",disabled:i.value===0||S.value,onClick:c},{default:Ee(()=>[Je(O(C(o)("question.back")),1)]),_:1},8,["disabled"])):ae("",!0),re(Bt,{class:"qfoot-btn",size:"sm",variant:"ghost",loading:F.value,disabled:S.value,onClick:R},{default:Ee(()=>[Je(O(C(o)("question.dismiss")),1)]),_:1},8,["loading","disabled"])])]),key:"1"}]),1032,["class"]))}}),Mae=ct(Aae,[["__scopeId","data-v-14c58ac1"]]),Eae={class:"ah"},Tae={class:"akind"},Nae={class:"apath"},Iae={class:"ah-path"},Lae={key:1,class:"diff"},$ae={class:"dg"},Fae={class:"dc"},Oae={key:2,class:"body-shell"},Rae={class:"shell-cmd"},Bae={key:0,class:"shell-cwd"},Dae={key:1,class:"shell-danger"},Pae={key:3,class:"body-file"},Hae={class:"file-bar"},Wae={class:"file-lang"},zae={class:"file-content"},Uae={class:"file-ln"},qae={class:"file-text"},jae={key:4,class:"body-chip"},Vae={class:"chip-label"},Kae={class:"chip-value"},Gae={key:0,class:"chip-detail"},Yae={key:5,class:"body-chip"},Zae={key:0,class:"chip-label"},Qae={class:"chip-value"},Xae={key:6,class:"body-chip"},Jae={class:"chip-label"},ece={class:"chip-value"},tce={key:0,class:"chip-detail"},nce={key:7,class:"body-chip"},oce={class:"chip-label"},sce={class:"chip-value"},ice={key:0,class:"chip-detail"},rce={key:8,class:"body-todo"},lce={class:"todo-glyph"},ace={key:9,class:"body-plan"},cce={key:10,class:"body-generic"},uce={class:"gen-text"},dce={key:11,class:"feedback-wrap"},fce=["placeholder"],hce={class:"feedback-hint"},pce={key:0,class:"plan-actions"},mce={key:1,class:"abtn"},gce=Ze({__name:"ApprovalCard",props:{block:{},agentName:{},busy:{type:Boolean}},emits:["decide"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>{const E=n.block;return E.kind!=="plan_review"?null:{plan:E.plan,path:E.path,options:E.options??[]}}),r=X(!1),l=["shell","diff","file","fileop","url","search","invocation","todo","plan_review","generic"];function a(){const E=l.includes(n.block.kind)?n.block.kind:"generic";return s(`approval.title.${E}`)}const c=X(!1),u=X(""),d=X(null);function f(){n.busy||(c.value=!0,u.value="",setTimeout(()=>d.value?.focus(),0))}function h(){if(n.busy)return;const E=u.value.trim();i.value?v("feedback",{decision:"rejected",selectedLabel:"Revise",feedback:E||void 0}):v("feedback",{decision:"rejected",feedback:E||void 0}),c.value=!1,u.value=""}function p(){c.value=!1,u.value=""}function g(E){E.key==="Enter"&&!E.shiftKey?(E.preventDefault(),h()):E.key==="Escape"&&(E.preventDefault(),p())}const b=X(null);Qe(()=>n.busy,E=>{E||(b.value=null)});function v(E,F){n.busy||(b.value=E,o("decide",F))}function m(){v("approve",{decision:"approved"})}function y(){v("approveSession",{decision:"approved",scope:"session"})}function k(){v("reject",{decision:"rejected"})}function A(){v("approvePlan",{decision:"approved"})}function $(E){v(`option:${E}`,{decision:"approved",selectedLabel:E})}function N(){n.busy||f()}function x(){v("rejectAndExit",{decision:"rejected",selectedLabel:"Reject and Exit"})}function I(E){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){E.key==="1"?(E.preventDefault(),A()):E.key==="2"?(E.preventDefault(),N()):E.key==="3"&&(E.preventDefault(),x());return}E.key==="1"&&S.options[0]?(E.preventDefault(),$(S.options[0].label)):E.key==="2"&&S.options[1]?(E.preventDefault(),$(S.options[1].label)):E.key==="3"&&S.options[2]&&(E.preventDefault(),$(S.options[2].label));return}E.key==="1"?(E.preventDefault(),m()):E.key==="2"?(E.preventDefault(),y()):E.key==="3"?(E.preventDefault(),k()):E.key==="4"&&(E.preventDefault(),f())}return cn(()=>document.addEventListener("keydown",I)),bn(()=>document.removeEventListener("keydown",I)),(E,F)=>(w(),xe(qk,{class:We(["appr",{minimized:r.value}])},e3({head:Ee(()=>[_("div",Eae,[F[2]||(F[2]=_("span",{class:"ah-ic"},"!",-1)),_("span",Tae,O(a()),1),_("span",Nae,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(w(),T(Pe,{key:0},[Je(O(e.block.path),1)],64)):e.block.kind==="shell"?(w(),T(Pe,{key:1},[Je(O(e.block.command),1)],64)):e.block.kind==="url"?(w(),T(Pe,{key:2},[Je(O(e.block.url),1)],64)):e.block.kind==="search"?(w(),T(Pe,{key:3},[Je(O(e.block.query),1)],64)):e.block.kind==="invocation"?(w(),T(Pe,{key:4},[Je(O(e.block.name),1)],64)):e.block.kind==="generic"?(w(),T(Pe,{key:5},[Je(O(e.block.summary),1)],64)):ae("",!0)]),e.agentName&&!r.value?(w(),xe(Ri,{key:0,variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(C(s)("approval.subagentBadge",{name:e.agentName})),1)]),_:1})):ae("",!0),r.value?ae("",!0):(w(),xe(Ri,{key:1,variant:"warning",size:"sm",class:"aw"},{default:Ee(()=>[Je(O(C(s)("approval.required")),1)]),_:1})),re(Pn,{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:Ee(()=>[r.value?(w(),xe(Ve,{key:0,name:"chevron-up",size:"md"})):(w(),xe(Ve,{key:1,name:"minus",size:"md"}))]),_:1},8,["label"])])]),_:2},[r.value?void 0:{name:"default",fn:Ee(()=>[e.block.kind==="plan_review"&&e.block.path?(w(),xe(Xt,{key:0,text:e.block.path},{default:Ee(()=>[_("div",Iae,O(e.block.path),1)]),_:1},8,["text"])):ae("",!0),e.block.kind==="diff"?(w(),T("div",Lae,[(w(!0),T(Pe,null,ot(e.block.diff,(S,L)=>(w(),T("div",{key:L,class:We(["dl",S.kind==="add"?"add":S.kind==="rem"?"del":""])},[_("span",$ae,O(S.gutter),1),_("span",Fae,O(S.text),1)],2))),128))])):e.block.kind==="shell"?(w(),T("div",Oae,[_("div",Rae,[F[3]||(F[3]=_("span",{class:"shell-dollar"},"$",-1)),Je(" "+O(e.block.command),1)]),e.block.cwd?(w(),T("div",Bae,"cwd: "+O(e.block.cwd),1)):ae("",!0),e.block.danger?(w(),T("div",Dae,O(C(s)("approval.danger",{detail:e.block.danger})),1)):ae("",!0)])):e.block.kind==="file"?(w(),T("div",Pae,[_("div",Hae,[_("span",Wae,O(e.block.language??""),1)]),_("div",zae,[(w(!0),T(Pe,null,ot(e.block.content.split(`
297
- `),(S,L)=>(w(),T("div",{key:L,class:"file-line"},[_("span",Uae,O(L+1),1),_("span",qae,O(S),1)]))),128))])])):e.block.kind==="fileop"?(w(),T("div",jae,[_("span",Vae,O(e.block.op),1),_("span",Kae,O(e.block.path),1),e.block.detail?(w(),T("span",Gae,O(e.block.detail),1)):ae("",!0)])):e.block.kind==="url"?(w(),T("div",Yae,[e.block.method?(w(),T("span",Zae,O(e.block.method),1)):ae("",!0),_("span",Qae,O(e.block.url),1)])):e.block.kind==="search"?(w(),T("div",Xae,[_("span",Jae,O(C(s)("approval.searchQueryLabel")),1),_("span",ece,O(e.block.query),1),e.block.scope?(w(),T("span",tce,O(C(s)("approval.searchScope",{scope:e.block.scope})),1)):ae("",!0)])):e.block.kind==="invocation"?(w(),T("div",nce,[_("span",oce,O(e.block.kind2),1),_("span",sce,O(e.block.name),1),e.block.description?(w(),T("span",ice,O(e.block.description),1)):ae("",!0)])):e.block.kind==="todo"?(w(),T("div",rce,[(w(!0),T(Pe,null,ot(e.block.items,(S,L)=>(w(),T("div",{key:L,class:"todo-item"},[_("span",lce,O(S.status==="done"||S.status==="completed"?"✓":"○"),1),_("span",{class:We(["todo-title",{"todo-done":S.status==="done"||S.status==="completed"}])},O(S.title),3)]))),128))])):e.block.kind==="plan_review"?(w(),T("div",ace,[re(Wm,{text:e.block.plan},null,8,["text"])])):(w(),T("div",cce,[_("span",uce,O(e.block.summary),1)])),c.value?(w(),T("div",dce,[Fn(_("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:g},null,40,fce),[[_s,u.value]]),_("div",hce,O(C(s)("approval.feedbackHint")),1)])):ae("",!0)]),key:"0"},r.value?void 0:{name:"foot",fn:Ee(()=>[i.value?(w(),T("div",pce,[i.value.options.length>0?(w(!0),T(Pe,{key:0},ot(i.value.options,(S,L)=>(w(),xe(Xt,{key:L,text:S.description},{default:Ee(()=>[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value===`option:${S.label}`,disabled:e.busy,onClick:R=>$(S.label)},{default:Ee(()=>[Je(O(S.label),1),re(kr,{class:"k",keys:[String(L+1)]},null,8,["keys"])]),_:2},1032,["loading","disabled","onClick"])]),_:2},1032,["text"]))),128)):(w(),xe(Bt,{key:1,class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approvePlan",disabled:e.busy,onClick:A},{default:Ee(()=>[Je(O(C(s)("approval.approvePlan")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"])),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:N},{default:Ee(()=>[Je(O(C(s)("approval.revise")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["2"]})):ae("",!0)]),_:1},8,["disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"danger-soft",loading:b.value==="rejectAndExit",disabled:e.busy,onClick:x},{default:Ee(()=>[Je(O(C(s)("approval.rejectAndExit")),1),i.value.options.length===0?(w(),xe(kr,{key:0,class:"k",keys:["3"]})):ae("",!0)]),_:1},8,["loading","disabled"])])):(w(),T("div",mce,[re(Bt,{class:"kbtn",size:"sm",variant:"primary",loading:b.value==="approve",disabled:e.busy,onClick:m},{default:Ee(()=>[Je(O(C(s)("approval.approve")),1),re(kr,{class:"k",keys:["1"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="approveSession",disabled:e.busy,onClick:y},{default:Ee(()=>[Je(O(C(s)("approval.approveSession")),1),re(kr,{class:"k",keys:["2"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",loading:b.value==="reject",disabled:e.busy,onClick:k},{default:Ee(()=>[Je(O(C(s)("approval.reject")),1),re(kr,{class:"k",keys:["3"]})]),_:1},8,["loading","disabled"]),re(Bt,{class:"kbtn",size:"sm",variant:"secondary",disabled:e.busy,onClick:f},{default:Ee(()=>[Je(O(C(s)("approval.feedback")),1),re(kr,{class:"k",keys:["4"]})]),_:1},8,["disabled"])]))]),key:"1"}]),1032,["class"]))}}),vce=ct(gce,[["__scopeId","data-v-458a9d7d"]]),yce=Ze({__name:"StatusGlyph",props:{status:{}},setup(e){const t=e,n={pending:"○",run:"●",done:"✓",fail:"✗"};return(o,s)=>(w(),T("span",{class:We(["status-glyph",`s-${t.status}`]),"aria-hidden":"true"},O(n[t.status]),3))}}),B5=ct(yce,[["__scopeId","data-v-f595d935"]]),kce={class:"taskspane"},bce={class:"tp-head"},xce={class:"tp-title"},wce={class:"tp-count"},_ce={class:"tp-list"},Sce={key:0,class:"tp-empty"},Cce=["role","onClick"],Ace={class:"tp-name"},Mce={class:"tp-time"},Ece=["onClick"],Tce={key:0,class:"tp-detail"},Nce={key:0,class:"tp-codebox"},Ice=["onClick"],Lce={class:"tp-pre"},$ce={class:"tp-cmd"},Fce={key:1,class:"tp-codebox"},Oce=["onClick"],Rce={class:"tp-pre"},Bce=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel","open"],setup(e,{emit:t}){const n=t,{t:o}=Tt(),s=Bo(new Set),i=Bo(new Set),r=Bo(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,g,b){await Go(p)&&(b.add(g),setTimeout(()=>b.delete(g),1500))}async function f(p){p.meta&&await d(p.meta,p.id,i)}async function h(p){const g=p.output?.join(`
298
- `)??"";g&&await d(g,p.id,r)}return(p,g)=>(w(),T("div",kce,[_("div",bce,[_("span",xce,O(C(o)("tasks.tag")),1),_("span",wce,O(e.tasks.length),1)]),_("div",_ce,[e.tasks.length===0?(w(),T("div",Sce,O(C(o)("tasks.emptyTasks")),1)):(w(!0),T(Pe,{key:1},ot(e.tasks,b=>(w(),T("div",{key:b.id,class:We(["tp-row",{done:b.state==="done",fail:b.state==="fail",expandable:c(b)}])},[_("div",{class:"tp-main",role:c(b)?"button":void 0,onClick:v=>a(b)},[re(B5,{status:u(b.state)},null,8,["status"]),_("span",Ace,O(b.name),1),re(Ri,{variant:"neutral",size:"sm"},{default:Ee(()=>[Je(O(b.kind),1)]),_:2},1024),_("span",Mce,O(b.timing),1),b.state==="run"?(w(),T("button",{key:0,class:"tp-stop",onClick:bt(v=>n("cancel",b.id),["stop"])},O(C(o)("tasks.stop")),9,Ece)):ae("",!0),b.kind==="subagent"?(w(),xe(Ve,{key:1,class:"tp-chevron",name:"chevron-right",size:"sm"})):l(b)?(w(),xe(Ve,{key:2,class:We(["tp-chevron",{open:s.has(b.id)}]),name:"chevron-right",size:"sm"},null,8,["class"])):ae("",!0)],8,Cce),s.has(b.id)&&l(b)?(w(),T("div",Tce,[b.meta?(w(),T("div",Nce,[_("button",{class:We(["tp-copy",{copied:i.has(b.id)}]),onClick:bt(v=>f(b),["stop"])},O(i.has(b.id)?"已复制":"复制"),11,Ice),_("pre",Lce,[_("code",null,[_("span",$ce,O(b.meta),1)])])])):ae("",!0),b.output&&b.output.length>0?(w(),T("div",Fce,[_("button",{class:We(["tp-copy",{copied:r.has(b.id)}]),onClick:bt(v=>h(b),["stop"])},O(r.has(b.id)?"已复制":"复制"),11,Oce),_("pre",Rce,[_("code",null,[g[0]||(g[0]=Je(`
299
- `,-1)),(w(!0),T(Pe,null,ot(b.output,(v,m)=>(w(),T("span",{key:m,class:"tp-line"},O(v),1))),128)),g[1]||(g[1]=Je(`
300
- `,-1))])])])):ae("",!0)])):ae("",!0)],2))),128))])]))}}),qC=ct(Bce,[["__scopeId","data-v-28fd5fc0"]]),Dce={class:"todo-card"},Pce={key:0,class:"tc-empty"},Hce={class:"tc-name"},Wce=Ze({__name:"TodoCard",props:{todos:{}},setup(e){const t=e,{t:n}=Tt();function o(s){return s==="in_progress"?"run":s}return(s,i)=>(w(),T("div",Dce,[t.todos.length===0?(w(),T("div",Pce,[i[0]||(i[0]=_("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"},[_("path",{d:"M9 11l2 2 4-4"}),_("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})],-1)),_("span",null,O(C(n)("tasks.emptyTodo")),1)])):ae("",!0),(w(!0),T(Pe,null,ot(t.todos,(r,l)=>(w(),T("div",{key:l,class:We(["tc-row",`s-${r.status}`])},[re(B5,{status:o(r.status)},null,8,["status"]),_("span",Hce,O(r.title),1)],2))),128))]))}}),zce=ct(Wce,[["__scopeId","data-v-01c65735"]]),Uce={class:"dock-work-head"},qce={key:0,class:"dock-work-tab static"},jce={key:1,class:"dock-work-tab static"},Vce={key:2,class:"dock-work-tab static"},Kce={class:"dock-work-body"},Gce={class:"dw-count"},Yce={class:"dw-count"},Zce={class:"dw-count"},Qce=Ze({__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}=Tt(),r=X(null),l=X(null),a=X(null),c=X(null);function u(b){return r.value?(r.value.loadForEdit(b),!0):!1}function d(b){r.value?.loadAttachmentsForEdit(b)}function f(){r.value?.focus()}function h(b){if(!o.dockPanel)return;const v=b.target;v&&(l.value?.contains(v)||a.value?.contains(v)||s("close-dock-panel"))}Qe(()=>o.dockPanel,b=>{typeof document>"u"||(document.removeEventListener("mousedown",h,!0),b&&document.addEventListener("mousedown",h,!0))},{immediate:!0});let p=null;function g(){const b=c.value?.offsetHeight??0;document.documentElement.style.setProperty("--dock-h",`${b}px`)}return cn(()=>{typeof ResizeObserver!="function"||!c.value||(p=new ResizeObserver(g),p.observe(c.value),g())}),bn(()=>{typeof document<"u"&&document.removeEventListener("mousedown",h,!0),p?.disconnect(),p=null}),t({loadForEdit:u,loadAttachmentsForEdit:d,focus:f}),(b,v)=>(w(),T("div",{ref_key:"dockRef",ref:c,class:We(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:v[28]||(v[28]=bt(()=>{},["stop"]))},[re(Il,{name:"dock-panel"},{default:Ee(()=>[e.dockPanel?(w(),T("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:v[3]||(v[3]=bt(()=>{},["stop"]))},[_("div",Uce,[e.dockPanel==="bash"?(w(),T("span",qce,O(C(i)("tasks.dockBash"))+" · "+O(e.bashRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="subagent"?(w(),T("span",jce,O(C(i)("tasks.dockSubagent"))+" · "+O(e.subagentRunning)+" "+O(C(i)("tasks.running")),1)):e.dockPanel==="todos"?(w(),T("span",Vce,O(C(i)("tasks.dockTodos"))+" · "+O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1)):ae("",!0)]),_("div",Kce,[e.dockPanel==="bash"?(w(),xe(qC,{key:0,tasks:e.bashTasks,onCancel:v[0]||(v[0]=m=>s("cancelTask",m))},null,8,["tasks"])):e.dockPanel==="subagent"?(w(),xe(qC,{key:1,tasks:e.subagentTasks,onCancel:v[1]||(v[1]=m=>s("cancelTask",m)),onOpen:v[2]||(v[2]=m=>s("openAgent",m))},null,8,["tasks"])):e.dockPanel==="todos"?(w(),xe(zce,{key:2,todos:e.todos??[]},null,8,["todos"])):ae("",!0)])],512)):ae("",!0)]),_:1}),e.goal?(w(),xe(eae,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:v[4]||(v[4]=m=>s("controlGoal",m))},null,8,["goal","force-expanded"])):ae("",!0),e.hasDockWork?(w(),T("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(w(),xe(kh,{key:0,active:e.dockPanel==="bash","aria-pressed":e.dockPanel==="bash",onClick:v[5]||(v[5]=m=>s("toggle-dock-panel","bash"))},{default:Ee(()=>[re(Ve,{name:"clock",size:"md"}),_("span",null,O(C(i)("tasks.dockBash")),1),_("span",Gce,[v[29]||(v[29]=Je("(",-1)),_("b",null,O(e.bashTasks.length),1),v[30]||(v[30]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0),e.subagentTasks.length>0?(w(),xe(kh,{key:1,active:e.dockPanel==="subagent","aria-pressed":e.dockPanel==="subagent",onClick:v[6]||(v[6]=m=>s("toggle-dock-panel","subagent"))},{default:Ee(()=>[re(Ve,{name:"sparkles",size:"md"}),_("span",null,O(C(i)("tasks.dockSubagent")),1),_("span",Yce,[v[31]||(v[31]=Je("(",-1)),_("b",null,O(e.subagentTasks.length),1),v[32]||(v[32]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0),(e.todos?.length??0)>0?(w(),xe(kh,{key:2,active:e.dockPanel==="todos","aria-pressed":e.dockPanel==="todos",onClick:v[7]||(v[7]=m=>s("toggle-dock-panel","todos"))},{default:Ee(()=>[re(Ve,{name:"check-list",size:"md"}),_("span",null,O(C(i)("tasks.dockTodos")),1),_("span",Zce,[v[33]||(v[33]=Je("(",-1)),_("b",null,O(e.todoDoneCount)+"/"+O(e.todos?.length??0),1),v[34]||(v[34]=Je(")",-1))])]),_:1},8,["active","aria-pressed"])):ae("",!0)],512)):ae("",!0),e.pendingQuestion?(w(),xe(Mae,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,"busy-kind":e.questionBusyKind,onAnswer:v[8]||(v[8]=(m,y)=>s("answer",m,y)),onDismiss:v[9]||(v[9]=m=>s("dismiss",m))},null,8,["question","busy-kind"])):e.pendingApproval?(w(),xe(vce,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,busy:e.approvalBusy,onDecide:v[10]||(v[10]=m=>s("approval",e.pendingApproval.approvalId,m))},null,8,["block","agent-name","busy"])):(w(),xe(R5,{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:v[11]||(v[11]=m=>s("submit",m)),onSteer:v[12]||(v[12]=m=>s("steer",m)),onCommand:v[13]||(v[13]=m=>s("command",m)),onInterrupt:v[14]||(v[14]=m=>s("interrupt")),onSetPermission:v[15]||(v[15]=m=>s("setPermission",m)),onSetThinking:v[16]||(v[16]=m=>s("setThinking",m)),onTogglePlan:v[17]||(v[17]=m=>s("togglePlan")),onToggleSwarm:v[18]||(v[18]=m=>s("toggleSwarm")),onToggleGoal:v[19]||(v[19]=m=>s("toggleGoal")),onOpenBtw:v[20]||(v[20]=m=>s("openBtw")),onCreateGoal:v[21]||(v[21]=m=>s("createGoal",m)),onControlGoal:v[22]||(v[22]=m=>s("controlGoal",m)),onFocusGoal:v[23]||(v[23]=m=>s("focusGoal")),onFocusSwarm:v[24]||(v[24]=m=>s("focusSwarm")),onCompact:v[25]||(v[25]=m=>s("compact")),onPickModel:v[26]||(v[26]=m=>s("pickModel")),onSelectModel:v[27]||(v[27]=m=>s("selectModel",m))},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))}}),Xce=ct(Qce,[["__scopeId","data-v-9e5ec0f2"]]),Jce=["aria-label","aria-hidden"],eue={class:"toc-scroll"},tue=["onClick"],nue={class:"toc-label"},oue=240,sue=Ze({__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}=Tt(),i=X(null),r=X(!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>=oue}const c=B(()=>!n.mobile&&!n.sessionLoading&&n.items.length>1);return Qe(c,u=>{l?.disconnect(),l=null,u&&mt(()=>{const d=i.value,f=d?.offsetParent;!d||!f||(typeof ResizeObserver<"u"&&(l=new ResizeObserver(a),l.observe(f)),a())})},{immediate:!0}),po(()=>{l?.disconnect(),l=null}),(u,d)=>c.value?(w(),T("nav",{key:0,ref_key:"navRef",ref:i,class:We(["conversation-toc",{"toc-clipped":!r.value||e.occluded}]),"aria-label":C(s)("conversation.toc"),"aria-hidden":r.value&&!e.occluded?void 0:!0},[_("div",eue,[(w(!0),T(Pe,null,ot(e.items,f=>(w(),T("button",{key:f.id,type:"button",class:We(["toc-row",{active:e.activeTurnId===f.id}]),onClick:h=>o("select",f.id)},[d[0]||(d[0]=_("span",{class:"toc-bar"},null,-1)),_("span",nue,O(f.title),1)],10,tue))),128))])],10,Jce)):ae("",!0)}}),iue=ct(sue,[["__scopeId","data-v-3f1c1f66"]]),rue=5;function lue(e,t,n,o=rue){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 aue={class:"chat-layout"},cue={class:"empty-hint"},uue={key:0,class:"empty-hint-text"},due={key:1,class:"ws-pick"},fue={class:"ws-pick-name"},hue={key:1,class:"ws-pick-menu"},pue=["onClick"],mue={class:"ws-pick-item-name"},gue={class:"ws-pick-item-path"},vue=["aria-label"],yue={key:0,class:"abort-toast",role:"status","aria-live":"polite"},kue={class:"abort-toast-text"},vg=80,jC=1e3,bue=420,xue=3e3,wue=Ze({__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}=Tt(),s=e,i=n,r=X(!1),l=X(!1),a=B(()=>s.workspaces?.find(we=>we.id===s.activeWorkspaceId)?.name??s.workspaceName??""),c=B(()=>(s.workspaces?.length??0)>0),u=B(()=>lue(s.workspaces??[],s.activeWorkspaceId,l.value)),d=B(()=>(s.workspaces?.length??0)-u.value.length);Qe(r,he=>{he||(l.value=!1)});function f(he){r.value=!1,he!==s.activeWorkspaceId&&i("selectWorkspace",he)}Na(Ft.contentAlign);const h=X(null),p=X(null),g=X(null),b=X(!1),v=X(0);let m=null;function y(he,we){const He=g.value??p.value;return!He||He.loadForEdit(he)===!1?!1:(He.loadAttachmentsForEdit(we??[]),!0)}function k(){b.value=!0,m!==null&&clearTimeout(m),m=setTimeout(()=>{m=null,b.value=!1},2e3)}function A(){v.value++}const $=B(()=>s.tasks.filter(he=>he.kind!=="subagent")),N=B(()=>s.tasks.filter(he=>he.kind==="subagent"&&he.runInBackground)),x=B(()=>$.value.filter(he=>he.state==="run").length),I=B(()=>N.value.filter(he=>he.state==="run").length);function E(he){const we=s.tasks,He=we.find(Dt=>Dt.id===he)??we.find(Dt=>Dt.parentToolCallId===he);if(He)return He.id;const Rt=we.filter(Dt=>Dt.kind==="subagent"&&!Dt.parentToolCallId);if(Rt.length===1)return Rt[0].id}Ln("resolveAgentTaskId",E),Ln("pinScroll",to);const F=B(()=>(s.todos??[]).filter(he=>he.status==="done").length),S=B(()=>$.value.length>0||N.value.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),L=X(null),R=B(()=>s.gitInfo?s.changes?.length??0:0);function D(he){L.value=L.value===he?null:he}function z(){L.value=null}Qe(S,he=>{he||z()});function H(he){if(he.role==="compaction")return o("conversation.compactedPlain");if(he.role==="user"){if(he.skillActivation)return`/${he.skillActivation.name}`;if(he.pluginCommand)return`/${he.pluginCommand.pluginId}:${he.pluginCommand.commandName}`;const He=he.text.trim().replaceAll(/\s+/g," ");return He.length>0?He:"user"}const we=(he.text||he.thinking||"").trim().replaceAll(/\s+/g," ");return we.length>0?we:(he.tools?.length??0)>0?`${he.tools.length} tools`:"kimi"}const U=B(()=>s.turns.filter(he=>he.role==="user").map((he,we)=>({id:he.id,role:he.role,no:we+1,title:H(he)}))),Z=X(null);function K(){const he=Ae.value;if(!he)return;const we=he.querySelectorAll(".turn-anchor[data-turn-id]");if(we.length===0)return;const He=U.value;if(He.length===0)return;const Rt=new Set(He.map(Cs=>Cs.id));if(pe()<=vg){Z.value=He[He.length-1].id;return}const Dt=he.getBoundingClientRect(),rn=Dt.height/2;let Un=null;we.forEach(Cs=>{const Q=Cs.dataset.turnId;if(!Q||!Rt.has(Q))return;Cs.getBoundingClientRect().top-Dt.top<=rn&&(Un=Q)}),Z.value=Un??He[0].id}const V=X(!1);let J=0;function fe(){J||(J=it(()=>{J=0,oe()}))}function oe(){const he=Ae.value,we=!s.mobile&&s.conversationToc&&he?he.closest(".con")?.querySelector(".conversation-toc"):null,He=we?.querySelector(".toc-bar");let Rt=!1;if(he&&we&&He){const Dt=He.getBoundingClientRect(),rn=we.getBoundingClientRect(),Un=Dt.left+Dt.width/2;Rt=Array.from(he.querySelectorAll(".table-node-wrapper")).some(Cs=>{const Q=Cs.getBoundingClientRect();return Q.left<=Un&&Un<=Q.right&&Q.top<rn.bottom&&Q.bottom>rn.top})}V.value!==Rt&&(V.value=Rt)}const ce=B(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),ue=B(()=>{const he=ce.value;if(he)return s.pendingQuestionActions?.[he.questionId]}),Se=B(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),Te=B(()=>{const he=Se.value;return he?!!s.pendingApprovalActions?.[he.approvalId]:!1}),Ae=X(null),P=X(null),le=X(0),ne=X(0),q=B(()=>({"--panes-scrollbar-width":`${le.value}px`}));function ee(he){return he instanceof HTMLElement?he:he&&"$el"in he&&he.$el instanceof HTMLElement?he.$el:null}function ge(){const he=Ae.value;le.value=he?Math.max(0,he.offsetWidth-he.clientWidth):0,ne.value=P.value?.offsetHeight??0}function de(he){const we=ee(he);Ae.value=we,we&&rs()}function ve(he){const we=ee(he);P.value=we??null,he&&"loadForEdit"in he&&typeof he.loadForEdit=="function"&&"focus"in he&&typeof he.focus=="function"?g.value={loadForEdit:he.loadForEdit.bind(he),loadAttachmentsForEdit:"loadAttachmentsForEdit"in he&&typeof he.loadAttachmentsForEdit=="function"?he.loadAttachmentsForEdit.bind(he):()=>{},focus:he.focus.bind(he)}:g.value=null,is()}const j=X(!0),te=X(!1);function pe(){const he=Ae.value;return he?he.scrollHeight-he.scrollTop-he.clientHeight:0}let Ce=0,$e=0,De=0,me=0,Ie=0,et=0;function rt(){return Date.now()<$e}function _t(){fe();const he=Ae.value;if(!he)return;const we=he.scrollTop;if(qn()){Ce=we;return}if(performance.now()-De<100){Ce=we;return}const He=pe();if(rt()){j.value=!0,te.value=!1,Ce=we;return}we<Ce-1&&He>1?(j.value=!1,te.value=!0):He<=vg&&we>Ce+1&&(j.value=!0,te.value=!1),Ce=we,K()}function gt(he=!1){const we=Ae.value;j.value=!0,te.value=!1,we&&(!he&&performance.now()<me||(he&&typeof we.scrollTo=="function"?(De=performance.now(),me=performance.now()+bue,we.scrollTo({top:we.scrollHeight,behavior:"smooth"})):we.scrollTop=we.scrollHeight,Ce=we.scrollTop))}function It(he,we){return(we.closest("[inert]")?.closest(".tool-group")??we).getBoundingClientRect().top-he.getBoundingClientRect().top+he.scrollTop}function Ut(he,we){const He=Array.from(he.querySelectorAll(".turn-anchor[data-turn-id], [data-scroll-anchor-id]")).map(rn=>({node:rn,top:It(he,rn)})),Rt=He.findIndex(rn=>rn.top>=we),Dt=Rt<0?Math.max(0,He.length-1):Rt;return He.slice(Dt,Dt+2).flatMap(rn=>{const Un=rn.node.dataset.scrollAnchorId,Cs=Un??rn.node.dataset.turnId;return Cs?[{kind:Un?"tool":"turn",id:Cs,top:rn.top}]:[]})}const ht=new Map;function un(he,we){for(const He of we.anchors){const Rt=He.kind==="tool"?"data-scroll-anchor-id":"data-turn-id",Dt=he.querySelector(`[${Rt}="${Wt(He.id)}"]`);if(Dt)return It(he,Dt)-He.top}return he.scrollHeight-we.oldHeight}function dn(he,we,He=he.scrollTop){return he.scrollTop=He+un(he,we),Ce=he.scrollTop,he.scrollTop}async function ns(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||Tn.value||!s.hasMoreMessages)return;const he=s.sessionId,we=Ae.value,He=we?.scrollTop??0,Rt={anchors:we?Ut(we,He):[],oldHeight:we?.scrollHeight??0};jn(he,!0),ti();try{if(await mt(),await s.loadOlderMessages(he),await mt(),s.sessionId!==he){ht.set(he,Rt);return}const Dt=Ae.value;if(!Dt)return;dn(Dt,Rt),ht.delete(he)}finally{jn(he,!1)}}function Wt(he){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(he):he.replaceAll(/["\\]/g,"\\$&")}function Hn(he){const we=Ae.value;if(!we)return;const He=we.querySelector(`.turn-anchor[data-turn-id="${Wt(he)}"]`);He&&(Io(),j.value=!1,te.value=pe()>vg,He.scrollIntoView({behavior:"smooth",block:"center"}))}function lo(){const he=Ae.value;if(!he)return"none";const we=he.firstElementChild,He=we instanceof HTMLElement?we.offsetHeight:0,Rt=P.value?.offsetHeight??0;return`${he.scrollHeight}:${he.clientHeight}:${He}:${Rt}`}function it(he){return typeof requestAnimationFrame=="function"?requestAnimationFrame(he):setTimeout(he,16)}function Gn(he){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(he):clearTimeout(he)}let ao=0,Yn=0,go=null,os=0;function qn(){return performance.now()<ao}function to(he,we=260){const He=Ae.value;if(!He||(go=he,os=he.getBoundingClientRect().top,ao=performance.now()+we,Yn))return;const Rt=()=>{if(Yn=0,performance.now()>=ao||!go){go=null;return}const Dt=go.getBoundingClientRect().top-os;Dt&&(He.scrollTop+=Dt),Yn=it(Rt)};Yn=it(Rt)}function vn(he=36){if(!j.value&&!rt())return;const we=++et;let He="",Rt=0,Dt=0;Ie&&(Gn(Ie),Ie=0);const rn=()=>{if(Ie=0,we!==et||!j.value&&!rt())return;gt(!1);const Un=lo();Rt=Un===He?Rt+1:0,He=Un,Dt++,Rt<3&&Dt<he&&(Ie=it(rn))};Ie=it(rn)}function Zn(he,we){return he!==void 0&&he.length>0&&we.length>=he.length&&he.firstId!==we.firstId&&he.lastId===we.lastId&&he.lastTextLen===we.lastTextLen&&he.lastThinkingLen===we.lastThinkingLen&&he.lastToolsLen===we.lastToolsLen&&he.approvalIds===we.approvalIds}const xn=B(()=>{const he=(s.approvals??[]).map(rn=>rn.approvalId).join(","),we=s.turns,He=we.at(-1),Rt=He?.thinking?.length??0,Dt=He?.tools?.reduce((rn,Un)=>rn+Un.name.length+(Un.arg?.length??0)+(Un.output?.join("").length??0),0)??0;return{length:we.length,firstId:we[0]?.id??"",lastId:He?.id??"",lastTextLen:He?.text.length??0,lastThinkingLen:Rt,lastToolsLen:Dt,approvalIds:he}});Qe(xn,async(he,we)=>{if(Tn.value&&Zn(we,he)){K();return}await mt(),j.value||rt()?gt(he.length<we.length):te.value=!0,K()}),Qe(P,()=>{is()}),Qe(()=>s.mobile,async()=>{await mt(),ge()});const An=new Map;Qe(()=>s.fileReloadKey,async(he,we)=>{const He=Ae.value;we&&He&&An.set(String(we),{top:He.scrollTop,following:j.value}),Io(),await mt();const Rt=Ae.value,Dt=he?An.get(String(he)):void 0;if(Dt&&Rt){const rn=ht.get(String(he)),Un=rn?dn(Rt,rn,Dt.top):Dt.top;rn&&ht.delete(String(he)),j.value=Dt.following,Rt.scrollTop=Un,Ce=Rt.scrollTop,te.value=!Dt.following&&pe()>1,Dt.following&&vn()}else j.value=!0,Ce=0,gt(!1),vn();K()}),Qe(()=>s.sessionLoading,async(he,we)=>{he||!we||(j.value=!0,await mt(),vn(),K())}),Qe(()=>s.turnActive,async(he,we)=>{he||!we||!j.value&&!rt()||(await mt(),vn(48),K())});function Mn(){j.value=!0,te.value=!1,$e=Date.now()+jC,mt(()=>{gt(!0),vn(16)})}function Do(he){Mn(),i("submit",he)}function ze(he){j.value=!0,te.value=!1,$e=Date.now()+jC,i("editMessage",he)}function Xe(he){const we=s.queued?.[he],He=we?.text??"";y(He,we?.attachments)&&i("editQueued",he)}function kt(he){i("reorderQueue",he)}function Ht(he,we){Mn(),i("answer",he,we)}function Rn(he,we){!he||!we||i("approval",he,we)}let sn=null,Gt=null,Wn=null,En=null,St=0,Po=0,Ao=0;const ss=X(new Set),Tn=B(()=>!!s.sessionId&&ss.value.has(s.sessionId));function jn(he,we){const He=new Set(ss.value);we?He.add(he):He.delete(he),ss.value=He}function Ps(){Tn.value||Ao||(Ao=it(()=>{Ao=0,!Tn.value&&(qn()||(j.value||rt())&&gt(!1))}))}function ti(){et++,Ie&&(Gn(Ie),Ie=0),Ao&&(Gn(Ao),Ao=0)}function Io(){const he=Ae.value;if($e=0,ti(),ao=0,go=null,he){const we=he.scrollTop;typeof he.scrollTo=="function"?he.scrollTo({top:we,behavior:"auto"}):he.scrollTop=we}me=0,De=Number.NEGATIVE_INFINITY,he&&(Ce=he.scrollTop)}function Ss(){const he=Ae.value;!he||he.scrollHeight-he.clientHeight<=1&&!s.hasMoreMessages||(j.value=!1,Io(),he.scrollHeight-he.clientHeight>1&&(te.value=!0))}function Wi(he){const we=Ae.value;if(!we)return!1;for(const He of he.composedPath()){if(He===we)return!1;if(He instanceof HTMLElement&&He.scrollHeight>He.clientHeight+1&&He.scrollTop>1)return!0}return!1}function Si(he){he.defaultPrevented||he.ctrlKey||he.shiftKey||he.deltaY>=0||Wi(he)||Ss()}function co(he){const we=Ae.value;if(!we||he.defaultPrevented||he.button!==0||he.pointerType==="touch")return;const He=we.getBoundingClientRect(),Rt=we.offsetWidth-we.clientWidth,Dt=Rt>0?Rt:12;he.target===we&&he.clientX>=He.right-Dt&&Ss()}let ni=null;function Ci(he){ni=he.touches.length===1?he.touches[0].clientY:null}function ar(he){const we=he.touches.length===1?he.touches[0].clientY:null;we!==null&&ni!==null&&we>ni+2&&!Wi(he)&&Ss(),ni=we}function no(){if(!Gt)return;const he=Ae.value?.firstElementChild??null;he!==Wn&&(Wn&&Gt.unobserve(Wn),Wn=he,he&&Gt.observe(he))}function is(){if(!Gt)return;const he=P.value;he!==En&&(En&&Gt.unobserve(En),En=he,he&&Gt.observe(he))}function rs(){const he=Ae.value;ge(),sn&&(sn.disconnect(),he&&sn.observe(he,{childList:!0,subtree:!0,characterData:!0})),Gt&&(Gt.disconnect(),Wn=null,En=null,he&&Gt.observe(he),no(),is()),St=he?.scrollHeight??0,Po=he?.clientHeight??0,fe()}function Lo(){no(),Ps(),fe()}function Ai(){typeof document>"u"||document.visibilityState==="visible"&&j.value&&vn()}const zn=X(!1);let $o=null;function oi(){zn.value=!0,$o!==null&&clearTimeout($o),$o=setTimeout(()=>{zn.value=!1},xue)}function Ue(){oi(),i("interrupt")}function Fe(he){he.key==="Escape"&&(s.running||s.working)&&(he.preventDefault(),Ue())}function se(){j.value&&Ps()}cn(()=>{mt(()=>{typeof MutationObserver=="function"&&(sn=new MutationObserver(Lo)),typeof ResizeObserver=="function"&&(Gt=new ResizeObserver(()=>{fe(),ge();const he=Ae.value;if(!he)return;const{scrollHeight:we,clientHeight:He}=he,Rt=we>St+1,Dt=He<Po-1;St=we,Po=He,!qn()&&(Rt||Dt)&&Ps()})),rs(),vn(48),K(),typeof document<"u"&&(document.addEventListener("visibilitychange",Ai),document.addEventListener("keydown",Fe)),window.visualViewport?.addEventListener("resize",se)})}),bn(()=>{sn&&sn.disconnect(),Gt&&Gt.disconnect(),Ao&&Gn(Ao),Ie&&Gn(Ie),Yn&&Gn(Yn),J&&Gn(J),$o!==null&&clearTimeout($o),m!==null&&(clearTimeout(m),m=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",Ai),document.removeEventListener("keydown",Fe)),window.visualViewport?.removeEventListener("resize",se)});function Ne(){(g.value??p.value)?.focus()}return t({loadComposerForEdit:y,focusComposer:Ne}),(he,we)=>(w(),T("section",{class:We(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(w(),xe(gse,{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":R.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:b.value,onOpenChanges:we[0]||(we[0]=He=>i("openChanges")),onCopyAll:we[1]||(we[1]=He=>h.value?.copyConversation()),onCopyFinalSummary:we[2]||(we[2]=He=>h.value?.copyFinalSummary()),onOpenPr:we[3]||(we[3]=He=>e.pr&&i("openPr",e.pr.url)),onRenameSession:we[4]||(we[4]=(He,Rt)=>i("renameSession",He,Rt)),onForkSession:we[5]||(we[5]=He=>i("forkSession",He)),onArchiveSession:we[6]||(we[6]=He=>i("archiveSession",He)),onExportSession:we[7]||(we[7]=He=>i("exportSession",He))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):ae("",!0),e.conversationToc?(w(),xe(iue,{key:1,items:U.value,"active-turn-id":Z.value,mobile:e.mobile,"session-loading":e.sessionLoading,occluded:V.value,onSelect:Hn},null,8,["items","active-turn-id","mobile","session-loading","occluded"])):ae("",!0),_("div",aue,[_("div",{ref:de,class:We(["panes chat-scroll",{"is-following":j.value,"history-prepending":Tn.value}]),onScrollPassive:_t,onWheelPassive:Si,onPointerdownPassive:co,onTouchstartPassive:Ci,onTouchmovePassive:ar},[_("div",{class:We(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(w(),T(Pe,{key:0},[we[55]||(we[55]=_("div",{class:"empty-spacer"},null,-1)),_("div",cue,[_("span",{class:We(["empty-hint-title",{"is-starting":e.starting}])},[e.starting?(w(),xe(Ds,{key:0,size:"sm"})):ae("",!0),_("span",null,O(e.starting?C(o)("conversation.starting"):C(o)("composer.emptyConversationTitle")),1)],2),e.starting?ae("",!0):(w(),T("span",uue,O(C(o)("composer.emptyConversation")),1)),c.value&&!e.starting?(w(),T("div",due,[re(Xt,{text:C(o)("conversation.switchWorkspace")},{default:Ee(()=>[_("button",{type:"button",class:"ws-pick-btn",onClick:we[8]||(we[8]=bt(He=>r.value=!r.value,["stop"]))},[re(Ve,{name:"folder",size:"sm"}),_("span",fue,O(a.value),1),re(Ve,{class:We(["ws-pick-chev",{open:r.value}]),name:"chevron-down",size:"sm"},null,8,["class"])])]),_:1},8,["text"]),r.value?(w(),T("div",{key:0,class:"ws-pick-backdrop",onClick:we[9]||(we[9]=He=>r.value=!1)})):ae("",!0),r.value?(w(),T("div",hue,[(w(!0),T(Pe,null,ot(u.value,He=>(w(),T("button",{key:He.id,type:"button",class:We(["ws-pick-item",{on:He.id===e.activeWorkspaceId}]),onClick:bt(Rt=>f(He.id),["stop"])},[_("span",mue,O(He.name),1),_("span",gue,O(He.shortPath),1)],10,pue))),128)),d.value>0?(w(),T("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:we[10]||(we[10]=bt(He=>l.value=!l.value,["stop"]))},[_("span",null,O(C(o)("conversation.moreWorkspaces",{count:d.value})),1)])):ae("",!0),we[54]||(we[54]=_("div",{class:"ws-pick-divider"},null,-1)),_("button",{type:"button",class:"ws-pick-action",onClick:we[11]||(we[11]=bt(He=>{r.value=!1,i("addWorkspace")},["stop"]))},[re(Ve,{name:"plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)])])):ae("",!0)])):e.starting?ae("",!0):(w(),T("button",{key:2,type:"button",class:"empty-add-workspace",onClick:we[12]||(we[12]=He=>i("addWorkspace"))},[re(Ve,{name:"folder-plus",size:"sm"}),_("span",null,O(C(o)("conversation.addWorkspace")),1)]))]),re(R5,{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:Do,onSteer:we[13]||(we[13]=He=>i("steer",He)),onCommand:we[14]||(we[14]=He=>i("command",He)),onInterrupt:Ue,onUnqueue:we[15]||(we[15]=He=>i("unqueue",He)),onEditQueued:we[16]||(we[16]=He=>i("editQueued",He)),onSetPermission:we[17]||(we[17]=He=>i("setPermission",He)),onSetThinking:we[18]||(we[18]=He=>i("setThinking",He)),onTogglePlan:we[19]||(we[19]=He=>i("togglePlan")),onToggleSwarm:we[20]||(we[20]=He=>i("toggleSwarm")),onToggleGoal:we[21]||(we[21]=He=>i("toggleGoal")),onOpenBtw:we[22]||(we[22]=He=>i("command","/btw")),onCreateGoal:we[23]||(we[23]=He=>i("createGoal",He)),onControlGoal:we[24]||(we[24]=He=>i("controlGoal",He)),onFocusGoal:A,onCompact:we[25]||(we[25]=He=>i("compact")),onPickModel:we[26]||(we[26]=He=>i("pickModel")),onSelectModel:we[27]||(we[27]=He=>i("selectModel",He))},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"]),we[56]||(we[56]=_("div",{class:"empty-spacer"},null,-1))],64)):(w(),xe(A5,{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":j.value,"tool-diff-panel":!0,queued:e.queued,onOpenFile:we[28]||(we[28]=He=>i("openFile",He)),onOpenMedia:we[29]||(we[29]=He=>i("openMedia",He)),onCopyConversationCopied:k,onOpenThinking:we[30]||(we[30]=He=>i("openThinking",He)),onOpenCompaction:we[31]||(we[31]=He=>i("openCompaction",He)),onOpenAgent:we[32]||(we[32]=He=>i("openAgent",He)),onOpenToolDiff:we[33]||(we[33]=He=>i("openToolDiff",He)),onEditMessage:ze,onLoadOlderMessages:ns,onUnqueue:we[34]||(we[34]=He=>i("unqueue",He)),onEditQueued:Xe,onReorderQueue:kt},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?ae("",!0):(w(),xe(Xce,{key:0,ref:ve,style:Yt(q.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":v.value,"dock-panel":L.value,"bash-tasks":$.value,"subagent-tasks":N.value,"bash-running":x.value,"subagent-running":I.value,"todo-done-count":F.value,"has-dock-work":S.value,todos:e.todos,"pending-question":ce.value,"question-busy-kind":ue.value,"pending-approval":Se.value,"approval-busy":Te.value,mobile:e.mobile,onToggleDockPanel:we[35]||(we[35]=He=>D(He)),onCloseDockPanel:we[36]||(we[36]=He=>z()),onOpenAgent:we[37]||(we[37]=He=>i("openAgent",He)),onAnswer:Ht,onDismiss:we[38]||(we[38]=He=>i("dismiss",He)),onApproval:Rn,onCancelTask:we[39]||(we[39]=He=>i("cancelTask",He)),onControlGoal:we[40]||(we[40]=He=>i("controlGoal",He)),onSubmit:Do,onSteer:we[41]||(we[41]=He=>i("steer",He)),onCommand:we[42]||(we[42]=He=>i("command",He)),onInterrupt:Ue,onSetPermission:we[43]||(we[43]=He=>i("setPermission",He)),onSetThinking:we[44]||(we[44]=He=>i("setThinking",He)),onTogglePlan:we[45]||(we[45]=He=>i("togglePlan")),onToggleSwarm:we[46]||(we[46]=He=>i("toggleSwarm")),onToggleGoal:we[47]||(we[47]=He=>i("toggleGoal")),onOpenBtw:we[48]||(we[48]=He=>i("command","/btw")),onCreateGoal:we[49]||(we[49]=He=>i("createGoal",He)),onFocusGoal:A,onCompact:we[50]||(we[50]=He=>i("compact")),onPickModel:we[51]||(we[51]=He=>i("pickModel")),onSelectModel:we[52]||(we[52]=He=>i("selectModel",He))},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"]))]),re(Il,{name:"pill"},{default:Ee(()=>[te.value?(w(),T("button",{key:0,class:"newmsg-pill",style:Yt({bottom:`${ne.value+12}px`}),"aria-label":C(o)("conversation.jumpToLatestAria"),onClick:we[53]||(we[53]=He=>gt(!0))},[re(Ve,{class:"pill-chevron",name:"chevron-down",size:"md"}),Je(" "+O(C(o)("conversation.newMessages")),1)],12,vue)):ae("",!0)]),_:1}),re(Il,{name:"abort-toast"},{default:Ee(()=>[zn.value?(w(),T("div",yue,[_("span",kue,O(C(o)("conversation.manuallyAborted")),1)])):ae("",!0)]),_:1})],2))}}),_ue=ct(wue,[["__scopeId","data-v-68f9dafd"]]),Sue=["aria-selected","onClick"],Cue=Ze({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("div",{class:We(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[(w(!0),T(Pe,null,ot(e.options,i=>(w(),T("button",{key:i.value,class:We(["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)},O(i.label),11,Sue))),128))],2))}}),gs=ct(Cue,[["__scopeId","data-v-d1aaccd7"]]),Aue={class:"ui-panel-header__title"},Mue={key:0,class:"ui-panel-header__sub"},Eue=Ze({__name:"PanelHeader",props:{title:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{default:"Close"},wrap:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-panel-header",{wrap:e.wrap}])},[_("span",Aue,O(e.title),1),re(Xt,{text:e.subtitle},{default:Ee(()=>[e.subtitle?(w(),T("span",Mue,O(e.subtitle),1)):ae("",!0)]),_:1},8,["text"]),On(t.$slots,"default",{},void 0,!0),e.closable?(w(),xe(Pn,{key:0,class:"ui-panel-header__close",size:"sm",label:e.closeLabel,onClick:n[0]||(n[0]=o=>t.$emit("close"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])):ae("",!0)],2))}}),$a=ct(Eue,[["__scopeId","data-v-c47879ad"]]),Tue={key:0,class:"fp-empty fp-error"},Nue={key:1,class:"fp-empty"},Iue={key:2,class:"fp-loading"},Lue={class:"fp-path"},$ue={class:"fp-meta"},Fue={key:0,class:"fp-lines"},Oue={class:"fp-size"},Rue={key:3,class:"fp-search"},Bue=["placeholder"],Due={key:0,class:"fp-search-count"},Pue=["href","aria-label"],Hue={key:1,class:"fp-code"},Wue={class:"fp-line-table"},zue=["data-line"],Uue={class:"fp-gutter"},que=["innerHTML"],jue={key:1,class:"fp-body fp-code"},Vue={class:"fp-line-table"},Kue=["data-line"],Gue={class:"fp-gutter"},Yue=["innerHTML"],Zue={key:2,class:"fp-body"},Que=["srcdoc","title"],Xue={key:1,class:"fp-code"},Jue={class:"fp-line-table"},ede=["data-line"],tde={class:"fp-gutter"},nde=["innerHTML"],ode={key:3,class:"fp-body fp-pdf-wrap"},sde=["src","title"],ide={key:1,class:"fp-binary-card"},rde={class:"fp-binary-label"},lde={key:4,class:"fp-body fp-table-wrap"},ade={class:"fp-table"},cde=["data-line"],ude={key:5,class:"fp-body fp-image-wrap"},dde=["src","alt"],fde={key:1,class:"fp-binary-card"},hde={class:"fp-binary-icon"},pde={class:"fp-binary-label"},mde={key:6,class:"fp-body fp-image-wrap"},gde=["src"],vde={key:1,class:"fp-binary-card"},yde={class:"fp-binary-icon"},kde={class:"fp-binary-label"},bde={key:7,class:"fp-body fp-code"},xde={class:"fp-line-table"},wde=["data-line"],_de={class:"fp-gutter"},Sde=["innerHTML"],Cde={key:8,class:"fp-body fp-binary-wrap"},Ade={class:"fp-binary-card"},Mde={class:"fp-binary-icon"},Ede={class:"fp-binary-label"},Tde=Ze({__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}=Tt();function o(P,le){const ne=le?le.split("/").filter(Boolean):[];for(const q of P.split("/"))q===""||q==="."||(q===".."?ne.pop():ne.push(q));return ne.join("/")}const s=Kt("resolveImage",async P=>P),i=B(()=>{const P=c.file?.path??"",le=P.lastIndexOf("/");return le>0?P.slice(0,le):""});function r(P){if(/^(https?:|data:|blob:)/i.test(P)||P.startsWith("/"))return P;const le=i.value;return le?o(P,le):P}async function l(P){const le=r(P);return s?s(le):le}Ln("resolveImage",l);function a(P){let le=P.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(le)||le.startsWith("/"))return P;for(const q of["#","?"]){const ee=le.indexOf(q);ee!==-1&&(le=le.slice(0,ee))}const ne=i.value;return{...P,path:o(le,ne)}}const c=e,u=t;function d(P){c.openFile?.(a(P))}const f=X(null),h=B(()=>{const P=c.file;if(!P)return"binary";const le=P.mime??"",ne=P.languageId??"",q=P.path.toLowerCase();return le==="text/markdown"||ne==="markdown"||ne==="md"||q.endsWith(".mdx")?"markdown":le==="application/json"||ne==="json"?"json":le==="text/html"||ne==="html"||q.endsWith(".html")||q.endsWith(".htm")?"html":le==="application/pdf"||q.endsWith(".pdf")?"pdf":le==="text/csv"||ne==="csv"||q.endsWith(".csv")?"csv":le.startsWith("image/")?"image":le.startsWith("video/")?"video":P.isBinary?"binary":le.startsWith("text/")||ne!==""?"text":"binary"});function p(P){const le=atob(P),ne=Uint8Array.from(le,q=>q.charCodeAt(0));return new TextDecoder().decode(ne)}const g=B(()=>{const P=c.file;if(!P)return"";if(P.encoding==="base64")try{return p(P.content)}catch{return P.content}return P.content}),b=B(()=>{if(h.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(g.value),null,2)}catch{return g.value}}),v=B(()=>c.file?(h.value==="json"?b.value:g.value).split(`
301
- `):[]),m=B(()=>c.file?h.value==="json"?b.value:g.value:""),y=X(""),k=X(0),A=B(()=>{const P=y.value.trim().toLowerCase();if(!P)return[];const le=[];return v.value.forEach((ne,q)=>{ne.toLowerCase().includes(P)&&le.push(q+1)}),le});Qe(y,()=>{k.value=0});function $(P,le=!1){P&&mt(()=>{const ne=f.value?.querySelector(".fp-body"),q=ne?.querySelector(`[data-line="${P}"]`);if(!ne||!q)return;le&&(ne.scrollTop=0);const ee=ne.getBoundingClientRect(),ge=q.getBoundingClientRect(),de=ge.top-ee.top+ne.scrollTop;ne.scrollTop=de-ne.clientHeight/2+ge.height/2})}Qe(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function N(P){const le=A.value;le.length!==0&&(k.value=(k.value+P+le.length)%le.length,$(le[k.value]))}function x(P){const le=A.value;return{target:c.line===P,hit:le.includes(P),active:le[k.value]===P}}function I(P){return P<1024?`${P} B`:P<1024*1024?`${(P/1024).toFixed(1)} KB`:`${(P/(1024*1024)).toFixed(1)} MB`}const E=X(!1),F=X(!1);function S(){c.file&&Go(m.value).then(P=>{P&&(E.value=!0,setTimeout(()=>{E.value=!1},1400))})}function L(){c.file&&Go(c.file.path).then(P=>{P&&(F.value=!0,setTimeout(()=>{F.value=!1},1400))})}const R=X("preview"),D=X("preview"),z=X("fit");function H(P){R.value=P}function U(P){D.value=P}function Z(P){z.value=P}Qe(h,P=>{R.value=P==="html"?"preview":"source",D.value="preview",z.value="fit"});const K=B(()=>{const P=c.file;return!P||h.value!=="image"?null:P.sourceUrl?P.sourceUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:P.mime==="image/svg+xml"?`data:${P.mime};charset=utf-8,${encodeURIComponent(P.content)}`:null}),V=B(()=>{const P=c.file;return!P||h.value!=="video"?null:P.sourceUrl?P.sourceUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:null}),J=B(()=>{const P=c.file;return!P||h.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:P.encoding==="base64"?`data:${P.mime};base64,${P.content}`:null}),fe=B(()=>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:;">`,g.value].join(""):"");function oe(P){const le=[];let ne="",q=!1;for(let ee=0;ee<P.length;ee++){const ge=P[ee];ge==='"'&&P[ee+1]==='"'?(ne+='"',ee++):ge==='"'?q=!q:ge===","&&!q?(le.push(ne),ne=""):ne+=ge}return le.push(ne),le}const ce=B(()=>v.value.slice(0,200).map(oe));function ue(P){return P.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function Se(){const P=c.file;if(!P)return"";const le=P.languageId?.toLowerCase();return le||(P.path.split(".").pop()?.toLowerCase()??"")}function Te(P){const le=Se();let ne=ue(P);return h.value==="json"||le==="json"||le==="jsonc"?(ne=ne.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),ne=ne.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),ne=ne.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),ne=ne.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),ne):h.value==="html"||le==="html"||le==="xml"||le==="svg"?(ne=ne.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),ne=ne.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),ne=ne.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),ne):(ne=ne.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>'),ne=ne.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),ne=ne.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),ne)}function Ae(P,le=55){return!P||P.length<=le?P:"…"+P.slice(P.length-le+1)}return(P,le)=>(w(),T("div",{ref_key:"rootRef",ref:f,class:"file-preview"},[e.error&&!e.loading?(w(),T("div",Tue,[_("span",null,O(e.error),1),e.closable?(w(),xe(Bt,{key:0,variant:"secondary",size:"sm",onClick:le[0]||(le[0]=ne=>u("close"))},{default:Ee(()=>[Je(O(C(n)("filePreview.close")),1)]),_:1})):ae("",!0)])):!e.file&&!e.loading?(w(),T("div",Nue,O(C(n)("filePreview.empty")),1)):e.loading?(w(),T("div",Iue,[le[7]||(le[7]=_("span",{class:"spinner"},null,-1)),_("span",null,O(C(n)("filePreview.loading")),1)])):e.file?(w(),T(Pe,{key:3},[re($a,{wrap:"",title:C(n)("common.preview"),closable:e.closable,"close-label":C(n)("filePreview.close"),onClose:le[6]||(le[6]=ne=>u("close"))},{default:Ee(()=>[re(Xt,{text:e.file.path},{default:Ee(()=>[_("span",Lue,O(Ae(e.file.path)),1)]),_:1},8,["text"]),_("span",$ue,[e.file.lineCount?(w(),T("span",Fue,O(C(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):ae("",!0),_("span",Oue,O(I(e.file.size)),1)]),h.value==="html"?(w(),xe(gs,{key:0,"model-value":R.value,size:"sm",options:[{value:"preview",label:C(n)("filePreview.preview")},{value:"source",label:C(n)("filePreview.source")}],"onUpdate:modelValue":H},null,8,["model-value","options"])):ae("",!0),h.value==="markdown"?(w(),xe(gs,{key:1,"model-value":D.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"])):ae("",!0),h.value==="image"?(w(),xe(gs,{key:2,"model-value":z.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"])):ae("",!0),h.value==="text"||h.value==="json"||h.value==="html"||h.value==="csv"?(w(),T("div",Rue,[Fn(_("input",{"onUpdate:modelValue":le[1]||(le[1]=ne=>y.value=ne),class:"fp-search-input",type:"search",placeholder:C(n)("filePreview.search")},null,8,Bue),[[_s,y.value]]),y.value.trim()?(w(),T("span",Due,O(A.value.length),1)):ae("",!0),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.prevMatch"),onClick:le[2]||(le[2]=ne=>N(-1))},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),re(Pn,{size:"sm",disabled:A.value.length===0,label:C(n)("filePreview.nextMatch"),onClick:le[3]||(le[3]=ne=>N(1))},{default:Ee(()=>[re(Ve,{name:"arrow-down",size:"md"})]),_:1},8,["disabled","label"])])):ae("",!0),re(Pn,{size:"sm",class:We({copied:F.value}),label:F.value?C(n)("filePreview.copied"):C(n)("filePreview.copyPath"),onClick:L},{default:Ee(()=>[F.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"link",size:"md"}))]),_:1},8,["class","label"]),e.externalActions?(w(),xe(Pn,{key:4,size:"sm",label:C(n)("filePreview.openInEditor"),onClick:le[4]||(le[4]=ne=>u("openExternal"))},{default:Ee(()=>[re(Ve,{name:"external-link",size:"md"})]),_:1},8,["label"])):ae("",!0),e.externalActions?(w(),xe(Pn,{key:5,size:"sm",label:C(n)("filePreview.reveal"),onClick:le[5]||(le[5]=ne=>u("reveal"))},{default:Ee(()=>[re(Ve,{name:"folder",size:"md"})]),_:1},8,["label"])):ae("",!0),e.downloadUrl?(w(),T("a",{key:6,class:"fp-download",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"","aria-label":C(n)("filePreview.download")},[re(Ve,{name:"download",size:"md"})],8,Pue)):ae("",!0),!e.file.isBinary&&h.value!=="image"?(w(),xe(Pn,{key:7,size:"sm",class:We({copied:E.value}),label:E.value?C(n)("filePreview.copied"):C(n)("filePreview.copy"),onClick:S},{default:Ee(()=>[E.value?(w(),xe(Ve,{key:1,class:"fp-check",name:"check",size:"md"})):(w(),xe(Ve,{key:0,name:"copy",size:"md"}))]),_:1},8,["class","label"])):ae("",!0)]),_:1},8,["title","closable","close-label"]),h.value==="markdown"?(w(),T("div",{key:0,class:We(["fp-body",{"fp-markdown":D.value==="preview"}])},[D.value==="preview"?(w(),xe(Wm,{key:0,text:g.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(w(),T("div",Hue,[_("div",Wue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",Uue,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,que)],10,zue))),128))])]))],2)):h.value==="json"?(w(),T("div",jue,[_("div",Vue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",Gue,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,Yue)],10,Kue))),128))])])):h.value==="html"?(w(),T("div",Zue,[R.value==="preview"?(w(),T("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:fe.value,title:e.file.path},null,8,Que)):(w(),T("div",Xue,[_("div",Jue,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",tde,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,nde)],10,ede))),128))])]))])):h.value==="pdf"?(w(),T("div",ode,[J.value?(w(),T("iframe",{key:0,class:"fp-pdf-frame",src:J.value,title:e.file.path},null,8,sde)):(w(),T("div",ide,[_("span",rde,O(C(n)("filePreview.pdfNoPreview")),1)]))])):h.value==="csv"?(w(),T("div",lde,[_("table",ade,[_("tbody",null,[(w(!0),T(Pe,null,ot(ce.value,(ne,q)=>(w(),T("tr",{key:q,class:We(x(q+1)),"data-line":q+1},[_("th",null,O(q+1),1),(w(!0),T(Pe,null,ot(ne,(ee,ge)=>(w(),T("td",{key:ge},O(ee),1))),128))],10,cde))),128))])])])):h.value==="image"?(w(),T("div",ude,[K.value?(w(),T("img",{key:0,src:K.value,alt:e.file.path,class:We(["fp-image",{actual:z.value==="actual"}])},null,10,dde)):(w(),T("div",fde,[_("span",hde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",pde,O(C(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:I(e.file.size)})),1)]))])):h.value==="video"?(w(),T("div",mde,[V.value?(w(),T("video",{key:0,src:V.value,class:"fp-image",controls:"",playsinline:"",preload:"metadata"},null,8,gde)):(w(),T("div",vde,[_("span",yde,[re(Ve,{name:"image-off",size:"lg"})]),_("span",kde,O(C(n)("filePreview.videoNoPreview",{mime:e.file.mime,size:I(e.file.size)})),1)]))])):h.value==="text"?(w(),T("div",bde,[_("div",xde,[(w(!0),T(Pe,null,ot(v.value,(ne,q)=>(w(),T("div",{key:q,class:We(["fp-line-row",x(q+1)]),"data-line":q+1},[_("span",_de,O(q+1),1),_("span",{class:"fp-line-text",innerHTML:Te(ne)},null,8,Sde)],10,wde))),128))])])):(w(),T("div",Cde,[_("div",Ade,[_("span",Mde,[re(Ve,{name:"file-off",size:"lg"})]),_("span",Ede,O(C(n)("filePreview.binaryNoPreview",{mime:e.file.mime||C(n)("filePreview.unknownType"),size:I(e.file.size)})),1)])]))],64)):ae("",!0)],512))}}),Nde=ct(Tde,[["__scopeId","data-v-ded222d2"]]),Ide={class:"tp"},Lde=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=X(null);return Qe(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||mt(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(w(),T("div",Ide,[re($a,{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"]),_("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},O(e.text),513)]))}}),VC=ct(Lde,[["__scopeId","data-v-cf9c560b"]]),$de={class:"ap"},Fde={key:0,class:"ap-type"},Ode={key:1,class:"ap-reason"},Rde={key:2,class:"ap-field"},Bde={class:"ap-field-body"},Dde={key:3,class:"ap-field"},Pde={class:"ap-field-body ap-live"},Hde={key:4,class:"ap-field"},Wde={class:"ap-field-body ap-progress"},zde={key:0,class:"ap-call"},Ude={key:1,class:"ap-output"},qde=["onClick"],jde={key:5,class:"ap-field"},Vde={class:"ap-field-body"},Kde=8,KC=5,GC=2,Gde=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt(),i=B(()=>(n.member.outputLines??[]).map(g=>g.trimEnd()).filter(g=>g.length>0)),r=B(()=>(n.member.text??"").trimEnd());function l(g){const b=[];let v=null,m=0;for(const y of g)y.startsWith("Calling ")?(v={key:`g${m++}`,call:y,output:[]},b.push(v)):v?v.output.push(y):(v={key:`g${m++}`,call:"",output:[y]},b.push(v));return b}const a=B(()=>l(i.value)),c=X(new Set);function u(g){return c.value.has(g)}function d(g){const b=new Set(c.value);b.has(g)?b.delete(g):b.add(g),c.value=b}function f(g){return g.output.length-KC-GC}function h(g){switch(g){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const p=X(null);return Qe(()=>i.value.length+r.value.length,()=>{const g=p.value;!g||!(g.scrollHeight-g.scrollTop-g.clientHeight<24)||mt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},{immediate:!0}),(g,b)=>(w(),T("div",$de,[re($a,{title:C(s)("common.preview"),subtitle:e.member.name,"close-label":C(s)("thinking.close"),onClose:b[0]||(b[0]=v=>o("close"))},{default:Ee(()=>[re(Ri,{variant:"neutral",size:"sm",class:"ap-phase"},{default:Ee(()=>[Je(O(h(e.member.phase)),1)]),_:1})]),_:1},8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyEl",ref:p,class:"ap-body"},[e.member.subagentType?(w(),T("div",Fde,O(e.member.subagentType),1)):ae("",!0),e.member.suspendedReason?(w(),T("div",Ode,O(e.member.suspendedReason),1)):ae("",!0),e.member.prompt?(w(),T("div",Rde,[b[1]||(b[1]=_("span",{class:"ap-field-label"},"Task",-1)),_("div",Bde,O(e.member.prompt),1)])):ae("",!0),r.value?(w(),T("div",Dde,[b[2]||(b[2]=_("span",{class:"ap-field-label"},"Output",-1)),_("div",Pde,O(r.value),1)])):ae("",!0),a.value.length>0?(w(),T("div",Hde,[b[4]||(b[4]=_("span",{class:"ap-field-label"},"Progress",-1)),_("div",Wde,[(w(!0),T(Pe,null,ot(a.value,v=>(w(),T("div",{key:v.key,class:"ap-group"},[v.call?(w(),T("div",zde,[b[3]||(b[3]=_("span",{class:"ap-glyph","aria-hidden":"true"},"▶",-1)),Je(" "+O(v.call),1)])):ae("",!0),v.output.length>0?(w(),T("div",Ude,[v.output.length<=Kde||u(v.key)?(w(!0),T(Pe,{key:0},ot(v.output,(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)):(w(),T(Pe,{key:1},[(w(!0),T(Pe,null,ot(v.output.slice(0,KC),(m,y)=>(w(),T("div",{key:y,class:"ap-out-line"},O(m),1))),128)),_("button",{type:"button",class:"ap-fold",onClick:m=>d(v.key)}," … ("+O(f(v))+" more) ",9,qde),(w(!0),T(Pe,null,ot(v.output.slice(-GC),(m,y)=>(w(),T("div",{key:"t"+y,class:"ap-out-line"},O(m),1))),128))],64))])):ae("",!0)]))),128))])])):ae("",!0),e.member.summary?(w(),T("div",jde,[b[5]||(b[5]=_("span",{class:"ap-field-label"},"Result",-1)),_("div",Vde,O(e.member.summary),1)])):ae("",!0)],512)]))}}),Yde=ct(Gde,[["__scopeId","data-v-715bd93e"]]),Zde={class:"diff-lines"},Qde={key:0,class:"hunk-text"},Xde={class:"dl-gutter old"},Jde={class:"dl-gutter new"},efe={class:"dl-sign"},tfe={class:"dl-text"},nfe=Ze({__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)=>(w(),T("div",Zde,[(w(!0),T(Pe,null,ot(e.lines,(r,l)=>(w(),T("div",{key:l,class:We(["dl",o(r)])},[r.type==="hunk"?(w(),T("span",Qde,O(r.text),1)):(w(),T(Pe,{key:1},[_("span",Xde,O(t(r)),1),_("span",Jde,O(n(r)),1),_("span",efe,O(r.type==="add"?"+":r.type==="del"?"-":" "),1),_("span",tfe,O(r.text),1)],64))],2))),128))]))}}),D5=ct(nfe,[["__scopeId","data-v-2f6bc1cc"]]),ofe={class:"tdp"},sfe={class:"tdp-body"},ife={key:1,class:"tdp-output"},rfe={key:2,class:"tdp-empty"},lfe=Ze({__name:"ToolDiffPanel",props:{target:{}},emits:["close"],setup(e,{emit:t}){const n=t,{t:o}=Tt();return(s,i)=>(w(),T("div",ofe,[re($a,{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"]),_("div",sfe,[e.target.lines&&e.target.lines.length>0?(w(),xe(D5,{key:0,lines:e.target.lines},null,8,["lines"])):e.target.output&&e.target.output.length>0?(w(),T("div",ife,[(w(!0),T(Pe,null,ot(e.target.output,(r,l)=>(w(),T("div",{key:l},O(r),1))),128))])):(w(),T("div",rfe,O(C(o)("diff.noDiff")),1))])]))}}),afe=ct(lfe,[["__scopeId","data-v-76f2fbca"]]),cfe={class:"sc"},ufe={key:0,class:"sc-empty"},dfe={key:2,class:"sc-loading","aria-hidden":"true"},ffe={class:"sc-composer"},hfe=["placeholder"],pfe=["disabled"],mfe=Ze({__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}=Tt(),i=B(()=>n.turns.find(m=>m.role==="user")?.text?.trim()??""),r=B(()=>n.title?.trim()||s("sideChat.title")),l=B(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||s("sideChat.subtitle")),a=X(""),c=X(null),u=X(null);function d(){const v=a.value.trim();v&&(o("send",v),a.value="",mt(()=>{c.value&&(c.value.style.height="auto"),f()}))}function f(){const v=u.value;v&&(v.scrollTop=v.scrollHeight)}const h=B(()=>{const v=n.turns;if(v.length===0)return"0";const m=v.at(-1),y=m.thinking?.length??0,k=m.tools?.reduce((A,$)=>A+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${v.length}:${m.text.length}:${y}:${k}`});Qe(h,async()=>{!n.running&&!n.sending||(await mt(),f())});const p=B(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function g(v){v.key==="Enter"&&!v.shiftKey&&!v.isComposing&&(v.preventDefault(),d())}function b(){const v=c.value;v&&(v.style.height="auto",v.style.height=`${Math.min(v.scrollHeight,160)}px`)}return(v,m)=>(w(),T("div",cfe,[re($a,{title:r.value,subtitle:l.value,"close-label":C(s)("thinking.close"),onClose:m[0]||(m[0]=y=>o("close"))},null,8,["title","subtitle","close-label"]),_("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(w(),T("div",ufe,O(C(s)("sideChat.empty")),1)):(w(),xe(A5,{key:1,turns:e.turns,approvals:[],"turn-active":e.running,working:e.sending||e.running},null,8,["turns","turn-active","working"])),p.value?(w(),T("div",dfe,[re(S5)])):ae("",!0)],512),_("div",ffe,[Fn(_("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":m[1]||(m[1]=y=>a.value=y),class:"sc-input",rows:"1",placeholder:C(s)("sideChat.placeholder"),onInput:b,onKeydown:g},null,40,hfe),[[_s,a.value]]),re(Xt,{text:C(s)("sideChat.send")},{default:Ee(()=>[_("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),onClick:d},[re(Ve,{name:"arrow-right",size:"sm"})],8,pfe)]),_:1},8,["text"])])]))}}),gfe=ct(mfe,[["__scopeId","data-v-f973798f"]]),vfe={class:"changes-pane"},yfe={class:"dv-path"},kfe={class:"diff-head"},bfe={class:"back-label"},xfe={key:0,class:"empty-state"},wfe={key:1,class:"dv-lines-wrap"},_fe={key:2,class:"empty-state"},Sfe={class:"dv-change-count"},Cfe={class:"ch-head"},Afe={class:"br-label"},Mfe={class:"br-name"},Efe={key:0,class:"sync-info"},Tfe={key:0,class:"ahead"},Nfe={key:0,class:"behind"},Ife={key:1,class:"empty-head"},Lfe={key:0,class:"ch-list"},$fe=["onClick"],Ffe={class:"fpath"},Ofe={key:1,class:"ch-list ch-tree"},Rfe={class:"tree-list"},Bfe=["onClick"],Dfe={class:"tree-name"},Pfe=["onClick"],Hfe={class:"tree-name"},Wfe={key:2,class:"empty-state"},zfe={key:3,class:"empty-state"},Ufe=Ze({__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}=Tt(),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=B(()=>o.gitInfo!==null),u=B(()=>o.changes.length>0),d=B(()=>(o.selectedDiffPath??null)!==null),f=B(()=>o.mode==="detail"||o.mode==="full"&&d.value),h=B(()=>o.fileDiff??[]),p=B(()=>o.fileDiffLoading===!0);function g(F){s("open",F)}function b(){s("back")}function v(){s("close")}const m=X("list");function y(F){m.value=F}function k(F){const S={children:[]},L=[...F].sort((R,D)=>R.path.localeCompare(D.path));for(const R of L){const D=R.path.split("/");let z=S;for(let H=0;H<D.length;H++){const U=D[H],Z=H===D.length-1,K=D.slice(0,H+1).join("/");let V=z.children.find(J=>J.name===U&&J.kind===(Z?"file":"folder"));V||(V={name:U,path:K,kind:Z?"file":"folder",status:Z?R.status:void 0,children:[]},z.children.push(V)),z=V}}return S.children}const A=B(()=>k(o.changes)),$=X(new Set);function N(F){return!$.value.has(F)}const x=B(()=>{const F=[];function S(L,R){for(const D of L)F.push({node:D,depth:R}),D.kind==="folder"&&N(D.path)&&S(D.children,R+1)}return S(A.value,0),F});function I(F){const S=new Set($.value);S.has(F.path)?S.delete(F.path):S.add(F.path),$.value=S}function E(F){return`${16+F*16}px`}return(F,S)=>(w(),T("div",vfe,[f.value?(w(),T(Pe,{key:0},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[re(Xt,{text:e.selectedDiffPath??""},{default:Ee(()=>[_("span",yfe,O(a(e.selectedDiffPath??"",50)),1)]),_:1},8,["text"])]),_:1},8,["title","closable","close-label"]),_("div",kfe,[e.hideBack?ae("",!0):(w(),xe(Bt,{key:0,variant:"ghost",size:"sm",onClick:b},{default:Ee(()=>[S[0]||(S[0]=_("span",{"aria-hidden":"true"},"←",-1)),_("span",bfe,O(C(n)("diff.back")),1)]),_:1}))]),p.value?(w(),T("div",xfe,O(C(n)("diff.loading")),1)):h.value.length>0?(w(),T("div",wfe,[re(D5,{lines:h.value},null,8,["lines"])])):(w(),T("div",_fe,O(C(n)("diff.noDiff")),1))],64)):(w(),T(Pe,{key:1},[re($a,{title:C(n)("diff.title"),closable:e.closable,"close-label":C(n)("diff.close"),onClose:v},{default:Ee(()=>[_("span",Sfe,O(C(n)("diff.changeCount",{count:e.changes.length})),1),re(gs,{"model-value":m.value,size:"sm",options:[{value:"list",label:C(n)("diff.list")},{value:"tree",label:C(n)("diff.tree")}],"onUpdate:modelValue":y},null,8,["model-value","options"])]),_:1},8,["title","closable","close-label"]),_("div",Cfe,[c.value?(w(),T(Pe,{key:0},[_("span",Afe,O(C(n)("diff.branch")),1),_("span",Mfe,O(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(w(),T("span",Efe,[re(Xt,{text:C(n)("diff.aheadTitle")},{default:Ee(()=>[e.gitInfo.ahead>0?(w(),T("span",Tfe,"↑"+O(e.gitInfo.ahead),1)):ae("",!0)]),_:1},8,["text"]),re(Xt,{text:C(n)("diff.behindTitle")},{default:Ee(()=>[e.gitInfo.behind>0?(w(),T("span",Nfe,"↓"+O(e.gitInfo.behind),1)):ae("",!0)]),_:1},8,["text"])])):ae("",!0)],64)):(w(),T("span",Ife,O(C(n)("diff.empty")),1))]),u.value&&m.value==="list"?(w(),T("div",Lfe,[(w(!0),T(Pe,null,ot(e.changes,L=>(w(),xe(Xt,{key:L.path,text:L.path},{default:Ee(()=>[_("button",{type:"button",class:"ch-row",onClick:R=>g(L.path)},[_("span",{class:We(["badge",i(L.status)])},O(l(L.status)),3),_("span",Ffe,O(a(L.path)),1)],8,$fe)]),_:2},1032,["text"]))),128))])):u.value&&m.value==="tree"?(w(),T("div",Ofe,[_("ul",Rfe,[(w(!0),T(Pe,null,ot(x.value,({node:L,depth:R})=>(w(),T("li",{key:L.path,class:"tree-node"},[L.kind==="folder"?(w(),T("button",{key:0,type:"button",class:"tree-row tree-folder",style:Yt({paddingLeft:E(R)}),onClick:D=>I(L)},[re(Ve,{class:"tree-icon",name:"folder-solid",size:"sm"}),_("span",Dfe,O(L.name),1)],12,Bfe)):(w(),xe(Xt,{key:1,text:L.path},{default:Ee(()=>[_("button",{type:"button",class:"tree-row tree-file",style:Yt({paddingLeft:E(R)}),onClick:D=>g(L.path)},[_("span",{class:We(["badge",i(L.status)])},O(l(L.status)),3),_("span",Hfe,O(L.name),1)],12,Pfe)]),_:2},1032,["text"]))]))),128))])])):c.value?(w(),T("div",Wfe,O(C(n)("diff.clean")),1)):(w(),T("div",zfe,O(C(n)("diff.empty")),1))],64))]))}}),qfe=ct(Ufe,[["__scopeId","data-v-7778610a"]]);function jk(e,t){let n=null;cn(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,mt(()=>{const o=t?.value??e.value;try{o?.focus()}catch{}})}),po(()=>{const o=n;if(n=null,!(!o||typeof document>"u"||!document.contains(o)))try{o.focus()}catch{}})}const jfe=["type","value","placeholder","disabled","readonly"],Vfe=Ze({__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=X();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)=>(w(),T("input",{ref_key:"el",ref:s,class:We(["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,jfe))}}),Kc=ct(Vfe,[["__scopeId","data-v-340f0da2"]]),Kfe={class:"search-wrap"},Gfe={key:0,class:"tab-strip"},Yfe={key:1,class:"state-row"},Zfe={key:2,class:"state-row unavail"},Qfe={key:3,class:"model-list"},Xfe=["aria-selected","onClick","onMouseenter"],Jfe={class:"check"},ehe={class:"model-main"},the={class:"model-name"},nhe={class:"model-id"},ohe={key:0,class:"caps"},she={class:"model-provider"},ihe={class:"model-ctx"},rhe={key:0,class:"empty"},lhe={class:"footer-hint"},ahe=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=B(()=>new Set(o.starredIds??[]));function r(y){return i.value.has(y)}const l=X(""),a=X(null),c=X(null),u=X("all");jk(c,a);const d=B(()=>{const y=new Set,k=[{id:"all",label:n("model.allTab")}];for(const A of o.models)y.has(A.provider)||(y.add(A.provider),k.push({id:A.provider,label:A.provider}));return k}),f=B(()=>{const y=l.value.toLowerCase().trim(),k=o.models.filter(A=>{if(u.value!=="all"&&A.provider!==u.value)return!1;const $=(A.displayName??A.model).toLowerCase().includes(y),N=A.provider.toLowerCase().includes(y),x=A.id.toLowerCase().includes(y);return!y||$||N||x});return u.value!=="all"?k:k.sort((A,$)=>{const N=r(A.id)?1:0;return(r($.id)?1:0)-N})}),h=B(()=>f.value),p=X(0);Qe([l,u],()=>{p.value=0}),Qe(d,y=>{y.some(k=>k.id===u.value)||(u.value="all")}),Qe(h,y=>{p.value=Math.min(p.value,Math.max(y.length-1,0))});function g(y){if(y.key==="Escape"){s("close");return}if(y.key==="ArrowDown")y.preventDefault(),p.value=Math.min(p.value+1,h.value.length-1);else if(y.key==="ArrowUp")y.preventDefault(),p.value=Math.max(p.value-1,0);else if(y.key==="Enter"){const k=h.value[p.value];k&&s("select",k.id)}}cn(()=>{document.addEventListener("keydown",g)}),bn(()=>{document.removeEventListener("keydown",g)});function b(y){s("select",y)}function v(y){return h.value.indexOf(y)}function m(y){u.value=y}return(y,k)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("model.title"),size:"xl",height:"fixed",onClose:k[1]||(k[1]=A=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:c,class:"mp"},[_("div",Kfe,[re(Kc,{ref_key:"searchRef",ref:a,modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=A=>l.value=A),placeholder:C(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false",autofocus:""},null,8,["modelValue","placeholder"])]),d.value.length>1?(w(),T("div",Gfe,[(w(!0),T(Pe,null,ot(d.value,A=>(w(),xe(Bt,{key:A.id,variant:A.id===u.value?"secondary":"ghost",size:"sm",onClick:$=>m(A.id)},{default:Ee(()=>[Je(O(A.label),1)]),_:2},1032,["variant","onClick"]))),128))])):ae("",!0),e.loading?(w(),T("div",Yfe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("model.loading")),1)])):e.unavailable?(w(),T("div",Zfe,[re(Ve,{name:"alert-triangle",size:"lg"}),_("span",null,O(C(n)("model.unavailable")),1)])):(w(),T("div",Qfe,[(w(!0),T(Pe,null,ot(h.value,A=>(w(),T("div",{key:A.id,class:We(["model-row",{"is-current":A.id===e.current,"is-selected":v(A)===p.value}]),role:"option","aria-selected":A.id===e.current,onClick:$=>b(A.id),onMouseenter:$=>p.value=v(A)},[_("span",Jfe,[A.id===e.current?(w(),xe(Ve,{key:0,name:"check",size:"sm"})):ae("",!0)]),_("span",ehe,[_("span",the,O(A.displayName??A.model),1),_("span",nhe,O(A.id),1),A.capabilities&&A.capabilities.length>0?(w(),T("span",ohe,[(w(!0),T(Pe,null,ot(A.capabilities,$=>(w(),xe(Ri,{key:$,variant:"info",size:"sm"},{default:Ee(()=>[Je(O($),1)]),_:2},1024))),128))])):ae("",!0)]),_("span",she,O(A.provider),1),_("span",ihe,O(C(n)("model.contextSuffix",{size:C(ir)(A.maxContextSize)})),1),re(Pn,{size:"sm",label:r(A.id)?C(n)("model.unstarTitle"):C(n)("model.starTitle"),onClick:bt($=>s("toggle-star",A.id),["stop"])},{default:Ee(()=>[r(A.id)?(w(),xe(Ve,{key:0,name:"star",size:"md"})):(w(),xe(Ve,{key:1,name:"star-outline",size:"md"}))]),_:2},1032,["label","onClick"])],42,Xfe))),128)),h.value.length===0&&!e.loading&&!e.unavailable?(w(),T("div",rhe,O(o.models.length===0?C(n)("model.emptyNoModels"):C(n)("model.emptyNoMatch")),1)):ae("",!0)])),_("div",lhe,O(C(n)("model.footerHint")),1)],512)]),_:1},8,["title"]))}}),che=ct(ahe,[["__scopeId","data-v-56cefe51"]]),uhe={key:0,class:"ui-field__label"},dhe={key:1,class:"ui-field__error"},fhe={key:2,class:"ui-field__hint"},hhe=Ze({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-field",{"has-error":!!e.error}])},[e.label?(w(),T("label",uhe,O(e.label),1)):ae("",!0),On(t.$slots,"default",{},void 0,!0),e.error?(w(),T("span",dhe,O(e.error),1)):e.hint?(w(),T("span",fhe,O(e.hint),1)):ae("",!0)],2))}}),fh=ct(hhe,[["__scopeId","data-v-49bce958"]]),phe=["value","disabled"],mhe=Ze({__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)=>(w(),T("select",{class:We(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error}]]),value:e.modelValue,disabled:e.disabled,onChange:o},[On(s.$slots,"default",{},void 0,!0)],42,phe))}}),Yv=ct(mhe,[["__scopeId","data-v-92a040fd"]]),ghe={class:"prov-list"},vhe={key:0,class:"state-row"},yhe={key:1,class:"state-row unavail"},khe={key:2,class:"empty"},bhe={class:"prov-info"},xhe={class:"prov-type"},whe={key:0,class:"prov-url"},_he={class:"prov-meta"},She={key:0},Che={class:"prov-actions"},Ahe={key:0,class:"add-section"},Mhe={key:0,class:"add-btns"},Ehe={key:1,class:"add-form"},The=["value"],Nhe={key:0,class:"add-error"},Ihe={class:"form-btns"},Lhe={class:"footer-hint"},$he=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(null);jk(o);const s=t;function i(b){s("delete",b)}const r=X(!1),l=Bo({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),a=X(""),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(b){if(b.key==="Escape"){if(r.value){d();return}s("close")}}cn(()=>document.addEventListener("keydown",h)),bn(()=>document.removeEventListener("keydown",h));function p(b){return b==="connected"?"var(--color-success)":b==="error"?"var(--color-danger)":"var(--color-text-faint)"}function g(b){return n(b==="connected"?"providers.status.connected":b==="error"?"providers.status.error":"providers.status.unconfigured")}return(b,v)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("providers.title"),size:"xl",height:"fixed",onClose:v[6]||(v[6]=m=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:o,class:"pm"},[_("div",ghe,[e.loading?(w(),T("div",vhe,[re(Ds,{size:"sm"}),_("span",null,O(C(n)("providers.loading")),1)])):e.unavailable?(w(),T("div",yhe,[re(Ve,{name:"alert-triangle",size:"md"}),_("span",null,O(C(n)("providers.unavailable")),1)])):e.providers.length===0?(w(),T("div",khe,O(C(n)("providers.empty")),1)):(w(!0),T(Pe,{key:3},ot(e.providers,m=>(w(),T("div",{key:m.id,class:"prov-row"},[re(Xt,{text:g(m.status)},{default:Ee(()=>[_("span",{class:We(["status-dot",{"status-dot--empty":m.status!=="connected"&&m.status!=="error"}]),style:Yt(m.status==="connected"||m.status==="error"?{background:p(m.status)}:void 0)},null,6)]),_:2},1032,["text"]),_("div",bhe,[_("span",xhe,O(m.type),1),m.baseUrl?(w(),T("span",whe,O(m.baseUrl),1)):ae("",!0),_("span",_he,[re(Ri,{variant:m.hasApiKey?"success":"neutral",size:"sm"},{default:Ee(()=>[Je(O(m.hasApiKey?C(n)("providers.keySet"):C(n)("providers.keyNotSet")),1)]),_:2},1032,["variant"]),m.models&&m.models.length>0?(w(),T("span",She," · "+O(C(n)("providers.modelCount",{count:m.models.length})),1)):ae("",!0)])]),_("div",Che,[re(Xt,{text:C(n)("providers.refreshTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"secondary",size:"sm",onClick:y=>s("refresh",m.id)},{default:Ee(()=>[Je(O(C(n)("providers.refresh")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"]),re(Xt,{text:C(n)("providers.deleteTitle",{type:m.type})},{default:Ee(()=>[re(Bt,{variant:"danger-soft",size:"sm",onClick:y=>i(m.id)},{default:Ee(()=>[Je(O(C(n)("providers.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["text"])])]))),128))]),e.unavailable?ae("",!0):(w(),T("div",Ahe,[r.value?(w(),T("div",Ehe,[re(fh,{label:C(n)("providers.fieldType")},{default:Ee(()=>[re(Yv,{modelValue:l.type,"onUpdate:modelValue":v[2]||(v[2]=m=>l.type=m)},{default:Ee(()=>[(w(),T(Pe,null,ot(c,m=>_("option",{key:m,value:m},O(m),9,The)),64))]),_:1},8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldApiKey")},{default:Ee(()=>[re(Kc,{modelValue:l.apiKey,"onUpdate:modelValue":v[3]||(v[3]=m=>l.apiKey=m),type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,8,["modelValue"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldBaseUrl")},{default:Ee(()=>[re(Kc,{modelValue:l.baseUrl,"onUpdate:modelValue":v[4]||(v[4]=m=>l.baseUrl=m),placeholder:C(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),re(fh,{label:C(n)("providers.fieldDefaultModel")},{default:Ee(()=>[re(Kc,{modelValue:l.defaultModel,"onUpdate:modelValue":v[5]||(v[5]=m=>l.defaultModel=m),placeholder:C(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a.value?(w(),T("div",Nhe,O(a.value),1)):ae("",!0),_("div",Ihe,[re(Bt,{variant:"primary",size:"sm",onClick:f},{default:Ee(()=>[Je(O(C(n)("providers.add")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:d},{default:Ee(()=>[Je(O(C(n)("common.cancel")),1)]),_:1})])])):(w(),T("div",Mhe,[re(Bt,{variant:"secondary",size:"sm",onClick:v[0]||(v[0]=m=>s("openLogin","moonshot"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginKimi")),1)]),_:1}),re(Bt,{variant:"secondary",size:"sm",onClick:v[1]||(v[1]=m=>s("openLogin","anthropic"))},{default:Ee(()=>[re(Ve,{name:"user",size:"sm"}),Je(" "+O(C(n)("providers.loginAnthropic")),1)]),_:1}),re(Bt,{variant:"primary",size:"sm",onClick:u},{default:Ee(()=>[re(Ve,{name:"plus",size:"sm"}),Je(" "+O(C(n)("providers.enterApiKey")),1)]),_:1})]))])),_("div",Lhe,O(C(n)("providers.escClose")),1)],512)]),_:1},8,["title"]))}}),Fhe=ct($he,[["__scopeId","data-v-cf73278e"]]),Ohe={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Rhe={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Bhe={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},yg=Ze({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(w(),T("svg",Ohe,[...n[0]||(n[0]=[_("circle",{cx:"18",cy:"18",r:"15"},null,-1),_("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(w(),T("svg",Rhe,[...n[1]||(n[1]=[_("circle",{cx:"14",cy:"14",r:"12"},null,-1),_("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),_("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(w(),T("svg",Bhe,[...n[2]||(n[2]=[_("path",{d:"M14 3 L26 24 H2 Z"},null,-1),_("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),_("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Dhe={key:0,class:"center-body"},Phe={class:"center-text"},Hhe={key:1,class:"nb"},Whe={class:"nb-lead"},zhe=["href"],Uhe={class:"nb-or"},qhe={class:"nb-fallback"},jhe={class:"nb-fb-text"},Vhe=["href"],Khe={class:"nb-code-row"},Ghe={class:"nb-code"},Yhe={class:"nb-status"},Zhe={class:"nb-status-text"},Qhe={class:"nb-countdown"},Xhe={key:2,class:"center-body"},Jhe={class:"center-text success-text"},epe={class:"center-hint"},tpe={class:"center-body"},npe={class:"center-text err-text"},ope={class:"center-hint"},spe={class:"actions"},ipe={class:"center-body"},rpe={class:"center-text warn-text"},lpe={class:"center-hint"},ape={class:"actions"},cpe=3,upe=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=X(!0),s=t,i=e,r=X("starting"),l=X(!1),a=X(null),c=X(0),u=X(!1);let d=null,f=null,h=0;cn(async()=>{await p()}),bn(()=>{v()});async function p(){v(),a.value=null,l.value=!1,h=0,r.value="starting";const $=await i.onStartOAuthLogin();if(!$){r.value="error";return}if($.status==="authenticated"){v(),r.value="success",setTimeout(()=>{s("success"),s("close")},800);return}a.value={flowId:$.flowId,verificationUri:$.verificationUri,verificationUriComplete:$.verificationUriComplete,userCode:$.userCode,expiresIn:$.expiresIn,interval:$.interval},c.value=$.expiresIn,r.value="device-code",g(),b($.interval)}function g(){f&&clearInterval(f),f=setInterval(()=>{c.value>0?c.value--:(f&&clearInterval(f),f=null)},1e3)}function b($){d&&clearTimeout(d),d=setTimeout(async()=>{const N=await i.onPollOAuthLogin();if(N===null){if(h+=1,h>=cpe){v(),l.value=!0,r.value="error";return}b($);return}h=0,N.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{s("success"),s("close")},1200)):N.status==="expired"||N.status==="cancelled"?(v(),r.value="expired"):b($)},$*1e3)}function v(){d&&(clearTimeout(d),d=null),f&&(clearInterval(f),f=null)}async function m(){await p()}async function y(){!a.value||!await Go(a.value.userCode)||(u.value=!0,setTimeout(()=>{u.value=!1},2e3))}async function k(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),s("close")}function A($){const N=Math.floor($/60),x=$%60;return`${N}:${String(x).padStart(2,"0")}`}return($,N)=>(w(),xe(qr,{open:o.value,"onUpdate:open":N[0]||(N[0]=x=>o.value=x),title:C(n)("login.title"),"close-on-overlay":!1,onClose:k},{default:Ee(()=>[r.value==="starting"?(w(),T("div",Dhe,[re(Ds,{size:"md"}),_("span",Phe,O(C(n)("login.starting")),1)])):r.value==="device-code"&&a.value?(w(),T("div",Hhe,[_("div",Whe,O(C(n)("login.lead")),1),_("a",{class:"nb-primary",href:a.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[Je(O(C(n)("login.authorizeInBrowser"))+" ",1),re(Ve,{name:"external-link",size:"sm"})],8,zhe),_("div",Uhe,O(C(n)("login.orDivider")),1),_("div",qhe,[_("div",jhe,[Je(O(C(n)("login.fallbackPrefix")),1),_("a",{class:"nb-fb-link",href:a.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},O(a.value.verificationUri),9,Vhe),Je(O(C(n)("login.fallbackSuffix")),1)]),_("div",Khe,[_("span",Ghe,O(a.value.userCode),1),re(Bt,{class:We(["nb-copy",{"is-copied":u.value}]),variant:"secondary",size:"sm",onClick:y},{default:Ee(()=>[u.value?(w(),T(Pe,{key:0},[re(Ve,{name:"check",size:"sm"}),Je(" "+O(C(n)("login.copied")),1)],64)):(w(),T(Pe,{key:1},[re(Ve,{name:"copy",size:"sm"}),Je(" "+O(C(n)("login.copy")),1)],64))]),_:1},8,["class"])])]),_("div",Yhe,[re(Ds,{size:"sm",label:C(n)("login.waitingAuth")},null,8,["label"]),_("span",Zhe,O(C(n)("login.waitingAutoClose")),1),_("span",Qhe,O(A(c.value)),1)])])):r.value==="success"?(w(),T("div",Xhe,[re(yg,{kind:"success"}),_("span",Jhe,O(C(n)("login.success")),1),_("span",epe,O(C(n)("login.successHint")),1)])):r.value==="expired"?(w(),T(Pe,{key:3},[_("div",tpe,[re(yg,{kind:"expired"}),_("span",npe,O(C(n)("login.expiredTitle")),1),_("span",ope,O(C(n)("login.expiredHint")),1)]),_("div",spe,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):r.value==="error"?(w(),T(Pe,{key:4},[_("div",ipe,[re(yg,{kind:"error"}),_("span",rpe,O(l.value?C(n)("login.pollErrorTitle"):C(n)("login.errorTitle")),1),_("span",lpe,O(l.value?C(n)("login.pollErrorHint"):C(n)("login.errorHint")),1)]),_("div",ape,[re(Bt,{variant:"primary",onClick:m},{default:Ee(()=>[Je(O(C(n)("login.retry")),1)]),_:1}),re(Bt,{variant:"secondary",onClick:k},{default:Ee(()=>[Je(O(C(n)("login.closeBtn")),1)]),_:1})])],64)):ae("",!0)]),_:1},8,["open","title"]))}}),dpe=ct(upe,[["__scopeId","data-v-8308a28f"]]);function fpe(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const hpe=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function Fi(e){const t=e.replaceAll("\\","/"),n=hpe.test(t),o=t.replace(/\/+$/,"");return n?o.toLowerCase():o}function ppe(e,t){const n=Fi(t.cwd);return e.find(o=>Fi(o.root)===n)?.id??t.workspaceId??t.cwd}function mpe(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:o,sessionsHasMoreByWorkspace:s}=e,i=new Set(o.map(Fi)),r=new Map;for(const d of t){const f=Fi(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=Fi(f);i.has(h)||r.has(h)||r.set(h,{id:d.workspaceId??f,root:f,name:fpe(f),sessionCount:0})}const l=new Map;for(const d of n){const f=ppe(t,d);l.set(f,(l.get(f)??0)+1)}const a=[];for(const d of t){const f=Fi(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 gpe(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 YC(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 vpe(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 ype(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 kpe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function bpe(e){return kpe.has(e.type)}const xpe=50,wpe=100,Zv=32*1024,_pe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,xpe)},cancelTask(e){clearTimeout(e)}};function Spe(e,t,n={}){const o=n.scheduler??_pe,s=Math.max(1,Math.floor(n.maxItemsPerSlice??wpe)),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 g=()=>{if(u||l!==null||a!==null||d()===0)return;const v=++c,m=()=>{v===c&&p()};l=o.requestFrame(m),a=o.requestTask(m)};p=()=>{f();let v=0;for(;!u&&v<s&&r<i.length;){const m=i[r++];e(m),v+=1}h(),g()};const b=(v=>{if(!u){if(t(v)){const m=i.length>r?i.at(-1):void 0,y=m===void 0?void 0:n.coalesce?.(m,v);y===void 0?i.push(v):i[i.length-1]=y,g();return}if(d()===0){e(v);return}i.push(v),p()}});return b.flush=()=>{if(!u){for(f();!u&&r<i.length;)e(i[r++]);h()}},b.discard=v=>{if(u||d()===0)return;let m=r;for(let y=r;y<i.length;y+=1){const k=i[y];v(k)||(i[m++]=k)}i.length=m,h(),d()===0?f():g()},b.dispose=()=>{u||(u=!0,f(),i.length=0,r=0)},b}function Qv(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 Cpe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,o=Qv(t);if(n===void 0||o===void 0||n.kind!==o.kind||o.value.length<=Zv)return[e];const s=[];let i=0;for(;i<o.value.length;){let r=Math.min(i+Zv,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 Ape(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,o=t.meta.stream,s=Qv(e.appEvent),i=Qv(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>Zv)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 P5=["blue","mono"],H5=["light","dark","system"],W5=14,Mpe=12,Epe=20;function Tpe(){const e=mo(Ft.accent);return e&&P5.includes(e)?e:"blue"}function Npe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}function Ipe(){const e=mo(Ft.colorScheme);return e&&H5.includes(e)?e:"system"}function Lpe(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 Vk(e){return Number.isFinite(e)?Math.min(Epe,Math.max(Mpe,Math.round(e))):W5}function $pe(){const e=mo(Ft.uiFontSize);return e===null?W5:Vk(Number(e))}function Fpe(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--base-ui-font-size",`${Vk(e)}px`)}const Kk=X(Ipe()),Gk=X(Tpe()),Yk=X($pe());Qe(Kk,Lpe,{immediate:!0});Qe(Gk,Npe,{immediate:!0});Qe(Yk,Fpe,{immediate:!0});function Ope(e){H5.includes(e)&&(Kk.value=e,So(Ft.colorScheme,e))}function Rpe(e){P5.includes(e)&&(Gk.value=e,So(Ft.accent,e))}function Bpe(e){const t=Vk(e);Yk.value=t,So(Ft.uiFontSize,String(t))}const Dpe=600,Ppe=250,Gm=250,Hpe=1e3,Wpe=160,Wp=X(!1);let va=[],xa=null,zp=-Gm;function zpe(){va=[],zp=-Gm,Wp.value=!1,xa!==null&&(clearTimeout(xa),xa=null)}function Upe(){Wp.value=!0,xa!==null&&clearTimeout(xa),xa=setTimeout(()=>{xa=null,va=[],zp=-Gm,Wp.value=!1},Hpe)}function qpe(e){if(e<=0)return;const t=Date.now();va.push({time:t,chars:e});const n=t-Dpe;if(va=va.filter(l=>l.time>=n),t-zp<Gm)return;zp=t;const o=va[0]?.time??t,s=Math.max(t-o,Ppe);va.reduce((l,a)=>l+a.chars,0)/s*1e3>=Wpe&&Upe()}function z5(){return{colorScheme:Kk,accent:Gk,uiFontSize:Yk,fastMoon:Wp,setColorScheme:Ope,setAccent:Rpe,setUiFontSize:Bpe,resetFastMoon:zpe,recordMoonDelta:qpe}}function jpe(e,t,n){return e==="idle"&&!t&&!n}function Zk(e,t){const n=mo(e);return n===null?t:n==="1"}const Qk=X(Zk(Ft.notifyOnComplete,!0)),Xk=X(Zk(Ft.notifyOnQuestion,!1)),Jk=X(Zk(Ft.notifyOnApproval,!1)),e2=X(typeof Notification<"u"?Notification.permission:"denied"),Vpe="/favicon.ico";async function t2(e,t,n){if(!n){e.value=!1,So(t,"0");return}if(typeof Notification>"u")return;let o=Notification.permission;if(o==="default")try{o=await Notification.requestPermission()}catch{}e2.value=o,o==="granted"&&(e.value=!0,So(t,"1"))}function Kpe(e){return t2(Qk,Ft.notifyOnComplete,e)}function Gpe(e){return t2(Xk,Ft.notifyOnQuestion,e)}function Ype(e){return t2(Jk,Ft.notifyOnApproval,e)}function n2(...e){for(const t of e){const n=t?.trim();if(n)return n}return""}function Zpe(e){return{title:_n.global.t("settings.notifyTitle"),body:n2(e,_n.global.t("settings.notifyFallback"))}}function Qpe(e,t){return{title:_n.global.t("settings.notifyQuestionTitle"),body:n2(t,e,_n.global.t("settings.notifyQuestionFallback"))}}function Xpe(e,t){return{title:_n.global.t("settings.notifyApprovalTitle"),body:n2(t,e,_n.global.t("settings.notifyApprovalFallback"))}}function o2(e,t,n,o){if(!e||typeof Notification>"u")return;const s=Notification.permission;if(s!=="denied"){if(s==="default"){Notification.requestPermission().then(i=>{e2.value=i,i==="granted"&&ZC(t,n,o)});return}ZC(t,n,o)}}function ZC(e,t,n){if(!e.isUserWatching)try{const o=new Notification(t.title,{body:t.body,tag:n,icon:Vpe});o.onclick=()=>{try{window.focus()}catch{}e.onClick(),o.close()}}catch{}}function Jpe(e,t){o2(Qk.value,t,Zpe(t.sessionTitle),`kimi-complete-${e}-${t.promptId??Date.now()}`)}function eme(e){o2(Xk.value,e,Qpe(e.sessionTitle,e.questionPreview),`kimi-question-${e.questionId}`)}function tme(e){o2(Jk.value,e,Xpe(e.sessionTitle,e.toolName),`kimi-approval-${e.approvalId}`)}function nme(){return{notifyOnComplete:Qk,notifyOnQuestion:Xk,notifyOnApproval:Jk,notifyPermission:e2,setNotifyOnComplete:Kpe,setNotifyOnQuestion:Gpe,setNotifyOnApproval:Ype,maybeNotifyCompletion:Jpe,maybeNotifyQuestion:eme,maybeNotifyApproval:tme}}function ome(){return mo(Ft.soundOnComplete)==="1"}const cu=X(ome());function sme(){if(typeof window>"u")return;const e=window;return window.AudioContext??e.webkitAudioContext}let kg=null;function U5(){const e=sme();if(!e)return null;if(kg===null)try{kg=new e}catch{return null}return kg}function q5(){if(!cu.value)return;const e=U5();e!==null&&e.state==="suspended"&&e.resume().then(()=>{Er("sound: audio context resumed",{state:e.state})},t=>{Er("sound: audio context resume rejected",{error:String(t)})})}let QC=!1;function ime(){if(QC||typeof window>"u")return;QC=!0;const e=()=>{q5()};window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("keydown",e,{capture:!0})}ime();function rme(e){cu.value=e,So(Ft.soundOnComplete,e?"1":"0"),e&&q5()}function XC(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 s2(){const e=U5();if(e===null){Er("sound: skipped, AudioContext unavailable");return}if(e.state!=="running"){Er("sound: skipped, context not running",{state:e.state}),e.state==="suspended"&&e.resume().then(()=>{Er("sound: context resumed for next time",{state:e.state})},t=>{Er("sound: resume rejected",{error:String(t)})});return}try{XC(e,880,0,.16,.18),XC(e,1320,.1,.22,.16),Er("sound: chime scheduled",{state:e.state})}catch(t){Er("sound: failed to play",{error:String(t)})}}function lme(){cu.value&&s2()}function ame(){cu.value&&s2()}function cme(){cu.value&&s2()}function ume(){return{soundOnComplete:cu,setSoundOnComplete:rme,maybePlayCompletionSound:lme,maybePlayQuestionSound:ame,maybePlayApprovalSound:cme}}const dme=1e3,fme=4096,JC=32*1024;function hme(e,t){let n=null,o;const s=new Set;async function i(f){try{const p=await dt().listTasks(f);e.tasksBySession={...e.tasksBySession,[f]:YC(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]??[],g=dt(),b=new Map;if(await Promise.all(p.map(async m=>{if((m.status==="completed"||m.status==="failed"||m.status==="cancelled")&&!s.has(m.id)&&!((m.outputLines?.length??0)>0))try{const k=await g.getTask(f,m.id,{withOutput:!0,outputBytes:JC});k.outputPreview!==void 0&&b.set(m.id,{preview:k.outputPreview,bytes:k.outputBytes}),s.add(m.id)}catch{}})),b.size===0)return;const v=e.tasksBySession[f]??[];e.tasksBySession={...e.tasksBySession,[f]:v.map(m=>{const y=b.get(m.id)??(m.backgroundTaskId!==void 0?b.get(m.backgroundTaskId):void 0);return y?{...m,outputPreview:y.preview,outputBytes:y.bytes}:m})}}async function l(f){if(e.activeSessionId!==f)return;const h=dt();let p;try{p=await h.listTasks(f)}catch{return}const g=new Map;await Promise.all(p.map(async y=>{const k=y.status==="running",A=y.status==="completed"||y.status==="failed"||y.status==="cancelled";if(!(!k&&!A)&&!(A&&(s.has(y.id)||(y.outputLines?.length??0)>0)))try{const $=await h.getTask(f,y.id,{withOutput:!0,outputBytes:k?fme:JC});$.outputPreview!==void 0&&g.set(y.id,{preview:$.outputPreview,bytes:$.outputBytes}),A&&s.add(y.id)}catch{}}));const b=e.tasksBySession[f]??[],v=new Map(b.map(y=>[y.id,y])),m=p.map(y=>{const k=v.get(y.id),A=g.get(y.id);return{...y,outputLines:k?.outputLines,text:k?.text,outputPreview:A?.preview??k?.outputPreview,outputBytes:A?.bytes??k?.outputBytes}});e.tasksBySession={...e.tasksBySession,[f]:YC(m,b)}}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())},dme))}function c(){n!==null&&(clearInterval(n),n=null),o=void 0,s.clear()}const u=X(0);let d=null;return Qe(()=>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}),Qe(()=>{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,g)=>{let b;h&&f!==void 0?a(f):f!==void 0?b=setTimeout(()=>{(e.tasksBySession[f]??[]).some(m=>m.status==="running")||c()},1500):c(),g(()=>{b!==void 0&&clearTimeout(b)})},{deep:!0,immediate:!0}),{taskClock:B(()=>u.value),loadTasksForSession:i}}function pme(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 mme(e){const t=[];if(!e)return t;let n=0,o=0,s=!1;for(const i of e.split(`
302
- `)){if(i.startsWith("diff --git")){s=!1;continue}if(!s&&pme(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 Xv="/sessions/";function e4(e){const{pathname:t}=e;if(!t.startsWith(Xv))return;const n=t.slice(Xv.length);if(!(!n||n.includes("/")))try{const o=decodeURIComponent(n);return o.length>0?o:void 0}catch{return}}function gme(e){return e===void 0||e.length===0?"/":`${Xv}${encodeURIComponent(e)}`}const vme=50,Jv=5,yme=40402,kme=40410,bme=40902,xme=2e3;function bg(e){return vi(e)&&e.code===bme}const wme=40904;function _me(e){return vi(e)&&e.code===wme}const ca=Bo({}),hh=Bo({}),xg=Bo({}),Yi=Bo(new Set),Ym=new Map,Fa=new Map,Up=new Map;let Sme=0;const da=new Map,Cme=3;let t4=0;function Ame(){return t4+=1,`${Date.now().toString(36)}-${t4}`}function Mme(e){return{generation:Ym.get(e)??0,pending:(Fa.get(e)?.size??0)>0}}function ey(e){const t=++Sme;Ym.set(e,t);const n=Fa.get(e)??new Set;return n.add(t),Fa.set(e,n),t}function ty(e,t){const n=Fa.get(e);if(n===void 0||(n.delete(t),n.size>0))return;Fa.delete(e);const o=Up.get(e);Up.delete(e),o?.()}function Eme(e){Ym.delete(e),Fa.delete(e),Up.delete(e),da.delete(e)}function Tme(e,t){return!t.pending&&t.generation===(Ym.get(e)??0)}function Nme(e,t){if((Fa.get(e)?.size??0)===0){t();return}Up.set(e,t)}function Ime(e,t){const{t:n}=_n.global,{confirm:o}=tf(),{taskPoller:s,sideChat:i,modelProvider:r,pushOperationFailure:l,activity:a,sessionsKnownEmpty:c,setSessions:u,updateSession:d,upsertSessionFront:f,appendSession:h,forgetSession:p,setActiveSessionId:g,updateSessionMessages:b,nextOptimisticMsgId:v,getEventConn:m,syncSessionFromSnapshot:y,reopenSession:k,hasLoadedMessages:A,refreshSessionStatus:$,refreshSessionGoal:N,persistSessionProfile:x,mergedWorkspaces:I,workspacesView:E,status:F,workspaceIdForSession:S,savePermissionToStorage:L,savePlanModeToStorage:R,saveSwarmModeToStorage:D,saveGoalModeToStorage:z,draftModes:H,saveUnread:U,saveActiveWorkspaceToStorage:Z,saveHiddenWorkspacesToStorage:K,goalErrorMessage:V,resetFastMoon:J,initialized:fe,connectIssue:oe,selectedDiffPath:ce,fileDiffLines:ue,fileDiffLoading:Se}=t;let Te=!1;async function Ae(Q){if(e.messagesLoadingMoreBySession[Q])return;const be=e.messagesBySession[Q];if(!be||be.length===0)return;const ke=be[0].id;e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!0},e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!1};try{const Oe=await dt().listMessages(Q,{beforeId:ke,pageSize:vme}),Ye=[...Oe.items].reverse();b(Q,st=>[...Ye,...st]),e.messagesHasMoreBySession={...e.messagesHasMoreBySession,[Q]:Oe.hasMore}}catch(Oe){e.messagesLoadMoreErrorBySession={...e.messagesLoadMoreErrorBySession,[Q]:!0},l("loadOlderMessages",Oe,{sessionId:Q})}finally{e.messagesLoadingMoreBySession={...e.messagesLoadingMoreBySession,[Q]:!1}}}function P(Q){s.loadTasksForSession(Q),q(Q),$(Q),N(Q),Object.prototype.hasOwnProperty.call(r.skillsBySession.value,Q)||r.loadSkillsForSession(Q)}async function le(Q){const be=e.activeSessionId;if(be){ce.value=Q,ue.value=[],Se.value=!0;try{const Oe=await dt().getFileDiff(be,Q);if(ce.value!==Q)return;ue.value=mme(Oe.diff)}catch(ke){ce.value===Q&&(ue.value=[]),console.warn("[loadFileDiff] diff unavailable for",Q,ke)}finally{ce.value===Q&&(Se.value=!1)}}}function ne(){ce.value=null,ue.value=[],Se.value=!1}async function q(Q){try{const ke=await dt().getGitStatus(Q);e.gitStatusBySession={...e.gitStatusBySession,[Q]:ke}}catch{}}async function ee(){try{const be=await dt().getAuth();return e.authReady=be.ready,e.defaultModel=be.defaultModel,e.managedProviderStatus=be.managedProvider?.status??null,oe.value=null,"proceed"}catch(Q){return vi(Q)&&(Q.code===401||Q.code===x5)?(oe.value=null,"server-auth-required"):(oe.value=(Q instanceof Error?Q.message:String(Q)).slice(0,140),"retry")}}async function ge(){let Q=!0;for(;;){const be=await ee();if(be!=="retry")return be;Q&&(oe.value=null,Q=!1),await new Promise(ke=>{setTimeout(ke,xme)})}}async function de(){try{const Q=dt();e.config=await Q.getConfig()}catch{}}async function ve(Q){try{const ke=await dt().setConfig(Q);return e.config=ke,e.defaultModel=ke.defaultModel??null,!0}catch(be){return l("setConfig",be),!1}}const j=100,te=30,pe=720*60*1e3;async function Ce(){const Q=dt(),be=[];let ke,Oe;for(;;){let Ye;try{Ye=await Q.listSessions({pageSize:j,beforeId:ke,excludeEmpty:!0})}catch(st){if(be.length===0)throw st;Oe=st;break}if(be.push(...Ye.items),!Ye.hasMore||Ye.items.length===0)break;ke=Ye.items[Ye.items.length-1].id}return{sessions:be,error:Oe}}function $e(Q){const be=new Map(e.sessions.map(ke=>[ke.id,ke.usage]));u(Q.map(ke=>{const Oe=be.get(ke.id);return Oe!==void 0&&Hv(ke.usage)&&!Hv(Oe)?{...ke,usage:Oe}:ke}))}function De(Q){const be=[...Q],ke=new Set(be.map(Oe=>Oe.id));for(const Oe of e.sessions)ke.has(Oe.id)||(be.push(Oe),ke.add(Oe.id));return be.sort((Oe,Ye)=>new Date(Ye.updatedAt).getTime()-new Date(Oe.updatedAt).getTime()),be}async function me(Q){const be=dt(),ke=[],Oe=Date.now(),Ye=jt=>Oe-new Date(jt.updatedAt).getTime();let st,Ct=!1,Ot=!0,uo;for(;;){let jt;try{jt=await be.listSessions({workspaceId:Q,pageSize:Jv,beforeId:st,excludeEmpty:!0})}catch(Mt){if(Ot)throw Mt;uo=Mt,Ct=!0;break}if(Ct=jt.hasMore,jt.items.length===0)break;const wn=jt.items[jt.items.length-1],ls=Ye(wn)>=pe;if(!Ot&&ls){const Mt=jt.items.findIndex(Vt=>Ye(Vt)>=pe),Nt=Mt>=0?Mt+1:jt.items.length;ke.push(...jt.items.slice(0,Nt)),Ct=jt.hasMore||Nt<jt.items.length;break}if(ke.push(...jt.items),Ot=!1,!jt.hasMore||ls)break;st=wn.id}return{workspaceId:Q,page:{items:ke,hasMore:Ct},error:uo}}async function Ie(){const Q=e.workspaces;if(Q.length===0){const Mt=await Ce(),Nt=Mt.error===void 0?Mt.sessions:De(Mt.sessions);return e.sessionsHasMoreByWorkspace={},e.sessionsCursorByWorkspace={},e.sessionsInitialCountByWorkspace={},e.sessionsFullyLoaded=Mt.error===void 0,Mt.error!==void 0&&l("load",Mt.error),Nt}const be=await Promise.allSettled(Q.map(Mt=>me(Mt.id))),ke=[],Oe=new Set,Ye=new Map,st=new Set;let Ct;for(let Mt=0;Mt<be.length;Mt++){const Nt=be[Mt];if(Nt.status==="fulfilled"){Ye.set(Nt.value.workspaceId,Nt.value.page),Nt.value.error!==void 0&&(st.size===0&&(Ct=Nt.value.error),st.add(Nt.value.workspaceId));for(const Vt of Nt.value.page.items)Oe.has(Vt.id)||(ke.push(Vt),Oe.add(Vt.id));continue}st.size===0&&(Ct=Nt.reason),st.add(Q[Mt].id)}if(Ye.size===0){l("load",Ct);return}const Ot=new Set(Q.filter(Mt=>st.has(Mt.id)).map(Mt=>Mt.root)),uo=new Set(Q.map(Mt=>Mt.id));for(const Mt of e.sessions)!(Mt.workspaceId!==void 0&&uo.has(Mt.workspaceId)?st.has(Mt.workspaceId):Ot.has(Mt.cwd)||st.has(S(Mt)))||Oe.has(Mt.id)||(ke.push(Mt),Oe.add(Mt.id));const jt={},wn={},ls={};for(const{id:Mt}of Q){const Nt=Ye.get(Mt);if(Nt===void 0){const Vt=e.sessionsHasMoreByWorkspace[Mt],fo=e.sessionsCursorByWorkspace[Mt],oo=e.sessionsInitialCountByWorkspace[Mt];Vt!==void 0&&(jt[Mt]=Vt),fo!==void 0&&(wn[Mt]=fo),oo!==void 0&&(ls[Mt]=oo);continue}jt[Mt]=Nt.hasMore,wn[Mt]=Nt.items.length>0?Nt.items[Nt.items.length-1].id:void 0,ls[Mt]=Math.max(Nt.items.length,Jv)}return e.sessionsHasMoreByWorkspace=jt,e.sessionsCursorByWorkspace=wn,e.sessionsInitialCountByWorkspace=ls,e.sessionsFullyLoaded=!1,ke.sort((Mt,Nt)=>new Date(Nt.updatedAt).getTime()-new Date(Mt.updatedAt).getTime()),st.size>0&&l("load",Ct),ke}async function et(Q){if(e.sessionsLoadingMoreByWorkspace[Q]||e.sessionsHasMoreByWorkspace[Q]===!1)return;const be=e.sessionsCursorByWorkspace[Q];if(be!==void 0){e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!0};try{const ke=await dt().listSessions({workspaceId:Q,pageSize:te,beforeId:be,excludeEmpty:!0}),Oe=new Set(e.sessions.map(st=>st.id)),Ye=ke.items.filter(st=>!Oe.has(st.id));Ye.length>0&&u([...e.sessions,...Ye]),e.sessionsCursorByWorkspace={...e.sessionsCursorByWorkspace,[Q]:ke.items.length>0?ke.items[ke.items.length-1].id:be},e.sessionsHasMoreByWorkspace={...e.sessionsHasMoreByWorkspace,[Q]:ke.hasMore}}catch(ke){l("loadMoreSessions",ke)}finally{e.sessionsLoadingMoreByWorkspace={...e.sessionsLoadingMoreByWorkspace,[Q]:!1}}}}async function rt(){if(e.sessionsFullyLoaded)return;const Q=await Ce().catch(Oe=>(console.warn("[kimi-web] loadAllSessions failed; search covers only loaded sessions",Oe),null));if(Q===null)return;const be=Q.error===void 0?Q.sessions:De(Q.sessions);if($e(be),e.sessionsFullyLoaded=Q.error===void 0,Q.error!==void 0)return;const ke={};for(const Oe of e.workspaces)ke[Oe.id]=!1;e.sessionsHasMoreByWorkspace=ke}async function _t(){const Q=await dt().getMeta().catch(()=>null);Q!==null&&(e.serverVersion=Q.serverVersion,e.availableOpenInApps=Q.openInApps,e.dangerousBypassAuth=Q.dangerousBypassAuth,e.backend=Q.backend)}async function gt(){const Q=Date.now();let be="accepted";ko("app:load:start"),e.loading=!0;const ke=!fe.value;let Oe=!0;try{if(ke&&await ge()==="server-auth-required"){Oe=!1,be="auth-required";return}const Ye=dt();await Promise.all([Ye.getHealth().catch(()=>null),_t(),r.loadModels()]),ke||await ee(),await de(),await It();const st=await Ie(),Ct=st??e.sessions;st!==void 0&&$e(st);const Ot=Ct[0],uo=e.activeWorkspaceId;!(uo!==null&&I.value.some(ls=>ls.id===uo))&&Ot&&ht(S(Ot)),xn();const wn=typeof window<"u"?e4(window.location):void 0;!e.activeSessionId&&wn!==void 0&&(e.sessions.some(Mt=>Mt.id===wn)||await to(wn))&&await An(wn,{urlMode:"replace"}),!e.activeSessionId&&Ct.length>0&&await An(Ct[0].id,{urlMode:"replace"})}catch(Ye){be="failed",l("load",Ye)}finally{e.loading=!1,Oe&&(fe.value=!0),ko("app:load:complete",{status:be,sessionId:e.activeSessionId,sessionCount:e.sessions.length,workspaceCount:e.workspaces.length,durationMs:Date.now()-Q})}}async function It(){try{const Q=dt(),[be,ke]=await Promise.all([Q.listWorkspaces().catch(()=>[]),Q.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);e.workspaces=Ut(be),e.fsHome=ke.home||null,e.recentRoots=ke.recentRoots}catch{}}function Ut(Q){const be=zf();return Object.keys(be).length===0?Q:Q.map(ke=>{const Oe=be[ke.root];return Oe!==void 0?{...ke,name:Oe}:ke})}function ht(Q){e.activeWorkspaceId=Q,Z(Q)}function un(Q){ht(Q);const be=e.sessions.filter(ke=>S(ke)===Q);if(be.length>0){const ke=be[0];ke&&ke.id!==e.activeSessionId&&An(ke.id)}else g(void 0),qn(void 0,"push")}function dn(Q){const be=zf()[Q.root],ke=be!==void 0?{...Q,name:be}:Q,Oe=Fi(ke.root);e.hiddenWorkspaceRoots.some(Ct=>Fi(Ct)===Oe)&&(e.hiddenWorkspaceRoots=e.hiddenWorkspaceRoots.filter(Ct=>Fi(Ct)!==Oe),K(e.hiddenWorkspaceRoots));const Ye=e.workspaces.findIndex(Ct=>Ct.id===ke.id||Ct.root===ke.root);if(Ye===-1){e.workspaces=[ke,...e.workspaces];return}const st=[...e.workspaces];st[Ye]=ke,e.workspaces=st}function ns(Q){if(Q.type==="workspaceCreated"||Q.type==="workspaceUpdated"){dn(Q.workspace);return}const be=e.workspaces.find(Oe=>Oe.id===Q.workspaceId)?.root??Q.root;if(be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots)),e.workspaces=e.workspaces.filter(Oe=>Oe.id!==Q.workspaceId&&Oe.root!==be),e.activeWorkspaceId===Q.workspaceId||e.activeWorkspaceId===be){const Oe=E.value[0]?.id??null;if(e.activeWorkspaceId=Oe,Oe)Z(Oe);else try{Na(Ft.activeWorkspace)}catch{}g(void 0),e.sessionLoading=!1,ne(),qn(void 0,"replace")}}function Wt(){g(void 0),qn(void 0,"push")}function Hn(Q){ht(Q),Wt(),ne()}async function lo(Q){const be=I.value.find(wn=>wn.id===Q);if(!be)return null;const ke=e.thinking,Oe=dt();let Ye,st=be.root;try{const wn=await Oe.addWorkspace({root:be.root});Ye=wn.id,st=wn.root,dn(wn)}catch{}const Ct=r.draftModel.value??void 0,Ot=await Oe.createSession({workspaceId:Ye,cwd:st,model:Ct});r.draftModel.value=null;const uo=Ct!==void 0&&(!Ot.model||Ot.model.length===0)?{...Ot,model:Ct}:Ot;f(uo),ht(Ot.workspaceId??Ye??Q),await An(Ot.id);const jt=Ot.id;return ke!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[jt]:ke}),H.planMode&&(e.planModeBySession={...e.planModeBySession,[jt]:!0},R()),H.swarmMode&&(e.swarmModeBySession={...e.swarmModeBySession,[jt]:!0},D()),H.goalMode&&(e.goalModeBySession={...e.goalModeBySession,[jt]:!0},z()),H.planMode=!1,H.swarmMode=!1,H.goalMode=!1,jt}async function it(Q,be,ke){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;await Mn(Oe,be,ke)}catch(Oe){l("startSessionAndSendPrompt",Oe)}finally{Yi.delete(Q)}}}async function Gn(Q,be,ke){if(!Yi.has(Q)){Yi.add(Q);try{const Oe=await lo(Q);if(!Oe)return;const Ye=e.planModeBySession[Oe]??!1,st=e.swarmModeBySession[Oe]??!1,Ct=e.sessions.find(jt=>jt.id===Oe),Ot=(Ct?.model&&Ct.model.length>0?Ct.model:e.defaultModel)??void 0;if(!await x({model:Ot,planMode:Ye,swarmMode:st,permissionMode:e.permission},Oe))return;await r.activateSkill(be,ke,Oe)}catch(Oe){l("startSessionAndActivateSkill",Oe)}finally{Yi.delete(Q)}}}async function ao(Q,be){if(!Yi.has(Q)){Yi.add(Q);try{const ke=await lo(Q);if(!ke)return;await i.openSideChatOn(ke,be)}catch(ke){l("startSessionAndOpenSideChat",ke)}finally{Yi.delete(Q)}}}async function Yn(Q){const be=Q.trim();if(!be)return!1;const ke=dt();try{const Oe=await ke.addWorkspace({root:be});return dn(Oe),Hn(Oe.id),!0}catch(Oe){return console.warn("[kimi-web] addWorkspaceByPath failed for",be,Oe),!1}}async function go(Q){try{return await dt().browseFs(Q)}catch{return{path:"",parent:null,entries:[]}}}async function os(){try{return await dt().getFsHome()}catch{return{home:"",recentRoots:[]}}}function qn(Q,be){if(be==="none"||typeof window>"u"||!window.history)return;const ke=gme(Q);if(window.location.pathname!==ke)try{be==="push"?window.history.pushState(null,"",ke):window.history.replaceState(null,"",ke)}catch{}}async function to(Q){try{const be=await dt().getSession(Q);return e.sessions.some(ke=>ke.id===be.id)||h(be),!0}catch{return!1}}function vn(){const Q=e4(window.location);if(Q===void 0){g(void 0);return}if(Q!==e.activeSessionId){if(e.sessions.some(be=>be.id===Q)){An(Q,{urlMode:"none"});return}(async()=>{if(await to(Q)){await An(Q,{urlMode:"none"});return}const be=e.sessions[0];be?await An(be.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))})()}}let Zn=!1;function xn(){Zn||typeof window>"u"||(Zn=!0,window.addEventListener("popstate",vn))}async function An(Q,be){const ke=A(Q),Oe=!ke&&c.has(Q);c.delete(Q);try{qn(Q,be?.urlMode??"push"),e.sessionLoading=!ke&&!Oe,g(Q),J(),e.unreadBySession[Q]&&(e.unreadBySession={...e.unreadBySession,[Q]:!1},U({[Q]:!1})),ne();const Ye=e.sessions.find(st=>st.id===Q);if(Ye){const st=S(Ye);e.activeWorkspaceId!==st&&ht(st)}if(ke){if(await k(Q)==="not-found")return}else if(await y(Q)==="not-found")return;P(Q)}catch(Ye){l("selectSession",Ye,{sessionId:Q})}finally{e.activeSessionId===Q&&(e.sessionLoading=!1)}}async function Mn(Q,be,ke){const Oe=ey(Q);e.inFlightBySession={...e.inFlightBySession,[Q]:!0};const Ye=v();try{const st=dt(),Ct=[];be&&Ct.push({type:"text",text:be});for(const Vt of ke??[])Vt.kind==="video"?Ct.push({type:"video",source:{kind:"file",fileId:Vt.fileId}}):Vt.kind==="file"?Ct.push({type:"file",fileId:Vt.fileId,name:Vt.name??"",mediaType:Vt.mediaType||"application/octet-stream",size:Vt.size??0}):Ct.push({type:"image",source:{kind:"file",fileId:Vt.fileId}});if(Ct.length===0)return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},"rejected";const Ot={id:Ye,sessionId:Q,role:"user",content:Ct,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(Q,Vt=>[...Vt,Ot]);const uo=e.sessions.find(Vt=>Vt.id===Q),jt=(uo?.model&&uo.model.length>0?uo.model:e.defaultModel)??void 0,wn=e.planModeBySession[Q]??!1,ls=e.swarmModeBySession[Q]??!1,Mt=e.goalModeBySession[Q]??!1;if(Mt&&be)try{await st.updateSession(Q,{goalObjective:be.trim()})}catch(Vt){return l("createGoal",Vt,{sessionId:Q}),e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,fo=>fo.some(oo=>oo.id===Ye)?fo.filter(oo=>oo.id!==Ye):fo),"rejected"}const Nt=await st.submitPrompt(Q,{content:Ct,model:jt,thinking:await r.resolveThinkingForPrompt(Q,jt)??e.thinking,permissionMode:e.permission,planMode:wn,swarmMode:ls});return Mt&&(e.goalModeBySession={...e.goalModeBySession,[Q]:!1},z()),e.promptIdBySession={...e.promptIdBySession,[Q]:Nt.promptId},b(Q,Vt=>{const fo=Vt.findIndex(zi=>zi.id===Ye);if(fo===-1)return Vt;const oo=[...Vt];return oo[fo]={...oo[fo],promptId:oo[fo].promptId??Nt.promptId},oo}),m()?.bindNextPromptId(Q,Nt.promptId),"ok"}catch(st){return e.inFlightBySession={...e.inFlightBySession,[Q]:!1},b(Q,Ct=>Ct.some(Ot=>Ot.id===Ye)?Ct.filter(Ot=>Ot.id!==Ye):Ct),l("sendPrompt",st,{sessionId:Q}),vi(st)?"rejected":"uncertain"}finally{ty(Q,Oe)}}async function Do(Q,be){const ke=e.activeSessionId;if(ke){if(a.value!=="idle"||e.inFlightBySession[ke]){kt(Q,be);return}if((e.queuedBySession[ke]?.length??0)>0){kt(Q,be),Ht(ke);return}await Mn(ke,Q,be)}}async function ze(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[],Ye=[],st=[];for(const Nt of Oe){const Vt=Nt.text.trim();Vt&&Ye.push(Vt),Nt.attachments?.length&&st.push(...Nt.attachments)}const Ct=Q.trim();if(Ct&&Ye.push(Ct),be?.length&&st.push(...be),Ye.length===0&&st.length===0)return;Oe.length>0&&(e.queuedBySession={...e.queuedBySession,[ke]:[]});const Ot=Ye.join(`
303
-
304
- `),uo=()=>{if(Oe.length===0)return;const Nt=e.queuedBySession[ke]??[];e.queuedBySession={...e.queuedBySession,[ke]:[...Oe,...Nt]}};if(a.value==="idle"&&!e.inFlightBySession[ke]){await Mn(ke,Ot,st)==="rejected"&&uo();return}const jt=[];Ot&&jt.push({type:"text",text:Ot});for(const Nt of st)Nt.kind==="video"?jt.push({type:"video",source:{kind:"file",fileId:Nt.fileId}}):Nt.kind==="file"?jt.push({type:"file",fileId:Nt.fileId,name:Nt.name??"",mediaType:Nt.mediaType||"application/octet-stream",size:Nt.size??0}):jt.push({type:"image",source:{kind:"file",fileId:Nt.fileId}});const wn=v(),ls={id:wn,sessionId:ke,role:"user",content:jt,createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};b(ke,Nt=>[...Nt,ls]);const Mt=ey(ke);try{const Nt=dt(),Vt=e.sessions.find(zi=>zi.id===ke),fo=(Vt?.model&&Vt.model.length>0?Vt.model:e.defaultModel)??void 0,oo=await Nt.submitPrompt(ke,{content:jt,model:fo,thinking:await r.resolveThinkingForPrompt(ke,fo)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[ke]??!1,swarmMode:e.swarmModeBySession[ke]??!1});if(b(ke,zi=>{const Ul=zi.findIndex(lf=>lf.id===wn);if(Ul===-1)return zi;const ql=[...zi];return ql[Ul]={...ql[Ul],promptId:ql[Ul].promptId??oo.promptId},ql}),oo.status!=="queued"){e.promptIdBySession={...e.promptIdBySession,[ke]:oo.promptId},m()?.bindNextPromptId(ke,oo.promptId);return}try{await Nt.steerPrompts(ke,[oo.promptId])}catch{}}catch(Nt){b(ke,Vt=>Vt.filter(fo=>fo.id!==wn)),vi(Nt)&&uo(),l("steer",Nt,{sessionId:ke})}finally{ty(ke,Mt)}}async function Xe(Q,be){try{const Oe=await dt().uploadFile({file:Q,name:be});return{fileId:Oe.id,name:Oe.name,mediaType:Oe.mediaType}}catch(ke){return l("uploadImage",ke),null}}function kt(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[],Ye={text:Q,attachments:be,id:Ame()};e.queuedBySession={...e.queuedBySession,[ke]:[...Oe,Ye]}}function Ht(Q){const[be,...ke]=e.queuedBySession[Q]??[];be!==void 0&&(e.queuedBySession={...e.queuedBySession,[Q]:ke},Mn(Q,be.text,be.attachments).then(Oe=>{if(Oe==="ok"){da.delete(Q);return}if(Oe==="uncertain"){da.delete(Q);return}if(!e.sessions.some(uo=>uo.id===Q)){da.delete(Q);return}const Ye=be.id??be.text,st=da.get(Q),Ct=st!==void 0&&st.key===Ye?st.count+1:1;if(Ct>=Cme){da.delete(Q),(e.queuedBySession[Q]?.length??0)>0&&Ht(Q);return}da.set(Q,{key:Ye,count:Ct});const Ot=e.queuedBySession[Q]??[];e.queuedBySession={...e.queuedBySession,[Q]:[be,...Ot]}}))}function Rn(Q,be){const ke=e.inFlightBySession[Q]===!0;if(e.inFlightBySession={...e.inFlightBySession,[Q]:!1},e.promptIdBySession[Q]!==void 0){const Ye={...e.promptIdBySession};delete Ye[Q],e.promptIdBySession=Ye}return Q===e.activeSessionId&&J(),(ke||be?.turnWasActive===!0||(e.turnActiveBySession[Q]??!1))&&Ht(Q),ke}function sn(Q,be){be.inFlightTurn!==null&&be.busy||Rn(Q)}async function Gt(){const Q=e.activeSessionId;if(!Q)return;const be=e.sessions.find(Ye=>Ye.id===Q);let ke=e.promptIdBySession[Q];if(ke===void 0){const Ye=be?.currentPromptId;Ye!==void 0&&Ye.length>0&&!Ye.startsWith("pr_")&&(ke=Ye)}const Oe=dt();if(ke!==void 0)try{if((await Oe.abortPrompt(Q,ke)).aborted)return;const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}catch(Ye){if(vi(Ye)&&Ye.code===yme){const st={...e.promptIdBySession};delete st[Q],e.promptIdBySession=st}else{l("abortCurrentPrompt",Ye,{sessionId:Q});return}}try{await Oe.abortSession(Q)}catch(Ye){l("abortCurrentPrompt",Ye,{sessionId:Q})}}function Wn(Q,be){const ke=e.approvalsBySession[Q]??[];e.approvalsBySession={...e.approvalsBySession,[Q]:ke.filter(Oe=>Oe.approvalId!==be)}}function En(Q,be){const ke=e.questionsBySession[Q]??[];e.questionsBySession={...e.questionsBySession,[Q]:ke.filter(Oe=>Oe.questionId!==be)}}async function St(Q,be){const ke=e.activeSessionId;if(ke&&!hh[Q]){hh[Q]=!0;try{const Oe=dt(),Ye={decision:be.decision,scope:be.scope,feedback:be.feedback,selectedLabel:be.selectedLabel};await Oe.respondApproval(ke,Q,Ye),Wn(ke,Q)}catch(Oe){bg(Oe)?Wn(ke,Q):l("respondApproval",Oe,{sessionId:ke})}finally{delete hh[Q]}}}async function Po(Q,be){const ke=e.activeSessionId;if(ke&&!ca[Q]){ca[Q]="answer";try{await dt().respondQuestion(ke,Q,be),En(ke,Q)}catch(Oe){bg(Oe)?En(ke,Q):l("respondQuestion",Oe,{sessionId:ke})}finally{delete ca[Q]}}}async function Ao(Q){const be=e.activeSessionId;if(be&&!ca[Q]){ca[Q]="dismiss";try{await dt().dismissQuestion(be,Q),En(be,Q)}catch(ke){bg(ke)?En(be,Q):l("dismissQuestion",ke,{sessionId:be})}finally{delete ca[Q]}}}async function ss(Q){const be=e.activeSessionId;if(be&&!xg[Q]){xg[Q]=!0;try{const ke=dt(),Oe=(e.tasksBySession[be]??[]).find(st=>st.id===Q)?.backgroundTaskId;await ke.cancelTask(be,Oe??Q);const Ye=e.tasksBySession[be]??[];e.tasksBySession={...e.tasksBySession,[be]:Ye.map(st=>st.id===Q?{...st,status:"cancelled"}:st)}}catch(ke){_me(ke)||l("cancelTask",ke,{sessionId:be})}finally{delete xg[Q]}}}function Tn(Q){const be=e.activeSessionId;be?(e.planModeBySession={...e.planModeBySession,[be]:Q},R(),x({planMode:Q})):H.planMode=Q}function jn(){const Q=e.activeSessionId,be=Q?e.planModeBySession[Q]??!1:H.planMode;Tn(!be)}function Ps(Q){const be=e.activeSessionId;be?(e.swarmModeBySession={...e.swarmModeBySession,[be]:Q},D(),x({swarmMode:Q})):H.swarmMode=Q}async function ti(){const Q=e.activeSessionId,ke=!(Q?e.swarmModeBySession[Q]??!1:H.swarmMode);ke&&e.permission==="manual"&&!await o({title:n("workspace.swarmEnableConfirm"),variant:"primary"})||Ps(ke)}function Io(Q){const be=e.activeSessionId;be?(e.goalModeBySession={...e.goalModeBySession,[be]:Q},z()):H.goalMode=Q}function Ss(){const Q=e.activeSessionId,be=Q?e.goalModeBySession[Q]??!1:H.goalMode;Io(!be)}async function Wi(Q){const be=Q.trim();if(!be||e.permission==="manual"&&!await o({title:n("workspace.goalStartConfirm",{objective:be}),variant:"primary"}))return;let ke=e.activeSessionId;if(!ke){const Oe=e.activeWorkspaceId,Ye=Oe&&E.value.some(st=>st.id===Oe)?Oe:E.value[0]?.id??null;if(!Ye)return;try{ke=await lo(Ye)??void 0}catch(st){l("createGoal",st);return}if(!ke)return}try{await dt().updateSession(ke,{goalObjective:be})}catch(Oe){l("createGoal",Oe,{sessionId:ke,message:V(Oe)});return}e.goalModeBySession[ke]&&(e.goalModeBySession={...e.goalModeBySession,[ke]:!1},z()),e.activeSessionId===ke?await Do(be):await Mn(ke,be)}function Si(Q){const be=e.activeSessionId;be&&Promise.resolve(dt().updateSession(be,{goalControl:Q})).catch(ke=>{l("controlGoal",ke,{sessionId:be,message:V(ke)})})}function co(Q){e.permission=Q,L(Q),x({permissionMode:Q})}function ni(Q){const be=[...e.warnings];be.splice(Q,1),e.warnings=be}async function Ci(Q,be){try{await dt().updateSession(Q,{title:be}),d(Q,Oe=>({...Oe,title:be}))}catch(ke){l("renameSession",ke,{sessionId:Q})}}async function ar(Q,be){const ke=e.workspaces.find(Ye=>Ye.id===Q)?.root,Oe=()=>{e.workspaces=e.workspaces.map(Ye=>Ye.id===Q?{...Ye,name:be}:Ye)};try{if(await dt().updateWorkspace(Q,{name:be}),ke!==void 0){const Ye=zf();ke in Ye&&(delete Ye[ke],ew(Ye))}Oe()}catch(Ye){if(ke!==void 0&&vi(Ye)&&Ye.code===kme){ew({...zf(),[ke]:be}),Oe();return}l("renameWorkspace",Ye)}}async function no(Q){const be=e.workspaces.find(st=>st.id===Q)?.root??I.value.find(st=>st.id===Q)?.root??Q,ke=e.activeSessionId?e.sessions.find(st=>st.id===e.activeSessionId):void 0,Oe=e.activeWorkspaceId===Q||e.activeWorkspaceId===be,Ye=!!(ke&&(ke.cwd===be||ke.workspaceId===Q||S(ke)===Q));be&&!e.hiddenWorkspaceRoots.includes(be)&&(e.hiddenWorkspaceRoots=[...e.hiddenWorkspaceRoots,be],K(e.hiddenWorkspaceRoots));try{await dt().deleteWorkspace(Q)}catch(st){console.warn("[kimi-web] deleteWorkspace registry cleanup failed for",Q,st)}if(e.workspaces=e.workspaces.filter(st=>st.id!==Q&&st.root!==be),Oe||Ye){const st=E.value[0]?.id??null;if(e.activeWorkspaceId=st,st)Z(st);else try{Na(Ft.activeWorkspace)}catch{}}(Oe||Ye)&&(g(void 0),e.sessionLoading=!1,ne(),qn(void 0,"replace"))}async function is(Q){try{await dt().archiveSession(Q),p(Q),i.clearSideChatForSession(Q);const{[Q]:ke,...Oe}=e.sideChatUserMessageIdsBySession;if(e.sideChatUserMessageIdsBySession=Oe,e.activeSessionId===Q){const Ye=e.sessions[0];Ye?await An(Ye.id,{urlMode:"replace"}):(g(void 0),qn(void 0,"replace"))}}catch(be){l("archiveSession",be,{sessionId:Q})}}async function rs(Q){if(Te)return;const be=Q??e.activeSessionId;if(!be){const Oe=n("commands.export.noSession");ko("export:failed",{status:"no-session"}),l("exportSession",new Error(Oe),{message:Oe});return}Te=!0;const ke=Date.now();ko("export:start",{sessionId:be});try{const Oe=Qte(),{blob:Ye,fileName:st}=await dt().exportSession(be,Oe);if(typeof document>"u")throw new Error("Document is unavailable");const Ct=URL.createObjectURL(Ye);let Ot;try{Ot=document.createElement("a"),Ot.href=Ct,Ot.download=st,document.body.append(Ot),Ot.click()}finally{Ot?.remove(),setTimeout(()=>{try{URL.revokeObjectURL(Ct)}catch{}},0)}ko("export:accepted",{sessionId:be,status:"accepted",zipBytes:Ye.size,durationMs:Date.now()-ke})}catch(Oe){const Ye=typeof Oe=="object"&&Oe!==null?Oe:void 0;ko("export:failed",{sessionId:be,status:"failed",durationMs:Date.now()-ke,errorName:typeof Ye?.name=="string"?Ye.name:typeof Oe,errorCode:typeof Ye?.code=="number"?Ye.code:void 0,requestId:typeof Ye?.requestId=="string"?Ye.requestId:void 0,phase:typeof Ye?.phase=="string"?Ye.phase:void 0,httpStatus:typeof Ye?.status=="number"?Ye.status:void 0}),l("exportSession",Oe,{sessionId:be})}finally{Te=!1}}async function Lo(Q){try{const be=await dt().restoreSession(Q);return f(be),!0}catch(be){return l("restoreSession",be,{sessionId:Q}),!1}}function Ai(Q){return dt().listSessions({archivedOnly:!0,beforeId:Q?.beforeId,pageSize:Q?.pageSize??50})}async function zn(){try{await dt().logout(),await ee(),await gt()}catch(Q){l("logout",Q)}}function $o(Q){const be=e.activeSessionId;be&&dt().compactSession(be,Q).catch(ke=>{l("compact",ke,{sessionId:be})})}async function oi(Q){const be=Q??e.activeSessionId;if(be)try{const ke=await dt().forkSession(be);f(ke),await An(ke.id)}catch(ke){l("fork",ke,{sessionId:be})}}async function Ue(Q=1){const be=e.activeSessionId;if(!be)return null;const ke=(()=>{const Oe=e.messagesBySession[be]??[];for(let Ye=Oe.length-1;Ye>=0;Ye--){const st=Oe[Ye];if(st.role==="user"&&!(st.metadata?.origin&&st.metadata.origin.kind!=="user"))return st.content.filter(Ct=>Ct.type==="text").map(Ct=>Ct.text).join(`
305
- `)}return null})();try{return await dt().undoSession(be,Q),await y(be),ke}catch(Oe){return l("undo",Oe,{sessionId:be}),null}}function Fe(Q){const be=e.activeSessionId;if(!be)return;const ke=e.queuedBySession[be]??[];if(Q<0||Q>=ke.length)return;const Oe=[...ke];Oe.splice(Q,1),e.queuedBySession={...e.queuedBySession,[be]:Oe}}function se(Q,be){const ke=e.activeSessionId;if(!ke)return;const Oe=e.queuedBySession[ke]??[];if(Q===be||Q<0||Q>=Oe.length||be<0||be>=Oe.length)return;const Ye=[...Oe],[st]=Ye.splice(Q,1);st!==void 0&&(Ye.splice(be,0,st),e.queuedBySession={...e.queuedBySession,[ke]:Ye})}async function Ne(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().listDirectory(be,{path:Q,includeGitStatus:!0})).items}catch{return[]}}async function he(Q){const be=e.activeSessionId;if(!be)return null;try{const Oe=await dt().readFile(be,{path:Q});return{path:Oe.path,content:Oe.content,encoding:Oe.encoding,mime:Oe.mime,languageId:Oe.languageId,isBinary:Oe.isBinary,size:Oe.size,lineCount:Oe.lineCount}}catch(ke){return console.warn("[kimi-web] readFileContent failed for",Q,ke),null}}const we=10485760;function He(Q){const be=e.activeSessionId;return be?dt().getFileDownloadUrl(be,Q):null}async function Rt(Q,be){const ke=e.activeSessionId;if(!ke)return!1;try{return await dt().openFile(ke,{path:Q,line:be}),!0}catch(Oe){return l("openFile",Oe,{sessionId:ke}),!1}}async function Dt(Q){const be=e.activeSessionId;if(!be)return;const ke=F.value.cwd||".";try{await dt().openInApp(be,Q,ke)}catch(Oe){l("openInApp",Oe,{sessionId:be})}}async function rn(Q){const be=e.activeSessionId;if(!be)return!1;try{return await dt().revealFile(be,{path:Q}),!0}catch(ke){return l("revealFile",ke,{sessionId:be}),!1}}async function Un(Q){if(/^(https?:|data:|blob:)/i.test(Q))return Q;const be=e.activeSessionId;if(!be)return Q;let ke=Q;if(ke.startsWith("/")){const Oe=e.sessions.find(Ye=>Ye.id===be)?.cwd;if(Oe&&(ke===Oe||ke.startsWith(Oe.endsWith("/")?Oe:`${Oe}/`))){if(ke=ke.slice(Oe.length).replace(/^\//,""),!ke)return Q}else return Q}try{const Ye=await dt().readFile(be,{path:ke,length:we});return!Ye.isBinary||Ye.encoding!=="base64"||Ye.truncated?Q:`data:${Ye.mime};base64,${Ye.content}`}catch{return Q}}async function Cs(Q){const be=e.activeSessionId;if(!be)return[];try{return(await dt().searchFiles(be,{query:Q,limit:20})).items.map(Ye=>({path:Ye.path,name:Ye.name}))}catch{return[]}}return{loadFileDiff:le,clearFileDiff:ne,loadGitStatus:q,checkAuth:ee,loadConfig:de,updateConfig:ve,listAllSessionsGlobal:Ce,load:gt,refreshServerMeta:_t,loadWorkspaces:It,loadMoreSessions:et,loadAllSessions:rt,selectWorkspace:ht,openWorkspace:un,upsertWorkspacePreserveOrder:dn,applyWorkspaceEvent:ns,clearActiveSession:Wt,openWorkspaceDraft:Hn,startSessionAndSendPrompt:it,startSessionAndActivateSkill:Gn,startSessionAndOpenSideChat:ao,addWorkspaceByPath:Yn,browseFs:go,getFsHome:os,writeSessionUrl:qn,fetchSessionIntoList:to,onSessionRoutePopState:vn,bindSessionRoute:xn,selectSession:An,submitPromptInternal:Mn,finishPromptLocal:Rn,localTurnStartState:Mme,isLocalTurnSnapshotCurrent:Tme,afterLocalTurnStartsSettle:Nme,handleSessionSnapshot:sn,sendPrompt:Do,steerPrompt:ze,uploadImage:Xe,enqueue:kt,unqueue:Fe,reorderQueue:se,abortCurrentPrompt:Gt,respondApproval:St,respondQuestion:Po,dismissQuestion:Ao,pendingQuestionActions:ca,pendingApprovalActions:hh,cancelTask:ss,setPlanMode:Tn,togglePlanMode:jn,setSwarmMode:Ps,toggleSwarmMode:ti,setGoalMode:Io,toggleGoalMode:Ss,createGoal:Wi,controlGoal:Si,setPermission:co,dismissWarning:ni,renameSession:Ci,renameWorkspace:ar,deleteWorkspace:no,archiveSession:is,exportSession:rs,restoreSession:Lo,loadArchivedSessions:Ai,logout:zn,compact:$o,forkSession:oi,undo:Ue,listDir:Ne,readFileContent:he,getFileDownloadUrl:He,openWorkspaceFile:Rt,openInApp:Dt,revealWorkspaceFile:rn,resolveImageUrl:Un,searchFiles:Cs,loadOlderMessages:Ae,refreshSessionSidecars:P,isStartingFirstPrompt:()=>Yi.size>0}}const j5=Ft.starredModels,n4=new Error("profile persist failed");function Lme(){try{const e=mo(j5);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function $me(e){try{So(j5,JSON.stringify(e))}catch{}}function Fme(e,t){const{pushOperationFailure:n,refreshSessionStatus:o,persistSessionProfile:s,activity:i,updateSession:r,updateSessionMessages:l}=t,a=X([]),c=X(Lme()),u=X({}),d=X({}),f=X([]),h=X(null);function p(V){if(!(V==null||V.length===0))return a.value.find(J=>J.id===V)??a.value.find(J=>J.model===V)}function g(){const V=e.activeSessionId?e.sessions.find(fe=>fe.id===e.activeSessionId):void 0,J=V===void 0?h.value??e.defaultModel:V.model||e.defaultModel;return p(J)?.id??J??void 0}function b(V){if(V===void 0)return;const J=p(V);return J===void 0?void 0:Pd(J)}function v(V,J){const fe=V==null?void 0:e.thinkingBySession[V];return fe!==void 0&&xre(J,fe)?fe:Pd(J)}function m(V,J){if(J===void 0)return;const fe=p(J);return fe===void 0?void 0:v(V,fe)}async function y(V,J){return V!=null&&e.thinkingBySession[V]===void 0&&await o(V),m(V,J)}function k(V){e.thinking=V;const J=e.activeSessionId;return V!==void 0&&J!==null&&J!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:V}),V}Qe([()=>e.activeSessionId,()=>g(),()=>{const V=e.activeSessionId;return V==null?void 0:e.thinkingBySession[V]}],()=>{const V=p(g());V!==void 0&&(e.thinking=v(e.activeSessionId,V))});function A(V){dt().setConfig({thinking:wre(V,p(g())?.supportEfforts)}).catch(J=>n("setConfig",J))}async function $(V){try{const fe=await dt().listSkills(V);u.value={...u.value,[V]:fe}}catch{}}async function N(V){try{const fe=await dt().listSkillsForWorkspace(V);d.value={...d.value,[V]:fe}}catch{}}async function x(){try{const V=dt();a.value=await V.listModels();const J=p(g());J!==void 0&&(e.thinking=v(e.activeSessionId,J))}catch(V){n("loadModels",V)}}async function I(){try{const V=dt();f.value=await V.listProviders()}catch(V){n("loadProviders",V)}}async function E(V){const J=e.activeSessionId,fe=p(V),oe=e.thinking,ce=J?e.sessions.find(Te=>Te.id===J)?.model:void 0,ue=g()!==(fe?.id??V),Se=_re(fe,oe,ue);if(!J)return h.value=V,e.thinking=Se,Se!==oe&&Se!==void 0&&A(Se),!0;r(J,Te=>({...Te,model:V})),Se!==oe&&(e.thinking=Se,Se!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:Se}));try{await dt().updateSession(J,{model:V,thinking:Se!==oe?Se:void 0})}catch(Te){return r(J,Ae=>({...Ae,model:ce??Ae.model})),Se!==oe&&(e.thinking=oe,oe!==void 0&&(e.thinkingBySession={...e.thinkingBySession,[J]:oe})),n("setModel",Te,{sessionId:J}),!1}return Se!==oe&&Se!==void 0&&A(Se),await o(J),!0}function F(V){const J=new Set(c.value);J.has(V)?J.delete(V):J.add(V),c.value=Array.from(J),$me(c.value)}async function S(V,J,fe){const oe=fe??e.activeSessionId;if(!oe)return;const ce=i.value==="idle"&&!e.inFlightBySession[oe],ue=`msg_skill_opt_${Date.now().toString(36)}`,Se=ce?ey(oe):void 0;if(ce){e.inFlightBySession={...e.inFlightBySession,[oe]:!0};const Te={id:ue,sessionId:oe,role:"user",content:[{type:"text",text:`/${V}${J?` ${J}`:""}`}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:V,skillArgs:J}}};l(oe,Ae=>[...Ae,Te])}try{const Te=e.sessions.find(le=>le.id===oe)?.model,Ae=(Te&&Te.length>0?Te:e.defaultModel)??void 0;if(!await s({thinking:await y(oe,Ae)??e.thinking},oe))throw n4;await dt().activateSkill(oe,V,J)}catch(Te){ce&&(e.inFlightBySession={...e.inFlightBySession,[oe]:!1},l(oe,Ae=>Ae.filter(P=>P.id!==ue))),Te!==n4&&n("activateSkill",Te,{sessionId:oe})}finally{Se!==void 0&&ty(oe,Se)}}async function L(V){try{await dt().addProvider(V),await Promise.all([I(),x()])}catch(J){n("addProvider",J)}}async function R(V){try{await dt().deleteProvider(V),await Promise.all([I(),x()])}catch(J){n("deleteProvider",J)}}async function D(V){try{const J=await dt().refreshProvider(V);for(const fe of J.failed)n("refreshProvider",new Error(fe.reason),{message:fe.provider});await Promise.all([I(),x()])}catch(J){n("refreshProvider",J)}}async function z(){try{const V=await dt().refreshAllProviders();for(const J of V.failed)n("refreshAllProviders",new Error(J.reason),{message:J.provider});await Promise.all([I(),x()])}catch(V){n("refreshAllProviders",V)}}async function H(){try{return await dt().startOAuthLogin()}catch{return null}}async function U(){try{return await dt().pollOAuthLogin()}catch(V){return console.warn("[kimi-web] pollOAuthLogin failed",V),null}}async function Z(){try{await dt().cancelOAuthLogin()}catch{}}function K(V){const J=k(V);s({thinking:J}),J!==void 0&&A(J)}return{models:a,starredModelIds:c,providers:f,draftModel:h,skillsBySession:u,skillsByWorkspace:d,loadSkillsForSession:$,loadSkillsForWorkspace:N,loadModels:x,loadProviders:I,setModel:E,thinkingLevelForModelId:b,thinkingLevelForSessionId:m,resolveThinkingForPrompt:y,toggleStarModel:F,activateSkill:S,addProvider:L,deleteProvider:R,refreshProvider:D,refreshAllProviders:z,startOAuthLogin:H,pollOAuthLogin:U,cancelOAuthLogin:Z,setThinking:K}}const V5="kimiWeb.compaction",Ome=/^read[_-]?media(?:file)?$/i,Rme=/^data:([^;]+);base64,(.*)$/s,Bme=/^<(image|video|audio)\s+path="([^"]+)">$/,Dme=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Pme=/Mime type:\s*([^.\s]+)/i,Hme=/Size:\s*(\d+)\s*bytes/i,Wme=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,zme="<system>Image compressed to fit model limits:",Ume=/<system>Image compressed to fit model limits:[\s\S]*?<\/system>/g;function qme(e){return e.includes(zme)?e.replace(Ume,""):e}function jme(e){return e.replaceAll("&quot;",'"').replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function Vme(e){const t=Dme.exec(e.trim());return t?{kind:t[1],path:jme(t[2])}:null}const K5=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Kme=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})(?=-)/;function Gme(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),o=n>0?t.slice(0,n):t;return K5.test(o)?o:void 0}const Yme=/^Attached file "(.+)" \(([^,]+), (\d+) bytes\): (.+) — open it with the Read tool$/;function Zme(e){const t=Yme.exec(e.trim());if(!t)return null;const n=(t[4]??"").split(/[\\/]/).at(-1)??"",o=Kme.exec(n)?.[0];return{name:t[1],mediaType:t[2],size:Number(t[3]),fileId:o!==void 0&&K5.test(o)?o:void 0}}function Qme(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 Xme(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 Jme(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 e1e(e,t){if(!Ome.test(e))return;const n=Xme(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=Bme.exec(h);p&&(s=p[1],o=p[2]);const g=Pme.exec(h);g?.[1]&&(i=g[1]);const b=Hme.exec(h);b?.[1]&&(r=Number(b[1]));const v=Wme.exec(h);v?.[1]&&v[2]&&(l=`${v[1]}x${v[2]}`);continue}const f=Jme(d);f&&(a=f)}if(a===null)return;const c=Rme.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Qme(c[2])),{kind:a.kind??s??"image",url:a.url,path:o,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function t1e(e){if(e!=null){if(typeof e=="string")return e.split(`
306
- `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
307
- `));else if(n&&typeof n=="object"){const o=n;o.type==="text"&&typeof o.text=="string"?t.push(...o.text.split(`
308
- `)):o.type==="think"&&typeof o.think=="string"?t.push(...o.think.split(`
309
- `)):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 n1e(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 o1e(e,t){const n=e.split(`
310
- `),o=t.split(`
311
- `),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 s1e(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:o1e(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 i1e(e){const t=`<prompt>
312
- `,n=`
313
- </prompt>`,o=e.indexOf(t),s=e.lastIndexOf(n);return o>=0&&s>=o+t.length?e.slice(o+t.length,s):r1e(e)}function r1e(e){const t=e.split(`
314
- `);return t.length>=2&&t[0]?.startsWith("<cron-fire ")&&t.at(-1)==="</cron-fire>"?t.slice(1,-1).join(`
315
- `):e}function l1e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function a1e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
316
- `);return i1e(t)}function c1e(e,t){const n=e.metadata?.origin??{},o=a1e(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 u1e(e,t,n){const{text:o,cron:s}=c1e(e,n);return{id:e.id,role:"cron",no:t,text:o,createdAt:e.createdAt,cron:s}}function d1e(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 f1e(e){return e.metadata?.origin?.kind==="compaction_summary"}function h1e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function p1e(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 m1e(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 g1e(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 G5(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 g=0;g<p.tools.length;g++){const b=p.tools[g];if(b.status!=="running")continue;const v={...b,status:"ok"};p.tools[g]=v;const m=p.blocks.find(y=>y.kind==="tool"&&y.tool.id===v.id);m&&m.kind==="tool"&&(m.tool=v)}i.push({id:p.id,role:"assistant",no:r++,text:p.textParts.join(`
317
- `),thinking:p.thinkingParts.length>0?p.thinkingParts.join(`
318
- `):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 g of p)if(g.type==="text"){if(g.text){h.textParts.push(g.text);const b=h.blocks.at(-1);b&&b.kind==="text"?b.text+=`
319
- `+g.text:h.blocks.push({kind:"text",text:g.text})}}else if(g.type==="thinking"){if(g.thinking){h.thinkingParts.push(g.thinking);const b=h.blocks.at(-1);b&&b.kind==="thinking"?b.thinking+=`
320
- `+g.thinking:h.blocks.push({kind:"thinking",thinking:g.thinking})}}else if(g.type==="toolUse"){const b=l.get(g.toolCallId),v={id:g.toolCallId,name:g.toolName,arg:typeof g.input=="string"?g.input:JSON.stringify(g.input),status:"running",output:g.outputLines,planPath:g.toolName==="ExitPlanMode"?s[g.toolCallId]?.path:void 0};h.tools.push(v),h.blocks.push({kind:"tool",tool:v}),b&&(h.approval=s1e(b),h.approvalId=b.approvalId)}else if(g.type==="toolResult"){const b=h.tools.findIndex(v=>v.id===g.toolCallId);if(b!==-1){const v=h.tools[b],m={...v,status:g.isError?"error":"ok",output:t1e(g.output),media:g.isError?void 0:e1e(v.name,g.output)};m.name==="ExitPlanMode"&&!m.planPath&&(m.planPath=p1e(m.output)),h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}}function d(h,p){for(const g of p){if(g.type!=="toolUse"||!g.outputLines?.length)continue;const b=h.tools.findIndex(k=>k.id===g.toolCallId);if(b===-1)continue;const v=h.tools[b];if(v.output!==void 0)continue;const m={...v,output:g.outputLines};h.tools[b]=m;const y=h.blocks.find(k=>k.kind==="tool"&&k.tool.id===g.toolCallId);y&&y.kind==="tool"&&(y.tool=m)}}function f(h){if(h.type==="image"||h.type==="video"){const p=h.type,g=h.source;if(g.kind==="url")return{url:g.url,kind:p};if(g.kind==="base64")return{url:`data:${g.mediaType};base64,${g.data}`,kind:p};if(g.kind==="file"&&n)return{url:n(g.fileId),kind:p,fileId:g.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(f1e(h)){c();const m=h.metadata?.[V5];i.push({id:h.id,role:"compaction",no:r,text:h.content.filter(y=>y.type==="text").map(y=>y.text).join(`
321
- `),compaction:{trigger:m?.trigger,tokensBefore:m?.tokensBefore,tokensAfter:m?.tokensAfter}});continue}if(h.role==="user"){const m=l1e(h);if(c(),m!==void 0){i.push(u1e(h,r++,m));continue}if(!d1e(h))continue;const y=h.metadata?.origin,k=y?.kind==="skill_activation"&&y?.trigger==="user-slash",A=y?.kind==="plugin_command"&&y?.trigger==="user-slash",$=[],N=[];for(const x of h.content){if(x.type==="text")if(k)$.push(y.skillArgs??"");else if(A)$.push(y.commandArgs??"");else{const E=Vme(x.text);if(E&&(E.kind==="video"||E.kind==="image")&&n){const L=Gme(E.path);if(L){N.push({url:n(L),kind:E.kind,fileId:L});continue}}const F=Zme(x.text);if(F){N.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=qme(x.text);if(S!==x.text&&S.trim().length===0)continue;$.push(S)}const I=f(x);if(I){N.push({url:I.url,kind:I.kind,name:x.type==="file"?x.name:void 0,fileId:I.fileId});continue}x.type==="file"&&n&&N.push({kind:"file",url:n(x.fileId),fileId:x.fileId,name:x.name,mediaType:x.mediaType||void 0,size:x.size})}i.push({id:h.id,role:"user",no:r++,text:$.join(`
322
- `),attachments:N.length>0?N:void 0,skillActivation:k?{name:y.skillName,args:y.skillArgs}:void 0,pluginCommand:A?{pluginId:y.pluginId,commandName:y.commandName,args:y.commandArgs}:void 0,createdAt:h.createdAt});continue}if(h.role==="tool"){a&&u(a,h.content);continue}const p=h.promptId;h1e(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 b=a;if(b===null)continue;const v=m1e(h.content);if(b.promptId!==void 0&&b.foldedSigs.some(m=>g1e(m,v))){d(b,h.content);continue}b.foldedSigs.push(v),u(b,h.content)}return c(!0),i}function v1e(e,t){const{pushOperationFailure:n,nextOptimisticMsgId:o,connectEventsIfNeeded:s,getEventConn:i,resolveThinkingForPrompt:r}=t,l=X({}),a=B(()=>{const E=e.activeSessionId;if(!E)return null;const F=l.value[E];return F?{parentId:E,agentId:F.agentId}:null}),c=B(()=>a.value?.parentId??null),u=B(()=>a.value!==null),d=B(()=>{const E=a.value;return E?!!e.sideChatSendingByAgent[E.agentId]:!1}),f=B(()=>{const E=a.value;return E?e.sideChatSendingByAgent[E.agentId]?!0:(e.tasksBySession[E.parentId]??[]).some(F=>F.id===E.agentId&&F.status==="running"):!1}),h=B(()=>{const E=a.value;if(!E)return[];const F=e.sideChatMessagesByAgent[E.agentId]??[];return G5(F,[],S=>dt().getFileUrl(S),f.value)});function p(E,F){e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[E]:F(e.sideChatMessagesByAgent[E]??[])}}function g(E,F){p(E,S=>[...S,F])}function b(E){p(E,F=>{const S=[...F].reverse().findIndex(R=>R.role==="user");if(S===-1)return F;const L=F.length-1-S;return F.filter((R,D)=>D!==L)})}function v(E,F){p(E,S=>{const L=[...S];for(let R=L.length-1;R>=0;R-=1){const D=L[R];if(D.role==="user")return L[R]={...D,promptId:D.promptId??F},L}return S})}function m(E,F,S){S&&p(E,L=>{const R=L.at(-1);if(R?.role==="assistant"){const D=R.content[0],z=D?.type==="text"?D.text:"";return[...L.slice(0,-1),{...R,content:[{type:"text",text:`${z}${S}`}]}]}return[...L,{id:o(),sessionId:F,role:"assistant",content:[{type:"text",text:S}],createdAt:new Date().toISOString()}]})}function y(E,F,S){if(e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[E]:!1},!S)return;const R=(e.sideChatMessagesByAgent[E]??[]).at(-1);(R?.role==="assistant"&&R.content[0]?.type==="text"?R.content[0].text:"").trim().length>0||m(E,F,S)}async function k(E){const F=e.activeSessionId;F&&await A(F,E)}async function A(E,F){if(!l.value[E]){let S;try{({agentId:S}=await dt().startBtw(E))}catch(L){n("openSideChat",L,{sessionId:E});return}e.sideChatMessagesByAgent={...e.sideChatMessagesByAgent,[S]:e.sideChatMessagesByAgent[S]??[]},l.value={...l.value,[E]:{agentId:S}},s(),i()?.markSideChannelAgent(S)}F&&F.trim()&&await $(E,F.trim())}async function $(E,F){const S=l.value[E],L=F.trim();if(!S||!L)return;const R=E,D=S.agentId;e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!0};const z={id:o(),sessionId:R,role:"user",content:[{type:"text",text:L}],createdAt:new Date().toISOString(),metadata:{"kimiWeb.optimisticUserMessage":!0}};g(D,z);try{const H=e.sessions.find(K=>K.id===R),U=(H?.model&&H.model.length>0?H.model:e.defaultModel)??void 0,Z=await dt().submitPrompt(R,{content:[{type:"text",text:L}],agentId:D,model:U,thinking:await r(R,U)??e.thinking,permissionMode:e.permission,planMode:e.planModeBySession[R]??!1,swarmMode:e.swarmModeBySession[R]??!1});v(D,Z.promptId),e.sideChatUserMessageIdsBySession={...e.sideChatUserMessageIdsBySession,[R]:[...e.sideChatUserMessageIdsBySession[R]??[],Z.userMessageId]}}catch(H){n("sendSideChatPrompt",H,{sessionId:R}),b(D),e.sideChatSendingByAgent={...e.sideChatSendingByAgent,[D]:!1}}}function N(){const E=e.activeSessionId;if(!E)return;const{[E]:F,...S}=l.value;l.value=S}async function x(E){const F=a.value;F&&await $(F.parentId,E)}function I(E){if(!l.value[E])return;const{[E]:F,...S}=l.value;l.value=S}return{sideChatTargetBySession:l,sideChatSessionId:c,sideChatVisible:u,sideChatSending:d,sideChatRunning:f,sideChatTurns:h,appendSideChatAssistantText:m,finishSideChatAgent:y,openSideChat:k,openSideChatOn:A,closeSideChat:N,sendSideChatPrompt:x,clearSideChatForSession:I}}const y1e="kimiWeb.optimisticUserMessage",o4="Sub Agent";function k1e(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},compactionBySession:{},warnings:[]}}function b1e(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 x1e(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 wg(e){return e.role==="user"&&e.metadata?.[y1e]===!0}function w1e(e){const t=e.metadata?.origin;return t?.kind==="cron_job"||t?.kind==="cron_missed"}function _1e(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}const S1e=/^<(image|video|audio)\s+path="[^"]+"><\/\1>$/;function s4(e){let t="",n=0;for(const o of e.content)o.type==="text"?S1e.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 C1e(e,t){const n=s4(e),o=s4(t);return n.text===o.text&&n.media===o.media}function A1e(e,t){const n=t.promptId;if(n!==void 0)for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&s.promptId===n)return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&_1e(s,t))return o}for(let o=e.length-1;o>=0;o--){const s=e[o];if(wg(s)&&C1e(s,t))return o}return-1}function M1e(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 E1e={"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 T1e(e){const t=_n.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?E1e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${i}`),message:e.message,details:n.length>0?n:void 0}}function N1e(e,t,n){const o=b1e(e);switch(x1e(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"},[V5]: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"&&!w1e(t.message)){const a=A1e(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]=M1e(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===o4&&a.description!==o4?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,T1e(s)];else if(s&&s._agentWarning){const i=s.message??s.code??"agent warning";o.warnings=[...o.warnings,`${_n.global.t("warnings.noteLabel")}: ${i}`]}else{const i=s?.type??"(unknown)";o.warnings=[...o.warnings,`Unhandled event: ${i}`]}break}}return o}function I1e(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function L1e(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"||Da(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:I1e(a.status)}]:[]})}}return[]}const $1e=["queued","working","suspended","completed","failed"];function Y5(e){return e.status==="completed"?"completed":e.status==="failed"||e.status==="cancelled"?"failed":e.subagentPhase?e.subagentPhase:"working"}function F1e(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function O1e(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:Y5(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=F1e();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 R1e(e){let t=0,n=0;for(const o of e){n+=o.members.length;for(const s of $1e)(s==="completed"||s==="failed")&&(t+=o.counts[s])}return{done:t,total:n}}function B1e(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:Y5(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 Cr=z5(),Ji=nme(),Hd=ume(),Z5=Ft.permission,Q5=Ft.activeWorkspace,X5=Ft.planMode,J5=Ft.swarmMode,e8=Ft.goalMode,i4=40401,t8=Ft.onboarded;Na(Ft.codeFont);Na(Ft.theme);Na(Ft.thinking);function D1e(){try{const e=mo(Z5);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function P1e(e){try{So(Z5,e)}catch{}}function _g(e){const t=mo(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 i2(e,t){try{const n={};for(const[o,s]of Object.entries(t))s&&(n[o]=!0);So(e,JSON.stringify(n))}catch{}}function n8(){i2(X5,ye.planModeBySession)}function o8(){i2(J5,ye.swarmModeBySession)}function s8(){i2(e8,ye.goalModeBySession)}function H1e(){try{return mo(Q5)}catch{return null}}const i8=Ft.hiddenWorkspaces;function W1e(){try{const e=mo(i8);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function z1e(e){try{So(i8,JSON.stringify(e))}catch{}}function U1e(e){try{So(Q5,e)}catch{}}function q1e(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 ye=Bo({...k1e(),connected:!1,serverVersion:"",dangerousBypassAuth:!1,backend:"v1",workspaceName:"kimi-web",connection:"disconnected",permission:D1e(),thinking:void 0,thinkingBySession:{},planModeBySession:_g(X5),swarmModeBySession:_g(J5),goalModeBySession:_g(e8),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},inFlightBySession:{},unreadBySession:Dy(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:H1e(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:W1e(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{},sessionsHasMoreByWorkspace:{},sessionsLoadingMoreByWorkspace:{},sessionsCursorByWorkspace:{},sessionsInitialCountByWorkspace:{},sessionsFullyLoaded:!1}),Zm=Bo({planMode:!1,swarmMode:!1,goalMode:!1});function r8(e){ye.sessions=e}function Qm(e,t){ye.sessions=ye.sessions.map(n=>n.id===e?t(n):n)}function j1e(e){ye.sessions=[e,...ye.sessions.filter(t=>t.id!==e.id)]}function V1e(e){ye.sessions=[...ye.sessions,e]}function K1e(e){ye.sessions=ye.sessions.filter(t=>t.id!==e)}function l8(){const e=ye.activeSessionId;e&&ye.unreadBySession[e]&&typeof document<"u"&&document.visibilityState==="visible"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!1},Py({[e]:!1}))}typeof window<"u"&&window.addEventListener("storage",e=>{e.key===Ft.unread&&(ye.unreadBySession=Dy(),l8())});function ny(){if(xi===null||!xi.health().stale)return;ko("ws:stale-reconnect",{sessionId:ye.activeSessionId,status:"stale"}),Er("ws: stale socket on focus, reconnecting",{activeSessionId:ye.activeSessionId}),xi.reconnect();const e=ye.activeSessionId;e&&Vp.request(e)}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(l8(),ny())});typeof window<"u"&&(window.addEventListener("focus",ny),window.addEventListener("online",ny));function r2(e){ye.activeSessionId=e}function G1e(e){ye.messagesBySession=e}function Y1e(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t}}function a8(e,t){ye.messagesBySession={...ye.messagesBySession,[e]:t(ye.messagesBySession[e]??[])}}function Z1e(e){const{[e]:t,...n}=ye.messagesBySession;ye.messagesBySession=n}function c8(e){xi?.unsubscribe(e),b0e(e),qp.discard(({meta:t})=>t.sessionId===e),K1e(e),Z1e(e),delete ye.approvalsBySession[e],delete ye.questionsBySession[e],delete ye.tasksBySession[e],delete ye.goalBySession[e],delete ye.gitStatusBySession[e],delete ye.lastSeqBySession[e],delete ye.compactionBySession[e],delete ye.messagesLoadingMoreBySession[e],delete ye.messagesHasMoreBySession[e],delete ye.messagesLoadMoreErrorBySession[e],delete oy[e],jp.delete(e),Bh.delete(e),x8.delete(e),Eme(e),delete ye.queuedBySession[e],delete ye.promptIdBySession[e],delete ye.inFlightBySession[e],delete ye.turnActiveBySession[e],delete ye.planModeBySession[e],delete ye.swarmModeBySession[e],delete ye.goalModeBySession[e],delete ye.thinkingBySession[e],n8(),o8(),s8()}const u8=X(null),d8=X([]),f8=X(!1),h8=X(!1),p8=X(null);async function of(e){let t;try{t=await dt().getSessionStatus(e)}catch{return}Qm(e,n=>({...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}})),ye.swarmModeBySession={...ye.swarmModeBySession,[e]:t.swarmMode},ye.planModeBySession={...ye.planModeBySession,[e]:t.planMode},t.thinkingEffort.length>0&&(ye.thinkingBySession={...ye.thinkingBySession,[e]:t.thinkingEffort})}async function Q1e(e){const t=ye.goalVersionBySession[e]??0;let n;try{n=await dt().getSessionGoal(e)}catch{return}if((ye.goalVersionBySession[e]??0)!==t)return;const o={...ye.goalBySession};n===null||n.status==="complete"?delete o[e]:o[e]=n,ye.goalBySession=o}function m8(e,t){const n=t??ye.activeSessionId;return n?Promise.resolve(dt().updateSession(n,e)).then(()=>of(n)).then(()=>!0).catch(o=>(sf("persistSessionProfile",o,{sessionId:n}),!1)):Promise.resolve(!1)}const g8=Ft.conversationToc;function X1e(){try{const e=mo(g8);return e===null?!0:e==="true"}catch{return!0}}function J1e(e){try{So(g8,e?"true":"false")}catch{}}const v8=X(X1e());function e0e(e){v8.value=e,J1e(e)}function t0e(e){try{return mo(e)??""}catch{return""}}const y8=X(t0e(t8)==="1");function n0e(e){y8.value=e;try{So(t8,e?"1":"0")}catch{}}let xi=null,r4=0;function k8(){return r4+=1,`msg_opt_${Date.now().toString(36)}_${r4}`}function o0e(e,t,n){const o={sessions:ye.sessions,activeSessionId:ye.activeSessionId,messagesBySession:ye.messagesBySession,approvalsBySession:ye.approvalsBySession,planReviewByToolCallId:ye.planReviewByToolCallId,questionsBySession:ye.questionsBySession,tasksBySession:ye.tasksBySession,goalBySession:ye.goalBySession,goalVersionBySession:ye.goalVersionBySession,lastSeqBySession:ye.lastSeqBySession,turnActiveBySession:ye.turnActiveBySession,compactionBySession:ye.compactionBySession,config:ye.config,warnings:ye.warnings},s=N1e(o,e,{sessionId:t,seq:n});r8(s.sessions),r2(s.activeSessionId),G1e(s.messagesBySession),ye.approvalsBySession=s.approvalsBySession,ye.planReviewByToolCallId=s.planReviewByToolCallId,ye.questionsBySession=s.questionsBySession,ye.tasksBySession=s.tasksBySession,ye.goalBySession=s.goalBySession,ye.goalVersionBySession=s.goalVersionBySession,ye.lastSeqBySession=s.lastSeqBySession,ye.turnActiveBySession=s.turnActiveBySession,ye.compactionBySession=s.compactionBySession,ye.config=s.config??null,ye.warnings=s.warnings,e.type==="configChanged"&&(ye.defaultModel=e.config.defaultModel??null),e.type==="modelCatalogChanged"&&(In.loadModels(),In.loadProviders()),e.type==="sessionUsageUpdated"&&(e.swarmMode!==void 0&&(ye.swarmModeBySession={...ye.swarmModeBySession,[e.sessionId]:e.swarmMode}),e.planMode!==void 0&&(ye.planModeBySession={...ye.planModeBySession,[e.sessionId]:e.planMode}),e.thinking!==void 0&&(ye.thinkingBySession={...ye.thinkingBySession,[e.sessionId]:e.thinking}))}function s0e(e,t){const n=ye.lastSeqBySession[t.sessionId]??0,o=ye.turnActiveBySession[t.sessionId]??!1;o0e(e,t.sessionId,t.seq);const s=fs.sideChatTargetBySession.value[t.sessionId];if(s){const{agentId:i}=s,r=t.sessionId;e.type==="agentDelta"&&e.agentId===i?e.delta.text&&fs.appendSideChatAssistantText(i,r,e.delta.text):e.type==="agentTurnEnded"&&e.agentId===i?fs.finishSideChatAgent(i,r):e.type==="taskProgress"&&e.taskId===i?fs.appendSideChatAssistantText(i,r,e.outputChunk):e.type==="taskCompleted"&&e.taskId===i&&fs.finishSideChatAgent(i,r,e.outputPreview)}if(e.type==="messageCreated"&&e.message.role==="user"&&e.message.promptId!==void 0){const i=e.message.sessionId;ye.promptIdBySession[i]!==e.message.promptId&&(ye.promptIdBySession={...ye.promptIdBySession,[i]:e.message.promptId})}if(e.type==="assistantDelta"&&t.sessionId===ye.activeSessionId&&Cr.recordMoonDelta((e.delta.text?.length??0)+(e.delta.thinking?.length??0)),e.type==="turnActiveChanged"&&!e.active&&t.seq>n){const i=e.reason;Age(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&&Cge(e.sessionId),(e.type==="promptAborted"||e.type==="promptCompleted"&&e.reason==="blocked")&&t.seq>n&&ye.promptIdBySession[e.sessionId]===e.promptId&&ut.finishPromptLocal(e.sessionId),e.type==="questionRequested"&&Mge(e.sessionId,e.question),e.type==="approvalRequested"&&Ege(e.sessionId,e.approval)}const qp=Spe(({appEvent:e,meta:t})=>s0e(e,t),({appEvent:e})=>bpe(e),{coalesce:Ape});function b8(){if(xi!==null||typeof WebSocket>"u")return;ko("ws:connection",{status:"connecting"}),ye.connection="connecting",xi=dt().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){ut.applyWorkspaceEvent(t);return}for(const o of Cpe({appEvent:t,meta:n}))qp(o)},onResync(t,n,o){ko("ws:resync",{sessionId:t,status:"required",seq:n}),qp.flush(),jp.add(t),Vp.request(t)},onError(t,n,o){ko("ws:error",{status:"failed",errorCode:t,fatal:o}),l2({severity:"error",title:_n.global.t("warnings.wsTitle"),message:n,details:[Qn("message",n)].filter(s=>s!==void 0)})},onConnectionChange(t){ko("ws:connection",{status:t?"connected":"disconnected"}),ye.connected=t,ye.connection=t?"connected":"disconnected",t&&(f0e(),ut.refreshServerMeta())}})}const oy={},jp=new Set,Bh=new Set,x8=new Set;function i0e(e){return vi(e)&&e.code===i4?!0:typeof e=="object"&&e!==null&&e.code===i4}function Qn(e,t){if(!(t==null||t===""))return{label:_n.global.t(`warnings.details.${e}`),value:w8(t)}}function w8(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 r0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function l0e(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function a0e(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function c0e(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function l4(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function u0e(e,t,n){const o=$k(t),s=vi(t),i=o||s?t.timestamp:void 0,r=o||s?t.durationMs:void 0,l=[Qn("operation",e),Qn("sessionId",n??ye.activeSessionId),Qn("connection",ye.connection),Qn("timestamp",c0e(i??Date.now()))];return o?l.push(Qn("duration",l4(r)),Qn("request",`${t.method} ${t.path}`),Qn("endpoint",t.url),Qn("requestId",t.requestId),Qn("phase",t.phase),Qn("timeout",`${t.timeoutMs}ms`),Qn("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Qn("contentType",t.contentType),Qn("responsePreview",t.bodyPreview),Qn("cause",t.cause)):s?l.push(Qn("duration",l4(r)),Qn("code",t.code),Qn("requestId",t.requestId),Qn("message",t.message),Qn("details",t.details)):l.push(Qn("errorName",r0e(t)),Qn("message",l0e(t)??w8(t)),Qn("stack",a0e(t))),l.filter(a=>a!==void 0)}function d0e(e,t,n={}){const o=$k(t),s=vi(t),i=n.title??(o?_n.global.t("warnings.daemonNetworkTitle"):s?_n.global.t("warnings.daemonApiTitle"):_n.global.t("warnings.operationFailedTitle")),r=n.message??(o?_n.global.t("warnings.daemonNetworkMessage"):s?t.message:_n.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:u0e(e,t,n.sessionId)}}function l2(e){ye.warnings=[...ye.warnings,e]}function f0e(){const e=_n.global.t("warnings.wsTitle"),t=ye.warnings.filter(n=>!(typeof n=="object"&&n!==null&&n.severity==="error"&&n.title===e));t.length!==ye.warnings.length&&(ye.warnings=t)}function sf(e,t,n){console.error(`[kimi-web] operation failed: ${e}`,t);const o=vi(t),s=$k(t);ko("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}),l2(d0e(e,t,n))}const h0e={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function p0e(e){if(!vi(e))return;const t=h0e[e.code];return t?_n.global.t(t):void 0}async function m0e(e){if(c8(e),ye.activeSessionId!==e)return;const t=ye.sessions[0];t?await ut.selectSession(t.id,{urlMode:"replace"}):(r2(void 0),ye.sessionLoading=!1,ut.writeSessionUrl(void 0,"replace"))}const a4=new Set;async function g0e(e){if(!a4.has(e)){a4.add(e);try{const t=await dt().getSessionWarnings(e),n=_n.global.t("warnings.noteLabel");for(const o of t)l2(`${n}: ${o.message}`)}catch{}}}async function a2(e){const t=ut.localTurnStartState(e);try{const o=await dt().getSessionSnapshot(e);if(!ye.sessions.some(a=>a.id===e))return"ok";qp.flush();const s=ye.lastSeqBySession[e]??0,i=oy[e];if(!(jp.has(e)||Kp.has(e))&&i!==void 0&&i===o.epoch&&s>o.asOfSeq)return Bh.delete(e)||(Bh.add(e),Vp.request(e)),"ok";if(!ut.isLocalTurnSnapshotCurrent(e,t))return ut.afterLocalTurnStartsSettle(e,()=>{Vp.request(e)}),"ok";const l=Hv(o.session.usage);Qm(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})),Y1e(e,gpe(ye.messagesBySession[e]??[],o.messages)),ye.tasksBySession={...ye.tasksBySession,[e]:vpe(o.subagents,ye.tasksBySession[e]??[])},ye.messagesHasMoreBySession={...ye.messagesHasMoreBySession,[e]:o.hasMoreMessages},ye.approvalsBySession={...ye.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&&(ye.planReviewByToolCallId={...ye.planReviewByToolCallId,[a.toolCallId]:{plan:c.plan,path:typeof c.path=="string"?c.path:void 0}})}ye.questionsBySession={...ye.questionsBySession,[e]:o.pendingQuestions},ye.lastSeqBySession={...ye.lastSeqBySession,[e]:o.asOfSeq},oy[e]=o.epoch,jp.delete(e),Bh.delete(e),ut.handleSessionSnapshot(e,{inFlightTurn:o.inFlightTurn,busy:o.session.busy});{const a={...ye.turnActiveBySession};o.session.mainTurnActive??(o.inFlightTurn!==null&&o.session.busy)?a[e]=!0:delete a[e],ye.turnActiveBySession=a}return b8(),xi&&(xi.seedSnapshot(e,o),xi.subscribe(e,{seq:o.asOfSeq,epoch:o.epoch}),k0e(e)),Kp.delete(e),l&&of(e),g0e(e),"ok"}catch(n){return i0e(n)?(await m0e(e),"not-found"):(sf("getSessionSnapshot",n,{title:_n.global.t("warnings.sessionSnapshotTitle"),message:_n.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Vp=ype(a2);function v0e(e){return Object.prototype.hasOwnProperty.call(ye.messagesBySession,e)}const y0e=4,Ar=[],Kp=new Set;function k0e(e){const t=Ar.indexOf(e);for(t!==-1&&Ar.splice(t,1),Ar.unshift(e);Ar.length>y0e;){let n=-1;for(let s=Ar.length-1;s>=0;s--)if(Ar[s]!==ye.activeSessionId){n=s;break}if(n===-1)break;const[o]=Ar.splice(n,1);if(o===void 0)break;xi?.unsubscribe(o),Kp.add(o)}}function b0e(e){const t=Ar.indexOf(e);t!==-1&&Ar.splice(t,1),Kp.delete(e)}async function x0e(e){return a2(e)}function c2(e,t){return(ye.inFlightBySession[e]??!1)||(ye.turnActiveBySession[e]??!1)||(t??ye.sessions.find(n=>n.id===e)?.mainTurnActive??!1)}function u2(e){try{const t=new Date(e),o=Date.now()-t.getTime(),s=o/36e5;if(o<6e4)return _n.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 w0e=3e4,Wd=X(0);let Sg=null;function _0e(){Sg===null&&(Sg=setInterval(()=>{Wd.value=(Wd.value+1)%Number.MAX_SAFE_INTEGER},w0e),Sg.unref?.())}function S0e(e,t){const n=e.split(`
323
- `),o=t.split(`
324
- `),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 C0e(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:S0e(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 A0e(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 M0e(e){const t=ye.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 E0e(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=_n.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=_n.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??M0e(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 T0e=B(()=>{const e=ye.sessions.find(n=>n.id===ye.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:ye.workspaceName,branch:t}}),N0e=B(()=>(Wd.value,ye.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:u2(e.updatedAt),busy:c2(e.id,e.mainTurnActive),pendingInteraction:e.pendingInteraction,lastTurnReason:e.lastTurnReason})))),I0e=B(()=>ye.activeSessionId??""),L0e=B(()=>{const e=ye.activeSessionId;if(e)return In.skillsBySession.value[e]??[];const t=Jm.value;return t?In.skillsByWorkspace.value[t]??[]:[]}),d2=B(()=>{const e=ye.activeSessionId;return e?ye.inFlightBySession[e]??!1:!1}),$0e=B(()=>ut.isStartingFirstPrompt()),fs=v1e(ye,{pushOperationFailure:sf,nextOptimisticMsgId:k8,connectEventsIfNeeded:b8,getEventConn:()=>xi,resolveThinkingForPrompt:(e,t)=>In.resolveThinkingForPrompt(e,t)}),rf=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=fs.sideChatTargetBySession.value[e]?.agentId;return(ye.tasksBySession[e]??[]).filter(n=>n.id!==t)}),_8=hme(ye,rf),F0e=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=new Set(ye.sideChatUserMessageIdsBySession[e]??[]),n=(ye.messagesBySession[e]??[]).filter(s=>!t.has(s.id)),o=ye.approvalsBySession[e]??[];return G5(n,o,s=>dt().getFileUrl(s),Xm.value,ye.planReviewByToolCallId)}),Xm=B(()=>{const e=ye.activeSessionId;return e?(ye.turnActiveBySession[e]??!1)||(ye.sessions.find(t=>t.id===e)?.mainTurnActive??!1):!1}),O0e=B(()=>d2.value||Xm.value),R0e=B(()=>(_8.taskClock.value,rf.value.map(E0e))),S8=B(()=>O1e(rf.value)),B0e=B(()=>B1e(rf.value)),bc=B(()=>{const e=ye.activeSessionId;return e?ye.goalBySession[e]??null:null}),D0e=B(()=>{const e=ye.activeSessionId;return e?L1e(ye.messagesBySession[e]??[]):[]}),P0e=B(()=>{const e=ye.activeSessionId;return e?ye.compactionBySession[e]??null:null}),H0e=B(()=>ye.connection),W0e=B(()=>ye.loading),z0e=B(()=>ye.sessionLoading),U0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadingMoreBySession[e]??!1:!1}),q0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesHasMoreBySession[e]??!1:!1}),j0e=B(()=>{const e=ye.activeSessionId;return e?ye.messagesLoadMoreErrorBySession[e]??!1:!1}),V0e=B(()=>ye.serverVersion),K0e=B(()=>ye.backend),G0e=B(()=>ye.dangerousBypassAuth);function Y0e(){ye.dangerousBypassAuth=!1}const Z0e=B(()=>ye.permission),Q0e=B(()=>ye.thinking),C8=B(()=>{const e=ye.activeSessionId;return e?ye.planModeBySession[e]??!1:Zm.planMode}),X0e=B(()=>{const e=ye.activeSessionId;return e?ye.swarmModeBySession[e]??!1:Zm.swarmMode}),J0e=B(()=>{const e=ye.activeSessionId;return e?ye.goalModeBySession[e]??!1:Zm.goalMode}),ege=B(()=>{const e=R1e(S8.value);return{plan:C8.value,goal:bc.value&&bc.value.status!=="complete"?{status:bc.value.status,turnsUsed:bc.value.turnsUsed,elapsedMs:bc.value.wallClockMs}:null,swarm:e.total>0?e:null}}),tge=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=dt();return(ye.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}))}))}),nge=B(()=>ye.warnings),oge=B(()=>{const e=ye.activeSessionId;return e?(ye.questionsBySession[e]??[]).map(A0e):[]}),sge=B(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:C0e(t),agentName:t.agentName})):[]}),f2=B(()=>{const e=ye.activeSessionId;return e?(ye.approvalsBySession[e]??[]).length>0?"awaiting-approval":(ye.questionsBySession[e]??[]).length>0?"awaiting-question":d2.value||Xm.value?"running":"idle":"idle"}),In=Fme(ye,{pushOperationFailure:sf,refreshSessionStatus:of,persistSessionProfile:m8,activity:f2,updateSession:Qm,updateSessionMessages:a8}),sy=B(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),ige=B(()=>{const e=ye.activeSessionId;return e?ye.gitStatusBySession[e]?.pullRequest??null:null}),rge=B(()=>{const e=ye.activeSessionId;if(!e)return[];const t=ye.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,o])=>({path:n,status:o})).sort((n,o)=>n.path.localeCompare(o.path)):[]}),lge=B(()=>{const e=ye.activeSessionId;if(!e)return null;const t=ye.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),A8=B(()=>{const e=ye.sessions.find(r=>r.id===ye.activeSessionId),t=sy.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?In.draftModel.value:null,o=(e?.model&&e.model.length>0?e.model:n??ye.defaultModel)??"—",s=In.models.value.find(r=>r.id===o)??In.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:ye.permission,branch:t,cwd:e?.cwd??"",isGitRepo:sy.value!==null}}),age=B(()=>d8.value),cge=B(()=>ye.sessions.find(t=>t.id===ye.activeSessionId)?.usage.totalCostUsd??0),uge=B(()=>ye.authReady),dge=B(()=>ye.defaultModel),fge=B(()=>ye.managedProviderStatus),hge=B(()=>ye.config),pge=B(()=>{const e=ye.activeSessionId;if(!e)return{};const t=ye.gitStatusBySession[e];return t?{...t.entries}:{}});function tu(e){const t=Fi(e.cwd);return ye.workspaces.find(n=>Fi(n.root)===t)?.id??e.workspaceId??e.cwd}const h2=B(()=>mpe({workspaces:ye.workspaces,sessions:ye.sessions,hiddenWorkspaceRoots:ye.hiddenWorkspaceRoots,sessionsHasMoreByWorkspace:ye.sessionsHasMoreByWorkspace})),Gp=X(yI()),nu=X(kI()==="manual"?"manual":"recent");Qe(()=>[h2.value.map(e=>e.id).join("\0"),ye.loading],([e,t])=>{if(t)return;const n=e?e.split("\0"):[],o=FI(n,Gp.value);o!==null&&(Gp.value=o,kA(o))});const Oa=B(()=>{const e=h2.value.map(t=>({id:t.id,name:t.name,root:t.root,shortPath:q1e(t.root,ye.fsHome),sessionCount:t.sessionCount}));if(nu.value==="recent"){const t=new Map;for(const n of ye.sessions){if(n.parentSessionId)continue;const o=tu(n),s=new Date(n.updatedAt).getTime();s>(t.get(o)??Number.NEGATIVE_INFINITY)&&t.set(o,s)}return BI(e,t)}return OI(e,Gp.value)}),Jm=B(()=>{const e=ye.activeWorkspaceId,t=Oa.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null});Qe(Jm,e=>{e&&(Object.prototype.hasOwnProperty.call(In.skillsByWorkspace.value,e)||In.loadSkillsForWorkspace(e))},{immediate:!0});const mge=B(()=>{const e=Jm.value;return e?Oa.value.find(t=>t.id===e)??null:null}),gge=B(()=>{Wd.value;const e=new Set(Oa.value.map(n=>n.id)),t=new Map(Oa.value.map(n=>[n.id,n.name]));return ye.sessions.filter(n=>!n.parentSessionId&&e.has(tu(n))).map(n=>{const o=tu(n);return{id:n.id,title:n.title,time:u2(n.updatedAt),busy:c2(n.id,n.mainTurnActive),pendingInteraction:n.pendingInteraction,lastTurnReason:n.lastTurnReason,lastPrompt:n.lastPrompt,workspaceId:o,workspaceName:t.get(o)}})}),vge=B(()=>{Wd.value;const e=new Map;for(const t of ye.sessions.toSorted((n,o)=>new Date(o.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=tu(t),o={id:t.id,title:t.title,time:u2(t.updatedAt),busy:c2(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 Oa.value.map(t=>({workspace:t,sessions:e.get(t.id)??[],hasMore:ye.sessionsHasMoreByWorkspace[t.id]??!1,loadingMore:ye.sessionsLoadingMoreByWorkspace[t.id]??!1,initialCount:ye.sessionsInitialCountByWorkspace[t.id]??Jv}))});function yge(e){Gp.value=e,kA(e),nu.value!=="manual"&&(nu.value="manual",bA("manual"))}function kge(e){nu.value!==e&&(nu.value=e,bA(e))}const M8=B(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),bge=B(()=>{const e={};for(const[t,n]of Object.entries(ye.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(ye.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),xge=B(()=>{const e={};for(const[t,n]of Object.entries(ye.unreadBySession))n&&(e[t]=!0);return e}),wge=B(()=>{const e={},t=M8.value;for(const n of ye.sessions){const o=t[n.id]??0;if(o<=0)continue;const s=tu(n);e[s]=(e[s]??0)+o}return e}),_ge=B(()=>ye.recentRoots),Sge=B(()=>ye.availableOpenInApps),ut=Ime(ye,{taskPoller:_8,sideChat:fs,modelProvider:In,pushOperationFailure:sf,activity:f2,sessionsKnownEmpty:x8,setSessions:r8,updateSession:Qm,upsertSessionFront:j1e,appendSession:V1e,forgetSession:c8,setActiveSessionId:r2,updateSessionMessages:a8,nextOptimisticMsgId:k8,getEventConn:()=>xi,syncSessionFromSnapshot:a2,reopenSession:x0e,hasLoadedMessages:v0e,refreshSessionStatus:of,refreshSessionGoal:Q1e,persistSessionProfile:m8,mergedWorkspaces:h2,workspacesView:Oa,status:A8,workspaceIdForSession:tu,savePermissionToStorage:P1e,savePlanModeToStorage:n8,saveSwarmModeToStorage:o8,saveGoalModeToStorage:s8,draftModes:Zm,saveUnread:Py,saveActiveWorkspaceToStorage:U1e,saveHiddenWorkspacesToStorage:z1e,goalErrorMessage:p0e,resetFastMoon:Cr.resetFastMoon,initialized:h8,connectIssue:p8,selectedDiffPath:u8,fileDiffLines:d8,fileDiffLoading:f8});function p2(e){return e===ye.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible"&&document.hasFocus()}function Cge(e){if(ye.turnActiveBySession[e]){const t={...ye.turnActiveBySession};delete t[e],ye.turnActiveBySession=t}ye.inFlightBySession[e]&&(ye.inFlightBySession={...ye.inFlightBySession,[e]:!1})}function Age(e,t,n){const o=ye.promptIdBySession[e];ut.finishPromptLocal(e,{turnWasActive:n}),e===ye.activeSessionId?(ut.loadGitStatus(e),of(e)):t==="idle"&&(ye.unreadBySession={...ye.unreadBySession,[e]:!0},Py({[e]:!0}));const s=(ye.approvalsBySession[e]??[]).length>0,i=(ye.questionsBySession[e]??[]).length>0;jpe(t,s,i)&&Ji.maybeNotifyCompletion(e,{isUserWatching:p2(e),sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",promptId:o,onClick:()=>{ut.selectSession(e)}}),t==="idle"&&Hd.maybePlayCompletionSound()}function Mge(e,t){const n=t.questions[0],o=n?.header?.trim()??"",s=n?.question?.trim()??"",i=o&&s?`${o}: ${s}`:s||o;Ji.maybeNotifyQuestion({isUserWatching:p2(e),sessionTitle:ye.sessions.find(r=>r.id===e)?.title??"",questionPreview:i,questionId:t.questionId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayQuestionSound()}function Ege(e,t){Ji.maybeNotifyApproval({isUserWatching:p2(e),sessionTitle:ye.sessions.find(n=>n.id===e)?.title??"",toolName:t.toolName,approvalId:t.approvalId,onClick:()=>{ut.selectSession(e)}}),Hd.maybePlayApprovalSound()}function m2(){return _0e(),{workspace:T0e,sessions:N0e,activeSessionId:I0e,workspacesView:Oa,workspaceSortMode:nu,visibleWorkspace:mge,activeWorkspaceId:Jm,sessionsForView:gge,workspaceGroups:vge,attentionBySession:M8,pendingBySession:bge,attentionByWorkspace:wge,unreadBySession:xge,recentRoots:_ge,turns:F0e,tasks:R0e,activeAppTasks:rf,todos:D0e,goal:bc,swarms:S8,swarmMembersByToolCallId:B0e,activationBadges:ege,compaction:P0e,status:A8,sessionCost:cge,fileDiff:age,selectedDiffPath:u8,fileDiffLoading:f8,changes:rge,gitInfo:sy,gitDiffStats:lge,activePullRequest:ige,changesByPath:pge,pendingApprovals:sge,availableOpenInApps:Sge,connection:H0e,loading:W0e,sessionLoading:z0e,loadingMoreMessages:U0e,hasMoreMessages:q0e,loadMoreMessagesError:j0e,serverVersion:V0e,backend:K0e,dangerousBypassAuth:G0e,clearDangerousBypassAuth:Y0e,initialized:h8,connectIssue:p8,permission:Z0e,thinking:Q0e,planMode:C8,swarmMode:X0e,goalMode:J0e,queued:tge,warnings:nge,questions:oge,activity:f2,turnActive:Xm,inFlight:d2,working:O0e,isStartingFirstPrompt:$0e,fastMoon:Cr.fastMoon,models:In.models,starredModelIds:In.starredModelIds,providers:In.providers,uiFontSize:Cr.uiFontSize,setUiFontSize:Cr.setUiFontSize,conversationToc:v8,setConversationToc:e0e,colorScheme:Cr.colorScheme,setColorScheme:Cr.setColorScheme,accent:Cr.accent,setAccent:Cr.setAccent,notifyOnComplete:Ji.notifyOnComplete,notifyOnQuestion:Ji.notifyOnQuestion,notifyOnApproval:Ji.notifyOnApproval,notifyPermission:Ji.notifyPermission,setNotifyOnComplete:Ji.setNotifyOnComplete,setNotifyOnQuestion:Ji.setNotifyOnQuestion,setNotifyOnApproval:Ji.setNotifyOnApproval,soundOnComplete:Hd.soundOnComplete,setSoundOnComplete:Hd.setSoundOnComplete,onboarded:y8,setOnboarded:n0e,load:ut.load,selectSession:ut.selectSession,clearActiveSession:ut.clearActiveSession,loadOlderMessages:ut.loadOlderMessages,loadWorkspaces:ut.loadWorkspaces,loadMoreSessions:ut.loadMoreSessions,loadAllSessions:ut.loadAllSessions,selectWorkspace:ut.selectWorkspace,openWorkspace:ut.openWorkspace,openWorkspaceDraft:ut.openWorkspaceDraft,startSessionAndSendPrompt:ut.startSessionAndSendPrompt,startSessionAndActivateSkill:ut.startSessionAndActivateSkill,startSessionAndOpenSideChat:ut.startSessionAndOpenSideChat,addWorkspaceByPath:ut.addWorkspaceByPath,browseFs:ut.browseFs,getFsHome:ut.getFsHome,sendPrompt:ut.sendPrompt,steerPrompt:ut.steerPrompt,sideChatVisible:fs.sideChatVisible,sideChatSessionId:fs.sideChatSessionId,sideChatTurns:fs.sideChatTurns,sideChatRunning:fs.sideChatRunning,sideChatSending:fs.sideChatSending,openSideChat:fs.openSideChat,closeSideChat:fs.closeSideChat,sendSideChatPrompt:fs.sendSideChatPrompt,uploadImage:ut.uploadImage,abortCurrentPrompt:ut.abortCurrentPrompt,respondApproval:ut.respondApproval,respondQuestion:ut.respondQuestion,dismissQuestion:ut.dismissQuestion,pendingQuestionActions:ut.pendingQuestionActions,pendingApprovalActions:ut.pendingApprovalActions,cancelTask:ut.cancelTask,setPermission:ut.setPermission,setThinking:In.setThinking,setPlanMode:ut.setPlanMode,togglePlanMode:ut.togglePlanMode,setSwarmMode:ut.setSwarmMode,toggleSwarmMode:ut.toggleSwarmMode,setGoalMode:ut.setGoalMode,toggleGoalMode:ut.toggleGoalMode,createGoal:ut.createGoal,controlGoal:ut.controlGoal,enqueue:ut.enqueue,dismissWarning:ut.dismissWarning,renameSession:ut.renameSession,renameWorkspace:ut.renameWorkspace,deleteWorkspace:ut.deleteWorkspace,reorderWorkspaces:yge,setWorkspaceSortMode:kge,archiveSession:ut.archiveSession,exportSession:ut.exportSession,restoreSession:ut.restoreSession,loadArchivedSessions:ut.loadArchivedSessions,compact:ut.compact,forkSession:ut.forkSession,undo:ut.undo,unqueue:ut.unqueue,reorderQueue:ut.reorderQueue,searchFiles:ut.searchFiles,loadGitStatus:ut.loadGitStatus,loadFileDiff:ut.loadFileDiff,clearFileDiff:ut.clearFileDiff,listDir:ut.listDir,readFileContent:ut.readFileContent,getFileDownloadUrl:ut.getFileDownloadUrl,openWorkspaceFile:ut.openWorkspaceFile,openInApp:ut.openInApp,revealWorkspaceFile:ut.revealWorkspaceFile,resolveImageUrl:ut.resolveImageUrl,loadModels:In.loadModels,loadProviders:In.loadProviders,skills:L0e,activateSkill:In.activateSkill,setModel:In.setModel,toggleStarModel:In.toggleStarModel,addProvider:In.addProvider,deleteProvider:In.deleteProvider,refreshProvider:In.refreshProvider,refreshAllProviders:In.refreshAllProviders,authReady:uge,defaultModel:dge,managedProviderStatus:fge,config:hge,updateConfig:ut.updateConfig,checkAuth:ut.checkAuth,startOAuthLogin:In.startOAuthLogin,pollOAuthLogin:In.pollOAuthLogin,cancelOAuthLogin:In.cancelOAuthLogin,logout:ut.logout}}const E8=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=Tt(),n=_A.map(s=>({value:s.code,label:s.label}));function o(s){t.value!==s&&SA(s)}return(s,i)=>(w(),xe(gs,{"model-value":C(t),options:C(n),"onUpdate:modelValue":o},null,8,["model-value","options"]))}}),Tge=["aria-checked","aria-label","disabled"],Nge=Ze({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(o,s)=>(w(),T("button",{class:We(["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]=[_("span",{class:"ui-switch__thumb"},null,-1)])],10,Tge))}}),yr=ct(Nge,[["__scopeId","data-v-dbe22dc4"]]),Ige=["aria-label"],Lge=["aria-selected","onClick"],$ge={class:"body"},Fge={class:"panel"},Oge={class:"sec"},Rge={class:"sec-title"},Bge={class:"row"},Dge={class:"rlabel"},Pge={class:"row"},Hge={class:"rlabel"},Wge={class:"row"},zge={class:"rlabel"},Uge={class:"num-field"},qge=["value","aria-label"],jge={class:"row"},Vge={class:"rlabel"},Kge={class:"row"},Gge={class:"rlabel"},Yge={class:"hint"},Zge={class:"sec"},Qge={class:"sec-title"},Xge={class:"row"},Jge={class:"rlabel"},eve={key:0,class:"hint"},tve={class:"row"},nve={class:"rlabel"},ove={key:0,class:"hint"},sve={class:"row"},ive={class:"rlabel"},rve={key:0,class:"hint"},lve={class:"row"},ave={class:"rlabel"},cve={class:"panel"},uve={class:"sec"},dve={class:"sec-title"},fve={class:"row"},hve={class:"rlabel"},pve={key:0,class:"rvalue"},mve={class:"actions"},gve={class:"panel"},vve={class:"sec"},yve={class:"sec-head"},kve={class:"sec-title"},bve={key:0,class:"saving"},xve={class:"row"},wve={class:"rlabel"},_ve={class:"hint"},Sve={key:0,class:"select-wrap"},Cve={key:0,value:"",disabled:""},Ave=["label"],Mve=["value"],Eve={key:1,class:"rvalue mono"},Tve={class:"row"},Nve={class:"rlabel"},Ive={class:"hint"},Lve={class:"row"},$ve={class:"rlabel"},Fve={class:"hint"},Ove={class:"row"},Rve={class:"rlabel"},Bve={class:"hint"},Dve={class:"row"},Pve={class:"rlabel"},Hve={class:"hint"},Wve={key:1,class:"empty-config"},zve={class:"panel"},Uve={class:"sec"},qve={class:"sec-title"},jve={class:"row"},Vve={class:"rlabel"},Kve={class:"rvalue mono"},Gve={class:"row"},Yve={class:"rlabel"},Zve={class:"rvalue mono"},Qve={class:"row"},Xve={class:"rlabel"},Jve={class:"rvalue mono"},eye={key:0,class:"row"},tye={class:"rlabel"},nye={class:"hint"},oye={class:"hint"},sye={class:"row"},iye={class:"rlabel"},rye={key:0,class:"hint"},lye={class:"panel"},aye={class:"panel-head"},cye={class:"panel-title"},uye={class:"panel-desc"},dye={class:"archive-toolbar"},fye={class:"archive-search"},hye=["placeholder"],pye={value:"all"},mye=["value"],gye={key:0,class:"archive-empty"},vye={key:0,class:"archive-list"},yye={class:"archive-workspace"},kye={class:"path"},bye={class:"count"},xye={class:"setting-card"},wye={class:"archive-meta"},_ye={class:"archive-name"},Sye={class:"archive-time"},Cye={key:1,class:"archive-empty"},Aye=100,Mye=Ze({__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}=Tt(),o=e,s=t,i=X("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=AI(),a=B(()=>o.backend==="v2"?"v2 (kap-server)":"v1 (server)"),c=["manual","auto","yolo"],u={manual:"status.permissionManual",auto:"status.permissionAuto",yolo:"status.permissionYolo"},d=X(null);jk(d);function f(oe){oe.key==="Escape"&&s("close")}cn(()=>document.addEventListener("keydown",f)),bn(()=>document.removeEventListener("keydown",f));function h(){h5()}const p=B(()=>{const oe=new Map;for(const ce of o.models??[])oe.set(ce.id,{id:ce.id,label:ce.displayName??ce.model??ce.id,provider:ce.provider});for(const[ce,ue]of Object.entries(o.config?.models??{})){if(oe.has(ce))continue;const Se=v(ue);oe.set(ce,{id:ce,label:m(ce,ue,Se),provider:Se??ce})}return Array.from(oe.values())}),g=B(()=>{const oe=new Map;for(const ce of p.value){const ue=oe.get(ce.provider)??[];ue.push(ce),oe.set(ce.provider,ue)}for(const ce of oe.values())ce.sort((ue,Se)=>ue.label.localeCompare(Se.label));return Array.from(oe.entries()).toSorted(([ce],[ue])=>ce.localeCompare(ue)).map(([ce,ue])=>({provider:ce,options:ue}))}),b=B(()=>{const oe=o.config?.defaultPermissionMode;return oe==="auto"||oe==="yolo"||oe==="manual"?oe:"manual"});function v(oe){if(!oe||typeof oe!="object")return;const ce=oe;return typeof ce.provider=="string"?ce.provider:void 0}function m(oe,ce,ue){if(!ce||typeof ce!="object")return oe;const Se=ce,Te=typeof Se.model=="string"?Se.model:void 0,Ae=ue??v(ce);return Te&&Ae?`${oe} (${Ae}/${Te})`:Te?`${oe} (${Te})`:oe}function y(oe){return oe===!0}function k(oe){!oe||oe===o.config?.defaultModel||s("updateConfig",{defaultModel:oe})}function A(oe){oe!==b.value&&s("updateConfig",{defaultPermissionMode:oe})}function $(oe){const ce=o.config?.[oe];s("updateConfig",{[oe]:!y(ce)})}function N(){const oe=o.config?.thinking;return!oe||typeof oe!="object"?!0:oe.enabled!==!1}function x(){s("updateConfig",{thinking:{enabled:!N()}})}function I(){const oe=o.config?.telemetry!==!1;s("updateConfig",{telemetry:!oe})}function E(oe){i.value=oe}const F=m2(),S=X([]),L=X(!1),R=X(!1),D=X(""),z=X("all"),H=X("archived-desc");async function U(){if(!(L.value||R.value)){L.value=!0;try{const oe=[];let ce;for(;;){const ue=await F.loadArchivedSessions({beforeId:ce,pageSize:Aye});if(oe.push(...ue.items),!ue.hasMore||ue.items.length===0)break;const Se=ue.items.at(-1)?.id;if(Se===void 0)break;ce=Se}S.value=oe,R.value=!0}catch(oe){console.warn("loadAllArchived failed",oe)}finally{L.value=!1}}}Qe(i,oe=>{oe==="archived"&&!R.value&&U()});const Z=B(()=>{const oe=new Set;for(const ce of S.value)oe.add(ce.cwd);return Array.from(oe).sort((ce,ue)=>ce.localeCompare(ue))}),K=B(()=>{const oe=D.value.trim().toLowerCase();let ce=S.value.filter(ue=>ue.archived===!0);return z.value!=="all"&&(ce=ce.filter(ue=>ue.cwd===z.value)),oe&&(ce=ce.filter(ue=>ue.title.toLowerCase().includes(oe))),ce=ce.slice(),H.value==="archived-desc"?ce.sort((ue,Se)=>Se.updatedAt.localeCompare(ue.updatedAt)):H.value==="created-desc"?ce.sort((ue,Se)=>Se.createdAt.localeCompare(ue.createdAt)):ce.sort((ue,Se)=>ue.title.localeCompare(Se.title,"zh")),ce}),V=B(()=>{const oe=new Map;for(const ce of K.value){const ue=oe.get(ce.cwd)??[];ue.push(ce),oe.set(ce.cwd,ue)}return Array.from(oe.entries()).map(([ce,ue])=>({cwd:ce,items:ue}))});async function J(oe){await F.restoreSession(oe)&&(S.value=S.value.filter(ue=>ue.id!==oe))}function fe(oe){const ce=new Date(oe);if(Number.isNaN(ce.getTime()))return oe;const ue=Se=>String(Se).padStart(2,"0");return`${ce.getFullYear()}-${ue(ce.getMonth()+1)}-${ue(ce.getDate())} ${ue(ce.getHours())}:${ue(ce.getMinutes())}`}return(oe,ce)=>(w(),xe(qr,{open:!0,"close-on-esc":!1,title:C(n)("settings.title"),size:"xl",height:"fixed",padded:!1,onClose:ce[19]||(ce[19]=ue=>s("close"))},{default:Ee(()=>[_("div",{ref_key:"dialogRef",ref:d,class:"sd"},[_("nav",{class:"settings-tabs",role:"tablist","aria-label":C(n)("settings.title")},[(w(),T(Pe,null,ot(r,ue=>_("button",{key:ue.id,type:"button",class:We(["tab",{on:i.value===ue.id}]),role:"tab","aria-selected":i.value===ue.id,onClick:Se=>E(ue.id)},O(C(n)(ue.labelKey)),11,Lge)),64))],8,Ige),_("div",$ge,[Fn(_("section",Fge,[_("section",Oge,[_("h3",Rge,O(C(n)("settings.appearance")),1),_("div",Bge,[_("span",Dge,O(C(n)("theme.colorSchemeLabel")),1),re(gs,{"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":ce[0]||(ce[0]=ue=>s("setColorScheme",ue))},null,8,["model-value","options"])]),_("div",Pge,[_("span",Hge,O(C(n)("theme.accentLabel")),1),re(gs,{"model-value":e.accent,options:[{value:"blue",label:C(n)("theme.accentBlue")},{value:"mono",label:C(n)("theme.accentBlack")}],"onUpdate:modelValue":ce[1]||(ce[1]=ue=>s("setAccent",ue))},null,8,["model-value","options"])]),_("div",Wge,[_("span",zge,O(C(n)("settings.uiFontSize")),1),_("label",Uge,[_("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":C(n)("settings.uiFontSize"),onInput:ce[2]||(ce[2]=ue=>s("setUiFontSize",Number(ue.target.value)))},null,40,qge),ce[20]||(ce[20]=_("span",{class:"num-unit"},"px",-1))])]),_("div",jge,[_("span",Vge,O(C(n)("sidebar.language")),1),re(E8)]),_("div",Kge,[_("span",Gge,[Je(O(C(n)("settings.conversationToc"))+" ",1),_("span",Yge,O(C(n)("settings.conversationTocHint")),1)]),re(yr,{"model-value":e.conversationToc??!0,label:C(n)("settings.conversationToc"),"onUpdate:modelValue":ce[3]||(ce[3]=ue=>s("setConversationToc",ue))},null,8,["model-value","label"])])]),_("section",Zge,[_("h3",Qge,O(C(n)("settings.notifications")),1),_("div",Xge,[_("span",Jge,[Je(O(C(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",eve,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notify,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnComplete"),"onUpdate:modelValue":ce[4]||(ce[4]=ue=>s("setNotify",ue))},null,8,["model-value","disabled","label"])]),_("div",tve,[_("span",nve,[Je(O(C(n)("settings.notifyOnQuestion"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",ove,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notifyQuestion,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnQuestion"),"onUpdate:modelValue":ce[5]||(ce[5]=ue=>s("setNotifyQuestion",ue))},null,8,["model-value","disabled","label"])]),_("div",sve,[_("span",ive,[Je(O(C(n)("settings.notifyOnApproval"))+" ",1),e.notifyPermission==="denied"?(w(),T("span",rve,O(C(n)("settings.notifyDenied")),1)):ae("",!0)]),re(yr,{"model-value":e.notifyApproval,disabled:e.notifyPermission==="denied",label:C(n)("settings.notifyOnApproval"),"onUpdate:modelValue":ce[6]||(ce[6]=ue=>s("setNotifyApproval",ue))},null,8,["model-value","disabled","label"])]),_("div",lve,[_("span",ave,O(C(n)("settings.soundOnComplete")),1),re(yr,{"model-value":e.sound,label:C(n)("settings.soundOnComplete"),"onUpdate:modelValue":ce[7]||(ce[7]=ue=>s("setSound",ue))},null,8,["model-value","label"])])])],512),[[mi,i.value==="general"]]),Fn(_("section",cve,[_("section",uve,[_("h3",dve,O(C(n)("settings.account")),1),_("div",fve,[_("span",hve,O(e.authReady?"managed:kimi-code":C(n)("sidebar.notSignedIn")),1),re(Xt,{text:e.accountModel},{default:Ee(()=>[e.authReady&&e.accountModel?(w(),T("span",pve,O(e.accountModel),1)):ae("",!0)]),_:1},8,["text"])]),_("div",mve,[re(Bt,{variant:"secondary",size:"sm",onClick:ce[8]||(ce[8]=ue=>{s("openOnboarding"),s("close")})},{default:Ee(()=>[Je(O(C(n)("onboarding.reopen")),1)]),_:1}),e.authReady?(w(),xe(Bt,{key:0,variant:"danger-soft",size:"sm",onClick:ce[9]||(ce[9]=ue=>s("logout"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signOut")),1)]),_:1})):(w(),xe(Bt,{key:1,variant:"primary",size:"sm",onClick:ce[10]||(ce[10]=ue=>s("login"))},{default:Ee(()=>[Je(O(C(n)("sidebar.signIn")),1)]),_:1}))])])],512),[[mi,i.value==="account"]]),Fn(_("section",gve,[_("section",vve,[_("div",yve,[_("h3",kve,O(C(n)("settings.agentDefaults")),1),e.configSaving?(w(),T("span",bve,O(C(n)("settings.saving")),1)):ae("",!0)]),e.config?(w(),T(Pe,{key:0},[_("div",xve,[_("span",wve,[Je(O(C(n)("settings.defaultModel"))+" ",1),_("span",_ve,O(C(n)("settings.defaultModelHint")),1)]),g.value.length>0?(w(),T("div",Sve,[re(Yv,{"model-value":e.config.defaultModel??"",disabled:e.configSaving,"aria-label":C(n)("settings.defaultModel"),"onUpdate:modelValue":k},{default:Ee(()=>[e.config.defaultModel?ae("",!0):(w(),T("option",Cve,O(C(n)("settings.noDefaultModel")),1)),(w(!0),T(Pe,null,ot(g.value,ue=>(w(),T("optgroup",{key:ue.provider,label:ue.provider},[(w(!0),T(Pe,null,ot(ue.options,Se=>(w(),T("option",{key:Se.id,value:Se.id},O(Se.label),9,Mve))),128))],8,Ave))),128))]),_:1},8,["model-value","disabled","aria-label"])])):(w(),T("span",Eve,O(e.config.defaultModel??C(n)("settings.noDefaultModel")),1))]),_("div",Tve,[_("span",Nve,[Je(O(C(n)("settings.defaultPermission"))+" ",1),_("span",Ive,O(C(n)("settings.defaultPermissionHint")),1)]),re(gs,{"model-value":b.value,options:c.map(ue=>({value:ue,label:C(n)(u[ue])})),"onUpdate:modelValue":ce[11]||(ce[11]=ue=>A(ue))},null,8,["model-value","options"])]),_("div",Lve,[_("span",$ve,[Je(O(C(n)("settings.defaultThinking"))+" ",1),_("span",Fve,O(C(n)("settings.defaultThinkingHint")),1)]),re(yr,{"model-value":N(),disabled:e.configSaving,label:C(n)("settings.defaultThinking"),"onUpdate:modelValue":ce[12]||(ce[12]=ue=>x())},null,8,["model-value","disabled","label"])]),_("div",Ove,[_("span",Rve,[Je(O(C(n)("settings.defaultPlanMode"))+" ",1),_("span",Bve,O(C(n)("settings.defaultPlanModeHint")),1)]),re(yr,{"model-value":y(e.config.defaultPlanMode),disabled:e.configSaving,label:C(n)("settings.defaultPlanMode"),"onUpdate:modelValue":ce[13]||(ce[13]=ue=>$("defaultPlanMode"))},null,8,["model-value","disabled","label"])]),_("div",Dve,[_("span",Pve,[Je(O(C(n)("settings.mergeSkills"))+" ",1),_("span",Hve,O(C(n)("settings.mergeSkillsHint")),1)]),re(yr,{"model-value":y(e.config.mergeAllAvailableSkills),disabled:e.configSaving,label:C(n)("settings.mergeSkills"),"onUpdate:modelValue":ce[14]||(ce[14]=ue=>$("mergeAllAvailableSkills"))},null,8,["model-value","disabled","label"])])],64)):(w(),T("div",Wve,O(C(n)("settings.configUnavailable")),1))])],512),[[mi,i.value==="agent"]]),Fn(_("section",zve,[_("section",Uve,[_("h3",qve,O(C(n)("settings.advanced")),1),_("div",jve,[_("span",Vve,O(C(n)("sidebar.daemon")),1),_("span",Kve,O(C(l)),1)]),_("div",Gve,[_("span",Yve,O(C(n)("settings.backend")),1),_("span",Zve,O(a.value),1)]),_("div",Qve,[_("span",Xve,O(C(n)("settings.serverVersion")),1),_("span",Jve,O(e.serverVersion||"-"),1)]),e.config?(w(),T("div",eye,[_("span",tye,[Je(O(C(n)("settings.telemetry"))+" ",1),_("span",nye,O(C(n)("settings.telemetryHint")),1),_("span",oye,O(C(n)("settings.telemetryRestartHint")),1)]),re(yr,{"model-value":e.config.telemetry!==!1,disabled:e.configSaving,label:C(n)("settings.telemetry"),"onUpdate:modelValue":ce[15]||(ce[15]=ue=>I())},null,8,["model-value","disabled","label"])])):ae("",!0),_("div",sye,[_("span",iye,[Je(O(C(n)("settings.exportLog"))+" ",1),C(Hi)()?ae("",!0):(w(),T("span",rye,O(C(n)("settings.logHint")),1))]),re(Bt,{variant:"secondary",size:"sm",onClick:h},{default:Ee(()=>[Je(O(C(n)("settings.exportLogBtn")),1)]),_:1})])])],512),[[mi,i.value==="advanced"]]),Fn(_("section",lye,[_("div",aye,[ce[21]||(ce[21]=_("div",{class:"panel-kicker"},"Archived sessions",-1)),_("h4",cye,O(C(n)("settings.archivedTitle")),1),_("p",uye,O(C(n)("settings.archivedDesc")),1)]),_("div",dye,[_("label",fye,[ce[22]||(ce[22]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("circle",{cx:"11",cy:"11",r:"7"}),_("path",{d:"m21 21-4.3-4.3"})],-1)),Fn(_("input",{"onUpdate:modelValue":ce[16]||(ce[16]=ue=>D.value=ue),placeholder:C(n)("settings.archivedSearch")},null,8,hye),[[_s,D.value]])]),re(Yv,{"model-value":z.value,size:"sm","aria-label":C(n)("settings.archivedAllWorkspaces"),"onUpdate:modelValue":ce[17]||(ce[17]=ue=>z.value=ue)},{default:Ee(()=>[_("option",pye,O(C(n)("settings.archivedAllWorkspaces")),1),(w(!0),T(Pe,null,ot(Z.value,ue=>(w(),T("option",{key:ue,value:ue},O(ue),9,mye))),128))]),_:1},8,["model-value","aria-label"]),re(gs,{size:"sm","model-value":H.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":ce[18]||(ce[18]=ue=>H.value=ue)},null,8,["model-value","options"])]),L.value?(w(),T("div",gye,O(C(n)("settings.archivedLoadingAll")),1)):(w(),T(Pe,{key:1},[V.value.length>0?(w(),T("div",vye,[(w(!0),T(Pe,null,ot(V.value,ue=>(w(),T("section",{key:ue.cwd,class:"archive-card"},[_("div",yye,[ce[23]||(ce[23]=_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[_("path",{d:"M3 7h6l2 2h10v9H3z"}),_("path",{d:"M3 7V5h6l2 2"})],-1)),_("span",kye,O(ue.cwd),1),_("span",bye,O(C(n)("settings.archivedSessionsCount",{count:ue.items.length})),1)]),_("div",xye,[(w(!0),T(Pe,null,ot(ue.items,Se=>(w(),T("div",{key:Se.id,class:"archive-row"},[_("div",wye,[_("div",_ye,O(Se.title),1),_("div",Sye,O(C(n)("settings.archivedAt",{time:fe(Se.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:Te=>J(Se.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128))])]))),128))])):(w(),T("div",Cye,O(S.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))],512),[[mi,i.value==="archived"]])])],512)]),_:1},8,["title"]))}}),Eye=ct(Mye,[["__scopeId","data-v-2377814f"]]),Tye=/^(?:\/|~(?:\/|$)|[A-Za-z]:[\\/]|\\\\)/,T8=/^[A-Za-z]:[\\/]/,Nye=/^\/\/(?!\/)/;function Cg(e){return Tye.test(e.trim())}function Iye(e,t){return e==="~"?t||e:e.startsWith("~/")?(t||"~")+e.slice(1):e}function Lye(e){return Nye.test(e)?`//${e.slice(2).replaceAll(/\/{2,}/g,"/")}`:e.replaceAll(/\/{2,}/g,"/")}function $ye(e){return T8.test(e)||e.startsWith("\\\\")||e.startsWith("//")}function Fye(e){return T8.test(e)?3:e.startsWith("\\\\")||e.startsWith("//")?2:e.startsWith("/")?1:0}function iy(e,t){let n=Lye(Iye(e.trim(),t));const o=$ye(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=Fye(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 Oye(e,t,n){return`${e}${e.endsWith(n)?"":n}${t}`}function Rye(e,t,n){if(n===null)return null;const{target:o}=iy(e,t);return o===n?n:null}const Bye={class:"aw"},Dye={key:0,class:"crumbbar"},Pye={class:"crumbs"},Hye={key:0,class:"crumb-sep"},Wye=["onClick"],zye=["placeholder"],Uye={key:2,class:"folder-list"},qye={key:0,class:"fl-loading"},jye={key:0,class:"fl-loading"},Vye={key:0,class:"fl-note"},Kye=["onClick"],Gye={class:"folder-name"},Yye={key:1,class:"fl-empty fl-error"},Zye={key:2,class:"fl-empty fl-error"},Qye=["onClick"],Xye={class:"folder-name search-rel"},Jye={key:0,class:"fl-empty"},eke={key:1,class:"fl-loading"},tke=["onClick"],nke={class:"folder-name"},oke={key:0,class:"fl-empty"},ske={key:3,class:"degraded-hint"},ike={key:4,class:"add-error",role:"alert"},rke={class:"actions"},lke={class:"footer-hint"},ake=600,cke=6,c4=150,uke=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{},error:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=X(!1),l=X(!1),a=X(""),c=X(null),u=X([]),d=X(""),f=X(!1),h=X([]),p=B(()=>d.value.trim().length>0);let g=0,b=null;const v=B(()=>Cg(d.value)),m=X("idle"),y=X(""),k=X("/"),A=X([]),$=X(""),N=X(null),x=X(null),I=B(()=>m.value!=="valid"?null:Rye(d.value,$.value,x.value));let E=0,F=null;function S(ce,ue){const Se=ce.toLowerCase(),Te=ue.toLowerCase();let Ae=0;for(let P=0;P<Te.length&&Ae<Se.length;P++)Te[P]===Se[Ae]&&Ae++;return Ae===Se.length}async function L(ce){const ue=a.value,Se=ce.trim();if(!ue||Se===""){h.value=[],f.value=!1;return}const Te=++g;f.value=!0;const Ae=[],P=[{path:ue,depth:0}];let le=0;for(;P.length>0&&le<ake&&Ae.length<c4;){if(Te!==g)return;const ne=P.shift();le++;let q;try{q=await o.browseFs(ne.path)}catch{continue}if(Te!==g)return;for(const ee of q.entries){if(!ee.isDir)continue;const ge=ee.path.startsWith(ue)?ee.path.slice(ue.length).replace(/^\/+/,""):ee.path;if(S(Se,ge||ee.name)&&(Ae.push({path:ee.path,name:ee.name,rel:ge||ee.name}),Ae.length>=c4))break;ne.depth+1<cke&&P.push({path:ee.path,depth:ne.depth+1})}Te===g&&(h.value=[...Ae])}Te===g&&(f.value=!1)}Qe(d,ce=>{b&&clearTimeout(b),F&&clearTimeout(F),E++,m.value="idle",A.value=[],x.value=null;const ue=ce.trim();if(ue===""){g++,h.value=[],f.value=!1;return}if(Cg(ue)){if(g++,h.value=[],f.value=!1,l.value)return;m.value="checking",F=setTimeout(()=>void R(ue),150);return}b=setTimeout(()=>void L(ce),220)});async function R(ce){const ue=++E;m.value="checking",x.value=null;const Se=iy(ce,$.value),{target:Te}=Se;try{const P=await o.browseFs(Te);if(ue!==E)return;if(P.path){m.value="valid",A.value=[],x.value=Te,a.value=P.path,c.value=P.parent,u.value=P.entries,l.value=!1;return}}catch{}if(ue!==E)return;const Ae=Se.base.toLowerCase();y.value=Se.parent,k.value=Se.separator;try{const P=await o.browseFs(Se.parent);if(ue!==E)return;if(P.path){A.value=P.entries.filter(le=>le.isDir&&le.name.toLowerCase().startsWith(Ae)),m.value="not-found";return}}catch{}ue===E&&(A.value=[],m.value="bad-parent")}function D(ce){d.value=Oye(y.value,ce,k.value),N.value?.focus()}const z=B(()=>l.value?n("workspace.degradedPlaceholder"):n("workspace.searchPlaceholder")),H=B(()=>l.value?n("workspace.degradedHint"):v.value&&m.value==="valid"?n("workspace.pathFollowHint"):n("workspace.browseHint"));function U(ce){if(ce.key==="Escape"){d.value?d.value="":s("close");return}if(ce.key!=="Enter")return;const ue=d.value.trim();if(Cg(ue)){if(ce.preventDefault(),l.value){const{target:Se}=iy(ue,$.value);Se&&s("add",Se);return}m.value==="valid"?oe():m.value==="not-found"&&A.value[0]&&D(A.value[0].name)}}const Z=B(()=>{const ce=a.value;if(!ce)return[];const ue=ce.split("/").filter(Boolean),Se=[{label:"/",path:"/"}];let Te="";for(const Ae of ue)Te+=`/${Ae}`,Se.push({label:Ae,path:Te});return Se}),K=B(()=>!(a.value.length===0||v.value&&I.value===null));async function V(ce){r.value=!0;try{const ue=await o.browseFs(ce);if(!ue.path){l.value=!0;return}a.value=ue.path,c.value=ue.parent,u.value=ue.entries,d.value="",l.value=!1}catch{l.value=!0}finally{r.value=!1}}function J(ce){ce.isDir&&V(ce.path)}function fe(){c.value&&V(c.value)}function oe(){K.value&&s("add",I.value??a.value)}return cn(async()=>{r.value=!0;try{const ce=await o.getFsHome().catch(()=>({home:"",recentRoots:[]}));if(ce.home&&($.value=ce.home),o.defaultPath&&(await V(o.defaultPath),!l.value))return;$.value?await V($.value):l.value=!0}catch{l.value=!0}finally{r.value=!1}}),bn(()=>{b&&clearTimeout(b),F&&clearTimeout(F)}),(ce,ue)=>(w(),xe(qr,{open:i.value,"onUpdate:open":ue[2]||(ue[2]=Se=>i.value=Se),title:C(n)("workspace.addTitle"),size:"lg",height:"fixed",onClose:ue[3]||(ue[3]=Se=>s("close"))},{default:Ee(()=>[_("div",Bye,[l.value?ae("",!0):(w(),T("div",Dye,[re(Pn,{size:"sm",disabled:!c.value,label:C(n)("workspace.up"),onClick:fe},{default:Ee(()=>[re(Ve,{name:"arrow-up",size:"md"})]),_:1},8,["disabled","label"]),_("div",Pye,[(w(!0),T(Pe,null,ot(Z.value,(Se,Te)=>(w(),T(Pe,{key:Se.path},[Te>1?(w(),T("span",Hye,"/")):ae("",!0),_("button",{class:We(["crumb",{last:Te===Z.value.length-1}]),onClick:Ae=>V(Se.path)},O(Se.label),11,Wye)],64))),128))])])),!r.value||l.value?(w(),T("div",{key:1,class:We(["filterbar",{"has-error":m.value==="not-found"||m.value==="bad-parent"}])},[re(Ve,{class:"filter-icon",name:"search",size:"md"}),Fn(_("input",{ref_key:"filterEl",ref:N,"onUpdate:modelValue":ue[0]||(ue[0]=Se=>d.value=Se),class:"filter-input",type:"text",placeholder:z.value,autocomplete:"off",spellcheck:"false",onKeydown:bt(U,["stop"])},null,40,zye),[[_s,d.value]]),f.value||m.value==="checking"?(w(),xe(Ds,{key:0,size:"sm"})):ae("",!0)],2)):ae("",!0),l.value?(w(),T("div",ske,O(C(n)("workspace.degradedHint")),1)):(w(),T("div",Uye,[r.value?(w(),T("div",qye,O(C(n)("workspace.browsing")),1)):v.value&&m.value!=="valid"?(w(),T(Pe,{key:1},[m.value==="checking"?(w(),T("div",jye,O(C(n)("workspace.checkingPath")),1)):m.value==="not-found"?(w(),T(Pe,{key:1},[A.value.length>0?(w(),T("div",Vye,O(C(n)("workspace.pathPickHint")),1)):ae("",!0),(w(!0),T(Pe,null,ot(A.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>D(Se.name)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Gye,O(Se.name),1)],8,Kye))),128)),A.value.length===0?(w(),T("div",Yye,O(C(n)("workspace.noPathMatch",{parent:y.value})),1)):ae("",!0)],64)):m.value==="bad-parent"?(w(),T("div",Zye,O(C(n)("workspace.badParent",{parent:y.value})),1)):ae("",!0)],64)):p.value&&!v.value?(w(),T(Pe,{key:2},[(w(!0),T(Pe,null,ot(h.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>V(Se.path)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",Xye,O(Se.rel),1)],8,Qye))),128)),!f.value&&h.value.length===0?(w(),T("div",Jye,O(C(n)("workspace.noFilterMatch",{q:d.value.trim()})),1)):f.value&&h.value.length===0?(w(),T("div",eke,O(C(n)("workspace.searching")),1)):ae("",!0)],64)):(w(),T(Pe,{key:3},[(w(!0),T(Pe,null,ot(u.value,Se=>(w(),T("button",{key:Se.path,class:"folder-row",onClick:Te=>J(Se)},[re(Ve,{class:"dir-icon",name:"folder-closed",size:"sm"}),_("span",nke,O(Se.name),1)],8,tke))),128)),u.value.length===0?(w(),T("div",oke,O(C(n)("workspace.noSubfolders")),1)):ae("",!0)],64))])),e.error?(w(),T("div",ike,O(e.error),1)):ae("",!0),_("div",rke,[re(Xt,{text:a.value},{default:Ee(()=>[l.value?ae("",!0):(w(),xe(Bt,{key:0,variant:"primary",disabled:!K.value,onClick:oe},{default:Ee(()=>[Je(O(C(n)("workspace.openThisFolder")),1)]),_:1},8,["disabled"]))]),_:1},8,["text"]),re(Bt,{variant:"secondary",onClick:ue[1]||(ue[1]=Se=>s("close"))},{default:Ee(()=>[Je(O(C(n)("workspace.cancel")),1)]),_:1})]),_("div",lke,O(H.value),1)])]),_:1},8,["open","title"]))}}),dke=ct(uke,[["__scopeId","data-v-07cbb13d"]]),fke={key:0,class:"confirm-dialog__message"},hke=Ze({__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}=Tt();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),po(()=>{typeof window<"u"&&window.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(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:Ee(()=>[re(Bt,{variant:"secondary",disabled:e.loading,onClick:i},{default:Ee(()=>[Je(O(e.cancelLabel??C(s)("common.cancel")),1)]),_:1},8,["disabled"]),re(Bt,{class:"confirm-dialog__confirm",variant:e.variant,loading:e.loading,onClick:a[0]||(a[0]=c=>o("confirm"))},{default:Ee(()=>[Je(O(e.confirmLabel??C(s)("common.confirm")),1)]),_:1},8,["variant","loading"])]),default:Ee(()=>[e.message?(w(),T("p",fke,O(e.message),1)):ae("",!0)]),_:1},8,["open","title","close-on-esc","close-on-overlay"]))}}),pke=ct(hke,[["__scopeId","data-v-2e719024"]]),mke=Ze({__name:"ConfirmDialogHost",setup(e){const{current:t,busy:n,settle:o,runAction:s}=tf();function i(){s()}return(r,l)=>(w(),xe(pke,{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"]))}}),gke={class:"rows"},vke={class:"row"},yke={class:"row"},kke={class:"row"},bke={class:"row"},xke={class:"row"},wke={class:"row"},_ke={class:"ctx-text"},Ske={key:0,class:"bar"},Cke={class:"row"},Ake=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t,i=X(!0),r=B(()=>o.status.ctxMax<=0?0:Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100)))),l=B(()=>o.status.ctxMax>0?n("status.statusContextValue",{used:ir(o.status.ctxUsed),max:ir(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=B(()=>{const p=o.status.permission;return p==="yolo"?"var(--color-danger)":p==="auto"?"var(--color-warning)":"var(--color-text)"}),u=B(()=>o.planMode?n("status.planOn"):n("status.planOff")),d=B(()=>o.swarmMode?n("status.swarmOn"):n("status.swarmOff")),f=B(()=>typeof o.costUsd=="number"&&o.costUsd>0),h=B(()=>f.value?`$${o.costUsd.toFixed(4)}`:n("status.statusNone"));return(p,g)=>(w(),xe(qr,{open:i.value,"onUpdate:open":g[0]||(g[0]=b=>i.value=b),title:C(n)("status.statusPanelTitle"),onClose:g[1]||(g[1]=b=>s("close"))},{default:Ee(()=>[_("dl",gke,[_("div",vke,[_("dt",null,O(C(n)("status.statusModel")),1),_("dd",null,O(e.status.model),1)]),_("div",yke,[_("dt",null,O(C(n)("status.statusThinking")),1),_("dd",null,O(e.thinking),1)]),_("div",kke,[_("dt",null,O(C(n)("status.statusPermission")),1),_("dd",{style:Yt({color:c.value})},O(a(e.status.permission)),5)]),_("div",bke,[_("dt",null,O(C(n)("status.statusPlanMode")),1),_("dd",{class:We({"plan-on":e.planMode})},O(u.value),3)]),_("div",xke,[_("dt",null,O(C(n)("status.statusSwarmMode")),1),_("dd",{class:We({"swarm-on":e.swarmMode})},O(d.value),3)]),_("div",wke,[_("dt",null,O(C(n)("status.statusContext")),1),_("dd",null,[_("span",_ke,O(l.value),1),e.status.ctxMax>0?(w(),T("span",Ske,[_("i",{style:Yt({width:r.value+"%"})},null,4)])):ae("",!0)])]),_("div",Cke,[_("dt",null,O(C(n)("status.statusCost")),1),_("dd",null,O(h.value),1)])])]),_:1},8,["open","title"]))}}),Mke=ct(Ake,[["__scopeId","data-v-39844d89"]]),Eke={class:"ui-toast__icon","aria-hidden":"true"},Tke={class:"ui-toast__body"},Nke={class:"ui-toast__title"},Ike={key:0,class:"ui-toast__msg"},Lke=Ze({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{default:"Dismiss"}},emits:["dismiss"],setup(e){return(t,n)=>(w(),T("div",{class:We(["ui-toast",`ui-toast--${e.variant}`])},[_("span",Eke,[On(t.$slots,"icon",{},()=>[e.variant==="success"?(w(),xe(Ve,{key:0,name:"check"})):e.variant==="danger"?(w(),xe(Ve,{key:1,name:"close"})):e.variant==="warning"?(w(),xe(Ve,{key:2,name:"alert-triangle"})):(w(),xe(Ve,{key:3,name:"info"}))],!0)]),_("div",Tke,[_("div",Nke,O(e.title),1),e.message?(w(),T("div",Ike,O(e.message),1)):ae("",!0),On(t.$slots,"default",{},void 0,!0)]),re(Pn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel,onClick:n[0]||(n[0]=o=>t.$emit("dismiss"))},{default:Ee(()=>[re(Ve,{name:"close",size:"sm"})]),_:1},8,["label"])],2))}}),$ke=ct(Lke,[["__scopeId","data-v-adc6f346"]]),Fke={key:0,class:"actions"},Oke=["onClick"],Rke=["onClick"],Bke={key:1,class:"details"},Dke=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,o=t,{t:s}=Tt();function i(x){return typeof x=="object"&&x!==null}function r(x){return i(x)?x.title:x}function l(x){return i(x)?x.message??"":""}function a(x){return i(x)?x.details:void 0}function c(x){return i(x)?x.severity==="error":x.startsWith(`${s("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(x)}function u(x){return i(x)?`notice:${x.severity}:${x.title}:${x.message??""}:${JSON.stringify(x.details??[])}`:`text:${x}`}function d(x){if(!i(x))return x;const I=[x.title];x.message&&I.push(x.message);const E=x.details??[];if(E.length>0){I.push("",`${s("warnings.diagnostics")}:`);for(const F of E)I.push(`${F.label}: ${F.value}`)}return I.join(`
325
- `)}let f=1;const h=X([]),p=new Map,g=new Map;function b(x){const I=c(x)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?I+5e3:I}function v(x,I){const E=p.get(x)??{handle:null,deadline:0,remaining:0};E.handle=setTimeout(()=>N(x),I),E.deadline=Date.now()+I,p.set(x,E)}function m(x){const I=p.get(x);I&&I.handle!==null&&clearTimeout(I.handle),p.delete(x)}function y(x){const I=p.get(x);!I||I.handle===null||(clearTimeout(I.handle),I.handle=null,I.remaining=Math.max(0,I.deadline-Date.now()))}function k(x){if(h.value.find(F=>F.id===x)?.detailsOpen)return;const E=p.get(x);!E||E.handle!==null||v(x,E.remaining)}function A(x){x.detailsOpen=!x.detailsOpen,x.detailsOpen?y(x.id):k(x.id)}async function $(x){if(!await Go(d(x.warning)))return;x.copied=!0;const E=g.get(x.id);E&&clearTimeout(E),g.set(x.id,setTimeout(()=>{x.copied=!1,g.delete(x.id)},1400))}function N(x){m(x);const I=g.get(x);I&&clearTimeout(I),g.delete(x);const E=h.value.findIndex(F=>F.id===x);E!==-1&&(h.value=h.value.filter(F=>F.id!==x),o("dismiss",E))}return Qe(()=>n.warnings,x=>{const I=[...h.value];h.value=x.map(E=>{const F=u(E),S=I.findIndex(D=>D.key===F),L=S===-1?void 0:I.splice(S,1)[0];if(L)return L.warning=E,L;const R={id:f++,key:F,warning:E,detailsOpen:!1,copied:!1};return v(R.id,b(E)),R});for(const E of I){m(E.id);const F=g.get(E.id);F&&clearTimeout(F),g.delete(E.id)}},{immediate:!0,flush:"post"}),bn(()=>{p.forEach(x=>{x.handle!==null&&clearTimeout(x.handle)}),p.clear(),g.forEach(x=>clearTimeout(x)),g.clear()}),(x,I)=>(w(),xe(J9,{name:"toast",tag:"div",class:"toasts",role:"status","aria-live":"polite"},{default:Ee(()=>[(w(!0),T(Pe,null,ot(h.value,E=>(w(),xe($ke,{key:E.id,variant:c(E.warning)?"danger":"warning",title:r(E.warning),message:l(E.warning),"dismiss-label":C(s)("warnings.dismiss"),onDismiss:F=>N(E.id),onPointerenter:F=>y(E.id),onPointerleave:F=>k(E.id)},{default:Ee(()=>[a(E.warning)?.length?(w(),T("div",Fke,[_("button",{class:"link",type:"button",onClick:F=>A(E)},O(E.detailsOpen?C(s)("warnings.hideDetails"):C(s)("warnings.showDetails")),9,Oke),_("button",{class:"link",type:"button",onClick:F=>$(E)},O(E.copied?C(s)("warnings.copied"):C(s)("warnings.copyDetails")),9,Rke)])):ae("",!0),E.detailsOpen&&a(E.warning)?.length?(w(),T("dl",Bke,[(w(!0),T(Pe,null,ot(a(E.warning),F=>(w(),T("div",{key:`${F.label}:${F.value}`,class:"detail-row"},[_("dt",null,O(F.label),1),_("dd",null,O(F.value),1)]))),128))])):ae("",!0)]),_:2},1032,["variant","title","message","dismiss-label","onDismiss","onPointerenter","onPointerleave"]))),128))]),_:1}))}}),Pke=ct(Dke,[["__scopeId","data-v-6cc72bd4"]]),Hke={class:"topbar"},Wke={class:"wsq"},zke=["aria-label"],Uke={class:"tb-path"},qke={class:"ws"},jke={class:"se"},Vke={class:"tb-sub"},Kke=Ze({__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}=Tt(),o=e,s=t,i=B(()=>{const a=o.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=B(()=>o.workspace?.name??n("workspace.noWorkspace")),l=B(()=>o.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(w(),T("div",Hke,[_("span",Wke,O(i.value),1),_("button",{type:"button",class:"tb-mid","aria-label":C(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>s("openSwitcher"))},[_("span",Uke,[_("span",qke,O(r.value),1),e.sessionTitle?(w(),T(Pe,{key:0},[c[2]||(c[2]=_("span",{class:"sl"},"/",-1)),_("span",jke,O(e.sessionTitle),1)],64)):ae("",!0),c[3]||(c[3]=_("span",{class:"cv"},"⌄",-1))]),_("span",Vke,[_("span",{class:We(["rd",{on:e.running}])},null,2),_("span",null,O(l.value),1),e.branch?(w(),T(Pe,{key:0},[Je(" · "+O(e.branch),1)],64)):ae("",!0),e.sessionCount>0?(w(),T(Pe,{key:1},[Je(" · "+O(C(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):ae("",!0)])],8,zke),re(Pn,{size:"lg",label:C(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>s("openSettings"))},{default:Ee(()=>[re(Ve,{name:"sliders",size:"lg"})]),_:1},8,["label"])]))}}),Gke=ct(Kke,[["__scopeId","data-v-6b4b901f"]]),Yke={key:0,class:"sheet-root"},Zke=["aria-label"],Qke=["aria-label"],Xke={key:0,class:"sheet-head"},Jke={class:"sheet-title"},e2e={class:"sheet-body"},t2e=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=Tt(),o=e,s=t;function i(){s("update:modelValue",!1),s("close")}function r(l){l.key==="Escape"&&i()}return Qe(()=>o.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),bn(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(w(),xe(Il,{name:"sheet"},{default:Ee(()=>[e.modelValue?(w(),T("div",Yke,[_("div",{class:"sheet-scrim",onClick:i}),_("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||C(n)("mobile.sheetLabel")},[_("button",{type:"button",class:"sheet-grab","aria-label":C(n)("mobile.closeSheet"),onClick:i},null,8,Qke),e.title?(w(),T("div",Xke,[_("span",Jke,O(e.title),1)])):ae("",!0),_("div",e2e,[On(l.$slots,"default",{},void 0,!0)])],8,Zke)])):ae("",!0)]),_:3}))}}),N8=ct(t2e,[["__scopeId","data-v-745ee5a2"]]),n2e={class:"mlist"},o2e={key:0,class:"mempty"},s2e=["onClick"],i2e={class:"mgh-main"},r2e={class:"mgh-name"},l2e={class:"mgh-path"},a2e={key:2,class:"att"},c2e={key:0,class:"mempty small"},u2e=["onClick"],d2e={class:"m"},f2e={class:"s"},h2e={key:0,class:"att"},p2e=["disabled","onClick"],m2e=["onClick"],g2e=Ze({__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}=Tt(),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=X(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,y.value=null,N.value=null}const h=X(new Set);function p(F){return h.value.has(F)}function g(F){const S=new Set(h.value);S.has(F)?S.delete(F):S.add(F),h.value=S}function b(F){if(p(F.workspace.id))return F.sessions;const S=F.sessions.slice(0,F.initialCount);if(o.activeId&&!S.some(L=>L.id===o.activeId)){const L=F.sessions.find(R=>R.id===o.activeId);if(L)return[...S,L]}return S}function v(F){if(!h.value.has(F)){const S=new Set(h.value);S.add(F),h.value=S}s("loadMore",F)}function m(F){return o.attentionByWorkspace[F]??0}const y=X(null);function k(F){y.value=y.value===F?null:F,N.value=null}function A(F){y.value=null;const L=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();L&&s("rename",F.id,L)}function $(F){y.value=null,s("archive",F)}const N=X(null);function x(F){N.value=N.value===F?null:F,y.value=null}function I(F){Go(F.root),N.value=null}function E(F){N.value=null,s("deleteWorkspace",F.id)}return(F,S)=>(w(),xe(N8,{"model-value":e.modelValue,"onUpdate:modelValue":S[2]||(S[2]=L=>s("update:modelValue",L))},{default:Ee(()=>[_("button",{type:"button",class:"newrow",onClick:a},[re(Ve,{name:"message",size:"sm"}),Je(" "+O(C(n)("sidebar.newChat")),1)]),_("button",{type:"button",class:"newrow secondary",onClick:c},[re(Ve,{name:"folder",size:"sm"}),Je(" "+O(C(n)("sidebar.newWorkspace")),1)]),_("div",n2e,[e.groups.length===0?(w(),T("div",o2e,O(C(n)("workspace.noWorkspace")),1)):ae("",!0),(w(!0),T(Pe,null,ot(e.groups,L=>(w(),T("div",{key:L.workspace.id,class:"mgroup"},[_("div",{class:We(["mgh",{on:L.workspace.id===e.activeWorkspaceId}]),onClick:R=>f(L.workspace.id)},[d(L.workspace.id)?(w(),xe(Ve,{key:0,class:"mgh-folder",name:"folder-closed",size:"sm"})):(w(),xe(Ve,{key:1,class:"mgh-folder",name:"folder",size:"sm"})),_("div",i2e,[_("span",r2e,O(L.workspace.name),1),re(Xt,{text:L.workspace.root},{default:Ee(()=>[_("span",l2e,O(L.workspace.shortPath),1)]),_:2},1032,["text"])]),d(L.workspace.id)&&m(L.workspace.id)>0?(w(),T("span",a2e,O(m(L.workspace.id)),1)):ae("",!0),re(Pn,{size:"lg",class:"mgh-more",label:C(n)("sidebar.options"),onClick:bt(R=>x(L.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),re(Pn,{size:"lg",class:"mgh-add",label:C(n)("workspace.newInGroup"),onClick:bt(R=>l(L.workspace.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"plus",size:"md"})]),_:1},8,["label","onClick"]),N.value===L.workspace.id?(w(),xe(kl,{key:3,class:"kmenu wsmenu",onClick:S[0]||(S[0]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:R=>I(L.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.copyPath")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:R=>E(L.workspace)},{default:Ee(()=>[Je(O(C(n)("sidebar.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)):ae("",!0)],10,s2e),Fn(_("div",null,[L.sessions.length===0?(w(),T("div",c2e,O(C(n)("sidebar.noSessions")),1)):ae("",!0),(w(!0),T(Pe,null,ot(b(L),R=>(w(),T("div",{key:R.id,class:We(["srow",{cur:R.id===e.activeId}]),onClick:D=>r(R.id)},[_("div",d2e,[_("div",{class:We(["t",{run:R.busy,aborted:!R.busy&&(e.attentionBySession[R.id]??0)===0&&(R.lastTurnReason==="cancelled"||R.lastTurnReason==="failed")}])},O(R.title),3),_("div",f2e,O(R.time),1)]),(e.attentionBySession[R.id]??0)>0?(w(),T("span",h2e,O(e.attentionBySession[R.id]),1)):ae("",!0),re(Pn,{size:"lg",class:"kb",label:C(n)("sidebar.options"),onClick:bt(D=>k(R.id),["stop"])},{default:Ee(()=>[re(Ve,{name:"dots-horizontal",size:"md"})]),_:1},8,["label","onClick"]),y.value===R.id?(w(),xe(kl,{key:1,class:"kmenu",onClick:S[1]||(S[1]=bt(()=>{},["stop"]))},{default:Ee(()=>[re(pn,{size:"lg",onClick:D=>A(R)},{default:Ee(()=>[Je(O(C(n)("sidebar.rename")),1)]),_:1},8,["onClick"]),re(pn,{size:"lg",danger:"",onClick:D=>$(R.id)},{default:Ee(()=>[Je(O(C(n)("sidebar.archive")),1)]),_:1},8,["onClick"])]),_:2},1024)):ae("",!0)],10,u2e))),128)),L.hasMore||L.loadingMore?(w(),T("button",{key:1,type:"button",class:"mshow-more",disabled:L.loadingMore,onClick:bt(R=>v(L.workspace.id),["stop"])},O(L.loadingMore?C(n)("sidebar.loadingMore"):C(n)("sidebar.showMore",{count:Math.max(0,L.workspace.sessionCount-L.sessions.length)})),9,p2e)):ae("",!0),L.sessions.length>L.initialCount?(w(),T("button",{key:2,type:"button",class:"mshow-more",onClick:bt(R=>g(L.workspace.id),["stop"])},O(p(L.workspace.id)?C(n)("sidebar.showLess"):C(n)("sidebar.showAll",{count:L.sessions.length-L.initialCount})),9,m2e)):ae("",!0)],512),[[mi,!d(L.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),v2e=ct(g2e,[["__scopeId","data-v-df277098"]]),y2e={class:"group-title"},k2e={class:"srow-main"},b2e={class:"srow-label"},x2e={class:"srow-sub"},w2e={class:"srow read-only"},_2e={class:"srow-main"},S2e={class:"srow-label"},C2e={key:0,class:"srow-sub"},A2e={class:"cache-note"},M2e={class:"srow-main"},E2e={class:"srow-label"},T2e={class:"srow-sub"},N2e=["aria-checked"],I2e={class:"srow-main"},L2e={class:"srow-label"},$2e={class:"srow-sub"},F2e=["aria-checked"],O2e={class:"srow-main"},R2e={class:"srow-label"},B2e={class:"srow read-only"},D2e={class:"srow-main"},P2e={class:"srow-label"},H2e={class:"srow-sub"},W2e=["aria-label"],z2e={class:"group-title"},U2e={class:"srow-main"},q2e={class:"srow-label"},j2e={class:"srow-sub"},V2e={class:"srow read-only pref"},K2e={class:"srow-main"},G2e={class:"srow-label"},Y2e={class:"srow read-only pref"},Z2e={class:"srow-main"},Q2e={class:"srow-label"},X2e={class:"srow read-only pref"},J2e={class:"srow-main"},ebe={class:"srow-label"},tbe={class:"num-field"},nbe=["value","aria-label"],obe={class:"srow-main"},sbe={class:"srow-label"},ibe={class:"srow-sub"},rbe=["aria-checked"],lbe={class:"srow-main"},abe={class:"srow-label"},cbe={class:"srow-main"},ube={class:"srow-label"},dbe={key:2,class:"srow read-only"},fbe={class:"srow-main"},hbe={class:"srow-label"},pbe={class:"srow-val dim"},mbe={class:"arch-subhead"},gbe={class:"arch-count"},vbe={class:"arch-tools"},ybe={key:0,class:"arch-empty"},kbe={class:"arch-meta"},bbe={class:"arch-name"},xbe={class:"arch-time"},wbe={key:2,class:"arch-empty"},_be=100,Sbe=Ze({__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}=Tt(),o=e,s=t;function i(V){s("setColorScheme",V)}const r=["manual","auto","yolo"],l=B(()=>o.models?.find(V=>V.id===o.status?.modelId)),a=B(()=>Vm(l.value)),c=B(()=>Km(l.value)),u=B(()=>Pp(l.value,o.thinking)),d=B(()=>c.value.includes(u.value)?u.value:""),f=B(()=>c.value.map(V=>({value:V,label:Gv(V)}))),h=B(()=>o.planMode===!0),p=B(()=>o.swarmMode===!0),g=B(()=>{const V=o.status.permission;return V==="yolo"?"var(--color-danger)":V==="auto"?"var(--color-warning)":"var(--color-text-muted)"}),b=B(()=>{const V=o.status.permission,J=n(V==="yolo"?"mobile.permYoloSub":V==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${V} · ${J}`}),v=B(()=>o.status.ctxMax>0?Math.min(100,Math.max(0,Math.ceil(o.status.ctxUsed/o.status.ctxMax*100))):0),m=B(()=>o.status.ctxMax>0?`${ir(o.status.ctxUsed)}/${ir(o.status.ctxMax)}`:n("status.statusNone"));function y(V){s("setThinking",Uk(l.value,V))}function k(){const V=r.indexOf(o.status.permission),J=r[(V+1)%r.length];s("setPermission",J)}function A(){s("pickModel"),s("update:modelValue",!1)}function $(){s("login"),s("update:modelValue",!1)}function N(){s("logout"),s("update:modelValue",!1)}const x=m2(),I=X("main"),E=X([]),F=X(!1),S=X(!1),L=X(""),R=X("archived-desc");async function D(){if(!F.value){F.value=!0,S.value=!1;try{const V=[];let J;for(;;){const fe=await x.loadArchivedSessions({beforeId:J,pageSize:_be});if(V.push(...fe.items),!fe.hasMore||fe.items.length===0)break;const oe=fe.items.at(-1)?.id;if(oe===void 0)break;J=oe}E.value=V,S.value=!0}catch(V){console.warn("loadAllArchived failed",V)}finally{F.value=!1}}}function z(){I.value="archived",L.value="",D()}function H(){I.value="main"}const U=B(()=>{const V=L.value.trim().toLowerCase();let J=E.value.filter(fe=>fe.archived===!0);return V&&(J=J.filter(fe=>fe.title.toLowerCase().includes(V))),J=J.slice(),R.value==="archived-desc"?J.sort((fe,oe)=>oe.updatedAt.localeCompare(fe.updatedAt)):R.value==="created-desc"?J.sort((fe,oe)=>oe.createdAt.localeCompare(fe.createdAt)):J.sort((fe,oe)=>fe.title.localeCompare(oe.title,"zh")),J});async function Z(V){await x.restoreSession(V)&&(E.value=E.value.filter(fe=>fe.id!==V))}function K(V){const J=new Date(V);if(Number.isNaN(J.getTime()))return V;const fe=oe=>String(oe).padStart(2,"0");return`${J.getFullYear()}-${fe(J.getMonth()+1)}-${fe(J.getDate())} ${fe(J.getHours())}:${fe(J.getMinutes())}`}return Qe(()=>o.modelValue,V=>{V||(I.value="main")}),(V,J)=>(w(),xe(N8,{"model-value":e.modelValue,title:C(n)("mobile.settingsTitle"),"onUpdate:modelValue":J[6]||(J[6]=fe=>s("update:modelValue",fe))},{default:Ee(()=>[I.value==="main"?(w(),T(Pe,{key:0},[_("div",y2e,O(C(n)("mobile.groupSession")),1),_("button",{type:"button",class:"srow",onClick:A},[_("span",k2e,[_("span",b2e,O(C(n)("status.statusModel")),1),_("span",x2e,O(e.status.model),1)]),J[7]||(J[7]=_("span",{class:"chev"},"›",-1))]),_("div",w2e,[_("span",_2e,[_("span",S2e,O(C(n)("status.statusThinking")),1),a.value==="unsupported"?(w(),T("span",C2e,O(C(n)("status.modeNotSupported")),1)):ae("",!0)]),c.value.length>1?(w(),xe(gs,{key:0,"model-value":d.value,options:f.value,size:"sm","onUpdate:modelValue":y},null,8,["model-value","options"])):(w(),T("span",{key:1,class:We(["srow-val",{dim:u.value==="off"}])},O(u.value==="off"?C(n)("status.planOff"):C(Gv)(u.value)),3))]),_("div",A2e,O(C(n)("status.cacheNote")),1),_("button",{type:"button",class:"srow",onClick:J[0]||(J[0]=fe=>s("togglePlan"))},[_("span",M2e,[_("span",E2e,O(C(n)("status.statusPlanMode")),1),_("span",T2e,O(C(n)("mobile.planModeSub")),1)]),_("span",{class:We(["toggle",{on:h.value}]),role:"switch","aria-checked":h.value},null,10,N2e)]),_("button",{type:"button",class:"srow",onClick:J[1]||(J[1]=fe=>s("toggleSwarm"))},[_("span",I2e,[_("span",L2e,O(C(n)("status.statusSwarmMode")),1),_("span",$2e,O(C(n)("mobile.swarmModeSub")),1)]),_("span",{class:We(["toggle",{on:p.value}]),role:"switch","aria-checked":p.value},null,10,F2e)]),_("button",{type:"button",class:"srow",onClick:k},[_("span",O2e,[_("span",R2e,O(C(n)("status.statusPermission")),1),_("span",{class:"srow-sub",style:Yt({color:g.value})},O(b.value),5)]),J[8]||(J[8]=_("span",{class:"chev"},"›",-1))]),_("div",B2e,[_("span",D2e,[_("span",P2e,O(C(n)("status.statusContext")),1),_("span",H2e,O(m.value),1)]),_("span",{class:"ctx-meter","aria-label":m.value},[_("i",{style:Yt({width:v.value+"%"})},null,4)],8,W2e)]),_("div",z2e,O(C(n)("mobile.groupApp")),1),_("button",{type:"button",class:"srow",onClick:z},[_("span",U2e,[_("span",q2e,O(C(n)("mobile.archivedSessions")),1),_("span",j2e,O(C(n)("mobile.archivedSessionsSub")),1)]),J[9]||(J[9]=_("span",{class:"chev"},"›",-1))]),_("div",V2e,[_("span",K2e,[_("span",G2e,O(C(n)("theme.colorSchemeLabel")),1)]),re(gs,{"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"])]),_("div",Y2e,[_("span",Z2e,[_("span",Q2e,O(C(n)("sidebar.language")),1)]),re(E8)]),_("div",X2e,[_("span",J2e,[_("span",ebe,O(C(n)("settings.uiFontSize")),1)]),_("label",tbe,[_("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]=fe=>s("setUiFontSize",Number(fe.target.value)))},null,40,nbe),J[10]||(J[10]=_("span",{class:"num-unit"},"px",-1))])]),_("button",{type:"button",class:"srow",onClick:J[3]||(J[3]=fe=>s("setConversationToc",!e.conversationToc))},[_("span",obe,[_("span",sbe,O(C(n)("settings.conversationToc")),1),_("span",ibe,O(C(n)("settings.conversationTocHint")),1)]),_("span",{class:We(["toggle",{on:e.conversationToc}]),role:"switch","aria-checked":e.conversationToc},null,10,rbe)]),e.authReady?(w(),T("button",{key:0,type:"button",class:"srow acct out",onClick:N},[_("span",lbe,[_("span",abe,O(C(n)("sidebar.signOut")),1)])])):(w(),T("button",{key:1,type:"button",class:"srow acct in",onClick:$},[_("span",cbe,[_("span",ube,O(C(n)("sidebar.signIn")),1)])])),e.serverVersion?(w(),T("div",dbe,[_("span",fbe,[_("span",hbe,O(C(n)("settings.serverVersion")),1)]),_("span",pbe,O(e.serverVersion),1)])):ae("",!0)],64)):(w(),T(Pe,{key:1},[_("div",mbe,[_("button",{type:"button",class:"arch-back",onClick:H},[J[11]||(J[11]=_("span",{class:"chev back"},"‹",-1)),Je(" "+O(C(n)("mobile.archivedBack")),1)]),_("span",gbe,O(C(n)("mobile.sessionCount",{n:U.value.length})),1)]),_("div",vbe,[re(Kc,{class:"arch-search-input","model-value":L.value,size:"sm",placeholder:C(n)("settings.archivedSearch"),"onUpdate:modelValue":J[4]||(J[4]=fe=>L.value=fe)},null,8,["model-value","placeholder"]),re(gs,{size:"sm","model-value":R.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[5]||(J[5]=fe=>R.value=fe)},null,8,["model-value","options"])]),F.value?(w(),T("div",ybe,O(C(n)("settings.archivedLoadingAll")),1)):U.value.length>0?(w(!0),T(Pe,{key:1},ot(U.value,fe=>(w(),T("div",{key:fe.id,class:"arch-row"},[_("div",kbe,[_("div",bbe,O(fe.title),1),_("div",xbe,O(C(n)("settings.archivedAt",{time:K(fe.updatedAt)})),1)]),re(Bt,{variant:"secondary",size:"sm",onClick:oe=>Z(fe.id)},{default:Ee(()=>[Je(O(C(n)("settings.archivedRestore")),1)]),_:1},8,["onClick"])]))),128)):(w(),T("div",wbe,O(E.value.length===0?C(n)("settings.archivedEmpty"):C(n)("settings.archivedNoMatch")),1))],64))]),_:1},8,["model-value","title"]))}}),Cbe=ct(Sbe,[["__scopeId","data-v-c244b2fe"]]),Abe={class:"ob-brand"},Mbe={class:"ob-brand-text"},Ebe={class:"ob-title"},Tbe={class:"ob-sub"},Nbe={class:"ob-sec"},Ibe={class:"ob-label"},Lbe={class:"ob-sec"},$be={class:"ob-label"},Fbe={class:"ob-sec"},Obe={class:"ob-label"},Rbe=Ze({__name:"Onboarding",emits:["complete","skip"],setup(e,{emit:t}){const n=t,{t:o,locale:s}=Tt(),{colorScheme:i,accent:r,setColorScheme:l,setAccent:a}=z5();function c(d){s.value!==d&&SA(d)}function u(){n("complete")}return(d,f)=>(w(),xe(qr,{open:!0,size:"md","close-on-overlay":!1,"close-on-esc":!1,onClose:f[3]||(f[3]=h=>n("skip"))},{head:Ee(()=>[_("div",Abe,[f[4]||(f[4]=_("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Kimi Code"},[_("defs",null,[_("mask",{id:"obKimiEyes",maskUnits:"userSpaceOnUse"},[_("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),_("g",{class:"ob-eyes",fill:"#000"},[_("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),_("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),_("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--color-accent)",mask:"url(#obKimiEyes)"})],-1)),_("div",Mbe,[_("div",Ebe,O(C(o)("onboarding.title")),1),_("div",Tbe,O(C(o)("onboarding.subtitle")),1)])])]),default:Ee(()=>[_("section",Nbe,[_("div",Ibe,O(C(o)("onboarding.languageLabel")),1),re(gs,{"model-value":C(s),options:C(_A).map(h=>({value:h.code,label:h.label})),"onUpdate:modelValue":f[0]||(f[0]=h=>c(h))},null,8,["model-value","options"])]),_("section",Lbe,[_("div",$be,O(C(o)("theme.colorSchemeLabel")),1),re(gs,{"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"])]),_("section",Fbe,[_("div",Obe,O(C(o)("theme.accentLabel")),1),re(gs,{"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"])]),re(Bt,{variant:"primary",size:"lg",class:"ob-start",onClick:u},{default:Ee(()=>[Je(O(C(o)("onboarding.start")),1)]),_:1})]),_:1}))}}),Bbe=ct(Rbe,[["__scopeId","data-v-fbdd3eab"]]),Dbe=["aria-label"],Pbe={class:"gload-box"},Hbe={class:"gload-text"},Wbe={key:0,class:"gload-issue"},zbe={class:"gload-issue-detail"},Ube=Ze({__name:"GlobalLoading",props:{issue:{}},setup(e){const{t}=Tt();return(n,o)=>(w(),T("div",{class:"gload",role:"status","aria-label":C(t)("app.connecting")},[_("div",Pbe,[o[0]||(o[0]=Ay('<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)),re(Ds,{size:"md",label:C(t)("app.connecting")},null,8,["label"]),_("div",Hbe,O(C(t)("app.connecting")),1),e.issue?(w(),T("div",Wbe,[_("div",null,O(C(t)("app.connectRetrying")),1),_("div",zbe,O(e.issue),1)])):ae("",!0)])],8,Dbe))}}),qbe=ct(Ube,[["__scopeId","data-v-0b6dec6a"]]),jbe={class:"kap-root"},Vbe={class:"kap-head"},Kbe={class:"kap-count"},Gbe={class:"kap-head-actions"},Ybe={class:"kap-filters"},Zbe=["value"],Qbe={class:"kap-check"},Xbe={class:"kap-check"},Jbe={class:"kap-view-toggle",role:"group"},exe={key:0,class:"kap-empty"},txe=["onClick"],nxe={class:"kap-ts"},oxe={class:"kap-label"},sxe={key:0,class:"kap-detail"},ixe={class:"kap-detail-actions"},rxe=["onClick"],lxe={key:1,class:"kap-agg"},axe={class:"mono"},cxe={class:"mono"},uxe={class:"num"},dxe={class:"num"},fxe={key:0},hxe={class:"mono"},pxe={class:"num"},mxe={class:"num"},gxe={key:0},vxe=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,o=X("all"),s=X(""),i=X(""),r=X(!1),l=X("timeline"),a=B(()=>(Ik.value,[...Wte()])),c=B(()=>{const I=new Set;for(const E of a.value)E.sessionId&&I.add(E.sessionId);return[...I].sort()});function u(I){return I.kind==="rest:error"||I.code!==void 0&&I.code!==0||I.eventType==="error"||I.eventType==="parse-error"}const d=B(()=>{const I=s.value.trim().toLowerCase();return a.value.filter(E=>!(o.value!=="all"&&E.source!==o.value||i.value&&E.sessionId!==i.value||r.value&&!u(E)||I&&!`${E.label} ${E.kind} ${E.eventType??""} ${E.sessionId??""} ${E.requestId??""}`.toLowerCase().includes(I)))}),f=B(()=>{const I=new Map;for(const E of d.value){if(E.kind!=="ws:in"&&E.kind!=="ws:out")continue;const F=E.kind==="ws:in"?"←":"→",S=`${F} ${E.eventType??"?"} @ ${E.sessionId??"-"}`,L=I.get(S)??{key:S,sessionId:E.sessionId??"-",eventType:E.eventType??"?",dir:F,count:0};L.count++,E.seq!==void 0&&(L.lastSeq=E.seq),I.set(S,L)}return[...I.values()].sort((E,F)=>F.count-E.count)}),h=B(()=>{const I=new Map;for(const E of d.value){if(E.source!=="rest"||E.kind==="rest:request")continue;const F=`${E.method??"?"} ${E.path??"?"}`,S=I.get(F)??{count:0,errors:0,totalMs:0,timed:0};S.count++,u(E)&&S.errors++,E.durationMs!==void 0&&(S.totalMs+=E.durationMs,S.timed++),I.set(F,S)}return[...I.entries()].map(([E,F])=>({key:E,count:F.count,errors:F.errors,avgMs:F.timed>0?Math.round(F.totalMs/F.timed):0})).sort((E,F)=>F.count-E.count)}),p=X(null),g=X(!0),b=X(null),v=X(null);Qe(()=>d.value.length,async()=>{if(!g.value||l.value!=="timeline")return;await mt();const I=b.value;I&&(I.scrollTop=I.scrollHeight)});function m(I){p.value=p.value===I?null:I}function y(I){const E=new Date(I),F=(S,L=2)=>String(S).padStart(L,"0");return`${F(E.getHours())}:${F(E.getMinutes())}:${F(E.getSeconds())}.${F(E.getMilliseconds(),3)}`}function k(I){return JSON.stringify(I,null,2)}async function A(I){await Go(k(I))&&(v.value=I.id,setTimeout(()=>{v.value===I.id&&(v.value=null)},1500))}function $(){h5(d.value)}function N(I){return u(I)||I.source==="client"?"b-err":I.source==="rest"?"b-rest":I.kind==="ws:lifecycle"?"b-life":I.kind==="ws:out"?"b-out":"b-in"}function x(I){return I.source==="rest"?"REST":I.source==="client"?"APP":"WS"}return(I,E)=>(w(),T("section",jbe,[_("header",Vbe,[E[11]||(E[11]=_("strong",null,"KAP debug",-1)),_("span",Kbe,O(d.value.length)+"/"+O(a.value.length),1),_("div",Gbe,[_("button",{type:"button",class:We({on:C(Gu)}),onClick:E[0]||(E[0]=F=>Gu.value=!C(Gu))},O(C(Gu)?"resume":"pause"),3),_("button",{type:"button",onClick:E[1]||(E[1]=F=>C(zte)())},"clear"),_("button",{type:"button",onClick:E[2]||(E[2]=F=>$())},"export jsonl"),re(Xt,{text:"Close window"},{default:Ee(()=>[_("button",{type:"button",onClick:E[3]||(E[3]=F=>n("close"))},"✕")]),_:1})])]),_("div",Ybe,[Fn(_("select",{"onUpdate:modelValue":E[4]||(E[4]=F=>o.value=F),"aria-label":"Source filter"},[...E[12]||(E[12]=[_("option",{value:"all"},"rest + ws + app",-1),_("option",{value:"rest"},"rest",-1),_("option",{value:"ws"},"ws",-1),_("option",{value:"client"},"app errors",-1)])],512),[[qg,o.value]]),Fn(_("select",{"onUpdate:modelValue":E[5]||(E[5]=F=>i.value=F),"aria-label":"Session filter"},[E[13]||(E[13]=_("option",{value:""},"all sessions",-1)),(w(!0),T(Pe,null,ot(c.value,F=>(w(),T("option",{key:F,value:F},O(F),9,Zbe))),128))],512),[[qg,i.value]]),Fn(_("input",{"onUpdate:modelValue":E[6]||(E[6]=F=>s.value=F),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[_s,s.value]]),_("label",Qbe,[Fn(_("input",{"onUpdate:modelValue":E[7]||(E[7]=F=>r.value=F),type:"checkbox"},null,512),[[np,r.value]]),E[14]||(E[14]=Je(" errors",-1))]),_("label",Xbe,[Fn(_("input",{"onUpdate:modelValue":E[8]||(E[8]=F=>g.value=F),type:"checkbox"},null,512),[[np,g.value]]),E[15]||(E[15]=Je(" follow",-1))]),_("div",Jbe,[_("button",{type:"button",class:We({on:l.value==="timeline"}),onClick:E[9]||(E[9]=F=>l.value="timeline")},"timeline",2),_("button",{type:"button",class:We({on:l.value==="aggregate"}),onClick:E[10]||(E[10]=F=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(w(),T("div",{key:0,ref_key:"listRef",ref:b,class:"kap-list"},[d.value.length===0?(w(),T("div",exe," No trace entries yet. REST calls and WS frames will appear here. ")):ae("",!0),(w(!0),T(Pe,null,ot(d.value,F=>(w(),T("div",{key:F.id,class:"kap-row-wrap"},[_("button",{type:"button",class:We(["kap-row",{expanded:p.value===F.id}]),onClick:S=>m(F.id)},[_("span",nxe,O(y(F.ts)),1),_("span",{class:We(["kap-badge",N(F)])},O(x(F)),3),_("span",oxe,O(F.label),1)],10,txe),p.value===F.id?(w(),T("div",sxe,[_("div",ixe,[_("button",{type:"button",onClick:S=>A(F)},O(v.value===F.id?"copied ✓":"copy json"),9,rxe)]),_("pre",null,O(k(F)),1)])):ae("",!0)]))),128))],512)):(w(),T("div",lxe,[E[20]||(E[20]=_("h4",null,"WS frames by session / type",-1)),_("table",null,[E[17]||(E[17]=_("thead",null,[_("tr",null,[_("th",null,"dir"),_("th",null,"type"),_("th",null,"session"),_("th",null,"count"),_("th",null,"last seq")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(f.value,F=>(w(),T("tr",{key:F.key},[_("td",null,O(F.dir),1),_("td",axe,O(F.eventType),1),_("td",cxe,O(F.sessionId),1),_("td",uxe,O(F.count),1),_("td",dxe,O(F.lastSeq??"—"),1)]))),128)),f.value.length===0?(w(),T("tr",fxe,[...E[16]||(E[16]=[_("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):ae("",!0)])]),E[21]||(E[21]=_("h4",null,"REST by endpoint",-1)),_("table",null,[E[19]||(E[19]=_("thead",null,[_("tr",null,[_("th",null,"endpoint"),_("th",null,"count"),_("th",null,"errors"),_("th",null,"avg ms")])],-1)),_("tbody",null,[(w(!0),T(Pe,null,ot(h.value,F=>(w(),T("tr",{key:F.key},[_("td",hxe,O(F.key),1),_("td",pxe,O(F.count),1),_("td",{class:We(["num",{err:F.errors>0}])},O(F.errors),3),_("td",mxe,O(F.avgMs),1)]))),128)),h.value.length===0?(w(),T("tr",gxe,[...E[18]||(E[18]=[_("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):ae("",!0)])])]))]))}}),yxe=ct(vxe,[["__scopeId","data-v-3cda6fe3"]]),kxe=Ze({__name:"DebugPanel",setup(e){const t=X(!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=op(yxe,{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()}),po(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(w(),xe(Xt,{text:t.value?"Focus KAP debug window":"Open KAP debug window"},{default:Ee(()=>[_("button",{class:"kap-fab",type:"button",onClick:c}," KAP ")]),_:1},8,["text"]))}}),bxe=ct(kxe,[["__scopeId","data-v-21346738"]]);function xxe({client:e,authLogoRef:t}){const n=B(()=>e.authReady.value),o=B(()=>e.initialized.value&&!n.value),s="/login",i=X(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)}Qe(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 bn(()=>{r!==null&&clearTimeout(r)}),{showAuthGate:o,blinkAuthLogo:c}}function wxe({running:e,showAuthGate:t}){const{t:n}=Tt(),o=["◐","◓","◑","◒"],s=X(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}Qe(e,c=>{c?r():l()},{immediate:!0});const a=B(()=>{const c=e.value?`${o[s.value]} `:"";return t.value?`${c}${n("app.authPageTitle")} - Kimi Code Web`:`${c}Kimi Code Web`});mT(()=>{typeof document<"u"&&(document.title=a.value)}),bn(()=>{l()})}const I8=X(typeof window>"u"?0:window.innerWidth);let ph=0,Yp=!1;function ry(){I8.value=window.innerWidth}function _xe(){Yp||typeof window>"u"||(window.addEventListener("resize",ry),Yp=!0,ry())}function Sxe(){!Yp||typeof window>"u"||(window.removeEventListener("resize",ry),Yp=!1)}function L8(e,t,n){return Math.max(t,e-n)}function ly(e,t,n){return Math.min(n,Math.max(t,e))}function $8(){return cn(()=>{ph+=1,_xe()}),po(()=>{ph=Math.max(0,ph-1),ph===0&&Sxe()}),{viewportWidth:I8}}const Cxe="kimi-web.file-preview-width",xc=320;function Axe({client:e,sideWidth:t,detailTarget:n,closeFilePreview:o}){const{viewportWidth:s}=$8(),i=B(()=>Math.max(0,s.value-t.value)),r=B(()=>L8(i.value,xc,xc));function l(ne){return ly(Math.round(ne),xc,r.value)}function a(){return l(i.value/2)}const c=B(()=>a()),u=X(c.value),d=B(()=>ly(u.value,xc,r.value)),f=X(null),h=B(()=>{const ne=f.value;if(!ne)return null;const ee=e.turns.value.find(ge=>ge.id===ne.turnId)?.blocks?.[ne.blockIndex];return ee?.kind==="thinking"?ee.thinking:null}),p=B(()=>h.value!==null);function g(ne){const q=f.value;if(q&&q.turnId===ne.turnId&&q.blockIndex===ne.blockIndex){f.value=null,n.value==="thinking"&&(n.value=null);return}n.value="thinking",f.value=ne}function b(){f.value=null,n.value==="thinking"&&(n.value=null)}const v=X(null),m=B(()=>{const ne=v.value;if(!ne)return null;const q=e.turns.value.find(ee=>ee.id===ne.turnId);return q?.role==="compaction"&&q.text?q.text:null}),y=B(()=>m.value!==null);function k(ne){if(v.value?.turnId===ne.turnId){v.value=null,n.value==="compaction"&&(n.value=null);return}n.value="compaction",v.value=ne}function A(){v.value=null,n.value==="compaction"&&(n.value=null)}const $=X(null);function N(ne){const q=e.activeAppTasks.value,ee=q.find(de=>de.id===ne)??q.find(de=>de.parentToolCallId===ne);if(ee)return ee.id;const ge=q.filter(de=>de.kind==="subagent"&&!de.parentToolCallId);if(ge.length===1)return ge[0].id}const x=B(()=>{const ne=$.value;if(!ne)return null;const q=e.activeAppTasks.value.find(ee=>ee.id===ne.subagentId);return q?n1e(q):null}),I=B(()=>x.value!==null);function E(ne){const q=N(ne);if(q){if($.value?.subagentId===q){$.value=null,n.value==="agent"&&(n.value=null);return}$.value={subagentId:q},n.value="agent"}}function F(){$.value=null,n.value==="agent"&&(n.value=null)}const S=X(null),L=B(()=>{const ne=S.value;if(!ne)return null;const q=vH(e.turns.value,ne);return q?{id:ne,title:Pa(q.name),path:gH(q.arg),lines:q.status==="error"?null:MA(q),output:q.output}:null}),R=B(()=>L.value!==null);function D(ne){if(n.value==="toolDiff"&&S.value===ne){z();return}n.value="toolDiff",S.value=ne}function z(){S.value=null,n.value==="toolDiff"&&(n.value=null)}const H=X("list"),U=X(null);function Z(){if(n.value==="diff"){K();return}n.value="diff",H.value="list",U.value=null,e.loadGitStatus(e.activeSessionId.value)}function K(){n.value==="diff"&&(n.value=null),H.value="list",U.value=null,e.clearFileDiff()}async function V(ne){H.value="detail",U.value=ne,await e.loadFileDiff(ne)}async function J(ne){!e.activeSessionId.value&&e.activeWorkspaceId.value?await e.startSessionAndOpenSideChat(e.activeWorkspaceId.value,ne):await e.openSideChat(ne),n.value="btw"}function fe(){e.closeSideChat(),n.value==="btw"&&(n.value=null)}function oe(){n.value==="btw"&&(n.value=null)}const ce=B(()=>e.sideChatVisible.value),ue=B(()=>n.value!==null&&(n.value!=="thinking"||p.value)&&(n.value!=="compaction"||y.value)&&(n.value!=="agent"||I.value)&&(n.value!=="toolDiff"||R.value)&&(n.value!=="btw"||ce.value)),Se=X(!1),Te=X({});function Ae(){switch(n.value){case"thinking":return f.value?{kind:"thinking",...f.value}:null;case"compaction":return v.value?{kind:"compaction",...v.value}:null;case"agent":return $.value?{kind:"agent",...$.value}:null;case"toolDiff":return S.value?{kind:"toolDiff",toolId:S.value}:null;case"btw":return{kind:"btw"};default:return null}}function P(ne){if(ne)switch(ne.kind){case"thinking":f.value={turnId:ne.turnId,blockIndex:ne.blockIndex},n.value="thinking";break;case"compaction":v.value={turnId:ne.turnId},n.value="compaction";break;case"agent":$.value={subagentId:ne.subagentId},n.value="agent";break;case"toolDiff":S.value=ne.toolId,n.value="toolDiff";break;case"btw":e.sideChatVisible.value&&(n.value="btw");break}}function le(){return n.value==="thinking"&&p.value?(b(),!0):n.value==="compaction"&&y.value?(A(),!0):n.value==="agent"&&I.value?(F(),!0):n.value==="toolDiff"&&R.value?(z(),!0):n.value==="file"?(o(),!0):n.value==="diff"?(K(),!0):n.value==="btw"?(fe(),!0):!1}return Qe(e.activeSessionId,(ne,q)=>{if(q){const ee=Ae();ee?Te.value[q]=ee:delete Te.value[q]}o(),b(),A(),F(),z(),K(),oe(),ne&&P(Te.value[ne])}),{PREVIEW_WIDTH_KEY:Cxe,PREVIEW_MIN:xc,previewDefaultWidth:c,previewMax:r,previewWidth:u,previewPanelWidth:d,thinkingPanelText:h,thinkingVisible:p,openThinkingPanel:g,closeThinkingPanel:b,compactionPanelText:m,compactionPanelVisible:y,openCompactionPanel:k,closeCompactionPanel:A,agentPanelMember:x,agentPanelVisible:I,openAgentPanel:E,closeAgentPanel:F,toolDiffTarget:L,toolDiffVisible:R,openToolDiff:D,closeToolDiff:z,detailDiffMode:H,detailDiffPath:U,openDiffDetail:Z,closeDiffDetail:K,selectDiffFile:V,btwVisible:ce,openSideChatTab:J,closeSideChat:fe,hideSideChatPanel:oe,sidePanelVisible:ue,panelDragging:Se,closeOpenSidePanel:le}}const Mxe=Ft.sidebarWidth,u4=Ft.sidebarCollapsed,d4=270,Ag=170,Exe=480,Txe=320;function Nxe(e={}){const{viewportWidth:t}=$8(),n=X(d4),o=X(!1),s=X(!1),i=B(()=>{const u=Txe+(O4(e.previewOpen)?xc:0);return Math.min(Exe,L8(t.value,Ag,u))}),r=B(()=>ly(n.value,Ag,i.value));function l(){try{o.value=mo(u4)==="true"}catch{o.value=!1}}function a(){try{So(u4,String(o.value))}catch{}}function c(){o.value=!o.value,a()}return{SIDEBAR_WIDTH_KEY:Mxe,SIDEBAR_DEFAULT:d4,SIDEBAR_MIN:Ag,sidebarMax:i,sessionColWidth:n,sidebarCollapsed:o,sidebarDragging:s,sideWidth:r,loadSidebarCollapsed:l,toggleSidebarCollapse:c}}function Ixe(e){return/^(?:https?:|blob:|data:)/i.test(e)}function Lxe({client:e,detailTarget:t}){const{t:n}=Tt(),o=X(null),s=X(null),i=X(!1),r=X(null),l=X(null);let a=0,c=null;function u(){c!==null&&(URL.revokeObjectURL(c),c=null)}const d=B(()=>{const N=l.value;return N?e.getFileDownloadUrl(N):null}),f=B(()=>o.value!==null);function h(N){return N.length>1?N.replace(/\/+$/,""):N}function p(N){const x=[];for(const I of N.split(/[\\/]+/))if(!(!I||I===".")){if(I===".."){x.pop();continue}x.push(I)}return x.join("/")}function g(N){const x=N.trim();if(!x)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(x))return{error:n("filePreview.errors.unsupportedPath")};if(x.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const I=h(e.status.value.cwd);if(x.startsWith("/")){if(!I||x!==I&&!x.startsWith(`${I}/`))return{error:n("filePreview.errors.outsideWorkspace")};const F=x===I?"":x.slice(I.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(x.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const E=p(x);return E?{path:E}:{error:n("filePreview.errors.emptyPath")}}async function b(N){const x=o.value;if(t.value==="file"&&x&&x.path===N.path&&x.line===N.line){k();return}const I=++a;u(),t.value="file",s.value=null,r.value=null,i.value=!0,o.value=N,l.value=null;const E=g(N.path);if("error"in E){i.value=!1,r.value=E.error;return}l.value=E.path;try{const F=await e.readFileContent(E.path);if(I!==a)return;F?s.value={...F,path:F.path||E.path}:r.value=n("filePreview.errors.loadFailed")}catch(F){if(I!==a)return;r.value=F instanceof Error?F.message:n("filePreview.errors.loadFailed")}finally{I===a&&(i.value=!1)}}function v(N){return/^data:([^;,]+)/i.exec(N)?.[1]}function m(N){if(N.kind!=="image"&&N.kind!=="video")return;const x=++a;u(),t.value="file",o.value=null,l.value=null,r.value=null;const I=N.kind==="video",E={path:N.path??(I?"Video":"ReadMediaFile image"),content:"",encoding:"utf-8",mime:N.mimeType??v(N.url)??(I?"video/*":"image/*"),isBinary:!0,size:N.bytes??0};N.fileId?(i.value=!0,s.value=E,dt().getFileBlob(N.fileId).then(F=>{if(x===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(()=>{x===a&&(s.value&&(s.value={...s.value,sourceUrl:N.url}),i.value=!1)})):(i.value=!1,s.value=Ixe(N.url)?{...E,sourceUrl:N.url}:E)}function y(){a+=1,o.value=null,l.value=null,s.value=null,r.value=null,i.value=!1,u()}function k(){y(),t.value==="file"&&(t.value=null)}Qe(t,(N,x)=>{x==="file"&&N!=="file"&&y()});function A(){const N=s.value?.path??o.value?.path;N&&e.openWorkspaceFile(N,o.value?.line)}function $(){const N=s.value?.path??o.value?.path;N&&e.revealWorkspaceFile(N)}return{previewTarget:o,previewFile:s,previewLoading:i,previewError:r,previewDownloadUrl:d,previewExternalActions:f,openFilePreview:b,openMediaPreview:m,closeFilePreview:k,openPreviewInEditor:A,revealPreviewFile:$}}const $xe=640,Fxe=`(max-width: ${$xe}px)`;function Oxe(){const e=X(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Fxe);e.value=t.matches;const n=o=>{e.value=o.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),bn(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),bn(()=>t.removeListener(n))),e}const Rxe={class:"server-auth-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"server-auth-title"},Bxe={class:"server-auth-card"},Dxe={class:"server-auth-body"},Pxe={class:"server-auth-foot"},Hxe=Ze({__name:"ServerAuthDialog",setup(e){const t=X(""),n=X(null),o=X(!1);cn(()=>{mt(()=>n.value?.focus())});function s(){const r=t.value;!r||o.value||(o.value=!0,k5(r),window.location.reload())}function i(r){r.key==="Enter"&&(r.preventDefault(),s())}return(r,l)=>(w(),T("div",Rxe,[_("div",Bxe,[l[1]||(l[1]=_("div",{class:"server-auth-head"},[_("h1",{id:"server-auth-title",class:"server-auth-title"},"Server token required"),_("p",{class:"server-auth-hint"},[Je(" This server is protected. Enter the bearer token printed when the server started (or the password set via "),_("code",null,"KIMI_CODE_PASSWORD"),Je("). ")])],-1)),_("div",Dxe,[re(Kc,{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"])]),_("div",Pxe,[re(Bt,{variant:"primary",disabled:!t.value||o.value,loading:o.value,onClick:s},{default:Ee(()=>[Je(O(o.value?"Connecting…":"Connect"),1)]),_:1},8,["disabled","loading"])])])]))}}),Wxe=ct(Hxe,[["__scopeId","data-v-6f624612"]]),zxe=["aria-label"],Uxe=Ze({__name:"InternalBuildBanner",setup(e){const{t}=Tt(),n=FB;return(o,s)=>C(n)?(w(),T("span",{key:0,class:"internal-build-tag",role:"note","aria-label":C(t)("app.internalBuildBanner")},[s[0]||(s[0]=_("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"},[_("path",{d:"M8 2 14 13H2L8 2Z"}),_("path",{d:"M8 6v3.5"}),_("path",{d:"M8 11.5h.01"})],-1)),_("span",null,O(C(t)("app.internalBuildBanner")),1)],8,zxe)):ae("",!0)}}),qxe=ct(Uxe,[["__scopeId","data-v-166b3735"]]),jxe={class:"app-shell"},Vxe={key:1,class:"auth-page"},Kxe={class:"auth-page-inner"},Gxe={class:"auth-page-copy"},Yxe=["aria-label","aria-hidden"],Zxe=Ze({__name:"App",setup(e){$ne();const t=X(!1);let n=null;const o=m2(),s=B(()=>!o.dangerousBypassAuth.value&&t.value);Ln("resolveImage",o.resolveImageUrl),Ln("resolveSwarmMembers",Fe=>o.swarmMembersByToolCallId.value.get(Fe)??[]);const{t:i}=Tt(),{confirm:r}=tf(),l=Hi(),a=Oxe(),c=X(!1),u=X(!1),d=B(()=>{const Fe=o.activeSessionId.value;return o.sessions.value.find(se=>se.id===Fe)?.title??""}),f=B(()=>o.visibleWorkspace.value?.sessionCount??0),h=B(()=>o.activity.value!=="idle"),p=X(null),{showAuthGate:g,blinkAuthLogo:b}=xxe({client:o,authLogoRef:p});wxe({running:h,showAuthGate:g});function v(Fe){const se=o.models.value.find(He=>He.id===o.status.value.modelId),Ne=Km(se),he=Ne.indexOf(Pp(se,Fe)),we=Ne[(he+1)%Ne.length]??Ne[0]??"off";return Uk(se,we)}const m=B(()=>{const Fe=o.models.value.find(se=>se.id===o.status.value.modelId);return Pp(Fe,o.thinking.value)}),y=X(!o.onboarded.value);function k(){o.setOnboarded(!0),y.value=!1}function A(){y.value=!0}let $=0;function N(){const Fe=window.visualViewport,se=document.documentElement.style;se.setProperty("--app-height",`${Fe?.height??window.innerHeight}px`),se.setProperty("--app-top",`${Fe?.offsetTop??0}px`)}function x(){$||($=requestAnimationFrame(()=>{$=0,N()}))}cn(()=>{n=Rne(()=>{t.value=!0,o.clearDangerousBypassAuth()}),o.load(),ne(),N(),window.visualViewport?.addEventListener("resize",x),window.visualViewport?.addEventListener("scroll",x),window.addEventListener("resize",x),document.addEventListener("keydown",I,!0)}),bn(()=>{document.removeEventListener("keydown",I,!0),window.visualViewport?.removeEventListener("resize",x),window.visualViewport?.removeEventListener("scroll",x),window.removeEventListener("resize",x),$&&(cancelAnimationFrame($),$=0),document.documentElement.style.removeProperty("--app-height"),document.documentElement.style.removeProperty("--app-top"),n!==null&&(n(),n=null)});function I(Fe){Fe.key==="Escape"&&(Xe.value||os()&&(Fe.stopPropagation(),Fe.preventDefault()))}const E=X(null),F=X(!1);Qe(o.activeSessionId,()=>{F.value=!0,mt(()=>{F.value=!1})});const{previewTarget:S,previewFile:L,previewLoading:R,previewError:D,previewDownloadUrl:z,previewExternalActions:H,openFilePreview:U,openMediaPreview:Z,closeFilePreview:K,openPreviewInEditor:V,revealPreviewFile:J}=Lxe({client:o,detailTarget:E}),fe=B(()=>E.value!==null),{SIDEBAR_WIDTH_KEY:oe,SIDEBAR_DEFAULT:ce,SIDEBAR_MIN:ue,sidebarMax:Se,sessionColWidth:Te,sidebarCollapsed:Ae,sidebarDragging:P,sideWidth:le,loadSidebarCollapsed:ne,toggleSidebarCollapse:q}=Nxe({previewOpen:fe}),{PREVIEW_WIDTH_KEY:ee,PREVIEW_MIN:ge,previewDefaultWidth:de,previewMax:ve,previewWidth:j,previewPanelWidth:te,thinkingPanelText:pe,thinkingVisible:Ce,openThinkingPanel:$e,closeThinkingPanel:De,compactionPanelText:me,compactionPanelVisible:Ie,openCompactionPanel:et,closeCompactionPanel:rt,agentPanelMember:_t,openAgentPanel:gt,closeAgentPanel:It,toolDiffTarget:Ut,openToolDiff:ht,closeToolDiff:un,detailDiffMode:dn,detailDiffPath:ns,openDiffDetail:Wt,closeDiffDetail:Hn,selectDiffFile:lo,btwVisible:it,openSideChatTab:Gn,closeSideChat:ao,sidePanelVisible:Yn,panelDragging:go,closeOpenSidePanel:os}=Axe({client:o,sideWidth:le,detailTarget:E,closeFilePreview:K}),qn=X(null),to=X(!1),vn=X(!1),Zn=X(!1),xn=X(!1),An=X(!1),Mn=X(!1),Do=X(null),ze=X(null),Xe=B(()=>vc.value>0||to.value||vn.value||Zn.value||xn.value||An.value||Mn.value||y.value||c.value||u.value),kt=X(!1),Ht=X(!1),Rn=X(!1),sn=X(!1),Gt=X(!1);async function Wn(){kt.value=!0,Ht.value=!1,to.value=!0;try{await o.refreshAllProviders()}catch{Ht.value=!0}finally{kt.value=!1}}async function En(){Rn.value=!0,sn.value=!1,vn.value=!0;try{await o.loadProviders()}catch{sn.value=!0}finally{Rn.value=!1}}function St(){Zn.value=!0}async function Po(Fe){to.value=!1,await Ao(Fe)}async function Ao(Fe){await o.setModel(Fe)&&Fe!==o.defaultModel.value&&o.updateConfig({defaultModel:Fe})}async function ss(Fe){await o.addProvider(Fe)}async function Tn(Fe){await o.refreshProvider(Fe)}async function jn(Fe){await r({title:i("sidebar.archive"),message:i("sidebar.archiveConfirm"),variant:"danger",action:()=>o.archiveSession(Fe)})}async function Ps(Fe){const se=o.workspacesView.value.find(Ne=>Ne.id===Fe)?.name??Fe;await r({title:i("sidebar.removeWorkspace"),message:i("workspace.removeWorkspaceConfirm",{name:se}),variant:"danger",action:()=>o.deleteWorkspace(Fe)})}async function ti(Fe){await r({title:i("providers.delete"),message:i("providers.confirmDelete"),variant:"danger",action:()=>o.deleteProvider(Fe)})}async function Io(Fe){Gt.value=!0;try{await o.updateConfig(Fe)&&await o.checkAuth()}finally{Gt.value=!1}}async function Ss(){return o.startOAuthLogin()}async function Wi(){return o.pollOAuthLogin()}async function Si(){return o.cancelOAuthLogin()}async function co(){Zn.value=!1,await o.checkAuth(),await o.load()}async function ni(Fe){await o.undo(1),await mt(),qn.value?.loadComposerForEdit(Fe.text,Fe.attachments)}function Ci(Fe){if(Fe==="/compact"||Fe.startsWith("/compact ")){o.compact(Fe.slice(8).trim()||void 0);return}if(Fe==="/swarm"||Fe.startsWith("/swarm ")){const se=Fe.slice(6).trim();se==="on"?o.setSwarmMode(!0):se==="off"?o.setSwarmMode(!1):se?(o.setSwarmMode(!0),o.sendPrompt(se)):o.toggleSwarmMode();return}if(Fe==="/goal"||Fe.startsWith("/goal ")){const se=Fe.slice(5).trim();se==="pause"||se==="resume"||se==="cancel"?o.controlGoal(se):se?o.createGoal(se):o.toggleGoalMode();return}if(Fe==="/btw"||Fe.startsWith("/btw ")){const se=Fe.slice(4).trim();!se&&o.sideChatVisible.value?ao():Gn(se||void 0);return}switch(Fe){case"/new":case"/clear":$o();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(v(o.thinking.value));break;case"/status":An.value=!0;break;case"/login":St();break;default:{const se=Fe.indexOf(" "),Ne=vre((se===-1?Fe:Fe.slice(0,se)).slice(1)),he=se===-1?void 0:Fe.slice(se+1).trim()||void 0;if(!Ne)break;!o.activeSessionId.value&&o.activeWorkspaceId.value?o.startSessionAndActivateSkill(o.activeWorkspaceId.value,Ne,he):o.activateSkill(Ne,he);break}}}function ar(Fe){o.unqueue(Fe)}function no(Fe){o.unqueue(Fe)}function is(Fe){o.reorderQueue(Fe.from,Fe.to)}async function rs(Fe){const se=o.activeWorkspaceId.value;if(!o.activeSessionId.value&&se){await o.startSessionAndSendPrompt(se,Fe.text,Fe.attachments);return}if(!o.activeSessionId.value&&!se){Do.value=Fe,xn.value=!0;return}o.sendPrompt(Fe.text,Fe.attachments)}async function Lo(Fe){if(ze.value=null,!await o.addWorkspaceByPath(Fe)){ze.value=i("workspace.addFailed");return}xn.value=!1;const Ne=Do.value;Do.value=null;const he=o.activeWorkspaceId.value;Ne&&he&&await o.startSessionAndSendPrompt(he,Ne.text,Ne.attachments)}function Ai(){Do.value=null,ze.value=null,xn.value=!1}function zn(){mt(()=>{qn.value?.focusComposer()})}function $o(){const Fe=o.activeWorkspaceId.value;Fe?o.openWorkspaceDraft(Fe):o.clearActiveSession(),zn()}function oi(Fe){o.openWorkspaceDraft(Fe),zn()}function Ue(Fe){Fe&&window.open(Fe,"_blank","noopener")}return(Fe,se)=>(w(),T("div",jxe,[s.value?(w(),xe(Wxe,{key:0})):ae("",!0),C(g)?(w(),T("section",Vxe,[_("div",Kxe,[(w(),T("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:se[0]||(se[0]=bt(()=>{},["prevent"])),onClick:se[1]||(se[1]=(...Ne)=>C(b)&&C(b)(...Ne))},[...se[98]||(se[98]=[Ay('<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)),_("div",Gxe,[_("h1",null,O(C(i)("app.authPageTitle")),1),_("p",null,O(C(i)("app.authPageMessage")),1)]),re(Bt,{class:"auth-page-btn",variant:"primary",onClick:St},{default:Ee(()=>[re(Ve,{name:"log-in",size:"md"}),_("span",null,O(C(i)("app.authPageLogin")),1)]),_:1})])])):(w(),T("div",{key:2,class:We(["app",{mobile:C(a),"sidebar-collapsed":C(Ae)&&!C(a),"macos-desktop":C(Dc)}]),style:Yt({"--preview-w":C(te)+"px"})},[C(a)?(w(),xe(Gke,{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:se[19]||(se[19]=Ne=>c.value=!0),onOpenSettings:se[20]||(se[20]=Ne=>u.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(w(),T(Pe,{key:0},[re(oD,{collapsed:C(Ae),dragging:C(P),"col-width":C(le),"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:se[2]||(se[2]=Ne=>C(o).selectSession(Ne)),onCreate:$o,onCreateInWorkspace:se[3]||(se[3]=Ne=>oi(Ne)),onSelectWorkspace:se[4]||(se[4]=Ne=>C(o).openWorkspace(Ne)),onAddWorkspace:se[5]||(se[5]=Ne=>xn.value=!0),onRename:se[6]||(se[6]=(Ne,he)=>C(o).renameSession(Ne,he)),onArchive:se[7]||(se[7]=Ne=>jn(Ne)),onFork:se[8]||(se[8]=Ne=>C(o).forkSession(Ne)),onExport:se[9]||(se[9]=Ne=>C(o).exportSession(Ne)),onRenameWorkspace:se[10]||(se[10]=(Ne,he)=>C(o).renameWorkspace(Ne,he)),onDeleteWorkspace:se[11]||(se[11]=Ne=>Ps(Ne)),onReorderWorkspaces:se[12]||(se[12]=Ne=>C(o).reorderWorkspaces(Ne)),onSetWorkspaceSortMode:se[13]||(se[13]=Ne=>C(o).setWorkspaceSortMode(Ne)),onLoadMoreSessions:se[14]||(se[14]=Ne=>void C(o).loadMoreSessions(Ne)),onLoadAllSessions:se[15]||(se[15]=Ne=>void C(o).loadAllSessions()),onOpenSettings:se[16]||(se[16]=Ne=>Mn.value=!0),onCollapse:C(q)},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"]),Fn(re(fw,{class:"side-handle","storage-key":C(oe),"default-width":C(ce),min:C(ue),max:C(Se),"onUpdate:width":se[17]||(se[17]=Ne=>Te.value=Ne),"onUpdate:dragging":se[18]||(se[18]=Ne=>P.value=Ne)},null,8,["storage-key","default-width","min","max"]),[[mi,!C(Ae)]])],64)),re(_ue,{ref_key:"conversationPaneRef",ref:qn,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:se[21]||(se[21]=Ne=>C(Wt)()),onSelectWorkspace:se[22]||(se[22]=Ne=>oi(Ne)),onAddWorkspace:se[23]||(se[23]=Ne=>xn.value=!0),onOpenPr:Ue,onSubmit:se[24]||(se[24]=Ne=>rs(Ne)),onSteer:se[25]||(se[25]=Ne=>C(o).steerPrompt(Ne.text,Ne.attachments)),onApproval:se[26]||(se[26]=(Ne,he)=>C(o).respondApproval(Ne,he)),onCancelTask:se[27]||(se[27]=Ne=>C(o).cancelTask(Ne)),onAnswer:se[28]||(se[28]=(Ne,he)=>C(o).respondQuestion(Ne,he)),onDismiss:se[29]||(se[29]=Ne=>C(o).dismissQuestion(Ne)),onCommand:Ci,onInterrupt:se[30]||(se[30]=Ne=>C(o).abortCurrentPrompt()),onUnqueue:ar,onEditQueued:no,onReorderQueue:is,onSetPermission:se[31]||(se[31]=Ne=>C(o).setPermission(Ne)),onSetThinking:se[32]||(se[32]=Ne=>C(o).setThinking(Ne)),onTogglePlan:se[33]||(se[33]=Ne=>C(o).togglePlanMode()),onToggleSwarm:se[34]||(se[34]=Ne=>C(o).toggleSwarmMode()),onToggleGoal:se[35]||(se[35]=Ne=>C(o).toggleGoalMode()),onCreateGoal:se[36]||(se[36]=Ne=>C(o).createGoal(Ne)),onControlGoal:se[37]||(se[37]=Ne=>C(o).controlGoal(Ne)),onRefreshGitStatus:se[38]||(se[38]=Ne=>C(o).activeSessionId.value&&C(o).loadGitStatus(C(o).activeSessionId.value)),onRenameSession:se[39]||(se[39]=(Ne,he)=>C(o).renameSession(Ne,he)),onForkSession:se[40]||(se[40]=Ne=>C(o).forkSession(Ne)),onArchiveSession:se[41]||(se[41]=Ne=>jn(Ne)),onExportSession:se[42]||(se[42]=Ne=>C(o).exportSession(Ne)),onCompact:se[43]||(se[43]=Ne=>C(o).compact()),onPickModel:se[44]||(se[44]=Ne=>Wn()),onSelectModel:se[45]||(se[45]=Ne=>Ao(Ne)),onOpenFile:se[46]||(se[46]=Ne=>C(U)(Ne)),onOpenMedia:se[47]||(se[47]=Ne=>C(Z)(Ne)),onOpenThinking:se[48]||(se[48]=Ne=>C($e)(Ne)),onOpenCompaction:se[49]||(se[49]=Ne=>C(et)(Ne)),onOpenAgent:se[50]||(se[50]=Ne=>C(gt)(Ne)),onOpenToolDiff:se[51]||(se[51]=Ne=>C(ht)(Ne)),onEditMessage:ni},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(Dc)||C(Ae))?(w(),xe(Pn,{key:2,class:"sidebar-toggle-btn",size:"sm",label:C(Ae)?C(i)("sidebar.expandSidebar"):C(i)("sidebar.collapseSidebar"),onClick:C(q)},{default:Ee(()=>[re(Ve,{name:C(Ae)?"panel-expand":"panel-collapse"},null,8,["name"])]),_:1},8,["label","onClick"])):ae("",!0),C(Yn)&&!C(a)?(w(),xe(fw,{key:3,class:"preview-handle","storage-key":C(ee),"default-width":C(de),min:C(ge),max:C(ve),reverse:"","aria-label":C(i)("layout.resizePreviewAria"),"onUpdate:width":se[52]||(se[52]=Ne=>j.value=Ne),"onUpdate:dragging":se[53]||(se[53]=Ne=>go.value=Ne)},null,8,["storage-key","default-width","min","max","aria-label"])):ae("",!0),!C(a)||C(Yn)?(w(),T("aside",{key:4,class:We(["global-preview",{open:C(Yn),mobile:C(a),"no-anim":C(go)||F.value}]),role:"complementary","aria-label":C(i)("layout.detailPanelAria"),"aria-hidden":!C(Yn)},[E.value==="thinking"&&C(Ce)?(w(),xe(VC,{key:0,text:C(pe)??"",onClose:C(De)},null,8,["text","onClose"])):E.value==="compaction"&&C(Ie)?(w(),xe(VC,{key:1,text:C(me)??"",subtitle:C(i)("conversation.summaryTitle"),onClose:C(rt)},null,8,["text","subtitle","onClose"])):E.value==="agent"&&C(_t)?(w(),xe(Yde,{key:2,member:C(_t),onClose:C(It)},null,8,["member","onClose"])):E.value==="btw"&&C(it)?(w(),xe(gfe,{key:3,turns:C(o).sideChatTurns.value,running:C(o).sideChatRunning.value,sending:C(o).sideChatSending.value,onSend:se[54]||(se[54]=Ne=>C(o).sendSideChatPrompt(Ne)),onClose:C(ao)},null,8,["turns","running","sending","onClose"])):E.value==="diff"?(w(),xe(qfe,{key:4,mode:C(dn),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(lo),onBack:se[55]||(se[55]=Ne=>{dn.value="list",ns.value=null,C(o).clearFileDiff()}),onClose:C(Hn)},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading","onOpen","onClose"])):E.value==="toolDiff"&&C(Ut)?(w(),xe(afe,{key:5,target:C(Ut),onClose:C(un)},null,8,["target","onClose"])):E.value==="file"?(w(),xe(Nde,{key:6,file:C(L),loading:C(R),error:C(D),line:C(S)?.line,"download-url":C(z),closable:"","external-actions":C(H),"open-file":C(U),onClose:C(K),onOpenExternal:C(V),onReveal:C(J)},null,8,["file","loading","error","line","download-url","external-actions","open-file","onClose","onOpenExternal","onReveal"])):ae("",!0)],10,Yxe)):ae("",!0),re(qxe,{class:"internal-build-fab"}),to.value?(w(),xe(che,{key:5,models:C(o).models.value,current:C(o).status.value.modelId,"starred-ids":C(o).starredModelIds.value,loading:kt.value,unavailable:Ht.value,onSelect:se[56]||(se[56]=Ne=>Po(Ne)),onToggleStar:se[57]||(se[57]=Ne=>C(o).toggleStarModel(Ne)),onClose:se[58]||(se[58]=Ne=>to.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):ae("",!0),Mn.value?(w(),xe(Eye,{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":Gt.value,"server-version":C(o).serverVersion.value,backend:C(o).backend.value,onSetColorScheme:se[59]||(se[59]=Ne=>C(o).setColorScheme(Ne)),onSetAccent:se[60]||(se[60]=Ne=>C(o).setAccent(Ne)),onSetUiFontSize:se[61]||(se[61]=Ne=>C(o).setUiFontSize(Ne)),onSetNotify:se[62]||(se[62]=Ne=>C(o).setNotifyOnComplete(Ne)),onSetNotifyQuestion:se[63]||(se[63]=Ne=>C(o).setNotifyOnQuestion(Ne)),onSetNotifyApproval:se[64]||(se[64]=Ne=>C(o).setNotifyOnApproval(Ne)),onSetSound:se[65]||(se[65]=Ne=>C(o).setSoundOnComplete(Ne)),onSetConversationToc:se[66]||(se[66]=Ne=>C(o).setConversationToc(Ne)),onUpdateConfig:se[67]||(se[67]=Ne=>Io(Ne)),onLogin:se[68]||(se[68]=()=>{Mn.value=!1,St()}),onLogout:C(o).logout,onOpenOnboarding:se[69]||(se[69]=()=>{Mn.value=!1,A()}),onOpenProviders:se[70]||(se[70]=()=>{Mn.value=!1,En()}),onClose:se[71]||(se[71]=Ne=>Mn.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"])):ae("",!0),vn.value?(w(),xe(Fhe,{key:7,providers:C(o).providers.value,loading:Rn.value,unavailable:sn.value,onAdd:se[72]||(se[72]=Ne=>ss(Ne)),onRefresh:se[73]||(se[73]=Ne=>Tn(Ne)),onDelete:se[74]||(se[74]=Ne=>ti(Ne)),onOpenLogin:se[75]||(se[75]=()=>{vn.value=!1,St()}),onClose:se[76]||(se[76]=Ne=>vn.value=!1)},null,8,["providers","loading","unavailable"])):ae("",!0),An.value?(w(),xe(Mke,{key:8,status:C(o).status.value,thinking:m.value,"plan-mode":C(o).planMode.value,"swarm-mode":C(o).swarmMode.value,"cost-usd":C(o).sessionCost.value,onClose:se[77]||(se[77]=Ne=>An.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):ae("",!0),xn.value?(w(),xe(dke,{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:ze.value,onAdd:se[78]||(se[78]=Ne=>Lo(Ne)),onClose:Ai},null,8,["browse-fs","get-fs-home","default-path","error"])):ae("",!0),re(Il,{name:"gload-fade"},{default:Ee(()=>[C(o).initialized.value?ae("",!0):(w(),xe(qbe,{key:0,issue:C(o).connectIssue.value},null,8,["issue"]))]),_:1}),C(o).initialized.value&&y.value&&!C(g)?(w(),xe(Bbe,{key:10,onComplete:k,onSkip:k})):ae("",!0),re(Pke,{warnings:C(o).warnings.value,onDismiss:C(o).dismissWarning},null,8,["warnings","onDismiss"]),C(l)?(w(),xe(bxe,{key:11})):ae("",!0),re(mke),C(a)?(w(),xe(v2e,{key:12,modelValue:c.value,"onUpdate:modelValue":se[79]||(se[79]=Ne=>c.value=Ne),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:se[80]||(se[80]=Ne=>C(o).selectSession(Ne)),onCreate:$o,onCreateInWorkspace:se[81]||(se[81]=Ne=>oi(Ne)),onAddWorkspace:se[82]||(se[82]=Ne=>xn.value=!0),onRename:se[83]||(se[83]=(Ne,he)=>C(o).renameSession(Ne,he)),onArchive:se[84]||(se[84]=Ne=>jn(Ne)),onDeleteWorkspace:se[85]||(se[85]=Ne=>Ps(Ne)),onLoadMore:se[86]||(se[86]=Ne=>void C(o).loadMoreSessions(Ne))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):ae("",!0),C(a)?(w(),xe(Cbe,{key:13,modelValue:u.value,"onUpdate:modelValue":se[87]||(se[87]=Ne=>u.value=Ne),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:se[88]||(se[88]=Ne=>Wn()),onSetThinking:se[89]||(se[89]=Ne=>C(o).setThinking(Ne)),onTogglePlan:se[90]||(se[90]=Ne=>C(o).togglePlanMode()),onToggleSwarm:se[91]||(se[91]=Ne=>C(o).toggleSwarmMode()),onSetPermission:se[92]||(se[92]=Ne=>C(o).setPermission(Ne)),onSetColorScheme:se[93]||(se[93]=Ne=>C(o).setColorScheme(Ne)),onSetUiFontSize:se[94]||(se[94]=Ne=>C(o).setUiFontSize(Ne)),onSetConversationToc:se[95]||(se[95]=Ne=>C(o).setConversationToc(Ne)),onLogin:se[96]||(se[96]=()=>{u.value=!1,St()}),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"])):ae("",!0)],6)),Zn.value?(w(),xe(dpe,{key:3,"on-start-o-auth-login":Ss,"on-poll-o-auth-login":Wi,"on-cancel-o-auth-login":Si,onSuccess:co,onClose:se[97]||(se[97]=Ne=>Zn.value=!1)})):ae("",!0)]))}}),Qxe=ct(Zxe,[["__scopeId","data-v-8cd3196b"]]);Gte();op(Qxe).use(_n).mount("#app");export{LE as $,e3 as A,wT as B,bo as C,Zwe as D,y4 as E,Pe as F,Ay as G,Je as H,re as I,tT as J,xwe as K,Li as L,Ze as M,G9 as N,Cwe as O,Awe as P,Twe as Q,Ph as R,Rc as S,dm as T,Mwe as U,Ey as V,Swe as W,Xwe as X,Ewe as Y,jwe as Z,Jxe as _,K4 as a,jo as a$,Yo as a0,uy as a1,lwe as a2,gy as a3,y9 as a4,mn as a5,su as a6,hwe as a7,t_e as a8,vwe as a9,X4 as aA,$T as aB,PT as aC,cn as aD,DT as aE,BT as aF,dy as aG,RT as aH,bn as aI,yy as aJ,rT as aK,w as aL,j9 as aM,dwe as aN,Ln as aO,R4 as aP,uwe as aQ,qh as aR,Bo as aS,Wh as aT,X as aU,Pwe as aV,uN as aW,ot as aX,On as aY,WT as aZ,wwe as a_,bwe as aa,kwe as ab,ywe as ac,Wwe as ad,n_e as ae,Kt as af,S9 as ag,cm as ah,_l as ai,Hr as aj,ho as ak,Hwe as al,Ks as am,Nl as an,pt as ao,Lwe as ap,$we as aq,yn as ar,mt as as,T9 as at,We as au,Xxe as av,Yt as aw,LT as ax,OT as ay,po as az,cwe as b,_X as b$,Gwe as b0,kd as b1,Zh as b2,Vwe as b3,Tl as b4,QE as b5,twe as b6,Ba as b7,hT as b8,Kwe as b9,_s as bA,mi as bB,C9 as bC,Uwe as bD,Qe as bE,mT as bF,pwe as bG,gT as bH,Owe as bI,Ee as bJ,Nwe as bK,Fn as bL,nr as bM,zwe as bN,bt as bO,fwe as bP,gn as bQ,ms as bR,f_e as bS,fJ as bT,PM as bU,p_e as bV,WQ as bW,kk as bX,h_e as bY,yv as bZ,b_e as b_,ewe as ba,O as bb,mh as bc,_we as bd,en as be,swe as bf,owe as bg,O4 as bh,Dwe as bi,nwe as bj,C as bk,Vd as bl,e_e as bm,Qwe as bn,Z9 as bo,mwe as bp,Rwe as bq,pT as br,Jwe as bs,Iwe as bt,gwe as bu,V4 as bv,np as bw,iN as bx,P3 as by,qg as bz,qwe as c,wX as c0,gk as c1,xX as c2,c_e as c3,FQ as c4,a_e as c5,Mp as c6,i_e as c7,bX as c8,$M as c9,k_e as ca,r_e as cb,w_e as cc,Sv as cd,Ec as ce,wv as cf,__e as cg,x_e as ch,d_e as ci,qs as cj,l_e as ck,u_e as cl,UQ as cm,y_e as cn,_v as co,xv as cp,v_e as cq,s_e as cr,g_e as cs,m_e as ct,Ve as cu,o_e as cv,ct as cw,Bwe as d,Sl as e,iwe as f,Il as g,J9 as h,rwe as i,awe as j,wi as k,Ud as l,No as m,tm as n,Wr as o,Ywe as p,B as q,op as r,xe as s,ae as t,T as u,_ as v,c9 as w,Fwe as x,a9 as y,dN as z};