@rohansguliani/mux-chat-ui 0.4.1 → 0.4.3

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 (421) hide show
  1. package/kit/assets/core-Di-5v6uF.js +12 -0
  2. package/kit/assets/engine-oniguruma-CzywPD2Z.js +1 -0
  3. package/kit/assets/{markdown-parse.worker-D0WrtDJ7.js → markdown-parse.worker-UxspIzRN.js} +7 -7
  4. package/kit/build.json +1 -1
  5. package/kit/chunks/{abnfDiagram-VCTEODGH-aawkrAj6.js → abnfDiagram-VCTEODGH-Bfs5Gqvk.js} +1 -1
  6. package/kit/chunks/{app-chat-kit-C-b6Y63T.js → app-chat-kit-Ck66xmNL.js} +192 -192
  7. package/kit/chunks/{arc-EbFzNw_R.js → arc-Dli4yqeF.js} +1 -1
  8. package/kit/chunks/architecture-7GRP2DOG-DeMUlzil.js +1 -0
  9. package/kit/chunks/{architectureDiagram-5GKGNRK7-CD3tEssA.js → architectureDiagram-5GKGNRK7-fkZTSFnE.js} +1 -1
  10. package/kit/chunks/{blockDiagram-NRAW4CY4-7QgFd2Hk.js → blockDiagram-NRAW4CY4-DTa_uwng.js} +1 -1
  11. package/kit/chunks/{c4Diagram-UCG6FXSJ-DYRJHmaW.js → c4Diagram-UCG6FXSJ-Bxungqmw.js} +1 -1
  12. package/kit/chunks/channel-J39uX_8L.js +1 -0
  13. package/kit/chunks/{chunk-2Q5K7J3B-C7CILgFW.js → chunk-2Q5K7J3B-BC9T3euC.js} +1 -1
  14. package/kit/chunks/{chunk-5VM5RSS4-DU4ynm4i.js → chunk-5VM5RSS4-DglfV9WQ.js} +1 -1
  15. package/kit/chunks/{chunk-F27PBJKO-Cpr4cHiy.js → chunk-F27PBJKO-DjeLRSJB.js} +1 -1
  16. package/kit/chunks/{chunk-G27WJ6UU-CFgs87kn.js → chunk-G27WJ6UU-BgJbAaZu.js} +1 -1
  17. package/kit/chunks/{chunk-JWPE2WC7-Cqwb9v7c.js → chunk-JWPE2WC7-AcX35oCq.js} +1 -1
  18. package/kit/chunks/{chunk-LCL6LL3I-fUhgnbF1.js → chunk-LCL6LL3I-BwBMbUcf.js} +1 -1
  19. package/kit/chunks/{chunk-POPQ4Y6H-BMqiEt5Y.js → chunk-POPQ4Y6H-C-hfwTbE.js} +1 -1
  20. package/kit/chunks/{chunk-RHFEMEQ7-UtGL3UWT.js → chunk-RHFEMEQ7-DXgWUVaq.js} +1 -1
  21. package/kit/chunks/{chunk-SVP7TREG-BNzLngWc.js → chunk-SVP7TREG-BRdZhE71.js} +1 -1
  22. package/kit/chunks/{chunk-XXDRQBXY--cnGrVD8.js → chunk-XXDRQBXY-CI7P87YE.js} +1 -1
  23. package/kit/chunks/classDiagram-DTDB5LWJ-H1ejRJcX.js +1 -0
  24. package/kit/chunks/classDiagram-v2-JRS7N3AN-H1ejRJcX.js +1 -0
  25. package/kit/chunks/core-CXDtDTdc.js +12 -0
  26. package/kit/chunks/{cose-bilkent-JH36ORCC-BMartBdb.js → cose-bilkent-JH36ORCC-Dqi19t_j.js} +1 -1
  27. package/kit/chunks/cynefin-OW5HDTMX-fH9d9mHi.js +1 -0
  28. package/kit/chunks/{cynefinDiagram-5FMLGOSQ-CUB7w3gK.js → cynefinDiagram-5FMLGOSQ-2eqttX2S.js} +1 -1
  29. package/kit/chunks/{dagre-3AP2YEHR-DwfEgec4.js → dagre-3AP2YEHR-D1-Ji0Mz.js} +1 -1
  30. package/kit/chunks/{diagram-S7CK7UJ4-C2_pdRvt.js → diagram-S7CK7UJ4-Z689GD_k.js} +1 -1
  31. package/kit/chunks/{diagram-UQ7AKVKN-BeOC94i9.js → diagram-UQ7AKVKN-6wH2UOiG.js} +1 -1
  32. package/kit/chunks/{diagram-VSXAHHWV-BJqiCb3J.js → diagram-VSXAHHWV-C7ceZTNp.js} +1 -1
  33. package/kit/chunks/{diagram-VX7I27RA-B1ePQWjM.js → diagram-VX7I27RA-CQ0ngi2L.js} +1 -1
  34. package/kit/chunks/{diagram-Z3DM3KII-4O4kGxOa.js → diagram-Z3DM3KII-rW7Ioaec.js} +1 -1
  35. package/kit/chunks/{ebnfDiagram-PWID7BFC-BsMWVAzY.js → ebnfDiagram-PWID7BFC-rdIb5LRV.js} +1 -1
  36. package/kit/chunks/engine-compile-CLAWXunO.js +141 -0
  37. package/kit/chunks/engine-oniguruma-C5ugeybA.js +1 -0
  38. package/kit/chunks/{erDiagram-SSCWMZ5O-BeGs3Qlf.js → erDiagram-SSCWMZ5O-CrBH-qwy.js} +1 -1
  39. package/kit/chunks/eventmodeling-NTZA5JFV-B6dfQZX5.js +1 -0
  40. package/kit/chunks/{file-BlRQDOFP.js → file-4YaHcrma.js} +5 -5
  41. package/kit/chunks/flowDiagram-A5DVABFB-Bnk2IjEI.js +1 -0
  42. package/kit/chunks/{ganttDiagram-EL5Y4UJY-Butg8izl.js → ganttDiagram-EL5Y4UJY-CohLIBwF.js} +1 -1
  43. package/kit/chunks/gitGraph-4MIJSDKK-D6QTJZzE.js +1 -0
  44. package/kit/chunks/{gitGraphDiagram-WWUBYQGX-Djca0Wx-.js → gitGraphDiagram-WWUBYQGX-C3-dW0io.js} +1 -1
  45. package/kit/chunks/index-B1au7_iH.js +1 -0
  46. package/kit/chunks/{index-iAF0Rn9U.js → index-DCZ3hf3T.js} +3 -3
  47. package/kit/chunks/info-A6RAGUB7-pEawYHxw.js +1 -0
  48. package/kit/chunks/{infoDiagram-RXCK75RN-BAOb8l5A.js → infoDiagram-RXCK75RN-KzC_PMCu.js} +1 -1
  49. package/kit/chunks/{ishikawaDiagram-5VMMS53U-8KBwqPWi.js → ishikawaDiagram-5VMMS53U-BOkqSJeh.js} +1 -1
  50. package/kit/chunks/{journeyDiagram-EYS64GPL-CawYPIQT.js → journeyDiagram-EYS64GPL-puAvr0qD.js} +1 -1
  51. package/kit/chunks/{kanban-definition-3QL26DDD-Dg_lCGBT.js → kanban-definition-3QL26DDD-BBJwrZJC.js} +1 -1
  52. package/kit/chunks/{layout-BM8wHG6o.js → layout-CZyvCll6.js} +1 -1
  53. package/kit/chunks/{linear-DKhl7N6S.js → linear-Ls7JLhyc.js} +1 -1
  54. package/kit/chunks/{markdown-code-BTfpGmJj.js → markdown-code-CXhO_kB-.js} +1 -1
  55. package/kit/chunks/{markdown-BDO0KNsJ.js → markdown-leZ65Gnj.js} +2 -2
  56. package/kit/chunks/{markdown-mermaid-BHDm-Eop.js → markdown-mermaid-CWtlyPVU.js} +1 -1
  57. package/kit/chunks/marked-parser-DJaHEhO4.js +1 -0
  58. package/kit/chunks/{mermaid-parser.core-D9Cspzql.js → mermaid-parser.core-ButbfTJL.js} +2 -2
  59. package/kit/chunks/{mermaid.core-CfB36ohx.js → mermaid.core-Den2NdAK.js} +4 -4
  60. package/kit/chunks/{mindmap-definition-FBJOCRG2-BRIAXAUl.js → mindmap-definition-FBJOCRG2-D7-THfgD.js} +1 -1
  61. package/kit/chunks/packet-AYTQ26CC-DkYyila1.js +1 -0
  62. package/kit/chunks/{pegDiagram-XKGWAZYB-D6wSK_Nz.js → pegDiagram-XKGWAZYB-CD1_OS6w.js} +1 -1
  63. package/kit/chunks/pie-WAS4IAKB-DiDgpL5b.js +1 -0
  64. package/kit/chunks/{pieDiagram-E7YTZNPT-Ch_-MJ_P.js → pieDiagram-E7YTZNPT-COgMyD7l.js} +1 -1
  65. package/kit/chunks/{quadrantDiagram-AXDQQJYC-D76oyHLE.js → quadrantDiagram-AXDQQJYC-3pqJZoPE.js} +1 -1
  66. package/kit/chunks/radar-RG4KPBEZ-CBz73bz-.js +1 -0
  67. package/kit/chunks/railroad-74A4TZTK-BTsrRQQ1.js +1 -0
  68. package/kit/chunks/railroad-abnf-HS5TGJTU-DXJRXL-z.js +1 -0
  69. package/kit/chunks/railroad-ebnf-LZEXJU2U-BSgGdaL7.js +1 -0
  70. package/kit/chunks/railroad-peg-WCYAUIDC-liB6zpun.js +1 -0
  71. package/kit/chunks/{railroadDiagram-O6MQD6OU-CHtdMlPY.js → railroadDiagram-O6MQD6OU-VOt2CEsx.js} +1 -1
  72. package/kit/chunks/{requirementDiagram-EFPCY7ZU-l6gDxxdV.js → requirementDiagram-EFPCY7ZU-vN2rPOmy.js} +1 -1
  73. package/kit/chunks/{sankeyDiagram-P5KCCOFB-CjZ3Uu0e.js → sankeyDiagram-P5KCCOFB-BiwU-ryo.js} +1 -1
  74. package/kit/chunks/{sequenceDiagram-WJ2MYXX4-BRuNs18X.js → sequenceDiagram-WJ2MYXX4-B2rNhW13.js} +1 -1
  75. package/kit/chunks/{sizeCapture-X5ZJPWSS-Ckw-xvdD.js → sizeCapture-X5ZJPWSS-C6_yXTuo.js} +1 -1
  76. package/kit/chunks/{stateDiagram-HBIQ2CUA-BAMlzlwn.js → stateDiagram-HBIQ2CUA-BvqZobNo.js} +1 -1
  77. package/kit/chunks/stateDiagram-v2-4QOOHH4V-BgyB5xo0.js +1 -0
  78. package/kit/chunks/{swimlanes-XN3QIQJK-Dr5fJdVS.js → swimlanes-XN3QIQJK-B3mCwXEY.js} +1 -1
  79. package/kit/chunks/swimlanesDiagram-VK2B7HYN-B32zSYEj.js +8 -0
  80. package/kit/chunks/{timeline-definition-24CTP7MA-DmDeY1TU.js → timeline-definition-24CTP7MA-DMIuMIxq.js} +1 -1
  81. package/kit/chunks/treeView-Q6P3EWNA-DsAWOfDH.js +1 -0
  82. package/kit/chunks/treemap-WGGIJYW6-BqtQKaeF.js +1 -0
  83. package/kit/chunks/{vennDiagram-4TSXK5OY-DhRpgnfs.js → vennDiagram-4TSXK5OY-BwSRmgyd.js} +1 -1
  84. package/kit/chunks/wardley-WFR3VGLG-CB8g2VlV.js +1 -0
  85. package/kit/chunks/{wardleyDiagram-VM6X3IG4-BgbweIse.js → wardleyDiagram-VM6X3IG4-B6z3die9.js} +1 -1
  86. package/kit/chunks/{xychartDiagram-S5SC5T6Z-CQWNrkBN.js → xychartDiagram-S5SC5T6Z-JSywrnZk.js} +1 -1
  87. package/kit/index.js +1 -1
  88. package/kit/mux-build.json +1 -1
  89. package/package.json +1 -1
  90. package/kit/assets/abap-Dg923wIy.js +0 -1
  91. package/kit/assets/actionscript-3-CqOcUQ0w.js +0 -1
  92. package/kit/assets/ada-CTi7YQtL.js +0 -1
  93. package/kit/assets/ahk-BJYYIeOs.js +0 -1
  94. package/kit/assets/ahk2-BLfzmBxo.js +0 -1
  95. package/kit/assets/andromeeda-CT0vplkN.js +0 -1
  96. package/kit/assets/angular-html-DX9ZP5JV.js +0 -1
  97. package/kit/assets/angular-ts-1O2hJJmY.js +0 -1
  98. package/kit/assets/apache-PcO-DBxQ.js +0 -1
  99. package/kit/assets/apex-B4ts4Pdn.js +0 -1
  100. package/kit/assets/apl-Dz5ncP8G.js +0 -1
  101. package/kit/assets/applescript-Ds_W2jPS.js +0 -1
  102. package/kit/assets/ara-C1--7J61.js +0 -1
  103. package/kit/assets/asciidoc-DaaWi4fn.js +0 -1
  104. package/kit/assets/asm-CTFRnVOM.js +0 -1
  105. package/kit/assets/astro-BWgTGUF8.js +0 -1
  106. package/kit/assets/aurora-x-C0VKFdlO.js +0 -1
  107. package/kit/assets/awk-CrWgQKhV.js +0 -1
  108. package/kit/assets/ayu-dark-wZ6ORhBL.js +0 -1
  109. package/kit/assets/ayu-light-xXLJ_Ch1.js +0 -1
  110. package/kit/assets/ayu-mirage-CQckA_sP.js +0 -1
  111. package/kit/assets/ballerina-a0yOSyc5.js +0 -1
  112. package/kit/assets/bat-C1qk1Jq1.js +0 -1
  113. package/kit/assets/beancount-dPJi_gci.js +0 -1
  114. package/kit/assets/berry-CVKoklHx.js +0 -1
  115. package/kit/assets/bibtex-DRcCXNgM.js +0 -1
  116. package/kit/assets/bicep-jWz-hQ8I.js +0 -1
  117. package/kit/assets/bird2-wc5D5_X9.js +0 -1
  118. package/kit/assets/blade-DFktsHST.js +0 -1
  119. package/kit/assets/bsl-BtUDvyR4.js +0 -1
  120. package/kit/assets/c-BG-tZi7o.js +0 -1
  121. package/kit/assets/c3-R-USHpyF.js +0 -1
  122. package/kit/assets/cadence-BuaeHeSu.js +0 -1
  123. package/kit/assets/cairo-BYiDgOF2.js +0 -1
  124. package/kit/assets/catppuccin-frappe-CquLvoVK.js +0 -1
  125. package/kit/assets/catppuccin-latte-G5tdnGFo.js +0 -1
  126. package/kit/assets/catppuccin-macchiato-BZRq1pKO.js +0 -1
  127. package/kit/assets/catppuccin-mocha-Bbf5uIw6.js +0 -1
  128. package/kit/assets/chapel-D6IdCptL.js +0 -1
  129. package/kit/assets/clarity-BJ-KISir.js +0 -1
  130. package/kit/assets/clojure-KnfDkB_V.js +0 -1
  131. package/kit/assets/cmake-bh2MLnkv.js +0 -1
  132. package/kit/assets/cobol-DbURsbuN.js +0 -1
  133. package/kit/assets/codeowners-CtwIM3TN.js +0 -1
  134. package/kit/assets/codeql-D164juXQ.js +0 -1
  135. package/kit/assets/coffee-Bk-z6oI_.js +0 -1
  136. package/kit/assets/common-lisp-DXc9XcIM.js +0 -1
  137. package/kit/assets/coq-BIZj6HM_.js +0 -1
  138. package/kit/assets/cpp-C-tF_bWl.js +0 -1
  139. package/kit/assets/crystal-Dvqzbpz8.js +0 -1
  140. package/kit/assets/csharp-CFxe5pRo.js +0 -1
  141. package/kit/assets/css-Br67jR8j.js +0 -1
  142. package/kit/assets/csv-D5aBhKLr.js +0 -1
  143. package/kit/assets/cue-WCin6O4e.js +0 -1
  144. package/kit/assets/cypher-DYQk2G82.js +0 -1
  145. package/kit/assets/d-DVc-yF-l.js +0 -1
  146. package/kit/assets/dark-plus-DLU5INA3.js +0 -1
  147. package/kit/assets/dart-ByalkS20.js +0 -1
  148. package/kit/assets/dax-oldcCaJg.js +0 -1
  149. package/kit/assets/desktop-DZfyBMgF.js +0 -1
  150. package/kit/assets/diff-jW5kmiru.js +0 -1
  151. package/kit/assets/docker-DG9neUKd.js +0 -1
  152. package/kit/assets/dotenv-Bea-FkXq.js +0 -1
  153. package/kit/assets/dracula-XcYHBZy6.js +0 -1
  154. package/kit/assets/dracula-soft-BPeX9gxW.js +0 -1
  155. package/kit/assets/dream-maker-DAHQwpwp.js +0 -1
  156. package/kit/assets/edge-DTiORMU5.js +0 -1
  157. package/kit/assets/elixir-DnIH90qd.js +0 -1
  158. package/kit/assets/elm-BjIDgKzz.js +0 -1
  159. package/kit/assets/emacs-lisp-Ckw2FTkV.js +0 -1
  160. package/kit/assets/erb-CazEJMPD.js +0 -1
  161. package/kit/assets/erlang-DNeY46SW.js +0 -1
  162. package/kit/assets/everforest-dark-WOub3wle.js +0 -1
  163. package/kit/assets/everforest-light-DCUg8VH8.js +0 -1
  164. package/kit/assets/fennel-DBMsxtrh.js +0 -1
  165. package/kit/assets/fish-BxskpYPN.js +0 -1
  166. package/kit/assets/fluent-Bwo2XpEt.js +0 -1
  167. package/kit/assets/fortran-fixed-form-DFFnVrrY.js +0 -1
  168. package/kit/assets/fortran-free-form-DB5N_DgY.js +0 -1
  169. package/kit/assets/fsharp-DRAF1jsN.js +0 -1
  170. package/kit/assets/gdresource-B0Kp4-ms.js +0 -1
  171. package/kit/assets/gdscript-DKyjuXKv.js +0 -1
  172. package/kit/assets/gdshader-G7X6ysY3.js +0 -1
  173. package/kit/assets/genie-DSsjfZMX.js +0 -1
  174. package/kit/assets/gherkin-Cl2Fw-_0.js +0 -1
  175. package/kit/assets/git-commit-CJPsQObV.js +0 -1
  176. package/kit/assets/git-rebase-DeZqv4fp.js +0 -1
  177. package/kit/assets/github-dark-BQV5ugrc.js +0 -1
  178. package/kit/assets/github-dark-default-DLWDM7FH.js +0 -1
  179. package/kit/assets/github-dark-dimmed-D1FmiR_p.js +0 -1
  180. package/kit/assets/github-dark-high-contrast-BilLoi0o.js +0 -1
  181. package/kit/assets/github-light-Rcb2q3L5.js +0 -1
  182. package/kit/assets/github-light-default-CQ75esMw.js +0 -1
  183. package/kit/assets/github-light-high-contrast-CRF1wyLy.js +0 -1
  184. package/kit/assets/gleam-BeBqoPwE.js +0 -1
  185. package/kit/assets/glimmer-js-F_qk9EQT.js +0 -1
  186. package/kit/assets/glimmer-ts-Dhzi-GJU.js +0 -1
  187. package/kit/assets/glsl-BOG9l2nV.js +0 -1
  188. package/kit/assets/gn-Dxr0sSUf.js +0 -1
  189. package/kit/assets/gnuplot-CtW3R_Hz.js +0 -1
  190. package/kit/assets/go-B7VTfpnm.js +0 -1
  191. package/kit/assets/graphql-B6XHM4uj.js +0 -1
  192. package/kit/assets/groovy-DFxE31Qs.js +0 -1
  193. package/kit/assets/gruvbox-dark-hard-C37G1gbc.js +0 -1
  194. package/kit/assets/gruvbox-dark-medium-C3G9m3TV.js +0 -1
  195. package/kit/assets/gruvbox-dark-soft-eZmcmZ9I.js +0 -1
  196. package/kit/assets/gruvbox-light-hard-BYj-vz_3.js +0 -1
  197. package/kit/assets/gruvbox-light-medium-BdQlDiiF.js +0 -1
  198. package/kit/assets/gruvbox-light-soft-BGNwjiRh.js +0 -1
  199. package/kit/assets/hack-jRhjsWHJ.js +0 -1
  200. package/kit/assets/haml-C4vGXCDX.js +0 -1
  201. package/kit/assets/handlebars-BsldGL5W.js +0 -1
  202. package/kit/assets/haskell-BfdhR_WN.js +0 -1
  203. package/kit/assets/haxe-wmAaY_mP.js +0 -1
  204. package/kit/assets/hcl-B6OePqme.js +0 -1
  205. package/kit/assets/hjson-D2jn7IRw.js +0 -1
  206. package/kit/assets/hlsl-MKeth5V9.js +0 -1
  207. package/kit/assets/horizon-bright-BVMyA0so.js +0 -1
  208. package/kit/assets/horizon-cslQss18.js +0 -1
  209. package/kit/assets/houston-RHIKkNfR.js +0 -1
  210. package/kit/assets/html-BW_6VhB7.js +0 -1
  211. package/kit/assets/html-derivative-BxANmYVz.js +0 -1
  212. package/kit/assets/http-CG3jvXcS.js +0 -1
  213. package/kit/assets/hurl-CxQrh4RI.js +0 -1
  214. package/kit/assets/hxml-In6F2XHE.js +0 -1
  215. package/kit/assets/hy-DI6mCUnw.js +0 -1
  216. package/kit/assets/imba-D-Pk5S0X.js +0 -1
  217. package/kit/assets/index-DKDjvsnq.js +0 -12
  218. package/kit/assets/ini-Dix3pTmg.js +0 -1
  219. package/kit/assets/java-BTDmaRNO.js +0 -1
  220. package/kit/assets/javascript-WyGyM1wV.js +0 -1
  221. package/kit/assets/jinja-CGKoJZuT.js +0 -1
  222. package/kit/assets/jison-B9XHrcYJ.js +0 -1
  223. package/kit/assets/json-B8JryHcM.js +0 -1
  224. package/kit/assets/json5-Cdatmj9n.js +0 -1
  225. package/kit/assets/jsonc-CvUCa1o5.js +0 -1
  226. package/kit/assets/jsonl-9I_GBd5L.js +0 -1
  227. package/kit/assets/jsonnet-XoenQ2oc.js +0 -1
  228. package/kit/assets/jssm-CWE2S0Z5.js +0 -1
  229. package/kit/assets/jsx-8cLv2Six.js +0 -1
  230. package/kit/assets/julia-CHsXSRRi.js +0 -1
  231. package/kit/assets/just-BhMjiL1x.js +0 -1
  232. package/kit/assets/kanagawa-dragon-elpLL9d7.js +0 -1
  233. package/kit/assets/kanagawa-lotus-qwxsXd6N.js +0 -1
  234. package/kit/assets/kanagawa-wave-CmHwPSUq.js +0 -1
  235. package/kit/assets/kdl-CMbyIXjQ.js +0 -1
  236. package/kit/assets/kotlin-BQy537ds.js +0 -1
  237. package/kit/assets/kusto-Bh6esMjd.js +0 -1
  238. package/kit/assets/laserwave-si7wuSrt.js +0 -1
  239. package/kit/assets/latex-l4EWm08Q.js +0 -1
  240. package/kit/assets/lean-C4RHkN41.js +0 -1
  241. package/kit/assets/less-XNfgnZC7.js +0 -1
  242. package/kit/assets/light-plus-g_Fi9vkG.js +0 -1
  243. package/kit/assets/liquid-VEiCTF4k.js +0 -1
  244. package/kit/assets/llvm-CQZjIlnZ.js +0 -1
  245. package/kit/assets/log-CcaF_xNv.js +0 -1
  246. package/kit/assets/logo-D9WQLoKQ.js +0 -1
  247. package/kit/assets/lua-8Av-h-ns.js +0 -1
  248. package/kit/assets/luau-CmQFRJk_.js +0 -1
  249. package/kit/assets/make-DXVx14cr.js +0 -1
  250. package/kit/assets/markdown-DX-TNHnc.js +0 -1
  251. package/kit/assets/marko-6XzqJfhW.js +0 -1
  252. package/kit/assets/material-theme-CIJ3cGaW.js +0 -1
  253. package/kit/assets/material-theme-darker-BWg3m1GB.js +0 -1
  254. package/kit/assets/material-theme-lighter-DR8HWMN7.js +0 -1
  255. package/kit/assets/material-theme-ocean-CZf9pk28.js +0 -1
  256. package/kit/assets/material-theme-palenight-BF01YeZy.js +0 -1
  257. package/kit/assets/matlab-DzreyMvm.js +0 -1
  258. package/kit/assets/mdc-DRPSCe6f.js +0 -1
  259. package/kit/assets/mdx-C2fqO2XY.js +0 -1
  260. package/kit/assets/mermaid-B3PwCbv_.js +0 -1
  261. package/kit/assets/min-dark-DhfaepVE.js +0 -1
  262. package/kit/assets/min-light-6xx0uMgm.js +0 -1
  263. package/kit/assets/mipsasm-yE_Aqo9y.js +0 -1
  264. package/kit/assets/mojo-DoyaMtMQ.js +0 -1
  265. package/kit/assets/monokai-CfflZzqd.js +0 -1
  266. package/kit/assets/moonbit-GUn1DCOq.js +0 -1
  267. package/kit/assets/move-DgW29s8x.js +0 -1
  268. package/kit/assets/narrat-DXUZ_ZkW.js +0 -1
  269. package/kit/assets/nextflow-D9i3Mg89.js +0 -1
  270. package/kit/assets/nextflow-groovy-BtKenbWl.js +0 -1
  271. package/kit/assets/nginx-DSXkacNc.js +0 -1
  272. package/kit/assets/night-owl-EdP2Hztp.js +0 -1
  273. package/kit/assets/night-owl-light-Bk-lYVyk.js +0 -1
  274. package/kit/assets/nim-D9lokC5T.js +0 -1
  275. package/kit/assets/nix-Ckjrpg0r.js +0 -1
  276. package/kit/assets/nord-BAu0wM6c.js +0 -1
  277. package/kit/assets/nsis-C1FUr9r5.js +0 -1
  278. package/kit/assets/nushell-D7aJuCS6.js +0 -1
  279. package/kit/assets/objective-c-BoaBTdtz.js +0 -1
  280. package/kit/assets/objective-cpp-DstR8hNy.js +0 -1
  281. package/kit/assets/ocaml-DTbn2Hv7.js +0 -1
  282. package/kit/assets/odin-Bxc4S6Xn.js +0 -1
  283. package/kit/assets/one-dark-pro-utPxbBbJ.js +0 -1
  284. package/kit/assets/one-light-BuCQ22aO.js +0 -1
  285. package/kit/assets/openscad-CXHpNBsb.js +0 -1
  286. package/kit/assets/org-DcqggXXW.js +0 -1
  287. package/kit/assets/pascal-Sr-XLSE6.js +0 -1
  288. package/kit/assets/perl-CP_GSK0L.js +0 -1
  289. package/kit/assets/php-CNeTOyEV.js +0 -1
  290. package/kit/assets/pkl-CRusufhw.js +0 -1
  291. package/kit/assets/plastic-CXnNNlFZ.js +0 -1
  292. package/kit/assets/plsql-Dbm3tV2N.js +0 -1
  293. package/kit/assets/po-LG0lFwH4.js +0 -1
  294. package/kit/assets/poimandres-BrOVMvuE.js +0 -1
  295. package/kit/assets/polar-DjOs3GWb.js +0 -1
  296. package/kit/assets/postcss-GRRkWn2F.js +0 -1
  297. package/kit/assets/powerquery-DHf-dtTS.js +0 -1
  298. package/kit/assets/powershell-CUnxWBRw.js +0 -1
  299. package/kit/assets/prisma-HKDfktb8.js +0 -1
  300. package/kit/assets/prolog-9JcfiY6I.js +0 -1
  301. package/kit/assets/proto-dqx_Sj2i.js +0 -1
  302. package/kit/assets/pug-kUpeg2wB.js +0 -1
  303. package/kit/assets/puppet-Di57VbSS.js +0 -1
  304. package/kit/assets/purescript-BgpM7rDH.js +0 -1
  305. package/kit/assets/python-B6Ihcp-E.js +0 -1
  306. package/kit/assets/qml-DmGQGbca.js +0 -1
  307. package/kit/assets/qmldir-DXd9s5XC.js +0 -1
  308. package/kit/assets/qss-B7NnhfIi.js +0 -1
  309. package/kit/assets/r-C2sK8mqY.js +0 -1
  310. package/kit/assets/racket-CeDx7KO2.js +0 -1
  311. package/kit/assets/raku-BMJwmrCS.js +0 -1
  312. package/kit/assets/razor-C2a5o_rD.js +0 -1
  313. package/kit/assets/rbs-BNdQsBCU.js +0 -1
  314. package/kit/assets/red-D0qvOrrt.js +0 -1
  315. package/kit/assets/reg-Cvyu2Gnx.js +0 -1
  316. package/kit/assets/regexp-DK-WlHNu.js +0 -1
  317. package/kit/assets/rel-BlqNHz8k.js +0 -1
  318. package/kit/assets/riscv-C5dpdlr7.js +0 -1
  319. package/kit/assets/ron-j5NfrB3z.js +0 -1
  320. package/kit/assets/rose-pine-B13eftVv.js +0 -1
  321. package/kit/assets/rose-pine-dawn-BcSoidev.js +0 -1
  322. package/kit/assets/rose-pine-moon-QhZovmiB.js +0 -1
  323. package/kit/assets/rosmsg-ZkSIzPhc.js +0 -1
  324. package/kit/assets/rst-CgFL6KOR.js +0 -1
  325. package/kit/assets/ruby-CoSFdlpl.js +0 -1
  326. package/kit/assets/rust-CxuBE0J8.js +0 -1
  327. package/kit/assets/sas-DPMpzP9X.js +0 -1
  328. package/kit/assets/sass-bfEVHPJ8.js +0 -1
  329. package/kit/assets/scala-DT3kbCHL.js +0 -1
  330. package/kit/assets/scheme-OJppFQF3.js +0 -1
  331. package/kit/assets/scss-n48HZsmL.js +0 -1
  332. package/kit/assets/sdbl-CvZs3G9c.js +0 -1
  333. package/kit/assets/shaderlab-CEJedz68.js +0 -1
  334. package/kit/assets/shellscript-DgJyDXW6.js +0 -1
  335. package/kit/assets/shellsession-DSlzxnCM.js +0 -1
  336. package/kit/assets/slack-dark-CWRQmTmo.js +0 -1
  337. package/kit/assets/slack-ochin-DO_ok7XK.js +0 -1
  338. package/kit/assets/smalltalk-De6KzMWc.js +0 -1
  339. package/kit/assets/smithy-BVTkKWO9.js +0 -1
  340. package/kit/assets/snazzy-light-B5llO_gK.js +0 -1
  341. package/kit/assets/solarized-dark-BWFpDpV1.js +0 -1
  342. package/kit/assets/solarized-light-eZCMDrWD.js +0 -1
  343. package/kit/assets/solidity-SYSxO-p1.js +0 -1
  344. package/kit/assets/soy-DEV4yxgM.js +0 -1
  345. package/kit/assets/sparql-BJh4JEw-.js +0 -1
  346. package/kit/assets/splunk-h-bNAnbk.js +0 -1
  347. package/kit/assets/sql-Dq2MiB0T.js +0 -1
  348. package/kit/assets/ssh-config-CywOjoXH.js +0 -1
  349. package/kit/assets/stata-BcICKvEt.js +0 -1
  350. package/kit/assets/stylus-CIg617SB.js +0 -1
  351. package/kit/assets/surrealql-CWlK9SzL.js +0 -1
  352. package/kit/assets/svelte-B-Z8GLL9.js +0 -1
  353. package/kit/assets/swift-CGD9CJBj.js +0 -1
  354. package/kit/assets/synthwave-84-DRVv-_m_.js +0 -1
  355. package/kit/assets/system-verilog-CG_VWOG3.js +0 -1
  356. package/kit/assets/systemd-DKMPPZjB.js +0 -1
  357. package/kit/assets/talonscript-eRuyeYHl.js +0 -1
  358. package/kit/assets/tasl-B9CVvjfG.js +0 -1
  359. package/kit/assets/tcl-Bq9dbVAF.js +0 -1
  360. package/kit/assets/templ-W185oS4p.js +0 -1
  361. package/kit/assets/terraform-CAp711iT.js +0 -1
  362. package/kit/assets/tex-DNkCctwf.js +0 -1
  363. package/kit/assets/tokyo-night-BvwC8l2v.js +0 -1
  364. package/kit/assets/toml-Ms459DBw.js +0 -1
  365. package/kit/assets/ts-tags-xUT7JH_c.js +0 -1
  366. package/kit/assets/tsv-BFtm7NXx.js +0 -1
  367. package/kit/assets/tsx-D6116Ycy.js +0 -1
  368. package/kit/assets/turtle-DpRhbQZY.js +0 -1
  369. package/kit/assets/twig-k5g5DPXm.js +0 -1
  370. package/kit/assets/typescript-BqvgUolh.js +0 -1
  371. package/kit/assets/typespec-B09nCZui.js +0 -1
  372. package/kit/assets/typst-Dfd71gQj.js +0 -1
  373. package/kit/assets/v-DUsAht2M.js +0 -1
  374. package/kit/assets/vala-z59IxkFd.js +0 -1
  375. package/kit/assets/vb-A7jYO8Gn.js +0 -1
  376. package/kit/assets/verilog-jqltjd44.js +0 -1
  377. package/kit/assets/vesper-DxfWgk_t.js +0 -1
  378. package/kit/assets/vhdl-DJCsFYgn.js +0 -1
  379. package/kit/assets/viml-pbKHW3Ia.js +0 -1
  380. package/kit/assets/vitesse-black-B_BYPdvp.js +0 -1
  381. package/kit/assets/vitesse-dark-DOSOf2Sz.js +0 -1
  382. package/kit/assets/vitesse-light-gUX51GpB.js +0 -1
  383. package/kit/assets/vue-D2T8AFdP.js +0 -1
  384. package/kit/assets/vue-html-zEfNEgpj.js +0 -1
  385. package/kit/assets/vue-vine-DQRWX4iy.js +0 -1
  386. package/kit/assets/vyper-DpazWNpx.js +0 -1
  387. package/kit/assets/wasm-CFi-k9--.js +0 -1
  388. package/kit/assets/wenyan-CYFFG9DK.js +0 -1
  389. package/kit/assets/wgsl-CxjTZs-b.js +0 -1
  390. package/kit/assets/wikitext-Bx2qct8O.js +0 -1
  391. package/kit/assets/wit-DDW3hD69.js +0 -1
  392. package/kit/assets/wolfram-pu21K997.js +0 -1
  393. package/kit/assets/xml-BkAJuBCc.js +0 -1
  394. package/kit/assets/xsl-C6UUWSil.js +0 -1
  395. package/kit/assets/yaml-Bopit2L3.js +0 -1
  396. package/kit/assets/zenscript-BIAKq-aR.js +0 -1
  397. package/kit/assets/zig-bSFrHQ7n.js +0 -1
  398. package/kit/chunks/architecture-7GRP2DOG-DmopnJBM.js +0 -1
  399. package/kit/chunks/channel-8d3EytTd.js +0 -1
  400. package/kit/chunks/classDiagram-DTDB5LWJ-Drr-kJqf.js +0 -1
  401. package/kit/chunks/classDiagram-v2-JRS7N3AN-Drr-kJqf.js +0 -1
  402. package/kit/chunks/cynefin-OW5HDTMX-DkJ1CWpZ.js +0 -1
  403. package/kit/chunks/engine-compile-BDQHc296.js +0 -152
  404. package/kit/chunks/eventmodeling-NTZA5JFV-hzlNNDk-.js +0 -1
  405. package/kit/chunks/flowDiagram-A5DVABFB-CT-HpJwj.js +0 -1
  406. package/kit/chunks/gitGraph-4MIJSDKK-4Akf2-by.js +0 -1
  407. package/kit/chunks/index-DxjmYPLk.js +0 -1
  408. package/kit/chunks/info-A6RAGUB7-BuP6VBwF.js +0 -1
  409. package/kit/chunks/marked-parser-CQPg9t-F.js +0 -1
  410. package/kit/chunks/packet-AYTQ26CC-DvkOaLgE.js +0 -1
  411. package/kit/chunks/pie-WAS4IAKB-B3LaxjZ1.js +0 -1
  412. package/kit/chunks/radar-RG4KPBEZ-Dt_kds5L.js +0 -1
  413. package/kit/chunks/railroad-74A4TZTK-DScav3I9.js +0 -1
  414. package/kit/chunks/railroad-abnf-HS5TGJTU-DKC5Sh7O.js +0 -1
  415. package/kit/chunks/railroad-ebnf-LZEXJU2U-DWLFQZkd.js +0 -1
  416. package/kit/chunks/railroad-peg-WCYAUIDC-CmBlOEo4.js +0 -1
  417. package/kit/chunks/stateDiagram-v2-4QOOHH4V-e0gHn4zn.js +0 -1
  418. package/kit/chunks/swimlanesDiagram-VK2B7HYN-DK9V99PO.js +0 -8
  419. package/kit/chunks/treeView-Q6P3EWNA-CR7EEU-W.js +0 -1
  420. package/kit/chunks/treemap-WGGIJYW6-dsO-ECH3.js +0 -1
  421. package/kit/chunks/wardley-WFR3VGLG-Cg8qdR8L.js +0 -1
@@ -0,0 +1 @@
1
+ import{d as o}from"./chunk-RHFEMEQ7-DXgWUVaq.js";import{c as D}from"./chunk-RHFEMEQ7-DXgWUVaq.js";import"./mermaid.core-Den2NdAK.js";import"./chunk-5VM5RSS4-DglfV9WQ.js";import"./chunk-XXDRQBXY-CI7P87YE.js";import"./chunk-POPQ4Y6H-C-hfwTbE.js";import"./chunk-F27PBJKO-DjeLRSJB.js";import"./markdown-leZ65Gnj.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-code-CXhO_kB-.js";import"./channel-J39uX_8L.js";export{D as createFlowDiagram,o as diagram};
@@ -1,4 +1,4 @@
1
- import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,g as Nn,s as Pn,x as Vn,v as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,o as Xn,B as Gn,u as jn}from"./mermaid.core-CfB36ohx.js";import{g as oe}from"./app-chat-kit-C-b6Y63T.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DKhl7N6S.js";import{i as er}from"./init-Gi6I4Gst.js";import"./markdown-BDO0KNsJ.js";import"solid-js/web";import"solid-js";import"./markdown-code-BTfpGmJj.js";import"solid-js/store";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?yr(t):new ht(t,e,n,r??1)}function ht(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*dr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(ht,be,un(ln,{brighter(t){return new ht(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new ht(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function kr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const pr=kr(Hn);function vr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(S<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=w<S;_&&([S,w]=[w,S]);const Y=P&&typeof P.range=="function"?P:F(S,w,P),X=Y?Y.range(S,+w+1):[];return _?X.reverse():X}function F(S,w,P){const _=Math.abs(w-S)/P,Y=Qn(([,,v])=>v).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]<a[Y][2]/_?Y-1:Y];return X.every(B)}return[y,F]}const[Yr,Fr]=_r(kt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ur(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,S=Ot(i),w=Ht(i),P=Ot(s),_=Ht(s),Y=Ot(a),X=Ht(a),B=Ot(y),v=Ht(y),U=Ot(F),R=Ht(F),E={a:m,A:I,b:o,B:W,c:null,d:Xe,e:Xe,f:ti,g:li,G:di,H:Qr,I:Jr,j:Kr,L:Dn,m:ei,M:ni,p:u,q:K,Q:Qe,s:Je,S:ri,u:ii,U:si,V:ai,w:oi,W:ci,x:null,X:null,y:ui,Y:fi,Z:hi,"%":je},z={a:l,A:$,b:O,B:j,c:null,d:Ge,e:Ge,f:ki,g:Si,G:Yi,H:mi,I:gi,j:yi,L:Cn,m:pi,M:vi,p:H,q:J,Q:Qe,s:Je,S:Ti,u:xi,U:bi,V:wi,w:Di,W:Mi,x:null,X:null,y:Ci,Y:_i,Z:Fi,"%":je},G={a:x,A:C,b:M,B:D,c,d:Be,e:Be,f:Zr,g:qe,G:ze,H:Ze,I:Ze,j:Rr,L:Br,m:Vr,M:zr,p:L,q:Pr,Q:Gr,s:jr,S:qr,u:Wr,U:$r,V:Or,w:Ar,W:Hr,x:g,X:b,y:qe,Y:ze,Z:Nr,"%":Xr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),z.x=T(n,z),z.X=T(r,z),z.c=T(e,z);function T(h,N){return function(V){var f=[],tt=-1,A=0,Q=h.length,Z,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(A,tt)),(st=Re[Z=h.charAt(++tt)])!=null?Z=h.charAt(++tt):st=Z==="e"?" ":"0",(at=N[Z])&&(Z=at(V,st)),f.push(Z),A=tt+1);return f.push(h.slice(A,tt)),f.join("")}}function k(h,N){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),A,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(N&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt<A;){if(f>=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Lr(t){return t.replace(Ir,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Lr).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)<T?Y:y(T)<T?X:a(T)<T?B:s(T)<T?v:r(T)<T?i(T)<T?U:R:n(T)<T?E:z)(T)}return w.invert=function(T){return new Date(P(T))},w.domain=function(T){return arguments.length?_(Array.from(T,Ii)):_().map(Ei)},w.ticks=function(T){var k=_();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:S(k)},w.nice=function(T){var k=_();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?_(vr(k,T)):w},w.copy=function(){return Kn(w,_n(t,e,n,r,i,s,a,y,F,S))},w}function Li(){return er.apply(_n(Yr,Fr,kt,Rt,zt,xt,Pt,Nt,vt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Ai=jt.exports,Ke;function Wi(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Ai,(function(){var n="day";return function(r,i,s){var a=function(S){return S.add(4-S.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(S){if(!this.$utils().u(S))return this.add(7*(S-this.isoWeek()),n);var w,P,_,Y,X=a(this),B=(w=this.isoWeekYear(),P=this.$u,_=(P?s.utc:s)().year(w).startOf("year"),Y=4-_.isoWeekday(),_.isoWeekday()>4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G<z;G+=1){var T=E[G],k=X[T],p=k&&k[0],L=k&&k[1];E[G]=L?{regex:p,parser:L}:T.replace(/^\[|\]$/g,"")}return function(x){for(var C={},M=0,D=0;M<z;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),I=g.exec(m)[0];b.call(C,I),x=x.replace(I,"")}}return(function(o){var W=o.afternoon;if(W!==void 0){var u=o.hours;W?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(C),C}}return function(v,U,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(S=v.parseTwoDigitYear);var E=U.prototype,z=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var L=p[1];if(typeof L=="string"){var x=p[2]===!0,C=p[3]===!0,M=x||C,D=p[2];C&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,I,o,W){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`:
1
+ import{bf as on,bg as On,bh as cn,bi as un,bj as ln,bk as ue,bl as Hn,g as Nn,s as Pn,x as Vn,v as Rn,a as zn,b as qn,_ as d,c as Yt,j as Zt,d as Bn,bm as it,l as Tt,k as Zn,o as Xn,B as Gn,u as jn}from"./mermaid.core-Den2NdAK.js";import{g as oe}from"./app-chat-kit-Ck66xmNL.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-Ls7JLhyc.js";import{i as er}from"./init-Gi6I4Gst.js";import"./markdown-leZ65Gnj.js";import"solid-js/web";import"solid-js";import"./markdown-code-CXhO_kB-.js";import"solid-js/store";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*hr;return new ht(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function be(t,e,n,r){return arguments.length===1?yr(t):new ht(t,e,n,r??1)}function ht(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function pn(t){if(isNaN(t.h))return new ft(t.l,0,0,t.opacity);var e=t.h*dr;return new ft(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}cn(ht,be,un(ln,{brighter(t){return new ht(this.h,this.c,this.l+ne*(t??1),this.opacity)},darker(t){return new ht(this.h,this.c,this.l-ne*(t??1),this.opacity)},rgb(){return pn(this).rgb()}}));function kr(t){return function(e,n){var r=t((e=be(e)).h,(n=be(n)).h),i=ue(e.c,n.c),s=ue(e.l,n.l),a=ue(e.opacity,n.opacity);return function(y){return e.h=r(y),e.c=i(y),e.l=s(y),e.opacity=a(y),e+""}}}const pr=kr(Hn);function vr(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],s=t[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),t[n]=e.floor(i),t[r]=e.ceil(s),t}const ge=new Date,ye=new Date;function nt(t,e,n,r){function i(s){return t(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a<y-s?a:y},i.offset=(s,a)=>(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s<a)||!(y>0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(S<s&&s<a);return F},i.filter=s=>nt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=w<S;_&&([S,w]=[w,S]);const Y=P&&typeof P.range=="function"?P:F(S,w,P),X=Y?Y.range(S,+w+1):[];return _?X.reverse():X}function F(S,w,P){const _=Math.abs(w-S)/P,Y=Qn(([,,v])=>v).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]<a[Y][2]/_?Y-1:Y];return X.every(B)}return[y,F]}const[Yr,Fr]=_r(kt,Rt,zt,xt,Pt,Nt);function pe(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ve(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function $t(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Ur(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,s=t.days,a=t.shortDays,y=t.months,F=t.shortMonths,S=Ot(i),w=Ht(i),P=Ot(s),_=Ht(s),Y=Ot(a),X=Ht(a),B=Ot(y),v=Ht(y),U=Ot(F),R=Ht(F),E={a:m,A:I,b:o,B:W,c:null,d:Xe,e:Xe,f:ti,g:li,G:di,H:Qr,I:Jr,j:Kr,L:Dn,m:ei,M:ni,p:u,q:K,Q:Qe,s:Je,S:ri,u:ii,U:si,V:ai,w:oi,W:ci,x:null,X:null,y:ui,Y:fi,Z:hi,"%":je},z={a:l,A:$,b:O,B:j,c:null,d:Ge,e:Ge,f:ki,g:Si,G:Yi,H:mi,I:gi,j:yi,L:Cn,m:pi,M:vi,p:H,q:J,Q:Qe,s:Je,S:Ti,u:xi,U:bi,V:wi,w:Di,W:Mi,x:null,X:null,y:Ci,Y:_i,Z:Fi,"%":je},G={a:x,A:C,b:M,B:D,c,d:Be,e:Be,f:Zr,g:qe,G:ze,H:Ze,I:Ze,j:Rr,L:Br,m:Vr,M:zr,p:L,q:Pr,Q:Gr,s:jr,S:qr,u:Wr,U:$r,V:Or,w:Ar,W:Hr,x:g,X:b,y:qe,Y:ze,Z:Nr,"%":Xr};E.x=T(n,E),E.X=T(r,E),E.c=T(e,E),z.x=T(n,z),z.X=T(r,z),z.c=T(e,z);function T(h,N){return function(V){var f=[],tt=-1,A=0,Q=h.length,Z,st,at;for(V instanceof Date||(V=new Date(+V));++tt<Q;)h.charCodeAt(tt)===37&&(f.push(h.slice(A,tt)),(st=Re[Z=h.charAt(++tt)])!=null?Z=h.charAt(++tt):st=Z==="e"?" ":"0",(at=N[Z])&&(Z=at(V,st)),f.push(Z),A=tt+1);return f.push(h.slice(A,tt)),f.join("")}}function k(h,N){return function(V){var f=$t(1900,void 0,1),tt=p(f,h,V+="",0),A,Q;if(tt!=V.length)return null;if("Q"in f)return new Date(f.Q);if("s"in f)return new Date(f.s*1e3+("L"in f?f.L:0));if(N&&!("Z"in f)&&(f.Z=0),"p"in f&&(f.H=f.H%12+f.p*12),f.m===void 0&&(f.m="q"in f?f.q:0),"V"in f){if(f.V<1||f.V>53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt<A;){if(f>=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(e)+i:i)}function Lr(t){return t.replace(Ir,"\\$&")}function Ot(t){return new RegExp("^(?:"+t.map(Lr).join("|")+")","i")}function Ht(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)<T?Y:y(T)<T?X:a(T)<T?B:s(T)<T?v:r(T)<T?i(T)<T?U:R:n(T)<T?E:z)(T)}return w.invert=function(T){return new Date(P(T))},w.domain=function(T){return arguments.length?_(Array.from(T,Ii)):_().map(Ei)},w.ticks=function(T){var k=_();return t(k[0],k[k.length-1],T??10)},w.tickFormat=function(T,k){return k==null?G:S(k)},w.nice=function(T){var k=_();return(!T||typeof T.range!="function")&&(T=e(k[0],k[k.length-1],T??10)),T?_(vr(k,T)):w},w.copy=function(){return Kn(w,_n(t,e,n,r,i,s,a,y,F,S))},w}function Li(){return er.apply(_n(Yr,Fr,kt,Rt,zt,xt,Pt,Nt,vt,ie).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var jt={exports:{}},Ai=jt.exports,Ke;function Wi(){return Ke||(Ke=1,(function(t,e){(function(n,r){t.exports=r()})(Ai,(function(){var n="day";return function(r,i,s){var a=function(S){return S.add(4-S.isoWeekday(),n)},y=i.prototype;y.isoWeekYear=function(){return a(this).year()},y.isoWeek=function(S){if(!this.$utils().u(S))return this.add(7*(S-this.isoWeek()),n);var w,P,_,Y,X=a(this),B=(w=this.isoWeekYear(),P=this.$u,_=(P?s.utc:s)().year(w).startOf("year"),Y=4-_.isoWeekday(),_.isoWeekday()>4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G<z;G+=1){var T=E[G],k=X[T],p=k&&k[0],L=k&&k[1];E[G]=L?{regex:p,parser:L}:T.replace(/^\[|\]$/g,"")}return function(x){for(var C={},M=0,D=0;M<z;M+=1){var c=E[M];if(typeof c=="string")D+=c.length;else{var g=c.regex,b=c.parser,m=x.slice(D),I=g.exec(m)[0];b.call(C,I),x=x.replace(I,"")}}return(function(o){var W=o.afternoon;if(W!==void 0){var u=o.hours;W?u<12&&(o.hours+=12):u===12&&(o.hours=0),delete o.afternoon}})(C),C}}return function(v,U,R){R.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(S=v.parseTwoDigitYear);var E=U.prototype,z=E.parse;E.parse=function(G){var T=G.date,k=G.utc,p=G.args;this.$u=k;var L=p[1];if(typeof L=="string"){var x=p[2]===!0,C=p[3]===!0,M=x||C,D=p[2];C&&(D=p[2]),F=this.$locale(),!x&&D&&(F=R.Ls[D]),this.$d=(function(m,I,o,W){try{if(["x","X"].indexOf(I)>-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`:
2
2
  `+H.showPosition()+`
3
3
  Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{g as o}from"./mermaid-parser.core-ButbfTJL.js";import{G}from"./mermaid-parser.core-ButbfTJL.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";export{G as GitGraphModule,o as createGitGraphServices};
@@ -1,4 +1,4 @@
1
- import{I as le}from"./chunk-2Q5K7J3B-C7CILgFW.js";import{p as he}from"./chunk-JWPE2WC7-Cqwb9v7c.js";import{x as $e,v as fe,s as ge,g as ue,a as ye,b as xe,_ as h,G as J,l as w,j as me,c as q,u as pe,H as be,B as we,k as B,I as ke,K as ve,L as Ce}from"./mermaid.core-CfB36ohx.js";import{v as Ee}from"./mermaid-parser.core-D9Cspzql.js";import"./app-chat-kit-C-b6Y63T.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-BDO0KNsJ.js";import"./markdown-code-BTfpGmJj.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Ie=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Re=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Ie,branch:Re,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ke(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ue(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=h(e=>e.branch,"parseCheckout"),Ue=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,I=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],R=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),R=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-I).attr("y",t.y+13.5).attr("width",l.width+2*I).attr("height",l.height+2*I),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
1
+ import{I as le}from"./chunk-2Q5K7J3B-BC9T3euC.js";import{p as he}from"./chunk-JWPE2WC7-AcX35oCq.js";import{x as $e,v as fe,s as ge,g as ue,a as ye,b as xe,_ as h,G as J,l as w,j as me,c as q,u as pe,H as be,B as we,k as B,I as ke,K as ve,L as Ce}from"./mermaid.core-Den2NdAK.js";import{v as Ee}from"./mermaid-parser.core-ButbfTJL.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-leZ65Gnj.js";import"./markdown-code-CXhO_kB-.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Ie=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Re=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Ie,branch:Re,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ke(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ue(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ke=h(e=>e.branch,"parseCheckout"),Ue=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,I=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],R=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),R=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-I).attr("y",t.y+13.5).attr("width",l.width+2*I).attr("height",l.height+2*I),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
2
2
  ${s-i/2-L/2},${x+I}
3
3
  ${s-i/2-L/2},${x-I}
4
4
  ${t.posWithOffset-i/2-L},${x-c-I}
@@ -0,0 +1 @@
1
+ import{b as a}from"./engine-compile-CLAWXunO.js";import{a as l,c as g,d as h,e as m,f as c,g as d,h as T,i as p,j as S,k,l as u,m as H,n as f,o as b,p as C}from"./engine-compile-CLAWXunO.js";import{createOnigurumaEngine as L,loadWasm as v}from"./engine-oniguruma-C5ugeybA.js";import{S as z,a as A,b as E,c as I,d as B,e as P,f as R,g as W,h as j,i as G,j as D,k as J,l as O,m as V,n as q,o as w,p as F,q as N,r as K,s as M,t as Q,u as U,v as X,w as Y,x as Z,y as _,z as $,A as ee,B as ae,C as se,D as te,E as ie,F as re,G as oe,H as ne,I as le}from"./core-CXDtDTdc.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";export{z as ShikiError,A as addClassToHast,E as applyColorReplacements,a as bundledLanguages,l as bundledLanguagesAlias,g as bundledLanguagesBase,h as bundledLanguagesInfo,m as bundledThemes,c as bundledThemesInfo,d as codeToHast,T as codeToHtml,p as codeToTokens,S as codeToTokensBase,k as codeToTokensWithThemes,I as createBundledHighlighter,B as createCssVariablesTheme,u as createHighlighter,P as createHighlighterCore,R as createHighlighterCoreSync,H as createJavaScriptRegexEngine,L as createOnigurumaEngine,W as createPositionConverter,j as createShikiInternal,G as createShikiInternalSync,D as createShikiPrimitive,J as createShikiPrimitiveAsync,O as createSingletonShorthands,f as defaultJavaScriptRegexConstructor,V as flatTokenVariants,b as getLastGrammarState,C as getSingletonHighlighter,q as getSingletonHighlighterCore,w as getTokenStyleObject,F as guessEmbeddedLanguages,N as hastToHtml,K as isNoneTheme,M as isPlainLang,Q as isSpecialLang,U as isSpecialTheme,v as loadWasm,X as makeSingletonHighlighter,Y as makeSingletonHighlighterCore,Z as normalizeGetter,_ as normalizeTheme,$ as resolveColorReplacements,ee as splitLines,ae as splitToken,se as splitTokens,te as stringifyTokenStyle,ie as toArray,re as tokenizeAnsiWithTheme,oe as tokenizeWithTheme,ne as tokensToHast,le as transformerDecorations};
@@ -1,4 +1,4 @@
1
- import{i as je,s as qe,r as Ze,p as Ye,a as Xe,h as Qe,d as Je,c as tn,b as en,e as ke,f as nn,g as vt,j as sn,k as Xt,l as xt,q as at,m as Qt,n as Jt}from"./file-BlRQDOFP.js";import{b as te}from"./app-chat-kit-C-b6Y63T.js";import{L as $,M as ee}from"./engine-compile-BDQHc296.js";import"solid-js/web";import"solid-js";import"solid-js/store";const rn={compositeOverBg:en,contrastRatio:tn,deriveMutedFg:Je,hoverWouldEraseText:Qe,isDarkSurface:Xe,isFullyTransparent:je,pickReadableForeground:Ye,relativeLuminance:Ze,surfacesMatch:qe},on=100,et=1,Ut=2,Vt=3;var Te=class{#e=[];#t=[];#r;#n=!1;constructor(t){this.#r=Math.max(1,t?.maxEntries??on)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0,this.#n=!1}clearRedo(){this.#t.length=0}push(t){this.#e.push(t),this.clearRedo(),this.#n=!0,this.#e.length>this.#r&&this.#e.shift()}setLastUndoSelectionsAfter(t){const e=this.#e[this.#e.length-1];e!==void 0&&(e.selectionsAfter=t.map(n=>({...n})))}setLastUndoLineAnnotations(t,e){const n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=t.slice(),n.lineAnnotationsAfter=e.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#n?this.peekUndo():void 0}replaceLastUndo(t){if(this.#e.length===0){this.push(t);return}this.#e[this.#e.length-1]=t,this.clearRedo(),this.#n=!0}popUndoToRedo(){const t=this.#e.pop();if(t!==void 0)return this.#t.push(t),this.#n=!1,t}popRedoToUndo(){const t=this.#t.pop();if(t!==void 0)return this.#e.push(t),this.#n=!1,t}};function an(t,e,n,i,s,r,o,a){const c=[...e].sort((l,f)=>l.start-f.start),h=[];let d;if(s?.length===c.length){const l=[];for(const f of s){if(f.start.line!==f.end.line||f.start.character!==f.end.character)break;l.push(t.offsetAt(f.start))}if(l.length===c.length){l.sort((v,g)=>v-g);let f=!0,u=!0;for(let v=0;v<c.length;v++){const g=c[v];if(g.text.length>0||g.start===g.end){f=!1,u=!1;break}f&&=l[v]===g.end,u&&=l[v]===g.start}d=f?Ut:u?Vt:void 0}}for(let l=0,f=0;l<c.length;l++){const u=c[l],v=t.getTextSlice(u.start,u.end),g=u.start+f;h.push({start:g,end:g+u.text.length,text:v}),f+=u.text.length-(u.end-u.start)}return{forwardEdits:c.map(l=>({...l})),inverseEdits:h,versionBefore:n,versionAfter:i,selectionsBefore:s?.map(l=>({...l})),selectionsAfter:r?.map(l=>({...l})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:a?.slice(),coalescingMode:d}}function cn(t,e){if(t===void 0||t.undoBoundary===!0||e.undoBoundary===!0||t.forwardEdits.length===0||t.forwardEdits.length!==t.inverseEdits.length||t.forwardEdits.length!==e.forwardEdits.length||e.forwardEdits.length!==e.inverseEdits.length)return!1;let n;for(let i=0;i<t.forwardEdits.length;i++){const s=t.forwardEdits[i],r=t.inverseEdits[i],o=e.forwardEdits[i],a=e.inverseEdits[i],c=Ee(o.start,t.forwardEdits),h=s.start<=s.end&&s.text.length>0&&!s.text.includes(`
1
+ import{i as je,s as qe,r as Ze,p as Ye,a as Xe,h as Qe,d as Je,c as tn,b as en,e as ke,f as nn,g as vt,j as sn,k as Xt,l as xt,q as at,m as Qt,n as Jt}from"./file-4YaHcrma.js";import{b as te}from"./app-chat-kit-Ck66xmNL.js";import{J as $,K as ee}from"./core-CXDtDTdc.js";import"solid-js/web";import"solid-js";import"./engine-compile-CLAWXunO.js";import"./engine-oniguruma-C5ugeybA.js";import"solid-js/store";const rn={compositeOverBg:en,contrastRatio:tn,deriveMutedFg:Je,hoverWouldEraseText:Qe,isDarkSurface:Xe,isFullyTransparent:je,pickReadableForeground:Ye,relativeLuminance:Ze,surfacesMatch:qe},on=100,et=1,Ut=2,Vt=3;var Te=class{#e=[];#t=[];#r;#n=!1;constructor(t){this.#r=Math.max(1,t?.maxEntries??on)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0,this.#n=!1}clearRedo(){this.#t.length=0}push(t){this.#e.push(t),this.clearRedo(),this.#n=!0,this.#e.length>this.#r&&this.#e.shift()}setLastUndoSelectionsAfter(t){const e=this.#e[this.#e.length-1];e!==void 0&&(e.selectionsAfter=t.map(n=>({...n})))}setLastUndoLineAnnotations(t,e){const n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=t.slice(),n.lineAnnotationsAfter=e.slice())}peekUndo(){return this.#e[this.#e.length-1]}peekUndoForCoalescing(){return this.#n?this.peekUndo():void 0}replaceLastUndo(t){if(this.#e.length===0){this.push(t);return}this.#e[this.#e.length-1]=t,this.clearRedo(),this.#n=!0}popUndoToRedo(){const t=this.#e.pop();if(t!==void 0)return this.#t.push(t),this.#n=!1,t}popRedoToUndo(){const t=this.#t.pop();if(t!==void 0)return this.#e.push(t),this.#n=!1,t}};function an(t,e,n,i,s,r,o,a){const c=[...e].sort((l,f)=>l.start-f.start),h=[];let d;if(s?.length===c.length){const l=[];for(const f of s){if(f.start.line!==f.end.line||f.start.character!==f.end.character)break;l.push(t.offsetAt(f.start))}if(l.length===c.length){l.sort((v,g)=>v-g);let f=!0,u=!0;for(let v=0;v<c.length;v++){const g=c[v];if(g.text.length>0||g.start===g.end){f=!1,u=!1;break}f&&=l[v]===g.end,u&&=l[v]===g.start}d=f?Ut:u?Vt:void 0}}for(let l=0,f=0;l<c.length;l++){const u=c[l],v=t.getTextSlice(u.start,u.end),g=u.start+f;h.push({start:g,end:g+u.text.length,text:v}),f+=u.text.length-(u.end-u.start)}return{forwardEdits:c.map(l=>({...l})),inverseEdits:h,versionBefore:n,versionAfter:i,selectionsBefore:s?.map(l=>({...l})),selectionsAfter:r?.map(l=>({...l})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:a?.slice(),coalescingMode:d}}function cn(t,e){if(t===void 0||t.undoBoundary===!0||e.undoBoundary===!0||t.forwardEdits.length===0||t.forwardEdits.length!==t.inverseEdits.length||t.forwardEdits.length!==e.forwardEdits.length||e.forwardEdits.length!==e.inverseEdits.length)return!1;let n;for(let i=0;i<t.forwardEdits.length;i++){const s=t.forwardEdits[i],r=t.inverseEdits[i],o=e.forwardEdits[i],a=e.inverseEdits[i],c=Ee(o.start,t.forwardEdits),h=s.start<=s.end&&s.text.length>0&&!s.text.includes(`
2
2
  `)&&!r.text.includes(`
3
3
  `),d=o.start===o.end&&o.text.length>0&&!o.text.includes(`
4
4
  `)&&a.text.length===0;if(h&&d){if(o.start!==r.end||(n??=et,n!==et||t.coalescingMode!==void 0&&t.coalescingMode!==et||e.coalescingMode!==void 0&&e.coalescingMode!==et))return!1;continue}const l=s.text.length===0&&s.end>s.start&&r.text.length>0,f=o.text.length===0&&o.end>o.start&&a.text.length>0;if(l&&f){let u;if(c===s.end)u=Vt;else{if(c+(o.end-o.start)!==s.start)return!1;u=Ut}if(n??=u,n!==u||t.coalescingMode!==void 0&&t.coalescingMode!==u||e.coalescingMode!==void 0&&e.coalescingMode!==u)return!1;continue}return!1}return n!==void 0}function ln(t,e){const n=[],i=[];let s;for(let r=0;r<t.forwardEdits.length;r++){const o=t.forwardEdits[r],a=t.inverseEdits[r],c=e.forwardEdits[r],h=e.inverseEdits[r],d=Ee(c.start,t.forwardEdits);if(o.text.length>0){s??=et,n.push({start:o.start,end:o.end,text:o.text+c.text}),i.push(a.text);continue}if(d===o.end){s??=Vt,n.push({start:o.start,end:d+(c.end-c.start),text:""}),i.push(a.text+h.text);continue}s??=Ut,n.push({start:Math.min(o.start,d),end:o.end,text:""}),i.push(h.text+a.text)}return{forwardEdits:n,inverseEdits:hn(n,i),versionBefore:t.versionBefore,versionAfter:e.versionAfter,selectionsBefore:t.selectionsBefore?.slice(),selectionsAfter:e.selectionsAfter?.slice(),lineAnnotationsBefore:t.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:e.lineAnnotationsAfter?.slice(),coalescingMode:s}}function hn(t,e){const n=[];for(let i=0,s=0;i<t.length;i++){const r=t[i],o=r.start+s;n.push({start:o,end:o+r.text.length,text:e[i]}),s+=r.text.length-(r.end-r.start)}return n}function Ee(t,e){let n=t;for(const i of e){const s=i.end-i.start,r=i.text.length,o=r-s;if(!(n<i.start)){if(n>=i.start+r){n-=o;continue}n=i.start+Math.min(n-i.start,s)}}return n}const dn=1e5,It=10,dt=13,fn="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";var nt=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(t,e,n,i,s,r,o,a){this.source=t,this.offset=e,this.length=n,this.lineOffsetStart=i,this.lineOffsetEnd=s,this.hasVirtualTrailingCRBreak=r,this.firstCharCode=o,this.lastCharCode=a}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+(this.hasVirtualTrailingCRBreak?1:0)}},ne=class{text;lineOffsets;constructor(t){this.text=t,this.lineOffsets=ke(t)}append(t){const e=this.text.length;for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);i!==It&&i!==dt||(i===dt&&t.charCodeAt(n+1)===It&&n++,this.lineOffsets.push(e+n+1))}return this.text+=t,e}},ct=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(t,e=t.length,n=t.lineBreakCount,i=t.firstCharCode,s=t.lastCharCode){this.piece=t,this.subtreeLength=e,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=i,this.subtreeLastCharCode=s}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-(U(this.left?.subtreeLastCharCode,this.piece.firstCharCode)?1:0)-(U(this.piece.lastCharCode,this.right?.subtreeFirstCharCode)?1:0),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},un=class{#e;#t=new ne("");#r=null;#n=0;#a=0;#l=null;#c=null;#p=null;#S=2654435769;constructor(t){this.#e=new ne(t);const e=this.#y(nt.Original,0,t.length);this.#r=e.length>0?this.#j(e):null,this.#n=this.#r?.subtreeLength??0,this.#a=(this.#r?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#a}getText(t){if(t===void 0)return this.#B();const e=this.offsetAt(t.start),n=this.offsetAt(t.end);return this.getTextSlice(e,n)}getLineText(t,e=!1){if(this.#l!==null&&this.#l[0]===t&&this.#l[1]===e)return this.#l[2];const n=this.#w(t);if(n===void 0)throw new Error(`Line index out of range: ${t}`);const i=this.getTextSlice(n[0],n[1],!e);return this.#l=[t,e,i],this.#c=[t,e,i.length],i}getLineLength(t,e=!1){const n=this.#c,i=this.#l;if(n!==null&&n[0]===t&&n[1]===e)return n[2];if(i!==null&&i[0]===t&&i[1]===e){const c=i[2].length;return this.#c=[t,e,c],c}const s=this.#w(t);if(s===void 0)throw new Error(`Line index out of range: ${t}`);const[r,o]=s;let a=o-r;if(!e)for(;a>0&&bt(this.charAt(r+a-1).charCodeAt(0));)a--;return this.#c=[t,e,a],a}getTextSlice(t,e,n=!1){if(t>=e)return"";const i=_(t,0,this.#n),s=_(e,i,this.#n);if(i>=s)return"";const r=this.#L(i);if(r===void 0)return"";const o=[];let[a,c]=r,h=s-i;for(;a!==null&&h>0;){const d=Math.min(a.piece.length-c,h),l=this.#C(a.piece.source),f=a.piece.offset+c;let u=f+d;if(n)for(;u>f&&bt(l.text.charCodeAt(u-1));)u--;o.push(l.text.slice(f,u)),h-=d,c=0,a=this.#v(a)}return o.join("")}charAt(t){const e=this.#L(t);if(e===void 0)return"";const[n,i]=e;return this.#C(n.piece.source).text.charAt(n.piece.offset+i)}includes(t){if(t.length===0)return!0;const e=ie(t);let n=0,i=!1;return this.#x(s=>{for(let r=s.start;r<s.end;r++){const o=s.text.charCodeAt(r);for(;n>0&&o!==t.charCodeAt(n);)n=e[n-1];if(o===t.charCodeAt(n)&&n++,n===t.length)return i=!0,!1}return!0}),i}findNextNonOverlappingSubstring(t,e){if(t.length===0||t.length>this.#n)return;const n=gn(e,this.#n),i=n.reduce((h,[,d])=>Math.max(h,d),0),s=ie(t);let r=0,o=0,a,c;return this.#x(h=>{for(let d=h.start;d<h.end;d++){const l=h.text.charCodeAt(d);for(;r>0&&l!==t.charCodeAt(r);)r=s[r-1];if(l===t.charCodeAt(r)&&r++,r===t.length){const f=o-t.length+1;if(!pn(n,f,f+t.length)){if(f>=i)return c=f,!1;a??=f}r=s[r-1]}o++}return!0}),c??a}search(t){if(t.text.length===0||this.#n===0)return[];if(t.text.includes(`
@@ -507,7 +507,7 @@ import{i as je,s as qe,r as Ze,p as Ye,a as Xe,h as Qe,d as Je,c as tn,b as en,e
507
507
  --diffs-editor-info-fg: ${p??"initial"};
508
508
  --diffs-editor-warning-fg: ${C??"initial"};
509
509
  --diffs-editor-error-fg: ${m??"initial"};
510
- }`),this.#a=t,this.#n=e??n.type,this.#l=i}#z(){if(this.#a==="")return;const{colorMap:t}=this.#e.setTheme(this.#a);this.#l=t}cleanUp(){this.#F=!0,this.stopBackgroundTokenize(),this.#$(),this.#T?.forEach(t=>t()),this.#T=void 0}tokenize(t,e){if(this.#A(),this.#z(),this.#t===void 0&&!lt(this.#c.languageId))throw new Error(`Grammar for language "${this.#c.languageId}" not loaded`);this.#v&&(this.#N.length=Math.min(this.#N.length,t.startLine));const{lineCount:n}=this.#c,{startingLine:i=0,totalLines:s=1/0}=e??{},r=s===1/0?n:Math.min(i+s,n),o=t.startLine,a=Math.max(i,o),c=e!==void 0&&s!==1/0&&t.lineDelta>0&&o<r&&t.endLine>=r,h=t.lineDelta===0&&(t.changedLineChanges?.every(([,,T])=>T===0)??!0),d=h||e===void 0||o>=a,l=t.changedLineRanges??[[o,t.endLine]];this.#B=[],this.#x=0,this.#C=[];let f=-1;if(o<a)for(const[T,R]of l)T<a&&(f=Math.max(f,Math.min(R,a-1)));const u=f>=o&&(h||t.lineDelta<0);h?this.#R(o):(this.#W(t),(e===void 0||o>=a)&&this.#R(a));let v=0,g=l[v][1],p,C=0,m=h?l[v][0]:a,x=!1;const L=new Map,S=u?new Map:void 0;if(S!==void 0&&!h){const T=Math.min(f+1,a,r);if(T>o){this.#R(T);let R=o,O=this.#o[R]??$;for(;R<T;R++){const A=this.#H(R,O);O=A.state,S.set(R,A.resolvedTokens)}this.#o[T]=O}}let w=this.#o[m]??$;for(;m<r;){const T=h?this.#o[m+1]:void 0;d&&(this.#o[m]=w);const{resolvedTokens:R,state:O}=this.#H(m,w);if(w=O,m>=a?L.set(m,R):S?.set(m,R),d&&(this.#o[m+1]=w),x=m>=g&&h&&T!==void 0&&w.equals(T),x){v++;const A=l[v];if(A===void 0)break;if(A[0]>=r){p=A[0],C=v;break}this.#o[A[0]]===void 0?(g=A[1],m++):(m=A[0],w=this.#o[m]??w,g=A[1]),x=!1;continue}m++}if(d&&(m<r?this.#o[m+1]=w:this.#o[m]=w),S!==void 0&&S.size>0&&this.#u(S,this.#n),p!==void 0)this.#b(p,l,C);else if(!x&&m<n){const T=c&&o>=a?r:o<a&&!h?o:m;this.#b(T,l,v)}return L}prebuildStateStack(t){this.#A(),this.#V(t)}stopBackgroundTokenize(){this.#I=-1,!this.#g&&(this.#g=!0,this.#M=!1,this.#y=-1,this.#E=-1,this.#U=void 0,this.#k=0,this.#B=[],this.#x=0,this.#C=[],this.#$())}pauseBackgroundTokenize(){this.#g||this.#M||(this.#w&&console.log("[diffs/editor] background tokenization paused",{jobId:this.#m}),this.#M=!0)}resumeBackgroundTokenize(){this.#g||!this.#M||this.#t===void 0||this.#y<0||(this.#w&&console.log("[diffs/editor] background tokenization resumed",{jobId:this.#m}),this.#M=!1,this.#Q(this.#m))}#A(){this.#t===void 0&&!lt(this.#c.languageId)&&this.#e.getLoadedLanguages().includes(this.#c.languageId)&&(this.#t=this.#e.getLanguage(this.#c.languageId))}#s(){this.#h||(globalThis.addEventListener("message",this.#D),this.#h=!0)}#$(){this.#h&&(globalThis.removeEventListener("message",this.#D),this.#h=!1)}#Q(t){globalThis.postMessage({type:"tokenize",tokenizerId:this.#j,jobId:t})}#b(t,e,n=0){if(lt(this.#c.languageId))return;const i=++this.#m;this.#w&&console.log("[diffs/editor] background tokenization scheduled",{jobId:i,startLine:t,changedLineRanges:e,changedRangeIndex:n}),this.#g=!1,this.#M=!1,this.#y=t,this.#E>=0&&(this.#I=Math.max(this.#I,this.#E)),this.#E=-1,this.#U=e,this.#k=n,this.#s(),this.#Q(i)}#P(t){if(this.#t===void 0||this.#o.length>t)return;if(!this.#g){this.#E>=0?this.#E=Math.max(this.#E,t):this.#I=Math.max(this.#I,t);return}const e=++this.#m;this.#g=!1,this.#M=!1,this.#y=this.#o.length-1,this.#E=t,this.#I=-1,this.#U=void 0,this.#k=0,this.#s(),this.#Q(e)}#H(t,e){const n=this.#c.getLineText(t);if(n.length>this.#p)return console.warn(`[diffs] Line(${t}) too long to tokenize: ${n.length}`),this.#_(t,null),{resolvedTokens:[[0,"",n]],state:e};if(this.#t===void 0||n===""||n.trim()==="")return this.#_(t,null),{resolvedTokens:[[0,"",n]],state:e};const i=Et(this.#t,this.#l,n,e,Tt,this.#v);return this.#_(t,i.bracketIgnoredRanges),{resolvedTokens:i.resolvedTokens,state:i.ruleStack}}#_(t,e){this.#v&&(this.#N[t]=e)}#W(t){const e=t.changedLineChanges??[[t.startLine,t.endLine,t.lineDelta]],n=t.startLine+1;n<=this.#o.length-n?(this.#B=this.#o,this.#x=0,this.#o=this.#o.slice(0,n)):(this.#x=n,this.#B=this.#o.slice(n),this.#o.length=Math.min(this.#o.length,n)),this.#C=e}#it(t){let e=t;for(let n=this.#C.length-1;n>=0;n--){const[i,s,r]=this.#C[n];if(r!==0){if(e>s)e-=r;else if(e>i)return this.#o[t]}}return this.#B[e-this.#x]??this.#o[t]}#R(t,e){const n=Math.min(Math.max(0,t),this.#c.lineCount);if(this.#o.length>n||this.#t===void 0)return!0;const i=e===void 0?0:performance.now();let s=this.#o.length-1,r=this.#o[s]??$;for(;s<n;){this.#o[s]=r;const o=this.#c.getLineText(s);if(o.length<=this.#p&&o!==""&&o.trim()!==""){const a=Et(this.#t,this.#l,o,r,Tt,this.#v,!1);this.#_(s,a.bracketIgnoredRanges),r=a.ruleStack}else this.#_(s,null);if(s++,this.#o[s]=r,e!==void 0&&performance.now()-i>e)break}return s>=n}#O(t){if(this.#g||this.#M||this.#t===void 0||t!==this.#m)return;this.#z();const e=this.#R(this.#E,1);if(!(this.#g||this.#M||t!==this.#m)){if(e){this.stopBackgroundTokenize();return}this.#y=this.#o.length-1,this.#Q(t)}}#mt(t){if(this.#g||this.#M||this.#t===void 0||t!==this.#m)return;this.#z();const e=performance.now(),n=new Map,i=this.#c.lineCount,s=this.#U;let r=this.#y,o=this.#o[r]??$,a=!1,c=this.#k,h=s?.[c]?.[1];for(;r<i;){this.#o[r]=o;const d=h!==void 0?this.#it(r+1):void 0,l=this.#c.getLineText(r);if(l.length>this.#p)console.warn(`[diffs] Line(${r}) too long to tokenize: ${l.length}`),n.set(r,[[0,"",l]]),this.#_(r,null);else if(l===""||l.trim()==="")n.set(r,[[0,"",l]]),this.#_(r,null);else{const f=Et(this.#t,this.#l,l,o,Tt,this.#v);n.set(r,f.resolvedTokens),this.#_(r,f.bracketIgnoredRanges),o=f.ruleStack}if(this.#o[r+1]=o,a=h!==void 0&&r>=h&&d!==void 0&&o.equals(d),r++,a){c++;const f=s?.[c];if(f===void 0)break;if(h=f[1],this.#o[f[0]]===void 0)a=!1;else{r=f[0],o=this.#o[r]??o,a=!1;continue}}if(performance.now()-e>1)break}if(this.#u(n,this.#n),!(this.#g||this.#M||t!==this.#m)){if(a||r>=i){const d=this.#I;this.stopBackgroundTokenize(),d>=0&&this.#P(d);return}this.#y=r,this.#k=c,this.#Q(t)}}};function Et(t,e,n,i,s,r=!0,o=!0){const a=t.tokenizeLine2(n,i,s);a.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);const c=a.tokens,h=c.length/2,d=[],l=[];if(!o&&!r)return{ruleStack:a.ruleStack,resolvedTokens:d,bracketIgnoredRanges:l};for(let f=0;f<h;f++){const u=c[2*f],v=f+1<h?c[2*f+2]:n.length;if(u===v)continue;const g=c[2*f+1];if(o){const p=ee.getForeground(g);d.push([u,e[p],n.slice(u,v)])}r&&ee.getTokenType(g)>0&&l.push([u,v])}return{ruleStack:a.ruleStack,resolvedTokens:d,bracketIgnoredRanges:l}}function At(t){return t.map(([e,n,i])=>e===0&&n===""?i===""?y("br"):i:y("span",{dataset:{char:e.toString()},style:`color:${n};`,textContent:i}))}function lt(t){return t==="text"||t==="ansi"}function ss(t){const e=t.getSelection?.();if(e==null||e.rangeCount===0)return;const n=e.getRangeAt(0);return{collapsed:n.collapsed,startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}}function K(t){if(typeof t.cacheKey!="string"||t.cacheKey.length===0)throw new Error(`Editor persistState requires a non-empty file.cacheKey for "${t.name}". Provide a unique, stable cacheKey for every editable file.`);return t.cacheKey}function Mt(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"}const rs=2,os=1e4,Rt="selection-action",Ot="application/vnd.pierre.diffs-selections+json";var us=class{#e;#t=new Ji;#r;#n;#a=new Map;#l;#c;#p=new Map;#S;#u=0;#L=!1;#v;#w;#T;#F;#o={generation:0,callback:void 0,delivered:!1};#B;#x;#C;#y=new Map;#g=new Map;#M=new Map;#m;#j;#E;#I;#U;#k;#N;#h;#V;#D;#Z;#Y;#f;#z;#A;#s;#$;#Q;#b;#P;#H;#_=!0;#W=!1;#it=!1;#R=!1;#O;#mt=!1;#Ct=!1;#st=!1;#It=!1;#q;#Lt="";#xt;#Pt;#i;#X;#J;#ht;#yt=!1;#dt=!1;#at=!1;#Bt=!1;#ft;#me=(t,e)=>{if(this.#f?.updateRenderCache(t,e),this.#$!==void 0&&this.#$.totalLines!==1/0){const{startingLine:n,totalLines:i}=this.#$,s=Math.min(n+i,this.#s?.lineCount??0);for(const[r,o]of t)if(r>=n&&r<s){const a=this.#lt(r);a!==void 0&&a.replaceChildren(...At(o))}}};constructor(t={}){this.#e=t}setOptions(t){const e=this.#e.persistStateStorage??"inMemory",n={...this.#e,...t};if(n.persistState===!0&&this.#f?.type==="file"){const i=this.#f.__getCurrentFile?.()??this.#z;i!==void 0&&K(i)}this.#e=n,this.#e.persistState!==!0&&(this.#a.clear(),this.#u++,this.#L=!1),(this.#e.persistStateStorage??"inMemory")!==e&&(this.#u++,this.#l=void 0,this.#c=void 0,this.#p.clear())}edit(t){if(this.#e.persistState===!0&&t.type==="file"){const e=t.__getCurrentFile?.();e!==void 0&&K(e)}return this.#Ht(),this.#f=t,this.#be(),this.#F=t.attachEditor(this),()=>this.cleanUp()}applyEdits(t,e=!0){const n=this.#s;if(n==null)throw new Error("Editor is not attached");const i=this.#R,s=this.#i,r=s?.map(h=>[n.offsetAt(h.start),n.offsetAt(h.end)]),o=s===void 0?void 0:n.resolveEdits(t).sort((h,d)=>h.start-d.start),a=n.applyEdits(t,e,s);if(a===void 0)return;let c;s!==void 0&&r!==void 0&&o!==void 0&&(c=wt(n,s,r,o),e&&n.setLastUndoSelectionsAfter(c)),this.#G(a,c,this.#et(a),{skipFocus:!i})}get canUndo(){return this.#s?.canUndo??!1}get canRedo(){return this.#s?.canRedo??!1}undo(){this.#Wt("undo")}redo(){this.#Wt("redo")}getFile(){const t=this.#z,e=this.#s;if(t===void 0||e===void 0)return;const n={...t};return Object.defineProperty(n,"contents",{enumerable:!0,get:()=>e.getText()}),n}getText(){return this.#s?.getText()??""}getState(){const t=this.#f;return{selections:this.#i,view:t!=null?{scrollLeft:t.getCodeScrollLeft()}:void 0}}setState({selections:t,view:e}){if(this.#f===void 0||this.#s===void 0)throw new Error("Editor is not attached");if(this.#_=!1,this.#d(t??[]),e!=null){this.#f.setCodeScrollLeft(e.scrollLeft);return}this.#tt()}setSelections(t){const e=this.#s;if(e===void 0)throw new Error("Text document is not initialized");const n=t.map(s=>{let r=e.normalizePosition(s.start),o=e.normalizePosition(s.end),a=s.direction==="none"?0:s.direction==="backward"?-1:1;return E(r,o)>0&&([r,o]=[o,r],a!==0&&(a=a===1?-1:1)),{direction:a,start:r,end:o}});this.#_=!1,this.#d(n);const i=n.at(-1);i!==void 0&&this.#ct(B(i).line),this.#tt()}setMarkers(t){const e=this.#s;if(e===void 0)throw new Error("Text document is not initialized");if(t.length===0){this.#b?.cleanup(),this.#b=void 0,this.#d(this.#i??[]);return}this.#b??=new Ai({popoverManager:this.#Tt(),getLineHeight:()=>this.#t.lineHeight,getOverlayElement:()=>this.#V,getGutterWidth:()=>this.#ot(),getCharX:(n,i)=>this.#vt(n,i),getLineY:n=>this.#pt(n),isMouseDown:()=>this.#st||this.#Ct}),this.#b.setMarkers(t,e),this.#h!==void 0&&this.#b.listenHover(this.#h),this.#d(this.#i??[])}focus(t){const e=t?.preventScroll??!1,n=t?.lineNumber;if(n==="first-visible"||typeof n=="number"){const s=this.#s;if(s==null||this.#f==null)return;const r=n==="first-visible"?this.#Re(t?.offset):n;if(r==null)return;const o=s.normalizePosition({line:r-1,character:n==="first-visible"?0:t?.character??0});this.#Ie(o,e);return}const i=this.#i?.at(-1);if(i!==void 0){const s=i.direction===-1?i.end:i.start;this.#K(s,e)}else this.#K(void 0,e)}blur(){this.#O=void 0,this.#R=!1,this.#W=!1,this.#h?.blur()}cleanUp(t=!1){this.#Ht(),t||(this.#o.delivered=!1);const e=this.#f!=null,n=this.#Nt;this.#u++,this.#jt(),e&&(this.#L=n),Xt(this.#Qt),this.#r?.cleanUp(),this.#r=void 0,t||(this.#s=void 0,this.#z=void 0),this.#w?.forEach(i=>i()),this.#w=void 0,this.#v?.forEach(i=>i()),this.#v=void 0,this.#T?.forEach(i=>i()),this.#T=void 0,this.#F?.(t),this.#F=void 0,this.#x=void 0,this.#C=void 0,this.#y.clear(),this.#g.clear(),this.#M.clear(),this.#m=void 0,this.#j?.remove(),this.#j=void 0,this.#E?.remove(),this.#E=void 0,this.#I?.remove(),this.#I=void 0,this.#U?.remove(),this.#U=void 0,this.#k=void 0,this.#n?.cleanUp(),this.#n=void 0,this.#N=void 0,this.#h?.removeAttribute("contentEditable"),this.#h=void 0,this.#O=void 0,this.#R=!1,this.#V?.remove(),this.#V=void 0,this.#Y?.disconnect(),this.#Y=void 0,this.#Bt=!1,this.#ft!==void 0&&(cancelAnimationFrame(this.#ft),this.#ft=void 0),this.#Yt(),this.#f=void 0}__prepareFile(t){if(this.#e.persistState!==!0)return t;const e=K(t),n=this.#z,i=t.lang??xt(t.name);n!==void 0&&(K(n)!==e||n.name!==t.name||this.#s?.languageId!==i)&&(this.#u++,this.#jt());const s=this.#Kt(t,e);return s===void 0||s.getText()===t.contents?t:{...t,contents:s.getText()}}__postponeBgTokenizeToNextFrame(){const t=this.#r;t!==void 0&&(t.pauseBackgroundTokenize(),requestAnimationFrame(()=>{t.resumeBackgroundTokenize()}))}__captureFocusForDOMReplacement(){const t=this.#h,e=this.#k?.shadowRoot?.activeElement;t!=null&&(this.#R||e===t||e!=null&&t.contains(e))&&(this.#O={})}__syncRenderView=(t,e,n,i,s)=>{const r=this.#f;if(r==null)return;const o=e.shadowRoot;if(o==null){console.error("[editor] Could not find the shadow root.");return}let a,c,h;for(const v of o.querySelectorAll("[data-code]"))if(v.dataset.deletions===void 0){a=v;for(const g of v.children){const p=g,{gutter:C,content:m}=p.dataset;C!==void 0?c=p:m!==void 0&&(h=p)}break}if(a===void 0||h===void 0){this.#O=void 0;return}this.#Tt().setViewportElements(e,a),this.#k!==e&&(this.#k=e,this.#j!==void 0&&e.appendChild(this.#j),this.#E!==void 0&&o.appendChild(this.#E),this.#I!==void 0&&o.appendChild(this.#I),this.#U!==void 0&&o.prepend(this.#U));const d=this.#s===void 0||this.#z===void 0||this.#z.name!==n.name||this.#z.lang!==n.lang||this.#z.cacheKey!==n.cacheKey,l=this.#Nt?K(n):void 0;let f;if(d){this.#Ht();let v="";"contents"in n?v=n.contents:v=n.additionLines.join("");const g=new Te({maxEntries:this.#e.historyMaxEntries}),{name:p,lang:C,cacheKey:m}=n,x=C??xt(n.name),L=(l!==void 0?this.#Kt(n,l):void 0)??new Sn(n.name,v,x,0,g);this.#z={name:p,lang:C,cacheKey:m},this.#s=L,l!==void 0&&(this.#a.set(l,L),f={cacheKey:l,textDocument:L}),this.#r?.cleanUp(),this.#r=void 0,this.#Yt(),this.#g.clear(),this.#i=this.#Pt,this.#s!==void 0&&this.#e.__debug===!0&&console.log("[diffs/editor] text document rebuilt from",n.name)}f===void 0&&this.#L&&l!==void 0&&this.#s!==void 0&&(f={cacheKey:l,textDocument:this.#s});const u=this.#s;if(this.#r==null&&u!=null&&(this.#r=new is({highlighter:t,textDocument:u,codeOptions:this.#f?.__getEffectiveCodeOptions()??{},matchBrackets:this.#e.matchBrackets,onDeferTokenize:this.#me,onThemeChange:()=>this.#Be(),setStyle:v=>{this.#I.textContent=v},__debug:this.#e.__debug})),this.#h!==h&&(this.#N=c,this.#h=Nn(h,{contentEditable:"true",role:"textbox",ariaMultiLine:"true",autocapitalize:"off",writingSuggestions:"off",autocorrect:!1,spellcheck:!1,translate:!1}),this.#V!==void 0&&h.after(this.#V),this.#t.init(h),this.#Ae(),this.#Se(h,c),this.#h!==void 0&&this.#e.__debug===!0&&console.log("[diffs/editor] full re-render triggered !!!")),this.#O!=null&&(this.#O.target=h),h.ariaLabel!==n.name&&(h.ariaLabel=n.name),i!==void 0&&i.length>0||this.#nt)for(const v of this.#h.children){const g=v,{lineAnnotation:p,lineType:C,separator:m}=g.dataset;(p!==void 0||m!==void 0||C==="change-deletion")&&g.setAttribute("contenteditable","false")}if(this.#zt(),this.#r?.syncTheme(this.#f?.__getEffectiveCodeOptions()??{}),this.#A=i,this.#$=s,this.#Q=s?.totalLines,this.#r?.prebuildStateStack(s),this.#b?.removePopover(),(this.#i!==void 0||this.#X!==void 0||this.#b!==void 0)&&this.#d(this.#i??[]),this.#Pt!==void 0&&this.#Z!==void 0?(this.#Pt=void 0,this.#tt(!1,"center")):this.#J!==void 0?this.#Dt(this.#J,this.#ht,this.#dt):this.#O!==void 0?this.#Ft():this.#i!==void 0&&this.#i.length>0&&this.#R&&!this.#at&&this.focus({preventScroll:!0}),this.#at&&this.#P?.focus(),this.#e.__debug===!0&&s!==void 0){const{startingLine:v,totalLines:g}=s;console.log("[diffs/editor] render file:",n.name,"RenderRange:",v+"-"+(v+g),"of",this.#s?.lineCount,"lines")}f!==void 0&&(this.#L=!1,this.#Ce(f.cacheKey,f.textDocument)),this.#xe(r)};get#Nt(){return this.#e.persistState===!0&&this.#f?.type==="file"}#Kt(t,e){const n=this.#a.get(e),i=t.lang??xt(t.name);return n?.languageId===i?n:void 0}#Gt(){const t=this.#e.persistStateStorage??"inMemory";return(this.#l===void 0||this.#c!==t)&&(this.#l=Ki(t),this.#c=t),this.#l}#jt(){const t=this.#z,e=this.#s;if(!this.#Nt||t===void 0||e===void 0)return;const n=K(t);this.#a.set(n,e);let i;try{i=this.#Gt()}catch{return}const s=X(this.getState()),r=this.#S;if(r?.cacheKey===n&&r.textDocument===e){if(this.#S=void 0,e.version===r.documentVersion&&this.#i===r.selections&&s.view?.scrollLeft===r.view?.scrollLeft)return;this.#qt(i,n,s,r.completion);return}this.#qt(i,n,s)}#qt(t,e,n,i){const s=this.#p.get(e);if(i!==void 0||s!==void 0){let o=i??Promise.resolve();s!==void 0&&(o=o.then(()=>s)),this.#Zt(e,o.then(()=>t.set(e,n)));return}let r;try{r=t.set(e,n)}catch{return}Mt(r)&&this.#Zt(e,r)}#Zt(t,e){const n=e.catch(()=>{});this.#p.set(t,n),n.finally(()=>{this.#p.get(t)===n&&this.#p.delete(t)})}#Ce(t,e){const n=++this.#u,i=e.version,s=this.#i,r=this.getState().view,o=d=>{const l=this.getState().view;d===void 0||n!==this.#u||this.#s!==e||e.version!==i||this.#i!==s||l?.scrollLeft!==r?.scrollLeft||this.#z===void 0||K(this.#z)!==t||this.setState(X(d))},a=()=>{let d;try{d=this.#Gt().get(t)}catch{return}if(Mt(d))return d.then(o).catch(()=>{});try{o(d)}catch{}},c=this.#p.get(t),h=c===void 0?a():c.then(a);if(Mt(h)){const d={cacheKey:t,textDocument:e,documentVersion:i,selections:s,view:r,completion:h.catch(()=>{})};this.#S=d,d.completion.finally(()=>{this.#S===d&&(this.#S=void 0)})}}#bt(t){return this.#f?.isLineRenderable?.(t+1)??!0}get#Le(){const t=this.#f;if(t?.getNearestRenderableLine!=null)return(e,n)=>{const i=t.getNearestRenderableLine(e+1,n);return i==null?void 0:i-1}}#ct(t){this.#bt(t)||this.#f?.revealLine?.(t+1)}get#kt(){return this.#f?.options.diffStyle??"split"}get#nt(){return this.#f?.type==="file-diff"}get#rt(){return this.#f?.options.overflow==="wrap"}#Tt(){return this.#n??=new Kn({hasActivePopover:()=>this.#H!==void 0||this.#b?.isPopoverVisible()===!0,updateActivePopover:()=>{this.#Ut(),this.#b?.updatePopoverPosition()}})}#zt(){this.#y.clear(),this.#M.clear(),this.#m=void 0}#Yt(){this.#wt(null),this.#x=void 0,this.#C=void 0,this.#W=!1,this.#it=!1,this.#D?.forEach(t=>t.remove()),this.#D=void 0,this.#i=void 0,this.#xt=void 0,this.#J=void 0,this.#b?.cleanup(),this.#b=void 0,this.#P?.cleanup(),this.#P=void 0,this.#H?.cleanup(),this.#H=void 0,this.#_=!0}#Ht(){const t=this.#o;t.generation++,t.callback!=null&&(Xt(t.callback),t.callback=void 0)}#xe(t){const e=this.#o,n=this.#s;if(e.delivered||e.callback!=null||n==null)return;const{generation:i}=e,s=()=>{if(e.callback!==s||(e.callback=void 0,i!==e.generation||this.#f!==t||this.#s!==n))return;const r=this.#h,o=this.#k?.shadowRoot;r==null||o==null||!o.contains(r)||(e.delivered=!0,this.#e.onAttach?.(this,t))};e.callback=s,at(s)}#be(){this.#j=y("style",{dataset:"editorGlobalCss",textContent:`
510
+ }`),this.#a=t,this.#n=e??n.type,this.#l=i}#z(){if(this.#a==="")return;const{colorMap:t}=this.#e.setTheme(this.#a);this.#l=t}cleanUp(){this.#F=!0,this.stopBackgroundTokenize(),this.#$(),this.#T?.forEach(t=>t()),this.#T=void 0}tokenize(t,e){if(this.#A(),this.#z(),this.#t===void 0&&!lt(this.#c.languageId))throw new Error(`Grammar for language "${this.#c.languageId}" not loaded`);this.#v&&(this.#N.length=Math.min(this.#N.length,t.startLine));const{lineCount:n}=this.#c,{startingLine:i=0,totalLines:s=1/0}=e??{},r=s===1/0?n:Math.min(i+s,n),o=t.startLine,a=Math.max(i,o),c=e!==void 0&&s!==1/0&&t.lineDelta>0&&o<r&&t.endLine>=r,h=t.lineDelta===0&&(t.changedLineChanges?.every(([,,T])=>T===0)??!0),d=h||e===void 0||o>=a,l=t.changedLineRanges??[[o,t.endLine]];this.#B=[],this.#x=0,this.#C=[];let f=-1;if(o<a)for(const[T,R]of l)T<a&&(f=Math.max(f,Math.min(R,a-1)));const u=f>=o&&(h||t.lineDelta<0);h?this.#R(o):(this.#W(t),(e===void 0||o>=a)&&this.#R(a));let v=0,g=l[v][1],p,C=0,m=h?l[v][0]:a,x=!1;const L=new Map,S=u?new Map:void 0;if(S!==void 0&&!h){const T=Math.min(f+1,a,r);if(T>o){this.#R(T);let R=o,O=this.#o[R]??$;for(;R<T;R++){const A=this.#H(R,O);O=A.state,S.set(R,A.resolvedTokens)}this.#o[T]=O}}let w=this.#o[m]??$;for(;m<r;){const T=h?this.#o[m+1]:void 0;d&&(this.#o[m]=w);const{resolvedTokens:R,state:O}=this.#H(m,w);if(w=O,m>=a?L.set(m,R):S?.set(m,R),d&&(this.#o[m+1]=w),x=m>=g&&h&&T!==void 0&&w.equals(T),x){v++;const A=l[v];if(A===void 0)break;if(A[0]>=r){p=A[0],C=v;break}this.#o[A[0]]===void 0?(g=A[1],m++):(m=A[0],w=this.#o[m]??w,g=A[1]),x=!1;continue}m++}if(d&&(m<r?this.#o[m+1]=w:this.#o[m]=w),S!==void 0&&S.size>0&&this.#u(S,this.#n),p!==void 0)this.#b(p,l,C);else if(!x&&m<n){const T=c&&o>=a?r:o<a&&!h?o:m;this.#b(T,l,v)}return L}prebuildStateStack(t){this.#A(),this.#V(t)}stopBackgroundTokenize(){this.#I=-1,!this.#g&&(this.#g=!0,this.#M=!1,this.#y=-1,this.#E=-1,this.#U=void 0,this.#k=0,this.#B=[],this.#x=0,this.#C=[],this.#$())}pauseBackgroundTokenize(){this.#g||this.#M||(this.#w&&console.log("[diffs/editor] background tokenization paused",{jobId:this.#m}),this.#M=!0)}resumeBackgroundTokenize(){this.#g||!this.#M||this.#t===void 0||this.#y<0||(this.#w&&console.log("[diffs/editor] background tokenization resumed",{jobId:this.#m}),this.#M=!1,this.#Q(this.#m))}#A(){this.#t===void 0&&!lt(this.#c.languageId)&&this.#e.getLoadedLanguages().includes(this.#c.languageId)&&(this.#t=this.#e.getLanguage(this.#c.languageId))}#s(){this.#h||(globalThis.addEventListener("message",this.#D),this.#h=!0)}#$(){this.#h&&(globalThis.removeEventListener("message",this.#D),this.#h=!1)}#Q(t){globalThis.postMessage({type:"tokenize",tokenizerId:this.#j,jobId:t})}#b(t,e,n=0){if(lt(this.#c.languageId))return;const i=++this.#m;this.#w&&console.log("[diffs/editor] background tokenization scheduled",{jobId:i,startLine:t,changedLineRanges:e,changedRangeIndex:n}),this.#g=!1,this.#M=!1,this.#y=t,this.#E>=0&&(this.#I=Math.max(this.#I,this.#E)),this.#E=-1,this.#U=e,this.#k=n,this.#s(),this.#Q(i)}#P(t){if(this.#t===void 0||this.#o.length>t)return;if(!this.#g){this.#E>=0?this.#E=Math.max(this.#E,t):this.#I=Math.max(this.#I,t);return}const e=++this.#m;this.#g=!1,this.#M=!1,this.#y=this.#o.length-1,this.#E=t,this.#I=-1,this.#U=void 0,this.#k=0,this.#s(),this.#Q(e)}#H(t,e){const n=this.#c.getLineText(t);if(n.length>this.#p)return console.warn(`[diffs] Line(${t}) too long to tokenize: ${n.length}`),this.#_(t,null),{resolvedTokens:[[0,"",n]],state:e};if(this.#t===void 0||n===""||n.trim()==="")return this.#_(t,null),{resolvedTokens:[[0,"",n]],state:e};const i=Et(this.#t,this.#l,n,e,Tt,this.#v);return this.#_(t,i.bracketIgnoredRanges),{resolvedTokens:i.resolvedTokens,state:i.ruleStack}}#_(t,e){this.#v&&(this.#N[t]=e)}#W(t){const e=t.changedLineChanges??[[t.startLine,t.endLine,t.lineDelta]],n=t.startLine+1;n<=this.#o.length-n?(this.#B=this.#o,this.#x=0,this.#o=this.#o.slice(0,n)):(this.#x=n,this.#B=this.#o.slice(n),this.#o.length=Math.min(this.#o.length,n)),this.#C=e}#it(t){let e=t;for(let n=this.#C.length-1;n>=0;n--){const[i,s,r]=this.#C[n];if(r!==0){if(e>s)e-=r;else if(e>i)return this.#o[t]}}return this.#B[e-this.#x]??this.#o[t]}#R(t,e){const n=Math.min(Math.max(0,t),this.#c.lineCount);if(this.#o.length>n||this.#t===void 0)return!0;const i=e===void 0?0:performance.now();let s=this.#o.length-1,r=this.#o[s]??$;for(;s<n;){this.#o[s]=r;const o=this.#c.getLineText(s);if(o.length<=this.#p&&o!==""&&o.trim()!==""){const a=Et(this.#t,this.#l,o,r,Tt,this.#v,!1);this.#_(s,a.bracketIgnoredRanges),r=a.ruleStack}else this.#_(s,null);if(s++,this.#o[s]=r,e!==void 0&&performance.now()-i>e)break}return s>=n}#O(t){if(this.#g||this.#M||this.#t===void 0||t!==this.#m)return;this.#z();const e=this.#R(this.#E,1);if(!(this.#g||this.#M||t!==this.#m)){if(e){this.stopBackgroundTokenize();return}this.#y=this.#o.length-1,this.#Q(t)}}#mt(t){if(this.#g||this.#M||this.#t===void 0||t!==this.#m)return;this.#z();const e=performance.now(),n=new Map,i=this.#c.lineCount,s=this.#U;let r=this.#y,o=this.#o[r]??$,a=!1,c=this.#k,h=s?.[c]?.[1];for(;r<i;){this.#o[r]=o;const d=h!==void 0?this.#it(r+1):void 0,l=this.#c.getLineText(r);if(l.length>this.#p)console.warn(`[diffs] Line(${r}) too long to tokenize: ${l.length}`),n.set(r,[[0,"",l]]),this.#_(r,null);else if(l===""||l.trim()==="")n.set(r,[[0,"",l]]),this.#_(r,null);else{const f=Et(this.#t,this.#l,l,o,Tt,this.#v);n.set(r,f.resolvedTokens),this.#_(r,f.bracketIgnoredRanges),o=f.ruleStack}if(this.#o[r+1]=o,a=h!==void 0&&r>=h&&d!==void 0&&o.equals(d),r++,a){c++;const f=s?.[c];if(f===void 0)break;if(h=f[1],this.#o[f[0]]===void 0)a=!1;else{r=f[0],o=this.#o[r]??o,a=!1;continue}}if(performance.now()-e>1)break}if(this.#u(n,this.#n),!(this.#g||this.#M||t!==this.#m)){if(a||r>=i){const d=this.#I;this.stopBackgroundTokenize(),d>=0&&this.#P(d);return}this.#y=r,this.#k=c,this.#Q(t)}}};function Et(t,e,n,i,s,r=!0,o=!0){const a=t.tokenizeLine2(n,i,s);a.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);const c=a.tokens,h=c.length/2,d=[],l=[];if(!o&&!r)return{ruleStack:a.ruleStack,resolvedTokens:d,bracketIgnoredRanges:l};for(let f=0;f<h;f++){const u=c[2*f],v=f+1<h?c[2*f+2]:n.length;if(u===v)continue;const g=c[2*f+1];if(o){const p=ee.getForeground(g);d.push([u,e[p],n.slice(u,v)])}r&&ee.getTokenType(g)>0&&l.push([u,v])}return{ruleStack:a.ruleStack,resolvedTokens:d,bracketIgnoredRanges:l}}function At(t){return t.map(([e,n,i])=>e===0&&n===""?i===""?y("br"):i:y("span",{dataset:{char:e.toString()},style:`color:${n};`,textContent:i}))}function lt(t){return t==="text"||t==="ansi"}function ss(t){const e=t.getSelection?.();if(e==null||e.rangeCount===0)return;const n=e.getRangeAt(0);return{collapsed:n.collapsed,startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}}function K(t){if(typeof t.cacheKey!="string"||t.cacheKey.length===0)throw new Error(`Editor persistState requires a non-empty file.cacheKey for "${t.name}". Provide a unique, stable cacheKey for every editable file.`);return t.cacheKey}function Mt(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"}const rs=2,os=1e4,Rt="selection-action",Ot="application/vnd.pierre.diffs-selections+json";var ps=class{#e;#t=new Ji;#r;#n;#a=new Map;#l;#c;#p=new Map;#S;#u=0;#L=!1;#v;#w;#T;#F;#o={generation:0,callback:void 0,delivered:!1};#B;#x;#C;#y=new Map;#g=new Map;#M=new Map;#m;#j;#E;#I;#U;#k;#N;#h;#V;#D;#Z;#Y;#f;#z;#A;#s;#$;#Q;#b;#P;#H;#_=!0;#W=!1;#it=!1;#R=!1;#O;#mt=!1;#Ct=!1;#st=!1;#It=!1;#q;#Lt="";#xt;#Pt;#i;#X;#J;#ht;#yt=!1;#dt=!1;#at=!1;#Bt=!1;#ft;#me=(t,e)=>{if(this.#f?.updateRenderCache(t,e),this.#$!==void 0&&this.#$.totalLines!==1/0){const{startingLine:n,totalLines:i}=this.#$,s=Math.min(n+i,this.#s?.lineCount??0);for(const[r,o]of t)if(r>=n&&r<s){const a=this.#lt(r);a!==void 0&&a.replaceChildren(...At(o))}}};constructor(t={}){this.#e=t}setOptions(t){const e=this.#e.persistStateStorage??"inMemory",n={...this.#e,...t};if(n.persistState===!0&&this.#f?.type==="file"){const i=this.#f.__getCurrentFile?.()??this.#z;i!==void 0&&K(i)}this.#e=n,this.#e.persistState!==!0&&(this.#a.clear(),this.#u++,this.#L=!1),(this.#e.persistStateStorage??"inMemory")!==e&&(this.#u++,this.#l=void 0,this.#c=void 0,this.#p.clear())}edit(t){if(this.#e.persistState===!0&&t.type==="file"){const e=t.__getCurrentFile?.();e!==void 0&&K(e)}return this.#Ht(),this.#f=t,this.#be(),this.#F=t.attachEditor(this),()=>this.cleanUp()}applyEdits(t,e=!0){const n=this.#s;if(n==null)throw new Error("Editor is not attached");const i=this.#R,s=this.#i,r=s?.map(h=>[n.offsetAt(h.start),n.offsetAt(h.end)]),o=s===void 0?void 0:n.resolveEdits(t).sort((h,d)=>h.start-d.start),a=n.applyEdits(t,e,s);if(a===void 0)return;let c;s!==void 0&&r!==void 0&&o!==void 0&&(c=wt(n,s,r,o),e&&n.setLastUndoSelectionsAfter(c)),this.#G(a,c,this.#et(a),{skipFocus:!i})}get canUndo(){return this.#s?.canUndo??!1}get canRedo(){return this.#s?.canRedo??!1}undo(){this.#Wt("undo")}redo(){this.#Wt("redo")}getFile(){const t=this.#z,e=this.#s;if(t===void 0||e===void 0)return;const n={...t};return Object.defineProperty(n,"contents",{enumerable:!0,get:()=>e.getText()}),n}getText(){return this.#s?.getText()??""}getState(){const t=this.#f;return{selections:this.#i,view:t!=null?{scrollLeft:t.getCodeScrollLeft()}:void 0}}setState({selections:t,view:e}){if(this.#f===void 0||this.#s===void 0)throw new Error("Editor is not attached");if(this.#_=!1,this.#d(t??[]),e!=null){this.#f.setCodeScrollLeft(e.scrollLeft);return}this.#tt()}setSelections(t){const e=this.#s;if(e===void 0)throw new Error("Text document is not initialized");const n=t.map(s=>{let r=e.normalizePosition(s.start),o=e.normalizePosition(s.end),a=s.direction==="none"?0:s.direction==="backward"?-1:1;return E(r,o)>0&&([r,o]=[o,r],a!==0&&(a=a===1?-1:1)),{direction:a,start:r,end:o}});this.#_=!1,this.#d(n);const i=n.at(-1);i!==void 0&&this.#ct(B(i).line),this.#tt()}setMarkers(t){const e=this.#s;if(e===void 0)throw new Error("Text document is not initialized");if(t.length===0){this.#b?.cleanup(),this.#b=void 0,this.#d(this.#i??[]);return}this.#b??=new Ai({popoverManager:this.#Tt(),getLineHeight:()=>this.#t.lineHeight,getOverlayElement:()=>this.#V,getGutterWidth:()=>this.#ot(),getCharX:(n,i)=>this.#vt(n,i),getLineY:n=>this.#pt(n),isMouseDown:()=>this.#st||this.#Ct}),this.#b.setMarkers(t,e),this.#h!==void 0&&this.#b.listenHover(this.#h),this.#d(this.#i??[])}focus(t){const e=t?.preventScroll??!1,n=t?.lineNumber;if(n==="first-visible"||typeof n=="number"){const s=this.#s;if(s==null||this.#f==null)return;const r=n==="first-visible"?this.#Re(t?.offset):n;if(r==null)return;const o=s.normalizePosition({line:r-1,character:n==="first-visible"?0:t?.character??0});this.#Ie(o,e);return}const i=this.#i?.at(-1);if(i!==void 0){const s=i.direction===-1?i.end:i.start;this.#K(s,e)}else this.#K(void 0,e)}blur(){this.#O=void 0,this.#R=!1,this.#W=!1,this.#h?.blur()}cleanUp(t=!1){this.#Ht(),t||(this.#o.delivered=!1);const e=this.#f!=null,n=this.#Nt;this.#u++,this.#jt(),e&&(this.#L=n),Xt(this.#Qt),this.#r?.cleanUp(),this.#r=void 0,t||(this.#s=void 0,this.#z=void 0),this.#w?.forEach(i=>i()),this.#w=void 0,this.#v?.forEach(i=>i()),this.#v=void 0,this.#T?.forEach(i=>i()),this.#T=void 0,this.#F?.(t),this.#F=void 0,this.#x=void 0,this.#C=void 0,this.#y.clear(),this.#g.clear(),this.#M.clear(),this.#m=void 0,this.#j?.remove(),this.#j=void 0,this.#E?.remove(),this.#E=void 0,this.#I?.remove(),this.#I=void 0,this.#U?.remove(),this.#U=void 0,this.#k=void 0,this.#n?.cleanUp(),this.#n=void 0,this.#N=void 0,this.#h?.removeAttribute("contentEditable"),this.#h=void 0,this.#O=void 0,this.#R=!1,this.#V?.remove(),this.#V=void 0,this.#Y?.disconnect(),this.#Y=void 0,this.#Bt=!1,this.#ft!==void 0&&(cancelAnimationFrame(this.#ft),this.#ft=void 0),this.#Yt(),this.#f=void 0}__prepareFile(t){if(this.#e.persistState!==!0)return t;const e=K(t),n=this.#z,i=t.lang??xt(t.name);n!==void 0&&(K(n)!==e||n.name!==t.name||this.#s?.languageId!==i)&&(this.#u++,this.#jt());const s=this.#Kt(t,e);return s===void 0||s.getText()===t.contents?t:{...t,contents:s.getText()}}__postponeBgTokenizeToNextFrame(){const t=this.#r;t!==void 0&&(t.pauseBackgroundTokenize(),requestAnimationFrame(()=>{t.resumeBackgroundTokenize()}))}__captureFocusForDOMReplacement(){const t=this.#h,e=this.#k?.shadowRoot?.activeElement;t!=null&&(this.#R||e===t||e!=null&&t.contains(e))&&(this.#O={})}__syncRenderView=(t,e,n,i,s)=>{const r=this.#f;if(r==null)return;const o=e.shadowRoot;if(o==null){console.error("[editor] Could not find the shadow root.");return}let a,c,h;for(const v of o.querySelectorAll("[data-code]"))if(v.dataset.deletions===void 0){a=v;for(const g of v.children){const p=g,{gutter:C,content:m}=p.dataset;C!==void 0?c=p:m!==void 0&&(h=p)}break}if(a===void 0||h===void 0){this.#O=void 0;return}this.#Tt().setViewportElements(e,a),this.#k!==e&&(this.#k=e,this.#j!==void 0&&e.appendChild(this.#j),this.#E!==void 0&&o.appendChild(this.#E),this.#I!==void 0&&o.appendChild(this.#I),this.#U!==void 0&&o.prepend(this.#U));const d=this.#s===void 0||this.#z===void 0||this.#z.name!==n.name||this.#z.lang!==n.lang||this.#z.cacheKey!==n.cacheKey,l=this.#Nt?K(n):void 0;let f;if(d){this.#Ht();let v="";"contents"in n?v=n.contents:v=n.additionLines.join("");const g=new Te({maxEntries:this.#e.historyMaxEntries}),{name:p,lang:C,cacheKey:m}=n,x=C??xt(n.name),L=(l!==void 0?this.#Kt(n,l):void 0)??new Sn(n.name,v,x,0,g);this.#z={name:p,lang:C,cacheKey:m},this.#s=L,l!==void 0&&(this.#a.set(l,L),f={cacheKey:l,textDocument:L}),this.#r?.cleanUp(),this.#r=void 0,this.#Yt(),this.#g.clear(),this.#i=this.#Pt,this.#s!==void 0&&this.#e.__debug===!0&&console.log("[diffs/editor] text document rebuilt from",n.name)}f===void 0&&this.#L&&l!==void 0&&this.#s!==void 0&&(f={cacheKey:l,textDocument:this.#s});const u=this.#s;if(this.#r==null&&u!=null&&(this.#r=new is({highlighter:t,textDocument:u,codeOptions:this.#f?.__getEffectiveCodeOptions()??{},matchBrackets:this.#e.matchBrackets,onDeferTokenize:this.#me,onThemeChange:()=>this.#Be(),setStyle:v=>{this.#I.textContent=v},__debug:this.#e.__debug})),this.#h!==h&&(this.#N=c,this.#h=Nn(h,{contentEditable:"true",role:"textbox",ariaMultiLine:"true",autocapitalize:"off",writingSuggestions:"off",autocorrect:!1,spellcheck:!1,translate:!1}),this.#V!==void 0&&h.after(this.#V),this.#t.init(h),this.#Ae(),this.#Se(h,c),this.#h!==void 0&&this.#e.__debug===!0&&console.log("[diffs/editor] full re-render triggered !!!")),this.#O!=null&&(this.#O.target=h),h.ariaLabel!==n.name&&(h.ariaLabel=n.name),i!==void 0&&i.length>0||this.#nt)for(const v of this.#h.children){const g=v,{lineAnnotation:p,lineType:C,separator:m}=g.dataset;(p!==void 0||m!==void 0||C==="change-deletion")&&g.setAttribute("contenteditable","false")}if(this.#zt(),this.#r?.syncTheme(this.#f?.__getEffectiveCodeOptions()??{}),this.#A=i,this.#$=s,this.#Q=s?.totalLines,this.#r?.prebuildStateStack(s),this.#b?.removePopover(),(this.#i!==void 0||this.#X!==void 0||this.#b!==void 0)&&this.#d(this.#i??[]),this.#Pt!==void 0&&this.#Z!==void 0?(this.#Pt=void 0,this.#tt(!1,"center")):this.#J!==void 0?this.#Dt(this.#J,this.#ht,this.#dt):this.#O!==void 0?this.#Ft():this.#i!==void 0&&this.#i.length>0&&this.#R&&!this.#at&&this.focus({preventScroll:!0}),this.#at&&this.#P?.focus(),this.#e.__debug===!0&&s!==void 0){const{startingLine:v,totalLines:g}=s;console.log("[diffs/editor] render file:",n.name,"RenderRange:",v+"-"+(v+g),"of",this.#s?.lineCount,"lines")}f!==void 0&&(this.#L=!1,this.#Ce(f.cacheKey,f.textDocument)),this.#xe(r)};get#Nt(){return this.#e.persistState===!0&&this.#f?.type==="file"}#Kt(t,e){const n=this.#a.get(e),i=t.lang??xt(t.name);return n?.languageId===i?n:void 0}#Gt(){const t=this.#e.persistStateStorage??"inMemory";return(this.#l===void 0||this.#c!==t)&&(this.#l=Ki(t),this.#c=t),this.#l}#jt(){const t=this.#z,e=this.#s;if(!this.#Nt||t===void 0||e===void 0)return;const n=K(t);this.#a.set(n,e);let i;try{i=this.#Gt()}catch{return}const s=X(this.getState()),r=this.#S;if(r?.cacheKey===n&&r.textDocument===e){if(this.#S=void 0,e.version===r.documentVersion&&this.#i===r.selections&&s.view?.scrollLeft===r.view?.scrollLeft)return;this.#qt(i,n,s,r.completion);return}this.#qt(i,n,s)}#qt(t,e,n,i){const s=this.#p.get(e);if(i!==void 0||s!==void 0){let o=i??Promise.resolve();s!==void 0&&(o=o.then(()=>s)),this.#Zt(e,o.then(()=>t.set(e,n)));return}let r;try{r=t.set(e,n)}catch{return}Mt(r)&&this.#Zt(e,r)}#Zt(t,e){const n=e.catch(()=>{});this.#p.set(t,n),n.finally(()=>{this.#p.get(t)===n&&this.#p.delete(t)})}#Ce(t,e){const n=++this.#u,i=e.version,s=this.#i,r=this.getState().view,o=d=>{const l=this.getState().view;d===void 0||n!==this.#u||this.#s!==e||e.version!==i||this.#i!==s||l?.scrollLeft!==r?.scrollLeft||this.#z===void 0||K(this.#z)!==t||this.setState(X(d))},a=()=>{let d;try{d=this.#Gt().get(t)}catch{return}if(Mt(d))return d.then(o).catch(()=>{});try{o(d)}catch{}},c=this.#p.get(t),h=c===void 0?a():c.then(a);if(Mt(h)){const d={cacheKey:t,textDocument:e,documentVersion:i,selections:s,view:r,completion:h.catch(()=>{})};this.#S=d,d.completion.finally(()=>{this.#S===d&&(this.#S=void 0)})}}#bt(t){return this.#f?.isLineRenderable?.(t+1)??!0}get#Le(){const t=this.#f;if(t?.getNearestRenderableLine!=null)return(e,n)=>{const i=t.getNearestRenderableLine(e+1,n);return i==null?void 0:i-1}}#ct(t){this.#bt(t)||this.#f?.revealLine?.(t+1)}get#kt(){return this.#f?.options.diffStyle??"split"}get#nt(){return this.#f?.type==="file-diff"}get#rt(){return this.#f?.options.overflow==="wrap"}#Tt(){return this.#n??=new Kn({hasActivePopover:()=>this.#H!==void 0||this.#b?.isPopoverVisible()===!0,updateActivePopover:()=>{this.#Ut(),this.#b?.updatePopoverPosition()}})}#zt(){this.#y.clear(),this.#M.clear(),this.#m=void 0}#Yt(){this.#wt(null),this.#x=void 0,this.#C=void 0,this.#W=!1,this.#it=!1,this.#D?.forEach(t=>t.remove()),this.#D=void 0,this.#i=void 0,this.#xt=void 0,this.#J=void 0,this.#b?.cleanup(),this.#b=void 0,this.#P?.cleanup(),this.#P=void 0,this.#H?.cleanup(),this.#H=void 0,this.#_=!0}#Ht(){const t=this.#o;t.generation++,t.callback!=null&&(Xt(t.callback),t.callback=void 0)}#xe(t){const e=this.#o,n=this.#s;if(e.delivered||e.callback!=null||n==null)return;const{generation:i}=e,s=()=>{if(e.callback!==s||(e.callback=void 0,i!==e.generation||this.#f!==t||this.#s!==n))return;const r=this.#h,o=this.#k?.shadowRoot;r==null||o==null||!o.contains(r)||(e.delivered=!0,this.#e.onAttach?.(this,t))};e.callback=s,at(s)}#be(){this.#j=y("style",{dataset:"editorGlobalCss",textContent:`
511
511
  [data-annotation-slot] {
512
512
  user-select: none;
513
513
  -webkit-user-select: none;
@@ -515,4 +515,4 @@ import{i as je,s as qe,r as Ze,p as Ye,a as Xe,h as Qe,d as Je,c as tn,b as en,e
515
515
  `}),this.#E=y("style",{dataset:"editorCss",textContent:En}),this.#I=y("style",{dataset:"editorThemeCss"}),this.#U=Di(),this.#V=y("div",{dataset:"editorOverlay"});const t=n=>{const i=n.composedPath()[0];return i instanceof Node&&this.#h?.contains(i)===!0},e=()=>{this.#O!=null&&(this.#O=void 0,this.#R=!1,this.#W=!1)};this.#w=[k(document,"focusin",n=>{t(n)||e()},{passive:!0}),k(document,"pointerdown",n=>{t(n)||queueMicrotask(e)},{capture:!0,passive:!0}),k(document,"selectionchange",()=>{const n=this.#k?.shadowRoot;if(this.#W||this.#it||n==null||!this.#R||this.#i!==void 0&&this.#i.length>1&&!this.#st)return;const i=document.getSelection();if(i==null)return;const s=typeof i.getComposedRanges=="function"?i.getComposedRanges({shadowRoots:[n]})?.[0]:ss(n);if(s===void 0||!this.#Ke(s))return;let r=qn(s,0);if(r!==void 0){if(this.#st&&this.#It&&this.#i!==void 0&&this.#i.length>0){const o=this.#i.at(-1);this.#d([Ne(o,r)]);return}if(this.#st)this.#q!==void 0?r=Nt(this.#q,r):this.#q=r;else if(this.#q!==void 0)r.direction=Nt(this.#q,r).direction;else if(this.#i!==void 0&&this.#i.length===1){const o=this.#i[0];E(o.start,r.start)===0&&E(o.end,r.end)===0&&(r.direction=o.direction)}this.#xt!==void 0?this.#d([...this.#xt.filter(o=>!$t(o,r)),r]):this.#d([r])}},{passive:!0}),k(document,"pointerup",n=>{n.pointerType==="mouse"&&(this.#T?.forEach(i=>i()),this.#T=void 0,this.#Ct&&(this.#Ct=!1,this.#K()),this.#W=!1,this.#st=!1,this.#It=!1,this.#q=void 0,this.#xt=void 0,this.#e.enabledSelectionAction===!0&&this.#i!==void 0&&this.#i.length>0&&!I(this.#i.at(-1))&&this.#d(this.#i))},{passive:!0}),k(document,"keydown",n=>{n.key==="Shift"&&(this.#q=this.#i?.at(-1))},{passive:!0}),k(document,"keyup",n=>{n.key==="Shift"&&(this.#q=void 0)},{passive:!0})]}#_t(t){this.#T?.forEach(e=>e()),this.#T=t}#Xt(){return this.#f?.options.enableLineSelection===!0}#Et(){this.#it=this.#i!==void 0}#Se(t,e){const{onFocus:n,onBlur:i}=this.#e,s=o=>{const a=o.composedPath()[0];return a!==void 0&&(a===t||t.contains(a))};this.#v?.forEach(o=>o()),this.#v=[k(t,"focus",()=>{this.#R=!0,n?.(),!this.#st&&!this.#W&&this.#i!==void 0&&this.#i.length>0&&this.#St(this.#i.at(-1))},{passive:!0}),k(t,"blur",()=>{this.#O?.target===t&&(this.#O=void 0,this.#W=!1),this.#R=!1,i?.()},{passive:!0}),k(t,"pointerdown",o=>{if(this.#_=!0,this.#it=!1,o.pointerType==="mouse"){if(this.#Pe(o)){this.#Mt(!0),this.#i!==void 0&&this.#d([]);return}if(this.#Mt(!1),this.#b?.removePopover(),Qt()&&this.#A!==void 0&&this.#A.length>0){const a=[...t.querySelectorAll("[data-line-annotation]")].map(c=>[k(c,"mouseenter",()=>{this.#W=!0}),k(c,"mouseleave",()=>{this.#W=!1})]).flat();this.#_t(a)}if(this.#st=!0,this.#q=void 0,o.button===0&&st(o)&&(this.#xt=this.#i?.map(a=>({...a}))),o.shiftKey){const a=this.#i?.at(-1);if(a!==void 0){const c=a.direction===-1?a.end:a.start;this.#St({start:c,end:c,direction:0})}this.#It=!0}}},{passive:!0}),k(t,"keydown",o=>{if(!s(o))return;this.#_=!0,this.#it=!1;const a=Tn(o,this.#e.keymap);if(a!==void 0){o.preventDefault(),a==="simplifySelection"&&(this.#P?.close(),this.#P=void 0,this.#at=!1,this.#H?.cleanup(),this.#H=void 0),this.#Wt(a);return}const c=wn(o),h=this.#s;if(this.#i!==void 0&&this.#i.length>0&&c!==void 0&&h!==void 0){const d={getSoftLineOffsets:this.#rt?l=>this.#$t(l):void 0,resolveRenderableLine:this.#Le};o.shiftKey?this.#d(Qn(h,this.#i,c,d)):this.#d(Pe(h,this.#i,c,d)),this.#tt(),o.preventDefault();return}if((o.key.length===1?o.key.toLowerCase():o.key)==="v"&&st(o)){if(o.repeat&&this.#nt){o.preventDefault();return}if(this.#e.clipboard!==void 0){o.preventDefault(),at(this.#Qt);return}}if(this.#P!==void 0){const d=Bt(o);if(d!==void 0){o.preventDefault(),this.#P.navigate(d==="previous");return}}}),k(t,"copy",o=>{s(o)&&(o.preventDefault(),this.#ae()?o.clipboardData?.setData("text",this.#ce()):this.#ue(o.clipboardData,this.#_e(),this.#fe()))}),k(t,"cut",o=>{if(s(o))if(o.preventDefault(),this.#ae())o.clipboardData?.setData("text",this.#ce());else{const a=this.#fe();this.#ue(o.clipboardData,this.#We(),a)}}),k(t,"paste",o=>{if(!s(o))return;o.preventDefault();const a=o.clipboardData,c=this.#s;if(a===null||c===void 0)return;let h=a.getData("text");const d=this.#i?.length??0;if(d>1){const l=a.getData(Ot);if(l!==void 0)try{const f=JSON.parse(l);Array.isArray(f)&&f.length===d&&(h=f)}catch{}}this.#gt(Array.isArray(h)?h.map(l=>c.normalizeEol(l)):c.normalizeEol(h),void 0,!0,"document")}),k(t,"beforeinput",o=>{s(o)&&o.inputType!=="insertCompositionText"&&(o.preventDefault(),this.#te(o.inputType,o.data))}),k(t,"drop",o=>{s(o)&&o.preventDefault()}),k(t,"compositionstart",o=>{s(o)&&(this.#mt=!0,this.#W=!0)},{passive:!0}),k(t,"compositionend",o=>{if(!s(o))return;this.#W=!1;const a=this.#mt;this.#mt=!1,(o.data!==""||!a)&&this.#te("insertText",o.data)},{passive:!0})];const r=this.#k?.shadowRoot?.querySelector("[data-deletions]");if(r!=null&&this.#v.push(k(r,"pointerdown",o=>{const a=o.composedPath();if(Jt(a)){this.#Et();return}const c=a[0],h=c instanceof HTMLElement?c.closest("[data-column-number]"):null;if(h instanceof HTMLElement){if(this.#Xt()){this.#Et();return}if(this.#oe(h,r,o.pointerType==="mouse"))return}this.#Mt(!0),this.#i!==void 0&&this.#d([])},{passive:!0})),e!==void 0){const o=(c,h=!1)=>{let d=c;return d?.dataset.lineNumberContent!==void 0?d=d.parentElement??void 0:h&&d?.tagName==="SPAN"&&(d=d.closest("[data-line]")),d},a=c=>{if(c===void 0)return;const h=c.dataset.lineType,d=z(c)??z(c,"columnNumber");if(!(d===void 0||h===void 0||!tt(h)))return d-1};this.#v.push(k(e,"pointerdown",c=>{const h=c.composedPath();if(Jt(h)){this.#Et();return}const d=o(h[0]);if(d!==void 0&&this.#Xt()){this.#Et();return}if(d?.dataset.lineType==="change-deletion"){const v=d.closest("[data-code]");v!=null&&this.#oe(d,v,c.pointerType==="mouse");return}if(c.pointerType!=="mouse")return;const l=this.#s,f=a(d);if(f===void 0||l===void 0)return;this.#_=!0,this.#b?.removePopover();const u=this.#ie(f,f,l);this.#Ct=!0,this.#q=u,this.#d([u]),this.#St(u),this.#K(),this.#_t([k(document,"mousemove",v=>{if(!this.#Ct)return;const g=this.#s,p=a(o(v.composedPath()[0],!0));if(p===void 0||g===void 0)return;const C=this.#q?.start.line??p,m=this.#ie(C,p,g);this.#q??=m,this.#d([m]),this.#K(m.direction===-1?m.start:m.end)},{passive:!0})])},{passive:!0}))}this.#b?.listenHover(t),this.#Y?.disconnect(),this.#Y=new ResizeObserver(this.#Ee),this.#Y.observe(t),this.#Y.observe(t.parentElement),this.#Jt(t)}#Qt=async()=>{const t=this.#e.clipboard;if(t!==void 0){let e=await t.readText();const n=this.#i?.length??0;if(n>1){const s=await t.readText(Ot);try{const r=JSON.parse(s);Array.isArray(r)&&r.length===n&&(e=r)}catch{}}const i=this.#s;i!==void 0&&this.#gt(Array.isArray(e)?e.map(s=>i.normalizeEol(s)):i.normalizeEol(e),void 0,!0,"document")}};#Jt(t){this.#nt&&this.#kt==="split"&&this.#rt&&(this.#B={top:t.offsetTop,left:t.offsetLeft-this.#ot()},this.#e.__debug===!0&&console.log("[diffs/editor] content offset:",this.#B))}get#ut(){if(this.#nt&&this.#kt==="split"&&this.#rt)return this.#B}#Wt(t){const e=this.#s;if(e!==void 0)switch(t){case"openSearchPanel":this.#de("find");break;case"openSearchReplacePanel":this.#de("replace");break;case"findNextMatch":{const n=this.#i;if(n===void 0)break;if(n.some(I)){const i=n.map(s=>I(s)?Ht(e,s):s);this.#d(i),this.focus()}else{const i=fi(e,n);if(i!==void 0){this.#d(i);const s=i.at(-1);s!==void 0&&this.#ct(B(s).line),this.#tt()}}break}case"moveLineUp":case"moveLineDown":this.#Te(t==="moveLineUp"?-1:1);break;case"copyLineUp":case"copyLineDown":this.#ye(t==="copyLineUp"?-1:1);break;case"simplifySelection":{const n=this.#i,i=n?.at(-1);if(n===void 0||i===void 0)break;if(n.length>1)this.#d([i]),this.#K(B(i));else if(!I(i)){const s=B(i);this.#d([{start:s,end:s,direction:0}]),this.#K(s)}break}case"insertBlankLine":this.#ke();break;case"deleteHardLineForward":this.#Ve();break;case"toggleComment":case"toggleBlockComment":{const n=this.#i;if(n===void 0)break;const{lineComment:i,blockComment:s}=On(e.languageId,this.#e.languageCommentConfig);if(t==="toggleComment"&&i!==null){this.#At(In(e,n,i));break}const r=t==="toggleComment",o=Bn(e,n,s,r);o!==void 0&&this.#At(o.edits,r?void 0:a=>o.nextSelectionOffsets.map(([c,h,d])=>({start:a.positionAt(c),end:a.positionAt(h),direction:d})));break}case"indent":case"outdent":case"indentLess":case"indentMore":if(this.#i!==void 0){const n=[],i=[],s=new Set,r=[];for(const a of this.#i){const c=a.start.line,h=t==="outdent"||t==="indentLess",d=t==="indentLess"||t==="indentMore";if(c!==a.end.line||h||d){const l=Zn(e,a,this.#t.tabSize,h);for(const f of l[0]){const u=f.range.start.line;s.has(u)||(s.add(u),n.push(f))}i.push(l[1])}else{const l=e.charAt({line:c,character:0})===" "?" ":" ".repeat(this.#t.tabSize);n.push({range:a,newText:l}),r.push({line:c,startCharacter:a.start.character,addedLength:l.length-(a.end.character-a.start.character),selectionIndex:i.length});const f={line:a.start.line,character:a.start.character+l.length};i.push({start:f,end:f,direction:0})}}for(const a of r){let c=0;for(const h of r)h.line===a.line&&h.startCharacter<a.startCharacter&&(c+=h.addedLength);if(c!==0){const h=i[a.selectionIndex],d={line:a.line,character:h.start.character+c};i[a.selectionIndex]={start:d,end:d,direction:0}}}const o=e.applyEdits(n,!0,this.#i,i);o!==void 0&&this.#G(o,i)}break;case"selectAll":{const n=ui(e);this.#d([n]),this.focus();const i=this.#pe(),s=i[0]?.[0],r=i.at(-1)?.[1];s!==void 0&&r!==void 0&&(this.#it=!0,this.#St({start:{line:s,character:0},end:{line:r,character:e.getLineLength(r)},direction:1}));break}case"moveCursorToDocStart":case"moveCursorToDocEnd":{const n=Ce(e,t==="moveCursorToDocEnd",this.#nt);this.#d([n]),this.#ct(B(n).line),this.#tt()}break;case"expandSelectionDocStart":case"expandSelectionDocEnd":{const n=t==="expandSelectionDocEnd",i=this.#i;if(i!==void 0){const s=Ce(e,n,this.#nt);this.#d(hi(i,s)),this.#ct(B(s).line),this.#tt()}}break;case"undo":case"redo":this.#we(t);break}}#we(t){const e=this.#s;if(e===void 0||t==="undo"&&!e.canUndo||t==="redo"&&!e.canRedo)return;const n=this.#i,i=n?.map(d=>[e.offsetAt(d.start),e.offsetAt(d.end)]),s=t==="undo"?e.undo():e.redo();if(s===void 0)return;const[r,o,a,c]=s,h=o??(n!==void 0&&i!==void 0&&c!==void 0?wt(e,n,i,c):void 0);this.#G(r,h,a)}#At(t,e){const n=this.#s,i=this.#i;if(n===void 0||i===void 0)return;const s=e===void 0,r=s?i.map(h=>[n.offsetAt(h.start),n.offsetAt(h.end)]):void 0,o=s?t.map(h=>{const d=n.offsetAt(h.range.start),l=n.offsetAt(h.range.end);return{start:Math.min(d,l),end:Math.max(d,l),text:h.newText}}).sort((h,d)=>{const l=h.start-d.start;return l!==0?l:h.end-d.end}):void 0,a=n.applyEdits(t,!0,i,void 0,!0);if(a===void 0)return;const c=s?wt(n,i,r,o):e(n);n.setLastUndoSelectionsAfter(c),this.#G(a,c,this.#et(a))}#ye(t){const e=this.#s,n=this.#i;if(e===void 0||n===void 0)return;const i=me(n);if(i.length===0)return;const s=[];let r=0;const o=[];for(const c of i){s.push(r);const h=c.endLine-c.startLine+1;r+=h;const d=e.getText({start:{line:c.startLine,character:0},end:{line:c.endLine,character:e.getLineLength(c.endLine)}});if(t>0){const l={line:c.startLine,character:0};o.push({range:{start:l,end:l},newText:d+e.eol})}else if(c.endLine<e.lineCount-1){const l={line:c.endLine+1,character:0};o.push({range:{start:l,end:l},newText:d+e.eol})}else{const l={line:c.endLine,character:e.getLineLength(c.endLine)};o.push({range:{start:l,end:l},newText:e.eol+d})}}const a=n.map(c=>{const h=c.start.line;let d=0,l=i.length-1;for(;d<=l;){const g=d+l>>>1,p=i[g];if(h<p.startLine)l=g-1;else if(h>p.endLine)d=g+1;else{d=g;break}}const f=Math.max(0,d<=l?d:l),u=i[f],v=s[f]+(t>0?u.endLine-u.startLine+1:0);return{start:{...c.start,line:c.start.line+v},end:{...c.end,line:c.end.line+v},direction:c.direction}});this.#At(o,()=>a)}#ke(){const t=this.#s,e=this.#i;if(t===void 0||e===void 0)return;const n=e.map(c=>B(c).line),i=Array.from(new Set(n)).sort((c,h)=>c-h),s=new Map,r=new Map,o=[];for(let c=0;c<i.length;c++){const h=i[c],d=t.getLineText(h),l=/^\s*/.exec(d)?.[0]??"";s.set(h,c),r.set(h,l);const f={line:h,character:t.getLineLength(h)};o.push({range:{start:f,end:f},newText:t.eol+l})}const a=e.map((c,h)=>{const d=n[h],l={line:d+1+s.get(d),character:r.get(d).length};return{start:l,end:l,direction:0}});this.#At(o,()=>a)}#Te(t){const e=this.#s,n=this.#i;if(e===void 0||n===void 0)return;const i=me(n);if(i.length===0||t<0&&i[0].startLine===0||t>0&&i.at(-1).endLine>=e.lineCount-1)return;const s=e.lineCount,r=f=>f<s-1?{line:f+1,character:0}:{line:f,character:e.getLineLength(f)},o=(f,u)=>{const v=f.map(g=>e.getLineText(g)).join(e.eol);return u?v+e.eol:v},a=[];if(t<0)for(const f of i){const u=f.startLine-1,v=[];for(let g=f.startLine;g<=f.endLine;g++)v.push(g);a.push({range:{start:{line:u,character:0},end:r(f.endLine)},newText:o([...v,u],f.endLine<s-1)})}else for(let f=i.length-1;f>=0;f--){const u=i[f],v=u.endLine+1,g=[];for(let p=u.startLine;p<=u.endLine;p++)g.push(p);a.push({range:{start:{line:u.startLine,character:0},end:r(v)},newText:o([v,...g],v<s-1)})}const c=i.at(-1),h=t>0&&c.endLine===s-2?e.getLineLength(c.endLine):e.getLineLength(s-1),d=n.map(f=>di(f,t,s,u=>u===s-1?h:e.getLineLength(u))),l=e.applyEdits(a,!0,n,d,!0);l!==void 0&&this.#G(l,d)}#Ee=()=>{const t=this.#A?.length??0,e=this.#x,n=this.#C;this.#x=void 0,this.#C=void 0;const i=this.#ot()!==e,s=this.#Vt()!==n;!i&&!s||(this.#M.clear(),this.#m=void 0,this.#t.clearTextWidthCache(),s&&(this.#g.clear(),(this.#rt||t>0)&&this.#y.clear()),(this.#i!==void 0||this.#X!==void 0||this.#b!==void 0)&&(this.#d(this.#i??[]),this.#i!==void 0&&this.#R&&this.focus()),this.#b?.removePopover(),this.#Jt(this.#h))};#Ae(){if(this.#Bt)return;const t=document.fonts;t!==void 0&&(this.#Bt=!0,t.ready.then(()=>{this.#h===void 0||!this.#t.remeasureCharacterWidth()||(this.#x=void 0,this.#C=void 0,this.#zt(),this.#g.clear(),(this.#i!==void 0||this.#X!==void 0||this.#b!==void 0)&&this.#d(this.#i??[]),this.#b?.removePopover())}))}#Me(t,e,n=this.#$,i){const s=this.#r,r=this.#f,o=this.#s,a=this.#N,c=this.#h;if(s===void 0||r===void 0||o===void 0||c===void 0)return;s.stopBackgroundTokenize();const h=performance.now(),d=s.tokenize(t,n),l=performance.now();if(d.size>0){const u=c.children,v=new Set;for(const g of d.keys())this.#bt(g)&&v.add(g);for(let g=0;g<u.length;g++){const p=u[g];if(p!==void 0){const C=z(p),m=p.dataset.lineType;if(C===void 0||m==="change-deletion")continue;const x=C-1;if(v.has(x)){const L=d.get(x);if(p.replaceChildren(...At(L)),v.delete(x),v.size===0)break}}}if(v.size>0){let g=0;for(let p=u.length-1;p>=0;p--){const C=u[p],m=z(C);if(m!==void 0&&C.dataset.lineType!=="change-deletion"){g=m;break}}for(const p of v){if(p<g)continue;const C=d.get(p),m=String(p+1);y("div",{dataset:{line:m,lineType:"context",lineIndex:p.toString()},children:At(C)},c),a!==void 0&&y("div",{dataset:{lineType:"context",columnNumber:m,lineIndex:p.toString()},children:[y("span",{dataset:{lineNumberContent:""},textContent:m})]},a)}}}if(t.lineDelta<0)for(const u of[c.children,a?.children??[]])for(let v=u.length-1;v>=0;v--){const g=u[v],p=z(g)??z(g,"columnNumber"),C=g.dataset.lineType;if(!(p===void 0||C==="change-deletion")){if(p-1<t.lineCount)break;g.remove()}}const f=t.lineDelta!==0;if(f){let u=c.children.length;for(const v of c.children){const{bufferSize:g}=v.dataset;g!==void 0&&(u+=parseInt(g)-1)}c.style.gridRow="span "+u,a!==void 0&&(a.style.gridRow="span "+u)}r.updateRenderCache(d,s.themeType,{shouldRefreshDiffsView:this.#nt&&!f,lineCountChangeInFlight:f}),f&&r.applyDocumentChange(o,e,i),(f||this.#nt&&this.#kt==="unified")&&this.#zt(),e!==void 0&&(this.#A=e,Vn(e,c,a)),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${j(performance.now()-l)}ms,`,`tokenize in: ${j(l-h)}ms (${d.size} dirty lines)`)}#te(t,e){switch(t){case"insertText":{const n=e??"",i=this.#s,s=this.#i,r=i!==void 0&&s!==void 0?ii(i,s,n,this.#e.autoSurround):void 0;this.#gt(r??n);break}case"insertCompositionText":break;case"insertLineBreak":case"insertParagraph":this.#gt(this.#s?.eol??`
516
516
  `);break;case"deleteContentBackward":this.#ge();break;case"deleteContentForward":this.#ge(!0);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":this.#De();break;case"deleteWordBackward":this.#Ue();break;case"insertTranspose":this.#$e();break;default:console.warn(`[diffs] Unknown input type: ${t}`,e);break}}#K(t,e=!0,n){this.#R=!0,t!==void 0?(this.#W=!0,this.#St({start:t,end:t,direction:0}),at(()=>{if(n?.()===!1||!this.#R){this.#W=!1;return}this.#h?.focus({preventScroll:e}),at(()=>{this.#W=!1})})):n?.()!==!1?this.#h?.focus({preventScroll:e}):this.#R=!1}#Ft(t){const e=this.#O;if(e==null)return;if(this.#at){this.#O=void 0,this.#R=!1,this.#W=!1;return}const n=this.#h;if(n==null||!this.#ee(n)){this.#O=void 0,this.#R=!1;return}const i=()=>{if(this.#O!==e)return!1;const o=this.#ee(n);return this.#O=void 0,o};if(t!=null){this.#K(t,!0,i);return}const s=this.#i?.at(-1);if(s==null){this.#K(void 0,!0,i);return}const r=s.direction===-1?s.end:s.start;this.#K(r,!0,i)}#ee(t){const e=this.#k,n=e?.shadowRoot;if(e==null||n==null||this.#h!==t||!n.contains(t))return!1;const{activeElement:i}=n;if(i===t||i!=null&&t.contains(i))return!0;if(i!=null)return!1;const{ownerDocument:s}=e,{activeElement:r}=s;return r==null||r===s.body||r===s.documentElement||r===e}#Re(t=0){const e=this.#h,n=this.#k;if(this.#s==null||e==null||n==null)return;const i=this.#f?.getEditorViewport?.()??this.#Oe(n);let s,r;if(i instanceof HTMLElement){const a=i.getBoundingClientRect();s=a.top,r=a.bottom}else{const a=i.defaultView;if(a==null)return;s=0,r=a.innerHeight}const o=n.shadowRoot?.querySelector("[data-diffs-header][data-sticky]");if(o!=null&&(s=Math.max(s,o.getBoundingClientRect().bottom)),Number.isFinite(t)&&(s+=Math.max(0,t)),!(r<=s))for(const a of e.children){const c=a,h=z(c),d=c.dataset.lineType;if(h==null||d==null||!tt(d))continue;const l=c.getBoundingClientRect();if(!(l.bottom<=l.top)&&l.top>=s&&l.top<r)return h}}#Oe(t){const e=t.ownerDocument;let n=t.parentElement;for(;n!=null&&n!==e.body&&n!==e.documentElement;){const i=n.ownerDocument.defaultView?.getComputedStyle(n).overflowY;if(i==="auto"||i==="scroll"||i==="overlay")return n;n=n.parentElement}return e}#Ie(t,e){const n={start:t,end:t,direction:0};this.#_=!1,this.#d([n]),this.#ct(t.line),e?this.#K(t,!0):this.#tt()}#St(t){const e=window.getSelection();if(e===null)return;let{start:n,end:i,direction:s}=t;E(n,i)>0&&([n,i]=[i,n]);const r=this.#lt(n.line),o=this.#lt(i.line);if(r===void 0||o===void 0)return;let[a,c]=Le(r,n.character),[h,d]=Le(o,i.character);s===-1&&([a,c,h,d]=[h,d,a,c]);try{e.setBaseAndExtent(a,ce(a,c),h,ce(h,d))}catch(l){console.error("[diffs/editor] failed to update window selection:",l)}}#tt(t=!1,e="nearest"){const n=this.#i?.at(-1);if(n===void 0)return;const i=this.#Z;if(i!==void 0){if(i.scrollIntoView({block:e,inline:"nearest"}),!t){const s=n.direction===-1?n.end:n.start;this.#O!==void 0?this.#Ft(s):this.#K(s)}}else{const s=B(n);this.#Dt(s.line,s.character,t)}}#ne(){const t=this.#P!==void 0?48:0,e=this.#ot()+this.#t.ch;return`${t}px ${this.#t.ch}px 0 ${e}px`}#Dt(t,e=0,n=!1){this.__postponeBgTokenizeToNextFrame();const i=y("div",{style:{position:"absolute",left:"0",width:"2px",height:this.#t.lineHeight+"px",scrollMargin:this.#ne()}});if(this.#lt(t)!==void 0){const[s,r]=this.#vt(t,e),o=this.#pt(t)+r*this.#t.lineHeight;if(i.style.top=o+"px",i.style.left=s+"px",this.#V?.appendChild(i),i.scrollIntoView({block:"center",inline:"nearest"}),!n){const a={line:t,character:e};this.#O!==void 0?this.#Ft(a):this.#K(a)}this.#J=void 0,this.#ht=void 0,this.#yt=!1,this.#dt=!1}else{const s=this.#f?.getLinePosition?.(t+1);if(s!==void 0)i.style.top=s.top+"px",this.#k?.shadowRoot?.appendChild(i),i.scrollIntoView({block:"center",inline:"nearest"}),s.height>0&&this.#bt(t)?(this.#J=t,this.#ht=e,this.#dt=n):(this.#J=void 0,this.#ht=void 0,this.#dt=!1);else{let r=0;if(this.#J===t&&this.#h!==void 0)for(let a=this.#h.childElementCount-1;a>=0;a--){const c=this.#h.children[a],h=c.dataset.lineType,d=z(c);if(h!==void 0&&tt(h)&&d!==void 0){r=(t-(d-1))*this.#t.lineHeight;break}}const o=((this.#A??[]).filter(a=>a.lineNumber<t).length+t)*this.#t.lineHeight+r;i.style.top=o+"px",this.#k?.shadowRoot?.appendChild(i),i.scrollIntoView({block:"center",inline:"nearest"}),this.#J===t&&(r===0||this.#yt)||!this.#bt(t)?(this.#J=void 0,this.#ht=void 0,this.#yt=!1,this.#dt=!1):(this.#J=t,this.#ht=e,this.#yt=r!==0,this.#dt=n)}}i.remove()}#ie(t,e,n){const i=r=>({line:r,character:0}),s=r=>({line:r,character:n.getLineText(r).length});return e<t?{start:i(e),end:s(t),direction:-1}:{start:i(t),end:s(e),direction:1}}#Pe(t){const e=t.composedPath()[0];return e instanceof HTMLElement&&e.closest("[data-line]")?.getAttribute("data-line-type")==="change-deletion"}#se(t,e,n){const i=[...n.querySelectorAll("[data-content] > [data-line]")],s=i.indexOf(t),r=i.indexOf(e),[o,a]=r<s?[e,t]:[t,e],c=window.getSelection();if(c!==null){const l=document.createRange();l.setStart(o,0),l.setEnd(a,a.childNodes.length),c.removeAllRanges(),c.addRange(l)}this.#Mt(!0),this.#d([]),this.#wt(z(e)??null,!0,"deletions");const h=Math.min(s,r),d=Math.max(s,r);this.#Lt=h<0?"":i.slice(h,d+1).filter(l=>l.getAttribute("data-line-type")==="change-deletion").map(l=>l.textContent??"").join(`
517
517
  `)}#re(t,e){const n=t.parentElement;if(n==null||e==null)return;const i=[...n.children].indexOf(t),s=e.children[i];return s instanceof HTMLElement?s:void 0}#oe(t,e,n){const i=e.querySelector("[data-content]"),s=this.#re(t,i);return s===void 0?!1:(this.#se(s,s,e),n&&this.#_t([k(document,"mousemove",r=>{const o=r.composedPath()[0],a=o instanceof HTMLElement?o.closest("[data-column-number]"):null;if(a instanceof HTMLElement&&e.contains(a)){const c=this.#re(a,i);c!==void 0&&this.#se(s,c,e)}},{passive:!0})]),!0)}#ae(){return this.#k?.shadowRoot?.querySelector("pre")?.hasAttribute("data-deleted-text-selection")??!1}#ce(){return this.#Lt!==""?this.#Lt:window.getSelection()?.toString()??""}#Mt(t){const e=this.#k?.shadowRoot?.querySelector("pre");e!=null&&(t?(e.setAttribute("data-deleted-text-selection",""),this.#wt(null),this.#Lt=""):(e.removeAttribute("data-deleted-text-selection"),this.#Lt=""))}#wt(t,e=!1,n="additions"){try{this.#f?.setEditorActiveLine(t,{lineNumberOnly:e,side:n})}catch{}}#Be(){this.#ft===void 0&&(this.#ft=requestAnimationFrame(()=>{this.#ft=void 0,(this.#i!==void 0||this.#X!==void 0||this.#b!==void 0)&&this.#d(this.#i??[])}))}#d(t){if(this.__postponeBgTokenizeToNextFrame(),this.#Z=void 0,this.#wt(null),t.length===0&&this.#X===void 0&&this.#b===void 0){this.#i=void 0,this.#D?.forEach(s=>s.remove()),this.#D?.clear(),this.#H?.cleanup(),this.#H=void 0;return}const e=document.createDocumentFragment(),n={fragment:e,elements:new Map};if(t.length>0){const s=ze(t),r=s.at(-1);this.#i=s;const o=s.some(h=>!I(h)),a=B(r).line+1;this.#wt(a,o);for(const h of s)I(h)||this.#Rt(n,"selection",h),this.#ze(n,h,h===r);const c=this.#e.matchBrackets!==!1&&this.#s!==void 0&&this.#r!==void 0&&I(r)?Oi(this.#s,this.#r,r.start):void 0;if(c!==void 0)for(const h of c)this.#Rt(n,"bracketMatch",h)}const i=this.#s;if(this.#X!==void 0&&i!==void 0){const s=this.#X,r=this.#$,o=r!==void 0&&Number.isFinite(r.totalLines)||this.#nt&&this.#f?.options.expandUnchanged!==!0?this.#pe():void 0,a=this.#i?.at(-1),c=a!==void 0?i.offsetAt(a.start):-1,h=a!==void 0?i.offsetAt(a.end):-1;let d=0;const l=o?.length??1;for(let f=0;f<l;f++){let u=1/0;const v=o?.[f];if(v!==void 0){const[g,p]=v,C=i.offsetAt({line:g,character:0}),m=p+1;u=m<i.lineCount?i.offsetAt({line:m,character:0}):i.offsetAt({line:m-1,character:i.getLineLength(m-1)});let x=d,L=s.length;for(;x<L;){const S=x+Math.floor((L-x)/2);s[S][1]<=C?x=S+1:L=S}d=x}for(;d<s.length;d++){const[g,p]=s[d];if(g>=u)break;const C={start:i.positionAt(g),end:i.positionAt(p)},m=c===g&&h===p;this.#Rt(n,"match",C,m?"focus":void 0)}}}if(this.#b!==void 0&&i!==void 0)for(const s of this.#b.markers)this.#Rt(n,"marker",s,pt(s.severity));this.#V?.appendChild(e),this.#D?.forEach(s=>s.remove()),this.#D?.clear(),this.#D=n.elements,this.#Ut()}#Rt(t,e,n,i){if(this.#s===void 0)return;const{start:s,end:r}=n;let o=s.line,a=r.line+1;if(this.#$!==void 0){const{startingLine:c,totalLines:h}=this.#$;o=Math.max(o,c),a=Math.min(a,c+h)}for(let c=o;c<a;c++){if(!this.#Ot(c))continue;const h=c===r.line,d=c===s.line?s.character:0,l=h?r.character:this.#s.getLineLength(c);if(this.#rt){const g=this.#Vt(),p=this.#s.getLineText(c);if(2*this.#t.ch+this.#t.measureTextWidth(p)>g){this.#Ne(t,c,p,d,l,h,e,i);continue}}let f=0,u=0,v=0;d===0?f=this.#ot()+this.#t.ch+(this.#ut?.left??0):f=this.#vt(c,d)[0],!h&&e==="selection"&&(v=this.#t.ch),d===l?u=v:u=this.#vt(c,l)[0]-f+v,this.#he(t,e,c,0,f,u,i)}}#Ne(t,e,n,i,s,r,o,a){const c=this.#$t(e),h=c.length-1,d=this.#ot()+this.#t.ch+(this.#ut?.left??0);for(let l=0;l<h;l++){const f=c[l],u=c[l+1],v=Math.max(i,f),g=Math.min(s,u);if(v>g)continue;const p=this.#le(n,f,v),C=d+p;let m=0;!r&&l===h-1&&o==="selection"&&(m=this.#t.ch);const x=v===g?m:this.#le(n,f,g)-p+m;this.#he(t,o,e,l,C,x,a)}}#le(t,e,n){if(n<=e)return 0;const i=t.slice(e,n),s=ht(i,this.#t.tabSize);return s!==-1?s*this.#t.ch:this.#t.measureTextWidth(i)}#he(t,e,n,i,s,r,o){if(r===0)return;const{ch:a,lineHeight:c}=this.#t,h=this.#pt(n)+i*c,d=`${e}-${n}/${i}-${s}-${r} ${o??""}`,l=this.#D,f=(this.#e.roundedSelection??!0)&&e==="selection",u=(p,C,m,x)=>{const L=this.#pt(p)+C*c,S=this.#lt(p);let w="initial";S!==void 0&&(S.dataset.lineType==="change-addition"||S.dataset.selectedLine!==void 0)&&(w=getComputedStyle(S).getPropertyValue("--diffs-line-bg"));const T=`width:${a}px;transform:translateX(${m}px) translateY(${L}px);--diffs-selection-corner-bg:${w}`,R={selectionCorner:"",[x]:""},O=`${e}-block-${p}/${C}-${m}-1ch`;let A=O+"-"+x;if(x==="rbl"){const F=O+"-rtl",D=t.elements.get(F);D!==void 0&&(D.remove(),t.elements.delete(F),A+="-rtl",R.rtl="")}let H=t.elements.get(A);H===void 0&&(l?.has(A)===!0?(H=l.get(A),H.style.cssText=T,l.delete(A)):H=y("div",{dataset:"selectionRange",style:{cssText:T},children:[y("div",{dataset:R})]},t.fragment),t.elements.set(A,H))},v=p=>{const C=s+r,m=p.dataset,x=t.previousSelectionRange;if((x===void 0||x.line!==n||x.wrapLine!==i)&&(t.previousSelectionRange={element:p,line:n,wrapLine:i,left:s,width:r}),x===void 0||C<=x.left)["rtl","rtr","rbl","rbr"].forEach(L=>{m[L]=""});else{const L=x.line,S=x.wrapLine,w=x.left,T=x.element.dataset,R=w+x.width;w>s&&u(L,S,w-a,"rbr"),delete T.rbl,delete m.rtl,delete m.rtr,C>=R&&delete T.rbr,C>R&&(u(L,S,R,"rbl"),m.rtr=""),C<R&&u(n,i,C,"rtl"),s<w&&(m.rtl=""),m.rbl="",m.rbr=""}};let g=t.elements.get(d);if(g!==void 0){f&&v(g);return}l?.has(d)===!0?(g=l.get(d),l.delete(d)):g=y("div",{dataset:o?[e+"Range",o]:e+"Range"},t.fragment),g.style.width=`${r}px`,g.style.transform=`translateX(${s}px) translateY(${h}px)`,f&&v(g),t.elements.set(d,g)}#ze(t,e,n){const{line:i,character:s}=B(e);if(!this.#Ot(i))return;const[r,o]=this.#vt(i,s),a="caret-"+i+"/"+o+":"+s;if(t.elements.has(a))return;const c=y("div",{dataset:"caret",style:{transform:`translateX(${r-1}px) translateY(${this.#pt(i)+o*this.#t.lineHeight}px)`}},t.fragment);t.elements.set(a,c),n&&(c.style.scrollMargin=this.#ne(),this.#Z=c)}#Ut(){const t=this.#i?.at(-1),e=this.#V,n=this.#s,i=this.#e.renderSelectionAction,s=()=>{this.#H?.cleanup(),this.#H=void 0};if(this.#e.enabledSelectionAction!==!0||i===void 0||t===void 0||I(t)||this.#st||e===void 0||n===void 0){s();return}const r=B(t);if(!this.#Ot(r.line)){s();return}if(this.#H===void 0){if(!this.#_)return;const O=()=>this.#i?.at(-1)??t,A=i({textDocument:n,get selection(){return O()},applyEdits:H=>this.applyEdits(H),getSelectionText:()=>this.#s?.getText(O())??"",replaceSelectionText:H=>{this.#gt(H,[O()])},close:()=>{s(),this.#tt()}});this.#H=new $i(A,e,()=>this.#Ut()),this.#Tt().resetPlacement(Rt)}const o=this.#t.lineHeight,a=t.direction===-1,c={placeAbove:a,anchor:r},h=a?{placeAbove:!1,anchor:t.end}:{placeAbove:!0,anchor:t.start},d=this.#H.height,l=O=>{const[A,H]=this.#vt(O.anchor.line,O.anchor.character),F=this.#pt(O.anchor.line)+H*o,D=O.placeAbove?F:F+o,ot=O.placeAbove?D-d:D;return{top:ot,bottom:ot+d,left:A,anchorTop:D,rowTop:F}},f=l(c),u=n.lineCount,v=a?r.line<3:r.line>=u-3,g=this.#Ot(h.anchor.line)?l(h):void 0,p=this.#Tt(),C=p.getPlacementBounds(),m=g!==void 0&&p.choosePlacement({preferred:f,fallback:g,viewport:C,popoverHeight:d,atDocumentEdge:v,placementKey:Rt})==="fallback";g===void 0&&p.setPlacement("preferred",Rt);const{placeAbove:x}=m?h:c,{left:L,anchorTop:S}=m&&g!==void 0?g:f,w=a?f.rowTop:g?.rowTop??-1/0,T=(a?g?.rowTop??1/0:f.rowTop)+(t.end.line>t.start.line&&t.end.character===0?0:o),R=C===void 0||T>C.top&&w<C.bottom;this.#H.reposition(L,S,this.#ot(),x,R,C)}#de(t){if(this.#P!==void 0){this.#P.setMode(t);return}this.#He(t)}#He(t){this.#P?.cleanup();const e=this.#s,n=this.#k?.shadowRoot?.querySelector("pre"),i=this.#i;if(e===void 0||n==null)return;let s="",r;if(i!==void 0&&i.length>0){let c=i.at(-1);if(I(c)){c=Ht(e,c),this.#d([...i.slice(0,-1),c]);const h=e.getText(c);h!==""&&!h.includes(`
518
- `)&&(s=h,r=[e.offsetAt(c.start),e.offsetAt(c.end)])}}const o=([c,h],d)=>{const l=Kt(e,c,h);this.#d([l]),this.#ct(B(l).line),this.#tt(!0),this.#at=d},a=new Vi({textDocument:e,containerElement:n,defaultQuery:s,mode:t,initialMatch:r,scrollToMatch:o,applyReplace:c=>{if(c.length===0)return;const h=e.applyEdits(c.map(d=>({range:{start:e.positionAt(d.start),end:e.positionAt(d.end)},newText:d.text})),!0,this.#i);h!==void 0&&this.#G(h,void 0,this.#et(h),{skipSearchRefresh:!0})},onUpdate:(c,h)=>{if(c.length===0){this.#X=void 0,this.#d(this.#i??[]);return}if(this.#X=c,h?.syncSelection===!1){this.#d(this.#i??[]);const u=this.#i?.at(-1);if(u!==void 0){const v=e.offsetAt(u.start),g=e.offsetAt(u.end);for(const p of c)if(p[0]===v&&p[1]===g)return p}return}const d=this.#i?.at(-1);let l=0,f;d!==void 0&&(l=e.offsetAt(d.start));for(const u of c)if(u[0]>=l){f=u;break}return f!==void 0?o(f,!0):this.#d(this.#i??[]),f},onClose:()=>{this.#P=void 0,this.#at=!1,this.#X=void 0,this.#d(this.#i??[])}});this.#P=a,this.#at=!1}#_e(){const t=this.#s,e=this.#i;return t===void 0||e===void 0?"":zt(t,e)}#fe(){const t=this.#s,e=this.#i;return t===void 0||e===void 0?[]:pi(t,e)}#ue(t,e,n){t!==null&&(t.setData("text",e),n.length>1&&t.setData(Ot,JSON.stringify(n)))}#We(){const t=this.#s,e=this.#i;if(t===void 0||e===void 0||e.length===0)return"";if(e.some(i=>I(i))){const i=xi(t,e);return this.#Fe(i.edits,i.nextSelectionOffsets),i.text}const n=zt(t,e);return this.#gt("",void 0,!0),n}#Fe(t,e){const n=this.#s,i=this.#i;if(n===void 0||i===void 0||t.length===0)return;const s=n.applyResolvedEdits(t,!0,i,void 0,!0);if(s===void 0)return;const r=e.map(o=>{const a=n.positionAt(o);return{start:a,end:a,direction:0}});n.setLastUndoSelectionsAfter(r),this.#G(s,r,this.#et(s))}#gt(t,e=this.#i,n=!1,i="selection"){if(e===void 0)return;const s=this.#s,r=e.at(-1);if(s===void 0||r===void 0)return;const{nextSelections:o,change:a}=Array.isArray(t)&&t.length===e.length?rt(s,e,t,this.#A,n,i):Jn(s,e,{start:s.offsetAt(r.start),end:s.offsetAt(r.end),text:Array.isArray(t)?t.join(s.eol):t},this.#A,void 0,n);a!==void 0&&this.#G(a,o,this.#et(a))}#ge(t=!1){const e=this.#i,n=this.#s;if(e===void 0||n===void 0)return;const{nextSelections:i,change:s}=li(n,e,t,this.#A,this.#t.tabSize);s!==void 0&&this.#G(s,i,this.#et(s))}#De(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=oi(e,t,this.#rt?(s,r)=>{const o=this.#$t(s);for(let a=0;a+1<o.length;a++){const c=o[a],h=o[a+1];if(r>=c&&r<=h)return c}return 0}:void 0,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#Ue(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=ai(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#Ve(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=ri(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#$e(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=si(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#G(t,e,n,i){const s=this.getFile(),r=this.#e.onChange;if(s!==void 0&&r!==void 0){const c=n??this.#A;r(s,c,{changes:t.changes,file:s,lineAnnotations:c})}if(t.lineDelta!==0||this.#rt)for(const c of this.#y.keys())c>=t.startLine&&this.#y.delete(c);if(this.#g.size>0)if(t.lineDelta===0&&(t.changedLineRanges.length===1||t.changedLineChanges?.every(([,,c])=>c===0)===!0))for(const[c,h]of t.changedLineRanges)for(let d=c;d<=h;d++)this.#g.delete(d);else for(const c of this.#g.keys())c>=t.startLine&&this.#g.delete(c);this.#m=void 0;let o=this.#$,a;if(o!==void 0&&e!==void 0&&e.length>0){const c=e.at(-1),h=o.startingLine+o.totalLines;if(c.end.line>=h){const d=c.end.line-o.startingLine+1,l=this.#Q===void 0||this.#Q===1/0?1/0:this.#Q*rs;t.startLine<=h&&d<=l&&this.#bt(c.end.line)?(c.end.line>h&&(a=!0),o={...o,totalLines:d},this.#$=o):a=!0}}if(this.#Me(t,n,o,a),i?.skipSearchRefresh!==!0&&this.#P!==void 0&&this.#X!==void 0&&this.#P.updateMatches({syncSelection:!1}),e!==void 0&&(this.#d(e),i?.skipFocus!==!0)){const c=e.at(-1);if(c!==void 0&&this.#ct(B(c).line),this.#Z!==void 0)requestAnimationFrame(()=>{this.#Z?.scrollIntoView({block:"nearest",inline:"nearest"})});else if(e.length>0){const h=B(e.at(-1));this.#Dt(h.line,h.character)}this.focus({preventScroll:!0})}}#et(t){if(this.#A!==void 0){const e=mt(t,this.#A);if(e!==void 0)return this.#s?.setLastUndoLineAnnotations(this.#A,e),e}}#pe(){const t=this.#h;if(t===void 0)return[];const e=[];for(const n of t.children){const i=n,s=i.dataset.lineType,r=z(i);if(r===void 0||s===void 0||!tt(s))continue;const o=r-1,a=e.at(-1);a!==void 0&&o<=a[1]+1?a[1]=Math.max(a[1],o):e.push([o,o])}return e}#lt(t){let e=this.#M.get(t);if(e!==void 0)return e??void 0;const n=this.#$;if(n!==void 0&&(t<n.startingLine||t>=n.startingLine+n.totalLines))return;const i=this.#h;if(i!==void 0){if(n!==void 0){const{startingLine:s}=n,{children:r}=i;for(let o=t-s;o<=r.length;o++){const a=r[o];if(a===void 0)break;const c=z(a),h=a.dataset.lineType;if(c!==void 0&&c===t+1&&h!==void 0&&tt(h)){e=a;break}}}return e??=i.querySelector(`[data-line="${t+1}"]`+(this.#kt==="unified"?':not([data-line-type="change-deletion"])':"")),e!==void 0&&this.#M.set(t,e),e??void 0}}#ot(){if(this.#N===void 0)return 0;if(this.#x===void 0){const t=this.#h?.parentElement?.style.getPropertyValue("--diffs-column-number-width");t!==void 0&&t.length>2&&t.endsWith("px")?this.#x=parseInt(t.slice(0,-2),10):this.#x=this.#N.offsetWidth}return this.#x}#Vt(){if(this.#h===void 0)return 0;if(this.#C===void 0){const t=this.#h.parentElement?.style.getPropertyValue("--diffs-column-content-width");t!==void 0&&t.length>2&&t.endsWith("px")?this.#C=parseFloat(t.slice(0,-2)):this.#C=this.#h.offsetWidth}return this.#C}#pt(t){const e=this.#y.get(t);if(e!==void 0)return e;const n=this.#lt(t);if(n===void 0)return-1;let i=n.offsetTop+this.#t.paddingTop;return i+=this.#ut?.top??0,this.#y.set(t,i),i}#vt(t,e){if(this.#m!==void 0&&this.#m[0]===t&&this.#m[1]===e)return[this.#m[2],this.#m[3]];const n=this.#s?.getLineText(t),i=this.#ot()+this.#t.ch;if(n===void 0||n.length===0||e<=0)return[i+(this.#ut?.left??0),0];const s=ts(n,Math.min(e,n.length)),r=n.slice(0,s),o=ht(r,this.#t.tabSize);let a=0,c=0;if(o!==-1?a=i+o*this.#t.ch:a=i+this.#t.measureTextWidth(r),this.#rt){const h=this.#Vt();if(2*this.#t.ch+this.#t.measureTextWidth(n)>h){const d=this.#ve(t);if(d==null)return[a+(this.#ut?.left??0),0];for(let l=0;l+1<d.length;l++){const f=d[l];if(s<=d[l+1]){c=l;const u=n.slice(f,s),v=ht(u,this.#t.tabSize);v!==-1?a=i+v*this.#t.ch:a=i+this.#t.measureTextWidth(u);break}}}a+=this.#ut?.left??0}return this.#m!==void 0?(this.#m[0]=t,this.#m[1]=e,this.#m[2]=a,this.#m[3]=c):this.#m=[t,e,a,c],[a,c]}#ve(t){const e=this.#g.get(t);if(e!==void 0)return e;this.#g.size>=os&&this.#g.clear();const n=this.#s?.getLineText(t);if(n===void 0||n.length===0){const c=new Uint32Array([0]);return this.#g.set(t,c),c}const i=this.#h;if(i==null||!i.isConnected)return;const s=y("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",boxSizing:"border-box",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",font:"inherit",paddingInline:"1ch",tabSize:this.#t.tabSize.toString()},textContent:n},i),r=s.firstChild,o=document.createRange(),a=[];try{const c=s.getBoundingClientRect();if(c.width===0)return;const h=es(n),d=c.left+this.#t.ch,l=h===void 0?n.length:h.length-1,f=C=>h===void 0?C:h[C],u=C=>(o.setStart(r,f(C)),o.setEnd(r,f(C+1)),o.getBoundingClientRect());a.push(0);let v=u(0).top,g=1;for(;g<l;){let C=g,m=l;for(;C<m;){const w=C+m>>1;u(w).top>v?m=w:C=w+1}if(C>=l)break;const{left:x,top:L}=u(C),S=Qt()&&x-d>this.#t.ch/2;a.push(f(S?C-1:C)),v=L,g=C+1}const p=new Uint32Array(a.length+1);for(let C=0;C<a.length;C++)p[C]=a[C];return p[a.length]=n.length,this.#g.set(t,p),p}finally{s.remove()}}#$t(t){const e=this.#ve(t);if(e!==void 0)return e;const n=this.#s?.getLineText(t)?.length??0;return Uint32Array.of(0,n)}#Ke({startContainer:t,endContainer:e}){const n=this.#h;return n===void 0?!1:n.contains(t)&&n.contains(e)}#Ot(t){const e=this.#s?.lineCount??0;return t<0||t>=e?!1:this.#lt(t)!==void 0}};export{us as Editor,Sn as TextDocument};
518
+ `)&&(s=h,r=[e.offsetAt(c.start),e.offsetAt(c.end)])}}const o=([c,h],d)=>{const l=Kt(e,c,h);this.#d([l]),this.#ct(B(l).line),this.#tt(!0),this.#at=d},a=new Vi({textDocument:e,containerElement:n,defaultQuery:s,mode:t,initialMatch:r,scrollToMatch:o,applyReplace:c=>{if(c.length===0)return;const h=e.applyEdits(c.map(d=>({range:{start:e.positionAt(d.start),end:e.positionAt(d.end)},newText:d.text})),!0,this.#i);h!==void 0&&this.#G(h,void 0,this.#et(h),{skipSearchRefresh:!0})},onUpdate:(c,h)=>{if(c.length===0){this.#X=void 0,this.#d(this.#i??[]);return}if(this.#X=c,h?.syncSelection===!1){this.#d(this.#i??[]);const u=this.#i?.at(-1);if(u!==void 0){const v=e.offsetAt(u.start),g=e.offsetAt(u.end);for(const p of c)if(p[0]===v&&p[1]===g)return p}return}const d=this.#i?.at(-1);let l=0,f;d!==void 0&&(l=e.offsetAt(d.start));for(const u of c)if(u[0]>=l){f=u;break}return f!==void 0?o(f,!0):this.#d(this.#i??[]),f},onClose:()=>{this.#P=void 0,this.#at=!1,this.#X=void 0,this.#d(this.#i??[])}});this.#P=a,this.#at=!1}#_e(){const t=this.#s,e=this.#i;return t===void 0||e===void 0?"":zt(t,e)}#fe(){const t=this.#s,e=this.#i;return t===void 0||e===void 0?[]:pi(t,e)}#ue(t,e,n){t!==null&&(t.setData("text",e),n.length>1&&t.setData(Ot,JSON.stringify(n)))}#We(){const t=this.#s,e=this.#i;if(t===void 0||e===void 0||e.length===0)return"";if(e.some(i=>I(i))){const i=xi(t,e);return this.#Fe(i.edits,i.nextSelectionOffsets),i.text}const n=zt(t,e);return this.#gt("",void 0,!0),n}#Fe(t,e){const n=this.#s,i=this.#i;if(n===void 0||i===void 0||t.length===0)return;const s=n.applyResolvedEdits(t,!0,i,void 0,!0);if(s===void 0)return;const r=e.map(o=>{const a=n.positionAt(o);return{start:a,end:a,direction:0}});n.setLastUndoSelectionsAfter(r),this.#G(s,r,this.#et(s))}#gt(t,e=this.#i,n=!1,i="selection"){if(e===void 0)return;const s=this.#s,r=e.at(-1);if(s===void 0||r===void 0)return;const{nextSelections:o,change:a}=Array.isArray(t)&&t.length===e.length?rt(s,e,t,this.#A,n,i):Jn(s,e,{start:s.offsetAt(r.start),end:s.offsetAt(r.end),text:Array.isArray(t)?t.join(s.eol):t},this.#A,void 0,n);a!==void 0&&this.#G(a,o,this.#et(a))}#ge(t=!1){const e=this.#i,n=this.#s;if(e===void 0||n===void 0)return;const{nextSelections:i,change:s}=li(n,e,t,this.#A,this.#t.tabSize);s!==void 0&&this.#G(s,i,this.#et(s))}#De(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=oi(e,t,this.#rt?(s,r)=>{const o=this.#$t(s);for(let a=0;a+1<o.length;a++){const c=o[a],h=o[a+1];if(r>=c&&r<=h)return c}return 0}:void 0,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#Ue(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=ai(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#Ve(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=ri(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#$e(){const t=this.#i,e=this.#s;if(t===void 0||e===void 0)return;const{nextSelections:n,change:i}=si(e,t,this.#A);i!==void 0&&this.#G(i,n,this.#et(i))}#G(t,e,n,i){const s=this.getFile(),r=this.#e.onChange;if(s!==void 0&&r!==void 0){const c=n??this.#A;r(s,c,{changes:t.changes,file:s,lineAnnotations:c})}if(t.lineDelta!==0||this.#rt)for(const c of this.#y.keys())c>=t.startLine&&this.#y.delete(c);if(this.#g.size>0)if(t.lineDelta===0&&(t.changedLineRanges.length===1||t.changedLineChanges?.every(([,,c])=>c===0)===!0))for(const[c,h]of t.changedLineRanges)for(let d=c;d<=h;d++)this.#g.delete(d);else for(const c of this.#g.keys())c>=t.startLine&&this.#g.delete(c);this.#m=void 0;let o=this.#$,a;if(o!==void 0&&e!==void 0&&e.length>0){const c=e.at(-1),h=o.startingLine+o.totalLines;if(c.end.line>=h){const d=c.end.line-o.startingLine+1,l=this.#Q===void 0||this.#Q===1/0?1/0:this.#Q*rs;t.startLine<=h&&d<=l&&this.#bt(c.end.line)?(c.end.line>h&&(a=!0),o={...o,totalLines:d},this.#$=o):a=!0}}if(this.#Me(t,n,o,a),i?.skipSearchRefresh!==!0&&this.#P!==void 0&&this.#X!==void 0&&this.#P.updateMatches({syncSelection:!1}),e!==void 0&&(this.#d(e),i?.skipFocus!==!0)){const c=e.at(-1);if(c!==void 0&&this.#ct(B(c).line),this.#Z!==void 0)requestAnimationFrame(()=>{this.#Z?.scrollIntoView({block:"nearest",inline:"nearest"})});else if(e.length>0){const h=B(e.at(-1));this.#Dt(h.line,h.character)}this.focus({preventScroll:!0})}}#et(t){if(this.#A!==void 0){const e=mt(t,this.#A);if(e!==void 0)return this.#s?.setLastUndoLineAnnotations(this.#A,e),e}}#pe(){const t=this.#h;if(t===void 0)return[];const e=[];for(const n of t.children){const i=n,s=i.dataset.lineType,r=z(i);if(r===void 0||s===void 0||!tt(s))continue;const o=r-1,a=e.at(-1);a!==void 0&&o<=a[1]+1?a[1]=Math.max(a[1],o):e.push([o,o])}return e}#lt(t){let e=this.#M.get(t);if(e!==void 0)return e??void 0;const n=this.#$;if(n!==void 0&&(t<n.startingLine||t>=n.startingLine+n.totalLines))return;const i=this.#h;if(i!==void 0){if(n!==void 0){const{startingLine:s}=n,{children:r}=i;for(let o=t-s;o<=r.length;o++){const a=r[o];if(a===void 0)break;const c=z(a),h=a.dataset.lineType;if(c!==void 0&&c===t+1&&h!==void 0&&tt(h)){e=a;break}}}return e??=i.querySelector(`[data-line="${t+1}"]`+(this.#kt==="unified"?':not([data-line-type="change-deletion"])':"")),e!==void 0&&this.#M.set(t,e),e??void 0}}#ot(){if(this.#N===void 0)return 0;if(this.#x===void 0){const t=this.#h?.parentElement?.style.getPropertyValue("--diffs-column-number-width");t!==void 0&&t.length>2&&t.endsWith("px")?this.#x=parseInt(t.slice(0,-2),10):this.#x=this.#N.offsetWidth}return this.#x}#Vt(){if(this.#h===void 0)return 0;if(this.#C===void 0){const t=this.#h.parentElement?.style.getPropertyValue("--diffs-column-content-width");t!==void 0&&t.length>2&&t.endsWith("px")?this.#C=parseFloat(t.slice(0,-2)):this.#C=this.#h.offsetWidth}return this.#C}#pt(t){const e=this.#y.get(t);if(e!==void 0)return e;const n=this.#lt(t);if(n===void 0)return-1;let i=n.offsetTop+this.#t.paddingTop;return i+=this.#ut?.top??0,this.#y.set(t,i),i}#vt(t,e){if(this.#m!==void 0&&this.#m[0]===t&&this.#m[1]===e)return[this.#m[2],this.#m[3]];const n=this.#s?.getLineText(t),i=this.#ot()+this.#t.ch;if(n===void 0||n.length===0||e<=0)return[i+(this.#ut?.left??0),0];const s=ts(n,Math.min(e,n.length)),r=n.slice(0,s),o=ht(r,this.#t.tabSize);let a=0,c=0;if(o!==-1?a=i+o*this.#t.ch:a=i+this.#t.measureTextWidth(r),this.#rt){const h=this.#Vt();if(2*this.#t.ch+this.#t.measureTextWidth(n)>h){const d=this.#ve(t);if(d==null)return[a+(this.#ut?.left??0),0];for(let l=0;l+1<d.length;l++){const f=d[l];if(s<=d[l+1]){c=l;const u=n.slice(f,s),v=ht(u,this.#t.tabSize);v!==-1?a=i+v*this.#t.ch:a=i+this.#t.measureTextWidth(u);break}}}a+=this.#ut?.left??0}return this.#m!==void 0?(this.#m[0]=t,this.#m[1]=e,this.#m[2]=a,this.#m[3]=c):this.#m=[t,e,a,c],[a,c]}#ve(t){const e=this.#g.get(t);if(e!==void 0)return e;this.#g.size>=os&&this.#g.clear();const n=this.#s?.getLineText(t);if(n===void 0||n.length===0){const c=new Uint32Array([0]);return this.#g.set(t,c),c}const i=this.#h;if(i==null||!i.isConnected)return;const s=y("div",{style:{position:"absolute",top:"0",left:"0",width:"100%",boxSizing:"border-box",visibility:"hidden",pointerEvents:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",font:"inherit",paddingInline:"1ch",tabSize:this.#t.tabSize.toString()},textContent:n},i),r=s.firstChild,o=document.createRange(),a=[];try{const c=s.getBoundingClientRect();if(c.width===0)return;const h=es(n),d=c.left+this.#t.ch,l=h===void 0?n.length:h.length-1,f=C=>h===void 0?C:h[C],u=C=>(o.setStart(r,f(C)),o.setEnd(r,f(C+1)),o.getBoundingClientRect());a.push(0);let v=u(0).top,g=1;for(;g<l;){let C=g,m=l;for(;C<m;){const w=C+m>>1;u(w).top>v?m=w:C=w+1}if(C>=l)break;const{left:x,top:L}=u(C),S=Qt()&&x-d>this.#t.ch/2;a.push(f(S?C-1:C)),v=L,g=C+1}const p=new Uint32Array(a.length+1);for(let C=0;C<a.length;C++)p[C]=a[C];return p[a.length]=n.length,this.#g.set(t,p),p}finally{s.remove()}}#$t(t){const e=this.#ve(t);if(e!==void 0)return e;const n=this.#s?.getLineText(t)?.length??0;return Uint32Array.of(0,n)}#Ke({startContainer:t,endContainer:e}){const n=this.#h;return n===void 0?!1:n.contains(t)&&n.contains(e)}#Ot(t){const e=this.#s?.lineCount??0;return t<0||t>=e?!1:this.#lt(t)!==void 0}};export{ps as Editor,Sn as TextDocument};
@@ -0,0 +1 @@
1
+ import{c as r}from"./mermaid-parser.core-ButbfTJL.js";import{I as a}from"./mermaid-parser.core-ButbfTJL.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";export{a as InfoModule,r as createInfoServices};
@@ -1,2 +1,2 @@
1
- import{_ as e,l as o,M as i,d as n}from"./mermaid.core-CfB36ohx.js";import{v as p}from"./mermaid-parser.core-D9Cspzql.js";import"./app-chat-kit-C-b6Y63T.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-BDO0KNsJ.js";import"./markdown-code-BTfpGmJj.js";var g={parse:e(async r=>{const a=await p("info",r);o.debug(a)},"parse")},m={version:"11.17.0"},v=e(()=>m.version,"getVersion"),d={getVersion:v},c=e((r,a,s)=>{o.debug(`rendering info diagram
1
+ import{_ as e,l as o,M as i,d as n}from"./mermaid.core-Den2NdAK.js";import{v as p}from"./mermaid-parser.core-ButbfTJL.js";import"./app-chat-kit-Ck66xmNL.js";import"solid-js";import"solid-js/store";import"solid-js/web";import"./markdown-leZ65Gnj.js";import"./markdown-code-CXhO_kB-.js";var g={parse:e(async r=>{const a=await p("info",r);o.debug(a)},"parse")},m={version:"11.17.0"},v=e(()=>m.version,"getVersion"),d={getVersion:v},c=e((r,a,s)=>{o.debug(`rendering info diagram
2
2
  `+r);const t=i(a);n(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${s}`)},"draw"),l={draw:c},D={parser:g,db:d,renderer:l};export{D as diagram};